diff --git a/.cspell/project_words.txt b/.cspell/project_words.txt index 748c746de..e850b886f 100644 --- a/.cspell/project_words.txt +++ b/.cspell/project_words.txt @@ -11,9 +11,11 @@ codegen Condvar dashmap davidmytton +dayjs deel elon encryptor +Exif Flac graps haden @@ -59,7 +61,9 @@ storedkey stringly thumbstrips tobiaslutke +tokio typecheck +uuid vdfs vijay zacharysmith diff --git a/.gitattributes b/.gitattributes index d16251ec2..619c2fe74 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ pnpm-lock.yaml -diff package-lock.json -diff +Cargo.lock -diff +.github/actions/publish-artifacts/dist/index.js -diff diff --git a/.github/actions/publish-artifacts/dist/index.js b/.github/actions/publish-artifacts/dist/index.js index 5d98c4114..6fc0560ac 100644 --- a/.github/actions/publish-artifacts/dist/index.js +++ b/.github/actions/publish-artifacts/dist/index.js @@ -1,4 +1,4 @@ -(()=>{var __webpack_modules__={44079:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__exportStar||function(r,i){for(var a in r)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a))s(i,r,a)};Object.defineProperty(i,"__esModule",{value:true});const c=a(48011);l(a(81112),i);l(a(75716),i);l(a(48011),i);const p=new c.DefaultArtifactClient;i["default"]=p},46574:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Timestamp=void 0;const s=a(98604);const l=a(98604);const c=a(98604);const p=a(98604);const d=a(98604);const u=a(98604);const A=a(98604);class Timestamp$Type extends A.MessageType{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const r=this.create();const i=Date.now();r.seconds=u.PbLong.from(Math.floor(i/1e3)).toString();r.nanos=i%1e3*1e6;return r}toDate(r){return new Date(u.PbLong.from(r.seconds).toNumber()*1e3+Math.ceil(r.nanos/1e6))}fromDate(r){const i=this.create();const a=r.getTime();i.seconds=u.PbLong.from(Math.floor(a/1e3)).toString();i.nanos=a%1e3*1e6;return i}internalJsonWrite(r,i){let a=u.PbLong.from(r.seconds).toNumber()*1e3;if(aDate.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(r.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let s="Z";if(r.nanos>0){let i=(r.nanos+1e9).toString().substring(1);if(i.substring(3)==="000000")s="."+i.substring(0,3)+"Z";else if(i.substring(6)==="000")s="."+i.substring(0,6)+"Z";else s="."+i+"Z"}return new Date(a).toISOString().replace(".000Z",s)}internalJsonRead(r,i,a){if(typeof r!=="string")throw new Error("Unable to parse Timestamp from JSON "+(0,d.typeofJsonValue)(r)+".");let s=r.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!s)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let l=Date.parse(s[1]+"-"+s[2]+"-"+s[3]+"T"+s[4]+":"+s[5]+":"+s[6]+(s[8]?s[8]:"Z"));if(Number.isNaN(l))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(lDate.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(!a)a=this.create();a.seconds=u.PbLong.from(l/1e3).toString();a.nanos=0;if(s[7])a.nanos=parseInt("1"+s[7]+"0".repeat(9-s[7].length))-1e9;return a}create(r){const i={seconds:"0",nanos:0};globalThis.Object.defineProperty(i,p.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,c.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,a,s){let c=s!==null&&s!==void 0?s:this.create(),p=r.pos+i;while(r.pos{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BytesValue=i.StringValue=i.BoolValue=i.UInt32Value=i.Int32Value=i.UInt64Value=i.Int64Value=i.FloatValue=i.DoubleValue=void 0;const s=a(98604);const l=a(98604);const c=a(98604);const p=a(98604);const d=a(98604);const u=a(98604);const A=a(98604);class DoubleValue$Type extends A.MessageType{constructor(){super("google.protobuf.DoubleValue",[{no:1,name:"value",kind:"scalar",T:1}])}internalJsonWrite(r,i){return this.refJsonWriter.scalar(2,r.value,"value",false,true)}internalJsonRead(r,i,a){if(!a)a=this.create();a.value=this.refJsonReader.scalar(r,1,undefined,"value");return a}create(r){const i={value:0};globalThis.Object.defineProperty(i,u.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,d.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,a,s){let l=s!==null&&s!==void 0?s:this.create(),c=r.pos+i;while(r.pos{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ArtifactService=i.DeleteArtifactResponse=i.DeleteArtifactRequest=i.GetSignedArtifactURLResponse=i.GetSignedArtifactURLRequest=i.ListArtifactsResponse_MonolithArtifact=i.ListArtifactsResponse=i.ListArtifactsRequest=i.FinalizeArtifactResponse=i.FinalizeArtifactRequest=i.CreateArtifactResponse=i.CreateArtifactRequest=void 0;const s=a(83006);const l=a(98604);const c=a(98604);const p=a(98604);const d=a(98604);const u=a(98604);const A=a(32967);const h=a(32967);const g=a(46574);class CreateArtifactRequest$Type extends u.MessageType{constructor(){super("github.actions.results.api.v1.CreateArtifactRequest",[{no:1,name:"workflow_run_backend_id",kind:"scalar",T:9},{no:2,name:"workflow_job_run_backend_id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"expires_at",kind:"message",T:()=>g.Timestamp},{no:5,name:"version",kind:"scalar",T:5}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:"",name:"",version:0};globalThis.Object.defineProperty(i,d.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,p.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,a,s){let l=s!==null&&s!==void 0?s:this.create(),p=r.pos+i;while(r.posh.StringValue}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:"",name:"",size:"0"};globalThis.Object.defineProperty(i,d.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,p.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,a,s){let l=s!==null&&s!==void 0?s:this.create(),p=r.pos+i;while(r.posh.StringValue},{no:4,name:"id_filter",kind:"message",T:()=>A.Int64Value}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:""};globalThis.Object.defineProperty(i,d.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,p.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,a,s){let l=s!==null&&s!==void 0?s:this.create(),p=r.pos+i;while(r.posi.ListArtifactsResponse_MonolithArtifact}])}create(r){const i={artifacts:[]};globalThis.Object.defineProperty(i,d.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,p.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,a,s,l){let p=l!==null&&l!==void 0?l:this.create(),d=r.pos+a;while(r.posg.Timestamp}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:"",databaseId:"0",name:"",size:"0"};globalThis.Object.defineProperty(i,d.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,p.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,a,s){let l=s!==null&&s!==void 0?s:this.create(),p=r.pos+i;while(r.posc.CreateArtifactResponse.fromJson(r,{ignoreUnknownFields:true})))}FinalizeArtifact(r){const i=c.FinalizeArtifactRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","FinalizeArtifact","application/json",i);return a.then((r=>c.FinalizeArtifactResponse.fromJson(r,{ignoreUnknownFields:true})))}ListArtifacts(r){const i=c.ListArtifactsRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","ListArtifacts","application/json",i);return a.then((r=>c.ListArtifactsResponse.fromJson(r,{ignoreUnknownFields:true})))}GetSignedArtifactURL(r){const i=c.GetSignedArtifactURLRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","GetSignedArtifactURL","application/json",i);return a.then((r=>c.GetSignedArtifactURLResponse.fromJson(r,{ignoreUnknownFields:true})))}DeleteArtifact(r){const i=c.DeleteArtifactRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","DeleteArtifact","application/json",i);return a.then((r=>c.DeleteArtifactResponse.fromJson(r,{ignoreUnknownFields:true})))}}i.ArtifactServiceClientJSON=ArtifactServiceClientJSON;class ArtifactServiceClientProtobuf{constructor(r){this.rpc=r;this.CreateArtifact.bind(this);this.FinalizeArtifact.bind(this);this.ListArtifacts.bind(this);this.GetSignedArtifactURL.bind(this);this.DeleteArtifact.bind(this)}CreateArtifact(r){const i=c.CreateArtifactRequest.toBinary(r);const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","CreateArtifact","application/protobuf",i);return a.then((r=>c.CreateArtifactResponse.fromBinary(r)))}FinalizeArtifact(r){const i=c.FinalizeArtifactRequest.toBinary(r);const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","FinalizeArtifact","application/protobuf",i);return a.then((r=>c.FinalizeArtifactResponse.fromBinary(r)))}ListArtifacts(r){const i=c.ListArtifactsRequest.toBinary(r);const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","ListArtifacts","application/protobuf",i);return a.then((r=>c.ListArtifactsResponse.fromBinary(r)))}GetSignedArtifactURL(r){const i=c.GetSignedArtifactURLRequest.toBinary(r);const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","GetSignedArtifactURL","application/protobuf",i);return a.then((r=>c.GetSignedArtifactURLResponse.fromBinary(r)))}DeleteArtifact(r){const i=c.DeleteArtifactRequest.toBinary(r);const a=this.rpc.request("github.actions.results.api.v1.ArtifactService","DeleteArtifact","application/protobuf",i);return a.then((r=>c.DeleteArtifactResponse.fromBinary(r)))}}i.ArtifactServiceClientProtobuf=ArtifactServiceClientProtobuf;var p;(function(r){r["CreateArtifact"]="CreateArtifact";r["FinalizeArtifact"]="FinalizeArtifact";r["ListArtifacts"]="ListArtifacts";r["GetSignedArtifactURL"]="GetSignedArtifactURL";r["DeleteArtifact"]="DeleteArtifact"})(p||(i.ArtifactServiceMethod=p={}));i.ArtifactServiceMethodList=[p.CreateArtifact,p.FinalizeArtifact,p.ListArtifacts,p.GetSignedArtifactURL,p.DeleteArtifact];function createArtifactServiceServer(r){return new l.TwirpServer({service:r,packageName:"github.actions.results.api.v1",serviceName:"ArtifactService",methodList:i.ArtifactServiceMethodList,matchRoute:matchArtifactServiceRoute})}i.createArtifactServiceServer=createArtifactServiceServer;function matchArtifactServiceRoute(r,i){switch(r){case"CreateArtifact":return(r,a,l,c)=>s(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"CreateArtifact"});yield i.onMatch(r);return handleArtifactServiceCreateArtifactRequest(r,a,l,c)}));case"FinalizeArtifact":return(r,a,l,c)=>s(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"FinalizeArtifact"});yield i.onMatch(r);return handleArtifactServiceFinalizeArtifactRequest(r,a,l,c)}));case"ListArtifacts":return(r,a,l,c)=>s(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"ListArtifacts"});yield i.onMatch(r);return handleArtifactServiceListArtifactsRequest(r,a,l,c)}));case"GetSignedArtifactURL":return(r,a,l,c)=>s(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"GetSignedArtifactURL"});yield i.onMatch(r);return handleArtifactServiceGetSignedArtifactURLRequest(r,a,l,c)}));case"DeleteArtifact":return(r,a,l,c)=>s(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"DeleteArtifact"});yield i.onMatch(r);return handleArtifactServiceDeleteArtifactRequest(r,a,l,c)}));default:i.onNotFound();const r=`no handler found`;throw new l.TwirpError(l.TwirpErrorCode.BadRoute,r)}}function handleArtifactServiceCreateArtifactRequest(r,i,a,s){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceCreateArtifactJSON(r,i,a,s);case l.TwirpContentType.Protobuf:return handleArtifactServiceCreateArtifactProtobuf(r,i,a,s);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceFinalizeArtifactRequest(r,i,a,s){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceFinalizeArtifactJSON(r,i,a,s);case l.TwirpContentType.Protobuf:return handleArtifactServiceFinalizeArtifactProtobuf(r,i,a,s);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceListArtifactsRequest(r,i,a,s){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceListArtifactsJSON(r,i,a,s);case l.TwirpContentType.Protobuf:return handleArtifactServiceListArtifactsProtobuf(r,i,a,s);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceGetSignedArtifactURLRequest(r,i,a,s){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceGetSignedArtifactURLJSON(r,i,a,s);case l.TwirpContentType.Protobuf:return handleArtifactServiceGetSignedArtifactURLProtobuf(r,i,a,s);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceDeleteArtifactRequest(r,i,a,s){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceDeleteArtifactJSON(r,i,a,s);case l.TwirpContentType.Protobuf:return handleArtifactServiceDeleteArtifactProtobuf(r,i,a,s);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceCreateArtifactJSON(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{const r=JSON.parse(a.toString()||"{}");s=c.CreateArtifactRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.CreateArtifact(r,a)))}else{d=yield i.CreateArtifact(r,s)}return JSON.stringify(c.CreateArtifactResponse.toJson(d,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceFinalizeArtifactJSON(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{const r=JSON.parse(a.toString()||"{}");s=c.FinalizeArtifactRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.FinalizeArtifact(r,a)))}else{d=yield i.FinalizeArtifact(r,s)}return JSON.stringify(c.FinalizeArtifactResponse.toJson(d,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceListArtifactsJSON(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{const r=JSON.parse(a.toString()||"{}");s=c.ListArtifactsRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.ListArtifacts(r,a)))}else{d=yield i.ListArtifacts(r,s)}return JSON.stringify(c.ListArtifactsResponse.toJson(d,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceGetSignedArtifactURLJSON(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{const r=JSON.parse(a.toString()||"{}");s=c.GetSignedArtifactURLRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.GetSignedArtifactURL(r,a)))}else{d=yield i.GetSignedArtifactURL(r,s)}return JSON.stringify(c.GetSignedArtifactURLResponse.toJson(d,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceDeleteArtifactJSON(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{const r=JSON.parse(a.toString()||"{}");s=c.DeleteArtifactRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.DeleteArtifact(r,a)))}else{d=yield i.DeleteArtifact(r,s)}return JSON.stringify(c.DeleteArtifactResponse.toJson(d,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceCreateArtifactProtobuf(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{s=c.CreateArtifactRequest.fromBinary(a)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.CreateArtifact(r,a)))}else{d=yield i.CreateArtifact(r,s)}return Buffer.from(c.CreateArtifactResponse.toBinary(d))}))}function handleArtifactServiceFinalizeArtifactProtobuf(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{s=c.FinalizeArtifactRequest.fromBinary(a)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.FinalizeArtifact(r,a)))}else{d=yield i.FinalizeArtifact(r,s)}return Buffer.from(c.FinalizeArtifactResponse.toBinary(d))}))}function handleArtifactServiceListArtifactsProtobuf(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{s=c.ListArtifactsRequest.fromBinary(a)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.ListArtifacts(r,a)))}else{d=yield i.ListArtifacts(r,s)}return Buffer.from(c.ListArtifactsResponse.toBinary(d))}))}function handleArtifactServiceGetSignedArtifactURLProtobuf(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{s=c.GetSignedArtifactURLRequest.fromBinary(a)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.GetSignedArtifactURL(r,a)))}else{d=yield i.GetSignedArtifactURL(r,s)}return Buffer.from(c.GetSignedArtifactURLResponse.toBinary(d))}))}function handleArtifactServiceDeleteArtifactProtobuf(r,i,a,p){return s(this,void 0,void 0,(function*(){let s;let d;try{s=c.DeleteArtifactRequest.fromBinary(a)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(p&&p.length>0){const a=(0,l.chainInterceptors)(...p);d=yield a(r,s,((r,a)=>i.DeleteArtifact(r,a)))}else{d=yield i.DeleteArtifact(r,s)}return Buffer.from(c.DeleteArtifactResponse.toBinary(d))}))}},48011:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};var l=this&&this.__rest||function(r,i){var a={};for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&i.indexOf(s)<0)a[s]=r[s];if(r!=null&&typeof Object.getOwnPropertySymbols==="function")for(var l=0,s=Object.getOwnPropertySymbols(r);l1){d=p.artifacts.sort(((r,i)=>Number(i.databaseId)-Number(r.databaseId)))[0];(0,l.debug)(`More than one artifact found for a single name, returning newest (id: ${d.databaseId})`)}const u={workflowRunBackendId:d.workflowRunBackendId,workflowJobRunBackendId:d.workflowJobRunBackendId,name:d.name};const A=yield i.DeleteArtifact(u);(0,l.info)(`Artifact '${r}' (ID: ${A.artifactId}) deleted`);return{id:Number(A.artifactId)}}))}i.deleteArtifactInternal=deleteArtifactInternal},21452:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};var d=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.downloadArtifactInternal=i.downloadArtifactPublic=i.streamExtractExternal=void 0;const u=d(a(73292));const A=c(a(12781));const h=a(57147);const g=c(a(71017));const y=c(a(70707));const E=c(a(92481));const b=c(a(42712));const C=d(a(89477));const v=a(60206);const B=a(69332);const I=a(36543);const w=a(68319);const S=a(60175);const Q=a(75716);const scrubQueryParameters=r=>{const i=new URL(r);i.search="";return i.toString()};function exists(r){return p(this,void 0,void 0,(function*(){try{yield u.default.access(r);return true}catch(r){if(r.code==="ENOENT"){return false}else{throw r}}}))}function streamExtract(r,i){return p(this,void 0,void 0,(function*(){let a=0;while(a<5){try{yield streamExtractExternal(r,i);return}catch(r){if(r.message.includes("Malformed extraction path")){throw new Error(`Artifact download failed with unretryable error: ${r.message}`)}a++;E.debug(`Failed to download artifact after ${a} retries due to ${r.message}. Retrying in 5 seconds...`);yield new Promise((r=>setTimeout(r,5e3)))}}throw new Error(`Artifact download failed after ${a} retries.`)}))}function streamExtractExternal(r,i){return p(this,void 0,void 0,(function*(){const a=new b.HttpClient((0,v.getUserAgentString)());const s=yield a.get(r);if(s.message.statusCode!==200){throw new Error(`Unexpected HTTP response from blob storage: ${s.message.statusCode} ${s.message.statusMessage}`)}const l=30*1e3;return new Promise(((r,a)=>{const timerFn=()=>{s.message.destroy(new Error(`Blob storage chunk did not respond in ${l}ms`))};const c=setTimeout(timerFn,l);const d=new Set;d.add(i);s.message.on("data",(()=>{c.refresh()})).on("error",(r=>{E.debug(`response.message: Artifact download failed: ${r.message}`);clearTimeout(c);a(r)})).pipe(C.default.Parse()).pipe(new A.Transform({objectMode:true,transform:(r,s,l)=>p(this,void 0,void 0,(function*(){const s=g.normalize(g.join(i,r.path));if(!i.endsWith(g.sep)){i+=g.sep}if(!s.startsWith(i)){a(new Error(`Malformed extraction path: ${s}`))}E.debug(`Extracting artifact entry: ${s}`);if(r.type==="Directory"){if(!d.has(s)){d.add(s);yield resolveOrCreateDirectory(s).then((()=>{r.autodrain();l()}))}else{r.autodrain();l()}}else{if(!d.has(g.dirname(s))){d.add(g.dirname(s));yield resolveOrCreateDirectory(g.dirname(s))}const i=(0,h.createWriteStream)(s);i.on("finish",l);i.on("error",a);r.pipe(i)}}))})).on("finish",(()=>p(this,void 0,void 0,(function*(){clearTimeout(c);r()})))).on("error",(r=>{a(r)}))}))}))}i.streamExtractExternal=streamExtractExternal;function downloadArtifactPublic(r,i,a,s,l){return p(this,void 0,void 0,(function*(){const c=yield resolveOrCreateDirectory(l===null||l===void 0?void 0:l.path);const p=y.getOctokit(s);E.info(`Downloading artifact '${r}' from '${i}/${a}'`);const{headers:d,status:u}=yield p.rest.actions.downloadArtifact({owner:i,repo:a,artifact_id:r,archive_format:"zip",request:{redirect:"manual"}});if(u!==302){throw new Error(`Unable to download artifact. Unexpected status: ${u}`)}const{location:A}=d;if(!A){throw new Error(`Unable to redirect to artifact download url`)}E.info(`Redirecting to blob download url: ${scrubQueryParameters(A)}`);try{E.info(`Starting download of artifact to: ${c}`);yield streamExtract(A,c);E.info(`Artifact download completed successfully.`)}catch(r){throw new Error(`Unable to download and extract artifact: ${r.message}`)}return{downloadPath:c}}))}i.downloadArtifactPublic=downloadArtifactPublic;function downloadArtifactInternal(r,i){return p(this,void 0,void 0,(function*(){const a=yield resolveOrCreateDirectory(i===null||i===void 0?void 0:i.path);const s=(0,I.internalArtifactTwirpClient)();const{workflowRunBackendId:l,workflowJobRunBackendId:c}=(0,S.getBackendIdsFromToken)();const p={workflowRunBackendId:l,workflowJobRunBackendId:c,idFilter:w.Int64Value.create({value:r.toString()})};const{artifacts:d}=yield s.ListArtifacts(p);if(d.length===0){throw new Q.ArtifactNotFoundError(`No artifacts found for ID: ${r}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`)}if(d.length>1){E.warning("Multiple artifacts found, defaulting to first.")}const u={workflowRunBackendId:d[0].workflowRunBackendId,workflowJobRunBackendId:d[0].workflowJobRunBackendId,name:d[0].name};const{signedUrl:A}=yield s.GetSignedArtifactURL(u);E.info(`Redirecting to blob download url: ${scrubQueryParameters(A)}`);try{E.info(`Starting download of artifact to: ${a}`);yield streamExtract(A,a);E.info(`Artifact download completed successfully.`)}catch(r){throw new Error(`Unable to download and extract artifact: ${r.message}`)}return{downloadPath:a}}))}i.downloadArtifactInternal=downloadArtifactInternal;function resolveOrCreateDirectory(r=(0,B.getGitHubWorkspaceDir)()){return p(this,void 0,void 0,(function*(){if(!(yield exists(r))){E.debug(`Artifact destination folder does not exist, creating: ${r}`);yield u.default.mkdir(r,{recursive:true})}else{E.debug(`Artifact destination folder already exists: ${r}`)}return r}))}},19043:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.getArtifactInternal=i.getArtifactPublic=void 0;const d=a(70707);const u=a(32243);const A=c(a(92481));const h=a(95628);const g=a(16412);const y=a(61117);const E=a(60175);const b=a(60206);const C=a(36543);const v=a(68319);const B=a(75716);function getArtifactPublic(r,i,a,s,l){var c;return p(this,void 0,void 0,(function*(){const[p,E]=(0,g.getRetryOptions)(h.defaults);const C={log:undefined,userAgent:(0,b.getUserAgentString)(),previews:undefined,retry:p,request:E};const v=(0,d.getOctokit)(l,C,u.retry,y.requestLog);const I=yield v.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}",{owner:a,repo:s,run_id:i,name:r});if(I.status!==200){throw new B.InvalidResponseError(`Invalid response from GitHub API: ${I.status} (${(c=I===null||I===void 0?void 0:I.headers)===null||c===void 0?void 0:c["x-github-request-id"]})`)}if(I.data.artifacts.length===0){throw new B.ArtifactNotFoundError(`Artifact not found for name: ${r}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let w=I.data.artifacts[0];if(I.data.artifacts.length>1){w=I.data.artifacts.sort(((r,i)=>i.id-r.id))[0];A.debug(`More than one artifact found for a single name, returning newest (id: ${w.id})`)}return{artifact:{name:w.name,id:w.id,size:w.size_in_bytes,createdAt:w.created_at?new Date(w.created_at):undefined}}}))}i.getArtifactPublic=getArtifactPublic;function getArtifactInternal(r){return p(this,void 0,void 0,(function*(){const i=(0,C.internalArtifactTwirpClient)();const{workflowRunBackendId:a,workflowJobRunBackendId:s}=(0,E.getBackendIdsFromToken)();const l={workflowRunBackendId:a,workflowJobRunBackendId:s,nameFilter:v.StringValue.create({value:r})};const c=yield i.ListArtifacts(l);if(c.artifacts.length===0){throw new B.ArtifactNotFoundError(`Artifact not found for name: ${r}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let p=c.artifacts[0];if(c.artifacts.length>1){p=c.artifacts.sort(((r,i)=>Number(i.databaseId)-Number(r.databaseId)))[0];A.debug(`More than one artifact found for a single name, returning newest (id: ${p.databaseId})`)}return{artifact:{name:p.name,id:Number(p.databaseId),size:Number(p.size),createdAt:p.createdAt?v.Timestamp.toDate(p.createdAt):undefined}}}))}i.getArtifactInternal=getArtifactInternal},79081:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.listArtifactsInternal=i.listArtifactsPublic=void 0;const l=a(92481);const c=a(70707);const p=a(60206);const d=a(16412);const u=a(95628);const A=a(61117);const h=a(32243);const g=a(36543);const y=a(60175);const E=a(68319);const b=1e3;const C=100;const v=b/C;function listArtifactsPublic(r,i,a,g,y=false){return s(this,void 0,void 0,(function*(){(0,l.info)(`Fetching artifact list for workflow run ${r} in repository ${i}/${a}`);let s=[];const[E,B]=(0,d.getRetryOptions)(u.defaults);const I={log:undefined,userAgent:(0,p.getUserAgentString)(),previews:undefined,retry:E,request:B};const w=(0,c.getOctokit)(g,I,h.retry,A.requestLog);let S=1;const{data:Q}=yield w.rest.actions.listWorkflowRunArtifacts({owner:i,repo:a,run_id:r,per_page:C,page:S});let x=Math.ceil(Q.total_count/C);const N=Q.total_count;if(N>b){(0,l.warning)(`Workflow run ${r} has more than 1000 artifacts. Results will be incomplete as only the first ${b} artifacts will be returned`);x=v}for(const r of Q.artifacts){s.push({name:r.name,id:r.id,size:r.size_in_bytes,createdAt:r.created_at?new Date(r.created_at):undefined})}for(S;S({name:r.name,id:Number(r.databaseId),size:Number(r.size),createdAt:r.createdAt?E.Timestamp.toDate(r.createdAt):undefined})));if(r){d=filterLatest(d)}(0,l.info)(`Found ${d.length} artifact(s)`);return{artifacts:d}}))}i.listArtifactsInternal=listArtifactsInternal;function filterLatest(r){r.sort(((r,i)=>i.id-r.id));const i=[];const a=new Set;for(const s of r){if(!a.has(s.name)){i.push(s);a.add(s.name)}}return i}},16412:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getRetryOptions=void 0;const p=c(a(92481));const d=5;const u=[400,401,403,404,422];function getRetryOptions(r,i=d,a=u){var s;if(i<=0){return[{enabled:false},r.request]}const l={enabled:true};if(a.length>0){l.doNotRetry=a}const c=Object.assign(Object.assign({},r.request),{retries:i});p.debug(`GitHub client configured with: (retries: ${c.retries}, retry-exempt-status-code: ${(s=l.doNotRetry)!==null&&s!==void 0?s:"octokit default: [400, 401, 403, 404, 422]"})`);return[l,c]}i.getRetryOptions=getRetryOptions},36543:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.internalArtifactTwirpClient=void 0;const l=a(42712);const c=a(84659);const p=a(92481);const d=a(68319);const u=a(69332);const A=a(60206);const h=a(75716);class ArtifactHttpClient{constructor(r,i,a,s){this.maxAttempts=5;this.baseRetryIntervalMilliseconds=3e3;this.retryMultiplier=1.5;const p=(0,u.getRuntimeToken)();this.baseUrl=(0,u.getResultsServiceUrl)();if(i){this.maxAttempts=i}if(a){this.baseRetryIntervalMilliseconds=a}if(s){this.retryMultiplier=s}this.httpClient=new l.HttpClient(r,[new c.BearerCredentialHandler(p)])}request(r,i,a,l){return s(this,void 0,void 0,(function*(){const c=new URL(`/twirp/${r}/${i}`,this.baseUrl).href;(0,p.debug)(`[Request] ${i} ${c}`);const d={"Content-Type":a};try{const{body:r}=yield this.retryableRequest((()=>s(this,void 0,void 0,(function*(){return this.httpClient.post(c,JSON.stringify(l),d)}))));return r}catch(r){throw new Error(`Failed to ${i}: ${r.message}`)}}))}retryableRequest(r){return s(this,void 0,void 0,(function*(){let i=0;let a="";let s="";while(i=200&&r<300}isRetryableHttpStatusCode(r){if(!r)return false;const i=[l.HttpCodes.BadGateway,l.HttpCodes.GatewayTimeout,l.HttpCodes.InternalServerError,l.HttpCodes.ServiceUnavailable,l.HttpCodes.TooManyRequests];return i.includes(r)}sleep(r){return s(this,void 0,void 0,(function*(){return new Promise((i=>setTimeout(i,r)))}))}getExponentialRetryTimeMilliseconds(r){if(r<0){throw new Error("attempt should be a positive integer")}if(r===0){return this.baseRetryIntervalMilliseconds}const i=this.baseRetryIntervalMilliseconds*Math.pow(this.retryMultiplier,r);const a=i*this.retryMultiplier;return Math.trunc(Math.random()*(a-i)+i)}}function internalArtifactTwirpClient(r){const i=new ArtifactHttpClient((0,A.getUserAgentString)(),r===null||r===void 0?void 0:r.maxAttempts,r===null||r===void 0?void 0:r.retryIntervalMs,r===null||r===void 0?void 0:r.retryMultiplier);return new d.ArtifactServiceClientJSON(i)}i.internalArtifactTwirpClient=internalArtifactTwirpClient},69332:function(r,i,a){"use strict";var s=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getConcurrency=i.getGitHubWorkspaceDir=i.isGhes=i.getResultsServiceUrl=i.getRuntimeToken=i.getUploadChunkSize=void 0;const l=s(a(22037));function getUploadChunkSize(){return 8*1024*1024}i.getUploadChunkSize=getUploadChunkSize;function getRuntimeToken(){const r=process.env["ACTIONS_RUNTIME_TOKEN"];if(!r){throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable")}return r}i.getRuntimeToken=getRuntimeToken;function getResultsServiceUrl(){const r=process.env["ACTIONS_RESULTS_URL"];if(!r){throw new Error("Unable to get the ACTIONS_RESULTS_URL env variable")}return new URL(r).origin}i.getResultsServiceUrl=getResultsServiceUrl;function isGhes(){const r=new URL(process.env["GITHUB_SERVER_URL"]||"https://github.com");const i=r.hostname.trimEnd().toUpperCase();const a=i==="GITHUB.COM";const s=i.endsWith(".GHE.COM")||i.endsWith(".GHE.LOCALHOST");return!a&&!s}i.isGhes=isGhes;function getGitHubWorkspaceDir(){const r=process.env["GITHUB_WORKSPACE"];if(!r){throw new Error("Unable to get the GITHUB_WORKSPACE env variable")}return r}i.getGitHubWorkspaceDir=getGitHubWorkspaceDir;function getConcurrency(){const r=l.default.cpus().length;if(r<=4){return 32}const i=16*r;return i>300?300:i}i.getConcurrency=getConcurrency},75716:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.UsageError=i.NetworkError=i.GHESNotSupportedError=i.ArtifactNotFoundError=i.InvalidResponseError=i.FilesNotFoundError=void 0;class FilesNotFoundError extends Error{constructor(r=[]){let i="No files were found to upload";if(r.length>0){i+=`: ${r.join(", ")}`}super(i);this.files=r;this.name="FilesNotFoundError"}}i.FilesNotFoundError=FilesNotFoundError;class InvalidResponseError extends Error{constructor(r){super(r);this.name="InvalidResponseError"}}i.InvalidResponseError=InvalidResponseError;class ArtifactNotFoundError extends Error{constructor(r="Artifact not found"){super(r);this.name="ArtifactNotFoundError"}}i.ArtifactNotFoundError=ArtifactNotFoundError;class GHESNotSupportedError extends Error{constructor(r="@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES."){super(r);this.name="GHESNotSupportedError"}}i.GHESNotSupportedError=GHESNotSupportedError;class NetworkError extends Error{constructor(r){const i=`Unable to make request: ${r}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(i);this.code=r;this.name="NetworkError"}}i.NetworkError=NetworkError;NetworkError.isNetworkErrorCode=r=>{if(!r)return false;return["ECONNRESET","ENOTFOUND","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH"].includes(r)};class UsageError extends Error{constructor(){const r=`Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`;super(r);this.name="UsageError"}}i.UsageError=UsageError;UsageError.isUsageErrorMessage=r=>{if(!r)return false;return r.includes("insufficient usage")}},81112:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true})},60206:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getUserAgentString=void 0;const s=a(85024);function getUserAgentString(){return`@actions/artifact-${s.version}`}i.getUserAgentString=getUserAgentString},60175:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getBackendIdsFromToken=void 0;const d=c(a(92481));const u=a(69332);const A=p(a(68829));const h=new Error("Failed to get backend IDs: The provided JWT token is invalid and/or missing claims");function getBackendIdsFromToken(){const r=(0,u.getRuntimeToken)();const i=(0,A.default)(r);if(!i.scp){throw h}const a=i.scp.split(" ");if(a.length===0){throw h}for(const r of a){const i=r.split(":");if((i===null||i===void 0?void 0:i[0])!=="Actions.Results"){continue}if(i.length!==3){throw h}const a={workflowRunBackendId:i[1],workflowJobRunBackendId:i[2]};d.debug(`Workflow Run Backend ID: ${a.workflowRunBackendId}`);d.debug(`Workflow Job Run Backend ID: ${a.workflowJobRunBackendId}`);return a}throw h}i.getBackendIdsFromToken=getBackendIdsFromToken},44703:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.uploadZipToBlobStorage=void 0;const d=a(12990);const u=a(69332);const A=c(a(92481));const h=c(a(6113));const g=c(a(12781));const y=a(75716);function uploadZipToBlobStorage(r,i){return p(this,void 0,void 0,(function*(){let a=0;const s=(0,u.getConcurrency)();const l=(0,u.getUploadChunkSize)();const c=new d.BlobClient(r);const p=c.getBlockBlobClient();A.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${s}, bufferSize: ${l}`);const uploadCallback=r=>{A.info(`Uploaded bytes ${r.loadedBytes}`);a=r.loadedBytes};const E={blobHTTPHeaders:{blobContentType:"zip"},onProgress:uploadCallback};let b=undefined;const C=new g.PassThrough;const v=h.createHash("sha256");i.pipe(C);i.pipe(v).setEncoding("hex");A.info("Beginning upload of artifact content to blob storage");try{yield p.uploadStream(C,l,s,E)}catch(r){if(y.NetworkError.isNetworkErrorCode(r===null||r===void 0?void 0:r.code)){throw new y.NetworkError(r===null||r===void 0?void 0:r.code)}throw r}A.info("Finished uploading artifact content to blob storage!");v.end();b=v.read();A.info(`SHA256 hash of uploaded artifact zip is ${b}`);if(a===0){A.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`)}return{uploadSize:a,sha256Hash:b}}))}i.uploadZipToBlobStorage=uploadZipToBlobStorage},81664:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.validateFilePath=i.validateArtifactName=void 0;const s=a(92481);const l=new Map([['"',' Double quote "'],[":"," Colon :"],["<"," Less than <"],[">"," Greater than >"],["|"," Vertical bar |"],["*"," Asterisk *"],["?"," Question mark ?"],["\r"," Carriage return \\r"],["\n"," Line feed \\n"]]);const c=new Map([...l,["\\"," Backslash \\"],["/"," Forward slash /"]]);function validateArtifactName(r){if(!r){throw new Error(`Provided artifact name input during validation is empty`)}for(const[i,a]of c){if(r.includes(i)){throw new Error(`The artifact name is not valid: ${r}. Contains the following character: ${a}\n \nInvalid characters include: ${Array.from(c.values()).toString()}\n \nThese characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`)}}(0,s.info)(`Artifact name is valid!`)}i.validateArtifactName=validateArtifactName;function validateFilePath(r){if(!r){throw new Error(`Provided file path input during validation is empty`)}for(const[i,a]of l){if(r.includes(i)){throw new Error(`The path for one of the files in artifact is not valid: ${r}. Contains the following character: ${a}\n \nInvalid characters include: ${Array.from(l.values()).toString()}\n \nThe following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.\n `)}}}i.validateFilePath=validateFilePath},30183:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getExpiration=void 0;const p=a(68319);const d=c(a(92481));function getExpiration(r){if(!r){return undefined}const i=getRetentionDays();if(i&&ir.sourcePath?[r.sourcePath]:[])))}const c=(0,y.getBackendIdsFromToken)();const p=(0,h.internalArtifactTwirpClient)();const B={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:r,version:4};const I=(0,u.getExpiration)(s===null||s===void 0?void 0:s.retentionDays);if(I){B.expiresAt=I}const w=yield p.CreateArtifact(B);if(!w.ok){throw new v.InvalidResponseError("CreateArtifact: response from backend was not ok")}const S=yield(0,b.createZipUploadStream)(l,s===null||s===void 0?void 0:s.compressionLevel);const Q=yield(0,E.uploadZipToBlobStorage)(w.signedUploadUrl,S);const x={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:r,size:Q.uploadSize?Q.uploadSize.toString():"0"};if(Q.sha256Hash){x.hash=C.StringValue.create({value:`sha256:${Q.sha256Hash}`})}d.info(`Finalizing artifact upload`);const N=yield p.FinalizeArtifact(x);if(!N.ok){throw new v.InvalidResponseError("FinalizeArtifact: response from backend was not ok")}const R=BigInt(N.artifactId);d.info(`Artifact ${r}.zip successfully finalized. Artifact ID ${R}`);return{size:Q.uploadSize,id:Number(R)}}))}i.uploadArtifact=uploadArtifact},52052:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getUploadZipSpecification=i.validateRootDirectory=void 0;const p=c(a(57147));const d=a(92481);const u=a(71017);const A=a(81664);function validateRootDirectory(r){if(!p.existsSync(r)){throw new Error(`The provided rootDirectory ${r} does not exist`)}if(!p.statSync(r).isDirectory()){throw new Error(`The provided rootDirectory ${r} is not a valid directory`)}(0,d.info)(`Root directory input is valid!`)}i.validateRootDirectory=validateRootDirectory;function getUploadZipSpecification(r,i){const a=[];i=(0,u.normalize)(i);i=(0,u.resolve)(i);for(let s of r){if(!p.existsSync(s)){throw new Error(`File ${s} does not exist`)}if(!p.statSync(s).isDirectory()){s=(0,u.normalize)(s);s=(0,u.resolve)(s);if(!s.startsWith(i)){throw new Error(`The rootDirectory: ${i} is not a parent directory of the file: ${s}`)}const r=s.replace(i,"");(0,A.validateFilePath)(r);a.push({sourcePath:s,destinationPath:r})}else{const r=s.replace(i,"");(0,A.validateFilePath)(r);a.push({sourcePath:null,destinationPath:r})}}return a}i.getUploadZipSpecification=getUploadZipSpecification},65952:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.createZipUploadStream=i.ZipUploadStream=i.DEFAULT_COMPRESSION_LEVEL=void 0;const d=c(a(12781));const u=c(a(15387));const A=c(a(92481));const h=a(57147);const g=a(69332);i.DEFAULT_COMPRESSION_LEVEL=6;class ZipUploadStream extends d.Transform{constructor(r){super({highWaterMark:r})}_transform(r,i,a){a(null,r)}}i.ZipUploadStream=ZipUploadStream;function createZipUploadStream(r,a=i.DEFAULT_COMPRESSION_LEVEL){return p(this,void 0,void 0,(function*(){A.debug(`Creating Artifact archive with compressionLevel: ${a}`);const i=u.create("zip",{highWaterMark:(0,g.getUploadChunkSize)(),zlib:{level:a}});i.on("error",zipErrorCallback);i.on("warning",zipWarningCallback);i.on("finish",zipFinishCallback);i.on("end",zipEndCallback);for(const a of r){if(a.sourcePath!==null){i.append((0,h.createReadStream)(a.sourcePath),{name:a.destinationPath})}else{i.append("",{name:a.destinationPath})}}const s=(0,g.getUploadChunkSize)();const l=new ZipUploadStream(s);A.debug(`Zip write high watermark value ${l.writableHighWaterMark}`);A.debug(`Zip read high watermark value ${l.readableHighWaterMark}`);i.pipe(l);i.finalize();return l}))}i.createZipUploadStream=createZipUploadStream;const zipErrorCallback=r=>{A.error("An error has occurred while creating the zip file for upload");A.info(r);throw new Error("An error has occurred during zip creation for the artifact")};const zipWarningCallback=r=>{if(r.code==="ENOENT"){A.warning("ENOENT warning during artifact zip creation. No such file or directory");A.info(r)}else{A.warning(`A non-blocking warning has occurred during artifact zip creation: ${r.code}`);A.info(r)}};const zipFinishCallback=()=>{A.debug("Zip stream for upload has finished.")};const zipEndCallback=()=>{A.debug("Zip stream for upload has ended.")}},46062:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.issue=i.issueCommand=void 0;const p=c(a(22037));const d=a(34309);function issueCommand(r,i,a){const s=new Command(r,i,a);process.stdout.write(s.toString()+p.EOL)}i.issueCommand=issueCommand;function issue(r,i=""){issueCommand(r,{},i)}i.issue=issue;const u="::";class Command{constructor(r,i,a){if(!r){r="missing.command"}this.command=r;this.properties=i;this.message=a}toString(){let r=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){r+=" ";let i=true;for(const a in this.properties){if(this.properties.hasOwnProperty(a)){const s=this.properties[a];if(s){if(i){i=false}else{r+=","}r+=`${a}=${escapeProperty(s)}`}}}}r+=`${u}${escapeData(this.message)}`;return r}}function escapeData(r){return d.toCommandValue(r).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(r){return d.toCommandValue(r).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},92481:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.getIDToken=i.getState=i.saveState=i.group=i.endGroup=i.startGroup=i.info=i.notice=i.warning=i.error=i.debug=i.isDebug=i.setFailed=i.setCommandEcho=i.setOutput=i.getBooleanInput=i.getMultilineInput=i.getInput=i.addPath=i.setSecret=i.exportVariable=i.ExitCode=void 0;const d=a(46062);const u=a(44720);const A=a(34309);const h=c(a(22037));const g=c(a(71017));const y=a(57045);var E;(function(r){r[r["Success"]=0]="Success";r[r["Failure"]=1]="Failure"})(E=i.ExitCode||(i.ExitCode={}));function exportVariable(r,i){const a=A.toCommandValue(i);process.env[r]=a;const s=process.env["GITHUB_ENV"]||"";if(s){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(r,i))}d.issueCommand("set-env",{name:r},a)}i.exportVariable=exportVariable;function setSecret(r){d.issueCommand("add-mask",{},r)}i.setSecret=setSecret;function addPath(r){const i=process.env["GITHUB_PATH"]||"";if(i){u.issueFileCommand("PATH",r)}else{d.issueCommand("add-path",{},r)}process.env["PATH"]=`${r}${g.delimiter}${process.env["PATH"]}`}i.addPath=addPath;function getInput(r,i){const a=process.env[`INPUT_${r.replace(/ /g,"_").toUpperCase()}`]||"";if(i&&i.required&&!a){throw new Error(`Input required and not supplied: ${r}`)}if(i&&i.trimWhitespace===false){return a}return a.trim()}i.getInput=getInput;function getMultilineInput(r,i){const a=getInput(r,i).split("\n").filter((r=>r!==""));if(i&&i.trimWhitespace===false){return a}return a.map((r=>r.trim()))}i.getMultilineInput=getMultilineInput;function getBooleanInput(r,i){const a=["true","True","TRUE"];const s=["false","False","FALSE"];const l=getInput(r,i);if(a.includes(l))return true;if(s.includes(l))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${r}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}i.getBooleanInput=getBooleanInput;function setOutput(r,i){const a=process.env["GITHUB_OUTPUT"]||"";if(a){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(r,i))}process.stdout.write(h.EOL);d.issueCommand("set-output",{name:r},A.toCommandValue(i))}i.setOutput=setOutput;function setCommandEcho(r){d.issue("echo",r?"on":"off")}i.setCommandEcho=setCommandEcho;function setFailed(r){process.exitCode=E.Failure;error(r)}i.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}i.isDebug=isDebug;function debug(r){d.issueCommand("debug",{},r)}i.debug=debug;function error(r,i={}){d.issueCommand("error",A.toCommandProperties(i),r instanceof Error?r.toString():r)}i.error=error;function warning(r,i={}){d.issueCommand("warning",A.toCommandProperties(i),r instanceof Error?r.toString():r)}i.warning=warning;function notice(r,i={}){d.issueCommand("notice",A.toCommandProperties(i),r instanceof Error?r.toString():r)}i.notice=notice;function info(r){process.stdout.write(r+h.EOL)}i.info=info;function startGroup(r){d.issue("group",r)}i.startGroup=startGroup;function endGroup(){d.issue("endgroup")}i.endGroup=endGroup;function group(r,i){return p(this,void 0,void 0,(function*(){startGroup(r);let a;try{a=yield i()}finally{endGroup()}return a}))}i.group=group;function saveState(r,i){const a=process.env["GITHUB_STATE"]||"";if(a){return u.issueFileCommand("STATE",u.prepareKeyValueMessage(r,i))}d.issueCommand("save-state",{name:r},A.toCommandValue(i))}i.saveState=saveState;function getState(r){return process.env[`STATE_${r}`]||""}i.getState=getState;function getIDToken(r){return p(this,void 0,void 0,(function*(){return yield y.OidcClient.getIDToken(r)}))}i.getIDToken=getIDToken;var b=a(93176);Object.defineProperty(i,"summary",{enumerable:true,get:function(){return b.summary}});var C=a(93176);Object.defineProperty(i,"markdownSummary",{enumerable:true,get:function(){return C.markdownSummary}});var v=a(2314);Object.defineProperty(i,"toPosixPath",{enumerable:true,get:function(){return v.toPosixPath}});Object.defineProperty(i,"toWin32Path",{enumerable:true,get:function(){return v.toWin32Path}});Object.defineProperty(i,"toPlatformPath",{enumerable:true,get:function(){return v.toPlatformPath}})},44720:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.prepareKeyValueMessage=i.issueFileCommand=void 0;const p=c(a(57147));const d=c(a(22037));const u=a(50757);const A=a(34309);function issueFileCommand(r,i){const a=process.env[`GITHUB_${r}`];if(!a){throw new Error(`Unable to find environment variable for file command ${r}`)}if(!p.existsSync(a)){throw new Error(`Missing file at path: ${a}`)}p.appendFileSync(a,`${A.toCommandValue(i)}${d.EOL}`,{encoding:"utf8"})}i.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(r,i){const a=`ghadelimiter_${u.v4()}`;const s=A.toCommandValue(i);if(r.includes(a)){throw new Error(`Unexpected input: name should not contain the delimiter "${a}"`)}if(s.includes(a)){throw new Error(`Unexpected input: value should not contain the delimiter "${a}"`)}return`${r}<<${a}${d.EOL}${s}${d.EOL}${a}`}i.prepareKeyValueMessage=prepareKeyValueMessage},57045:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.OidcClient=void 0;const l=a(42712);const c=a(84659);const p=a(92481);class OidcClient{static createHttpClient(r=true,i=10){const a={allowRetries:r,maxRetries:i};return new l.HttpClient("actions/oidc-client",[new c.BearerCredentialHandler(OidcClient.getRequestToken())],a)}static getRequestToken(){const r=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!r){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return r}static getIDTokenUrl(){const r=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!r){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return r}static getCall(r){var i;return s(this,void 0,void 0,(function*(){const a=OidcClient.createHttpClient();const s=yield a.getJson(r).catch((r=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${r.statusCode}\n \n Error Message: ${r.message}`)}));const l=(i=s.result)===null||i===void 0?void 0:i.value;if(!l){throw new Error("Response json body do not have ID Token field")}return l}))}static getIDToken(r){return s(this,void 0,void 0,(function*(){try{let i=OidcClient.getIDTokenUrl();if(r){const a=encodeURIComponent(r);i=`${i}&audience=${a}`}p.debug(`ID token url is ${i}`);const a=yield OidcClient.getCall(i);p.setSecret(a);return a}catch(r){throw new Error(`Error message: ${r.message}`)}}))}}i.OidcClient=OidcClient},2314:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.toPlatformPath=i.toWin32Path=i.toPosixPath=void 0;const p=c(a(71017));function toPosixPath(r){return r.replace(/[\\]/g,"/")}i.toPosixPath=toPosixPath;function toWin32Path(r){return r.replace(/[/]/g,"\\")}i.toWin32Path=toWin32Path;function toPlatformPath(r){return r.replace(/[/\\]/g,p.sep)}i.toPlatformPath=toPlatformPath},93176:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.summary=i.markdownSummary=i.SUMMARY_DOCS_URL=i.SUMMARY_ENV_VAR=void 0;const l=a(22037);const c=a(57147);const{access:p,appendFile:d,writeFile:u}=c.promises;i.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";i.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return s(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const r=process.env[i.SUMMARY_ENV_VAR];if(!r){throw new Error(`Unable to find environment variable for $${i.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield p(r,c.constants.R_OK|c.constants.W_OK)}catch(i){throw new Error(`Unable to access summary file: '${r}'. Check if the file has correct read/write permissions.`)}this._filePath=r;return this._filePath}))}wrap(r,i,a={}){const s=Object.entries(a).map((([r,i])=>` ${r}="${i}"`)).join("");if(!i){return`<${r}${s}>`}return`<${r}${s}>${i}`}write(r){return s(this,void 0,void 0,(function*(){const i=!!(r===null||r===void 0?void 0:r.overwrite);const a=yield this.filePath();const s=i?u:d;yield s(a,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return s(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(r,i=false){this._buffer+=r;return i?this.addEOL():this}addEOL(){return this.addRaw(l.EOL)}addCodeBlock(r,i){const a=Object.assign({},i&&{lang:i});const s=this.wrap("pre",this.wrap("code",r),a);return this.addRaw(s).addEOL()}addList(r,i=false){const a=i?"ol":"ul";const s=r.map((r=>this.wrap("li",r))).join("");const l=this.wrap(a,s);return this.addRaw(l).addEOL()}addTable(r){const i=r.map((r=>{const i=r.map((r=>{if(typeof r==="string"){return this.wrap("td",r)}const{header:i,data:a,colspan:s,rowspan:l}=r;const c=i?"th":"td";const p=Object.assign(Object.assign({},s&&{colspan:s}),l&&{rowspan:l});return this.wrap(c,a,p)})).join("");return this.wrap("tr",i)})).join("");const a=this.wrap("table",i);return this.addRaw(a).addEOL()}addDetails(r,i){const a=this.wrap("details",this.wrap("summary",r)+i);return this.addRaw(a).addEOL()}addImage(r,i,a){const{width:s,height:l}=a||{};const c=Object.assign(Object.assign({},s&&{width:s}),l&&{height:l});const p=this.wrap("img",null,Object.assign({src:r,alt:i},c));return this.addRaw(p).addEOL()}addHeading(r,i){const a=`h${i}`;const s=["h1","h2","h3","h4","h5","h6"].includes(a)?a:"h1";const l=this.wrap(s,r);return this.addRaw(l).addEOL()}addSeparator(){const r=this.wrap("hr",null);return this.addRaw(r).addEOL()}addBreak(){const r=this.wrap("br",null);return this.addRaw(r).addEOL()}addQuote(r,i){const a=Object.assign({},i&&{cite:i});const s=this.wrap("blockquote",r,a);return this.addRaw(s).addEOL()}addLink(r,i){const a=this.wrap("a",r,{href:i});return this.addRaw(a).addEOL()}}const A=new Summary;i.markdownSummary=A;i.summary=A},34309:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.toCommandProperties=i.toCommandValue=void 0;function toCommandValue(r){if(r===null||r===undefined){return""}else if(typeof r==="string"||r instanceof String){return r}return JSON.stringify(r)}i.toCommandValue=toCommandValue;function toCommandProperties(r){if(!Object.keys(r).length){return{}}return{title:r.title,file:r.file,line:r.startLine,endLine:r.endLine,col:r.startColumn,endColumn:r.endColumn}}i.toCommandProperties=toCommandProperties},37917:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Context=void 0;const s=a(57147);const l=a(22037);class Context{constructor(){var r,i,a;this.payload={};if(process.env.GITHUB_EVENT_PATH){if(s.existsSync(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse(s.readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const r=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${r} does not exist${l.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10);this.runId=parseInt(process.env.GITHUB_RUN_ID,10);this.apiUrl=(r=process.env.GITHUB_API_URL)!==null&&r!==void 0?r:`https://api.github.com`;this.serverUrl=(i=process.env.GITHUB_SERVER_URL)!==null&&i!==void 0?i:`https://github.com`;this.graphqlUrl=(a=process.env.GITHUB_GRAPHQL_URL)!==null&&a!==void 0?a:`https://api.github.com/graphql`}get issue(){const r=this.payload;return Object.assign(Object.assign({},this.repo),{number:(r.issue||r.pull_request||r).number})}get repo(){if(process.env.GITHUB_REPOSITORY){const[r,i]=process.env.GITHUB_REPOSITORY.split("/");return{owner:r,repo:i}}if(this.payload.repository){return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name}}throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}}i.Context=Context},70707:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getOctokit=i.context=void 0;const p=c(a(37917));const d=a(95628);i.context=new p.Context;function getOctokit(r,i,...a){const s=d.GitHub.plugin(...a);return new s(d.getOctokitOptions(r,i))}i.getOctokit=getOctokit},89587:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getApiBaseUrl=i.getProxyAgent=i.getAuthString=void 0;const p=c(a(42712));function getAuthString(r,i){if(!r&&!i.auth){throw new Error("Parameter token or opts.auth is required")}else if(r&&i.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof i.auth==="string"?i.auth:`token ${r}`}i.getAuthString=getAuthString;function getProxyAgent(r){const i=new p.HttpClient;return i.getAgent(r)}i.getProxyAgent=getProxyAgent;function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}i.getApiBaseUrl=getApiBaseUrl},95628:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getOctokitOptions=i.GitHub=i.defaults=i.context=void 0;const p=c(a(37917));const d=c(a(89587));const u=a(80947);const A=a(15243);const h=a(88474);i.context=new p.Context;const g=d.getApiBaseUrl();i.defaults={baseUrl:g,request:{agent:d.getProxyAgent(g)}};i.GitHub=u.Octokit.plugin(A.restEndpointMethods,h.paginateRest).defaults(i.defaults);function getOctokitOptions(r,i){const a=Object.assign({},i||{});const s=d.getAuthString(r,a);if(s){a.auth=s}return a}i.getOctokitOptions=getOctokitOptions},38453:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.hashFiles=i.create=void 0;const l=a(53843);const c=a(70772);function create(r,i){return s(this,void 0,void 0,(function*(){return yield l.DefaultGlobber.create(r,i)}))}i.create=create;function hashFiles(r,i="",a,l=false){return s(this,void 0,void 0,(function*(){let s=true;if(a&&typeof a.followSymbolicLinks==="boolean"){s=a.followSymbolicLinks}const p=yield create(r,{followSymbolicLinks:s});return c.hashFiles(p,i,l)}))}i.hashFiles=hashFiles},92179:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getOptions=void 0;const p=c(a(92481));function getOptions(r){const i={followSymbolicLinks:true,implicitDescendants:true,matchDirectories:true,omitBrokenSymbolicLinks:true};if(r){if(typeof r.followSymbolicLinks==="boolean"){i.followSymbolicLinks=r.followSymbolicLinks;p.debug(`followSymbolicLinks '${i.followSymbolicLinks}'`)}if(typeof r.implicitDescendants==="boolean"){i.implicitDescendants=r.implicitDescendants;p.debug(`implicitDescendants '${i.implicitDescendants}'`)}if(typeof r.matchDirectories==="boolean"){i.matchDirectories=r.matchDirectories;p.debug(`matchDirectories '${i.matchDirectories}'`)}if(typeof r.omitBrokenSymbolicLinks==="boolean"){i.omitBrokenSymbolicLinks=r.omitBrokenSymbolicLinks;p.debug(`omitBrokenSymbolicLinks '${i.omitBrokenSymbolicLinks}'`)}}return i}i.getOptions=getOptions},53843:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};var d=this&&this.__asyncValues||function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],a;return i?i.call(r):(r=typeof __values==="function"?__values(r):r[Symbol.iterator](),a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a);function verb(i){a[i]=r[i]&&function(a){return new Promise((function(s,l){a=r[i](a),settle(s,l,a.done,a.value)}))}}function settle(r,i,a,s){Promise.resolve(s).then((function(i){r({value:i,done:a})}),i)}};var u=this&&this.__await||function(r){return this instanceof u?(this.v=r,this):new u(r)};var A=this&&this.__asyncGenerator||function(r,i,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=a.apply(r,i||[]),l,c=[];return l={},verb("next"),verb("throw"),verb("return"),l[Symbol.asyncIterator]=function(){return this},l;function verb(r){if(s[r])l[r]=function(i){return new Promise((function(a,s){c.push([r,i,a,s])>1||resume(r,i)}))}}function resume(r,i){try{step(s[r](i))}catch(r){settle(c[0][3],r)}}function step(r){r.value instanceof u?Promise.resolve(r.value.v).then(fulfill,reject):settle(c[0][2],r)}function fulfill(r){resume("next",r)}function reject(r){resume("throw",r)}function settle(r,i){if(r(i),c.shift(),c.length)resume(c[0][0],c[0][1])}};Object.defineProperty(i,"__esModule",{value:true});i.DefaultGlobber=void 0;const h=c(a(92481));const g=c(a(57147));const y=c(a(92179));const E=c(a(71017));const b=c(a(46968));const C=a(78276);const v=a(55999);const B=a(83698);const I=process.platform==="win32";class DefaultGlobber{constructor(r){this.patterns=[];this.searchPaths=[];this.options=y.getOptions(r)}getSearchPaths(){return this.searchPaths.slice()}glob(){var r,i;return p(this,void 0,void 0,(function*(){const a=[];try{for(var s=d(this.globGenerator()),l;l=yield s.next(),!l.done;){const r=l.value;a.push(r)}}catch(i){r={error:i}}finally{try{if(l&&!l.done&&(i=s.return))yield i.call(s)}finally{if(r)throw r.error}}return a}))}globGenerator(){return A(this,arguments,(function*globGenerator_1(){const r=y.getOptions(this.options);const i=[];for(const a of this.patterns){i.push(a);if(r.implicitDescendants&&(a.trailingSeparator||a.segments[a.segments.length-1]!=="**")){i.push(new v.Pattern(a.negate,true,a.segments.concat("**")))}}const a=[];for(const r of b.getSearchPaths(i)){h.debug(`Search path '${r}'`);try{yield u(g.promises.lstat(r))}catch(r){if(r.code==="ENOENT"){continue}throw r}a.unshift(new B.SearchState(r,1))}const s=[];while(a.length){const l=a.pop();const c=b.match(i,l.path);const p=!!c||b.partialMatch(i,l.path);if(!c&&!p){continue}const d=yield u(DefaultGlobber.stat(l,r,s));if(!d){continue}if(d.isDirectory()){if(c&C.MatchKind.Directory&&r.matchDirectories){yield yield u(l.path)}else if(!p){continue}const i=l.level+1;const s=(yield u(g.promises.readdir(l.path))).map((r=>new B.SearchState(E.join(l.path,r),i)));a.push(...s.reverse())}else if(c&C.MatchKind.File){yield yield u(l.path)}}}))}static create(r,i){return p(this,void 0,void 0,(function*(){const a=new DefaultGlobber(i);if(I){r=r.replace(/\r\n/g,"\n");r=r.replace(/\r/g,"\n")}const s=r.split("\n").map((r=>r.trim()));for(const r of s){if(!r||r.startsWith("#")){continue}else{a.patterns.push(new v.Pattern(r))}}a.searchPaths.push(...b.getSearchPaths(a.patterns));return a}))}static stat(r,i,a){return p(this,void 0,void 0,(function*(){let s;if(i.followSymbolicLinks){try{s=yield g.promises.stat(r.path)}catch(a){if(a.code==="ENOENT"){if(i.omitBrokenSymbolicLinks){h.debug(`Broken symlink '${r.path}'`);return undefined}throw new Error(`No information found for the path '${r.path}'. This may indicate a broken symbolic link.`)}throw a}}else{s=yield g.promises.lstat(r.path)}if(s.isDirectory()&&i.followSymbolicLinks){const i=yield g.promises.realpath(r.path);while(a.length>=r.level){a.pop()}if(a.some((r=>r===i))){h.debug(`Symlink cycle detected for path '${r.path}' and realpath '${i}'`);return undefined}a.push(i)}return s}))}}i.DefaultGlobber=DefaultGlobber},70772:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};var d=this&&this.__asyncValues||function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],a;return i?i.call(r):(r=typeof __values==="function"?__values(r):r[Symbol.iterator](),a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a);function verb(i){a[i]=r[i]&&function(a){return new Promise((function(s,l){a=r[i](a),settle(s,l,a.done,a.value)}))}}function settle(r,i,a,s){Promise.resolve(s).then((function(i){r({value:i,done:a})}),i)}};Object.defineProperty(i,"__esModule",{value:true});i.hashFiles=void 0;const u=c(a(6113));const A=c(a(92481));const h=c(a(57147));const g=c(a(12781));const y=c(a(73837));const E=c(a(71017));function hashFiles(r,i,a=false){var s,l;var c;return p(this,void 0,void 0,(function*(){const p=a?A.info:A.debug;let b=false;const C=i?i:(c=process.env["GITHUB_WORKSPACE"])!==null&&c!==void 0?c:process.cwd();const v=u.createHash("sha256");let B=0;try{for(var I=d(r.globGenerator()),w;w=yield I.next(),!w.done;){const r=w.value;p(r);if(!r.startsWith(`${C}${E.sep}`)){p(`Ignore '${r}' since it is not under GITHUB_WORKSPACE.`);continue}if(h.statSync(r).isDirectory()){p(`Skip directory '${r}'.`);continue}const i=u.createHash("sha256");const a=y.promisify(g.pipeline);yield a(h.createReadStream(r),i);v.write(i.digest());B++;if(!b){b=true}}}catch(r){s={error:r}}finally{try{if(w&&!w.done&&(l=I.return))yield l.call(I)}finally{if(s)throw s.error}}v.end();if(b){p(`Found ${B} files to hash.`);return v.digest("hex")}else{p(`No matches found for glob`);return""}}))}i.hashFiles=hashFiles},78276:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MatchKind=void 0;var a;(function(r){r[r["None"]=0]="None";r[r["Directory"]=1]="Directory";r[r["File"]=2]="File";r[r["All"]=3]="All"})(a=i.MatchKind||(i.MatchKind={}))},59444:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.safeTrimTrailingSeparator=i.normalizeSeparators=i.hasRoot=i.hasAbsoluteRoot=i.ensureAbsoluteRoot=i.dirname=void 0;const d=c(a(71017));const u=p(a(39491));const A=process.platform==="win32";function dirname(r){r=safeTrimTrailingSeparator(r);if(A&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(r)){return r}let i=d.dirname(r);if(A&&/^\\\\[^\\]+\\[^\\]+\\$/.test(i)){i=safeTrimTrailingSeparator(i)}return i}i.dirname=dirname;function ensureAbsoluteRoot(r,i){u.default(r,`ensureAbsoluteRoot parameter 'root' must not be empty`);u.default(i,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`);if(hasAbsoluteRoot(i)){return i}if(A){if(i.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let r=process.cwd();u.default(r.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${r}'`);if(i[0].toUpperCase()===r[0].toUpperCase()){if(i.length===2){return`${i[0]}:\\${r.substr(3)}`}else{if(!r.endsWith("\\")){r+="\\"}return`${i[0]}:\\${r.substr(3)}${i.substr(2)}`}}else{return`${i[0]}:\\${i.substr(2)}`}}else if(normalizeSeparators(i).match(/^\\$|^\\[^\\]/)){const r=process.cwd();u.default(r.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${r}'`);return`${r[0]}:\\${i.substr(1)}`}}u.default(hasAbsoluteRoot(r),`ensureAbsoluteRoot parameter 'root' must have an absolute root`);if(r.endsWith("/")||A&&r.endsWith("\\")){}else{r+=d.sep}return r+i}i.ensureAbsoluteRoot=ensureAbsoluteRoot;function hasAbsoluteRoot(r){u.default(r,`hasAbsoluteRoot parameter 'itemPath' must not be empty`);r=normalizeSeparators(r);if(A){return r.startsWith("\\\\")||/^[A-Z]:\\/i.test(r)}return r.startsWith("/")}i.hasAbsoluteRoot=hasAbsoluteRoot;function hasRoot(r){u.default(r,`isRooted parameter 'itemPath' must not be empty`);r=normalizeSeparators(r);if(A){return r.startsWith("\\")||/^[A-Z]:/i.test(r)}return r.startsWith("/")}i.hasRoot=hasRoot;function normalizeSeparators(r){r=r||"";if(A){r=r.replace(/\//g,"\\");const i=/^\\\\+[^\\]/.test(r);return(i?"\\":"")+r.replace(/\\\\+/g,"\\")}return r.replace(/\/\/+/g,"/")}i.normalizeSeparators=normalizeSeparators;function safeTrimTrailingSeparator(r){if(!r){return""}r=normalizeSeparators(r);if(!r.endsWith(d.sep)){return r}if(r===d.sep){return r}if(A&&/^[A-Z]:\\$/i.test(r)){return r}return r.substr(0,r.length-1)}i.safeTrimTrailingSeparator=safeTrimTrailingSeparator},84684:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Path=void 0;const d=c(a(71017));const u=c(a(59444));const A=p(a(39491));const h=process.platform==="win32";class Path{constructor(r){this.segments=[];if(typeof r==="string"){A.default(r,`Parameter 'itemPath' must not be empty`);r=u.safeTrimTrailingSeparator(r);if(!u.hasRoot(r)){this.segments=r.split(d.sep)}else{let i=r;let a=u.dirname(i);while(a!==i){const r=d.basename(i);this.segments.unshift(r);i=a;a=u.dirname(i)}this.segments.unshift(i)}}else{A.default(r.length>0,`Parameter 'itemPath' must not be an empty array`);for(let i=0;i!r.negate));const i={};for(const a of r){const r=u?a.searchPath.toUpperCase():a.searchPath;i[r]="candidate"}const a=[];for(const s of r){const r=u?s.searchPath.toUpperCase():s.searchPath;if(i[r]==="included"){continue}let l=false;let c=r;let d=p.dirname(c);while(d!==c){if(i[d]){l=true;break}c=d;d=p.dirname(c)}if(!l){a.push(s.searchPath);i[r]="included"}}return a}i.getSearchPaths=getSearchPaths;function match(r,i){let a=d.MatchKind.None;for(const s of r){if(s.negate){a&=~s.match(i)}else{a|=s.match(i)}}return a}i.match=match;function partialMatch(r,i){return r.some((r=>!r.negate&&r.partialMatch(i)))}i.partialMatch=partialMatch},55999:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Pattern=void 0;const d=c(a(22037));const u=c(a(71017));const A=c(a(59444));const h=p(a(39491));const g=a(94193);const y=a(78276);const E=a(84684);const b=process.platform==="win32";class Pattern{constructor(r,i=false,a,s){this.negate=false;let l;if(typeof r==="string"){l=r.trim()}else{a=a||[];h.default(a.length,`Parameter 'segments' must not empty`);const i=Pattern.getLiteral(a[0]);h.default(i&&A.hasAbsoluteRoot(i),`Parameter 'segments' first element must be a root path`);l=new E.Path(a).toString().trim();if(r){l=`!${l}`}}while(l.startsWith("!")){this.negate=!this.negate;l=l.substr(1).trim()}l=Pattern.fixupPattern(l,s);this.segments=new E.Path(l).segments;this.trailingSeparator=A.normalizeSeparators(l).endsWith(u.sep);l=A.safeTrimTrailingSeparator(l);let c=false;const p=this.segments.map((r=>Pattern.getLiteral(r))).filter((r=>!c&&!(c=r==="")));this.searchPath=new E.Path(p).toString();this.rootRegExp=new RegExp(Pattern.regExpEscape(p[0]),b?"i":"");this.isImplicitPattern=i;const d={dot:true,nobrace:true,nocase:b,nocomment:true,noext:true,nonegate:true};l=b?l.replace(/\\/g,"/"):l;this.minimatch=new g.Minimatch(l,d)}match(r){if(this.segments[this.segments.length-1]==="**"){r=A.normalizeSeparators(r);if(!r.endsWith(u.sep)&&this.isImplicitPattern===false){r=`${r}${u.sep}`}}else{r=A.safeTrimTrailingSeparator(r)}if(this.minimatch.match(r)){return this.trailingSeparator?y.MatchKind.Directory:y.MatchKind.All}return y.MatchKind.None}partialMatch(r){r=A.safeTrimTrailingSeparator(r);if(A.dirname(r)===r){return this.rootRegExp.test(r)}return this.minimatch.matchOne(r.split(b?/\\+/:/\/+/),this.minimatch.set[0],true)}static globEscape(r){return(b?r:r.replace(/\\/g,"\\\\")).replace(/(\[)(?=[^/]+\])/g,"[[]").replace(/\?/g,"[?]").replace(/\*/g,"[*]")}static fixupPattern(r,i){h.default(r,"pattern cannot be empty");const a=new E.Path(r).segments.map((r=>Pattern.getLiteral(r)));h.default(a.every(((r,i)=>(r!=="."||i===0)&&r!=="..")),`Invalid pattern '${r}'. Relative pathing '.' and '..' is not allowed.`);h.default(!A.hasRoot(r)||a[0],`Invalid pattern '${r}'. Root segment must not contain globs.`);r=A.normalizeSeparators(r);if(r==="."||r.startsWith(`.${u.sep}`)){r=Pattern.globEscape(process.cwd())+r.substr(1)}else if(r==="~"||r.startsWith(`~${u.sep}`)){i=i||d.homedir();h.default(i,"Unable to determine HOME directory");h.default(A.hasAbsoluteRoot(i),`Expected HOME directory to be a rooted path. Actual '${i}'`);r=Pattern.globEscape(i)+r.substr(1)}else if(b&&(r.match(/^[A-Z]:$/i)||r.match(/^[A-Z]:[^\\]/i))){let i=A.ensureAbsoluteRoot("C:\\dummy-root",r.substr(0,2));if(r.length>2&&!i.endsWith("\\")){i+="\\"}r=Pattern.globEscape(i)+r.substr(2)}else if(b&&(r==="\\"||r.match(/^\\[^\\]/))){let i=A.ensureAbsoluteRoot("C:\\dummy-root","\\");if(!i.endsWith("\\")){i+="\\"}r=Pattern.globEscape(i)+r.substr(1)}else{r=A.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()),r)}return A.normalizeSeparators(r)}static getLiteral(r){let i="";for(let a=0;a=0){if(s.length>1){return""}if(s){i+=s;a=l;continue}}}i+=s}return i}static regExpEscape(r){return r.replace(/[[\\^$.|?*+()]/g,"\\$&")}}i.Pattern=Pattern},83698:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SearchState=void 0;class SearchState{constructor(r,i){this.path=r;this.level=i}}i.SearchState=SearchState},84659:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.PersonalAccessTokenCredentialHandler=i.BearerCredentialHandler=i.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(r,i){this.username=r;this.password=i}prepareRequest(r){if(!r.headers){throw Error("The request has no headers")}r.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return a(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}i.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(r){this.token=r}prepareRequest(r){if(!r.headers){throw Error("The request has no headers")}r.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return a(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}i.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(r){this.token=r}prepareRequest(r){if(!r.headers){throw Error("The request has no headers")}r.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return a(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}i.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},42712:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var l=Object.getOwnPropertyDescriptor(i,a);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,l)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.HttpClient=i.isHttps=i.HttpClientResponse=i.HttpClientError=i.getProxyUrl=i.MediaTypes=i.Headers=i.HttpCodes=void 0;const d=c(a(13685));const u=c(a(95687));const A=c(a(32722));const h=c(a(70391));const g=a(16096);var y;(function(r){r[r["OK"]=200]="OK";r[r["MultipleChoices"]=300]="MultipleChoices";r[r["MovedPermanently"]=301]="MovedPermanently";r[r["ResourceMoved"]=302]="ResourceMoved";r[r["SeeOther"]=303]="SeeOther";r[r["NotModified"]=304]="NotModified";r[r["UseProxy"]=305]="UseProxy";r[r["SwitchProxy"]=306]="SwitchProxy";r[r["TemporaryRedirect"]=307]="TemporaryRedirect";r[r["PermanentRedirect"]=308]="PermanentRedirect";r[r["BadRequest"]=400]="BadRequest";r[r["Unauthorized"]=401]="Unauthorized";r[r["PaymentRequired"]=402]="PaymentRequired";r[r["Forbidden"]=403]="Forbidden";r[r["NotFound"]=404]="NotFound";r[r["MethodNotAllowed"]=405]="MethodNotAllowed";r[r["NotAcceptable"]=406]="NotAcceptable";r[r["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";r[r["RequestTimeout"]=408]="RequestTimeout";r[r["Conflict"]=409]="Conflict";r[r["Gone"]=410]="Gone";r[r["TooManyRequests"]=429]="TooManyRequests";r[r["InternalServerError"]=500]="InternalServerError";r[r["NotImplemented"]=501]="NotImplemented";r[r["BadGateway"]=502]="BadGateway";r[r["ServiceUnavailable"]=503]="ServiceUnavailable";r[r["GatewayTimeout"]=504]="GatewayTimeout"})(y||(i.HttpCodes=y={}));var E;(function(r){r["Accept"]="accept";r["ContentType"]="content-type"})(E||(i.Headers=E={}));var b;(function(r){r["ApplicationJson"]="application/json"})(b||(i.MediaTypes=b={}));function getProxyUrl(r){const i=A.getProxyUrl(new URL(r));return i?i.href:""}i.getProxyUrl=getProxyUrl;const C=[y.MovedPermanently,y.ResourceMoved,y.SeeOther,y.TemporaryRedirect,y.PermanentRedirect];const v=[y.BadGateway,y.ServiceUnavailable,y.GatewayTimeout];const B=["OPTIONS","GET","DELETE","HEAD"];const I=10;const w=5;class HttpClientError extends Error{constructor(r,i){super(r);this.name="HttpClientError";this.statusCode=i;Object.setPrototypeOf(this,HttpClientError.prototype)}}i.HttpClientError=HttpClientError;class HttpClientResponse{constructor(r){this.message=r}readBody(){return p(this,void 0,void 0,(function*(){return new Promise((r=>p(this,void 0,void 0,(function*(){let i=Buffer.alloc(0);this.message.on("data",(r=>{i=Buffer.concat([i,r])}));this.message.on("end",(()=>{r(i.toString())}))}))))}))}readBodyBuffer(){return p(this,void 0,void 0,(function*(){return new Promise((r=>p(this,void 0,void 0,(function*(){const i=[];this.message.on("data",(r=>{i.push(r)}));this.message.on("end",(()=>{r(Buffer.concat(i))}))}))))}))}}i.HttpClientResponse=HttpClientResponse;function isHttps(r){const i=new URL(r);return i.protocol==="https:"}i.isHttps=isHttps;class HttpClient{constructor(r,i,a){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=r;this.handlers=i||[];this.requestOptions=a;if(a){if(a.ignoreSslError!=null){this._ignoreSslError=a.ignoreSslError}this._socketTimeout=a.socketTimeout;if(a.allowRedirects!=null){this._allowRedirects=a.allowRedirects}if(a.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=a.allowRedirectDowngrade}if(a.maxRedirects!=null){this._maxRedirects=Math.max(a.maxRedirects,0)}if(a.keepAlive!=null){this._keepAlive=a.keepAlive}if(a.allowRetries!=null){this._allowRetries=a.allowRetries}if(a.maxRetries!=null){this._maxRetries=a.maxRetries}}}options(r,i){return p(this,void 0,void 0,(function*(){return this.request("OPTIONS",r,null,i||{})}))}get(r,i){return p(this,void 0,void 0,(function*(){return this.request("GET",r,null,i||{})}))}del(r,i){return p(this,void 0,void 0,(function*(){return this.request("DELETE",r,null,i||{})}))}post(r,i,a){return p(this,void 0,void 0,(function*(){return this.request("POST",r,i,a||{})}))}patch(r,i,a){return p(this,void 0,void 0,(function*(){return this.request("PATCH",r,i,a||{})}))}put(r,i,a){return p(this,void 0,void 0,(function*(){return this.request("PUT",r,i,a||{})}))}head(r,i){return p(this,void 0,void 0,(function*(){return this.request("HEAD",r,null,i||{})}))}sendStream(r,i,a,s){return p(this,void 0,void 0,(function*(){return this.request(r,i,a,s)}))}getJson(r,i={}){return p(this,void 0,void 0,(function*(){i[E.Accept]=this._getExistingOrDefaultHeader(i,E.Accept,b.ApplicationJson);const a=yield this.get(r,i);return this._processResponse(a,this.requestOptions)}))}postJson(r,i,a={}){return p(this,void 0,void 0,(function*(){const s=JSON.stringify(i,null,2);a[E.Accept]=this._getExistingOrDefaultHeader(a,E.Accept,b.ApplicationJson);a[E.ContentType]=this._getExistingOrDefaultHeader(a,E.ContentType,b.ApplicationJson);const l=yield this.post(r,s,a);return this._processResponse(l,this.requestOptions)}))}putJson(r,i,a={}){return p(this,void 0,void 0,(function*(){const s=JSON.stringify(i,null,2);a[E.Accept]=this._getExistingOrDefaultHeader(a,E.Accept,b.ApplicationJson);a[E.ContentType]=this._getExistingOrDefaultHeader(a,E.ContentType,b.ApplicationJson);const l=yield this.put(r,s,a);return this._processResponse(l,this.requestOptions)}))}patchJson(r,i,a={}){return p(this,void 0,void 0,(function*(){const s=JSON.stringify(i,null,2);a[E.Accept]=this._getExistingOrDefaultHeader(a,E.Accept,b.ApplicationJson);a[E.ContentType]=this._getExistingOrDefaultHeader(a,E.ContentType,b.ApplicationJson);const l=yield this.patch(r,s,a);return this._processResponse(l,this.requestOptions)}))}request(r,i,a,s){return p(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const l=new URL(i);let c=this._prepareRequest(r,l,s);const p=this._allowRetries&&B.includes(r)?this._maxRetries+1:1;let d=0;let u;do{u=yield this.requestRaw(c,a);if(u&&u.message&&u.message.statusCode===y.Unauthorized){let r;for(const i of this.handlers){if(i.canHandleAuthentication(u)){r=i;break}}if(r){return r.handleAuthentication(this,c,a)}else{return u}}let i=this._maxRedirects;while(u.message.statusCode&&C.includes(u.message.statusCode)&&this._allowRedirects&&i>0){const p=u.message.headers["location"];if(!p){break}const d=new URL(p);if(l.protocol==="https:"&&l.protocol!==d.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield u.readBody();if(d.hostname!==l.hostname){for(const r in s){if(r.toLowerCase()==="authorization"){delete s[r]}}}c=this._prepareRequest(r,d,s);u=yield this.requestRaw(c,a);i--}if(!u.message.statusCode||!v.includes(u.message.statusCode)){return u}d+=1;if(d{function callbackForResult(r,i){if(r){s(r)}else if(!i){s(new Error("Unknown error"))}else{a(i)}}this.requestRawWithCallback(r,i,callbackForResult)}))}))}requestRawWithCallback(r,i,a){if(typeof i==="string"){if(!r.options.headers){r.options.headers={}}r.options.headers["Content-Length"]=Buffer.byteLength(i,"utf8")}let s=false;function handleResult(r,i){if(!s){s=true;a(r,i)}}const l=r.httpModule.request(r.options,(r=>{const i=new HttpClientResponse(r);handleResult(undefined,i)}));let c;l.on("socket",(r=>{c=r}));l.setTimeout(this._socketTimeout||3*6e4,(()=>{if(c){c.end()}handleResult(new Error(`Request timeout: ${r.options.path}`))}));l.on("error",(function(r){handleResult(r)}));if(i&&typeof i==="string"){l.write(i,"utf8")}if(i&&typeof i!=="string"){i.on("close",(function(){l.end()}));i.pipe(l)}else{l.end()}}getAgent(r){const i=new URL(r);return this._getAgent(i)}getAgentDispatcher(r){const i=new URL(r);const a=A.getProxyUrl(i);const s=a&&a.hostname;if(!s){return}return this._getProxyAgentDispatcher(i,a)}_prepareRequest(r,i,a){const s={};s.parsedUrl=i;const l=s.parsedUrl.protocol==="https:";s.httpModule=l?u:d;const c=l?443:80;s.options={};s.options.host=s.parsedUrl.hostname;s.options.port=s.parsedUrl.port?parseInt(s.parsedUrl.port):c;s.options.path=(s.parsedUrl.pathname||"")+(s.parsedUrl.search||"");s.options.method=r;s.options.headers=this._mergeHeaders(a);if(this.userAgent!=null){s.options.headers["user-agent"]=this.userAgent}s.options.agent=this._getAgent(s.parsedUrl);if(this.handlers){for(const r of this.handlers){r.prepareRequest(s.options)}}return s}_mergeHeaders(r){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(r||{}))}return lowercaseKeys(r||{})}_getExistingOrDefaultHeader(r,i,a){let s;if(this.requestOptions&&this.requestOptions.headers){s=lowercaseKeys(this.requestOptions.headers)[i]}return r[i]||s||a}_getAgent(r){let i;const a=A.getProxyUrl(r);const s=a&&a.hostname;if(this._keepAlive&&s){i=this._proxyAgent}if(this._keepAlive&&!s){i=this._agent}if(i){return i}const l=r.protocol==="https:";let c=100;if(this.requestOptions){c=this.requestOptions.maxSockets||d.globalAgent.maxSockets}if(a&&a.hostname){const r={maxSockets:c,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(a.username||a.password)&&{proxyAuth:`${a.username}:${a.password}`}),{host:a.hostname,port:a.port})};let s;const p=a.protocol==="https:";if(l){s=p?h.httpsOverHttps:h.httpsOverHttp}else{s=p?h.httpOverHttps:h.httpOverHttp}i=s(r);this._proxyAgent=i}if(this._keepAlive&&!i){const r={keepAlive:this._keepAlive,maxSockets:c};i=l?new u.Agent(r):new d.Agent(r);this._agent=i}if(!i){i=l?u.globalAgent:d.globalAgent}if(l&&this._ignoreSslError){i.options=Object.assign(i.options||{},{rejectUnauthorized:false})}return i}_getProxyAgentDispatcher(r,i){let a;if(this._keepAlive){a=this._proxyAgentDispatcher}if(a){return a}const s=r.protocol==="https:";a=new g.ProxyAgent(Object.assign({uri:i.href,pipelining:!this._keepAlive?0:1},(i.username||i.password)&&{token:`${i.username}:${i.password}`}));this._proxyAgentDispatcher=a;if(s&&this._ignoreSslError){a.options=Object.assign(a.options.requestTls||{},{rejectUnauthorized:false})}return a}_performExponentialBackoff(r){return p(this,void 0,void 0,(function*(){r=Math.min(I,r);const i=w*Math.pow(2,r);return new Promise((r=>setTimeout((()=>r()),i)))}))}_processResponse(r,i){return p(this,void 0,void 0,(function*(){return new Promise(((a,s)=>p(this,void 0,void 0,(function*(){const l=r.message.statusCode||0;const c={statusCode:l,result:null,headers:{}};if(l===y.NotFound){a(c)}function dateTimeDeserializer(r,i){if(typeof i==="string"){const r=new Date(i);if(!isNaN(r.valueOf())){return r}}return i}let p;let d;try{d=yield r.readBody();if(d&&d.length>0){if(i&&i.deserializeDates){p=JSON.parse(d,dateTimeDeserializer)}else{p=JSON.parse(d)}c.result=p}c.headers=r.message.headers}catch(r){}if(l>299){let r;if(p&&p.message){r=p.message}else if(d&&d.length>0){r=d}else{r=`Failed request: (${l})`}const i=new HttpClientError(r,l);i.result=c.result;s(i)}else{a(c)}}))))}))}}i.HttpClient=HttpClient;const lowercaseKeys=r=>Object.keys(r).reduce(((i,a)=>(i[a.toLowerCase()]=r[a],i)),{})},32722:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.checkBypass=i.getProxyUrl=void 0;function getProxyUrl(r){const i=r.protocol==="https:";if(checkBypass(r)){return undefined}const a=(()=>{if(i){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(a){try{return new URL(a)}catch(r){if(!a.startsWith("http://")&&!a.startsWith("https://"))return new URL(`http://${a}`)}}else{return undefined}}i.getProxyUrl=getProxyUrl;function checkBypass(r){if(!r.hostname){return false}const i=r.hostname;if(isLoopbackAddress(i)){return true}const a=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!a){return false}let s;if(r.port){s=Number(r.port)}else if(r.protocol==="http:"){s=80}else if(r.protocol==="https:"){s=443}const l=[r.hostname.toUpperCase()];if(typeof s==="number"){l.push(`${l[0]}:${s}`)}for(const r of a.split(",").map((r=>r.trim().toUpperCase())).filter((r=>r))){if(r==="*"||l.some((i=>i===r||i.endsWith(`.${r}`)||r.startsWith(".")&&i.endsWith(`${r}`)))){return true}}return false}i.checkBypass=checkBypass;function isLoopbackAddress(r){const i=r.toLowerCase();return i==="localhost"||i.startsWith("127.")||i.startsWith("[::1]")||i.startsWith("[0:0:0:0:0:0:0:1]")}},18619:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};var d;Object.defineProperty(i,"__esModule",{value:true});i.getCmdPath=i.tryGetExecutablePath=i.isRooted=i.isDirectory=i.exists=i.READONLY=i.UV_FS_O_EXLOCK=i.IS_WINDOWS=i.unlink=i.symlink=i.stat=i.rmdir=i.rm=i.rename=i.readlink=i.readdir=i.open=i.mkdir=i.lstat=i.copyFile=i.chmod=void 0;const u=c(a(57147));const A=c(a(71017));d=u.promises,i.chmod=d.chmod,i.copyFile=d.copyFile,i.lstat=d.lstat,i.mkdir=d.mkdir,i.open=d.open,i.readdir=d.readdir,i.readlink=d.readlink,i.rename=d.rename,i.rm=d.rm,i.rmdir=d.rmdir,i.stat=d.stat,i.symlink=d.symlink,i.unlink=d.unlink;i.IS_WINDOWS=process.platform==="win32";i.UV_FS_O_EXLOCK=268435456;i.READONLY=u.constants.O_RDONLY;function exists(r){return p(this,void 0,void 0,(function*(){try{yield i.stat(r)}catch(r){if(r.code==="ENOENT"){return false}throw r}return true}))}i.exists=exists;function isDirectory(r,a=false){return p(this,void 0,void 0,(function*(){const s=a?yield i.stat(r):yield i.lstat(r);return s.isDirectory()}))}i.isDirectory=isDirectory;function isRooted(r){r=normalizeSeparators(r);if(!r){throw new Error('isRooted() parameter "p" cannot be empty')}if(i.IS_WINDOWS){return r.startsWith("\\")||/^[A-Z]:/i.test(r)}return r.startsWith("/")}i.isRooted=isRooted;function tryGetExecutablePath(r,a){return p(this,void 0,void 0,(function*(){let s=undefined;try{s=yield i.stat(r)}catch(i){if(i.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${i}`)}}if(s&&s.isFile()){if(i.IS_WINDOWS){const i=A.extname(r).toUpperCase();if(a.some((r=>r.toUpperCase()===i))){return r}}else{if(isUnixExecutable(s)){return r}}}const l=r;for(const c of a){r=l+c;s=undefined;try{s=yield i.stat(r)}catch(i){if(i.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${i}`)}}if(s&&s.isFile()){if(i.IS_WINDOWS){try{const a=A.dirname(r);const s=A.basename(r).toUpperCase();for(const l of yield i.readdir(a)){if(s===l.toUpperCase()){r=A.join(a,l);break}}}catch(i){console.log(`Unexpected error attempting to determine the actual case of the file '${r}': ${i}`)}return r}else{if(isUnixExecutable(s)){return r}}}}return""}))}i.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(r){r=r||"";if(i.IS_WINDOWS){r=r.replace(/\//g,"\\");return r.replace(/\\\\+/g,"\\")}return r.replace(/\/\/+/g,"/")}function isUnixExecutable(r){return(r.mode&1)>0||(r.mode&8)>0&&r.gid===process.getgid()||(r.mode&64)>0&&r.uid===process.getuid()}function getCmdPath(){var r;return(r=process.env["COMSPEC"])!==null&&r!==void 0?r:`cmd.exe`}i.getCmdPath=getCmdPath},3448:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.findInPath=i.which=i.mkdirP=i.rmRF=i.mv=i.cp=void 0;const d=a(39491);const u=c(a(71017));const A=c(a(18619));function cp(r,i,a={}){return p(this,void 0,void 0,(function*(){const{force:s,recursive:l,copySourceDirectory:c}=readCopyOptions(a);const p=(yield A.exists(i))?yield A.stat(i):null;if(p&&p.isFile()&&!s){return}const d=p&&p.isDirectory()&&c?u.join(i,u.basename(r)):i;if(!(yield A.exists(r))){throw new Error(`no such file or directory: ${r}`)}const h=yield A.stat(r);if(h.isDirectory()){if(!l){throw new Error(`Failed to copy. ${r} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(r,d,0,s)}}else{if(u.relative(r,d)===""){throw new Error(`'${d}' and '${r}' are the same file`)}yield copyFile(r,d,s)}}))}i.cp=cp;function mv(r,i,a={}){return p(this,void 0,void 0,(function*(){if(yield A.exists(i)){let s=true;if(yield A.isDirectory(i)){i=u.join(i,u.basename(r));s=yield A.exists(i)}if(s){if(a.force==null||a.force){yield rmRF(i)}else{throw new Error("Destination already exists")}}}yield mkdirP(u.dirname(i));yield A.rename(r,i)}))}i.mv=mv;function rmRF(r){return p(this,void 0,void 0,(function*(){if(A.IS_WINDOWS){if(/[*"<>|]/.test(r)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield A.rm(r,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(r){throw new Error(`File was unable to be removed ${r}`)}}))}i.rmRF=rmRF;function mkdirP(r){return p(this,void 0,void 0,(function*(){d.ok(r,"a path argument must be provided");yield A.mkdir(r,{recursive:true})}))}i.mkdirP=mkdirP;function which(r,i){return p(this,void 0,void 0,(function*(){if(!r){throw new Error("parameter 'tool' is required")}if(i){const i=yield which(r,false);if(!i){if(A.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${r}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${r}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return i}const a=yield findInPath(r);if(a&&a.length>0){return a[0]}return""}))}i.which=which;function findInPath(r){return p(this,void 0,void 0,(function*(){if(!r){throw new Error("parameter 'tool' is required")}const i=[];if(A.IS_WINDOWS&&process.env["PATHEXT"]){for(const r of process.env["PATHEXT"].split(u.delimiter)){if(r){i.push(r)}}}if(A.isRooted(r)){const a=yield A.tryGetExecutablePath(r,i);if(a){return[a]}return[]}if(r.includes(u.sep)){return[]}const a=[];if(process.env.PATH){for(const r of process.env.PATH.split(u.delimiter)){if(r){a.push(r)}}}const s=[];for(const l of a){const a=yield A.tryGetExecutablePath(u.join(l,r),i);if(a){s.push(a)}}return s}))}i.findInPath=findInPath;function readCopyOptions(r){const i=r.force==null?true:r.force;const a=Boolean(r.recursive);const s=r.copySourceDirectory==null?true:Boolean(r.copySourceDirectory);return{force:i,recursive:a,copySourceDirectory:s}}function cpDirRecursive(r,i,a,s){return p(this,void 0,void 0,(function*(){if(a>=255)return;a++;yield mkdirP(i);const l=yield A.readdir(r);for(const c of l){const l=`${r}/${c}`;const p=`${i}/${c}`;const d=yield A.lstat(l);if(d.isDirectory()){yield cpDirRecursive(l,p,a,s)}else{yield copyFile(l,p,s)}}yield A.chmod(i,(yield A.stat(r)).mode)}))}function copyFile(r,i,a){return p(this,void 0,void 0,(function*(){if((yield A.lstat(r)).isSymbolicLink()){try{yield A.lstat(i);yield A.unlink(i)}catch(r){if(r.code==="EPERM"){yield A.chmod(i,"0666");yield A.unlink(i)}}const a=yield A.readlink(r);yield A.symlink(a,i,A.IS_WINDOWS?"junction":null)}else if(!(yield A.exists(i))||a){yield A.copyFile(r,i)}}))}},78185:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=new WeakMap;const s=new WeakMap;class AbortSignal{constructor(){this.onabort=null;a.set(this,[]);s.set(this,false)}get aborted(){if(!s.has(this)){throw new TypeError("Expected `this` to be an instance of AbortSignal.")}return s.get(this)}static get none(){return new AbortSignal}addEventListener(r,i){if(!a.has(this)){throw new TypeError("Expected `this` to be an instance of AbortSignal.")}const s=a.get(this);s.push(i)}removeEventListener(r,i){if(!a.has(this)){throw new TypeError("Expected `this` to be an instance of AbortSignal.")}const s=a.get(this);const l=s.indexOf(i);if(l>-1){s.splice(l,1)}}dispatchEvent(r){throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes.")}}function abortSignal(r){if(r.aborted){return}if(r.onabort){r.onabort.call(r)}const i=a.get(r);if(i){i.slice().forEach((i=>{i.call(r,{type:"abort"})}))}s.set(r,true)}class AbortError extends Error{constructor(r){super(r);this.name="AbortError"}}class AbortController{constructor(r){this._signal=new AbortSignal;if(!r){return}if(!Array.isArray(r)){r=arguments}for(const i of r){if(i.aborted){this.abort()}else{i.addEventListener("abort",(()=>{this.abort()}))}}}get signal(){return this._signal}abort(){abortSignal(this._signal)}static timeout(r){const i=new AbortSignal;const a=setTimeout(abortSignal,r,i);if(typeof a.unref==="function"){a.unref()}return i}}i.AbortController=AbortController;i.AbortError=AbortError;i.AbortSignal=AbortSignal},48561:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(93677);class AzureKeyCredential{get key(){return this._key}constructor(r){if(!r){throw new Error("key must be a non-empty string")}this._key=r}update(r){this._key=r}}function isKeyCredential(r){return s.isObjectWithProperties(r,["key"])&&typeof r.key==="string"}class AzureNamedKeyCredential{get key(){return this._key}get name(){return this._name}constructor(r,i){if(!r||!i){throw new TypeError("name and key must be non-empty strings")}this._name=r;this._key=i}update(r,i){if(!r||!i){throw new TypeError("newName and newKey must be non-empty strings")}this._name=r;this._key=i}}function isNamedKeyCredential(r){return s.isObjectWithProperties(r,["name","key"])&&typeof r.key==="string"&&typeof r.name==="string"}class AzureSASCredential{get signature(){return this._signature}constructor(r){if(!r){throw new Error("shared access signature must be a non-empty string")}this._signature=r}update(r){if(!r){throw new Error("shared access signature must be a non-empty string")}this._signature=r}}function isSASCredential(r){return s.isObjectWithProperties(r,["signature"])&&typeof r.signature==="string"}function isTokenCredential(r){const i=r;return i&&typeof i.getToken==="function"&&(i.signRequest===undefined||i.getToken.length>0)}i.AzureKeyCredential=AzureKeyCredential;i.AzureNamedKeyCredential=AzureNamedKeyCredential;i.AzureSASCredential=AzureSASCredential;i.isKeyCredential=isKeyCredential;i.isNamedKeyCredential=isNamedKeyCredential;i.isSASCredential=isSASCredential;i.isTokenCredential=isTokenCredential},61889:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(50757);var l=a(73837);var c=a(56728);var p=a(82357);var d=a(93677);var u=a(91293);var A=a(48561);var h=a(22037);var g=a(13685);var y=a(95687);var E=a(78185);var b=a(70391);var C=a(12781);var v=a(97010);var B=a(18885);var I=a(54787);function _interopDefaultLegacy(r){return r&&typeof r==="object"&&"default"in r?r:{default:r}}function _interopNamespace(r){if(r&&r.__esModule)return r;var i=Object.create(null);if(r){Object.keys(r).forEach((function(a){if(a!=="default"){var s=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(i,a,s.get?s:{enumerable:true,get:function(){return r[a]}})}}))}i["default"]=r;return Object.freeze(i)}var w=_interopNamespace(p);var S=_interopNamespace(h);var Q=_interopNamespace(g);var x=_interopNamespace(y);var N=_interopNamespace(b);var R=_interopDefaultLegacy(v);var T=_interopDefaultLegacy(B);function getHeaderKey(r){return r.toLowerCase()}function isHttpHeadersLike(r){if(r&&typeof r==="object"){const i=r;if(typeof i.rawHeaders==="function"&&typeof i.clone==="function"&&typeof i.get==="function"&&typeof i.set==="function"&&typeof i.contains==="function"&&typeof i.remove==="function"&&typeof i.headersArray==="function"&&typeof i.headerValues==="function"&&typeof i.headerNames==="function"&&typeof i.toJson==="function"){return true}}return false}class HttpHeaders{constructor(r){this._headersMap={};if(r){for(const i in r){this.set(i,r[i])}}}set(r,i){this._headersMap[getHeaderKey(r)]={name:r,value:i.toString().trim()}}get(r){const i=this._headersMap[getHeaderKey(r)];return!i?undefined:i.value}contains(r){return!!this._headersMap[getHeaderKey(r)]}remove(r){const i=this.contains(r);delete this._headersMap[getHeaderKey(r)];return i}rawHeaders(){return this.toJson({preserveCase:true})}headersArray(){const r=[];for(const i in this._headersMap){r.push(this._headersMap[i])}return r}headerNames(){const r=[];const i=this.headersArray();for(let a=0;a{a=a.then(r)}));return a}function promiseToCallback(r){if(typeof r.then!=="function"){throw new Error("The provided input is not a Promise.")}return i=>{r.then((r=>i(undefined,r))).catch((r=>{i(r)}))}}function promiseToServiceCallback(r){if(typeof r.then!=="function"){throw new Error("The provided input is not a Promise.")}return i=>{r.then((r=>process.nextTick(i,undefined,r.parsedBody,r.request,r))).catch((r=>{process.nextTick(i,r)}))}}function prepareXMLRootList(r,i,a,s){if(!Array.isArray(r)){r=[r]}if(!a||!s){return{[i]:r}}const l={[i]:r};l[k]={[a]:s};return l}function applyMixins(r,i){const a=r;i.forEach((r=>{Object.getOwnPropertyNames(r.prototype).forEach((i=>{a.prototype[i]=r.prototype[i]}))}))}const P=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function isDuration(r){return P.test(r)}function replaceAll(r,i,a){return!r||!i?r:r.split(i).join(a||"")}function isPrimitiveType(r){return typeof r!=="object"&&typeof r!=="function"||r===null}function getEnvironmentValue(r){if(process.env[r]){return process.env[r]}else if(process.env[r.toLowerCase()]){return process.env[r.toLowerCase()]}return undefined}function isObject(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}class Serializer{constructor(r={},i){this.modelMappers=r;this.isXML=i}validateConstraints(r,i,a){const failValidation=(r,s)=>{throw new Error(`"${a}" with value "${i}" should satisfy the constraint "${r}": ${s}.`)};if(r.constraints&&i!=undefined){const a=i;const{ExclusiveMaximum:s,ExclusiveMinimum:l,InclusiveMaximum:c,InclusiveMinimum:p,MaxItems:d,MaxLength:u,MinItems:A,MinLength:h,MultipleOf:g,Pattern:y,UniqueItems:E}=r.constraints;if(s!=undefined&&a>=s){failValidation("ExclusiveMaximum",s)}if(l!=undefined&&a<=l){failValidation("ExclusiveMinimum",l)}if(c!=undefined&&a>c){failValidation("InclusiveMaximum",c)}if(p!=undefined&&ad){failValidation("MaxItems",d)}if(u!=undefined&&b.length>u){failValidation("MaxLength",u)}if(A!=undefined&&b.lengtha.indexOf(r)!==i))){failValidation("UniqueItems",E)}}}serialize(r,i,a,s={}){var l,c,p;const d={rootName:(l=s.rootName)!==null&&l!==void 0?l:"",includeRoot:(c=s.includeRoot)!==null&&c!==void 0?c:false,xmlCharKey:(p=s.xmlCharKey)!==null&&p!==void 0?p:_};let u={};const A=r.type.name;if(!a){a=r.serializedName}if(A.match(/^Sequence$/i)!==null){u=[]}if(r.isConstant){i=r.defaultValue}const{required:h,nullable:g}=r;if(h&&g&&i===undefined){throw new Error(`${a} cannot be undefined.`)}if(h&&!g&&i==undefined){throw new Error(`${a} cannot be null or undefined.`)}if(!h&&g===false&&i===null){throw new Error(`${a} cannot be null.`)}if(i==undefined){u=i}else{if(A.match(/^any$/i)!==null){u=i}else if(A.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)!==null){u=serializeBasicTypes(A,a,i)}else if(A.match(/^Enum$/i)!==null){const s=r;u=serializeEnumType(a,s.type.allowedValues,i)}else if(A.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)!==null){u=serializeDateTypes(A,i,a)}else if(A.match(/^ByteArray$/i)!==null){u=serializeByteArrayType(a,i)}else if(A.match(/^Base64Url$/i)!==null){u=serializeBase64UrlType(a,i)}else if(A.match(/^Sequence$/i)!==null){u=serializeSequenceType(this,r,i,a,Boolean(this.isXML),d)}else if(A.match(/^Dictionary$/i)!==null){u=serializeDictionaryType(this,r,i,a,Boolean(this.isXML),d)}else if(A.match(/^Composite$/i)!==null){u=serializeCompositeType(this,r,i,a,Boolean(this.isXML),d)}}return u}deserialize(r,i,a,s={}){var l,c,p;const d={rootName:(l=s.rootName)!==null&&l!==void 0?l:"",includeRoot:(c=s.includeRoot)!==null&&c!==void 0?c:false,xmlCharKey:(p=s.xmlCharKey)!==null&&p!==void 0?p:_};if(i==undefined){if(this.isXML&&r.type.name==="Sequence"&&!r.xmlIsWrapped){i=[]}if(r.defaultValue!==undefined){i=r.defaultValue}return i}let u;const A=r.type.name;if(!a){a=r.serializedName}if(A.match(/^Composite$/i)!==null){u=deserializeCompositeType(this,r,i,a,d)}else{if(this.isXML){const r=d.xmlCharKey;const a=i;if(a[k]!=undefined&&a[r]!=undefined){i=a[r]}}if(A.match(/^Number$/i)!==null){u=parseFloat(i);if(isNaN(u)){u=i}}else if(A.match(/^Boolean$/i)!==null){if(i==="true"){u=true}else if(i==="false"){u=false}else{u=i}}else if(A.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)!==null){u=i}else if(A.match(/^(Date|DateTime|DateTimeRfc1123)$/i)!==null){u=new Date(i)}else if(A.match(/^UnixTime$/i)!==null){u=unixTimeToDate(i)}else if(A.match(/^ByteArray$/i)!==null){u=decodeString(i)}else if(A.match(/^Base64Url$/i)!==null){u=base64UrlToByteArray(i)}else if(A.match(/^Sequence$/i)!==null){u=deserializeSequenceType(this,r,i,a,d)}else if(A.match(/^Dictionary$/i)!==null){u=deserializeDictionaryType(this,r,i,a,d)}}if(r.isConstant){u=r.defaultValue}return u}}function trimEnd(r,i){let a=r.length;while(a-1>=0&&r[a-1]===i){--a}return r.substr(0,a)}function bufferToBase64Url(r){if(!r){return undefined}if(!(r instanceof Uint8Array)){throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`)}const i=encodeByteArray(r);return trimEnd(i,"=").replace(/\+/g,"-").replace(/\//g,"_")}function base64UrlToByteArray(r){if(!r){return undefined}if(r&&typeof r.valueOf()!=="string"){throw new Error("Please provide an input of type string for converting to Uint8Array")}r=r.replace(/-/g,"+").replace(/_/g,"/");return decodeString(r)}function splitSerializeName(r){const i=[];let a="";if(r){const s=r.split(".");for(const r of s){if(r.charAt(r.length-1)==="\\"){a+=r.substr(0,r.length-1)+"."}else{a+=r;i.push(a);a=""}}}return i}function dateToUnixTime(r){if(!r){return undefined}if(typeof r.valueOf()==="string"){r=new Date(r)}return Math.floor(r.getTime()/1e3)}function unixTimeToDate(r){if(!r){return undefined}return new Date(r*1e3)}function serializeBasicTypes(r,i,a){if(a!==null&&a!==undefined){if(r.match(/^Number$/i)!==null){if(typeof a!=="number"){throw new Error(`${i} with value ${a} must be of type number.`)}}else if(r.match(/^String$/i)!==null){if(typeof a.valueOf()!=="string"){throw new Error(`${i} with value "${a}" must be of type string.`)}}else if(r.match(/^Uuid$/i)!==null){if(!(typeof a.valueOf()==="string"&&isValidUuid(a))){throw new Error(`${i} with value "${a}" must be of type string and a valid uuid.`)}}else if(r.match(/^Boolean$/i)!==null){if(typeof a!=="boolean"){throw new Error(`${i} with value ${a} must be of type boolean.`)}}else if(r.match(/^Stream$/i)!==null){const r=typeof a;if(r!=="string"&&r!=="function"&&!(a instanceof ArrayBuffer)&&!ArrayBuffer.isView(a)&&!((typeof Blob==="function"||typeof Blob==="object")&&a instanceof Blob)){throw new Error(`${i} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`)}}}return a}function serializeEnumType(r,i,a){if(!i){throw new Error(`Please provide a set of allowedValues to validate ${r} as an Enum Type.`)}const s=i.some((r=>{if(typeof r.valueOf()==="string"){return r.toLowerCase()===a.toLowerCase()}return r===a}));if(!s){throw new Error(`${a} is not a valid value for ${r}. The valid values are: ${JSON.stringify(i)}.`)}return a}function serializeByteArrayType(r,i){let a="";if(i!=undefined){if(!(i instanceof Uint8Array)){throw new Error(`${r} must be of type Uint8Array.`)}a=encodeByteArray(i)}return a}function serializeBase64UrlType(r,i){let a="";if(i!=undefined){if(!(i instanceof Uint8Array)){throw new Error(`${r} must be of type Uint8Array.`)}a=bufferToBase64Url(i)||""}return a}function serializeDateTypes(r,i,a){if(i!=undefined){if(r.match(/^Date$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${a} must be an instanceof Date or a string in ISO8601 format.`)}i=i instanceof Date?i.toISOString().substring(0,10):new Date(i).toISOString().substring(0,10)}else if(r.match(/^DateTime$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${a} must be an instanceof Date or a string in ISO8601 format.`)}i=i instanceof Date?i.toISOString():new Date(i).toISOString()}else if(r.match(/^DateTimeRfc1123$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${a} must be an instanceof Date or a string in RFC-1123 format.`)}i=i instanceof Date?i.toUTCString():new Date(i).toUTCString()}else if(r.match(/^UnixTime$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${a} must be an instanceof Date or a string in RFC-1123/ISO8601 format `+`for it to be serialized in UnixTime/Epoch format.`)}i=dateToUnixTime(i)}else if(r.match(/^TimeSpan$/i)!==null){if(!isDuration(i)){throw new Error(`${a} must be a string in ISO 8601 format. Instead was "${i}".`)}}}return i}function serializeSequenceType(r,i,a,s,l,c){if(!Array.isArray(a)){throw new Error(`${s} must be of type Array.`)}const p=i.type.element;if(!p||typeof p!=="object"){throw new Error(`element" metadata for an Array must be defined in the `+`mapper and it must of type "object" in ${s}.`)}const d=[];for(let i=0;ir!==l));if(d){p[l]=r.serialize(u,a[l],s+'["'+l+'"]',c)}}}return p}return a}function getXmlObjectValue(r,i,a,s){if(!a||!r.xmlNamespace){return i}const l=r.xmlNamespacePrefix?`xmlns:${r.xmlNamespacePrefix}`:"xmlns";const c={[l]:r.xmlNamespace};if(["Composite"].includes(r.type.name)){if(i[k]){return i}else{const r=Object.assign({},i);r[k]=c;return r}}const p={};p[s.xmlCharKey]=i;p[k]=c;return p}function isSpecialXmlProperty(r,i){return[k,i.xmlCharKey].includes(r)}function deserializeCompositeType(r,i,a,s,l){var c,p;const d=(c=l.xmlCharKey)!==null&&c!==void 0?c:_;if(getPolymorphicDiscriminatorRecursively(r,i)){i=getPolymorphicMapper(r,i,a,"serializedName")}const u=resolveModelProperties(r,i,s);let A={};const h=[];for(const c of Object.keys(u)){const g=u[c];const y=splitSerializeName(u[c].serializedName);h.push(y[0]);const{serializedName:E,xmlName:b,xmlElementName:C}=g;let v=s;if(E!==""&&E!==undefined){v=s+"."+E}const B=g.headerCollectionPrefix;if(B){const i={};for(const s of Object.keys(a)){if(s.startsWith(B)){i[s.substring(B.length)]=r.deserialize(g.type.value,a[s],v,l)}h.push(s)}A[c]=i}else if(r.isXML){if(g.xmlIsAttribute&&a[k]){A[c]=r.deserialize(g,a[k][b],v,l)}else if(g.xmlIsMsText){if(a[d]!==undefined){A[c]=a[d]}else if(typeof a==="string"){A[c]=a}}else{const i=C||b||E;if(g.xmlIsWrapped){const i=a[b];const s=(p=i===null||i===void 0?void 0:i[C])!==null&&p!==void 0?p:[];A[c]=r.deserialize(g,s,v,l);h.push(b)}else{const s=a[i];A[c]=r.deserialize(g,s,v,l);h.push(i)}}}else{let s;let p=a;for(const r of y){if(!p)break;p=p[r]}s=p;const d=i.type.polymorphicDiscriminator;if(d&&c===d.clientName&&s==undefined){s=i.serializedName}let h;if(Array.isArray(a[c])&&u[c].serializedName===""){s=a[c];const i=r.deserialize(g,s,v,l);for(const[r,a]of Object.entries(A)){if(!Object.prototype.hasOwnProperty.call(i,r)){i[r]=a}}A=i}else if(s!==undefined||g.defaultValue!==undefined){h=r.deserialize(g,s,v,l);A[c]=h}}}const g=i.type.additionalProperties;if(g){const isAdditionalProperty=r=>{for(const i in u){const a=splitSerializeName(u[i].serializedName);if(a[0]===r){return false}}return true};for(const i in a){if(isAdditionalProperty(i)){A[i]=r.deserialize(g,a[i],s+'["'+i+'"]',l)}}}else if(a){for(const r of Object.keys(a)){if(A[r]===undefined&&!h.includes(r)&&!isSpecialXmlProperty(r,l)){A[r]=a[r]}}}return A}function deserializeDictionaryType(r,i,a,s,l){const c=i.type.value;if(!c||typeof c!=="object"){throw new Error(`"value" metadata for a Dictionary must be defined in the `+`mapper and it must of type "object" in ${s}`)}if(a){const i={};for(const p of Object.keys(a)){i[p]=r.deserialize(c,a[p],s,l)}return i}return a}function deserializeSequenceType(r,i,a,s,l){const c=i.type.element;if(!c||typeof c!=="object"){throw new Error(`element" metadata for an Array must be defined in the `+`mapper and it must of type "object" in ${s}`)}if(a){if(!Array.isArray(a)){a=[a]}const i=[];for(let p=0;p0}keys(){return Object.keys(this._rawQuery)}set(r,i){const a=i;if(r){if(a!==undefined&&a!==null){const i=Array.isArray(a)?a:a.toString();this._rawQuery[r]=i}else{delete this._rawQuery[r]}}}get(r){return r?this._rawQuery[r]:undefined}toString(){let r="";for(const i in this._rawQuery){if(r){r+="&"}const a=this._rawQuery[i];if(Array.isArray(a)){const s=[];for(const r of a){s.push(`${i}=${r}`)}r+=s.join("&")}else{r+=`${i}=${a}`}}return r}static parse(r){const i=new URLQuery;if(r){if(r.startsWith("?")){r=r.substring(1)}let a="ParameterName";let s="";let l="";for(let c=0;cisAlphaNumericCharacter(r)))}function readUntilCharacter(r,...i){return readWhile(r,(r=>i.indexOf(r)===-1))}function nextScheme(r){const i=readWhileLetterOrDigit(r);r._currentToken=URLToken.scheme(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else{r._currentState="HOST"}}function nextSchemeOrHost(r){const i=readUntilCharacter(r,":","/","?");if(!hasCurrentCharacter(r)){r._currentToken=URLToken.host(i);r._currentState="DONE"}else if(getCurrentCharacter(r)===":"){if(peekCharacters(r,3)==="://"){r._currentToken=URLToken.scheme(i);r._currentState="HOST"}else{r._currentToken=URLToken.host(i);r._currentState="PORT"}}else{r._currentToken=URLToken.host(i);if(getCurrentCharacter(r)==="/"){r._currentState="PATH"}else{r._currentState="QUERY"}}}function nextHost(r){if(peekCharacters(r,3)==="://"){nextCharacter(r,3)}const i=readUntilCharacter(r,":","/","?");r._currentToken=URLToken.host(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else if(getCurrentCharacter(r)===":"){r._currentState="PORT"}else if(getCurrentCharacter(r)==="/"){r._currentState="PATH"}else{r._currentState="QUERY"}}function nextPort(r){if(getCurrentCharacter(r)===":"){nextCharacter(r)}const i=readUntilCharacter(r,"/","?");r._currentToken=URLToken.port(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else if(getCurrentCharacter(r)==="/"){r._currentState="PATH"}else{r._currentState="QUERY"}}function nextPath(r){const i=readUntilCharacter(r,"?");r._currentToken=URLToken.path(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else{r._currentState="QUERY"}}function nextQuery(r){if(getCurrentCharacter(r)==="?"){nextCharacter(r)}const i=readRemaining(r);r._currentToken=URLToken.query(i);r._currentState="DONE"}function createProxyAgent(r,i,a){const s=URLBuilder.parse(i.host).getHost();if(!s){throw new Error("Expecting a non-empty host in proxy settings.")}if(!isValidPort(i.port)){throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings.")}const l={proxy:{host:s,port:i.port,headers:a&&a.rawHeaders()||{}}};if(i.username&&i.password){l.proxy.proxyAuth=`${i.username}:${i.password}`}else if(i.username){l.proxy.proxyAuth=`${i.username}`}const c=isUrlHttps(r);const p=isUrlHttps(i.host);const d={isHttps:c,agent:createTunnel(c,p,l)};return d}function isUrlHttps(r){const i=URLBuilder.parse(r).getScheme()||"";return i.toLowerCase()==="https"}function createTunnel(r,i,a){if(r&&i){return N.httpsOverHttps(a)}else if(r&&!i){return N.httpsOverHttp(a)}else if(!r&&i){return N.httpOverHttps(a)}else{return N.httpOverHttp(a)}}function isValidPort(r){return 0<=r&&r<=65535}const M="REDACTED";const U=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"];const q=["api-version"];class Sanitizer{constructor({allowedHeaderNames:r=[],allowedQueryParameters:i=[]}={}){r=Array.isArray(r)?U.concat(r):U;i=Array.isArray(i)?q.concat(i):q;this.allowedHeaderNames=new Set(r.map((r=>r.toLowerCase())));this.allowedQueryParameters=new Set(i.map((r=>r.toLowerCase())))}sanitize(r){const i=new Set;return JSON.stringify(r,((r,a)=>{if(a instanceof Error){return Object.assign(Object.assign({},a),{name:a.name,message:a.message})}if(r==="_headersMap"){return this.sanitizeHeaders(a)}else if(r==="url"){return this.sanitizeUrl(a)}else if(r==="query"){return this.sanitizeQuery(a)}else if(r==="body"){return undefined}else if(r==="response"){return undefined}else if(r==="operationSpec"){return undefined}else if(Array.isArray(a)||isObject(a)){if(i.has(a)){return"[Circular]"}i.add(a)}return a}),2)}sanitizeHeaders(r){return this.sanitizeObject(r,this.allowedHeaderNames,((r,i)=>r[i].value))}sanitizeQuery(r){return this.sanitizeObject(r,this.allowedQueryParameters,((r,i)=>r[i]))}sanitizeObject(r,i,a){if(typeof r!=="object"||r===null){return r}const s={};for(const l of Object.keys(r)){if(i.has(l.toLowerCase())){s[l]=a(r,l)}else{s[l]=M}}return s}sanitizeUrl(r){if(typeof r!=="string"||r===null){return r}const i=URLBuilder.parse(r);const a=i.getQuery();if(!a){return r}const s=URLQuery.parse(a);for(const r of s.keys()){if(!this.allowedQueryParameters.has(r.toLowerCase())){s.set(r,M)}}i.setQuery(s.toString());return i.toString()}}const H=l.inspect.custom;const j=new Sanitizer;class RestError extends Error{constructor(r,i,a,s,l){super(r);this.name="RestError";this.code=i;this.statusCode=a;this.request=s;this.response=l;Object.setPrototypeOf(this,RestError.prototype)}[H](){return`RestError: ${this.message} \n ${j.sanitize(this)}`}}RestError.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";RestError.PARSE_ERROR="PARSE_ERROR";const G=u.createClientLogger("core-http");function getCachedAgent(r,i){return r?i.httpsAgent:i.httpAgent}class ReportTransform extends C.Transform{constructor(r){super();this.progressCallback=r;this.loadedBytes=0}_transform(r,i,a){this.push(r);this.loadedBytes+=r.length;this.progressCallback({loadedBytes:this.loadedBytes});a(undefined)}}function isReadableStream(r){return r&&typeof r.pipe==="function"}function isStreamComplete(r,i){return new Promise((a=>{r.once("close",(()=>{i===null||i===void 0?void 0:i.abort();a()}));r.once("end",a);r.once("error",a)}))}function parseHeaders(r){const i=new HttpHeaders;r.forEach(((r,a)=>{i.set(a,r)}));return i}class NodeFetchHttpClient{constructor(){this.proxyAgentMap=new Map;this.keepAliveAgents={}}async sendRequest(r){var i;if(!r&&typeof r!=="object"){throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object.")}const a=new E.AbortController;let s;if(r.abortSignal){if(r.abortSignal.aborted){throw new E.AbortError("The operation was aborted.")}s=r=>{if(r.type==="abort"){a.abort()}};r.abortSignal.addEventListener("abort",s)}if(r.timeout){setTimeout((()=>{a.abort()}),r.timeout)}if(r.formData){const i=r.formData;const a=new R["default"];const appendFormValue=(r,i)=>{if(typeof i==="function"){i=i()}if(i&&Object.prototype.hasOwnProperty.call(i,"value")&&Object.prototype.hasOwnProperty.call(i,"options")){a.append(r,i.value,i.options)}else{a.append(r,i)}};for(const r of Object.keys(i)){const a=i[r];if(Array.isArray(a)){for(let i=0;i{var i;(i=r.abortSignal)===null||i===void 0?void 0:i.removeEventListener("abort",s);return})).catch((r=>{G.warning("Error when cleaning up abortListener on httpRequest",r)}))}}}getOrCreateAgent(r){var i;const a=isUrlHttps(r.url);if(r.proxySettings){const{host:s,port:l,username:c,password:p}=r.proxySettings;const d=`${s}:${l}:${c}:${p}`;const u=(i=this.proxyAgentMap.get(d))!==null&&i!==void 0?i:{};let A=getCachedAgent(a,u);if(A){return A}const h=createProxyAgent(r.url,r.proxySettings,r.headers);A=h.agent;if(h.isHttps){u.httpsAgent=h.agent}else{u.httpAgent=h.agent}this.proxyAgentMap.set(d,u);return A}else if(r.keepAlive){let i=getCachedAgent(a,this.keepAliveAgents);if(i){return i}const s={keepAlive:r.keepAlive};if(a){i=this.keepAliveAgents.httpsAgent=new x.Agent(s)}else{i=this.keepAliveAgents.httpAgent=new Q.Agent(s)}return i}else{return a?x.globalAgent:Q.globalAgent}}async fetch(r,i){return T["default"](r,i)}async prepareRequest(r){const i={};i.agent=this.getOrCreateAgent(r);i.compress=r.decompressResponse;return i}async processRequest(r){}}i.HttpPipelineLogLevel=void 0;(function(r){r[r["OFF"]=0]="OFF";r[r["ERROR"]=1]="ERROR";r[r["WARNING"]=2]="WARNING";r[r["INFO"]=3]="INFO"})(i.HttpPipelineLogLevel||(i.HttpPipelineLogLevel={}));function operationOptionsToRequestOptionsBase(r){const{requestOptions:i,tracingOptions:a}=r,s=c.__rest(r,["requestOptions","tracingOptions"]);let l=s;if(i){l=Object.assign(Object.assign({},l),i)}if(a){l.tracingContext=a.tracingContext;l.spanOptions=a===null||a===void 0?void 0:a.spanOptions}return l}class BaseRequestPolicy{constructor(r,i){this._nextPolicy=r;this._options=i}shouldLog(r){return this._options.shouldLog(r)}log(r,i){this._options.log(r,i)}}class RequestPolicyOptions{constructor(r){this._logger=r}shouldLog(r){return!!this._logger&&r!==i.HttpPipelineLogLevel.OFF&&r<=this._logger.minimumLogLevel}log(r,i){if(this._logger&&this.shouldLog(r)){this._logger.log(r,i)}}}const z={explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:k,explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:undefined,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:undefined,attrValueProcessors:undefined,tagNameProcessors:undefined,valueProcessors:undefined,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:undefined,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false};const V=Object.assign({},z);V.explicitArray=false;const J=Object.assign({},z);J.explicitArray=false;J.renderOpts={pretty:false};function stringifyXML(r,i={}){var a;J.rootName=i.rootName;J.charkey=(a=i.xmlCharKey)!==null&&a!==void 0?a:_;const s=new w.Builder(J);return s.buildObject(r)}function parseXML(r,i={}){var a;V.explicitRoot=!!i.includeRoot;V.charkey=(a=i.xmlCharKey)!==null&&a!==void 0?a:_;const s=new w.Parser(V);return new Promise(((i,a)=>{if(!r){a(new Error("Document is empty"))}else{s.parseString(r,((r,s)=>{if(r){a(r)}else{i(s)}}))}}))}function deserializationPolicy(r,i){return{create:(a,s)=>new DeserializationPolicy(a,s,r,i)}}const Y=["application/json","text/json"];const W=["application/xml","application/atom+xml"];const X={expectedContentTypes:{json:Y,xml:W}};class DeserializationPolicy extends BaseRequestPolicy{constructor(r,i,a,s={}){var l;super(r,i);this.jsonContentTypes=a&&a.json||Y;this.xmlContentTypes=a&&a.xml||W;this.xmlCharKey=(l=s.xmlCharKey)!==null&&l!==void 0?l:_}async sendRequest(r){return this._nextPolicy.sendRequest(r).then((r=>deserializeResponseBody(this.jsonContentTypes,this.xmlContentTypes,r,{xmlCharKey:this.xmlCharKey})))}}function getOperationResponse(r){let i;const a=r.request;const s=a.operationSpec;if(s){const l=a.operationResponseGetter;if(!l){i=s.responses[r.status]}else{i=l(s,r)}}return i}function shouldDeserializeResponse(r){const i=r.request.shouldDeserialize;let a;if(i===undefined){a=true}else if(typeof i==="boolean"){a=i}else{a=i(r)}return a}function deserializeResponseBody(r,i,a,s={}){var l,c,p;const d={rootName:(l=s.rootName)!==null&&l!==void 0?l:"",includeRoot:(c=s.includeRoot)!==null&&c!==void 0?c:false,xmlCharKey:(p=s.xmlCharKey)!==null&&p!==void 0?p:_};return parse(r,i,a,d).then((r=>{if(!shouldDeserializeResponse(r)){return r}const i=r.request.operationSpec;if(!i||!i.responses){return r}const l=getOperationResponse(r);const{error:c,shouldReturnResponse:p}=handleErrorResponse(r,i,l);if(c){throw c}else if(p){return r}if(l){if(l.bodyMapper){let a=r.parsedBody;if(i.isXML&&l.bodyMapper.type.name===L.Sequence){a=typeof a==="object"?a[l.bodyMapper.xmlElementName]:[]}try{r.parsedBody=i.serializer.deserialize(l.bodyMapper,a,"operationRes.parsedBody",s)}catch(i){const a=new RestError(`Error ${i} occurred in deserializing the responseBody - ${r.bodyAsText}`,undefined,r.status,r.request,r);throw a}}else if(i.httpMethod==="HEAD"){r.parsedBody=a.status>=200&&a.status<300}if(l.headersMapper){r.parsedHeaders=i.serializer.deserialize(l.headersMapper,r.headers.toJson(),"operationRes.parsedHeaders",s)}}return r}))}function isOperationSpecEmpty(r){const i=Object.keys(r.responses);return i.length===0||i.length===1&&i[0]==="default"}function handleErrorResponse(r,i,a){var s;const l=200<=r.status&&r.status<300;const c=isOperationSpecEmpty(i)?l:!!a;if(c){if(a){if(!a.isError){return{error:null,shouldReturnResponse:false}}}else{return{error:null,shouldReturnResponse:false}}}const p=a!==null&&a!==void 0?a:i.responses.default;const d=((s=r.request.streamResponseStatusCodes)===null||s===void 0?void 0:s.has(r.status))||r.request.streamResponseBody;const u=d?`Unexpected status code: ${r.status}`:r.bodyAsText;const A=new RestError(u,undefined,r.status,r.request,r);if(!p){throw A}const h=p.bodyMapper;const g=p.headersMapper;try{if(r.parsedBody){const a=r.parsedBody;let s;if(h){let r=a;if(i.isXML&&h.type.name===L.Sequence){r=typeof a==="object"?a[h.xmlElementName]:[]}s=i.serializer.deserialize(h,r,"error.response.parsedBody")}const l=a.error||s||a;A.code=l.code;if(l.message){A.message=l.message}if(h){A.response.parsedBody=s}}if(r.headers&&g){A.response.parsedHeaders=i.serializer.deserialize(g,r.headers.toJson(),"operationRes.parsedHeaders")}}catch(i){A.message=`Error "${i.message}" occurred in deserializing the responseBody - "${r.bodyAsText}" for the default response.`}return{error:A,shouldReturnResponse:false}}function parse(r,i,a,s){var l;const errorHandler=r=>{const i=`Error "${r}" occurred while parsing the response body - ${a.bodyAsText}.`;const s=r.code||RestError.PARSE_ERROR;const l=new RestError(i,s,a.status,a.request,a);return Promise.reject(l)};const c=((l=a.request.streamResponseStatusCodes)===null||l===void 0?void 0:l.has(a.status))||a.request.streamResponseBody;if(!c&&a.bodyAsText){const l=a.bodyAsText;const c=a.headers.get("Content-Type")||"";const p=!c?[]:c.split(";").map((r=>r.toLowerCase()));if(p.length===0||p.some((i=>r.indexOf(i)!==-1))){return new Promise((r=>{a.parsedBody=JSON.parse(l);r(a)})).catch(errorHandler)}else if(p.some((r=>i.indexOf(r)!==-1))){return parseXML(l,s).then((r=>{a.parsedBody=r;return a})).catch(errorHandler)}}return Promise.resolve(a)}const K={enable:true};function keepAlivePolicy(r){return{create:(i,a)=>new KeepAlivePolicy(i,a,r||K)}}class KeepAlivePolicy extends BaseRequestPolicy{constructor(r,i,a){super(r,i);this.keepAliveOptions=a}async sendRequest(r){r.keepAlive=this.keepAliveOptions.enable;return this._nextPolicy.sendRequest(r)}}const $=["GET","HEAD"];const Z={handleRedirects:true,maxRetries:20};function redirectPolicy(r=20){return{create:(i,a)=>new RedirectPolicy(i,a,r)}}class RedirectPolicy extends BaseRequestPolicy{constructor(r,i,a=20){super(r,i);this.maxRetries=a}sendRequest(r){return this._nextPolicy.sendRequest(r).then((r=>handleRedirect(this,r,0)))}}function handleRedirect(r,i,a){const{request:s,status:l}=i;const c=i.headers.get("location");if(c&&(l===300||l===301&&$.includes(s.method)||l===302&&$.includes(s.method)||l===303&&s.method==="POST"||l===307)&&(!r.maxRetries||ahandleRedirect(r,i,a+1)))}return Promise.resolve(i)}const ee=3;const te=1e3*30;const re=1e3*90;const ie=1e3*3;function isNumber(r){return typeof r==="number"}function shouldRetry(r,i,a,s,l){if(!i(s,l)){return false}return a.retryCountnew ExponentialRetryPolicy(s,l,r,i,a)}}i.RetryMode=void 0;(function(r){r[r["Exponential"]=0]="Exponential"})(i.RetryMode||(i.RetryMode={}));const ne={maxRetries:ee,retryDelayInMs:te,maxRetryDelayInMs:re};class ExponentialRetryPolicy extends BaseRequestPolicy{constructor(r,i,a,s,l){super(r,i);this.retryCount=isNumber(a)?a:ee;this.retryInterval=isNumber(s)?s:te;this.maxRetryInterval=isNumber(l)?l:re}sendRequest(r){return this._nextPolicy.sendRequest(r.clone()).then((i=>retry$1(this,r,i))).catch((i=>retry$1(this,r,i.response,undefined,i)))}}async function retry$1(r,i,a,s,l){function shouldPolicyRetry(r){const i=r===null||r===void 0?void 0:r.status;if(i===503&&(a===null||a===void 0?void 0:a.headers.get(D.HeaderConstants.RETRY_AFTER))){return false}if(i===undefined||i<500&&i!==408||i===501||i===505){return false}return true}s=updateRetryData({retryInterval:r.retryInterval,minRetryInterval:0,maxRetryInterval:r.maxRetryInterval},s,l);const c=i.abortSignal&&i.abortSignal.aborted;if(!c&&shouldRetry(r.retryCount,shouldPolicyRetry,s,a)){G.info(`Retrying request in ${s.retryInterval}`);try{await d.delay(s.retryInterval);const a=await r._nextPolicy.sendRequest(i.clone());return retry$1(r,i,a,s)}catch(l){return retry$1(r,i,a,s,l)}}else if(c||l||!a){const r=s.error||new RestError("Failed to send the request.",RestError.REQUEST_SEND_ERROR,a&&a.status,a&&a.request,a);throw r}else{return a}}function logPolicy(r={}){return{create:(i,a)=>new LogPolicy(i,a,r)}}class LogPolicy extends BaseRequestPolicy{constructor(r,i,{logger:a=G.info,allowedHeaderNames:s=[],allowedQueryParameters:l=[]}={}){super(r,i);this.logger=a;this.sanitizer=new Sanitizer({allowedHeaderNames:s,allowedQueryParameters:l})}get allowedHeaderNames(){return this.sanitizer.allowedHeaderNames}set allowedHeaderNames(r){this.sanitizer.allowedHeaderNames=r}get allowedQueryParameters(){return this.sanitizer.allowedQueryParameters}set allowedQueryParameters(r){this.sanitizer.allowedQueryParameters=r}sendRequest(r){if(!this.logger.enabled)return this._nextPolicy.sendRequest(r);this.logRequest(r);return this._nextPolicy.sendRequest(r).then((r=>this.logResponse(r)))}logRequest(r){this.logger(`Request: ${this.sanitizer.sanitize(r)}`)}logResponse(r){this.logger(`Response status code: ${r.status}`);this.logger(`Headers: ${this.sanitizer.sanitize(r.headers)}`);return r}}function getPathStringFromParameter(r){return getPathStringFromParameterPath(r.parameterPath,r.mapper)}function getPathStringFromParameterPath(r,i){let a;if(typeof r==="string"){a=r}else if(Array.isArray(r)){a=r.join(".")}else{a=i.serializedName}return a}function getStreamResponseStatusCodes(r){const i=new Set;for(const a in r.responses){const s=r.responses[a];if(s.bodyMapper&&s.bodyMapper.type.name===L.Stream){i.add(Number(a))}}return i}function getDefaultUserAgentKey(){return D.HeaderConstants.USER_AGENT}function getPlatformSpecificData(){const r={key:"Node",value:process.version};const i={key:"OS",value:`(${S.arch()}-${S.type()}-${S.release()})`};return[r,i]}function getRuntimeInfo(){const r={key:"core-http",value:D.coreHttpVersion};return[r]}function getUserAgentString(r,i=" ",a="/"){return r.map((r=>{const i=r.value?`${a}${r.value}`:"";return`${r.key}${i}`})).join(i)}const ae=getDefaultUserAgentKey;function getDefaultUserAgentValue(){const r=getRuntimeInfo();const i=getPlatformSpecificData();const a=getUserAgentString(r.concat(i));return a}function userAgentPolicy(r){const i=!r||r.key===undefined||r.key===null?getDefaultUserAgentKey():r.key;const a=!r||r.value===undefined||r.value===null?getDefaultUserAgentValue():r.value;return{create:(r,s)=>new UserAgentPolicy(r,s,i,a)}}class UserAgentPolicy extends BaseRequestPolicy{constructor(r,i,a,s){super(r,i);this._nextPolicy=r;this._options=i;this.headerKey=a;this.headerValue=s}sendRequest(r){this.addUserAgentHeader(r);return this._nextPolicy.sendRequest(r)}addUserAgentHeader(r){if(!r.headers){r.headers=new HttpHeaders}if(!r.headers.get(this.headerKey)&&this.headerValue){r.headers.set(this.headerKey,this.headerValue)}}}i.QueryCollectionFormat=void 0;(function(r){r["Csv"]=",";r["Ssv"]=" ";r["Tsv"]="\t";r["Pipes"]="|";r["Multi"]="Multi"})(i.QueryCollectionFormat||(i.QueryCollectionFormat={}));const se={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function beginRefresh(r,i,a){async function tryGetAccessToken(){if(Date.now()r.getToken(i,a);s=beginRefresh(tryGetAccessToken,c.retryIntervalInMs,(d=l===null||l===void 0?void 0:l.expiresOnTimestamp)!==null&&d!==void 0?d:Date.now()).then((r=>{s=null;l=r;return l})).catch((r=>{s=null;l=null;throw r}))}return s}return async r=>{if(p.mustRefresh)return refresh(r);if(p.shouldRefresh){refresh(r)}return l}}function bearerTokenAuthenticationPolicy(r,i){const a=createTokenCycler(r,i);class BearerTokenAuthenticationPolicy extends BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){if(!r.url.toLowerCase().startsWith("https://")){throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.")}const{token:i}=await a({abortSignal:r.abortSignal,tracingOptions:{tracingContext:r.tracingContext}});r.headers.set(D.HeaderConstants.AUTHORIZATION,`Bearer ${i}`);return this._nextPolicy.sendRequest(r)}}return{create:(r,i)=>new BearerTokenAuthenticationPolicy(r,i)}}function disableResponseDecompressionPolicy(){return{create:(r,i)=>new DisableResponseDecompressionPolicy(r,i)}}class DisableResponseDecompressionPolicy extends BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){r.decompressResponse=false;return this._nextPolicy.sendRequest(r)}}function generateClientRequestIdPolicy(r="x-ms-client-request-id"){return{create:(i,a)=>new GenerateClientRequestIdPolicy(i,a,r)}}class GenerateClientRequestIdPolicy extends BaseRequestPolicy{constructor(r,i,a){super(r,i);this._requestIdHeaderName=a}sendRequest(r){if(!r.headers.contains(this._requestIdHeaderName)){r.headers.set(this._requestIdHeaderName,r.requestId)}return this._nextPolicy.sendRequest(r)}}let oe;function getCachedDefaultHttpClient(){if(!oe){oe=new NodeFetchHttpClient}return oe}function ndJsonPolicy(){return{create:(r,i)=>new NdJsonPolicy(r,i)}}class NdJsonPolicy extends BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){if(typeof r.body==="string"&&r.body.startsWith("[")){const i=JSON.parse(r.body);if(Array.isArray(i)){r.body=i.map((r=>JSON.stringify(r)+"\n")).join("")}}return this._nextPolicy.sendRequest(r)}}const le=[];let ce=false;const pe=new Map;function loadEnvironmentProxyValue(){if(!process){return undefined}const r=getEnvironmentValue(D.HTTPS_PROXY);const i=getEnvironmentValue(D.ALL_PROXY);const a=getEnvironmentValue(D.HTTP_PROXY);return r||i||a}function isBypassed(r,i,a){if(i.length===0){return false}const s=URLBuilder.parse(r).getHost();if(a===null||a===void 0?void 0:a.has(s)){return a.get(s)}let l=false;for(const r of i){if(r[0]==="."){if(s.endsWith(r)){l=true}else{if(s.length===r.length-1&&s===r.slice(1)){l=true}}}else{if(s===r){l=true}}}a===null||a===void 0?void 0:a.set(s,l);return l}function loadNoProxy(){const r=getEnvironmentValue(D.NO_PROXY);ce=true;if(r){return r.split(",").map((r=>r.trim())).filter((r=>r.length))}return[]}function getDefaultProxySettings(r){if(!r){r=loadEnvironmentProxyValue();if(!r){return undefined}}const{username:i,password:a,urlWithoutAuth:s}=extractAuthFromUrl(r);const l=URLBuilder.parse(s);const c=l.getScheme()?l.getScheme()+"://":"";return{host:c+l.getHost(),port:Number.parseInt(l.getPort()||"80"),username:i,password:a}}function proxyPolicy(r,i){if(!r){r=getDefaultProxySettings()}if(!ce){le.push(...loadNoProxy())}return{create:(a,s)=>new ProxyPolicy(a,s,r,i===null||i===void 0?void 0:i.customNoProxyList)}}function extractAuthFromUrl(r){const i=r.indexOf("@");if(i===-1){return{urlWithoutAuth:r}}const a=r.indexOf("://");const s=a!==-1?a+3:0;const l=r.substring(s,i);const c=l.indexOf(":");const p=c!==-1;const d=p?l.substring(0,c):l;const u=p?l.substring(c+1):undefined;const A=r.substring(0,s)+r.substring(i+1);return{username:d,password:u,urlWithoutAuth:A}}class ProxyPolicy extends BaseRequestPolicy{constructor(r,i,a,s){super(r,i);this.proxySettings=a;this.customNoProxyList=s}sendRequest(r){var i;if(!r.proxySettings&&!isBypassed(r.url,(i=this.customNoProxyList)!==null&&i!==void 0?i:le,this.customNoProxyList?undefined:pe)){r.proxySettings=this.proxySettings}return this._nextPolicy.sendRequest(r)}}function rpRegistrationPolicy(r=30){return{create:(i,a)=>new RPRegistrationPolicy(i,a,r)}}class RPRegistrationPolicy extends BaseRequestPolicy{constructor(r,i,a=30){super(r,i);this._retryTimeout=a}sendRequest(r){return this._nextPolicy.sendRequest(r.clone()).then((i=>registerIfNeeded(this,r,i)))}}function registerIfNeeded(r,i,a){if(a.status===409){const s=checkRPNotRegisteredError(a.bodyAsText);if(s){const l=extractSubscriptionUrl(i.url);return registerRP(r,l,s,i).catch((()=>false)).then((s=>{if(s){i.headers.set("x-ms-client-request-id",generateUuid());return r._nextPolicy.sendRequest(i.clone())}return a}))}}return Promise.resolve(a)}function getRequestEssentials(r,i=false){const a=r.clone();if(i){a.url=r.url}a.headers.set("x-ms-client-request-id",generateUuid());a.headers.set("Content-Type","application/json; charset=utf-8");return a}function checkRPNotRegisteredError(r){let i,a;if(r){try{a=JSON.parse(r)}catch(r){}if(a&&a.error&&a.error.message&&a.error.code&&a.error.code==="MissingSubscriptionRegistration"){const r=a.error.message.match(/.*'(.*)'/i);if(r){i=r.pop()}}}return i}function extractSubscriptionUrl(r){let i;const a=r.match(/.*\/subscriptions\/[a-f0-9-]+\//gi);if(a&&a[0]){i=a[0]}else{throw new Error(`Unable to extract subscriptionId from the given url - ${r}.`)}return i}async function registerRP(r,i,a,s){const l=`${i}providers/${a}/register?api-version=2016-02-01`;const c=`${i}providers/${a}?api-version=2016-02-01`;const p=getRequestEssentials(s);p.method="POST";p.url=l;const d=await r._nextPolicy.sendRequest(p);if(d.status!==200){throw new Error(`Autoregistration of ${a} failed. Please try registering manually.`)}return getRegistrationStatus(r,c,s)}async function getRegistrationStatus(r,i,a){const s=getRequestEssentials(a);s.url=i;s.method="GET";const l=await r._nextPolicy.sendRequest(s);const c=l.parsedBody;if(l.parsedBody&&c.registrationState&&c.registrationState==="Registered"){return true}else{await d.delay(r._retryTimeout*1e3);return getRegistrationStatus(r,i,a)}}function signingPolicy(r){return{create:(i,a)=>new SigningPolicy(i,a,r)}}class SigningPolicy extends BaseRequestPolicy{constructor(r,i,a){super(r,i);this.authenticationProvider=a}signRequest(r){return this.authenticationProvider.signRequest(r)}sendRequest(r){return this.signRequest(r).then((r=>this._nextPolicy.sendRequest(r)))}}function systemErrorRetryPolicy(r,i,a,s){return{create:(l,c)=>new SystemErrorRetryPolicy(l,c,r,i,a,s)}}class SystemErrorRetryPolicy extends BaseRequestPolicy{constructor(r,i,a,s,l,c){super(r,i);this.retryCount=isNumber(a)?a:ee;this.retryInterval=isNumber(s)?s:te;this.minRetryInterval=isNumber(l)?l:ie;this.maxRetryInterval=isNumber(c)?c:re}sendRequest(r){return this._nextPolicy.sendRequest(r.clone()).catch((i=>retry(this,r,i.response,i)))}}async function retry(r,i,a,s,l){l=updateRetryData(r,l,s);function shouldPolicyRetry(r,i){if(i&&i.code&&(i.code==="ETIMEDOUT"||i.code==="ESOCKETTIMEDOUT"||i.code==="ECONNREFUSED"||i.code==="ECONNRESET"||i.code==="ENOENT")){return true}return false}if(shouldRetry(r.retryCount,shouldPolicyRetry,l,a,s)){try{await d.delay(l.retryInterval);return r._nextPolicy.sendRequest(i.clone())}catch(s){return retry(r,i,a,s,l)}}else{if(s){return Promise.reject(l.error)}return a}}const de=3;const ue=D.HttpConstants.StatusCodes;function throttlingRetryPolicy(){return{create:(r,i)=>new ThrottlingRetryPolicy(r,i)}}const Ae="The operation was aborted.";class ThrottlingRetryPolicy extends BaseRequestPolicy{constructor(r,i,a){super(r,i);this.numberOfRetries=0;this._handleResponse=a||this._defaultResponseHandler}async sendRequest(r){const i=await this._nextPolicy.sendRequest(r.clone());if(i.status!==ue.TooManyRequests&&i.status!==ue.ServiceUnavailable){return i}else{return this._handleResponse(r,i)}}async _defaultResponseHandler(r,i){var a;const s=i.headers.get(D.HeaderConstants.RETRY_AFTER);if(s){const i=ThrottlingRetryPolicy.parseRetryAfterHeader(s);if(i){this.numberOfRetries+=1;await d.delay(i,{abortSignal:r.abortSignal,abortErrorMsg:Ae});if((a=r.abortSignal)===null||a===void 0?void 0:a.aborted){throw new E.AbortError(Ae)}if(this.numberOfRetries{let a=undefined;const s=this;const l=i;return{create(i,c){const p=getCredentialScopes(l,s.baseUri);if(!p){throw new Error(`When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy`)}if(a===undefined||a===null){a=bearerTokenAuthenticationPolicy(r,p)}return a.create(i,c)}}};s=wrappedPolicyFactory()}else if(r&&typeof r.signRequest==="function"){G.info("ServiceClient: creating signing policy from provided credentials");s=signingPolicy(r)}else if(r!==undefined&&r!==null){throw new Error("The credentials argument must implement the TokenCredential interface")}G.info("ServiceClient: using default request policies");a=createDefaultRequestPolicyFactories(s,i);if(i.requestPolicyFactories){const r=i.requestPolicyFactories(a);if(r){a=r}}}this._requestPolicyFactories=a}sendRequest(r){if(r===null||r===undefined||typeof r!=="object"){throw new Error("options cannot be null or undefined and it must be of type object.")}let i;try{if(isWebResourceLike(r)){r.validateRequestProperties();i=r}else{i=new WebResource;i=i.prepare(r)}}catch(r){return Promise.reject(r)}let a=this._httpClient;if(this._requestPolicyFactories&&this._requestPolicyFactories.length>0){for(let r=this._requestPolicyFactories.length-1;r>=0;--r){a=this._requestPolicyFactories[r].create(a,this._requestPolicyOptions)}}return a.sendRequest(i)}async sendOperationRequest(r,a,s){var l;if(typeof r.options==="function"){s=r.options;r.options=undefined}const c=(l=r.options)===null||l===void 0?void 0:l.serializerOptions;const p=new WebResource;let d;try{const s=a.baseUrl||this.baseUri;if(!s){throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.")}p.method=a.httpMethod;p.operationSpec=a;const l=URLBuilder.parse(s);if(a.path){l.appendPath(a.path)}if(a.urlParameters&&a.urlParameters.length>0){for(const i of a.urlParameters){let s=getOperationArgumentValueFromParameter(this,r,i,a.serializer);s=a.serializer.serialize(i.mapper,s,getPathStringFromParameter(i),c);if(!i.skipEncoding){s=encodeURIComponent(s)}l.replaceAll(`{${i.mapper.serializedName||getPathStringFromParameter(i)}}`,s)}}if(a.queryParameters&&a.queryParameters.length>0){for(const s of a.queryParameters){let p=getOperationArgumentValueFromParameter(this,r,s,a.serializer);if(p!==undefined&&p!==null){p=a.serializer.serialize(s.mapper,p,getPathStringFromParameter(s),c);if(s.collectionFormat!==undefined&&s.collectionFormat!==null){if(s.collectionFormat===i.QueryCollectionFormat.Multi){if(p.length===0){continue}else{for(const r in p){const i=p[r];p[r]=i===undefined||i===null?"":i.toString()}}}else if(s.collectionFormat===i.QueryCollectionFormat.Ssv||s.collectionFormat===i.QueryCollectionFormat.Tsv){p=p.join(s.collectionFormat)}}if(!s.skipEncoding){if(Array.isArray(p)){for(const r in p){if(p[r]!==undefined&&p[r]!==null){p[r]=encodeURIComponent(p[r])}}}else{p=encodeURIComponent(p)}}if(s.collectionFormat!==undefined&&s.collectionFormat!==null&&s.collectionFormat!==i.QueryCollectionFormat.Multi&&s.collectionFormat!==i.QueryCollectionFormat.Ssv&&s.collectionFormat!==i.QueryCollectionFormat.Tsv){p=p.join(s.collectionFormat)}l.setQueryParameter(s.mapper.serializedName||getPathStringFromParameter(s),p)}}}p.url=l.toString();const u=a.contentType||this.requestContentType;if(u&&a.requestBody){p.headers.set("Content-Type",u)}if(a.headerParameters){for(const i of a.headerParameters){let s=getOperationArgumentValueFromParameter(this,r,i,a.serializer);if(s!==undefined&&s!==null){s=a.serializer.serialize(i.mapper,s,getPathStringFromParameter(i),c);const r=i.mapper.headerCollectionPrefix;if(r){for(const i of Object.keys(s)){p.headers.set(r+i,s[i])}}else{p.headers.set(i.mapper.serializedName||getPathStringFromParameter(i),s)}}}}const A=r.options;if(A){if(A.customHeaders){for(const r in A.customHeaders){p.headers.set(r,A.customHeaders[r])}}if(A.abortSignal){p.abortSignal=A.abortSignal}if(A.timeout){p.timeout=A.timeout}if(A.onUploadProgress){p.onUploadProgress=A.onUploadProgress}if(A.onDownloadProgress){p.onDownloadProgress=A.onDownloadProgress}if(A.spanOptions){p.spanOptions=A.spanOptions}if(A.tracingContext){p.tracingContext=A.tracingContext}if(A.shouldDeserialize!==undefined&&A.shouldDeserialize!==null){p.shouldDeserialize=A.shouldDeserialize}}p.withCredentials=this._withCredentials;serializeRequestBody(this,p,r,a);if(p.streamResponseStatusCodes===undefined){p.streamResponseStatusCodes=getStreamResponseStatusCodes(a)}let h;let g;try{h=await this.sendRequest(p)}catch(r){g=r}if(g){if(g.response){g.details=flattenResponse(g.response,a.responses[g.statusCode]||a.responses["default"])}d=Promise.reject(g)}else{d=Promise.resolve(flattenResponse(h,a.responses[h.status]))}}catch(r){d=Promise.reject(r)}const u=s;if(u){d.then((r=>u(null,r._response.parsedBody,r._response.request,r._response))).catch((r=>u(r)))}return d}}function serializeRequestBody(r,i,a,s){var l,c,p,d,u,A;const h=(c=(l=a.options)===null||l===void 0?void 0:l.serializerOptions)!==null&&c!==void 0?c:{};const g={rootName:(p=h.rootName)!==null&&p!==void 0?p:"",includeRoot:(d=h.includeRoot)!==null&&d!==void 0?d:false,xmlCharKey:(u=h.xmlCharKey)!==null&&u!==void 0?u:_};const y=h.xmlCharKey;if(s.requestBody&&s.requestBody.mapper){i.body=getOperationArgumentValueFromParameter(r,a,s.requestBody,s.serializer);const l=s.requestBody.mapper;const{required:c,xmlName:p,xmlElementName:d,serializedName:u,xmlNamespace:h,xmlNamespacePrefix:E}=l;const b=l.type.name;try{if(i.body!==undefined&&i.body!==null||c){const r=getPathStringFromParameter(s.requestBody);i.body=s.serializer.serialize(l,i.body,r,g);const a=b===L.Stream;if(s.isXML){const r=E?`xmlns:${E}`:"xmlns";const s=getXmlValueWithNamespace(h,r,b,i.body,g);if(b===L.Sequence){i.body=stringifyXML(prepareXMLRootList(s,d||p||u,r,h),{rootName:p||u,xmlCharKey:y})}else if(!a){i.body=stringifyXML(s,{rootName:p||u,xmlCharKey:y})}}else if(b===L.String&&(((A=s.contentType)===null||A===void 0?void 0:A.match("text/plain"))||s.mediaType==="text")){return}else if(!a){i.body=JSON.stringify(i.body)}}}catch(r){throw new Error(`Error "${r.message}" occurred in serializing the payload - ${JSON.stringify(u,undefined," ")}.`)}}else if(s.formDataParameters&&s.formDataParameters.length>0){i.formData={};for(const l of s.formDataParameters){const c=getOperationArgumentValueFromParameter(r,a,l,s.serializer);if(c!==undefined&&c!==null){const r=l.mapper.serializedName||getPathStringFromParameter(l);i.formData[r]=s.serializer.serialize(l.mapper,c,getPathStringFromParameter(l),g)}}}}function getXmlValueWithNamespace(r,i,a,s,l){if(r&&!["Composite","Sequence","Dictionary"].includes(a)){const a={};a[l.xmlCharKey]=s;a[k]={[i]:r};return a}return s}function getValueOrFunctionResult(r,i){let a;if(typeof r==="string"){a=r}else{a=i();if(typeof r==="function"){a=r(a)}}return a}function createDefaultRequestPolicyFactories(r,i){const a=[];if(i.generateClientRequestIdHeader){a.push(generateClientRequestIdPolicy(i.clientRequestIdHeaderName))}if(r){a.push(r)}const s=getValueOrFunctionResult(i.userAgentHeaderName,ae);const l=getValueOrFunctionResult(i.userAgent,getDefaultUserAgentValue);if(s&&l){a.push(userAgentPolicy({key:s,value:l}))}a.push(redirectPolicy());a.push(rpRegistrationPolicy(i.rpRegistrationRetryTimeout));if(!i.noRetryPolicy){a.push(exponentialRetryPolicy());a.push(systemErrorRetryPolicy());a.push(throttlingRetryPolicy())}a.push(deserializationPolicy(i.deserializationContentTypes));if(d.isNode){a.push(proxyPolicy(i.proxySettings))}a.push(logPolicy({logger:G.info}));return a}function createPipelineFromOptions(r,i){const a=[];if(r.sendStreamingJson){a.push(ndJsonPolicy())}let s=undefined;if(r.userAgentOptions&&r.userAgentOptions.userAgentPrefix){const i=[];i.push(r.userAgentOptions.userAgentPrefix);const a=getDefaultUserAgentValue();if(i.indexOf(a)===-1){i.push(a)}s=i.join(" ")}const l=Object.assign(Object.assign({},K),r.keepAliveOptions);const c=Object.assign(Object.assign({},ne),r.retryOptions);const p=Object.assign(Object.assign({},Z),r.redirectOptions);if(d.isNode){a.push(proxyPolicy(r.proxyOptions))}const u=Object.assign(Object.assign({},X),r.deserializationOptions);const A=Object.assign({},r.loggingOptions);a.push(tracingPolicy({userAgent:s}),keepAlivePolicy(l),userAgentPolicy({value:s}),generateClientRequestIdPolicy(),deserializationPolicy(u.expectedContentTypes),throttlingRetryPolicy(),systemErrorRetryPolicy(),exponentialRetryPolicy(c.maxRetries,c.retryDelayInMs,c.maxRetryDelayInMs));if(p.handleRedirects){a.push(redirectPolicy(p.maxRetries))}if(i){a.push(i)}a.push(logPolicy(A));if(d.isNode&&r.decompressResponse===false){a.push(disableResponseDecompressionPolicy())}return{httpClient:r.httpClient,requestPolicyFactories:a}}function getOperationArgumentValueFromParameter(r,i,a,s){return getOperationArgumentValueFromParameterPath(r,i,a.parameterPath,a.mapper,s)}function getOperationArgumentValueFromParameterPath(r,i,a,s,l){var c;let p;if(typeof a==="string"){a=[a]}const d=(c=i.options)===null||c===void 0?void 0:c.serializerOptions;if(Array.isArray(a)){if(a.length>0){if(s.isConstant){p=s.defaultValue}else{let l=getPropertyFromParameterPath(i,a);if(!l.propertyFound){l=getPropertyFromParameterPath(r,a)}let c=false;if(!l.propertyFound){c=s.required||a[0]==="options"&&a.length===2}p=c?s.defaultValue:l.propertyValue}const c=getPathStringFromParameterPath(a,s);l.serialize(s,p,c,d)}}else{if(s.required){p={}}for(const c in a){const u=s.type.modelProperties[c];const A=a[c];const h=getOperationArgumentValueFromParameterPath(r,i,A,u,l);const g=getPathStringFromParameterPath(A,u);l.serialize(u,h,g,d);if(h!==undefined&&h!==null){if(!p){p={}}p[c]=h}}}return p}function getPropertyFromParameterPath(r,i){const a={propertyFound:false};let s=0;for(;sObject.defineProperty(i,"_response",{value:r});if(s){const i=s.type.name;if(i==="Stream"){return addOperationResponse(Object.assign(Object.assign({},a),{blobBody:r.blobBody,readableStreamBody:r.readableStreamBody}))}const l=i==="Composite"&&s.type.modelProperties||{};const c=Object.keys(l).some((r=>l[r].serializedName===""));if(i==="Sequence"||c){const i=[...r.parsedBody||[]];for(const a of Object.keys(l)){if(l[a].serializedName){i[a]=r.parsedBody[a]}}if(a){for(const r of Object.keys(a)){i[r]=a[r]}}addOperationResponse(i);return i}if(i==="Composite"||i==="Dictionary"){return addOperationResponse(Object.assign(Object.assign({},a),r.parsedBody))}}if(s||r.request.method==="HEAD"||isPrimitiveType(r.parsedBody)){return addOperationResponse(Object.assign(Object.assign({},a),{body:r.parsedBody}))}return addOperationResponse(Object.assign(Object.assign({},a),r.parsedBody))}function getCredentialScopes(r,i){if(r===null||r===void 0?void 0:r.credentialScopes){return r.credentialScopes}if(i){return`${i}/.default`}return undefined}function createSpanFunction(r){return I.createSpanFunction(r)}const fe=2*60*1e3;class ExpiringAccessTokenCache{constructor(r=fe){this.cachedToken=undefined;this.tokenRefreshBufferMs=r}setCachedToken(r){this.cachedToken=r}getCachedToken(){if(this.cachedToken&&Date.now()+this.tokenRefreshBufferMs>=this.cachedToken.expiresOnTimestamp){this.cachedToken=undefined}return this.cachedToken}}class AccessTokenRefresher{constructor(r,i,a=3e4){this.credential=r;this.scopes=i;this.requiredMillisecondsBeforeNewRefresh=a;this.lastCalled=0}isReady(){return!this.lastCalled||Date.now()-this.lastCalled>this.requiredMillisecondsBeforeNewRefresh}async getToken(r){this.lastCalled=Date.now();const i=await this.credential.getToken(this.scopes,r);this.promise=undefined;return i||undefined}refresh(r){if(!this.promise){this.promise=this.getToken(r)}return this.promise}}const he=D.HeaderConstants;const ge="Basic";class BasicAuthenticationCredentials{constructor(r,i,a=ge){this.authorizationScheme=ge;if(r===null||r===undefined||typeof r.valueOf()!=="string"){throw new Error("userName cannot be null or undefined and must be of type string.")}if(i===null||i===undefined||typeof i.valueOf()!=="string"){throw new Error("password cannot be null or undefined and must be of type string.")}this.userName=r;this.password=i;this.authorizationScheme=a}signRequest(r){const i=`${this.userName}:${this.password}`;const a=`${this.authorizationScheme} ${encodeString(i)}`;if(!r.headers)r.headers=new HttpHeaders;r.headers.set(he.AUTHORIZATION,a);return Promise.resolve(r)}}class ApiKeyCredentials{constructor(r){if(!r||r&&!r.inHeader&&!r.inQuery){throw new Error(`options cannot be null or undefined. Either "inHeader" or "inQuery" property of the options object needs to be provided.`)}this.inHeader=r.inHeader;this.inQuery=r.inQuery}signRequest(r){if(!r){return Promise.reject(new Error(`webResource cannot be null or undefined and must be of type "object".`))}if(this.inHeader){if(!r.headers){r.headers=new HttpHeaders}for(const i in this.inHeader){r.headers.set(i,this.inHeader[i])}}if(this.inQuery){if(!r.url){return Promise.reject(new Error(`url cannot be null in the request object.`))}if(r.url.indexOf("?")<0){r.url+="?"}for(const i in this.inQuery){if(!r.url.endsWith("?")){r.url+="&"}r.url+=`${i}=${this.inQuery[i]}`}}return Promise.resolve(r)}}class TopicCredentials extends ApiKeyCredentials{constructor(r){if(!r||r&&typeof r!=="string"){throw new Error("topicKey cannot be null or undefined and must be of type string.")}const i={inHeader:{"aeg-sas-key":r}};super(i)}}Object.defineProperty(i,"delay",{enumerable:true,get:function(){return d.delay}});Object.defineProperty(i,"isNode",{enumerable:true,get:function(){return d.isNode}});Object.defineProperty(i,"isTokenCredential",{enumerable:true,get:function(){return A.isTokenCredential}});i.AccessTokenRefresher=AccessTokenRefresher;i.ApiKeyCredentials=ApiKeyCredentials;i.BaseRequestPolicy=BaseRequestPolicy;i.BasicAuthenticationCredentials=BasicAuthenticationCredentials;i.Constants=D;i.DefaultHttpClient=NodeFetchHttpClient;i.ExpiringAccessTokenCache=ExpiringAccessTokenCache;i.HttpHeaders=HttpHeaders;i.MapperType=L;i.RequestPolicyOptions=RequestPolicyOptions;i.RestError=RestError;i.Serializer=Serializer;i.ServiceClient=ServiceClient;i.TopicCredentials=TopicCredentials;i.URLBuilder=URLBuilder;i.URLQuery=URLQuery;i.WebResource=WebResource;i.XML_ATTRKEY=k;i.XML_CHARKEY=_;i.applyMixins=applyMixins;i.bearerTokenAuthenticationPolicy=bearerTokenAuthenticationPolicy;i.createPipelineFromOptions=createPipelineFromOptions;i.createSpanFunction=createSpanFunction;i.deserializationPolicy=deserializationPolicy;i.deserializeResponseBody=deserializeResponseBody;i.disableResponseDecompressionPolicy=disableResponseDecompressionPolicy;i.encodeUri=encodeUri;i.executePromisesSequentially=executePromisesSequentially;i.exponentialRetryPolicy=exponentialRetryPolicy;i.flattenResponse=flattenResponse;i.generateClientRequestIdPolicy=generateClientRequestIdPolicy;i.generateUuid=generateUuid;i.getDefaultProxySettings=getDefaultProxySettings;i.getDefaultUserAgentValue=getDefaultUserAgentValue;i.isDuration=isDuration;i.isValidUuid=isValidUuid;i.keepAlivePolicy=keepAlivePolicy;i.logPolicy=logPolicy;i.operationOptionsToRequestOptionsBase=operationOptionsToRequestOptionsBase;i.parseXML=parseXML;i.promiseToCallback=promiseToCallback;i.promiseToServiceCallback=promiseToServiceCallback;i.proxyPolicy=proxyPolicy;i.redirectPolicy=redirectPolicy;i.serializeObject=serializeObject;i.signingPolicy=signingPolicy;i.stringifyXML=stringifyXML;i.stripRequest=stripRequest;i.stripResponse=stripResponse;i.systemErrorRetryPolicy=systemErrorRetryPolicy;i.throttlingRetryPolicy=throttlingRetryPolicy;i.tracingPolicy=tracingPolicy;i.userAgentPolicy=userAgentPolicy},18125:function(r,i){(function(){"use strict";i.stripBOM=function(r){if(r[0]==="\ufeff"){return r.substring(1)}else{return r}}}).call(this)},32973:function(r,i,a){(function(){"use strict";var r,s,l,c,p,d={}.hasOwnProperty;r=a(50410);s=a(78116).defaults;c=function(r){return typeof r==="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)};p=function(r){return""};l=function(r){return r.replace("]]>","]]]]>")};i.Builder=function(){function Builder(r){var i,a,l;this.options={};a=s["0.2"];for(i in a){if(!d.call(a,i))continue;l=a[i];this.options[i]=l}for(i in r){if(!d.call(r,i))continue;l=r[i];this.options[i]=l}}Builder.prototype.buildObject=function(i){var a,l,u,A,h;a=this.options.attrkey;l=this.options.charkey;if(Object.keys(i).length===1&&this.options.rootName===s["0.2"].rootName){h=Object.keys(i)[0];i=i[h]}else{h=this.options.rootName}u=function(r){return function(i,s){var A,h,g,y,E,b;if(typeof s!=="object"){if(r.options.cdata&&c(s)){i.raw(p(s))}else{i.txt(s)}}else if(Array.isArray(s)){for(y in s){if(!d.call(s,y))continue;h=s[y];for(E in h){g=h[E];i=u(i.ele(E),g).up()}}}else{for(E in s){if(!d.call(s,E))continue;h=s[E];if(E===a){if(typeof h==="object"){for(A in h){b=h[A];i=i.att(A,b)}}}else if(E===l){if(r.options.cdata&&c(h)){i=i.raw(p(h))}else{i=i.txt(h)}}else if(Array.isArray(h)){for(y in h){if(!d.call(h,y))continue;g=h[y];if(typeof g==="string"){if(r.options.cdata&&c(g)){i=i.ele(E).raw(p(g)).up()}else{i=i.ele(E,g).up()}}else{i=u(i.ele(E),g).up()}}}else if(typeof h==="object"){i=u(i.ele(E),h).up()}else{if(typeof h==="string"&&r.options.cdata&&c(h)){i=i.ele(E).raw(p(h)).up()}else{if(h==null){h=""}i=i.ele(E,h.toString()).up()}}}}return i}}(this);A=r.create(h,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return u(A,i).end(this.options.renderOpts)};return Builder}()}).call(this)},78116:function(r,i){(function(){i.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},6713:function(r,i,a){(function(){"use strict";var r,s,l,c,p,d,u,A,bind=function(r,i){return function(){return r.apply(i,arguments)}},extend=function(r,i){for(var a in i){if(h.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},h={}.hasOwnProperty;u=a(69467);l=a(82361);r=a(18125);d=a(26689);A=a(39512).setImmediate;s=a(78116).defaults;c=function(r){return typeof r==="object"&&r!=null&&Object.keys(r).length===0};p=function(r,i,a){var s,l,c;for(s=0,l=r.length;s0){u[r.options.childkey]=g}g=u}else if(b){b[r.options.childkey]=b[r.options.childkey]||[];y=Object.create(null);for(d in g){if(!h.call(g,d))continue;y[d]=g[d]}b[r.options.childkey].push(y);delete g["#name"];if(Object.keys(g).length===1&&i in g&&!r.EXPLICIT_CHARKEY){g=g[i]}}}if(s.length>0){return r.assignOrPush(b,A,g)}else{if(r.options.explicitRoot){E=g;g=Object.create(null);g[A]=E}r.resultObject=g;r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);a=function(r){return function(a){var l,c;c=s[s.length-1];if(c){c[i]+=a;if(r.options.explicitChildren&&r.options.preserveChildrenOrder&&r.options.charsAsChildren&&(r.options.includeWhiteChars||a.replace(/\\n/g,"").trim()!=="")){c[r.options.childkey]=c[r.options.childkey]||[];l={"#name":"__text__"};l[i]=a;if(r.options.normalize){l[i]=l[i].replace(/\s{2,}/g," ").trim()}c[r.options.childkey].push(l)}return c}}}(this);this.saxParser.ontext=a;return this.saxParser.oncdata=function(r){return function(r){var i;i=a(r);if(i){return i.cdata=true}}}(this)};Parser.prototype.parseString=function(i,a){var s;if(a!=null&&typeof a==="function"){this.on("end",(function(r){this.reset();return a(null,r)}));this.on("error",(function(r){this.reset();return a(r)}))}try{i=i.toString();if(i.trim()===""){this.emit("end",null);return true}i=r.stripBOM(i);if(this.options.async){this.remaining=i;A(this.processAsync);return this.saxParser}return this.saxParser.write(i).close()}catch(r){s=r;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",s);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw s}}};Parser.prototype.parseStringPromise=function(r){return new Promise(function(i){return function(a,s){return i.parseString(r,(function(r,i){if(r){return s(r)}else{return a(i)}}))}}(this))};return Parser}(l);i.parseString=function(r,a,s){var l,c,p;if(s!=null){if(typeof s==="function"){l=s}if(typeof a==="object"){c=a}}else{if(typeof a==="function"){l=a}c={}}p=new i.Parser(c);return p.parseString(r,l)};i.parseStringPromise=function(r,a){var s,l;if(typeof a==="object"){s=a}l=new i.Parser(s);return l.parseStringPromise(r)}}).call(this)},26689:function(r,i){(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/);i.normalize=function(r){return r.toLowerCase()};i.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)};i.stripPrefix=function(i){return i.replace(r,"")};i.parseNumbers=function(r){if(!isNaN(r)){r=r%1===0?parseInt(r,10):parseFloat(r)}return r};i.parseBooleans=function(r){if(/^(?:true|false)$/i.test(r)){r=r.toLowerCase()==="true"}return r}}).call(this)},82357:function(r,i,a){(function(){"use strict";var r,s,l,c,extend=function(r,i){for(var a in i){if(p.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},p={}.hasOwnProperty;s=a(78116);r=a(32973);l=a(6713);c=a(26689);i.defaults=s.defaults;i.processors=c;i.ValidationError=function(r){extend(ValidationError,r);function ValidationError(r){this.message=r}return ValidationError}(Error);i.Builder=r.Builder;i.Parser=l.Parser;i.parseString=l.parseString;i.parseStringPromise=l.parseStringPromise}).call(this)},18130:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(91293);var l=a(93677);const c=s.createClientLogger("core-lro");const p=2e3;const d=["succeeded","canceled","failed"];function deserializeState(r){try{return JSON.parse(r).state}catch(i){throw new Error(`Unable to deserialize input state: ${r}`)}}function setStateError(r){const{state:i,stateProxy:a,isOperationError:s}=r;return r=>{if(s(r)){a.setError(i,r);a.setFailed(i)}throw r}}function appendReadableErrorMessage(r,i){let a=r;if(a.slice(-1)!=="."){a=a+"."}return a+" "+i}function simplifyError(r){let i=r.message;let a=r.code;let s=r;while(s.innererror){s=s.innererror;a=s.code;i=appendReadableErrorMessage(i,s.message)}return{code:a,message:i}}function processOperationStatus(r){const{state:i,stateProxy:a,status:s,isDone:l,processResult:p,getError:d,response:u,setErrorAsResult:A}=r;switch(s){case"succeeded":{a.setSucceeded(i);break}case"failed":{const r=d===null||d===void 0?void 0:d(u);let s="";if(r){const{code:i,message:a}=simplifyError(r);s=`. ${i}. ${a}`}const l=`The long-running operation has failed${s}`;a.setError(i,new Error(l));a.setFailed(i);c.warning(l);break}case"canceled":{a.setCanceled(i);break}}if((l===null||l===void 0?void 0:l(u,i))||l===undefined&&["succeeded","canceled"].concat(A?[]:["failed"]).includes(s)){a.setResult(i,buildResult({response:u,state:i,processResult:p}))}}function buildResult(r){const{processResult:i,response:a,state:s}=r;return i?i(a,s):a}async function initOperation(r){const{init:i,stateProxy:a,processResult:s,getOperationStatus:l,withOperationLocation:p,setErrorAsResult:d}=r;const{operationLocation:u,resourceLocation:A,metadata:h,response:g}=await i();if(u)p===null||p===void 0?void 0:p(u,false);const y={metadata:h,operationLocation:u,resourceLocation:A};c.verbose(`LRO: Operation description:`,y);const E=a.initState(y);const b=l({response:g,state:E,operationLocation:u});processOperationStatus({state:E,status:b,stateProxy:a,response:g,setErrorAsResult:d,processResult:s});return E}async function pollOperationHelper(r){const{poll:i,state:a,stateProxy:s,operationLocation:l,getOperationStatus:p,getResourceLocation:u,isOperationError:A,options:h}=r;const g=await i(l,h).catch(setStateError({state:a,stateProxy:s,isOperationError:A}));const y=p(g,a);c.verbose(`LRO: Status:\n\tPolling from: ${a.config.operationLocation}\n\tOperation status: ${y}\n\tPolling status: ${d.includes(y)?"Stopped":"Running"}`);if(y==="succeeded"){const r=u(g,a);if(r!==undefined){return{response:await i(r).catch(setStateError({state:a,stateProxy:s,isOperationError:A})),status:y}}}return{response:g,status:y}}async function pollOperation(r){const{poll:i,state:a,stateProxy:s,options:l,getOperationStatus:c,getResourceLocation:p,getOperationLocation:u,isOperationError:A,withOperationLocation:h,getPollingInterval:g,processResult:y,getError:E,updateState:b,setDelay:C,isDone:v,setErrorAsResult:B}=r;const{operationLocation:I}=a.config;if(I!==undefined){const{response:r,status:w}=await pollOperationHelper({poll:i,getOperationStatus:c,state:a,stateProxy:s,operationLocation:I,getResourceLocation:p,isOperationError:A,options:l});processOperationStatus({status:w,response:r,state:a,stateProxy:s,isDone:v,processResult:y,getError:E,setErrorAsResult:B});if(!d.includes(w)){const i=g===null||g===void 0?void 0:g(r);if(i)C(i);const s=u===null||u===void 0?void 0:u(r,a);if(s!==undefined){const r=I!==s;a.config.operationLocation=s;h===null||h===void 0?void 0:h(s,r)}else h===null||h===void 0?void 0:h(I,false)}b===null||b===void 0?void 0:b(a,r)}}function getOperationLocationPollingUrl(r){const{azureAsyncOperation:i,operationLocation:a}=r;return a!==null&&a!==void 0?a:i}function getLocationHeader(r){return r.headers["location"]}function getOperationLocationHeader(r){return r.headers["operation-location"]}function getAzureAsyncOperationHeader(r){return r.headers["azure-asyncoperation"]}function findResourceLocation(r){var i;const{location:a,requestMethod:s,requestPath:l,resourceLocationConfig:c}=r;switch(s){case"PUT":{return l}case"DELETE":{return undefined}case"PATCH":{return(i=getDefault())!==null&&i!==void 0?i:l}default:{return getDefault()}}function getDefault(){switch(c){case"azure-async-operation":{return undefined}case"original-uri":{return l}case"location":default:{return a}}}}function inferLroMode(r){const{rawResponse:i,requestMethod:a,requestPath:s,resourceLocationConfig:l}=r;const c=getOperationLocationHeader(i);const p=getAzureAsyncOperationHeader(i);const d=getOperationLocationPollingUrl({operationLocation:c,azureAsyncOperation:p});const u=getLocationHeader(i);const A=a===null||a===void 0?void 0:a.toLocaleUpperCase();if(d!==undefined){return{mode:"OperationLocation",operationLocation:d,resourceLocation:findResourceLocation({requestMethod:A,location:u,requestPath:s,resourceLocationConfig:l})}}else if(u!==undefined){return{mode:"ResourceLocation",operationLocation:u}}else if(A==="PUT"&&s){return{mode:"Body",operationLocation:s}}else{return undefined}}function transformStatus(r){const{status:i,statusCode:a}=r;if(typeof i!=="string"&&i!==undefined){throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${i}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`)}switch(i===null||i===void 0?void 0:i.toLocaleLowerCase()){case undefined:return toOperationStatus(a);case"succeeded":return"succeeded";case"failed":return"failed";case"running":case"accepted":case"started":case"canceling":case"cancelling":return"running";case"canceled":case"cancelled":return"canceled";default:{c.verbose(`LRO: unrecognized operation status: ${i}`);return i}}}function getStatus(r){var i;const{status:a}=(i=r.body)!==null&&i!==void 0?i:{};return transformStatus({status:a,statusCode:r.statusCode})}function getProvisioningState(r){var i,a;const{properties:s,provisioningState:l}=(i=r.body)!==null&&i!==void 0?i:{};const c=(a=s===null||s===void 0?void 0:s.provisioningState)!==null&&a!==void 0?a:l;return transformStatus({status:c,statusCode:r.statusCode})}function toOperationStatus(r){if(r===202){return"running"}else if(r<300){return"succeeded"}else{return"failed"}}function parseRetryAfter({rawResponse:r}){const i=r.headers["retry-after"];if(i!==undefined){const r=parseInt(i);return isNaN(r)?calculatePollingIntervalFromDate(new Date(i)):r*1e3}return undefined}function getErrorFromResponse(r){const i=accessBodyProperty(r,"error");if(!i){c.warning(`The long-running operation failed but there is no error property in the response's body`);return}if(!i.code||!i.message){c.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);return}return i}function calculatePollingIntervalFromDate(r){const i=Math.floor((new Date).getTime());const a=r.getTime();if(i{const r=await l.sendInitialRequest();const i=inferLroMode({rawResponse:r.rawResponse,requestPath:l.requestPath,requestMethod:l.requestMethod,resourceLocationConfig:a});return Object.assign({response:r,operationLocation:i===null||i===void 0?void 0:i.operationLocation,resourceLocation:i===null||i===void 0?void 0:i.resourceLocation},(i===null||i===void 0?void 0:i.mode)?{metadata:{mode:i.mode}}:{})},stateProxy:i,processResult:s?({flatResponse:r},i)=>s(r,i):({flatResponse:r})=>r,getOperationStatus:getStatusFromInitialResponse,setErrorAsResult:c})}function getOperationLocation({rawResponse:r},i){var a;const s=(a=i.config.metadata)===null||a===void 0?void 0:a["mode"];switch(s){case"OperationLocation":{return getOperationLocationPollingUrl({operationLocation:getOperationLocationHeader(r),azureAsyncOperation:getAzureAsyncOperationHeader(r)})}case"ResourceLocation":{return getLocationHeader(r)}case"Body":default:{return undefined}}}function getOperationStatus({rawResponse:r},i){var a;const s=(a=i.config.metadata)===null||a===void 0?void 0:a["mode"];switch(s){case"OperationLocation":{return getStatus(r)}case"ResourceLocation":{return toOperationStatus(r.statusCode)}case"Body":{return getProvisioningState(r)}default:throw new Error(`Internal error: Unexpected operation mode: ${s}`)}}function accessBodyProperty({flatResponse:r,rawResponse:i},a){var s,l;return(s=r===null||r===void 0?void 0:r[a])!==null&&s!==void 0?s:(l=i.body)===null||l===void 0?void 0:l[a]}function getResourceLocation(r,i){const a=accessBodyProperty(r,"resourceLocation");if(a&&typeof a==="string"){i.config.resourceLocation=a}return i.config.resourceLocation}function isOperationError(r){return r.name==="RestError"}async function pollHttpOperation(r){const{lro:i,stateProxy:a,options:s,processResult:l,updateState:c,setDelay:p,state:d,setErrorAsResult:u}=r;return pollOperation({state:d,stateProxy:a,setDelay:p,processResult:l?({flatResponse:r},i)=>l(r,i):({flatResponse:r})=>r,getError:getErrorFromResponse,updateState:c,getPollingInterval:parseRetryAfter,getOperationLocation:getOperationLocation,getOperationStatus:getOperationStatus,isOperationError:isOperationError,getResourceLocation:getResourceLocation,options:s,poll:async(r,a)=>i.sendPollRequest(r,a),setErrorAsResult:u})}const createStateProxy$1=()=>({initState:r=>({status:"running",config:r}),setCanceled:r=>r.status="canceled",setError:(r,i)=>r.error=i,setResult:(r,i)=>r.result=i,setRunning:r=>r.status="running",setSucceeded:r=>r.status="succeeded",setFailed:r=>r.status="failed",getError:r=>r.error,getResult:r=>r.result,isCanceled:r=>r.status==="canceled",isFailed:r=>r.status==="failed",isRunning:r=>r.status==="running",isSucceeded:r=>r.status==="succeeded"});function buildCreatePoller(r){const{getOperationLocation:i,getStatusFromInitialResponse:a,getStatusFromPollResponse:s,isOperationError:c,getResourceLocation:d,getPollingInterval:u,getError:A,resolveOnUnsuccessful:h}=r;return async({init:r,poll:g},y)=>{const{processResult:E,updateState:b,withOperationLocation:C,intervalInMs:v=p,restoreFrom:B}=y||{};const I=createStateProxy$1();const w=C?(()=>{let r=false;return(i,a)=>{if(a)C(i);else if(!r)C(i);r=true}})():undefined;const S=B?deserializeState(B):await initOperation({init:r,stateProxy:I,processResult:E,getOperationStatus:a,withOperationLocation:w,setErrorAsResult:!h});let Q;const x=new AbortController;const N=new Map;const handleProgressEvents=async()=>N.forEach((r=>r(S)));const R="Operation was canceled";let T=v;const D={getOperationState:()=>S,getResult:()=>S.result,isDone:()=>["succeeded","failed","canceled"].includes(S.status),isStopped:()=>Q===undefined,stopPolling:()=>{x.abort()},toString:()=>JSON.stringify({state:S}),onProgress:r=>{const i=Symbol();N.set(i,r);return()=>N.delete(i)},pollUntilDone:r=>Q!==null&&Q!==void 0?Q:Q=(async()=>{const{abortSignal:i}=r||{};function abortListener(){x.abort()}const a=x.signal;if(i===null||i===void 0?void 0:i.aborted){x.abort()}else if(!a.aborted){i===null||i===void 0?void 0:i.addEventListener("abort",abortListener,{once:true})}try{if(!D.isDone()){await D.poll({abortSignal:a});while(!D.isDone()){await l.delay(T,{abortSignal:a});await D.poll({abortSignal:a})}}}finally{i===null||i===void 0?void 0:i.removeEventListener("abort",abortListener)}if(h){return D.getResult()}else{switch(S.status){case"succeeded":return D.getResult();case"canceled":throw new Error(R);case"failed":throw S.error;case"notStarted":case"running":throw new Error(`Polling completed without succeeding or failing`)}}})().finally((()=>{Q=undefined})),async poll(r){if(h){if(D.isDone())return}else{switch(S.status){case"succeeded":return;case"canceled":throw new Error(R);case"failed":throw S.error}}await pollOperation({poll:g,state:S,stateProxy:I,getOperationLocation:i,isOperationError:c,withOperationLocation:w,getPollingInterval:u,getOperationStatus:s,getResourceLocation:d,processResult:E,getError:A,updateState:b,options:r,setDelay:r=>{T=r},setErrorAsResult:!h});await handleProgressEvents();if(!h){switch(S.status){case"canceled":throw new Error(R);case"failed":throw S.error}}}};return D}}async function createHttpPoller(r,i){const{resourceLocationConfig:a,intervalInMs:s,processResult:l,restoreFrom:c,updateState:p,withOperationLocation:d,resolveOnUnsuccessful:u=false}=i||{};return buildCreatePoller({getStatusFromInitialResponse:getStatusFromInitialResponse,getStatusFromPollResponse:getOperationStatus,isOperationError:isOperationError,getOperationLocation:getOperationLocation,getResourceLocation:getResourceLocation,getPollingInterval:parseRetryAfter,getError:getErrorFromResponse,resolveOnUnsuccessful:u})({init:async()=>{const i=await r.sendInitialRequest();const s=inferLroMode({rawResponse:i.rawResponse,requestPath:r.requestPath,requestMethod:r.requestMethod,resourceLocationConfig:a});return Object.assign({response:i,operationLocation:s===null||s===void 0?void 0:s.operationLocation,resourceLocation:s===null||s===void 0?void 0:s.resourceLocation},(s===null||s===void 0?void 0:s.mode)?{metadata:{mode:s.mode}}:{})},poll:r.sendPollRequest},{intervalInMs:s,withOperationLocation:d,restoreFrom:c,updateState:p,processResult:l?({flatResponse:r},i)=>l(r,i):({flatResponse:r})=>r})}const createStateProxy=()=>({initState:r=>({config:r,isStarted:true}),setCanceled:r=>r.isCancelled=true,setError:(r,i)=>r.error=i,setResult:(r,i)=>r.result=i,setRunning:r=>r.isStarted=true,setSucceeded:r=>r.isCompleted=true,setFailed:()=>{},getError:r=>r.error,getResult:r=>r.result,isCanceled:r=>!!r.isCancelled,isFailed:r=>!!r.error,isRunning:r=>!!r.isStarted,isSucceeded:r=>Boolean(r.isCompleted&&!r.isCancelled&&!r.error)});class GenericPollOperation{constructor(r,i,a,s,l,c,p){this.state=r;this.lro=i;this.setErrorAsResult=a;this.lroResourceLocationConfig=s;this.processResult=l;this.updateState=c;this.isDone=p}setPollerConfig(r){this.pollerConfig=r}async update(r){var i;const a=createStateProxy();if(!this.state.isStarted){this.state=Object.assign(Object.assign({},this.state),await initHttpOperation({lro:this.lro,stateProxy:a,resourceLocationConfig:this.lroResourceLocationConfig,processResult:this.processResult,setErrorAsResult:this.setErrorAsResult}))}const s=this.updateState;const l=this.isDone;if(!this.state.isCompleted&&this.state.error===undefined){await pollHttpOperation({lro:this.lro,state:this.state,stateProxy:a,processResult:this.processResult,updateState:s?(r,{rawResponse:i})=>s(r,i):undefined,isDone:l?({flatResponse:r},i)=>l(r,i):undefined,options:r,setDelay:r=>{this.pollerConfig.intervalInMs=r},setErrorAsResult:this.setErrorAsResult})}(i=r===null||r===void 0?void 0:r.fireProgress)===null||i===void 0?void 0:i.call(r,this.state);return this}async cancel(){c.error("`cancelOperation` is deprecated because it wasn't implemented");return this}toString(){return JSON.stringify({state:this.state})}}class PollerStoppedError extends Error{constructor(r){super(r);this.name="PollerStoppedError";Object.setPrototypeOf(this,PollerStoppedError.prototype)}}class PollerCancelledError extends Error{constructor(r){super(r);this.name="PollerCancelledError";Object.setPrototypeOf(this,PollerCancelledError.prototype)}}class Poller{constructor(r){this.resolveOnUnsuccessful=false;this.stopped=true;this.pollProgressCallbacks=[];this.operation=r;this.promise=new Promise(((r,i)=>{this.resolve=r;this.reject=i}));this.promise.catch((()=>{}))}async startPolling(r={}){if(this.stopped){this.stopped=false}while(!this.isStopped()&&!this.isDone()){await this.poll(r);await this.delay()}}async pollOnce(r={}){if(!this.isDone()){this.operation=await this.operation.update({abortSignal:r.abortSignal,fireProgress:this.fireProgress.bind(this)})}this.processUpdatedState()}fireProgress(r){for(const i of this.pollProgressCallbacks){i(r)}}async cancelOnce(r={}){this.operation=await this.operation.cancel(r)}poll(r={}){if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(r);const clearPollOncePromise=()=>{this.pollOncePromise=undefined};this.pollOncePromise.then(clearPollOncePromise,clearPollOncePromise).catch(this.reject)}return this.pollOncePromise}processUpdatedState(){if(this.operation.state.error){this.stopped=true;if(!this.resolveOnUnsuccessful){this.reject(this.operation.state.error);throw this.operation.state.error}}if(this.operation.state.isCancelled){this.stopped=true;if(!this.resolveOnUnsuccessful){const r=new PollerCancelledError("Operation was canceled");this.reject(r);throw r}}if(this.isDone()&&this.resolve){this.resolve(this.getResult())}}async pollUntilDone(r={}){if(this.stopped){this.startPolling(r).catch(this.reject)}this.processUpdatedState();return this.promise}onProgress(r){this.pollProgressCallbacks.push(r);return()=>{this.pollProgressCallbacks=this.pollProgressCallbacks.filter((i=>i!==r))}}isDone(){const r=this.operation.state;return Boolean(r.isCompleted||r.isCancelled||r.error)}stopPolling(){if(!this.stopped){this.stopped=true;if(this.reject){this.reject(new PollerStoppedError("This poller is already stopped"))}}}isStopped(){return this.stopped}cancelOperation(r={}){if(!this.cancelPromise){this.cancelPromise=this.cancelOnce(r)}else if(r.abortSignal){throw new Error("A cancel request is currently pending")}return this.cancelPromise}getOperationState(){return this.operation.state}getResult(){const r=this.operation.state;return r.result}toString(){return this.operation.toString()}}class LroEngine extends Poller{constructor(r,i){const{intervalInMs:a=p,resumeFrom:s,resolveOnUnsuccessful:l=false,isDone:c,lroResourceLocationConfig:d,processResult:u,updateState:A}=i||{};const h=s?deserializeState(s):{};const g=new GenericPollOperation(h,r,!l,d,u,A,c);super(g);this.resolveOnUnsuccessful=l;this.config={intervalInMs:a};g.setPollerConfig(this.config)}delay(){return new Promise((r=>setTimeout((()=>r()),this.config.intervalInMs)))}}i.LroEngine=LroEngine;i.Poller=Poller;i.PollerCancelledError=PollerCancelledError;i.PollerStoppedError=PollerStoppedError;i.createHttpPoller=createHttpPoller},81996:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(56728);function getPagedAsyncIterator(r){var i;const a=getItemAsyncIterator(r);return{next(){return a.next()},[Symbol.asyncIterator](){return this},byPage:(i=r===null||r===void 0?void 0:r.byPage)!==null&&i!==void 0?i:i=>{const{continuationToken:a,maxPageSize:s}=i!==null&&i!==void 0?i:{};return getPageAsyncIterator(r,{pageLink:a,maxPageSize:s})}}}function getItemAsyncIterator(r){return s.__asyncGenerator(this,arguments,(function*getItemAsyncIterator_1(){var i,a,l,c;const p=getPageAsyncIterator(r);const d=yield s.__await(p.next());if(!Array.isArray(d.value)){const{toElements:l}=r;if(l){yield s.__await(yield*s.__asyncDelegator(s.__asyncValues(l(d.value))));try{for(var u=s.__asyncValues(p),A;A=yield s.__await(u.next()),!A.done;){const r=A.value;yield s.__await(yield*s.__asyncDelegator(s.__asyncValues(l(r))))}}catch(r){i={error:r}}finally{try{if(A&&!A.done&&(a=u.return))yield s.__await(a.call(u))}finally{if(i)throw i.error}}}else{yield yield s.__await(d.value);yield s.__await(yield*s.__asyncDelegator(s.__asyncValues(p)))}}else{yield s.__await(yield*s.__asyncDelegator(s.__asyncValues(d.value)));try{for(var h=s.__asyncValues(p),g;g=yield s.__await(h.next()),!g.done;){const r=g.value;yield s.__await(yield*s.__asyncDelegator(s.__asyncValues(r)))}}catch(r){l={error:r}}finally{try{if(g&&!g.done&&(c=h.return))yield s.__await(c.call(h))}finally{if(l)throw l.error}}}}))}function getPageAsyncIterator(r,i={}){return s.__asyncGenerator(this,arguments,(function*getPageAsyncIterator_1(){const{pageLink:a,maxPageSize:l}=i;let c=yield s.__await(r.getPage(a!==null&&a!==void 0?a:r.firstPageLink,l));if(!c){return yield s.__await(void 0)}yield yield s.__await(c.page);while(c.nextPageLink){c=yield s.__await(r.getPage(c.nextPageLink,l));if(!c){return yield s.__await(void 0)}yield yield s.__await(c.page)}}))}i.getPagedAsyncIterator=getPagedAsyncIterator},54787:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(85762);(function(r){r[r["INTERNAL"]=0]="INTERNAL";r[r["SERVER"]=1]="SERVER";r[r["CLIENT"]=2]="CLIENT";r[r["PRODUCER"]=3]="PRODUCER";r[r["CONSUMER"]=4]="CONSUMER"})(i.SpanKind||(i.SpanKind={}));function getSpan(r){return s.trace.getSpan(r)}function setSpan(r,i){return s.trace.setSpan(r,i)}function setSpanContext(r,i){return s.trace.setSpanContext(r,i)}function getSpanContext(r){return s.trace.getSpanContext(r)}function isSpanContextValid(r){return s.trace.isSpanContextValid(r)}function getTracer(r,i){return s.trace.getTracer(r||"azure/core-tracing",i)}const l=s.context;(function(r){r[r["UNSET"]=0]="UNSET";r[r["OK"]=1]="OK";r[r["ERROR"]=2]="ERROR"})(i.SpanStatusCode||(i.SpanStatusCode={}));function isTracingDisabled(){var r;if(typeof process==="undefined"){return false}const i=(r=process.env.AZURE_TRACING_DISABLED)===null||r===void 0?void 0:r.toLowerCase();if(i==="false"||i==="0"){return false}return Boolean(i)}function createSpanFunction(r){return function(a,c){const p=getTracer();const d=(c===null||c===void 0?void 0:c.tracingOptions)||{};const u=Object.assign({kind:i.SpanKind.INTERNAL},d.spanOptions);const A=r.packagePrefix?`${r.packagePrefix}.${a}`:a;let h;if(isTracingDisabled()){h=s.trace.wrapSpanContext(s.INVALID_SPAN_CONTEXT)}else{h=p.startSpan(A,u,d.tracingContext)}if(r.namespace){h.setAttribute("az.namespace",r.namespace)}let g=d.spanOptions||{};if(h.isRecording()&&r.namespace){g=Object.assign(Object.assign({},d.spanOptions),{attributes:Object.assign(Object.assign({},u.attributes),{"az.namespace":r.namespace})})}const y=Object.assign(Object.assign({},d),{spanOptions:g,tracingContext:setSpan(d.tracingContext||l.active(),h)});const E=Object.assign(Object.assign({},c),{tracingOptions:y});return{span:h,updatedOptions:E}}}const c="00";function extractSpanContextFromTraceParentHeader(r){const i=r.split("-");if(i.length!==4){return}const[a,s,l,p]=i;if(a!==c){return}const d=parseInt(p,16);const u={spanId:l,traceId:s,traceFlags:d};return u}function getTraceParentHeader(r){const i=[];if(!r.traceId){i.push("traceId")}if(!r.spanId){i.push("spanId")}if(i.length){return}const a=r.traceFlags||0;const s=a.toString(16);const l=s.length===1?`0${s}`:s;return`${c}-${r.traceId}-${r.spanId}-${l}`}i.context=l;i.createSpanFunction=createSpanFunction;i.extractSpanContextFromTraceParentHeader=extractSpanContextFromTraceParentHeader;i.getSpan=getSpan;i.getSpanContext=getSpanContext;i.getTraceParentHeader=getTraceParentHeader;i.getTracer=getTracer;i.isSpanContextValid=isSpanContextValid;i.setSpan=setSpan;i.setSpanContext=setSpanContext},93677:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(80560);var l=a(6113);function createAbortablePromise(r,i){const{cleanupBeforeAbort:a,abortSignal:l,abortErrorMsg:c}=i!==null&&i!==void 0?i:{};return new Promise(((i,p)=>{function rejectOnAbort(){p(new s.AbortError(c!==null&&c!==void 0?c:"The operation was aborted."))}function removeListeners(){l===null||l===void 0?void 0:l.removeEventListener("abort",onAbort)}function onAbort(){a===null||a===void 0?void 0:a();removeListeners();rejectOnAbort()}if(l===null||l===void 0?void 0:l.aborted){return rejectOnAbort()}try{r((r=>{removeListeners();i(r)}),(r=>{removeListeners();p(r)}))}catch(r){p(r)}l===null||l===void 0?void 0:l.addEventListener("abort",onAbort)}))}const c="The delay was aborted.";function delay(r,i){let a;const{abortSignal:s,abortErrorMsg:l}=i!==null&&i!==void 0?i:{};return createAbortablePromise((i=>{a=setTimeout(i,r)}),{cleanupBeforeAbort:()=>clearTimeout(a),abortSignal:s,abortErrorMsg:l!==null&&l!==void 0?l:c})}async function cancelablePromiseRace(r,i){var a,s;const l=new AbortController;function abortHandler(){l.abort()}(a=i===null||i===void 0?void 0:i.abortSignal)===null||a===void 0?void 0:a.addEventListener("abort",abortHandler);try{return await Promise.race(r.map((r=>r({abortSignal:l.signal}))))}finally{l.abort();(s=i===null||i===void 0?void 0:i.abortSignal)===null||s===void 0?void 0:s.removeEventListener("abort",abortHandler)}}function getRandomIntegerInclusive(r,i){r=Math.ceil(r);i=Math.floor(i);const a=Math.floor(Math.random()*(i-r+1));return a+r}function isObject(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function isError(r){if(isObject(r)){const i=typeof r.name==="string";const a=typeof r.message==="string";return i&&a}return false}function getErrorMessage(r){if(isError(r)){return r.message}else{let i;try{if(typeof r==="object"&&r){i=JSON.stringify(r)}else{i=String(r)}}catch(r){i="[unable to stringify input]"}return`Unknown error ${i}`}}async function computeSha256Hmac(r,i,a){const s=Buffer.from(r,"base64");return l.createHmac("sha256",s).update(i).digest(a)}async function computeSha256Hash(r,i){return l.createHash("sha256").update(r).digest(i)}function isDefined(r){return typeof r!=="undefined"&&r!==null}function isObjectWithProperties(r,i){if(!isDefined(r)||typeof r!=="object"){return false}for(const a of i){if(!objectHasProperty(r,a)){return false}}return true}function objectHasProperty(r,i){return isDefined(r)&&typeof r==="object"&&i in r}function generateUUID(){let r="";for(let i=0;i<32;i++){const a=Math.floor(Math.random()*16);if(i===12){r+="4"}else if(i===16){r+=a&3|8}else{r+=a.toString(16)}if(i===7||i===11||i===15||i===19){r+="-"}}return r}var p;let d=typeof((p=globalThis===null||globalThis===void 0?void 0:globalThis.crypto)===null||p===void 0?void 0:p.randomUUID)==="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):l.randomUUID;if(!d){d=generateUUID}function randomUUID(){return d()}var u,A,h,g;const y=typeof window!=="undefined"&&typeof window.document!=="undefined";const E=typeof self==="object"&&typeof(self===null||self===void 0?void 0:self.importScripts)==="function"&&(((u=self.constructor)===null||u===void 0?void 0:u.name)==="DedicatedWorkerGlobalScope"||((A=self.constructor)===null||A===void 0?void 0:A.name)==="ServiceWorkerGlobalScope"||((h=self.constructor)===null||h===void 0?void 0:h.name)==="SharedWorkerGlobalScope");const b=typeof Deno!=="undefined"&&typeof Deno.version!=="undefined"&&typeof Deno.version.deno!=="undefined";const C=typeof process!=="undefined"&&Boolean(process.version)&&Boolean((g=process.versions)===null||g===void 0?void 0:g.node)&&!b;const v=typeof Bun!=="undefined"&&typeof Bun.version!=="undefined";const B=typeof navigator!=="undefined"&&(navigator===null||navigator===void 0?void 0:navigator.product)==="ReactNative";function uint8ArrayToString(r,i){return Buffer.from(r).toString(i)}function stringToUint8Array(r,i){return Buffer.from(r,i)}i.cancelablePromiseRace=cancelablePromiseRace;i.computeSha256Hash=computeSha256Hash;i.computeSha256Hmac=computeSha256Hmac;i.createAbortablePromise=createAbortablePromise;i.delay=delay;i.getErrorMessage=getErrorMessage;i.getRandomIntegerInclusive=getRandomIntegerInclusive;i.isBrowser=y;i.isBun=v;i.isDefined=isDefined;i.isDeno=b;i.isError=isError;i.isNode=C;i.isObject=isObject;i.isObjectWithProperties=isObjectWithProperties;i.isReactNative=B;i.isWebWorker=E;i.objectHasProperty=objectHasProperty;i.randomUUID=randomUUID;i.stringToUint8Array=stringToUint8Array;i.uint8ArrayToString=uint8ArrayToString},80560:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});class AbortError extends Error{constructor(r){super(r);this.name="AbortError"}}i.AbortError=AbortError},91293:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(22037);var l=a(73837);function _interopDefaultLegacy(r){return r&&typeof r==="object"&&"default"in r?r:{default:r}}var c=_interopDefaultLegacy(l);function log(r,...i){process.stderr.write(`${c["default"].format(r,...i)}${s.EOL}`)}const p=typeof process!=="undefined"&&process.env&&process.env.DEBUG||undefined;let d;let u=[];let A=[];const h=[];if(p){enable(p)}const g=Object.assign((r=>createDebugger(r)),{enable:enable,enabled:enabled,disable:disable,log:log});function enable(r){d=r;u=[];A=[];const i=/\*/g;const a=r.split(",").map((r=>r.trim().replace(i,".*?")));for(const r of a){if(r.startsWith("-")){A.push(new RegExp(`^${r.substr(1)}$`))}else{u.push(new RegExp(`^${r}$`))}}for(const r of h){r.enabled=enabled(r.namespace)}}function enabled(r){if(r.endsWith("*")){return true}for(const i of A){if(i.test(r)){return false}}for(const i of u){if(i.test(r)){return true}}return false}function disable(){const r=d||"";enable("");return r}function createDebugger(r){const i=Object.assign(debug,{enabled:enabled(r),destroy:destroy,log:g.log,namespace:r,extend:extend});function debug(...a){if(!i.enabled){return}if(a.length>0){a[0]=`${r} ${a[0]}`}i.log(...a)}h.push(i);return i}function destroy(){const r=h.indexOf(this);if(r>=0){h.splice(r,1);return true}return false}function extend(r){const i=createDebugger(`${this.namespace}:${r}`);i.log=this.log;return i}var y=g;const E=new Set;const b=typeof process!=="undefined"&&process.env&&process.env.AZURE_LOG_LEVEL||undefined;let C;const v=y("azure");v.log=(...r)=>{y.log(...r)};const B=["verbose","info","warning","error"];if(b){if(isAzureLogLevel(b)){setLogLevel(b)}else{console.error(`AZURE_LOG_LEVEL set to unknown log level '${b}'; logging is not enabled. Acceptable values: ${B.join(", ")}.`)}}function setLogLevel(r){if(r&&!isAzureLogLevel(r)){throw new Error(`Unknown log level '${r}'. Acceptable values: ${B.join(",")}`)}C=r;const i=[];for(const r of E){if(shouldEnable(r)){i.push(r.namespace)}}y.enable(i.join(","))}function getLogLevel(){return C}const I={verbose:400,info:300,warning:200,error:100};function createClientLogger(r){const i=v.extend(r);patchLogMethod(v,i);return{error:createLogger(i,"error"),warning:createLogger(i,"warning"),info:createLogger(i,"info"),verbose:createLogger(i,"verbose")}}function patchLogMethod(r,i){i.log=(...i)=>{r.log(...i)}}function createLogger(r,i){const a=Object.assign(r.extend(i),{level:i});patchLogMethod(r,a);if(shouldEnable(a)){const r=y.disable();y.enable(r+","+a.namespace)}E.add(a);return a}function shouldEnable(r){return Boolean(C&&I[r.level]<=I[C])}function isAzureLogLevel(r){return B.includes(r)}i.AzureLogger=v;i.createClientLogger=createClientLogger;i.getLogLevel=getLogLevel;i.setLogLevel=setLogLevel},12990:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(61889);var l=a(56728);var c=a(54787);var p=a(91293);var d=a(78185);var u=a(22037);var A=a(6113);var h=a(12781);a(81996);var g=a(18130);var y=a(82361);var E=a(57147);var b=a(73837);function _interopNamespace(r){if(r&&r.__esModule)return r;var i=Object.create(null);if(r){Object.keys(r).forEach((function(a){if(a!=="default"){var s=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(i,a,s.get?s:{enumerable:true,get:function(){return r[a]}})}}))}i["default"]=r;return Object.freeze(i)}var C=_interopNamespace(s);var v=_interopNamespace(u);var B=_interopNamespace(E);var I=_interopNamespace(b);const w={serializedName:"BlobServiceProperties",xmlName:"StorageServiceProperties",type:{name:"Composite",className:"BlobServiceProperties",modelProperties:{blobAnalyticsLogging:{serializedName:"Logging",xmlName:"Logging",type:{name:"Composite",className:"Logging"}},hourMetrics:{serializedName:"HourMetrics",xmlName:"HourMetrics",type:{name:"Composite",className:"Metrics"}},minuteMetrics:{serializedName:"MinuteMetrics",xmlName:"MinuteMetrics",type:{name:"Composite",className:"Metrics"}},cors:{serializedName:"Cors",xmlName:"Cors",xmlIsWrapped:true,xmlElementName:"CorsRule",type:{name:"Sequence",element:{type:{name:"Composite",className:"CorsRule"}}}},defaultServiceVersion:{serializedName:"DefaultServiceVersion",xmlName:"DefaultServiceVersion",type:{name:"String"}},deleteRetentionPolicy:{serializedName:"DeleteRetentionPolicy",xmlName:"DeleteRetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}},staticWebsite:{serializedName:"StaticWebsite",xmlName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite"}}}}};const S={serializedName:"Logging",type:{name:"Composite",className:"Logging",modelProperties:{version:{serializedName:"Version",required:true,xmlName:"Version",type:{name:"String"}},deleteProperty:{serializedName:"Delete",required:true,xmlName:"Delete",type:{name:"Boolean"}},read:{serializedName:"Read",required:true,xmlName:"Read",type:{name:"Boolean"}},write:{serializedName:"Write",required:true,xmlName:"Write",type:{name:"Boolean"}},retentionPolicy:{serializedName:"RetentionPolicy",xmlName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}};const Q={serializedName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy",modelProperties:{enabled:{serializedName:"Enabled",required:true,xmlName:"Enabled",type:{name:"Boolean"}},days:{constraints:{InclusiveMinimum:1},serializedName:"Days",xmlName:"Days",type:{name:"Number"}}}}};const x={serializedName:"Metrics",type:{name:"Composite",className:"Metrics",modelProperties:{version:{serializedName:"Version",xmlName:"Version",type:{name:"String"}},enabled:{serializedName:"Enabled",required:true,xmlName:"Enabled",type:{name:"Boolean"}},includeAPIs:{serializedName:"IncludeAPIs",xmlName:"IncludeAPIs",type:{name:"Boolean"}},retentionPolicy:{serializedName:"RetentionPolicy",xmlName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}};const N={serializedName:"CorsRule",type:{name:"Composite",className:"CorsRule",modelProperties:{allowedOrigins:{serializedName:"AllowedOrigins",required:true,xmlName:"AllowedOrigins",type:{name:"String"}},allowedMethods:{serializedName:"AllowedMethods",required:true,xmlName:"AllowedMethods",type:{name:"String"}},allowedHeaders:{serializedName:"AllowedHeaders",required:true,xmlName:"AllowedHeaders",type:{name:"String"}},exposedHeaders:{serializedName:"ExposedHeaders",required:true,xmlName:"ExposedHeaders",type:{name:"String"}},maxAgeInSeconds:{constraints:{InclusiveMinimum:0},serializedName:"MaxAgeInSeconds",required:true,xmlName:"MaxAgeInSeconds",type:{name:"Number"}}}}};const R={serializedName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite",modelProperties:{enabled:{serializedName:"Enabled",required:true,xmlName:"Enabled",type:{name:"Boolean"}},indexDocument:{serializedName:"IndexDocument",xmlName:"IndexDocument",type:{name:"String"}},errorDocument404Path:{serializedName:"ErrorDocument404Path",xmlName:"ErrorDocument404Path",type:{name:"String"}},defaultIndexDocumentPath:{serializedName:"DefaultIndexDocumentPath",xmlName:"DefaultIndexDocumentPath",type:{name:"String"}}}}};const T={serializedName:"StorageError",type:{name:"Composite",className:"StorageError",modelProperties:{message:{serializedName:"Message",xmlName:"Message",type:{name:"String"}},code:{serializedName:"Code",xmlName:"Code",type:{name:"String"}}}}};const D={serializedName:"BlobServiceStatistics",xmlName:"StorageServiceStats",type:{name:"Composite",className:"BlobServiceStatistics",modelProperties:{geoReplication:{serializedName:"GeoReplication",xmlName:"GeoReplication",type:{name:"Composite",className:"GeoReplication"}}}}};const k={serializedName:"GeoReplication",type:{name:"Composite",className:"GeoReplication",modelProperties:{status:{serializedName:"Status",required:true,xmlName:"Status",type:{name:"Enum",allowedValues:["live","bootstrap","unavailable"]}},lastSyncOn:{serializedName:"LastSyncTime",required:true,xmlName:"LastSyncTime",type:{name:"DateTimeRfc1123"}}}}};const _={serializedName:"ListContainersSegmentResponse",xmlName:"EnumerationResults",type:{name:"Composite",className:"ListContainersSegmentResponse",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},prefix:{serializedName:"Prefix",xmlName:"Prefix",type:{name:"String"}},marker:{serializedName:"Marker",xmlName:"Marker",type:{name:"String"}},maxPageSize:{serializedName:"MaxResults",xmlName:"MaxResults",type:{name:"Number"}},containerItems:{serializedName:"ContainerItems",required:true,xmlName:"Containers",xmlIsWrapped:true,xmlElementName:"Container",type:{name:"Sequence",element:{type:{name:"Composite",className:"ContainerItem"}}}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const O={serializedName:"ContainerItem",xmlName:"Container",type:{name:"Composite",className:"ContainerItem",modelProperties:{name:{serializedName:"Name",required:true,xmlName:"Name",type:{name:"String"}},deleted:{serializedName:"Deleted",xmlName:"Deleted",type:{name:"Boolean"}},version:{serializedName:"Version",xmlName:"Version",type:{name:"String"}},properties:{serializedName:"Properties",xmlName:"Properties",type:{name:"Composite",className:"ContainerProperties"}},metadata:{serializedName:"Metadata",xmlName:"Metadata",type:{name:"Dictionary",value:{type:{name:"String"}}}}}}};const P={serializedName:"ContainerProperties",type:{name:"Composite",className:"ContainerProperties",modelProperties:{lastModified:{serializedName:"Last-Modified",required:true,xmlName:"Last-Modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"Etag",required:true,xmlName:"Etag",type:{name:"String"}},leaseStatus:{serializedName:"LeaseStatus",xmlName:"LeaseStatus",type:{name:"Enum",allowedValues:["locked","unlocked"]}},leaseState:{serializedName:"LeaseState",xmlName:"LeaseState",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseDuration:{serializedName:"LeaseDuration",xmlName:"LeaseDuration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},publicAccess:{serializedName:"PublicAccess",xmlName:"PublicAccess",type:{name:"Enum",allowedValues:["container","blob"]}},hasImmutabilityPolicy:{serializedName:"HasImmutabilityPolicy",xmlName:"HasImmutabilityPolicy",type:{name:"Boolean"}},hasLegalHold:{serializedName:"HasLegalHold",xmlName:"HasLegalHold",type:{name:"Boolean"}},defaultEncryptionScope:{serializedName:"DefaultEncryptionScope",xmlName:"DefaultEncryptionScope",type:{name:"String"}},preventEncryptionScopeOverride:{serializedName:"DenyEncryptionScopeOverride",xmlName:"DenyEncryptionScopeOverride",type:{name:"Boolean"}},deletedOn:{serializedName:"DeletedTime",xmlName:"DeletedTime",type:{name:"DateTimeRfc1123"}},remainingRetentionDays:{serializedName:"RemainingRetentionDays",xmlName:"RemainingRetentionDays",type:{name:"Number"}},isImmutableStorageWithVersioningEnabled:{serializedName:"ImmutableStorageWithVersioningEnabled",xmlName:"ImmutableStorageWithVersioningEnabled",type:{name:"Boolean"}}}}};const L={serializedName:"KeyInfo",type:{name:"Composite",className:"KeyInfo",modelProperties:{startsOn:{serializedName:"Start",required:true,xmlName:"Start",type:{name:"String"}},expiresOn:{serializedName:"Expiry",required:true,xmlName:"Expiry",type:{name:"String"}}}}};const M={serializedName:"UserDelegationKey",type:{name:"Composite",className:"UserDelegationKey",modelProperties:{signedObjectId:{serializedName:"SignedOid",required:true,xmlName:"SignedOid",type:{name:"String"}},signedTenantId:{serializedName:"SignedTid",required:true,xmlName:"SignedTid",type:{name:"String"}},signedStartsOn:{serializedName:"SignedStart",required:true,xmlName:"SignedStart",type:{name:"String"}},signedExpiresOn:{serializedName:"SignedExpiry",required:true,xmlName:"SignedExpiry",type:{name:"String"}},signedService:{serializedName:"SignedService",required:true,xmlName:"SignedService",type:{name:"String"}},signedVersion:{serializedName:"SignedVersion",required:true,xmlName:"SignedVersion",type:{name:"String"}},value:{serializedName:"Value",required:true,xmlName:"Value",type:{name:"String"}}}}};const U={serializedName:"FilterBlobSegment",xmlName:"EnumerationResults",type:{name:"Composite",className:"FilterBlobSegment",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},where:{serializedName:"Where",required:true,xmlName:"Where",type:{name:"String"}},blobs:{serializedName:"Blobs",required:true,xmlName:"Blobs",xmlIsWrapped:true,xmlElementName:"Blob",type:{name:"Sequence",element:{type:{name:"Composite",className:"FilterBlobItem"}}}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const q={serializedName:"FilterBlobItem",xmlName:"Blob",type:{name:"Composite",className:"FilterBlobItem",modelProperties:{name:{serializedName:"Name",required:true,xmlName:"Name",type:{name:"String"}},containerName:{serializedName:"ContainerName",required:true,xmlName:"ContainerName",type:{name:"String"}},tags:{serializedName:"Tags",xmlName:"Tags",type:{name:"Composite",className:"BlobTags"}}}}};const H={serializedName:"BlobTags",xmlName:"Tags",type:{name:"Composite",className:"BlobTags",modelProperties:{blobTagSet:{serializedName:"BlobTagSet",required:true,xmlName:"TagSet",xmlIsWrapped:true,xmlElementName:"Tag",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobTag"}}}}}}};const j={serializedName:"BlobTag",xmlName:"Tag",type:{name:"Composite",className:"BlobTag",modelProperties:{key:{serializedName:"Key",required:true,xmlName:"Key",type:{name:"String"}},value:{serializedName:"Value",required:true,xmlName:"Value",type:{name:"String"}}}}};const G={serializedName:"SignedIdentifier",xmlName:"SignedIdentifier",type:{name:"Composite",className:"SignedIdentifier",modelProperties:{id:{serializedName:"Id",required:true,xmlName:"Id",type:{name:"String"}},accessPolicy:{serializedName:"AccessPolicy",xmlName:"AccessPolicy",type:{name:"Composite",className:"AccessPolicy"}}}}};const z={serializedName:"AccessPolicy",type:{name:"Composite",className:"AccessPolicy",modelProperties:{startsOn:{serializedName:"Start",xmlName:"Start",type:{name:"String"}},expiresOn:{serializedName:"Expiry",xmlName:"Expiry",type:{name:"String"}},permissions:{serializedName:"Permission",xmlName:"Permission",type:{name:"String"}}}}};const V={serializedName:"ListBlobsFlatSegmentResponse",xmlName:"EnumerationResults",type:{name:"Composite",className:"ListBlobsFlatSegmentResponse",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},containerName:{serializedName:"ContainerName",required:true,xmlName:"ContainerName",xmlIsAttribute:true,type:{name:"String"}},prefix:{serializedName:"Prefix",xmlName:"Prefix",type:{name:"String"}},marker:{serializedName:"Marker",xmlName:"Marker",type:{name:"String"}},maxPageSize:{serializedName:"MaxResults",xmlName:"MaxResults",type:{name:"Number"}},segment:{serializedName:"Segment",xmlName:"Blobs",type:{name:"Composite",className:"BlobFlatListSegment"}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const J={serializedName:"BlobFlatListSegment",xmlName:"Blobs",type:{name:"Composite",className:"BlobFlatListSegment",modelProperties:{blobItems:{serializedName:"BlobItems",required:true,xmlName:"BlobItems",xmlElementName:"Blob",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobItemInternal"}}}}}}};const Y={serializedName:"BlobItemInternal",xmlName:"Blob",type:{name:"Composite",className:"BlobItemInternal",modelProperties:{name:{serializedName:"Name",xmlName:"Name",type:{name:"Composite",className:"BlobName"}},deleted:{serializedName:"Deleted",required:true,xmlName:"Deleted",type:{name:"Boolean"}},snapshot:{serializedName:"Snapshot",required:true,xmlName:"Snapshot",type:{name:"String"}},versionId:{serializedName:"VersionId",xmlName:"VersionId",type:{name:"String"}},isCurrentVersion:{serializedName:"IsCurrentVersion",xmlName:"IsCurrentVersion",type:{name:"Boolean"}},properties:{serializedName:"Properties",xmlName:"Properties",type:{name:"Composite",className:"BlobPropertiesInternal"}},metadata:{serializedName:"Metadata",xmlName:"Metadata",type:{name:"Dictionary",value:{type:{name:"String"}}}},blobTags:{serializedName:"BlobTags",xmlName:"Tags",type:{name:"Composite",className:"BlobTags"}},objectReplicationMetadata:{serializedName:"ObjectReplicationMetadata",xmlName:"OrMetadata",type:{name:"Dictionary",value:{type:{name:"String"}}}},hasVersionsOnly:{serializedName:"HasVersionsOnly",xmlName:"HasVersionsOnly",type:{name:"Boolean"}}}}};const W={serializedName:"BlobName",type:{name:"Composite",className:"BlobName",modelProperties:{encoded:{serializedName:"Encoded",xmlName:"Encoded",xmlIsAttribute:true,type:{name:"Boolean"}},content:{serializedName:"content",xmlName:"content",xmlIsMsText:true,type:{name:"String"}}}}};const X={serializedName:"BlobPropertiesInternal",xmlName:"Properties",type:{name:"Composite",className:"BlobPropertiesInternal",modelProperties:{createdOn:{serializedName:"Creation-Time",xmlName:"Creation-Time",type:{name:"DateTimeRfc1123"}},lastModified:{serializedName:"Last-Modified",required:true,xmlName:"Last-Modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"Etag",required:true,xmlName:"Etag",type:{name:"String"}},contentLength:{serializedName:"Content-Length",xmlName:"Content-Length",type:{name:"Number"}},contentType:{serializedName:"Content-Type",xmlName:"Content-Type",type:{name:"String"}},contentEncoding:{serializedName:"Content-Encoding",xmlName:"Content-Encoding",type:{name:"String"}},contentLanguage:{serializedName:"Content-Language",xmlName:"Content-Language",type:{name:"String"}},contentMD5:{serializedName:"Content-MD5",xmlName:"Content-MD5",type:{name:"ByteArray"}},contentDisposition:{serializedName:"Content-Disposition",xmlName:"Content-Disposition",type:{name:"String"}},cacheControl:{serializedName:"Cache-Control",xmlName:"Cache-Control",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"BlobType",xmlName:"BlobType",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},leaseStatus:{serializedName:"LeaseStatus",xmlName:"LeaseStatus",type:{name:"Enum",allowedValues:["locked","unlocked"]}},leaseState:{serializedName:"LeaseState",xmlName:"LeaseState",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseDuration:{serializedName:"LeaseDuration",xmlName:"LeaseDuration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},copyId:{serializedName:"CopyId",xmlName:"CopyId",type:{name:"String"}},copyStatus:{serializedName:"CopyStatus",xmlName:"CopyStatus",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},copySource:{serializedName:"CopySource",xmlName:"CopySource",type:{name:"String"}},copyProgress:{serializedName:"CopyProgress",xmlName:"CopyProgress",type:{name:"String"}},copyCompletedOn:{serializedName:"CopyCompletionTime",xmlName:"CopyCompletionTime",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"CopyStatusDescription",xmlName:"CopyStatusDescription",type:{name:"String"}},serverEncrypted:{serializedName:"ServerEncrypted",xmlName:"ServerEncrypted",type:{name:"Boolean"}},incrementalCopy:{serializedName:"IncrementalCopy",xmlName:"IncrementalCopy",type:{name:"Boolean"}},destinationSnapshot:{serializedName:"DestinationSnapshot",xmlName:"DestinationSnapshot",type:{name:"String"}},deletedOn:{serializedName:"DeletedTime",xmlName:"DeletedTime",type:{name:"DateTimeRfc1123"}},remainingRetentionDays:{serializedName:"RemainingRetentionDays",xmlName:"RemainingRetentionDays",type:{name:"Number"}},accessTier:{serializedName:"AccessTier",xmlName:"AccessTier",type:{name:"Enum",allowedValues:["P4","P6","P10","P15","P20","P30","P40","P50","P60","P70","P80","Hot","Cool","Archive","Cold"]}},accessTierInferred:{serializedName:"AccessTierInferred",xmlName:"AccessTierInferred",type:{name:"Boolean"}},archiveStatus:{serializedName:"ArchiveStatus",xmlName:"ArchiveStatus",type:{name:"Enum",allowedValues:["rehydrate-pending-to-hot","rehydrate-pending-to-cool","rehydrate-pending-to-cold"]}},customerProvidedKeySha256:{serializedName:"CustomerProvidedKeySha256",xmlName:"CustomerProvidedKeySha256",type:{name:"String"}},encryptionScope:{serializedName:"EncryptionScope",xmlName:"EncryptionScope",type:{name:"String"}},accessTierChangedOn:{serializedName:"AccessTierChangeTime",xmlName:"AccessTierChangeTime",type:{name:"DateTimeRfc1123"}},tagCount:{serializedName:"TagCount",xmlName:"TagCount",type:{name:"Number"}},expiresOn:{serializedName:"Expiry-Time",xmlName:"Expiry-Time",type:{name:"DateTimeRfc1123"}},isSealed:{serializedName:"Sealed",xmlName:"Sealed",type:{name:"Boolean"}},rehydratePriority:{serializedName:"RehydratePriority",xmlName:"RehydratePriority",type:{name:"Enum",allowedValues:["High","Standard"]}},lastAccessedOn:{serializedName:"LastAccessTime",xmlName:"LastAccessTime",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiresOn:{serializedName:"ImmutabilityPolicyUntilDate",xmlName:"ImmutabilityPolicyUntilDate",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"ImmutabilityPolicyMode",xmlName:"ImmutabilityPolicyMode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}},legalHold:{serializedName:"LegalHold",xmlName:"LegalHold",type:{name:"Boolean"}}}}};const K={serializedName:"ListBlobsHierarchySegmentResponse",xmlName:"EnumerationResults",type:{name:"Composite",className:"ListBlobsHierarchySegmentResponse",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},containerName:{serializedName:"ContainerName",required:true,xmlName:"ContainerName",xmlIsAttribute:true,type:{name:"String"}},prefix:{serializedName:"Prefix",xmlName:"Prefix",type:{name:"String"}},marker:{serializedName:"Marker",xmlName:"Marker",type:{name:"String"}},maxPageSize:{serializedName:"MaxResults",xmlName:"MaxResults",type:{name:"Number"}},delimiter:{serializedName:"Delimiter",xmlName:"Delimiter",type:{name:"String"}},segment:{serializedName:"Segment",xmlName:"Blobs",type:{name:"Composite",className:"BlobHierarchyListSegment"}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const $={serializedName:"BlobHierarchyListSegment",xmlName:"Blobs",type:{name:"Composite",className:"BlobHierarchyListSegment",modelProperties:{blobPrefixes:{serializedName:"BlobPrefixes",xmlName:"BlobPrefixes",xmlElementName:"BlobPrefix",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobPrefix"}}}},blobItems:{serializedName:"BlobItems",required:true,xmlName:"BlobItems",xmlElementName:"Blob",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobItemInternal"}}}}}}};const Z={serializedName:"BlobPrefix",type:{name:"Composite",className:"BlobPrefix",modelProperties:{name:{serializedName:"Name",xmlName:"Name",type:{name:"Composite",className:"BlobName"}}}}};const ee={serializedName:"BlockLookupList",xmlName:"BlockList",type:{name:"Composite",className:"BlockLookupList",modelProperties:{committed:{serializedName:"Committed",xmlName:"Committed",xmlElementName:"Committed",type:{name:"Sequence",element:{type:{name:"String"}}}},uncommitted:{serializedName:"Uncommitted",xmlName:"Uncommitted",xmlElementName:"Uncommitted",type:{name:"Sequence",element:{type:{name:"String"}}}},latest:{serializedName:"Latest",xmlName:"Latest",xmlElementName:"Latest",type:{name:"Sequence",element:{type:{name:"String"}}}}}}};const te={serializedName:"BlockList",type:{name:"Composite",className:"BlockList",modelProperties:{committedBlocks:{serializedName:"CommittedBlocks",xmlName:"CommittedBlocks",xmlIsWrapped:true,xmlElementName:"Block",type:{name:"Sequence",element:{type:{name:"Composite",className:"Block"}}}},uncommittedBlocks:{serializedName:"UncommittedBlocks",xmlName:"UncommittedBlocks",xmlIsWrapped:true,xmlElementName:"Block",type:{name:"Sequence",element:{type:{name:"Composite",className:"Block"}}}}}}};const re={serializedName:"Block",type:{name:"Composite",className:"Block",modelProperties:{name:{serializedName:"Name",required:true,xmlName:"Name",type:{name:"String"}},size:{serializedName:"Size",required:true,xmlName:"Size",type:{name:"Number"}}}}};const ie={serializedName:"PageList",type:{name:"Composite",className:"PageList",modelProperties:{pageRange:{serializedName:"PageRange",xmlName:"PageRange",xmlElementName:"PageRange",type:{name:"Sequence",element:{type:{name:"Composite",className:"PageRange"}}}},clearRange:{serializedName:"ClearRange",xmlName:"ClearRange",xmlElementName:"ClearRange",type:{name:"Sequence",element:{type:{name:"Composite",className:"ClearRange"}}}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const ne={serializedName:"PageRange",xmlName:"PageRange",type:{name:"Composite",className:"PageRange",modelProperties:{start:{serializedName:"Start",required:true,xmlName:"Start",type:{name:"Number"}},end:{serializedName:"End",required:true,xmlName:"End",type:{name:"Number"}}}}};const ae={serializedName:"ClearRange",xmlName:"ClearRange",type:{name:"Composite",className:"ClearRange",modelProperties:{start:{serializedName:"Start",required:true,xmlName:"Start",type:{name:"Number"}},end:{serializedName:"End",required:true,xmlName:"End",type:{name:"Number"}}}}};const se={serializedName:"QueryRequest",xmlName:"QueryRequest",type:{name:"Composite",className:"QueryRequest",modelProperties:{queryType:{serializedName:"QueryType",required:true,xmlName:"QueryType",type:{name:"String"}},expression:{serializedName:"Expression",required:true,xmlName:"Expression",type:{name:"String"}},inputSerialization:{serializedName:"InputSerialization",xmlName:"InputSerialization",type:{name:"Composite",className:"QuerySerialization"}},outputSerialization:{serializedName:"OutputSerialization",xmlName:"OutputSerialization",type:{name:"Composite",className:"QuerySerialization"}}}}};const oe={serializedName:"QuerySerialization",type:{name:"Composite",className:"QuerySerialization",modelProperties:{format:{serializedName:"Format",xmlName:"Format",type:{name:"Composite",className:"QueryFormat"}}}}};const le={serializedName:"QueryFormat",type:{name:"Composite",className:"QueryFormat",modelProperties:{type:{serializedName:"Type",required:true,xmlName:"Type",type:{name:"Enum",allowedValues:["delimited","json","arrow","parquet"]}},delimitedTextConfiguration:{serializedName:"DelimitedTextConfiguration",xmlName:"DelimitedTextConfiguration",type:{name:"Composite",className:"DelimitedTextConfiguration"}},jsonTextConfiguration:{serializedName:"JsonTextConfiguration",xmlName:"JsonTextConfiguration",type:{name:"Composite",className:"JsonTextConfiguration"}},arrowConfiguration:{serializedName:"ArrowConfiguration",xmlName:"ArrowConfiguration",type:{name:"Composite",className:"ArrowConfiguration"}},parquetTextConfiguration:{serializedName:"ParquetTextConfiguration",xmlName:"ParquetTextConfiguration",type:{name:"any"}}}}};const ce={serializedName:"DelimitedTextConfiguration",xmlName:"DelimitedTextConfiguration",type:{name:"Composite",className:"DelimitedTextConfiguration",modelProperties:{columnSeparator:{serializedName:"ColumnSeparator",xmlName:"ColumnSeparator",type:{name:"String"}},fieldQuote:{serializedName:"FieldQuote",xmlName:"FieldQuote",type:{name:"String"}},recordSeparator:{serializedName:"RecordSeparator",xmlName:"RecordSeparator",type:{name:"String"}},escapeChar:{serializedName:"EscapeChar",xmlName:"EscapeChar",type:{name:"String"}},headersPresent:{serializedName:"HeadersPresent",xmlName:"HasHeaders",type:{name:"Boolean"}}}}};const pe={serializedName:"JsonTextConfiguration",xmlName:"JsonTextConfiguration",type:{name:"Composite",className:"JsonTextConfiguration",modelProperties:{recordSeparator:{serializedName:"RecordSeparator",xmlName:"RecordSeparator",type:{name:"String"}}}}};const de={serializedName:"ArrowConfiguration",xmlName:"ArrowConfiguration",type:{name:"Composite",className:"ArrowConfiguration",modelProperties:{schema:{serializedName:"Schema",required:true,xmlName:"Schema",xmlIsWrapped:true,xmlElementName:"Field",type:{name:"Sequence",element:{type:{name:"Composite",className:"ArrowField"}}}}}}};const ue={serializedName:"ArrowField",xmlName:"Field",type:{name:"Composite",className:"ArrowField",modelProperties:{type:{serializedName:"Type",required:true,xmlName:"Type",type:{name:"String"}},name:{serializedName:"Name",xmlName:"Name",type:{name:"String"}},precision:{serializedName:"Precision",xmlName:"Precision",type:{name:"Number"}},scale:{serializedName:"Scale",xmlName:"Scale",type:{name:"Number"}}}}};const Ae={serializedName:"Service_setPropertiesHeaders",type:{name:"Composite",className:"ServiceSetPropertiesHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const me={serializedName:"Service_setPropertiesExceptionHeaders",type:{name:"Composite",className:"ServiceSetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const fe={serializedName:"Service_getPropertiesHeaders",type:{name:"Composite",className:"ServiceGetPropertiesHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const he={serializedName:"Service_getPropertiesExceptionHeaders",type:{name:"Composite",className:"ServiceGetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ge={serializedName:"Service_getStatisticsHeaders",type:{name:"Composite",className:"ServiceGetStatisticsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ye={serializedName:"Service_getStatisticsExceptionHeaders",type:{name:"Composite",className:"ServiceGetStatisticsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ee={serializedName:"Service_listContainersSegmentHeaders",type:{name:"Composite",className:"ServiceListContainersSegmentHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const be={serializedName:"Service_listContainersSegmentExceptionHeaders",type:{name:"Composite",className:"ServiceListContainersSegmentExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ce={serializedName:"Service_getUserDelegationKeyHeaders",type:{name:"Composite",className:"ServiceGetUserDelegationKeyHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ve={serializedName:"Service_getUserDelegationKeyExceptionHeaders",type:{name:"Composite",className:"ServiceGetUserDelegationKeyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Be={serializedName:"Service_getAccountInfoHeaders",type:{name:"Composite",className:"ServiceGetAccountInfoHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",xmlName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",xmlName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2","FileStorage","BlockBlobStorage"]}},isHierarchicalNamespaceEnabled:{serializedName:"x-ms-is-hns-enabled",xmlName:"x-ms-is-hns-enabled",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ie={serializedName:"Service_getAccountInfoExceptionHeaders",type:{name:"Composite",className:"ServiceGetAccountInfoExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const we={serializedName:"Service_submitBatchHeaders",type:{name:"Composite",className:"ServiceSubmitBatchHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Se={serializedName:"Service_submitBatchExceptionHeaders",type:{name:"Composite",className:"ServiceSubmitBatchExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Qe={serializedName:"Service_filterBlobsHeaders",type:{name:"Composite",className:"ServiceFilterBlobsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const xe={serializedName:"Service_filterBlobsExceptionHeaders",type:{name:"Composite",className:"ServiceFilterBlobsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ne={serializedName:"Container_createHeaders",type:{name:"Composite",className:"ContainerCreateHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Re={serializedName:"Container_createExceptionHeaders",type:{name:"Composite",className:"ContainerCreateExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Te={serializedName:"Container_getPropertiesHeaders",type:{name:"Composite",className:"ContainerGetPropertiesHeaders",modelProperties:{metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobPublicAccess:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}},hasImmutabilityPolicy:{serializedName:"x-ms-has-immutability-policy",xmlName:"x-ms-has-immutability-policy",type:{name:"Boolean"}},hasLegalHold:{serializedName:"x-ms-has-legal-hold",xmlName:"x-ms-has-legal-hold",type:{name:"Boolean"}},defaultEncryptionScope:{serializedName:"x-ms-default-encryption-scope",xmlName:"x-ms-default-encryption-scope",type:{name:"String"}},denyEncryptionScopeOverride:{serializedName:"x-ms-deny-encryption-scope-override",xmlName:"x-ms-deny-encryption-scope-override",type:{name:"Boolean"}},isImmutableStorageWithVersioningEnabled:{serializedName:"x-ms-immutable-storage-with-versioning-enabled",xmlName:"x-ms-immutable-storage-with-versioning-enabled",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const De={serializedName:"Container_getPropertiesExceptionHeaders",type:{name:"Composite",className:"ContainerGetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ke={serializedName:"Container_deleteHeaders",type:{name:"Composite",className:"ContainerDeleteHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const _e={serializedName:"Container_deleteExceptionHeaders",type:{name:"Composite",className:"ContainerDeleteExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Oe={serializedName:"Container_setMetadataHeaders",type:{name:"Composite",className:"ContainerSetMetadataHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Pe={serializedName:"Container_setMetadataExceptionHeaders",type:{name:"Composite",className:"ContainerSetMetadataExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Le={serializedName:"Container_getAccessPolicyHeaders",type:{name:"Composite",className:"ContainerGetAccessPolicyHeaders",modelProperties:{blobPublicAccess:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Me={serializedName:"Container_getAccessPolicyExceptionHeaders",type:{name:"Composite",className:"ContainerGetAccessPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Fe={serializedName:"Container_setAccessPolicyHeaders",type:{name:"Composite",className:"ContainerSetAccessPolicyHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ue={serializedName:"Container_setAccessPolicyExceptionHeaders",type:{name:"Composite",className:"ContainerSetAccessPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const qe={serializedName:"Container_restoreHeaders",type:{name:"Composite",className:"ContainerRestoreHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const He={serializedName:"Container_restoreExceptionHeaders",type:{name:"Composite",className:"ContainerRestoreExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const je={serializedName:"Container_renameHeaders",type:{name:"Composite",className:"ContainerRenameHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ge={serializedName:"Container_renameExceptionHeaders",type:{name:"Composite",className:"ContainerRenameExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ze={serializedName:"Container_submitBatchHeaders",type:{name:"Composite",className:"ContainerSubmitBatchHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}}}}};const Ve={serializedName:"Container_submitBatchExceptionHeaders",type:{name:"Composite",className:"ContainerSubmitBatchExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Je={serializedName:"Container_filterBlobsHeaders",type:{name:"Composite",className:"ContainerFilterBlobsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ye={serializedName:"Container_filterBlobsExceptionHeaders",type:{name:"Composite",className:"ContainerFilterBlobsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const We={serializedName:"Container_acquireLeaseHeaders",type:{name:"Composite",className:"ContainerAcquireLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Xe={serializedName:"Container_acquireLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerAcquireLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ke={serializedName:"Container_releaseLeaseHeaders",type:{name:"Composite",className:"ContainerReleaseLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const $e={serializedName:"Container_releaseLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerReleaseLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ze={serializedName:"Container_renewLeaseHeaders",type:{name:"Composite",className:"ContainerRenewLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const et={serializedName:"Container_renewLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerRenewLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const tt={serializedName:"Container_breakLeaseHeaders",type:{name:"Composite",className:"ContainerBreakLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseTime:{serializedName:"x-ms-lease-time",xmlName:"x-ms-lease-time",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const rt={serializedName:"Container_breakLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerBreakLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const it={serializedName:"Container_changeLeaseHeaders",type:{name:"Composite",className:"ContainerChangeLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const nt={serializedName:"Container_changeLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerChangeLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const st={serializedName:"Container_listBlobFlatSegmentHeaders",type:{name:"Composite",className:"ContainerListBlobFlatSegmentHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ot={serializedName:"Container_listBlobFlatSegmentExceptionHeaders",type:{name:"Composite",className:"ContainerListBlobFlatSegmentExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const lt={serializedName:"Container_listBlobHierarchySegmentHeaders",type:{name:"Composite",className:"ContainerListBlobHierarchySegmentHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ct={serializedName:"Container_listBlobHierarchySegmentExceptionHeaders",type:{name:"Composite",className:"ContainerListBlobHierarchySegmentExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const pt={serializedName:"Container_getAccountInfoHeaders",type:{name:"Composite",className:"ContainerGetAccountInfoHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",xmlName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",xmlName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2","FileStorage","BlockBlobStorage"]}}}}};const dt={serializedName:"Container_getAccountInfoExceptionHeaders",type:{name:"Composite",className:"ContainerGetAccountInfoExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ut={serializedName:"Blob_downloadHeaders",type:{name:"Composite",className:"BlobDownloadHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},createdOn:{serializedName:"x-ms-creation-time",xmlName:"x-ms-creation-time",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},objectReplicationPolicyId:{serializedName:"x-ms-or-policy-id",xmlName:"x-ms-or-policy-id",type:{name:"String"}},objectReplicationRules:{serializedName:"x-ms-or",xmlName:"x-ms-or",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-or-"},contentLength:{serializedName:"content-length",xmlName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},contentRange:{serializedName:"content-range",xmlName:"content-range",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",xmlName:"content-encoding",type:{name:"String"}},cacheControl:{serializedName:"cache-control",xmlName:"cache-control",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",xmlName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",xmlName:"content-language",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"x-ms-blob-type",xmlName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletedOn:{serializedName:"x-ms-copy-completion-time",xmlName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",xmlName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",xmlName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",xmlName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},isCurrentVersion:{serializedName:"x-ms-is-current-version",xmlName:"x-ms-is-current-version",type:{name:"Boolean"}},acceptRanges:{serializedName:"accept-ranges",xmlName:"accept-ranges",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",xmlName:"x-ms-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},blobContentMD5:{serializedName:"x-ms-blob-content-md5",xmlName:"x-ms-blob-content-md5",type:{name:"ByteArray"}},tagCount:{serializedName:"x-ms-tag-count",xmlName:"x-ms-tag-count",type:{name:"Number"}},isSealed:{serializedName:"x-ms-blob-sealed",xmlName:"x-ms-blob-sealed",type:{name:"Boolean"}},lastAccessed:{serializedName:"x-ms-last-access-time",xmlName:"x-ms-last-access-time",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiresOn:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}},legalHold:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}},contentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}}}}};const At={serializedName:"Blob_downloadExceptionHeaders",type:{name:"Composite",className:"BlobDownloadExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const mt={serializedName:"Blob_getPropertiesHeaders",type:{name:"Composite",className:"BlobGetPropertiesHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},createdOn:{serializedName:"x-ms-creation-time",xmlName:"x-ms-creation-time",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},objectReplicationPolicyId:{serializedName:"x-ms-or-policy-id",xmlName:"x-ms-or-policy-id",type:{name:"String"}},objectReplicationRules:{serializedName:"x-ms-or",xmlName:"x-ms-or",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-or-"},blobType:{serializedName:"x-ms-blob-type",xmlName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletedOn:{serializedName:"x-ms-copy-completion-time",xmlName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",xmlName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",xmlName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",xmlName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},isIncrementalCopy:{serializedName:"x-ms-incremental-copy",xmlName:"x-ms-incremental-copy",type:{name:"Boolean"}},destinationSnapshot:{serializedName:"x-ms-copy-destination-snapshot",xmlName:"x-ms-copy-destination-snapshot",type:{name:"String"}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},contentLength:{serializedName:"content-length",xmlName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",xmlName:"content-encoding",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",xmlName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",xmlName:"content-language",type:{name:"String"}},cacheControl:{serializedName:"cache-control",xmlName:"cache-control",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},acceptRanges:{serializedName:"accept-ranges",xmlName:"accept-ranges",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",xmlName:"x-ms-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},accessTier:{serializedName:"x-ms-access-tier",xmlName:"x-ms-access-tier",type:{name:"String"}},accessTierInferred:{serializedName:"x-ms-access-tier-inferred",xmlName:"x-ms-access-tier-inferred",type:{name:"Boolean"}},archiveStatus:{serializedName:"x-ms-archive-status",xmlName:"x-ms-archive-status",type:{name:"String"}},accessTierChangedOn:{serializedName:"x-ms-access-tier-change-time",xmlName:"x-ms-access-tier-change-time",type:{name:"DateTimeRfc1123"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},isCurrentVersion:{serializedName:"x-ms-is-current-version",xmlName:"x-ms-is-current-version",type:{name:"Boolean"}},tagCount:{serializedName:"x-ms-tag-count",xmlName:"x-ms-tag-count",type:{name:"Number"}},expiresOn:{serializedName:"x-ms-expiry-time",xmlName:"x-ms-expiry-time",type:{name:"DateTimeRfc1123"}},isSealed:{serializedName:"x-ms-blob-sealed",xmlName:"x-ms-blob-sealed",type:{name:"Boolean"}},rehydratePriority:{serializedName:"x-ms-rehydrate-priority",xmlName:"x-ms-rehydrate-priority",type:{name:"Enum",allowedValues:["High","Standard"]}},lastAccessed:{serializedName:"x-ms-last-access-time",xmlName:"x-ms-last-access-time",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiresOn:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}},legalHold:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ft={serializedName:"Blob_getPropertiesExceptionHeaders",type:{name:"Composite",className:"BlobGetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ht={serializedName:"Blob_deleteHeaders",type:{name:"Composite",className:"BlobDeleteHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const gt={serializedName:"Blob_deleteExceptionHeaders",type:{name:"Composite",className:"BlobDeleteExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const yt={serializedName:"Blob_undeleteHeaders",type:{name:"Composite",className:"BlobUndeleteHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Et={serializedName:"Blob_undeleteExceptionHeaders",type:{name:"Composite",className:"BlobUndeleteExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const bt={serializedName:"Blob_setExpiryHeaders",type:{name:"Composite",className:"BlobSetExpiryHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ct={serializedName:"Blob_setExpiryExceptionHeaders",type:{name:"Composite",className:"BlobSetExpiryExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const vt={serializedName:"Blob_setHttpHeadersHeaders",type:{name:"Composite",className:"BlobSetHttpHeadersHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Bt={serializedName:"Blob_setHttpHeadersExceptionHeaders",type:{name:"Composite",className:"BlobSetHttpHeadersExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const It={serializedName:"Blob_setImmutabilityPolicyHeaders",type:{name:"Composite",className:"BlobSetImmutabilityPolicyHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiry:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}}}}};const wt={serializedName:"Blob_setImmutabilityPolicyExceptionHeaders",type:{name:"Composite",className:"BlobSetImmutabilityPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const St={serializedName:"Blob_deleteImmutabilityPolicyHeaders",type:{name:"Composite",className:"BlobDeleteImmutabilityPolicyHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Qt={serializedName:"Blob_deleteImmutabilityPolicyExceptionHeaders",type:{name:"Composite",className:"BlobDeleteImmutabilityPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const xt={serializedName:"Blob_setLegalHoldHeaders",type:{name:"Composite",className:"BlobSetLegalHoldHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},legalHold:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}}}}};const Nt={serializedName:"Blob_setLegalHoldExceptionHeaders",type:{name:"Composite",className:"BlobSetLegalHoldExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Rt={serializedName:"Blob_setMetadataHeaders",type:{name:"Composite",className:"BlobSetMetadataHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Tt={serializedName:"Blob_setMetadataExceptionHeaders",type:{name:"Composite",className:"BlobSetMetadataExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Dt={serializedName:"Blob_acquireLeaseHeaders",type:{name:"Composite",className:"BlobAcquireLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const kt={serializedName:"Blob_acquireLeaseExceptionHeaders",type:{name:"Composite",className:"BlobAcquireLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const _t={serializedName:"Blob_releaseLeaseHeaders",type:{name:"Composite",className:"BlobReleaseLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ot={serializedName:"Blob_releaseLeaseExceptionHeaders",type:{name:"Composite",className:"BlobReleaseLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Pt={serializedName:"Blob_renewLeaseHeaders",type:{name:"Composite",className:"BlobRenewLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Lt={serializedName:"Blob_renewLeaseExceptionHeaders",type:{name:"Composite",className:"BlobRenewLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Mt={serializedName:"Blob_changeLeaseHeaders",type:{name:"Composite",className:"BlobChangeLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ft={serializedName:"Blob_changeLeaseExceptionHeaders",type:{name:"Composite",className:"BlobChangeLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ut={serializedName:"Blob_breakLeaseHeaders",type:{name:"Composite",className:"BlobBreakLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseTime:{serializedName:"x-ms-lease-time",xmlName:"x-ms-lease-time",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const qt={serializedName:"Blob_breakLeaseExceptionHeaders",type:{name:"Composite",className:"BlobBreakLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ht={serializedName:"Blob_createSnapshotHeaders",type:{name:"Composite",className:"BlobCreateSnapshotHeaders",modelProperties:{snapshot:{serializedName:"x-ms-snapshot",xmlName:"x-ms-snapshot",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const jt={serializedName:"Blob_createSnapshotExceptionHeaders",type:{name:"Composite",className:"BlobCreateSnapshotExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Gt={serializedName:"Blob_startCopyFromURLHeaders",type:{name:"Composite",className:"BlobStartCopyFromURLHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const zt={serializedName:"Blob_startCopyFromURLExceptionHeaders",type:{name:"Composite",className:"BlobStartCopyFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Vt={serializedName:"Blob_copyFromURLHeaders",type:{name:"Composite",className:"BlobCopyFromURLHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{defaultValue:"success",isConstant:true,serializedName:"x-ms-copy-status",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Jt={serializedName:"Blob_copyFromURLExceptionHeaders",type:{name:"Composite",className:"BlobCopyFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Yt={serializedName:"Blob_abortCopyFromURLHeaders",type:{name:"Composite",className:"BlobAbortCopyFromURLHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Wt={serializedName:"Blob_abortCopyFromURLExceptionHeaders",type:{name:"Composite",className:"BlobAbortCopyFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Xt={serializedName:"Blob_setTierHeaders",type:{name:"Composite",className:"BlobSetTierHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Kt={serializedName:"Blob_setTierExceptionHeaders",type:{name:"Composite",className:"BlobSetTierExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const $t={serializedName:"Blob_getAccountInfoHeaders",type:{name:"Composite",className:"BlobGetAccountInfoHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",xmlName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",xmlName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2","FileStorage","BlockBlobStorage"]}}}}};const Zt={serializedName:"Blob_getAccountInfoExceptionHeaders",type:{name:"Composite",className:"BlobGetAccountInfoExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const er={serializedName:"Blob_queryHeaders",type:{name:"Composite",className:"BlobQueryHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}}},contentLength:{serializedName:"content-length",xmlName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},contentRange:{serializedName:"content-range",xmlName:"content-range",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",xmlName:"content-encoding",type:{name:"String"}},cacheControl:{serializedName:"cache-control",xmlName:"cache-control",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",xmlName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",xmlName:"content-language",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"x-ms-blob-type",xmlName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletionTime:{serializedName:"x-ms-copy-completion-time",xmlName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",xmlName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",xmlName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",xmlName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},acceptRanges:{serializedName:"accept-ranges",xmlName:"accept-ranges",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",xmlName:"x-ms-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},blobContentMD5:{serializedName:"x-ms-blob-content-md5",xmlName:"x-ms-blob-content-md5",type:{name:"ByteArray"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}},contentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}}}}};const tr={serializedName:"Blob_queryExceptionHeaders",type:{name:"Composite",className:"BlobQueryExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const rr={serializedName:"Blob_getTagsHeaders",type:{name:"Composite",className:"BlobGetTagsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ir={serializedName:"Blob_getTagsExceptionHeaders",type:{name:"Composite",className:"BlobGetTagsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const nr={serializedName:"Blob_setTagsHeaders",type:{name:"Composite",className:"BlobSetTagsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ar={serializedName:"Blob_setTagsExceptionHeaders",type:{name:"Composite",className:"BlobSetTagsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const sr={serializedName:"PageBlob_createHeaders",type:{name:"Composite",className:"PageBlobCreateHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const or={serializedName:"PageBlob_createExceptionHeaders",type:{name:"Composite",className:"PageBlobCreateExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const lr={serializedName:"PageBlob_uploadPagesHeaders",type:{name:"Composite",className:"PageBlobUploadPagesHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const cr={serializedName:"PageBlob_uploadPagesExceptionHeaders",type:{name:"Composite",className:"PageBlobUploadPagesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const pr={serializedName:"PageBlob_clearPagesHeaders",type:{name:"Composite",className:"PageBlobClearPagesHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const dr={serializedName:"PageBlob_clearPagesExceptionHeaders",type:{name:"Composite",className:"PageBlobClearPagesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ur={serializedName:"PageBlob_uploadPagesFromURLHeaders",type:{name:"Composite",className:"PageBlobUploadPagesFromURLHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ar={serializedName:"PageBlob_uploadPagesFromURLExceptionHeaders",type:{name:"Composite",className:"PageBlobUploadPagesFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const mr={serializedName:"PageBlob_getPageRangesHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",xmlName:"x-ms-blob-content-length",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const fr={serializedName:"PageBlob_getPageRangesExceptionHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const hr={serializedName:"PageBlob_getPageRangesDiffHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesDiffHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",xmlName:"x-ms-blob-content-length",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const gr={serializedName:"PageBlob_getPageRangesDiffExceptionHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesDiffExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const yr={serializedName:"PageBlob_resizeHeaders",type:{name:"Composite",className:"PageBlobResizeHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Er={serializedName:"PageBlob_resizeExceptionHeaders",type:{name:"Composite",className:"PageBlobResizeExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const br={serializedName:"PageBlob_updateSequenceNumberHeaders",type:{name:"Composite",className:"PageBlobUpdateSequenceNumberHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Cr={serializedName:"PageBlob_updateSequenceNumberExceptionHeaders",type:{name:"Composite",className:"PageBlobUpdateSequenceNumberExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const vr={serializedName:"PageBlob_copyIncrementalHeaders",type:{name:"Composite",className:"PageBlobCopyIncrementalHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Br={serializedName:"PageBlob_copyIncrementalExceptionHeaders",type:{name:"Composite",className:"PageBlobCopyIncrementalExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ir={serializedName:"AppendBlob_createHeaders",type:{name:"Composite",className:"AppendBlobCreateHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const wr={serializedName:"AppendBlob_createExceptionHeaders",type:{name:"Composite",className:"AppendBlobCreateExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Sr={serializedName:"AppendBlob_appendBlockHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobAppendOffset:{serializedName:"x-ms-blob-append-offset",xmlName:"x-ms-blob-append-offset",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Qr={serializedName:"AppendBlob_appendBlockExceptionHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const xr={serializedName:"AppendBlob_appendBlockFromUrlHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockFromUrlHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobAppendOffset:{serializedName:"x-ms-blob-append-offset",xmlName:"x-ms-blob-append-offset",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Nr={serializedName:"AppendBlob_appendBlockFromUrlExceptionHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockFromUrlExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Rr={serializedName:"AppendBlob_sealHeaders",type:{name:"Composite",className:"AppendBlobSealHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isSealed:{serializedName:"x-ms-blob-sealed",xmlName:"x-ms-blob-sealed",type:{name:"Boolean"}}}}};const Tr={serializedName:"AppendBlob_sealExceptionHeaders",type:{name:"Composite",className:"AppendBlobSealExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Dr={serializedName:"BlockBlob_uploadHeaders",type:{name:"Composite",className:"BlockBlobUploadHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const kr={serializedName:"BlockBlob_uploadExceptionHeaders",type:{name:"Composite",className:"BlockBlobUploadExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const _r={serializedName:"BlockBlob_putBlobFromUrlHeaders",type:{name:"Composite",className:"BlockBlobPutBlobFromUrlHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Or={serializedName:"BlockBlob_putBlobFromUrlExceptionHeaders",type:{name:"Composite",className:"BlockBlobPutBlobFromUrlExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Pr={serializedName:"BlockBlob_stageBlockHeaders",type:{name:"Composite",className:"BlockBlobStageBlockHeaders",modelProperties:{contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Lr={serializedName:"BlockBlob_stageBlockExceptionHeaders",type:{name:"Composite",className:"BlockBlobStageBlockExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Mr={serializedName:"BlockBlob_stageBlockFromURLHeaders",type:{name:"Composite",className:"BlockBlobStageBlockFromURLHeaders",modelProperties:{contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Fr={serializedName:"BlockBlob_stageBlockFromURLExceptionHeaders",type:{name:"Composite",className:"BlockBlobStageBlockFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ur={serializedName:"BlockBlob_commitBlockListHeaders",type:{name:"Composite",className:"BlockBlobCommitBlockListHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const qr={serializedName:"BlockBlob_commitBlockListExceptionHeaders",type:{name:"Composite",className:"BlockBlobCommitBlockListExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Hr={serializedName:"BlockBlob_getBlockListHeaders",type:{name:"Composite",className:"BlockBlobGetBlockListHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",xmlName:"x-ms-blob-content-length",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const jr={serializedName:"BlockBlob_getBlockListExceptionHeaders",type:{name:"Composite",className:"BlockBlobGetBlockListExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};var Gr=Object.freeze({__proto__:null,BlobServiceProperties:w,Logging:S,RetentionPolicy:Q,Metrics:x,CorsRule:N,StaticWebsite:R,StorageError:T,BlobServiceStatistics:D,GeoReplication:k,ListContainersSegmentResponse:_,ContainerItem:O,ContainerProperties:P,KeyInfo:L,UserDelegationKey:M,FilterBlobSegment:U,FilterBlobItem:q,BlobTags:H,BlobTag:j,SignedIdentifier:G,AccessPolicy:z,ListBlobsFlatSegmentResponse:V,BlobFlatListSegment:J,BlobItemInternal:Y,BlobName:W,BlobPropertiesInternal:X,ListBlobsHierarchySegmentResponse:K,BlobHierarchyListSegment:$,BlobPrefix:Z,BlockLookupList:ee,BlockList:te,Block:re,PageList:ie,PageRange:ne,ClearRange:ae,QueryRequest:se,QuerySerialization:oe,QueryFormat:le,DelimitedTextConfiguration:ce,JsonTextConfiguration:pe,ArrowConfiguration:de,ArrowField:ue,ServiceSetPropertiesHeaders:Ae,ServiceSetPropertiesExceptionHeaders:me,ServiceGetPropertiesHeaders:fe,ServiceGetPropertiesExceptionHeaders:he,ServiceGetStatisticsHeaders:ge,ServiceGetStatisticsExceptionHeaders:ye,ServiceListContainersSegmentHeaders:Ee,ServiceListContainersSegmentExceptionHeaders:be,ServiceGetUserDelegationKeyHeaders:Ce,ServiceGetUserDelegationKeyExceptionHeaders:ve,ServiceGetAccountInfoHeaders:Be,ServiceGetAccountInfoExceptionHeaders:Ie,ServiceSubmitBatchHeaders:we,ServiceSubmitBatchExceptionHeaders:Se,ServiceFilterBlobsHeaders:Qe,ServiceFilterBlobsExceptionHeaders:xe,ContainerCreateHeaders:Ne,ContainerCreateExceptionHeaders:Re,ContainerGetPropertiesHeaders:Te,ContainerGetPropertiesExceptionHeaders:De,ContainerDeleteHeaders:ke,ContainerDeleteExceptionHeaders:_e,ContainerSetMetadataHeaders:Oe,ContainerSetMetadataExceptionHeaders:Pe,ContainerGetAccessPolicyHeaders:Le,ContainerGetAccessPolicyExceptionHeaders:Me,ContainerSetAccessPolicyHeaders:Fe,ContainerSetAccessPolicyExceptionHeaders:Ue,ContainerRestoreHeaders:qe,ContainerRestoreExceptionHeaders:He,ContainerRenameHeaders:je,ContainerRenameExceptionHeaders:Ge,ContainerSubmitBatchHeaders:ze,ContainerSubmitBatchExceptionHeaders:Ve,ContainerFilterBlobsHeaders:Je,ContainerFilterBlobsExceptionHeaders:Ye,ContainerAcquireLeaseHeaders:We,ContainerAcquireLeaseExceptionHeaders:Xe,ContainerReleaseLeaseHeaders:Ke,ContainerReleaseLeaseExceptionHeaders:$e,ContainerRenewLeaseHeaders:Ze,ContainerRenewLeaseExceptionHeaders:et,ContainerBreakLeaseHeaders:tt,ContainerBreakLeaseExceptionHeaders:rt,ContainerChangeLeaseHeaders:it,ContainerChangeLeaseExceptionHeaders:nt,ContainerListBlobFlatSegmentHeaders:st,ContainerListBlobFlatSegmentExceptionHeaders:ot,ContainerListBlobHierarchySegmentHeaders:lt,ContainerListBlobHierarchySegmentExceptionHeaders:ct,ContainerGetAccountInfoHeaders:pt,ContainerGetAccountInfoExceptionHeaders:dt,BlobDownloadHeaders:ut,BlobDownloadExceptionHeaders:At,BlobGetPropertiesHeaders:mt,BlobGetPropertiesExceptionHeaders:ft,BlobDeleteHeaders:ht,BlobDeleteExceptionHeaders:gt,BlobUndeleteHeaders:yt,BlobUndeleteExceptionHeaders:Et,BlobSetExpiryHeaders:bt,BlobSetExpiryExceptionHeaders:Ct,BlobSetHttpHeadersHeaders:vt,BlobSetHttpHeadersExceptionHeaders:Bt,BlobSetImmutabilityPolicyHeaders:It,BlobSetImmutabilityPolicyExceptionHeaders:wt,BlobDeleteImmutabilityPolicyHeaders:St,BlobDeleteImmutabilityPolicyExceptionHeaders:Qt,BlobSetLegalHoldHeaders:xt,BlobSetLegalHoldExceptionHeaders:Nt,BlobSetMetadataHeaders:Rt,BlobSetMetadataExceptionHeaders:Tt,BlobAcquireLeaseHeaders:Dt,BlobAcquireLeaseExceptionHeaders:kt,BlobReleaseLeaseHeaders:_t,BlobReleaseLeaseExceptionHeaders:Ot,BlobRenewLeaseHeaders:Pt,BlobRenewLeaseExceptionHeaders:Lt,BlobChangeLeaseHeaders:Mt,BlobChangeLeaseExceptionHeaders:Ft,BlobBreakLeaseHeaders:Ut,BlobBreakLeaseExceptionHeaders:qt,BlobCreateSnapshotHeaders:Ht,BlobCreateSnapshotExceptionHeaders:jt,BlobStartCopyFromURLHeaders:Gt,BlobStartCopyFromURLExceptionHeaders:zt,BlobCopyFromURLHeaders:Vt,BlobCopyFromURLExceptionHeaders:Jt,BlobAbortCopyFromURLHeaders:Yt,BlobAbortCopyFromURLExceptionHeaders:Wt,BlobSetTierHeaders:Xt,BlobSetTierExceptionHeaders:Kt,BlobGetAccountInfoHeaders:$t,BlobGetAccountInfoExceptionHeaders:Zt,BlobQueryHeaders:er,BlobQueryExceptionHeaders:tr,BlobGetTagsHeaders:rr,BlobGetTagsExceptionHeaders:ir,BlobSetTagsHeaders:nr,BlobSetTagsExceptionHeaders:ar,PageBlobCreateHeaders:sr,PageBlobCreateExceptionHeaders:or,PageBlobUploadPagesHeaders:lr,PageBlobUploadPagesExceptionHeaders:cr,PageBlobClearPagesHeaders:pr,PageBlobClearPagesExceptionHeaders:dr,PageBlobUploadPagesFromURLHeaders:ur,PageBlobUploadPagesFromURLExceptionHeaders:Ar,PageBlobGetPageRangesHeaders:mr,PageBlobGetPageRangesExceptionHeaders:fr,PageBlobGetPageRangesDiffHeaders:hr,PageBlobGetPageRangesDiffExceptionHeaders:gr,PageBlobResizeHeaders:yr,PageBlobResizeExceptionHeaders:Er,PageBlobUpdateSequenceNumberHeaders:br,PageBlobUpdateSequenceNumberExceptionHeaders:Cr,PageBlobCopyIncrementalHeaders:vr,PageBlobCopyIncrementalExceptionHeaders:Br,AppendBlobCreateHeaders:Ir,AppendBlobCreateExceptionHeaders:wr,AppendBlobAppendBlockHeaders:Sr,AppendBlobAppendBlockExceptionHeaders:Qr,AppendBlobAppendBlockFromUrlHeaders:xr,AppendBlobAppendBlockFromUrlExceptionHeaders:Nr,AppendBlobSealHeaders:Rr,AppendBlobSealExceptionHeaders:Tr,BlockBlobUploadHeaders:Dr,BlockBlobUploadExceptionHeaders:kr,BlockBlobPutBlobFromUrlHeaders:_r,BlockBlobPutBlobFromUrlExceptionHeaders:Or,BlockBlobStageBlockHeaders:Pr,BlockBlobStageBlockExceptionHeaders:Lr,BlockBlobStageBlockFromURLHeaders:Mr,BlockBlobStageBlockFromURLExceptionHeaders:Fr,BlockBlobCommitBlockListHeaders:Ur,BlockBlobCommitBlockListExceptionHeaders:qr,BlockBlobGetBlockListHeaders:Hr,BlockBlobGetBlockListExceptionHeaders:jr});const zr={parameterPath:["options","contentType"],mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Content-Type",type:{name:"String"}}};const Vr={parameterPath:"blobServiceProperties",mapper:w};const Jr={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Accept",type:{name:"String"}}};const Yr={parameterPath:"url",mapper:{serializedName:"url",required:true,xmlName:"url",type:{name:"String"}},skipEncoding:true};const Wr={parameterPath:"restype",mapper:{defaultValue:"service",isConstant:true,serializedName:"restype",type:{name:"String"}}};const Xr={parameterPath:"comp",mapper:{defaultValue:"properties",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Kr={parameterPath:["options","timeoutInSeconds"],mapper:{constraints:{InclusiveMinimum:0},serializedName:"timeout",xmlName:"timeout",type:{name:"Number"}}};const $r={parameterPath:"version",mapper:{defaultValue:"2023-11-03",isConstant:true,serializedName:"x-ms-version",type:{name:"String"}}};const Zr={parameterPath:["options","requestId"],mapper:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}}};const ei={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Accept",type:{name:"String"}}};const ti={parameterPath:"comp",mapper:{defaultValue:"stats",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ri={parameterPath:"comp",mapper:{defaultValue:"list",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ii={parameterPath:["options","prefix"],mapper:{serializedName:"prefix",xmlName:"prefix",type:{name:"String"}}};const ni={parameterPath:["options","marker"],mapper:{serializedName:"marker",xmlName:"marker",type:{name:"String"}}};const ai={parameterPath:["options","maxPageSize"],mapper:{constraints:{InclusiveMinimum:1},serializedName:"maxresults",xmlName:"maxresults",type:{name:"Number"}}};const si={parameterPath:["options","include"],mapper:{serializedName:"include",xmlName:"include",xmlElementName:"ListContainersIncludeType",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["metadata","deleted","system"]}}}},collectionFormat:s.QueryCollectionFormat.Csv};const oi={parameterPath:"keyInfo",mapper:L};const li={parameterPath:"comp",mapper:{defaultValue:"userdelegationkey",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ci={parameterPath:"restype",mapper:{defaultValue:"account",isConstant:true,serializedName:"restype",type:{name:"String"}}};const pi={parameterPath:"body",mapper:{serializedName:"body",required:true,xmlName:"body",type:{name:"Stream"}}};const di={parameterPath:"comp",mapper:{defaultValue:"batch",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ui={parameterPath:"contentLength",mapper:{serializedName:"Content-Length",required:true,xmlName:"Content-Length",type:{name:"Number"}}};const Ai={parameterPath:"multipartContentType",mapper:{serializedName:"Content-Type",required:true,xmlName:"Content-Type",type:{name:"String"}}};const mi={parameterPath:"comp",mapper:{defaultValue:"blobs",isConstant:true,serializedName:"comp",type:{name:"String"}}};const fi={parameterPath:["options","where"],mapper:{serializedName:"where",xmlName:"where",type:{name:"String"}}};const hi={parameterPath:"restype",mapper:{defaultValue:"container",isConstant:true,serializedName:"restype",type:{name:"String"}}};const gi={parameterPath:["options","metadata"],mapper:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"}};const yi={parameterPath:["options","access"],mapper:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}}};const Ei={parameterPath:["options","containerEncryptionScope","defaultEncryptionScope"],mapper:{serializedName:"x-ms-default-encryption-scope",xmlName:"x-ms-default-encryption-scope",type:{name:"String"}}};const bi={parameterPath:["options","containerEncryptionScope","preventEncryptionScopeOverride"],mapper:{serializedName:"x-ms-deny-encryption-scope-override",xmlName:"x-ms-deny-encryption-scope-override",type:{name:"Boolean"}}};const Ci={parameterPath:["options","leaseAccessConditions","leaseId"],mapper:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}}};const vi={parameterPath:["options","modifiedAccessConditions","ifModifiedSince"],mapper:{serializedName:"If-Modified-Since",xmlName:"If-Modified-Since",type:{name:"DateTimeRfc1123"}}};const Bi={parameterPath:["options","modifiedAccessConditions","ifUnmodifiedSince"],mapper:{serializedName:"If-Unmodified-Since",xmlName:"If-Unmodified-Since",type:{name:"DateTimeRfc1123"}}};const Ii={parameterPath:"comp",mapper:{defaultValue:"metadata",isConstant:true,serializedName:"comp",type:{name:"String"}}};const wi={parameterPath:"comp",mapper:{defaultValue:"acl",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Si={parameterPath:["options","containerAcl"],mapper:{serializedName:"containerAcl",xmlName:"SignedIdentifiers",xmlIsWrapped:true,xmlElementName:"SignedIdentifier",type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}}}};const Qi={parameterPath:"comp",mapper:{defaultValue:"undelete",isConstant:true,serializedName:"comp",type:{name:"String"}}};const xi={parameterPath:["options","deletedContainerName"],mapper:{serializedName:"x-ms-deleted-container-name",xmlName:"x-ms-deleted-container-name",type:{name:"String"}}};const Ni={parameterPath:["options","deletedContainerVersion"],mapper:{serializedName:"x-ms-deleted-container-version",xmlName:"x-ms-deleted-container-version",type:{name:"String"}}};const Ri={parameterPath:"comp",mapper:{defaultValue:"rename",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Ti={parameterPath:"sourceContainerName",mapper:{serializedName:"x-ms-source-container-name",required:true,xmlName:"x-ms-source-container-name",type:{name:"String"}}};const Di={parameterPath:["options","sourceLeaseId"],mapper:{serializedName:"x-ms-source-lease-id",xmlName:"x-ms-source-lease-id",type:{name:"String"}}};const ki={parameterPath:"comp",mapper:{defaultValue:"lease",isConstant:true,serializedName:"comp",type:{name:"String"}}};const _i={parameterPath:"action",mapper:{defaultValue:"acquire",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Oi={parameterPath:["options","duration"],mapper:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Number"}}};const Pi={parameterPath:["options","proposedLeaseId"],mapper:{serializedName:"x-ms-proposed-lease-id",xmlName:"x-ms-proposed-lease-id",type:{name:"String"}}};const Li={parameterPath:"action",mapper:{defaultValue:"release",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Mi={parameterPath:"leaseId",mapper:{serializedName:"x-ms-lease-id",required:true,xmlName:"x-ms-lease-id",type:{name:"String"}}};const Fi={parameterPath:"action",mapper:{defaultValue:"renew",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Ui={parameterPath:"action",mapper:{defaultValue:"break",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const qi={parameterPath:["options","breakPeriod"],mapper:{serializedName:"x-ms-lease-break-period",xmlName:"x-ms-lease-break-period",type:{name:"Number"}}};const Hi={parameterPath:"action",mapper:{defaultValue:"change",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const ji={parameterPath:"proposedLeaseId",mapper:{serializedName:"x-ms-proposed-lease-id",required:true,xmlName:"x-ms-proposed-lease-id",type:{name:"String"}}};const Gi={parameterPath:["options","include"],mapper:{serializedName:"include",xmlName:"include",xmlElementName:"ListBlobsIncludeItem",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["copy","deleted","metadata","snapshots","uncommittedblobs","versions","tags","immutabilitypolicy","legalhold","deletedwithversions"]}}}},collectionFormat:s.QueryCollectionFormat.Csv};const zi={parameterPath:"delimiter",mapper:{serializedName:"delimiter",required:true,xmlName:"delimiter",type:{name:"String"}}};const Vi={parameterPath:["options","snapshot"],mapper:{serializedName:"snapshot",xmlName:"snapshot",type:{name:"String"}}};const Ji={parameterPath:["options","versionId"],mapper:{serializedName:"versionid",xmlName:"versionid",type:{name:"String"}}};const Yi={parameterPath:["options","range"],mapper:{serializedName:"x-ms-range",xmlName:"x-ms-range",type:{name:"String"}}};const Wi={parameterPath:["options","rangeGetContentMD5"],mapper:{serializedName:"x-ms-range-get-content-md5",xmlName:"x-ms-range-get-content-md5",type:{name:"Boolean"}}};const Xi={parameterPath:["options","rangeGetContentCRC64"],mapper:{serializedName:"x-ms-range-get-content-crc64",xmlName:"x-ms-range-get-content-crc64",type:{name:"Boolean"}}};const Ki={parameterPath:["options","cpkInfo","encryptionKey"],mapper:{serializedName:"x-ms-encryption-key",xmlName:"x-ms-encryption-key",type:{name:"String"}}};const $i={parameterPath:["options","cpkInfo","encryptionKeySha256"],mapper:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}}};const Zi={parameterPath:["options","cpkInfo","encryptionAlgorithm"],mapper:{serializedName:"x-ms-encryption-algorithm",xmlName:"x-ms-encryption-algorithm",type:{name:"String"}}};const en={parameterPath:["options","modifiedAccessConditions","ifMatch"],mapper:{serializedName:"If-Match",xmlName:"If-Match",type:{name:"String"}}};const tn={parameterPath:["options","modifiedAccessConditions","ifNoneMatch"],mapper:{serializedName:"If-None-Match",xmlName:"If-None-Match",type:{name:"String"}}};const rn={parameterPath:["options","modifiedAccessConditions","ifTags"],mapper:{serializedName:"x-ms-if-tags",xmlName:"x-ms-if-tags",type:{name:"String"}}};const nn={parameterPath:["options","deleteSnapshots"],mapper:{serializedName:"x-ms-delete-snapshots",xmlName:"x-ms-delete-snapshots",type:{name:"Enum",allowedValues:["include","only"]}}};const an={parameterPath:["options","blobDeleteType"],mapper:{serializedName:"deletetype",xmlName:"deletetype",type:{name:"String"}}};const sn={parameterPath:"comp",mapper:{defaultValue:"expiry",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ln={parameterPath:"expiryOptions",mapper:{serializedName:"x-ms-expiry-option",required:true,xmlName:"x-ms-expiry-option",type:{name:"String"}}};const cn={parameterPath:["options","expiresOn"],mapper:{serializedName:"x-ms-expiry-time",xmlName:"x-ms-expiry-time",type:{name:"String"}}};const pn={parameterPath:["options","blobHttpHeaders","blobCacheControl"],mapper:{serializedName:"x-ms-blob-cache-control",xmlName:"x-ms-blob-cache-control",type:{name:"String"}}};const dn={parameterPath:["options","blobHttpHeaders","blobContentType"],mapper:{serializedName:"x-ms-blob-content-type",xmlName:"x-ms-blob-content-type",type:{name:"String"}}};const un={parameterPath:["options","blobHttpHeaders","blobContentMD5"],mapper:{serializedName:"x-ms-blob-content-md5",xmlName:"x-ms-blob-content-md5",type:{name:"ByteArray"}}};const An={parameterPath:["options","blobHttpHeaders","blobContentEncoding"],mapper:{serializedName:"x-ms-blob-content-encoding",xmlName:"x-ms-blob-content-encoding",type:{name:"String"}}};const mn={parameterPath:["options","blobHttpHeaders","blobContentLanguage"],mapper:{serializedName:"x-ms-blob-content-language",xmlName:"x-ms-blob-content-language",type:{name:"String"}}};const hn={parameterPath:["options","blobHttpHeaders","blobContentDisposition"],mapper:{serializedName:"x-ms-blob-content-disposition",xmlName:"x-ms-blob-content-disposition",type:{name:"String"}}};const gn={parameterPath:"comp",mapper:{defaultValue:"immutabilityPolicies",isConstant:true,serializedName:"comp",type:{name:"String"}}};const yn={parameterPath:["options","immutabilityPolicyExpiry"],mapper:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}}};const En={parameterPath:["options","immutabilityPolicyMode"],mapper:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}}};const bn={parameterPath:"comp",mapper:{defaultValue:"legalhold",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Cn={parameterPath:"legalHold",mapper:{serializedName:"x-ms-legal-hold",required:true,xmlName:"x-ms-legal-hold",type:{name:"Boolean"}}};const vn={parameterPath:["options","encryptionScope"],mapper:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}}};const Bn={parameterPath:"comp",mapper:{defaultValue:"snapshot",isConstant:true,serializedName:"comp",type:{name:"String"}}};const In={parameterPath:["options","tier"],mapper:{serializedName:"x-ms-access-tier",xmlName:"x-ms-access-tier",type:{name:"Enum",allowedValues:["P4","P6","P10","P15","P20","P30","P40","P50","P60","P70","P80","Hot","Cool","Archive","Cold"]}}};const wn={parameterPath:["options","rehydratePriority"],mapper:{serializedName:"x-ms-rehydrate-priority",xmlName:"x-ms-rehydrate-priority",type:{name:"Enum",allowedValues:["High","Standard"]}}};const Sn={parameterPath:["options","sourceModifiedAccessConditions","sourceIfModifiedSince"],mapper:{serializedName:"x-ms-source-if-modified-since",xmlName:"x-ms-source-if-modified-since",type:{name:"DateTimeRfc1123"}}};const Qn={parameterPath:["options","sourceModifiedAccessConditions","sourceIfUnmodifiedSince"],mapper:{serializedName:"x-ms-source-if-unmodified-since",xmlName:"x-ms-source-if-unmodified-since",type:{name:"DateTimeRfc1123"}}};const xn={parameterPath:["options","sourceModifiedAccessConditions","sourceIfMatch"],mapper:{serializedName:"x-ms-source-if-match",xmlName:"x-ms-source-if-match",type:{name:"String"}}};const Nn={parameterPath:["options","sourceModifiedAccessConditions","sourceIfNoneMatch"],mapper:{serializedName:"x-ms-source-if-none-match",xmlName:"x-ms-source-if-none-match",type:{name:"String"}}};const Rn={parameterPath:["options","sourceModifiedAccessConditions","sourceIfTags"],mapper:{serializedName:"x-ms-source-if-tags",xmlName:"x-ms-source-if-tags",type:{name:"String"}}};const Tn={parameterPath:"copySource",mapper:{serializedName:"x-ms-copy-source",required:true,xmlName:"x-ms-copy-source",type:{name:"String"}}};const Dn={parameterPath:["options","blobTagsString"],mapper:{serializedName:"x-ms-tags",xmlName:"x-ms-tags",type:{name:"String"}}};const kn={parameterPath:["options","sealBlob"],mapper:{serializedName:"x-ms-seal-blob",xmlName:"x-ms-seal-blob",type:{name:"Boolean"}}};const _n={parameterPath:["options","legalHold"],mapper:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}}};const On={parameterPath:"xMsRequiresSync",mapper:{defaultValue:"true",isConstant:true,serializedName:"x-ms-requires-sync",type:{name:"String"}}};const Pn={parameterPath:["options","sourceContentMD5"],mapper:{serializedName:"x-ms-source-content-md5",xmlName:"x-ms-source-content-md5",type:{name:"ByteArray"}}};const Ln={parameterPath:["options","copySourceAuthorization"],mapper:{serializedName:"x-ms-copy-source-authorization",xmlName:"x-ms-copy-source-authorization",type:{name:"String"}}};const Mn={parameterPath:["options","copySourceTags"],mapper:{serializedName:"x-ms-copy-source-tag-option",xmlName:"x-ms-copy-source-tag-option",type:{name:"Enum",allowedValues:["REPLACE","COPY"]}}};const Fn={parameterPath:"comp",mapper:{defaultValue:"copy",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Un={parameterPath:"copyActionAbortConstant",mapper:{defaultValue:"abort",isConstant:true,serializedName:"x-ms-copy-action",type:{name:"String"}}};const qn={parameterPath:"copyId",mapper:{serializedName:"copyid",required:true,xmlName:"copyid",type:{name:"String"}}};const Hn={parameterPath:"comp",mapper:{defaultValue:"tier",isConstant:true,serializedName:"comp",type:{name:"String"}}};const jn={parameterPath:"tier",mapper:{serializedName:"x-ms-access-tier",required:true,xmlName:"x-ms-access-tier",type:{name:"Enum",allowedValues:["P4","P6","P10","P15","P20","P30","P40","P50","P60","P70","P80","Hot","Cool","Archive","Cold"]}}};const Gn={parameterPath:["options","queryRequest"],mapper:se};const zn={parameterPath:"comp",mapper:{defaultValue:"query",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Vn={parameterPath:"comp",mapper:{defaultValue:"tags",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Jn={parameterPath:["options","tags"],mapper:H};const Yn={parameterPath:["options","transactionalContentMD5"],mapper:{serializedName:"Content-MD5",xmlName:"Content-MD5",type:{name:"ByteArray"}}};const Wn={parameterPath:["options","transactionalContentCrc64"],mapper:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}}};const Xn={parameterPath:"blobType",mapper:{defaultValue:"PageBlob",isConstant:true,serializedName:"x-ms-blob-type",type:{name:"String"}}};const Kn={parameterPath:"blobContentLength",mapper:{serializedName:"x-ms-blob-content-length",required:true,xmlName:"x-ms-blob-content-length",type:{name:"Number"}}};const $n={parameterPath:["options","blobSequenceNumber"],mapper:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}}};const Zn={parameterPath:["options","contentType"],mapper:{defaultValue:"application/octet-stream",isConstant:true,serializedName:"Content-Type",type:{name:"String"}}};const ea={parameterPath:"body",mapper:{serializedName:"body",required:true,xmlName:"body",type:{name:"Stream"}}};const ta={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Accept",type:{name:"String"}}};const ra={parameterPath:"comp",mapper:{defaultValue:"page",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ia={parameterPath:"pageWrite",mapper:{defaultValue:"update",isConstant:true,serializedName:"x-ms-page-write",type:{name:"String"}}};const na={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberLessThanOrEqualTo"],mapper:{serializedName:"x-ms-if-sequence-number-le",xmlName:"x-ms-if-sequence-number-le",type:{name:"Number"}}};const aa={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberLessThan"],mapper:{serializedName:"x-ms-if-sequence-number-lt",xmlName:"x-ms-if-sequence-number-lt",type:{name:"Number"}}};const sa={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberEqualTo"],mapper:{serializedName:"x-ms-if-sequence-number-eq",xmlName:"x-ms-if-sequence-number-eq",type:{name:"Number"}}};const oa={parameterPath:"pageWrite",mapper:{defaultValue:"clear",isConstant:true,serializedName:"x-ms-page-write",type:{name:"String"}}};const la={parameterPath:"sourceUrl",mapper:{serializedName:"x-ms-copy-source",required:true,xmlName:"x-ms-copy-source",type:{name:"String"}}};const ca={parameterPath:"sourceRange",mapper:{serializedName:"x-ms-source-range",required:true,xmlName:"x-ms-source-range",type:{name:"String"}}};const pa={parameterPath:["options","sourceContentCrc64"],mapper:{serializedName:"x-ms-source-content-crc64",xmlName:"x-ms-source-content-crc64",type:{name:"ByteArray"}}};const da={parameterPath:"range",mapper:{serializedName:"x-ms-range",required:true,xmlName:"x-ms-range",type:{name:"String"}}};const ua={parameterPath:"comp",mapper:{defaultValue:"pagelist",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Aa={parameterPath:["options","prevsnapshot"],mapper:{serializedName:"prevsnapshot",xmlName:"prevsnapshot",type:{name:"String"}}};const ma={parameterPath:["options","prevSnapshotUrl"],mapper:{serializedName:"x-ms-previous-snapshot-url",xmlName:"x-ms-previous-snapshot-url",type:{name:"String"}}};const fa={parameterPath:"sequenceNumberAction",mapper:{serializedName:"x-ms-sequence-number-action",required:true,xmlName:"x-ms-sequence-number-action",type:{name:"Enum",allowedValues:["max","update","increment"]}}};const ha={parameterPath:"comp",mapper:{defaultValue:"incrementalcopy",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ga={parameterPath:"blobType",mapper:{defaultValue:"AppendBlob",isConstant:true,serializedName:"x-ms-blob-type",type:{name:"String"}}};const ya={parameterPath:"comp",mapper:{defaultValue:"appendblock",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Ea={parameterPath:["options","appendPositionAccessConditions","maxSize"],mapper:{serializedName:"x-ms-blob-condition-maxsize",xmlName:"x-ms-blob-condition-maxsize",type:{name:"Number"}}};const ba={parameterPath:["options","appendPositionAccessConditions","appendPosition"],mapper:{serializedName:"x-ms-blob-condition-appendpos",xmlName:"x-ms-blob-condition-appendpos",type:{name:"Number"}}};const Ca={parameterPath:["options","sourceRange"],mapper:{serializedName:"x-ms-source-range",xmlName:"x-ms-source-range",type:{name:"String"}}};const va={parameterPath:"comp",mapper:{defaultValue:"seal",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Ba={parameterPath:"blobType",mapper:{defaultValue:"BlockBlob",isConstant:true,serializedName:"x-ms-blob-type",type:{name:"String"}}};const Ia={parameterPath:["options","copySourceBlobProperties"],mapper:{serializedName:"x-ms-copy-source-blob-properties",xmlName:"x-ms-copy-source-blob-properties",type:{name:"Boolean"}}};const wa={parameterPath:"comp",mapper:{defaultValue:"block",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Sa={parameterPath:"blockId",mapper:{serializedName:"blockid",required:true,xmlName:"blockid",type:{name:"String"}}};const Qa={parameterPath:"blocks",mapper:ee};const xa={parameterPath:"comp",mapper:{defaultValue:"blocklist",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Na={parameterPath:"listType",mapper:{defaultValue:"committed",serializedName:"blocklisttype",required:true,xmlName:"blocklisttype",type:{name:"Enum",allowedValues:["committed","uncommitted","all"]}}};class Service{constructor(r){this.client=r}setProperties(r,i){const a={blobServiceProperties:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Ta)}getProperties(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Da)}getStatistics(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ka)}listContainersSegment(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,_a)}getUserDelegationKey(r,i){const a={keyInfo:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Oa)}getAccountInfo(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Pa)}submitBatch(r,i,a,s){const l={contentLength:r,multipartContentType:i,body:a,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(l,La)}filterBlobs(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ma)}}const Ra=new C.Serializer(Gr,true);const Ta={path:"/",httpMethod:"PUT",responses:{202:{headersMapper:Ae},default:{bodyMapper:T,headersMapper:me}},requestBody:Vr,queryParameters:[Wr,Xr,Kr],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ra};const Da={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:w,headersMapper:fe},default:{bodyMapper:T,headersMapper:he}},queryParameters:[Wr,Xr,Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Ra};const ka={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:D,headersMapper:ge},default:{bodyMapper:T,headersMapper:ye}},queryParameters:[Wr,Kr,ti],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Ra};const _a={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:_,headersMapper:Ee},default:{bodyMapper:T,headersMapper:be}},queryParameters:[Kr,ri,ii,ni,ai,si],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Ra};const Oa={path:"/",httpMethod:"POST",responses:{200:{bodyMapper:M,headersMapper:Ce},default:{bodyMapper:T,headersMapper:ve}},requestBody:oi,queryParameters:[Wr,Kr,li],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ra};const Pa={path:"/",httpMethod:"GET",responses:{200:{headersMapper:Be},default:{bodyMapper:T,headersMapper:Ie}},queryParameters:[Xr,ci],urlParameters:[Yr],headerParameters:[$r,ei],isXML:true,serializer:Ra};const La={path:"/",httpMethod:"POST",responses:{202:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:we},default:{bodyMapper:T,headersMapper:Se}},requestBody:pi,queryParameters:[Kr,di],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr,ui,Ai],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ra};const Ma={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:U,headersMapper:Qe},default:{bodyMapper:T,headersMapper:xe}},queryParameters:[Kr,ni,ai,mi,fi],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Ra};class Container{constructor(r){this.client=r}create(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ua)}getProperties(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,qa)}delete(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ha)}setMetadata(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ja)}getAccessPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ga)}setAccessPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,za)}restore(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Va)}rename(r,i){const a={sourceContainerName:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Ja)}submitBatch(r,i,a,s){const l={contentLength:r,multipartContentType:i,body:a,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(l,Ya)}filterBlobs(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Wa)}acquireLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Xa)}releaseLease(r,i){const a={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Ka)}renewLease(r,i){const a={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,$a)}breakLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Za)}changeLease(r,i,a){const s={leaseId:r,proposedLeaseId:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,es)}listBlobFlatSegment(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ts)}listBlobHierarchySegment(r,i){const a={delimiter:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,rs)}getAccountInfo(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ns)}}const Fa=new C.Serializer(Gr,true);const Ua={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:Ne},default:{bodyMapper:T,headersMapper:Re}},queryParameters:[Kr,hi],urlParameters:[Yr],headerParameters:[$r,Zr,ei,gi,yi,Ei,bi],isXML:true,serializer:Fa};const qa={path:"/{containerName}",httpMethod:"GET",responses:{200:{headersMapper:Te},default:{bodyMapper:T,headersMapper:De}},queryParameters:[Kr,hi],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci],isXML:true,serializer:Fa};const Ha={path:"/{containerName}",httpMethod:"DELETE",responses:{202:{headersMapper:ke},default:{bodyMapper:T,headersMapper:_e}},queryParameters:[Kr,hi],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi],isXML:true,serializer:Fa};const ja={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Oe},default:{bodyMapper:T,headersMapper:Pe}},queryParameters:[Kr,hi,Ii],urlParameters:[Yr],headerParameters:[$r,Zr,ei,gi,Ci,vi],isXML:true,serializer:Fa};const Ga={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}},serializedName:"SignedIdentifiers",xmlName:"SignedIdentifiers",xmlIsWrapped:true,xmlElementName:"SignedIdentifier"},headersMapper:Le},default:{bodyMapper:T,headersMapper:Me}},queryParameters:[Kr,hi,wi],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci],isXML:true,serializer:Fa};const za={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Fe},default:{bodyMapper:T,headersMapper:Ue}},requestBody:Si,queryParameters:[Kr,hi,wi],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr,yi,Ci,vi,Bi],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Fa};const Va={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:qe},default:{bodyMapper:T,headersMapper:He}},queryParameters:[Kr,hi,Qi],urlParameters:[Yr],headerParameters:[$r,Zr,ei,xi,Ni],isXML:true,serializer:Fa};const Ja={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:je},default:{bodyMapper:T,headersMapper:Ge}},queryParameters:[Kr,hi,Ri],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ti,Di],isXML:true,serializer:Fa};const Ya={path:"/{containerName}",httpMethod:"POST",responses:{202:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:ze},default:{bodyMapper:T,headersMapper:Ve}},requestBody:pi,queryParameters:[Kr,di,hi],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr,ui,Ai],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Fa};const Wa={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:U,headersMapper:Je},default:{bodyMapper:T,headersMapper:Ye}},queryParameters:[Kr,ni,ai,mi,fi,hi],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Fa};const Xa={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:We},default:{bodyMapper:T,headersMapper:Xe}},queryParameters:[Kr,hi,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,_i,Oi,Pi],isXML:true,serializer:Fa};const Ka={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Ke},default:{bodyMapper:T,headersMapper:$e}},queryParameters:[Kr,hi,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Li,Mi],isXML:true,serializer:Fa};const $a={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Ze},default:{bodyMapper:T,headersMapper:et}},queryParameters:[Kr,hi,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Mi,Fi],isXML:true,serializer:Fa};const Za={path:"/{containerName}",httpMethod:"PUT",responses:{202:{headersMapper:tt},default:{bodyMapper:T,headersMapper:rt}},queryParameters:[Kr,hi,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Ui,qi],isXML:true,serializer:Fa};const es={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:it},default:{bodyMapper:T,headersMapper:nt}},queryParameters:[Kr,hi,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Mi,Hi,ji],isXML:true,serializer:Fa};const ts={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:V,headersMapper:st},default:{bodyMapper:T,headersMapper:ot}},queryParameters:[Kr,ri,ii,ni,ai,hi,Gi],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Fa};const rs={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:K,headersMapper:lt},default:{bodyMapper:T,headersMapper:ct}},queryParameters:[Kr,ri,ii,ni,ai,hi,Gi,zi],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:Fa};const ns={path:"/{containerName}",httpMethod:"GET",responses:{200:{headersMapper:pt},default:{bodyMapper:T,headersMapper:dt}},queryParameters:[Xr,ci],urlParameters:[Yr],headerParameters:[$r,ei],isXML:true,serializer:Fa};class Blob$1{constructor(r){this.client=r}download(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ss)}getProperties(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,os)}delete(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ls)}undelete(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,cs)}setExpiry(r,i){const a={expiryOptions:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,ps)}setHttpHeaders(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ds)}setImmutabilityPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,us)}deleteImmutabilityPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,As)}setLegalHold(r,i){const a={legalHold:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,ms)}setMetadata(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,fs)}acquireLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,hs)}releaseLease(r,i){const a={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,gs)}renewLease(r,i){const a={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,ys)}changeLease(r,i,a){const s={leaseId:r,proposedLeaseId:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,Es)}breakLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,bs)}createSnapshot(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Cs)}startCopyFromURL(r,i){const a={copySource:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,vs)}copyFromURL(r,i){const a={copySource:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Bs)}abortCopyFromURL(r,i){const a={copyId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Is)}setTier(r,i){const a={tier:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,ws)}getAccountInfo(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ss)}query(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Qs)}getTags(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,xs)}setTags(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ns)}}const as=new C.Serializer(Gr,true);const ss={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:ut},206:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:ut},default:{bodyMapper:T,headersMapper:At}},queryParameters:[Kr,Vi,Ji],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,Yi,Wi,Xi,Ki,$i,Zi,en,tn,rn],isXML:true,serializer:as};const os={path:"/{containerName}/{blob}",httpMethod:"HEAD",responses:{200:{headersMapper:mt},default:{bodyMapper:T,headersMapper:ft}},queryParameters:[Kr,Vi,Ji],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn],isXML:true,serializer:as};const ls={path:"/{containerName}/{blob}",httpMethod:"DELETE",responses:{202:{headersMapper:ht},default:{bodyMapper:T,headersMapper:gt}},queryParameters:[Kr,Vi,Ji,an],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,en,tn,rn,nn],isXML:true,serializer:as};const cs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:yt},default:{bodyMapper:T,headersMapper:Et}},queryParameters:[Kr,Qi],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:as};const ps={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:bt},default:{bodyMapper:T,headersMapper:Ct}},queryParameters:[Kr,sn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ln,cn],isXML:true,serializer:as};const ds={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:vt},default:{bodyMapper:T,headersMapper:Bt}},queryParameters:[Xr,Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,en,tn,rn,pn,dn,un,An,mn,hn],isXML:true,serializer:as};const us={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:It},default:{bodyMapper:T,headersMapper:wt}},queryParameters:[Kr,gn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Bi,yn,En],isXML:true,serializer:as};const As={path:"/{containerName}/{blob}",httpMethod:"DELETE",responses:{200:{headersMapper:St},default:{bodyMapper:T,headersMapper:Qt}},queryParameters:[Kr,gn],urlParameters:[Yr],headerParameters:[$r,Zr,ei],isXML:true,serializer:as};const ms={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:xt},default:{bodyMapper:T,headersMapper:Nt}},queryParameters:[Kr,bn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Cn],isXML:true,serializer:as};const fs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Rt},default:{bodyMapper:T,headersMapper:Tt}},queryParameters:[Kr,Ii],urlParameters:[Yr],headerParameters:[$r,Zr,ei,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,vn],isXML:true,serializer:as};const hs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Dt},default:{bodyMapper:T,headersMapper:kt}},queryParameters:[Kr,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,_i,Oi,Pi,en,tn,rn],isXML:true,serializer:as};const gs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:_t},default:{bodyMapper:T,headersMapper:Ot}},queryParameters:[Kr,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Li,Mi,en,tn,rn],isXML:true,serializer:as};const ys={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Pt},default:{bodyMapper:T,headersMapper:Lt}},queryParameters:[Kr,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Mi,Fi,en,tn,rn],isXML:true,serializer:as};const Es={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Mt},default:{bodyMapper:T,headersMapper:Ft}},queryParameters:[Kr,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Mi,Hi,ji,en,tn,rn],isXML:true,serializer:as};const bs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:Ut},default:{bodyMapper:T,headersMapper:qt}},queryParameters:[Kr,ki],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,Ui,qi,en,tn,rn],isXML:true,serializer:as};const Cs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Ht},default:{bodyMapper:T,headersMapper:jt}},queryParameters:[Kr,Bn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,vn],isXML:true,serializer:as};const vs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:Gt},default:{bodyMapper:T,headersMapper:zt}},queryParameters:[Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,gi,Ci,vi,Bi,en,tn,rn,yn,En,In,wn,Sn,Qn,xn,Nn,Rn,Tn,Dn,kn,_n],isXML:true,serializer:as};const Bs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:Vt},default:{bodyMapper:T,headersMapper:Jt}},queryParameters:[Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,gi,Ci,vi,Bi,en,tn,rn,yn,En,vn,In,Sn,Qn,xn,Nn,Tn,Dn,_n,On,Pn,Ln,Mn],isXML:true,serializer:as};const Is={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{204:{headersMapper:Yt},default:{bodyMapper:T,headersMapper:Wt}},queryParameters:[Kr,Fn,qn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,Un],isXML:true,serializer:as};const ws={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Xt},202:{headersMapper:Xt},default:{bodyMapper:T,headersMapper:Kt}},queryParameters:[Kr,Vi,Ji,Hn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,rn,wn,jn],isXML:true,serializer:as};const Ss={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{headersMapper:$t},default:{bodyMapper:T,headersMapper:Zt}},queryParameters:[Xr,ci],urlParameters:[Yr],headerParameters:[$r,ei],isXML:true,serializer:as};const Qs={path:"/{containerName}/{blob}",httpMethod:"POST",responses:{200:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:er},206:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:er},default:{bodyMapper:T,headersMapper:tr}},requestBody:Gn,queryParameters:[Kr,Vi,zn],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:as};const xs={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:H,headersMapper:rr},default:{bodyMapper:T,headersMapper:ir}},queryParameters:[Kr,Vi,Ji,Vn],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,rn],isXML:true,serializer:as};const Ns={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{204:{headersMapper:nr},default:{bodyMapper:T,headersMapper:ar}},requestBody:Jn,queryParameters:[Kr,Ji,Vn],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr,Ci,rn,Yn,Wn],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:as};class PageBlob{constructor(r){this.client=r}create(r,i,a){const s={contentLength:r,blobContentLength:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,Ds)}uploadPages(r,i,a){const s={contentLength:r,body:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,ks)}clearPages(r,i){const a={contentLength:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,_s)}uploadPagesFromURL(r,i,a,s,l){const c={sourceUrl:r,sourceRange:i,contentLength:a,range:s,options:C.operationOptionsToRequestOptionsBase(l||{})};return this.client.sendOperationRequest(c,Os)}getPageRanges(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ps)}getPageRangesDiff(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ls)}resize(r,i){const a={blobContentLength:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Ms)}updateSequenceNumber(r,i){const a={sequenceNumberAction:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Fs)}copyIncremental(r,i){const a={copySource:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Us)}}const Rs=new C.Serializer(Gr,true);const Ts=new C.Serializer(Gr,false);const Ds={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:sr},default:{bodyMapper:T,headersMapper:or}},queryParameters:[Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,pn,dn,un,An,mn,hn,yn,En,vn,In,Dn,_n,Xn,Kn,$n],isXML:true,serializer:Rs};const ks={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:lr},default:{bodyMapper:T,headersMapper:cr}},requestBody:ea,queryParameters:[Kr,ra],urlParameters:[Yr],headerParameters:[$r,Zr,ui,Ci,vi,Bi,Yi,Ki,$i,Zi,en,tn,rn,vn,Yn,Wn,Zn,ta,ia,na,aa,sa],mediaType:"binary",serializer:Ts};const _s={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:pr},default:{bodyMapper:T,headersMapper:dr}},queryParameters:[Kr,ra],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,Ci,vi,Bi,Yi,Ki,$i,Zi,en,tn,rn,vn,na,aa,sa,oa],isXML:true,serializer:Rs};const Os={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:ur},default:{bodyMapper:T,headersMapper:Ar}},queryParameters:[Kr,ra],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,vn,Sn,Qn,xn,Nn,Pn,Ln,ia,na,aa,sa,la,ca,pa,da],isXML:true,serializer:Rs};const Ps={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:ie,headersMapper:mr},default:{bodyMapper:T,headersMapper:fr}},queryParameters:[Kr,ni,ai,Vi,ua],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,Yi,en,tn,rn],isXML:true,serializer:Rs};const Ls={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:ie,headersMapper:hr},default:{bodyMapper:T,headersMapper:gr}},queryParameters:[Kr,ni,ai,Vi,ua,Aa],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,Yi,en,tn,rn,ma],isXML:true,serializer:Rs};const Ms={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:yr},default:{bodyMapper:T,headersMapper:Er}},queryParameters:[Xr,Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,vn,Kn],isXML:true,serializer:Rs};const Fs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:br},default:{bodyMapper:T,headersMapper:Cr}},queryParameters:[Xr,Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,en,tn,rn,$n,fa],isXML:true,serializer:Rs};const Us={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:vr},default:{bodyMapper:T,headersMapper:Br}},queryParameters:[Kr,ha],urlParameters:[Yr],headerParameters:[$r,Zr,ei,vi,Bi,en,tn,rn,Tn],isXML:true,serializer:Rs};class AppendBlob{constructor(r){this.client=r}create(r,i){const a={contentLength:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,js)}appendBlock(r,i,a){const s={contentLength:r,body:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,Gs)}appendBlockFromUrl(r,i,a){const s={sourceUrl:r,contentLength:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,zs)}seal(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Vs)}}const qs=new C.Serializer(Gr,true);const Hs=new C.Serializer(Gr,false);const js={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Ir},default:{bodyMapper:T,headersMapper:wr}},queryParameters:[Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,pn,dn,un,An,mn,hn,yn,En,vn,Dn,_n,ga],isXML:true,serializer:qs};const Gs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Sr},default:{bodyMapper:T,headersMapper:Qr}},requestBody:ea,queryParameters:[Kr,ya],urlParameters:[Yr],headerParameters:[$r,Zr,ui,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,vn,Yn,Wn,Zn,ta,Ea,ba],mediaType:"binary",serializer:Hs};const zs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:xr},default:{bodyMapper:T,headersMapper:Nr}},queryParameters:[Kr,ya],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,vn,Sn,Qn,xn,Nn,Pn,Ln,Yn,la,pa,Ea,ba,Ca],isXML:true,serializer:qs};const Vs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Rr},default:{bodyMapper:T,headersMapper:Tr}},queryParameters:[Kr,va],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,vi,Bi,en,tn,ba],isXML:true,serializer:qs};class BlockBlob{constructor(r){this.client=r}upload(r,i,a){const s={contentLength:r,body:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,Ws)}putBlobFromUrl(r,i,a){const s={contentLength:r,copySource:i,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(s,Xs)}stageBlock(r,i,a,s){const l={blockId:r,contentLength:i,body:a,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(l,Ks)}stageBlockFromURL(r,i,a,s){const l={blockId:r,contentLength:i,sourceUrl:a,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(l,$s)}commitBlockList(r,i){const a={blocks:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,Zs)}getBlockList(r,i){const a={listType:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(a,eo)}}const Js=new C.Serializer(Gr,true);const Ys=new C.Serializer(Gr,false);const Ws={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Dr},default:{bodyMapper:T,headersMapper:kr}},requestBody:ea,queryParameters:[Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ui,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,pn,dn,un,An,mn,hn,yn,En,vn,In,Dn,_n,Yn,Wn,Zn,ta,Ba],mediaType:"binary",serializer:Ys};const Xs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:_r},default:{bodyMapper:T,headersMapper:Or}},queryParameters:[Kr],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,pn,dn,un,An,mn,hn,vn,In,Sn,Qn,xn,Nn,Rn,Tn,Dn,Pn,Ln,Mn,Yn,Ba,Ia],isXML:true,serializer:Js};const Ks={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Pr},default:{bodyMapper:T,headersMapper:Lr}},requestBody:ea,queryParameters:[Kr,wa,Sa],urlParameters:[Yr],headerParameters:[$r,Zr,ui,Ci,Ki,$i,Zi,vn,Yn,Wn,Zn,ta],mediaType:"binary",serializer:Ys};const $s={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Mr},default:{bodyMapper:T,headersMapper:Fr}},queryParameters:[Kr,wa,Sa],urlParameters:[Yr],headerParameters:[$r,Zr,ei,ui,Ci,Ki,$i,Zi,vn,Sn,Qn,xn,Nn,Pn,Ln,la,pa,Ca],isXML:true,serializer:Js};const Zs={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Ur},default:{bodyMapper:T,headersMapper:qr}},requestBody:Qa,queryParameters:[Kr,xa],urlParameters:[Yr],headerParameters:[zr,Jr,$r,Zr,gi,Ci,vi,Bi,Ki,$i,Zi,en,tn,rn,pn,dn,un,An,mn,hn,yn,En,vn,In,Dn,_n,Yn,Wn],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Js};const eo={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:te,headersMapper:Hr},default:{bodyMapper:T,headersMapper:jr}},queryParameters:[Kr,Vi,xa,Na],urlParameters:[Yr],headerParameters:[$r,Zr,ei,Ci,rn],isXML:true,serializer:Js};const to=p.createClientLogger("storage-blob");const ro="12.17.0";const io="2023-11-03";const no=256*1024*1024;const ao=4e3*1024*1024;const so=5e4;const oo=8*1024*1024;const lo=4*1024*1024;const co=5;const po=100*1e3;const uo="https://storage.azure.com/.default";const Ao={Parameters:{FORCE_BROWSER_NO_CACHE:"_",SIGNATURE:"sig",SNAPSHOT:"snapshot",VERSIONID:"versionid",TIMEOUT:"timeout"}};const mo={HTTP_ACCEPTED:202,HTTP_CONFLICT:409,HTTP_NOT_FOUND:404,HTTP_PRECON_FAILED:412,HTTP_RANGE_NOT_SATISFIABLE:416};const fo={AUTHORIZATION:"Authorization",AUTHORIZATION_SCHEME:"Bearer",CONTENT_ENCODING:"Content-Encoding",CONTENT_ID:"Content-ID",CONTENT_LANGUAGE:"Content-Language",CONTENT_LENGTH:"Content-Length",CONTENT_MD5:"Content-Md5",CONTENT_TRANSFER_ENCODING:"Content-Transfer-Encoding",CONTENT_TYPE:"Content-Type",COOKIE:"Cookie",DATE:"date",IF_MATCH:"if-match",IF_MODIFIED_SINCE:"if-modified-since",IF_NONE_MATCH:"if-none-match",IF_UNMODIFIED_SINCE:"if-unmodified-since",PREFIX_FOR_STORAGE:"x-ms-",RANGE:"Range",USER_AGENT:"User-Agent",X_MS_CLIENT_REQUEST_ID:"x-ms-client-request-id",X_MS_COPY_SOURCE:"x-ms-copy-source",X_MS_DATE:"x-ms-date",X_MS_ERROR_CODE:"x-ms-error-code",X_MS_VERSION:"x-ms-version"};const ho="";const go="*";const yo=1*1024*1024;const Eo=256;const bo=4*yo;const Co="\r\n";const vo="HTTP/1.1";const Bo="AES256";const Io=`DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;const wo=["Access-Control-Allow-Origin","Cache-Control","Content-Length","Content-Type","Date","Request-Id","traceparent","Transfer-Encoding","User-Agent","x-ms-client-request-id","x-ms-date","x-ms-error-code","x-ms-request-id","x-ms-return-client-request-id","x-ms-version","Accept-Ranges","Content-Disposition","Content-Encoding","Content-Language","Content-MD5","Content-Range","ETag","Last-Modified","Server","Vary","x-ms-content-crc64","x-ms-copy-action","x-ms-copy-completion-time","x-ms-copy-id","x-ms-copy-progress","x-ms-copy-status","x-ms-has-immutability-policy","x-ms-has-legal-hold","x-ms-lease-state","x-ms-lease-status","x-ms-range","x-ms-request-server-encrypted","x-ms-server-encrypted","x-ms-snapshot","x-ms-source-range","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","x-ms-access-tier","x-ms-access-tier-change-time","x-ms-access-tier-inferred","x-ms-account-kind","x-ms-archive-status","x-ms-blob-append-offset","x-ms-blob-cache-control","x-ms-blob-committed-block-count","x-ms-blob-condition-appendpos","x-ms-blob-condition-maxsize","x-ms-blob-content-disposition","x-ms-blob-content-encoding","x-ms-blob-content-language","x-ms-blob-content-length","x-ms-blob-content-md5","x-ms-blob-content-type","x-ms-blob-public-access","x-ms-blob-sequence-number","x-ms-blob-type","x-ms-copy-destination-snapshot","x-ms-creation-time","x-ms-default-encryption-scope","x-ms-delete-snapshots","x-ms-delete-type-permanent","x-ms-deny-encryption-scope-override","x-ms-encryption-algorithm","x-ms-if-sequence-number-eq","x-ms-if-sequence-number-le","x-ms-if-sequence-number-lt","x-ms-incremental-copy","x-ms-lease-action","x-ms-lease-break-period","x-ms-lease-duration","x-ms-lease-id","x-ms-lease-time","x-ms-page-write","x-ms-proposed-lease-id","x-ms-range-get-content-md5","x-ms-rehydrate-priority","x-ms-sequence-number-action","x-ms-sku-name","x-ms-source-content-md5","x-ms-source-if-match","x-ms-source-if-modified-since","x-ms-source-if-none-match","x-ms-source-if-unmodified-since","x-ms-tag-count","x-ms-encryption-key-sha256","x-ms-if-tags","x-ms-source-if-tags"];const So=["comp","maxresults","rscc","rscd","rsce","rscl","rsct","se","si","sip","sp","spr","sr","srt","ss","st","sv","include","marker","prefix","copyid","restype","blockid","blocklisttype","delimiter","prevsnapshot","ske","skoid","sks","skt","sktid","skv","snapshot"];const Qo="BlobUsesCustomerSpecifiedEncryption";const xo="BlobDoesNotUseCustomerSpecifiedEncryption";const No=["10000","10001","10002","10003","10004","10100","10101","10102","10103","10104","11000","11001","11002","11003","11004","11100","11101","11102","11103","11104"];function escapeURLPath(r){const i=s.URLBuilder.parse(r);let a=i.getPath();a=a||"/";a=escape(a);i.setPath(a);return i.toString()}function getProxyUriFromDevConnString(r){let i="";if(r.search("DevelopmentStorageProxyUri=")!==-1){const a=r.split(";");for(const r of a){if(r.trim().startsWith("DevelopmentStorageProxyUri=")){i=r.trim().match("DevelopmentStorageProxyUri=(.*)")[1]}}}return i}function getValueInConnString(r,i){const a=r.split(";");for(const r of a){if(r.trim().startsWith(i)){return r.trim().match(i+"=(.*)")[1]}}return""}function extractConnectionStringParts(r){let i="";if(r.startsWith("UseDevelopmentStorage=true")){i=getProxyUriFromDevConnString(r);r=Io}let a=getValueInConnString(r,"BlobEndpoint");a=a.endsWith("/")?a.slice(0,-1):a;if(r.search("DefaultEndpointsProtocol=")!==-1&&r.search("AccountKey=")!==-1){let s="";let l="";let c=Buffer.from("accountKey","base64");let p="";l=getValueInConnString(r,"AccountName");c=Buffer.from(getValueInConnString(r,"AccountKey"),"base64");if(!a){s=getValueInConnString(r,"DefaultEndpointsProtocol");const i=s.toLowerCase();if(i!=="https"&&i!=="http"){throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'")}p=getValueInConnString(r,"EndpointSuffix");if(!p){throw new Error("Invalid EndpointSuffix in the provided Connection String")}a=`${s}://${l}.blob.${p}`}if(!l){throw new Error("Invalid AccountName in the provided Connection String")}else if(c.length===0){throw new Error("Invalid AccountKey in the provided Connection String")}return{kind:"AccountConnString",url:a,accountName:l,accountKey:c,proxyUri:i}}else{const i=getValueInConnString(r,"SharedAccessSignature");let s=getValueInConnString(r,"AccountName");if(!s){s=getAccountNameFromUrl(a)}if(!a){throw new Error("Invalid BlobEndpoint in the provided SAS Connection String")}else if(!i){throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String")}return{kind:"SASConnString",url:a,accountName:s,accountSas:i}}}function escape(r){return encodeURIComponent(r).replace(/%2F/g,"/").replace(/'/g,"%27").replace(/\+/g,"%20").replace(/%25/g,"%")}function appendToURLPath(r,i){const a=s.URLBuilder.parse(r);let l=a.getPath();l=l?l.endsWith("/")?`${l}${i}`:`${l}/${i}`:i;a.setPath(l);const c=new URL(a.toString());return c.toString()}function setURLParameter(r,i,a){const l=s.URLBuilder.parse(r);l.setQueryParameter(i,a);return l.toString()}function getURLParameter(r,i){const a=s.URLBuilder.parse(r);return a.getQueryParameterValue(i)}function setURLHost(r,i){const a=s.URLBuilder.parse(r);a.setHost(i);return a.toString()}function getURLPath(r){const i=s.URLBuilder.parse(r);return i.getPath()}function getURLScheme(r){const i=s.URLBuilder.parse(r);return i.getScheme()}function getURLPathAndQuery(r){const i=s.URLBuilder.parse(r);const a=i.getPath();if(!a){throw new RangeError("Invalid url without valid path.")}let l=i.getQuery()||"";l=l.trim();if(l!==""){l=l.startsWith("?")?l:`?${l}`}return`${a}${l}`}function getURLQueries(r){let i=s.URLBuilder.parse(r).getQuery();if(!i){return{}}i=i.trim();i=i.startsWith("?")?i.substr(1):i;let a=i.split("&");a=a.filter((r=>{const i=r.indexOf("=");const a=r.lastIndexOf("=");return i>0&&i===a&&al){r=r.slice(0,l)}const c=r+padStart(i.toString(),a-r.length,"0");return base64encode(c)}async function delay(r,i,a){return new Promise(((s,l)=>{let c;const abortHandler=()=>{if(c!==undefined){clearTimeout(c)}l(a)};const resolveHandler=()=>{if(i!==undefined){i.removeEventListener("abort",abortHandler)}s()};c=setTimeout(resolveHandler,r);if(i!==undefined){i.addEventListener("abort",abortHandler)}}))}function padStart(r,i,a=" "){if(String.prototype.padStart){return r.padStart(i,a)}a=a||" ";if(r.length>i){return r}else{i=i-r.length;if(i>a.length){a+=a.repeat(i/a.length)}return a.slice(0,i)+r}}function iEqual(r,i){return r.toLocaleLowerCase()===i.toLocaleLowerCase()}function getAccountNameFromUrl(r){const i=s.URLBuilder.parse(r);let a;try{if(i.getHost().split(".")[1]==="blob"){a=i.getHost().split(".")[0]}else if(isIpEndpointStyle(i)){a=i.getPath().split("/")[1]}else{a=""}return a}catch(r){throw new Error("Unable to extract accountName with provided information.")}}function isIpEndpointStyle(r){if(r.getHost()===undefined){return false}const i=r.getHost()+(r.getPort()===undefined?"":":"+r.getPort());return/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(i)||r.getPort()!==undefined&&No.includes(r.getPort())}function toBlobTagsString(r){if(r===undefined){return undefined}const i=[];for(const a in r){if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];i.push(`${encodeURIComponent(a)}=${encodeURIComponent(s)}`)}}return i.join("&")}function toBlobTags(r){if(r===undefined){return undefined}const i={blobTagSet:[]};for(const a in r){if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];i.blobTagSet.push({key:a,value:s})}}return i}function toTags(r){if(r===undefined){return undefined}const i={};for(const a of r.blobTagSet){i[a.key]=a.value}return i}function toQuerySerialization(r){if(r===undefined){return undefined}switch(r.kind){case"csv":return{format:{type:"delimited",delimitedTextConfiguration:{columnSeparator:r.columnSeparator||",",fieldQuote:r.fieldQuote||"",recordSeparator:r.recordSeparator,escapeChar:r.escapeCharacter||"",headersPresent:r.hasHeaders||false}}};case"json":return{format:{type:"json",jsonTextConfiguration:{recordSeparator:r.recordSeparator}}};case"arrow":return{format:{type:"arrow",arrowConfiguration:{schema:r.schema}}};case"parquet":return{format:{type:"parquet"}};default:throw Error("Invalid BlobQueryTextConfiguration.")}}function parseObjectReplicationRecord(r){if(!r){return undefined}if("policy-id"in r){return undefined}const i=[];for(const a in r){const s=a.split("_");const l="or-";if(s[0].startsWith(l)){s[0]=s[0].substring(l.length)}const c={ruleId:s[1],replicationStatus:r[a]};const p=i.findIndex((r=>r.policyId===s[0]));if(p>-1){i[p].rules.push(c)}else{i.push({policyId:s[0],rules:[c]})}}return i}function attachCredential(r,i){r.credential=i;return r}function httpAuthorizationToString(r){return r?r.scheme+" "+r.value:undefined}function BlobNameToString(r){if(r.encoded){return decodeURIComponent(r.content)}else{return r.content}}function ConvertInternalResponseOfListBlobFlat(r){return Object.assign(Object.assign({},r),{segment:{blobItems:r.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i}))}})}function ConvertInternalResponseOfListBlobHierarchy(r){var i;return Object.assign(Object.assign({},r),{segment:{blobPrefixes:(i=r.segment.blobPrefixes)===null||i===void 0?void 0:i.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i})),blobItems:r.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i}))}})}function*ExtractPageRangeInfoItems(r){let i=[];let a=[];if(r.pageRange)i=r.pageRange;if(r.clearRange)a=r.clearRange;let s=0;let l=0;while(s=1?Math.floor(a.maxTries):Ro.maxTries,tryTimeoutInMs:a.tryTimeoutInMs&&a.tryTimeoutInMs>=0?a.tryTimeoutInMs:Ro.tryTimeoutInMs,retryDelayInMs:a.retryDelayInMs&&a.retryDelayInMs>=0?Math.min(a.retryDelayInMs,a.maxRetryDelayInMs?a.maxRetryDelayInMs:Ro.maxRetryDelayInMs):Ro.retryDelayInMs,maxRetryDelayInMs:a.maxRetryDelayInMs&&a.maxRetryDelayInMs>=0?a.maxRetryDelayInMs:Ro.maxRetryDelayInMs,secondaryHost:a.secondaryHost?a.secondaryHost:Ro.secondaryHost}}async sendRequest(r){return this.attemptSendRequest(r,false,1)}async attemptSendRequest(r,i,a){const s=r.clone();const l=i||!this.retryOptions.secondaryHost||!(r.method==="GET"||r.method==="HEAD"||r.method==="OPTIONS")||a%2===1;if(!l){s.url=setURLHost(s.url,this.retryOptions.secondaryHost)}if(this.retryOptions.tryTimeoutInMs){s.url=setURLParameter(s.url,Ao.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString())}let c;try{to.info(`RetryPolicy: =====> Try=${a} ${l?"Primary":"Secondary"}`);c=await this._nextPolicy.sendRequest(s);if(!this.shouldRetry(l,a,c)){return c}i=i||!l&&c.status===404}catch(r){to.error(`RetryPolicy: Caught error, message: ${r.message}, code: ${r.code}`);if(!this.shouldRetry(l,a,c,r)){throw r}}await this.delay(l,a,r.abortSignal);return this.attemptSendRequest(r,i,++a)}shouldRetry(r,i,a,s){if(i>=this.retryOptions.maxTries){to.info(`RetryPolicy: Attempt(s) ${i} >= maxTries ${this.retryOptions.maxTries}, no further try.`);return false}const l=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(s){for(const r of l){if(s.name.toUpperCase().includes(r)||s.message.toUpperCase().includes(r)||s.code&&s.code.toString().toUpperCase()===r){to.info(`RetryPolicy: Network error ${r} found, will retry.`);return true}}}if(a||s){const i=a?a.status:s?s.statusCode:0;if(!r&&i===404){to.info(`RetryPolicy: Secondary access with 404, will retry.`);return true}if(i===503||i===500){to.info(`RetryPolicy: Will retry for status code ${i}.`);return true}}if((s===null||s===void 0?void 0:s.code)==="PARSE_ERROR"&&(s===null||s===void 0?void 0:s.message.startsWith(`Error "Error: Unclosed root tag`))){to.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");return true}return false}async delay(r,a,s){let l=0;if(r){switch(this.retryOptions.retryPolicyType){case i.StorageRetryPolicyType.EXPONENTIAL:l=Math.min((Math.pow(2,a-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case i.StorageRetryPolicyType.FIXED:l=this.retryOptions.retryDelayInMs;break}}else{l=Math.random()*1e3}to.info(`RetryPolicy: Delay for ${l}ms`);return delay(l,s,To)}}class StorageRetryPolicyFactory{constructor(r){this.retryOptions=r}create(r,i){return new StorageRetryPolicy(r,i,this.retryOptions)}}class CredentialPolicy extends s.BaseRequestPolicy{sendRequest(r){return this._nextPolicy.sendRequest(this.signRequest(r))}signRequest(r){return r}}class AnonymousCredentialPolicy extends CredentialPolicy{constructor(r,i){super(r,i)}}class Credential{create(r,i){throw new Error("Method should be implemented in children classes.")}}class AnonymousCredential extends Credential{create(r,i){return new AnonymousCredentialPolicy(r,i)}}class TelemetryPolicy extends s.BaseRequestPolicy{constructor(r,i,a){super(r,i);this.telemetry=a}async sendRequest(r){if(s.isNode){if(!r.headers){r.headers=new s.HttpHeaders}if(!r.headers.get(fo.USER_AGENT)){r.headers.set(fo.USER_AGENT,this.telemetry)}}return this._nextPolicy.sendRequest(r)}}class TelemetryPolicyFactory{constructor(r){const i=[];if(s.isNode){if(r){const a=r.userAgentPrefix||"";if(a.length>0&&i.indexOf(a)===-1){i.push(a)}}const a=`azsdk-js-storageblob/${ro}`;if(i.indexOf(a)===-1){i.push(a)}let s=`(NODE-VERSION ${process.version})`;if(v){s=`(NODE-VERSION ${process.version}; ${v.type()} ${v.release()})`}if(i.indexOf(s)===-1){i.push(s)}}this.telemetryString=i.join(" ")}create(r,i){return new TelemetryPolicy(r,i,this.telemetryString)}}const Do=new s.DefaultHttpClient;function getCachedDefaultHttpClient(){return Do}const ko={DefaultScope:"/.default",HeaderConstants:{AUTHORIZATION:"authorization"}};const _o={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function beginRefresh(r,i,a){async function tryGetAccessToken(){if(Date.now()r.getToken(i,a);s=beginRefresh(tryGetAccessToken,c.retryIntervalInMs,(d=l===null||l===void 0?void 0:l.expiresOnTimestamp)!==null&&d!==void 0?d:Date.now()).then((r=>{s=null;l=r;return l})).catch((r=>{s=null;l=null;throw r}))}return s}return async r=>{if(p.mustRefresh)return refresh(r);if(p.shouldRefresh){refresh(r)}return l}}function getChallenge(r){const i=r.headers.get("WWW-Authenticate");if(r.status===401&&i){return i}return}function parseChallenge(r){const i=r.slice("Bearer ".length);const a=`${i.trim()} `.split(" ").filter((r=>r));const s=a.map((r=>(([r,i])=>({[r]:i}))(r.trim().split("="))));return s.reduce(((r,i)=>Object.assign(Object.assign({},r),i)),{})}function storageBearerTokenChallengeAuthenticationPolicy(r,i){let a=createTokenCycler(r,i);class StorageBearerTokenChallengeAuthenticationPolicy extends s.BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(i){if(!i.url.toLowerCase().startsWith("https://")){throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.")}const l=a;const c=(await l({abortSignal:i.abortSignal,tracingOptions:{tracingContext:i.tracingContext}})).token;i.headers.set(ko.HeaderConstants.AUTHORIZATION,`Bearer ${c}`);const p=await this._nextPolicy.sendRequest(i);if((p===null||p===void 0?void 0:p.status)===401){const l=getChallenge(p);if(l){const c=parseChallenge(l);const p=c.resource_id+ko.DefaultScope;const d=s.URLBuilder.parse(c.authorization_uri);const u=d.getPath().split("/");const A=u[1];const h=createTokenCycler(r,p);const g=(await h({abortSignal:i.abortSignal,tracingOptions:{tracingContext:i.tracingContext},tenantId:A})).token;a=h;i.headers.set(ko.HeaderConstants.AUTHORIZATION,`Bearer ${g}`);return this._nextPolicy.sendRequest(i)}}return p}}return{create:(r,i)=>new StorageBearerTokenChallengeAuthenticationPolicy(r,i)}}function isPipelineLike(r){if(!r||typeof r!=="object"){return false}const i=r;return Array.isArray(i.factories)&&typeof i.options==="object"&&typeof i.toServiceClientOptions==="function"}class Pipeline{constructor(r,i={}){this.factories=r;this.options=Object.assign(Object.assign({},i),{httpClient:i.httpClient||getCachedDefaultHttpClient()})}toServiceClientOptions(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}}}function newPipeline(r,i={}){var a;if(r===undefined){r=new AnonymousCredential}const l=new TelemetryPolicyFactory(i.userAgentOptions);const c=[s.tracingPolicy({userAgent:l.telemetryString}),s.keepAlivePolicy(i.keepAliveOptions),l,s.generateClientRequestIdPolicy(),new StorageBrowserPolicyFactory,new StorageRetryPolicyFactory(i.retryOptions),s.deserializationPolicy(undefined,{xmlCharKey:"#"}),s.logPolicy({logger:to.info,allowedHeaderNames:wo,allowedQueryParameters:So})];if(s.isNode){c.push(s.proxyPolicy(i.proxyOptions));c.push(s.disableResponseDecompressionPolicy())}c.push(s.isTokenCredential(r)?attachCredential(storageBearerTokenChallengeAuthenticationPolicy(r,(a=i.audience)!==null&&a!==void 0?a:uo),r):r);return new Pipeline(c,i)}class StorageSharedKeyCredentialPolicy extends CredentialPolicy{constructor(r,i,a){super(r,i);this.factory=a}signRequest(r){r.headers.set(fo.X_MS_DATE,(new Date).toUTCString());if(r.body&&(typeof r.body==="string"||r.body!==undefined)&&r.body.length>0){r.headers.set(fo.CONTENT_LENGTH,Buffer.byteLength(r.body))}const i=[r.method.toUpperCase(),this.getHeaderValueToSign(r,fo.CONTENT_LANGUAGE),this.getHeaderValueToSign(r,fo.CONTENT_ENCODING),this.getHeaderValueToSign(r,fo.CONTENT_LENGTH),this.getHeaderValueToSign(r,fo.CONTENT_MD5),this.getHeaderValueToSign(r,fo.CONTENT_TYPE),this.getHeaderValueToSign(r,fo.DATE),this.getHeaderValueToSign(r,fo.IF_MODIFIED_SINCE),this.getHeaderValueToSign(r,fo.IF_MATCH),this.getHeaderValueToSign(r,fo.IF_NONE_MATCH),this.getHeaderValueToSign(r,fo.IF_UNMODIFIED_SINCE),this.getHeaderValueToSign(r,fo.RANGE)].join("\n")+"\n"+this.getCanonicalizedHeadersString(r)+this.getCanonicalizedResourceString(r);const a=this.factory.computeHMACSHA256(i);r.headers.set(fo.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${a}`);return r}getHeaderValueToSign(r,i){const a=r.headers.get(i);if(!a){return""}if(i===fo.CONTENT_LENGTH&&a==="0"){return""}return a}getCanonicalizedHeadersString(r){let i=r.headers.headersArray().filter((r=>r.name.toLowerCase().startsWith(fo.PREFIX_FOR_STORAGE)));i.sort(((r,i)=>r.name.toLowerCase().localeCompare(i.name.toLowerCase())));i=i.filter(((r,i,a)=>{if(i>0&&r.name.toLowerCase()===a[i-1].name.toLowerCase()){return false}return true}));let a="";i.forEach((r=>{a+=`${r.name.toLowerCase().trimRight()}:${r.value.trimLeft()}\n`}));return a}getCanonicalizedResourceString(r){const i=getURLPath(r.url)||"/";let a="";a+=`/${this.factory.accountName}${i}`;const s=getURLQueries(r.url);const l={};if(s){const r=[];for(const i in s){if(Object.prototype.hasOwnProperty.call(s,i)){const a=i.toLowerCase();l[a]=s[i];r.push(a)}}r.sort();for(const i of r){a+=`\n${i}:${decodeURIComponent(l[i])}`}}return a}}class StorageSharedKeyCredential extends Credential{constructor(r,i){super();this.accountName=r;this.accountKey=Buffer.from(i,"base64")}create(r,i){return new StorageSharedKeyCredentialPolicy(r,i,this)}computeHMACSHA256(r){return A.createHmac("sha256",this.accountKey).update(r,"utf8").digest("base64")}}const Oo="azure-storage-blob";const Po="12.17.0";class StorageClientContext extends C.ServiceClient{constructor(r,i){if(r===undefined){throw new Error("'url' cannot be null")}if(!i){i={}}if(!i.userAgent){const r=C.getDefaultUserAgentValue();i.userAgent=`${Oo}/${Po} ${r}`}super(undefined,i);this.requestContentType="application/json; charset=utf-8";this.baseUri=i.endpoint||"{url}";this.url=r;this.version=i.version||"2023-11-03"}}class StorageClient{constructor(r,i){this.url=escapeURLPath(r);this.accountName=getAccountNameFromUrl(r);this.pipeline=i;this.storageClientContext=new StorageClientContext(this.url,i.toServiceClientOptions());this.isHttps=iEqual(getURLScheme(this.url)||"","https");this.credential=new AnonymousCredential;for(const r of this.pipeline.factories){if(s.isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential){this.credential=r}else if(s.isTokenCredential(r.credential)){this.credential=r.credential}}const a=this.storageClientContext;a.requestContentType=undefined}}const Lo=c.createSpanFunction({packagePrefix:"Azure.Storage.Blob",namespace:"Microsoft.Storage"});function convertTracingToRequestOptionsBase(r){var i,a;return{spanOptions:(i=r===null||r===void 0?void 0:r.tracingOptions)===null||i===void 0?void 0:i.spanOptions,tracingContext:(a=r===null||r===void 0?void 0:r.tracingOptions)===null||a===void 0?void 0:a.tracingContext}}class BlobSASPermissions{constructor(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false;this.permanentDelete=false}static parse(r){const i=new BlobSASPermissions;for(const a of r){switch(a){case"r":i.read=true;break;case"a":i.add=true;break;case"c":i.create=true;break;case"w":i.write=true;break;case"d":i.delete=true;break;case"x":i.deleteVersion=true;break;case"t":i.tag=true;break;case"m":i.move=true;break;case"e":i.execute=true;break;case"i":i.setImmutabilityPolicy=true;break;case"y":i.permanentDelete=true;break;default:throw new RangeError(`Invalid permission: ${a}`)}}return i}static from(r){const i=new BlobSASPermissions;if(r.read){i.read=true}if(r.add){i.add=true}if(r.create){i.create=true}if(r.write){i.write=true}if(r.delete){i.delete=true}if(r.deleteVersion){i.deleteVersion=true}if(r.tag){i.tag=true}if(r.move){i.move=true}if(r.execute){i.execute=true}if(r.setImmutabilityPolicy){i.setImmutabilityPolicy=true}if(r.permanentDelete){i.permanentDelete=true}return i}toString(){const r=[];if(this.read){r.push("r")}if(this.add){r.push("a")}if(this.create){r.push("c")}if(this.write){r.push("w")}if(this.delete){r.push("d")}if(this.deleteVersion){r.push("x")}if(this.tag){r.push("t")}if(this.move){r.push("m")}if(this.execute){r.push("e")}if(this.setImmutabilityPolicy){r.push("i")}if(this.permanentDelete){r.push("y")}return r.join("")}}class ContainerSASPermissions{constructor(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.list=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false;this.permanentDelete=false;this.filterByTags=false}static parse(r){const i=new ContainerSASPermissions;for(const a of r){switch(a){case"r":i.read=true;break;case"a":i.add=true;break;case"c":i.create=true;break;case"w":i.write=true;break;case"d":i.delete=true;break;case"l":i.list=true;break;case"t":i.tag=true;break;case"x":i.deleteVersion=true;break;case"m":i.move=true;break;case"e":i.execute=true;break;case"i":i.setImmutabilityPolicy=true;break;case"y":i.permanentDelete=true;break;case"f":i.filterByTags=true;break;default:throw new RangeError(`Invalid permission ${a}`)}}return i}static from(r){const i=new ContainerSASPermissions;if(r.read){i.read=true}if(r.add){i.add=true}if(r.create){i.create=true}if(r.write){i.write=true}if(r.delete){i.delete=true}if(r.list){i.list=true}if(r.deleteVersion){i.deleteVersion=true}if(r.tag){i.tag=true}if(r.move){i.move=true}if(r.execute){i.execute=true}if(r.setImmutabilityPolicy){i.setImmutabilityPolicy=true}if(r.permanentDelete){i.permanentDelete=true}if(r.filterByTags){i.filterByTags=true}return i}toString(){const r=[];if(this.read){r.push("r")}if(this.add){r.push("a")}if(this.create){r.push("c")}if(this.write){r.push("w")}if(this.delete){r.push("d")}if(this.deleteVersion){r.push("x")}if(this.list){r.push("l")}if(this.tag){r.push("t")}if(this.move){r.push("m")}if(this.execute){r.push("e")}if(this.setImmutabilityPolicy){r.push("i")}if(this.permanentDelete){r.push("y")}if(this.filterByTags){r.push("f")}return r.join("")}}class UserDelegationKeyCredential{constructor(r,i){this.accountName=r;this.userDelegationKey=i;this.key=Buffer.from(i.value,"base64")}computeHMACSHA256(r){return A.createHmac("sha256",this.key).update(r,"utf8").digest("base64")}}function ipRangeToString(r){return r.end?`${r.start}-${r.end}`:r.start}i.SASProtocol=void 0;(function(r){r["Https"]="https";r["HttpsAndHttp"]="https,http"})(i.SASProtocol||(i.SASProtocol={}));class SASQueryParameters{constructor(r,i,a,s,l,c,p,d,u,A,h,g,y,E,b,C,v,B,I,w){this.version=r;this.signature=i;if(a!==undefined&&typeof a!=="string"){this.permissions=a.permissions;this.services=a.services;this.resourceTypes=a.resourceTypes;this.protocol=a.protocol;this.startsOn=a.startsOn;this.expiresOn=a.expiresOn;this.ipRangeInner=a.ipRange;this.identifier=a.identifier;this.encryptionScope=a.encryptionScope;this.resource=a.resource;this.cacheControl=a.cacheControl;this.contentDisposition=a.contentDisposition;this.contentEncoding=a.contentEncoding;this.contentLanguage=a.contentLanguage;this.contentType=a.contentType;if(a.userDelegationKey){this.signedOid=a.userDelegationKey.signedObjectId;this.signedTenantId=a.userDelegationKey.signedTenantId;this.signedStartsOn=a.userDelegationKey.signedStartsOn;this.signedExpiresOn=a.userDelegationKey.signedExpiresOn;this.signedService=a.userDelegationKey.signedService;this.signedVersion=a.userDelegationKey.signedVersion;this.preauthorizedAgentObjectId=a.preauthorizedAgentObjectId;this.correlationId=a.correlationId}}else{this.services=s;this.resourceTypes=l;this.expiresOn=d;this.permissions=a;this.protocol=c;this.startsOn=p;this.ipRangeInner=u;this.encryptionScope=w;this.identifier=A;this.resource=h;this.cacheControl=g;this.contentDisposition=y;this.contentEncoding=E;this.contentLanguage=b;this.contentType=C;if(v){this.signedOid=v.signedObjectId;this.signedTenantId=v.signedTenantId;this.signedStartsOn=v.signedStartsOn;this.signedExpiresOn=v.signedExpiresOn;this.signedService=v.signedService;this.signedVersion=v.signedVersion;this.preauthorizedAgentObjectId=B;this.correlationId=I}}}get ipRange(){if(this.ipRangeInner){return{end:this.ipRangeInner.end,start:this.ipRangeInner.start}}return undefined}toString(){const r=["sv","ss","srt","spr","st","se","sip","si","ses","skoid","sktid","skt","ske","sks","skv","sr","sp","sig","rscc","rscd","rsce","rscl","rsct","saoid","scid"];const i=[];for(const a of r){switch(a){case"sv":this.tryAppendQueryParameter(i,a,this.version);break;case"ss":this.tryAppendQueryParameter(i,a,this.services);break;case"srt":this.tryAppendQueryParameter(i,a,this.resourceTypes);break;case"spr":this.tryAppendQueryParameter(i,a,this.protocol);break;case"st":this.tryAppendQueryParameter(i,a,this.startsOn?truncatedISO8061Date(this.startsOn,false):undefined);break;case"se":this.tryAppendQueryParameter(i,a,this.expiresOn?truncatedISO8061Date(this.expiresOn,false):undefined);break;case"sip":this.tryAppendQueryParameter(i,a,this.ipRange?ipRangeToString(this.ipRange):undefined);break;case"si":this.tryAppendQueryParameter(i,a,this.identifier);break;case"ses":this.tryAppendQueryParameter(i,a,this.encryptionScope);break;case"skoid":this.tryAppendQueryParameter(i,a,this.signedOid);break;case"sktid":this.tryAppendQueryParameter(i,a,this.signedTenantId);break;case"skt":this.tryAppendQueryParameter(i,a,this.signedStartsOn?truncatedISO8061Date(this.signedStartsOn,false):undefined);break;case"ske":this.tryAppendQueryParameter(i,a,this.signedExpiresOn?truncatedISO8061Date(this.signedExpiresOn,false):undefined);break;case"sks":this.tryAppendQueryParameter(i,a,this.signedService);break;case"skv":this.tryAppendQueryParameter(i,a,this.signedVersion);break;case"sr":this.tryAppendQueryParameter(i,a,this.resource);break;case"sp":this.tryAppendQueryParameter(i,a,this.permissions);break;case"sig":this.tryAppendQueryParameter(i,a,this.signature);break;case"rscc":this.tryAppendQueryParameter(i,a,this.cacheControl);break;case"rscd":this.tryAppendQueryParameter(i,a,this.contentDisposition);break;case"rsce":this.tryAppendQueryParameter(i,a,this.contentEncoding);break;case"rscl":this.tryAppendQueryParameter(i,a,this.contentLanguage);break;case"rsct":this.tryAppendQueryParameter(i,a,this.contentType);break;case"saoid":this.tryAppendQueryParameter(i,a,this.preauthorizedAgentObjectId);break;case"scid":this.tryAppendQueryParameter(i,a,this.correlationId);break}}return i.join("&")}tryAppendQueryParameter(r,i,a){if(!a){return}i=encodeURIComponent(i);a=encodeURIComponent(a);if(i.length>0&&a.length>0){r.push(`${i}=${a}`)}}}function generateBlobSASQueryParameters(r,i,a){const s=r.version?r.version:io;const l=i instanceof StorageSharedKeyCredential?i:undefined;let c;if(l===undefined&&a!==undefined){c=new UserDelegationKeyCredential(a,i)}if(l===undefined&&c===undefined){throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.")}if(s>="2020-12-06"){if(l!==undefined){return generateBlobSASQueryParameters20201206(r,l)}else{return generateBlobSASQueryParametersUDK20201206(r,c)}}if(s>="2018-11-09"){if(l!==undefined){return generateBlobSASQueryParameters20181109(r,l)}else{if(s>="2020-02-10"){return generateBlobSASQueryParametersUDK20200210(r,c)}else{return generateBlobSASQueryParametersUDK20181109(r,c)}}}if(s>="2015-04-05"){if(l!==undefined){return generateBlobSASQueryParameters20150405(r,l)}else{throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.")}}throw new RangeError("'version' must be >= '2015-04-05'.")}function generateBlobSASQueryParameters20150405(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.identifier&&!(r.permissions&&r.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}let a="c";if(r.blobName){a="b"}let s;if(r.permissions){if(r.blobName){s=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{s=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const l=[s?s:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),r.identifier,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,r.cacheControl?r.cacheControl:"",r.contentDisposition?r.contentDisposition:"",r.contentEncoding?r.contentEncoding:"",r.contentLanguage?r.contentLanguage:"",r.contentType?r.contentType:""].join("\n");const c=i.computeHMACSHA256(l);return new SASQueryParameters(r.version,c,s,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType)}function generateBlobSASQueryParameters20181109(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.identifier&&!(r.permissions&&r.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}let a="c";let s=r.snapshotTime;if(r.blobName){a="b";if(r.snapshotTime){a="bs"}else if(r.versionId){a="bv";s=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),r.identifier,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,a,s,r.cacheControl?r.cacheControl:"",r.contentDisposition?r.contentDisposition:"",r.contentEncoding?r.contentEncoding:"",r.contentLanguage?r.contentLanguage:"",r.contentType?r.contentType:""].join("\n");const p=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,p,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType)}function generateBlobSASQueryParameters20201206(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.identifier&&!(r.permissions&&r.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}let a="c";let s=r.snapshotTime;if(r.blobName){a="b";if(r.snapshotTime){a="bs"}else if(r.versionId){a="bv";s=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),r.identifier,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,a,s,r.encryptionScope,r.cacheControl?r.cacheControl:"",r.contentDisposition?r.contentDisposition:"",r.contentEncoding?r.contentEncoding:"",r.contentLanguage?r.contentLanguage:"",r.contentType?r.contentType:""].join("\n");const p=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,p,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,undefined,undefined,undefined,r.encryptionScope)}function generateBlobSASQueryParametersUDK20181109(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.permissions||!r.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}let a="c";let s=r.snapshotTime;if(r.blobName){a="b";if(r.snapshotTime){a="bs"}else if(r.versionId){a="bv";s=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),i.userDelegationKey.signedObjectId,i.userDelegationKey.signedTenantId,i.userDelegationKey.signedStartsOn?truncatedISO8061Date(i.userDelegationKey.signedStartsOn,false):"",i.userDelegationKey.signedExpiresOn?truncatedISO8061Date(i.userDelegationKey.signedExpiresOn,false):"",i.userDelegationKey.signedService,i.userDelegationKey.signedVersion,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,a,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType].join("\n");const p=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,p,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,i.userDelegationKey)}function generateBlobSASQueryParametersUDK20200210(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.permissions||!r.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}let a="c";let s=r.snapshotTime;if(r.blobName){a="b";if(r.snapshotTime){a="bs"}else if(r.versionId){a="bv";s=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),i.userDelegationKey.signedObjectId,i.userDelegationKey.signedTenantId,i.userDelegationKey.signedStartsOn?truncatedISO8061Date(i.userDelegationKey.signedStartsOn,false):"",i.userDelegationKey.signedExpiresOn?truncatedISO8061Date(i.userDelegationKey.signedExpiresOn,false):"",i.userDelegationKey.signedService,i.userDelegationKey.signedVersion,r.preauthorizedAgentObjectId,undefined,r.correlationId,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,a,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType].join("\n");const p=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,p,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,i.userDelegationKey,r.preauthorizedAgentObjectId,r.correlationId)}function generateBlobSASQueryParametersUDK20201206(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.permissions||!r.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}let a="c";let s=r.snapshotTime;if(r.blobName){a="b";if(r.snapshotTime){a="bs"}else if(r.versionId){a="bv";s=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),i.userDelegationKey.signedObjectId,i.userDelegationKey.signedTenantId,i.userDelegationKey.signedStartsOn?truncatedISO8061Date(i.userDelegationKey.signedStartsOn,false):"",i.userDelegationKey.signedExpiresOn?truncatedISO8061Date(i.userDelegationKey.signedExpiresOn,false):"",i.userDelegationKey.signedService,i.userDelegationKey.signedVersion,r.preauthorizedAgentObjectId,undefined,r.correlationId,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,a,s,r.encryptionScope,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType].join("\n");const p=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,p,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,i.userDelegationKey,r.preauthorizedAgentObjectId,r.correlationId,r.encryptionScope)}function getCanonicalName(r,i,a){const s=[`/blob/${r}/${i}`];if(a){s.push(`/${a}`)}return s.join("")}function SASSignatureValuesSanityCheckAndAutofill(r){const i=r.version?r.version:io;if(r.snapshotTime&&i<"2018-11-09"){throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.")}if(r.blobName===undefined&&r.snapshotTime){throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.")}if(r.versionId&&i<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.")}if(r.blobName===undefined&&r.versionId){throw RangeError("Must provide 'blobName' when providing 'versionId'.")}if(r.permissions&&r.permissions.setImmutabilityPolicy&&i<"2020-08-04"){throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.")}if(r.permissions&&r.permissions.deleteVersion&&i<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.")}if(r.permissions&&r.permissions.permanentDelete&&i<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.")}if(r.permissions&&r.permissions.tag&&i<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.")}if(i<"2020-02-10"&&r.permissions&&(r.permissions.move||r.permissions.execute)){throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.")}if(i<"2021-04-10"&&r.permissions&&r.permissions.filterByTags){throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.")}if(i<"2020-02-10"&&(r.preauthorizedAgentObjectId||r.correlationId)){throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.")}if(r.encryptionScope&&i<"2020-12-06"){throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.")}r.version=i;return r}class BlobLeaseClient{constructor(r,i){const a=new StorageClientContext(r.url,r.pipeline.toServiceClientOptions());this._url=r.url;if(r.name===undefined){this._isContainer=true;this._containerOrBlobOperation=new Container(a)}else{this._isContainer=false;this._containerOrBlobOperation=new Blob$1(a)}if(!i){i=s.generateUuid()}this._leaseId=i}get leaseId(){return this._leaseId}get url(){return this._url}async acquireLease(r,i={}){var a,s,l,p,d,u;const{span:A,updatedOptions:h}=Lo("BlobLeaseClient-acquireLease",i);if(this._isContainer&&(((a=i.conditions)===null||a===void 0?void 0:a.ifMatch)&&((s=i.conditions)===null||s===void 0?void 0:s.ifMatch)!==ho||((l=i.conditions)===null||l===void 0?void 0:l.ifNoneMatch)&&((p=i.conditions)===null||p===void 0?void 0:p.ifNoneMatch)!==ho||((d=i.conditions)===null||d===void 0?void 0:d.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{return await this._containerOrBlobOperation.acquireLease(Object.assign({abortSignal:i.abortSignal,duration:r,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(u=i.conditions)===null||u===void 0?void 0:u.tagConditions}),proposedLeaseId:this._leaseId},convertTracingToRequestOptionsBase(h)))}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}async changeLease(r,i={}){var a,s,l,p,d,u;const{span:A,updatedOptions:h}=Lo("BlobLeaseClient-changeLease",i);if(this._isContainer&&(((a=i.conditions)===null||a===void 0?void 0:a.ifMatch)&&((s=i.conditions)===null||s===void 0?void 0:s.ifMatch)!==ho||((l=i.conditions)===null||l===void 0?void 0:l.ifNoneMatch)&&((p=i.conditions)===null||p===void 0?void 0:p.ifNoneMatch)!==ho||((d=i.conditions)===null||d===void 0?void 0:d.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{const a=await this._containerOrBlobOperation.changeLease(this._leaseId,r,Object.assign({abortSignal:i.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(u=i.conditions)===null||u===void 0?void 0:u.tagConditions})},convertTracingToRequestOptionsBase(h)));this._leaseId=r;return a}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}async releaseLease(r={}){var i,a,s,l,p,d;const{span:u,updatedOptions:A}=Lo("BlobLeaseClient-releaseLease",r);if(this._isContainer&&(((i=r.conditions)===null||i===void 0?void 0:i.ifMatch)&&((a=r.conditions)===null||a===void 0?void 0:a.ifMatch)!==ho||((s=r.conditions)===null||s===void 0?void 0:s.ifNoneMatch)&&((l=r.conditions)===null||l===void 0?void 0:l.ifNoneMatch)!==ho||((p=r.conditions)===null||p===void 0?void 0:p.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{return await this._containerOrBlobOperation.releaseLease(this._leaseId,Object.assign({abortSignal:r.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(d=r.conditions)===null||d===void 0?void 0:d.tagConditions})},convertTracingToRequestOptionsBase(A)))}catch(r){u.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{u.end()}}async renewLease(r={}){var i,a,s,l,p,d;const{span:u,updatedOptions:A}=Lo("BlobLeaseClient-renewLease",r);if(this._isContainer&&(((i=r.conditions)===null||i===void 0?void 0:i.ifMatch)&&((a=r.conditions)===null||a===void 0?void 0:a.ifMatch)!==ho||((s=r.conditions)===null||s===void 0?void 0:s.ifNoneMatch)&&((l=r.conditions)===null||l===void 0?void 0:l.ifNoneMatch)!==ho||((p=r.conditions)===null||p===void 0?void 0:p.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{return await this._containerOrBlobOperation.renewLease(this._leaseId,Object.assign({abortSignal:r.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(d=r.conditions)===null||d===void 0?void 0:d.tagConditions})},convertTracingToRequestOptionsBase(A)))}catch(r){u.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{u.end()}}async breakLease(r,i={}){var a,s,l,p,d,u;const{span:A,updatedOptions:h}=Lo("BlobLeaseClient-breakLease",i);if(this._isContainer&&(((a=i.conditions)===null||a===void 0?void 0:a.ifMatch)&&((s=i.conditions)===null||s===void 0?void 0:s.ifMatch)!==ho||((l=i.conditions)===null||l===void 0?void 0:l.ifNoneMatch)&&((p=i.conditions)===null||p===void 0?void 0:p.ifNoneMatch)!==ho||((d=i.conditions)===null||d===void 0?void 0:d.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{const a=Object.assign({abortSignal:i.abortSignal,breakPeriod:r,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(u=i.conditions)===null||u===void 0?void 0:u.tagConditions})},convertTracingToRequestOptionsBase(h));return await this._containerOrBlobOperation.breakLease(a)}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}}class RetriableReadableStream extends h.Readable{constructor(r,i,a,s,l={}){super({highWaterMark:l.highWaterMark});this.retries=0;this.sourceDataHandler=r=>{if(this.options.doInjectErrorOnce){this.options.doInjectErrorOnce=undefined;this.source.pause();this.source.removeAllListeners("data");this.source.emit("end");return}this.offset+=r.length;if(this.onProgress){this.onProgress({loadedBytes:this.offset-this.start})}if(!this.push(r)){this.source.pause()}};this.sourceErrorOrEndHandler=r=>{if(r&&r.name==="AbortError"){this.destroy(r);return}this.removeSourceEventHandlers();if(this.offset-1===this.end){this.push(null)}else if(this.offset<=this.end){if(this.retries{this.source=r;this.setSourceEventHandlers();return})).catch((r=>{this.destroy(r)}))}else{this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset-1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`))}}else{this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset-1}`))}};this.getter=i;this.source=r;this.start=a;this.offset=a;this.end=a+s-1;this.maxRetryRequests=l.maxRetryRequests&&l.maxRetryRequests>=0?l.maxRetryRequests:0;this.onProgress=l.onProgress;this.options=l;this.setSourceEventHandlers()}_read(){this.source.resume()}setSourceEventHandlers(){this.source.on("data",this.sourceDataHandler);this.source.on("end",this.sourceErrorOrEndHandler);this.source.on("error",this.sourceErrorOrEndHandler)}removeSourceEventHandlers(){this.source.removeListener("data",this.sourceDataHandler);this.source.removeListener("end",this.sourceErrorOrEndHandler);this.source.removeListener("error",this.sourceErrorOrEndHandler)}_destroy(r,i){this.removeSourceEventHandlers();this.source.destroy();i(r===null?undefined:r)}}class BlobDownloadResponse{constructor(r,i,a,s,l={}){this.originalResponse=r;this.blobDownloadStream=new RetriableReadableStream(this.originalResponse.readableStreamBody,i,a,s,l)}get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return this.originalResponse.copyCompletedOn}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get tagCount(){return this.originalResponse.tagCount}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get lastAccessed(){return this.originalResponse.lastAccessed}get createdOn(){return this.originalResponse.createdOn}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get versionId(){return this.originalResponse.versionId}get isCurrentVersion(){return this.originalResponse.isCurrentVersion}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get objectReplicationDestinationPolicyId(){return this.originalResponse.objectReplicationDestinationPolicyId}get objectReplicationSourceProperties(){return this.originalResponse.objectReplicationSourceProperties}get isSealed(){return this.originalResponse.isSealed}get immutabilityPolicyExpiresOn(){return this.originalResponse.immutabilityPolicyExpiresOn}get immutabilityPolicyMode(){return this.originalResponse.immutabilityPolicyMode}get legalHold(){return this.originalResponse.legalHold}get contentAsBlob(){return this.originalResponse.blobBody}get readableStreamBody(){return s.isNode?this.blobDownloadStream:undefined}get _response(){return this.originalResponse._response}}const Mo=16;const Fo=new Uint8Array([79,98,106,1]);const Uo="avro.codec";const qo="avro.schema";class AvroParser{static async readFixedBytes(r,i,a={}){const s=await r.read(i,{abortSignal:a.abortSignal});if(s.length!==i){throw new Error("Hit stream end.")}return s}static async readByte(r,i={}){const a=await AvroParser.readFixedBytes(r,1,i);return a[0]}static async readZigZagLong(r,i={}){let a=0;let s=0;let l,c,p;do{l=await AvroParser.readByte(r,i);c=l&128;a|=(l&127)<Number.MAX_SAFE_INTEGER){throw new Error("Integer overflow.")}return s}return a>>1^-(a&1)}static async readLong(r,i={}){return AvroParser.readZigZagLong(r,i)}static async readInt(r,i={}){return AvroParser.readZigZagLong(r,i)}static async readNull(){return null}static async readBoolean(r,i={}){const a=await AvroParser.readByte(r,i);if(a===1){return true}else if(a===0){return false}else{throw new Error("Byte was not a boolean.")}}static async readFloat(r,i={}){const a=await AvroParser.readFixedBytes(r,4,i);const s=new DataView(a.buffer,a.byteOffset,a.byteLength);return s.getFloat32(0,true)}static async readDouble(r,i={}){const a=await AvroParser.readFixedBytes(r,8,i);const s=new DataView(a.buffer,a.byteOffset,a.byteLength);return s.getFloat64(0,true)}static async readBytes(r,i={}){const a=await AvroParser.readLong(r,i);if(a<0){throw new Error("Bytes size was negative.")}return r.read(a,{abortSignal:i.abortSignal})}static async readString(r,i={}){const a=await AvroParser.readBytes(r,i);const s=new TextDecoder;return s.decode(a)}static async readMapPair(r,i,a={}){const s=await AvroParser.readString(r,a);const l=await i(r,a);return{key:s,value:l}}static async readMap(r,i,a={}){const readPairMethod=(r,a={})=>AvroParser.readMapPair(r,i,a);const s=await AvroParser.readArray(r,readPairMethod,a);const l={};for(const r of s){l[r.key]=r.value}return l}static async readArray(r,i,a={}){const s=[];for(let l=await AvroParser.readLong(r,a);l!==0;l=await AvroParser.readLong(r,a)){if(l<0){await AvroParser.readLong(r,a);l=-l}while(l--){const l=await i(r,a);s.push(l)}}return s}}var Ho;(function(r){r["RECORD"]="record";r["ENUM"]="enum";r["ARRAY"]="array";r["MAP"]="map";r["UNION"]="union";r["FIXED"]="fixed"})(Ho||(Ho={}));var jo;(function(r){r["NULL"]="null";r["BOOLEAN"]="boolean";r["INT"]="int";r["LONG"]="long";r["FLOAT"]="float";r["DOUBLE"]="double";r["BYTES"]="bytes";r["STRING"]="string"})(jo||(jo={}));class AvroType{static fromSchema(r){if(typeof r==="string"){return AvroType.fromStringSchema(r)}else if(Array.isArray(r)){return AvroType.fromArraySchema(r)}else{return AvroType.fromObjectSchema(r)}}static fromStringSchema(r){switch(r){case jo.NULL:case jo.BOOLEAN:case jo.INT:case jo.LONG:case jo.FLOAT:case jo.DOUBLE:case jo.BYTES:case jo.STRING:return new AvroPrimitiveType(r);default:throw new Error(`Unexpected Avro type ${r}`)}}static fromArraySchema(r){return new AvroUnionType(r.map(AvroType.fromSchema))}static fromObjectSchema(r){const i=r.type;try{return AvroType.fromStringSchema(i)}catch(r){}switch(i){case Ho.RECORD:if(r.aliases){throw new Error(`aliases currently is not supported, schema: ${r}`)}if(!r.name){throw new Error(`Required attribute 'name' doesn't exist on schema: ${r}`)}const a={};if(!r.fields){throw new Error(`Required attribute 'fields' doesn't exist on schema: ${r}`)}for(const i of r.fields){a[i.name]=AvroType.fromSchema(i.type)}return new AvroRecordType(a,r.name);case Ho.ENUM:if(r.aliases){throw new Error(`aliases currently is not supported, schema: ${r}`)}if(!r.symbols){throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${r}`)}return new AvroEnumType(r.symbols);case Ho.MAP:if(!r.values){throw new Error(`Required attribute 'values' doesn't exist on schema: ${r}`)}return new AvroMapType(AvroType.fromSchema(r.values));case Ho.ARRAY:case Ho.FIXED:default:throw new Error(`Unexpected Avro type ${i} in ${r}`)}}}class AvroPrimitiveType extends AvroType{constructor(r){super();this._primitive=r}read(r,i={}){switch(this._primitive){case jo.NULL:return AvroParser.readNull();case jo.BOOLEAN:return AvroParser.readBoolean(r,i);case jo.INT:return AvroParser.readInt(r,i);case jo.LONG:return AvroParser.readLong(r,i);case jo.FLOAT:return AvroParser.readFloat(r,i);case jo.DOUBLE:return AvroParser.readDouble(r,i);case jo.BYTES:return AvroParser.readBytes(r,i);case jo.STRING:return AvroParser.readString(r,i);default:throw new Error("Unknown Avro Primitive")}}}class AvroEnumType extends AvroType{constructor(r){super();this._symbols=r}async read(r,i={}){const a=await AvroParser.readInt(r,i);return this._symbols[a]}}class AvroUnionType extends AvroType{constructor(r){super();this._types=r}async read(r,i={}){const a=await AvroParser.readInt(r,i);return this._types[a].read(r,i)}}class AvroMapType extends AvroType{constructor(r){super();this._itemType=r}read(r,i={}){const readItemMethod=(r,i)=>this._itemType.read(r,i);return AvroParser.readMap(r,readItemMethod,i)}}class AvroRecordType extends AvroType{constructor(r,i){super();this._fields=r;this._name=i}async read(r,i={}){const a={};a["$schema"]=this._name;for(const s in this._fields){if(Object.prototype.hasOwnProperty.call(this._fields,s)){a[s]=await this._fields[s].read(r,i)}}return a}}function arraysEqual(r,i){if(r===i)return true;if(r==null||i==null)return false;if(r.length!==i.length)return false;for(let a=0;a0){for(let i=0;i0}parseObjects(r={}){return l.__asyncGenerator(this,arguments,(function*parseObjects_1(){if(!this._initialized){yield l.__await(this.initialize(r))}while(this.hasNext()){const i=yield l.__await(this._itemType.read(this._dataStream,{abortSignal:r.abortSignal}));this._itemsRemainingInBlock--;this._objectIndex++;if(this._itemsRemainingInBlock===0){const i=yield l.__await(AvroParser.readFixedBytes(this._dataStream,Mo,{abortSignal:r.abortSignal}));this._blockOffset=this._initialBlockOffset+this._dataStream.position;this._objectIndex=0;if(!arraysEqual(this._syncMarker,i)){throw new Error("Stream is not a valid Avro file.")}try{this._itemsRemainingInBlock=yield l.__await(AvroParser.readLong(this._dataStream,{abortSignal:r.abortSignal}))}catch(r){this._itemsRemainingInBlock=0}if(this._itemsRemainingInBlock>0){yield l.__await(AvroParser.readLong(this._dataStream,{abortSignal:r.abortSignal}))}}yield yield l.__await(i)}}))}}class AvroReadable{}const Go=new d.AbortError("Reading from the avro stream was aborted.");class AvroReadableFromStream extends AvroReadable{constructor(r){super();this._readable=r;this._position=0}toUint8Array(r){if(typeof r==="string"){return Buffer.from(r)}return r}get position(){return this._position}async read(r,i={}){var a;if((a=i.abortSignal)===null||a===void 0?void 0:a.aborted){throw Go}if(r<0){throw new Error(`size parameter should be positive: ${r}`)}if(r===0){return new Uint8Array}if(!this._readable.readable){throw new Error("Stream no longer readable.")}const s=this._readable.read(r);if(s){this._position+=s.length;return this.toUint8Array(s)}else{return new Promise(((a,s)=>{const cleanUp=()=>{this._readable.removeListener("readable",readableCallback);this._readable.removeListener("error",rejectCallback);this._readable.removeListener("end",rejectCallback);this._readable.removeListener("close",rejectCallback);if(i.abortSignal){i.abortSignal.removeEventListener("abort",abortHandler)}};const readableCallback=()=>{const i=this._readable.read(r);if(i){this._position+=i.length;cleanUp();a(this.toUint8Array(i))}};const rejectCallback=()=>{cleanUp();s()};const abortHandler=()=>{cleanUp();s(Go)};this._readable.on("readable",readableCallback);this._readable.once("error",rejectCallback);this._readable.once("end",rejectCallback);this._readable.once("close",rejectCallback);if(i.abortSignal){i.abortSignal.addEventListener("abort",abortHandler)}}))}}}class BlobQuickQueryStream extends h.Readable{constructor(r,i={}){super();this.avroPaused=true;this.source=r;this.onProgress=i.onProgress;this.onError=i.onError;this.avroReader=new AvroReader(new AvroReadableFromStream(this.source));this.avroIter=this.avroReader.parseObjects({abortSignal:i.abortSignal})}_read(){if(this.avroPaused){this.readInternal().catch((r=>{this.emit("error",r)}))}}async readInternal(){this.avroPaused=false;let r;do{r=await this.avroIter.next();if(r.done){break}const i=r.value;const a=i.$schema;if(typeof a!=="string"){throw Error("Missing schema in avro record.")}switch(a){case"com.microsoft.azure.storage.queryBlobContents.resultData":{const r=i.data;if(r instanceof Uint8Array===false){throw Error("Invalid data in avro result record.")}if(!this.push(Buffer.from(r))){this.avroPaused=true}}break;case"com.microsoft.azure.storage.queryBlobContents.progress":{const r=i.bytesScanned;if(typeof r!=="number"){throw Error("Invalid bytesScanned in avro progress record.")}if(this.onProgress){this.onProgress({loadedBytes:r})}}break;case"com.microsoft.azure.storage.queryBlobContents.end":if(this.onProgress){const r=i.totalBytes;if(typeof r!=="number"){throw Error("Invalid totalBytes in avro end record.")}this.onProgress({loadedBytes:r})}this.push(null);break;case"com.microsoft.azure.storage.queryBlobContents.error":if(this.onError){const r=i.fatal;if(typeof r!=="boolean"){throw Error("Invalid fatal in avro error record.")}const a=i.name;if(typeof a!=="string"){throw Error("Invalid name in avro error record.")}const s=i.description;if(typeof s!=="string"){throw Error("Invalid description in avro error record.")}const l=i.position;if(typeof l!=="number"){throw Error("Invalid position in avro error record.")}this.onError({position:l,name:a,isFatal:r,description:s})}break;default:throw Error(`Unknown schema ${a} in avro progress record.`)}}while(!r.done&&!this.avroPaused)}}class BlobQueryResponse{constructor(r,i={}){this.originalResponse=r;this.blobDownloadStream=new BlobQuickQueryStream(this.originalResponse.readableStreamBody,i)}get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return undefined}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get blobBody(){return undefined}get readableStreamBody(){return s.isNode?this.blobDownloadStream:undefined}get _response(){return this.originalResponse._response}}i.BlockBlobTier=void 0;(function(r){r["Hot"]="Hot";r["Cool"]="Cool";r["Cold"]="Cold";r["Archive"]="Archive"})(i.BlockBlobTier||(i.BlockBlobTier={}));i.PremiumPageBlobTier=void 0;(function(r){r["P4"]="P4";r["P6"]="P6";r["P10"]="P10";r["P15"]="P15";r["P20"]="P20";r["P30"]="P30";r["P40"]="P40";r["P50"]="P50";r["P60"]="P60";r["P70"]="P70";r["P80"]="P80"})(i.PremiumPageBlobTier||(i.PremiumPageBlobTier={}));function toAccessTier(r){if(r===undefined){return undefined}return r}function ensureCpkIfSpecified(r,i){if(r&&!i){throw new RangeError("Customer-provided encryption key must be used over HTTPS.")}if(r&&!r.encryptionAlgorithm){r.encryptionAlgorithm=Bo}}i.StorageBlobAudience=void 0;(function(r){r["StorageOAuthScopes"]="https://storage.azure.com/.default";r["DiskComputeOAuthScopes"]="https://disk.compute.azure.com/.default"})(i.StorageBlobAudience||(i.StorageBlobAudience={}));function getBlobServiceAccountAudience(r){return`https://${r}.blob.core.windows.net/.default`}function rangeResponseFromModel(r){const i=(r._response.parsedBody.pageRange||[]).map((r=>({offset:r.start,count:r.end-r.start})));const a=(r._response.parsedBody.clearRange||[]).map((r=>({offset:r.start,count:r.end-r.start})));return Object.assign(Object.assign({},r),{pageRange:i,clearRange:a,_response:Object.assign(Object.assign({},r._response),{parsedBody:{pageRange:i,clearRange:a}})})}class BlobBeginCopyFromUrlPoller extends g.Poller{constructor(r){const{blobClient:i,copySource:a,intervalInMs:s=15e3,onProgress:l,resumeFrom:c,startCopyFromURLOptions:p}=r;let d;if(c){d=JSON.parse(c).state}const u=makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({},d),{blobClient:i,copySource:a,startCopyFromURLOptions:p}));super(u);if(typeof l==="function"){this.onProgress(l)}this.intervalInMs=s}delay(){return s.delay(this.intervalInMs)}}const zo=async function cancel(r={}){const i=this.state;const{copyId:a}=i;if(i.isCompleted){return makeBlobBeginCopyFromURLPollOperation(i)}if(!a){i.isCancelled=true;return makeBlobBeginCopyFromURLPollOperation(i)}await i.blobClient.abortCopyFromURL(a,{abortSignal:r.abortSignal});i.isCancelled=true;return makeBlobBeginCopyFromURLPollOperation(i)};const Vo=async function update(r={}){const i=this.state;const{blobClient:a,copySource:s,startCopyFromURLOptions:l}=i;if(!i.isStarted){i.isStarted=true;const r=await a.startCopyFromURL(s,l);i.copyId=r.copyId;if(r.copyStatus==="success"){i.result=r;i.isCompleted=true}}else if(!i.isCompleted){try{const a=await i.blobClient.getProperties({abortSignal:r.abortSignal});const{copyStatus:s,copyProgress:l}=a;const c=i.copyProgress;if(l){i.copyProgress=l}if(s==="pending"&&l!==c&&typeof r.fireProgress==="function"){r.fireProgress(i)}else if(s==="success"){i.result=a;i.isCompleted=true}else if(s==="failed"){i.error=new Error(`Blob copy failed with reason: "${a.copyStatusDescription||"unknown"}"`);i.isCompleted=true}}catch(r){i.error=r;i.isCompleted=true}}return makeBlobBeginCopyFromURLPollOperation(i)};const Jo=function toString(){return JSON.stringify({state:this.state},((r,i)=>{if(r==="blobClient"){return undefined}return i}))};function makeBlobBeginCopyFromURLPollOperation(r){return{state:Object.assign({},r),cancel:zo,toString:Jo,update:Vo}}function rangeToString(r){if(r.offset<0){throw new RangeError(`Range.offset cannot be smaller than 0.`)}if(r.count&&r.count<=0){throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`)}return r.count?`bytes=${r.offset}-${r.offset+r.count-1}`:`bytes=${r.offset}-`}var Yo;(function(r){r[r["Good"]=0]="Good";r[r["Error"]=1]="Error"})(Yo||(Yo={}));class Batch{constructor(r=5){this.actives=0;this.completed=0;this.offset=0;this.operations=[];this.state=Yo.Good;if(r<1){throw new RangeError("concurrency must be larger than 0")}this.concurrency=r;this.emitter=new y.EventEmitter}addOperation(r){this.operations.push((async()=>{try{this.actives++;await r();this.actives--;this.completed++;this.parallelExecute()}catch(r){this.emitter.emit("error",r)}}))}async do(){if(this.operations.length===0){return Promise.resolve()}this.parallelExecute();return new Promise(((r,i)=>{this.emitter.on("finish",r);this.emitter.on("error",(r=>{this.state=Yo.Error;i(r)}))}))}nextOperation(){if(this.offset=this.operations.length){this.emitter.emit("finish");return}while(this.actives=this.byteLength){this.push(null)}if(!r){r=this.readableHighWaterMark}const i=[];let a=0;while(ar-a){const s=this.byteOffsetInCurrentBuffer+r-a;i.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,s));this.pushedBytesLength+=r-a;this.byteOffsetInCurrentBuffer=s;a=r;break}else{const r=this.byteOffsetInCurrentBuffer+c;i.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,r));if(c===l){this.byteOffsetInCurrentBuffer=0;this.bufferIndex++}else{this.byteOffsetInCurrentBuffer=r}this.pushedBytesLength+=c;a+=c}}if(i.length>1){this.push(Buffer.concat(i))}else if(i.length===1){this.push(i[0])}}}const Wo=a(14300).constants.MAX_LENGTH;class PooledBuffer{constructor(r,i,a){this.buffers=[];this.capacity=r;this._size=0;const s=Math.ceil(r/Wo);for(let i=0;i0){r[0]=r[0].slice(c)}}getReadableStream(){return new BuffersStream(this.buffers,this.size)}}class BufferScheduler{constructor(r,i,a,s,l,c){this.emitter=new y.EventEmitter;this.offset=0;this.isStreamEnd=false;this.isError=false;this.executingOutgoingHandlers=0;this.numBuffers=0;this.unresolvedDataArray=[];this.unresolvedLength=0;this.incoming=[];this.outgoing=[];if(i<=0){throw new RangeError(`bufferSize must be larger than 0, current is ${i}`)}if(a<=0){throw new RangeError(`maxBuffers must be larger than 0, current is ${a}`)}if(l<=0){throw new RangeError(`concurrency must be larger than 0, current is ${l}`)}this.bufferSize=i;this.maxBuffers=a;this.readable=r;this.outgoingHandler=s;this.concurrency=l;this.encoding=c}async do(){return new Promise(((r,i)=>{this.readable.on("data",(r=>{r=typeof r==="string"?Buffer.from(r,this.encoding):r;this.appendUnresolvedData(r);if(!this.resolveData()){this.readable.pause()}}));this.readable.on("error",(r=>{this.emitter.emit("error",r)}));this.readable.on("end",(()=>{this.isStreamEnd=true;this.emitter.emit("checkEnd")}));this.emitter.on("error",(r=>{this.isError=true;this.readable.pause();i(r)}));this.emitter.on("checkEnd",(()=>{if(this.outgoing.length>0){this.triggerOutgoingHandlers();return}if(this.isStreamEnd&&this.executingOutgoingHandlers===0){if(this.unresolvedLength>0&&this.unresolvedLengtha.getReadableStream()),a.size,this.offset).then(r).catch(i)}else if(this.unresolvedLength>=this.bufferSize){return}else{r()}}}))}))}appendUnresolvedData(r){this.unresolvedDataArray.push(r);this.unresolvedLength+=r.length}shiftBufferFromUnresolvedDataArray(r){if(!r){r=new PooledBuffer(this.bufferSize,this.unresolvedDataArray,this.unresolvedLength)}else{r.fill(this.unresolvedDataArray,this.unresolvedLength)}this.unresolvedLength-=r.size;return r}resolveData(){while(this.unresolvedLength>=this.bufferSize){let r;if(this.incoming.length>0){r=this.incoming.shift();this.shiftBufferFromUnresolvedDataArray(r)}else{if(this.numBuffers=this.concurrency){return}r=this.outgoing.shift();if(r){this.triggerOutgoingHandler(r)}}while(r)}async triggerOutgoingHandler(r){const i=r.size;this.executingOutgoingHandlers++;this.offset+=i;try{await this.outgoingHandler((()=>r.getReadableStream()),i,this.offset-i)}catch(r){this.emitter.emit("error",r);return}this.executingOutgoingHandlers--;this.reuseBuffer(r);this.emitter.emit("checkEnd")}reuseBuffer(r){this.incoming.push(r);if(!this.isError&&this.resolveData()&&!this.isStreamEnd){this.readable.resume()}}}async function streamToBuffer(r,i,a,s,l){let c=0;const p=s-a;return new Promise(((s,d)=>{const u=setTimeout((()=>d(new Error(`The operation cannot be completed in timeout.`))),po);r.on("readable",(()=>{if(c>=p){clearTimeout(u);s();return}let d=r.read();if(!d){return}if(typeof d==="string"){d=Buffer.from(d,l)}const A=c+d.length>p?p-c:d.length;i.fill(d.slice(0,A),a+c,a+c+A);c+=A}));r.on("end",(()=>{clearTimeout(u);if(c{clearTimeout(u);d(r)}))}))}async function streamToBuffer2(r,i,a){let s=0;const l=i.length;return new Promise(((c,p)=>{r.on("readable",(()=>{let c=r.read();if(!c){return}if(typeof c==="string"){c=Buffer.from(c,a)}if(s+c.length>l){p(new Error(`Stream exceeds buffer size. Buffer size: ${l}`));return}i.fill(c,s,s+c.length);s+=c.length}));r.on("end",(()=>{c(s)}));r.on("error",p)}))}async function readStreamToLocalFile(r,i){return new Promise(((a,s)=>{const l=B.createWriteStream(i);r.on("error",(r=>{s(r)}));l.on("error",(r=>{s(r)}));l.on("close",a);r.pipe(l)}))}const Xo=I.promisify(B.stat);const Ko=B.createReadStream;class BlobClient extends StorageClient{constructor(r,i,a,l){l=l||{};let c;let p;if(isPipelineLike(i)){p=r;c=i}else if(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i)){p=r;l=a;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){p=r;if(a&&typeof a!=="string"){l=a}c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&a&&typeof a==="string"){const d=i;const u=a;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(s.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=s.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(p,c);({blobName:this._name,containerName:this._containerName}=this.getBlobAndContainerNamesFromUrl());this.blobContext=new Blob$1(this.storageClientContext);this._snapshot=getURLParameter(this.url,Ao.Parameters.SNAPSHOT);this._versionId=getURLParameter(this.url,Ao.Parameters.VERSIONID)}get name(){return this._name}get containerName(){return this._containerName}withSnapshot(r){return new BlobClient(setURLParameter(this.url,Ao.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}withVersion(r){return new BlobClient(setURLParameter(this.url,Ao.Parameters.VERSIONID,r.length===0?undefined:r),this.pipeline)}getAppendBlobClient(){return new AppendBlobClient(this.url,this.pipeline)}getBlockBlobClient(){return new BlockBlobClient(this.url,this.pipeline)}getPageBlobClient(){return new PageBlobClient(this.url,this.pipeline)}async download(r=0,i,a={}){var l;a.conditions=a.conditions||{};a.conditions=a.conditions||{};ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);const{span:p,updatedOptions:d}=Lo("BlobClient-download",a);try{const c=await this.blobContext.download(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(l=a.conditions)===null||l===void 0?void 0:l.tagConditions}),requestOptions:{onDownloadProgress:s.isNode?undefined:a.onProgress},range:r===0&&!i?undefined:rangeToString({offset:r,count:i}),rangeGetContentMD5:a.rangeGetContentMD5,rangeGetContentCRC64:a.rangeGetContentCrc64,snapshot:a.snapshot,cpkInfo:a.customerProvidedKey},convertTracingToRequestOptionsBase(d)));const p=Object.assign(Object.assign({},c),{_response:c._response,objectReplicationDestinationPolicyId:c.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(c.objectReplicationRules)});if(!s.isNode){return p}if(a.maxRetryRequests===undefined||a.maxRetryRequests<0){a.maxRetryRequests=co}if(c.contentLength===undefined){throw new RangeError(`File download response doesn't contain valid content length header`)}if(!c.etag){throw new RangeError(`File download response doesn't contain valid etag header`)}return new BlobDownloadResponse(p,(async i=>{var s;const l={leaseAccessConditions:a.conditions,modifiedAccessConditions:{ifMatch:a.conditions.ifMatch||c.etag,ifModifiedSince:a.conditions.ifModifiedSince,ifNoneMatch:a.conditions.ifNoneMatch,ifUnmodifiedSince:a.conditions.ifUnmodifiedSince,ifTags:(s=a.conditions)===null||s===void 0?void 0:s.tagConditions},range:rangeToString({count:r+c.contentLength-i,offset:i}),rangeGetContentMD5:a.rangeGetContentMD5,rangeGetContentCRC64:a.rangeGetContentCrc64,snapshot:a.snapshot,cpkInfo:a.customerProvidedKey};return(await this.blobContext.download(Object.assign({abortSignal:a.abortSignal},l))).readableStreamBody}),r,c.contentLength,{maxRetryRequests:a.maxRetryRequests,onProgress:a.onProgress})}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async exists(r={}){const{span:i,updatedOptions:a}=Lo("BlobClient-exists",r);try{ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);await this.getProperties({abortSignal:r.abortSignal,customerProvidedKey:r.customerProvidedKey,conditions:r.conditions,tracingOptions:a.tracingOptions});return true}catch(r){if(r.statusCode===404){return false}else if(r.statusCode===409&&(r.details.errorCode===Qo||r.details.errorCode===xo)){return true}i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async getProperties(r={}){var i;const{span:a,updatedOptions:s}=Lo("BlobClient-getProperties",r);try{r.conditions=r.conditions||{};ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);const a=await this.blobContext.getProperties(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions}),cpkInfo:r.customerProvidedKey},convertTracingToRequestOptionsBase(s)));return Object.assign(Object.assign({},a),{_response:a._response,objectReplicationDestinationPolicyId:a.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(a.objectReplicationRules)})}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async delete(r={}){var i;const{span:a,updatedOptions:s}=Lo("BlobClient-delete",r);r.conditions=r.conditions||{};try{return await this.blobContext.delete(Object.assign({abortSignal:r.abortSignal,deleteSnapshots:r.deleteSnapshots,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions})},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async deleteIfExists(r={}){var i,a;const{span:s,updatedOptions:l}=Lo("BlobClient-deleteIfExists",r);try{const r=await this.delete(l);return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="BlobNotFound"){s.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when deleting a blob or snapshot only if it exists."});return Object.assign(Object.assign({succeeded:false},(a=r.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:r.response})}s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async undelete(r={}){const{span:i,updatedOptions:a}=Lo("BlobClient-undelete",r);try{return await this.blobContext.undelete(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setHTTPHeaders(r,i={}){var a;const{span:s,updatedOptions:l}=Lo("BlobClient-setHTTPHeaders",i);i.conditions=i.conditions||{};try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blobContext.setHttpHeaders(Object.assign({abortSignal:i.abortSignal,blobHttpHeaders:r,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(l)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async setMetadata(r,i={}){var a;const{span:s,updatedOptions:l}=Lo("BlobClient-setMetadata",i);i.conditions=i.conditions||{};try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blobContext.setMetadata(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,metadata:r,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope},convertTracingToRequestOptionsBase(l)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async setTags(r,i={}){var a;const{span:s,updatedOptions:l}=Lo("BlobClient-setTags",i);try{return await this.blobContext.setTags(Object.assign(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(l)),{tags:toBlobTags(r)}))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async getTags(r={}){var i;const{span:a,updatedOptions:s}=Lo("BlobClient-getTags",r);try{const a=await this.blobContext.getTags(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions})},convertTracingToRequestOptionsBase(s)));const l=Object.assign(Object.assign({},a),{_response:a._response,tags:toTags({blobTagSet:a.blobTagSet})||{}});return l}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}getBlobLeaseClient(r){return new BlobLeaseClient(this,r)}async createSnapshot(r={}){var i;const{span:a,updatedOptions:s}=Lo("BlobClient-createSnapshot",r);r.conditions=r.conditions||{};try{ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return await this.blobContext.createSnapshot(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions}),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async beginCopyFromURL(r,i={}){const a={abortCopyFromURL:(...r)=>this.abortCopyFromURL(...r),getProperties:(...r)=>this.getProperties(...r),startCopyFromURL:(...r)=>this.startCopyFromURL(...r)};const s=new BlobBeginCopyFromUrlPoller({blobClient:a,copySource:r,intervalInMs:i.intervalInMs,onProgress:i.onProgress,resumeFrom:i.resumeFrom,startCopyFromURLOptions:i});await s.poll();return s}async abortCopyFromURL(r,i={}){const{span:a,updatedOptions:s}=Lo("BlobClient-abortCopyFromURL",i);try{return await this.blobContext.abortCopyFromURL(r,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async syncCopyFromURL(r,i={}){var a,s,l;const{span:p,updatedOptions:d}=Lo("BlobClient-syncCopyFromURL",i);i.conditions=i.conditions||{};i.sourceConditions=i.sourceConditions||{};try{return await this.blobContext.copyFromURL(r,Object.assign({abortSignal:i.abortSignal,metadata:i.metadata,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:i.sourceConditions.ifMatch,sourceIfModifiedSince:i.sourceConditions.ifModifiedSince,sourceIfNoneMatch:i.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:i.sourceConditions.ifUnmodifiedSince},sourceContentMD5:i.sourceContentMD5,copySourceAuthorization:httpAuthorizationToString(i.sourceAuthorization),tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags),immutabilityPolicyExpiry:(s=i.immutabilityPolicy)===null||s===void 0?void 0:s.expiriesOn,immutabilityPolicyMode:(l=i.immutabilityPolicy)===null||l===void 0?void 0:l.policyMode,legalHold:i.legalHold,encryptionScope:i.encryptionScope,copySourceTags:i.copySourceTags},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async setAccessTier(r,i={}){var a;const{span:s,updatedOptions:l}=Lo("BlobClient-setAccessTier",i);try{return await this.blobContext.setTier(toAccessTier(r),Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),rehydratePriority:i.rehydratePriority},convertTracingToRequestOptionsBase(l)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async downloadToBuffer(r,i,a,s={}){let l;let p=0;let d=0;let u=s;if(r instanceof Buffer){l=r;p=i||0;d=typeof a==="number"?a:0}else{p=typeof r==="number"?r:0;d=typeof i==="number"?i:0;u=a||{}}const{span:A,updatedOptions:h}=Lo("BlobClient-downloadToBuffer",u);try{if(!u.blockSize){u.blockSize=0}if(u.blockSize<0){throw new RangeError("blockSize option must be >= 0")}if(u.blockSize===0){u.blockSize=lo}if(p<0){throw new RangeError("offset option must be >= 0")}if(d&&d<=0){throw new RangeError("count option must be greater than 0")}if(!u.conditions){u.conditions={}}if(!d){const r=await this.getProperties(Object.assign(Object.assign({},u),{tracingOptions:Object.assign(Object.assign({},u.tracingOptions),convertTracingToRequestOptionsBase(h))}));d=r.contentLength-p;if(d<0){throw new RangeError(`offset ${p} shouldn't be larger than blob size ${r.contentLength}`)}}if(!l){try{l=Buffer.alloc(d)}catch(r){throw new Error(`Unable to allocate the buffer of size: ${d}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${r.message}`)}}if(l.length{let i=p+d;if(a+u.blockSize{if(!(this.credential instanceof StorageSharedKeyCredential)){throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential")}const a=generateBlobSASQueryParameters(Object.assign({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId},r),this.credential).toString();i(appendToURLQuery(this.url,a))}))}async deleteImmutabilityPolicy(r){const{span:i,updatedOptions:a}=Lo("BlobClient-deleteImmutabilityPolicy",r);try{return await this.blobContext.deleteImmutabilityPolicy(Object.assign({abortSignal:r===null||r===void 0?void 0:r.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setImmutabilityPolicy(r,i){const{span:a,updatedOptions:s}=Lo("BlobClient-setImmutabilityPolicy",i);try{return await this.blobContext.setImmutabilityPolicy(Object.assign({abortSignal:i===null||i===void 0?void 0:i.abortSignal,immutabilityPolicyExpiry:r.expiriesOn,immutabilityPolicyMode:r.policyMode,modifiedAccessConditions:i===null||i===void 0?void 0:i.modifiedAccessCondition},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async setLegalHold(r,i){const{span:a,updatedOptions:s}=Lo("BlobClient-setLegalHold",i);try{return await this.blobContext.setLegalHold(r,Object.assign({abortSignal:i===null||i===void 0?void 0:i.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}}class AppendBlobClient extends BlobClient{constructor(r,i,a,l){let c;let p;l=l||{};if(isPipelineLike(i)){p=r;c=i}else if(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i)){p=r;l=a;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){p=r;c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&a&&typeof a==="string"){const d=i;const u=a;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(s.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=s.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(p,c);this.appendBlobContext=new AppendBlob(this.storageClientContext)}withSnapshot(r){return new AppendBlobClient(setURLParameter(this.url,Ao.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}async create(r={}){var i,a,s;const{span:l,updatedOptions:p}=Lo("AppendBlobClient-create",r);r.conditions=r.conditions||{};try{ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return await this.appendBlobContext.create(0,Object.assign({abortSignal:r.abortSignal,blobHttpHeaders:r.blobHTTPHeaders,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions}),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,immutabilityPolicyExpiry:(a=r.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(s=r.immutabilityPolicy)===null||s===void 0?void 0:s.policyMode,legalHold:r.legalHold,blobTagsString:toBlobTagsString(r.tags)},convertTracingToRequestOptionsBase(p)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async createIfNotExists(r={}){var i,a;const{span:s,updatedOptions:l}=Lo("AppendBlobClient-createIfNotExists",r);const p={ifNoneMatch:go};try{const r=await this.create(Object.assign(Object.assign({},l),{conditions:p}));return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="BlobAlreadyExists"){s.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return Object.assign(Object.assign({succeeded:false},(a=r.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:r.response})}s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async seal(r={}){var i;const{span:a,updatedOptions:s}=Lo("AppendBlobClient-seal",r);r.conditions=r.conditions||{};try{return await this.appendBlobContext.seal(Object.assign({abortSignal:r.abortSignal,appendPositionAccessConditions:r.conditions,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions})},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async appendBlock(r,i,a={}){var s;const{span:l,updatedOptions:p}=Lo("AppendBlobClient-appendBlock",a);a.conditions=a.conditions||{};try{ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return await this.appendBlobContext.appendBlock(i,r,Object.assign({abortSignal:a.abortSignal,appendPositionAccessConditions:a.conditions,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(s=a.conditions)===null||s===void 0?void 0:s.tagConditions}),requestOptions:{onUploadProgress:a.onProgress},transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(p)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async appendBlockFromURL(r,i,a,s={}){var l;const{span:p,updatedOptions:d}=Lo("AppendBlobClient-appendBlockFromURL",s);s.conditions=s.conditions||{};s.sourceConditions=s.sourceConditions||{};try{ensureCpkIfSpecified(s.customerProvidedKey,this.isHttps);return await this.appendBlobContext.appendBlockFromUrl(r,0,Object.assign({abortSignal:s.abortSignal,sourceRange:rangeToString({offset:i,count:a}),sourceContentMD5:s.sourceContentMD5,sourceContentCrc64:s.sourceContentCrc64,leaseAccessConditions:s.conditions,appendPositionAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(l=s.conditions)===null||l===void 0?void 0:l.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:s.sourceConditions.ifMatch,sourceIfModifiedSince:s.sourceConditions.ifModifiedSince,sourceIfNoneMatch:s.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:s.sourceConditions.ifUnmodifiedSince},copySourceAuthorization:httpAuthorizationToString(s.sourceAuthorization),cpkInfo:s.customerProvidedKey,encryptionScope:s.encryptionScope},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}}class BlockBlobClient extends BlobClient{constructor(r,i,a,l){let c;let p;l=l||{};if(isPipelineLike(i)){p=r;c=i}else if(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i)){p=r;l=a;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){p=r;if(a&&typeof a!=="string"){l=a}c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&a&&typeof a==="string"){const d=i;const u=a;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(s.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=s.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(p,c);this.blockBlobContext=new BlockBlob(this.storageClientContext);this._blobContext=new Blob$1(this.storageClientContext)}withSnapshot(r){return new BlockBlobClient(setURLParameter(this.url,Ao.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}async query(r,i={}){var a;ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);const{span:l,updatedOptions:p}=Lo("BlockBlobClient-query",i);try{if(!s.isNode){throw new Error("This operation currently is only supported in Node.js.")}ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);const l=await this._blobContext.query(Object.assign({abortSignal:i.abortSignal,queryRequest:{queryType:"SQL",expression:r,inputSerialization:toQuerySerialization(i.inputTextConfiguration),outputSerialization:toQuerySerialization(i.outputTextConfiguration)},leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),cpkInfo:i.customerProvidedKey},convertTracingToRequestOptionsBase(p)));return new BlobQueryResponse(l,{abortSignal:i.abortSignal,onProgress:i.onProgress,onError:i.onError})}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async upload(r,i,a={}){var s,l,p;a.conditions=a.conditions||{};const{span:d,updatedOptions:u}=Lo("BlockBlobClient-upload",a);try{ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return await this.blockBlobContext.upload(i,r,Object.assign({abortSignal:a.abortSignal,blobHttpHeaders:a.blobHTTPHeaders,leaseAccessConditions:a.conditions,metadata:a.metadata,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(s=a.conditions)===null||s===void 0?void 0:s.tagConditions}),requestOptions:{onUploadProgress:a.onProgress},cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope,immutabilityPolicyExpiry:(l=a.immutabilityPolicy)===null||l===void 0?void 0:l.expiriesOn,immutabilityPolicyMode:(p=a.immutabilityPolicy)===null||p===void 0?void 0:p.policyMode,legalHold:a.legalHold,tier:toAccessTier(a.tier),blobTagsString:toBlobTagsString(a.tags)},convertTracingToRequestOptionsBase(u)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async syncUploadFromURL(r,i={}){var a,s,l,p,d;i.conditions=i.conditions||{};const{span:u,updatedOptions:A}=Lo("BlockBlobClient-syncUploadFromURL",i);try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blockBlobContext.putBlobFromUrl(0,r,Object.assign(Object.assign(Object.assign({},i),{blobHttpHeaders:i.blobHTTPHeaders,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:i.conditions.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:(a=i.sourceConditions)===null||a===void 0?void 0:a.ifMatch,sourceIfModifiedSince:(s=i.sourceConditions)===null||s===void 0?void 0:s.ifModifiedSince,sourceIfNoneMatch:(l=i.sourceConditions)===null||l===void 0?void 0:l.ifNoneMatch,sourceIfUnmodifiedSince:(p=i.sourceConditions)===null||p===void 0?void 0:p.ifUnmodifiedSince,sourceIfTags:(d=i.sourceConditions)===null||d===void 0?void 0:d.tagConditions},cpkInfo:i.customerProvidedKey,copySourceAuthorization:httpAuthorizationToString(i.sourceAuthorization),tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags),copySourceTags:i.copySourceTags}),convertTracingToRequestOptionsBase(A)))}catch(r){u.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{u.end()}}async stageBlock(r,i,a,s={}){const{span:l,updatedOptions:p}=Lo("BlockBlobClient-stageBlock",s);try{ensureCpkIfSpecified(s.customerProvidedKey,this.isHttps);return await this.blockBlobContext.stageBlock(r,a,i,Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,requestOptions:{onUploadProgress:s.onProgress},transactionalContentMD5:s.transactionalContentMD5,transactionalContentCrc64:s.transactionalContentCrc64,cpkInfo:s.customerProvidedKey,encryptionScope:s.encryptionScope},convertTracingToRequestOptionsBase(p)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async stageBlockFromURL(r,i,a=0,s,l={}){const{span:p,updatedOptions:d}=Lo("BlockBlobClient-stageBlockFromURL",l);try{ensureCpkIfSpecified(l.customerProvidedKey,this.isHttps);return await this.blockBlobContext.stageBlockFromURL(r,0,i,Object.assign({abortSignal:l.abortSignal,leaseAccessConditions:l.conditions,sourceContentMD5:l.sourceContentMD5,sourceContentCrc64:l.sourceContentCrc64,sourceRange:a===0&&!s?undefined:rangeToString({offset:a,count:s}),cpkInfo:l.customerProvidedKey,encryptionScope:l.encryptionScope,copySourceAuthorization:httpAuthorizationToString(l.sourceAuthorization)},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async commitBlockList(r,i={}){var a,s,l;i.conditions=i.conditions||{};const{span:p,updatedOptions:d}=Lo("BlockBlobClient-commitBlockList",i);try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blockBlobContext.commitBlockList({latest:r},Object.assign({abortSignal:i.abortSignal,blobHttpHeaders:i.blobHTTPHeaders,leaseAccessConditions:i.conditions,metadata:i.metadata,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,immutabilityPolicyExpiry:(s=i.immutabilityPolicy)===null||s===void 0?void 0:s.expiriesOn,immutabilityPolicyMode:(l=i.immutabilityPolicy)===null||l===void 0?void 0:l.policyMode,legalHold:i.legalHold,tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags)},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async getBlockList(r,i={}){var a;const{span:s,updatedOptions:l}=Lo("BlockBlobClient-getBlockList",i);try{const s=await this.blockBlobContext.getBlockList(r,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(l)));if(!s.committedBlocks){s.committedBlocks=[]}if(!s.uncommittedBlocks){s.uncommittedBlocks=[]}return s}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async uploadData(r,i={}){const{span:a,updatedOptions:l}=Lo("BlockBlobClient-uploadData",i);try{if(s.isNode){let i;if(r instanceof Buffer){i=r}else if(r instanceof ArrayBuffer){i=Buffer.from(r)}else{r=r;i=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}return this.uploadSeekableInternal(((r,a)=>i.slice(r,r+a)),i.byteLength,l)}else{const i=new Blob([r]);return this.uploadSeekableInternal(((r,a)=>i.slice(r,r+a)),i.size,l)}}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async uploadBrowserData(r,i={}){const{span:a,updatedOptions:s}=Lo("BlockBlobClient-uploadBrowserData",i);try{const i=new Blob([r]);return await this.uploadSeekableInternal(((r,a)=>i.slice(r,r+a)),i.size,s)}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async uploadSeekableInternal(r,i,a={}){if(!a.blockSize){a.blockSize=0}if(a.blockSize<0||a.blockSize>ao){throw new RangeError(`blockSize option must be >= 0 and <= ${ao}`)}if(a.maxSingleShotSize!==0&&!a.maxSingleShotSize){a.maxSingleShotSize=no}if(a.maxSingleShotSize<0||a.maxSingleShotSize>no){throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${no}`)}if(a.blockSize===0){if(i>ao*so){throw new RangeError(`${i} is too larger to upload to a block blob.`)}if(i>a.maxSingleShotSize){a.blockSize=Math.ceil(i/so);if(a.blockSizeso){throw new RangeError(`The buffer's size is too big or the BlockSize is too small;`+`the number of blocks must be <= ${so}`)}const c=[];const d=s.generateUuid();let u=0;const A=new Batch(a.concurrency);for(let s=0;s{const A=generateBlockID(d,s);const h=a.blockSize*s;const g=s===l-1?i:h+a.blockSize;const y=g-h;c.push(A);await this.stageBlock(A,r(h,y),y,{abortSignal:a.abortSignal,conditions:a.conditions,encryptionScope:a.encryptionScope,tracingOptions:p.tracingOptions});u+=y;if(a.onProgress){a.onProgress({loadedBytes:u})}}))}await A.do();return this.commitBlockList(c,p)}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async uploadFile(r,i={}){const{span:a,updatedOptions:s}=Lo("BlockBlobClient-uploadFile",i);try{const a=(await Xo(r)).size;return await this.uploadSeekableInternal(((i,a)=>()=>Ko(r,{autoClose:true,end:a?i+a-1:Infinity,start:i})),a,Object.assign(Object.assign({},i),{tracingOptions:Object.assign(Object.assign({},i.tracingOptions),convertTracingToRequestOptionsBase(s))}))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async uploadStream(r,i=oo,a=5,l={}){if(!l.blobHTTPHeaders){l.blobHTTPHeaders={}}if(!l.conditions){l.conditions={}}const{span:p,updatedOptions:d}=Lo("BlockBlobClient-uploadStream",l);try{let c=0;const p=s.generateUuid();let u=0;const A=[];const h=new BufferScheduler(r,i,a,(async(r,i)=>{const a=generateBlockID(p,c);A.push(a);c++;await this.stageBlock(a,r,i,{conditions:l.conditions,encryptionScope:l.encryptionScope,tracingOptions:d.tracingOptions});u+=i;if(l.onProgress){l.onProgress({loadedBytes:u})}}),Math.ceil(a/4*3));await h.do();return await this.commitBlockList(A,Object.assign(Object.assign({},l),{tracingOptions:Object.assign(Object.assign({},l.tracingOptions),convertTracingToRequestOptionsBase(d))}))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}}class PageBlobClient extends BlobClient{constructor(r,i,a,l){let c;let p;l=l||{};if(isPipelineLike(i)){p=r;c=i}else if(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i)){p=r;l=a;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){p=r;c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&a&&typeof a==="string"){const d=i;const u=a;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(s.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=s.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){p=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(d)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(p,c);this.pageBlobContext=new PageBlob(this.storageClientContext)}withSnapshot(r){return new PageBlobClient(setURLParameter(this.url,Ao.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}async create(r,i={}){var a,s,l;i.conditions=i.conditions||{};const{span:p,updatedOptions:d}=Lo("PageBlobClient-create",i);try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.pageBlobContext.create(0,r,Object.assign({abortSignal:i.abortSignal,blobHttpHeaders:i.blobHTTPHeaders,blobSequenceNumber:i.blobSequenceNumber,leaseAccessConditions:i.conditions,metadata:i.metadata,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,immutabilityPolicyExpiry:(s=i.immutabilityPolicy)===null||s===void 0?void 0:s.expiriesOn,immutabilityPolicyMode:(l=i.immutabilityPolicy)===null||l===void 0?void 0:l.policyMode,legalHold:i.legalHold,tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags)},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async createIfNotExists(r,i={}){var a,s;const{span:l,updatedOptions:p}=Lo("PageBlobClient-createIfNotExists",i);try{const a={ifNoneMatch:go};const s=await this.create(r,Object.assign(Object.assign({},i),{conditions:a,tracingOptions:p.tracingOptions}));return Object.assign(Object.assign({succeeded:true},s),{_response:s._response})}catch(r){if(((a=r.details)===null||a===void 0?void 0:a.errorCode)==="BlobAlreadyExists"){l.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return Object.assign(Object.assign({succeeded:false},(s=r.response)===null||s===void 0?void 0:s.parsedHeaders),{_response:r.response})}l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async uploadPages(r,i,a,s={}){var l;s.conditions=s.conditions||{};const{span:p,updatedOptions:d}=Lo("PageBlobClient-uploadPages",s);try{ensureCpkIfSpecified(s.customerProvidedKey,this.isHttps);return await this.pageBlobContext.uploadPages(a,r,Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(l=s.conditions)===null||l===void 0?void 0:l.tagConditions}),requestOptions:{onUploadProgress:s.onProgress},range:rangeToString({offset:i,count:a}),sequenceNumberAccessConditions:s.conditions,transactionalContentMD5:s.transactionalContentMD5,transactionalContentCrc64:s.transactionalContentCrc64,cpkInfo:s.customerProvidedKey,encryptionScope:s.encryptionScope},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async uploadPagesFromURL(r,i,a,s,l={}){var p;l.conditions=l.conditions||{};l.sourceConditions=l.sourceConditions||{};const{span:d,updatedOptions:u}=Lo("PageBlobClient-uploadPagesFromURL",l);try{ensureCpkIfSpecified(l.customerProvidedKey,this.isHttps);return await this.pageBlobContext.uploadPagesFromURL(r,rangeToString({offset:i,count:s}),0,rangeToString({offset:a,count:s}),Object.assign({abortSignal:l.abortSignal,sourceContentMD5:l.sourceContentMD5,sourceContentCrc64:l.sourceContentCrc64,leaseAccessConditions:l.conditions,sequenceNumberAccessConditions:l.conditions,modifiedAccessConditions:Object.assign(Object.assign({},l.conditions),{ifTags:(p=l.conditions)===null||p===void 0?void 0:p.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:l.sourceConditions.ifMatch,sourceIfModifiedSince:l.sourceConditions.ifModifiedSince,sourceIfNoneMatch:l.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:l.sourceConditions.ifUnmodifiedSince},cpkInfo:l.customerProvidedKey,encryptionScope:l.encryptionScope,copySourceAuthorization:httpAuthorizationToString(l.sourceAuthorization)},convertTracingToRequestOptionsBase(u)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async clearPages(r=0,i,a={}){var s;a.conditions=a.conditions||{};const{span:l,updatedOptions:p}=Lo("PageBlobClient-clearPages",a);try{return await this.pageBlobContext.clearPages(0,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(s=a.conditions)===null||s===void 0?void 0:s.tagConditions}),range:rangeToString({offset:r,count:i}),sequenceNumberAccessConditions:a.conditions,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(p)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async getPageRanges(r=0,i,a={}){var s;a.conditions=a.conditions||{};const{span:l,updatedOptions:p}=Lo("PageBlobClient-getPageRanges",a);try{return await this.pageBlobContext.getPageRanges(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(s=a.conditions)===null||s===void 0?void 0:s.tagConditions}),range:rangeToString({offset:r,count:i})},convertTracingToRequestOptionsBase(p))).then(rangeResponseFromModel)}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async listPageRangesSegment(r=0,i,a,s={}){var l;const{span:p,updatedOptions:d}=Lo("PageBlobClient-getPageRangesSegment",s);try{return await this.pageBlobContext.getPageRanges(Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(l=s.conditions)===null||l===void 0?void 0:l.tagConditions}),range:rangeToString({offset:r,count:i}),marker:a,maxPageSize:s.maxPageSize},convertTracingToRequestOptionsBase(d)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}listPageRangeItemSegments(r=0,i,a,s={}){return l.__asyncGenerator(this,arguments,(function*listPageRangeItemSegments_1(){let c;if(!!a||a===undefined){do{c=yield l.__await(this.listPageRangesSegment(r,i,a,s));a=c.continuationToken;yield yield l.__await(yield l.__await(c))}while(a)}}))}listPageRangeItems(r=0,i,a={}){return l.__asyncGenerator(this,arguments,(function*listPageRangeItems_1(){var s,c;let p;try{for(var d=l.__asyncValues(this.listPageRangeItemSegments(r,i,p,a)),u;u=yield l.__await(d.next()),!u.done;){const r=u.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(ExtractPageRangeInfoItems(r))))}}catch(r){s={error:r}}finally{try{if(u&&!u.done&&(c=d.return))yield l.__await(c.call(d))}finally{if(s)throw s.error}}}))}listPageRanges(r=0,i,a={}){a.conditions=a.conditions||{};const s=this.listPageRangeItems(r,i,a);return{next(){return s.next()},[Symbol.asyncIterator](){return this},byPage:(s={})=>this.listPageRangeItemSegments(r,i,s.continuationToken,Object.assign({maxPageSize:s.maxPageSize},a))}}async getPageRangesDiff(r,i,a,s={}){var l;s.conditions=s.conditions||{};const{span:p,updatedOptions:d}=Lo("PageBlobClient-getPageRangesDiff",s);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(l=s.conditions)===null||l===void 0?void 0:l.tagConditions}),prevsnapshot:a,range:rangeToString({offset:r,count:i})},convertTracingToRequestOptionsBase(d))).then(rangeResponseFromModel)}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async listPageRangesDiffSegment(r,i,a,s,l){var p;const{span:d,updatedOptions:u}=Lo("PageBlobClient-getPageRangesDiffSegment",l);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:l===null||l===void 0?void 0:l.abortSignal,leaseAccessConditions:l===null||l===void 0?void 0:l.conditions,modifiedAccessConditions:Object.assign(Object.assign({},l===null||l===void 0?void 0:l.conditions),{ifTags:(p=l===null||l===void 0?void 0:l.conditions)===null||p===void 0?void 0:p.tagConditions}),prevsnapshot:a,range:rangeToString({offset:r,count:i}),marker:s,maxPageSize:l===null||l===void 0?void 0:l.maxPageSize},convertTracingToRequestOptionsBase(u)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}listPageRangeDiffItemSegments(r,i,a,s,c){return l.__asyncGenerator(this,arguments,(function*listPageRangeDiffItemSegments_1(){let p;if(!!s||s===undefined){do{p=yield l.__await(this.listPageRangesDiffSegment(r,i,a,s,c));s=p.continuationToken;yield yield l.__await(yield l.__await(p))}while(s)}}))}listPageRangeDiffItems(r,i,a,s){return l.__asyncGenerator(this,arguments,(function*listPageRangeDiffItems_1(){var c,p;let d;try{for(var u=l.__asyncValues(this.listPageRangeDiffItemSegments(r,i,a,d,s)),A;A=yield l.__await(u.next()),!A.done;){const r=A.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(ExtractPageRangeInfoItems(r))))}}catch(r){c={error:r}}finally{try{if(A&&!A.done&&(p=u.return))yield l.__await(p.call(u))}finally{if(c)throw c.error}}}))}listPageRangesDiff(r,i,a,s={}){s.conditions=s.conditions||{};const l=this.listPageRangeDiffItems(r,i,a,Object.assign({},s));return{next(){return l.next()},[Symbol.asyncIterator](){return this},byPage:(l={})=>this.listPageRangeDiffItemSegments(r,i,a,l.continuationToken,Object.assign({maxPageSize:l.maxPageSize},s))}}async getPageRangesDiffForManagedDisks(r,i,a,s={}){var l;s.conditions=s.conditions||{};const{span:p,updatedOptions:d}=Lo("PageBlobClient-GetPageRangesDiffForManagedDisks",s);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(l=s.conditions)===null||l===void 0?void 0:l.tagConditions}),prevSnapshotUrl:a,range:rangeToString({offset:r,count:i})},convertTracingToRequestOptionsBase(d))).then(rangeResponseFromModel)}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async resize(r,i={}){var a;i.conditions=i.conditions||{};const{span:s,updatedOptions:l}=Lo("PageBlobClient-resize",i);try{return await this.pageBlobContext.resize(r,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions}),encryptionScope:i.encryptionScope},convertTracingToRequestOptionsBase(l)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async updateSequenceNumber(r,i,a={}){var s;a.conditions=a.conditions||{};const{span:l,updatedOptions:p}=Lo("PageBlobClient-updateSequenceNumber",a);try{return await this.pageBlobContext.updateSequenceNumber(r,Object.assign({abortSignal:a.abortSignal,blobSequenceNumber:i,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(s=a.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(p)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async startCopyIncremental(r,i={}){var a;const{span:s,updatedOptions:l}=Lo("PageBlobClient-startCopyIncremental",i);try{return await this.pageBlobContext.copyIncremental(r,Object.assign({abortSignal:i.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(a=i.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(l)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}}async function getBodyAsText(r){let i=Buffer.alloc(bo);const a=await streamToBuffer2(r.readableStreamBody,i);i=i.slice(0,a);return i.toString()}function utf8ByteLength(r){return Buffer.byteLength(r)}const $o=": ";const Zo=" ";const el=-1;class BatchResponseParser{constructor(r,i){if(!r||!r.contentType){throw new RangeError("batchResponse is malformed or doesn't contain valid content-type.")}if(!i||i.size===0){throw new RangeError("Invalid state: subRequests is not provided or size is 0.")}this.batchResponse=r;this.subRequests=i;this.responseBatchBoundary=this.batchResponse.contentType.split("=")[1];this.perResponsePrefix=`--${this.responseBatchBoundary}${Co}`;this.batchResponseEnding=`--${this.responseBatchBoundary}--`}async parseBatchResponse(){if(this.batchResponse._response.status!==mo.HTTP_ACCEPTED){throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`)}const r=await getBodyAsText(this.batchResponse);const i=r.split(this.batchResponseEnding)[0].split(this.perResponsePrefix).slice(1);const a=i.length;if(a!==this.subRequests.size&&a!==1){throw new Error("Invalid state: sub responses' count is not equal to sub requests' count.")}const l=new Array(a);let c=0;let p=0;for(let r=0;r=0&&y{if(this.keys[r]===undefined||this.keys[r]===tl.UNLOCKED){this.keys[r]=tl.LOCKED;i()}else{this.onUnlockEvent(r,(()=>{this.keys[r]=tl.LOCKED;i()}))}}))}static async unlock(r){return new Promise((i=>{if(this.keys[r]===tl.LOCKED){this.emitUnlockEvent(r)}delete this.keys[r];i()}))}static onUnlockEvent(r,i){if(this.listeners[r]===undefined){this.listeners[r]=[i]}else{this.listeners[r].push(i)}}static emitUnlockEvent(r){if(this.listeners[r]!==undefined&&this.listeners[r].length>0){const i=this.listeners[r].shift();setImmediate((()=>{i.call(this)}))}}}Mutex.keys={};Mutex.listeners={};class BlobBatch{constructor(){this.batch="batch";this.batchRequest=new InnerBatchRequest}getMultiPartContentType(){return this.batchRequest.getMultipartContentType()}getHttpRequestBody(){return this.batchRequest.getHttpRequestBody()}getSubRequests(){return this.batchRequest.getSubRequests()}async addSubRequestInternal(r,i){await Mutex.lock(this.batch);try{this.batchRequest.preAddSubRequest(r);await i();this.batchRequest.postAddSubRequest(r)}finally{await Mutex.unlock(this.batch)}}setBatchType(r){if(!this.batchType){this.batchType=r}if(this.batchType!==r){throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`)}}async deleteBlob(r,i,a){let l;let p;if(typeof r==="string"&&(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i))){l=r;p=i}else if(r instanceof BlobClient){l=r.url;p=r.credential;a=i}else{throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.")}if(!a){a={}}const{span:d,updatedOptions:u}=Lo("BatchDeleteRequest-addSubRequest",a);try{this.setBatchType("delete");await this.addSubRequestInternal({url:l,credential:p},(async()=>{await new BlobClient(l,this.batchRequest.createPipeline(p)).delete(u)}))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async setBlobAccessTier(r,i,a,l){let p;let d;let u;if(typeof r==="string"&&(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i))){p=r;d=i;u=a}else if(r instanceof BlobClient){p=r.url;d=r.credential;u=i;l=a}else{throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.")}if(!l){l={}}const{span:A,updatedOptions:h}=Lo("BatchSetTierRequest-addSubRequest",l);try{this.setBatchType("setAccessTier");await this.addSubRequestInternal({url:p,credential:d},(async()=>{await new BlobClient(p,this.batchRequest.createPipeline(d)).setAccessTier(u,h)}))}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}}class InnerBatchRequest{constructor(){this.operationCount=0;this.body="";const r=s.generateUuid();this.boundary=`batch_${r}`;this.subRequestPrefix=`--${this.boundary}${Co}${fo.CONTENT_TYPE}: application/http${Co}${fo.CONTENT_TRANSFER_ENCODING}: binary`;this.multipartContentType=`multipart/mixed; boundary=${this.boundary}`;this.batchRequestEnding=`--${this.boundary}--`;this.subRequests=new Map}createPipeline(r){const i=r instanceof AnonymousCredential;const a=3+(i?0:1);const l=new Array(a);l[0]=s.deserializationPolicy();l[1]=new BatchHeaderFilterPolicyFactory;if(!i){l[2]=s.isTokenCredential(r)?attachCredential(s.bearerTokenAuthenticationPolicy(r,uo),r):r}l[a-1]=new BatchRequestAssemblePolicyFactory(this);return new Pipeline(l,{})}appendSubRequestToBody(r){this.body+=[this.subRequestPrefix,`${fo.CONTENT_ID}: ${this.operationCount}`,"",`${r.method.toString()} ${getURLPathAndQuery(r.url)} ${vo}${Co}`].join(Co);for(const i of r.headers.headersArray()){this.body+=`${i.name}: ${i.value}${Co}`}this.body+=Co}preAddSubRequest(r){if(this.operationCount>=Eo){throw new RangeError(`Cannot exceed ${Eo} sub requests in a single batch`)}const i=getURLPath(r.url);if(!i||i===""){throw new RangeError(`Invalid url for sub request: '${r.url}'`)}}postAddSubRequest(r){this.subRequests.set(this.operationCount,r);this.operationCount++}getHttpRequestBody(){return`${this.body}${this.batchRequestEnding}${Co}`}getMultipartContentType(){return this.multipartContentType}getSubRequests(){return this.subRequests}}class BatchRequestAssemblePolicy extends s.BaseRequestPolicy{constructor(r,i,a){super(i,a);this.dummyResponse={request:new s.WebResource,status:200,headers:new s.HttpHeaders};this.batchRequest=r}async sendRequest(r){await this.batchRequest.appendSubRequestToBody(r);return this.dummyResponse}}class BatchRequestAssemblePolicyFactory{constructor(r){this.batchRequest=r}create(r,i){return new BatchRequestAssemblePolicy(this.batchRequest,r,i)}}class BatchHeaderFilterPolicy extends s.BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){let i="";for(const a of r.headers.headersArray()){if(iEqual(a.name,fo.X_MS_VERSION)){i=a.name}}if(i!==""){r.headers.remove(i)}return this._nextPolicy.sendRequest(r)}}class BatchHeaderFilterPolicyFactory{create(r,i){return new BatchHeaderFilterPolicy(r,i)}}class BlobBatchClient{constructor(r,i,a){let s;if(isPipelineLike(i)){s=i}else if(!i){s=newPipeline(new AnonymousCredential,a)}else{s=newPipeline(i,a)}const l=new StorageClientContext(r,s.toServiceClientOptions());const c=getURLPath(r);if(c&&c!=="/"){this.serviceOrContainerContext=new Container(l)}else{this.serviceOrContainerContext=new Service(l)}}createBatch(){return new BlobBatch}async deleteBlobs(r,i,a){const s=new BlobBatch;for(const l of r){if(typeof l==="string"){await s.deleteBlob(l,i,a)}else{await s.deleteBlob(l,i)}}return this.submitBatch(s)}async setBlobsAccessTier(r,i,a,s){const l=new BlobBatch;for(const c of r){if(typeof c==="string"){await l.setBlobAccessTier(c,i,a,s)}else{await l.setBlobAccessTier(c,i,a)}}return this.submitBatch(l)}async submitBatch(r,i={}){if(!r||r.getSubRequests().size===0){throw new RangeError("Batch request should contain one or more sub requests.")}const{span:a,updatedOptions:s}=Lo("BlobBatchClient-submitBatch",i);try{const a=r.getHttpRequestBody();const l=await this.serviceOrContainerContext.submitBatch(utf8ByteLength(a),r.getMultiPartContentType(),a,Object.assign(Object.assign({},i),convertTracingToRequestOptionsBase(s)));const c=new BatchResponseParser(l,r.getSubRequests());const p=await c.parseBatchResponse();const d={_response:l._response,contentType:l.contentType,errorCode:l.errorCode,requestId:l.requestId,clientRequestId:l.clientRequestId,version:l.version,subResponses:p.subResponses,subResponsesSucceededCount:p.subResponsesSucceededCount,subResponsesFailedCount:p.subResponsesFailedCount};return d}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}}class ContainerClient extends StorageClient{constructor(r,i,a){let l;let c;a=a||{};if(isPipelineLike(i)){c=r;l=i}else if(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i)){c=r;l=newPipeline(i,a)}else if(!i&&typeof i!=="string"){c=r;l=newPipeline(new AnonymousCredential,a)}else if(i&&typeof i==="string"){const p=i;const d=extractConnectionStringParts(r);if(d.kind==="AccountConnString"){if(s.isNode){const r=new StorageSharedKeyCredential(d.accountName,d.accountKey);c=appendToURLPath(d.url,encodeURIComponent(p));if(!a.proxyOptions){a.proxyOptions=s.getDefaultProxySettings(d.proxyUri)}l=newPipeline(r,a)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(d.kind==="SASConnString"){c=appendToURLPath(d.url,encodeURIComponent(p))+"?"+d.accountSas;l=newPipeline(new AnonymousCredential,a)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName parameter")}super(c,l);this._containerName=this.getContainerNameFromUrl();this.containerContext=new Container(this.storageClientContext)}get containerName(){return this._containerName}async create(r={}){const{span:i,updatedOptions:a}=Lo("ContainerClient-create",r);try{return await this.containerContext.create(Object.assign(Object.assign({},r),convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async createIfNotExists(r={}){var i,a;const{span:s,updatedOptions:l}=Lo("ContainerClient-createIfNotExists",r);try{const r=await this.create(l);return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="ContainerAlreadyExists"){s.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when creating a container only if it does not already exist."});return Object.assign(Object.assign({succeeded:false},(a=r.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:r.response})}s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async exists(r={}){const{span:i,updatedOptions:a}=Lo("ContainerClient-exists",r);try{await this.getProperties({abortSignal:r.abortSignal,tracingOptions:a.tracingOptions});return true}catch(r){if(r.statusCode===404){i.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when checking container existence"});return false}i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}getBlobClient(r){return new BlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}getAppendBlobClient(r){return new AppendBlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}getBlockBlobClient(r){return new BlockBlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}getPageBlobClient(r){return new PageBlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}async getProperties(r={}){if(!r.conditions){r.conditions={}}const{span:i,updatedOptions:a}=Lo("ContainerClient-getProperties",r);try{return await this.containerContext.getProperties(Object.assign(Object.assign({abortSignal:r.abortSignal},r.conditions),convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async delete(r={}){if(!r.conditions){r.conditions={}}const{span:i,updatedOptions:a}=Lo("ContainerClient-delete",r);try{return await this.containerContext.delete(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:r.conditions},convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async deleteIfExists(r={}){var i,a;const{span:s,updatedOptions:l}=Lo("ContainerClient-deleteIfExists",r);try{const r=await this.delete(l);return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="ContainerNotFound"){s.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when deleting a container only if it exists."});return Object.assign(Object.assign({succeeded:false},(a=r.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:r.response})}s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async setMetadata(r,i={}){if(!i.conditions){i.conditions={}}if(i.conditions.ifUnmodifiedSince){throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service")}const{span:a,updatedOptions:s}=Lo("ContainerClient-setMetadata",i);try{return await this.containerContext.setMetadata(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,metadata:r,modifiedAccessConditions:i.conditions},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async getAccessPolicy(r={}){if(!r.conditions){r.conditions={}}const{span:i,updatedOptions:a}=Lo("ContainerClient-getAccessPolicy",r);try{const i=await this.containerContext.getAccessPolicy(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions},convertTracingToRequestOptionsBase(a)));const s={_response:i._response,blobPublicAccess:i.blobPublicAccess,date:i.date,etag:i.etag,errorCode:i.errorCode,lastModified:i.lastModified,requestId:i.requestId,clientRequestId:i.clientRequestId,signedIdentifiers:[],version:i.version};for(const r of i){let i=undefined;if(r.accessPolicy){i={permissions:r.accessPolicy.permissions};if(r.accessPolicy.expiresOn){i.expiresOn=new Date(r.accessPolicy.expiresOn)}if(r.accessPolicy.startsOn){i.startsOn=new Date(r.accessPolicy.startsOn)}}s.signedIdentifiers.push({accessPolicy:i,id:r.id})}return s}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setAccessPolicy(r,i,a={}){a.conditions=a.conditions||{};const{span:s,updatedOptions:l}=Lo("ContainerClient-setAccessPolicy",a);try{const s=[];for(const r of i||[]){s.push({accessPolicy:{expiresOn:r.accessPolicy.expiresOn?truncatedISO8061Date(r.accessPolicy.expiresOn):"",permissions:r.accessPolicy.permissions,startsOn:r.accessPolicy.startsOn?truncatedISO8061Date(r.accessPolicy.startsOn):""},id:r.id})}return await this.containerContext.setAccessPolicy(Object.assign({abortSignal:a.abortSignal,access:r,containerAcl:s,leaseAccessConditions:a.conditions,modifiedAccessConditions:a.conditions},convertTracingToRequestOptionsBase(l)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}getBlobLeaseClient(r){return new BlobLeaseClient(this,r)}async uploadBlockBlob(r,i,a,s={}){const{span:l,updatedOptions:p}=Lo("ContainerClient-uploadBlockBlob",s);try{const s=this.getBlockBlobClient(r);const l=await s.upload(i,a,p);return{blockBlobClient:s,response:l}}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async deleteBlob(r,i={}){const{span:a,updatedOptions:s}=Lo("ContainerClient-deleteBlob",i);try{let a=this.getBlobClient(r);if(i.versionId){a=a.withVersion(i.versionId)}return await a.delete(s)}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async listBlobFlatSegment(r,i={}){const{span:a,updatedOptions:s}=Lo("ContainerClient-listBlobFlatSegment",i);try{const a=await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({marker:r},i),convertTracingToRequestOptionsBase(s)));const l=Object.assign(Object.assign({},a),{_response:Object.assign(Object.assign({},a._response),{parsedBody:ConvertInternalResponseOfListBlobFlat(a._response.parsedBody)}),segment:Object.assign(Object.assign({},a.segment),{blobItems:a.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name),tags:toTags(r.blobTags),objectReplicationSourceProperties:parseObjectReplicationRecord(r.objectReplicationMetadata)});return i}))})});return l}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async listBlobHierarchySegment(r,i,a={}){var s;const{span:l,updatedOptions:p}=Lo("ContainerClient-listBlobHierarchySegment",a);try{const l=await this.containerContext.listBlobHierarchySegment(r,Object.assign(Object.assign({marker:i},a),convertTracingToRequestOptionsBase(p)));const c=Object.assign(Object.assign({},l),{_response:Object.assign(Object.assign({},l._response),{parsedBody:ConvertInternalResponseOfListBlobHierarchy(l._response.parsedBody)}),segment:Object.assign(Object.assign({},l.segment),{blobItems:l.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name),tags:toTags(r.blobTags),objectReplicationSourceProperties:parseObjectReplicationRecord(r.objectReplicationMetadata)});return i})),blobPrefixes:(s=l.segment.blobPrefixes)===null||s===void 0?void 0:s.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i}))})});return c}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}listSegments(r,i={}){return l.__asyncGenerator(this,arguments,(function*listSegments_1(){let a;if(!!r||r===undefined){do{a=yield l.__await(this.listBlobFlatSegment(r,i));r=a.continuationToken;yield yield l.__await(yield l.__await(a))}while(r)}}))}listItems(r={}){return l.__asyncGenerator(this,arguments,(function*listItems_1(){var i,a;let s;try{for(var c=l.__asyncValues(this.listSegments(s,r)),p;p=yield l.__await(c.next()),!p.done;){const r=p.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.segment.blobItems)))}}catch(r){i={error:r}}finally{try{if(p&&!p.done&&(a=c.return))yield l.__await(a.call(c))}finally{if(i)throw i.error}}}))}listBlobsFlat(r={}){const i=[];if(r.includeCopy){i.push("copy")}if(r.includeDeleted){i.push("deleted")}if(r.includeMetadata){i.push("metadata")}if(r.includeSnapshots){i.push("snapshots")}if(r.includeVersions){i.push("versions")}if(r.includeUncommitedBlobs){i.push("uncommittedblobs")}if(r.includeTags){i.push("tags")}if(r.includeDeletedWithVersions){i.push("deletedwithversions")}if(r.includeImmutabilityPolicy){i.push("immutabilitypolicy")}if(r.includeLegalHold){i.push("legalhold")}if(r.prefix===""){r.prefix=undefined}const a=Object.assign(Object.assign({},r),i.length>0?{include:i}:{});const s=this.listItems(a);return{next(){return s.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listSegments(r.continuationToken,Object.assign({maxPageSize:r.maxPageSize},a))}}listHierarchySegments(r,i,a={}){return l.__asyncGenerator(this,arguments,(function*listHierarchySegments_1(){let s;if(!!i||i===undefined){do{s=yield l.__await(this.listBlobHierarchySegment(r,i,a));i=s.continuationToken;yield yield l.__await(yield l.__await(s))}while(i)}}))}listItemsByHierarchy(r,i={}){return l.__asyncGenerator(this,arguments,(function*listItemsByHierarchy_1(){var a,s;let c;try{for(var p=l.__asyncValues(this.listHierarchySegments(r,c,i)),d;d=yield l.__await(p.next()),!d.done;){const r=d.value;const i=r.segment;if(i.blobPrefixes){for(const r of i.blobPrefixes){yield yield l.__await(Object.assign({kind:"prefix"},r))}}for(const r of i.blobItems){yield yield l.__await(Object.assign({kind:"blob"},r))}}}catch(r){a={error:r}}finally{try{if(d&&!d.done&&(s=p.return))yield l.__await(s.call(p))}finally{if(a)throw a.error}}}))}listBlobsByHierarchy(r,i={}){if(r===""){throw new RangeError("delimiter should contain one or more characters")}const a=[];if(i.includeCopy){a.push("copy")}if(i.includeDeleted){a.push("deleted")}if(i.includeMetadata){a.push("metadata")}if(i.includeSnapshots){a.push("snapshots")}if(i.includeVersions){a.push("versions")}if(i.includeUncommitedBlobs){a.push("uncommittedblobs")}if(i.includeTags){a.push("tags")}if(i.includeDeletedWithVersions){a.push("deletedwithversions")}if(i.includeImmutabilityPolicy){a.push("immutabilitypolicy")}if(i.includeLegalHold){a.push("legalhold")}if(i.prefix===""){i.prefix=undefined}const s=Object.assign(Object.assign({},i),a.length>0?{include:a}:{});const l=this.listItemsByHierarchy(r,s);return{async next(){return l.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.listHierarchySegments(r,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},s))}}async findBlobsByTagsSegment(r,i,a={}){const{span:s,updatedOptions:l}=Lo("ContainerClient-findBlobsByTagsSegment",a);try{const s=await this.containerContext.filterBlobs(Object.assign({abortSignal:a.abortSignal,where:r,marker:i,maxPageSize:a.maxPageSize},convertTracingToRequestOptionsBase(l)));const c=Object.assign(Object.assign({},s),{_response:s._response,blobs:s.blobs.map((r=>{var i;let a="";if(((i=r.tags)===null||i===void 0?void 0:i.blobTagSet.length)===1){a=r.tags.blobTagSet[0].value}return Object.assign(Object.assign({},r),{tags:toTags(r.tags),tagValue:a})}))});return c}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}findBlobsByTagsSegments(r,i,a={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsSegments_1(){let s;if(!!i||i===undefined){do{s=yield l.__await(this.findBlobsByTagsSegment(r,i,a));s.blobs=s.blobs||[];i=s.continuationToken;yield yield l.__await(s)}while(i)}}))}findBlobsByTagsItems(r,i={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsItems_1(){var a,s;let c;try{for(var p=l.__asyncValues(this.findBlobsByTagsSegments(r,c,i)),d;d=yield l.__await(p.next()),!d.done;){const r=d.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.blobs)))}}catch(r){a={error:r}}finally{try{if(d&&!d.done&&(s=p.return))yield l.__await(s.call(p))}finally{if(a)throw a.error}}}))}findBlobsByTags(r,i={}){const a=Object.assign({},i);const s=this.findBlobsByTagsItems(r,a);return{next(){return s.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.findBlobsByTagsSegments(r,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},a))}}getContainerNameFromUrl(){let r;try{const i=s.URLBuilder.parse(this.url);if(i.getHost().split(".")[1]==="blob"){r=i.getPath().split("/")[1]}else if(isIpEndpointStyle(i)){r=i.getPath().split("/")[2]}else{r=i.getPath().split("/")[1]}r=decodeURIComponent(r);if(!r){throw new Error("Provided containerName is invalid.")}return r}catch(r){throw new Error("Unable to extract containerName with provided information.")}}generateSasUrl(r){return new Promise((i=>{if(!(this.credential instanceof StorageSharedKeyCredential)){throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential")}const a=generateBlobSASQueryParameters(Object.assign({containerName:this._containerName},r),this.credential).toString();i(appendToURLQuery(this.url,a))}))}getBlobBatchClient(){return new BlobBatchClient(this.url,this.pipeline)}}class AccountSASPermissions{constructor(){this.read=false;this.write=false;this.delete=false;this.deleteVersion=false;this.list=false;this.add=false;this.create=false;this.update=false;this.process=false;this.tag=false;this.filter=false;this.setImmutabilityPolicy=false;this.permanentDelete=false}static parse(r){const i=new AccountSASPermissions;for(const a of r){switch(a){case"r":i.read=true;break;case"w":i.write=true;break;case"d":i.delete=true;break;case"x":i.deleteVersion=true;break;case"l":i.list=true;break;case"a":i.add=true;break;case"c":i.create=true;break;case"u":i.update=true;break;case"p":i.process=true;break;case"t":i.tag=true;break;case"f":i.filter=true;break;case"i":i.setImmutabilityPolicy=true;break;case"y":i.permanentDelete=true;break;default:throw new RangeError(`Invalid permission character: ${a}`)}}return i}static from(r){const i=new AccountSASPermissions;if(r.read){i.read=true}if(r.write){i.write=true}if(r.delete){i.delete=true}if(r.deleteVersion){i.deleteVersion=true}if(r.filter){i.filter=true}if(r.tag){i.tag=true}if(r.list){i.list=true}if(r.add){i.add=true}if(r.create){i.create=true}if(r.update){i.update=true}if(r.process){i.process=true}if(r.setImmutabilityPolicy){i.setImmutabilityPolicy=true}if(r.permanentDelete){i.permanentDelete=true}return i}toString(){const r=[];if(this.read){r.push("r")}if(this.write){r.push("w")}if(this.delete){r.push("d")}if(this.deleteVersion){r.push("x")}if(this.filter){r.push("f")}if(this.tag){r.push("t")}if(this.list){r.push("l")}if(this.add){r.push("a")}if(this.create){r.push("c")}if(this.update){r.push("u")}if(this.process){r.push("p")}if(this.setImmutabilityPolicy){r.push("i")}if(this.permanentDelete){r.push("y")}return r.join("")}}class AccountSASResourceTypes{constructor(){this.service=false;this.container=false;this.object=false}static parse(r){const i=new AccountSASResourceTypes;for(const a of r){switch(a){case"s":i.service=true;break;case"c":i.container=true;break;case"o":i.object=true;break;default:throw new RangeError(`Invalid resource type: ${a}`)}}return i}toString(){const r=[];if(this.service){r.push("s")}if(this.container){r.push("c")}if(this.object){r.push("o")}return r.join("")}}class AccountSASServices{constructor(){this.blob=false;this.file=false;this.queue=false;this.table=false}static parse(r){const i=new AccountSASServices;for(const a of r){switch(a){case"b":i.blob=true;break;case"f":i.file=true;break;case"q":i.queue=true;break;case"t":i.table=true;break;default:throw new RangeError(`Invalid service character: ${a}`)}}return i}toString(){const r=[];if(this.blob){r.push("b")}if(this.table){r.push("t")}if(this.queue){r.push("q")}if(this.file){r.push("f")}return r.join("")}}function generateAccountSASQueryParameters(r,i){const a=r.version?r.version:io;if(r.permissions&&r.permissions.setImmutabilityPolicy&&a<"2020-08-04"){throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.")}if(r.permissions&&r.permissions.deleteVersion&&a<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.")}if(r.permissions&&r.permissions.permanentDelete&&a<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.")}if(r.permissions&&r.permissions.tag&&a<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.")}if(r.permissions&&r.permissions.filter&&a<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.")}if(r.encryptionScope&&a<"2020-12-06"){throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.")}const s=AccountSASPermissions.parse(r.permissions.toString());const l=AccountSASServices.parse(r.services).toString();const c=AccountSASResourceTypes.parse(r.resourceTypes).toString();let p;if(a>="2020-12-06"){p=[i.accountName,s,l,c,r.startsOn?truncatedISO8061Date(r.startsOn,false):"",truncatedISO8061Date(r.expiresOn,false),r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",a,r.encryptionScope?r.encryptionScope:"",""].join("\n")}else{p=[i.accountName,s,l,c,r.startsOn?truncatedISO8061Date(r.startsOn,false):"",truncatedISO8061Date(r.expiresOn,false),r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",a,""].join("\n")}const d=i.computeHMACSHA256(p);return new SASQueryParameters(a,d,s.toString(),l,c,r.protocol,r.startsOn,r.expiresOn,r.ipRange,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,r.encryptionScope)}class BlobServiceClient extends StorageClient{constructor(r,i,a){let l;if(isPipelineLike(i)){l=i}else if(s.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||s.isTokenCredential(i)){l=newPipeline(i,a)}else{l=newPipeline(new AnonymousCredential,a)}super(r,l);this.serviceContext=new Service(this.storageClientContext)}static fromConnectionString(r,i){i=i||{};const a=extractConnectionStringParts(r);if(a.kind==="AccountConnString"){if(s.isNode){const r=new StorageSharedKeyCredential(a.accountName,a.accountKey);if(!i.proxyOptions){i.proxyOptions=s.getDefaultProxySettings(a.proxyUri)}const l=newPipeline(r,i);return new BlobServiceClient(a.url,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(a.kind==="SASConnString"){const r=newPipeline(new AnonymousCredential,i);return new BlobServiceClient(a.url+"?"+a.accountSas,r)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}getContainerClient(r){return new ContainerClient(appendToURLPath(this.url,encodeURIComponent(r)),this.pipeline)}async createContainer(r,i={}){const{span:a,updatedOptions:s}=Lo("BlobServiceClient-createContainer",i);try{const i=this.getContainerClient(r);const a=await i.create(s);return{containerClient:i,containerCreateResponse:a}}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async deleteContainer(r,i={}){const{span:a,updatedOptions:s}=Lo("BlobServiceClient-deleteContainer",i);try{const i=this.getContainerClient(r);return await i.delete(s)}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async undeleteContainer(r,i,a={}){const{span:s,updatedOptions:l}=Lo("BlobServiceClient-undeleteContainer",a);try{const s=this.getContainerClient(a.destinationContainerName||r);const c=new Container(s["storageClientContext"]);const p=await c.restore(Object.assign({deletedContainerName:r,deletedContainerVersion:i},l));return{containerClient:s,containerUndeleteResponse:p}}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async renameContainer(r,i,a={}){var s;const{span:l,updatedOptions:p}=Lo("BlobServiceClient-renameContainer",a);try{const l=this.getContainerClient(i);const c=new Container(l["storageClientContext"]);const d=await c.rename(r,Object.assign(Object.assign({},p),{sourceLeaseId:(s=a.sourceCondition)===null||s===void 0?void 0:s.leaseId}));return{containerClient:l,containerRenameResponse:d}}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async getProperties(r={}){const{span:i,updatedOptions:a}=Lo("BlobServiceClient-getProperties",r);try{return await this.serviceContext.getProperties(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setProperties(r,i={}){const{span:a,updatedOptions:s}=Lo("BlobServiceClient-setProperties",i);try{return await this.serviceContext.setProperties(r,Object.assign({abortSignal:i.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async getStatistics(r={}){const{span:i,updatedOptions:a}=Lo("BlobServiceClient-getStatistics",r);try{return await this.serviceContext.getStatistics(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async getAccountInfo(r={}){const{span:i,updatedOptions:a}=Lo("BlobServiceClient-getAccountInfo",r);try{return await this.serviceContext.getAccountInfo(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async listContainersSegment(r,i={}){const{span:a,updatedOptions:s}=Lo("BlobServiceClient-listContainersSegment",i);try{return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({abortSignal:i.abortSignal,marker:r},i),{include:typeof i.include==="string"?[i.include]:i.include}),convertTracingToRequestOptionsBase(s)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async findBlobsByTagsSegment(r,i,a={}){const{span:s,updatedOptions:l}=Lo("BlobServiceClient-findBlobsByTagsSegment",a);try{const s=await this.serviceContext.filterBlobs(Object.assign({abortSignal:a.abortSignal,where:r,marker:i,maxPageSize:a.maxPageSize},convertTracingToRequestOptionsBase(l)));const c=Object.assign(Object.assign({},s),{_response:s._response,blobs:s.blobs.map((r=>{var i;let a="";if(((i=r.tags)===null||i===void 0?void 0:i.blobTagSet.length)===1){a=r.tags.blobTagSet[0].value}return Object.assign(Object.assign({},r),{tags:toTags(r.tags),tagValue:a})}))});return c}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}findBlobsByTagsSegments(r,i,a={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsSegments_1(){let s;if(!!i||i===undefined){do{s=yield l.__await(this.findBlobsByTagsSegment(r,i,a));s.blobs=s.blobs||[];i=s.continuationToken;yield yield l.__await(s)}while(i)}}))}findBlobsByTagsItems(r,i={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsItems_1(){var a,s;let c;try{for(var p=l.__asyncValues(this.findBlobsByTagsSegments(r,c,i)),d;d=yield l.__await(p.next()),!d.done;){const r=d.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.blobs)))}}catch(r){a={error:r}}finally{try{if(d&&!d.done&&(s=p.return))yield l.__await(s.call(p))}finally{if(a)throw a.error}}}))}findBlobsByTags(r,i={}){const a=Object.assign({},i);const s=this.findBlobsByTagsItems(r,a);return{next(){return s.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.findBlobsByTagsSegments(r,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},a))}}listSegments(r,i={}){return l.__asyncGenerator(this,arguments,(function*listSegments_1(){let a;if(!!r||r===undefined){do{a=yield l.__await(this.listContainersSegment(r,i));a.containerItems=a.containerItems||[];r=a.continuationToken;yield yield l.__await(yield l.__await(a))}while(r)}}))}listItems(r={}){return l.__asyncGenerator(this,arguments,(function*listItems_1(){var i,a;let s;try{for(var c=l.__asyncValues(this.listSegments(s,r)),p;p=yield l.__await(c.next()),!p.done;){const r=p.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.containerItems)))}}catch(r){i={error:r}}finally{try{if(p&&!p.done&&(a=c.return))yield l.__await(a.call(c))}finally{if(i)throw i.error}}}))}listContainers(r={}){if(r.prefix===""){r.prefix=undefined}const i=[];if(r.includeDeleted){i.push("deleted")}if(r.includeMetadata){i.push("metadata")}if(r.includeSystem){i.push("system")}const a=Object.assign(Object.assign({},r),i.length>0?{include:i}:{});const s=this.listItems(a);return{next(){return s.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listSegments(r.continuationToken,Object.assign({maxPageSize:r.maxPageSize},a))}}async getUserDelegationKey(r,i,a={}){const{span:s,updatedOptions:l}=Lo("BlobServiceClient-getUserDelegationKey",a);try{const s=await this.serviceContext.getUserDelegationKey({startsOn:truncatedISO8061Date(r,false),expiresOn:truncatedISO8061Date(i,false)},Object.assign({abortSignal:a.abortSignal},convertTracingToRequestOptionsBase(l)));const c={signedObjectId:s.signedObjectId,signedTenantId:s.signedTenantId,signedStartsOn:new Date(s.signedStartsOn),signedExpiresOn:new Date(s.signedExpiresOn),signedService:s.signedService,signedVersion:s.signedVersion,value:s.value};const p=Object.assign({_response:s._response,requestId:s.requestId,clientRequestId:s.clientRequestId,version:s.version,date:s.date,errorCode:s.errorCode},c);return p}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}getBlobBatchClient(){return new BlobBatchClient(this.url,this.pipeline)}generateAccountSasUrl(r,i=AccountSASPermissions.parse("r"),a="sco",s={}){if(!(this.credential instanceof StorageSharedKeyCredential)){throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential")}if(r===undefined){const i=new Date;r=new Date(i.getTime()+3600*1e3)}const l=generateAccountSASQueryParameters(Object.assign({permissions:i,expiresOn:r,resourceTypes:a,services:AccountSASServices.parse("b").toString()},s),this.credential).toString();return appendToURLQuery(this.url,l)}}i.KnownEncryptionAlgorithmType=void 0;(function(r){r["AES256"]="AES256"})(i.KnownEncryptionAlgorithmType||(i.KnownEncryptionAlgorithmType={}));Object.defineProperty(i,"BaseRequestPolicy",{enumerable:true,get:function(){return s.BaseRequestPolicy}});Object.defineProperty(i,"HttpHeaders",{enumerable:true,get:function(){return s.HttpHeaders}});Object.defineProperty(i,"RequestPolicyOptions",{enumerable:true,get:function(){return s.RequestPolicyOptions}});Object.defineProperty(i,"RestError",{enumerable:true,get:function(){return s.RestError}});Object.defineProperty(i,"WebResource",{enumerable:true,get:function(){return s.WebResource}});Object.defineProperty(i,"deserializationPolicy",{enumerable:true,get:function(){return s.deserializationPolicy}});i.AccountSASPermissions=AccountSASPermissions;i.AccountSASResourceTypes=AccountSASResourceTypes;i.AccountSASServices=AccountSASServices;i.AnonymousCredential=AnonymousCredential;i.AnonymousCredentialPolicy=AnonymousCredentialPolicy;i.AppendBlobClient=AppendBlobClient;i.BlobBatch=BlobBatch;i.BlobBatchClient=BlobBatchClient;i.BlobClient=BlobClient;i.BlobLeaseClient=BlobLeaseClient;i.BlobSASPermissions=BlobSASPermissions;i.BlobServiceClient=BlobServiceClient;i.BlockBlobClient=BlockBlobClient;i.ContainerClient=ContainerClient;i.ContainerSASPermissions=ContainerSASPermissions;i.Credential=Credential;i.CredentialPolicy=CredentialPolicy;i.PageBlobClient=PageBlobClient;i.Pipeline=Pipeline;i.SASQueryParameters=SASQueryParameters;i.StorageBrowserPolicy=StorageBrowserPolicy;i.StorageBrowserPolicyFactory=StorageBrowserPolicyFactory;i.StorageOAuthScopes=uo;i.StorageRetryPolicy=StorageRetryPolicy;i.StorageRetryPolicyFactory=StorageRetryPolicyFactory;i.StorageSharedKeyCredential=StorageSharedKeyCredential;i.StorageSharedKeyCredentialPolicy=StorageSharedKeyCredentialPolicy;i.generateAccountSASQueryParameters=generateAccountSASQueryParameters;i.generateBlobSASQueryParameters=generateBlobSASQueryParameters;i.getBlobServiceAccountAudience=getBlobServiceAccountAudience;i.isPipelineLike=isPipelineLike;i.logger=to;i.newPipeline=newPipeline},24818:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=/^v1\./;const s=/^ghs_/;const l=/^ghu_/;async function auth(r){const i=r.split(/\./).length===3;const c=a.test(r)||s.test(r);const p=l.test(r);const d=i?"app":c?"installation":p?"user-to-server":"oauth";return{type:"token",token:r,tokenType:d}}function withAuthorizationPrefix(r){if(r.split(/\./).length===3){return`bearer ${r}`}return`token ${r}`}async function hook(r,i,a,s){const l=i.endpoint.merge(a,s);l.headers.authorization=withAuthorizationPrefix(r);return i(l)}const c=function createTokenAuth(r){if(!r){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof r!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}r=r.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,r),{hook:hook.bind(null,r)})};i.createTokenAuth=c},80947:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(85581);var l=a(15546);var c=a(89193);var p=a(67023);var d=a(24818);function _objectWithoutPropertiesLoose(r,i){if(r==null)return{};var a={};var s=Object.keys(r);var l,c;for(c=0;c=0)continue;a[l]=r[l]}return a}function _objectWithoutProperties(r,i){if(r==null)return{};var a=_objectWithoutPropertiesLoose(r,i);var s,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(l=0;l=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,s))continue;a[s]=r[s]}}return a}const u="3.6.0";const A=["authStrategy"];class Octokit{constructor(r={}){const i=new l.Collection;const a={baseUrl:c.request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},r.request,{hook:i.bind(null,"request")}),mediaType:{previews:[],format:""}};a.headers["user-agent"]=[r.userAgent,`octokit-core.js/${u} ${s.getUserAgent()}`].filter(Boolean).join(" ");if(r.baseUrl){a.baseUrl=r.baseUrl}if(r.previews){a.mediaType.previews=r.previews}if(r.timeZone){a.headers["time-zone"]=r.timeZone}this.request=c.request.defaults(a);this.graphql=p.withCustomRequest(this.request).defaults(a);this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},r.log);this.hook=i;if(!r.authStrategy){if(!r.auth){this.auth=async()=>({type:"unauthenticated"})}else{const a=d.createTokenAuth(r.auth);i.wrap("request",a.hook);this.auth=a}}else{const{authStrategy:a}=r,s=_objectWithoutProperties(r,A);const l=a(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},r.auth));i.wrap("request",l.hook);this.auth=l}const h=this.constructor;h.plugins.forEach((i=>{Object.assign(this,i(this,r))}))}static defaults(r){const i=class extends(this){constructor(...i){const a=i[0]||{};if(typeof r==="function"){super(r(a));return}super(Object.assign({},r,a,a.userAgent&&r.userAgent?{userAgent:`${a.userAgent} ${r.userAgent}`}:null))}};return i}static plugin(...r){var i;const a=this.plugins;const s=(i=class extends(this){},i.plugins=a.concat(r.filter((r=>!a.includes(r)))),i);return s}}Octokit.VERSION=u;Octokit.plugins=[];i.Octokit=Octokit},70756:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(1363);var l=a(85581);function lowercaseKeys(r){if(!r){return{}}return Object.keys(r).reduce(((i,a)=>{i[a.toLowerCase()]=r[a];return i}),{})}function mergeDeep(r,i){const a=Object.assign({},r);Object.keys(i).forEach((l=>{if(s.isPlainObject(i[l])){if(!(l in r))Object.assign(a,{[l]:i[l]});else a[l]=mergeDeep(r[l],i[l])}else{Object.assign(a,{[l]:i[l]})}}));return a}function removeUndefinedProperties(r){for(const i in r){if(r[i]===undefined){delete r[i]}}return r}function merge(r,i,a){if(typeof i==="string"){let[r,s]=i.split(" ");a=Object.assign(s?{method:r,url:s}:{url:r},a)}else{a=Object.assign({},i)}a.headers=lowercaseKeys(a.headers);removeUndefinedProperties(a);removeUndefinedProperties(a.headers);const s=mergeDeep(r||{},a);if(r&&r.mediaType.previews.length){s.mediaType.previews=r.mediaType.previews.filter((r=>!s.mediaType.previews.includes(r))).concat(s.mediaType.previews)}s.mediaType.previews=s.mediaType.previews.map((r=>r.replace(/-preview/,"")));return s}function addQueryParameters(r,i){const a=/\?/.test(r)?"&":"?";const s=Object.keys(i);if(s.length===0){return r}return r+a+s.map((r=>{if(r==="q"){return"q="+i.q.split("+").map(encodeURIComponent).join("+")}return`${r}=${encodeURIComponent(i[r])}`})).join("&")}const c=/\{[^}]+\}/g;function removeNonChars(r){return r.replace(/^\W+|\W+$/g,"").split(/,/)}function extractUrlVariableNames(r){const i=r.match(c);if(!i){return[]}return i.map(removeNonChars).reduce(((r,i)=>r.concat(i)),[])}function omit(r,i){return Object.keys(r).filter((r=>!i.includes(r))).reduce(((i,a)=>{i[a]=r[a];return i}),{})}function encodeReserved(r){return r.split(/(%[0-9A-Fa-f]{2})/g).map((function(r){if(!/%[0-9A-Fa-f]/.test(r)){r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")}return r})).join("")}function encodeUnreserved(r){return encodeURIComponent(r).replace(/[!'()*]/g,(function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()}))}function encodeValue(r,i,a){i=r==="+"||r==="#"?encodeReserved(i):encodeUnreserved(i);if(a){return encodeUnreserved(a)+"="+i}else{return i}}function isDefined(r){return r!==undefined&&r!==null}function isKeyOperator(r){return r===";"||r==="&"||r==="?"}function getValues(r,i,a,s){var l=r[a],c=[];if(isDefined(l)&&l!==""){if(typeof l==="string"||typeof l==="number"||typeof l==="boolean"){l=l.toString();if(s&&s!=="*"){l=l.substring(0,parseInt(s,10))}c.push(encodeValue(i,l,isKeyOperator(i)?a:""))}else{if(s==="*"){if(Array.isArray(l)){l.filter(isDefined).forEach((function(r){c.push(encodeValue(i,r,isKeyOperator(i)?a:""))}))}else{Object.keys(l).forEach((function(r){if(isDefined(l[r])){c.push(encodeValue(i,l[r],r))}}))}}else{const r=[];if(Array.isArray(l)){l.filter(isDefined).forEach((function(a){r.push(encodeValue(i,a))}))}else{Object.keys(l).forEach((function(a){if(isDefined(l[a])){r.push(encodeUnreserved(a));r.push(encodeValue(i,l[a].toString()))}}))}if(isKeyOperator(i)){c.push(encodeUnreserved(a)+"="+r.join(","))}else if(r.length!==0){c.push(r.join(","))}}}}else{if(i===";"){if(isDefined(l)){c.push(encodeUnreserved(a))}}else if(l===""&&(i==="&"||i==="?")){c.push(encodeUnreserved(a)+"=")}else if(l===""){c.push("")}}return c}function parseUrl(r){return{expand:expand.bind(null,r)}}function expand(r,i){var a=["+","#",".","/",";","?","&"];return r.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(r,s,l){if(s){let r="";const l=[];if(a.indexOf(s.charAt(0))!==-1){r=s.charAt(0);s=s.substr(1)}s.split(/,/g).forEach((function(a){var s=/([^:\*]*)(?::(\d+)|(\*))?/.exec(a);l.push(getValues(i,r,s[1],s[2]||s[3]))}));if(r&&r!=="+"){var c=",";if(r==="?"){c="&"}else if(r!=="#"){c=r}return(l.length!==0?r:"")+l.join(c)}else{return l.join(",")}}else{return encodeReserved(l)}}))}function parse(r){let i=r.method.toUpperCase();let a=(r.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let s=Object.assign({},r.headers);let l;let c=omit(r,["method","baseUrl","url","headers","request","mediaType"]);const p=extractUrlVariableNames(a);a=parseUrl(a).expand(c);if(!/^http/.test(a)){a=r.baseUrl+a}const d=Object.keys(r).filter((r=>p.includes(r))).concat("baseUrl");const u=omit(c,d);const A=/application\/octet-stream/i.test(s.accept);if(!A){if(r.mediaType.format){s.accept=s.accept.split(/,/).map((i=>i.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${r.mediaType.format}`))).join(",")}if(r.mediaType.previews.length){const i=s.accept.match(/[\w-]+(?=-preview)/g)||[];s.accept=i.concat(r.mediaType.previews).map((i=>{const a=r.mediaType.format?`.${r.mediaType.format}`:"+json";return`application/vnd.github.${i}-preview${a}`})).join(",")}}if(["GET","HEAD"].includes(i)){a=addQueryParameters(a,u)}else{if("data"in u){l=u.data}else{if(Object.keys(u).length){l=u}else{s["content-length"]=0}}}if(!s["content-type"]&&typeof l!=="undefined"){s["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(i)&&typeof l==="undefined"){l=""}return Object.assign({method:i,url:a,headers:s},typeof l!=="undefined"?{body:l}:null,r.request?{request:r.request}:null)}function endpointWithDefaults(r,i,a){return parse(merge(r,i,a))}function withDefaults(r,i){const a=merge(r,i);const s=endpointWithDefaults.bind(null,a);return Object.assign(s,{DEFAULTS:a,defaults:withDefaults.bind(null,a),merge:merge.bind(null,a),parse:parse})}const p="6.0.12";const d=`octokit-endpoint.js/${p} ${l.getUserAgent()}`;const u={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":d},mediaType:{format:"",previews:[]}};const A=withDefaults(null,u);i.endpoint=A},67023:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(89193);var l=a(85581);const c="4.8.0";function _buildMessageForResponseErrors(r){return`Request failed due to following response errors:\n`+r.errors.map((r=>` - ${r.message}`)).join("\n")}class GraphqlResponseError extends Error{constructor(r,i,a){super(_buildMessageForResponseErrors(a));this.request=r;this.headers=i;this.response=a;this.name="GraphqlResponseError";this.errors=a.errors;this.data=a.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}const p=["method","baseUrl","url","headers","request","query","mediaType"];const d=["query","method","url"];const u=/\/api\/v3\/?$/;function graphql(r,i,a){if(a){if(typeof i==="string"&&"query"in a){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const r in a){if(!d.includes(r))continue;return Promise.reject(new Error(`[@octokit/graphql] "${r}" cannot be used as variable name`))}}const s=typeof i==="string"?Object.assign({query:i},a):i;const l=Object.keys(s).reduce(((r,i)=>{if(p.includes(i)){r[i]=s[i];return r}if(!r.variables){r.variables={}}r.variables[i]=s[i];return r}),{});const c=s.baseUrl||r.endpoint.DEFAULTS.baseUrl;if(u.test(c)){l.url=c.replace(u,"/api/graphql")}return r(l).then((r=>{if(r.data.errors){const i={};for(const a of Object.keys(r.headers)){i[a]=r.headers[a]}throw new GraphqlResponseError(l,i,r.data)}return r.data.data}))}function withDefaults(r,i){const a=r.defaults(i);const newApi=(r,i)=>graphql(a,r,i);return Object.assign(newApi,{defaults:withDefaults.bind(null,a),endpoint:s.request.endpoint})}const A=withDefaults(s.request,{headers:{"user-agent":`octokit-graphql.js/${c} ${l.getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(r){return withDefaults(r,{method:"POST",url:"/graphql"})}i.GraphqlResponseError=GraphqlResponseError;i.graphql=A;i.withCustomRequest=withCustomRequest},88474:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a="2.21.3";function ownKeys(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),a.push.apply(a,s)}return a}function _objectSpread2(r){for(var i=1;i({async next(){if(!d)return{done:true};try{const r=await l({method:c,url:d,headers:p});const i=normalizePaginatedListResponse(r);d=((i.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1];return{value:i}}catch(r){if(r.status!==409)throw r;d="";return{value:{status:200,headers:{},data:[]}}}}})}}function paginate(r,i,a,s){if(typeof a==="function"){s=a;a=undefined}return gather(r,[],iterator(r,i,a)[Symbol.asyncIterator](),s)}function gather(r,i,a,s){return a.next().then((l=>{if(l.done){return i}let c=false;function done(){c=true}i=i.concat(s?s(l.value,done):l.value.data);if(c){return i}return gather(r,i,a,s)}))}const s=Object.assign(paginate,{iterator:iterator});const l=["GET /app/hook/deliveries","GET /app/installations","GET /applications/grants","GET /authorizations","GET /enterprises/{enterprise}/actions/permissions/organizations","GET /enterprises/{enterprise}/actions/runner-groups","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners","GET /enterprises/{enterprise}/actions/runners","GET /enterprises/{enterprise}/audit-log","GET /enterprises/{enterprise}/secret-scanning/alerts","GET /enterprises/{enterprise}/settings/billing/advanced-security","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /licenses","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/audit-log","GET /orgs/{org}/blocks","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/codespaces","GET /orgs/{org}/credential-authorizations","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/external-groups","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/projects","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/settings/billing/advanced-security","GET /orgs/{org}/team-sync/groups","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/columns/{column_id}/cards","GET /projects/{project_id}/collaborators","GET /projects/{project_id}/columns","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/codespaces","GET /repos/{owner}/{repo}/codespaces/devcontainers","GET /repos/{owner}/{repo}/codespaces/secrets","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/status","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/dependabot/secrets","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/environments","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/git/matching-refs/{ref}","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/releases/{release_id}/reactions","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repos/{owner}/{repo}/topics","GET /repositories","GET /repositories/{repository_id}/environments/{environment_name}/secrets","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/codespaces","GET /user/codespaces/secrets","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/packages/{package_type}/{package_name}/versions","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /users","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/packages","GET /users/{username}/projects","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(r){if(typeof r==="string"){return l.includes(r)}else{return false}}function paginateRest(r){return{paginate:Object.assign(paginate.bind(null,r),{iterator:iterator.bind(null,r)})}}paginateRest.VERSION=a;i.composePaginateRest=s;i.isPaginatingEndpoint=isPaginatingEndpoint;i.paginateRest=paginateRest;i.paginatingEndpoints=l},61117:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a="1.0.4";function requestLog(r){r.hook.wrap("request",((i,a)=>{r.log.debug("request",a);const s=Date.now();const l=r.request.endpoint.parse(a);const c=l.url.replace(a.baseUrl,"");return i(a).then((i=>{r.log.info(`${l.method} ${c} - ${i.status} in ${Date.now()-s}ms`);return i})).catch((i=>{r.log.info(`${l.method} ${c} - ${i.status} in ${Date.now()-s}ms`);throw i}))}))}requestLog.VERSION=a;i.requestLog=requestLog},15243:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function ownKeys(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);if(i){s=s.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))}a.push.apply(a,s)}return a}function _objectSpread2(r){for(var i=1;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var s=_interopDefault(a(93860));async function errorRequest(r,i,a,s){if(!a.request||!a.request.request){throw a}if(a.status>=400&&!i.doNotRetry.includes(a.status)){const l=s.request.retries!=null?s.request.retries:i.retries;const c=Math.pow((s.request.retryCount||0)+1,2);throw r.retry.retryRequest(a,l,c)}throw a}async function wrapRequest(r,i,a){const l=new s;l.on("failed",(function(i,s){const l=~~i.request.request.retries;const c=~~i.request.request.retryAfter;a.request.retryCount=s.retryCount+1;if(l>s.retryCount){return c*r.retryAfterBaseValue}}));return l.schedule(i,a)}const l="3.0.9";function retry(r,i){const a=Object.assign({enabled:true,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,422],retries:3},i.retry);if(a.enabled){r.hook.error("request",errorRequest.bind(null,r,a));r.hook.wrap("request",wrapRequest.bind(null,a))}return{retry:{retryRequest:(r,i,a)=>{r.request.request=Object.assign({},r.request.request,{retries:i,retryAfter:a});return r}}}}retry.VERSION=l;i.VERSION=l;i.retry=retry},87488:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var s=a(33383);var l=_interopDefault(a(28995));const c=l((r=>console.warn(r)));const p=l((r=>console.warn(r)));class RequestError extends Error{constructor(r,i,a){super(r);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="HttpError";this.status=i;let l;if("headers"in a&&typeof a.headers!=="undefined"){l=a.headers}if("response"in a){this.response=a.response;l=a.response.headers}const d=Object.assign({},a.request);if(a.request.headers.authorization){d.headers=Object.assign({},a.request.headers,{authorization:a.request.headers.authorization.replace(/ .*$/," [REDACTED]")})}d.url=d.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=d;Object.defineProperty(this,"code",{get(){c(new s.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));return i}});Object.defineProperty(this,"headers",{get(){p(new s.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));return l||{}}})}}i.RequestError=RequestError},89193:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var s=a(70756);var l=a(85581);var c=a(1363);var p=_interopDefault(a(18885));var d=a(87488);const u="5.6.3";function getBufferResponse(r){return r.arrayBuffer()}function fetchWrapper(r){const i=r.request&&r.request.log?r.request.log:console;if(c.isPlainObject(r.body)||Array.isArray(r.body)){r.body=JSON.stringify(r.body)}let a={};let s;let l;const u=r.request&&r.request.fetch||p;return u(r.url,Object.assign({method:r.method,body:r.body,headers:r.headers,redirect:r.redirect},r.request)).then((async c=>{l=c.url;s=c.status;for(const r of c.headers){a[r[0]]=r[1]}if("deprecation"in a){const s=a.link&&a.link.match(/<([^>]+)>; rel="deprecation"/);const l=s&&s.pop();i.warn(`[@octokit/request] "${r.method} ${r.url}" is deprecated. It is scheduled to be removed on ${a.sunset}${l?`. See ${l}`:""}`)}if(s===204||s===205){return}if(r.method==="HEAD"){if(s<400){return}throw new d.RequestError(c.statusText,s,{response:{url:l,status:s,headers:a,data:undefined},request:r})}if(s===304){throw new d.RequestError("Not modified",s,{response:{url:l,status:s,headers:a,data:await getResponseData(c)},request:r})}if(s>=400){const i=await getResponseData(c);const p=new d.RequestError(toErrorMessage(i),s,{response:{url:l,status:s,headers:a,data:i},request:r});throw p}return getResponseData(c)})).then((r=>({status:s,url:l,headers:a,data:r}))).catch((i=>{if(i instanceof d.RequestError)throw i;throw new d.RequestError(i.message,500,{request:r})}))}async function getResponseData(r){const i=r.headers.get("content-type");if(/application\/json/.test(i)){return r.json()}if(!i||/^text\/|charset=utf-8$/.test(i)){return r.text()}return getBufferResponse(r)}function toErrorMessage(r){if(typeof r==="string")return r;if("message"in r){if(Array.isArray(r.errors)){return`${r.message}: ${r.errors.map(JSON.stringify).join(", ")}`}return r.message}return`Unknown error: ${JSON.stringify(r)}`}function withDefaults(r,i){const a=r.defaults(i);const newApi=function(r,i){const s=a.merge(r,i);if(!s.request||!s.request.hook){return fetchWrapper(a.parse(s))}const request=(r,i)=>fetchWrapper(a.parse(a.merge(r,i)));Object.assign(request,{endpoint:a,defaults:withDefaults.bind(null,a)});return s.request.hook(request,s)};return Object.assign(newApi,{endpoint:a,defaults:withDefaults.bind(null,a)})}const A=withDefaults(s.endpoint,{headers:{"user-agent":`octokit-request.js/${u} ${l.getUserAgent()}`}});i.request=A},10597:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ContextAPI=void 0;const s=a(6357);const l=a(17533);const c=a(35841);const p="context";const d=new s.NoopContextManager;class ContextAPI{constructor(){}static getInstance(){if(!this._instance){this._instance=new ContextAPI}return this._instance}setGlobalContextManager(r){return(0,l.registerGlobal)(p,r,c.DiagAPI.instance())}active(){return this._getContextManager().active()}with(r,i,a,...s){return this._getContextManager().with(r,i,a,...s)}bind(r,i){return this._getContextManager().bind(r,i)}_getContextManager(){return(0,l.getGlobal)(p)||d}disable(){this._getContextManager().disable();(0,l.unregisterGlobal)(p,c.DiagAPI.instance())}}i.ContextAPI=ContextAPI},35841:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagAPI=void 0;const s=a(93820);const l=a(69066);const c=a(62517);const p=a(17533);const d="diag";class DiagAPI{constructor(){function _logProxy(r){return function(...i){const a=(0,p.getGlobal)("diag");if(!a)return;return a[r](...i)}}const r=this;const setLogger=(i,a={logLevel:c.DiagLogLevel.INFO})=>{var s,d,u;if(i===r){const i=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");r.error((s=i.stack)!==null&&s!==void 0?s:i.message);return false}if(typeof a==="number"){a={logLevel:a}}const A=(0,p.getGlobal)("diag");const h=(0,l.createLogLevelDiagLogger)((d=a.logLevel)!==null&&d!==void 0?d:c.DiagLogLevel.INFO,i);if(A&&!a.suppressOverrideMessage){const r=(u=(new Error).stack)!==null&&u!==void 0?u:"";A.warn(`Current logger will be overwritten from ${r}`);h.warn(`Current logger will overwrite one already registered from ${r}`)}return(0,p.registerGlobal)("diag",h,r,true)};r.setLogger=setLogger;r.disable=()=>{(0,p.unregisterGlobal)(d,r)};r.createComponentLogger=r=>new s.DiagComponentLogger(r);r.verbose=_logProxy("verbose");r.debug=_logProxy("debug");r.info=_logProxy("info");r.warn=_logProxy("warn");r.error=_logProxy("error")}static instance(){if(!this._instance){this._instance=new DiagAPI}return this._instance}}i.DiagAPI=DiagAPI},42537:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MetricsAPI=void 0;const s=a(94749);const l=a(17533);const c=a(35841);const p="metrics";class MetricsAPI{constructor(){}static getInstance(){if(!this._instance){this._instance=new MetricsAPI}return this._instance}setGlobalMeterProvider(r){return(0,l.registerGlobal)(p,r,c.DiagAPI.instance())}getMeterProvider(){return(0,l.getGlobal)(p)||s.NOOP_METER_PROVIDER}getMeter(r,i,a){return this.getMeterProvider().getMeter(r,i,a)}disable(){(0,l.unregisterGlobal)(p,c.DiagAPI.instance())}}i.MetricsAPI=MetricsAPI},68276:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.PropagationAPI=void 0;const s=a(17533);const l=a(95911);const c=a(84216);const p=a(78269);const d=a(6794);const u=a(35841);const A="propagation";const h=new l.NoopTextMapPropagator;class PropagationAPI{constructor(){this.createBaggage=d.createBaggage;this.getBaggage=p.getBaggage;this.getActiveBaggage=p.getActiveBaggage;this.setBaggage=p.setBaggage;this.deleteBaggage=p.deleteBaggage}static getInstance(){if(!this._instance){this._instance=new PropagationAPI}return this._instance}setGlobalPropagator(r){return(0,s.registerGlobal)(A,r,u.DiagAPI.instance())}inject(r,i,a=c.defaultTextMapSetter){return this._getGlobalPropagator().inject(r,i,a)}extract(r,i,a=c.defaultTextMapGetter){return this._getGlobalPropagator().extract(r,i,a)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,s.unregisterGlobal)(A,u.DiagAPI.instance())}_getGlobalPropagator(){return(0,s.getGlobal)(A)||h}}i.PropagationAPI=PropagationAPI},80978:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.TraceAPI=void 0;const s=a(17533);const l=a(33241);const c=a(66659);const p=a(50401);const d=a(35841);const u="trace";class TraceAPI{constructor(){this._proxyTracerProvider=new l.ProxyTracerProvider;this.wrapSpanContext=c.wrapSpanContext;this.isSpanContextValid=c.isSpanContextValid;this.deleteSpan=p.deleteSpan;this.getSpan=p.getSpan;this.getActiveSpan=p.getActiveSpan;this.getSpanContext=p.getSpanContext;this.setSpan=p.setSpan;this.setSpanContext=p.setSpanContext}static getInstance(){if(!this._instance){this._instance=new TraceAPI}return this._instance}setGlobalTracerProvider(r){const i=(0,s.registerGlobal)(u,this._proxyTracerProvider,d.DiagAPI.instance());if(i){this._proxyTracerProvider.setDelegate(r)}return i}getTracerProvider(){return(0,s.getGlobal)(u)||this._proxyTracerProvider}getTracer(r,i){return this.getTracerProvider().getTracer(r,i)}disable(){(0,s.unregisterGlobal)(u,d.DiagAPI.instance());this._proxyTracerProvider=new l.ProxyTracerProvider}}i.TraceAPI=TraceAPI},78269:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.deleteBaggage=i.setBaggage=i.getActiveBaggage=i.getBaggage=void 0;const s=a(10597);const l=a(88521);const c=(0,l.createContextKey)("OpenTelemetry Baggage Key");function getBaggage(r){return r.getValue(c)||undefined}i.getBaggage=getBaggage;function getActiveBaggage(){return getBaggage(s.ContextAPI.getInstance().active())}i.getActiveBaggage=getActiveBaggage;function setBaggage(r,i){return r.setValue(c,i)}i.setBaggage=setBaggage;function deleteBaggage(r){return r.deleteValue(c)}i.deleteBaggage=deleteBaggage},80996:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BaggageImpl=void 0;class BaggageImpl{constructor(r){this._entries=r?new Map(r):new Map}getEntry(r){const i=this._entries.get(r);if(!i){return undefined}return Object.assign({},i)}getAllEntries(){return Array.from(this._entries.entries()).map((([r,i])=>[r,i]))}setEntry(r,i){const a=new BaggageImpl(this._entries);a._entries.set(r,i);return a}removeEntry(r){const i=new BaggageImpl(this._entries);i._entries.delete(r);return i}removeEntries(...r){const i=new BaggageImpl(this._entries);for(const a of r){i._entries.delete(a)}return i}clear(){return new BaggageImpl}}i.BaggageImpl=BaggageImpl},23371:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.baggageEntryMetadataSymbol=void 0;i.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},6794:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.baggageEntryMetadataFromString=i.createBaggage=void 0;const s=a(35841);const l=a(80996);const c=a(23371);const p=s.DiagAPI.instance();function createBaggage(r={}){return new l.BaggageImpl(new Map(Object.entries(r)))}i.createBaggage=createBaggage;function baggageEntryMetadataFromString(r){if(typeof r!=="string"){p.error(`Cannot create baggage metadata from unknown type: ${typeof r}`);r=""}return{__TYPE__:c.baggageEntryMetadataSymbol,toString(){return r}}}i.baggageEntryMetadataFromString=baggageEntryMetadataFromString},35751:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.context=void 0;const s=a(10597);i.context=s.ContextAPI.getInstance()},6357:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopContextManager=void 0;const s=a(88521);class NoopContextManager{active(){return s.ROOT_CONTEXT}with(r,i,a,...s){return i.call(a,...s)}bind(r,i){return i}enable(){return this}disable(){return this}}i.NoopContextManager=NoopContextManager},88521:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ROOT_CONTEXT=i.createContextKey=void 0;function createContextKey(r){return Symbol.for(r)}i.createContextKey=createContextKey;class BaseContext{constructor(r){const i=this;i._currentContext=r?new Map(r):new Map;i.getValue=r=>i._currentContext.get(r);i.setValue=(r,a)=>{const s=new BaseContext(i._currentContext);s._currentContext.set(r,a);return s};i.deleteValue=r=>{const a=new BaseContext(i._currentContext);a._currentContext.delete(r);return a}}}i.ROOT_CONTEXT=new BaseContext},35654:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.diag=void 0;const s=a(35841);i.diag=s.DiagAPI.instance()},93820:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagComponentLogger=void 0;const s=a(17533);class DiagComponentLogger{constructor(r){this._namespace=r.namespace||"DiagComponentLogger"}debug(...r){return logProxy("debug",this._namespace,r)}error(...r){return logProxy("error",this._namespace,r)}info(...r){return logProxy("info",this._namespace,r)}warn(...r){return logProxy("warn",this._namespace,r)}verbose(...r){return logProxy("verbose",this._namespace,r)}}i.DiagComponentLogger=DiagComponentLogger;function logProxy(r,i,a){const l=(0,s.getGlobal)("diag");if(!l){return}a.unshift(i);return l[r](...a)}},83431:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagConsoleLogger=void 0;const a=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class DiagConsoleLogger{constructor(){function _consoleFunc(r){return function(...i){if(console){let a=console[r];if(typeof a!=="function"){a=console.log}if(typeof a==="function"){return a.apply(console,i)}}}}for(let r=0;r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createLogLevelDiagLogger=void 0;const s=a(62517);function createLogLevelDiagLogger(r,i){if(rs.DiagLogLevel.ALL){r=s.DiagLogLevel.ALL}i=i||{};function _filterFunc(a,s){const l=i[a];if(typeof l==="function"&&r>=s){return l.bind(i)}return function(){}}return{error:_filterFunc("error",s.DiagLogLevel.ERROR),warn:_filterFunc("warn",s.DiagLogLevel.WARN),info:_filterFunc("info",s.DiagLogLevel.INFO),debug:_filterFunc("debug",s.DiagLogLevel.DEBUG),verbose:_filterFunc("verbose",s.DiagLogLevel.VERBOSE)}}i.createLogLevelDiagLogger=createLogLevelDiagLogger},62517:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagLogLevel=void 0;var a;(function(r){r[r["NONE"]=0]="NONE";r[r["ERROR"]=30]="ERROR";r[r["WARN"]=50]="WARN";r[r["INFO"]=60]="INFO";r[r["DEBUG"]=70]="DEBUG";r[r["VERBOSE"]=80]="VERBOSE";r[r["ALL"]=9999]="ALL"})(a=i.DiagLogLevel||(i.DiagLogLevel={}))},85762:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.trace=i.propagation=i.metrics=i.diag=i.context=i.INVALID_SPAN_CONTEXT=i.INVALID_TRACEID=i.INVALID_SPANID=i.isValidSpanId=i.isValidTraceId=i.isSpanContextValid=i.createTraceState=i.TraceFlags=i.SpanStatusCode=i.SpanKind=i.SamplingDecision=i.ProxyTracerProvider=i.ProxyTracer=i.defaultTextMapSetter=i.defaultTextMapGetter=i.ValueType=i.createNoopMeter=i.DiagLogLevel=i.DiagConsoleLogger=i.ROOT_CONTEXT=i.createContextKey=i.baggageEntryMetadataFromString=void 0;var s=a(6794);Object.defineProperty(i,"baggageEntryMetadataFromString",{enumerable:true,get:function(){return s.baggageEntryMetadataFromString}});var l=a(88521);Object.defineProperty(i,"createContextKey",{enumerable:true,get:function(){return l.createContextKey}});Object.defineProperty(i,"ROOT_CONTEXT",{enumerable:true,get:function(){return l.ROOT_CONTEXT}});var c=a(83431);Object.defineProperty(i,"DiagConsoleLogger",{enumerable:true,get:function(){return c.DiagConsoleLogger}});var p=a(62517);Object.defineProperty(i,"DiagLogLevel",{enumerable:true,get:function(){return p.DiagLogLevel}});var d=a(90783);Object.defineProperty(i,"createNoopMeter",{enumerable:true,get:function(){return d.createNoopMeter}});var u=a(8809);Object.defineProperty(i,"ValueType",{enumerable:true,get:function(){return u.ValueType}});var A=a(84216);Object.defineProperty(i,"defaultTextMapGetter",{enumerable:true,get:function(){return A.defaultTextMapGetter}});Object.defineProperty(i,"defaultTextMapSetter",{enumerable:true,get:function(){return A.defaultTextMapSetter}});var h=a(91804);Object.defineProperty(i,"ProxyTracer",{enumerable:true,get:function(){return h.ProxyTracer}});var g=a(33241);Object.defineProperty(i,"ProxyTracerProvider",{enumerable:true,get:function(){return g.ProxyTracerProvider}});var y=a(63046);Object.defineProperty(i,"SamplingDecision",{enumerable:true,get:function(){return y.SamplingDecision}});var E=a(844);Object.defineProperty(i,"SpanKind",{enumerable:true,get:function(){return E.SpanKind}});var b=a(19889);Object.defineProperty(i,"SpanStatusCode",{enumerable:true,get:function(){return b.SpanStatusCode}});var C=a(52970);Object.defineProperty(i,"TraceFlags",{enumerable:true,get:function(){return C.TraceFlags}});var v=a(93222);Object.defineProperty(i,"createTraceState",{enumerable:true,get:function(){return v.createTraceState}});var B=a(66659);Object.defineProperty(i,"isSpanContextValid",{enumerable:true,get:function(){return B.isSpanContextValid}});Object.defineProperty(i,"isValidTraceId",{enumerable:true,get:function(){return B.isValidTraceId}});Object.defineProperty(i,"isValidSpanId",{enumerable:true,get:function(){return B.isValidSpanId}});var I=a(35259);Object.defineProperty(i,"INVALID_SPANID",{enumerable:true,get:function(){return I.INVALID_SPANID}});Object.defineProperty(i,"INVALID_TRACEID",{enumerable:true,get:function(){return I.INVALID_TRACEID}});Object.defineProperty(i,"INVALID_SPAN_CONTEXT",{enumerable:true,get:function(){return I.INVALID_SPAN_CONTEXT}});const w=a(35751);Object.defineProperty(i,"context",{enumerable:true,get:function(){return w.context}});const S=a(35654);Object.defineProperty(i,"diag",{enumerable:true,get:function(){return S.diag}});const Q=a(77090);Object.defineProperty(i,"metrics",{enumerable:true,get:function(){return Q.metrics}});const x=a(40113);Object.defineProperty(i,"propagation",{enumerable:true,get:function(){return x.propagation}});const N=a(82227);Object.defineProperty(i,"trace",{enumerable:true,get:function(){return N.trace}});i["default"]={context:w.context,diag:S.diag,metrics:Q.metrics,propagation:x.propagation,trace:N.trace}},17533:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.unregisterGlobal=i.getGlobal=i.registerGlobal=void 0;const s=a(11207);const l=a(23445);const c=a(54610);const p=l.VERSION.split(".")[0];const d=Symbol.for(`opentelemetry.js.api.${p}`);const u=s._globalThis;function registerGlobal(r,i,a,s=false){var c;const p=u[d]=(c=u[d])!==null&&c!==void 0?c:{version:l.VERSION};if(!s&&p[r]){const i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${r}`);a.error(i.stack||i.message);return false}if(p.version!==l.VERSION){const i=new Error(`@opentelemetry/api: Registration of version v${p.version} for ${r} does not match previously registered API v${l.VERSION}`);a.error(i.stack||i.message);return false}p[r]=i;a.debug(`@opentelemetry/api: Registered a global for ${r} v${l.VERSION}.`);return true}i.registerGlobal=registerGlobal;function getGlobal(r){var i,a;const s=(i=u[d])===null||i===void 0?void 0:i.version;if(!s||!(0,c.isCompatible)(s)){return}return(a=u[d])===null||a===void 0?void 0:a[r]}i.getGlobal=getGlobal;function unregisterGlobal(r,i){i.debug(`@opentelemetry/api: Unregistering a global for ${r} v${l.VERSION}.`);const a=u[d];if(a){delete a[r]}}i.unregisterGlobal=unregisterGlobal},54610:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isCompatible=i._makeCompatibilityCheck=void 0;const s=a(23445);const l=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function _makeCompatibilityCheck(r){const i=new Set([r]);const a=new Set;const s=r.match(l);if(!s){return()=>false}const c={major:+s[1],minor:+s[2],patch:+s[3],prerelease:s[4]};if(c.prerelease!=null){return function isExactmatch(i){return i===r}}function _reject(r){a.add(r);return false}function _accept(r){i.add(r);return true}return function isCompatible(r){if(i.has(r)){return true}if(a.has(r)){return false}const s=r.match(l);if(!s){return _reject(r)}const p={major:+s[1],minor:+s[2],patch:+s[3],prerelease:s[4]};if(p.prerelease!=null){return _reject(r)}if(c.major!==p.major){return _reject(r)}if(c.major===0){if(c.minor===p.minor&&c.patch<=p.patch){return _accept(r)}return _reject(r)}if(c.minor<=p.minor){return _accept(r)}return _reject(r)}}i._makeCompatibilityCheck=_makeCompatibilityCheck;i.isCompatible=_makeCompatibilityCheck(s.VERSION)},77090:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.metrics=void 0;const s=a(42537);i.metrics=s.MetricsAPI.getInstance()},8809:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ValueType=void 0;var a;(function(r){r[r["INT"]=0]="INT";r[r["DOUBLE"]=1]="DOUBLE"})(a=i.ValueType||(i.ValueType={}))},90783:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createNoopMeter=i.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=i.NOOP_OBSERVABLE_GAUGE_METRIC=i.NOOP_OBSERVABLE_COUNTER_METRIC=i.NOOP_UP_DOWN_COUNTER_METRIC=i.NOOP_HISTOGRAM_METRIC=i.NOOP_COUNTER_METRIC=i.NOOP_METER=i.NoopObservableUpDownCounterMetric=i.NoopObservableGaugeMetric=i.NoopObservableCounterMetric=i.NoopObservableMetric=i.NoopHistogramMetric=i.NoopUpDownCounterMetric=i.NoopCounterMetric=i.NoopMetric=i.NoopMeter=void 0;class NoopMeter{constructor(){}createHistogram(r,a){return i.NOOP_HISTOGRAM_METRIC}createCounter(r,a){return i.NOOP_COUNTER_METRIC}createUpDownCounter(r,a){return i.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(r,a){return i.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(r,a){return i.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(r,a){return i.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(r,i){}removeBatchObservableCallback(r){}}i.NoopMeter=NoopMeter;class NoopMetric{}i.NoopMetric=NoopMetric;class NoopCounterMetric extends NoopMetric{add(r,i){}}i.NoopCounterMetric=NoopCounterMetric;class NoopUpDownCounterMetric extends NoopMetric{add(r,i){}}i.NoopUpDownCounterMetric=NoopUpDownCounterMetric;class NoopHistogramMetric extends NoopMetric{record(r,i){}}i.NoopHistogramMetric=NoopHistogramMetric;class NoopObservableMetric{addCallback(r){}removeCallback(r){}}i.NoopObservableMetric=NoopObservableMetric;class NoopObservableCounterMetric extends NoopObservableMetric{}i.NoopObservableCounterMetric=NoopObservableCounterMetric;class NoopObservableGaugeMetric extends NoopObservableMetric{}i.NoopObservableGaugeMetric=NoopObservableGaugeMetric;class NoopObservableUpDownCounterMetric extends NoopObservableMetric{}i.NoopObservableUpDownCounterMetric=NoopObservableUpDownCounterMetric;i.NOOP_METER=new NoopMeter;i.NOOP_COUNTER_METRIC=new NoopCounterMetric;i.NOOP_HISTOGRAM_METRIC=new NoopHistogramMetric;i.NOOP_UP_DOWN_COUNTER_METRIC=new NoopUpDownCounterMetric;i.NOOP_OBSERVABLE_COUNTER_METRIC=new NoopObservableCounterMetric;i.NOOP_OBSERVABLE_GAUGE_METRIC=new NoopObservableGaugeMetric;i.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new NoopObservableUpDownCounterMetric;function createNoopMeter(){return i.NOOP_METER}i.createNoopMeter=createNoopMeter},94749:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NOOP_METER_PROVIDER=i.NoopMeterProvider=void 0;const s=a(90783);class NoopMeterProvider{getMeter(r,i,a){return s.NOOP_METER}}i.NoopMeterProvider=NoopMeterProvider;i.NOOP_METER_PROVIDER=new NoopMeterProvider},11207:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__exportStar||function(r,i){for(var a in r)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a))s(i,r,a)};Object.defineProperty(i,"__esModule",{value:true});l(a(45362),i)},776:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i._globalThis=void 0;i._globalThis=typeof globalThis==="object"?globalThis:global},45362:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__exportStar||function(r,i){for(var a in r)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a))s(i,r,a)};Object.defineProperty(i,"__esModule",{value:true});l(a(776),i)},40113:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.propagation=void 0;const s=a(68276);i.propagation=s.PropagationAPI.getInstance()},95911:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopTextMapPropagator=void 0;class NoopTextMapPropagator{inject(r,i){}extract(r,i){return r}fields(){return[]}}i.NoopTextMapPropagator=NoopTextMapPropagator},84216:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.defaultTextMapSetter=i.defaultTextMapGetter=void 0;i.defaultTextMapGetter={get(r,i){if(r==null){return undefined}return r[i]},keys(r){if(r==null){return[]}return Object.keys(r)}};i.defaultTextMapSetter={set(r,i,a){if(r==null){return}r[i]=a}}},82227:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.trace=void 0;const s=a(80978);i.trace=s.TraceAPI.getInstance()},75484:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NonRecordingSpan=void 0;const s=a(35259);class NonRecordingSpan{constructor(r=s.INVALID_SPAN_CONTEXT){this._spanContext=r}spanContext(){return this._spanContext}setAttribute(r,i){return this}setAttributes(r){return this}addEvent(r,i){return this}setStatus(r){return this}updateName(r){return this}end(r){}isRecording(){return false}recordException(r,i){}}i.NonRecordingSpan=NonRecordingSpan},88248:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopTracer=void 0;const s=a(10597);const l=a(50401);const c=a(75484);const p=a(66659);const d=s.ContextAPI.getInstance();class NoopTracer{startSpan(r,i,a=d.active()){const s=Boolean(i===null||i===void 0?void 0:i.root);if(s){return new c.NonRecordingSpan}const u=a&&(0,l.getSpanContext)(a);if(isSpanContext(u)&&(0,p.isSpanContextValid)(u)){return new c.NonRecordingSpan(u)}else{return new c.NonRecordingSpan}}startActiveSpan(r,i,a,s){let c;let p;let u;if(arguments.length<2){return}else if(arguments.length===2){u=i}else if(arguments.length===3){c=i;u=a}else{c=i;p=a;u=s}const A=p!==null&&p!==void 0?p:d.active();const h=this.startSpan(r,c,A);const g=(0,l.setSpan)(A,h);return d.with(g,u,undefined,h)}}i.NoopTracer=NoopTracer;function isSpanContext(r){return typeof r==="object"&&typeof r["spanId"]==="string"&&typeof r["traceId"]==="string"&&typeof r["traceFlags"]==="number"}},32495:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopTracerProvider=void 0;const s=a(88248);class NoopTracerProvider{getTracer(r,i,a){return new s.NoopTracer}}i.NoopTracerProvider=NoopTracerProvider},91804:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ProxyTracer=void 0;const s=a(88248);const l=new s.NoopTracer;class ProxyTracer{constructor(r,i,a,s){this._provider=r;this.name=i;this.version=a;this.options=s}startSpan(r,i,a){return this._getTracer().startSpan(r,i,a)}startActiveSpan(r,i,a,s){const l=this._getTracer();return Reflect.apply(l.startActiveSpan,l,arguments)}_getTracer(){if(this._delegate){return this._delegate}const r=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!r){return l}this._delegate=r;return this._delegate}}i.ProxyTracer=ProxyTracer},33241:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ProxyTracerProvider=void 0;const s=a(91804);const l=a(32495);const c=new l.NoopTracerProvider;class ProxyTracerProvider{getTracer(r,i,a){var l;return(l=this.getDelegateTracer(r,i,a))!==null&&l!==void 0?l:new s.ProxyTracer(this,r,i,a)}getDelegate(){var r;return(r=this._delegate)!==null&&r!==void 0?r:c}setDelegate(r){this._delegate=r}getDelegateTracer(r,i,a){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(r,i,a)}}i.ProxyTracerProvider=ProxyTracerProvider},63046:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SamplingDecision=void 0;var a;(function(r){r[r["NOT_RECORD"]=0]="NOT_RECORD";r[r["RECORD"]=1]="RECORD";r[r["RECORD_AND_SAMPLED"]=2]="RECORD_AND_SAMPLED"})(a=i.SamplingDecision||(i.SamplingDecision={}))},50401:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getSpanContext=i.setSpanContext=i.deleteSpan=i.setSpan=i.getActiveSpan=i.getSpan=void 0;const s=a(88521);const l=a(75484);const c=a(10597);const p=(0,s.createContextKey)("OpenTelemetry Context Key SPAN");function getSpan(r){return r.getValue(p)||undefined}i.getSpan=getSpan;function getActiveSpan(){return getSpan(c.ContextAPI.getInstance().active())}i.getActiveSpan=getActiveSpan;function setSpan(r,i){return r.setValue(p,i)}i.setSpan=setSpan;function deleteSpan(r){return r.deleteValue(p)}i.deleteSpan=deleteSpan;function setSpanContext(r,i){return setSpan(r,new l.NonRecordingSpan(i))}i.setSpanContext=setSpanContext;function getSpanContext(r){var i;return(i=getSpan(r))===null||i===void 0?void 0:i.spanContext()}i.getSpanContext=getSpanContext},64503:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.TraceStateImpl=void 0;const s=a(51864);const l=32;const c=512;const p=",";const d="=";class TraceStateImpl{constructor(r){this._internalState=new Map;if(r)this._parse(r)}set(r,i){const a=this._clone();if(a._internalState.has(r)){a._internalState.delete(r)}a._internalState.set(r,i);return a}unset(r){const i=this._clone();i._internalState.delete(r);return i}get(r){return this._internalState.get(r)}serialize(){return this._keys().reduce(((r,i)=>{r.push(i+d+this.get(i));return r}),[]).join(p)}_parse(r){if(r.length>c)return;this._internalState=r.split(p).reverse().reduce(((r,i)=>{const a=i.trim();const l=a.indexOf(d);if(l!==-1){const c=a.slice(0,l);const p=a.slice(l+1,i.length);if((0,s.validateKey)(c)&&(0,s.validateValue)(p)){r.set(c,p)}else{}}return r}),new Map);if(this._internalState.size>l){this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,l))}}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const r=new TraceStateImpl;r._internalState=new Map(this._internalState);return r}}i.TraceStateImpl=TraceStateImpl},51864:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.validateValue=i.validateKey=void 0;const a="[_0-9a-z-*/]";const s=`[a-z]${a}{0,255}`;const l=`[a-z0-9]${a}{0,240}@[a-z]${a}{0,13}`;const c=new RegExp(`^(?:${s}|${l})$`);const p=/^[ -~]{0,255}[!-~]$/;const d=/,|=/;function validateKey(r){return c.test(r)}i.validateKey=validateKey;function validateValue(r){return p.test(r)&&!d.test(r)}i.validateValue=validateValue},93222:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createTraceState=void 0;const s=a(64503);function createTraceState(r){return new s.TraceStateImpl(r)}i.createTraceState=createTraceState},35259:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.INVALID_SPAN_CONTEXT=i.INVALID_TRACEID=i.INVALID_SPANID=void 0;const s=a(52970);i.INVALID_SPANID="0000000000000000";i.INVALID_TRACEID="00000000000000000000000000000000";i.INVALID_SPAN_CONTEXT={traceId:i.INVALID_TRACEID,spanId:i.INVALID_SPANID,traceFlags:s.TraceFlags.NONE}},844:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SpanKind=void 0;var a;(function(r){r[r["INTERNAL"]=0]="INTERNAL";r[r["SERVER"]=1]="SERVER";r[r["CLIENT"]=2]="CLIENT";r[r["PRODUCER"]=3]="PRODUCER";r[r["CONSUMER"]=4]="CONSUMER"})(a=i.SpanKind||(i.SpanKind={}))},66659:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.wrapSpanContext=i.isSpanContextValid=i.isValidSpanId=i.isValidTraceId=void 0;const s=a(35259);const l=a(75484);const c=/^([0-9a-f]{32})$/i;const p=/^[0-9a-f]{16}$/i;function isValidTraceId(r){return c.test(r)&&r!==s.INVALID_TRACEID}i.isValidTraceId=isValidTraceId;function isValidSpanId(r){return p.test(r)&&r!==s.INVALID_SPANID}i.isValidSpanId=isValidSpanId;function isSpanContextValid(r){return isValidTraceId(r.traceId)&&isValidSpanId(r.spanId)}i.isSpanContextValid=isSpanContextValid;function wrapSpanContext(r){return new l.NonRecordingSpan(r)}i.wrapSpanContext=wrapSpanContext},19889:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SpanStatusCode=void 0;var a;(function(r){r[r["UNSET"]=0]="UNSET";r[r["OK"]=1]="OK";r[r["ERROR"]=2]="ERROR"})(a=i.SpanStatusCode||(i.SpanStatusCode={}))},52970:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.TraceFlags=void 0;var a;(function(r){r[r["NONE"]=0]="NONE";r[r["SAMPLED"]=1]="SAMPLED"})(a=i.TraceFlags||(i.TraceFlags={}))},23445:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.VERSION=void 0;i.VERSION="1.8.0"},36655:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.ClientStreamingCall=void 0;class ClientStreamingCall{constructor(r,i,a,s,l,c,p){this.method=r;this.requestHeaders=i;this.requests=a;this.headers=s;this.response=l;this.status=c;this.trailers=p}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return a(this,void 0,void 0,(function*(){let[r,i,a,s]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:r,response:i,status:a,trailers:s}}))}}i.ClientStreamingCall=ClientStreamingCall},33544:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Deferred=i.DeferredState=void 0;var a;(function(r){r[r["PENDING"]=0]="PENDING";r[r["REJECTED"]=1]="REJECTED";r[r["RESOLVED"]=2]="RESOLVED"})(a=i.DeferredState||(i.DeferredState={}));class Deferred{constructor(r=true){this._state=a.PENDING;this._promise=new Promise(((r,i)=>{this._resolve=r;this._reject=i}));if(r){this._promise.catch((r=>{}))}}get state(){return this._state}get promise(){return this._promise}resolve(r){if(this.state!==a.PENDING)throw new Error(`cannot resolve ${a[this.state].toLowerCase()}`);this._resolve(r);this._state=a.RESOLVED}reject(r){if(this.state!==a.PENDING)throw new Error(`cannot reject ${a[this.state].toLowerCase()}`);this._reject(r);this._state=a.REJECTED}resolvePending(r){if(this._state===a.PENDING)this.resolve(r)}rejectPending(r){if(this._state===a.PENDING)this.reject(r)}}i.Deferred=Deferred},12692:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.DuplexStreamingCall=void 0;class DuplexStreamingCall{constructor(r,i,a,s,l,c,p){this.method=r;this.requestHeaders=i;this.requests=a;this.headers=s;this.responses=l;this.status=c;this.trailers=p}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return a(this,void 0,void 0,(function*(){let[r,i,a]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:r,status:i,trailers:a}}))}}i.DuplexStreamingCall=DuplexStreamingCall},83006:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(22345);Object.defineProperty(i,"ServiceType",{enumerable:true,get:function(){return s.ServiceType}});var l=a(72911);Object.defineProperty(i,"readMethodOptions",{enumerable:true,get:function(){return l.readMethodOptions}});Object.defineProperty(i,"readMethodOption",{enumerable:true,get:function(){return l.readMethodOption}});Object.defineProperty(i,"readServiceOption",{enumerable:true,get:function(){return l.readServiceOption}});var c=a(79135);Object.defineProperty(i,"RpcError",{enumerable:true,get:function(){return c.RpcError}});var p=a(10877);Object.defineProperty(i,"mergeRpcOptions",{enumerable:true,get:function(){return p.mergeRpcOptions}});var d=a(18962);Object.defineProperty(i,"RpcOutputStreamController",{enumerable:true,get:function(){return d.RpcOutputStreamController}});var u=a(77578);Object.defineProperty(i,"TestTransport",{enumerable:true,get:function(){return u.TestTransport}});var A=a(33544);Object.defineProperty(i,"Deferred",{enumerable:true,get:function(){return A.Deferred}});Object.defineProperty(i,"DeferredState",{enumerable:true,get:function(){return A.DeferredState}});var h=a(12692);Object.defineProperty(i,"DuplexStreamingCall",{enumerable:true,get:function(){return h.DuplexStreamingCall}});var g=a(36655);Object.defineProperty(i,"ClientStreamingCall",{enumerable:true,get:function(){return g.ClientStreamingCall}});var y=a(80266);Object.defineProperty(i,"ServerStreamingCall",{enumerable:true,get:function(){return y.ServerStreamingCall}});var E=a(50037);Object.defineProperty(i,"UnaryCall",{enumerable:true,get:function(){return E.UnaryCall}});var b=a(85079);Object.defineProperty(i,"stackIntercept",{enumerable:true,get:function(){return b.stackIntercept}});Object.defineProperty(i,"stackDuplexStreamingInterceptors",{enumerable:true,get:function(){return b.stackDuplexStreamingInterceptors}});Object.defineProperty(i,"stackClientStreamingInterceptors",{enumerable:true,get:function(){return b.stackClientStreamingInterceptors}});Object.defineProperty(i,"stackServerStreamingInterceptors",{enumerable:true,get:function(){return b.stackServerStreamingInterceptors}});Object.defineProperty(i,"stackUnaryInterceptors",{enumerable:true,get:function(){return b.stackUnaryInterceptors}});var C=a(44576);Object.defineProperty(i,"ServerCallContextController",{enumerable:true,get:function(){return C.ServerCallContextController}})},72911:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.readServiceOption=i.readMethodOption=i.readMethodOptions=i.normalizeMethodInfo=void 0;const s=a(98604);function normalizeMethodInfo(r,i){var a,l,c;let p=r;p.service=i;p.localName=(a=p.localName)!==null&&a!==void 0?a:s.lowerCamelCase(p.name);p.serverStreaming=!!p.serverStreaming;p.clientStreaming=!!p.clientStreaming;p.options=(l=p.options)!==null&&l!==void 0?l:{};p.idempotency=(c=p.idempotency)!==null&&c!==void 0?c:undefined;return p}i.normalizeMethodInfo=normalizeMethodInfo;function readMethodOptions(r,i,a,s){var l;const c=(l=r.methods.find(((r,a)=>r.localName===i||a===i)))===null||l===void 0?void 0:l.options;return c&&c[a]?s.fromJson(c[a]):undefined}i.readMethodOptions=readMethodOptions;function readMethodOption(r,i,a,s){var l;const c=(l=r.methods.find(((r,a)=>r.localName===i||a===i)))===null||l===void 0?void 0:l.options;if(!c){return undefined}const p=c[a];if(p===undefined){return p}return s?s.fromJson(p):p}i.readMethodOption=readMethodOption;function readServiceOption(r,i,a){const s=r.options;if(!s){return undefined}const l=s[i];if(l===undefined){return l}return a?a.fromJson(l):l}i.readServiceOption=readServiceOption},79135:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.RpcError=void 0;class RpcError extends Error{constructor(r,i="UNKNOWN",a){super(r);this.name="RpcError";Object.setPrototypeOf(this,new.target.prototype);this.code=i;this.meta=a!==null&&a!==void 0?a:{}}toString(){const r=[this.name+": "+this.message];if(this.code){r.push("");r.push("Code: "+this.code)}if(this.serviceName&&this.methodName){r.push("Method: "+this.serviceName+"/"+this.methodName)}let i=Object.entries(this.meta);if(i.length){r.push("");r.push("Meta:");for(let[a,s]of i){r.push(` ${a}: ${s}`)}}return r.join("\n")}}i.RpcError=RpcError},85079:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.stackDuplexStreamingInterceptors=i.stackClientStreamingInterceptors=i.stackServerStreamingInterceptors=i.stackUnaryInterceptors=i.stackIntercept=void 0;const s=a(98604);function stackIntercept(r,i,a,l,c){var p,d,u,A;if(r=="unary"){let tail=(r,a,s)=>i.unary(r,a,s);for(const r of((p=l.interceptors)!==null&&p!==void 0?p:[]).filter((r=>r.interceptUnary)).reverse()){const i=tail;tail=(a,s,l)=>r.interceptUnary(i,a,s,l)}return tail(a,c,l)}if(r=="serverStreaming"){let tail=(r,a,s)=>i.serverStreaming(r,a,s);for(const r of((d=l.interceptors)!==null&&d!==void 0?d:[]).filter((r=>r.interceptServerStreaming)).reverse()){const i=tail;tail=(a,s,l)=>r.interceptServerStreaming(i,a,s,l)}return tail(a,c,l)}if(r=="clientStreaming"){let tail=(r,a)=>i.clientStreaming(r,a);for(const r of((u=l.interceptors)!==null&&u!==void 0?u:[]).filter((r=>r.interceptClientStreaming)).reverse()){const i=tail;tail=(a,s)=>r.interceptClientStreaming(i,a,s)}return tail(a,l)}if(r=="duplex"){let tail=(r,a)=>i.duplex(r,a);for(const r of((A=l.interceptors)!==null&&A!==void 0?A:[]).filter((r=>r.interceptDuplex)).reverse()){const i=tail;tail=(a,s)=>r.interceptDuplex(i,a,s)}return tail(a,l)}s.assertNever(r)}i.stackIntercept=stackIntercept;function stackUnaryInterceptors(r,i,a,s){return stackIntercept("unary",r,i,s,a)}i.stackUnaryInterceptors=stackUnaryInterceptors;function stackServerStreamingInterceptors(r,i,a,s){return stackIntercept("serverStreaming",r,i,s,a)}i.stackServerStreamingInterceptors=stackServerStreamingInterceptors;function stackClientStreamingInterceptors(r,i,a){return stackIntercept("clientStreaming",r,i,a)}i.stackClientStreamingInterceptors=stackClientStreamingInterceptors;function stackDuplexStreamingInterceptors(r,i,a){return stackIntercept("duplex",r,i,a)}i.stackDuplexStreamingInterceptors=stackDuplexStreamingInterceptors},10877:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.mergeRpcOptions=void 0;const s=a(98604);function mergeRpcOptions(r,i){if(!i)return r;let a={};copy(r,a);copy(i,a);for(let l of Object.keys(i)){let c=i[l];switch(l){case"jsonOptions":a.jsonOptions=s.mergeJsonOptions(r.jsonOptions,a.jsonOptions);break;case"binaryOptions":a.binaryOptions=s.mergeBinaryOptions(r.binaryOptions,a.binaryOptions);break;case"meta":a.meta={};copy(r.meta,a.meta);copy(i.meta,a.meta);break;case"interceptors":a.interceptors=r.interceptors?r.interceptors.concat(c):c.concat();break}}return a}i.mergeRpcOptions=mergeRpcOptions;function copy(r,i){if(!r)return;let a=i;for(let[i,s]of Object.entries(r)){if(s instanceof Date)a[i]=new Date(s.getTime());else if(Array.isArray(s))a[i]=s.concat();else a[i]=s}}},18962:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.RpcOutputStreamController=void 0;const s=a(33544);const l=a(98604);class RpcOutputStreamController{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]};this._closed=false}onNext(r){return this.addLis(r,this._lis.nxt)}onMessage(r){return this.addLis(r,this._lis.msg)}onError(r){return this.addLis(r,this._lis.err)}onComplete(r){return this.addLis(r,this._lis.cmp)}addLis(r,i){i.push(r);return()=>{let a=i.indexOf(r);if(a>=0)i.splice(a,1)}}clearLis(){for(let r of Object.values(this._lis))r.splice(0,r.length)}get closed(){return this._closed!==false}notifyNext(r,i,a){l.assert((r?1:0)+(i?1:0)+(a?1:0)<=1,"only one emission at a time");if(r)this.notifyMessage(r);if(i)this.notifyError(i);if(a)this.notifyComplete()}notifyMessage(r){l.assert(!this.closed,"stream is closed");this.pushIt({value:r,done:false});this._lis.msg.forEach((i=>i(r)));this._lis.nxt.forEach((i=>i(r,undefined,false)))}notifyError(r){l.assert(!this.closed,"stream is closed");this._closed=r;this.pushIt(r);this._lis.err.forEach((i=>i(r)));this._lis.nxt.forEach((i=>i(undefined,r,false)));this.clearLis()}notifyComplete(){l.assert(!this.closed,"stream is closed");this._closed=true;this.pushIt({value:null,done:true});this._lis.cmp.forEach((r=>r()));this._lis.nxt.forEach((r=>r(undefined,undefined,true)));this.clearLis()}[Symbol.asyncIterator](){if(!this._itState){this._itState={q:[]}}if(this._closed===true)this.pushIt({value:null,done:true});else if(this._closed!==false)this.pushIt(this._closed);return{next:()=>{let r=this._itState;l.assert(r,"bad state");l.assert(!r.p,"iterator contract broken");let i=r.q.shift();if(i)return"value"in i?Promise.resolve(i):Promise.reject(i);r.p=new s.Deferred;return r.p.promise}}}pushIt(r){let i=this._itState;if(!i)return;if(i.p){const a=i.p;l.assert(a.state==s.DeferredState.PENDING,"iterator contract broken");"value"in r?a.resolve(r):a.reject(r);delete i.p}else{i.q.push(r)}}}i.RpcOutputStreamController=RpcOutputStreamController},44576:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ServerCallContextController=void 0;class ServerCallContextController{constructor(r,i,a,s,l={code:"OK",detail:""}){this._cancelled=false;this._listeners=[];this.method=r;this.headers=i;this.deadline=a;this.trailers={};this._sendRH=s;this.status=l}notifyCancelled(){if(!this._cancelled){this._cancelled=true;for(let r of this._listeners){r()}}}sendResponseHeaders(r){this._sendRH(r)}get cancelled(){return this._cancelled}onCancel(r){const i=this._listeners;i.push(r);return()=>{let a=i.indexOf(r);if(a>=0)i.splice(a,1)}}}i.ServerCallContextController=ServerCallContextController},80266:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.ServerStreamingCall=void 0;class ServerStreamingCall{constructor(r,i,a,s,l,c,p){this.method=r;this.requestHeaders=i;this.request=a;this.headers=s;this.responses=l;this.status=c;this.trailers=p}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return a(this,void 0,void 0,(function*(){let[r,i,a]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:r,status:i,trailers:a}}))}}i.ServerStreamingCall=ServerStreamingCall},22345:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ServiceType=void 0;const s=a(72911);class ServiceType{constructor(r,i,a){this.typeName=r;this.methods=i.map((r=>s.normalizeMethodInfo(r,this)));this.options=a!==null&&a!==void 0?a:{}}}i.ServiceType=ServiceType},77578:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.TestTransport=void 0;const l=a(79135);const c=a(98604);const p=a(18962);const d=a(10877);const u=a(50037);const A=a(80266);const h=a(36655);const g=a(12692);class TestTransport{constructor(r){this.suppressUncaughtRejections=true;this.headerDelay=10;this.responseDelay=50;this.betweenResponseDelay=10;this.afterResponseDelay=10;this.data=r!==null&&r!==void 0?r:{}}get sentMessages(){if(this.lastInput instanceof TestInputStream){return this.lastInput.sent}else if(typeof this.lastInput=="object"){return[this.lastInput.single]}return[]}get sendComplete(){if(this.lastInput instanceof TestInputStream){return this.lastInput.completed}else if(typeof this.lastInput=="object"){return true}return false}promiseHeaders(){var r;const i=(r=this.data.headers)!==null&&r!==void 0?r:TestTransport.defaultHeaders;return i instanceof l.RpcError?Promise.reject(i):Promise.resolve(i)}promiseSingleResponse(r){if(this.data.response instanceof l.RpcError){return Promise.reject(this.data.response)}let i;if(Array.isArray(this.data.response)){c.assert(this.data.response.length>0);i=this.data.response[0]}else if(this.data.response!==undefined){i=this.data.response}else{i=r.O.create()}c.assert(r.O.is(i));return Promise.resolve(i)}streamResponses(r,i,a){return s(this,void 0,void 0,(function*(){const s=[];if(this.data.response===undefined){s.push(r.O.create())}else if(Array.isArray(this.data.response)){for(let i of this.data.response){c.assert(r.O.is(i));s.push(i)}}else if(!(this.data.response instanceof l.RpcError)){c.assert(r.O.is(this.data.response));s.push(this.data.response)}try{yield delay(this.responseDelay,a)(undefined)}catch(r){i.notifyError(r);return}if(this.data.response instanceof l.RpcError){i.notifyError(this.data.response);return}for(let r of s){i.notifyMessage(r);try{yield delay(this.betweenResponseDelay,a)(undefined)}catch(r){i.notifyError(r);return}}if(this.data.status instanceof l.RpcError){i.notifyError(this.data.status);return}if(this.data.trailers instanceof l.RpcError){i.notifyError(this.data.trailers);return}i.notifyComplete()}))}promiseStatus(){var r;const i=(r=this.data.status)!==null&&r!==void 0?r:TestTransport.defaultStatus;return i instanceof l.RpcError?Promise.reject(i):Promise.resolve(i)}promiseTrailers(){var r;const i=(r=this.data.trailers)!==null&&r!==void 0?r:TestTransport.defaultTrailers;return i instanceof l.RpcError?Promise.reject(i):Promise.resolve(i)}maybeSuppressUncaught(...r){if(this.suppressUncaughtRejections){for(let i of r){i.catch((()=>{}))}}}mergeOptions(r){return d.mergeRpcOptions({},r)}unary(r,i,a){var s;const l=(s=a.meta)!==null&&s!==void 0?s:{},c=this.promiseHeaders().then(delay(this.headerDelay,a.abort)),p=c.catch((r=>{})).then(delay(this.responseDelay,a.abort)).then((i=>this.promiseSingleResponse(r))),d=p.catch((r=>{})).then(delay(this.afterResponseDelay,a.abort)).then((r=>this.promiseStatus())),A=p.catch((r=>{})).then(delay(this.afterResponseDelay,a.abort)).then((r=>this.promiseTrailers()));this.maybeSuppressUncaught(d,A);this.lastInput={single:i};return new u.UnaryCall(r,l,i,c,p,d,A)}serverStreaming(r,i,a){var s;const l=(s=a.meta)!==null&&s!==void 0?s:{},c=this.promiseHeaders().then(delay(this.headerDelay,a.abort)),d=new p.RpcOutputStreamController,u=c.then(delay(this.responseDelay,a.abort)).catch((()=>{})).then((()=>this.streamResponses(r,d,a.abort))).then(delay(this.afterResponseDelay,a.abort)),h=u.then((()=>this.promiseStatus())),g=u.then((()=>this.promiseTrailers()));this.maybeSuppressUncaught(h,g);this.lastInput={single:i};return new A.ServerStreamingCall(r,l,i,c,d,h,g)}clientStreaming(r,i){var a;const s=(a=i.meta)!==null&&a!==void 0?a:{},l=this.promiseHeaders().then(delay(this.headerDelay,i.abort)),c=l.catch((r=>{})).then(delay(this.responseDelay,i.abort)).then((i=>this.promiseSingleResponse(r))),p=c.catch((r=>{})).then(delay(this.afterResponseDelay,i.abort)).then((r=>this.promiseStatus())),d=c.catch((r=>{})).then(delay(this.afterResponseDelay,i.abort)).then((r=>this.promiseTrailers()));this.maybeSuppressUncaught(p,d);this.lastInput=new TestInputStream(this.data,i.abort);return new h.ClientStreamingCall(r,s,this.lastInput,l,c,p,d)}duplex(r,i){var a;const s=(a=i.meta)!==null&&a!==void 0?a:{},l=this.promiseHeaders().then(delay(this.headerDelay,i.abort)),c=new p.RpcOutputStreamController,d=l.then(delay(this.responseDelay,i.abort)).catch((()=>{})).then((()=>this.streamResponses(r,c,i.abort))).then(delay(this.afterResponseDelay,i.abort)),u=d.then((()=>this.promiseStatus())),A=d.then((()=>this.promiseTrailers()));this.maybeSuppressUncaught(u,A);this.lastInput=new TestInputStream(this.data,i.abort);return new g.DuplexStreamingCall(r,s,this.lastInput,l,c,u,A)}}i.TestTransport=TestTransport;TestTransport.defaultHeaders={responseHeader:"test"};TestTransport.defaultStatus={code:"OK",detail:"all good"};TestTransport.defaultTrailers={responseTrailer:"test"};function delay(r,i){return a=>new Promise(((s,c)=>{if(i===null||i===void 0?void 0:i.aborted){c(new l.RpcError("user cancel","CANCELLED"))}else{const p=setTimeout((()=>s(a)),r);if(i){i.addEventListener("abort",(r=>{clearTimeout(p);c(new l.RpcError("user cancel","CANCELLED"))}))}}}))}class TestInputStream{constructor(r,i){this._completed=false;this._sent=[];this.data=r;this.abort=i}get sent(){return this._sent}get completed(){return this._completed}send(r){if(this.data.inputMessage instanceof l.RpcError){return Promise.reject(this.data.inputMessage)}const i=this.data.inputMessage===undefined?10:this.data.inputMessage;return Promise.resolve(undefined).then((()=>{this._sent.push(r)})).then(delay(i,this.abort))}complete(){if(this.data.inputComplete instanceof l.RpcError){return Promise.reject(this.data.inputComplete)}const r=this.data.inputComplete===undefined?10:this.data.inputComplete;return Promise.resolve(undefined).then((()=>{this._completed=true})).then(delay(r,this.abort))}}},50037:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.UnaryCall=void 0;class UnaryCall{constructor(r,i,a,s,l,c,p){this.method=r;this.requestHeaders=i;this.request=a;this.headers=s;this.response=l;this.status=c;this.trailers=p}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return a(this,void 0,void 0,(function*(){let[r,i,a,s]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:r,response:i,status:a,trailers:s}}))}}i.UnaryCall=UnaryCall},18238:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.assertFloat32=i.assertUInt32=i.assertInt32=i.assertNever=i.assert=void 0;function assert(r,i){if(!r){throw new Error(i)}}i.assert=assert;function assertNever(r,i){throw new Error(i!==null&&i!==void 0?i:"Unexpected object: "+r)}i.assertNever=assertNever;const a=34028234663852886e22,s=-34028234663852886e22,l=4294967295,c=2147483647,p=-2147483648;function assertInt32(r){if(typeof r!=="number")throw new Error("invalid int 32: "+typeof r);if(!Number.isInteger(r)||r>c||rl||r<0)throw new Error("invalid uint 32: "+r)}i.assertUInt32=assertUInt32;function assertFloat32(r){if(typeof r!=="number")throw new Error("invalid float 32: "+typeof r);if(!Number.isFinite(r))return;if(r>a||r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.base64encode=i.base64decode=void 0;let a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let s=[];for(let r=0;r>4;d=p;c=2;break;case 2:a[l++]=(d&15)<<4|(p&60)>>2;d=p;c=3;break;case 3:a[l++]=(d&3)<<6|p;c=0;break}}if(c==1)throw Error(`invalid base64 string.`);return a.subarray(0,l)}i.base64decode=base64decode;function base64encode(r){let i="",s=0,l,c=0;for(let p=0;p>2];c=(l&3)<<4;s=1;break;case 1:i+=a[c|l>>4];c=(l&15)<<2;s=2;break;case 2:i+=a[c|l>>6];i+=a[l&63];s=0;break}}if(s){i+=a[c];i+="=";if(s==1)i+="="}return i}i.base64encode=base64encode},73775:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.WireType=i.mergeBinaryOptions=i.UnknownFieldHandler=void 0;var a;(function(r){r.symbol=Symbol.for("protobuf-ts/unknown");r.onRead=(i,a,s,l,c)=>{let p=is(a)?a[r.symbol]:a[r.symbol]=[];p.push({no:s,wireType:l,data:c})};r.onWrite=(i,a,s)=>{for(let{no:i,wireType:l,data:c}of r.list(a))s.tag(i,l).raw(c)};r.list=(i,a)=>{if(is(i)){let s=i[r.symbol];return a?s.filter((r=>r.no==a)):s}return[]};r.last=(i,a)=>r.list(i,a).slice(-1)[0];const is=i=>i&&Array.isArray(i[r.symbol])})(a=i.UnknownFieldHandler||(i.UnknownFieldHandler={}));function mergeBinaryOptions(r,i){return Object.assign(Object.assign({},r),i)}i.mergeBinaryOptions=mergeBinaryOptions;var s;(function(r){r[r["Varint"]=0]="Varint";r[r["Bit64"]=1]="Bit64";r[r["LengthDelimited"]=2]="LengthDelimited";r[r["StartGroup"]=3]="StartGroup";r[r["EndGroup"]=4]="EndGroup";r[r["Bit32"]=5]="Bit32"})(s=i.WireType||(i.WireType={}))},85095:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BinaryReader=i.binaryReadOptions=void 0;const s=a(73775);const l=a(25901);const c=a(75170);const p={readUnknownField:true,readerFactory:r=>new BinaryReader(r)};function binaryReadOptions(r){return r?Object.assign(Object.assign({},p),r):p}i.binaryReadOptions=binaryReadOptions;class BinaryReader{constructor(r,i){this.varint64=c.varint64read;this.uint32=c.varint32read;this.buf=r;this.len=r.length;this.pos=0;this.view=new DataView(r.buffer,r.byteOffset,r.byteLength);this.textDecoder=i!==null&&i!==void 0?i:new TextDecoder("utf-8",{fatal:true,ignoreBOM:true})}tag(){let r=this.uint32(),i=r>>>3,a=r&7;if(i<=0||a<0||a>5)throw new Error("illegal tag: field no "+i+" wire type "+a);return[i,a]}skip(r){let i=this.pos;switch(r){case s.WireType.Varint:while(this.buf[this.pos++]&128){}break;case s.WireType.Bit64:this.pos+=4;case s.WireType.Bit32:this.pos+=4;break;case s.WireType.LengthDelimited:let i=this.uint32();this.pos+=i;break;case s.WireType.StartGroup:let a;while((a=this.tag()[1])!==s.WireType.EndGroup){this.skip(a)}break;default:throw new Error("cant skip wire type "+r)}this.assertBounds();return this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let r=this.uint32();return r>>>1^-(r&1)}int64(){return new l.PbLong(...this.varint64())}uint64(){return new l.PbULong(...this.varint64())}sint64(){let[r,i]=this.varint64();let a=-(r&1);r=(r>>>1|(i&1)<<31)^a;i=i>>>1^a;return new l.PbLong(r,i)}bool(){let[r,i]=this.varint64();return r!==0||i!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,true)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,true)}fixed64(){return new l.PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new l.PbLong(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,true)}double(){return this.view.getFloat64((this.pos+=8)-8,true)}bytes(){let r=this.uint32();let i=this.pos;this.pos+=r;this.assertBounds();return this.buf.subarray(i,i+r)}string(){return this.textDecoder.decode(this.bytes())}}i.BinaryReader=BinaryReader},37745:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BinaryWriter=i.binaryWriteOptions=void 0;const s=a(25901);const l=a(75170);const c=a(18238);const p={writeUnknownFields:true,writerFactory:()=>new BinaryWriter};function binaryWriteOptions(r){return r?Object.assign(Object.assign({},p),r):p}i.binaryWriteOptions=binaryWriteOptions;class BinaryWriter{constructor(r){this.stack=[];this.textEncoder=r!==null&&r!==void 0?r:new TextEncoder;this.chunks=[];this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let r=0;for(let i=0;i>>0)}raw(r){if(this.buf.length){this.chunks.push(new Uint8Array(this.buf));this.buf=[]}this.chunks.push(r);return this}uint32(r){c.assertUInt32(r);while(r>127){this.buf.push(r&127|128);r=r>>>7}this.buf.push(r);return this}int32(r){c.assertInt32(r);l.varint32write(r,this.buf);return this}bool(r){this.buf.push(r?1:0);return this}bytes(r){this.uint32(r.byteLength);return this.raw(r)}string(r){let i=this.textEncoder.encode(r);this.uint32(i.byteLength);return this.raw(i)}float(r){c.assertFloat32(r);let i=new Uint8Array(4);new DataView(i.buffer).setFloat32(0,r,true);return this.raw(i)}double(r){let i=new Uint8Array(8);new DataView(i.buffer).setFloat64(0,r,true);return this.raw(i)}fixed32(r){c.assertUInt32(r);let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,r,true);return this.raw(i)}sfixed32(r){c.assertInt32(r);let i=new Uint8Array(4);new DataView(i.buffer).setInt32(0,r,true);return this.raw(i)}sint32(r){c.assertInt32(r);r=(r<<1^r>>31)>>>0;l.varint32write(r,this.buf);return this}sfixed64(r){let i=new Uint8Array(8);let a=new DataView(i.buffer);let l=s.PbLong.from(r);a.setInt32(0,l.lo,true);a.setInt32(4,l.hi,true);return this.raw(i)}fixed64(r){let i=new Uint8Array(8);let a=new DataView(i.buffer);let l=s.PbULong.from(r);a.setInt32(0,l.lo,true);a.setInt32(4,l.hi,true);return this.raw(i)}int64(r){let i=s.PbLong.from(r);l.varint64write(i.lo,i.hi,this.buf);return this}sint64(r){let i=s.PbLong.from(r),a=i.hi>>31,c=i.lo<<1^a,p=(i.hi<<1|i.lo>>>31)^a;l.varint64write(c,p,this.buf);return this}uint64(r){let i=s.PbULong.from(r);l.varint64write(i.lo,i.hi,this.buf);return this}}i.BinaryWriter=BinaryWriter},41638:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.listEnumNumbers=i.listEnumNames=i.listEnumValues=i.isEnumObject=void 0;function isEnumObject(r){if(typeof r!="object"||r===null){return false}if(!r.hasOwnProperty(0)){return false}for(let i of Object.keys(r)){let a=parseInt(i);if(!Number.isNaN(a)){let i=r[a];if(i===undefined)return false;if(r[i]!==a)return false}else{let a=r[i];if(a===undefined)return false;if(typeof a!=="number")return false;if(r[a]===undefined)return false}}return true}i.isEnumObject=isEnumObject;function listEnumValues(r){if(!isEnumObject(r))throw new Error("not a typescript enum object");let i=[];for(let[a,s]of Object.entries(r))if(typeof s=="number")i.push({name:a,number:s});return i}i.listEnumValues=listEnumValues;function listEnumNames(r){return listEnumValues(r).map((r=>r.name))}i.listEnumNames=listEnumNames;function listEnumNumbers(r){return listEnumValues(r).map((r=>r.number)).filter(((r,i,a)=>a.indexOf(r)==i))}i.listEnumNumbers=listEnumNumbers},75170:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.varint32read=i.varint32write=i.int64toString=i.int64fromString=i.varint64write=i.varint64read=void 0;function varint64read(){let r=0;let i=0;for(let a=0;a<28;a+=7){let s=this.buf[this.pos++];r|=(s&127)<>4;if((a&128)==0){this.assertBounds();return[r,i]}for(let a=3;a<=31;a+=7){let s=this.buf[this.pos++];i|=(s&127)<>>s;const c=!(l>>>7==0&&i==0);const p=(c?l|128:l)&255;a.push(p);if(!c){return}}const s=r>>>28&15|(i&7)<<4;const l=!(i>>3==0);a.push((l?s|128:s)&255);if(!l){return}for(let r=3;r<31;r=r+7){const s=i>>>r;const l=!(s>>>7==0);const c=(l?s|128:s)&255;a.push(c);if(!l){return}}a.push(i>>>31&1)}i.varint64write=varint64write;const a=(1<<16)*(1<<16);function int64fromString(r){let i=r[0]=="-";if(i)r=r.slice(1);const s=1e6;let l=0;let c=0;function add1e6digit(i,p){const d=Number(r.slice(i,p));c*=s;l=l*s+d;if(l>=a){c=c+(l/a|0);l=l%a}}add1e6digit(-24,-18);add1e6digit(-18,-12);add1e6digit(-12,-6);add1e6digit(-6);return[i,l,c]}i.int64fromString=int64fromString;function int64toString(r,i){if(i>>>0<=2097151){return""+(a*i+(r>>>0))}let s=r&16777215;let l=(r>>>24|i<<8)>>>0&16777215;let c=i>>16&65535;let p=s+l*6777216+c*6710656;let d=l+c*8147497;let u=c*2;let A=1e7;if(p>=A){d+=Math.floor(p/A);p%=A}if(d>=A){u+=Math.floor(d/A);d%=A}function decimalFrom1e7(r,i){let a=r?String(r):"";if(i){return"0000000".slice(a.length)+a}return a}return decimalFrom1e7(u,0)+decimalFrom1e7(d,u)+decimalFrom1e7(p,1)}i.int64toString=int64toString;function varint32write(r,i){if(r>=0){while(r>127){i.push(r&127|128);r=r>>>7}i.push(r)}else{for(let a=0;a<9;a++){i.push(r&127|128);r=r>>7}i.push(1)}}i.varint32write=varint32write;function varint32read(){let r=this.buf[this.pos++];let i=r&127;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&127)<<7;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&127)<<14;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&127)<<21;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&15)<<28;for(let i=5;(r&128)!==0&&i<10;i++)r=this.buf[this.pos++];if((r&128)!=0)throw new Error("invalid varint");this.assertBounds();return i>>>0}i.varint32read=varint32read},98604:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var s=a(65668);Object.defineProperty(i,"typeofJsonValue",{enumerable:true,get:function(){return s.typeofJsonValue}});Object.defineProperty(i,"isJsonObject",{enumerable:true,get:function(){return s.isJsonObject}});var l=a(54826);Object.defineProperty(i,"base64decode",{enumerable:true,get:function(){return l.base64decode}});Object.defineProperty(i,"base64encode",{enumerable:true,get:function(){return l.base64encode}});var c=a(93826);Object.defineProperty(i,"utf8read",{enumerable:true,get:function(){return c.utf8read}});var p=a(73775);Object.defineProperty(i,"WireType",{enumerable:true,get:function(){return p.WireType}});Object.defineProperty(i,"mergeBinaryOptions",{enumerable:true,get:function(){return p.mergeBinaryOptions}});Object.defineProperty(i,"UnknownFieldHandler",{enumerable:true,get:function(){return p.UnknownFieldHandler}});var d=a(85095);Object.defineProperty(i,"BinaryReader",{enumerable:true,get:function(){return d.BinaryReader}});Object.defineProperty(i,"binaryReadOptions",{enumerable:true,get:function(){return d.binaryReadOptions}});var u=a(37745);Object.defineProperty(i,"BinaryWriter",{enumerable:true,get:function(){return u.BinaryWriter}});Object.defineProperty(i,"binaryWriteOptions",{enumerable:true,get:function(){return u.binaryWriteOptions}});var A=a(25901);Object.defineProperty(i,"PbLong",{enumerable:true,get:function(){return A.PbLong}});Object.defineProperty(i,"PbULong",{enumerable:true,get:function(){return A.PbULong}});var h=a(24032);Object.defineProperty(i,"jsonReadOptions",{enumerable:true,get:function(){return h.jsonReadOptions}});Object.defineProperty(i,"jsonWriteOptions",{enumerable:true,get:function(){return h.jsonWriteOptions}});Object.defineProperty(i,"mergeJsonOptions",{enumerable:true,get:function(){return h.mergeJsonOptions}});var g=a(63673);Object.defineProperty(i,"MESSAGE_TYPE",{enumerable:true,get:function(){return g.MESSAGE_TYPE}});var y=a(1116);Object.defineProperty(i,"MessageType",{enumerable:true,get:function(){return y.MessageType}});var E=a(6108);Object.defineProperty(i,"ScalarType",{enumerable:true,get:function(){return E.ScalarType}});Object.defineProperty(i,"LongType",{enumerable:true,get:function(){return E.LongType}});Object.defineProperty(i,"RepeatType",{enumerable:true,get:function(){return E.RepeatType}});Object.defineProperty(i,"normalizeFieldInfo",{enumerable:true,get:function(){return E.normalizeFieldInfo}});Object.defineProperty(i,"readFieldOptions",{enumerable:true,get:function(){return E.readFieldOptions}});Object.defineProperty(i,"readFieldOption",{enumerable:true,get:function(){return E.readFieldOption}});Object.defineProperty(i,"readMessageOption",{enumerable:true,get:function(){return E.readMessageOption}});var b=a(86075);Object.defineProperty(i,"ReflectionTypeCheck",{enumerable:true,get:function(){return b.ReflectionTypeCheck}});var C=a(17769);Object.defineProperty(i,"reflectionCreate",{enumerable:true,get:function(){return C.reflectionCreate}});var v=a(31952);Object.defineProperty(i,"reflectionScalarDefault",{enumerable:true,get:function(){return v.reflectionScalarDefault}});var B=a(79155);Object.defineProperty(i,"reflectionMergePartial",{enumerable:true,get:function(){return B.reflectionMergePartial}});var I=a(65566);Object.defineProperty(i,"reflectionEquals",{enumerable:true,get:function(){return I.reflectionEquals}});var w=a(82529);Object.defineProperty(i,"ReflectionBinaryReader",{enumerable:true,get:function(){return w.ReflectionBinaryReader}});var S=a(51870);Object.defineProperty(i,"ReflectionBinaryWriter",{enumerable:true,get:function(){return S.ReflectionBinaryWriter}});var Q=a(87298);Object.defineProperty(i,"ReflectionJsonReader",{enumerable:true,get:function(){return Q.ReflectionJsonReader}});var x=a(76015);Object.defineProperty(i,"ReflectionJsonWriter",{enumerable:true,get:function(){return x.ReflectionJsonWriter}});var N=a(27840);Object.defineProperty(i,"containsMessageType",{enumerable:true,get:function(){return N.containsMessageType}});var R=a(71983);Object.defineProperty(i,"isOneofGroup",{enumerable:true,get:function(){return R.isOneofGroup}});Object.defineProperty(i,"setOneofValue",{enumerable:true,get:function(){return R.setOneofValue}});Object.defineProperty(i,"getOneofValue",{enumerable:true,get:function(){return R.getOneofValue}});Object.defineProperty(i,"clearOneofValue",{enumerable:true,get:function(){return R.clearOneofValue}});Object.defineProperty(i,"getSelectedOneofValue",{enumerable:true,get:function(){return R.getSelectedOneofValue}});var T=a(41638);Object.defineProperty(i,"listEnumValues",{enumerable:true,get:function(){return T.listEnumValues}});Object.defineProperty(i,"listEnumNames",{enumerable:true,get:function(){return T.listEnumNames}});Object.defineProperty(i,"listEnumNumbers",{enumerable:true,get:function(){return T.listEnumNumbers}});Object.defineProperty(i,"isEnumObject",{enumerable:true,get:function(){return T.isEnumObject}});var D=a(86283);Object.defineProperty(i,"lowerCamelCase",{enumerable:true,get:function(){return D.lowerCamelCase}});var k=a(18238);Object.defineProperty(i,"assert",{enumerable:true,get:function(){return k.assert}});Object.defineProperty(i,"assertNever",{enumerable:true,get:function(){return k.assertNever}});Object.defineProperty(i,"assertInt32",{enumerable:true,get:function(){return k.assertInt32}});Object.defineProperty(i,"assertUInt32",{enumerable:true,get:function(){return k.assertUInt32}});Object.defineProperty(i,"assertFloat32",{enumerable:true,get:function(){return k.assertFloat32}})},24032:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.mergeJsonOptions=i.jsonWriteOptions=i.jsonReadOptions=void 0;const a={emitDefaultValues:false,enumAsInteger:false,useProtoFieldName:false,prettySpaces:0},s={ignoreUnknownFields:false};function jsonReadOptions(r){return r?Object.assign(Object.assign({},s),r):s}i.jsonReadOptions=jsonReadOptions;function jsonWriteOptions(r){return r?Object.assign(Object.assign({},a),r):a}i.jsonWriteOptions=jsonWriteOptions;function mergeJsonOptions(r,i){var a,s;let l=Object.assign(Object.assign({},r),i);l.typeRegistry=[...(a=r===null||r===void 0?void 0:r.typeRegistry)!==null&&a!==void 0?a:[],...(s=i===null||i===void 0?void 0:i.typeRegistry)!==null&&s!==void 0?s:[]];return l}i.mergeJsonOptions=mergeJsonOptions},65668:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isJsonObject=i.typeofJsonValue=void 0;function typeofJsonValue(r){let i=typeof r;if(i=="object"){if(Array.isArray(r))return"array";if(r===null)return"null"}return i}i.typeofJsonValue=typeofJsonValue;function isJsonObject(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}i.isJsonObject=isJsonObject},86283:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.lowerCamelCase=void 0;function lowerCamelCase(r){let i=false;const a=[];for(let s=0;s{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MESSAGE_TYPE=void 0;i.MESSAGE_TYPE=Symbol.for("protobuf-ts/message-type")},1116:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MessageType=void 0;const s=a(63673);const l=a(6108);const c=a(86075);const p=a(87298);const d=a(76015);const u=a(82529);const A=a(51870);const h=a(17769);const g=a(79155);const y=a(65668);const E=a(24032);const b=a(65566);const C=a(37745);const v=a(85095);class MessageType{constructor(r,i,a){this.defaultCheckDepth=16;this.typeName=r;this.fields=i.map(l.normalizeFieldInfo);this.options=a!==null&&a!==void 0?a:{};this.messagePrototype=Object.defineProperty({},s.MESSAGE_TYPE,{value:this});this.refTypeCheck=new c.ReflectionTypeCheck(this);this.refJsonReader=new p.ReflectionJsonReader(this);this.refJsonWriter=new d.ReflectionJsonWriter(this);this.refBinReader=new u.ReflectionBinaryReader(this);this.refBinWriter=new A.ReflectionBinaryWriter(this)}create(r){let i=h.reflectionCreate(this);if(r!==undefined){g.reflectionMergePartial(this,i,r)}return i}clone(r){let i=this.create();g.reflectionMergePartial(this,i,r);return i}equals(r,i){return b.reflectionEquals(this,r,i)}is(r,i=this.defaultCheckDepth){return this.refTypeCheck.is(r,i,false)}isAssignable(r,i=this.defaultCheckDepth){return this.refTypeCheck.is(r,i,true)}mergePartial(r,i){g.reflectionMergePartial(this,r,i)}fromBinary(r,i){let a=v.binaryReadOptions(i);return this.internalBinaryRead(a.readerFactory(r),r.byteLength,a)}fromJson(r,i){return this.internalJsonRead(r,E.jsonReadOptions(i))}fromJsonString(r,i){let a=JSON.parse(r);return this.fromJson(a,i)}toJson(r,i){return this.internalJsonWrite(r,E.jsonWriteOptions(i))}toJsonString(r,i){var a;let s=this.toJson(r,i);return JSON.stringify(s,null,(a=i===null||i===void 0?void 0:i.prettySpaces)!==null&&a!==void 0?a:0)}toBinary(r,i){let a=C.binaryWriteOptions(i);return this.internalBinaryWrite(r,a.writerFactory(),a).finish()}internalJsonRead(r,i,a){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let s=a!==null&&a!==void 0?a:this.create();this.refJsonReader.read(r,s,i);return s}throw new Error(`Unable to parse message ${this.typeName} from JSON ${y.typeofJsonValue(r)}.`)}internalJsonWrite(r,i){return this.refJsonWriter.write(r,i)}internalBinaryWrite(r,i,a){this.refBinWriter.write(r,i,a);return i}internalBinaryRead(r,i,a,s){let l=s!==null&&s!==void 0?s:this.create();this.refBinReader.read(r,l,a,i);return l}}i.MessageType=MessageType},71983:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getSelectedOneofValue=i.clearOneofValue=i.setUnknownOneofValue=i.setOneofValue=i.getOneofValue=i.isOneofGroup=void 0;function isOneofGroup(r){if(typeof r!="object"||r===null||!r.hasOwnProperty("oneofKind")){return false}switch(typeof r.oneofKind){case"string":if(r[r.oneofKind]===undefined)return false;return Object.keys(r).length==2;case"undefined":return Object.keys(r).length==1;default:return false}}i.isOneofGroup=isOneofGroup;function getOneofValue(r,i){return r[i]}i.getOneofValue=getOneofValue;function setOneofValue(r,i,a){if(r.oneofKind!==undefined){delete r[r.oneofKind]}r.oneofKind=i;if(a!==undefined){r[i]=a}}i.setOneofValue=setOneofValue;function setUnknownOneofValue(r,i,a){if(r.oneofKind!==undefined){delete r[r.oneofKind]}r.oneofKind=i;if(a!==undefined&&i!==undefined){r[i]=a}}i.setUnknownOneofValue=setUnknownOneofValue;function clearOneofValue(r){if(r.oneofKind!==undefined){delete r[r.oneofKind]}r.oneofKind=undefined}i.clearOneofValue=clearOneofValue;function getSelectedOneofValue(r){if(r.oneofKind===undefined){return undefined}return r[r.oneofKind]}i.getSelectedOneofValue=getSelectedOneofValue},25901:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.PbLong=i.PbULong=i.detectBi=void 0;const s=a(75170);let l;function detectBi(){const r=new DataView(new ArrayBuffer(8));const i=globalThis.BigInt!==undefined&&typeof r.getBigInt64==="function"&&typeof r.getBigUint64==="function"&&typeof r.setBigInt64==="function"&&typeof r.setBigUint64==="function";l=i?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:r}:undefined}i.detectBi=detectBi;detectBi();function assertBi(r){if(!r)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const c=/^-?[0-9]+$/;const p=4294967296;const d=2147483648;class SharedPbLong{constructor(r,i){this.lo=r|0;this.hi=i|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let r=this.hi*p+(this.lo>>>0);if(!Number.isSafeInteger(r))throw new Error("cannot convert to safe number");return r}}class PbULong extends SharedPbLong{static from(r){if(l)switch(typeof r){case"string":if(r=="0")return this.ZERO;if(r=="")throw new Error("string is no integer");r=l.C(r);case"number":if(r===0)return this.ZERO;r=l.C(r);case"bigint":if(!r)return this.ZERO;if(rl.UMAX)throw new Error("ulong too large");l.V.setBigUint64(0,r,true);return new PbULong(l.V.getInt32(0,true),l.V.getInt32(4,true))}else switch(typeof r){case"string":if(r=="0")return this.ZERO;r=r.trim();if(!c.test(r))throw new Error("string is no integer");let[i,a,l]=s.int64fromString(r);if(i)throw new Error("signed value for ulong");return new PbULong(a,l);case"number":if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw new Error("number is no integer");if(r<0)throw new Error("signed value for ulong");return new PbULong(r,r/p)}throw new Error("unknown value "+typeof r)}toString(){return l?this.toBigInt().toString():s.int64toString(this.lo,this.hi)}toBigInt(){assertBi(l);l.V.setInt32(0,this.lo,true);l.V.setInt32(4,this.hi,true);return l.V.getBigUint64(0,true)}}i.PbULong=PbULong;PbULong.ZERO=new PbULong(0,0);class PbLong extends SharedPbLong{static from(r){if(l)switch(typeof r){case"string":if(r=="0")return this.ZERO;if(r=="")throw new Error("string is no integer");r=l.C(r);case"number":if(r===0)return this.ZERO;r=l.C(r);case"bigint":if(!r)return this.ZERO;if(rl.MAX)throw new Error("signed long too large");l.V.setBigInt64(0,r,true);return new PbLong(l.V.getInt32(0,true),l.V.getInt32(4,true))}else switch(typeof r){case"string":if(r=="0")return this.ZERO;r=r.trim();if(!c.test(r))throw new Error("string is no integer");let[i,a,l]=s.int64fromString(r);if(i){if(l>d||l==d&&a!=0)throw new Error("signed long too small")}else if(l>=d)throw new Error("signed long too large");let u=new PbLong(a,l);return i?u.negate():u;case"number":if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw new Error("number is no integer");return r>0?new PbLong(r,r/p):new PbLong(-r,-r/p).negate()}throw new Error("unknown value "+typeof r)}isNegative(){return(this.hi&d)!==0}negate(){let r=~this.hi,i=this.lo;if(i)i=~i+1;else r+=1;return new PbLong(i,r)}toString(){if(l)return this.toBigInt().toString();if(this.isNegative()){let r=this.negate();return"-"+s.int64toString(r.lo,r.hi)}return s.int64toString(this.lo,this.hi)}toBigInt(){assertBi(l);l.V.setInt32(0,this.lo,true);l.V.setInt32(4,this.hi,true);return l.V.getBigInt64(0,true)}}i.PbLong=PbLong;PbLong.ZERO=new PbLong(0,0)},93826:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.utf8read=void 0;const fromCharCodes=r=>String.fromCharCode.apply(String,r);function utf8read(r){if(r.length<1)return"";let i=0,a=[],s=[],l=0,c;let p=r.length;while(i191&&c<224)s[l++]=(c&31)<<6|r[i++]&63;else if(c>239&&c<365){c=((c&7)<<18|(r[i++]&63)<<12|(r[i++]&63)<<6|r[i++]&63)-65536;s[l++]=55296+(c>>10);s[l++]=56320+(c&1023)}else s[l++]=(c&15)<<12|(r[i++]&63)<<6|r[i++]&63;if(l>8191){a.push(fromCharCodes(s));l=0}}if(a.length){if(l)a.push(fromCharCodes(s.slice(0,l)));return a.join("")}return fromCharCodes(s.slice(0,l))}i.utf8read=utf8read},82529:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionBinaryReader=void 0;const s=a(73775);const l=a(6108);const c=a(13136);const p=a(31952);class ReflectionBinaryReader{constructor(r){this.info=r}prepare(){var r;if(!this.fieldNoToField){const i=(r=this.info.fields)!==null&&r!==void 0?r:[];this.fieldNoToField=new Map(i.map((r=>[r.no,r])))}}read(r,i,a,c){this.prepare();const p=c===undefined?r.len:r.pos+c;while(r.pos{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionBinaryWriter=void 0;const s=a(73775);const l=a(6108);const c=a(18238);const p=a(25901);class ReflectionBinaryWriter{constructor(r){this.info=r}prepare(){if(!this.fields){const r=this.info.fields?this.info.fields.concat():[];this.fields=r.sort(((r,i)=>r.no-i.no))}}write(r,i,a){this.prepare();for(const s of this.fields){let p,d,u=s.repeat,A=s.localName;if(s.oneof){const i=r[s.oneof];if(i.oneofKind!==A)continue;p=i[A];d=true}else{p=r[A];d=false}switch(s.kind){case"scalar":case"enum":let r=s.kind=="enum"?l.ScalarType.INT32:s.T;if(u){c.assert(Array.isArray(p));if(u==l.RepeatType.PACKED)this.packed(i,r,s.no,p);else for(const a of p)this.scalar(i,r,s.no,a,true)}else if(p===undefined)c.assert(s.opt);else this.scalar(i,r,s.no,p,d||s.opt);break;case"message":if(u){c.assert(Array.isArray(p));for(const r of p)this.message(i,a,s.T(),s.no,r)}else{this.message(i,a,s.T(),s.no,p)}break;case"map":c.assert(typeof p=="object"&&p!==null);for(const[r,l]of Object.entries(p))this.mapEntry(i,a,s,r,l);break}}let p=a.writeUnknownFields;if(p!==false)(p===true?s.UnknownFieldHandler.onWrite:p)(this.info.typeName,r,i)}mapEntry(r,i,a,p,d){r.tag(a.no,s.WireType.LengthDelimited);r.fork();let u=p;switch(a.K){case l.ScalarType.INT32:case l.ScalarType.FIXED32:case l.ScalarType.UINT32:case l.ScalarType.SFIXED32:case l.ScalarType.SINT32:u=Number.parseInt(p);break;case l.ScalarType.BOOL:c.assert(p=="true"||p=="false");u=p=="true";break}this.scalar(r,a.K,1,u,true);switch(a.V.kind){case"scalar":this.scalar(r,a.V.T,2,d,true);break;case"enum":this.scalar(r,l.ScalarType.INT32,2,d,true);break;case"message":this.message(r,i,a.V.T(),2,d);break}r.join()}message(r,i,a,l,c){if(c===undefined)return;a.internalBinaryWrite(c,r.tag(l,s.WireType.LengthDelimited).fork(),i);r.join()}scalar(r,i,a,s,l){let[c,p,d]=this.scalarInfo(i,s);if(!d||l){r.tag(a,c);r[p](s)}}packed(r,i,a,p){if(!p.length)return;c.assert(i!==l.ScalarType.BYTES&&i!==l.ScalarType.STRING);r.tag(a,s.WireType.LengthDelimited);r.fork();let[,d]=this.scalarInfo(i);for(let i=0;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.containsMessageType=void 0;const s=a(63673);function containsMessageType(r){return r[s.MESSAGE_TYPE]!=null}i.containsMessageType=containsMessageType},17769:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionCreate=void 0;const s=a(31952);const l=a(63673);function reflectionCreate(r){const i=r.messagePrototype?Object.create(r.messagePrototype):Object.defineProperty({},l.MESSAGE_TYPE,{value:r});for(let a of r.fields){let r=a.localName;if(a.opt)continue;if(a.oneof)i[a.oneof]={oneofKind:undefined};else if(a.repeat)i[r]=[];else switch(a.kind){case"scalar":i[r]=s.reflectionScalarDefault(a.T,a.L);break;case"enum":i[r]=0;break;case"map":i[r]={};break}}return i}i.reflectionCreate=reflectionCreate},65566:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionEquals=void 0;const s=a(6108);function reflectionEquals(r,i,a){if(i===a)return true;if(!i||!a)return false;for(let c of r.fields){let r=c.localName;let p=c.oneof?i[c.oneof][r]:i[r];let d=c.oneof?a[c.oneof][r]:a[r];switch(c.kind){case"enum":case"scalar":let r=c.kind=="enum"?s.ScalarType.INT32:c.T;if(!(c.repeat?repeatedPrimitiveEq(r,p,d):primitiveEq(r,p,d)))return false;break;case"map":if(!(c.V.kind=="message"?repeatedMsgEq(c.V.T(),l(p),l(d)):repeatedPrimitiveEq(c.V.kind=="enum"?s.ScalarType.INT32:c.V.T,l(p),l(d))))return false;break;case"message":let i=c.T();if(!(c.repeat?repeatedMsgEq(i,p,d):i.equals(p,d)))return false;break}}return true}i.reflectionEquals=reflectionEquals;const l=Object.values;function primitiveEq(r,i,a){if(i===a)return true;if(r!==s.ScalarType.BYTES)return false;let l=i;let c=a;if(l.length!==c.length)return false;for(let r=0;r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.readMessageOption=i.readFieldOption=i.readFieldOptions=i.normalizeFieldInfo=i.RepeatType=i.LongType=i.ScalarType=void 0;const s=a(86283);var l;(function(r){r[r["DOUBLE"]=1]="DOUBLE";r[r["FLOAT"]=2]="FLOAT";r[r["INT64"]=3]="INT64";r[r["UINT64"]=4]="UINT64";r[r["INT32"]=5]="INT32";r[r["FIXED64"]=6]="FIXED64";r[r["FIXED32"]=7]="FIXED32";r[r["BOOL"]=8]="BOOL";r[r["STRING"]=9]="STRING";r[r["BYTES"]=12]="BYTES";r[r["UINT32"]=13]="UINT32";r[r["SFIXED32"]=15]="SFIXED32";r[r["SFIXED64"]=16]="SFIXED64";r[r["SINT32"]=17]="SINT32";r[r["SINT64"]=18]="SINT64"})(l=i.ScalarType||(i.ScalarType={}));var c;(function(r){r[r["BIGINT"]=0]="BIGINT";r[r["STRING"]=1]="STRING";r[r["NUMBER"]=2]="NUMBER"})(c=i.LongType||(i.LongType={}));var p;(function(r){r[r["NO"]=0]="NO";r[r["PACKED"]=1]="PACKED";r[r["UNPACKED"]=2]="UNPACKED"})(p=i.RepeatType||(i.RepeatType={}));function normalizeFieldInfo(r){var i,a,l,c;r.localName=(i=r.localName)!==null&&i!==void 0?i:s.lowerCamelCase(r.name);r.jsonName=(a=r.jsonName)!==null&&a!==void 0?a:s.lowerCamelCase(r.name);r.repeat=(l=r.repeat)!==null&&l!==void 0?l:p.NO;r.opt=(c=r.opt)!==null&&c!==void 0?c:r.repeat?false:r.oneof?false:r.kind=="message";return r}i.normalizeFieldInfo=normalizeFieldInfo;function readFieldOptions(r,i,a,s){var l;const c=(l=r.fields.find(((r,a)=>r.localName==i||a==i)))===null||l===void 0?void 0:l.options;return c&&c[a]?s.fromJson(c[a]):undefined}i.readFieldOptions=readFieldOptions;function readFieldOption(r,i,a,s){var l;const c=(l=r.fields.find(((r,a)=>r.localName==i||a==i)))===null||l===void 0?void 0:l.options;if(!c){return undefined}const p=c[a];if(p===undefined){return p}return s?s.fromJson(p):p}i.readFieldOption=readFieldOption;function readMessageOption(r,i,a){const s=r.options;const l=s[i];if(l===undefined){return l}return a?a.fromJson(l):l}i.readMessageOption=readMessageOption},87298:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionJsonReader=void 0;const s=a(65668);const l=a(54826);const c=a(6108);const p=a(25901);const d=a(18238);const u=a(13136);class ReflectionJsonReader{constructor(r){this.info=r}prepare(){var r;if(this.fMap===undefined){this.fMap={};const i=(r=this.info.fields)!==null&&r!==void 0?r:[];for(const r of i){this.fMap[r.name]=r;this.fMap[r.jsonName]=r;this.fMap[r.localName]=r}}}assert(r,i,a){if(!r){let r=s.typeofJsonValue(a);if(r=="number"||r=="boolean")r=a.toString();throw new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${i}`)}}read(r,i,a){this.prepare();const l=[];for(const[p,d]of Object.entries(r)){const r=this.fMap[p];if(!r){if(!a.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${p}`);continue}const u=r.localName;let A;if(r.oneof){if(d===null&&(r.kind!=="enum"||r.T()[0]!=="google.protobuf.NullValue")){continue}if(l.includes(r.oneof))throw new Error(`Multiple members of the oneof group "${r.oneof}" of ${this.info.typeName} are present in JSON.`);l.push(r.oneof);A=i[r.oneof]={oneofKind:u}}else{A=i}if(r.kind=="map"){if(d===null){continue}this.assert(s.isJsonObject(d),r.name,d);const i=A[u];for(const[s,l]of Object.entries(d)){this.assert(l!==null,r.name+" map value",null);let p;switch(r.V.kind){case"message":p=r.V.T().internalJsonRead(l,a);break;case"enum":p=this.enum(r.V.T(),l,r.name,a.ignoreUnknownFields);if(p===false)continue;break;case"scalar":p=this.scalar(l,r.V.T,r.V.L,r.name);break}this.assert(p!==undefined,r.name+" map value",l);let d=s;if(r.K==c.ScalarType.BOOL)d=d=="true"?true:d=="false"?false:d;d=this.scalar(d,r.K,c.LongType.STRING,r.name).toString();i[d]=p}}else if(r.repeat){if(d===null)continue;this.assert(Array.isArray(d),r.name,d);const i=A[u];for(const s of d){this.assert(s!==null,r.name,null);let l;switch(r.kind){case"message":l=r.T().internalJsonRead(s,a);break;case"enum":l=this.enum(r.T(),s,r.name,a.ignoreUnknownFields);if(l===false)continue;break;case"scalar":l=this.scalar(s,r.T,r.L,r.name);break}this.assert(l!==undefined,r.name,d);i.push(l)}}else{switch(r.kind){case"message":if(d===null&&r.T().typeName!="google.protobuf.Value"){this.assert(r.oneof===undefined,r.name+" (oneof member)",null);continue}A[u]=r.T().internalJsonRead(d,a,A[u]);break;case"enum":let i=this.enum(r.T(),d,r.name,a.ignoreUnknownFields);if(i===false)continue;A[u]=i;break;case"scalar":A[u]=this.scalar(d,r.T,r.L,r.name);break}}}}enum(r,i,a,s){if(r[0]=="google.protobuf.NullValue")d.assert(i===null||i==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} only accepts null.`);if(i===null)return 0;switch(typeof i){case"number":d.assert(Number.isInteger(i),`Unable to parse field ${this.info.typeName}#${a}, enum can only be integral number, got ${i}.`);return i;case"string":let l=i;if(r[2]&&i.substring(0,r[2].length)===r[2])l=i.substring(r[2].length);let c=r[1][l];if(typeof c==="undefined"&&s){return false}d.assert(typeof c=="number",`Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} has no value for "${i}".`);return c}d.assert(false,`Unable to parse field ${this.info.typeName}#${a}, cannot parse enum value from ${typeof i}".`)}scalar(r,i,a,s){let A;try{switch(i){case c.ScalarType.DOUBLE:case c.ScalarType.FLOAT:if(r===null)return 0;if(r==="NaN")return Number.NaN;if(r==="Infinity")return Number.POSITIVE_INFINITY;if(r==="-Infinity")return Number.NEGATIVE_INFINITY;if(r===""){A="empty string";break}if(typeof r=="string"&&r.trim().length!==r.length){A="extra whitespace";break}if(typeof r!="string"&&typeof r!="number"){break}let s=Number(r);if(Number.isNaN(s)){A="not a number";break}if(!Number.isFinite(s)){A="too large or small";break}if(i==c.ScalarType.FLOAT)d.assertFloat32(s);return s;case c.ScalarType.INT32:case c.ScalarType.FIXED32:case c.ScalarType.SFIXED32:case c.ScalarType.SINT32:case c.ScalarType.UINT32:if(r===null)return 0;let h;if(typeof r=="number")h=r;else if(r==="")A="empty string";else if(typeof r=="string"){if(r.trim().length!==r.length)A="extra whitespace";else h=Number(r)}if(h===undefined)break;if(i==c.ScalarType.UINT32)d.assertUInt32(h);else d.assertInt32(h);return h;case c.ScalarType.INT64:case c.ScalarType.SFIXED64:case c.ScalarType.SINT64:if(r===null)return u.reflectionLongConvert(p.PbLong.ZERO,a);if(typeof r!="number"&&typeof r!="string")break;return u.reflectionLongConvert(p.PbLong.from(r),a);case c.ScalarType.FIXED64:case c.ScalarType.UINT64:if(r===null)return u.reflectionLongConvert(p.PbULong.ZERO,a);if(typeof r!="number"&&typeof r!="string")break;return u.reflectionLongConvert(p.PbULong.from(r),a);case c.ScalarType.BOOL:if(r===null)return false;if(typeof r!=="boolean")break;return r;case c.ScalarType.STRING:if(r===null)return"";if(typeof r!=="string"){A="extra whitespace";break}try{encodeURIComponent(r)}catch(A){A="invalid UTF8";break}return r;case c.ScalarType.BYTES:if(r===null||r==="")return new Uint8Array(0);if(typeof r!=="string")break;return l.base64decode(r)}}catch(r){A=r.message}this.assert(false,s+(A?" - "+A:""),r)}}i.ReflectionJsonReader=ReflectionJsonReader},76015:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionJsonWriter=void 0;const s=a(54826);const l=a(25901);const c=a(6108);const p=a(18238);class ReflectionJsonWriter{constructor(r){var i;this.fields=(i=r.fields)!==null&&i!==void 0?i:[]}write(r,i){const a={},s=r;for(const r of this.fields){if(!r.oneof){let l=this.field(r,s[r.localName],i);if(l!==undefined)a[i.useProtoFieldName?r.name:r.jsonName]=l;continue}const l=s[r.oneof];if(l.oneofKind!==r.localName)continue;const c=r.kind=="scalar"||r.kind=="enum"?Object.assign(Object.assign({},i),{emitDefaultValues:true}):i;let d=this.field(r,l[r.localName],c);p.assert(d!==undefined);a[i.useProtoFieldName?r.name:r.jsonName]=d}return a}field(r,i,a){let s=undefined;if(r.kind=="map"){p.assert(typeof i=="object"&&i!==null);const l={};switch(r.V.kind){case"scalar":for(const[a,s]of Object.entries(i)){const i=this.scalar(r.V.T,s,r.name,false,true);p.assert(i!==undefined);l[a.toString()]=i}break;case"message":const s=r.V.T();for(const[c,d]of Object.entries(i)){const i=this.message(s,d,r.name,a);p.assert(i!==undefined);l[c.toString()]=i}break;case"enum":const c=r.V.T();for(const[s,d]of Object.entries(i)){p.assert(d===undefined||typeof d=="number");const i=this.enum(c,d,r.name,false,true,a.enumAsInteger);p.assert(i!==undefined);l[s.toString()]=i}break}if(a.emitDefaultValues||Object.keys(l).length>0)s=l}else if(r.repeat){p.assert(Array.isArray(i));const l=[];switch(r.kind){case"scalar":for(let a=0;a0||a.emitDefaultValues)s=l}else{switch(r.kind){case"scalar":s=this.scalar(r.T,i,r.name,r.opt,a.emitDefaultValues);break;case"enum":s=this.enum(r.T(),i,r.name,r.opt,a.emitDefaultValues,a.enumAsInteger);break;case"message":s=this.message(r.T(),i,r.name,a);break}}return s}enum(r,i,a,s,l,c){if(r[0]=="google.protobuf.NullValue")return!l&&!s?undefined:null;if(i===undefined){p.assert(s);return undefined}if(i===0&&!l&&!s)return undefined;p.assert(typeof i=="number");p.assert(Number.isInteger(i));if(c||!r[1].hasOwnProperty(i))return i;if(r[2])return r[2]+r[1][i];return r[1][i]}message(r,i,a,s){if(i===undefined)return s.emitDefaultValues?null:undefined;return r.internalJsonWrite(i,s)}scalar(r,i,a,d,u){if(i===undefined){p.assert(d);return undefined}const A=u||d;switch(r){case c.ScalarType.INT32:case c.ScalarType.SFIXED32:case c.ScalarType.SINT32:if(i===0)return A?0:undefined;p.assertInt32(i);return i;case c.ScalarType.FIXED32:case c.ScalarType.UINT32:if(i===0)return A?0:undefined;p.assertUInt32(i);return i;case c.ScalarType.FLOAT:p.assertFloat32(i);case c.ScalarType.DOUBLE:if(i===0)return A?0:undefined;p.assert(typeof i=="number");if(Number.isNaN(i))return"NaN";if(i===Number.POSITIVE_INFINITY)return"Infinity";if(i===Number.NEGATIVE_INFINITY)return"-Infinity";return i;case c.ScalarType.STRING:if(i==="")return A?"":undefined;p.assert(typeof i=="string");return i;case c.ScalarType.BOOL:if(i===false)return A?false:undefined;p.assert(typeof i=="boolean");return i;case c.ScalarType.UINT64:case c.ScalarType.FIXED64:p.assert(typeof i=="number"||typeof i=="string"||typeof i=="bigint");let r=l.PbULong.from(i);if(r.isZero()&&!A)return undefined;return r.toString();case c.ScalarType.INT64:case c.ScalarType.SFIXED64:case c.ScalarType.SINT64:p.assert(typeof i=="number"||typeof i=="string"||typeof i=="bigint");let a=l.PbLong.from(i);if(a.isZero()&&!A)return undefined;return a.toString();case c.ScalarType.BYTES:p.assert(i instanceof Uint8Array);if(!i.byteLength)return A?"":undefined;return s.base64encode(i)}}}i.ReflectionJsonWriter=ReflectionJsonWriter},13136:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionLongConvert=void 0;const s=a(6108);function reflectionLongConvert(r,i){switch(i){case s.LongType.BIGINT:return r.toBigInt();case s.LongType.NUMBER:return r.toNumber();default:return r.toString()}}i.reflectionLongConvert=reflectionLongConvert},79155:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionMergePartial=void 0;function reflectionMergePartial(r,i,a){let s,l=a,c;for(let a of r.fields){let r=a.localName;if(a.oneof){const p=l[a.oneof];if((p===null||p===void 0?void 0:p.oneofKind)==undefined){continue}s=p[r];c=i[a.oneof];c.oneofKind=p.oneofKind;if(s==undefined){delete c[r];continue}}else{s=l[r];c=i;if(s==undefined){continue}}if(a.repeat)c[r].length=s.length;switch(a.kind){case"scalar":case"enum":if(a.repeat)for(let i=0;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionScalarDefault=void 0;const s=a(6108);const l=a(13136);const c=a(25901);function reflectionScalarDefault(r,i=s.LongType.STRING){switch(r){case s.ScalarType.BOOL:return false;case s.ScalarType.UINT64:case s.ScalarType.FIXED64:return l.reflectionLongConvert(c.PbULong.ZERO,i);case s.ScalarType.INT64:case s.ScalarType.SFIXED64:case s.ScalarType.SINT64:return l.reflectionLongConvert(c.PbLong.ZERO,i);case s.ScalarType.DOUBLE:case s.ScalarType.FLOAT:return 0;case s.ScalarType.BYTES:return new Uint8Array(0);case s.ScalarType.STRING:return"";default:return 0}}i.reflectionScalarDefault=reflectionScalarDefault},86075:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionTypeCheck=void 0;const s=a(6108);const l=a(71983);class ReflectionTypeCheck{constructor(r){var i;this.fields=(i=r.fields)!==null&&i!==void 0?i:[]}prepare(){if(this.data)return;const r=[],i=[],a=[];for(let s of this.fields){if(s.oneof){if(!a.includes(s.oneof)){a.push(s.oneof);r.push(s.oneof);i.push(s.oneof)}}else{i.push(s.localName);switch(s.kind){case"scalar":case"enum":if(!s.opt||s.repeat)r.push(s.localName);break;case"message":if(s.repeat)r.push(s.localName);break;case"map":r.push(s.localName);break}}}this.data={req:r,known:i,oneofs:Object.values(a)}}is(r,i,a=false){if(i<0)return true;if(r===null||r===undefined||typeof r!="object")return false;this.prepare();let s=Object.keys(r),c=this.data;if(s.length!s.includes(r))))return false;if(!a){if(s.some((r=>!c.known.includes(r))))return false}if(i<1){return true}for(const s of c.oneofs){const c=r[s];if(!l.isOneofGroup(c))return false;if(c.oneofKind===undefined)continue;const p=this.fields.find((r=>r.localName===c.oneofKind));if(!p)return false;if(!this.field(c[c.oneofKind],p,a,i))return false}for(const s of this.fields){if(s.oneof!==undefined)continue;if(!this.field(r[s.localName],s,a,i))return false}return true}field(r,i,a,l){let c=i.repeat;switch(i.kind){case"scalar":if(r===undefined)return i.opt;if(c)return this.scalars(r,i.T,l,i.L);return this.scalar(r,i.T,i.L);case"enum":if(r===undefined)return i.opt;if(c)return this.scalars(r,s.ScalarType.INT32,l);return this.scalar(r,s.ScalarType.INT32);case"message":if(r===undefined)return true;if(c)return this.messages(r,i.T(),a,l);return this.message(r,i.T(),a,l);case"map":if(typeof r!="object"||r===null)return false;if(l<2)return true;if(!this.mapKeys(r,i.K,l))return false;switch(i.V.kind){case"scalar":return this.scalars(Object.values(r),i.V.T,l,i.V.L);case"enum":return this.scalars(Object.values(r),s.ScalarType.INT32,l);case"message":return this.messages(Object.values(r),i.V.T(),a,l)}break}return true}message(r,i,a,s){if(a){return i.isAssignable(r,s)}return i.is(r,s)}messages(r,i,a,s){if(!Array.isArray(r))return false;if(s<2)return true;if(a){for(let a=0;aparseInt(r))),i,a);case s.ScalarType.BOOL:return this.scalars(l.slice(0,a).map((r=>r=="true"?true:r=="false"?false:r)),i,a);default:return this.scalars(l,i,a,s.LongType.STRING)}}}i.ReflectionTypeCheck=ReflectionTypeCheck},2136:(r,i,a)=>{var s=a(1692);var l=a(71017);var c=a(31520);var p=a(41633);var d=a(85195);var u=a(77356);var A=a(81201);var h=r.exports={};var g=/[\/\\]/g;var processPatterns=function(r,i){var a=[];c(r).forEach((function(r){var s=r.indexOf("!")===0;if(s){r=r.slice(1)}var l=i(r);if(s){a=p(a,l)}else{a=d(a,l)}}));return a};h.exists=function(){var r=l.join.apply(l,arguments);return s.existsSync(r)};h.expand=function(...r){var i=u(r[0])?r.shift():{};var a=Array.isArray(r[0])?r[0]:r;if(a.length===0){return[]}var c=processPatterns(a,(function(r){return A.sync(r,i)}));if(i.filter){c=c.filter((function(r){r=l.join(i.cwd||"",r);try{if(typeof i.filter==="function"){return i.filter(r)}else{return s.statSync(r)[i.filter]()}}catch(r){return false}}))}return c};h.expandMapping=function(r,i,a){a=Object.assign({rename:function(r,i){return l.join(r||"",i)}},a);var s=[];var c={};h.expand(a,r).forEach((function(r){var p=r;if(a.flatten){p=l.basename(p)}if(a.ext){p=p.replace(/(\.[^\/]*)?$/,a.ext)}var d=a.rename(i,p,a);if(a.cwd){r=l.join(a.cwd,r)}d=d.replace(g,"/");r=r.replace(g,"/");if(c[d]){c[d].src.push(r)}else{s.push({src:[r],dest:d});c[d]=s[s.length-1]}}));return s};h.normalizeFilesArray=function(r){var i=[];r.forEach((function(r){var a;if("src"in r||"dest"in r){i.push(r)}}));if(i.length===0){return[]}i=_(i).chain().forEach((function(r){if(!("src"in r)||!r.src){return}if(Array.isArray(r.src)){r.src=c(r.src)}else{r.src=[r.src]}})).map((function(r){var i=Object.assign({},r);delete i.src;delete i.dest;if(r.expand){return h.expandMapping(r.src,r.dest,i).map((function(i){var a=Object.assign({},r);a.orig=Object.assign({},r);a.src=i.src;a.dest=i.dest;["expand","cwd","flatten","rename","ext"].forEach((function(r){delete a[r]}));return a}))}var a=Object.assign({},r);a.orig=Object.assign({},r);if("src"in a){Object.defineProperty(a,"src",{enumerable:true,get:function fn(){var a;if(!("result"in fn)){a=r.src;a=Array.isArray(a)?c(a):[a];fn.result=h.expand(i,a)}return fn.result}})}if("dest"in a){a.dest=r.dest}return a})).flatten().value();return i}},78443:(r,i,a)=>{var s=a(1692);var l=a(71017);var c=a(73837);var p=a(73268);var d=a(43766);var u=a(3768);var A=a(12781).Stream;var h=a(62235).PassThrough;var g=r.exports={};g.file=a(2136);function assertPath(r){if(typeof r!=="string"){throw new TypeError("Path must be a string. Received "+nutils.inspect(r))}}g.collectStream=function(r,i){var a=[];var s=0;r.on("error",i);r.on("data",(function(r){a.push(r);s+=r.length}));r.on("end",(function(){var r=new Buffer(s);var l=0;a.forEach((function(i){i.copy(r,l);l+=i.length}));i(null,r)}))};g.dateify=function(r){r=r||new Date;if(r instanceof Date){r=r}else if(typeof r==="string"){r=new Date(r)}else{r=new Date}return r};g.defaults=function(r,i,a){var s=arguments;s[0]=s[0]||{};return u(...s)};g.isStream=function(r){return r instanceof A};g.lazyReadStream=function(r){return new p.Readable((function(){return s.createReadStream(r)}))};g.normalizeInputSource=function(r){if(r===null){return new Buffer(0)}else if(typeof r==="string"){return new Buffer(r)}else if(g.isStream(r)&&!r._readableState){var i=new h;r.pipe(i);return i}return r};g.sanitizePath=function(r){return d(r,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};g.trailingSlashIt=function(r){return r.slice(-1)!=="/"?r+"/":r};g.unixifyPath=function(r){return d(r,false).replace(/^\w+:/,"")};g.walkdir=function(r,i,a){var c=[];if(typeof i==="function"){a=i;i=r}s.readdir(r,(function(p,d){var u=0;var A;var h;if(p){return a(p)}(function next(){A=d[u++];if(!A){return a(null,c)}h=l.join(r,A);s.stat(h,(function(r,a){c.push({path:h,relative:l.relative(i,h).replace(/\\/g,"/"),stats:a});if(a&&a.isDirectory()){g.walkdir(h,i,(function(r,i){i.forEach((function(r){c.push(r)}));next()}))}else{next()}}))})()}))}},12546:r=>{var i={}.toString;r.exports=Array.isArray||function(r){return i.call(r)=="[object Array]"}},79008:(r,i,a)=>{"use strict";var s=a(72166);var l=Object.keys||function(r){var i=[];for(var a in r){i.push(a)}return i};r.exports=Duplex;var c=Object.create(a(90310));c.inherits=a(55806);var p=a(90538);var d=a(38383);c.inherits(Duplex,p);{var u=l(d.prototype);for(var A=0;A{"use strict";r.exports=PassThrough;var s=a(70690);var l=Object.create(a(90310));l.inherits=a(55806);l.inherits(PassThrough,s);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);s.call(this,r)}PassThrough.prototype._transform=function(r,i,a){a(null,r)}},90538:(r,i,a)=>{"use strict";var s=a(72166);r.exports=Readable;var l=a(12546);var c;Readable.ReadableState=ReadableState;var p=a(82361).EventEmitter;var EElistenerCount=function(r,i){return r.listeners(i).length};var d=a(13151);var u=a(37480).Buffer;var A=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return u.from(r)}function _isUint8Array(r){return u.isBuffer(r)||r instanceof A}var h=Object.create(a(90310));h.inherits=a(55806);var g=a(73837);var y=void 0;if(g&&g.debuglog){y=g.debuglog("stream")}else{y=function(){}}var E=a(39338);var b=a(36702);var C;h.inherits(Readable,d);var v=["error","close","destroy","pause","resume"];function prependListener(r,i,a){if(typeof r.prependListener==="function")return r.prependListener(i,a);if(!r._events||!r._events[i])r.on(i,a);else if(l(r._events[i]))r._events[i].unshift(a);else r._events[i]=[a,r._events[i]]}function ReadableState(r,i){c=c||a(79008);r=r||{};var s=i instanceof c;this.objectMode=!!r.objectMode;if(s)this.objectMode=this.objectMode||!!r.readableObjectMode;var l=r.highWaterMark;var p=r.readableHighWaterMark;var d=this.objectMode?16:16*1024;if(l||l===0)this.highWaterMark=l;else if(s&&(p||p===0))this.highWaterMark=p;else this.highWaterMark=d;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new E;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=r.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(r.encoding){if(!C)C=a(13301).s;this.decoder=new C(r.encoding);this.encoding=r.encoding}}function Readable(r){c=c||a(79008);if(!(this instanceof Readable))return new Readable(r);this._readableState=new ReadableState(r,this);this.readable=true;if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy}d.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(r){if(!this._readableState){return}this._readableState.destroyed=r}});Readable.prototype.destroy=b.destroy;Readable.prototype._undestroy=b.undestroy;Readable.prototype._destroy=function(r,i){this.push(null);i(r)};Readable.prototype.push=function(r,i){var a=this._readableState;var s;if(!a.objectMode){if(typeof r==="string"){i=i||a.defaultEncoding;if(i!==a.encoding){r=u.from(r,i);i=""}s=true}}else{s=true}return readableAddChunk(this,r,i,false,s)};Readable.prototype.unshift=function(r){return readableAddChunk(this,r,null,true,false)};function readableAddChunk(r,i,a,s,l){var c=r._readableState;if(i===null){c.reading=false;onEofChunk(r,c)}else{var p;if(!l)p=chunkInvalid(c,i);if(p){r.emit("error",p)}else if(c.objectMode||i&&i.length>0){if(typeof i!=="string"&&!c.objectMode&&Object.getPrototypeOf(i)!==u.prototype){i=_uint8ArrayToBuffer(i)}if(s){if(c.endEmitted)r.emit("error",new Error("stream.unshift() after end event"));else addChunk(r,c,i,true)}else if(c.ended){r.emit("error",new Error("stream.push() after EOF"))}else{c.reading=false;if(c.decoder&&!a){i=c.decoder.write(i);if(c.objectMode||i.length!==0)addChunk(r,c,i,false);else maybeReadMore(r,c)}else{addChunk(r,c,i,false)}}}else if(!s){c.reading=false}}return needMoreData(c)}function addChunk(r,i,a,s){if(i.flowing&&i.length===0&&!i.sync){r.emit("data",a);r.read(0)}else{i.length+=i.objectMode?1:a.length;if(s)i.buffer.unshift(a);else i.buffer.push(a);if(i.needReadable)emitReadable(r)}maybeReadMore(r,i)}function chunkInvalid(r,i){var a;if(!_isUint8Array(i)&&typeof i!=="string"&&i!==undefined&&!r.objectMode){a=new TypeError("Invalid non-string/buffer chunk")}return a}function needMoreData(r){return!r.ended&&(r.needReadable||r.length=B){r=B}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if(i.objectMode)return 1;if(r!==r){if(i.flowing&&i.length)return i.buffer.head.data.length;else return i.length}if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r<=i.length)return r;if(!i.ended){i.needReadable=true;return 0}return i.length}Readable.prototype.read=function(r){y("read",r);r=parseInt(r,10);var i=this._readableState;var a=r;if(r!==0)i.emittedReadable=false;if(r===0&&i.needReadable&&(i.length>=i.highWaterMark||i.ended)){y("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}var s=i.needReadable;y("need readable",s);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=true;r=0}else{i.length-=r}if(i.length===0){if(!i.ended)i.needReadable=true;if(a!==r&&i.ended)endReadable(this)}if(l!==null)this.emit("data",l);return l};function onEofChunk(r,i){if(i.ended)return;if(i.decoder){var a=i.decoder.end();if(a&&a.length){i.buffer.push(a);i.length+=i.objectMode?1:a.length}}i.ended=true;emitReadable(r)}function emitReadable(r){var i=r._readableState;i.needReadable=false;if(!i.emittedReadable){y("emitReadable",i.flowing);i.emittedReadable=true;if(i.sync)s.nextTick(emitReadable_,r);else emitReadable_(r)}}function emitReadable_(r){y("emit readable");r.emit("readable");flow(r)}function maybeReadMore(r,i){if(!i.readingMore){i.readingMore=true;s.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){var a=i.length;while(!i.reading&&!i.flowing&&!i.ended&&i.length1&&indexOf(l.pipes,r)!==-1)&&!u){y("false write response, pause",l.awaitDrain);l.awaitDrain++;A=true}a.pause()}}function onerror(i){y("onerror",i);unpipe();r.removeListener("error",onerror);if(EElistenerCount(r,"error")===0)r.emit("error",i)}prependListener(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){y("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){y("unpipe");a.unpipe(r)}r.emit("pipe",a);if(!l.flowing){y("pipe resume");a.resume()}return r};function pipeOnDrain(r){return function(){var i=r._readableState;y("pipeOnDrain",i.awaitDrain);if(i.awaitDrain)i.awaitDrain--;if(i.awaitDrain===0&&EElistenerCount(r,"data")){i.flowing=true;flow(r)}}}Readable.prototype.unpipe=function(r){var i=this._readableState;var a={hasUnpiped:false};if(i.pipesCount===0)return this;if(i.pipesCount===1){if(r&&r!==i.pipes)return this;if(!r)r=i.pipes;i.pipes=null;i.pipesCount=0;i.flowing=false;if(r)r.emit("unpipe",this,a);return this}if(!r){var s=i.pipes;var l=i.pipesCount;i.pipes=null;i.pipesCount=0;i.flowing=false;for(var c=0;c=i.length){if(i.decoder)a=i.buffer.join("");else if(i.buffer.length===1)a=i.buffer.head.data;else a=i.buffer.concat(i.length);i.buffer.clear()}else{a=fromListPartial(r,i.buffer,i.decoder)}return a}function fromListPartial(r,i,a){var s;if(rc.length?c.length:r;if(p===c.length)l+=c;else l+=c.slice(0,r);r-=p;if(r===0){if(p===c.length){++s;if(a.next)i.head=a.next;else i.head=i.tail=null}else{i.head=a;a.data=c.slice(p)}break}++s}i.length-=s;return l}function copyFromBuffer(r,i){var a=u.allocUnsafe(r);var s=i.head;var l=1;s.data.copy(a);r-=s.data.length;while(s=s.next){var c=s.data;var p=r>c.length?c.length:r;c.copy(a,a.length-r,0,p);r-=p;if(r===0){if(p===c.length){++l;if(s.next)i.head=s.next;else i.head=i.tail=null}else{i.head=s;s.data=c.slice(p)}break}++l}i.length-=l;return a}function endReadable(r){var i=r._readableState;if(i.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!i.endEmitted){i.ended=true;s.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){if(!r.endEmitted&&r.length===0){r.endEmitted=true;i.readable=false;i.emit("end")}}function indexOf(r,i){for(var a=0,s=r.length;a{"use strict";r.exports=Transform;var s=a(79008);var l=Object.create(a(90310));l.inherits=a(55806);l.inherits(Transform,s);function afterTransform(r,i){var a=this._transformState;a.transforming=false;var s=a.writecb;if(!s){return this.emit("error",new Error("write callback called multiple times"))}a.writechunk=null;a.writecb=null;if(i!=null)this.push(i);s(r);var l=this._readableState;l.reading=false;if(l.needReadable||l.length{"use strict";var s=a(72166);r.exports=Writable;function WriteReq(r,i,a){this.chunk=r;this.encoding=i;this.callback=a;this.next=null}function CorkedRequest(r){var i=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(i,r)}}var l=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:s.nextTick;var c;Writable.WritableState=WritableState;var p=Object.create(a(90310));p.inherits=a(55806);var d={deprecate:a(41257)};var u=a(13151);var A=a(37480).Buffer;var h=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return A.from(r)}function _isUint8Array(r){return A.isBuffer(r)||r instanceof h}var g=a(36702);p.inherits(Writable,u);function nop(){}function WritableState(r,i){c=c||a(79008);r=r||{};var s=i instanceof c;this.objectMode=!!r.objectMode;if(s)this.objectMode=this.objectMode||!!r.writableObjectMode;var l=r.highWaterMark;var p=r.writableHighWaterMark;var d=this.objectMode?16:16*1024;if(l||l===0)this.highWaterMark=l;else if(s&&(p||p===0))this.highWaterMark=p;else this.highWaterMark=d;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var u=r.decodeStrings===false;this.decodeStrings=!u;this.defaultEncoding=r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(r){onwrite(i,r)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var r=this.bufferedRequest;var i=[];while(r){i.push(r);r=r.next}return i};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(r){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(r){if(y.call(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}})}else{y=function(r){return r instanceof this}}function Writable(r){c=c||a(79008);if(!y.call(Writable,this)&&!(this instanceof c)){return new Writable(r)}this._writableState=new WritableState(r,this);this.writable=true;if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final}u.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(r,i){var a=new Error("write after end");r.emit("error",a);s.nextTick(i,a)}function validChunk(r,i,a,l){var c=true;var p=false;if(a===null){p=new TypeError("May not write null values to stream")}else if(typeof a!=="string"&&a!==undefined&&!i.objectMode){p=new TypeError("Invalid non-string/buffer chunk")}if(p){r.emit("error",p);s.nextTick(l,p);c=false}return c}Writable.prototype.write=function(r,i,a){var s=this._writableState;var l=false;var c=!s.objectMode&&_isUint8Array(r);if(c&&!A.isBuffer(r)){r=_uint8ArrayToBuffer(r)}if(typeof i==="function"){a=i;i=null}if(c)i="buffer";else if(!i)i=s.defaultEncoding;if(typeof a!=="function")a=nop;if(s.ended)writeAfterEnd(this,a);else if(c||validChunk(this,s,r,a)){s.pendingcb++;l=writeOrBuffer(this,s,c,r,i,a)}return l};Writable.prototype.cork=function(){var r=this._writableState;r.corked++};Writable.prototype.uncork=function(){var r=this._writableState;if(r.corked){r.corked--;if(!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=r.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+r);this._writableState.defaultEncoding=r;return this};function decodeChunk(r,i,a){if(!r.objectMode&&r.decodeStrings!==false&&typeof i==="string"){i=A.from(i,a)}return i}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(r,i,a,s,l,c){if(!a){var p=decodeChunk(i,s,l);if(s!==p){a=true;l="buffer";s=p}}var d=i.objectMode?1:s.length;i.length+=d;var u=i.length{"use strict";function _classCallCheck(r,i){if(!(r instanceof i)){throw new TypeError("Cannot call a class as a function")}}var s=a(37480).Buffer;var l=a(73837);function copyBuffer(r,i,a){r.copy(i,a)}r.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(r){var i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length};BufferList.prototype.unshift=function unshift(r){var i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(r){if(this.length===0)return"";var i=this.head;var a=""+i.data;while(i=i.next){a+=r+i.data}return a};BufferList.prototype.concat=function concat(r){if(this.length===0)return s.alloc(0);var i=s.allocUnsafe(r>>>0);var a=this.head;var l=0;while(a){copyBuffer(a.data,i,l);l+=a.data.length;a=a.next}return i};return BufferList}();if(l&&l.inspect&&l.inspect.custom){r.exports.prototype[l.inspect.custom]=function(){var r=l.inspect({length:this.length});return this.constructor.name+" "+r}}},36702:(r,i,a)=>{"use strict";var s=a(72166);function destroy(r,i){var a=this;var l=this._readableState&&this._readableState.destroyed;var c=this._writableState&&this._writableState.destroyed;if(l||c){if(i){i(r)}else if(r){if(!this._writableState){s.nextTick(emitErrorNT,this,r)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;s.nextTick(emitErrorNT,this,r)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(r||null,(function(r){if(!i&&r){if(!a._writableState){s.nextTick(emitErrorNT,a,r)}else if(!a._writableState.errorEmitted){a._writableState.errorEmitted=true;s.nextTick(emitErrorNT,a,r)}}else if(i){i(r)}}));return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(r,i){r.emit("error",i)}r.exports={destroy:destroy,undestroy:undestroy}},13151:(r,i,a)=>{r.exports=a(12781)},62235:(r,i,a)=>{var s=a(12781);if(process.env.READABLE_STREAM==="disable"&&s){r.exports=s;i=r.exports=s.Readable;i.Readable=s.Readable;i.Writable=s.Writable;i.Duplex=s.Duplex;i.Transform=s.Transform;i.PassThrough=s.PassThrough;i.Stream=s}else{i=r.exports=a(90538);i.Stream=s||i;i.Readable=i;i.Writable=a(38383);i.Duplex=a(79008);i.Transform=a(70690);i.PassThrough=a(77882)}},37480:(r,i,a)=>{var s=a(14300);var l=s.Buffer;function copyProps(r,i){for(var a in r){i[a]=r[a]}}if(l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow){r.exports=s}else{copyProps(s,i);i.Buffer=SafeBuffer}function SafeBuffer(r,i,a){return l(r,i,a)}copyProps(l,SafeBuffer);SafeBuffer.from=function(r,i,a){if(typeof r==="number"){throw new TypeError("Argument must not be a number")}return l(r,i,a)};SafeBuffer.alloc=function(r,i,a){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}var s=l(r);if(i!==undefined){if(typeof a==="string"){s.fill(i,a)}else{s.fill(i)}}else{s.fill(0)}return s};SafeBuffer.allocUnsafe=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return l(r)};SafeBuffer.allocUnsafeSlow=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return s.SlowBuffer(r)}},13301:(r,i,a)=>{"use strict";var s=a(37480).Buffer;var l=s.isEncoding||function(r){r=""+r;switch(r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(r){if(!r)return"utf8";var i;while(true){switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(i)return;r=(""+r).toLowerCase();i=true}}}function normalizeEncoding(r){var i=_normalizeEncoding(r);if(typeof i!=="string"&&(s.isEncoding===l||!l(r)))throw new Error("Unknown encoding: "+r);return i||r}i.s=StringDecoder;function StringDecoder(r){this.encoding=normalizeEncoding(r);var i;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;i=4;break;case"utf8":this.fillLast=utf8FillLast;i=4;break;case"base64":this.text=base64Text;this.end=base64End;i=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=s.allocUnsafe(i)}StringDecoder.prototype.write=function(r){if(r.length===0)return"";var i;var a;if(this.lastNeed){i=this.fillLast(r);if(i===undefined)return"";a=this.lastNeed;this.lastNeed=0}else{a=0}if(a>5===6)return 2;else if(r>>4===14)return 3;else if(r>>3===30)return 4;return r>>6===2?-1:-2}function utf8CheckIncomplete(r,i,a){var s=i.length-1;if(s=0){if(l>0)r.lastNeed=l-1;return l}if(--s=0){if(l>0)r.lastNeed=l-2;return l}if(--s=0){if(l>0){if(l===2)l=0;else r.lastNeed=l-3}return l}return 0}function utf8CheckExtraBytes(r,i,a){if((i[0]&192)!==128){r.lastNeed=0;return"�"}if(r.lastNeed>1&&i.length>1){if((i[1]&192)!==128){r.lastNeed=1;return"�"}if(r.lastNeed>2&&i.length>2){if((i[2]&192)!==128){r.lastNeed=2;return"�"}}}}function utf8FillLast(r){var i=this.lastTotal-this.lastNeed;var a=utf8CheckExtraBytes(this,r,i);if(a!==undefined)return a;if(this.lastNeed<=r.length){r.copy(this.lastChar,i,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}r.copy(this.lastChar,i,0,r.length);this.lastNeed-=r.length}function utf8Text(r,i){var a=utf8CheckIncomplete(this,r,i);if(!this.lastNeed)return r.toString("utf8",i);this.lastTotal=a;var s=r.length-(a-this.lastNeed);r.copy(this.lastChar,0,s);return r.toString("utf8",i,s)}function utf8End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+"�";return i}function utf16Text(r,i){if((r.length-i)%2===0){var a=r.toString("utf16le",i);if(a){var s=a.charCodeAt(a.length-1);if(s>=55296&&s<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1];return a.slice(0,-1)}}return a}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=r[r.length-1];return r.toString("utf16le",i,r.length-1)}function utf16End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,a)}return i}function base64Text(r,i){var a=(r.length-i)%3;if(a===0)return r.toString("base64",i);this.lastNeed=3-a;this.lastTotal=3;if(a===1){this.lastChar[0]=r[r.length-1]}else{this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1]}return r.toString("base64",i,r.length-a)}function base64End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+this.lastChar.toString("base64",0,3-this.lastNeed);return i}function simpleWrite(r){return r.toString(this.encoding)}function simpleEnd(r){return r&&r.length?this.write(r):""}},15387:(r,i,a)=>{ +(()=>{var __webpack_modules__={44079:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__exportStar||function(r,i){for(var s in r)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s))a(i,r,s)};Object.defineProperty(i,"__esModule",{value:true});const c=s(48011);l(s(81112),i);l(s(75716),i);l(s(48011),i);const d=new c.DefaultArtifactClient;i["default"]=d},46574:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Timestamp=void 0;const a=s(98604);const l=s(98604);const c=s(98604);const d=s(98604);const p=s(98604);const u=s(98604);const A=s(98604);class Timestamp$Type extends A.MessageType{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const r=this.create();const i=Date.now();r.seconds=u.PbLong.from(Math.floor(i/1e3)).toString();r.nanos=i%1e3*1e6;return r}toDate(r){return new Date(u.PbLong.from(r.seconds).toNumber()*1e3+Math.ceil(r.nanos/1e6))}fromDate(r){const i=this.create();const s=r.getTime();i.seconds=u.PbLong.from(Math.floor(s/1e3)).toString();i.nanos=s%1e3*1e6;return i}internalJsonWrite(r,i){let s=u.PbLong.from(r.seconds).toNumber()*1e3;if(sDate.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(r.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let a="Z";if(r.nanos>0){let i=(r.nanos+1e9).toString().substring(1);if(i.substring(3)==="000000")a="."+i.substring(0,3)+"Z";else if(i.substring(6)==="000")a="."+i.substring(0,6)+"Z";else a="."+i+"Z"}return new Date(s).toISOString().replace(".000Z",a)}internalJsonRead(r,i,s){if(typeof r!=="string")throw new Error("Unable to parse Timestamp from JSON "+(0,p.typeofJsonValue)(r)+".");let a=r.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!a)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let l=Date.parse(a[1]+"-"+a[2]+"-"+a[3]+"T"+a[4]+":"+a[5]+":"+a[6]+(a[8]?a[8]:"Z"));if(Number.isNaN(l))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(lDate.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(!s)s=this.create();s.seconds=u.PbLong.from(l/1e3).toString();s.nanos=0;if(a[7])s.nanos=parseInt("1"+a[7]+"0".repeat(9-a[7].length))-1e9;return s}create(r){const i={seconds:"0",nanos:0};globalThis.Object.defineProperty(i,d.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,c.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,s,a){let c=a!==null&&a!==void 0?a:this.create(),d=r.pos+i;while(r.pos{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BytesValue=i.StringValue=i.BoolValue=i.UInt32Value=i.Int32Value=i.UInt64Value=i.Int64Value=i.FloatValue=i.DoubleValue=void 0;const a=s(98604);const l=s(98604);const c=s(98604);const d=s(98604);const p=s(98604);const u=s(98604);const A=s(98604);class DoubleValue$Type extends A.MessageType{constructor(){super("google.protobuf.DoubleValue",[{no:1,name:"value",kind:"scalar",T:1}])}internalJsonWrite(r,i){return this.refJsonWriter.scalar(2,r.value,"value",false,true)}internalJsonRead(r,i,s){if(!s)s=this.create();s.value=this.refJsonReader.scalar(r,1,undefined,"value");return s}create(r){const i={value:0};globalThis.Object.defineProperty(i,u.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,p.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,s,a){let l=a!==null&&a!==void 0?a:this.create(),c=r.pos+i;while(r.pos{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ArtifactService=i.DeleteArtifactResponse=i.DeleteArtifactRequest=i.GetSignedArtifactURLResponse=i.GetSignedArtifactURLRequest=i.ListArtifactsResponse_MonolithArtifact=i.ListArtifactsResponse=i.ListArtifactsRequest=i.FinalizeArtifactResponse=i.FinalizeArtifactRequest=i.CreateArtifactResponse=i.CreateArtifactRequest=void 0;const a=s(83006);const l=s(98604);const c=s(98604);const d=s(98604);const p=s(98604);const u=s(98604);const A=s(32967);const h=s(32967);const g=s(46574);class CreateArtifactRequest$Type extends u.MessageType{constructor(){super("github.actions.results.api.v1.CreateArtifactRequest",[{no:1,name:"workflow_run_backend_id",kind:"scalar",T:9},{no:2,name:"workflow_job_run_backend_id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"expires_at",kind:"message",T:()=>g.Timestamp},{no:5,name:"version",kind:"scalar",T:5}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:"",name:"",version:0};globalThis.Object.defineProperty(i,p.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,d.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,s,a){let l=a!==null&&a!==void 0?a:this.create(),d=r.pos+i;while(r.posh.StringValue}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:"",name:"",size:"0"};globalThis.Object.defineProperty(i,p.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,d.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,s,a){let l=a!==null&&a!==void 0?a:this.create(),d=r.pos+i;while(r.posh.StringValue},{no:4,name:"id_filter",kind:"message",T:()=>A.Int64Value}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:""};globalThis.Object.defineProperty(i,p.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,d.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,s,a){let l=a!==null&&a!==void 0?a:this.create(),d=r.pos+i;while(r.posi.ListArtifactsResponse_MonolithArtifact}])}create(r){const i={artifacts:[]};globalThis.Object.defineProperty(i,p.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,d.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,s,a,l){let d=l!==null&&l!==void 0?l:this.create(),p=r.pos+s;while(r.posg.Timestamp}])}create(r){const i={workflowRunBackendId:"",workflowJobRunBackendId:"",databaseId:"0",name:"",size:"0"};globalThis.Object.defineProperty(i,p.MESSAGE_TYPE,{enumerable:false,value:this});if(r!==undefined)(0,d.reflectionMergePartial)(this,i,r);return i}internalBinaryRead(r,i,s,a){let l=a!==null&&a!==void 0?a:this.create(),d=r.pos+i;while(r.posc.CreateArtifactResponse.fromJson(r,{ignoreUnknownFields:true})))}FinalizeArtifact(r){const i=c.FinalizeArtifactRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","FinalizeArtifact","application/json",i);return s.then((r=>c.FinalizeArtifactResponse.fromJson(r,{ignoreUnknownFields:true})))}ListArtifacts(r){const i=c.ListArtifactsRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","ListArtifacts","application/json",i);return s.then((r=>c.ListArtifactsResponse.fromJson(r,{ignoreUnknownFields:true})))}GetSignedArtifactURL(r){const i=c.GetSignedArtifactURLRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","GetSignedArtifactURL","application/json",i);return s.then((r=>c.GetSignedArtifactURLResponse.fromJson(r,{ignoreUnknownFields:true})))}DeleteArtifact(r){const i=c.DeleteArtifactRequest.toJson(r,{useProtoFieldName:true,emitDefaultValues:false});const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","DeleteArtifact","application/json",i);return s.then((r=>c.DeleteArtifactResponse.fromJson(r,{ignoreUnknownFields:true})))}}i.ArtifactServiceClientJSON=ArtifactServiceClientJSON;class ArtifactServiceClientProtobuf{constructor(r){this.rpc=r;this.CreateArtifact.bind(this);this.FinalizeArtifact.bind(this);this.ListArtifacts.bind(this);this.GetSignedArtifactURL.bind(this);this.DeleteArtifact.bind(this)}CreateArtifact(r){const i=c.CreateArtifactRequest.toBinary(r);const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","CreateArtifact","application/protobuf",i);return s.then((r=>c.CreateArtifactResponse.fromBinary(r)))}FinalizeArtifact(r){const i=c.FinalizeArtifactRequest.toBinary(r);const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","FinalizeArtifact","application/protobuf",i);return s.then((r=>c.FinalizeArtifactResponse.fromBinary(r)))}ListArtifacts(r){const i=c.ListArtifactsRequest.toBinary(r);const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","ListArtifacts","application/protobuf",i);return s.then((r=>c.ListArtifactsResponse.fromBinary(r)))}GetSignedArtifactURL(r){const i=c.GetSignedArtifactURLRequest.toBinary(r);const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","GetSignedArtifactURL","application/protobuf",i);return s.then((r=>c.GetSignedArtifactURLResponse.fromBinary(r)))}DeleteArtifact(r){const i=c.DeleteArtifactRequest.toBinary(r);const s=this.rpc.request("github.actions.results.api.v1.ArtifactService","DeleteArtifact","application/protobuf",i);return s.then((r=>c.DeleteArtifactResponse.fromBinary(r)))}}i.ArtifactServiceClientProtobuf=ArtifactServiceClientProtobuf;var d;(function(r){r["CreateArtifact"]="CreateArtifact";r["FinalizeArtifact"]="FinalizeArtifact";r["ListArtifacts"]="ListArtifacts";r["GetSignedArtifactURL"]="GetSignedArtifactURL";r["DeleteArtifact"]="DeleteArtifact"})(d||(i.ArtifactServiceMethod=d={}));i.ArtifactServiceMethodList=[d.CreateArtifact,d.FinalizeArtifact,d.ListArtifacts,d.GetSignedArtifactURL,d.DeleteArtifact];function createArtifactServiceServer(r){return new l.TwirpServer({service:r,packageName:"github.actions.results.api.v1",serviceName:"ArtifactService",methodList:i.ArtifactServiceMethodList,matchRoute:matchArtifactServiceRoute})}i.createArtifactServiceServer=createArtifactServiceServer;function matchArtifactServiceRoute(r,i){switch(r){case"CreateArtifact":return(r,s,l,c)=>a(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"CreateArtifact"});yield i.onMatch(r);return handleArtifactServiceCreateArtifactRequest(r,s,l,c)}));case"FinalizeArtifact":return(r,s,l,c)=>a(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"FinalizeArtifact"});yield i.onMatch(r);return handleArtifactServiceFinalizeArtifactRequest(r,s,l,c)}));case"ListArtifacts":return(r,s,l,c)=>a(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"ListArtifacts"});yield i.onMatch(r);return handleArtifactServiceListArtifactsRequest(r,s,l,c)}));case"GetSignedArtifactURL":return(r,s,l,c)=>a(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"GetSignedArtifactURL"});yield i.onMatch(r);return handleArtifactServiceGetSignedArtifactURLRequest(r,s,l,c)}));case"DeleteArtifact":return(r,s,l,c)=>a(this,void 0,void 0,(function*(){r=Object.assign(Object.assign({},r),{methodName:"DeleteArtifact"});yield i.onMatch(r);return handleArtifactServiceDeleteArtifactRequest(r,s,l,c)}));default:i.onNotFound();const r=`no handler found`;throw new l.TwirpError(l.TwirpErrorCode.BadRoute,r)}}function handleArtifactServiceCreateArtifactRequest(r,i,s,a){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceCreateArtifactJSON(r,i,s,a);case l.TwirpContentType.Protobuf:return handleArtifactServiceCreateArtifactProtobuf(r,i,s,a);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceFinalizeArtifactRequest(r,i,s,a){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceFinalizeArtifactJSON(r,i,s,a);case l.TwirpContentType.Protobuf:return handleArtifactServiceFinalizeArtifactProtobuf(r,i,s,a);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceListArtifactsRequest(r,i,s,a){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceListArtifactsJSON(r,i,s,a);case l.TwirpContentType.Protobuf:return handleArtifactServiceListArtifactsProtobuf(r,i,s,a);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceGetSignedArtifactURLRequest(r,i,s,a){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceGetSignedArtifactURLJSON(r,i,s,a);case l.TwirpContentType.Protobuf:return handleArtifactServiceGetSignedArtifactURLProtobuf(r,i,s,a);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceDeleteArtifactRequest(r,i,s,a){switch(r.contentType){case l.TwirpContentType.JSON:return handleArtifactServiceDeleteArtifactJSON(r,i,s,a);case l.TwirpContentType.Protobuf:return handleArtifactServiceDeleteArtifactProtobuf(r,i,s,a);default:const c="unexpected Content-Type";throw new l.TwirpError(l.TwirpErrorCode.BadRoute,c)}}function handleArtifactServiceCreateArtifactJSON(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{const r=JSON.parse(s.toString()||"{}");a=c.CreateArtifactRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.CreateArtifact(r,s)))}else{p=yield i.CreateArtifact(r,a)}return JSON.stringify(c.CreateArtifactResponse.toJson(p,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceFinalizeArtifactJSON(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{const r=JSON.parse(s.toString()||"{}");a=c.FinalizeArtifactRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.FinalizeArtifact(r,s)))}else{p=yield i.FinalizeArtifact(r,a)}return JSON.stringify(c.FinalizeArtifactResponse.toJson(p,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceListArtifactsJSON(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{const r=JSON.parse(s.toString()||"{}");a=c.ListArtifactsRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.ListArtifacts(r,s)))}else{p=yield i.ListArtifacts(r,a)}return JSON.stringify(c.ListArtifactsResponse.toJson(p,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceGetSignedArtifactURLJSON(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{const r=JSON.parse(s.toString()||"{}");a=c.GetSignedArtifactURLRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.GetSignedArtifactURL(r,s)))}else{p=yield i.GetSignedArtifactURL(r,a)}return JSON.stringify(c.GetSignedArtifactURLResponse.toJson(p,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceDeleteArtifactJSON(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{const r=JSON.parse(s.toString()||"{}");a=c.DeleteArtifactRequest.fromJson(r,{ignoreUnknownFields:true})}catch(r){if(r instanceof Error){const i="the json request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.DeleteArtifact(r,s)))}else{p=yield i.DeleteArtifact(r,a)}return JSON.stringify(c.DeleteArtifactResponse.toJson(p,{useProtoFieldName:true,emitDefaultValues:false}))}))}function handleArtifactServiceCreateArtifactProtobuf(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{a=c.CreateArtifactRequest.fromBinary(s)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.CreateArtifact(r,s)))}else{p=yield i.CreateArtifact(r,a)}return Buffer.from(c.CreateArtifactResponse.toBinary(p))}))}function handleArtifactServiceFinalizeArtifactProtobuf(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{a=c.FinalizeArtifactRequest.fromBinary(s)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.FinalizeArtifact(r,s)))}else{p=yield i.FinalizeArtifact(r,a)}return Buffer.from(c.FinalizeArtifactResponse.toBinary(p))}))}function handleArtifactServiceListArtifactsProtobuf(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{a=c.ListArtifactsRequest.fromBinary(s)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.ListArtifacts(r,s)))}else{p=yield i.ListArtifacts(r,a)}return Buffer.from(c.ListArtifactsResponse.toBinary(p))}))}function handleArtifactServiceGetSignedArtifactURLProtobuf(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{a=c.GetSignedArtifactURLRequest.fromBinary(s)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.GetSignedArtifactURL(r,s)))}else{p=yield i.GetSignedArtifactURL(r,a)}return Buffer.from(c.GetSignedArtifactURLResponse.toBinary(p))}))}function handleArtifactServiceDeleteArtifactProtobuf(r,i,s,d){return a(this,void 0,void 0,(function*(){let a;let p;try{a=c.DeleteArtifactRequest.fromBinary(s)}catch(r){if(r instanceof Error){const i="the protobuf request could not be decoded";throw new l.TwirpError(l.TwirpErrorCode.Malformed,i).withCause(r,true)}}if(d&&d.length>0){const s=(0,l.chainInterceptors)(...d);p=yield s(r,a,((r,s)=>i.DeleteArtifact(r,s)))}else{p=yield i.DeleteArtifact(r,a)}return Buffer.from(c.DeleteArtifactResponse.toBinary(p))}))}},48011:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};var l=this&&this.__rest||function(r,i){var s={};for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&i.indexOf(a)<0)s[a]=r[a];if(r!=null&&typeof Object.getOwnPropertySymbols==="function")for(var l=0,a=Object.getOwnPropertySymbols(r);l1){p=d.artifacts.sort(((r,i)=>Number(i.databaseId)-Number(r.databaseId)))[0];(0,l.debug)(`More than one artifact found for a single name, returning newest (id: ${p.databaseId})`)}const u={workflowRunBackendId:p.workflowRunBackendId,workflowJobRunBackendId:p.workflowJobRunBackendId,name:p.name};const A=yield i.DeleteArtifact(u);(0,l.info)(`Artifact '${r}' (ID: ${A.artifactId}) deleted`);return{id:Number(A.artifactId)}}))}i.deleteArtifactInternal=deleteArtifactInternal},21452:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};var p=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.downloadArtifactInternal=i.downloadArtifactPublic=i.streamExtractExternal=void 0;const u=p(s(73292));const A=c(s(70707));const h=c(s(92481));const g=c(s(42712));const y=p(s(89477));const b=s(60206);const w=s(69332);const C=s(36543);const v=s(68319);const I=s(60175);const B=s(75716);const scrubQueryParameters=r=>{const i=new URL(r);i.search="";return i.toString()};function exists(r){return d(this,void 0,void 0,(function*(){try{yield u.default.access(r);return true}catch(r){if(r.code==="ENOENT"){return false}else{throw r}}}))}function streamExtract(r,i){return d(this,void 0,void 0,(function*(){let s=0;while(s<5){try{yield streamExtractExternal(r,i);return}catch(r){s++;h.debug(`Failed to download artifact after ${s} retries due to ${r.message}. Retrying in 5 seconds...`);yield new Promise((r=>setTimeout(r,5e3)))}}throw new Error(`Artifact download failed after ${s} retries.`)}))}function streamExtractExternal(r,i){return d(this,void 0,void 0,(function*(){const s=new g.HttpClient((0,b.getUserAgentString)());const a=yield s.get(r);if(a.message.statusCode!==200){throw new Error(`Unexpected HTTP response from blob storage: ${a.message.statusCode} ${a.message.statusMessage}`)}const l=30*1e3;return new Promise(((r,s)=>{const timerFn=()=>{a.message.destroy(new Error(`Blob storage chunk did not respond in ${l}ms`))};const c=setTimeout(timerFn,l);a.message.on("data",(()=>{c.refresh()})).on("error",(r=>{h.debug(`response.message: Artifact download failed: ${r.message}`);clearTimeout(c);s(r)})).pipe(y.default.Extract({path:i})).on("close",(()=>{clearTimeout(c);r()})).on("error",(r=>{s(r)}))}))}))}i.streamExtractExternal=streamExtractExternal;function downloadArtifactPublic(r,i,s,a,l){return d(this,void 0,void 0,(function*(){const c=yield resolveOrCreateDirectory(l===null||l===void 0?void 0:l.path);const d=A.getOctokit(a);h.info(`Downloading artifact '${r}' from '${i}/${s}'`);const{headers:p,status:u}=yield d.rest.actions.downloadArtifact({owner:i,repo:s,artifact_id:r,archive_format:"zip",request:{redirect:"manual"}});if(u!==302){throw new Error(`Unable to download artifact. Unexpected status: ${u}`)}const{location:g}=p;if(!g){throw new Error(`Unable to redirect to artifact download url`)}h.info(`Redirecting to blob download url: ${scrubQueryParameters(g)}`);try{h.info(`Starting download of artifact to: ${c}`);yield streamExtract(g,c);h.info(`Artifact download completed successfully.`)}catch(r){throw new Error(`Unable to download and extract artifact: ${r.message}`)}return{downloadPath:c}}))}i.downloadArtifactPublic=downloadArtifactPublic;function downloadArtifactInternal(r,i){return d(this,void 0,void 0,(function*(){const s=yield resolveOrCreateDirectory(i===null||i===void 0?void 0:i.path);const a=(0,C.internalArtifactTwirpClient)();const{workflowRunBackendId:l,workflowJobRunBackendId:c}=(0,I.getBackendIdsFromToken)();const d={workflowRunBackendId:l,workflowJobRunBackendId:c,idFilter:v.Int64Value.create({value:r.toString()})};const{artifacts:p}=yield a.ListArtifacts(d);if(p.length===0){throw new B.ArtifactNotFoundError(`No artifacts found for ID: ${r}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`)}if(p.length>1){h.warning("Multiple artifacts found, defaulting to first.")}const u={workflowRunBackendId:p[0].workflowRunBackendId,workflowJobRunBackendId:p[0].workflowJobRunBackendId,name:p[0].name};const{signedUrl:A}=yield a.GetSignedArtifactURL(u);h.info(`Redirecting to blob download url: ${scrubQueryParameters(A)}`);try{h.info(`Starting download of artifact to: ${s}`);yield streamExtract(A,s);h.info(`Artifact download completed successfully.`)}catch(r){throw new Error(`Unable to download and extract artifact: ${r.message}`)}return{downloadPath:s}}))}i.downloadArtifactInternal=downloadArtifactInternal;function resolveOrCreateDirectory(r=(0,w.getGitHubWorkspaceDir)()){return d(this,void 0,void 0,(function*(){if(!(yield exists(r))){h.debug(`Artifact destination folder does not exist, creating: ${r}`);yield u.default.mkdir(r,{recursive:true})}else{h.debug(`Artifact destination folder already exists: ${r}`)}return r}))}},19043:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.getArtifactInternal=i.getArtifactPublic=void 0;const p=s(70707);const u=s(32243);const A=c(s(92481));const h=s(95628);const g=s(16412);const y=s(61117);const b=s(60175);const w=s(60206);const C=s(36543);const v=s(68319);const I=s(75716);function getArtifactPublic(r,i,s,a,l){var c;return d(this,void 0,void 0,(function*(){const[d,b]=(0,g.getRetryOptions)(h.defaults);const C={log:undefined,userAgent:(0,w.getUserAgentString)(),previews:undefined,retry:d,request:b};const v=(0,p.getOctokit)(l,C,u.retry,y.requestLog);const B=yield v.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}",{owner:s,repo:a,run_id:i,name:r});if(B.status!==200){throw new I.InvalidResponseError(`Invalid response from GitHub API: ${B.status} (${(c=B===null||B===void 0?void 0:B.headers)===null||c===void 0?void 0:c["x-github-request-id"]})`)}if(B.data.artifacts.length===0){throw new I.ArtifactNotFoundError(`Artifact not found for name: ${r}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let S=B.data.artifacts[0];if(B.data.artifacts.length>1){S=B.data.artifacts.sort(((r,i)=>i.id-r.id))[0];A.debug(`More than one artifact found for a single name, returning newest (id: ${S.id})`)}return{artifact:{name:S.name,id:S.id,size:S.size_in_bytes,createdAt:S.created_at?new Date(S.created_at):undefined}}}))}i.getArtifactPublic=getArtifactPublic;function getArtifactInternal(r){return d(this,void 0,void 0,(function*(){const i=(0,C.internalArtifactTwirpClient)();const{workflowRunBackendId:s,workflowJobRunBackendId:a}=(0,b.getBackendIdsFromToken)();const l={workflowRunBackendId:s,workflowJobRunBackendId:a,nameFilter:v.StringValue.create({value:r})};const c=yield i.ListArtifacts(l);if(c.artifacts.length===0){throw new I.ArtifactNotFoundError(`Artifact not found for name: ${r}\n Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`)}let d=c.artifacts[0];if(c.artifacts.length>1){d=c.artifacts.sort(((r,i)=>Number(i.databaseId)-Number(r.databaseId)))[0];A.debug(`More than one artifact found for a single name, returning newest (id: ${d.databaseId})`)}return{artifact:{name:d.name,id:Number(d.databaseId),size:Number(d.size),createdAt:d.createdAt?v.Timestamp.toDate(d.createdAt):undefined}}}))}i.getArtifactInternal=getArtifactInternal},79081:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.listArtifactsInternal=i.listArtifactsPublic=void 0;const l=s(92481);const c=s(70707);const d=s(60206);const p=s(16412);const u=s(95628);const A=s(61117);const h=s(32243);const g=s(36543);const y=s(60175);const b=s(68319);const w=1e3;const C=100;const v=w/C;function listArtifactsPublic(r,i,s,g,y=false){return a(this,void 0,void 0,(function*(){(0,l.info)(`Fetching artifact list for workflow run ${r} in repository ${i}/${s}`);let a=[];const[b,I]=(0,p.getRetryOptions)(u.defaults);const B={log:undefined,userAgent:(0,d.getUserAgentString)(),previews:undefined,retry:b,request:I};const S=(0,c.getOctokit)(g,B,h.retry,A.requestLog);let x=1;const{data:R}=yield S.rest.actions.listWorkflowRunArtifacts({owner:i,repo:s,run_id:r,per_page:C,page:x});let Q=Math.ceil(R.total_count/C);const _=R.total_count;if(_>w){(0,l.warning)(`Workflow run ${r} has more than 1000 artifacts. Results will be incomplete as only the first ${w} artifacts will be returned`);Q=v}for(const r of R.artifacts){a.push({name:r.name,id:r.id,size:r.size_in_bytes,createdAt:r.created_at?new Date(r.created_at):undefined})}for(x;x({name:r.name,id:Number(r.databaseId),size:Number(r.size),createdAt:r.createdAt?b.Timestamp.toDate(r.createdAt):undefined})));if(r){p=filterLatest(p)}(0,l.info)(`Found ${p.length} artifact(s)`);return{artifacts:p}}))}i.listArtifactsInternal=listArtifactsInternal;function filterLatest(r){r.sort(((r,i)=>i.id-r.id));const i=[];const s=new Set;for(const a of r){if(!s.has(a.name)){i.push(a);s.add(a.name)}}return i}},16412:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getRetryOptions=void 0;const d=c(s(92481));const p=5;const u=[400,401,403,404,422];function getRetryOptions(r,i=p,s=u){var a;if(i<=0){return[{enabled:false},r.request]}const l={enabled:true};if(s.length>0){l.doNotRetry=s}const c=Object.assign(Object.assign({},r.request),{retries:i});d.debug(`GitHub client configured with: (retries: ${c.retries}, retry-exempt-status-code: ${(a=l.doNotRetry)!==null&&a!==void 0?a:"octokit default: [400, 401, 403, 404, 422]"})`);return[l,c]}i.getRetryOptions=getRetryOptions},36543:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.internalArtifactTwirpClient=void 0;const l=s(42712);const c=s(84659);const d=s(92481);const p=s(68319);const u=s(69332);const A=s(60206);const h=s(75716);class ArtifactHttpClient{constructor(r,i,s,a){this.maxAttempts=5;this.baseRetryIntervalMilliseconds=3e3;this.retryMultiplier=1.5;const d=(0,u.getRuntimeToken)();this.baseUrl=(0,u.getResultsServiceUrl)();if(i){this.maxAttempts=i}if(s){this.baseRetryIntervalMilliseconds=s}if(a){this.retryMultiplier=a}this.httpClient=new l.HttpClient(r,[new c.BearerCredentialHandler(d)])}request(r,i,s,l){return a(this,void 0,void 0,(function*(){const c=new URL(`/twirp/${r}/${i}`,this.baseUrl).href;(0,d.debug)(`[Request] ${i} ${c}`);const p={"Content-Type":s};try{const{body:r}=yield this.retryableRequest((()=>a(this,void 0,void 0,(function*(){return this.httpClient.post(c,JSON.stringify(l),p)}))));return r}catch(r){throw new Error(`Failed to ${i}: ${r.message}`)}}))}retryableRequest(r){return a(this,void 0,void 0,(function*(){let i=0;let s="";let a="";while(i=200&&r<300}isRetryableHttpStatusCode(r){if(!r)return false;const i=[l.HttpCodes.BadGateway,l.HttpCodes.GatewayTimeout,l.HttpCodes.InternalServerError,l.HttpCodes.ServiceUnavailable,l.HttpCodes.TooManyRequests];return i.includes(r)}sleep(r){return a(this,void 0,void 0,(function*(){return new Promise((i=>setTimeout(i,r)))}))}getExponentialRetryTimeMilliseconds(r){if(r<0){throw new Error("attempt should be a positive integer")}if(r===0){return this.baseRetryIntervalMilliseconds}const i=this.baseRetryIntervalMilliseconds*Math.pow(this.retryMultiplier,r);const s=i*this.retryMultiplier;return Math.trunc(Math.random()*(s-i)+i)}}function internalArtifactTwirpClient(r){const i=new ArtifactHttpClient((0,A.getUserAgentString)(),r===null||r===void 0?void 0:r.maxAttempts,r===null||r===void 0?void 0:r.retryIntervalMs,r===null||r===void 0?void 0:r.retryMultiplier);return new p.ArtifactServiceClientJSON(i)}i.internalArtifactTwirpClient=internalArtifactTwirpClient},69332:function(r,i,s){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getConcurrency=i.getGitHubWorkspaceDir=i.isGhes=i.getResultsServiceUrl=i.getRuntimeToken=i.getUploadChunkSize=void 0;const l=a(s(22037));function getUploadChunkSize(){return 8*1024*1024}i.getUploadChunkSize=getUploadChunkSize;function getRuntimeToken(){const r=process.env["ACTIONS_RUNTIME_TOKEN"];if(!r){throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable")}return r}i.getRuntimeToken=getRuntimeToken;function getResultsServiceUrl(){const r=process.env["ACTIONS_RESULTS_URL"];if(!r){throw new Error("Unable to get the ACTIONS_RESULTS_URL env variable")}return new URL(r).origin}i.getResultsServiceUrl=getResultsServiceUrl;function isGhes(){const r=new URL(process.env["GITHUB_SERVER_URL"]||"https://github.com");const i=r.hostname.trimEnd().toUpperCase();const s=i==="GITHUB.COM";const a=i.endsWith(".GHE.COM")||i.endsWith(".GHE.LOCALHOST");return!s&&!a}i.isGhes=isGhes;function getGitHubWorkspaceDir(){const r=process.env["GITHUB_WORKSPACE"];if(!r){throw new Error("Unable to get the GITHUB_WORKSPACE env variable")}return r}i.getGitHubWorkspaceDir=getGitHubWorkspaceDir;function getConcurrency(){const r=l.default.cpus().length;if(r<=4){return 32}const i=16*r;return i>300?300:i}i.getConcurrency=getConcurrency},75716:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.UsageError=i.NetworkError=i.GHESNotSupportedError=i.ArtifactNotFoundError=i.InvalidResponseError=i.FilesNotFoundError=void 0;class FilesNotFoundError extends Error{constructor(r=[]){let i="No files were found to upload";if(r.length>0){i+=`: ${r.join(", ")}`}super(i);this.files=r;this.name="FilesNotFoundError"}}i.FilesNotFoundError=FilesNotFoundError;class InvalidResponseError extends Error{constructor(r){super(r);this.name="InvalidResponseError"}}i.InvalidResponseError=InvalidResponseError;class ArtifactNotFoundError extends Error{constructor(r="Artifact not found"){super(r);this.name="ArtifactNotFoundError"}}i.ArtifactNotFoundError=ArtifactNotFoundError;class GHESNotSupportedError extends Error{constructor(r="@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES."){super(r);this.name="GHESNotSupportedError"}}i.GHESNotSupportedError=GHESNotSupportedError;class NetworkError extends Error{constructor(r){const i=`Unable to make request: ${r}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(i);this.code=r;this.name="NetworkError"}}i.NetworkError=NetworkError;NetworkError.isNetworkErrorCode=r=>{if(!r)return false;return["ECONNRESET","ENOTFOUND","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH"].includes(r)};class UsageError extends Error{constructor(){const r=`Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`;super(r);this.name="UsageError"}}i.UsageError=UsageError;UsageError.isUsageErrorMessage=r=>{if(!r)return false;return r.includes("insufficient usage")}},81112:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true})},60206:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getUserAgentString=void 0;const a=s(85024);function getUserAgentString(){return`@actions/artifact-${a.version}`}i.getUserAgentString=getUserAgentString},60175:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getBackendIdsFromToken=void 0;const p=c(s(92481));const u=s(69332);const A=d(s(68829));const h=new Error("Failed to get backend IDs: The provided JWT token is invalid and/or missing claims");function getBackendIdsFromToken(){const r=(0,u.getRuntimeToken)();const i=(0,A.default)(r);if(!i.scp){throw h}const s=i.scp.split(" ");if(s.length===0){throw h}for(const r of s){const i=r.split(":");if((i===null||i===void 0?void 0:i[0])!=="Actions.Results"){continue}if(i.length!==3){throw h}const s={workflowRunBackendId:i[1],workflowJobRunBackendId:i[2]};p.debug(`Workflow Run Backend ID: ${s.workflowRunBackendId}`);p.debug(`Workflow Job Run Backend ID: ${s.workflowJobRunBackendId}`);return s}throw h}i.getBackendIdsFromToken=getBackendIdsFromToken},44703:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.uploadZipToBlobStorage=void 0;const p=s(12990);const u=s(69332);const A=c(s(92481));const h=c(s(6113));const g=c(s(12781));const y=s(75716);function uploadZipToBlobStorage(r,i){return d(this,void 0,void 0,(function*(){let s=0;let a=Date.now();let l;const chunkTimer=r=>{if(l){clearTimeout(l)}l=setTimeout((()=>{const i=Date.now();if(i-a>r){throw new Error("Upload progress stalled.")}}),r);return l};const c=(0,u.getConcurrency)();const d=(0,u.getUploadChunkSize)();const b=new p.BlobClient(r);const w=b.getBlockBlobClient();const C=3e5;A.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${c}, bufferSize: ${d}`);const uploadCallback=r=>{A.info(`Uploaded bytes ${r.loadedBytes}`);s=r.loadedBytes;chunkTimer(C);a=Date.now()};const v={blobHTTPHeaders:{blobContentType:"zip"},onProgress:uploadCallback};let I=undefined;const B=new g.PassThrough;const S=h.createHash("sha256");i.pipe(B);i.pipe(S).setEncoding("hex");A.info("Beginning upload of artifact content to blob storage");try{l=chunkTimer(C);yield w.uploadStream(B,d,c,v)}catch(r){if(y.NetworkError.isNetworkErrorCode(r===null||r===void 0?void 0:r.code)){throw new y.NetworkError(r===null||r===void 0?void 0:r.code)}throw r}finally{if(l){clearTimeout(l)}}A.info("Finished uploading artifact content to blob storage!");S.end();I=S.read();A.info(`SHA256 hash of uploaded artifact zip is ${I}`);if(s===0){A.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`)}return{uploadSize:s,sha256Hash:I}}))}i.uploadZipToBlobStorage=uploadZipToBlobStorage},81664:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.validateFilePath=i.validateArtifactName=void 0;const a=s(92481);const l=new Map([['"',' Double quote "'],[":"," Colon :"],["<"," Less than <"],[">"," Greater than >"],["|"," Vertical bar |"],["*"," Asterisk *"],["?"," Question mark ?"],["\r"," Carriage return \\r"],["\n"," Line feed \\n"]]);const c=new Map([...l,["\\"," Backslash \\"],["/"," Forward slash /"]]);function validateArtifactName(r){if(!r){throw new Error(`Provided artifact name input during validation is empty`)}for(const[i,s]of c){if(r.includes(i)){throw new Error(`The artifact name is not valid: ${r}. Contains the following character: ${s}\n \nInvalid characters include: ${Array.from(c.values()).toString()}\n \nThese characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`)}}(0,a.info)(`Artifact name is valid!`)}i.validateArtifactName=validateArtifactName;function validateFilePath(r){if(!r){throw new Error(`Provided file path input during validation is empty`)}for(const[i,s]of l){if(r.includes(i)){throw new Error(`The path for one of the files in artifact is not valid: ${r}. Contains the following character: ${s}\n \nInvalid characters include: ${Array.from(l.values()).toString()}\n \nThe following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.\n `)}}}i.validateFilePath=validateFilePath},30183:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getExpiration=void 0;const d=s(68319);const p=c(s(92481));function getExpiration(r){if(!r){return undefined}const i=getRetentionDays();if(i&&ir.sourcePath?[r.sourcePath]:[])))}const c=(0,y.getBackendIdsFromToken)();const d=(0,h.internalArtifactTwirpClient)();const I={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:r,version:4};const B=(0,u.getExpiration)(a===null||a===void 0?void 0:a.retentionDays);if(B){I.expiresAt=B}const S=yield d.CreateArtifact(I);if(!S.ok){throw new v.InvalidResponseError("CreateArtifact: response from backend was not ok")}const x=yield(0,w.createZipUploadStream)(l,a===null||a===void 0?void 0:a.compressionLevel);const R=yield(0,b.uploadZipToBlobStorage)(S.signedUploadUrl,x);const Q={workflowRunBackendId:c.workflowRunBackendId,workflowJobRunBackendId:c.workflowJobRunBackendId,name:r,size:R.uploadSize?R.uploadSize.toString():"0"};if(R.sha256Hash){Q.hash=C.StringValue.create({value:`sha256:${R.sha256Hash}`})}p.info(`Finalizing artifact upload`);const _=yield d.FinalizeArtifact(Q);if(!_.ok){throw new v.InvalidResponseError("FinalizeArtifact: response from backend was not ok")}const N=BigInt(_.artifactId);p.info(`Artifact ${r}.zip successfully finalized. Artifact ID ${N}`);return{size:R.uploadSize,id:Number(N)}}))}i.uploadArtifact=uploadArtifact},52052:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getUploadZipSpecification=i.validateRootDirectory=void 0;const d=c(s(57147));const p=s(92481);const u=s(71017);const A=s(81664);function validateRootDirectory(r){if(!d.existsSync(r)){throw new Error(`The provided rootDirectory ${r} does not exist`)}if(!d.statSync(r).isDirectory()){throw new Error(`The provided rootDirectory ${r} is not a valid directory`)}(0,p.info)(`Root directory input is valid!`)}i.validateRootDirectory=validateRootDirectory;function getUploadZipSpecification(r,i){const s=[];i=(0,u.normalize)(i);i=(0,u.resolve)(i);for(let a of r){if(!d.existsSync(a)){throw new Error(`File ${a} does not exist`)}if(!d.statSync(a).isDirectory()){a=(0,u.normalize)(a);a=(0,u.resolve)(a);if(!a.startsWith(i)){throw new Error(`The rootDirectory: ${i} is not a parent directory of the file: ${a}`)}const r=a.replace(i,"");(0,A.validateFilePath)(r);s.push({sourcePath:a,destinationPath:r})}else{const r=a.replace(i,"");(0,A.validateFilePath)(r);s.push({sourcePath:null,destinationPath:r})}}return s}i.getUploadZipSpecification=getUploadZipSpecification},65952:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.createZipUploadStream=i.ZipUploadStream=i.DEFAULT_COMPRESSION_LEVEL=void 0;const p=c(s(12781));const u=c(s(15387));const A=c(s(92481));const h=s(57147);const g=s(69332);i.DEFAULT_COMPRESSION_LEVEL=6;class ZipUploadStream extends p.Transform{constructor(r){super({highWaterMark:r})}_transform(r,i,s){s(null,r)}}i.ZipUploadStream=ZipUploadStream;function createZipUploadStream(r,s=i.DEFAULT_COMPRESSION_LEVEL){return d(this,void 0,void 0,(function*(){A.debug(`Creating Artifact archive with compressionLevel: ${s}`);const i=u.create("zip",{highWaterMark:(0,g.getUploadChunkSize)(),zlib:{level:s}});i.on("error",zipErrorCallback);i.on("warning",zipWarningCallback);i.on("finish",zipFinishCallback);i.on("end",zipEndCallback);for(const s of r){if(s.sourcePath!==null){i.append((0,h.createReadStream)(s.sourcePath),{name:s.destinationPath})}else{i.append("",{name:s.destinationPath})}}const a=(0,g.getUploadChunkSize)();const l=new ZipUploadStream(a);A.debug(`Zip write high watermark value ${l.writableHighWaterMark}`);A.debug(`Zip read high watermark value ${l.readableHighWaterMark}`);i.pipe(l);i.finalize();return l}))}i.createZipUploadStream=createZipUploadStream;const zipErrorCallback=r=>{A.error("An error has occurred while creating the zip file for upload");A.info(r);throw new Error("An error has occurred during zip creation for the artifact")};const zipWarningCallback=r=>{if(r.code==="ENOENT"){A.warning("ENOENT warning during artifact zip creation. No such file or directory");A.info(r)}else{A.warning(`A non-blocking warning has occurred during artifact zip creation: ${r.code}`);A.info(r)}};const zipFinishCallback=()=>{A.debug("Zip stream for upload has finished.")};const zipEndCallback=()=>{A.debug("Zip stream for upload has ended.")}},46062:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.issue=i.issueCommand=void 0;const d=c(s(22037));const p=s(34309);function issueCommand(r,i,s){const a=new Command(r,i,s);process.stdout.write(a.toString()+d.EOL)}i.issueCommand=issueCommand;function issue(r,i=""){issueCommand(r,{},i)}i.issue=issue;const u="::";class Command{constructor(r,i,s){if(!r){r="missing.command"}this.command=r;this.properties=i;this.message=s}toString(){let r=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){r+=" ";let i=true;for(const s in this.properties){if(this.properties.hasOwnProperty(s)){const a=this.properties[s];if(a){if(i){i=false}else{r+=","}r+=`${s}=${escapeProperty(a)}`}}}}r+=`${u}${escapeData(this.message)}`;return r}}function escapeData(r){return p.toCommandValue(r).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(r){return p.toCommandValue(r).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},92481:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.getIDToken=i.getState=i.saveState=i.group=i.endGroup=i.startGroup=i.info=i.notice=i.warning=i.error=i.debug=i.isDebug=i.setFailed=i.setCommandEcho=i.setOutput=i.getBooleanInput=i.getMultilineInput=i.getInput=i.addPath=i.setSecret=i.exportVariable=i.ExitCode=void 0;const p=s(46062);const u=s(44720);const A=s(34309);const h=c(s(22037));const g=c(s(71017));const y=s(57045);var b;(function(r){r[r["Success"]=0]="Success";r[r["Failure"]=1]="Failure"})(b=i.ExitCode||(i.ExitCode={}));function exportVariable(r,i){const s=A.toCommandValue(i);process.env[r]=s;const a=process.env["GITHUB_ENV"]||"";if(a){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(r,i))}p.issueCommand("set-env",{name:r},s)}i.exportVariable=exportVariable;function setSecret(r){p.issueCommand("add-mask",{},r)}i.setSecret=setSecret;function addPath(r){const i=process.env["GITHUB_PATH"]||"";if(i){u.issueFileCommand("PATH",r)}else{p.issueCommand("add-path",{},r)}process.env["PATH"]=`${r}${g.delimiter}${process.env["PATH"]}`}i.addPath=addPath;function getInput(r,i){const s=process.env[`INPUT_${r.replace(/ /g,"_").toUpperCase()}`]||"";if(i&&i.required&&!s){throw new Error(`Input required and not supplied: ${r}`)}if(i&&i.trimWhitespace===false){return s}return s.trim()}i.getInput=getInput;function getMultilineInput(r,i){const s=getInput(r,i).split("\n").filter((r=>r!==""));if(i&&i.trimWhitespace===false){return s}return s.map((r=>r.trim()))}i.getMultilineInput=getMultilineInput;function getBooleanInput(r,i){const s=["true","True","TRUE"];const a=["false","False","FALSE"];const l=getInput(r,i);if(s.includes(l))return true;if(a.includes(l))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${r}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}i.getBooleanInput=getBooleanInput;function setOutput(r,i){const s=process.env["GITHUB_OUTPUT"]||"";if(s){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(r,i))}process.stdout.write(h.EOL);p.issueCommand("set-output",{name:r},A.toCommandValue(i))}i.setOutput=setOutput;function setCommandEcho(r){p.issue("echo",r?"on":"off")}i.setCommandEcho=setCommandEcho;function setFailed(r){process.exitCode=b.Failure;error(r)}i.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}i.isDebug=isDebug;function debug(r){p.issueCommand("debug",{},r)}i.debug=debug;function error(r,i={}){p.issueCommand("error",A.toCommandProperties(i),r instanceof Error?r.toString():r)}i.error=error;function warning(r,i={}){p.issueCommand("warning",A.toCommandProperties(i),r instanceof Error?r.toString():r)}i.warning=warning;function notice(r,i={}){p.issueCommand("notice",A.toCommandProperties(i),r instanceof Error?r.toString():r)}i.notice=notice;function info(r){process.stdout.write(r+h.EOL)}i.info=info;function startGroup(r){p.issue("group",r)}i.startGroup=startGroup;function endGroup(){p.issue("endgroup")}i.endGroup=endGroup;function group(r,i){return d(this,void 0,void 0,(function*(){startGroup(r);let s;try{s=yield i()}finally{endGroup()}return s}))}i.group=group;function saveState(r,i){const s=process.env["GITHUB_STATE"]||"";if(s){return u.issueFileCommand("STATE",u.prepareKeyValueMessage(r,i))}p.issueCommand("save-state",{name:r},A.toCommandValue(i))}i.saveState=saveState;function getState(r){return process.env[`STATE_${r}`]||""}i.getState=getState;function getIDToken(r){return d(this,void 0,void 0,(function*(){return yield y.OidcClient.getIDToken(r)}))}i.getIDToken=getIDToken;var w=s(93176);Object.defineProperty(i,"summary",{enumerable:true,get:function(){return w.summary}});var C=s(93176);Object.defineProperty(i,"markdownSummary",{enumerable:true,get:function(){return C.markdownSummary}});var v=s(2314);Object.defineProperty(i,"toPosixPath",{enumerable:true,get:function(){return v.toPosixPath}});Object.defineProperty(i,"toWin32Path",{enumerable:true,get:function(){return v.toWin32Path}});Object.defineProperty(i,"toPlatformPath",{enumerable:true,get:function(){return v.toPlatformPath}})},44720:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.prepareKeyValueMessage=i.issueFileCommand=void 0;const d=c(s(57147));const p=c(s(22037));const u=s(50757);const A=s(34309);function issueFileCommand(r,i){const s=process.env[`GITHUB_${r}`];if(!s){throw new Error(`Unable to find environment variable for file command ${r}`)}if(!d.existsSync(s)){throw new Error(`Missing file at path: ${s}`)}d.appendFileSync(s,`${A.toCommandValue(i)}${p.EOL}`,{encoding:"utf8"})}i.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(r,i){const s=`ghadelimiter_${u.v4()}`;const a=A.toCommandValue(i);if(r.includes(s)){throw new Error(`Unexpected input: name should not contain the delimiter "${s}"`)}if(a.includes(s)){throw new Error(`Unexpected input: value should not contain the delimiter "${s}"`)}return`${r}<<${s}${p.EOL}${a}${p.EOL}${s}`}i.prepareKeyValueMessage=prepareKeyValueMessage},57045:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.OidcClient=void 0;const l=s(42712);const c=s(84659);const d=s(92481);class OidcClient{static createHttpClient(r=true,i=10){const s={allowRetries:r,maxRetries:i};return new l.HttpClient("actions/oidc-client",[new c.BearerCredentialHandler(OidcClient.getRequestToken())],s)}static getRequestToken(){const r=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!r){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return r}static getIDTokenUrl(){const r=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!r){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return r}static getCall(r){var i;return a(this,void 0,void 0,(function*(){const s=OidcClient.createHttpClient();const a=yield s.getJson(r).catch((r=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${r.statusCode}\n \n Error Message: ${r.message}`)}));const l=(i=a.result)===null||i===void 0?void 0:i.value;if(!l){throw new Error("Response json body do not have ID Token field")}return l}))}static getIDToken(r){return a(this,void 0,void 0,(function*(){try{let i=OidcClient.getIDTokenUrl();if(r){const s=encodeURIComponent(r);i=`${i}&audience=${s}`}d.debug(`ID token url is ${i}`);const s=yield OidcClient.getCall(i);d.setSecret(s);return s}catch(r){throw new Error(`Error message: ${r.message}`)}}))}}i.OidcClient=OidcClient},2314:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.toPlatformPath=i.toWin32Path=i.toPosixPath=void 0;const d=c(s(71017));function toPosixPath(r){return r.replace(/[\\]/g,"/")}i.toPosixPath=toPosixPath;function toWin32Path(r){return r.replace(/[/]/g,"\\")}i.toWin32Path=toWin32Path;function toPlatformPath(r){return r.replace(/[/\\]/g,d.sep)}i.toPlatformPath=toPlatformPath},93176:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.summary=i.markdownSummary=i.SUMMARY_DOCS_URL=i.SUMMARY_ENV_VAR=void 0;const l=s(22037);const c=s(57147);const{access:d,appendFile:p,writeFile:u}=c.promises;i.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";i.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return a(this,void 0,void 0,(function*(){if(this._filePath){return this._filePath}const r=process.env[i.SUMMARY_ENV_VAR];if(!r){throw new Error(`Unable to find environment variable for $${i.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield d(r,c.constants.R_OK|c.constants.W_OK)}catch(i){throw new Error(`Unable to access summary file: '${r}'. Check if the file has correct read/write permissions.`)}this._filePath=r;return this._filePath}))}wrap(r,i,s={}){const a=Object.entries(s).map((([r,i])=>` ${r}="${i}"`)).join("");if(!i){return`<${r}${a}>`}return`<${r}${a}>${i}`}write(r){return a(this,void 0,void 0,(function*(){const i=!!(r===null||r===void 0?void 0:r.overwrite);const s=yield this.filePath();const a=i?u:p;yield a(s,this._buffer,{encoding:"utf8"});return this.emptyBuffer()}))}clear(){return a(this,void 0,void 0,(function*(){return this.emptyBuffer().write({overwrite:true})}))}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(r,i=false){this._buffer+=r;return i?this.addEOL():this}addEOL(){return this.addRaw(l.EOL)}addCodeBlock(r,i){const s=Object.assign({},i&&{lang:i});const a=this.wrap("pre",this.wrap("code",r),s);return this.addRaw(a).addEOL()}addList(r,i=false){const s=i?"ol":"ul";const a=r.map((r=>this.wrap("li",r))).join("");const l=this.wrap(s,a);return this.addRaw(l).addEOL()}addTable(r){const i=r.map((r=>{const i=r.map((r=>{if(typeof r==="string"){return this.wrap("td",r)}const{header:i,data:s,colspan:a,rowspan:l}=r;const c=i?"th":"td";const d=Object.assign(Object.assign({},a&&{colspan:a}),l&&{rowspan:l});return this.wrap(c,s,d)})).join("");return this.wrap("tr",i)})).join("");const s=this.wrap("table",i);return this.addRaw(s).addEOL()}addDetails(r,i){const s=this.wrap("details",this.wrap("summary",r)+i);return this.addRaw(s).addEOL()}addImage(r,i,s){const{width:a,height:l}=s||{};const c=Object.assign(Object.assign({},a&&{width:a}),l&&{height:l});const d=this.wrap("img",null,Object.assign({src:r,alt:i},c));return this.addRaw(d).addEOL()}addHeading(r,i){const s=`h${i}`;const a=["h1","h2","h3","h4","h5","h6"].includes(s)?s:"h1";const l=this.wrap(a,r);return this.addRaw(l).addEOL()}addSeparator(){const r=this.wrap("hr",null);return this.addRaw(r).addEOL()}addBreak(){const r=this.wrap("br",null);return this.addRaw(r).addEOL()}addQuote(r,i){const s=Object.assign({},i&&{cite:i});const a=this.wrap("blockquote",r,s);return this.addRaw(a).addEOL()}addLink(r,i){const s=this.wrap("a",r,{href:i});return this.addRaw(s).addEOL()}}const A=new Summary;i.markdownSummary=A;i.summary=A},34309:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.toCommandProperties=i.toCommandValue=void 0;function toCommandValue(r){if(r===null||r===undefined){return""}else if(typeof r==="string"||r instanceof String){return r}return JSON.stringify(r)}i.toCommandValue=toCommandValue;function toCommandProperties(r){if(!Object.keys(r).length){return{}}return{title:r.title,file:r.file,line:r.startLine,endLine:r.endLine,col:r.startColumn,endColumn:r.endColumn}}i.toCommandProperties=toCommandProperties},37917:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Context=void 0;const a=s(57147);const l=s(22037);class Context{constructor(){var r,i,s;this.payload={};if(process.env.GITHUB_EVENT_PATH){if(a.existsSync(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse(a.readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const r=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${r} does not exist${l.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10);this.runId=parseInt(process.env.GITHUB_RUN_ID,10);this.apiUrl=(r=process.env.GITHUB_API_URL)!==null&&r!==void 0?r:`https://api.github.com`;this.serverUrl=(i=process.env.GITHUB_SERVER_URL)!==null&&i!==void 0?i:`https://github.com`;this.graphqlUrl=(s=process.env.GITHUB_GRAPHQL_URL)!==null&&s!==void 0?s:`https://api.github.com/graphql`}get issue(){const r=this.payload;return Object.assign(Object.assign({},this.repo),{number:(r.issue||r.pull_request||r).number})}get repo(){if(process.env.GITHUB_REPOSITORY){const[r,i]=process.env.GITHUB_REPOSITORY.split("/");return{owner:r,repo:i}}if(this.payload.repository){return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name}}throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}}i.Context=Context},70707:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getOctokit=i.context=void 0;const d=c(s(37917));const p=s(95628);i.context=new d.Context;function getOctokit(r,i,...s){const a=p.GitHub.plugin(...s);return new a(p.getOctokitOptions(r,i))}i.getOctokit=getOctokit},89587:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getApiBaseUrl=i.getProxyAgent=i.getAuthString=void 0;const d=c(s(42712));function getAuthString(r,i){if(!r&&!i.auth){throw new Error("Parameter token or opts.auth is required")}else if(r&&i.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof i.auth==="string"?i.auth:`token ${r}`}i.getAuthString=getAuthString;function getProxyAgent(r){const i=new d.HttpClient;return i.getAgent(r)}i.getProxyAgent=getProxyAgent;function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}i.getApiBaseUrl=getApiBaseUrl},95628:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getOctokitOptions=i.GitHub=i.defaults=i.context=void 0;const d=c(s(37917));const p=c(s(89587));const u=s(80947);const A=s(15243);const h=s(88474);i.context=new d.Context;const g=p.getApiBaseUrl();i.defaults={baseUrl:g,request:{agent:p.getProxyAgent(g)}};i.GitHub=u.Octokit.plugin(A.restEndpointMethods,h.paginateRest).defaults(i.defaults);function getOctokitOptions(r,i){const s=Object.assign({},i||{});const a=p.getAuthString(r,s);if(a){s.auth=a}return s}i.getOctokitOptions=getOctokitOptions},38453:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.hashFiles=i.create=void 0;const l=s(53843);const c=s(70772);function create(r,i){return a(this,void 0,void 0,(function*(){return yield l.DefaultGlobber.create(r,i)}))}i.create=create;function hashFiles(r,i="",s,l=false){return a(this,void 0,void 0,(function*(){let a=true;if(s&&typeof s.followSymbolicLinks==="boolean"){a=s.followSymbolicLinks}const d=yield create(r,{followSymbolicLinks:a});return c.hashFiles(d,i,l)}))}i.hashFiles=hashFiles},92179:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.getOptions=void 0;const d=c(s(92481));function getOptions(r){const i={followSymbolicLinks:true,implicitDescendants:true,matchDirectories:true,omitBrokenSymbolicLinks:true};if(r){if(typeof r.followSymbolicLinks==="boolean"){i.followSymbolicLinks=r.followSymbolicLinks;d.debug(`followSymbolicLinks '${i.followSymbolicLinks}'`)}if(typeof r.implicitDescendants==="boolean"){i.implicitDescendants=r.implicitDescendants;d.debug(`implicitDescendants '${i.implicitDescendants}'`)}if(typeof r.matchDirectories==="boolean"){i.matchDirectories=r.matchDirectories;d.debug(`matchDirectories '${i.matchDirectories}'`)}if(typeof r.omitBrokenSymbolicLinks==="boolean"){i.omitBrokenSymbolicLinks=r.omitBrokenSymbolicLinks;d.debug(`omitBrokenSymbolicLinks '${i.omitBrokenSymbolicLinks}'`)}}return i}i.getOptions=getOptions},53843:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};var p=this&&this.__asyncValues||function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],s;return i?i.call(r):(r=typeof __values==="function"?__values(r):r[Symbol.iterator](),s={},verb("next"),verb("throw"),verb("return"),s[Symbol.asyncIterator]=function(){return this},s);function verb(i){s[i]=r[i]&&function(s){return new Promise((function(a,l){s=r[i](s),settle(a,l,s.done,s.value)}))}}function settle(r,i,s,a){Promise.resolve(a).then((function(i){r({value:i,done:s})}),i)}};var u=this&&this.__await||function(r){return this instanceof u?(this.v=r,this):new u(r)};var A=this&&this.__asyncGenerator||function(r,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=s.apply(r,i||[]),l,c=[];return l={},verb("next"),verb("throw"),verb("return"),l[Symbol.asyncIterator]=function(){return this},l;function verb(r){if(a[r])l[r]=function(i){return new Promise((function(s,a){c.push([r,i,s,a])>1||resume(r,i)}))}}function resume(r,i){try{step(a[r](i))}catch(r){settle(c[0][3],r)}}function step(r){r.value instanceof u?Promise.resolve(r.value.v).then(fulfill,reject):settle(c[0][2],r)}function fulfill(r){resume("next",r)}function reject(r){resume("throw",r)}function settle(r,i){if(r(i),c.shift(),c.length)resume(c[0][0],c[0][1])}};Object.defineProperty(i,"__esModule",{value:true});i.DefaultGlobber=void 0;const h=c(s(92481));const g=c(s(57147));const y=c(s(92179));const b=c(s(71017));const w=c(s(46968));const C=s(78276);const v=s(55999);const I=s(83698);const B=process.platform==="win32";class DefaultGlobber{constructor(r){this.patterns=[];this.searchPaths=[];this.options=y.getOptions(r)}getSearchPaths(){return this.searchPaths.slice()}glob(){var r,i;return d(this,void 0,void 0,(function*(){const s=[];try{for(var a=p(this.globGenerator()),l;l=yield a.next(),!l.done;){const r=l.value;s.push(r)}}catch(i){r={error:i}}finally{try{if(l&&!l.done&&(i=a.return))yield i.call(a)}finally{if(r)throw r.error}}return s}))}globGenerator(){return A(this,arguments,(function*globGenerator_1(){const r=y.getOptions(this.options);const i=[];for(const s of this.patterns){i.push(s);if(r.implicitDescendants&&(s.trailingSeparator||s.segments[s.segments.length-1]!=="**")){i.push(new v.Pattern(s.negate,true,s.segments.concat("**")))}}const s=[];for(const r of w.getSearchPaths(i)){h.debug(`Search path '${r}'`);try{yield u(g.promises.lstat(r))}catch(r){if(r.code==="ENOENT"){continue}throw r}s.unshift(new I.SearchState(r,1))}const a=[];while(s.length){const l=s.pop();const c=w.match(i,l.path);const d=!!c||w.partialMatch(i,l.path);if(!c&&!d){continue}const p=yield u(DefaultGlobber.stat(l,r,a));if(!p){continue}if(p.isDirectory()){if(c&C.MatchKind.Directory&&r.matchDirectories){yield yield u(l.path)}else if(!d){continue}const i=l.level+1;const a=(yield u(g.promises.readdir(l.path))).map((r=>new I.SearchState(b.join(l.path,r),i)));s.push(...a.reverse())}else if(c&C.MatchKind.File){yield yield u(l.path)}}}))}static create(r,i){return d(this,void 0,void 0,(function*(){const s=new DefaultGlobber(i);if(B){r=r.replace(/\r\n/g,"\n");r=r.replace(/\r/g,"\n")}const a=r.split("\n").map((r=>r.trim()));for(const r of a){if(!r||r.startsWith("#")){continue}else{s.patterns.push(new v.Pattern(r))}}s.searchPaths.push(...w.getSearchPaths(s.patterns));return s}))}static stat(r,i,s){return d(this,void 0,void 0,(function*(){let a;if(i.followSymbolicLinks){try{a=yield g.promises.stat(r.path)}catch(s){if(s.code==="ENOENT"){if(i.omitBrokenSymbolicLinks){h.debug(`Broken symlink '${r.path}'`);return undefined}throw new Error(`No information found for the path '${r.path}'. This may indicate a broken symbolic link.`)}throw s}}else{a=yield g.promises.lstat(r.path)}if(a.isDirectory()&&i.followSymbolicLinks){const i=yield g.promises.realpath(r.path);while(s.length>=r.level){s.pop()}if(s.some((r=>r===i))){h.debug(`Symlink cycle detected for path '${r.path}' and realpath '${i}'`);return undefined}s.push(i)}return a}))}}i.DefaultGlobber=DefaultGlobber},70772:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};var p=this&&this.__asyncValues||function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],s;return i?i.call(r):(r=typeof __values==="function"?__values(r):r[Symbol.iterator](),s={},verb("next"),verb("throw"),verb("return"),s[Symbol.asyncIterator]=function(){return this},s);function verb(i){s[i]=r[i]&&function(s){return new Promise((function(a,l){s=r[i](s),settle(a,l,s.done,s.value)}))}}function settle(r,i,s,a){Promise.resolve(a).then((function(i){r({value:i,done:s})}),i)}};Object.defineProperty(i,"__esModule",{value:true});i.hashFiles=void 0;const u=c(s(6113));const A=c(s(92481));const h=c(s(57147));const g=c(s(12781));const y=c(s(73837));const b=c(s(71017));function hashFiles(r,i,s=false){var a,l;var c;return d(this,void 0,void 0,(function*(){const d=s?A.info:A.debug;let w=false;const C=i?i:(c=process.env["GITHUB_WORKSPACE"])!==null&&c!==void 0?c:process.cwd();const v=u.createHash("sha256");let I=0;try{for(var B=p(r.globGenerator()),S;S=yield B.next(),!S.done;){const r=S.value;d(r);if(!r.startsWith(`${C}${b.sep}`)){d(`Ignore '${r}' since it is not under GITHUB_WORKSPACE.`);continue}if(h.statSync(r).isDirectory()){d(`Skip directory '${r}'.`);continue}const i=u.createHash("sha256");const s=y.promisify(g.pipeline);yield s(h.createReadStream(r),i);v.write(i.digest());I++;if(!w){w=true}}}catch(r){a={error:r}}finally{try{if(S&&!S.done&&(l=B.return))yield l.call(B)}finally{if(a)throw a.error}}v.end();if(w){d(`Found ${I} files to hash.`);return v.digest("hex")}else{d(`No matches found for glob`);return""}}))}i.hashFiles=hashFiles},78276:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MatchKind=void 0;var s;(function(r){r[r["None"]=0]="None";r[r["Directory"]=1]="Directory";r[r["File"]=2]="File";r[r["All"]=3]="All"})(s=i.MatchKind||(i.MatchKind={}))},59444:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.safeTrimTrailingSeparator=i.normalizeSeparators=i.hasRoot=i.hasAbsoluteRoot=i.ensureAbsoluteRoot=i.dirname=void 0;const p=c(s(71017));const u=d(s(39491));const A=process.platform==="win32";function dirname(r){r=safeTrimTrailingSeparator(r);if(A&&/^\\\\[^\\]+(\\[^\\]+)?$/.test(r)){return r}let i=p.dirname(r);if(A&&/^\\\\[^\\]+\\[^\\]+\\$/.test(i)){i=safeTrimTrailingSeparator(i)}return i}i.dirname=dirname;function ensureAbsoluteRoot(r,i){u.default(r,`ensureAbsoluteRoot parameter 'root' must not be empty`);u.default(i,`ensureAbsoluteRoot parameter 'itemPath' must not be empty`);if(hasAbsoluteRoot(i)){return i}if(A){if(i.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)){let r=process.cwd();u.default(r.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${r}'`);if(i[0].toUpperCase()===r[0].toUpperCase()){if(i.length===2){return`${i[0]}:\\${r.substr(3)}`}else{if(!r.endsWith("\\")){r+="\\"}return`${i[0]}:\\${r.substr(3)}${i.substr(2)}`}}else{return`${i[0]}:\\${i.substr(2)}`}}else if(normalizeSeparators(i).match(/^\\$|^\\[^\\]/)){const r=process.cwd();u.default(r.match(/^[A-Z]:\\/i),`Expected current directory to start with an absolute drive root. Actual '${r}'`);return`${r[0]}:\\${i.substr(1)}`}}u.default(hasAbsoluteRoot(r),`ensureAbsoluteRoot parameter 'root' must have an absolute root`);if(r.endsWith("/")||A&&r.endsWith("\\")){}else{r+=p.sep}return r+i}i.ensureAbsoluteRoot=ensureAbsoluteRoot;function hasAbsoluteRoot(r){u.default(r,`hasAbsoluteRoot parameter 'itemPath' must not be empty`);r=normalizeSeparators(r);if(A){return r.startsWith("\\\\")||/^[A-Z]:\\/i.test(r)}return r.startsWith("/")}i.hasAbsoluteRoot=hasAbsoluteRoot;function hasRoot(r){u.default(r,`isRooted parameter 'itemPath' must not be empty`);r=normalizeSeparators(r);if(A){return r.startsWith("\\")||/^[A-Z]:/i.test(r)}return r.startsWith("/")}i.hasRoot=hasRoot;function normalizeSeparators(r){r=r||"";if(A){r=r.replace(/\//g,"\\");const i=/^\\\\+[^\\]/.test(r);return(i?"\\":"")+r.replace(/\\\\+/g,"\\")}return r.replace(/\/\/+/g,"/")}i.normalizeSeparators=normalizeSeparators;function safeTrimTrailingSeparator(r){if(!r){return""}r=normalizeSeparators(r);if(!r.endsWith(p.sep)){return r}if(r===p.sep){return r}if(A&&/^[A-Z]:\\$/i.test(r)){return r}return r.substr(0,r.length-1)}i.safeTrimTrailingSeparator=safeTrimTrailingSeparator},84684:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Path=void 0;const p=c(s(71017));const u=c(s(59444));const A=d(s(39491));const h=process.platform==="win32";class Path{constructor(r){this.segments=[];if(typeof r==="string"){A.default(r,`Parameter 'itemPath' must not be empty`);r=u.safeTrimTrailingSeparator(r);if(!u.hasRoot(r)){this.segments=r.split(p.sep)}else{let i=r;let s=u.dirname(i);while(s!==i){const r=p.basename(i);this.segments.unshift(r);i=s;s=u.dirname(i)}this.segments.unshift(i)}}else{A.default(r.length>0,`Parameter 'itemPath' must not be an empty array`);for(let i=0;i!r.negate));const i={};for(const s of r){const r=u?s.searchPath.toUpperCase():s.searchPath;i[r]="candidate"}const s=[];for(const a of r){const r=u?a.searchPath.toUpperCase():a.searchPath;if(i[r]==="included"){continue}let l=false;let c=r;let p=d.dirname(c);while(p!==c){if(i[p]){l=true;break}c=p;p=d.dirname(c)}if(!l){s.push(a.searchPath);i[r]="included"}}return s}i.getSearchPaths=getSearchPaths;function match(r,i){let s=p.MatchKind.None;for(const a of r){if(a.negate){s&=~a.match(i)}else{s|=a.match(i)}}return s}i.match=match;function partialMatch(r,i){return r.some((r=>!r.negate&&r.partialMatch(i)))}i.partialMatch=partialMatch},55999:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Pattern=void 0;const p=c(s(22037));const u=c(s(71017));const A=c(s(59444));const h=d(s(39491));const g=s(94193);const y=s(78276);const b=s(84684);const w=process.platform==="win32";class Pattern{constructor(r,i=false,s,a){this.negate=false;let l;if(typeof r==="string"){l=r.trim()}else{s=s||[];h.default(s.length,`Parameter 'segments' must not empty`);const i=Pattern.getLiteral(s[0]);h.default(i&&A.hasAbsoluteRoot(i),`Parameter 'segments' first element must be a root path`);l=new b.Path(s).toString().trim();if(r){l=`!${l}`}}while(l.startsWith("!")){this.negate=!this.negate;l=l.substr(1).trim()}l=Pattern.fixupPattern(l,a);this.segments=new b.Path(l).segments;this.trailingSeparator=A.normalizeSeparators(l).endsWith(u.sep);l=A.safeTrimTrailingSeparator(l);let c=false;const d=this.segments.map((r=>Pattern.getLiteral(r))).filter((r=>!c&&!(c=r==="")));this.searchPath=new b.Path(d).toString();this.rootRegExp=new RegExp(Pattern.regExpEscape(d[0]),w?"i":"");this.isImplicitPattern=i;const p={dot:true,nobrace:true,nocase:w,nocomment:true,noext:true,nonegate:true};l=w?l.replace(/\\/g,"/"):l;this.minimatch=new g.Minimatch(l,p)}match(r){if(this.segments[this.segments.length-1]==="**"){r=A.normalizeSeparators(r);if(!r.endsWith(u.sep)&&this.isImplicitPattern===false){r=`${r}${u.sep}`}}else{r=A.safeTrimTrailingSeparator(r)}if(this.minimatch.match(r)){return this.trailingSeparator?y.MatchKind.Directory:y.MatchKind.All}return y.MatchKind.None}partialMatch(r){r=A.safeTrimTrailingSeparator(r);if(A.dirname(r)===r){return this.rootRegExp.test(r)}return this.minimatch.matchOne(r.split(w?/\\+/:/\/+/),this.minimatch.set[0],true)}static globEscape(r){return(w?r:r.replace(/\\/g,"\\\\")).replace(/(\[)(?=[^/]+\])/g,"[[]").replace(/\?/g,"[?]").replace(/\*/g,"[*]")}static fixupPattern(r,i){h.default(r,"pattern cannot be empty");const s=new b.Path(r).segments.map((r=>Pattern.getLiteral(r)));h.default(s.every(((r,i)=>(r!=="."||i===0)&&r!=="..")),`Invalid pattern '${r}'. Relative pathing '.' and '..' is not allowed.`);h.default(!A.hasRoot(r)||s[0],`Invalid pattern '${r}'. Root segment must not contain globs.`);r=A.normalizeSeparators(r);if(r==="."||r.startsWith(`.${u.sep}`)){r=Pattern.globEscape(process.cwd())+r.substr(1)}else if(r==="~"||r.startsWith(`~${u.sep}`)){i=i||p.homedir();h.default(i,"Unable to determine HOME directory");h.default(A.hasAbsoluteRoot(i),`Expected HOME directory to be a rooted path. Actual '${i}'`);r=Pattern.globEscape(i)+r.substr(1)}else if(w&&(r.match(/^[A-Z]:$/i)||r.match(/^[A-Z]:[^\\]/i))){let i=A.ensureAbsoluteRoot("C:\\dummy-root",r.substr(0,2));if(r.length>2&&!i.endsWith("\\")){i+="\\"}r=Pattern.globEscape(i)+r.substr(2)}else if(w&&(r==="\\"||r.match(/^\\[^\\]/))){let i=A.ensureAbsoluteRoot("C:\\dummy-root","\\");if(!i.endsWith("\\")){i+="\\"}r=Pattern.globEscape(i)+r.substr(1)}else{r=A.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()),r)}return A.normalizeSeparators(r)}static getLiteral(r){let i="";for(let s=0;s=0){if(a.length>1){return""}if(a){i+=a;s=l;continue}}}i+=a}return i}static regExpEscape(r){return r.replace(/[[\\^$.|?*+()]/g,"\\$&")}}i.Pattern=Pattern},83698:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SearchState=void 0;class SearchState{constructor(r,i){this.path=r;this.level=i}}i.SearchState=SearchState},84659:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.PersonalAccessTokenCredentialHandler=i.BearerCredentialHandler=i.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(r,i){this.username=r;this.password=i}prepareRequest(r){if(!r.headers){throw Error("The request has no headers")}r.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return s(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}i.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(r){this.token=r}prepareRequest(r){if(!r.headers){throw Error("The request has no headers")}r.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return s(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}i.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(r){this.token=r}prepareRequest(r){if(!r.headers){throw Error("The request has no headers")}r.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return s(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}i.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},42712:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.HttpClient=i.isHttps=i.HttpClientResponse=i.HttpClientError=i.getProxyUrl=i.MediaTypes=i.Headers=i.HttpCodes=void 0;const p=c(s(13685));const u=c(s(95687));const A=c(s(32722));const h=c(s(70391));const g=s(16096);var y;(function(r){r[r["OK"]=200]="OK";r[r["MultipleChoices"]=300]="MultipleChoices";r[r["MovedPermanently"]=301]="MovedPermanently";r[r["ResourceMoved"]=302]="ResourceMoved";r[r["SeeOther"]=303]="SeeOther";r[r["NotModified"]=304]="NotModified";r[r["UseProxy"]=305]="UseProxy";r[r["SwitchProxy"]=306]="SwitchProxy";r[r["TemporaryRedirect"]=307]="TemporaryRedirect";r[r["PermanentRedirect"]=308]="PermanentRedirect";r[r["BadRequest"]=400]="BadRequest";r[r["Unauthorized"]=401]="Unauthorized";r[r["PaymentRequired"]=402]="PaymentRequired";r[r["Forbidden"]=403]="Forbidden";r[r["NotFound"]=404]="NotFound";r[r["MethodNotAllowed"]=405]="MethodNotAllowed";r[r["NotAcceptable"]=406]="NotAcceptable";r[r["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";r[r["RequestTimeout"]=408]="RequestTimeout";r[r["Conflict"]=409]="Conflict";r[r["Gone"]=410]="Gone";r[r["TooManyRequests"]=429]="TooManyRequests";r[r["InternalServerError"]=500]="InternalServerError";r[r["NotImplemented"]=501]="NotImplemented";r[r["BadGateway"]=502]="BadGateway";r[r["ServiceUnavailable"]=503]="ServiceUnavailable";r[r["GatewayTimeout"]=504]="GatewayTimeout"})(y||(i.HttpCodes=y={}));var b;(function(r){r["Accept"]="accept";r["ContentType"]="content-type"})(b||(i.Headers=b={}));var w;(function(r){r["ApplicationJson"]="application/json"})(w||(i.MediaTypes=w={}));function getProxyUrl(r){const i=A.getProxyUrl(new URL(r));return i?i.href:""}i.getProxyUrl=getProxyUrl;const C=[y.MovedPermanently,y.ResourceMoved,y.SeeOther,y.TemporaryRedirect,y.PermanentRedirect];const v=[y.BadGateway,y.ServiceUnavailable,y.GatewayTimeout];const I=["OPTIONS","GET","DELETE","HEAD"];const B=10;const S=5;class HttpClientError extends Error{constructor(r,i){super(r);this.name="HttpClientError";this.statusCode=i;Object.setPrototypeOf(this,HttpClientError.prototype)}}i.HttpClientError=HttpClientError;class HttpClientResponse{constructor(r){this.message=r}readBody(){return d(this,void 0,void 0,(function*(){return new Promise((r=>d(this,void 0,void 0,(function*(){let i=Buffer.alloc(0);this.message.on("data",(r=>{i=Buffer.concat([i,r])}));this.message.on("end",(()=>{r(i.toString())}))}))))}))}readBodyBuffer(){return d(this,void 0,void 0,(function*(){return new Promise((r=>d(this,void 0,void 0,(function*(){const i=[];this.message.on("data",(r=>{i.push(r)}));this.message.on("end",(()=>{r(Buffer.concat(i))}))}))))}))}}i.HttpClientResponse=HttpClientResponse;function isHttps(r){const i=new URL(r);return i.protocol==="https:"}i.isHttps=isHttps;class HttpClient{constructor(r,i,s){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=r;this.handlers=i||[];this.requestOptions=s;if(s){if(s.ignoreSslError!=null){this._ignoreSslError=s.ignoreSslError}this._socketTimeout=s.socketTimeout;if(s.allowRedirects!=null){this._allowRedirects=s.allowRedirects}if(s.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=s.allowRedirectDowngrade}if(s.maxRedirects!=null){this._maxRedirects=Math.max(s.maxRedirects,0)}if(s.keepAlive!=null){this._keepAlive=s.keepAlive}if(s.allowRetries!=null){this._allowRetries=s.allowRetries}if(s.maxRetries!=null){this._maxRetries=s.maxRetries}}}options(r,i){return d(this,void 0,void 0,(function*(){return this.request("OPTIONS",r,null,i||{})}))}get(r,i){return d(this,void 0,void 0,(function*(){return this.request("GET",r,null,i||{})}))}del(r,i){return d(this,void 0,void 0,(function*(){return this.request("DELETE",r,null,i||{})}))}post(r,i,s){return d(this,void 0,void 0,(function*(){return this.request("POST",r,i,s||{})}))}patch(r,i,s){return d(this,void 0,void 0,(function*(){return this.request("PATCH",r,i,s||{})}))}put(r,i,s){return d(this,void 0,void 0,(function*(){return this.request("PUT",r,i,s||{})}))}head(r,i){return d(this,void 0,void 0,(function*(){return this.request("HEAD",r,null,i||{})}))}sendStream(r,i,s,a){return d(this,void 0,void 0,(function*(){return this.request(r,i,s,a)}))}getJson(r,i={}){return d(this,void 0,void 0,(function*(){i[b.Accept]=this._getExistingOrDefaultHeader(i,b.Accept,w.ApplicationJson);const s=yield this.get(r,i);return this._processResponse(s,this.requestOptions)}))}postJson(r,i,s={}){return d(this,void 0,void 0,(function*(){const a=JSON.stringify(i,null,2);s[b.Accept]=this._getExistingOrDefaultHeader(s,b.Accept,w.ApplicationJson);s[b.ContentType]=this._getExistingOrDefaultHeader(s,b.ContentType,w.ApplicationJson);const l=yield this.post(r,a,s);return this._processResponse(l,this.requestOptions)}))}putJson(r,i,s={}){return d(this,void 0,void 0,(function*(){const a=JSON.stringify(i,null,2);s[b.Accept]=this._getExistingOrDefaultHeader(s,b.Accept,w.ApplicationJson);s[b.ContentType]=this._getExistingOrDefaultHeader(s,b.ContentType,w.ApplicationJson);const l=yield this.put(r,a,s);return this._processResponse(l,this.requestOptions)}))}patchJson(r,i,s={}){return d(this,void 0,void 0,(function*(){const a=JSON.stringify(i,null,2);s[b.Accept]=this._getExistingOrDefaultHeader(s,b.Accept,w.ApplicationJson);s[b.ContentType]=this._getExistingOrDefaultHeader(s,b.ContentType,w.ApplicationJson);const l=yield this.patch(r,a,s);return this._processResponse(l,this.requestOptions)}))}request(r,i,s,a){return d(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const l=new URL(i);let c=this._prepareRequest(r,l,a);const d=this._allowRetries&&I.includes(r)?this._maxRetries+1:1;let p=0;let u;do{u=yield this.requestRaw(c,s);if(u&&u.message&&u.message.statusCode===y.Unauthorized){let r;for(const i of this.handlers){if(i.canHandleAuthentication(u)){r=i;break}}if(r){return r.handleAuthentication(this,c,s)}else{return u}}let i=this._maxRedirects;while(u.message.statusCode&&C.includes(u.message.statusCode)&&this._allowRedirects&&i>0){const d=u.message.headers["location"];if(!d){break}const p=new URL(d);if(l.protocol==="https:"&&l.protocol!==p.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield u.readBody();if(p.hostname!==l.hostname){for(const r in a){if(r.toLowerCase()==="authorization"){delete a[r]}}}c=this._prepareRequest(r,p,a);u=yield this.requestRaw(c,s);i--}if(!u.message.statusCode||!v.includes(u.message.statusCode)){return u}p+=1;if(p{function callbackForResult(r,i){if(r){a(r)}else if(!i){a(new Error("Unknown error"))}else{s(i)}}this.requestRawWithCallback(r,i,callbackForResult)}))}))}requestRawWithCallback(r,i,s){if(typeof i==="string"){if(!r.options.headers){r.options.headers={}}r.options.headers["Content-Length"]=Buffer.byteLength(i,"utf8")}let a=false;function handleResult(r,i){if(!a){a=true;s(r,i)}}const l=r.httpModule.request(r.options,(r=>{const i=new HttpClientResponse(r);handleResult(undefined,i)}));let c;l.on("socket",(r=>{c=r}));l.setTimeout(this._socketTimeout||3*6e4,(()=>{if(c){c.end()}handleResult(new Error(`Request timeout: ${r.options.path}`))}));l.on("error",(function(r){handleResult(r)}));if(i&&typeof i==="string"){l.write(i,"utf8")}if(i&&typeof i!=="string"){i.on("close",(function(){l.end()}));i.pipe(l)}else{l.end()}}getAgent(r){const i=new URL(r);return this._getAgent(i)}getAgentDispatcher(r){const i=new URL(r);const s=A.getProxyUrl(i);const a=s&&s.hostname;if(!a){return}return this._getProxyAgentDispatcher(i,s)}_prepareRequest(r,i,s){const a={};a.parsedUrl=i;const l=a.parsedUrl.protocol==="https:";a.httpModule=l?u:p;const c=l?443:80;a.options={};a.options.host=a.parsedUrl.hostname;a.options.port=a.parsedUrl.port?parseInt(a.parsedUrl.port):c;a.options.path=(a.parsedUrl.pathname||"")+(a.parsedUrl.search||"");a.options.method=r;a.options.headers=this._mergeHeaders(s);if(this.userAgent!=null){a.options.headers["user-agent"]=this.userAgent}a.options.agent=this._getAgent(a.parsedUrl);if(this.handlers){for(const r of this.handlers){r.prepareRequest(a.options)}}return a}_mergeHeaders(r){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(r||{}))}return lowercaseKeys(r||{})}_getExistingOrDefaultHeader(r,i,s){let a;if(this.requestOptions&&this.requestOptions.headers){a=lowercaseKeys(this.requestOptions.headers)[i]}return r[i]||a||s}_getAgent(r){let i;const s=A.getProxyUrl(r);const a=s&&s.hostname;if(this._keepAlive&&a){i=this._proxyAgent}if(!a){i=this._agent}if(i){return i}const l=r.protocol==="https:";let c=100;if(this.requestOptions){c=this.requestOptions.maxSockets||p.globalAgent.maxSockets}if(s&&s.hostname){const r={maxSockets:c,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(s.username||s.password)&&{proxyAuth:`${s.username}:${s.password}`}),{host:s.hostname,port:s.port})};let a;const d=s.protocol==="https:";if(l){a=d?h.httpsOverHttps:h.httpsOverHttp}else{a=d?h.httpOverHttps:h.httpOverHttp}i=a(r);this._proxyAgent=i}if(!i){const r={keepAlive:this._keepAlive,maxSockets:c};i=l?new u.Agent(r):new p.Agent(r);this._agent=i}if(l&&this._ignoreSslError){i.options=Object.assign(i.options||{},{rejectUnauthorized:false})}return i}_getProxyAgentDispatcher(r,i){let s;if(this._keepAlive){s=this._proxyAgentDispatcher}if(s){return s}const a=r.protocol==="https:";s=new g.ProxyAgent(Object.assign({uri:i.href,pipelining:!this._keepAlive?0:1},(i.username||i.password)&&{token:`${i.username}:${i.password}`}));this._proxyAgentDispatcher=s;if(a&&this._ignoreSslError){s.options=Object.assign(s.options.requestTls||{},{rejectUnauthorized:false})}return s}_performExponentialBackoff(r){return d(this,void 0,void 0,(function*(){r=Math.min(B,r);const i=S*Math.pow(2,r);return new Promise((r=>setTimeout((()=>r()),i)))}))}_processResponse(r,i){return d(this,void 0,void 0,(function*(){return new Promise(((s,a)=>d(this,void 0,void 0,(function*(){const l=r.message.statusCode||0;const c={statusCode:l,result:null,headers:{}};if(l===y.NotFound){s(c)}function dateTimeDeserializer(r,i){if(typeof i==="string"){const r=new Date(i);if(!isNaN(r.valueOf())){return r}}return i}let d;let p;try{p=yield r.readBody();if(p&&p.length>0){if(i&&i.deserializeDates){d=JSON.parse(p,dateTimeDeserializer)}else{d=JSON.parse(p)}c.result=d}c.headers=r.message.headers}catch(r){}if(l>299){let r;if(d&&d.message){r=d.message}else if(p&&p.length>0){r=p}else{r=`Failed request: (${l})`}const i=new HttpClientError(r,l);i.result=c.result;a(i)}else{s(c)}}))))}))}}i.HttpClient=HttpClient;const lowercaseKeys=r=>Object.keys(r).reduce(((i,s)=>(i[s.toLowerCase()]=r[s],i)),{})},32722:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.checkBypass=i.getProxyUrl=void 0;function getProxyUrl(r){const i=r.protocol==="https:";if(checkBypass(r)){return undefined}const s=(()=>{if(i){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(s){try{return new URL(s)}catch(r){if(!s.startsWith("http://")&&!s.startsWith("https://"))return new URL(`http://${s}`)}}else{return undefined}}i.getProxyUrl=getProxyUrl;function checkBypass(r){if(!r.hostname){return false}const i=r.hostname;if(isLoopbackAddress(i)){return true}const s=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!s){return false}let a;if(r.port){a=Number(r.port)}else if(r.protocol==="http:"){a=80}else if(r.protocol==="https:"){a=443}const l=[r.hostname.toUpperCase()];if(typeof a==="number"){l.push(`${l[0]}:${a}`)}for(const r of s.split(",").map((r=>r.trim().toUpperCase())).filter((r=>r))){if(r==="*"||l.some((i=>i===r||i.endsWith(`.${r}`)||r.startsWith(".")&&i.endsWith(`${r}`)))){return true}}return false}i.checkBypass=checkBypass;function isLoopbackAddress(r){const i=r.toLowerCase();return i==="localhost"||i.startsWith("127.")||i.startsWith("[::1]")||i.startsWith("[0:0:0:0:0:0:0:1]")}},18619:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};var p;Object.defineProperty(i,"__esModule",{value:true});i.getCmdPath=i.tryGetExecutablePath=i.isRooted=i.isDirectory=i.exists=i.READONLY=i.UV_FS_O_EXLOCK=i.IS_WINDOWS=i.unlink=i.symlink=i.stat=i.rmdir=i.rm=i.rename=i.readlink=i.readdir=i.open=i.mkdir=i.lstat=i.copyFile=i.chmod=void 0;const u=c(s(57147));const A=c(s(71017));p=u.promises,i.chmod=p.chmod,i.copyFile=p.copyFile,i.lstat=p.lstat,i.mkdir=p.mkdir,i.open=p.open,i.readdir=p.readdir,i.readlink=p.readlink,i.rename=p.rename,i.rm=p.rm,i.rmdir=p.rmdir,i.stat=p.stat,i.symlink=p.symlink,i.unlink=p.unlink;i.IS_WINDOWS=process.platform==="win32";i.UV_FS_O_EXLOCK=268435456;i.READONLY=u.constants.O_RDONLY;function exists(r){return d(this,void 0,void 0,(function*(){try{yield i.stat(r)}catch(r){if(r.code==="ENOENT"){return false}throw r}return true}))}i.exists=exists;function isDirectory(r,s=false){return d(this,void 0,void 0,(function*(){const a=s?yield i.stat(r):yield i.lstat(r);return a.isDirectory()}))}i.isDirectory=isDirectory;function isRooted(r){r=normalizeSeparators(r);if(!r){throw new Error('isRooted() parameter "p" cannot be empty')}if(i.IS_WINDOWS){return r.startsWith("\\")||/^[A-Z]:/i.test(r)}return r.startsWith("/")}i.isRooted=isRooted;function tryGetExecutablePath(r,s){return d(this,void 0,void 0,(function*(){let a=undefined;try{a=yield i.stat(r)}catch(i){if(i.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${i}`)}}if(a&&a.isFile()){if(i.IS_WINDOWS){const i=A.extname(r).toUpperCase();if(s.some((r=>r.toUpperCase()===i))){return r}}else{if(isUnixExecutable(a)){return r}}}const l=r;for(const c of s){r=l+c;a=undefined;try{a=yield i.stat(r)}catch(i){if(i.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${r}': ${i}`)}}if(a&&a.isFile()){if(i.IS_WINDOWS){try{const s=A.dirname(r);const a=A.basename(r).toUpperCase();for(const l of yield i.readdir(s)){if(a===l.toUpperCase()){r=A.join(s,l);break}}}catch(i){console.log(`Unexpected error attempting to determine the actual case of the file '${r}': ${i}`)}return r}else{if(isUnixExecutable(a)){return r}}}}return""}))}i.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(r){r=r||"";if(i.IS_WINDOWS){r=r.replace(/\//g,"\\");return r.replace(/\\\\+/g,"\\")}return r.replace(/\/\/+/g,"/")}function isUnixExecutable(r){return(r.mode&1)>0||(r.mode&8)>0&&r.gid===process.getgid()||(r.mode&64)>0&&r.uid===process.getuid()}function getCmdPath(){var r;return(r=process.env["COMSPEC"])!==null&&r!==void 0?r:`cmd.exe`}i.getCmdPath=getCmdPath},3448:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.findInPath=i.which=i.mkdirP=i.rmRF=i.mv=i.cp=void 0;const p=s(39491);const u=c(s(71017));const A=c(s(18619));function cp(r,i,s={}){return d(this,void 0,void 0,(function*(){const{force:a,recursive:l,copySourceDirectory:c}=readCopyOptions(s);const d=(yield A.exists(i))?yield A.stat(i):null;if(d&&d.isFile()&&!a){return}const p=d&&d.isDirectory()&&c?u.join(i,u.basename(r)):i;if(!(yield A.exists(r))){throw new Error(`no such file or directory: ${r}`)}const h=yield A.stat(r);if(h.isDirectory()){if(!l){throw new Error(`Failed to copy. ${r} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(r,p,0,a)}}else{if(u.relative(r,p)===""){throw new Error(`'${p}' and '${r}' are the same file`)}yield copyFile(r,p,a)}}))}i.cp=cp;function mv(r,i,s={}){return d(this,void 0,void 0,(function*(){if(yield A.exists(i)){let a=true;if(yield A.isDirectory(i)){i=u.join(i,u.basename(r));a=yield A.exists(i)}if(a){if(s.force==null||s.force){yield rmRF(i)}else{throw new Error("Destination already exists")}}}yield mkdirP(u.dirname(i));yield A.rename(r,i)}))}i.mv=mv;function rmRF(r){return d(this,void 0,void 0,(function*(){if(A.IS_WINDOWS){if(/[*"<>|]/.test(r)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield A.rm(r,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(r){throw new Error(`File was unable to be removed ${r}`)}}))}i.rmRF=rmRF;function mkdirP(r){return d(this,void 0,void 0,(function*(){p.ok(r,"a path argument must be provided");yield A.mkdir(r,{recursive:true})}))}i.mkdirP=mkdirP;function which(r,i){return d(this,void 0,void 0,(function*(){if(!r){throw new Error("parameter 'tool' is required")}if(i){const i=yield which(r,false);if(!i){if(A.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${r}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${r}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return i}const s=yield findInPath(r);if(s&&s.length>0){return s[0]}return""}))}i.which=which;function findInPath(r){return d(this,void 0,void 0,(function*(){if(!r){throw new Error("parameter 'tool' is required")}const i=[];if(A.IS_WINDOWS&&process.env["PATHEXT"]){for(const r of process.env["PATHEXT"].split(u.delimiter)){if(r){i.push(r)}}}if(A.isRooted(r)){const s=yield A.tryGetExecutablePath(r,i);if(s){return[s]}return[]}if(r.includes(u.sep)){return[]}const s=[];if(process.env.PATH){for(const r of process.env.PATH.split(u.delimiter)){if(r){s.push(r)}}}const a=[];for(const l of s){const s=yield A.tryGetExecutablePath(u.join(l,r),i);if(s){a.push(s)}}return a}))}i.findInPath=findInPath;function readCopyOptions(r){const i=r.force==null?true:r.force;const s=Boolean(r.recursive);const a=r.copySourceDirectory==null?true:Boolean(r.copySourceDirectory);return{force:i,recursive:s,copySourceDirectory:a}}function cpDirRecursive(r,i,s,a){return d(this,void 0,void 0,(function*(){if(s>=255)return;s++;yield mkdirP(i);const l=yield A.readdir(r);for(const c of l){const l=`${r}/${c}`;const d=`${i}/${c}`;const p=yield A.lstat(l);if(p.isDirectory()){yield cpDirRecursive(l,d,s,a)}else{yield copyFile(l,d,a)}}yield A.chmod(i,(yield A.stat(r)).mode)}))}function copyFile(r,i,s){return d(this,void 0,void 0,(function*(){if((yield A.lstat(r)).isSymbolicLink()){try{yield A.lstat(i);yield A.unlink(i)}catch(r){if(r.code==="EPERM"){yield A.chmod(i,"0666");yield A.unlink(i)}}const s=yield A.readlink(r);yield A.symlink(s,i,A.IS_WINDOWS?"junction":null)}else if(!(yield A.exists(i))||s){yield A.copyFile(r,i)}}))}},78185:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const s=new WeakMap;const a=new WeakMap;class AbortSignal{constructor(){this.onabort=null;s.set(this,[]);a.set(this,false)}get aborted(){if(!a.has(this)){throw new TypeError("Expected `this` to be an instance of AbortSignal.")}return a.get(this)}static get none(){return new AbortSignal}addEventListener(r,i){if(!s.has(this)){throw new TypeError("Expected `this` to be an instance of AbortSignal.")}const a=s.get(this);a.push(i)}removeEventListener(r,i){if(!s.has(this)){throw new TypeError("Expected `this` to be an instance of AbortSignal.")}const a=s.get(this);const l=a.indexOf(i);if(l>-1){a.splice(l,1)}}dispatchEvent(r){throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes.")}}function abortSignal(r){if(r.aborted){return}if(r.onabort){r.onabort.call(r)}const i=s.get(r);if(i){i.slice().forEach((i=>{i.call(r,{type:"abort"})}))}a.set(r,true)}class AbortError extends Error{constructor(r){super(r);this.name="AbortError"}}class AbortController{constructor(r){this._signal=new AbortSignal;if(!r){return}if(!Array.isArray(r)){r=arguments}for(const i of r){if(i.aborted){this.abort()}else{i.addEventListener("abort",(()=>{this.abort()}))}}}get signal(){return this._signal}abort(){abortSignal(this._signal)}static timeout(r){const i=new AbortSignal;const s=setTimeout(abortSignal,r,i);if(typeof s.unref==="function"){s.unref()}return i}}i.AbortController=AbortController;i.AbortError=AbortError;i.AbortSignal=AbortSignal},61889:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(50757);var l=s(73837);var c=s(56728);var d=s(82357);var p=s(76672);var u=s(91878);var A=s(2729);var h=s(22037);var g=s(13685);var y=s(95687);var b=s(78185);var w=s(70391);var C=s(12781);var v=s(97010);var I=s(18885);var B=s(54787);function _interopDefaultLegacy(r){return r&&typeof r==="object"&&"default"in r?r:{default:r}}function _interopNamespace(r){if(r&&r.__esModule)return r;var i=Object.create(null);if(r){Object.keys(r).forEach((function(s){if(s!=="default"){var a=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(i,s,a.get?a:{enumerable:true,get:function(){return r[s]}})}}))}i["default"]=r;return Object.freeze(i)}var S=_interopNamespace(d);var x=_interopNamespace(h);var R=_interopNamespace(g);var Q=_interopNamespace(y);var _=_interopNamespace(w);var N=_interopDefaultLegacy(v);var T=_interopDefaultLegacy(I);function getHeaderKey(r){return r.toLowerCase()}function isHttpHeadersLike(r){if(r&&typeof r==="object"){const i=r;if(typeof i.rawHeaders==="function"&&typeof i.clone==="function"&&typeof i.get==="function"&&typeof i.set==="function"&&typeof i.contains==="function"&&typeof i.remove==="function"&&typeof i.headersArray==="function"&&typeof i.headerValues==="function"&&typeof i.headerNames==="function"&&typeof i.toJson==="function"){return true}}return false}class HttpHeaders{constructor(r){this._headersMap={};if(r){for(const i in r){this.set(i,r[i])}}}set(r,i){this._headersMap[getHeaderKey(r)]={name:r,value:i.toString().trim()}}get(r){const i=this._headersMap[getHeaderKey(r)];return!i?undefined:i.value}contains(r){return!!this._headersMap[getHeaderKey(r)]}remove(r){const i=this.contains(r);delete this._headersMap[getHeaderKey(r)];return i}rawHeaders(){return this.toJson({preserveCase:true})}headersArray(){const r=[];for(const i in this._headersMap){r.push(this._headersMap[i])}return r}headerNames(){const r=[];const i=this.headersArray();for(let s=0;s{s=s.then(r)}));return s}function promiseToCallback(r){if(typeof r.then!=="function"){throw new Error("The provided input is not a Promise.")}return i=>{r.then((r=>i(undefined,r))).catch((r=>{i(r)}))}}function promiseToServiceCallback(r){if(typeof r.then!=="function"){throw new Error("The provided input is not a Promise.")}return i=>{r.then((r=>process.nextTick(i,undefined,r.parsedBody,r.request,r))).catch((r=>{process.nextTick(i,r)}))}}function prepareXMLRootList(r,i,s,a){if(!Array.isArray(r)){r=[r]}if(!s||!a){return{[i]:r}}const l={[i]:r};l[D]={[s]:a};return l}function applyMixins(r,i){const s=r;i.forEach((r=>{Object.getOwnPropertyNames(r.prototype).forEach((i=>{s.prototype[i]=r.prototype[i]}))}))}const L=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function isDuration(r){return L.test(r)}function replaceAll(r,i,s){return!r||!i?r:r.split(i).join(s||"")}function isPrimitiveType(r){return typeof r!=="object"&&typeof r!=="function"||r===null}function getEnvironmentValue(r){if(process.env[r]){return process.env[r]}else if(process.env[r.toLowerCase()]){return process.env[r.toLowerCase()]}return undefined}function isObject(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}class Serializer{constructor(r={},i){this.modelMappers=r;this.isXML=i}validateConstraints(r,i,s){const failValidation=(r,a)=>{throw new Error(`"${s}" with value "${i}" should satisfy the constraint "${r}": ${a}.`)};if(r.constraints&&i!=undefined){const s=i;const{ExclusiveMaximum:a,ExclusiveMinimum:l,InclusiveMaximum:c,InclusiveMinimum:d,MaxItems:p,MaxLength:u,MinItems:A,MinLength:h,MultipleOf:g,Pattern:y,UniqueItems:b}=r.constraints;if(a!=undefined&&s>=a){failValidation("ExclusiveMaximum",a)}if(l!=undefined&&s<=l){failValidation("ExclusiveMinimum",l)}if(c!=undefined&&s>c){failValidation("InclusiveMaximum",c)}if(d!=undefined&&sp){failValidation("MaxItems",p)}if(u!=undefined&&w.length>u){failValidation("MaxLength",u)}if(A!=undefined&&w.lengths.indexOf(r)!==i))){failValidation("UniqueItems",b)}}}serialize(r,i,s,a={}){var l,c,d;const p={rootName:(l=a.rootName)!==null&&l!==void 0?l:"",includeRoot:(c=a.includeRoot)!==null&&c!==void 0?c:false,xmlCharKey:(d=a.xmlCharKey)!==null&&d!==void 0?d:P};let u={};const A=r.type.name;if(!s){s=r.serializedName}if(A.match(/^Sequence$/i)!==null){u=[]}if(r.isConstant){i=r.defaultValue}const{required:h,nullable:g}=r;if(h&&g&&i===undefined){throw new Error(`${s} cannot be undefined.`)}if(h&&!g&&i==undefined){throw new Error(`${s} cannot be null or undefined.`)}if(!h&&g===false&&i===null){throw new Error(`${s} cannot be null.`)}if(i==undefined){u=i}else{if(A.match(/^any$/i)!==null){u=i}else if(A.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)!==null){u=serializeBasicTypes(A,s,i)}else if(A.match(/^Enum$/i)!==null){const a=r;u=serializeEnumType(s,a.type.allowedValues,i)}else if(A.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)!==null){u=serializeDateTypes(A,i,s)}else if(A.match(/^ByteArray$/i)!==null){u=serializeByteArrayType(s,i)}else if(A.match(/^Base64Url$/i)!==null){u=serializeBase64UrlType(s,i)}else if(A.match(/^Sequence$/i)!==null){u=serializeSequenceType(this,r,i,s,Boolean(this.isXML),p)}else if(A.match(/^Dictionary$/i)!==null){u=serializeDictionaryType(this,r,i,s,Boolean(this.isXML),p)}else if(A.match(/^Composite$/i)!==null){u=serializeCompositeType(this,r,i,s,Boolean(this.isXML),p)}}return u}deserialize(r,i,s,a={}){var l,c,d;const p={rootName:(l=a.rootName)!==null&&l!==void 0?l:"",includeRoot:(c=a.includeRoot)!==null&&c!==void 0?c:false,xmlCharKey:(d=a.xmlCharKey)!==null&&d!==void 0?d:P};if(i==undefined){if(this.isXML&&r.type.name==="Sequence"&&!r.xmlIsWrapped){i=[]}if(r.defaultValue!==undefined){i=r.defaultValue}return i}let u;const A=r.type.name;if(!s){s=r.serializedName}if(A.match(/^Composite$/i)!==null){u=deserializeCompositeType(this,r,i,s,p)}else{if(this.isXML){const r=p.xmlCharKey;const s=i;if(s[D]!=undefined&&s[r]!=undefined){i=s[r]}}if(A.match(/^Number$/i)!==null){u=parseFloat(i);if(isNaN(u)){u=i}}else if(A.match(/^Boolean$/i)!==null){if(i==="true"){u=true}else if(i==="false"){u=false}else{u=i}}else if(A.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)!==null){u=i}else if(A.match(/^(Date|DateTime|DateTimeRfc1123)$/i)!==null){u=new Date(i)}else if(A.match(/^UnixTime$/i)!==null){u=unixTimeToDate(i)}else if(A.match(/^ByteArray$/i)!==null){u=decodeString(i)}else if(A.match(/^Base64Url$/i)!==null){u=base64UrlToByteArray(i)}else if(A.match(/^Sequence$/i)!==null){u=deserializeSequenceType(this,r,i,s,p)}else if(A.match(/^Dictionary$/i)!==null){u=deserializeDictionaryType(this,r,i,s,p)}}if(r.isConstant){u=r.defaultValue}return u}}function trimEnd(r,i){let s=r.length;while(s-1>=0&&r[s-1]===i){--s}return r.substr(0,s)}function bufferToBase64Url(r){if(!r){return undefined}if(!(r instanceof Uint8Array)){throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`)}const i=encodeByteArray(r);return trimEnd(i,"=").replace(/\+/g,"-").replace(/\//g,"_")}function base64UrlToByteArray(r){if(!r){return undefined}if(r&&typeof r.valueOf()!=="string"){throw new Error("Please provide an input of type string for converting to Uint8Array")}r=r.replace(/-/g,"+").replace(/_/g,"/");return decodeString(r)}function splitSerializeName(r){const i=[];let s="";if(r){const a=r.split(".");for(const r of a){if(r.charAt(r.length-1)==="\\"){s+=r.substr(0,r.length-1)+"."}else{s+=r;i.push(s);s=""}}}return i}function dateToUnixTime(r){if(!r){return undefined}if(typeof r.valueOf()==="string"){r=new Date(r)}return Math.floor(r.getTime()/1e3)}function unixTimeToDate(r){if(!r){return undefined}return new Date(r*1e3)}function serializeBasicTypes(r,i,s){if(s!==null&&s!==undefined){if(r.match(/^Number$/i)!==null){if(typeof s!=="number"){throw new Error(`${i} with value ${s} must be of type number.`)}}else if(r.match(/^String$/i)!==null){if(typeof s.valueOf()!=="string"){throw new Error(`${i} with value "${s}" must be of type string.`)}}else if(r.match(/^Uuid$/i)!==null){if(!(typeof s.valueOf()==="string"&&isValidUuid(s))){throw new Error(`${i} with value "${s}" must be of type string and a valid uuid.`)}}else if(r.match(/^Boolean$/i)!==null){if(typeof s!=="boolean"){throw new Error(`${i} with value ${s} must be of type boolean.`)}}else if(r.match(/^Stream$/i)!==null){const r=typeof s;if(r!=="string"&&r!=="function"&&!(s instanceof ArrayBuffer)&&!ArrayBuffer.isView(s)&&!((typeof Blob==="function"||typeof Blob==="object")&&s instanceof Blob)){throw new Error(`${i} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`)}}}return s}function serializeEnumType(r,i,s){if(!i){throw new Error(`Please provide a set of allowedValues to validate ${r} as an Enum Type.`)}const a=i.some((r=>{if(typeof r.valueOf()==="string"){return r.toLowerCase()===s.toLowerCase()}return r===s}));if(!a){throw new Error(`${s} is not a valid value for ${r}. The valid values are: ${JSON.stringify(i)}.`)}return s}function serializeByteArrayType(r,i){let s="";if(i!=undefined){if(!(i instanceof Uint8Array)){throw new Error(`${r} must be of type Uint8Array.`)}s=encodeByteArray(i)}return s}function serializeBase64UrlType(r,i){let s="";if(i!=undefined){if(!(i instanceof Uint8Array)){throw new Error(`${r} must be of type Uint8Array.`)}s=bufferToBase64Url(i)||""}return s}function serializeDateTypes(r,i,s){if(i!=undefined){if(r.match(/^Date$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${s} must be an instanceof Date or a string in ISO8601 format.`)}i=i instanceof Date?i.toISOString().substring(0,10):new Date(i).toISOString().substring(0,10)}else if(r.match(/^DateTime$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${s} must be an instanceof Date or a string in ISO8601 format.`)}i=i instanceof Date?i.toISOString():new Date(i).toISOString()}else if(r.match(/^DateTimeRfc1123$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${s} must be an instanceof Date or a string in RFC-1123 format.`)}i=i instanceof Date?i.toUTCString():new Date(i).toUTCString()}else if(r.match(/^UnixTime$/i)!==null){if(!(i instanceof Date||typeof i.valueOf()==="string"&&!isNaN(Date.parse(i)))){throw new Error(`${s} must be an instanceof Date or a string in RFC-1123/ISO8601 format `+`for it to be serialized in UnixTime/Epoch format.`)}i=dateToUnixTime(i)}else if(r.match(/^TimeSpan$/i)!==null){if(!isDuration(i)){throw new Error(`${s} must be a string in ISO 8601 format. Instead was "${i}".`)}}}return i}function serializeSequenceType(r,i,s,a,l,c){if(!Array.isArray(s)){throw new Error(`${a} must be of type Array.`)}const d=i.type.element;if(!d||typeof d!=="object"){throw new Error(`element" metadata for an Array must be defined in the `+`mapper and it must of type "object" in ${a}.`)}const p=[];for(let i=0;ir!==l));if(p){d[l]=r.serialize(u,s[l],a+'["'+l+'"]',c)}}}return d}return s}function getXmlObjectValue(r,i,s,a){if(!s||!r.xmlNamespace){return i}const l=r.xmlNamespacePrefix?`xmlns:${r.xmlNamespacePrefix}`:"xmlns";const c={[l]:r.xmlNamespace};if(["Composite"].includes(r.type.name)){if(i[D]){return i}else{const r=Object.assign({},i);r[D]=c;return r}}const d={};d[a.xmlCharKey]=i;d[D]=c;return d}function isSpecialXmlProperty(r,i){return[D,i.xmlCharKey].includes(r)}function deserializeCompositeType(r,i,s,a,l){var c,d;const p=(c=l.xmlCharKey)!==null&&c!==void 0?c:P;if(getPolymorphicDiscriminatorRecursively(r,i)){i=getPolymorphicMapper(r,i,s,"serializedName")}const u=resolveModelProperties(r,i,a);let A={};const h=[];for(const c of Object.keys(u)){const g=u[c];const y=splitSerializeName(u[c].serializedName);h.push(y[0]);const{serializedName:b,xmlName:w,xmlElementName:C}=g;let v=a;if(b!==""&&b!==undefined){v=a+"."+b}const I=g.headerCollectionPrefix;if(I){const i={};for(const a of Object.keys(s)){if(a.startsWith(I)){i[a.substring(I.length)]=r.deserialize(g.type.value,s[a],v,l)}h.push(a)}A[c]=i}else if(r.isXML){if(g.xmlIsAttribute&&s[D]){A[c]=r.deserialize(g,s[D][w],v,l)}else if(g.xmlIsMsText){if(s[p]!==undefined){A[c]=s[p]}else if(typeof s==="string"){A[c]=s}}else{const i=C||w||b;if(g.xmlIsWrapped){const i=s[w];const a=(d=i===null||i===void 0?void 0:i[C])!==null&&d!==void 0?d:[];A[c]=r.deserialize(g,a,v,l);h.push(w)}else{const a=s[i];A[c]=r.deserialize(g,a,v,l);h.push(i)}}}else{let a;let d=s;for(const r of y){if(!d)break;d=d[r]}a=d;const p=i.type.polymorphicDiscriminator;if(p&&c===p.clientName&&a==undefined){a=i.serializedName}let h;if(Array.isArray(s[c])&&u[c].serializedName===""){a=s[c];const i=r.deserialize(g,a,v,l);for(const[r,s]of Object.entries(A)){if(!Object.prototype.hasOwnProperty.call(i,r)){i[r]=s}}A=i}else if(a!==undefined||g.defaultValue!==undefined){h=r.deserialize(g,a,v,l);A[c]=h}}}const g=i.type.additionalProperties;if(g){const isAdditionalProperty=r=>{for(const i in u){const s=splitSerializeName(u[i].serializedName);if(s[0]===r){return false}}return true};for(const i in s){if(isAdditionalProperty(i)){A[i]=r.deserialize(g,s[i],a+'["'+i+'"]',l)}}}else if(s){for(const r of Object.keys(s)){if(A[r]===undefined&&!h.includes(r)&&!isSpecialXmlProperty(r,l)){A[r]=s[r]}}}return A}function deserializeDictionaryType(r,i,s,a,l){const c=i.type.value;if(!c||typeof c!=="object"){throw new Error(`"value" metadata for a Dictionary must be defined in the `+`mapper and it must of type "object" in ${a}`)}if(s){const i={};for(const d of Object.keys(s)){i[d]=r.deserialize(c,s[d],a,l)}return i}return s}function deserializeSequenceType(r,i,s,a,l){const c=i.type.element;if(!c||typeof c!=="object"){throw new Error(`element" metadata for an Array must be defined in the `+`mapper and it must of type "object" in ${a}`)}if(s){if(!Array.isArray(s)){s=[s]}const i=[];for(let d=0;d0}keys(){return Object.keys(this._rawQuery)}set(r,i){const s=i;if(r){if(s!==undefined&&s!==null){const i=Array.isArray(s)?s:s.toString();this._rawQuery[r]=i}else{delete this._rawQuery[r]}}}get(r){return r?this._rawQuery[r]:undefined}toString(){let r="";for(const i in this._rawQuery){if(r){r+="&"}const s=this._rawQuery[i];if(Array.isArray(s)){const a=[];for(const r of s){a.push(`${i}=${r}`)}r+=a.join("&")}else{r+=`${i}=${s}`}}return r}static parse(r){const i=new URLQuery;if(r){if(r.startsWith("?")){r=r.substring(1)}let s="ParameterName";let a="";let l="";for(let c=0;cisAlphaNumericCharacter(r)))}function readUntilCharacter(r,...i){return readWhile(r,(r=>i.indexOf(r)===-1))}function nextScheme(r){const i=readWhileLetterOrDigit(r);r._currentToken=URLToken.scheme(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else{r._currentState="HOST"}}function nextSchemeOrHost(r){const i=readUntilCharacter(r,":","/","?");if(!hasCurrentCharacter(r)){r._currentToken=URLToken.host(i);r._currentState="DONE"}else if(getCurrentCharacter(r)===":"){if(peekCharacters(r,3)==="://"){r._currentToken=URLToken.scheme(i);r._currentState="HOST"}else{r._currentToken=URLToken.host(i);r._currentState="PORT"}}else{r._currentToken=URLToken.host(i);if(getCurrentCharacter(r)==="/"){r._currentState="PATH"}else{r._currentState="QUERY"}}}function nextHost(r){if(peekCharacters(r,3)==="://"){nextCharacter(r,3)}const i=readUntilCharacter(r,":","/","?");r._currentToken=URLToken.host(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else if(getCurrentCharacter(r)===":"){r._currentState="PORT"}else if(getCurrentCharacter(r)==="/"){r._currentState="PATH"}else{r._currentState="QUERY"}}function nextPort(r){if(getCurrentCharacter(r)===":"){nextCharacter(r)}const i=readUntilCharacter(r,"/","?");r._currentToken=URLToken.port(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else if(getCurrentCharacter(r)==="/"){r._currentState="PATH"}else{r._currentState="QUERY"}}function nextPath(r){const i=readUntilCharacter(r,"?");r._currentToken=URLToken.path(i);if(!hasCurrentCharacter(r)){r._currentState="DONE"}else{r._currentState="QUERY"}}function nextQuery(r){if(getCurrentCharacter(r)==="?"){nextCharacter(r)}const i=readRemaining(r);r._currentToken=URLToken.query(i);r._currentState="DONE"}function createProxyAgent(r,i,s){const a=URLBuilder.parse(i.host).getHost();if(!a){throw new Error("Expecting a non-empty host in proxy settings.")}if(!isValidPort(i.port)){throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings.")}const l={proxy:{host:a,port:i.port,headers:s&&s.rawHeaders()||{}}};if(i.username&&i.password){l.proxy.proxyAuth=`${i.username}:${i.password}`}else if(i.username){l.proxy.proxyAuth=`${i.username}`}const c=isUrlHttps(r);const d=isUrlHttps(i.host);const p={isHttps:c,agent:createTunnel(c,d,l)};return p}function isUrlHttps(r){const i=URLBuilder.parse(r).getScheme()||"";return i.toLowerCase()==="https"}function createTunnel(r,i,s){if(r&&i){return _.httpsOverHttps(s)}else if(r&&!i){return _.httpsOverHttp(s)}else if(!r&&i){return _.httpOverHttps(s)}else{return _.httpOverHttp(s)}}function isValidPort(r){return 0<=r&&r<=65535}const U="REDACTED";const j=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"];const H=["api-version"];class Sanitizer{constructor({allowedHeaderNames:r=[],allowedQueryParameters:i=[]}={}){r=Array.isArray(r)?j.concat(r):j;i=Array.isArray(i)?H.concat(i):H;this.allowedHeaderNames=new Set(r.map((r=>r.toLowerCase())));this.allowedQueryParameters=new Set(i.map((r=>r.toLowerCase())))}sanitize(r){const i=new Set;return JSON.stringify(r,((r,s)=>{if(s instanceof Error){return Object.assign(Object.assign({},s),{name:s.name,message:s.message})}if(r==="_headersMap"){return this.sanitizeHeaders(s)}else if(r==="url"){return this.sanitizeUrl(s)}else if(r==="query"){return this.sanitizeQuery(s)}else if(r==="body"){return undefined}else if(r==="response"){return undefined}else if(r==="operationSpec"){return undefined}else if(Array.isArray(s)||isObject(s)){if(i.has(s)){return"[Circular]"}i.add(s)}return s}),2)}sanitizeHeaders(r){return this.sanitizeObject(r,this.allowedHeaderNames,((r,i)=>r[i].value))}sanitizeQuery(r){return this.sanitizeObject(r,this.allowedQueryParameters,((r,i)=>r[i]))}sanitizeObject(r,i,s){if(typeof r!=="object"||r===null){return r}const a={};for(const l of Object.keys(r)){if(i.has(l.toLowerCase())){a[l]=s(r,l)}else{a[l]=U}}return a}sanitizeUrl(r){if(typeof r!=="string"||r===null){return r}const i=URLBuilder.parse(r);const s=i.getQuery();if(!s){return r}const a=URLQuery.parse(s);for(const r of a.keys()){if(!this.allowedQueryParameters.has(r.toLowerCase())){a.set(r,U)}}i.setQuery(a.toString());return i.toString()}}const q=l.inspect.custom;const G=new Sanitizer;class RestError extends Error{constructor(r,i,s,a,l){super(r);this.name="RestError";this.code=i;this.statusCode=s;this.request=a;this.response=l;Object.setPrototypeOf(this,RestError.prototype)}[q](){return`RestError: ${this.message} \n ${G.sanitize(this)}`}}RestError.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";RestError.PARSE_ERROR="PARSE_ERROR";const z=u.createClientLogger("core-http");function getCachedAgent(r,i){return r?i.httpsAgent:i.httpAgent}class ReportTransform extends C.Transform{constructor(r){super();this.progressCallback=r;this.loadedBytes=0}_transform(r,i,s){this.push(r);this.loadedBytes+=r.length;this.progressCallback({loadedBytes:this.loadedBytes});s(undefined)}}function isReadableStream(r){return r&&typeof r.pipe==="function"}function isStreamComplete(r,i){return new Promise((s=>{r.once("close",(()=>{i===null||i===void 0?void 0:i.abort();s()}));r.once("end",s);r.once("error",s)}))}function parseHeaders(r){const i=new HttpHeaders;r.forEach(((r,s)=>{i.set(s,r)}));return i}class NodeFetchHttpClient{constructor(){this.proxyAgentMap=new Map;this.keepAliveAgents={}}async sendRequest(r){var i;if(!r&&typeof r!=="object"){throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object.")}const s=new b.AbortController;let a;if(r.abortSignal){if(r.abortSignal.aborted){throw new b.AbortError("The operation was aborted.")}a=r=>{if(r.type==="abort"){s.abort()}};r.abortSignal.addEventListener("abort",a)}if(r.timeout){setTimeout((()=>{s.abort()}),r.timeout)}if(r.formData){const i=r.formData;const s=new N["default"];const appendFormValue=(r,i)=>{if(typeof i==="function"){i=i()}if(i&&Object.prototype.hasOwnProperty.call(i,"value")&&Object.prototype.hasOwnProperty.call(i,"options")){s.append(r,i.value,i.options)}else{s.append(r,i)}};for(const r of Object.keys(i)){const s=i[r];if(Array.isArray(s)){for(let i=0;i{var i;(i=r.abortSignal)===null||i===void 0?void 0:i.removeEventListener("abort",a);return})).catch((r=>{z.warning("Error when cleaning up abortListener on httpRequest",r)}))}}}getOrCreateAgent(r){var i;const s=isUrlHttps(r.url);if(r.proxySettings){const{host:a,port:l,username:c,password:d}=r.proxySettings;const p=`${a}:${l}:${c}:${d}`;const u=(i=this.proxyAgentMap.get(p))!==null&&i!==void 0?i:{};let A=getCachedAgent(s,u);if(A){return A}const h=createProxyAgent(r.url,r.proxySettings,r.headers);A=h.agent;if(h.isHttps){u.httpsAgent=h.agent}else{u.httpAgent=h.agent}this.proxyAgentMap.set(p,u);return A}else if(r.keepAlive){let i=getCachedAgent(s,this.keepAliveAgents);if(i){return i}const a={keepAlive:r.keepAlive};if(s){i=this.keepAliveAgents.httpsAgent=new Q.Agent(a)}else{i=this.keepAliveAgents.httpAgent=new R.Agent(a)}return i}else{return s?Q.globalAgent:R.globalAgent}}async fetch(r,i){return T["default"](r,i)}async prepareRequest(r){const i={};i.agent=this.getOrCreateAgent(r);i.compress=r.decompressResponse;return i}async processRequest(r){}}i.HttpPipelineLogLevel=void 0;(function(r){r[r["OFF"]=0]="OFF";r[r["ERROR"]=1]="ERROR";r[r["WARNING"]=2]="WARNING";r[r["INFO"]=3]="INFO"})(i.HttpPipelineLogLevel||(i.HttpPipelineLogLevel={}));function operationOptionsToRequestOptionsBase(r){const{requestOptions:i,tracingOptions:s}=r,a=c.__rest(r,["requestOptions","tracingOptions"]);let l=a;if(i){l=Object.assign(Object.assign({},l),i)}if(s){l.tracingContext=s.tracingContext;l.spanOptions=s===null||s===void 0?void 0:s.spanOptions}return l}class BaseRequestPolicy{constructor(r,i){this._nextPolicy=r;this._options=i}shouldLog(r){return this._options.shouldLog(r)}log(r,i){this._options.log(r,i)}}class RequestPolicyOptions{constructor(r){this._logger=r}shouldLog(r){return!!this._logger&&r!==i.HttpPipelineLogLevel.OFF&&r<=this._logger.minimumLogLevel}log(r,i){if(this._logger&&this.shouldLog(r)){this._logger.log(r,i)}}}const V={explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:D,explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:undefined,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:undefined,attrValueProcessors:undefined,tagNameProcessors:undefined,valueProcessors:undefined,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:undefined,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false};const W=Object.assign({},V);W.explicitArray=false;const Y=Object.assign({},V);Y.explicitArray=false;Y.renderOpts={pretty:false};function stringifyXML(r,i={}){var s;Y.rootName=i.rootName;Y.charkey=(s=i.xmlCharKey)!==null&&s!==void 0?s:P;const a=new S.Builder(Y);return a.buildObject(r)}function parseXML(r,i={}){var s;W.explicitRoot=!!i.includeRoot;W.charkey=(s=i.xmlCharKey)!==null&&s!==void 0?s:P;const a=new S.Parser(W);return new Promise(((i,s)=>{if(!r){s(new Error("Document is empty"))}else{a.parseString(r,((r,a)=>{if(r){s(r)}else{i(a)}}))}}))}function deserializationPolicy(r,i){return{create:(s,a)=>new DeserializationPolicy(s,a,r,i)}}const J=["application/json","text/json"];const $=["application/xml","application/atom+xml"];const X={expectedContentTypes:{json:J,xml:$}};class DeserializationPolicy extends BaseRequestPolicy{constructor(r,i,s,a={}){var l;super(r,i);this.jsonContentTypes=s&&s.json||J;this.xmlContentTypes=s&&s.xml||$;this.xmlCharKey=(l=a.xmlCharKey)!==null&&l!==void 0?l:P}async sendRequest(r){return this._nextPolicy.sendRequest(r).then((r=>deserializeResponseBody(this.jsonContentTypes,this.xmlContentTypes,r,{xmlCharKey:this.xmlCharKey})))}}function getOperationResponse(r){let i;const s=r.request;const a=s.operationSpec;if(a){const l=s.operationResponseGetter;if(!l){i=a.responses[r.status]}else{i=l(a,r)}}return i}function shouldDeserializeResponse(r){const i=r.request.shouldDeserialize;let s;if(i===undefined){s=true}else if(typeof i==="boolean"){s=i}else{s=i(r)}return s}function deserializeResponseBody(r,i,s,a={}){var l,c,d;const p={rootName:(l=a.rootName)!==null&&l!==void 0?l:"",includeRoot:(c=a.includeRoot)!==null&&c!==void 0?c:false,xmlCharKey:(d=a.xmlCharKey)!==null&&d!==void 0?d:P};return parse(r,i,s,p).then((r=>{if(!shouldDeserializeResponse(r)){return r}const i=r.request.operationSpec;if(!i||!i.responses){return r}const l=getOperationResponse(r);const{error:c,shouldReturnResponse:d}=handleErrorResponse(r,i,l);if(c){throw c}else if(d){return r}if(l){if(l.bodyMapper){let s=r.parsedBody;if(i.isXML&&l.bodyMapper.type.name===M.Sequence){s=typeof s==="object"?s[l.bodyMapper.xmlElementName]:[]}try{r.parsedBody=i.serializer.deserialize(l.bodyMapper,s,"operationRes.parsedBody",a)}catch(i){const s=new RestError(`Error ${i} occurred in deserializing the responseBody - ${r.bodyAsText}`,undefined,r.status,r.request,r);throw s}}else if(i.httpMethod==="HEAD"){r.parsedBody=s.status>=200&&s.status<300}if(l.headersMapper){r.parsedHeaders=i.serializer.deserialize(l.headersMapper,r.headers.toJson(),"operationRes.parsedHeaders",a)}}return r}))}function isOperationSpecEmpty(r){const i=Object.keys(r.responses);return i.length===0||i.length===1&&i[0]==="default"}function handleErrorResponse(r,i,s){var a;const l=200<=r.status&&r.status<300;const c=isOperationSpecEmpty(i)?l:!!s;if(c){if(s){if(!s.isError){return{error:null,shouldReturnResponse:false}}}else{return{error:null,shouldReturnResponse:false}}}const d=s!==null&&s!==void 0?s:i.responses.default;const p=((a=r.request.streamResponseStatusCodes)===null||a===void 0?void 0:a.has(r.status))||r.request.streamResponseBody;const u=p?`Unexpected status code: ${r.status}`:r.bodyAsText;const A=new RestError(u,undefined,r.status,r.request,r);if(!d){throw A}const h=d.bodyMapper;const g=d.headersMapper;try{if(r.parsedBody){const s=r.parsedBody;let a;if(h){let r=s;if(i.isXML&&h.type.name===M.Sequence){r=typeof s==="object"?s[h.xmlElementName]:[]}a=i.serializer.deserialize(h,r,"error.response.parsedBody")}const l=s.error||a||s;A.code=l.code;if(l.message){A.message=l.message}if(h){A.response.parsedBody=a}}if(r.headers&&g){A.response.parsedHeaders=i.serializer.deserialize(g,r.headers.toJson(),"operationRes.parsedHeaders")}}catch(i){A.message=`Error "${i.message}" occurred in deserializing the responseBody - "${r.bodyAsText}" for the default response.`}return{error:A,shouldReturnResponse:false}}function parse(r,i,s,a){var l;const errorHandler=r=>{const i=`Error "${r}" occurred while parsing the response body - ${s.bodyAsText}.`;const a=r.code||RestError.PARSE_ERROR;const l=new RestError(i,a,s.status,s.request,s);return Promise.reject(l)};const c=((l=s.request.streamResponseStatusCodes)===null||l===void 0?void 0:l.has(s.status))||s.request.streamResponseBody;if(!c&&s.bodyAsText){const l=s.bodyAsText;const c=s.headers.get("Content-Type")||"";const d=!c?[]:c.split(";").map((r=>r.toLowerCase()));if(d.length===0||d.some((i=>r.indexOf(i)!==-1))){return new Promise((r=>{s.parsedBody=JSON.parse(l);r(s)})).catch(errorHandler)}else if(d.some((r=>i.indexOf(r)!==-1))){return parseXML(l,a).then((r=>{s.parsedBody=r;return s})).catch(errorHandler)}}return Promise.resolve(s)}const K={enable:true};function keepAlivePolicy(r){return{create:(i,s)=>new KeepAlivePolicy(i,s,r||K)}}class KeepAlivePolicy extends BaseRequestPolicy{constructor(r,i,s){super(r,i);this.keepAliveOptions=s}async sendRequest(r){r.keepAlive=this.keepAliveOptions.enable;return this._nextPolicy.sendRequest(r)}}const Z=["GET","HEAD"];const ee={handleRedirects:true,maxRetries:20};function redirectPolicy(r=20){return{create:(i,s)=>new RedirectPolicy(i,s,r)}}class RedirectPolicy extends BaseRequestPolicy{constructor(r,i,s=20){super(r,i);this.maxRetries=s}sendRequest(r){return this._nextPolicy.sendRequest(r).then((r=>handleRedirect(this,r,0)))}}function handleRedirect(r,i,s){const{request:a,status:l}=i;const c=i.headers.get("location");if(c&&(l===300||l===301&&Z.includes(a.method)||l===302&&Z.includes(a.method)||l===303&&a.method==="POST"||l===307)&&(!r.maxRetries||shandleRedirect(r,i,s+1)))}return Promise.resolve(i)}const te=3;const re=1e3*30;const ne=1e3*90;const ie=1e3*3;function isNumber(r){return typeof r==="number"}function shouldRetry(r,i,s,a,l){if(!i(a,l)){return false}return s.retryCountnew ExponentialRetryPolicy(a,l,r,i,s)}}i.RetryMode=void 0;(function(r){r[r["Exponential"]=0]="Exponential"})(i.RetryMode||(i.RetryMode={}));const se={maxRetries:te,retryDelayInMs:re,maxRetryDelayInMs:ne};class ExponentialRetryPolicy extends BaseRequestPolicy{constructor(r,i,s,a,l){super(r,i);this.retryCount=isNumber(s)?s:te;this.retryInterval=isNumber(a)?a:re;this.maxRetryInterval=isNumber(l)?l:ne}sendRequest(r){return this._nextPolicy.sendRequest(r.clone()).then((i=>retry$1(this,r,i))).catch((i=>retry$1(this,r,i.response,undefined,i)))}}async function retry$1(r,i,s,a,l){function shouldPolicyRetry(r){const i=r===null||r===void 0?void 0:r.status;if(i===503&&(s===null||s===void 0?void 0:s.headers.get(k.HeaderConstants.RETRY_AFTER))){return false}if(i===undefined||i<500&&i!==408||i===501||i===505){return false}return true}a=updateRetryData({retryInterval:r.retryInterval,minRetryInterval:0,maxRetryInterval:r.maxRetryInterval},a,l);const c=i.abortSignal&&i.abortSignal.aborted;if(!c&&shouldRetry(r.retryCount,shouldPolicyRetry,a,s)){z.info(`Retrying request in ${a.retryInterval}`);try{await p.delay(a.retryInterval);const s=await r._nextPolicy.sendRequest(i.clone());return retry$1(r,i,s,a)}catch(l){return retry$1(r,i,s,a,l)}}else if(c||l||!s){const r=a.error||new RestError("Failed to send the request.",RestError.REQUEST_SEND_ERROR,s&&s.status,s&&s.request,s);throw r}else{return s}}function logPolicy(r={}){return{create:(i,s)=>new LogPolicy(i,s,r)}}class LogPolicy extends BaseRequestPolicy{constructor(r,i,{logger:s=z.info,allowedHeaderNames:a=[],allowedQueryParameters:l=[]}={}){super(r,i);this.logger=s;this.sanitizer=new Sanitizer({allowedHeaderNames:a,allowedQueryParameters:l})}get allowedHeaderNames(){return this.sanitizer.allowedHeaderNames}set allowedHeaderNames(r){this.sanitizer.allowedHeaderNames=r}get allowedQueryParameters(){return this.sanitizer.allowedQueryParameters}set allowedQueryParameters(r){this.sanitizer.allowedQueryParameters=r}sendRequest(r){if(!this.logger.enabled)return this._nextPolicy.sendRequest(r);this.logRequest(r);return this._nextPolicy.sendRequest(r).then((r=>this.logResponse(r)))}logRequest(r){this.logger(`Request: ${this.sanitizer.sanitize(r)}`)}logResponse(r){this.logger(`Response status code: ${r.status}`);this.logger(`Headers: ${this.sanitizer.sanitize(r.headers)}`);return r}}function getPathStringFromParameter(r){return getPathStringFromParameterPath(r.parameterPath,r.mapper)}function getPathStringFromParameterPath(r,i){let s;if(typeof r==="string"){s=r}else if(Array.isArray(r)){s=r.join(".")}else{s=i.serializedName}return s}function getStreamResponseStatusCodes(r){const i=new Set;for(const s in r.responses){const a=r.responses[s];if(a.bodyMapper&&a.bodyMapper.type.name===M.Stream){i.add(Number(s))}}return i}function getDefaultUserAgentKey(){return k.HeaderConstants.USER_AGENT}function getPlatformSpecificData(){const r={key:"Node",value:process.version};const i={key:"OS",value:`(${x.arch()}-${x.type()}-${x.release()})`};return[r,i]}function getRuntimeInfo(){const r={key:"core-http",value:k.coreHttpVersion};return[r]}function getUserAgentString(r,i=" ",s="/"){return r.map((r=>{const i=r.value?`${s}${r.value}`:"";return`${r.key}${i}`})).join(i)}const ae=getDefaultUserAgentKey;function getDefaultUserAgentValue(){const r=getRuntimeInfo();const i=getPlatformSpecificData();const s=getUserAgentString(r.concat(i));return s}function userAgentPolicy(r){const i=!r||r.key===undefined||r.key===null?getDefaultUserAgentKey():r.key;const s=!r||r.value===undefined||r.value===null?getDefaultUserAgentValue():r.value;return{create:(r,a)=>new UserAgentPolicy(r,a,i,s)}}class UserAgentPolicy extends BaseRequestPolicy{constructor(r,i,s,a){super(r,i);this._nextPolicy=r;this._options=i;this.headerKey=s;this.headerValue=a}sendRequest(r){this.addUserAgentHeader(r);return this._nextPolicy.sendRequest(r)}addUserAgentHeader(r){if(!r.headers){r.headers=new HttpHeaders}if(!r.headers.get(this.headerKey)&&this.headerValue){r.headers.set(this.headerKey,this.headerValue)}}}i.QueryCollectionFormat=void 0;(function(r){r["Csv"]=",";r["Ssv"]=" ";r["Tsv"]="\t";r["Pipes"]="|";r["Multi"]="Multi"})(i.QueryCollectionFormat||(i.QueryCollectionFormat={}));const oe={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function beginRefresh(r,i,s){async function tryGetAccessToken(){if(Date.now()r.getToken(i,s);a=beginRefresh(tryGetAccessToken,c.retryIntervalInMs,(p=l===null||l===void 0?void 0:l.expiresOnTimestamp)!==null&&p!==void 0?p:Date.now()).then((r=>{a=null;l=r;return l})).catch((r=>{a=null;l=null;throw r}))}return a}return async r=>{if(d.mustRefresh)return refresh(r);if(d.shouldRefresh){refresh(r)}return l}}function bearerTokenAuthenticationPolicy(r,i){const s=createTokenCycler(r,i);class BearerTokenAuthenticationPolicy extends BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){if(!r.url.toLowerCase().startsWith("https://")){throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.")}const{token:i}=await s({abortSignal:r.abortSignal,tracingOptions:{tracingContext:r.tracingContext}});r.headers.set(k.HeaderConstants.AUTHORIZATION,`Bearer ${i}`);return this._nextPolicy.sendRequest(r)}}return{create:(r,i)=>new BearerTokenAuthenticationPolicy(r,i)}}function disableResponseDecompressionPolicy(){return{create:(r,i)=>new DisableResponseDecompressionPolicy(r,i)}}class DisableResponseDecompressionPolicy extends BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){r.decompressResponse=false;return this._nextPolicy.sendRequest(r)}}function generateClientRequestIdPolicy(r="x-ms-client-request-id"){return{create:(i,s)=>new GenerateClientRequestIdPolicy(i,s,r)}}class GenerateClientRequestIdPolicy extends BaseRequestPolicy{constructor(r,i,s){super(r,i);this._requestIdHeaderName=s}sendRequest(r){if(!r.headers.contains(this._requestIdHeaderName)){r.headers.set(this._requestIdHeaderName,r.requestId)}return this._nextPolicy.sendRequest(r)}}let le;function getCachedDefaultHttpClient(){if(!le){le=new NodeFetchHttpClient}return le}function ndJsonPolicy(){return{create:(r,i)=>new NdJsonPolicy(r,i)}}class NdJsonPolicy extends BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){if(typeof r.body==="string"&&r.body.startsWith("[")){const i=JSON.parse(r.body);if(Array.isArray(i)){r.body=i.map((r=>JSON.stringify(r)+"\n")).join("")}}return this._nextPolicy.sendRequest(r)}}const ce=[];let de=false;const pe=new Map;function loadEnvironmentProxyValue(){if(!process){return undefined}const r=getEnvironmentValue(k.HTTPS_PROXY);const i=getEnvironmentValue(k.ALL_PROXY);const s=getEnvironmentValue(k.HTTP_PROXY);return r||i||s}function isBypassed(r,i,s){if(i.length===0){return false}const a=URLBuilder.parse(r).getHost();if(s===null||s===void 0?void 0:s.has(a)){return s.get(a)}let l=false;for(const r of i){if(r[0]==="."){if(a.endsWith(r)){l=true}else{if(a.length===r.length-1&&a===r.slice(1)){l=true}}}else{if(a===r){l=true}}}s===null||s===void 0?void 0:s.set(a,l);return l}function loadNoProxy(){const r=getEnvironmentValue(k.NO_PROXY);de=true;if(r){return r.split(",").map((r=>r.trim())).filter((r=>r.length))}return[]}function getDefaultProxySettings(r){if(!r){r=loadEnvironmentProxyValue();if(!r){return undefined}}const{username:i,password:s,urlWithoutAuth:a}=extractAuthFromUrl(r);const l=URLBuilder.parse(a);const c=l.getScheme()?l.getScheme()+"://":"";return{host:c+l.getHost(),port:Number.parseInt(l.getPort()||"80"),username:i,password:s}}function proxyPolicy(r,i){if(!r){r=getDefaultProxySettings()}if(!de){ce.push(...loadNoProxy())}return{create:(s,a)=>new ProxyPolicy(s,a,r,i===null||i===void 0?void 0:i.customNoProxyList)}}function extractAuthFromUrl(r){const i=r.indexOf("@");if(i===-1){return{urlWithoutAuth:r}}const s=r.indexOf("://");const a=s!==-1?s+3:0;const l=r.substring(a,i);const c=l.indexOf(":");const d=c!==-1;const p=d?l.substring(0,c):l;const u=d?l.substring(c+1):undefined;const A=r.substring(0,a)+r.substring(i+1);return{username:p,password:u,urlWithoutAuth:A}}class ProxyPolicy extends BaseRequestPolicy{constructor(r,i,s,a){super(r,i);this.proxySettings=s;this.customNoProxyList=a}sendRequest(r){var i;if(!r.proxySettings&&!isBypassed(r.url,(i=this.customNoProxyList)!==null&&i!==void 0?i:ce,this.customNoProxyList?undefined:pe)){r.proxySettings=this.proxySettings}return this._nextPolicy.sendRequest(r)}}function rpRegistrationPolicy(r=30){return{create:(i,s)=>new RPRegistrationPolicy(i,s,r)}}class RPRegistrationPolicy extends BaseRequestPolicy{constructor(r,i,s=30){super(r,i);this._retryTimeout=s}sendRequest(r){return this._nextPolicy.sendRequest(r.clone()).then((i=>registerIfNeeded(this,r,i)))}}function registerIfNeeded(r,i,s){if(s.status===409){const a=checkRPNotRegisteredError(s.bodyAsText);if(a){const l=extractSubscriptionUrl(i.url);return registerRP(r,l,a,i).catch((()=>false)).then((a=>{if(a){i.headers.set("x-ms-client-request-id",generateUuid());return r._nextPolicy.sendRequest(i.clone())}return s}))}}return Promise.resolve(s)}function getRequestEssentials(r,i=false){const s=r.clone();if(i){s.url=r.url}s.headers.set("x-ms-client-request-id",generateUuid());s.headers.set("Content-Type","application/json; charset=utf-8");return s}function checkRPNotRegisteredError(r){let i,s;if(r){try{s=JSON.parse(r)}catch(r){}if(s&&s.error&&s.error.message&&s.error.code&&s.error.code==="MissingSubscriptionRegistration"){const r=s.error.message.match(/.*'(.*)'/i);if(r){i=r.pop()}}}return i}function extractSubscriptionUrl(r){let i;const s=r.match(/.*\/subscriptions\/[a-f0-9-]+\//gi);if(s&&s[0]){i=s[0]}else{throw new Error(`Unable to extract subscriptionId from the given url - ${r}.`)}return i}async function registerRP(r,i,s,a){const l=`${i}providers/${s}/register?api-version=2016-02-01`;const c=`${i}providers/${s}?api-version=2016-02-01`;const d=getRequestEssentials(a);d.method="POST";d.url=l;const p=await r._nextPolicy.sendRequest(d);if(p.status!==200){throw new Error(`Autoregistration of ${s} failed. Please try registering manually.`)}return getRegistrationStatus(r,c,a)}async function getRegistrationStatus(r,i,s){const a=getRequestEssentials(s);a.url=i;a.method="GET";const l=await r._nextPolicy.sendRequest(a);const c=l.parsedBody;if(l.parsedBody&&c.registrationState&&c.registrationState==="Registered"){return true}else{await p.delay(r._retryTimeout*1e3);return getRegistrationStatus(r,i,s)}}function signingPolicy(r){return{create:(i,s)=>new SigningPolicy(i,s,r)}}class SigningPolicy extends BaseRequestPolicy{constructor(r,i,s){super(r,i);this.authenticationProvider=s}signRequest(r){return this.authenticationProvider.signRequest(r)}sendRequest(r){return this.signRequest(r).then((r=>this._nextPolicy.sendRequest(r)))}}function systemErrorRetryPolicy(r,i,s,a){return{create:(l,c)=>new SystemErrorRetryPolicy(l,c,r,i,s,a)}}class SystemErrorRetryPolicy extends BaseRequestPolicy{constructor(r,i,s,a,l,c){super(r,i);this.retryCount=isNumber(s)?s:te;this.retryInterval=isNumber(a)?a:re;this.minRetryInterval=isNumber(l)?l:ie;this.maxRetryInterval=isNumber(c)?c:ne}sendRequest(r){return this._nextPolicy.sendRequest(r.clone()).catch((i=>retry(this,r,i.response,i)))}}async function retry(r,i,s,a,l){l=updateRetryData(r,l,a);function shouldPolicyRetry(r,i){if(i&&i.code&&(i.code==="ETIMEDOUT"||i.code==="ESOCKETTIMEDOUT"||i.code==="ECONNREFUSED"||i.code==="ECONNRESET"||i.code==="ENOENT")){return true}return false}if(shouldRetry(r.retryCount,shouldPolicyRetry,l,s,a)){try{await p.delay(l.retryInterval);return r._nextPolicy.sendRequest(i.clone())}catch(a){return retry(r,i,s,a,l)}}else{if(a){return Promise.reject(l.error)}return s}}const ue=3;const Ae=k.HttpConstants.StatusCodes;function throttlingRetryPolicy(){return{create:(r,i)=>new ThrottlingRetryPolicy(r,i)}}const fe="The operation was aborted.";class ThrottlingRetryPolicy extends BaseRequestPolicy{constructor(r,i,s){super(r,i);this.numberOfRetries=0;this._handleResponse=s||this._defaultResponseHandler}async sendRequest(r){const i=await this._nextPolicy.sendRequest(r.clone());if(i.status!==Ae.TooManyRequests&&i.status!==Ae.ServiceUnavailable){return i}else{return this._handleResponse(r,i)}}async _defaultResponseHandler(r,i){var s;const a=i.headers.get(k.HeaderConstants.RETRY_AFTER);if(a){const i=ThrottlingRetryPolicy.parseRetryAfterHeader(a);if(i){this.numberOfRetries+=1;await p.delay(i,{abortSignal:r.abortSignal,abortErrorMsg:fe});if((s=r.abortSignal)===null||s===void 0?void 0:s.aborted){throw new b.AbortError(fe)}if(this.numberOfRetries{let s=undefined;const a=this;const l=i;return{create(i,c){const d=getCredentialScopes(l,a.baseUri);if(!d){throw new Error(`When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy`)}if(s===undefined||s===null){s=bearerTokenAuthenticationPolicy(r,d)}return s.create(i,c)}}};a=wrappedPolicyFactory()}else if(r&&typeof r.signRequest==="function"){z.info("ServiceClient: creating signing policy from provided credentials");a=signingPolicy(r)}else if(r!==undefined&&r!==null){throw new Error("The credentials argument must implement the TokenCredential interface")}z.info("ServiceClient: using default request policies");s=createDefaultRequestPolicyFactories(a,i);if(i.requestPolicyFactories){const r=i.requestPolicyFactories(s);if(r){s=r}}}this._requestPolicyFactories=s}sendRequest(r){if(r===null||r===undefined||typeof r!=="object"){throw new Error("options cannot be null or undefined and it must be of type object.")}let i;try{if(isWebResourceLike(r)){r.validateRequestProperties();i=r}else{i=new WebResource;i=i.prepare(r)}}catch(r){return Promise.reject(r)}let s=this._httpClient;if(this._requestPolicyFactories&&this._requestPolicyFactories.length>0){for(let r=this._requestPolicyFactories.length-1;r>=0;--r){s=this._requestPolicyFactories[r].create(s,this._requestPolicyOptions)}}return s.sendRequest(i)}async sendOperationRequest(r,s,a){var l;if(typeof r.options==="function"){a=r.options;r.options=undefined}const c=(l=r.options)===null||l===void 0?void 0:l.serializerOptions;const d=new WebResource;let p;try{const a=s.baseUrl||this.baseUri;if(!a){throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.")}d.method=s.httpMethod;d.operationSpec=s;const l=URLBuilder.parse(a);if(s.path){l.appendPath(s.path)}if(s.urlParameters&&s.urlParameters.length>0){for(const i of s.urlParameters){let a=getOperationArgumentValueFromParameter(this,r,i,s.serializer);a=s.serializer.serialize(i.mapper,a,getPathStringFromParameter(i),c);if(!i.skipEncoding){a=encodeURIComponent(a)}l.replaceAll(`{${i.mapper.serializedName||getPathStringFromParameter(i)}}`,a)}}if(s.queryParameters&&s.queryParameters.length>0){for(const a of s.queryParameters){let d=getOperationArgumentValueFromParameter(this,r,a,s.serializer);if(d!==undefined&&d!==null){d=s.serializer.serialize(a.mapper,d,getPathStringFromParameter(a),c);if(a.collectionFormat!==undefined&&a.collectionFormat!==null){if(a.collectionFormat===i.QueryCollectionFormat.Multi){if(d.length===0){continue}else{for(const r in d){const i=d[r];d[r]=i===undefined||i===null?"":i.toString()}}}else if(a.collectionFormat===i.QueryCollectionFormat.Ssv||a.collectionFormat===i.QueryCollectionFormat.Tsv){d=d.join(a.collectionFormat)}}if(!a.skipEncoding){if(Array.isArray(d)){for(const r in d){if(d[r]!==undefined&&d[r]!==null){d[r]=encodeURIComponent(d[r])}}}else{d=encodeURIComponent(d)}}if(a.collectionFormat!==undefined&&a.collectionFormat!==null&&a.collectionFormat!==i.QueryCollectionFormat.Multi&&a.collectionFormat!==i.QueryCollectionFormat.Ssv&&a.collectionFormat!==i.QueryCollectionFormat.Tsv){d=d.join(a.collectionFormat)}l.setQueryParameter(a.mapper.serializedName||getPathStringFromParameter(a),d)}}}d.url=l.toString();const u=s.contentType||this.requestContentType;if(u&&s.requestBody){d.headers.set("Content-Type",u)}if(s.headerParameters){for(const i of s.headerParameters){let a=getOperationArgumentValueFromParameter(this,r,i,s.serializer);if(a!==undefined&&a!==null){a=s.serializer.serialize(i.mapper,a,getPathStringFromParameter(i),c);const r=i.mapper.headerCollectionPrefix;if(r){for(const i of Object.keys(a)){d.headers.set(r+i,a[i])}}else{d.headers.set(i.mapper.serializedName||getPathStringFromParameter(i),a)}}}}const A=r.options;if(A){if(A.customHeaders){for(const r in A.customHeaders){d.headers.set(r,A.customHeaders[r])}}if(A.abortSignal){d.abortSignal=A.abortSignal}if(A.timeout){d.timeout=A.timeout}if(A.onUploadProgress){d.onUploadProgress=A.onUploadProgress}if(A.onDownloadProgress){d.onDownloadProgress=A.onDownloadProgress}if(A.spanOptions){d.spanOptions=A.spanOptions}if(A.tracingContext){d.tracingContext=A.tracingContext}if(A.shouldDeserialize!==undefined&&A.shouldDeserialize!==null){d.shouldDeserialize=A.shouldDeserialize}}d.withCredentials=this._withCredentials;serializeRequestBody(this,d,r,s);if(d.streamResponseStatusCodes===undefined){d.streamResponseStatusCodes=getStreamResponseStatusCodes(s)}let h;let g;try{h=await this.sendRequest(d)}catch(r){g=r}if(g){if(g.response){g.details=flattenResponse(g.response,s.responses[g.statusCode]||s.responses["default"])}p=Promise.reject(g)}else{p=Promise.resolve(flattenResponse(h,s.responses[h.status]))}}catch(r){p=Promise.reject(r)}const u=a;if(u){p.then((r=>u(null,r._response.parsedBody,r._response.request,r._response))).catch((r=>u(r)))}return p}}function serializeRequestBody(r,i,s,a){var l,c,d,p,u,A;const h=(c=(l=s.options)===null||l===void 0?void 0:l.serializerOptions)!==null&&c!==void 0?c:{};const g={rootName:(d=h.rootName)!==null&&d!==void 0?d:"",includeRoot:(p=h.includeRoot)!==null&&p!==void 0?p:false,xmlCharKey:(u=h.xmlCharKey)!==null&&u!==void 0?u:P};const y=h.xmlCharKey;if(a.requestBody&&a.requestBody.mapper){i.body=getOperationArgumentValueFromParameter(r,s,a.requestBody,a.serializer);const l=a.requestBody.mapper;const{required:c,xmlName:d,xmlElementName:p,serializedName:u,xmlNamespace:h,xmlNamespacePrefix:b}=l;const w=l.type.name;try{if(i.body!==undefined&&i.body!==null||c){const r=getPathStringFromParameter(a.requestBody);i.body=a.serializer.serialize(l,i.body,r,g);const s=w===M.Stream;if(a.isXML){const r=b?`xmlns:${b}`:"xmlns";const a=getXmlValueWithNamespace(h,r,w,i.body,g);if(w===M.Sequence){i.body=stringifyXML(prepareXMLRootList(a,p||d||u,r,h),{rootName:d||u,xmlCharKey:y})}else if(!s){i.body=stringifyXML(a,{rootName:d||u,xmlCharKey:y})}}else if(w===M.String&&(((A=a.contentType)===null||A===void 0?void 0:A.match("text/plain"))||a.mediaType==="text")){return}else if(!s){i.body=JSON.stringify(i.body)}}}catch(r){throw new Error(`Error "${r.message}" occurred in serializing the payload - ${JSON.stringify(u,undefined," ")}.`)}}else if(a.formDataParameters&&a.formDataParameters.length>0){i.formData={};for(const l of a.formDataParameters){const c=getOperationArgumentValueFromParameter(r,s,l,a.serializer);if(c!==undefined&&c!==null){const r=l.mapper.serializedName||getPathStringFromParameter(l);i.formData[r]=a.serializer.serialize(l.mapper,c,getPathStringFromParameter(l),g)}}}}function getXmlValueWithNamespace(r,i,s,a,l){if(r&&!["Composite","Sequence","Dictionary"].includes(s)){const s={};s[l.xmlCharKey]=a;s[D]={[i]:r};return s}return a}function getValueOrFunctionResult(r,i){let s;if(typeof r==="string"){s=r}else{s=i();if(typeof r==="function"){s=r(s)}}return s}function createDefaultRequestPolicyFactories(r,i){const s=[];if(i.generateClientRequestIdHeader){s.push(generateClientRequestIdPolicy(i.clientRequestIdHeaderName))}if(r){s.push(r)}const a=getValueOrFunctionResult(i.userAgentHeaderName,ae);const l=getValueOrFunctionResult(i.userAgent,getDefaultUserAgentValue);if(a&&l){s.push(userAgentPolicy({key:a,value:l}))}s.push(redirectPolicy());s.push(rpRegistrationPolicy(i.rpRegistrationRetryTimeout));if(!i.noRetryPolicy){s.push(exponentialRetryPolicy());s.push(systemErrorRetryPolicy());s.push(throttlingRetryPolicy())}s.push(deserializationPolicy(i.deserializationContentTypes));if(p.isNode){s.push(proxyPolicy(i.proxySettings))}s.push(logPolicy({logger:z.info}));return s}function createPipelineFromOptions(r,i){const s=[];if(r.sendStreamingJson){s.push(ndJsonPolicy())}let a=undefined;if(r.userAgentOptions&&r.userAgentOptions.userAgentPrefix){const i=[];i.push(r.userAgentOptions.userAgentPrefix);const s=getDefaultUserAgentValue();if(i.indexOf(s)===-1){i.push(s)}a=i.join(" ")}const l=Object.assign(Object.assign({},K),r.keepAliveOptions);const c=Object.assign(Object.assign({},se),r.retryOptions);const d=Object.assign(Object.assign({},ee),r.redirectOptions);if(p.isNode){s.push(proxyPolicy(r.proxyOptions))}const u=Object.assign(Object.assign({},X),r.deserializationOptions);const A=Object.assign({},r.loggingOptions);s.push(tracingPolicy({userAgent:a}),keepAlivePolicy(l),userAgentPolicy({value:a}),generateClientRequestIdPolicy(),deserializationPolicy(u.expectedContentTypes),throttlingRetryPolicy(),systemErrorRetryPolicy(),exponentialRetryPolicy(c.maxRetries,c.retryDelayInMs,c.maxRetryDelayInMs));if(d.handleRedirects){s.push(redirectPolicy(d.maxRetries))}if(i){s.push(i)}s.push(logPolicy(A));if(p.isNode&&r.decompressResponse===false){s.push(disableResponseDecompressionPolicy())}return{httpClient:r.httpClient,requestPolicyFactories:s}}function getOperationArgumentValueFromParameter(r,i,s,a){return getOperationArgumentValueFromParameterPath(r,i,s.parameterPath,s.mapper,a)}function getOperationArgumentValueFromParameterPath(r,i,s,a,l){var c;let d;if(typeof s==="string"){s=[s]}const p=(c=i.options)===null||c===void 0?void 0:c.serializerOptions;if(Array.isArray(s)){if(s.length>0){if(a.isConstant){d=a.defaultValue}else{let l=getPropertyFromParameterPath(i,s);if(!l.propertyFound){l=getPropertyFromParameterPath(r,s)}let c=false;if(!l.propertyFound){c=a.required||s[0]==="options"&&s.length===2}d=c?a.defaultValue:l.propertyValue}const c=getPathStringFromParameterPath(s,a);l.serialize(a,d,c,p)}}else{if(a.required){d={}}for(const c in s){const u=a.type.modelProperties[c];const A=s[c];const h=getOperationArgumentValueFromParameterPath(r,i,A,u,l);const g=getPathStringFromParameterPath(A,u);l.serialize(u,h,g,p);if(h!==undefined&&h!==null){if(!d){d={}}d[c]=h}}}return d}function getPropertyFromParameterPath(r,i){const s={propertyFound:false};let a=0;for(;aObject.defineProperty(i,"_response",{value:r});if(a){const i=a.type.name;if(i==="Stream"){return addOperationResponse(Object.assign(Object.assign({},s),{blobBody:r.blobBody,readableStreamBody:r.readableStreamBody}))}const l=i==="Composite"&&a.type.modelProperties||{};const c=Object.keys(l).some((r=>l[r].serializedName===""));if(i==="Sequence"||c){const i=[...r.parsedBody||[]];for(const s of Object.keys(l)){if(l[s].serializedName){i[s]=r.parsedBody[s]}}if(s){for(const r of Object.keys(s)){i[r]=s[r]}}addOperationResponse(i);return i}if(i==="Composite"||i==="Dictionary"){return addOperationResponse(Object.assign(Object.assign({},s),r.parsedBody))}}if(a||r.request.method==="HEAD"||isPrimitiveType(r.parsedBody)){return addOperationResponse(Object.assign(Object.assign({},s),{body:r.parsedBody}))}return addOperationResponse(Object.assign(Object.assign({},s),r.parsedBody))}function getCredentialScopes(r,i){if(r===null||r===void 0?void 0:r.credentialScopes){return r.credentialScopes}if(i){return`${i}/.default`}return undefined}function createSpanFunction(r){return B.createSpanFunction(r)}const he=2*60*1e3;class ExpiringAccessTokenCache{constructor(r=he){this.cachedToken=undefined;this.tokenRefreshBufferMs=r}setCachedToken(r){this.cachedToken=r}getCachedToken(){if(this.cachedToken&&Date.now()+this.tokenRefreshBufferMs>=this.cachedToken.expiresOnTimestamp){this.cachedToken=undefined}return this.cachedToken}}class AccessTokenRefresher{constructor(r,i,s=3e4){this.credential=r;this.scopes=i;this.requiredMillisecondsBeforeNewRefresh=s;this.lastCalled=0}isReady(){return!this.lastCalled||Date.now()-this.lastCalled>this.requiredMillisecondsBeforeNewRefresh}async getToken(r){this.lastCalled=Date.now();const i=await this.credential.getToken(this.scopes,r);this.promise=undefined;return i||undefined}refresh(r){if(!this.promise){this.promise=this.getToken(r)}return this.promise}}const ge=k.HeaderConstants;const ye="Basic";class BasicAuthenticationCredentials{constructor(r,i,s=ye){this.authorizationScheme=ye;if(r===null||r===undefined||typeof r.valueOf()!=="string"){throw new Error("userName cannot be null or undefined and must be of type string.")}if(i===null||i===undefined||typeof i.valueOf()!=="string"){throw new Error("password cannot be null or undefined and must be of type string.")}this.userName=r;this.password=i;this.authorizationScheme=s}signRequest(r){const i=`${this.userName}:${this.password}`;const s=`${this.authorizationScheme} ${encodeString(i)}`;if(!r.headers)r.headers=new HttpHeaders;r.headers.set(ge.AUTHORIZATION,s);return Promise.resolve(r)}}class ApiKeyCredentials{constructor(r){if(!r||r&&!r.inHeader&&!r.inQuery){throw new Error(`options cannot be null or undefined. Either "inHeader" or "inQuery" property of the options object needs to be provided.`)}this.inHeader=r.inHeader;this.inQuery=r.inQuery}signRequest(r){if(!r){return Promise.reject(new Error(`webResource cannot be null or undefined and must be of type "object".`))}if(this.inHeader){if(!r.headers){r.headers=new HttpHeaders}for(const i in this.inHeader){r.headers.set(i,this.inHeader[i])}}if(this.inQuery){if(!r.url){return Promise.reject(new Error(`url cannot be null in the request object.`))}if(r.url.indexOf("?")<0){r.url+="?"}for(const i in this.inQuery){if(!r.url.endsWith("?")){r.url+="&"}r.url+=`${i}=${this.inQuery[i]}`}}return Promise.resolve(r)}}class TopicCredentials extends ApiKeyCredentials{constructor(r){if(!r||r&&typeof r!=="string"){throw new Error("topicKey cannot be null or undefined and must be of type string.")}const i={inHeader:{"aeg-sas-key":r}};super(i)}}Object.defineProperty(i,"delay",{enumerable:true,get:function(){return p.delay}});Object.defineProperty(i,"isNode",{enumerable:true,get:function(){return p.isNode}});Object.defineProperty(i,"isTokenCredential",{enumerable:true,get:function(){return A.isTokenCredential}});i.AccessTokenRefresher=AccessTokenRefresher;i.ApiKeyCredentials=ApiKeyCredentials;i.BaseRequestPolicy=BaseRequestPolicy;i.BasicAuthenticationCredentials=BasicAuthenticationCredentials;i.Constants=k;i.DefaultHttpClient=NodeFetchHttpClient;i.ExpiringAccessTokenCache=ExpiringAccessTokenCache;i.HttpHeaders=HttpHeaders;i.MapperType=M;i.RequestPolicyOptions=RequestPolicyOptions;i.RestError=RestError;i.Serializer=Serializer;i.ServiceClient=ServiceClient;i.TopicCredentials=TopicCredentials;i.URLBuilder=URLBuilder;i.URLQuery=URLQuery;i.WebResource=WebResource;i.XML_ATTRKEY=D;i.XML_CHARKEY=P;i.applyMixins=applyMixins;i.bearerTokenAuthenticationPolicy=bearerTokenAuthenticationPolicy;i.createPipelineFromOptions=createPipelineFromOptions;i.createSpanFunction=createSpanFunction;i.deserializationPolicy=deserializationPolicy;i.deserializeResponseBody=deserializeResponseBody;i.disableResponseDecompressionPolicy=disableResponseDecompressionPolicy;i.encodeUri=encodeUri;i.executePromisesSequentially=executePromisesSequentially;i.exponentialRetryPolicy=exponentialRetryPolicy;i.flattenResponse=flattenResponse;i.generateClientRequestIdPolicy=generateClientRequestIdPolicy;i.generateUuid=generateUuid;i.getDefaultProxySettings=getDefaultProxySettings;i.getDefaultUserAgentValue=getDefaultUserAgentValue;i.isDuration=isDuration;i.isValidUuid=isValidUuid;i.keepAlivePolicy=keepAlivePolicy;i.logPolicy=logPolicy;i.operationOptionsToRequestOptionsBase=operationOptionsToRequestOptionsBase;i.parseXML=parseXML;i.promiseToCallback=promiseToCallback;i.promiseToServiceCallback=promiseToServiceCallback;i.proxyPolicy=proxyPolicy;i.redirectPolicy=redirectPolicy;i.serializeObject=serializeObject;i.signingPolicy=signingPolicy;i.stringifyXML=stringifyXML;i.stripRequest=stripRequest;i.stripResponse=stripResponse;i.systemErrorRetryPolicy=systemErrorRetryPolicy;i.throttlingRetryPolicy=throttlingRetryPolicy;i.tracingPolicy=tracingPolicy;i.userAgentPolicy=userAgentPolicy},18125:function(r,i){(function(){"use strict";i.stripBOM=function(r){if(r[0]==="\ufeff"){return r.substring(1)}else{return r}}}).call(this)},32973:function(r,i,s){(function(){"use strict";var r,a,l,c,d,p={}.hasOwnProperty;r=s(50410);a=s(78116).defaults;c=function(r){return typeof r==="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)};d=function(r){return""};l=function(r){return r.replace("]]>","]]]]>")};i.Builder=function(){function Builder(r){var i,s,l;this.options={};s=a["0.2"];for(i in s){if(!p.call(s,i))continue;l=s[i];this.options[i]=l}for(i in r){if(!p.call(r,i))continue;l=r[i];this.options[i]=l}}Builder.prototype.buildObject=function(i){var s,l,u,A,h;s=this.options.attrkey;l=this.options.charkey;if(Object.keys(i).length===1&&this.options.rootName===a["0.2"].rootName){h=Object.keys(i)[0];i=i[h]}else{h=this.options.rootName}u=function(r){return function(i,a){var A,h,g,y,b,w;if(typeof a!=="object"){if(r.options.cdata&&c(a)){i.raw(d(a))}else{i.txt(a)}}else if(Array.isArray(a)){for(y in a){if(!p.call(a,y))continue;h=a[y];for(b in h){g=h[b];i=u(i.ele(b),g).up()}}}else{for(b in a){if(!p.call(a,b))continue;h=a[b];if(b===s){if(typeof h==="object"){for(A in h){w=h[A];i=i.att(A,w)}}}else if(b===l){if(r.options.cdata&&c(h)){i=i.raw(d(h))}else{i=i.txt(h)}}else if(Array.isArray(h)){for(y in h){if(!p.call(h,y))continue;g=h[y];if(typeof g==="string"){if(r.options.cdata&&c(g)){i=i.ele(b).raw(d(g)).up()}else{i=i.ele(b,g).up()}}else{i=u(i.ele(b),g).up()}}}else if(typeof h==="object"){i=u(i.ele(b),h).up()}else{if(typeof h==="string"&&r.options.cdata&&c(h)){i=i.ele(b).raw(d(h)).up()}else{if(h==null){h=""}i=i.ele(b,h.toString()).up()}}}}return i}}(this);A=r.create(h,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return u(A,i).end(this.options.renderOpts)};return Builder}()}).call(this)},78116:function(r,i){(function(){i.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},6713:function(r,i,s){(function(){"use strict";var r,a,l,c,d,p,u,A,bind=function(r,i){return function(){return r.apply(i,arguments)}},extend=function(r,i){for(var s in i){if(h.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},h={}.hasOwnProperty;u=s(69467);l=s(82361);r=s(18125);p=s(26689);A=s(39512).setImmediate;a=s(78116).defaults;c=function(r){return typeof r==="object"&&r!=null&&Object.keys(r).length===0};d=function(r,i,s){var a,l,c;for(a=0,l=r.length;a0){u[r.options.childkey]=g}g=u}else if(w){w[r.options.childkey]=w[r.options.childkey]||[];y=Object.create(null);for(p in g){if(!h.call(g,p))continue;y[p]=g[p]}w[r.options.childkey].push(y);delete g["#name"];if(Object.keys(g).length===1&&i in g&&!r.EXPLICIT_CHARKEY){g=g[i]}}}if(a.length>0){return r.assignOrPush(w,A,g)}else{if(r.options.explicitRoot){b=g;g=Object.create(null);g[A]=b}r.resultObject=g;r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);s=function(r){return function(s){var l,c;c=a[a.length-1];if(c){c[i]+=s;if(r.options.explicitChildren&&r.options.preserveChildrenOrder&&r.options.charsAsChildren&&(r.options.includeWhiteChars||s.replace(/\\n/g,"").trim()!=="")){c[r.options.childkey]=c[r.options.childkey]||[];l={"#name":"__text__"};l[i]=s;if(r.options.normalize){l[i]=l[i].replace(/\s{2,}/g," ").trim()}c[r.options.childkey].push(l)}return c}}}(this);this.saxParser.ontext=s;return this.saxParser.oncdata=function(r){return function(r){var i;i=s(r);if(i){return i.cdata=true}}}(this)};Parser.prototype.parseString=function(i,s){var a;if(s!=null&&typeof s==="function"){this.on("end",(function(r){this.reset();return s(null,r)}));this.on("error",(function(r){this.reset();return s(r)}))}try{i=i.toString();if(i.trim()===""){this.emit("end",null);return true}i=r.stripBOM(i);if(this.options.async){this.remaining=i;A(this.processAsync);return this.saxParser}return this.saxParser.write(i).close()}catch(r){a=r;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",a);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw a}}};Parser.prototype.parseStringPromise=function(r){return new Promise(function(i){return function(s,a){return i.parseString(r,(function(r,i){if(r){return a(r)}else{return s(i)}}))}}(this))};return Parser}(l);i.parseString=function(r,s,a){var l,c,d;if(a!=null){if(typeof a==="function"){l=a}if(typeof s==="object"){c=s}}else{if(typeof s==="function"){l=s}c={}}d=new i.Parser(c);return d.parseString(r,l)};i.parseStringPromise=function(r,s){var a,l;if(typeof s==="object"){a=s}l=new i.Parser(a);return l.parseStringPromise(r)}}).call(this)},26689:function(r,i){(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/);i.normalize=function(r){return r.toLowerCase()};i.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)};i.stripPrefix=function(i){return i.replace(r,"")};i.parseNumbers=function(r){if(!isNaN(r)){r=r%1===0?parseInt(r,10):parseFloat(r)}return r};i.parseBooleans=function(r){if(/^(?:true|false)$/i.test(r)){r=r.toLowerCase()==="true"}return r}}).call(this)},82357:function(r,i,s){(function(){"use strict";var r,a,l,c,extend=function(r,i){for(var s in i){if(d.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},d={}.hasOwnProperty;a=s(78116);r=s(32973);l=s(6713);c=s(26689);i.defaults=a.defaults;i.processors=c;i.ValidationError=function(r){extend(ValidationError,r);function ValidationError(r){this.message=r}return ValidationError}(Error);i.Builder=r.Builder;i.Parser=l.Parser;i.parseString=l.parseString;i.parseStringPromise=l.parseStringPromise}).call(this)},54787:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(85762);(function(r){r[r["INTERNAL"]=0]="INTERNAL";r[r["SERVER"]=1]="SERVER";r[r["CLIENT"]=2]="CLIENT";r[r["PRODUCER"]=3]="PRODUCER";r[r["CONSUMER"]=4]="CONSUMER"})(i.SpanKind||(i.SpanKind={}));function getSpan(r){return a.trace.getSpan(r)}function setSpan(r,i){return a.trace.setSpan(r,i)}function setSpanContext(r,i){return a.trace.setSpanContext(r,i)}function getSpanContext(r){return a.trace.getSpanContext(r)}function isSpanContextValid(r){return a.trace.isSpanContextValid(r)}function getTracer(r,i){return a.trace.getTracer(r||"azure/core-tracing",i)}const l=a.context;(function(r){r[r["UNSET"]=0]="UNSET";r[r["OK"]=1]="OK";r[r["ERROR"]=2]="ERROR"})(i.SpanStatusCode||(i.SpanStatusCode={}));function isTracingDisabled(){var r;if(typeof process==="undefined"){return false}const i=(r=process.env.AZURE_TRACING_DISABLED)===null||r===void 0?void 0:r.toLowerCase();if(i==="false"||i==="0"){return false}return Boolean(i)}function createSpanFunction(r){return function(s,c){const d=getTracer();const p=(c===null||c===void 0?void 0:c.tracingOptions)||{};const u=Object.assign({kind:i.SpanKind.INTERNAL},p.spanOptions);const A=r.packagePrefix?`${r.packagePrefix}.${s}`:s;let h;if(isTracingDisabled()){h=a.trace.wrapSpanContext(a.INVALID_SPAN_CONTEXT)}else{h=d.startSpan(A,u,p.tracingContext)}if(r.namespace){h.setAttribute("az.namespace",r.namespace)}let g=p.spanOptions||{};if(h.isRecording()&&r.namespace){g=Object.assign(Object.assign({},p.spanOptions),{attributes:Object.assign(Object.assign({},u.attributes),{"az.namespace":r.namespace})})}const y=Object.assign(Object.assign({},p),{spanOptions:g,tracingContext:setSpan(p.tracingContext||l.active(),h)});const b=Object.assign(Object.assign({},c),{tracingOptions:y});return{span:h,updatedOptions:b}}}const c="00";function extractSpanContextFromTraceParentHeader(r){const i=r.split("-");if(i.length!==4){return}const[s,a,l,d]=i;if(s!==c){return}const p=parseInt(d,16);const u={spanId:l,traceId:a,traceFlags:p};return u}function getTraceParentHeader(r){const i=[];if(!r.traceId){i.push("traceId")}if(!r.spanId){i.push("spanId")}if(i.length){return}const s=r.traceFlags||0;const a=s.toString(16);const l=a.length===1?`0${a}`:a;return`${c}-${r.traceId}-${r.spanId}-${l}`}i.context=l;i.createSpanFunction=createSpanFunction;i.extractSpanContextFromTraceParentHeader=extractSpanContextFromTraceParentHeader;i.getSpan=getSpan;i.getSpanContext=getSpanContext;i.getTraceParentHeader=getTraceParentHeader;i.getTracer=getTracer;i.isSpanContextValid=isSpanContextValid;i.setSpan=setSpan;i.setSpanContext=setSpanContext},12990:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(61889);var l=s(56728);var c=s(54787);var d=s(91878);var p=s(78185);var u=s(22037);var A=s(6113);var h=s(12781);s(73590);var g=s(40823);var y=s(82361);var b=s(57147);var w=s(73837);function _interopNamespace(r){if(r&&r.__esModule)return r;var i=Object.create(null);if(r){Object.keys(r).forEach((function(s){if(s!=="default"){var a=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(i,s,a.get?a:{enumerable:true,get:function(){return r[s]}})}}))}i["default"]=r;return Object.freeze(i)}var C=_interopNamespace(a);var v=_interopNamespace(u);var I=_interopNamespace(b);var B=_interopNamespace(w);const S={serializedName:"BlobServiceProperties",xmlName:"StorageServiceProperties",type:{name:"Composite",className:"BlobServiceProperties",modelProperties:{blobAnalyticsLogging:{serializedName:"Logging",xmlName:"Logging",type:{name:"Composite",className:"Logging"}},hourMetrics:{serializedName:"HourMetrics",xmlName:"HourMetrics",type:{name:"Composite",className:"Metrics"}},minuteMetrics:{serializedName:"MinuteMetrics",xmlName:"MinuteMetrics",type:{name:"Composite",className:"Metrics"}},cors:{serializedName:"Cors",xmlName:"Cors",xmlIsWrapped:true,xmlElementName:"CorsRule",type:{name:"Sequence",element:{type:{name:"Composite",className:"CorsRule"}}}},defaultServiceVersion:{serializedName:"DefaultServiceVersion",xmlName:"DefaultServiceVersion",type:{name:"String"}},deleteRetentionPolicy:{serializedName:"DeleteRetentionPolicy",xmlName:"DeleteRetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}},staticWebsite:{serializedName:"StaticWebsite",xmlName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite"}}}}};const x={serializedName:"Logging",type:{name:"Composite",className:"Logging",modelProperties:{version:{serializedName:"Version",required:true,xmlName:"Version",type:{name:"String"}},deleteProperty:{serializedName:"Delete",required:true,xmlName:"Delete",type:{name:"Boolean"}},read:{serializedName:"Read",required:true,xmlName:"Read",type:{name:"Boolean"}},write:{serializedName:"Write",required:true,xmlName:"Write",type:{name:"Boolean"}},retentionPolicy:{serializedName:"RetentionPolicy",xmlName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}};const R={serializedName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy",modelProperties:{enabled:{serializedName:"Enabled",required:true,xmlName:"Enabled",type:{name:"Boolean"}},days:{constraints:{InclusiveMinimum:1},serializedName:"Days",xmlName:"Days",type:{name:"Number"}}}}};const Q={serializedName:"Metrics",type:{name:"Composite",className:"Metrics",modelProperties:{version:{serializedName:"Version",xmlName:"Version",type:{name:"String"}},enabled:{serializedName:"Enabled",required:true,xmlName:"Enabled",type:{name:"Boolean"}},includeAPIs:{serializedName:"IncludeAPIs",xmlName:"IncludeAPIs",type:{name:"Boolean"}},retentionPolicy:{serializedName:"RetentionPolicy",xmlName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}};const _={serializedName:"CorsRule",type:{name:"Composite",className:"CorsRule",modelProperties:{allowedOrigins:{serializedName:"AllowedOrigins",required:true,xmlName:"AllowedOrigins",type:{name:"String"}},allowedMethods:{serializedName:"AllowedMethods",required:true,xmlName:"AllowedMethods",type:{name:"String"}},allowedHeaders:{serializedName:"AllowedHeaders",required:true,xmlName:"AllowedHeaders",type:{name:"String"}},exposedHeaders:{serializedName:"ExposedHeaders",required:true,xmlName:"ExposedHeaders",type:{name:"String"}},maxAgeInSeconds:{constraints:{InclusiveMinimum:0},serializedName:"MaxAgeInSeconds",required:true,xmlName:"MaxAgeInSeconds",type:{name:"Number"}}}}};const N={serializedName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite",modelProperties:{enabled:{serializedName:"Enabled",required:true,xmlName:"Enabled",type:{name:"Boolean"}},indexDocument:{serializedName:"IndexDocument",xmlName:"IndexDocument",type:{name:"String"}},errorDocument404Path:{serializedName:"ErrorDocument404Path",xmlName:"ErrorDocument404Path",type:{name:"String"}},defaultIndexDocumentPath:{serializedName:"DefaultIndexDocumentPath",xmlName:"DefaultIndexDocumentPath",type:{name:"String"}}}}};const T={serializedName:"StorageError",type:{name:"Composite",className:"StorageError",modelProperties:{message:{serializedName:"Message",xmlName:"Message",type:{name:"String"}},code:{serializedName:"Code",xmlName:"Code",type:{name:"String"}}}}};const k={serializedName:"BlobServiceStatistics",xmlName:"StorageServiceStats",type:{name:"Composite",className:"BlobServiceStatistics",modelProperties:{geoReplication:{serializedName:"GeoReplication",xmlName:"GeoReplication",type:{name:"Composite",className:"GeoReplication"}}}}};const D={serializedName:"GeoReplication",type:{name:"Composite",className:"GeoReplication",modelProperties:{status:{serializedName:"Status",required:true,xmlName:"Status",type:{name:"Enum",allowedValues:["live","bootstrap","unavailable"]}},lastSyncOn:{serializedName:"LastSyncTime",required:true,xmlName:"LastSyncTime",type:{name:"DateTimeRfc1123"}}}}};const P={serializedName:"ListContainersSegmentResponse",xmlName:"EnumerationResults",type:{name:"Composite",className:"ListContainersSegmentResponse",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},prefix:{serializedName:"Prefix",xmlName:"Prefix",type:{name:"String"}},marker:{serializedName:"Marker",xmlName:"Marker",type:{name:"String"}},maxPageSize:{serializedName:"MaxResults",xmlName:"MaxResults",type:{name:"Number"}},containerItems:{serializedName:"ContainerItems",required:true,xmlName:"Containers",xmlIsWrapped:true,xmlElementName:"Container",type:{name:"Sequence",element:{type:{name:"Composite",className:"ContainerItem"}}}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const O={serializedName:"ContainerItem",xmlName:"Container",type:{name:"Composite",className:"ContainerItem",modelProperties:{name:{serializedName:"Name",required:true,xmlName:"Name",type:{name:"String"}},deleted:{serializedName:"Deleted",xmlName:"Deleted",type:{name:"Boolean"}},version:{serializedName:"Version",xmlName:"Version",type:{name:"String"}},properties:{serializedName:"Properties",xmlName:"Properties",type:{name:"Composite",className:"ContainerProperties"}},metadata:{serializedName:"Metadata",xmlName:"Metadata",type:{name:"Dictionary",value:{type:{name:"String"}}}}}}};const L={serializedName:"ContainerProperties",type:{name:"Composite",className:"ContainerProperties",modelProperties:{lastModified:{serializedName:"Last-Modified",required:true,xmlName:"Last-Modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"Etag",required:true,xmlName:"Etag",type:{name:"String"}},leaseStatus:{serializedName:"LeaseStatus",xmlName:"LeaseStatus",type:{name:"Enum",allowedValues:["locked","unlocked"]}},leaseState:{serializedName:"LeaseState",xmlName:"LeaseState",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseDuration:{serializedName:"LeaseDuration",xmlName:"LeaseDuration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},publicAccess:{serializedName:"PublicAccess",xmlName:"PublicAccess",type:{name:"Enum",allowedValues:["container","blob"]}},hasImmutabilityPolicy:{serializedName:"HasImmutabilityPolicy",xmlName:"HasImmutabilityPolicy",type:{name:"Boolean"}},hasLegalHold:{serializedName:"HasLegalHold",xmlName:"HasLegalHold",type:{name:"Boolean"}},defaultEncryptionScope:{serializedName:"DefaultEncryptionScope",xmlName:"DefaultEncryptionScope",type:{name:"String"}},preventEncryptionScopeOverride:{serializedName:"DenyEncryptionScopeOverride",xmlName:"DenyEncryptionScopeOverride",type:{name:"Boolean"}},deletedOn:{serializedName:"DeletedTime",xmlName:"DeletedTime",type:{name:"DateTimeRfc1123"}},remainingRetentionDays:{serializedName:"RemainingRetentionDays",xmlName:"RemainingRetentionDays",type:{name:"Number"}},isImmutableStorageWithVersioningEnabled:{serializedName:"ImmutableStorageWithVersioningEnabled",xmlName:"ImmutableStorageWithVersioningEnabled",type:{name:"Boolean"}}}}};const M={serializedName:"KeyInfo",type:{name:"Composite",className:"KeyInfo",modelProperties:{startsOn:{serializedName:"Start",required:true,xmlName:"Start",type:{name:"String"}},expiresOn:{serializedName:"Expiry",required:true,xmlName:"Expiry",type:{name:"String"}}}}};const U={serializedName:"UserDelegationKey",type:{name:"Composite",className:"UserDelegationKey",modelProperties:{signedObjectId:{serializedName:"SignedOid",required:true,xmlName:"SignedOid",type:{name:"String"}},signedTenantId:{serializedName:"SignedTid",required:true,xmlName:"SignedTid",type:{name:"String"}},signedStartsOn:{serializedName:"SignedStart",required:true,xmlName:"SignedStart",type:{name:"String"}},signedExpiresOn:{serializedName:"SignedExpiry",required:true,xmlName:"SignedExpiry",type:{name:"String"}},signedService:{serializedName:"SignedService",required:true,xmlName:"SignedService",type:{name:"String"}},signedVersion:{serializedName:"SignedVersion",required:true,xmlName:"SignedVersion",type:{name:"String"}},value:{serializedName:"Value",required:true,xmlName:"Value",type:{name:"String"}}}}};const j={serializedName:"FilterBlobSegment",xmlName:"EnumerationResults",type:{name:"Composite",className:"FilterBlobSegment",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},where:{serializedName:"Where",required:true,xmlName:"Where",type:{name:"String"}},blobs:{serializedName:"Blobs",required:true,xmlName:"Blobs",xmlIsWrapped:true,xmlElementName:"Blob",type:{name:"Sequence",element:{type:{name:"Composite",className:"FilterBlobItem"}}}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const H={serializedName:"FilterBlobItem",xmlName:"Blob",type:{name:"Composite",className:"FilterBlobItem",modelProperties:{name:{serializedName:"Name",required:true,xmlName:"Name",type:{name:"String"}},containerName:{serializedName:"ContainerName",required:true,xmlName:"ContainerName",type:{name:"String"}},tags:{serializedName:"Tags",xmlName:"Tags",type:{name:"Composite",className:"BlobTags"}}}}};const q={serializedName:"BlobTags",xmlName:"Tags",type:{name:"Composite",className:"BlobTags",modelProperties:{blobTagSet:{serializedName:"BlobTagSet",required:true,xmlName:"TagSet",xmlIsWrapped:true,xmlElementName:"Tag",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobTag"}}}}}}};const G={serializedName:"BlobTag",xmlName:"Tag",type:{name:"Composite",className:"BlobTag",modelProperties:{key:{serializedName:"Key",required:true,xmlName:"Key",type:{name:"String"}},value:{serializedName:"Value",required:true,xmlName:"Value",type:{name:"String"}}}}};const z={serializedName:"SignedIdentifier",xmlName:"SignedIdentifier",type:{name:"Composite",className:"SignedIdentifier",modelProperties:{id:{serializedName:"Id",required:true,xmlName:"Id",type:{name:"String"}},accessPolicy:{serializedName:"AccessPolicy",xmlName:"AccessPolicy",type:{name:"Composite",className:"AccessPolicy"}}}}};const V={serializedName:"AccessPolicy",type:{name:"Composite",className:"AccessPolicy",modelProperties:{startsOn:{serializedName:"Start",xmlName:"Start",type:{name:"String"}},expiresOn:{serializedName:"Expiry",xmlName:"Expiry",type:{name:"String"}},permissions:{serializedName:"Permission",xmlName:"Permission",type:{name:"String"}}}}};const W={serializedName:"ListBlobsFlatSegmentResponse",xmlName:"EnumerationResults",type:{name:"Composite",className:"ListBlobsFlatSegmentResponse",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},containerName:{serializedName:"ContainerName",required:true,xmlName:"ContainerName",xmlIsAttribute:true,type:{name:"String"}},prefix:{serializedName:"Prefix",xmlName:"Prefix",type:{name:"String"}},marker:{serializedName:"Marker",xmlName:"Marker",type:{name:"String"}},maxPageSize:{serializedName:"MaxResults",xmlName:"MaxResults",type:{name:"Number"}},segment:{serializedName:"Segment",xmlName:"Blobs",type:{name:"Composite",className:"BlobFlatListSegment"}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const Y={serializedName:"BlobFlatListSegment",xmlName:"Blobs",type:{name:"Composite",className:"BlobFlatListSegment",modelProperties:{blobItems:{serializedName:"BlobItems",required:true,xmlName:"BlobItems",xmlElementName:"Blob",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobItemInternal"}}}}}}};const J={serializedName:"BlobItemInternal",xmlName:"Blob",type:{name:"Composite",className:"BlobItemInternal",modelProperties:{name:{serializedName:"Name",xmlName:"Name",type:{name:"Composite",className:"BlobName"}},deleted:{serializedName:"Deleted",required:true,xmlName:"Deleted",type:{name:"Boolean"}},snapshot:{serializedName:"Snapshot",required:true,xmlName:"Snapshot",type:{name:"String"}},versionId:{serializedName:"VersionId",xmlName:"VersionId",type:{name:"String"}},isCurrentVersion:{serializedName:"IsCurrentVersion",xmlName:"IsCurrentVersion",type:{name:"Boolean"}},properties:{serializedName:"Properties",xmlName:"Properties",type:{name:"Composite",className:"BlobPropertiesInternal"}},metadata:{serializedName:"Metadata",xmlName:"Metadata",type:{name:"Dictionary",value:{type:{name:"String"}}}},blobTags:{serializedName:"BlobTags",xmlName:"Tags",type:{name:"Composite",className:"BlobTags"}},objectReplicationMetadata:{serializedName:"ObjectReplicationMetadata",xmlName:"OrMetadata",type:{name:"Dictionary",value:{type:{name:"String"}}}},hasVersionsOnly:{serializedName:"HasVersionsOnly",xmlName:"HasVersionsOnly",type:{name:"Boolean"}}}}};const $={serializedName:"BlobName",type:{name:"Composite",className:"BlobName",modelProperties:{encoded:{serializedName:"Encoded",xmlName:"Encoded",xmlIsAttribute:true,type:{name:"Boolean"}},content:{serializedName:"content",xmlName:"content",xmlIsMsText:true,type:{name:"String"}}}}};const X={serializedName:"BlobPropertiesInternal",xmlName:"Properties",type:{name:"Composite",className:"BlobPropertiesInternal",modelProperties:{createdOn:{serializedName:"Creation-Time",xmlName:"Creation-Time",type:{name:"DateTimeRfc1123"}},lastModified:{serializedName:"Last-Modified",required:true,xmlName:"Last-Modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"Etag",required:true,xmlName:"Etag",type:{name:"String"}},contentLength:{serializedName:"Content-Length",xmlName:"Content-Length",type:{name:"Number"}},contentType:{serializedName:"Content-Type",xmlName:"Content-Type",type:{name:"String"}},contentEncoding:{serializedName:"Content-Encoding",xmlName:"Content-Encoding",type:{name:"String"}},contentLanguage:{serializedName:"Content-Language",xmlName:"Content-Language",type:{name:"String"}},contentMD5:{serializedName:"Content-MD5",xmlName:"Content-MD5",type:{name:"ByteArray"}},contentDisposition:{serializedName:"Content-Disposition",xmlName:"Content-Disposition",type:{name:"String"}},cacheControl:{serializedName:"Cache-Control",xmlName:"Cache-Control",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"BlobType",xmlName:"BlobType",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},leaseStatus:{serializedName:"LeaseStatus",xmlName:"LeaseStatus",type:{name:"Enum",allowedValues:["locked","unlocked"]}},leaseState:{serializedName:"LeaseState",xmlName:"LeaseState",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseDuration:{serializedName:"LeaseDuration",xmlName:"LeaseDuration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},copyId:{serializedName:"CopyId",xmlName:"CopyId",type:{name:"String"}},copyStatus:{serializedName:"CopyStatus",xmlName:"CopyStatus",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},copySource:{serializedName:"CopySource",xmlName:"CopySource",type:{name:"String"}},copyProgress:{serializedName:"CopyProgress",xmlName:"CopyProgress",type:{name:"String"}},copyCompletedOn:{serializedName:"CopyCompletionTime",xmlName:"CopyCompletionTime",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"CopyStatusDescription",xmlName:"CopyStatusDescription",type:{name:"String"}},serverEncrypted:{serializedName:"ServerEncrypted",xmlName:"ServerEncrypted",type:{name:"Boolean"}},incrementalCopy:{serializedName:"IncrementalCopy",xmlName:"IncrementalCopy",type:{name:"Boolean"}},destinationSnapshot:{serializedName:"DestinationSnapshot",xmlName:"DestinationSnapshot",type:{name:"String"}},deletedOn:{serializedName:"DeletedTime",xmlName:"DeletedTime",type:{name:"DateTimeRfc1123"}},remainingRetentionDays:{serializedName:"RemainingRetentionDays",xmlName:"RemainingRetentionDays",type:{name:"Number"}},accessTier:{serializedName:"AccessTier",xmlName:"AccessTier",type:{name:"Enum",allowedValues:["P4","P6","P10","P15","P20","P30","P40","P50","P60","P70","P80","Hot","Cool","Archive","Cold"]}},accessTierInferred:{serializedName:"AccessTierInferred",xmlName:"AccessTierInferred",type:{name:"Boolean"}},archiveStatus:{serializedName:"ArchiveStatus",xmlName:"ArchiveStatus",type:{name:"Enum",allowedValues:["rehydrate-pending-to-hot","rehydrate-pending-to-cool","rehydrate-pending-to-cold"]}},customerProvidedKeySha256:{serializedName:"CustomerProvidedKeySha256",xmlName:"CustomerProvidedKeySha256",type:{name:"String"}},encryptionScope:{serializedName:"EncryptionScope",xmlName:"EncryptionScope",type:{name:"String"}},accessTierChangedOn:{serializedName:"AccessTierChangeTime",xmlName:"AccessTierChangeTime",type:{name:"DateTimeRfc1123"}},tagCount:{serializedName:"TagCount",xmlName:"TagCount",type:{name:"Number"}},expiresOn:{serializedName:"Expiry-Time",xmlName:"Expiry-Time",type:{name:"DateTimeRfc1123"}},isSealed:{serializedName:"Sealed",xmlName:"Sealed",type:{name:"Boolean"}},rehydratePriority:{serializedName:"RehydratePriority",xmlName:"RehydratePriority",type:{name:"Enum",allowedValues:["High","Standard"]}},lastAccessedOn:{serializedName:"LastAccessTime",xmlName:"LastAccessTime",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiresOn:{serializedName:"ImmutabilityPolicyUntilDate",xmlName:"ImmutabilityPolicyUntilDate",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"ImmutabilityPolicyMode",xmlName:"ImmutabilityPolicyMode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}},legalHold:{serializedName:"LegalHold",xmlName:"LegalHold",type:{name:"Boolean"}}}}};const K={serializedName:"ListBlobsHierarchySegmentResponse",xmlName:"EnumerationResults",type:{name:"Composite",className:"ListBlobsHierarchySegmentResponse",modelProperties:{serviceEndpoint:{serializedName:"ServiceEndpoint",required:true,xmlName:"ServiceEndpoint",xmlIsAttribute:true,type:{name:"String"}},containerName:{serializedName:"ContainerName",required:true,xmlName:"ContainerName",xmlIsAttribute:true,type:{name:"String"}},prefix:{serializedName:"Prefix",xmlName:"Prefix",type:{name:"String"}},marker:{serializedName:"Marker",xmlName:"Marker",type:{name:"String"}},maxPageSize:{serializedName:"MaxResults",xmlName:"MaxResults",type:{name:"Number"}},delimiter:{serializedName:"Delimiter",xmlName:"Delimiter",type:{name:"String"}},segment:{serializedName:"Segment",xmlName:"Blobs",type:{name:"Composite",className:"BlobHierarchyListSegment"}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const Z={serializedName:"BlobHierarchyListSegment",xmlName:"Blobs",type:{name:"Composite",className:"BlobHierarchyListSegment",modelProperties:{blobPrefixes:{serializedName:"BlobPrefixes",xmlName:"BlobPrefixes",xmlElementName:"BlobPrefix",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobPrefix"}}}},blobItems:{serializedName:"BlobItems",required:true,xmlName:"BlobItems",xmlElementName:"Blob",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobItemInternal"}}}}}}};const ee={serializedName:"BlobPrefix",type:{name:"Composite",className:"BlobPrefix",modelProperties:{name:{serializedName:"Name",xmlName:"Name",type:{name:"Composite",className:"BlobName"}}}}};const te={serializedName:"BlockLookupList",xmlName:"BlockList",type:{name:"Composite",className:"BlockLookupList",modelProperties:{committed:{serializedName:"Committed",xmlName:"Committed",xmlElementName:"Committed",type:{name:"Sequence",element:{type:{name:"String"}}}},uncommitted:{serializedName:"Uncommitted",xmlName:"Uncommitted",xmlElementName:"Uncommitted",type:{name:"Sequence",element:{type:{name:"String"}}}},latest:{serializedName:"Latest",xmlName:"Latest",xmlElementName:"Latest",type:{name:"Sequence",element:{type:{name:"String"}}}}}}};const re={serializedName:"BlockList",type:{name:"Composite",className:"BlockList",modelProperties:{committedBlocks:{serializedName:"CommittedBlocks",xmlName:"CommittedBlocks",xmlIsWrapped:true,xmlElementName:"Block",type:{name:"Sequence",element:{type:{name:"Composite",className:"Block"}}}},uncommittedBlocks:{serializedName:"UncommittedBlocks",xmlName:"UncommittedBlocks",xmlIsWrapped:true,xmlElementName:"Block",type:{name:"Sequence",element:{type:{name:"Composite",className:"Block"}}}}}}};const ne={serializedName:"Block",type:{name:"Composite",className:"Block",modelProperties:{name:{serializedName:"Name",required:true,xmlName:"Name",type:{name:"String"}},size:{serializedName:"Size",required:true,xmlName:"Size",type:{name:"Number"}}}}};const ie={serializedName:"PageList",type:{name:"Composite",className:"PageList",modelProperties:{pageRange:{serializedName:"PageRange",xmlName:"PageRange",xmlElementName:"PageRange",type:{name:"Sequence",element:{type:{name:"Composite",className:"PageRange"}}}},clearRange:{serializedName:"ClearRange",xmlName:"ClearRange",xmlElementName:"ClearRange",type:{name:"Sequence",element:{type:{name:"Composite",className:"ClearRange"}}}},continuationToken:{serializedName:"NextMarker",xmlName:"NextMarker",type:{name:"String"}}}}};const se={serializedName:"PageRange",xmlName:"PageRange",type:{name:"Composite",className:"PageRange",modelProperties:{start:{serializedName:"Start",required:true,xmlName:"Start",type:{name:"Number"}},end:{serializedName:"End",required:true,xmlName:"End",type:{name:"Number"}}}}};const ae={serializedName:"ClearRange",xmlName:"ClearRange",type:{name:"Composite",className:"ClearRange",modelProperties:{start:{serializedName:"Start",required:true,xmlName:"Start",type:{name:"Number"}},end:{serializedName:"End",required:true,xmlName:"End",type:{name:"Number"}}}}};const oe={serializedName:"QueryRequest",xmlName:"QueryRequest",type:{name:"Composite",className:"QueryRequest",modelProperties:{queryType:{serializedName:"QueryType",required:true,xmlName:"QueryType",type:{name:"String"}},expression:{serializedName:"Expression",required:true,xmlName:"Expression",type:{name:"String"}},inputSerialization:{serializedName:"InputSerialization",xmlName:"InputSerialization",type:{name:"Composite",className:"QuerySerialization"}},outputSerialization:{serializedName:"OutputSerialization",xmlName:"OutputSerialization",type:{name:"Composite",className:"QuerySerialization"}}}}};const le={serializedName:"QuerySerialization",type:{name:"Composite",className:"QuerySerialization",modelProperties:{format:{serializedName:"Format",xmlName:"Format",type:{name:"Composite",className:"QueryFormat"}}}}};const ce={serializedName:"QueryFormat",type:{name:"Composite",className:"QueryFormat",modelProperties:{type:{serializedName:"Type",required:true,xmlName:"Type",type:{name:"Enum",allowedValues:["delimited","json","arrow","parquet"]}},delimitedTextConfiguration:{serializedName:"DelimitedTextConfiguration",xmlName:"DelimitedTextConfiguration",type:{name:"Composite",className:"DelimitedTextConfiguration"}},jsonTextConfiguration:{serializedName:"JsonTextConfiguration",xmlName:"JsonTextConfiguration",type:{name:"Composite",className:"JsonTextConfiguration"}},arrowConfiguration:{serializedName:"ArrowConfiguration",xmlName:"ArrowConfiguration",type:{name:"Composite",className:"ArrowConfiguration"}},parquetTextConfiguration:{serializedName:"ParquetTextConfiguration",xmlName:"ParquetTextConfiguration",type:{name:"any"}}}}};const de={serializedName:"DelimitedTextConfiguration",xmlName:"DelimitedTextConfiguration",type:{name:"Composite",className:"DelimitedTextConfiguration",modelProperties:{columnSeparator:{serializedName:"ColumnSeparator",xmlName:"ColumnSeparator",type:{name:"String"}},fieldQuote:{serializedName:"FieldQuote",xmlName:"FieldQuote",type:{name:"String"}},recordSeparator:{serializedName:"RecordSeparator",xmlName:"RecordSeparator",type:{name:"String"}},escapeChar:{serializedName:"EscapeChar",xmlName:"EscapeChar",type:{name:"String"}},headersPresent:{serializedName:"HeadersPresent",xmlName:"HasHeaders",type:{name:"Boolean"}}}}};const pe={serializedName:"JsonTextConfiguration",xmlName:"JsonTextConfiguration",type:{name:"Composite",className:"JsonTextConfiguration",modelProperties:{recordSeparator:{serializedName:"RecordSeparator",xmlName:"RecordSeparator",type:{name:"String"}}}}};const ue={serializedName:"ArrowConfiguration",xmlName:"ArrowConfiguration",type:{name:"Composite",className:"ArrowConfiguration",modelProperties:{schema:{serializedName:"Schema",required:true,xmlName:"Schema",xmlIsWrapped:true,xmlElementName:"Field",type:{name:"Sequence",element:{type:{name:"Composite",className:"ArrowField"}}}}}}};const Ae={serializedName:"ArrowField",xmlName:"Field",type:{name:"Composite",className:"ArrowField",modelProperties:{type:{serializedName:"Type",required:true,xmlName:"Type",type:{name:"String"}},name:{serializedName:"Name",xmlName:"Name",type:{name:"String"}},precision:{serializedName:"Precision",xmlName:"Precision",type:{name:"Number"}},scale:{serializedName:"Scale",xmlName:"Scale",type:{name:"Number"}}}}};const fe={serializedName:"Service_setPropertiesHeaders",type:{name:"Composite",className:"ServiceSetPropertiesHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const me={serializedName:"Service_setPropertiesExceptionHeaders",type:{name:"Composite",className:"ServiceSetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const he={serializedName:"Service_getPropertiesHeaders",type:{name:"Composite",className:"ServiceGetPropertiesHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ge={serializedName:"Service_getPropertiesExceptionHeaders",type:{name:"Composite",className:"ServiceGetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ye={serializedName:"Service_getStatisticsHeaders",type:{name:"Composite",className:"ServiceGetStatisticsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const be={serializedName:"Service_getStatisticsExceptionHeaders",type:{name:"Composite",className:"ServiceGetStatisticsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ee={serializedName:"Service_listContainersSegmentHeaders",type:{name:"Composite",className:"ServiceListContainersSegmentHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const we={serializedName:"Service_listContainersSegmentExceptionHeaders",type:{name:"Composite",className:"ServiceListContainersSegmentExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ce={serializedName:"Service_getUserDelegationKeyHeaders",type:{name:"Composite",className:"ServiceGetUserDelegationKeyHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ve={serializedName:"Service_getUserDelegationKeyExceptionHeaders",type:{name:"Composite",className:"ServiceGetUserDelegationKeyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ie={serializedName:"Service_getAccountInfoHeaders",type:{name:"Composite",className:"ServiceGetAccountInfoHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",xmlName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",xmlName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2","FileStorage","BlockBlobStorage"]}},isHierarchicalNamespaceEnabled:{serializedName:"x-ms-is-hns-enabled",xmlName:"x-ms-is-hns-enabled",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Be={serializedName:"Service_getAccountInfoExceptionHeaders",type:{name:"Composite",className:"ServiceGetAccountInfoExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Se={serializedName:"Service_submitBatchHeaders",type:{name:"Composite",className:"ServiceSubmitBatchHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const xe={serializedName:"Service_submitBatchExceptionHeaders",type:{name:"Composite",className:"ServiceSubmitBatchExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Re={serializedName:"Service_filterBlobsHeaders",type:{name:"Composite",className:"ServiceFilterBlobsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Qe={serializedName:"Service_filterBlobsExceptionHeaders",type:{name:"Composite",className:"ServiceFilterBlobsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const _e={serializedName:"Container_createHeaders",type:{name:"Composite",className:"ContainerCreateHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ne={serializedName:"Container_createExceptionHeaders",type:{name:"Composite",className:"ContainerCreateExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Te={serializedName:"Container_getPropertiesHeaders",type:{name:"Composite",className:"ContainerGetPropertiesHeaders",modelProperties:{metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobPublicAccess:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}},hasImmutabilityPolicy:{serializedName:"x-ms-has-immutability-policy",xmlName:"x-ms-has-immutability-policy",type:{name:"Boolean"}},hasLegalHold:{serializedName:"x-ms-has-legal-hold",xmlName:"x-ms-has-legal-hold",type:{name:"Boolean"}},defaultEncryptionScope:{serializedName:"x-ms-default-encryption-scope",xmlName:"x-ms-default-encryption-scope",type:{name:"String"}},denyEncryptionScopeOverride:{serializedName:"x-ms-deny-encryption-scope-override",xmlName:"x-ms-deny-encryption-scope-override",type:{name:"Boolean"}},isImmutableStorageWithVersioningEnabled:{serializedName:"x-ms-immutable-storage-with-versioning-enabled",xmlName:"x-ms-immutable-storage-with-versioning-enabled",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ke={serializedName:"Container_getPropertiesExceptionHeaders",type:{name:"Composite",className:"ContainerGetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const De={serializedName:"Container_deleteHeaders",type:{name:"Composite",className:"ContainerDeleteHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Pe={serializedName:"Container_deleteExceptionHeaders",type:{name:"Composite",className:"ContainerDeleteExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Oe={serializedName:"Container_setMetadataHeaders",type:{name:"Composite",className:"ContainerSetMetadataHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Le={serializedName:"Container_setMetadataExceptionHeaders",type:{name:"Composite",className:"ContainerSetMetadataExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Me={serializedName:"Container_getAccessPolicyHeaders",type:{name:"Composite",className:"ContainerGetAccessPolicyHeaders",modelProperties:{blobPublicAccess:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Fe={serializedName:"Container_getAccessPolicyExceptionHeaders",type:{name:"Composite",className:"ContainerGetAccessPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ue={serializedName:"Container_setAccessPolicyHeaders",type:{name:"Composite",className:"ContainerSetAccessPolicyHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const je={serializedName:"Container_setAccessPolicyExceptionHeaders",type:{name:"Composite",className:"ContainerSetAccessPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const He={serializedName:"Container_restoreHeaders",type:{name:"Composite",className:"ContainerRestoreHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const qe={serializedName:"Container_restoreExceptionHeaders",type:{name:"Composite",className:"ContainerRestoreExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ge={serializedName:"Container_renameHeaders",type:{name:"Composite",className:"ContainerRenameHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ze={serializedName:"Container_renameExceptionHeaders",type:{name:"Composite",className:"ContainerRenameExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ve={serializedName:"Container_submitBatchHeaders",type:{name:"Composite",className:"ContainerSubmitBatchHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}}}}};const We={serializedName:"Container_submitBatchExceptionHeaders",type:{name:"Composite",className:"ContainerSubmitBatchExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ye={serializedName:"Container_filterBlobsHeaders",type:{name:"Composite",className:"ContainerFilterBlobsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Je={serializedName:"Container_filterBlobsExceptionHeaders",type:{name:"Composite",className:"ContainerFilterBlobsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const $e={serializedName:"Container_acquireLeaseHeaders",type:{name:"Composite",className:"ContainerAcquireLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Xe={serializedName:"Container_acquireLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerAcquireLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ke={serializedName:"Container_releaseLeaseHeaders",type:{name:"Composite",className:"ContainerReleaseLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ze={serializedName:"Container_releaseLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerReleaseLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const et={serializedName:"Container_renewLeaseHeaders",type:{name:"Composite",className:"ContainerRenewLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const tt={serializedName:"Container_renewLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerRenewLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const rt={serializedName:"Container_breakLeaseHeaders",type:{name:"Composite",className:"ContainerBreakLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseTime:{serializedName:"x-ms-lease-time",xmlName:"x-ms-lease-time",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const nt={serializedName:"Container_breakLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerBreakLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const it={serializedName:"Container_changeLeaseHeaders",type:{name:"Composite",className:"ContainerChangeLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const st={serializedName:"Container_changeLeaseExceptionHeaders",type:{name:"Composite",className:"ContainerChangeLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ot={serializedName:"Container_listBlobFlatSegmentHeaders",type:{name:"Composite",className:"ContainerListBlobFlatSegmentHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const lt={serializedName:"Container_listBlobFlatSegmentExceptionHeaders",type:{name:"Composite",className:"ContainerListBlobFlatSegmentExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ct={serializedName:"Container_listBlobHierarchySegmentHeaders",type:{name:"Composite",className:"ContainerListBlobHierarchySegmentHeaders",modelProperties:{contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const dt={serializedName:"Container_listBlobHierarchySegmentExceptionHeaders",type:{name:"Composite",className:"ContainerListBlobHierarchySegmentExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const pt={serializedName:"Container_getAccountInfoHeaders",type:{name:"Composite",className:"ContainerGetAccountInfoHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",xmlName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",xmlName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2","FileStorage","BlockBlobStorage"]}}}}};const ut={serializedName:"Container_getAccountInfoExceptionHeaders",type:{name:"Composite",className:"ContainerGetAccountInfoExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const At={serializedName:"Blob_downloadHeaders",type:{name:"Composite",className:"BlobDownloadHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},createdOn:{serializedName:"x-ms-creation-time",xmlName:"x-ms-creation-time",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},objectReplicationPolicyId:{serializedName:"x-ms-or-policy-id",xmlName:"x-ms-or-policy-id",type:{name:"String"}},objectReplicationRules:{serializedName:"x-ms-or",xmlName:"x-ms-or",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-or-"},contentLength:{serializedName:"content-length",xmlName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},contentRange:{serializedName:"content-range",xmlName:"content-range",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",xmlName:"content-encoding",type:{name:"String"}},cacheControl:{serializedName:"cache-control",xmlName:"cache-control",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",xmlName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",xmlName:"content-language",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"x-ms-blob-type",xmlName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletedOn:{serializedName:"x-ms-copy-completion-time",xmlName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",xmlName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",xmlName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",xmlName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},isCurrentVersion:{serializedName:"x-ms-is-current-version",xmlName:"x-ms-is-current-version",type:{name:"Boolean"}},acceptRanges:{serializedName:"accept-ranges",xmlName:"accept-ranges",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",xmlName:"x-ms-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},blobContentMD5:{serializedName:"x-ms-blob-content-md5",xmlName:"x-ms-blob-content-md5",type:{name:"ByteArray"}},tagCount:{serializedName:"x-ms-tag-count",xmlName:"x-ms-tag-count",type:{name:"Number"}},isSealed:{serializedName:"x-ms-blob-sealed",xmlName:"x-ms-blob-sealed",type:{name:"Boolean"}},lastAccessed:{serializedName:"x-ms-last-access-time",xmlName:"x-ms-last-access-time",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiresOn:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}},legalHold:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}},contentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}}}}};const ft={serializedName:"Blob_downloadExceptionHeaders",type:{name:"Composite",className:"BlobDownloadExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const mt={serializedName:"Blob_getPropertiesHeaders",type:{name:"Composite",className:"BlobGetPropertiesHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},createdOn:{serializedName:"x-ms-creation-time",xmlName:"x-ms-creation-time",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},objectReplicationPolicyId:{serializedName:"x-ms-or-policy-id",xmlName:"x-ms-or-policy-id",type:{name:"String"}},objectReplicationRules:{serializedName:"x-ms-or",xmlName:"x-ms-or",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-or-"},blobType:{serializedName:"x-ms-blob-type",xmlName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletedOn:{serializedName:"x-ms-copy-completion-time",xmlName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",xmlName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",xmlName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",xmlName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},isIncrementalCopy:{serializedName:"x-ms-incremental-copy",xmlName:"x-ms-incremental-copy",type:{name:"Boolean"}},destinationSnapshot:{serializedName:"x-ms-copy-destination-snapshot",xmlName:"x-ms-copy-destination-snapshot",type:{name:"String"}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},contentLength:{serializedName:"content-length",xmlName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",xmlName:"content-encoding",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",xmlName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",xmlName:"content-language",type:{name:"String"}},cacheControl:{serializedName:"cache-control",xmlName:"cache-control",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},acceptRanges:{serializedName:"accept-ranges",xmlName:"accept-ranges",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",xmlName:"x-ms-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},accessTier:{serializedName:"x-ms-access-tier",xmlName:"x-ms-access-tier",type:{name:"String"}},accessTierInferred:{serializedName:"x-ms-access-tier-inferred",xmlName:"x-ms-access-tier-inferred",type:{name:"Boolean"}},archiveStatus:{serializedName:"x-ms-archive-status",xmlName:"x-ms-archive-status",type:{name:"String"}},accessTierChangedOn:{serializedName:"x-ms-access-tier-change-time",xmlName:"x-ms-access-tier-change-time",type:{name:"DateTimeRfc1123"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},isCurrentVersion:{serializedName:"x-ms-is-current-version",xmlName:"x-ms-is-current-version",type:{name:"Boolean"}},tagCount:{serializedName:"x-ms-tag-count",xmlName:"x-ms-tag-count",type:{name:"Number"}},expiresOn:{serializedName:"x-ms-expiry-time",xmlName:"x-ms-expiry-time",type:{name:"DateTimeRfc1123"}},isSealed:{serializedName:"x-ms-blob-sealed",xmlName:"x-ms-blob-sealed",type:{name:"Boolean"}},rehydratePriority:{serializedName:"x-ms-rehydrate-priority",xmlName:"x-ms-rehydrate-priority",type:{name:"Enum",allowedValues:["High","Standard"]}},lastAccessed:{serializedName:"x-ms-last-access-time",xmlName:"x-ms-last-access-time",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiresOn:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}},legalHold:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ht={serializedName:"Blob_getPropertiesExceptionHeaders",type:{name:"Composite",className:"BlobGetPropertiesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const gt={serializedName:"Blob_deleteHeaders",type:{name:"Composite",className:"BlobDeleteHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const yt={serializedName:"Blob_deleteExceptionHeaders",type:{name:"Composite",className:"BlobDeleteExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const bt={serializedName:"Blob_undeleteHeaders",type:{name:"Composite",className:"BlobUndeleteHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Et={serializedName:"Blob_undeleteExceptionHeaders",type:{name:"Composite",className:"BlobUndeleteExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const wt={serializedName:"Blob_setExpiryHeaders",type:{name:"Composite",className:"BlobSetExpiryHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ct={serializedName:"Blob_setExpiryExceptionHeaders",type:{name:"Composite",className:"BlobSetExpiryExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const vt={serializedName:"Blob_setHttpHeadersHeaders",type:{name:"Composite",className:"BlobSetHttpHeadersHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const It={serializedName:"Blob_setHttpHeadersExceptionHeaders",type:{name:"Composite",className:"BlobSetHttpHeadersExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Bt={serializedName:"Blob_setImmutabilityPolicyHeaders",type:{name:"Composite",className:"BlobSetImmutabilityPolicyHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyExpiry:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}},immutabilityPolicyMode:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}}}}};const St={serializedName:"Blob_setImmutabilityPolicyExceptionHeaders",type:{name:"Composite",className:"BlobSetImmutabilityPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const xt={serializedName:"Blob_deleteImmutabilityPolicyHeaders",type:{name:"Composite",className:"BlobDeleteImmutabilityPolicyHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Rt={serializedName:"Blob_deleteImmutabilityPolicyExceptionHeaders",type:{name:"Composite",className:"BlobDeleteImmutabilityPolicyExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Qt={serializedName:"Blob_setLegalHoldHeaders",type:{name:"Composite",className:"BlobSetLegalHoldHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},legalHold:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}}}}};const _t={serializedName:"Blob_setLegalHoldExceptionHeaders",type:{name:"Composite",className:"BlobSetLegalHoldExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Nt={serializedName:"Blob_setMetadataHeaders",type:{name:"Composite",className:"BlobSetMetadataHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Tt={serializedName:"Blob_setMetadataExceptionHeaders",type:{name:"Composite",className:"BlobSetMetadataExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const kt={serializedName:"Blob_acquireLeaseHeaders",type:{name:"Composite",className:"BlobAcquireLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Dt={serializedName:"Blob_acquireLeaseExceptionHeaders",type:{name:"Composite",className:"BlobAcquireLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Pt={serializedName:"Blob_releaseLeaseHeaders",type:{name:"Composite",className:"BlobReleaseLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ot={serializedName:"Blob_releaseLeaseExceptionHeaders",type:{name:"Composite",className:"BlobReleaseLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Lt={serializedName:"Blob_renewLeaseHeaders",type:{name:"Composite",className:"BlobRenewLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Mt={serializedName:"Blob_renewLeaseExceptionHeaders",type:{name:"Composite",className:"BlobRenewLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ft={serializedName:"Blob_changeLeaseHeaders",type:{name:"Composite",className:"BlobChangeLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},leaseId:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ut={serializedName:"Blob_changeLeaseExceptionHeaders",type:{name:"Composite",className:"BlobChangeLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const jt={serializedName:"Blob_breakLeaseHeaders",type:{name:"Composite",className:"BlobBreakLeaseHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseTime:{serializedName:"x-ms-lease-time",xmlName:"x-ms-lease-time",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}}}}};const Ht={serializedName:"Blob_breakLeaseExceptionHeaders",type:{name:"Composite",className:"BlobBreakLeaseExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const qt={serializedName:"Blob_createSnapshotHeaders",type:{name:"Composite",className:"BlobCreateSnapshotHeaders",modelProperties:{snapshot:{serializedName:"x-ms-snapshot",xmlName:"x-ms-snapshot",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Gt={serializedName:"Blob_createSnapshotExceptionHeaders",type:{name:"Composite",className:"BlobCreateSnapshotExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const zt={serializedName:"Blob_startCopyFromURLHeaders",type:{name:"Composite",className:"BlobStartCopyFromURLHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Vt={serializedName:"Blob_startCopyFromURLExceptionHeaders",type:{name:"Composite",className:"BlobStartCopyFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Wt={serializedName:"Blob_copyFromURLHeaders",type:{name:"Composite",className:"BlobCopyFromURLHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{defaultValue:"success",isConstant:true,serializedName:"x-ms-copy-status",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Yt={serializedName:"Blob_copyFromURLExceptionHeaders",type:{name:"Composite",className:"BlobCopyFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Jt={serializedName:"Blob_abortCopyFromURLHeaders",type:{name:"Composite",className:"BlobAbortCopyFromURLHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const $t={serializedName:"Blob_abortCopyFromURLExceptionHeaders",type:{name:"Composite",className:"BlobAbortCopyFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Xt={serializedName:"Blob_setTierHeaders",type:{name:"Composite",className:"BlobSetTierHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Kt={serializedName:"Blob_setTierExceptionHeaders",type:{name:"Composite",className:"BlobSetTierExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Zt={serializedName:"Blob_getAccountInfoHeaders",type:{name:"Composite",className:"BlobGetAccountInfoHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",xmlName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",xmlName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2","FileStorage","BlockBlobStorage"]}}}}};const er={serializedName:"Blob_getAccountInfoExceptionHeaders",type:{name:"Composite",className:"BlobGetAccountInfoExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const tr={serializedName:"Blob_queryHeaders",type:{name:"Composite",className:"BlobQueryHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}}},contentLength:{serializedName:"content-length",xmlName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},contentRange:{serializedName:"content-range",xmlName:"content-range",type:{name:"String"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",xmlName:"content-encoding",type:{name:"String"}},cacheControl:{serializedName:"cache-control",xmlName:"cache-control",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",xmlName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",xmlName:"content-language",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"x-ms-blob-type",xmlName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletionTime:{serializedName:"x-ms-copy-completion-time",xmlName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",xmlName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",xmlName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",xmlName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},leaseDuration:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",xmlName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",xmlName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},acceptRanges:{serializedName:"accept-ranges",xmlName:"accept-ranges",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",xmlName:"x-ms-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},blobContentMD5:{serializedName:"x-ms-blob-content-md5",xmlName:"x-ms-blob-content-md5",type:{name:"ByteArray"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}},contentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}}}}};const rr={serializedName:"Blob_queryExceptionHeaders",type:{name:"Composite",className:"BlobQueryExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const nr={serializedName:"Blob_getTagsHeaders",type:{name:"Composite",className:"BlobGetTagsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ir={serializedName:"Blob_getTagsExceptionHeaders",type:{name:"Composite",className:"BlobGetTagsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const sr={serializedName:"Blob_setTagsHeaders",type:{name:"Composite",className:"BlobSetTagsHeaders",modelProperties:{clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ar={serializedName:"Blob_setTagsExceptionHeaders",type:{name:"Composite",className:"BlobSetTagsExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const or={serializedName:"PageBlob_createHeaders",type:{name:"Composite",className:"PageBlobCreateHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const lr={serializedName:"PageBlob_createExceptionHeaders",type:{name:"Composite",className:"PageBlobCreateExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const cr={serializedName:"PageBlob_uploadPagesHeaders",type:{name:"Composite",className:"PageBlobUploadPagesHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const dr={serializedName:"PageBlob_uploadPagesExceptionHeaders",type:{name:"Composite",className:"PageBlobUploadPagesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const pr={serializedName:"PageBlob_clearPagesHeaders",type:{name:"Composite",className:"PageBlobClearPagesHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const ur={serializedName:"PageBlob_clearPagesExceptionHeaders",type:{name:"Composite",className:"PageBlobClearPagesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ar={serializedName:"PageBlob_uploadPagesFromURLHeaders",type:{name:"Composite",className:"PageBlobUploadPagesFromURLHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const fr={serializedName:"PageBlob_uploadPagesFromURLExceptionHeaders",type:{name:"Composite",className:"PageBlobUploadPagesFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const mr={serializedName:"PageBlob_getPageRangesHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",xmlName:"x-ms-blob-content-length",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const hr={serializedName:"PageBlob_getPageRangesExceptionHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const gr={serializedName:"PageBlob_getPageRangesDiffHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesDiffHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",xmlName:"x-ms-blob-content-length",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const yr={serializedName:"PageBlob_getPageRangesDiffExceptionHeaders",type:{name:"Composite",className:"PageBlobGetPageRangesDiffExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const br={serializedName:"PageBlob_resizeHeaders",type:{name:"Composite",className:"PageBlobResizeHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Er={serializedName:"PageBlob_resizeExceptionHeaders",type:{name:"Composite",className:"PageBlobResizeExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const wr={serializedName:"PageBlob_updateSequenceNumberHeaders",type:{name:"Composite",className:"PageBlobUpdateSequenceNumberHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Cr={serializedName:"PageBlob_updateSequenceNumberExceptionHeaders",type:{name:"Composite",className:"PageBlobUpdateSequenceNumberExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const vr={serializedName:"PageBlob_copyIncrementalHeaders",type:{name:"Composite",className:"PageBlobCopyIncrementalHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",xmlName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",xmlName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ir={serializedName:"PageBlob_copyIncrementalExceptionHeaders",type:{name:"Composite",className:"PageBlobCopyIncrementalExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Br={serializedName:"AppendBlob_createHeaders",type:{name:"Composite",className:"AppendBlobCreateHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Sr={serializedName:"AppendBlob_createExceptionHeaders",type:{name:"Composite",className:"AppendBlobCreateExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const xr={serializedName:"AppendBlob_appendBlockHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobAppendOffset:{serializedName:"x-ms-blob-append-offset",xmlName:"x-ms-blob-append-offset",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Rr={serializedName:"AppendBlob_appendBlockExceptionHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Qr={serializedName:"AppendBlob_appendBlockFromUrlHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockFromUrlHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},blobAppendOffset:{serializedName:"x-ms-blob-append-offset",xmlName:"x-ms-blob-append-offset",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",xmlName:"x-ms-blob-committed-block-count",type:{name:"Number"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const _r={serializedName:"AppendBlob_appendBlockFromUrlExceptionHeaders",type:{name:"Composite",className:"AppendBlobAppendBlockFromUrlExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Nr={serializedName:"AppendBlob_sealHeaders",type:{name:"Composite",className:"AppendBlobSealHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isSealed:{serializedName:"x-ms-blob-sealed",xmlName:"x-ms-blob-sealed",type:{name:"Boolean"}}}}};const Tr={serializedName:"AppendBlob_sealExceptionHeaders",type:{name:"Composite",className:"AppendBlobSealExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const kr={serializedName:"BlockBlob_uploadHeaders",type:{name:"Composite",className:"BlockBlobUploadHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Dr={serializedName:"BlockBlob_uploadExceptionHeaders",type:{name:"Composite",className:"BlockBlobUploadExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Pr={serializedName:"BlockBlob_putBlobFromUrlHeaders",type:{name:"Composite",className:"BlockBlobPutBlobFromUrlHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Or={serializedName:"BlockBlob_putBlobFromUrlExceptionHeaders",type:{name:"Composite",className:"BlockBlobPutBlobFromUrlExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Lr={serializedName:"BlockBlob_stageBlockHeaders",type:{name:"Composite",className:"BlockBlobStageBlockHeaders",modelProperties:{contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Mr={serializedName:"BlockBlob_stageBlockExceptionHeaders",type:{name:"Composite",className:"BlockBlobStageBlockExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Fr={serializedName:"BlockBlob_stageBlockFromURLHeaders",type:{name:"Composite",className:"BlockBlobStageBlockFromURLHeaders",modelProperties:{contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Ur={serializedName:"BlockBlob_stageBlockFromURLExceptionHeaders",type:{name:"Composite",className:"BlockBlobStageBlockFromURLExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const jr={serializedName:"BlockBlob_commitBlockListHeaders",type:{name:"Composite",className:"BlockBlobCommitBlockListHeaders",modelProperties:{etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",xmlName:"content-md5",type:{name:"ByteArray"}},xMsContentCrc64:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},versionId:{serializedName:"x-ms-version-id",xmlName:"x-ms-version-id",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",xmlName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},encryptionKeySha256:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}},encryptionScope:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Hr={serializedName:"BlockBlob_commitBlockListExceptionHeaders",type:{name:"Composite",className:"BlockBlobCommitBlockListExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const qr={serializedName:"BlockBlob_getBlockListHeaders",type:{name:"Composite",className:"BlockBlobGetBlockListHeaders",modelProperties:{lastModified:{serializedName:"last-modified",xmlName:"last-modified",type:{name:"DateTimeRfc1123"}},etag:{serializedName:"etag",xmlName:"etag",type:{name:"String"}},contentType:{serializedName:"content-type",xmlName:"content-type",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",xmlName:"x-ms-blob-content-length",type:{name:"Number"}},clientRequestId:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",xmlName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",xmlName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",xmlName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};const Gr={serializedName:"BlockBlob_getBlockListExceptionHeaders",type:{name:"Composite",className:"BlockBlobGetBlockListExceptionHeaders",modelProperties:{errorCode:{serializedName:"x-ms-error-code",xmlName:"x-ms-error-code",type:{name:"String"}}}}};var zr=Object.freeze({__proto__:null,BlobServiceProperties:S,Logging:x,RetentionPolicy:R,Metrics:Q,CorsRule:_,StaticWebsite:N,StorageError:T,BlobServiceStatistics:k,GeoReplication:D,ListContainersSegmentResponse:P,ContainerItem:O,ContainerProperties:L,KeyInfo:M,UserDelegationKey:U,FilterBlobSegment:j,FilterBlobItem:H,BlobTags:q,BlobTag:G,SignedIdentifier:z,AccessPolicy:V,ListBlobsFlatSegmentResponse:W,BlobFlatListSegment:Y,BlobItemInternal:J,BlobName:$,BlobPropertiesInternal:X,ListBlobsHierarchySegmentResponse:K,BlobHierarchyListSegment:Z,BlobPrefix:ee,BlockLookupList:te,BlockList:re,Block:ne,PageList:ie,PageRange:se,ClearRange:ae,QueryRequest:oe,QuerySerialization:le,QueryFormat:ce,DelimitedTextConfiguration:de,JsonTextConfiguration:pe,ArrowConfiguration:ue,ArrowField:Ae,ServiceSetPropertiesHeaders:fe,ServiceSetPropertiesExceptionHeaders:me,ServiceGetPropertiesHeaders:he,ServiceGetPropertiesExceptionHeaders:ge,ServiceGetStatisticsHeaders:ye,ServiceGetStatisticsExceptionHeaders:be,ServiceListContainersSegmentHeaders:Ee,ServiceListContainersSegmentExceptionHeaders:we,ServiceGetUserDelegationKeyHeaders:Ce,ServiceGetUserDelegationKeyExceptionHeaders:ve,ServiceGetAccountInfoHeaders:Ie,ServiceGetAccountInfoExceptionHeaders:Be,ServiceSubmitBatchHeaders:Se,ServiceSubmitBatchExceptionHeaders:xe,ServiceFilterBlobsHeaders:Re,ServiceFilterBlobsExceptionHeaders:Qe,ContainerCreateHeaders:_e,ContainerCreateExceptionHeaders:Ne,ContainerGetPropertiesHeaders:Te,ContainerGetPropertiesExceptionHeaders:ke,ContainerDeleteHeaders:De,ContainerDeleteExceptionHeaders:Pe,ContainerSetMetadataHeaders:Oe,ContainerSetMetadataExceptionHeaders:Le,ContainerGetAccessPolicyHeaders:Me,ContainerGetAccessPolicyExceptionHeaders:Fe,ContainerSetAccessPolicyHeaders:Ue,ContainerSetAccessPolicyExceptionHeaders:je,ContainerRestoreHeaders:He,ContainerRestoreExceptionHeaders:qe,ContainerRenameHeaders:Ge,ContainerRenameExceptionHeaders:ze,ContainerSubmitBatchHeaders:Ve,ContainerSubmitBatchExceptionHeaders:We,ContainerFilterBlobsHeaders:Ye,ContainerFilterBlobsExceptionHeaders:Je,ContainerAcquireLeaseHeaders:$e,ContainerAcquireLeaseExceptionHeaders:Xe,ContainerReleaseLeaseHeaders:Ke,ContainerReleaseLeaseExceptionHeaders:Ze,ContainerRenewLeaseHeaders:et,ContainerRenewLeaseExceptionHeaders:tt,ContainerBreakLeaseHeaders:rt,ContainerBreakLeaseExceptionHeaders:nt,ContainerChangeLeaseHeaders:it,ContainerChangeLeaseExceptionHeaders:st,ContainerListBlobFlatSegmentHeaders:ot,ContainerListBlobFlatSegmentExceptionHeaders:lt,ContainerListBlobHierarchySegmentHeaders:ct,ContainerListBlobHierarchySegmentExceptionHeaders:dt,ContainerGetAccountInfoHeaders:pt,ContainerGetAccountInfoExceptionHeaders:ut,BlobDownloadHeaders:At,BlobDownloadExceptionHeaders:ft,BlobGetPropertiesHeaders:mt,BlobGetPropertiesExceptionHeaders:ht,BlobDeleteHeaders:gt,BlobDeleteExceptionHeaders:yt,BlobUndeleteHeaders:bt,BlobUndeleteExceptionHeaders:Et,BlobSetExpiryHeaders:wt,BlobSetExpiryExceptionHeaders:Ct,BlobSetHttpHeadersHeaders:vt,BlobSetHttpHeadersExceptionHeaders:It,BlobSetImmutabilityPolicyHeaders:Bt,BlobSetImmutabilityPolicyExceptionHeaders:St,BlobDeleteImmutabilityPolicyHeaders:xt,BlobDeleteImmutabilityPolicyExceptionHeaders:Rt,BlobSetLegalHoldHeaders:Qt,BlobSetLegalHoldExceptionHeaders:_t,BlobSetMetadataHeaders:Nt,BlobSetMetadataExceptionHeaders:Tt,BlobAcquireLeaseHeaders:kt,BlobAcquireLeaseExceptionHeaders:Dt,BlobReleaseLeaseHeaders:Pt,BlobReleaseLeaseExceptionHeaders:Ot,BlobRenewLeaseHeaders:Lt,BlobRenewLeaseExceptionHeaders:Mt,BlobChangeLeaseHeaders:Ft,BlobChangeLeaseExceptionHeaders:Ut,BlobBreakLeaseHeaders:jt,BlobBreakLeaseExceptionHeaders:Ht,BlobCreateSnapshotHeaders:qt,BlobCreateSnapshotExceptionHeaders:Gt,BlobStartCopyFromURLHeaders:zt,BlobStartCopyFromURLExceptionHeaders:Vt,BlobCopyFromURLHeaders:Wt,BlobCopyFromURLExceptionHeaders:Yt,BlobAbortCopyFromURLHeaders:Jt,BlobAbortCopyFromURLExceptionHeaders:$t,BlobSetTierHeaders:Xt,BlobSetTierExceptionHeaders:Kt,BlobGetAccountInfoHeaders:Zt,BlobGetAccountInfoExceptionHeaders:er,BlobQueryHeaders:tr,BlobQueryExceptionHeaders:rr,BlobGetTagsHeaders:nr,BlobGetTagsExceptionHeaders:ir,BlobSetTagsHeaders:sr,BlobSetTagsExceptionHeaders:ar,PageBlobCreateHeaders:or,PageBlobCreateExceptionHeaders:lr,PageBlobUploadPagesHeaders:cr,PageBlobUploadPagesExceptionHeaders:dr,PageBlobClearPagesHeaders:pr,PageBlobClearPagesExceptionHeaders:ur,PageBlobUploadPagesFromURLHeaders:Ar,PageBlobUploadPagesFromURLExceptionHeaders:fr,PageBlobGetPageRangesHeaders:mr,PageBlobGetPageRangesExceptionHeaders:hr,PageBlobGetPageRangesDiffHeaders:gr,PageBlobGetPageRangesDiffExceptionHeaders:yr,PageBlobResizeHeaders:br,PageBlobResizeExceptionHeaders:Er,PageBlobUpdateSequenceNumberHeaders:wr,PageBlobUpdateSequenceNumberExceptionHeaders:Cr,PageBlobCopyIncrementalHeaders:vr,PageBlobCopyIncrementalExceptionHeaders:Ir,AppendBlobCreateHeaders:Br,AppendBlobCreateExceptionHeaders:Sr,AppendBlobAppendBlockHeaders:xr,AppendBlobAppendBlockExceptionHeaders:Rr,AppendBlobAppendBlockFromUrlHeaders:Qr,AppendBlobAppendBlockFromUrlExceptionHeaders:_r,AppendBlobSealHeaders:Nr,AppendBlobSealExceptionHeaders:Tr,BlockBlobUploadHeaders:kr,BlockBlobUploadExceptionHeaders:Dr,BlockBlobPutBlobFromUrlHeaders:Pr,BlockBlobPutBlobFromUrlExceptionHeaders:Or,BlockBlobStageBlockHeaders:Lr,BlockBlobStageBlockExceptionHeaders:Mr,BlockBlobStageBlockFromURLHeaders:Fr,BlockBlobStageBlockFromURLExceptionHeaders:Ur,BlockBlobCommitBlockListHeaders:jr,BlockBlobCommitBlockListExceptionHeaders:Hr,BlockBlobGetBlockListHeaders:qr,BlockBlobGetBlockListExceptionHeaders:Gr});const Vr={parameterPath:["options","contentType"],mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Content-Type",type:{name:"String"}}};const Wr={parameterPath:"blobServiceProperties",mapper:S};const Yr={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Accept",type:{name:"String"}}};const Jr={parameterPath:"url",mapper:{serializedName:"url",required:true,xmlName:"url",type:{name:"String"}},skipEncoding:true};const $r={parameterPath:"restype",mapper:{defaultValue:"service",isConstant:true,serializedName:"restype",type:{name:"String"}}};const Xr={parameterPath:"comp",mapper:{defaultValue:"properties",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Kr={parameterPath:["options","timeoutInSeconds"],mapper:{constraints:{InclusiveMinimum:0},serializedName:"timeout",xmlName:"timeout",type:{name:"Number"}}};const Zr={parameterPath:"version",mapper:{defaultValue:"2023-11-03",isConstant:true,serializedName:"x-ms-version",type:{name:"String"}}};const en={parameterPath:["options","requestId"],mapper:{serializedName:"x-ms-client-request-id",xmlName:"x-ms-client-request-id",type:{name:"String"}}};const tn={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Accept",type:{name:"String"}}};const rn={parameterPath:"comp",mapper:{defaultValue:"stats",isConstant:true,serializedName:"comp",type:{name:"String"}}};const nn={parameterPath:"comp",mapper:{defaultValue:"list",isConstant:true,serializedName:"comp",type:{name:"String"}}};const sn={parameterPath:["options","prefix"],mapper:{serializedName:"prefix",xmlName:"prefix",type:{name:"String"}}};const an={parameterPath:["options","marker"],mapper:{serializedName:"marker",xmlName:"marker",type:{name:"String"}}};const ln={parameterPath:["options","maxPageSize"],mapper:{constraints:{InclusiveMinimum:1},serializedName:"maxresults",xmlName:"maxresults",type:{name:"Number"}}};const cn={parameterPath:["options","include"],mapper:{serializedName:"include",xmlName:"include",xmlElementName:"ListContainersIncludeType",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["metadata","deleted","system"]}}}},collectionFormat:a.QueryCollectionFormat.Csv};const dn={parameterPath:"keyInfo",mapper:M};const pn={parameterPath:"comp",mapper:{defaultValue:"userdelegationkey",isConstant:true,serializedName:"comp",type:{name:"String"}}};const un={parameterPath:"restype",mapper:{defaultValue:"account",isConstant:true,serializedName:"restype",type:{name:"String"}}};const An={parameterPath:"body",mapper:{serializedName:"body",required:true,xmlName:"body",type:{name:"Stream"}}};const mn={parameterPath:"comp",mapper:{defaultValue:"batch",isConstant:true,serializedName:"comp",type:{name:"String"}}};const hn={parameterPath:"contentLength",mapper:{serializedName:"Content-Length",required:true,xmlName:"Content-Length",type:{name:"Number"}}};const gn={parameterPath:"multipartContentType",mapper:{serializedName:"Content-Type",required:true,xmlName:"Content-Type",type:{name:"String"}}};const yn={parameterPath:"comp",mapper:{defaultValue:"blobs",isConstant:true,serializedName:"comp",type:{name:"String"}}};const bn={parameterPath:["options","where"],mapper:{serializedName:"where",xmlName:"where",type:{name:"String"}}};const En={parameterPath:"restype",mapper:{defaultValue:"container",isConstant:true,serializedName:"restype",type:{name:"String"}}};const wn={parameterPath:["options","metadata"],mapper:{serializedName:"x-ms-meta",xmlName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"}};const Cn={parameterPath:["options","access"],mapper:{serializedName:"x-ms-blob-public-access",xmlName:"x-ms-blob-public-access",type:{name:"Enum",allowedValues:["container","blob"]}}};const vn={parameterPath:["options","containerEncryptionScope","defaultEncryptionScope"],mapper:{serializedName:"x-ms-default-encryption-scope",xmlName:"x-ms-default-encryption-scope",type:{name:"String"}}};const In={parameterPath:["options","containerEncryptionScope","preventEncryptionScopeOverride"],mapper:{serializedName:"x-ms-deny-encryption-scope-override",xmlName:"x-ms-deny-encryption-scope-override",type:{name:"Boolean"}}};const Bn={parameterPath:["options","leaseAccessConditions","leaseId"],mapper:{serializedName:"x-ms-lease-id",xmlName:"x-ms-lease-id",type:{name:"String"}}};const Sn={parameterPath:["options","modifiedAccessConditions","ifModifiedSince"],mapper:{serializedName:"If-Modified-Since",xmlName:"If-Modified-Since",type:{name:"DateTimeRfc1123"}}};const xn={parameterPath:["options","modifiedAccessConditions","ifUnmodifiedSince"],mapper:{serializedName:"If-Unmodified-Since",xmlName:"If-Unmodified-Since",type:{name:"DateTimeRfc1123"}}};const Rn={parameterPath:"comp",mapper:{defaultValue:"metadata",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Qn={parameterPath:"comp",mapper:{defaultValue:"acl",isConstant:true,serializedName:"comp",type:{name:"String"}}};const _n={parameterPath:["options","containerAcl"],mapper:{serializedName:"containerAcl",xmlName:"SignedIdentifiers",xmlIsWrapped:true,xmlElementName:"SignedIdentifier",type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}}}};const Nn={parameterPath:"comp",mapper:{defaultValue:"undelete",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Tn={parameterPath:["options","deletedContainerName"],mapper:{serializedName:"x-ms-deleted-container-name",xmlName:"x-ms-deleted-container-name",type:{name:"String"}}};const kn={parameterPath:["options","deletedContainerVersion"],mapper:{serializedName:"x-ms-deleted-container-version",xmlName:"x-ms-deleted-container-version",type:{name:"String"}}};const Dn={parameterPath:"comp",mapper:{defaultValue:"rename",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Pn={parameterPath:"sourceContainerName",mapper:{serializedName:"x-ms-source-container-name",required:true,xmlName:"x-ms-source-container-name",type:{name:"String"}}};const On={parameterPath:["options","sourceLeaseId"],mapper:{serializedName:"x-ms-source-lease-id",xmlName:"x-ms-source-lease-id",type:{name:"String"}}};const Ln={parameterPath:"comp",mapper:{defaultValue:"lease",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Mn={parameterPath:"action",mapper:{defaultValue:"acquire",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Fn={parameterPath:["options","duration"],mapper:{serializedName:"x-ms-lease-duration",xmlName:"x-ms-lease-duration",type:{name:"Number"}}};const Un={parameterPath:["options","proposedLeaseId"],mapper:{serializedName:"x-ms-proposed-lease-id",xmlName:"x-ms-proposed-lease-id",type:{name:"String"}}};const jn={parameterPath:"action",mapper:{defaultValue:"release",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Hn={parameterPath:"leaseId",mapper:{serializedName:"x-ms-lease-id",required:true,xmlName:"x-ms-lease-id",type:{name:"String"}}};const qn={parameterPath:"action",mapper:{defaultValue:"renew",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Gn={parameterPath:"action",mapper:{defaultValue:"break",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const zn={parameterPath:["options","breakPeriod"],mapper:{serializedName:"x-ms-lease-break-period",xmlName:"x-ms-lease-break-period",type:{name:"Number"}}};const Vn={parameterPath:"action",mapper:{defaultValue:"change",isConstant:true,serializedName:"x-ms-lease-action",type:{name:"String"}}};const Wn={parameterPath:"proposedLeaseId",mapper:{serializedName:"x-ms-proposed-lease-id",required:true,xmlName:"x-ms-proposed-lease-id",type:{name:"String"}}};const Yn={parameterPath:["options","include"],mapper:{serializedName:"include",xmlName:"include",xmlElementName:"ListBlobsIncludeItem",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["copy","deleted","metadata","snapshots","uncommittedblobs","versions","tags","immutabilitypolicy","legalhold","deletedwithversions"]}}}},collectionFormat:a.QueryCollectionFormat.Csv};const Jn={parameterPath:"delimiter",mapper:{serializedName:"delimiter",required:true,xmlName:"delimiter",type:{name:"String"}}};const $n={parameterPath:["options","snapshot"],mapper:{serializedName:"snapshot",xmlName:"snapshot",type:{name:"String"}}};const Xn={parameterPath:["options","versionId"],mapper:{serializedName:"versionid",xmlName:"versionid",type:{name:"String"}}};const Kn={parameterPath:["options","range"],mapper:{serializedName:"x-ms-range",xmlName:"x-ms-range",type:{name:"String"}}};const Zn={parameterPath:["options","rangeGetContentMD5"],mapper:{serializedName:"x-ms-range-get-content-md5",xmlName:"x-ms-range-get-content-md5",type:{name:"Boolean"}}};const ei={parameterPath:["options","rangeGetContentCRC64"],mapper:{serializedName:"x-ms-range-get-content-crc64",xmlName:"x-ms-range-get-content-crc64",type:{name:"Boolean"}}};const ti={parameterPath:["options","cpkInfo","encryptionKey"],mapper:{serializedName:"x-ms-encryption-key",xmlName:"x-ms-encryption-key",type:{name:"String"}}};const ri={parameterPath:["options","cpkInfo","encryptionKeySha256"],mapper:{serializedName:"x-ms-encryption-key-sha256",xmlName:"x-ms-encryption-key-sha256",type:{name:"String"}}};const ni={parameterPath:["options","cpkInfo","encryptionAlgorithm"],mapper:{serializedName:"x-ms-encryption-algorithm",xmlName:"x-ms-encryption-algorithm",type:{name:"String"}}};const ii={parameterPath:["options","modifiedAccessConditions","ifMatch"],mapper:{serializedName:"If-Match",xmlName:"If-Match",type:{name:"String"}}};const si={parameterPath:["options","modifiedAccessConditions","ifNoneMatch"],mapper:{serializedName:"If-None-Match",xmlName:"If-None-Match",type:{name:"String"}}};const ai={parameterPath:["options","modifiedAccessConditions","ifTags"],mapper:{serializedName:"x-ms-if-tags",xmlName:"x-ms-if-tags",type:{name:"String"}}};const oi={parameterPath:["options","deleteSnapshots"],mapper:{serializedName:"x-ms-delete-snapshots",xmlName:"x-ms-delete-snapshots",type:{name:"Enum",allowedValues:["include","only"]}}};const li={parameterPath:["options","blobDeleteType"],mapper:{serializedName:"deletetype",xmlName:"deletetype",type:{name:"String"}}};const ci={parameterPath:"comp",mapper:{defaultValue:"expiry",isConstant:true,serializedName:"comp",type:{name:"String"}}};const di={parameterPath:"expiryOptions",mapper:{serializedName:"x-ms-expiry-option",required:true,xmlName:"x-ms-expiry-option",type:{name:"String"}}};const pi={parameterPath:["options","expiresOn"],mapper:{serializedName:"x-ms-expiry-time",xmlName:"x-ms-expiry-time",type:{name:"String"}}};const ui={parameterPath:["options","blobHttpHeaders","blobCacheControl"],mapper:{serializedName:"x-ms-blob-cache-control",xmlName:"x-ms-blob-cache-control",type:{name:"String"}}};const Ai={parameterPath:["options","blobHttpHeaders","blobContentType"],mapper:{serializedName:"x-ms-blob-content-type",xmlName:"x-ms-blob-content-type",type:{name:"String"}}};const fi={parameterPath:["options","blobHttpHeaders","blobContentMD5"],mapper:{serializedName:"x-ms-blob-content-md5",xmlName:"x-ms-blob-content-md5",type:{name:"ByteArray"}}};const mi={parameterPath:["options","blobHttpHeaders","blobContentEncoding"],mapper:{serializedName:"x-ms-blob-content-encoding",xmlName:"x-ms-blob-content-encoding",type:{name:"String"}}};const hi={parameterPath:["options","blobHttpHeaders","blobContentLanguage"],mapper:{serializedName:"x-ms-blob-content-language",xmlName:"x-ms-blob-content-language",type:{name:"String"}}};const gi={parameterPath:["options","blobHttpHeaders","blobContentDisposition"],mapper:{serializedName:"x-ms-blob-content-disposition",xmlName:"x-ms-blob-content-disposition",type:{name:"String"}}};const yi={parameterPath:"comp",mapper:{defaultValue:"immutabilityPolicies",isConstant:true,serializedName:"comp",type:{name:"String"}}};const bi={parameterPath:["options","immutabilityPolicyExpiry"],mapper:{serializedName:"x-ms-immutability-policy-until-date",xmlName:"x-ms-immutability-policy-until-date",type:{name:"DateTimeRfc1123"}}};const Ei={parameterPath:["options","immutabilityPolicyMode"],mapper:{serializedName:"x-ms-immutability-policy-mode",xmlName:"x-ms-immutability-policy-mode",type:{name:"Enum",allowedValues:["Mutable","Unlocked","Locked"]}}};const wi={parameterPath:"comp",mapper:{defaultValue:"legalhold",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Ci={parameterPath:"legalHold",mapper:{serializedName:"x-ms-legal-hold",required:true,xmlName:"x-ms-legal-hold",type:{name:"Boolean"}}};const vi={parameterPath:["options","encryptionScope"],mapper:{serializedName:"x-ms-encryption-scope",xmlName:"x-ms-encryption-scope",type:{name:"String"}}};const Ii={parameterPath:"comp",mapper:{defaultValue:"snapshot",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Bi={parameterPath:["options","tier"],mapper:{serializedName:"x-ms-access-tier",xmlName:"x-ms-access-tier",type:{name:"Enum",allowedValues:["P4","P6","P10","P15","P20","P30","P40","P50","P60","P70","P80","Hot","Cool","Archive","Cold"]}}};const Si={parameterPath:["options","rehydratePriority"],mapper:{serializedName:"x-ms-rehydrate-priority",xmlName:"x-ms-rehydrate-priority",type:{name:"Enum",allowedValues:["High","Standard"]}}};const xi={parameterPath:["options","sourceModifiedAccessConditions","sourceIfModifiedSince"],mapper:{serializedName:"x-ms-source-if-modified-since",xmlName:"x-ms-source-if-modified-since",type:{name:"DateTimeRfc1123"}}};const Ri={parameterPath:["options","sourceModifiedAccessConditions","sourceIfUnmodifiedSince"],mapper:{serializedName:"x-ms-source-if-unmodified-since",xmlName:"x-ms-source-if-unmodified-since",type:{name:"DateTimeRfc1123"}}};const Qi={parameterPath:["options","sourceModifiedAccessConditions","sourceIfMatch"],mapper:{serializedName:"x-ms-source-if-match",xmlName:"x-ms-source-if-match",type:{name:"String"}}};const _i={parameterPath:["options","sourceModifiedAccessConditions","sourceIfNoneMatch"],mapper:{serializedName:"x-ms-source-if-none-match",xmlName:"x-ms-source-if-none-match",type:{name:"String"}}};const Ni={parameterPath:["options","sourceModifiedAccessConditions","sourceIfTags"],mapper:{serializedName:"x-ms-source-if-tags",xmlName:"x-ms-source-if-tags",type:{name:"String"}}};const Ti={parameterPath:"copySource",mapper:{serializedName:"x-ms-copy-source",required:true,xmlName:"x-ms-copy-source",type:{name:"String"}}};const ki={parameterPath:["options","blobTagsString"],mapper:{serializedName:"x-ms-tags",xmlName:"x-ms-tags",type:{name:"String"}}};const Di={parameterPath:["options","sealBlob"],mapper:{serializedName:"x-ms-seal-blob",xmlName:"x-ms-seal-blob",type:{name:"Boolean"}}};const Pi={parameterPath:["options","legalHold"],mapper:{serializedName:"x-ms-legal-hold",xmlName:"x-ms-legal-hold",type:{name:"Boolean"}}};const Oi={parameterPath:"xMsRequiresSync",mapper:{defaultValue:"true",isConstant:true,serializedName:"x-ms-requires-sync",type:{name:"String"}}};const Li={parameterPath:["options","sourceContentMD5"],mapper:{serializedName:"x-ms-source-content-md5",xmlName:"x-ms-source-content-md5",type:{name:"ByteArray"}}};const Mi={parameterPath:["options","copySourceAuthorization"],mapper:{serializedName:"x-ms-copy-source-authorization",xmlName:"x-ms-copy-source-authorization",type:{name:"String"}}};const Fi={parameterPath:["options","copySourceTags"],mapper:{serializedName:"x-ms-copy-source-tag-option",xmlName:"x-ms-copy-source-tag-option",type:{name:"Enum",allowedValues:["REPLACE","COPY"]}}};const Ui={parameterPath:"comp",mapper:{defaultValue:"copy",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ji={parameterPath:"copyActionAbortConstant",mapper:{defaultValue:"abort",isConstant:true,serializedName:"x-ms-copy-action",type:{name:"String"}}};const Hi={parameterPath:"copyId",mapper:{serializedName:"copyid",required:true,xmlName:"copyid",type:{name:"String"}}};const qi={parameterPath:"comp",mapper:{defaultValue:"tier",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Gi={parameterPath:"tier",mapper:{serializedName:"x-ms-access-tier",required:true,xmlName:"x-ms-access-tier",type:{name:"Enum",allowedValues:["P4","P6","P10","P15","P20","P30","P40","P50","P60","P70","P80","Hot","Cool","Archive","Cold"]}}};const zi={parameterPath:["options","queryRequest"],mapper:oe};const Vi={parameterPath:"comp",mapper:{defaultValue:"query",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Wi={parameterPath:"comp",mapper:{defaultValue:"tags",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Yi={parameterPath:["options","tags"],mapper:q};const Ji={parameterPath:["options","transactionalContentMD5"],mapper:{serializedName:"Content-MD5",xmlName:"Content-MD5",type:{name:"ByteArray"}}};const $i={parameterPath:["options","transactionalContentCrc64"],mapper:{serializedName:"x-ms-content-crc64",xmlName:"x-ms-content-crc64",type:{name:"ByteArray"}}};const Xi={parameterPath:"blobType",mapper:{defaultValue:"PageBlob",isConstant:true,serializedName:"x-ms-blob-type",type:{name:"String"}}};const Ki={parameterPath:"blobContentLength",mapper:{serializedName:"x-ms-blob-content-length",required:true,xmlName:"x-ms-blob-content-length",type:{name:"Number"}}};const Zi={parameterPath:["options","blobSequenceNumber"],mapper:{serializedName:"x-ms-blob-sequence-number",xmlName:"x-ms-blob-sequence-number",type:{name:"Number"}}};const es={parameterPath:["options","contentType"],mapper:{defaultValue:"application/octet-stream",isConstant:true,serializedName:"Content-Type",type:{name:"String"}}};const ts={parameterPath:"body",mapper:{serializedName:"body",required:true,xmlName:"body",type:{name:"Stream"}}};const rs={parameterPath:"accept",mapper:{defaultValue:"application/xml",isConstant:true,serializedName:"Accept",type:{name:"String"}}};const ns={parameterPath:"comp",mapper:{defaultValue:"page",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ss={parameterPath:"pageWrite",mapper:{defaultValue:"update",isConstant:true,serializedName:"x-ms-page-write",type:{name:"String"}}};const as={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberLessThanOrEqualTo"],mapper:{serializedName:"x-ms-if-sequence-number-le",xmlName:"x-ms-if-sequence-number-le",type:{name:"Number"}}};const os={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberLessThan"],mapper:{serializedName:"x-ms-if-sequence-number-lt",xmlName:"x-ms-if-sequence-number-lt",type:{name:"Number"}}};const ls={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberEqualTo"],mapper:{serializedName:"x-ms-if-sequence-number-eq",xmlName:"x-ms-if-sequence-number-eq",type:{name:"Number"}}};const cs={parameterPath:"pageWrite",mapper:{defaultValue:"clear",isConstant:true,serializedName:"x-ms-page-write",type:{name:"String"}}};const ds={parameterPath:"sourceUrl",mapper:{serializedName:"x-ms-copy-source",required:true,xmlName:"x-ms-copy-source",type:{name:"String"}}};const ps={parameterPath:"sourceRange",mapper:{serializedName:"x-ms-source-range",required:true,xmlName:"x-ms-source-range",type:{name:"String"}}};const us={parameterPath:["options","sourceContentCrc64"],mapper:{serializedName:"x-ms-source-content-crc64",xmlName:"x-ms-source-content-crc64",type:{name:"ByteArray"}}};const As={parameterPath:"range",mapper:{serializedName:"x-ms-range",required:true,xmlName:"x-ms-range",type:{name:"String"}}};const fs={parameterPath:"comp",mapper:{defaultValue:"pagelist",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ms={parameterPath:["options","prevsnapshot"],mapper:{serializedName:"prevsnapshot",xmlName:"prevsnapshot",type:{name:"String"}}};const hs={parameterPath:["options","prevSnapshotUrl"],mapper:{serializedName:"x-ms-previous-snapshot-url",xmlName:"x-ms-previous-snapshot-url",type:{name:"String"}}};const gs={parameterPath:"sequenceNumberAction",mapper:{serializedName:"x-ms-sequence-number-action",required:true,xmlName:"x-ms-sequence-number-action",type:{name:"Enum",allowedValues:["max","update","increment"]}}};const ys={parameterPath:"comp",mapper:{defaultValue:"incrementalcopy",isConstant:true,serializedName:"comp",type:{name:"String"}}};const bs={parameterPath:"blobType",mapper:{defaultValue:"AppendBlob",isConstant:true,serializedName:"x-ms-blob-type",type:{name:"String"}}};const Es={parameterPath:"comp",mapper:{defaultValue:"appendblock",isConstant:true,serializedName:"comp",type:{name:"String"}}};const ws={parameterPath:["options","appendPositionAccessConditions","maxSize"],mapper:{serializedName:"x-ms-blob-condition-maxsize",xmlName:"x-ms-blob-condition-maxsize",type:{name:"Number"}}};const Cs={parameterPath:["options","appendPositionAccessConditions","appendPosition"],mapper:{serializedName:"x-ms-blob-condition-appendpos",xmlName:"x-ms-blob-condition-appendpos",type:{name:"Number"}}};const vs={parameterPath:["options","sourceRange"],mapper:{serializedName:"x-ms-source-range",xmlName:"x-ms-source-range",type:{name:"String"}}};const Is={parameterPath:"comp",mapper:{defaultValue:"seal",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Bs={parameterPath:"blobType",mapper:{defaultValue:"BlockBlob",isConstant:true,serializedName:"x-ms-blob-type",type:{name:"String"}}};const Ss={parameterPath:["options","copySourceBlobProperties"],mapper:{serializedName:"x-ms-copy-source-blob-properties",xmlName:"x-ms-copy-source-blob-properties",type:{name:"Boolean"}}};const xs={parameterPath:"comp",mapper:{defaultValue:"block",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Rs={parameterPath:"blockId",mapper:{serializedName:"blockid",required:true,xmlName:"blockid",type:{name:"String"}}};const Qs={parameterPath:"blocks",mapper:te};const _s={parameterPath:"comp",mapper:{defaultValue:"blocklist",isConstant:true,serializedName:"comp",type:{name:"String"}}};const Ns={parameterPath:"listType",mapper:{defaultValue:"committed",serializedName:"blocklisttype",required:true,xmlName:"blocklisttype",type:{name:"Enum",allowedValues:["committed","uncommitted","all"]}}};class Service{constructor(r){this.client=r}setProperties(r,i){const s={blobServiceProperties:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ks)}getProperties(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ds)}getStatistics(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ps)}listContainersSegment(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Os)}getUserDelegationKey(r,i){const s={keyInfo:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Ls)}getAccountInfo(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ms)}submitBatch(r,i,s,a){const l={contentLength:r,multipartContentType:i,body:s,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(l,Fs)}filterBlobs(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Us)}}const Ts=new C.Serializer(zr,true);const ks={path:"/",httpMethod:"PUT",responses:{202:{headersMapper:fe},default:{bodyMapper:T,headersMapper:me}},requestBody:Wr,queryParameters:[$r,Xr,Kr],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ts};const Ds={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:S,headersMapper:he},default:{bodyMapper:T,headersMapper:ge}},queryParameters:[$r,Xr,Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:Ts};const Ps={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:k,headersMapper:ye},default:{bodyMapper:T,headersMapper:be}},queryParameters:[$r,Kr,rn],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:Ts};const Os={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:P,headersMapper:Ee},default:{bodyMapper:T,headersMapper:we}},queryParameters:[Kr,nn,sn,an,ln,cn],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:Ts};const Ls={path:"/",httpMethod:"POST",responses:{200:{bodyMapper:U,headersMapper:Ce},default:{bodyMapper:T,headersMapper:ve}},requestBody:dn,queryParameters:[$r,Kr,pn],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ts};const Ms={path:"/",httpMethod:"GET",responses:{200:{headersMapper:Ie},default:{bodyMapper:T,headersMapper:Be}},queryParameters:[Xr,un],urlParameters:[Jr],headerParameters:[Zr,tn],isXML:true,serializer:Ts};const Fs={path:"/",httpMethod:"POST",responses:{202:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:Se},default:{bodyMapper:T,headersMapper:xe}},requestBody:An,queryParameters:[Kr,mn],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en,hn,gn],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ts};const Us={path:"/",httpMethod:"GET",responses:{200:{bodyMapper:j,headersMapper:Re},default:{bodyMapper:T,headersMapper:Qe}},queryParameters:[Kr,an,ln,yn,bn],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:Ts};class Container{constructor(r){this.client=r}create(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Hs)}getProperties(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,qs)}delete(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Gs)}setMetadata(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,zs)}getAccessPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Vs)}setAccessPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ws)}restore(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ys)}rename(r,i){const s={sourceContainerName:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Js)}submitBatch(r,i,s,a){const l={contentLength:r,multipartContentType:i,body:s,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(l,$s)}filterBlobs(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Xs)}acquireLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ks)}releaseLease(r,i){const s={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Zs)}renewLease(r,i){const s={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ea)}breakLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ta)}changeLease(r,i,s){const a={leaseId:r,proposedLeaseId:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,ra)}listBlobFlatSegment(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,na)}listBlobHierarchySegment(r,i){const s={delimiter:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ia)}getAccountInfo(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,sa)}}const js=new C.Serializer(zr,true);const Hs={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:_e},default:{bodyMapper:T,headersMapper:Ne}},queryParameters:[Kr,En],urlParameters:[Jr],headerParameters:[Zr,en,tn,wn,Cn,vn,In],isXML:true,serializer:js};const qs={path:"/{containerName}",httpMethod:"GET",responses:{200:{headersMapper:Te},default:{bodyMapper:T,headersMapper:ke}},queryParameters:[Kr,En],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn],isXML:true,serializer:js};const Gs={path:"/{containerName}",httpMethod:"DELETE",responses:{202:{headersMapper:De},default:{bodyMapper:T,headersMapper:Pe}},queryParameters:[Kr,En],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn],isXML:true,serializer:js};const zs={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Oe},default:{bodyMapper:T,headersMapper:Le}},queryParameters:[Kr,En,Rn],urlParameters:[Jr],headerParameters:[Zr,en,tn,wn,Bn,Sn],isXML:true,serializer:js};const Vs={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}},serializedName:"SignedIdentifiers",xmlName:"SignedIdentifiers",xmlIsWrapped:true,xmlElementName:"SignedIdentifier"},headersMapper:Me},default:{bodyMapper:T,headersMapper:Fe}},queryParameters:[Kr,En,Qn],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn],isXML:true,serializer:js};const Ws={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Ue},default:{bodyMapper:T,headersMapper:je}},requestBody:_n,queryParameters:[Kr,En,Qn],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en,Cn,Bn,Sn,xn],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:js};const Ys={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:He},default:{bodyMapper:T,headersMapper:qe}},queryParameters:[Kr,En,Nn],urlParameters:[Jr],headerParameters:[Zr,en,tn,Tn,kn],isXML:true,serializer:js};const Js={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Ge},default:{bodyMapper:T,headersMapper:ze}},queryParameters:[Kr,En,Dn],urlParameters:[Jr],headerParameters:[Zr,en,tn,Pn,On],isXML:true,serializer:js};const $s={path:"/{containerName}",httpMethod:"POST",responses:{202:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:Ve},default:{bodyMapper:T,headersMapper:We}},requestBody:An,queryParameters:[Kr,mn,En],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en,hn,gn],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:js};const Xs={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:j,headersMapper:Ye},default:{bodyMapper:T,headersMapper:Je}},queryParameters:[Kr,an,ln,yn,bn,En],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:js};const Ks={path:"/{containerName}",httpMethod:"PUT",responses:{201:{headersMapper:$e},default:{bodyMapper:T,headersMapper:Xe}},queryParameters:[Kr,En,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Mn,Fn,Un],isXML:true,serializer:js};const Zs={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:Ke},default:{bodyMapper:T,headersMapper:Ze}},queryParameters:[Kr,En,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,jn,Hn],isXML:true,serializer:js};const ea={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:et},default:{bodyMapper:T,headersMapper:tt}},queryParameters:[Kr,En,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Hn,qn],isXML:true,serializer:js};const ta={path:"/{containerName}",httpMethod:"PUT",responses:{202:{headersMapper:rt},default:{bodyMapper:T,headersMapper:nt}},queryParameters:[Kr,En,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Gn,zn],isXML:true,serializer:js};const ra={path:"/{containerName}",httpMethod:"PUT",responses:{200:{headersMapper:it},default:{bodyMapper:T,headersMapper:st}},queryParameters:[Kr,En,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Hn,Vn,Wn],isXML:true,serializer:js};const na={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:W,headersMapper:ot},default:{bodyMapper:T,headersMapper:lt}},queryParameters:[Kr,nn,sn,an,ln,En,Yn],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:js};const ia={path:"/{containerName}",httpMethod:"GET",responses:{200:{bodyMapper:K,headersMapper:ct},default:{bodyMapper:T,headersMapper:dt}},queryParameters:[Kr,nn,sn,an,ln,En,Yn,Jn],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:js};const sa={path:"/{containerName}",httpMethod:"GET",responses:{200:{headersMapper:pt},default:{bodyMapper:T,headersMapper:ut}},queryParameters:[Xr,un],urlParameters:[Jr],headerParameters:[Zr,tn],isXML:true,serializer:js};class Blob$1{constructor(r){this.client=r}download(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,oa)}getProperties(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,la)}delete(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ca)}undelete(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,da)}setExpiry(r,i){const s={expiryOptions:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,pa)}setHttpHeaders(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ua)}setImmutabilityPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Aa)}deleteImmutabilityPolicy(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,fa)}setLegalHold(r,i){const s={legalHold:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ma)}setMetadata(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ha)}acquireLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,ga)}releaseLease(r,i){const s={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ya)}renewLease(r,i){const s={leaseId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ba)}changeLease(r,i,s){const a={leaseId:r,proposedLeaseId:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,Ea)}breakLease(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,wa)}createSnapshot(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ca)}startCopyFromURL(r,i){const s={copySource:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,va)}copyFromURL(r,i){const s={copySource:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Ia)}abortCopyFromURL(r,i){const s={copyId:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Ba)}setTier(r,i){const s={tier:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Sa)}getAccountInfo(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,xa)}query(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ra)}getTags(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Qa)}setTags(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,_a)}}const aa=new C.Serializer(zr,true);const oa={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:At},206:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:At},default:{bodyMapper:T,headersMapper:ft}},queryParameters:[Kr,$n,Xn],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,Kn,Zn,ei,ti,ri,ni,ii,si,ai],isXML:true,serializer:aa};const la={path:"/{containerName}/{blob}",httpMethod:"HEAD",responses:{200:{headersMapper:mt},default:{bodyMapper:T,headersMapper:ht}},queryParameters:[Kr,$n,Xn],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,ti,ri,ni,ii,si,ai],isXML:true,serializer:aa};const ca={path:"/{containerName}/{blob}",httpMethod:"DELETE",responses:{202:{headersMapper:gt},default:{bodyMapper:T,headersMapper:yt}},queryParameters:[Kr,$n,Xn,li],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,ii,si,ai,oi],isXML:true,serializer:aa};const da={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:bt},default:{bodyMapper:T,headersMapper:Et}},queryParameters:[Kr,Nn],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:aa};const pa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:wt},default:{bodyMapper:T,headersMapper:Ct}},queryParameters:[Kr,ci],urlParameters:[Jr],headerParameters:[Zr,en,tn,di,pi],isXML:true,serializer:aa};const ua={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:vt},default:{bodyMapper:T,headersMapper:It}},queryParameters:[Xr,Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,ii,si,ai,ui,Ai,fi,mi,hi,gi],isXML:true,serializer:aa};const Aa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Bt},default:{bodyMapper:T,headersMapper:St}},queryParameters:[Kr,yi],urlParameters:[Jr],headerParameters:[Zr,en,tn,xn,bi,Ei],isXML:true,serializer:aa};const fa={path:"/{containerName}/{blob}",httpMethod:"DELETE",responses:{200:{headersMapper:xt},default:{bodyMapper:T,headersMapper:Rt}},queryParameters:[Kr,yi],urlParameters:[Jr],headerParameters:[Zr,en,tn],isXML:true,serializer:aa};const ma={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Qt},default:{bodyMapper:T,headersMapper:_t}},queryParameters:[Kr,wi],urlParameters:[Jr],headerParameters:[Zr,en,tn,Ci],isXML:true,serializer:aa};const ha={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Nt},default:{bodyMapper:T,headersMapper:Tt}},queryParameters:[Kr,Rn],urlParameters:[Jr],headerParameters:[Zr,en,tn,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,vi],isXML:true,serializer:aa};const ga={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:kt},default:{bodyMapper:T,headersMapper:Dt}},queryParameters:[Kr,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Mn,Fn,Un,ii,si,ai],isXML:true,serializer:aa};const ya={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Pt},default:{bodyMapper:T,headersMapper:Ot}},queryParameters:[Kr,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,jn,Hn,ii,si,ai],isXML:true,serializer:aa};const ba={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Lt},default:{bodyMapper:T,headersMapper:Mt}},queryParameters:[Kr,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Hn,qn,ii,si,ai],isXML:true,serializer:aa};const Ea={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Ft},default:{bodyMapper:T,headersMapper:Ut}},queryParameters:[Kr,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Hn,Vn,Wn,ii,si,ai],isXML:true,serializer:aa};const wa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:jt},default:{bodyMapper:T,headersMapper:Ht}},queryParameters:[Kr,Ln],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,Gn,zn,ii,si,ai],isXML:true,serializer:aa};const Ca={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:qt},default:{bodyMapper:T,headersMapper:Gt}},queryParameters:[Kr,Ii],urlParameters:[Jr],headerParameters:[Zr,en,tn,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,vi],isXML:true,serializer:aa};const va={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:zt},default:{bodyMapper:T,headersMapper:Vt}},queryParameters:[Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,wn,Bn,Sn,xn,ii,si,ai,bi,Ei,Bi,Si,xi,Ri,Qi,_i,Ni,Ti,ki,Di,Pi],isXML:true,serializer:aa};const Ia={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:Wt},default:{bodyMapper:T,headersMapper:Yt}},queryParameters:[Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,wn,Bn,Sn,xn,ii,si,ai,bi,Ei,vi,Bi,xi,Ri,Qi,_i,Ti,ki,Pi,Oi,Li,Mi,Fi],isXML:true,serializer:aa};const Ba={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{204:{headersMapper:Jt},default:{bodyMapper:T,headersMapper:$t}},queryParameters:[Kr,Ui,Hi],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,ji],isXML:true,serializer:aa};const Sa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Xt},202:{headersMapper:Xt},default:{bodyMapper:T,headersMapper:Kt}},queryParameters:[Kr,$n,Xn,qi],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,ai,Si,Gi],isXML:true,serializer:aa};const xa={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{headersMapper:Zt},default:{bodyMapper:T,headersMapper:er}},queryParameters:[Xr,un],urlParameters:[Jr],headerParameters:[Zr,tn],isXML:true,serializer:aa};const Ra={path:"/{containerName}/{blob}",httpMethod:"POST",responses:{200:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:tr},206:{bodyMapper:{type:{name:"Stream"},serializedName:"parsedResponse"},headersMapper:tr},default:{bodyMapper:T,headersMapper:rr}},requestBody:zi,queryParameters:[Kr,$n,Vi],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en,Bn,Sn,xn,ti,ri,ni,ii,si,ai],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:aa};const Qa={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:q,headersMapper:nr},default:{bodyMapper:T,headersMapper:ir}},queryParameters:[Kr,$n,Xn,Wi],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,ai],isXML:true,serializer:aa};const _a={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{204:{headersMapper:sr},default:{bodyMapper:T,headersMapper:ar}},requestBody:Yi,queryParameters:[Kr,Xn,Wi],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en,Bn,ai,Ji,$i],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:aa};class PageBlob{constructor(r){this.client=r}create(r,i,s){const a={contentLength:r,blobContentLength:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,ka)}uploadPages(r,i,s){const a={contentLength:r,body:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,Da)}clearPages(r,i){const s={contentLength:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Pa)}uploadPagesFromURL(r,i,s,a,l){const c={sourceUrl:r,sourceRange:i,contentLength:s,range:a,options:C.operationOptionsToRequestOptionsBase(l||{})};return this.client.sendOperationRequest(c,Oa)}getPageRanges(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,La)}getPageRangesDiff(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Ma)}resize(r,i){const s={blobContentLength:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Fa)}updateSequenceNumber(r,i){const s={sequenceNumberAction:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Ua)}copyIncremental(r,i){const s={copySource:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,ja)}}const Na=new C.Serializer(zr,true);const Ta=new C.Serializer(zr,false);const ka={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:or},default:{bodyMapper:T,headersMapper:lr}},queryParameters:[Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,ui,Ai,fi,mi,hi,gi,bi,Ei,vi,Bi,ki,Pi,Xi,Ki,Zi],isXML:true,serializer:Na};const Da={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:cr},default:{bodyMapper:T,headersMapper:dr}},requestBody:ts,queryParameters:[Kr,ns],urlParameters:[Jr],headerParameters:[Zr,en,hn,Bn,Sn,xn,Kn,ti,ri,ni,ii,si,ai,vi,Ji,$i,es,rs,ss,as,os,ls],mediaType:"binary",serializer:Ta};const Pa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:pr},default:{bodyMapper:T,headersMapper:ur}},queryParameters:[Kr,ns],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,Bn,Sn,xn,Kn,ti,ri,ni,ii,si,ai,vi,as,os,ls,cs],isXML:true,serializer:Na};const Oa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Ar},default:{bodyMapper:T,headersMapper:fr}},queryParameters:[Kr,ns],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,vi,xi,Ri,Qi,_i,Li,Mi,ss,as,os,ls,ds,ps,us,As],isXML:true,serializer:Na};const La={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:ie,headersMapper:mr},default:{bodyMapper:T,headersMapper:hr}},queryParameters:[Kr,an,ln,$n,fs],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,Kn,ii,si,ai],isXML:true,serializer:Na};const Ma={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:ie,headersMapper:gr},default:{bodyMapper:T,headersMapper:yr}},queryParameters:[Kr,an,ln,$n,fs,ms],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,Kn,ii,si,ai,hs],isXML:true,serializer:Na};const Fa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:br},default:{bodyMapper:T,headersMapper:Er}},queryParameters:[Xr,Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,vi,Ki],isXML:true,serializer:Na};const Ua={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:wr},default:{bodyMapper:T,headersMapper:Cr}},queryParameters:[Xr,Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,ii,si,ai,Zi,gs],isXML:true,serializer:Na};const ja={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{202:{headersMapper:vr},default:{bodyMapper:T,headersMapper:Ir}},queryParameters:[Kr,ys],urlParameters:[Jr],headerParameters:[Zr,en,tn,Sn,xn,ii,si,ai,Ti],isXML:true,serializer:Na};class AppendBlob{constructor(r){this.client=r}create(r,i){const s={contentLength:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,Ga)}appendBlock(r,i,s){const a={contentLength:r,body:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,za)}appendBlockFromUrl(r,i,s){const a={sourceUrl:r,contentLength:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,Va)}seal(r){const i={options:C.operationOptionsToRequestOptionsBase(r||{})};return this.client.sendOperationRequest(i,Wa)}}const Ha=new C.Serializer(zr,true);const qa=new C.Serializer(zr,false);const Ga={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Br},default:{bodyMapper:T,headersMapper:Sr}},queryParameters:[Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,ui,Ai,fi,mi,hi,gi,bi,Ei,vi,ki,Pi,bs],isXML:true,serializer:Ha};const za={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:xr},default:{bodyMapper:T,headersMapper:Rr}},requestBody:ts,queryParameters:[Kr,Es],urlParameters:[Jr],headerParameters:[Zr,en,hn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,vi,Ji,$i,es,rs,ws,Cs],mediaType:"binary",serializer:qa};const Va={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Qr},default:{bodyMapper:T,headersMapper:_r}},queryParameters:[Kr,Es],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,vi,xi,Ri,Qi,_i,Li,Mi,Ji,ds,us,ws,Cs,vs],isXML:true,serializer:Ha};const Wa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{200:{headersMapper:Nr},default:{bodyMapper:T,headersMapper:Tr}},queryParameters:[Kr,Is],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,Sn,xn,ii,si,Cs],isXML:true,serializer:Ha};class BlockBlob{constructor(r){this.client=r}upload(r,i,s){const a={contentLength:r,body:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,$a)}putBlobFromUrl(r,i,s){const a={contentLength:r,copySource:i,options:C.operationOptionsToRequestOptionsBase(s||{})};return this.client.sendOperationRequest(a,Xa)}stageBlock(r,i,s,a){const l={blockId:r,contentLength:i,body:s,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(l,Ka)}stageBlockFromURL(r,i,s,a){const l={blockId:r,contentLength:i,sourceUrl:s,options:C.operationOptionsToRequestOptionsBase(a||{})};return this.client.sendOperationRequest(l,Za)}commitBlockList(r,i){const s={blocks:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,eo)}getBlockList(r,i){const s={listType:r,options:C.operationOptionsToRequestOptionsBase(i||{})};return this.client.sendOperationRequest(s,to)}}const Ya=new C.Serializer(zr,true);const Ja=new C.Serializer(zr,false);const $a={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:kr},default:{bodyMapper:T,headersMapper:Dr}},requestBody:ts,queryParameters:[Kr],urlParameters:[Jr],headerParameters:[Zr,en,hn,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,ui,Ai,fi,mi,hi,gi,bi,Ei,vi,Bi,ki,Pi,Ji,$i,es,rs,Bs],mediaType:"binary",serializer:Ja};const Xa={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Pr},default:{bodyMapper:T,headersMapper:Or}},queryParameters:[Kr],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,ui,Ai,fi,mi,hi,gi,vi,Bi,xi,Ri,Qi,_i,Ni,Ti,ki,Li,Mi,Fi,Ji,Bs,Ss],isXML:true,serializer:Ya};const Ka={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Lr},default:{bodyMapper:T,headersMapper:Mr}},requestBody:ts,queryParameters:[Kr,xs,Rs],urlParameters:[Jr],headerParameters:[Zr,en,hn,Bn,ti,ri,ni,vi,Ji,$i,es,rs],mediaType:"binary",serializer:Ja};const Za={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:Fr},default:{bodyMapper:T,headersMapper:Ur}},queryParameters:[Kr,xs,Rs],urlParameters:[Jr],headerParameters:[Zr,en,tn,hn,Bn,ti,ri,ni,vi,xi,Ri,Qi,_i,Li,Mi,ds,us,vs],isXML:true,serializer:Ya};const eo={path:"/{containerName}/{blob}",httpMethod:"PUT",responses:{201:{headersMapper:jr},default:{bodyMapper:T,headersMapper:Hr}},requestBody:Qs,queryParameters:[Kr,_s],urlParameters:[Jr],headerParameters:[Vr,Yr,Zr,en,wn,Bn,Sn,xn,ti,ri,ni,ii,si,ai,ui,Ai,fi,mi,hi,gi,bi,Ei,vi,Bi,ki,Pi,Ji,$i],isXML:true,contentType:"application/xml; charset=utf-8",mediaType:"xml",serializer:Ya};const to={path:"/{containerName}/{blob}",httpMethod:"GET",responses:{200:{bodyMapper:re,headersMapper:qr},default:{bodyMapper:T,headersMapper:Gr}},queryParameters:[Kr,$n,_s,Ns],urlParameters:[Jr],headerParameters:[Zr,en,tn,Bn,ai],isXML:true,serializer:Ya};const ro=d.createClientLogger("storage-blob");const no="12.17.0";const io="2023-11-03";const so=256*1024*1024;const ao=4e3*1024*1024;const oo=5e4;const lo=8*1024*1024;const co=4*1024*1024;const po=5;const uo=100*1e3;const Ao="https://storage.azure.com/.default";const fo={Parameters:{FORCE_BROWSER_NO_CACHE:"_",SIGNATURE:"sig",SNAPSHOT:"snapshot",VERSIONID:"versionid",TIMEOUT:"timeout"}};const mo={HTTP_ACCEPTED:202,HTTP_CONFLICT:409,HTTP_NOT_FOUND:404,HTTP_PRECON_FAILED:412,HTTP_RANGE_NOT_SATISFIABLE:416};const ho={AUTHORIZATION:"Authorization",AUTHORIZATION_SCHEME:"Bearer",CONTENT_ENCODING:"Content-Encoding",CONTENT_ID:"Content-ID",CONTENT_LANGUAGE:"Content-Language",CONTENT_LENGTH:"Content-Length",CONTENT_MD5:"Content-Md5",CONTENT_TRANSFER_ENCODING:"Content-Transfer-Encoding",CONTENT_TYPE:"Content-Type",COOKIE:"Cookie",DATE:"date",IF_MATCH:"if-match",IF_MODIFIED_SINCE:"if-modified-since",IF_NONE_MATCH:"if-none-match",IF_UNMODIFIED_SINCE:"if-unmodified-since",PREFIX_FOR_STORAGE:"x-ms-",RANGE:"Range",USER_AGENT:"User-Agent",X_MS_CLIENT_REQUEST_ID:"x-ms-client-request-id",X_MS_COPY_SOURCE:"x-ms-copy-source",X_MS_DATE:"x-ms-date",X_MS_ERROR_CODE:"x-ms-error-code",X_MS_VERSION:"x-ms-version"};const go="";const yo="*";const bo=1*1024*1024;const Eo=256;const wo=4*bo;const Co="\r\n";const vo="HTTP/1.1";const Io="AES256";const Bo=`DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;const So=["Access-Control-Allow-Origin","Cache-Control","Content-Length","Content-Type","Date","Request-Id","traceparent","Transfer-Encoding","User-Agent","x-ms-client-request-id","x-ms-date","x-ms-error-code","x-ms-request-id","x-ms-return-client-request-id","x-ms-version","Accept-Ranges","Content-Disposition","Content-Encoding","Content-Language","Content-MD5","Content-Range","ETag","Last-Modified","Server","Vary","x-ms-content-crc64","x-ms-copy-action","x-ms-copy-completion-time","x-ms-copy-id","x-ms-copy-progress","x-ms-copy-status","x-ms-has-immutability-policy","x-ms-has-legal-hold","x-ms-lease-state","x-ms-lease-status","x-ms-range","x-ms-request-server-encrypted","x-ms-server-encrypted","x-ms-snapshot","x-ms-source-range","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","x-ms-access-tier","x-ms-access-tier-change-time","x-ms-access-tier-inferred","x-ms-account-kind","x-ms-archive-status","x-ms-blob-append-offset","x-ms-blob-cache-control","x-ms-blob-committed-block-count","x-ms-blob-condition-appendpos","x-ms-blob-condition-maxsize","x-ms-blob-content-disposition","x-ms-blob-content-encoding","x-ms-blob-content-language","x-ms-blob-content-length","x-ms-blob-content-md5","x-ms-blob-content-type","x-ms-blob-public-access","x-ms-blob-sequence-number","x-ms-blob-type","x-ms-copy-destination-snapshot","x-ms-creation-time","x-ms-default-encryption-scope","x-ms-delete-snapshots","x-ms-delete-type-permanent","x-ms-deny-encryption-scope-override","x-ms-encryption-algorithm","x-ms-if-sequence-number-eq","x-ms-if-sequence-number-le","x-ms-if-sequence-number-lt","x-ms-incremental-copy","x-ms-lease-action","x-ms-lease-break-period","x-ms-lease-duration","x-ms-lease-id","x-ms-lease-time","x-ms-page-write","x-ms-proposed-lease-id","x-ms-range-get-content-md5","x-ms-rehydrate-priority","x-ms-sequence-number-action","x-ms-sku-name","x-ms-source-content-md5","x-ms-source-if-match","x-ms-source-if-modified-since","x-ms-source-if-none-match","x-ms-source-if-unmodified-since","x-ms-tag-count","x-ms-encryption-key-sha256","x-ms-if-tags","x-ms-source-if-tags"];const xo=["comp","maxresults","rscc","rscd","rsce","rscl","rsct","se","si","sip","sp","spr","sr","srt","ss","st","sv","include","marker","prefix","copyid","restype","blockid","blocklisttype","delimiter","prevsnapshot","ske","skoid","sks","skt","sktid","skv","snapshot"];const Ro="BlobUsesCustomerSpecifiedEncryption";const Qo="BlobDoesNotUseCustomerSpecifiedEncryption";const _o=["10000","10001","10002","10003","10004","10100","10101","10102","10103","10104","11000","11001","11002","11003","11004","11100","11101","11102","11103","11104"];function escapeURLPath(r){const i=a.URLBuilder.parse(r);let s=i.getPath();s=s||"/";s=escape(s);i.setPath(s);return i.toString()}function getProxyUriFromDevConnString(r){let i="";if(r.search("DevelopmentStorageProxyUri=")!==-1){const s=r.split(";");for(const r of s){if(r.trim().startsWith("DevelopmentStorageProxyUri=")){i=r.trim().match("DevelopmentStorageProxyUri=(.*)")[1]}}}return i}function getValueInConnString(r,i){const s=r.split(";");for(const r of s){if(r.trim().startsWith(i)){return r.trim().match(i+"=(.*)")[1]}}return""}function extractConnectionStringParts(r){let i="";if(r.startsWith("UseDevelopmentStorage=true")){i=getProxyUriFromDevConnString(r);r=Bo}let s=getValueInConnString(r,"BlobEndpoint");s=s.endsWith("/")?s.slice(0,-1):s;if(r.search("DefaultEndpointsProtocol=")!==-1&&r.search("AccountKey=")!==-1){let a="";let l="";let c=Buffer.from("accountKey","base64");let d="";l=getValueInConnString(r,"AccountName");c=Buffer.from(getValueInConnString(r,"AccountKey"),"base64");if(!s){a=getValueInConnString(r,"DefaultEndpointsProtocol");const i=a.toLowerCase();if(i!=="https"&&i!=="http"){throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'")}d=getValueInConnString(r,"EndpointSuffix");if(!d){throw new Error("Invalid EndpointSuffix in the provided Connection String")}s=`${a}://${l}.blob.${d}`}if(!l){throw new Error("Invalid AccountName in the provided Connection String")}else if(c.length===0){throw new Error("Invalid AccountKey in the provided Connection String")}return{kind:"AccountConnString",url:s,accountName:l,accountKey:c,proxyUri:i}}else{const i=getValueInConnString(r,"SharedAccessSignature");let a=getValueInConnString(r,"AccountName");if(!a){a=getAccountNameFromUrl(s)}if(!s){throw new Error("Invalid BlobEndpoint in the provided SAS Connection String")}else if(!i){throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String")}return{kind:"SASConnString",url:s,accountName:a,accountSas:i}}}function escape(r){return encodeURIComponent(r).replace(/%2F/g,"/").replace(/'/g,"%27").replace(/\+/g,"%20").replace(/%25/g,"%")}function appendToURLPath(r,i){const s=a.URLBuilder.parse(r);let l=s.getPath();l=l?l.endsWith("/")?`${l}${i}`:`${l}/${i}`:i;s.setPath(l);const c=new URL(s.toString());return c.toString()}function setURLParameter(r,i,s){const l=a.URLBuilder.parse(r);l.setQueryParameter(i,s);return l.toString()}function getURLParameter(r,i){const s=a.URLBuilder.parse(r);return s.getQueryParameterValue(i)}function setURLHost(r,i){const s=a.URLBuilder.parse(r);s.setHost(i);return s.toString()}function getURLPath(r){const i=a.URLBuilder.parse(r);return i.getPath()}function getURLScheme(r){const i=a.URLBuilder.parse(r);return i.getScheme()}function getURLPathAndQuery(r){const i=a.URLBuilder.parse(r);const s=i.getPath();if(!s){throw new RangeError("Invalid url without valid path.")}let l=i.getQuery()||"";l=l.trim();if(l!==""){l=l.startsWith("?")?l:`?${l}`}return`${s}${l}`}function getURLQueries(r){let i=a.URLBuilder.parse(r).getQuery();if(!i){return{}}i=i.trim();i=i.startsWith("?")?i.substr(1):i;let s=i.split("&");s=s.filter((r=>{const i=r.indexOf("=");const s=r.lastIndexOf("=");return i>0&&i===s&&sl){r=r.slice(0,l)}const c=r+padStart(i.toString(),s-r.length,"0");return base64encode(c)}async function delay(r,i,s){return new Promise(((a,l)=>{let c;const abortHandler=()=>{if(c!==undefined){clearTimeout(c)}l(s)};const resolveHandler=()=>{if(i!==undefined){i.removeEventListener("abort",abortHandler)}a()};c=setTimeout(resolveHandler,r);if(i!==undefined){i.addEventListener("abort",abortHandler)}}))}function padStart(r,i,s=" "){if(String.prototype.padStart){return r.padStart(i,s)}s=s||" ";if(r.length>i){return r}else{i=i-r.length;if(i>s.length){s+=s.repeat(i/s.length)}return s.slice(0,i)+r}}function iEqual(r,i){return r.toLocaleLowerCase()===i.toLocaleLowerCase()}function getAccountNameFromUrl(r){const i=a.URLBuilder.parse(r);let s;try{if(i.getHost().split(".")[1]==="blob"){s=i.getHost().split(".")[0]}else if(isIpEndpointStyle(i)){s=i.getPath().split("/")[1]}else{s=""}return s}catch(r){throw new Error("Unable to extract accountName with provided information.")}}function isIpEndpointStyle(r){if(r.getHost()===undefined){return false}const i=r.getHost()+(r.getPort()===undefined?"":":"+r.getPort());return/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(i)||r.getPort()!==undefined&&_o.includes(r.getPort())}function toBlobTagsString(r){if(r===undefined){return undefined}const i=[];for(const s in r){if(Object.prototype.hasOwnProperty.call(r,s)){const a=r[s];i.push(`${encodeURIComponent(s)}=${encodeURIComponent(a)}`)}}return i.join("&")}function toBlobTags(r){if(r===undefined){return undefined}const i={blobTagSet:[]};for(const s in r){if(Object.prototype.hasOwnProperty.call(r,s)){const a=r[s];i.blobTagSet.push({key:s,value:a})}}return i}function toTags(r){if(r===undefined){return undefined}const i={};for(const s of r.blobTagSet){i[s.key]=s.value}return i}function toQuerySerialization(r){if(r===undefined){return undefined}switch(r.kind){case"csv":return{format:{type:"delimited",delimitedTextConfiguration:{columnSeparator:r.columnSeparator||",",fieldQuote:r.fieldQuote||"",recordSeparator:r.recordSeparator,escapeChar:r.escapeCharacter||"",headersPresent:r.hasHeaders||false}}};case"json":return{format:{type:"json",jsonTextConfiguration:{recordSeparator:r.recordSeparator}}};case"arrow":return{format:{type:"arrow",arrowConfiguration:{schema:r.schema}}};case"parquet":return{format:{type:"parquet"}};default:throw Error("Invalid BlobQueryTextConfiguration.")}}function parseObjectReplicationRecord(r){if(!r){return undefined}if("policy-id"in r){return undefined}const i=[];for(const s in r){const a=s.split("_");const l="or-";if(a[0].startsWith(l)){a[0]=a[0].substring(l.length)}const c={ruleId:a[1],replicationStatus:r[s]};const d=i.findIndex((r=>r.policyId===a[0]));if(d>-1){i[d].rules.push(c)}else{i.push({policyId:a[0],rules:[c]})}}return i}function attachCredential(r,i){r.credential=i;return r}function httpAuthorizationToString(r){return r?r.scheme+" "+r.value:undefined}function BlobNameToString(r){if(r.encoded){return decodeURIComponent(r.content)}else{return r.content}}function ConvertInternalResponseOfListBlobFlat(r){return Object.assign(Object.assign({},r),{segment:{blobItems:r.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i}))}})}function ConvertInternalResponseOfListBlobHierarchy(r){var i;return Object.assign(Object.assign({},r),{segment:{blobPrefixes:(i=r.segment.blobPrefixes)===null||i===void 0?void 0:i.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i})),blobItems:r.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i}))}})}function*ExtractPageRangeInfoItems(r){let i=[];let s=[];if(r.pageRange)i=r.pageRange;if(r.clearRange)s=r.clearRange;let a=0;let l=0;while(a=1?Math.floor(s.maxTries):No.maxTries,tryTimeoutInMs:s.tryTimeoutInMs&&s.tryTimeoutInMs>=0?s.tryTimeoutInMs:No.tryTimeoutInMs,retryDelayInMs:s.retryDelayInMs&&s.retryDelayInMs>=0?Math.min(s.retryDelayInMs,s.maxRetryDelayInMs?s.maxRetryDelayInMs:No.maxRetryDelayInMs):No.retryDelayInMs,maxRetryDelayInMs:s.maxRetryDelayInMs&&s.maxRetryDelayInMs>=0?s.maxRetryDelayInMs:No.maxRetryDelayInMs,secondaryHost:s.secondaryHost?s.secondaryHost:No.secondaryHost}}async sendRequest(r){return this.attemptSendRequest(r,false,1)}async attemptSendRequest(r,i,s){const a=r.clone();const l=i||!this.retryOptions.secondaryHost||!(r.method==="GET"||r.method==="HEAD"||r.method==="OPTIONS")||s%2===1;if(!l){a.url=setURLHost(a.url,this.retryOptions.secondaryHost)}if(this.retryOptions.tryTimeoutInMs){a.url=setURLParameter(a.url,fo.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString())}let c;try{ro.info(`RetryPolicy: =====> Try=${s} ${l?"Primary":"Secondary"}`);c=await this._nextPolicy.sendRequest(a);if(!this.shouldRetry(l,s,c)){return c}i=i||!l&&c.status===404}catch(r){ro.error(`RetryPolicy: Caught error, message: ${r.message}, code: ${r.code}`);if(!this.shouldRetry(l,s,c,r)){throw r}}await this.delay(l,s,r.abortSignal);return this.attemptSendRequest(r,i,++s)}shouldRetry(r,i,s,a){if(i>=this.retryOptions.maxTries){ro.info(`RetryPolicy: Attempt(s) ${i} >= maxTries ${this.retryOptions.maxTries}, no further try.`);return false}const l=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(a){for(const r of l){if(a.name.toUpperCase().includes(r)||a.message.toUpperCase().includes(r)||a.code&&a.code.toString().toUpperCase()===r){ro.info(`RetryPolicy: Network error ${r} found, will retry.`);return true}}}if(s||a){const i=s?s.status:a?a.statusCode:0;if(!r&&i===404){ro.info(`RetryPolicy: Secondary access with 404, will retry.`);return true}if(i===503||i===500){ro.info(`RetryPolicy: Will retry for status code ${i}.`);return true}}if((a===null||a===void 0?void 0:a.code)==="PARSE_ERROR"&&(a===null||a===void 0?void 0:a.message.startsWith(`Error "Error: Unclosed root tag`))){ro.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");return true}return false}async delay(r,s,a){let l=0;if(r){switch(this.retryOptions.retryPolicyType){case i.StorageRetryPolicyType.EXPONENTIAL:l=Math.min((Math.pow(2,s-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case i.StorageRetryPolicyType.FIXED:l=this.retryOptions.retryDelayInMs;break}}else{l=Math.random()*1e3}ro.info(`RetryPolicy: Delay for ${l}ms`);return delay(l,a,To)}}class StorageRetryPolicyFactory{constructor(r){this.retryOptions=r}create(r,i){return new StorageRetryPolicy(r,i,this.retryOptions)}}class CredentialPolicy extends a.BaseRequestPolicy{sendRequest(r){return this._nextPolicy.sendRequest(this.signRequest(r))}signRequest(r){return r}}class AnonymousCredentialPolicy extends CredentialPolicy{constructor(r,i){super(r,i)}}class Credential{create(r,i){throw new Error("Method should be implemented in children classes.")}}class AnonymousCredential extends Credential{create(r,i){return new AnonymousCredentialPolicy(r,i)}}class TelemetryPolicy extends a.BaseRequestPolicy{constructor(r,i,s){super(r,i);this.telemetry=s}async sendRequest(r){if(a.isNode){if(!r.headers){r.headers=new a.HttpHeaders}if(!r.headers.get(ho.USER_AGENT)){r.headers.set(ho.USER_AGENT,this.telemetry)}}return this._nextPolicy.sendRequest(r)}}class TelemetryPolicyFactory{constructor(r){const i=[];if(a.isNode){if(r){const s=r.userAgentPrefix||"";if(s.length>0&&i.indexOf(s)===-1){i.push(s)}}const s=`azsdk-js-storageblob/${no}`;if(i.indexOf(s)===-1){i.push(s)}let a=`(NODE-VERSION ${process.version})`;if(v){a=`(NODE-VERSION ${process.version}; ${v.type()} ${v.release()})`}if(i.indexOf(a)===-1){i.push(a)}}this.telemetryString=i.join(" ")}create(r,i){return new TelemetryPolicy(r,i,this.telemetryString)}}const ko=new a.DefaultHttpClient;function getCachedDefaultHttpClient(){return ko}const Do={DefaultScope:"/.default",HeaderConstants:{AUTHORIZATION:"authorization"}};const Po={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function beginRefresh(r,i,s){async function tryGetAccessToken(){if(Date.now()r.getToken(i,s);a=beginRefresh(tryGetAccessToken,c.retryIntervalInMs,(p=l===null||l===void 0?void 0:l.expiresOnTimestamp)!==null&&p!==void 0?p:Date.now()).then((r=>{a=null;l=r;return l})).catch((r=>{a=null;l=null;throw r}))}return a}return async r=>{if(d.mustRefresh)return refresh(r);if(d.shouldRefresh){refresh(r)}return l}}function getChallenge(r){const i=r.headers.get("WWW-Authenticate");if(r.status===401&&i){return i}return}function parseChallenge(r){const i=r.slice("Bearer ".length);const s=`${i.trim()} `.split(" ").filter((r=>r));const a=s.map((r=>(([r,i])=>({[r]:i}))(r.trim().split("="))));return a.reduce(((r,i)=>Object.assign(Object.assign({},r),i)),{})}function storageBearerTokenChallengeAuthenticationPolicy(r,i){let s=createTokenCycler(r,i);class StorageBearerTokenChallengeAuthenticationPolicy extends a.BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(i){if(!i.url.toLowerCase().startsWith("https://")){throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.")}const l=s;const c=(await l({abortSignal:i.abortSignal,tracingOptions:{tracingContext:i.tracingContext}})).token;i.headers.set(Do.HeaderConstants.AUTHORIZATION,`Bearer ${c}`);const d=await this._nextPolicy.sendRequest(i);if((d===null||d===void 0?void 0:d.status)===401){const l=getChallenge(d);if(l){const c=parseChallenge(l);const d=c.resource_id+Do.DefaultScope;const p=a.URLBuilder.parse(c.authorization_uri);const u=p.getPath().split("/");const A=u[1];const h=createTokenCycler(r,d);const g=(await h({abortSignal:i.abortSignal,tracingOptions:{tracingContext:i.tracingContext},tenantId:A})).token;s=h;i.headers.set(Do.HeaderConstants.AUTHORIZATION,`Bearer ${g}`);return this._nextPolicy.sendRequest(i)}}return d}}return{create:(r,i)=>new StorageBearerTokenChallengeAuthenticationPolicy(r,i)}}function isPipelineLike(r){if(!r||typeof r!=="object"){return false}const i=r;return Array.isArray(i.factories)&&typeof i.options==="object"&&typeof i.toServiceClientOptions==="function"}class Pipeline{constructor(r,i={}){this.factories=r;this.options=Object.assign(Object.assign({},i),{httpClient:i.httpClient||getCachedDefaultHttpClient()})}toServiceClientOptions(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}}}function newPipeline(r,i={}){var s;if(r===undefined){r=new AnonymousCredential}const l=new TelemetryPolicyFactory(i.userAgentOptions);const c=[a.tracingPolicy({userAgent:l.telemetryString}),a.keepAlivePolicy(i.keepAliveOptions),l,a.generateClientRequestIdPolicy(),new StorageBrowserPolicyFactory,new StorageRetryPolicyFactory(i.retryOptions),a.deserializationPolicy(undefined,{xmlCharKey:"#"}),a.logPolicy({logger:ro.info,allowedHeaderNames:So,allowedQueryParameters:xo})];if(a.isNode){c.push(a.proxyPolicy(i.proxyOptions));c.push(a.disableResponseDecompressionPolicy())}c.push(a.isTokenCredential(r)?attachCredential(storageBearerTokenChallengeAuthenticationPolicy(r,(s=i.audience)!==null&&s!==void 0?s:Ao),r):r);return new Pipeline(c,i)}class StorageSharedKeyCredentialPolicy extends CredentialPolicy{constructor(r,i,s){super(r,i);this.factory=s}signRequest(r){r.headers.set(ho.X_MS_DATE,(new Date).toUTCString());if(r.body&&(typeof r.body==="string"||r.body!==undefined)&&r.body.length>0){r.headers.set(ho.CONTENT_LENGTH,Buffer.byteLength(r.body))}const i=[r.method.toUpperCase(),this.getHeaderValueToSign(r,ho.CONTENT_LANGUAGE),this.getHeaderValueToSign(r,ho.CONTENT_ENCODING),this.getHeaderValueToSign(r,ho.CONTENT_LENGTH),this.getHeaderValueToSign(r,ho.CONTENT_MD5),this.getHeaderValueToSign(r,ho.CONTENT_TYPE),this.getHeaderValueToSign(r,ho.DATE),this.getHeaderValueToSign(r,ho.IF_MODIFIED_SINCE),this.getHeaderValueToSign(r,ho.IF_MATCH),this.getHeaderValueToSign(r,ho.IF_NONE_MATCH),this.getHeaderValueToSign(r,ho.IF_UNMODIFIED_SINCE),this.getHeaderValueToSign(r,ho.RANGE)].join("\n")+"\n"+this.getCanonicalizedHeadersString(r)+this.getCanonicalizedResourceString(r);const s=this.factory.computeHMACSHA256(i);r.headers.set(ho.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${s}`);return r}getHeaderValueToSign(r,i){const s=r.headers.get(i);if(!s){return""}if(i===ho.CONTENT_LENGTH&&s==="0"){return""}return s}getCanonicalizedHeadersString(r){let i=r.headers.headersArray().filter((r=>r.name.toLowerCase().startsWith(ho.PREFIX_FOR_STORAGE)));i.sort(((r,i)=>r.name.toLowerCase().localeCompare(i.name.toLowerCase())));i=i.filter(((r,i,s)=>{if(i>0&&r.name.toLowerCase()===s[i-1].name.toLowerCase()){return false}return true}));let s="";i.forEach((r=>{s+=`${r.name.toLowerCase().trimRight()}:${r.value.trimLeft()}\n`}));return s}getCanonicalizedResourceString(r){const i=getURLPath(r.url)||"/";let s="";s+=`/${this.factory.accountName}${i}`;const a=getURLQueries(r.url);const l={};if(a){const r=[];for(const i in a){if(Object.prototype.hasOwnProperty.call(a,i)){const s=i.toLowerCase();l[s]=a[i];r.push(s)}}r.sort();for(const i of r){s+=`\n${i}:${decodeURIComponent(l[i])}`}}return s}}class StorageSharedKeyCredential extends Credential{constructor(r,i){super();this.accountName=r;this.accountKey=Buffer.from(i,"base64")}create(r,i){return new StorageSharedKeyCredentialPolicy(r,i,this)}computeHMACSHA256(r){return A.createHmac("sha256",this.accountKey).update(r,"utf8").digest("base64")}}const Oo="azure-storage-blob";const Lo="12.17.0";class StorageClientContext extends C.ServiceClient{constructor(r,i){if(r===undefined){throw new Error("'url' cannot be null")}if(!i){i={}}if(!i.userAgent){const r=C.getDefaultUserAgentValue();i.userAgent=`${Oo}/${Lo} ${r}`}super(undefined,i);this.requestContentType="application/json; charset=utf-8";this.baseUri=i.endpoint||"{url}";this.url=r;this.version=i.version||"2023-11-03"}}class StorageClient{constructor(r,i){this.url=escapeURLPath(r);this.accountName=getAccountNameFromUrl(r);this.pipeline=i;this.storageClientContext=new StorageClientContext(this.url,i.toServiceClientOptions());this.isHttps=iEqual(getURLScheme(this.url)||"","https");this.credential=new AnonymousCredential;for(const r of this.pipeline.factories){if(a.isNode&&r instanceof StorageSharedKeyCredential||r instanceof AnonymousCredential){this.credential=r}else if(a.isTokenCredential(r.credential)){this.credential=r.credential}}const s=this.storageClientContext;s.requestContentType=undefined}}const Mo=c.createSpanFunction({packagePrefix:"Azure.Storage.Blob",namespace:"Microsoft.Storage"});function convertTracingToRequestOptionsBase(r){var i,s;return{spanOptions:(i=r===null||r===void 0?void 0:r.tracingOptions)===null||i===void 0?void 0:i.spanOptions,tracingContext:(s=r===null||r===void 0?void 0:r.tracingOptions)===null||s===void 0?void 0:s.tracingContext}}class BlobSASPermissions{constructor(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false;this.permanentDelete=false}static parse(r){const i=new BlobSASPermissions;for(const s of r){switch(s){case"r":i.read=true;break;case"a":i.add=true;break;case"c":i.create=true;break;case"w":i.write=true;break;case"d":i.delete=true;break;case"x":i.deleteVersion=true;break;case"t":i.tag=true;break;case"m":i.move=true;break;case"e":i.execute=true;break;case"i":i.setImmutabilityPolicy=true;break;case"y":i.permanentDelete=true;break;default:throw new RangeError(`Invalid permission: ${s}`)}}return i}static from(r){const i=new BlobSASPermissions;if(r.read){i.read=true}if(r.add){i.add=true}if(r.create){i.create=true}if(r.write){i.write=true}if(r.delete){i.delete=true}if(r.deleteVersion){i.deleteVersion=true}if(r.tag){i.tag=true}if(r.move){i.move=true}if(r.execute){i.execute=true}if(r.setImmutabilityPolicy){i.setImmutabilityPolicy=true}if(r.permanentDelete){i.permanentDelete=true}return i}toString(){const r=[];if(this.read){r.push("r")}if(this.add){r.push("a")}if(this.create){r.push("c")}if(this.write){r.push("w")}if(this.delete){r.push("d")}if(this.deleteVersion){r.push("x")}if(this.tag){r.push("t")}if(this.move){r.push("m")}if(this.execute){r.push("e")}if(this.setImmutabilityPolicy){r.push("i")}if(this.permanentDelete){r.push("y")}return r.join("")}}class ContainerSASPermissions{constructor(){this.read=false;this.add=false;this.create=false;this.write=false;this.delete=false;this.deleteVersion=false;this.list=false;this.tag=false;this.move=false;this.execute=false;this.setImmutabilityPolicy=false;this.permanentDelete=false;this.filterByTags=false}static parse(r){const i=new ContainerSASPermissions;for(const s of r){switch(s){case"r":i.read=true;break;case"a":i.add=true;break;case"c":i.create=true;break;case"w":i.write=true;break;case"d":i.delete=true;break;case"l":i.list=true;break;case"t":i.tag=true;break;case"x":i.deleteVersion=true;break;case"m":i.move=true;break;case"e":i.execute=true;break;case"i":i.setImmutabilityPolicy=true;break;case"y":i.permanentDelete=true;break;case"f":i.filterByTags=true;break;default:throw new RangeError(`Invalid permission ${s}`)}}return i}static from(r){const i=new ContainerSASPermissions;if(r.read){i.read=true}if(r.add){i.add=true}if(r.create){i.create=true}if(r.write){i.write=true}if(r.delete){i.delete=true}if(r.list){i.list=true}if(r.deleteVersion){i.deleteVersion=true}if(r.tag){i.tag=true}if(r.move){i.move=true}if(r.execute){i.execute=true}if(r.setImmutabilityPolicy){i.setImmutabilityPolicy=true}if(r.permanentDelete){i.permanentDelete=true}if(r.filterByTags){i.filterByTags=true}return i}toString(){const r=[];if(this.read){r.push("r")}if(this.add){r.push("a")}if(this.create){r.push("c")}if(this.write){r.push("w")}if(this.delete){r.push("d")}if(this.deleteVersion){r.push("x")}if(this.list){r.push("l")}if(this.tag){r.push("t")}if(this.move){r.push("m")}if(this.execute){r.push("e")}if(this.setImmutabilityPolicy){r.push("i")}if(this.permanentDelete){r.push("y")}if(this.filterByTags){r.push("f")}return r.join("")}}class UserDelegationKeyCredential{constructor(r,i){this.accountName=r;this.userDelegationKey=i;this.key=Buffer.from(i.value,"base64")}computeHMACSHA256(r){return A.createHmac("sha256",this.key).update(r,"utf8").digest("base64")}}function ipRangeToString(r){return r.end?`${r.start}-${r.end}`:r.start}i.SASProtocol=void 0;(function(r){r["Https"]="https";r["HttpsAndHttp"]="https,http"})(i.SASProtocol||(i.SASProtocol={}));class SASQueryParameters{constructor(r,i,s,a,l,c,d,p,u,A,h,g,y,b,w,C,v,I,B,S){this.version=r;this.signature=i;if(s!==undefined&&typeof s!=="string"){this.permissions=s.permissions;this.services=s.services;this.resourceTypes=s.resourceTypes;this.protocol=s.protocol;this.startsOn=s.startsOn;this.expiresOn=s.expiresOn;this.ipRangeInner=s.ipRange;this.identifier=s.identifier;this.encryptionScope=s.encryptionScope;this.resource=s.resource;this.cacheControl=s.cacheControl;this.contentDisposition=s.contentDisposition;this.contentEncoding=s.contentEncoding;this.contentLanguage=s.contentLanguage;this.contentType=s.contentType;if(s.userDelegationKey){this.signedOid=s.userDelegationKey.signedObjectId;this.signedTenantId=s.userDelegationKey.signedTenantId;this.signedStartsOn=s.userDelegationKey.signedStartsOn;this.signedExpiresOn=s.userDelegationKey.signedExpiresOn;this.signedService=s.userDelegationKey.signedService;this.signedVersion=s.userDelegationKey.signedVersion;this.preauthorizedAgentObjectId=s.preauthorizedAgentObjectId;this.correlationId=s.correlationId}}else{this.services=a;this.resourceTypes=l;this.expiresOn=p;this.permissions=s;this.protocol=c;this.startsOn=d;this.ipRangeInner=u;this.encryptionScope=S;this.identifier=A;this.resource=h;this.cacheControl=g;this.contentDisposition=y;this.contentEncoding=b;this.contentLanguage=w;this.contentType=C;if(v){this.signedOid=v.signedObjectId;this.signedTenantId=v.signedTenantId;this.signedStartsOn=v.signedStartsOn;this.signedExpiresOn=v.signedExpiresOn;this.signedService=v.signedService;this.signedVersion=v.signedVersion;this.preauthorizedAgentObjectId=I;this.correlationId=B}}}get ipRange(){if(this.ipRangeInner){return{end:this.ipRangeInner.end,start:this.ipRangeInner.start}}return undefined}toString(){const r=["sv","ss","srt","spr","st","se","sip","si","ses","skoid","sktid","skt","ske","sks","skv","sr","sp","sig","rscc","rscd","rsce","rscl","rsct","saoid","scid"];const i=[];for(const s of r){switch(s){case"sv":this.tryAppendQueryParameter(i,s,this.version);break;case"ss":this.tryAppendQueryParameter(i,s,this.services);break;case"srt":this.tryAppendQueryParameter(i,s,this.resourceTypes);break;case"spr":this.tryAppendQueryParameter(i,s,this.protocol);break;case"st":this.tryAppendQueryParameter(i,s,this.startsOn?truncatedISO8061Date(this.startsOn,false):undefined);break;case"se":this.tryAppendQueryParameter(i,s,this.expiresOn?truncatedISO8061Date(this.expiresOn,false):undefined);break;case"sip":this.tryAppendQueryParameter(i,s,this.ipRange?ipRangeToString(this.ipRange):undefined);break;case"si":this.tryAppendQueryParameter(i,s,this.identifier);break;case"ses":this.tryAppendQueryParameter(i,s,this.encryptionScope);break;case"skoid":this.tryAppendQueryParameter(i,s,this.signedOid);break;case"sktid":this.tryAppendQueryParameter(i,s,this.signedTenantId);break;case"skt":this.tryAppendQueryParameter(i,s,this.signedStartsOn?truncatedISO8061Date(this.signedStartsOn,false):undefined);break;case"ske":this.tryAppendQueryParameter(i,s,this.signedExpiresOn?truncatedISO8061Date(this.signedExpiresOn,false):undefined);break;case"sks":this.tryAppendQueryParameter(i,s,this.signedService);break;case"skv":this.tryAppendQueryParameter(i,s,this.signedVersion);break;case"sr":this.tryAppendQueryParameter(i,s,this.resource);break;case"sp":this.tryAppendQueryParameter(i,s,this.permissions);break;case"sig":this.tryAppendQueryParameter(i,s,this.signature);break;case"rscc":this.tryAppendQueryParameter(i,s,this.cacheControl);break;case"rscd":this.tryAppendQueryParameter(i,s,this.contentDisposition);break;case"rsce":this.tryAppendQueryParameter(i,s,this.contentEncoding);break;case"rscl":this.tryAppendQueryParameter(i,s,this.contentLanguage);break;case"rsct":this.tryAppendQueryParameter(i,s,this.contentType);break;case"saoid":this.tryAppendQueryParameter(i,s,this.preauthorizedAgentObjectId);break;case"scid":this.tryAppendQueryParameter(i,s,this.correlationId);break}}return i.join("&")}tryAppendQueryParameter(r,i,s){if(!s){return}i=encodeURIComponent(i);s=encodeURIComponent(s);if(i.length>0&&s.length>0){r.push(`${i}=${s}`)}}}function generateBlobSASQueryParameters(r,i,s){const a=r.version?r.version:io;const l=i instanceof StorageSharedKeyCredential?i:undefined;let c;if(l===undefined&&s!==undefined){c=new UserDelegationKeyCredential(s,i)}if(l===undefined&&c===undefined){throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.")}if(a>="2020-12-06"){if(l!==undefined){return generateBlobSASQueryParameters20201206(r,l)}else{return generateBlobSASQueryParametersUDK20201206(r,c)}}if(a>="2018-11-09"){if(l!==undefined){return generateBlobSASQueryParameters20181109(r,l)}else{if(a>="2020-02-10"){return generateBlobSASQueryParametersUDK20200210(r,c)}else{return generateBlobSASQueryParametersUDK20181109(r,c)}}}if(a>="2015-04-05"){if(l!==undefined){return generateBlobSASQueryParameters20150405(r,l)}else{throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.")}}throw new RangeError("'version' must be >= '2015-04-05'.")}function generateBlobSASQueryParameters20150405(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.identifier&&!(r.permissions&&r.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}let s="c";if(r.blobName){s="b"}let a;if(r.permissions){if(r.blobName){a=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{a=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const l=[a?a:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),r.identifier,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,r.cacheControl?r.cacheControl:"",r.contentDisposition?r.contentDisposition:"",r.contentEncoding?r.contentEncoding:"",r.contentLanguage?r.contentLanguage:"",r.contentType?r.contentType:""].join("\n");const c=i.computeHMACSHA256(l);return new SASQueryParameters(r.version,c,a,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType)}function generateBlobSASQueryParameters20181109(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.identifier&&!(r.permissions&&r.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}let s="c";let a=r.snapshotTime;if(r.blobName){s="b";if(r.snapshotTime){s="bs"}else if(r.versionId){s="bv";a=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),r.identifier,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,s,a,r.cacheControl?r.cacheControl:"",r.contentDisposition?r.contentDisposition:"",r.contentEncoding?r.contentEncoding:"",r.contentLanguage?r.contentLanguage:"",r.contentType?r.contentType:""].join("\n");const d=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,d,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType)}function generateBlobSASQueryParameters20201206(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.identifier&&!(r.permissions&&r.expiresOn)){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.")}let s="c";let a=r.snapshotTime;if(r.blobName){s="b";if(r.snapshotTime){s="bs"}else if(r.versionId){s="bv";a=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),r.identifier,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,s,a,r.encryptionScope,r.cacheControl?r.cacheControl:"",r.contentDisposition?r.contentDisposition:"",r.contentEncoding?r.contentEncoding:"",r.contentLanguage?r.contentLanguage:"",r.contentType?r.contentType:""].join("\n");const d=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,d,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,undefined,undefined,undefined,r.encryptionScope)}function generateBlobSASQueryParametersUDK20181109(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.permissions||!r.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}let s="c";let a=r.snapshotTime;if(r.blobName){s="b";if(r.snapshotTime){s="bs"}else if(r.versionId){s="bv";a=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),i.userDelegationKey.signedObjectId,i.userDelegationKey.signedTenantId,i.userDelegationKey.signedStartsOn?truncatedISO8061Date(i.userDelegationKey.signedStartsOn,false):"",i.userDelegationKey.signedExpiresOn?truncatedISO8061Date(i.userDelegationKey.signedExpiresOn,false):"",i.userDelegationKey.signedService,i.userDelegationKey.signedVersion,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,s,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType].join("\n");const d=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,d,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,i.userDelegationKey)}function generateBlobSASQueryParametersUDK20200210(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.permissions||!r.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}let s="c";let a=r.snapshotTime;if(r.blobName){s="b";if(r.snapshotTime){s="bs"}else if(r.versionId){s="bv";a=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),i.userDelegationKey.signedObjectId,i.userDelegationKey.signedTenantId,i.userDelegationKey.signedStartsOn?truncatedISO8061Date(i.userDelegationKey.signedStartsOn,false):"",i.userDelegationKey.signedExpiresOn?truncatedISO8061Date(i.userDelegationKey.signedExpiresOn,false):"",i.userDelegationKey.signedService,i.userDelegationKey.signedVersion,r.preauthorizedAgentObjectId,undefined,r.correlationId,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,s,a,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType].join("\n");const d=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,d,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,i.userDelegationKey,r.preauthorizedAgentObjectId,r.correlationId)}function generateBlobSASQueryParametersUDK20201206(r,i){r=SASSignatureValuesSanityCheckAndAutofill(r);if(!r.permissions||!r.expiresOn){throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.")}let s="c";let a=r.snapshotTime;if(r.blobName){s="b";if(r.snapshotTime){s="bs"}else if(r.versionId){s="bv";a=r.versionId}}let l;if(r.permissions){if(r.blobName){l=BlobSASPermissions.parse(r.permissions.toString()).toString()}else{l=ContainerSASPermissions.parse(r.permissions.toString()).toString()}}const c=[l?l:"",r.startsOn?truncatedISO8061Date(r.startsOn,false):"",r.expiresOn?truncatedISO8061Date(r.expiresOn,false):"",getCanonicalName(i.accountName,r.containerName,r.blobName),i.userDelegationKey.signedObjectId,i.userDelegationKey.signedTenantId,i.userDelegationKey.signedStartsOn?truncatedISO8061Date(i.userDelegationKey.signedStartsOn,false):"",i.userDelegationKey.signedExpiresOn?truncatedISO8061Date(i.userDelegationKey.signedExpiresOn,false):"",i.userDelegationKey.signedService,i.userDelegationKey.signedVersion,r.preauthorizedAgentObjectId,undefined,r.correlationId,r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",r.version,s,a,r.encryptionScope,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType].join("\n");const d=i.computeHMACSHA256(c);return new SASQueryParameters(r.version,d,l,undefined,undefined,r.protocol,r.startsOn,r.expiresOn,r.ipRange,r.identifier,s,r.cacheControl,r.contentDisposition,r.contentEncoding,r.contentLanguage,r.contentType,i.userDelegationKey,r.preauthorizedAgentObjectId,r.correlationId,r.encryptionScope)}function getCanonicalName(r,i,s){const a=[`/blob/${r}/${i}`];if(s){a.push(`/${s}`)}return a.join("")}function SASSignatureValuesSanityCheckAndAutofill(r){const i=r.version?r.version:io;if(r.snapshotTime&&i<"2018-11-09"){throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.")}if(r.blobName===undefined&&r.snapshotTime){throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.")}if(r.versionId&&i<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.")}if(r.blobName===undefined&&r.versionId){throw RangeError("Must provide 'blobName' when providing 'versionId'.")}if(r.permissions&&r.permissions.setImmutabilityPolicy&&i<"2020-08-04"){throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.")}if(r.permissions&&r.permissions.deleteVersion&&i<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.")}if(r.permissions&&r.permissions.permanentDelete&&i<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.")}if(r.permissions&&r.permissions.tag&&i<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.")}if(i<"2020-02-10"&&r.permissions&&(r.permissions.move||r.permissions.execute)){throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.")}if(i<"2021-04-10"&&r.permissions&&r.permissions.filterByTags){throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.")}if(i<"2020-02-10"&&(r.preauthorizedAgentObjectId||r.correlationId)){throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.")}if(r.encryptionScope&&i<"2020-12-06"){throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.")}r.version=i;return r}class BlobLeaseClient{constructor(r,i){const s=new StorageClientContext(r.url,r.pipeline.toServiceClientOptions());this._url=r.url;if(r.name===undefined){this._isContainer=true;this._containerOrBlobOperation=new Container(s)}else{this._isContainer=false;this._containerOrBlobOperation=new Blob$1(s)}if(!i){i=a.generateUuid()}this._leaseId=i}get leaseId(){return this._leaseId}get url(){return this._url}async acquireLease(r,i={}){var s,a,l,d,p,u;const{span:A,updatedOptions:h}=Mo("BlobLeaseClient-acquireLease",i);if(this._isContainer&&(((s=i.conditions)===null||s===void 0?void 0:s.ifMatch)&&((a=i.conditions)===null||a===void 0?void 0:a.ifMatch)!==go||((l=i.conditions)===null||l===void 0?void 0:l.ifNoneMatch)&&((d=i.conditions)===null||d===void 0?void 0:d.ifNoneMatch)!==go||((p=i.conditions)===null||p===void 0?void 0:p.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{return await this._containerOrBlobOperation.acquireLease(Object.assign({abortSignal:i.abortSignal,duration:r,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(u=i.conditions)===null||u===void 0?void 0:u.tagConditions}),proposedLeaseId:this._leaseId},convertTracingToRequestOptionsBase(h)))}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}async changeLease(r,i={}){var s,a,l,d,p,u;const{span:A,updatedOptions:h}=Mo("BlobLeaseClient-changeLease",i);if(this._isContainer&&(((s=i.conditions)===null||s===void 0?void 0:s.ifMatch)&&((a=i.conditions)===null||a===void 0?void 0:a.ifMatch)!==go||((l=i.conditions)===null||l===void 0?void 0:l.ifNoneMatch)&&((d=i.conditions)===null||d===void 0?void 0:d.ifNoneMatch)!==go||((p=i.conditions)===null||p===void 0?void 0:p.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{const s=await this._containerOrBlobOperation.changeLease(this._leaseId,r,Object.assign({abortSignal:i.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(u=i.conditions)===null||u===void 0?void 0:u.tagConditions})},convertTracingToRequestOptionsBase(h)));this._leaseId=r;return s}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}async releaseLease(r={}){var i,s,a,l,d,p;const{span:u,updatedOptions:A}=Mo("BlobLeaseClient-releaseLease",r);if(this._isContainer&&(((i=r.conditions)===null||i===void 0?void 0:i.ifMatch)&&((s=r.conditions)===null||s===void 0?void 0:s.ifMatch)!==go||((a=r.conditions)===null||a===void 0?void 0:a.ifNoneMatch)&&((l=r.conditions)===null||l===void 0?void 0:l.ifNoneMatch)!==go||((d=r.conditions)===null||d===void 0?void 0:d.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{return await this._containerOrBlobOperation.releaseLease(this._leaseId,Object.assign({abortSignal:r.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(p=r.conditions)===null||p===void 0?void 0:p.tagConditions})},convertTracingToRequestOptionsBase(A)))}catch(r){u.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{u.end()}}async renewLease(r={}){var i,s,a,l,d,p;const{span:u,updatedOptions:A}=Mo("BlobLeaseClient-renewLease",r);if(this._isContainer&&(((i=r.conditions)===null||i===void 0?void 0:i.ifMatch)&&((s=r.conditions)===null||s===void 0?void 0:s.ifMatch)!==go||((a=r.conditions)===null||a===void 0?void 0:a.ifNoneMatch)&&((l=r.conditions)===null||l===void 0?void 0:l.ifNoneMatch)!==go||((d=r.conditions)===null||d===void 0?void 0:d.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{return await this._containerOrBlobOperation.renewLease(this._leaseId,Object.assign({abortSignal:r.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(p=r.conditions)===null||p===void 0?void 0:p.tagConditions})},convertTracingToRequestOptionsBase(A)))}catch(r){u.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{u.end()}}async breakLease(r,i={}){var s,a,l,d,p,u;const{span:A,updatedOptions:h}=Mo("BlobLeaseClient-breakLease",i);if(this._isContainer&&(((s=i.conditions)===null||s===void 0?void 0:s.ifMatch)&&((a=i.conditions)===null||a===void 0?void 0:a.ifMatch)!==go||((l=i.conditions)===null||l===void 0?void 0:l.ifNoneMatch)&&((d=i.conditions)===null||d===void 0?void 0:d.ifNoneMatch)!==go||((p=i.conditions)===null||p===void 0?void 0:p.tagConditions))){throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.")}try{const s=Object.assign({abortSignal:i.abortSignal,breakPeriod:r,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(u=i.conditions)===null||u===void 0?void 0:u.tagConditions})},convertTracingToRequestOptionsBase(h));return await this._containerOrBlobOperation.breakLease(s)}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}}class RetriableReadableStream extends h.Readable{constructor(r,i,s,a,l={}){super({highWaterMark:l.highWaterMark});this.retries=0;this.sourceDataHandler=r=>{if(this.options.doInjectErrorOnce){this.options.doInjectErrorOnce=undefined;this.source.pause();this.source.removeAllListeners("data");this.source.emit("end");return}this.offset+=r.length;if(this.onProgress){this.onProgress({loadedBytes:this.offset-this.start})}if(!this.push(r)){this.source.pause()}};this.sourceErrorOrEndHandler=r=>{if(r&&r.name==="AbortError"){this.destroy(r);return}this.removeSourceEventHandlers();if(this.offset-1===this.end){this.push(null)}else if(this.offset<=this.end){if(this.retries{this.source=r;this.setSourceEventHandlers();return})).catch((r=>{this.destroy(r)}))}else{this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset-1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`))}}else{this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset-1}`))}};this.getter=i;this.source=r;this.start=s;this.offset=s;this.end=s+a-1;this.maxRetryRequests=l.maxRetryRequests&&l.maxRetryRequests>=0?l.maxRetryRequests:0;this.onProgress=l.onProgress;this.options=l;this.setSourceEventHandlers()}_read(){this.source.resume()}setSourceEventHandlers(){this.source.on("data",this.sourceDataHandler);this.source.on("end",this.sourceErrorOrEndHandler);this.source.on("error",this.sourceErrorOrEndHandler)}removeSourceEventHandlers(){this.source.removeListener("data",this.sourceDataHandler);this.source.removeListener("end",this.sourceErrorOrEndHandler);this.source.removeListener("error",this.sourceErrorOrEndHandler)}_destroy(r,i){this.removeSourceEventHandlers();this.source.destroy();i(r===null?undefined:r)}}class BlobDownloadResponse{constructor(r,i,s,a,l={}){this.originalResponse=r;this.blobDownloadStream=new RetriableReadableStream(this.originalResponse.readableStreamBody,i,s,a,l)}get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return this.originalResponse.copyCompletedOn}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get tagCount(){return this.originalResponse.tagCount}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get lastAccessed(){return this.originalResponse.lastAccessed}get createdOn(){return this.originalResponse.createdOn}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get versionId(){return this.originalResponse.versionId}get isCurrentVersion(){return this.originalResponse.isCurrentVersion}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get objectReplicationDestinationPolicyId(){return this.originalResponse.objectReplicationDestinationPolicyId}get objectReplicationSourceProperties(){return this.originalResponse.objectReplicationSourceProperties}get isSealed(){return this.originalResponse.isSealed}get immutabilityPolicyExpiresOn(){return this.originalResponse.immutabilityPolicyExpiresOn}get immutabilityPolicyMode(){return this.originalResponse.immutabilityPolicyMode}get legalHold(){return this.originalResponse.legalHold}get contentAsBlob(){return this.originalResponse.blobBody}get readableStreamBody(){return a.isNode?this.blobDownloadStream:undefined}get _response(){return this.originalResponse._response}}const Fo=16;const Uo=new Uint8Array([79,98,106,1]);const jo="avro.codec";const Ho="avro.schema";class AvroParser{static async readFixedBytes(r,i,s={}){const a=await r.read(i,{abortSignal:s.abortSignal});if(a.length!==i){throw new Error("Hit stream end.")}return a}static async readByte(r,i={}){const s=await AvroParser.readFixedBytes(r,1,i);return s[0]}static async readZigZagLong(r,i={}){let s=0;let a=0;let l,c,d;do{l=await AvroParser.readByte(r,i);c=l&128;s|=(l&127)<Number.MAX_SAFE_INTEGER){throw new Error("Integer overflow.")}return a}return s>>1^-(s&1)}static async readLong(r,i={}){return AvroParser.readZigZagLong(r,i)}static async readInt(r,i={}){return AvroParser.readZigZagLong(r,i)}static async readNull(){return null}static async readBoolean(r,i={}){const s=await AvroParser.readByte(r,i);if(s===1){return true}else if(s===0){return false}else{throw new Error("Byte was not a boolean.")}}static async readFloat(r,i={}){const s=await AvroParser.readFixedBytes(r,4,i);const a=new DataView(s.buffer,s.byteOffset,s.byteLength);return a.getFloat32(0,true)}static async readDouble(r,i={}){const s=await AvroParser.readFixedBytes(r,8,i);const a=new DataView(s.buffer,s.byteOffset,s.byteLength);return a.getFloat64(0,true)}static async readBytes(r,i={}){const s=await AvroParser.readLong(r,i);if(s<0){throw new Error("Bytes size was negative.")}return r.read(s,{abortSignal:i.abortSignal})}static async readString(r,i={}){const s=await AvroParser.readBytes(r,i);const a=new TextDecoder;return a.decode(s)}static async readMapPair(r,i,s={}){const a=await AvroParser.readString(r,s);const l=await i(r,s);return{key:a,value:l}}static async readMap(r,i,s={}){const readPairMethod=(r,s={})=>AvroParser.readMapPair(r,i,s);const a=await AvroParser.readArray(r,readPairMethod,s);const l={};for(const r of a){l[r.key]=r.value}return l}static async readArray(r,i,s={}){const a=[];for(let l=await AvroParser.readLong(r,s);l!==0;l=await AvroParser.readLong(r,s)){if(l<0){await AvroParser.readLong(r,s);l=-l}while(l--){const l=await i(r,s);a.push(l)}}return a}}var qo;(function(r){r["RECORD"]="record";r["ENUM"]="enum";r["ARRAY"]="array";r["MAP"]="map";r["UNION"]="union";r["FIXED"]="fixed"})(qo||(qo={}));var Go;(function(r){r["NULL"]="null";r["BOOLEAN"]="boolean";r["INT"]="int";r["LONG"]="long";r["FLOAT"]="float";r["DOUBLE"]="double";r["BYTES"]="bytes";r["STRING"]="string"})(Go||(Go={}));class AvroType{static fromSchema(r){if(typeof r==="string"){return AvroType.fromStringSchema(r)}else if(Array.isArray(r)){return AvroType.fromArraySchema(r)}else{return AvroType.fromObjectSchema(r)}}static fromStringSchema(r){switch(r){case Go.NULL:case Go.BOOLEAN:case Go.INT:case Go.LONG:case Go.FLOAT:case Go.DOUBLE:case Go.BYTES:case Go.STRING:return new AvroPrimitiveType(r);default:throw new Error(`Unexpected Avro type ${r}`)}}static fromArraySchema(r){return new AvroUnionType(r.map(AvroType.fromSchema))}static fromObjectSchema(r){const i=r.type;try{return AvroType.fromStringSchema(i)}catch(r){}switch(i){case qo.RECORD:if(r.aliases){throw new Error(`aliases currently is not supported, schema: ${r}`)}if(!r.name){throw new Error(`Required attribute 'name' doesn't exist on schema: ${r}`)}const s={};if(!r.fields){throw new Error(`Required attribute 'fields' doesn't exist on schema: ${r}`)}for(const i of r.fields){s[i.name]=AvroType.fromSchema(i.type)}return new AvroRecordType(s,r.name);case qo.ENUM:if(r.aliases){throw new Error(`aliases currently is not supported, schema: ${r}`)}if(!r.symbols){throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${r}`)}return new AvroEnumType(r.symbols);case qo.MAP:if(!r.values){throw new Error(`Required attribute 'values' doesn't exist on schema: ${r}`)}return new AvroMapType(AvroType.fromSchema(r.values));case qo.ARRAY:case qo.FIXED:default:throw new Error(`Unexpected Avro type ${i} in ${r}`)}}}class AvroPrimitiveType extends AvroType{constructor(r){super();this._primitive=r}read(r,i={}){switch(this._primitive){case Go.NULL:return AvroParser.readNull();case Go.BOOLEAN:return AvroParser.readBoolean(r,i);case Go.INT:return AvroParser.readInt(r,i);case Go.LONG:return AvroParser.readLong(r,i);case Go.FLOAT:return AvroParser.readFloat(r,i);case Go.DOUBLE:return AvroParser.readDouble(r,i);case Go.BYTES:return AvroParser.readBytes(r,i);case Go.STRING:return AvroParser.readString(r,i);default:throw new Error("Unknown Avro Primitive")}}}class AvroEnumType extends AvroType{constructor(r){super();this._symbols=r}async read(r,i={}){const s=await AvroParser.readInt(r,i);return this._symbols[s]}}class AvroUnionType extends AvroType{constructor(r){super();this._types=r}async read(r,i={}){const s=await AvroParser.readInt(r,i);return this._types[s].read(r,i)}}class AvroMapType extends AvroType{constructor(r){super();this._itemType=r}read(r,i={}){const readItemMethod=(r,i)=>this._itemType.read(r,i);return AvroParser.readMap(r,readItemMethod,i)}}class AvroRecordType extends AvroType{constructor(r,i){super();this._fields=r;this._name=i}async read(r,i={}){const s={};s["$schema"]=this._name;for(const a in this._fields){if(Object.prototype.hasOwnProperty.call(this._fields,a)){s[a]=await this._fields[a].read(r,i)}}return s}}function arraysEqual(r,i){if(r===i)return true;if(r==null||i==null)return false;if(r.length!==i.length)return false;for(let s=0;s0){for(let i=0;i0}parseObjects(r={}){return l.__asyncGenerator(this,arguments,(function*parseObjects_1(){if(!this._initialized){yield l.__await(this.initialize(r))}while(this.hasNext()){const i=yield l.__await(this._itemType.read(this._dataStream,{abortSignal:r.abortSignal}));this._itemsRemainingInBlock--;this._objectIndex++;if(this._itemsRemainingInBlock===0){const i=yield l.__await(AvroParser.readFixedBytes(this._dataStream,Fo,{abortSignal:r.abortSignal}));this._blockOffset=this._initialBlockOffset+this._dataStream.position;this._objectIndex=0;if(!arraysEqual(this._syncMarker,i)){throw new Error("Stream is not a valid Avro file.")}try{this._itemsRemainingInBlock=yield l.__await(AvroParser.readLong(this._dataStream,{abortSignal:r.abortSignal}))}catch(r){this._itemsRemainingInBlock=0}if(this._itemsRemainingInBlock>0){yield l.__await(AvroParser.readLong(this._dataStream,{abortSignal:r.abortSignal}))}}yield yield l.__await(i)}}))}}class AvroReadable{}const zo=new p.AbortError("Reading from the avro stream was aborted.");class AvroReadableFromStream extends AvroReadable{constructor(r){super();this._readable=r;this._position=0}toUint8Array(r){if(typeof r==="string"){return Buffer.from(r)}return r}get position(){return this._position}async read(r,i={}){var s;if((s=i.abortSignal)===null||s===void 0?void 0:s.aborted){throw zo}if(r<0){throw new Error(`size parameter should be positive: ${r}`)}if(r===0){return new Uint8Array}if(!this._readable.readable){throw new Error("Stream no longer readable.")}const a=this._readable.read(r);if(a){this._position+=a.length;return this.toUint8Array(a)}else{return new Promise(((s,a)=>{const cleanUp=()=>{this._readable.removeListener("readable",readableCallback);this._readable.removeListener("error",rejectCallback);this._readable.removeListener("end",rejectCallback);this._readable.removeListener("close",rejectCallback);if(i.abortSignal){i.abortSignal.removeEventListener("abort",abortHandler)}};const readableCallback=()=>{const i=this._readable.read(r);if(i){this._position+=i.length;cleanUp();s(this.toUint8Array(i))}};const rejectCallback=()=>{cleanUp();a()};const abortHandler=()=>{cleanUp();a(zo)};this._readable.on("readable",readableCallback);this._readable.once("error",rejectCallback);this._readable.once("end",rejectCallback);this._readable.once("close",rejectCallback);if(i.abortSignal){i.abortSignal.addEventListener("abort",abortHandler)}}))}}}class BlobQuickQueryStream extends h.Readable{constructor(r,i={}){super();this.avroPaused=true;this.source=r;this.onProgress=i.onProgress;this.onError=i.onError;this.avroReader=new AvroReader(new AvroReadableFromStream(this.source));this.avroIter=this.avroReader.parseObjects({abortSignal:i.abortSignal})}_read(){if(this.avroPaused){this.readInternal().catch((r=>{this.emit("error",r)}))}}async readInternal(){this.avroPaused=false;let r;do{r=await this.avroIter.next();if(r.done){break}const i=r.value;const s=i.$schema;if(typeof s!=="string"){throw Error("Missing schema in avro record.")}switch(s){case"com.microsoft.azure.storage.queryBlobContents.resultData":{const r=i.data;if(r instanceof Uint8Array===false){throw Error("Invalid data in avro result record.")}if(!this.push(Buffer.from(r))){this.avroPaused=true}}break;case"com.microsoft.azure.storage.queryBlobContents.progress":{const r=i.bytesScanned;if(typeof r!=="number"){throw Error("Invalid bytesScanned in avro progress record.")}if(this.onProgress){this.onProgress({loadedBytes:r})}}break;case"com.microsoft.azure.storage.queryBlobContents.end":if(this.onProgress){const r=i.totalBytes;if(typeof r!=="number"){throw Error("Invalid totalBytes in avro end record.")}this.onProgress({loadedBytes:r})}this.push(null);break;case"com.microsoft.azure.storage.queryBlobContents.error":if(this.onError){const r=i.fatal;if(typeof r!=="boolean"){throw Error("Invalid fatal in avro error record.")}const s=i.name;if(typeof s!=="string"){throw Error("Invalid name in avro error record.")}const a=i.description;if(typeof a!=="string"){throw Error("Invalid description in avro error record.")}const l=i.position;if(typeof l!=="number"){throw Error("Invalid position in avro error record.")}this.onError({position:l,name:s,isFatal:r,description:a})}break;default:throw Error(`Unknown schema ${s} in avro progress record.`)}}while(!r.done&&!this.avroPaused)}}class BlobQueryResponse{constructor(r,i={}){this.originalResponse=r;this.blobDownloadStream=new BlobQuickQueryStream(this.originalResponse.readableStreamBody,i)}get acceptRanges(){return this.originalResponse.acceptRanges}get cacheControl(){return this.originalResponse.cacheControl}get contentDisposition(){return this.originalResponse.contentDisposition}get contentEncoding(){return this.originalResponse.contentEncoding}get contentLanguage(){return this.originalResponse.contentLanguage}get blobSequenceNumber(){return this.originalResponse.blobSequenceNumber}get blobType(){return this.originalResponse.blobType}get contentLength(){return this.originalResponse.contentLength}get contentMD5(){return this.originalResponse.contentMD5}get contentRange(){return this.originalResponse.contentRange}get contentType(){return this.originalResponse.contentType}get copyCompletedOn(){return undefined}get copyId(){return this.originalResponse.copyId}get copyProgress(){return this.originalResponse.copyProgress}get copySource(){return this.originalResponse.copySource}get copyStatus(){return this.originalResponse.copyStatus}get copyStatusDescription(){return this.originalResponse.copyStatusDescription}get leaseDuration(){return this.originalResponse.leaseDuration}get leaseState(){return this.originalResponse.leaseState}get leaseStatus(){return this.originalResponse.leaseStatus}get date(){return this.originalResponse.date}get blobCommittedBlockCount(){return this.originalResponse.blobCommittedBlockCount}get etag(){return this.originalResponse.etag}get errorCode(){return this.originalResponse.errorCode}get isServerEncrypted(){return this.originalResponse.isServerEncrypted}get blobContentMD5(){return this.originalResponse.blobContentMD5}get lastModified(){return this.originalResponse.lastModified}get metadata(){return this.originalResponse.metadata}get requestId(){return this.originalResponse.requestId}get clientRequestId(){return this.originalResponse.clientRequestId}get version(){return this.originalResponse.version}get encryptionKeySha256(){return this.originalResponse.encryptionKeySha256}get contentCrc64(){return this.originalResponse.contentCrc64}get blobBody(){return undefined}get readableStreamBody(){return a.isNode?this.blobDownloadStream:undefined}get _response(){return this.originalResponse._response}}i.BlockBlobTier=void 0;(function(r){r["Hot"]="Hot";r["Cool"]="Cool";r["Cold"]="Cold";r["Archive"]="Archive"})(i.BlockBlobTier||(i.BlockBlobTier={}));i.PremiumPageBlobTier=void 0;(function(r){r["P4"]="P4";r["P6"]="P6";r["P10"]="P10";r["P15"]="P15";r["P20"]="P20";r["P30"]="P30";r["P40"]="P40";r["P50"]="P50";r["P60"]="P60";r["P70"]="P70";r["P80"]="P80"})(i.PremiumPageBlobTier||(i.PremiumPageBlobTier={}));function toAccessTier(r){if(r===undefined){return undefined}return r}function ensureCpkIfSpecified(r,i){if(r&&!i){throw new RangeError("Customer-provided encryption key must be used over HTTPS.")}if(r&&!r.encryptionAlgorithm){r.encryptionAlgorithm=Io}}i.StorageBlobAudience=void 0;(function(r){r["StorageOAuthScopes"]="https://storage.azure.com/.default";r["DiskComputeOAuthScopes"]="https://disk.compute.azure.com/.default"})(i.StorageBlobAudience||(i.StorageBlobAudience={}));function getBlobServiceAccountAudience(r){return`https://${r}.blob.core.windows.net/.default`}function rangeResponseFromModel(r){const i=(r._response.parsedBody.pageRange||[]).map((r=>({offset:r.start,count:r.end-r.start})));const s=(r._response.parsedBody.clearRange||[]).map((r=>({offset:r.start,count:r.end-r.start})));return Object.assign(Object.assign({},r),{pageRange:i,clearRange:s,_response:Object.assign(Object.assign({},r._response),{parsedBody:{pageRange:i,clearRange:s}})})}class BlobBeginCopyFromUrlPoller extends g.Poller{constructor(r){const{blobClient:i,copySource:s,intervalInMs:a=15e3,onProgress:l,resumeFrom:c,startCopyFromURLOptions:d}=r;let p;if(c){p=JSON.parse(c).state}const u=makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({},p),{blobClient:i,copySource:s,startCopyFromURLOptions:d}));super(u);if(typeof l==="function"){this.onProgress(l)}this.intervalInMs=a}delay(){return a.delay(this.intervalInMs)}}const Vo=async function cancel(r={}){const i=this.state;const{copyId:s}=i;if(i.isCompleted){return makeBlobBeginCopyFromURLPollOperation(i)}if(!s){i.isCancelled=true;return makeBlobBeginCopyFromURLPollOperation(i)}await i.blobClient.abortCopyFromURL(s,{abortSignal:r.abortSignal});i.isCancelled=true;return makeBlobBeginCopyFromURLPollOperation(i)};const Wo=async function update(r={}){const i=this.state;const{blobClient:s,copySource:a,startCopyFromURLOptions:l}=i;if(!i.isStarted){i.isStarted=true;const r=await s.startCopyFromURL(a,l);i.copyId=r.copyId;if(r.copyStatus==="success"){i.result=r;i.isCompleted=true}}else if(!i.isCompleted){try{const s=await i.blobClient.getProperties({abortSignal:r.abortSignal});const{copyStatus:a,copyProgress:l}=s;const c=i.copyProgress;if(l){i.copyProgress=l}if(a==="pending"&&l!==c&&typeof r.fireProgress==="function"){r.fireProgress(i)}else if(a==="success"){i.result=s;i.isCompleted=true}else if(a==="failed"){i.error=new Error(`Blob copy failed with reason: "${s.copyStatusDescription||"unknown"}"`);i.isCompleted=true}}catch(r){i.error=r;i.isCompleted=true}}return makeBlobBeginCopyFromURLPollOperation(i)};const Yo=function toString(){return JSON.stringify({state:this.state},((r,i)=>{if(r==="blobClient"){return undefined}return i}))};function makeBlobBeginCopyFromURLPollOperation(r){return{state:Object.assign({},r),cancel:Vo,toString:Yo,update:Wo}}function rangeToString(r){if(r.offset<0){throw new RangeError(`Range.offset cannot be smaller than 0.`)}if(r.count&&r.count<=0){throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`)}return r.count?`bytes=${r.offset}-${r.offset+r.count-1}`:`bytes=${r.offset}-`}var Jo;(function(r){r[r["Good"]=0]="Good";r[r["Error"]=1]="Error"})(Jo||(Jo={}));class Batch{constructor(r=5){this.actives=0;this.completed=0;this.offset=0;this.operations=[];this.state=Jo.Good;if(r<1){throw new RangeError("concurrency must be larger than 0")}this.concurrency=r;this.emitter=new y.EventEmitter}addOperation(r){this.operations.push((async()=>{try{this.actives++;await r();this.actives--;this.completed++;this.parallelExecute()}catch(r){this.emitter.emit("error",r)}}))}async do(){if(this.operations.length===0){return Promise.resolve()}this.parallelExecute();return new Promise(((r,i)=>{this.emitter.on("finish",r);this.emitter.on("error",(r=>{this.state=Jo.Error;i(r)}))}))}nextOperation(){if(this.offset=this.operations.length){this.emitter.emit("finish");return}while(this.actives=this.byteLength){this.push(null)}if(!r){r=this.readableHighWaterMark}const i=[];let s=0;while(sr-s){const a=this.byteOffsetInCurrentBuffer+r-s;i.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,a));this.pushedBytesLength+=r-s;this.byteOffsetInCurrentBuffer=a;s=r;break}else{const r=this.byteOffsetInCurrentBuffer+c;i.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer,r));if(c===l){this.byteOffsetInCurrentBuffer=0;this.bufferIndex++}else{this.byteOffsetInCurrentBuffer=r}this.pushedBytesLength+=c;s+=c}}if(i.length>1){this.push(Buffer.concat(i))}else if(i.length===1){this.push(i[0])}}}const $o=s(14300).constants.MAX_LENGTH;class PooledBuffer{constructor(r,i,s){this.buffers=[];this.capacity=r;this._size=0;const a=Math.ceil(r/$o);for(let i=0;i0){r[0]=r[0].slice(c)}}getReadableStream(){return new BuffersStream(this.buffers,this.size)}}class BufferScheduler{constructor(r,i,s,a,l,c){this.emitter=new y.EventEmitter;this.offset=0;this.isStreamEnd=false;this.isError=false;this.executingOutgoingHandlers=0;this.numBuffers=0;this.unresolvedDataArray=[];this.unresolvedLength=0;this.incoming=[];this.outgoing=[];if(i<=0){throw new RangeError(`bufferSize must be larger than 0, current is ${i}`)}if(s<=0){throw new RangeError(`maxBuffers must be larger than 0, current is ${s}`)}if(l<=0){throw new RangeError(`concurrency must be larger than 0, current is ${l}`)}this.bufferSize=i;this.maxBuffers=s;this.readable=r;this.outgoingHandler=a;this.concurrency=l;this.encoding=c}async do(){return new Promise(((r,i)=>{this.readable.on("data",(r=>{r=typeof r==="string"?Buffer.from(r,this.encoding):r;this.appendUnresolvedData(r);if(!this.resolveData()){this.readable.pause()}}));this.readable.on("error",(r=>{this.emitter.emit("error",r)}));this.readable.on("end",(()=>{this.isStreamEnd=true;this.emitter.emit("checkEnd")}));this.emitter.on("error",(r=>{this.isError=true;this.readable.pause();i(r)}));this.emitter.on("checkEnd",(()=>{if(this.outgoing.length>0){this.triggerOutgoingHandlers();return}if(this.isStreamEnd&&this.executingOutgoingHandlers===0){if(this.unresolvedLength>0&&this.unresolvedLengths.getReadableStream()),s.size,this.offset).then(r).catch(i)}else if(this.unresolvedLength>=this.bufferSize){return}else{r()}}}))}))}appendUnresolvedData(r){this.unresolvedDataArray.push(r);this.unresolvedLength+=r.length}shiftBufferFromUnresolvedDataArray(r){if(!r){r=new PooledBuffer(this.bufferSize,this.unresolvedDataArray,this.unresolvedLength)}else{r.fill(this.unresolvedDataArray,this.unresolvedLength)}this.unresolvedLength-=r.size;return r}resolveData(){while(this.unresolvedLength>=this.bufferSize){let r;if(this.incoming.length>0){r=this.incoming.shift();this.shiftBufferFromUnresolvedDataArray(r)}else{if(this.numBuffers=this.concurrency){return}r=this.outgoing.shift();if(r){this.triggerOutgoingHandler(r)}}while(r)}async triggerOutgoingHandler(r){const i=r.size;this.executingOutgoingHandlers++;this.offset+=i;try{await this.outgoingHandler((()=>r.getReadableStream()),i,this.offset-i)}catch(r){this.emitter.emit("error",r);return}this.executingOutgoingHandlers--;this.reuseBuffer(r);this.emitter.emit("checkEnd")}reuseBuffer(r){this.incoming.push(r);if(!this.isError&&this.resolveData()&&!this.isStreamEnd){this.readable.resume()}}}async function streamToBuffer(r,i,s,a,l){let c=0;const d=a-s;return new Promise(((a,p)=>{const u=setTimeout((()=>p(new Error(`The operation cannot be completed in timeout.`))),uo);r.on("readable",(()=>{if(c>=d){clearTimeout(u);a();return}let p=r.read();if(!p){return}if(typeof p==="string"){p=Buffer.from(p,l)}const A=c+p.length>d?d-c:p.length;i.fill(p.slice(0,A),s+c,s+c+A);c+=A}));r.on("end",(()=>{clearTimeout(u);if(c{clearTimeout(u);p(r)}))}))}async function streamToBuffer2(r,i,s){let a=0;const l=i.length;return new Promise(((c,d)=>{r.on("readable",(()=>{let c=r.read();if(!c){return}if(typeof c==="string"){c=Buffer.from(c,s)}if(a+c.length>l){d(new Error(`Stream exceeds buffer size. Buffer size: ${l}`));return}i.fill(c,a,a+c.length);a+=c.length}));r.on("end",(()=>{c(a)}));r.on("error",d)}))}async function readStreamToLocalFile(r,i){return new Promise(((s,a)=>{const l=I.createWriteStream(i);r.on("error",(r=>{a(r)}));l.on("error",(r=>{a(r)}));l.on("close",s);r.pipe(l)}))}const Xo=B.promisify(I.stat);const Ko=I.createReadStream;class BlobClient extends StorageClient{constructor(r,i,s,l){l=l||{};let c;let d;if(isPipelineLike(i)){d=r;c=i}else if(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i)){d=r;l=s;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){d=r;if(s&&typeof s!=="string"){l=s}c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&s&&typeof s==="string"){const p=i;const u=s;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(a.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=a.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(d,c);({blobName:this._name,containerName:this._containerName}=this.getBlobAndContainerNamesFromUrl());this.blobContext=new Blob$1(this.storageClientContext);this._snapshot=getURLParameter(this.url,fo.Parameters.SNAPSHOT);this._versionId=getURLParameter(this.url,fo.Parameters.VERSIONID)}get name(){return this._name}get containerName(){return this._containerName}withSnapshot(r){return new BlobClient(setURLParameter(this.url,fo.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}withVersion(r){return new BlobClient(setURLParameter(this.url,fo.Parameters.VERSIONID,r.length===0?undefined:r),this.pipeline)}getAppendBlobClient(){return new AppendBlobClient(this.url,this.pipeline)}getBlockBlobClient(){return new BlockBlobClient(this.url,this.pipeline)}getPageBlobClient(){return new PageBlobClient(this.url,this.pipeline)}async download(r=0,i,s={}){var l;s.conditions=s.conditions||{};s.conditions=s.conditions||{};ensureCpkIfSpecified(s.customerProvidedKey,this.isHttps);const{span:d,updatedOptions:p}=Mo("BlobClient-download",s);try{const c=await this.blobContext.download(Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(l=s.conditions)===null||l===void 0?void 0:l.tagConditions}),requestOptions:{onDownloadProgress:a.isNode?undefined:s.onProgress},range:r===0&&!i?undefined:rangeToString({offset:r,count:i}),rangeGetContentMD5:s.rangeGetContentMD5,rangeGetContentCRC64:s.rangeGetContentCrc64,snapshot:s.snapshot,cpkInfo:s.customerProvidedKey},convertTracingToRequestOptionsBase(p)));const d=Object.assign(Object.assign({},c),{_response:c._response,objectReplicationDestinationPolicyId:c.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(c.objectReplicationRules)});if(!a.isNode){return d}if(s.maxRetryRequests===undefined||s.maxRetryRequests<0){s.maxRetryRequests=po}if(c.contentLength===undefined){throw new RangeError(`File download response doesn't contain valid content length header`)}if(!c.etag){throw new RangeError(`File download response doesn't contain valid etag header`)}return new BlobDownloadResponse(d,(async i=>{var a;const l={leaseAccessConditions:s.conditions,modifiedAccessConditions:{ifMatch:s.conditions.ifMatch||c.etag,ifModifiedSince:s.conditions.ifModifiedSince,ifNoneMatch:s.conditions.ifNoneMatch,ifUnmodifiedSince:s.conditions.ifUnmodifiedSince,ifTags:(a=s.conditions)===null||a===void 0?void 0:a.tagConditions},range:rangeToString({count:r+c.contentLength-i,offset:i}),rangeGetContentMD5:s.rangeGetContentMD5,rangeGetContentCRC64:s.rangeGetContentCrc64,snapshot:s.snapshot,cpkInfo:s.customerProvidedKey};return(await this.blobContext.download(Object.assign({abortSignal:s.abortSignal},l))).readableStreamBody}),r,c.contentLength,{maxRetryRequests:s.maxRetryRequests,onProgress:s.onProgress})}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async exists(r={}){const{span:i,updatedOptions:s}=Mo("BlobClient-exists",r);try{ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);await this.getProperties({abortSignal:r.abortSignal,customerProvidedKey:r.customerProvidedKey,conditions:r.conditions,tracingOptions:s.tracingOptions});return true}catch(r){if(r.statusCode===404){return false}else if(r.statusCode===409&&(r.details.errorCode===Ro||r.details.errorCode===Qo)){return true}i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async getProperties(r={}){var i;const{span:s,updatedOptions:a}=Mo("BlobClient-getProperties",r);try{r.conditions=r.conditions||{};ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);const s=await this.blobContext.getProperties(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions}),cpkInfo:r.customerProvidedKey},convertTracingToRequestOptionsBase(a)));return Object.assign(Object.assign({},s),{_response:s._response,objectReplicationDestinationPolicyId:s.objectReplicationPolicyId,objectReplicationSourceProperties:parseObjectReplicationRecord(s.objectReplicationRules)})}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async delete(r={}){var i;const{span:s,updatedOptions:a}=Mo("BlobClient-delete",r);r.conditions=r.conditions||{};try{return await this.blobContext.delete(Object.assign({abortSignal:r.abortSignal,deleteSnapshots:r.deleteSnapshots,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions})},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async deleteIfExists(r={}){var i,s;const{span:a,updatedOptions:l}=Mo("BlobClient-deleteIfExists",r);try{const r=await this.delete(l);return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="BlobNotFound"){a.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when deleting a blob or snapshot only if it exists."});return Object.assign(Object.assign({succeeded:false},(s=r.response)===null||s===void 0?void 0:s.parsedHeaders),{_response:r.response})}a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async undelete(r={}){const{span:i,updatedOptions:s}=Mo("BlobClient-undelete",r);try{return await this.blobContext.undelete(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setHTTPHeaders(r,i={}){var s;const{span:a,updatedOptions:l}=Mo("BlobClient-setHTTPHeaders",i);i.conditions=i.conditions||{};try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blobContext.setHttpHeaders(Object.assign({abortSignal:i.abortSignal,blobHttpHeaders:r,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(l)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async setMetadata(r,i={}){var s;const{span:a,updatedOptions:l}=Mo("BlobClient-setMetadata",i);i.conditions=i.conditions||{};try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blobContext.setMetadata(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,metadata:r,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope},convertTracingToRequestOptionsBase(l)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async setTags(r,i={}){var s;const{span:a,updatedOptions:l}=Mo("BlobClient-setTags",i);try{return await this.blobContext.setTags(Object.assign(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(l)),{tags:toBlobTags(r)}))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async getTags(r={}){var i;const{span:s,updatedOptions:a}=Mo("BlobClient-getTags",r);try{const s=await this.blobContext.getTags(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions})},convertTracingToRequestOptionsBase(a)));const l=Object.assign(Object.assign({},s),{_response:s._response,tags:toTags({blobTagSet:s.blobTagSet})||{}});return l}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}getBlobLeaseClient(r){return new BlobLeaseClient(this,r)}async createSnapshot(r={}){var i;const{span:s,updatedOptions:a}=Mo("BlobClient-createSnapshot",r);r.conditions=r.conditions||{};try{ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return await this.blobContext.createSnapshot(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions}),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async beginCopyFromURL(r,i={}){const s={abortCopyFromURL:(...r)=>this.abortCopyFromURL(...r),getProperties:(...r)=>this.getProperties(...r),startCopyFromURL:(...r)=>this.startCopyFromURL(...r)};const a=new BlobBeginCopyFromUrlPoller({blobClient:s,copySource:r,intervalInMs:i.intervalInMs,onProgress:i.onProgress,resumeFrom:i.resumeFrom,startCopyFromURLOptions:i});await a.poll();return a}async abortCopyFromURL(r,i={}){const{span:s,updatedOptions:a}=Mo("BlobClient-abortCopyFromURL",i);try{return await this.blobContext.abortCopyFromURL(r,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async syncCopyFromURL(r,i={}){var s,a,l;const{span:d,updatedOptions:p}=Mo("BlobClient-syncCopyFromURL",i);i.conditions=i.conditions||{};i.sourceConditions=i.sourceConditions||{};try{return await this.blobContext.copyFromURL(r,Object.assign({abortSignal:i.abortSignal,metadata:i.metadata,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:i.sourceConditions.ifMatch,sourceIfModifiedSince:i.sourceConditions.ifModifiedSince,sourceIfNoneMatch:i.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:i.sourceConditions.ifUnmodifiedSince},sourceContentMD5:i.sourceContentMD5,copySourceAuthorization:httpAuthorizationToString(i.sourceAuthorization),tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags),immutabilityPolicyExpiry:(a=i.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(l=i.immutabilityPolicy)===null||l===void 0?void 0:l.policyMode,legalHold:i.legalHold,encryptionScope:i.encryptionScope,copySourceTags:i.copySourceTags},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async setAccessTier(r,i={}){var s;const{span:a,updatedOptions:l}=Mo("BlobClient-setAccessTier",i);try{return await this.blobContext.setTier(toAccessTier(r),Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),rehydratePriority:i.rehydratePriority},convertTracingToRequestOptionsBase(l)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async downloadToBuffer(r,i,s,a={}){let l;let d=0;let p=0;let u=a;if(r instanceof Buffer){l=r;d=i||0;p=typeof s==="number"?s:0}else{d=typeof r==="number"?r:0;p=typeof i==="number"?i:0;u=s||{}}const{span:A,updatedOptions:h}=Mo("BlobClient-downloadToBuffer",u);try{if(!u.blockSize){u.blockSize=0}if(u.blockSize<0){throw new RangeError("blockSize option must be >= 0")}if(u.blockSize===0){u.blockSize=co}if(d<0){throw new RangeError("offset option must be >= 0")}if(p&&p<=0){throw new RangeError("count option must be greater than 0")}if(!u.conditions){u.conditions={}}if(!p){const r=await this.getProperties(Object.assign(Object.assign({},u),{tracingOptions:Object.assign(Object.assign({},u.tracingOptions),convertTracingToRequestOptionsBase(h))}));p=r.contentLength-d;if(p<0){throw new RangeError(`offset ${d} shouldn't be larger than blob size ${r.contentLength}`)}}if(!l){try{l=Buffer.alloc(p)}catch(r){throw new Error(`Unable to allocate the buffer of size: ${p}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile".\t ${r.message}`)}}if(l.length{let i=d+p;if(s+u.blockSize{if(!(this.credential instanceof StorageSharedKeyCredential)){throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential")}const s=generateBlobSASQueryParameters(Object.assign({containerName:this._containerName,blobName:this._name,snapshotTime:this._snapshot,versionId:this._versionId},r),this.credential).toString();i(appendToURLQuery(this.url,s))}))}async deleteImmutabilityPolicy(r){const{span:i,updatedOptions:s}=Mo("BlobClient-deleteImmutabilityPolicy",r);try{return await this.blobContext.deleteImmutabilityPolicy(Object.assign({abortSignal:r===null||r===void 0?void 0:r.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setImmutabilityPolicy(r,i){const{span:s,updatedOptions:a}=Mo("BlobClient-setImmutabilityPolicy",i);try{return await this.blobContext.setImmutabilityPolicy(Object.assign({abortSignal:i===null||i===void 0?void 0:i.abortSignal,immutabilityPolicyExpiry:r.expiriesOn,immutabilityPolicyMode:r.policyMode,modifiedAccessConditions:i===null||i===void 0?void 0:i.modifiedAccessCondition},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async setLegalHold(r,i){const{span:s,updatedOptions:a}=Mo("BlobClient-setLegalHold",i);try{return await this.blobContext.setLegalHold(r,Object.assign({abortSignal:i===null||i===void 0?void 0:i.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}}class AppendBlobClient extends BlobClient{constructor(r,i,s,l){let c;let d;l=l||{};if(isPipelineLike(i)){d=r;c=i}else if(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i)){d=r;l=s;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){d=r;c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&s&&typeof s==="string"){const p=i;const u=s;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(a.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=a.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(d,c);this.appendBlobContext=new AppendBlob(this.storageClientContext)}withSnapshot(r){return new AppendBlobClient(setURLParameter(this.url,fo.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}async create(r={}){var i,s,a;const{span:l,updatedOptions:d}=Mo("AppendBlobClient-create",r);r.conditions=r.conditions||{};try{ensureCpkIfSpecified(r.customerProvidedKey,this.isHttps);return await this.appendBlobContext.create(0,Object.assign({abortSignal:r.abortSignal,blobHttpHeaders:r.blobHTTPHeaders,leaseAccessConditions:r.conditions,metadata:r.metadata,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions}),cpkInfo:r.customerProvidedKey,encryptionScope:r.encryptionScope,immutabilityPolicyExpiry:(s=r.immutabilityPolicy)===null||s===void 0?void 0:s.expiriesOn,immutabilityPolicyMode:(a=r.immutabilityPolicy)===null||a===void 0?void 0:a.policyMode,legalHold:r.legalHold,blobTagsString:toBlobTagsString(r.tags)},convertTracingToRequestOptionsBase(d)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async createIfNotExists(r={}){var i,s;const{span:a,updatedOptions:l}=Mo("AppendBlobClient-createIfNotExists",r);const d={ifNoneMatch:yo};try{const r=await this.create(Object.assign(Object.assign({},l),{conditions:d}));return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="BlobAlreadyExists"){a.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return Object.assign(Object.assign({succeeded:false},(s=r.response)===null||s===void 0?void 0:s.parsedHeaders),{_response:r.response})}a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async seal(r={}){var i;const{span:s,updatedOptions:a}=Mo("AppendBlobClient-seal",r);r.conditions=r.conditions||{};try{return await this.appendBlobContext.seal(Object.assign({abortSignal:r.abortSignal,appendPositionAccessConditions:r.conditions,leaseAccessConditions:r.conditions,modifiedAccessConditions:Object.assign(Object.assign({},r.conditions),{ifTags:(i=r.conditions)===null||i===void 0?void 0:i.tagConditions})},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async appendBlock(r,i,s={}){var a;const{span:l,updatedOptions:d}=Mo("AppendBlobClient-appendBlock",s);s.conditions=s.conditions||{};try{ensureCpkIfSpecified(s.customerProvidedKey,this.isHttps);return await this.appendBlobContext.appendBlock(i,r,Object.assign({abortSignal:s.abortSignal,appendPositionAccessConditions:s.conditions,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(a=s.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onUploadProgress:s.onProgress},transactionalContentMD5:s.transactionalContentMD5,transactionalContentCrc64:s.transactionalContentCrc64,cpkInfo:s.customerProvidedKey,encryptionScope:s.encryptionScope},convertTracingToRequestOptionsBase(d)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async appendBlockFromURL(r,i,s,a={}){var l;const{span:d,updatedOptions:p}=Mo("AppendBlobClient-appendBlockFromURL",a);a.conditions=a.conditions||{};a.sourceConditions=a.sourceConditions||{};try{ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return await this.appendBlobContext.appendBlockFromUrl(r,0,Object.assign({abortSignal:a.abortSignal,sourceRange:rangeToString({offset:i,count:s}),sourceContentMD5:a.sourceContentMD5,sourceContentCrc64:a.sourceContentCrc64,leaseAccessConditions:a.conditions,appendPositionAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(l=a.conditions)===null||l===void 0?void 0:l.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:a.sourceConditions.ifMatch,sourceIfModifiedSince:a.sourceConditions.ifModifiedSince,sourceIfNoneMatch:a.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:a.sourceConditions.ifUnmodifiedSince},copySourceAuthorization:httpAuthorizationToString(a.sourceAuthorization),cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}}class BlockBlobClient extends BlobClient{constructor(r,i,s,l){let c;let d;l=l||{};if(isPipelineLike(i)){d=r;c=i}else if(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i)){d=r;l=s;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){d=r;if(s&&typeof s!=="string"){l=s}c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&s&&typeof s==="string"){const p=i;const u=s;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(a.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=a.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(d,c);this.blockBlobContext=new BlockBlob(this.storageClientContext);this._blobContext=new Blob$1(this.storageClientContext)}withSnapshot(r){return new BlockBlobClient(setURLParameter(this.url,fo.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}async query(r,i={}){var s;ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);const{span:l,updatedOptions:d}=Mo("BlockBlobClient-query",i);try{if(!a.isNode){throw new Error("This operation currently is only supported in Node.js.")}ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);const l=await this._blobContext.query(Object.assign({abortSignal:i.abortSignal,queryRequest:{queryType:"SQL",expression:r,inputSerialization:toQuerySerialization(i.inputTextConfiguration),outputSerialization:toQuerySerialization(i.outputTextConfiguration)},leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),cpkInfo:i.customerProvidedKey},convertTracingToRequestOptionsBase(d)));return new BlobQueryResponse(l,{abortSignal:i.abortSignal,onProgress:i.onProgress,onError:i.onError})}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async upload(r,i,s={}){var a,l,d;s.conditions=s.conditions||{};const{span:p,updatedOptions:u}=Mo("BlockBlobClient-upload",s);try{ensureCpkIfSpecified(s.customerProvidedKey,this.isHttps);return await this.blockBlobContext.upload(i,r,Object.assign({abortSignal:s.abortSignal,blobHttpHeaders:s.blobHTTPHeaders,leaseAccessConditions:s.conditions,metadata:s.metadata,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(a=s.conditions)===null||a===void 0?void 0:a.tagConditions}),requestOptions:{onUploadProgress:s.onProgress},cpkInfo:s.customerProvidedKey,encryptionScope:s.encryptionScope,immutabilityPolicyExpiry:(l=s.immutabilityPolicy)===null||l===void 0?void 0:l.expiriesOn,immutabilityPolicyMode:(d=s.immutabilityPolicy)===null||d===void 0?void 0:d.policyMode,legalHold:s.legalHold,tier:toAccessTier(s.tier),blobTagsString:toBlobTagsString(s.tags)},convertTracingToRequestOptionsBase(u)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async syncUploadFromURL(r,i={}){var s,a,l,d,p;i.conditions=i.conditions||{};const{span:u,updatedOptions:A}=Mo("BlockBlobClient-syncUploadFromURL",i);try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blockBlobContext.putBlobFromUrl(0,r,Object.assign(Object.assign(Object.assign({},i),{blobHttpHeaders:i.blobHTTPHeaders,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:i.conditions.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:(s=i.sourceConditions)===null||s===void 0?void 0:s.ifMatch,sourceIfModifiedSince:(a=i.sourceConditions)===null||a===void 0?void 0:a.ifModifiedSince,sourceIfNoneMatch:(l=i.sourceConditions)===null||l===void 0?void 0:l.ifNoneMatch,sourceIfUnmodifiedSince:(d=i.sourceConditions)===null||d===void 0?void 0:d.ifUnmodifiedSince,sourceIfTags:(p=i.sourceConditions)===null||p===void 0?void 0:p.tagConditions},cpkInfo:i.customerProvidedKey,copySourceAuthorization:httpAuthorizationToString(i.sourceAuthorization),tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags),copySourceTags:i.copySourceTags}),convertTracingToRequestOptionsBase(A)))}catch(r){u.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{u.end()}}async stageBlock(r,i,s,a={}){const{span:l,updatedOptions:d}=Mo("BlockBlobClient-stageBlock",a);try{ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return await this.blockBlobContext.stageBlock(r,s,i,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,requestOptions:{onUploadProgress:a.onProgress},transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(d)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async stageBlockFromURL(r,i,s=0,a,l={}){const{span:d,updatedOptions:p}=Mo("BlockBlobClient-stageBlockFromURL",l);try{ensureCpkIfSpecified(l.customerProvidedKey,this.isHttps);return await this.blockBlobContext.stageBlockFromURL(r,0,i,Object.assign({abortSignal:l.abortSignal,leaseAccessConditions:l.conditions,sourceContentMD5:l.sourceContentMD5,sourceContentCrc64:l.sourceContentCrc64,sourceRange:s===0&&!a?undefined:rangeToString({offset:s,count:a}),cpkInfo:l.customerProvidedKey,encryptionScope:l.encryptionScope,copySourceAuthorization:httpAuthorizationToString(l.sourceAuthorization)},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async commitBlockList(r,i={}){var s,a,l;i.conditions=i.conditions||{};const{span:d,updatedOptions:p}=Mo("BlockBlobClient-commitBlockList",i);try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.blockBlobContext.commitBlockList({latest:r},Object.assign({abortSignal:i.abortSignal,blobHttpHeaders:i.blobHTTPHeaders,leaseAccessConditions:i.conditions,metadata:i.metadata,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,immutabilityPolicyExpiry:(a=i.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(l=i.immutabilityPolicy)===null||l===void 0?void 0:l.policyMode,legalHold:i.legalHold,tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags)},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async getBlockList(r,i={}){var s;const{span:a,updatedOptions:l}=Mo("BlockBlobClient-getBlockList",i);try{const a=await this.blockBlobContext.getBlockList(r,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(l)));if(!a.committedBlocks){a.committedBlocks=[]}if(!a.uncommittedBlocks){a.uncommittedBlocks=[]}return a}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async uploadData(r,i={}){const{span:s,updatedOptions:l}=Mo("BlockBlobClient-uploadData",i);try{if(a.isNode){let i;if(r instanceof Buffer){i=r}else if(r instanceof ArrayBuffer){i=Buffer.from(r)}else{r=r;i=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}return this.uploadSeekableInternal(((r,s)=>i.slice(r,r+s)),i.byteLength,l)}else{const i=new Blob([r]);return this.uploadSeekableInternal(((r,s)=>i.slice(r,r+s)),i.size,l)}}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async uploadBrowserData(r,i={}){const{span:s,updatedOptions:a}=Mo("BlockBlobClient-uploadBrowserData",i);try{const i=new Blob([r]);return await this.uploadSeekableInternal(((r,s)=>i.slice(r,r+s)),i.size,a)}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async uploadSeekableInternal(r,i,s={}){if(!s.blockSize){s.blockSize=0}if(s.blockSize<0||s.blockSize>ao){throw new RangeError(`blockSize option must be >= 0 and <= ${ao}`)}if(s.maxSingleShotSize!==0&&!s.maxSingleShotSize){s.maxSingleShotSize=so}if(s.maxSingleShotSize<0||s.maxSingleShotSize>so){throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${so}`)}if(s.blockSize===0){if(i>ao*oo){throw new RangeError(`${i} is too larger to upload to a block blob.`)}if(i>s.maxSingleShotSize){s.blockSize=Math.ceil(i/oo);if(s.blockSizeoo){throw new RangeError(`The buffer's size is too big or the BlockSize is too small;`+`the number of blocks must be <= ${oo}`)}const c=[];const p=a.generateUuid();let u=0;const A=new Batch(s.concurrency);for(let a=0;a{const A=generateBlockID(p,a);const h=s.blockSize*a;const g=a===l-1?i:h+s.blockSize;const y=g-h;c.push(A);await this.stageBlock(A,r(h,y),y,{abortSignal:s.abortSignal,conditions:s.conditions,encryptionScope:s.encryptionScope,tracingOptions:d.tracingOptions});u+=y;if(s.onProgress){s.onProgress({loadedBytes:u})}}))}await A.do();return this.commitBlockList(c,d)}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async uploadFile(r,i={}){const{span:s,updatedOptions:a}=Mo("BlockBlobClient-uploadFile",i);try{const s=(await Xo(r)).size;return await this.uploadSeekableInternal(((i,s)=>()=>Ko(r,{autoClose:true,end:s?i+s-1:Infinity,start:i})),s,Object.assign(Object.assign({},i),{tracingOptions:Object.assign(Object.assign({},i.tracingOptions),convertTracingToRequestOptionsBase(a))}))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async uploadStream(r,i=lo,s=5,l={}){if(!l.blobHTTPHeaders){l.blobHTTPHeaders={}}if(!l.conditions){l.conditions={}}const{span:d,updatedOptions:p}=Mo("BlockBlobClient-uploadStream",l);try{let c=0;const d=a.generateUuid();let u=0;const A=[];const h=new BufferScheduler(r,i,s,(async(r,i)=>{const s=generateBlockID(d,c);A.push(s);c++;await this.stageBlock(s,r,i,{conditions:l.conditions,encryptionScope:l.encryptionScope,tracingOptions:p.tracingOptions});u+=i;if(l.onProgress){l.onProgress({loadedBytes:u})}}),Math.ceil(s/4*3));await h.do();return await this.commitBlockList(A,Object.assign(Object.assign({},l),{tracingOptions:Object.assign(Object.assign({},l.tracingOptions),convertTracingToRequestOptionsBase(p))}))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}}class PageBlobClient extends BlobClient{constructor(r,i,s,l){let c;let d;l=l||{};if(isPipelineLike(i)){d=r;c=i}else if(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i)){d=r;l=s;c=newPipeline(i,l)}else if(!i&&typeof i!=="string"){d=r;c=newPipeline(new AnonymousCredential,l)}else if(i&&typeof i==="string"&&s&&typeof s==="string"){const p=i;const u=s;const A=extractConnectionStringParts(r);if(A.kind==="AccountConnString"){if(a.isNode){const r=new StorageSharedKeyCredential(A.accountName,A.accountKey);d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u));if(!l.proxyOptions){l.proxyOptions=a.getDefaultProxySettings(A.proxyUri)}c=newPipeline(r,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(A.kind==="SASConnString"){d=appendToURLPath(appendToURLPath(A.url,encodeURIComponent(p)),encodeURIComponent(u))+"?"+A.accountSas;c=newPipeline(new AnonymousCredential,l)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName and blobName parameters")}super(d,c);this.pageBlobContext=new PageBlob(this.storageClientContext)}withSnapshot(r){return new PageBlobClient(setURLParameter(this.url,fo.Parameters.SNAPSHOT,r.length===0?undefined:r),this.pipeline)}async create(r,i={}){var s,a,l;i.conditions=i.conditions||{};const{span:d,updatedOptions:p}=Mo("PageBlobClient-create",i);try{ensureCpkIfSpecified(i.customerProvidedKey,this.isHttps);return await this.pageBlobContext.create(0,r,Object.assign({abortSignal:i.abortSignal,blobHttpHeaders:i.blobHTTPHeaders,blobSequenceNumber:i.blobSequenceNumber,leaseAccessConditions:i.conditions,metadata:i.metadata,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),cpkInfo:i.customerProvidedKey,encryptionScope:i.encryptionScope,immutabilityPolicyExpiry:(a=i.immutabilityPolicy)===null||a===void 0?void 0:a.expiriesOn,immutabilityPolicyMode:(l=i.immutabilityPolicy)===null||l===void 0?void 0:l.policyMode,legalHold:i.legalHold,tier:toAccessTier(i.tier),blobTagsString:toBlobTagsString(i.tags)},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async createIfNotExists(r,i={}){var s,a;const{span:l,updatedOptions:d}=Mo("PageBlobClient-createIfNotExists",i);try{const s={ifNoneMatch:yo};const a=await this.create(r,Object.assign(Object.assign({},i),{conditions:s,tracingOptions:d.tracingOptions}));return Object.assign(Object.assign({succeeded:true},a),{_response:a._response})}catch(r){if(((s=r.details)===null||s===void 0?void 0:s.errorCode)==="BlobAlreadyExists"){l.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when creating a blob only if it does not already exist."});return Object.assign(Object.assign({succeeded:false},(a=r.response)===null||a===void 0?void 0:a.parsedHeaders),{_response:r.response})}l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async uploadPages(r,i,s,a={}){var l;a.conditions=a.conditions||{};const{span:d,updatedOptions:p}=Mo("PageBlobClient-uploadPages",a);try{ensureCpkIfSpecified(a.customerProvidedKey,this.isHttps);return await this.pageBlobContext.uploadPages(s,r,Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(l=a.conditions)===null||l===void 0?void 0:l.tagConditions}),requestOptions:{onUploadProgress:a.onProgress},range:rangeToString({offset:i,count:s}),sequenceNumberAccessConditions:a.conditions,transactionalContentMD5:a.transactionalContentMD5,transactionalContentCrc64:a.transactionalContentCrc64,cpkInfo:a.customerProvidedKey,encryptionScope:a.encryptionScope},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async uploadPagesFromURL(r,i,s,a,l={}){var d;l.conditions=l.conditions||{};l.sourceConditions=l.sourceConditions||{};const{span:p,updatedOptions:u}=Mo("PageBlobClient-uploadPagesFromURL",l);try{ensureCpkIfSpecified(l.customerProvidedKey,this.isHttps);return await this.pageBlobContext.uploadPagesFromURL(r,rangeToString({offset:i,count:a}),0,rangeToString({offset:s,count:a}),Object.assign({abortSignal:l.abortSignal,sourceContentMD5:l.sourceContentMD5,sourceContentCrc64:l.sourceContentCrc64,leaseAccessConditions:l.conditions,sequenceNumberAccessConditions:l.conditions,modifiedAccessConditions:Object.assign(Object.assign({},l.conditions),{ifTags:(d=l.conditions)===null||d===void 0?void 0:d.tagConditions}),sourceModifiedAccessConditions:{sourceIfMatch:l.sourceConditions.ifMatch,sourceIfModifiedSince:l.sourceConditions.ifModifiedSince,sourceIfNoneMatch:l.sourceConditions.ifNoneMatch,sourceIfUnmodifiedSince:l.sourceConditions.ifUnmodifiedSince},cpkInfo:l.customerProvidedKey,encryptionScope:l.encryptionScope,copySourceAuthorization:httpAuthorizationToString(l.sourceAuthorization)},convertTracingToRequestOptionsBase(u)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async clearPages(r=0,i,s={}){var a;s.conditions=s.conditions||{};const{span:l,updatedOptions:d}=Mo("PageBlobClient-clearPages",s);try{return await this.pageBlobContext.clearPages(0,Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(a=s.conditions)===null||a===void 0?void 0:a.tagConditions}),range:rangeToString({offset:r,count:i}),sequenceNumberAccessConditions:s.conditions,cpkInfo:s.customerProvidedKey,encryptionScope:s.encryptionScope},convertTracingToRequestOptionsBase(d)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async getPageRanges(r=0,i,s={}){var a;s.conditions=s.conditions||{};const{span:l,updatedOptions:d}=Mo("PageBlobClient-getPageRanges",s);try{return await this.pageBlobContext.getPageRanges(Object.assign({abortSignal:s.abortSignal,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(a=s.conditions)===null||a===void 0?void 0:a.tagConditions}),range:rangeToString({offset:r,count:i})},convertTracingToRequestOptionsBase(d))).then(rangeResponseFromModel)}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async listPageRangesSegment(r=0,i,s,a={}){var l;const{span:d,updatedOptions:p}=Mo("PageBlobClient-getPageRangesSegment",a);try{return await this.pageBlobContext.getPageRanges(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(l=a.conditions)===null||l===void 0?void 0:l.tagConditions}),range:rangeToString({offset:r,count:i}),marker:s,maxPageSize:a.maxPageSize},convertTracingToRequestOptionsBase(p)))}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}listPageRangeItemSegments(r=0,i,s,a={}){return l.__asyncGenerator(this,arguments,(function*listPageRangeItemSegments_1(){let c;if(!!s||s===undefined){do{c=yield l.__await(this.listPageRangesSegment(r,i,s,a));s=c.continuationToken;yield yield l.__await(yield l.__await(c))}while(s)}}))}listPageRangeItems(r=0,i,s={}){return l.__asyncGenerator(this,arguments,(function*listPageRangeItems_1(){var a,c;let d;try{for(var p=l.__asyncValues(this.listPageRangeItemSegments(r,i,d,s)),u;u=yield l.__await(p.next()),!u.done;){const r=u.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(ExtractPageRangeInfoItems(r))))}}catch(r){a={error:r}}finally{try{if(u&&!u.done&&(c=p.return))yield l.__await(c.call(p))}finally{if(a)throw a.error}}}))}listPageRanges(r=0,i,s={}){s.conditions=s.conditions||{};const a=this.listPageRangeItems(r,i,s);return{next(){return a.next()},[Symbol.asyncIterator](){return this},byPage:(a={})=>this.listPageRangeItemSegments(r,i,a.continuationToken,Object.assign({maxPageSize:a.maxPageSize},s))}}async getPageRangesDiff(r,i,s,a={}){var l;a.conditions=a.conditions||{};const{span:d,updatedOptions:p}=Mo("PageBlobClient-getPageRangesDiff",a);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(l=a.conditions)===null||l===void 0?void 0:l.tagConditions}),prevsnapshot:s,range:rangeToString({offset:r,count:i})},convertTracingToRequestOptionsBase(p))).then(rangeResponseFromModel)}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async listPageRangesDiffSegment(r,i,s,a,l){var d;const{span:p,updatedOptions:u}=Mo("PageBlobClient-getPageRangesDiffSegment",l);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:l===null||l===void 0?void 0:l.abortSignal,leaseAccessConditions:l===null||l===void 0?void 0:l.conditions,modifiedAccessConditions:Object.assign(Object.assign({},l===null||l===void 0?void 0:l.conditions),{ifTags:(d=l===null||l===void 0?void 0:l.conditions)===null||d===void 0?void 0:d.tagConditions}),prevsnapshot:s,range:rangeToString({offset:r,count:i}),marker:a,maxPageSize:l===null||l===void 0?void 0:l.maxPageSize},convertTracingToRequestOptionsBase(u)))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}listPageRangeDiffItemSegments(r,i,s,a,c){return l.__asyncGenerator(this,arguments,(function*listPageRangeDiffItemSegments_1(){let d;if(!!a||a===undefined){do{d=yield l.__await(this.listPageRangesDiffSegment(r,i,s,a,c));a=d.continuationToken;yield yield l.__await(yield l.__await(d))}while(a)}}))}listPageRangeDiffItems(r,i,s,a){return l.__asyncGenerator(this,arguments,(function*listPageRangeDiffItems_1(){var c,d;let p;try{for(var u=l.__asyncValues(this.listPageRangeDiffItemSegments(r,i,s,p,a)),A;A=yield l.__await(u.next()),!A.done;){const r=A.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(ExtractPageRangeInfoItems(r))))}}catch(r){c={error:r}}finally{try{if(A&&!A.done&&(d=u.return))yield l.__await(d.call(u))}finally{if(c)throw c.error}}}))}listPageRangesDiff(r,i,s,a={}){a.conditions=a.conditions||{};const l=this.listPageRangeDiffItems(r,i,s,Object.assign({},a));return{next(){return l.next()},[Symbol.asyncIterator](){return this},byPage:(l={})=>this.listPageRangeDiffItemSegments(r,i,s,l.continuationToken,Object.assign({maxPageSize:l.maxPageSize},a))}}async getPageRangesDiffForManagedDisks(r,i,s,a={}){var l;a.conditions=a.conditions||{};const{span:d,updatedOptions:p}=Mo("PageBlobClient-GetPageRangesDiffForManagedDisks",a);try{return await this.pageBlobContext.getPageRangesDiff(Object.assign({abortSignal:a.abortSignal,leaseAccessConditions:a.conditions,modifiedAccessConditions:Object.assign(Object.assign({},a.conditions),{ifTags:(l=a.conditions)===null||l===void 0?void 0:l.tagConditions}),prevSnapshotUrl:s,range:rangeToString({offset:r,count:i})},convertTracingToRequestOptionsBase(p))).then(rangeResponseFromModel)}catch(r){d.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{d.end()}}async resize(r,i={}){var s;i.conditions=i.conditions||{};const{span:a,updatedOptions:l}=Mo("PageBlobClient-resize",i);try{return await this.pageBlobContext.resize(r,Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions}),encryptionScope:i.encryptionScope},convertTracingToRequestOptionsBase(l)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async updateSequenceNumber(r,i,s={}){var a;s.conditions=s.conditions||{};const{span:l,updatedOptions:d}=Mo("PageBlobClient-updateSequenceNumber",s);try{return await this.pageBlobContext.updateSequenceNumber(r,Object.assign({abortSignal:s.abortSignal,blobSequenceNumber:i,leaseAccessConditions:s.conditions,modifiedAccessConditions:Object.assign(Object.assign({},s.conditions),{ifTags:(a=s.conditions)===null||a===void 0?void 0:a.tagConditions})},convertTracingToRequestOptionsBase(d)))}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async startCopyIncremental(r,i={}){var s;const{span:a,updatedOptions:l}=Mo("PageBlobClient-startCopyIncremental",i);try{return await this.pageBlobContext.copyIncremental(r,Object.assign({abortSignal:i.abortSignal,modifiedAccessConditions:Object.assign(Object.assign({},i.conditions),{ifTags:(s=i.conditions)===null||s===void 0?void 0:s.tagConditions})},convertTracingToRequestOptionsBase(l)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}}async function getBodyAsText(r){let i=Buffer.alloc(wo);const s=await streamToBuffer2(r.readableStreamBody,i);i=i.slice(0,s);return i.toString()}function utf8ByteLength(r){return Buffer.byteLength(r)}const Zo=": ";const el=" ";const tl=-1;class BatchResponseParser{constructor(r,i){if(!r||!r.contentType){throw new RangeError("batchResponse is malformed or doesn't contain valid content-type.")}if(!i||i.size===0){throw new RangeError("Invalid state: subRequests is not provided or size is 0.")}this.batchResponse=r;this.subRequests=i;this.responseBatchBoundary=this.batchResponse.contentType.split("=")[1];this.perResponsePrefix=`--${this.responseBatchBoundary}${Co}`;this.batchResponseEnding=`--${this.responseBatchBoundary}--`}async parseBatchResponse(){if(this.batchResponse._response.status!==mo.HTTP_ACCEPTED){throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`)}const r=await getBodyAsText(this.batchResponse);const i=r.split(this.batchResponseEnding)[0].split(this.perResponsePrefix).slice(1);const s=i.length;if(s!==this.subRequests.size&&s!==1){throw new Error("Invalid state: sub responses' count is not equal to sub requests' count.")}const l=new Array(s);let c=0;let d=0;for(let r=0;r=0&&y{if(this.keys[r]===undefined||this.keys[r]===rl.UNLOCKED){this.keys[r]=rl.LOCKED;i()}else{this.onUnlockEvent(r,(()=>{this.keys[r]=rl.LOCKED;i()}))}}))}static async unlock(r){return new Promise((i=>{if(this.keys[r]===rl.LOCKED){this.emitUnlockEvent(r)}delete this.keys[r];i()}))}static onUnlockEvent(r,i){if(this.listeners[r]===undefined){this.listeners[r]=[i]}else{this.listeners[r].push(i)}}static emitUnlockEvent(r){if(this.listeners[r]!==undefined&&this.listeners[r].length>0){const i=this.listeners[r].shift();setImmediate((()=>{i.call(this)}))}}}Mutex.keys={};Mutex.listeners={};class BlobBatch{constructor(){this.batch="batch";this.batchRequest=new InnerBatchRequest}getMultiPartContentType(){return this.batchRequest.getMultipartContentType()}getHttpRequestBody(){return this.batchRequest.getHttpRequestBody()}getSubRequests(){return this.batchRequest.getSubRequests()}async addSubRequestInternal(r,i){await Mutex.lock(this.batch);try{this.batchRequest.preAddSubRequest(r);await i();this.batchRequest.postAddSubRequest(r)}finally{await Mutex.unlock(this.batch)}}setBatchType(r){if(!this.batchType){this.batchType=r}if(this.batchType!==r){throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`)}}async deleteBlob(r,i,s){let l;let d;if(typeof r==="string"&&(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i))){l=r;d=i}else if(r instanceof BlobClient){l=r.url;d=r.credential;s=i}else{throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.")}if(!s){s={}}const{span:p,updatedOptions:u}=Mo("BatchDeleteRequest-addSubRequest",s);try{this.setBatchType("delete");await this.addSubRequestInternal({url:l,credential:d},(async()=>{await new BlobClient(l,this.batchRequest.createPipeline(d)).delete(u)}))}catch(r){p.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{p.end()}}async setBlobAccessTier(r,i,s,l){let d;let p;let u;if(typeof r==="string"&&(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i))){d=r;p=i;u=s}else if(r instanceof BlobClient){d=r.url;p=r.credential;u=i;l=s}else{throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided.")}if(!l){l={}}const{span:A,updatedOptions:h}=Mo("BatchSetTierRequest-addSubRequest",l);try{this.setBatchType("setAccessTier");await this.addSubRequestInternal({url:d,credential:p},(async()=>{await new BlobClient(d,this.batchRequest.createPipeline(p)).setAccessTier(u,h)}))}catch(r){A.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{A.end()}}}class InnerBatchRequest{constructor(){this.operationCount=0;this.body="";const r=a.generateUuid();this.boundary=`batch_${r}`;this.subRequestPrefix=`--${this.boundary}${Co}${ho.CONTENT_TYPE}: application/http${Co}${ho.CONTENT_TRANSFER_ENCODING}: binary`;this.multipartContentType=`multipart/mixed; boundary=${this.boundary}`;this.batchRequestEnding=`--${this.boundary}--`;this.subRequests=new Map}createPipeline(r){const i=r instanceof AnonymousCredential;const s=3+(i?0:1);const l=new Array(s);l[0]=a.deserializationPolicy();l[1]=new BatchHeaderFilterPolicyFactory;if(!i){l[2]=a.isTokenCredential(r)?attachCredential(a.bearerTokenAuthenticationPolicy(r,Ao),r):r}l[s-1]=new BatchRequestAssemblePolicyFactory(this);return new Pipeline(l,{})}appendSubRequestToBody(r){this.body+=[this.subRequestPrefix,`${ho.CONTENT_ID}: ${this.operationCount}`,"",`${r.method.toString()} ${getURLPathAndQuery(r.url)} ${vo}${Co}`].join(Co);for(const i of r.headers.headersArray()){this.body+=`${i.name}: ${i.value}${Co}`}this.body+=Co}preAddSubRequest(r){if(this.operationCount>=Eo){throw new RangeError(`Cannot exceed ${Eo} sub requests in a single batch`)}const i=getURLPath(r.url);if(!i||i===""){throw new RangeError(`Invalid url for sub request: '${r.url}'`)}}postAddSubRequest(r){this.subRequests.set(this.operationCount,r);this.operationCount++}getHttpRequestBody(){return`${this.body}${this.batchRequestEnding}${Co}`}getMultipartContentType(){return this.multipartContentType}getSubRequests(){return this.subRequests}}class BatchRequestAssemblePolicy extends a.BaseRequestPolicy{constructor(r,i,s){super(i,s);this.dummyResponse={request:new a.WebResource,status:200,headers:new a.HttpHeaders};this.batchRequest=r}async sendRequest(r){await this.batchRequest.appendSubRequestToBody(r);return this.dummyResponse}}class BatchRequestAssemblePolicyFactory{constructor(r){this.batchRequest=r}create(r,i){return new BatchRequestAssemblePolicy(this.batchRequest,r,i)}}class BatchHeaderFilterPolicy extends a.BaseRequestPolicy{constructor(r,i){super(r,i)}async sendRequest(r){let i="";for(const s of r.headers.headersArray()){if(iEqual(s.name,ho.X_MS_VERSION)){i=s.name}}if(i!==""){r.headers.remove(i)}return this._nextPolicy.sendRequest(r)}}class BatchHeaderFilterPolicyFactory{create(r,i){return new BatchHeaderFilterPolicy(r,i)}}class BlobBatchClient{constructor(r,i,s){let a;if(isPipelineLike(i)){a=i}else if(!i){a=newPipeline(new AnonymousCredential,s)}else{a=newPipeline(i,s)}const l=new StorageClientContext(r,a.toServiceClientOptions());const c=getURLPath(r);if(c&&c!=="/"){this.serviceOrContainerContext=new Container(l)}else{this.serviceOrContainerContext=new Service(l)}}createBatch(){return new BlobBatch}async deleteBlobs(r,i,s){const a=new BlobBatch;for(const l of r){if(typeof l==="string"){await a.deleteBlob(l,i,s)}else{await a.deleteBlob(l,i)}}return this.submitBatch(a)}async setBlobsAccessTier(r,i,s,a){const l=new BlobBatch;for(const c of r){if(typeof c==="string"){await l.setBlobAccessTier(c,i,s,a)}else{await l.setBlobAccessTier(c,i,s)}}return this.submitBatch(l)}async submitBatch(r,i={}){if(!r||r.getSubRequests().size===0){throw new RangeError("Batch request should contain one or more sub requests.")}const{span:s,updatedOptions:a}=Mo("BlobBatchClient-submitBatch",i);try{const s=r.getHttpRequestBody();const l=await this.serviceOrContainerContext.submitBatch(utf8ByteLength(s),r.getMultiPartContentType(),s,Object.assign(Object.assign({},i),convertTracingToRequestOptionsBase(a)));const c=new BatchResponseParser(l,r.getSubRequests());const d=await c.parseBatchResponse();const p={_response:l._response,contentType:l.contentType,errorCode:l.errorCode,requestId:l.requestId,clientRequestId:l.clientRequestId,version:l.version,subResponses:d.subResponses,subResponsesSucceededCount:d.subResponsesSucceededCount,subResponsesFailedCount:d.subResponsesFailedCount};return p}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}}class ContainerClient extends StorageClient{constructor(r,i,s){let l;let c;s=s||{};if(isPipelineLike(i)){c=r;l=i}else if(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i)){c=r;l=newPipeline(i,s)}else if(!i&&typeof i!=="string"){c=r;l=newPipeline(new AnonymousCredential,s)}else if(i&&typeof i==="string"){const d=i;const p=extractConnectionStringParts(r);if(p.kind==="AccountConnString"){if(a.isNode){const r=new StorageSharedKeyCredential(p.accountName,p.accountKey);c=appendToURLPath(p.url,encodeURIComponent(d));if(!s.proxyOptions){s.proxyOptions=a.getDefaultProxySettings(p.proxyUri)}l=newPipeline(r,s)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(p.kind==="SASConnString"){c=appendToURLPath(p.url,encodeURIComponent(d))+"?"+p.accountSas;l=newPipeline(new AnonymousCredential,s)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}else{throw new Error("Expecting non-empty strings for containerName parameter")}super(c,l);this._containerName=this.getContainerNameFromUrl();this.containerContext=new Container(this.storageClientContext)}get containerName(){return this._containerName}async create(r={}){const{span:i,updatedOptions:s}=Mo("ContainerClient-create",r);try{return await this.containerContext.create(Object.assign(Object.assign({},r),convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async createIfNotExists(r={}){var i,s;const{span:a,updatedOptions:l}=Mo("ContainerClient-createIfNotExists",r);try{const r=await this.create(l);return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="ContainerAlreadyExists"){a.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when creating a container only if it does not already exist."});return Object.assign(Object.assign({succeeded:false},(s=r.response)===null||s===void 0?void 0:s.parsedHeaders),{_response:r.response})}a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async exists(r={}){const{span:i,updatedOptions:s}=Mo("ContainerClient-exists",r);try{await this.getProperties({abortSignal:r.abortSignal,tracingOptions:s.tracingOptions});return true}catch(r){if(r.statusCode===404){i.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when checking container existence"});return false}i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}getBlobClient(r){return new BlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}getAppendBlobClient(r){return new AppendBlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}getBlockBlobClient(r){return new BlockBlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}getPageBlobClient(r){return new PageBlobClient(appendToURLPath(this.url,EscapePath(r)),this.pipeline)}async getProperties(r={}){if(!r.conditions){r.conditions={}}const{span:i,updatedOptions:s}=Mo("ContainerClient-getProperties",r);try{return await this.containerContext.getProperties(Object.assign(Object.assign({abortSignal:r.abortSignal},r.conditions),convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async delete(r={}){if(!r.conditions){r.conditions={}}const{span:i,updatedOptions:s}=Mo("ContainerClient-delete",r);try{return await this.containerContext.delete(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions,modifiedAccessConditions:r.conditions},convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async deleteIfExists(r={}){var i,s;const{span:a,updatedOptions:l}=Mo("ContainerClient-deleteIfExists",r);try{const r=await this.delete(l);return Object.assign(Object.assign({succeeded:true},r),{_response:r._response})}catch(r){if(((i=r.details)===null||i===void 0?void 0:i.errorCode)==="ContainerNotFound"){a.setStatus({code:c.SpanStatusCode.ERROR,message:"Expected exception when deleting a container only if it exists."});return Object.assign(Object.assign({succeeded:false},(s=r.response)===null||s===void 0?void 0:s.parsedHeaders),{_response:r.response})}a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async setMetadata(r,i={}){if(!i.conditions){i.conditions={}}if(i.conditions.ifUnmodifiedSince){throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service")}const{span:s,updatedOptions:a}=Mo("ContainerClient-setMetadata",i);try{return await this.containerContext.setMetadata(Object.assign({abortSignal:i.abortSignal,leaseAccessConditions:i.conditions,metadata:r,modifiedAccessConditions:i.conditions},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async getAccessPolicy(r={}){if(!r.conditions){r.conditions={}}const{span:i,updatedOptions:s}=Mo("ContainerClient-getAccessPolicy",r);try{const i=await this.containerContext.getAccessPolicy(Object.assign({abortSignal:r.abortSignal,leaseAccessConditions:r.conditions},convertTracingToRequestOptionsBase(s)));const a={_response:i._response,blobPublicAccess:i.blobPublicAccess,date:i.date,etag:i.etag,errorCode:i.errorCode,lastModified:i.lastModified,requestId:i.requestId,clientRequestId:i.clientRequestId,signedIdentifiers:[],version:i.version};for(const r of i){let i=undefined;if(r.accessPolicy){i={permissions:r.accessPolicy.permissions};if(r.accessPolicy.expiresOn){i.expiresOn=new Date(r.accessPolicy.expiresOn)}if(r.accessPolicy.startsOn){i.startsOn=new Date(r.accessPolicy.startsOn)}}a.signedIdentifiers.push({accessPolicy:i,id:r.id})}return a}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setAccessPolicy(r,i,s={}){s.conditions=s.conditions||{};const{span:a,updatedOptions:l}=Mo("ContainerClient-setAccessPolicy",s);try{const a=[];for(const r of i||[]){a.push({accessPolicy:{expiresOn:r.accessPolicy.expiresOn?truncatedISO8061Date(r.accessPolicy.expiresOn):"",permissions:r.accessPolicy.permissions,startsOn:r.accessPolicy.startsOn?truncatedISO8061Date(r.accessPolicy.startsOn):""},id:r.id})}return await this.containerContext.setAccessPolicy(Object.assign({abortSignal:s.abortSignal,access:r,containerAcl:a,leaseAccessConditions:s.conditions,modifiedAccessConditions:s.conditions},convertTracingToRequestOptionsBase(l)))}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}getBlobLeaseClient(r){return new BlobLeaseClient(this,r)}async uploadBlockBlob(r,i,s,a={}){const{span:l,updatedOptions:d}=Mo("ContainerClient-uploadBlockBlob",a);try{const a=this.getBlockBlobClient(r);const l=await a.upload(i,s,d);return{blockBlobClient:a,response:l}}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async deleteBlob(r,i={}){const{span:s,updatedOptions:a}=Mo("ContainerClient-deleteBlob",i);try{let s=this.getBlobClient(r);if(i.versionId){s=s.withVersion(i.versionId)}return await s.delete(a)}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async listBlobFlatSegment(r,i={}){const{span:s,updatedOptions:a}=Mo("ContainerClient-listBlobFlatSegment",i);try{const s=await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({marker:r},i),convertTracingToRequestOptionsBase(a)));const l=Object.assign(Object.assign({},s),{_response:Object.assign(Object.assign({},s._response),{parsedBody:ConvertInternalResponseOfListBlobFlat(s._response.parsedBody)}),segment:Object.assign(Object.assign({},s.segment),{blobItems:s.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name),tags:toTags(r.blobTags),objectReplicationSourceProperties:parseObjectReplicationRecord(r.objectReplicationMetadata)});return i}))})});return l}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async listBlobHierarchySegment(r,i,s={}){var a;const{span:l,updatedOptions:d}=Mo("ContainerClient-listBlobHierarchySegment",s);try{const l=await this.containerContext.listBlobHierarchySegment(r,Object.assign(Object.assign({marker:i},s),convertTracingToRequestOptionsBase(d)));const c=Object.assign(Object.assign({},l),{_response:Object.assign(Object.assign({},l._response),{parsedBody:ConvertInternalResponseOfListBlobHierarchy(l._response.parsedBody)}),segment:Object.assign(Object.assign({},l.segment),{blobItems:l.segment.blobItems.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name),tags:toTags(r.blobTags),objectReplicationSourceProperties:parseObjectReplicationRecord(r.objectReplicationMetadata)});return i})),blobPrefixes:(a=l.segment.blobPrefixes)===null||a===void 0?void 0:a.map((r=>{const i=Object.assign(Object.assign({},r),{name:BlobNameToString(r.name)});return i}))})});return c}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}listSegments(r,i={}){return l.__asyncGenerator(this,arguments,(function*listSegments_1(){let s;if(!!r||r===undefined){do{s=yield l.__await(this.listBlobFlatSegment(r,i));r=s.continuationToken;yield yield l.__await(yield l.__await(s))}while(r)}}))}listItems(r={}){return l.__asyncGenerator(this,arguments,(function*listItems_1(){var i,s;let a;try{for(var c=l.__asyncValues(this.listSegments(a,r)),d;d=yield l.__await(c.next()),!d.done;){const r=d.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.segment.blobItems)))}}catch(r){i={error:r}}finally{try{if(d&&!d.done&&(s=c.return))yield l.__await(s.call(c))}finally{if(i)throw i.error}}}))}listBlobsFlat(r={}){const i=[];if(r.includeCopy){i.push("copy")}if(r.includeDeleted){i.push("deleted")}if(r.includeMetadata){i.push("metadata")}if(r.includeSnapshots){i.push("snapshots")}if(r.includeVersions){i.push("versions")}if(r.includeUncommitedBlobs){i.push("uncommittedblobs")}if(r.includeTags){i.push("tags")}if(r.includeDeletedWithVersions){i.push("deletedwithversions")}if(r.includeImmutabilityPolicy){i.push("immutabilitypolicy")}if(r.includeLegalHold){i.push("legalhold")}if(r.prefix===""){r.prefix=undefined}const s=Object.assign(Object.assign({},r),i.length>0?{include:i}:{});const a=this.listItems(s);return{next(){return a.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listSegments(r.continuationToken,Object.assign({maxPageSize:r.maxPageSize},s))}}listHierarchySegments(r,i,s={}){return l.__asyncGenerator(this,arguments,(function*listHierarchySegments_1(){let a;if(!!i||i===undefined){do{a=yield l.__await(this.listBlobHierarchySegment(r,i,s));i=a.continuationToken;yield yield l.__await(yield l.__await(a))}while(i)}}))}listItemsByHierarchy(r,i={}){return l.__asyncGenerator(this,arguments,(function*listItemsByHierarchy_1(){var s,a;let c;try{for(var d=l.__asyncValues(this.listHierarchySegments(r,c,i)),p;p=yield l.__await(d.next()),!p.done;){const r=p.value;const i=r.segment;if(i.blobPrefixes){for(const r of i.blobPrefixes){yield yield l.__await(Object.assign({kind:"prefix"},r))}}for(const r of i.blobItems){yield yield l.__await(Object.assign({kind:"blob"},r))}}}catch(r){s={error:r}}finally{try{if(p&&!p.done&&(a=d.return))yield l.__await(a.call(d))}finally{if(s)throw s.error}}}))}listBlobsByHierarchy(r,i={}){if(r===""){throw new RangeError("delimiter should contain one or more characters")}const s=[];if(i.includeCopy){s.push("copy")}if(i.includeDeleted){s.push("deleted")}if(i.includeMetadata){s.push("metadata")}if(i.includeSnapshots){s.push("snapshots")}if(i.includeVersions){s.push("versions")}if(i.includeUncommitedBlobs){s.push("uncommittedblobs")}if(i.includeTags){s.push("tags")}if(i.includeDeletedWithVersions){s.push("deletedwithversions")}if(i.includeImmutabilityPolicy){s.push("immutabilitypolicy")}if(i.includeLegalHold){s.push("legalhold")}if(i.prefix===""){i.prefix=undefined}const a=Object.assign(Object.assign({},i),s.length>0?{include:s}:{});const l=this.listItemsByHierarchy(r,a);return{async next(){return l.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.listHierarchySegments(r,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},a))}}async findBlobsByTagsSegment(r,i,s={}){const{span:a,updatedOptions:l}=Mo("ContainerClient-findBlobsByTagsSegment",s);try{const a=await this.containerContext.filterBlobs(Object.assign({abortSignal:s.abortSignal,where:r,marker:i,maxPageSize:s.maxPageSize},convertTracingToRequestOptionsBase(l)));const c=Object.assign(Object.assign({},a),{_response:a._response,blobs:a.blobs.map((r=>{var i;let s="";if(((i=r.tags)===null||i===void 0?void 0:i.blobTagSet.length)===1){s=r.tags.blobTagSet[0].value}return Object.assign(Object.assign({},r),{tags:toTags(r.tags),tagValue:s})}))});return c}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}findBlobsByTagsSegments(r,i,s={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsSegments_1(){let a;if(!!i||i===undefined){do{a=yield l.__await(this.findBlobsByTagsSegment(r,i,s));a.blobs=a.blobs||[];i=a.continuationToken;yield yield l.__await(a)}while(i)}}))}findBlobsByTagsItems(r,i={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsItems_1(){var s,a;let c;try{for(var d=l.__asyncValues(this.findBlobsByTagsSegments(r,c,i)),p;p=yield l.__await(d.next()),!p.done;){const r=p.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.blobs)))}}catch(r){s={error:r}}finally{try{if(p&&!p.done&&(a=d.return))yield l.__await(a.call(d))}finally{if(s)throw s.error}}}))}findBlobsByTags(r,i={}){const s=Object.assign({},i);const a=this.findBlobsByTagsItems(r,s);return{next(){return a.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.findBlobsByTagsSegments(r,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},s))}}getContainerNameFromUrl(){let r;try{const i=a.URLBuilder.parse(this.url);if(i.getHost().split(".")[1]==="blob"){r=i.getPath().split("/")[1]}else if(isIpEndpointStyle(i)){r=i.getPath().split("/")[2]}else{r=i.getPath().split("/")[1]}r=decodeURIComponent(r);if(!r){throw new Error("Provided containerName is invalid.")}return r}catch(r){throw new Error("Unable to extract containerName with provided information.")}}generateSasUrl(r){return new Promise((i=>{if(!(this.credential instanceof StorageSharedKeyCredential)){throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential")}const s=generateBlobSASQueryParameters(Object.assign({containerName:this._containerName},r),this.credential).toString();i(appendToURLQuery(this.url,s))}))}getBlobBatchClient(){return new BlobBatchClient(this.url,this.pipeline)}}class AccountSASPermissions{constructor(){this.read=false;this.write=false;this.delete=false;this.deleteVersion=false;this.list=false;this.add=false;this.create=false;this.update=false;this.process=false;this.tag=false;this.filter=false;this.setImmutabilityPolicy=false;this.permanentDelete=false}static parse(r){const i=new AccountSASPermissions;for(const s of r){switch(s){case"r":i.read=true;break;case"w":i.write=true;break;case"d":i.delete=true;break;case"x":i.deleteVersion=true;break;case"l":i.list=true;break;case"a":i.add=true;break;case"c":i.create=true;break;case"u":i.update=true;break;case"p":i.process=true;break;case"t":i.tag=true;break;case"f":i.filter=true;break;case"i":i.setImmutabilityPolicy=true;break;case"y":i.permanentDelete=true;break;default:throw new RangeError(`Invalid permission character: ${s}`)}}return i}static from(r){const i=new AccountSASPermissions;if(r.read){i.read=true}if(r.write){i.write=true}if(r.delete){i.delete=true}if(r.deleteVersion){i.deleteVersion=true}if(r.filter){i.filter=true}if(r.tag){i.tag=true}if(r.list){i.list=true}if(r.add){i.add=true}if(r.create){i.create=true}if(r.update){i.update=true}if(r.process){i.process=true}if(r.setImmutabilityPolicy){i.setImmutabilityPolicy=true}if(r.permanentDelete){i.permanentDelete=true}return i}toString(){const r=[];if(this.read){r.push("r")}if(this.write){r.push("w")}if(this.delete){r.push("d")}if(this.deleteVersion){r.push("x")}if(this.filter){r.push("f")}if(this.tag){r.push("t")}if(this.list){r.push("l")}if(this.add){r.push("a")}if(this.create){r.push("c")}if(this.update){r.push("u")}if(this.process){r.push("p")}if(this.setImmutabilityPolicy){r.push("i")}if(this.permanentDelete){r.push("y")}return r.join("")}}class AccountSASResourceTypes{constructor(){this.service=false;this.container=false;this.object=false}static parse(r){const i=new AccountSASResourceTypes;for(const s of r){switch(s){case"s":i.service=true;break;case"c":i.container=true;break;case"o":i.object=true;break;default:throw new RangeError(`Invalid resource type: ${s}`)}}return i}toString(){const r=[];if(this.service){r.push("s")}if(this.container){r.push("c")}if(this.object){r.push("o")}return r.join("")}}class AccountSASServices{constructor(){this.blob=false;this.file=false;this.queue=false;this.table=false}static parse(r){const i=new AccountSASServices;for(const s of r){switch(s){case"b":i.blob=true;break;case"f":i.file=true;break;case"q":i.queue=true;break;case"t":i.table=true;break;default:throw new RangeError(`Invalid service character: ${s}`)}}return i}toString(){const r=[];if(this.blob){r.push("b")}if(this.table){r.push("t")}if(this.queue){r.push("q")}if(this.file){r.push("f")}return r.join("")}}function generateAccountSASQueryParameters(r,i){const s=r.version?r.version:io;if(r.permissions&&r.permissions.setImmutabilityPolicy&&s<"2020-08-04"){throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.")}if(r.permissions&&r.permissions.deleteVersion&&s<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.")}if(r.permissions&&r.permissions.permanentDelete&&s<"2019-10-10"){throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.")}if(r.permissions&&r.permissions.tag&&s<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.")}if(r.permissions&&r.permissions.filter&&s<"2019-12-12"){throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.")}if(r.encryptionScope&&s<"2020-12-06"){throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.")}const a=AccountSASPermissions.parse(r.permissions.toString());const l=AccountSASServices.parse(r.services).toString();const c=AccountSASResourceTypes.parse(r.resourceTypes).toString();let d;if(s>="2020-12-06"){d=[i.accountName,a,l,c,r.startsOn?truncatedISO8061Date(r.startsOn,false):"",truncatedISO8061Date(r.expiresOn,false),r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",s,r.encryptionScope?r.encryptionScope:"",""].join("\n")}else{d=[i.accountName,a,l,c,r.startsOn?truncatedISO8061Date(r.startsOn,false):"",truncatedISO8061Date(r.expiresOn,false),r.ipRange?ipRangeToString(r.ipRange):"",r.protocol?r.protocol:"",s,""].join("\n")}const p=i.computeHMACSHA256(d);return new SASQueryParameters(s,p,a.toString(),l,c,r.protocol,r.startsOn,r.expiresOn,r.ipRange,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,r.encryptionScope)}class BlobServiceClient extends StorageClient{constructor(r,i,s){let l;if(isPipelineLike(i)){l=i}else if(a.isNode&&i instanceof StorageSharedKeyCredential||i instanceof AnonymousCredential||a.isTokenCredential(i)){l=newPipeline(i,s)}else{l=newPipeline(new AnonymousCredential,s)}super(r,l);this.serviceContext=new Service(this.storageClientContext)}static fromConnectionString(r,i){i=i||{};const s=extractConnectionStringParts(r);if(s.kind==="AccountConnString"){if(a.isNode){const r=new StorageSharedKeyCredential(s.accountName,s.accountKey);if(!i.proxyOptions){i.proxyOptions=a.getDefaultProxySettings(s.proxyUri)}const l=newPipeline(r,i);return new BlobServiceClient(s.url,l)}else{throw new Error("Account connection string is only supported in Node.js environment")}}else if(s.kind==="SASConnString"){const r=newPipeline(new AnonymousCredential,i);return new BlobServiceClient(s.url+"?"+s.accountSas,r)}else{throw new Error("Connection string must be either an Account connection string or a SAS connection string")}}getContainerClient(r){return new ContainerClient(appendToURLPath(this.url,encodeURIComponent(r)),this.pipeline)}async createContainer(r,i={}){const{span:s,updatedOptions:a}=Mo("BlobServiceClient-createContainer",i);try{const i=this.getContainerClient(r);const s=await i.create(a);return{containerClient:i,containerCreateResponse:s}}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async deleteContainer(r,i={}){const{span:s,updatedOptions:a}=Mo("BlobServiceClient-deleteContainer",i);try{const i=this.getContainerClient(r);return await i.delete(a)}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async undeleteContainer(r,i,s={}){const{span:a,updatedOptions:l}=Mo("BlobServiceClient-undeleteContainer",s);try{const a=this.getContainerClient(s.destinationContainerName||r);const c=new Container(a["storageClientContext"]);const d=await c.restore(Object.assign({deletedContainerName:r,deletedContainerVersion:i},l));return{containerClient:a,containerUndeleteResponse:d}}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}async renameContainer(r,i,s={}){var a;const{span:l,updatedOptions:d}=Mo("BlobServiceClient-renameContainer",s);try{const l=this.getContainerClient(i);const c=new Container(l["storageClientContext"]);const p=await c.rename(r,Object.assign(Object.assign({},d),{sourceLeaseId:(a=s.sourceCondition)===null||a===void 0?void 0:a.leaseId}));return{containerClient:l,containerRenameResponse:p}}catch(r){l.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{l.end()}}async getProperties(r={}){const{span:i,updatedOptions:s}=Mo("BlobServiceClient-getProperties",r);try{return await this.serviceContext.getProperties(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async setProperties(r,i={}){const{span:s,updatedOptions:a}=Mo("BlobServiceClient-setProperties",i);try{return await this.serviceContext.setProperties(r,Object.assign({abortSignal:i.abortSignal},convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async getStatistics(r={}){const{span:i,updatedOptions:s}=Mo("BlobServiceClient-getStatistics",r);try{return await this.serviceContext.getStatistics(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async getAccountInfo(r={}){const{span:i,updatedOptions:s}=Mo("BlobServiceClient-getAccountInfo",r);try{return await this.serviceContext.getAccountInfo(Object.assign({abortSignal:r.abortSignal},convertTracingToRequestOptionsBase(s)))}catch(r){i.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{i.end()}}async listContainersSegment(r,i={}){const{span:s,updatedOptions:a}=Mo("BlobServiceClient-listContainersSegment",i);try{return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({abortSignal:i.abortSignal,marker:r},i),{include:typeof i.include==="string"?[i.include]:i.include}),convertTracingToRequestOptionsBase(a)))}catch(r){s.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{s.end()}}async findBlobsByTagsSegment(r,i,s={}){const{span:a,updatedOptions:l}=Mo("BlobServiceClient-findBlobsByTagsSegment",s);try{const a=await this.serviceContext.filterBlobs(Object.assign({abortSignal:s.abortSignal,where:r,marker:i,maxPageSize:s.maxPageSize},convertTracingToRequestOptionsBase(l)));const c=Object.assign(Object.assign({},a),{_response:a._response,blobs:a.blobs.map((r=>{var i;let s="";if(((i=r.tags)===null||i===void 0?void 0:i.blobTagSet.length)===1){s=r.tags.blobTagSet[0].value}return Object.assign(Object.assign({},r),{tags:toTags(r.tags),tagValue:s})}))});return c}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}findBlobsByTagsSegments(r,i,s={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsSegments_1(){let a;if(!!i||i===undefined){do{a=yield l.__await(this.findBlobsByTagsSegment(r,i,s));a.blobs=a.blobs||[];i=a.continuationToken;yield yield l.__await(a)}while(i)}}))}findBlobsByTagsItems(r,i={}){return l.__asyncGenerator(this,arguments,(function*findBlobsByTagsItems_1(){var s,a;let c;try{for(var d=l.__asyncValues(this.findBlobsByTagsSegments(r,c,i)),p;p=yield l.__await(d.next()),!p.done;){const r=p.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.blobs)))}}catch(r){s={error:r}}finally{try{if(p&&!p.done&&(a=d.return))yield l.__await(a.call(d))}finally{if(s)throw s.error}}}))}findBlobsByTags(r,i={}){const s=Object.assign({},i);const a=this.findBlobsByTagsItems(r,s);return{next(){return a.next()},[Symbol.asyncIterator](){return this},byPage:(i={})=>this.findBlobsByTagsSegments(r,i.continuationToken,Object.assign({maxPageSize:i.maxPageSize},s))}}listSegments(r,i={}){return l.__asyncGenerator(this,arguments,(function*listSegments_1(){let s;if(!!r||r===undefined){do{s=yield l.__await(this.listContainersSegment(r,i));s.containerItems=s.containerItems||[];r=s.continuationToken;yield yield l.__await(yield l.__await(s))}while(r)}}))}listItems(r={}){return l.__asyncGenerator(this,arguments,(function*listItems_1(){var i,s;let a;try{for(var c=l.__asyncValues(this.listSegments(a,r)),d;d=yield l.__await(c.next()),!d.done;){const r=d.value;yield l.__await(yield*l.__asyncDelegator(l.__asyncValues(r.containerItems)))}}catch(r){i={error:r}}finally{try{if(d&&!d.done&&(s=c.return))yield l.__await(s.call(c))}finally{if(i)throw i.error}}}))}listContainers(r={}){if(r.prefix===""){r.prefix=undefined}const i=[];if(r.includeDeleted){i.push("deleted")}if(r.includeMetadata){i.push("metadata")}if(r.includeSystem){i.push("system")}const s=Object.assign(Object.assign({},r),i.length>0?{include:i}:{});const a=this.listItems(s);return{next(){return a.next()},[Symbol.asyncIterator](){return this},byPage:(r={})=>this.listSegments(r.continuationToken,Object.assign({maxPageSize:r.maxPageSize},s))}}async getUserDelegationKey(r,i,s={}){const{span:a,updatedOptions:l}=Mo("BlobServiceClient-getUserDelegationKey",s);try{const a=await this.serviceContext.getUserDelegationKey({startsOn:truncatedISO8061Date(r,false),expiresOn:truncatedISO8061Date(i,false)},Object.assign({abortSignal:s.abortSignal},convertTracingToRequestOptionsBase(l)));const c={signedObjectId:a.signedObjectId,signedTenantId:a.signedTenantId,signedStartsOn:new Date(a.signedStartsOn),signedExpiresOn:new Date(a.signedExpiresOn),signedService:a.signedService,signedVersion:a.signedVersion,value:a.value};const d=Object.assign({_response:a._response,requestId:a.requestId,clientRequestId:a.clientRequestId,version:a.version,date:a.date,errorCode:a.errorCode},c);return d}catch(r){a.setStatus({code:c.SpanStatusCode.ERROR,message:r.message});throw r}finally{a.end()}}getBlobBatchClient(){return new BlobBatchClient(this.url,this.pipeline)}generateAccountSasUrl(r,i=AccountSASPermissions.parse("r"),s="sco",a={}){if(!(this.credential instanceof StorageSharedKeyCredential)){throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential")}if(r===undefined){const i=new Date;r=new Date(i.getTime()+3600*1e3)}const l=generateAccountSASQueryParameters(Object.assign({permissions:i,expiresOn:r,resourceTypes:s,services:AccountSASServices.parse("b").toString()},a),this.credential).toString();return appendToURLQuery(this.url,l)}}i.KnownEncryptionAlgorithmType=void 0;(function(r){r["AES256"]="AES256"})(i.KnownEncryptionAlgorithmType||(i.KnownEncryptionAlgorithmType={}));Object.defineProperty(i,"BaseRequestPolicy",{enumerable:true,get:function(){return a.BaseRequestPolicy}});Object.defineProperty(i,"HttpHeaders",{enumerable:true,get:function(){return a.HttpHeaders}});Object.defineProperty(i,"RequestPolicyOptions",{enumerable:true,get:function(){return a.RequestPolicyOptions}});Object.defineProperty(i,"RestError",{enumerable:true,get:function(){return a.RestError}});Object.defineProperty(i,"WebResource",{enumerable:true,get:function(){return a.WebResource}});Object.defineProperty(i,"deserializationPolicy",{enumerable:true,get:function(){return a.deserializationPolicy}});i.AccountSASPermissions=AccountSASPermissions;i.AccountSASResourceTypes=AccountSASResourceTypes;i.AccountSASServices=AccountSASServices;i.AnonymousCredential=AnonymousCredential;i.AnonymousCredentialPolicy=AnonymousCredentialPolicy;i.AppendBlobClient=AppendBlobClient;i.BlobBatch=BlobBatch;i.BlobBatchClient=BlobBatchClient;i.BlobClient=BlobClient;i.BlobLeaseClient=BlobLeaseClient;i.BlobSASPermissions=BlobSASPermissions;i.BlobServiceClient=BlobServiceClient;i.BlockBlobClient=BlockBlobClient;i.ContainerClient=ContainerClient;i.ContainerSASPermissions=ContainerSASPermissions;i.Credential=Credential;i.CredentialPolicy=CredentialPolicy;i.PageBlobClient=PageBlobClient;i.Pipeline=Pipeline;i.SASQueryParameters=SASQueryParameters;i.StorageBrowserPolicy=StorageBrowserPolicy;i.StorageBrowserPolicyFactory=StorageBrowserPolicyFactory;i.StorageOAuthScopes=Ao;i.StorageRetryPolicy=StorageRetryPolicy;i.StorageRetryPolicyFactory=StorageRetryPolicyFactory;i.StorageSharedKeyCredential=StorageSharedKeyCredential;i.StorageSharedKeyCredentialPolicy=StorageSharedKeyCredentialPolicy;i.generateAccountSASQueryParameters=generateAccountSASQueryParameters;i.generateBlobSASQueryParameters=generateBlobSASQueryParameters;i.getBlobServiceAccountAudience=getBlobServiceAccountAudience;i.isPipelineLike=isPipelineLike;i.logger=ro;i.newPipeline=newPipeline},24818:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const s=/^v1\./;const a=/^ghs_/;const l=/^ghu_/;async function auth(r){const i=r.split(/\./).length===3;const c=s.test(r)||a.test(r);const d=l.test(r);const p=i?"app":c?"installation":d?"user-to-server":"oauth";return{type:"token",token:r,tokenType:p}}function withAuthorizationPrefix(r){if(r.split(/\./).length===3){return`bearer ${r}`}return`token ${r}`}async function hook(r,i,s,a){const l=i.endpoint.merge(s,a);l.headers.authorization=withAuthorizationPrefix(r);return i(l)}const c=function createTokenAuth(r){if(!r){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof r!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}r=r.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,r),{hook:hook.bind(null,r)})};i.createTokenAuth=c},80947:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(85581);var l=s(15546);var c=s(89193);var d=s(67023);var p=s(24818);function _objectWithoutPropertiesLoose(r,i){if(r==null)return{};var s={};var a=Object.keys(r);var l,c;for(c=0;c=0)continue;s[l]=r[l]}return s}function _objectWithoutProperties(r,i){if(r==null)return{};var s=_objectWithoutPropertiesLoose(r,i);var a,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(l=0;l=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,a))continue;s[a]=r[a]}}return s}const u="3.6.0";const A=["authStrategy"];class Octokit{constructor(r={}){const i=new l.Collection;const s={baseUrl:c.request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},r.request,{hook:i.bind(null,"request")}),mediaType:{previews:[],format:""}};s.headers["user-agent"]=[r.userAgent,`octokit-core.js/${u} ${a.getUserAgent()}`].filter(Boolean).join(" ");if(r.baseUrl){s.baseUrl=r.baseUrl}if(r.previews){s.mediaType.previews=r.previews}if(r.timeZone){s.headers["time-zone"]=r.timeZone}this.request=c.request.defaults(s);this.graphql=d.withCustomRequest(this.request).defaults(s);this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},r.log);this.hook=i;if(!r.authStrategy){if(!r.auth){this.auth=async()=>({type:"unauthenticated"})}else{const s=p.createTokenAuth(r.auth);i.wrap("request",s.hook);this.auth=s}}else{const{authStrategy:s}=r,a=_objectWithoutProperties(r,A);const l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:a},r.auth));i.wrap("request",l.hook);this.auth=l}const h=this.constructor;h.plugins.forEach((i=>{Object.assign(this,i(this,r))}))}static defaults(r){const i=class extends(this){constructor(...i){const s=i[0]||{};if(typeof r==="function"){super(r(s));return}super(Object.assign({},r,s,s.userAgent&&r.userAgent?{userAgent:`${s.userAgent} ${r.userAgent}`}:null))}};return i}static plugin(...r){var i;const s=this.plugins;const a=(i=class extends(this){},i.plugins=s.concat(r.filter((r=>!s.includes(r)))),i);return a}}Octokit.VERSION=u;Octokit.plugins=[];i.Octokit=Octokit},70756:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(1363);var l=s(85581);function lowercaseKeys(r){if(!r){return{}}return Object.keys(r).reduce(((i,s)=>{i[s.toLowerCase()]=r[s];return i}),{})}function mergeDeep(r,i){const s=Object.assign({},r);Object.keys(i).forEach((l=>{if(a.isPlainObject(i[l])){if(!(l in r))Object.assign(s,{[l]:i[l]});else s[l]=mergeDeep(r[l],i[l])}else{Object.assign(s,{[l]:i[l]})}}));return s}function removeUndefinedProperties(r){for(const i in r){if(r[i]===undefined){delete r[i]}}return r}function merge(r,i,s){if(typeof i==="string"){let[r,a]=i.split(" ");s=Object.assign(a?{method:r,url:a}:{url:r},s)}else{s=Object.assign({},i)}s.headers=lowercaseKeys(s.headers);removeUndefinedProperties(s);removeUndefinedProperties(s.headers);const a=mergeDeep(r||{},s);if(r&&r.mediaType.previews.length){a.mediaType.previews=r.mediaType.previews.filter((r=>!a.mediaType.previews.includes(r))).concat(a.mediaType.previews)}a.mediaType.previews=a.mediaType.previews.map((r=>r.replace(/-preview/,"")));return a}function addQueryParameters(r,i){const s=/\?/.test(r)?"&":"?";const a=Object.keys(i);if(a.length===0){return r}return r+s+a.map((r=>{if(r==="q"){return"q="+i.q.split("+").map(encodeURIComponent).join("+")}return`${r}=${encodeURIComponent(i[r])}`})).join("&")}const c=/\{[^}]+\}/g;function removeNonChars(r){return r.replace(/^\W+|\W+$/g,"").split(/,/)}function extractUrlVariableNames(r){const i=r.match(c);if(!i){return[]}return i.map(removeNonChars).reduce(((r,i)=>r.concat(i)),[])}function omit(r,i){return Object.keys(r).filter((r=>!i.includes(r))).reduce(((i,s)=>{i[s]=r[s];return i}),{})}function encodeReserved(r){return r.split(/(%[0-9A-Fa-f]{2})/g).map((function(r){if(!/%[0-9A-Fa-f]/.test(r)){r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")}return r})).join("")}function encodeUnreserved(r){return encodeURIComponent(r).replace(/[!'()*]/g,(function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()}))}function encodeValue(r,i,s){i=r==="+"||r==="#"?encodeReserved(i):encodeUnreserved(i);if(s){return encodeUnreserved(s)+"="+i}else{return i}}function isDefined(r){return r!==undefined&&r!==null}function isKeyOperator(r){return r===";"||r==="&"||r==="?"}function getValues(r,i,s,a){var l=r[s],c=[];if(isDefined(l)&&l!==""){if(typeof l==="string"||typeof l==="number"||typeof l==="boolean"){l=l.toString();if(a&&a!=="*"){l=l.substring(0,parseInt(a,10))}c.push(encodeValue(i,l,isKeyOperator(i)?s:""))}else{if(a==="*"){if(Array.isArray(l)){l.filter(isDefined).forEach((function(r){c.push(encodeValue(i,r,isKeyOperator(i)?s:""))}))}else{Object.keys(l).forEach((function(r){if(isDefined(l[r])){c.push(encodeValue(i,l[r],r))}}))}}else{const r=[];if(Array.isArray(l)){l.filter(isDefined).forEach((function(s){r.push(encodeValue(i,s))}))}else{Object.keys(l).forEach((function(s){if(isDefined(l[s])){r.push(encodeUnreserved(s));r.push(encodeValue(i,l[s].toString()))}}))}if(isKeyOperator(i)){c.push(encodeUnreserved(s)+"="+r.join(","))}else if(r.length!==0){c.push(r.join(","))}}}}else{if(i===";"){if(isDefined(l)){c.push(encodeUnreserved(s))}}else if(l===""&&(i==="&"||i==="?")){c.push(encodeUnreserved(s)+"=")}else if(l===""){c.push("")}}return c}function parseUrl(r){return{expand:expand.bind(null,r)}}function expand(r,i){var s=["+","#",".","/",";","?","&"];return r.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(r,a,l){if(a){let r="";const l=[];if(s.indexOf(a.charAt(0))!==-1){r=a.charAt(0);a=a.substr(1)}a.split(/,/g).forEach((function(s){var a=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);l.push(getValues(i,r,a[1],a[2]||a[3]))}));if(r&&r!=="+"){var c=",";if(r==="?"){c="&"}else if(r!=="#"){c=r}return(l.length!==0?r:"")+l.join(c)}else{return l.join(",")}}else{return encodeReserved(l)}}))}function parse(r){let i=r.method.toUpperCase();let s=(r.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let a=Object.assign({},r.headers);let l;let c=omit(r,["method","baseUrl","url","headers","request","mediaType"]);const d=extractUrlVariableNames(s);s=parseUrl(s).expand(c);if(!/^http/.test(s)){s=r.baseUrl+s}const p=Object.keys(r).filter((r=>d.includes(r))).concat("baseUrl");const u=omit(c,p);const A=/application\/octet-stream/i.test(a.accept);if(!A){if(r.mediaType.format){a.accept=a.accept.split(/,/).map((i=>i.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${r.mediaType.format}`))).join(",")}if(r.mediaType.previews.length){const i=a.accept.match(/[\w-]+(?=-preview)/g)||[];a.accept=i.concat(r.mediaType.previews).map((i=>{const s=r.mediaType.format?`.${r.mediaType.format}`:"+json";return`application/vnd.github.${i}-preview${s}`})).join(",")}}if(["GET","HEAD"].includes(i)){s=addQueryParameters(s,u)}else{if("data"in u){l=u.data}else{if(Object.keys(u).length){l=u}else{a["content-length"]=0}}}if(!a["content-type"]&&typeof l!=="undefined"){a["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(i)&&typeof l==="undefined"){l=""}return Object.assign({method:i,url:s,headers:a},typeof l!=="undefined"?{body:l}:null,r.request?{request:r.request}:null)}function endpointWithDefaults(r,i,s){return parse(merge(r,i,s))}function withDefaults(r,i){const s=merge(r,i);const a=endpointWithDefaults.bind(null,s);return Object.assign(a,{DEFAULTS:s,defaults:withDefaults.bind(null,s),merge:merge.bind(null,s),parse:parse})}const d="6.0.12";const p=`octokit-endpoint.js/${d} ${l.getUserAgent()}`;const u={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":p},mediaType:{format:"",previews:[]}};const A=withDefaults(null,u);i.endpoint=A},67023:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(89193);var l=s(85581);const c="4.8.0";function _buildMessageForResponseErrors(r){return`Request failed due to following response errors:\n`+r.errors.map((r=>` - ${r.message}`)).join("\n")}class GraphqlResponseError extends Error{constructor(r,i,s){super(_buildMessageForResponseErrors(s));this.request=r;this.headers=i;this.response=s;this.name="GraphqlResponseError";this.errors=s.errors;this.data=s.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}const d=["method","baseUrl","url","headers","request","query","mediaType"];const p=["query","method","url"];const u=/\/api\/v3\/?$/;function graphql(r,i,s){if(s){if(typeof i==="string"&&"query"in s){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const r in s){if(!p.includes(r))continue;return Promise.reject(new Error(`[@octokit/graphql] "${r}" cannot be used as variable name`))}}const a=typeof i==="string"?Object.assign({query:i},s):i;const l=Object.keys(a).reduce(((r,i)=>{if(d.includes(i)){r[i]=a[i];return r}if(!r.variables){r.variables={}}r.variables[i]=a[i];return r}),{});const c=a.baseUrl||r.endpoint.DEFAULTS.baseUrl;if(u.test(c)){l.url=c.replace(u,"/api/graphql")}return r(l).then((r=>{if(r.data.errors){const i={};for(const s of Object.keys(r.headers)){i[s]=r.headers[s]}throw new GraphqlResponseError(l,i,r.data)}return r.data.data}))}function withDefaults(r,i){const s=r.defaults(i);const newApi=(r,i)=>graphql(s,r,i);return Object.assign(newApi,{defaults:withDefaults.bind(null,s),endpoint:a.request.endpoint})}const A=withDefaults(a.request,{headers:{"user-agent":`octokit-graphql.js/${c} ${l.getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(r){return withDefaults(r,{method:"POST",url:"/graphql"})}i.GraphqlResponseError=GraphqlResponseError;i.graphql=A;i.withCustomRequest=withCustomRequest},88474:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const s="2.21.3";function ownKeys(r,i){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);i&&(a=a.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),s.push.apply(s,a)}return s}function _objectSpread2(r){for(var i=1;i({async next(){if(!p)return{done:true};try{const r=await l({method:c,url:p,headers:d});const i=normalizePaginatedListResponse(r);p=((i.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1];return{value:i}}catch(r){if(r.status!==409)throw r;p="";return{value:{status:200,headers:{},data:[]}}}}})}}function paginate(r,i,s,a){if(typeof s==="function"){a=s;s=undefined}return gather(r,[],iterator(r,i,s)[Symbol.asyncIterator](),a)}function gather(r,i,s,a){return s.next().then((l=>{if(l.done){return i}let c=false;function done(){c=true}i=i.concat(a?a(l.value,done):l.value.data);if(c){return i}return gather(r,i,s,a)}))}const a=Object.assign(paginate,{iterator:iterator});const l=["GET /app/hook/deliveries","GET /app/installations","GET /applications/grants","GET /authorizations","GET /enterprises/{enterprise}/actions/permissions/organizations","GET /enterprises/{enterprise}/actions/runner-groups","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners","GET /enterprises/{enterprise}/actions/runners","GET /enterprises/{enterprise}/audit-log","GET /enterprises/{enterprise}/secret-scanning/alerts","GET /enterprises/{enterprise}/settings/billing/advanced-security","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /licenses","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/audit-log","GET /orgs/{org}/blocks","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/codespaces","GET /orgs/{org}/credential-authorizations","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/external-groups","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/projects","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/settings/billing/advanced-security","GET /orgs/{org}/team-sync/groups","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/columns/{column_id}/cards","GET /projects/{project_id}/collaborators","GET /projects/{project_id}/columns","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/codespaces","GET /repos/{owner}/{repo}/codespaces/devcontainers","GET /repos/{owner}/{repo}/codespaces/secrets","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/status","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/dependabot/secrets","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/environments","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/git/matching-refs/{ref}","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/releases/{release_id}/reactions","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repos/{owner}/{repo}/topics","GET /repositories","GET /repositories/{repository_id}/environments/{environment_name}/secrets","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/codespaces","GET /user/codespaces/secrets","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/packages/{package_type}/{package_name}/versions","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /users","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/packages","GET /users/{username}/projects","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(r){if(typeof r==="string"){return l.includes(r)}else{return false}}function paginateRest(r){return{paginate:Object.assign(paginate.bind(null,r),{iterator:iterator.bind(null,r)})}}paginateRest.VERSION=s;i.composePaginateRest=a;i.isPaginatingEndpoint=isPaginatingEndpoint;i.paginateRest=paginateRest;i.paginatingEndpoints=l},61117:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const s="1.0.4";function requestLog(r){r.hook.wrap("request",((i,s)=>{r.log.debug("request",s);const a=Date.now();const l=r.request.endpoint.parse(s);const c=l.url.replace(s.baseUrl,"");return i(s).then((i=>{r.log.info(`${l.method} ${c} - ${i.status} in ${Date.now()-a}ms`);return i})).catch((i=>{r.log.info(`${l.method} ${c} - ${i.status} in ${Date.now()-a}ms`);throw i}))}))}requestLog.VERSION=s;i.requestLog=requestLog},15243:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function ownKeys(r,i){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);if(i){a=a.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))}s.push.apply(s,a)}return s}function _objectSpread2(r){for(var i=1;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var a=_interopDefault(s(93860));async function errorRequest(r,i,s,a){if(!s.request||!s.request.request){throw s}if(s.status>=400&&!i.doNotRetry.includes(s.status)){const l=a.request.retries!=null?a.request.retries:i.retries;const c=Math.pow((a.request.retryCount||0)+1,2);throw r.retry.retryRequest(s,l,c)}throw s}async function wrapRequest(r,i,s){const l=new a;l.on("failed",(function(i,a){const l=~~i.request.request.retries;const c=~~i.request.request.retryAfter;s.request.retryCount=a.retryCount+1;if(l>a.retryCount){return c*r.retryAfterBaseValue}}));return l.schedule(i,s)}const l="3.0.9";function retry(r,i){const s=Object.assign({enabled:true,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,422],retries:3},i.retry);if(s.enabled){r.hook.error("request",errorRequest.bind(null,r,s));r.hook.wrap("request",wrapRequest.bind(null,s))}return{retry:{retryRequest:(r,i,s)=>{r.request.request=Object.assign({},r.request.request,{retries:i,retryAfter:s});return r}}}}retry.VERSION=l;i.VERSION=l;i.retry=retry},87488:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var a=s(33383);var l=_interopDefault(s(28995));const c=l((r=>console.warn(r)));const d=l((r=>console.warn(r)));class RequestError extends Error{constructor(r,i,s){super(r);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="HttpError";this.status=i;let l;if("headers"in s&&typeof s.headers!=="undefined"){l=s.headers}if("response"in s){this.response=s.response;l=s.response.headers}const p=Object.assign({},s.request);if(s.request.headers.authorization){p.headers=Object.assign({},s.request.headers,{authorization:s.request.headers.authorization.replace(/ .*$/," [REDACTED]")})}p.url=p.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=p;Object.defineProperty(this,"code",{get(){c(new a.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));return i}});Object.defineProperty(this,"headers",{get(){d(new a.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));return l||{}}})}}i.RequestError=RequestError},89193:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var a=s(70756);var l=s(85581);var c=s(1363);var d=_interopDefault(s(18885));var p=s(87488);const u="5.6.3";function getBufferResponse(r){return r.arrayBuffer()}function fetchWrapper(r){const i=r.request&&r.request.log?r.request.log:console;if(c.isPlainObject(r.body)||Array.isArray(r.body)){r.body=JSON.stringify(r.body)}let s={};let a;let l;const u=r.request&&r.request.fetch||d;return u(r.url,Object.assign({method:r.method,body:r.body,headers:r.headers,redirect:r.redirect},r.request)).then((async c=>{l=c.url;a=c.status;for(const r of c.headers){s[r[0]]=r[1]}if("deprecation"in s){const a=s.link&&s.link.match(/<([^>]+)>; rel="deprecation"/);const l=a&&a.pop();i.warn(`[@octokit/request] "${r.method} ${r.url}" is deprecated. It is scheduled to be removed on ${s.sunset}${l?`. See ${l}`:""}`)}if(a===204||a===205){return}if(r.method==="HEAD"){if(a<400){return}throw new p.RequestError(c.statusText,a,{response:{url:l,status:a,headers:s,data:undefined},request:r})}if(a===304){throw new p.RequestError("Not modified",a,{response:{url:l,status:a,headers:s,data:await getResponseData(c)},request:r})}if(a>=400){const i=await getResponseData(c);const d=new p.RequestError(toErrorMessage(i),a,{response:{url:l,status:a,headers:s,data:i},request:r});throw d}return getResponseData(c)})).then((r=>({status:a,url:l,headers:s,data:r}))).catch((i=>{if(i instanceof p.RequestError)throw i;throw new p.RequestError(i.message,500,{request:r})}))}async function getResponseData(r){const i=r.headers.get("content-type");if(/application\/json/.test(i)){return r.json()}if(!i||/^text\/|charset=utf-8$/.test(i)){return r.text()}return getBufferResponse(r)}function toErrorMessage(r){if(typeof r==="string")return r;if("message"in r){if(Array.isArray(r.errors)){return`${r.message}: ${r.errors.map(JSON.stringify).join(", ")}`}return r.message}return`Unknown error: ${JSON.stringify(r)}`}function withDefaults(r,i){const s=r.defaults(i);const newApi=function(r,i){const a=s.merge(r,i);if(!a.request||!a.request.hook){return fetchWrapper(s.parse(a))}const request=(r,i)=>fetchWrapper(s.parse(s.merge(r,i)));Object.assign(request,{endpoint:s,defaults:withDefaults.bind(null,s)});return a.request.hook(request,a)};return Object.assign(newApi,{endpoint:s,defaults:withDefaults.bind(null,s)})}const A=withDefaults(a.endpoint,{headers:{"user-agent":`octokit-request.js/${u} ${l.getUserAgent()}`}});i.request=A},10597:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ContextAPI=void 0;const a=s(6357);const l=s(17533);const c=s(35841);const d="context";const p=new a.NoopContextManager;class ContextAPI{constructor(){}static getInstance(){if(!this._instance){this._instance=new ContextAPI}return this._instance}setGlobalContextManager(r){return(0,l.registerGlobal)(d,r,c.DiagAPI.instance())}active(){return this._getContextManager().active()}with(r,i,s,...a){return this._getContextManager().with(r,i,s,...a)}bind(r,i){return this._getContextManager().bind(r,i)}_getContextManager(){return(0,l.getGlobal)(d)||p}disable(){this._getContextManager().disable();(0,l.unregisterGlobal)(d,c.DiagAPI.instance())}}i.ContextAPI=ContextAPI},35841:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagAPI=void 0;const a=s(93820);const l=s(69066);const c=s(62517);const d=s(17533);const p="diag";class DiagAPI{constructor(){function _logProxy(r){return function(...i){const s=(0,d.getGlobal)("diag");if(!s)return;return s[r](...i)}}const r=this;const setLogger=(i,s={logLevel:c.DiagLogLevel.INFO})=>{var a,p,u;if(i===r){const i=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");r.error((a=i.stack)!==null&&a!==void 0?a:i.message);return false}if(typeof s==="number"){s={logLevel:s}}const A=(0,d.getGlobal)("diag");const h=(0,l.createLogLevelDiagLogger)((p=s.logLevel)!==null&&p!==void 0?p:c.DiagLogLevel.INFO,i);if(A&&!s.suppressOverrideMessage){const r=(u=(new Error).stack)!==null&&u!==void 0?u:"";A.warn(`Current logger will be overwritten from ${r}`);h.warn(`Current logger will overwrite one already registered from ${r}`)}return(0,d.registerGlobal)("diag",h,r,true)};r.setLogger=setLogger;r.disable=()=>{(0,d.unregisterGlobal)(p,r)};r.createComponentLogger=r=>new a.DiagComponentLogger(r);r.verbose=_logProxy("verbose");r.debug=_logProxy("debug");r.info=_logProxy("info");r.warn=_logProxy("warn");r.error=_logProxy("error")}static instance(){if(!this._instance){this._instance=new DiagAPI}return this._instance}}i.DiagAPI=DiagAPI},42537:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MetricsAPI=void 0;const a=s(94749);const l=s(17533);const c=s(35841);const d="metrics";class MetricsAPI{constructor(){}static getInstance(){if(!this._instance){this._instance=new MetricsAPI}return this._instance}setGlobalMeterProvider(r){return(0,l.registerGlobal)(d,r,c.DiagAPI.instance())}getMeterProvider(){return(0,l.getGlobal)(d)||a.NOOP_METER_PROVIDER}getMeter(r,i,s){return this.getMeterProvider().getMeter(r,i,s)}disable(){(0,l.unregisterGlobal)(d,c.DiagAPI.instance())}}i.MetricsAPI=MetricsAPI},68276:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.PropagationAPI=void 0;const a=s(17533);const l=s(95911);const c=s(84216);const d=s(78269);const p=s(6794);const u=s(35841);const A="propagation";const h=new l.NoopTextMapPropagator;class PropagationAPI{constructor(){this.createBaggage=p.createBaggage;this.getBaggage=d.getBaggage;this.getActiveBaggage=d.getActiveBaggage;this.setBaggage=d.setBaggage;this.deleteBaggage=d.deleteBaggage}static getInstance(){if(!this._instance){this._instance=new PropagationAPI}return this._instance}setGlobalPropagator(r){return(0,a.registerGlobal)(A,r,u.DiagAPI.instance())}inject(r,i,s=c.defaultTextMapSetter){return this._getGlobalPropagator().inject(r,i,s)}extract(r,i,s=c.defaultTextMapGetter){return this._getGlobalPropagator().extract(r,i,s)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,a.unregisterGlobal)(A,u.DiagAPI.instance())}_getGlobalPropagator(){return(0,a.getGlobal)(A)||h}}i.PropagationAPI=PropagationAPI},80978:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.TraceAPI=void 0;const a=s(17533);const l=s(33241);const c=s(66659);const d=s(50401);const p=s(35841);const u="trace";class TraceAPI{constructor(){this._proxyTracerProvider=new l.ProxyTracerProvider;this.wrapSpanContext=c.wrapSpanContext;this.isSpanContextValid=c.isSpanContextValid;this.deleteSpan=d.deleteSpan;this.getSpan=d.getSpan;this.getActiveSpan=d.getActiveSpan;this.getSpanContext=d.getSpanContext;this.setSpan=d.setSpan;this.setSpanContext=d.setSpanContext}static getInstance(){if(!this._instance){this._instance=new TraceAPI}return this._instance}setGlobalTracerProvider(r){const i=(0,a.registerGlobal)(u,this._proxyTracerProvider,p.DiagAPI.instance());if(i){this._proxyTracerProvider.setDelegate(r)}return i}getTracerProvider(){return(0,a.getGlobal)(u)||this._proxyTracerProvider}getTracer(r,i){return this.getTracerProvider().getTracer(r,i)}disable(){(0,a.unregisterGlobal)(u,p.DiagAPI.instance());this._proxyTracerProvider=new l.ProxyTracerProvider}}i.TraceAPI=TraceAPI},78269:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.deleteBaggage=i.setBaggage=i.getActiveBaggage=i.getBaggage=void 0;const a=s(10597);const l=s(88521);const c=(0,l.createContextKey)("OpenTelemetry Baggage Key");function getBaggage(r){return r.getValue(c)||undefined}i.getBaggage=getBaggage;function getActiveBaggage(){return getBaggage(a.ContextAPI.getInstance().active())}i.getActiveBaggage=getActiveBaggage;function setBaggage(r,i){return r.setValue(c,i)}i.setBaggage=setBaggage;function deleteBaggage(r){return r.deleteValue(c)}i.deleteBaggage=deleteBaggage},80996:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BaggageImpl=void 0;class BaggageImpl{constructor(r){this._entries=r?new Map(r):new Map}getEntry(r){const i=this._entries.get(r);if(!i){return undefined}return Object.assign({},i)}getAllEntries(){return Array.from(this._entries.entries()).map((([r,i])=>[r,i]))}setEntry(r,i){const s=new BaggageImpl(this._entries);s._entries.set(r,i);return s}removeEntry(r){const i=new BaggageImpl(this._entries);i._entries.delete(r);return i}removeEntries(...r){const i=new BaggageImpl(this._entries);for(const s of r){i._entries.delete(s)}return i}clear(){return new BaggageImpl}}i.BaggageImpl=BaggageImpl},23371:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.baggageEntryMetadataSymbol=void 0;i.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},6794:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.baggageEntryMetadataFromString=i.createBaggage=void 0;const a=s(35841);const l=s(80996);const c=s(23371);const d=a.DiagAPI.instance();function createBaggage(r={}){return new l.BaggageImpl(new Map(Object.entries(r)))}i.createBaggage=createBaggage;function baggageEntryMetadataFromString(r){if(typeof r!=="string"){d.error(`Cannot create baggage metadata from unknown type: ${typeof r}`);r=""}return{__TYPE__:c.baggageEntryMetadataSymbol,toString(){return r}}}i.baggageEntryMetadataFromString=baggageEntryMetadataFromString},35751:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.context=void 0;const a=s(10597);i.context=a.ContextAPI.getInstance()},6357:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopContextManager=void 0;const a=s(88521);class NoopContextManager{active(){return a.ROOT_CONTEXT}with(r,i,s,...a){return i.call(s,...a)}bind(r,i){return i}enable(){return this}disable(){return this}}i.NoopContextManager=NoopContextManager},88521:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ROOT_CONTEXT=i.createContextKey=void 0;function createContextKey(r){return Symbol.for(r)}i.createContextKey=createContextKey;class BaseContext{constructor(r){const i=this;i._currentContext=r?new Map(r):new Map;i.getValue=r=>i._currentContext.get(r);i.setValue=(r,s)=>{const a=new BaseContext(i._currentContext);a._currentContext.set(r,s);return a};i.deleteValue=r=>{const s=new BaseContext(i._currentContext);s._currentContext.delete(r);return s}}}i.ROOT_CONTEXT=new BaseContext},35654:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.diag=void 0;const a=s(35841);i.diag=a.DiagAPI.instance()},93820:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagComponentLogger=void 0;const a=s(17533);class DiagComponentLogger{constructor(r){this._namespace=r.namespace||"DiagComponentLogger"}debug(...r){return logProxy("debug",this._namespace,r)}error(...r){return logProxy("error",this._namespace,r)}info(...r){return logProxy("info",this._namespace,r)}warn(...r){return logProxy("warn",this._namespace,r)}verbose(...r){return logProxy("verbose",this._namespace,r)}}i.DiagComponentLogger=DiagComponentLogger;function logProxy(r,i,s){const l=(0,a.getGlobal)("diag");if(!l){return}s.unshift(i);return l[r](...s)}},83431:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagConsoleLogger=void 0;const s=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class DiagConsoleLogger{constructor(){function _consoleFunc(r){return function(...i){if(console){let s=console[r];if(typeof s!=="function"){s=console.log}if(typeof s==="function"){return s.apply(console,i)}}}}for(let r=0;r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createLogLevelDiagLogger=void 0;const a=s(62517);function createLogLevelDiagLogger(r,i){if(ra.DiagLogLevel.ALL){r=a.DiagLogLevel.ALL}i=i||{};function _filterFunc(s,a){const l=i[s];if(typeof l==="function"&&r>=a){return l.bind(i)}return function(){}}return{error:_filterFunc("error",a.DiagLogLevel.ERROR),warn:_filterFunc("warn",a.DiagLogLevel.WARN),info:_filterFunc("info",a.DiagLogLevel.INFO),debug:_filterFunc("debug",a.DiagLogLevel.DEBUG),verbose:_filterFunc("verbose",a.DiagLogLevel.VERBOSE)}}i.createLogLevelDiagLogger=createLogLevelDiagLogger},62517:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.DiagLogLevel=void 0;var s;(function(r){r[r["NONE"]=0]="NONE";r[r["ERROR"]=30]="ERROR";r[r["WARN"]=50]="WARN";r[r["INFO"]=60]="INFO";r[r["DEBUG"]=70]="DEBUG";r[r["VERBOSE"]=80]="VERBOSE";r[r["ALL"]=9999]="ALL"})(s=i.DiagLogLevel||(i.DiagLogLevel={}))},85762:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.trace=i.propagation=i.metrics=i.diag=i.context=i.INVALID_SPAN_CONTEXT=i.INVALID_TRACEID=i.INVALID_SPANID=i.isValidSpanId=i.isValidTraceId=i.isSpanContextValid=i.createTraceState=i.TraceFlags=i.SpanStatusCode=i.SpanKind=i.SamplingDecision=i.ProxyTracerProvider=i.ProxyTracer=i.defaultTextMapSetter=i.defaultTextMapGetter=i.ValueType=i.createNoopMeter=i.DiagLogLevel=i.DiagConsoleLogger=i.ROOT_CONTEXT=i.createContextKey=i.baggageEntryMetadataFromString=void 0;var a=s(6794);Object.defineProperty(i,"baggageEntryMetadataFromString",{enumerable:true,get:function(){return a.baggageEntryMetadataFromString}});var l=s(88521);Object.defineProperty(i,"createContextKey",{enumerable:true,get:function(){return l.createContextKey}});Object.defineProperty(i,"ROOT_CONTEXT",{enumerable:true,get:function(){return l.ROOT_CONTEXT}});var c=s(83431);Object.defineProperty(i,"DiagConsoleLogger",{enumerable:true,get:function(){return c.DiagConsoleLogger}});var d=s(62517);Object.defineProperty(i,"DiagLogLevel",{enumerable:true,get:function(){return d.DiagLogLevel}});var p=s(90783);Object.defineProperty(i,"createNoopMeter",{enumerable:true,get:function(){return p.createNoopMeter}});var u=s(8809);Object.defineProperty(i,"ValueType",{enumerable:true,get:function(){return u.ValueType}});var A=s(84216);Object.defineProperty(i,"defaultTextMapGetter",{enumerable:true,get:function(){return A.defaultTextMapGetter}});Object.defineProperty(i,"defaultTextMapSetter",{enumerable:true,get:function(){return A.defaultTextMapSetter}});var h=s(91804);Object.defineProperty(i,"ProxyTracer",{enumerable:true,get:function(){return h.ProxyTracer}});var g=s(33241);Object.defineProperty(i,"ProxyTracerProvider",{enumerable:true,get:function(){return g.ProxyTracerProvider}});var y=s(63046);Object.defineProperty(i,"SamplingDecision",{enumerable:true,get:function(){return y.SamplingDecision}});var b=s(844);Object.defineProperty(i,"SpanKind",{enumerable:true,get:function(){return b.SpanKind}});var w=s(19889);Object.defineProperty(i,"SpanStatusCode",{enumerable:true,get:function(){return w.SpanStatusCode}});var C=s(52970);Object.defineProperty(i,"TraceFlags",{enumerable:true,get:function(){return C.TraceFlags}});var v=s(93222);Object.defineProperty(i,"createTraceState",{enumerable:true,get:function(){return v.createTraceState}});var I=s(66659);Object.defineProperty(i,"isSpanContextValid",{enumerable:true,get:function(){return I.isSpanContextValid}});Object.defineProperty(i,"isValidTraceId",{enumerable:true,get:function(){return I.isValidTraceId}});Object.defineProperty(i,"isValidSpanId",{enumerable:true,get:function(){return I.isValidSpanId}});var B=s(35259);Object.defineProperty(i,"INVALID_SPANID",{enumerable:true,get:function(){return B.INVALID_SPANID}});Object.defineProperty(i,"INVALID_TRACEID",{enumerable:true,get:function(){return B.INVALID_TRACEID}});Object.defineProperty(i,"INVALID_SPAN_CONTEXT",{enumerable:true,get:function(){return B.INVALID_SPAN_CONTEXT}});const S=s(35751);Object.defineProperty(i,"context",{enumerable:true,get:function(){return S.context}});const x=s(35654);Object.defineProperty(i,"diag",{enumerable:true,get:function(){return x.diag}});const R=s(77090);Object.defineProperty(i,"metrics",{enumerable:true,get:function(){return R.metrics}});const Q=s(40113);Object.defineProperty(i,"propagation",{enumerable:true,get:function(){return Q.propagation}});const _=s(82227);Object.defineProperty(i,"trace",{enumerable:true,get:function(){return _.trace}});i["default"]={context:S.context,diag:x.diag,metrics:R.metrics,propagation:Q.propagation,trace:_.trace}},17533:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.unregisterGlobal=i.getGlobal=i.registerGlobal=void 0;const a=s(11207);const l=s(23445);const c=s(54610);const d=l.VERSION.split(".")[0];const p=Symbol.for(`opentelemetry.js.api.${d}`);const u=a._globalThis;function registerGlobal(r,i,s,a=false){var c;const d=u[p]=(c=u[p])!==null&&c!==void 0?c:{version:l.VERSION};if(!a&&d[r]){const i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${r}`);s.error(i.stack||i.message);return false}if(d.version!==l.VERSION){const i=new Error(`@opentelemetry/api: Registration of version v${d.version} for ${r} does not match previously registered API v${l.VERSION}`);s.error(i.stack||i.message);return false}d[r]=i;s.debug(`@opentelemetry/api: Registered a global for ${r} v${l.VERSION}.`);return true}i.registerGlobal=registerGlobal;function getGlobal(r){var i,s;const a=(i=u[p])===null||i===void 0?void 0:i.version;if(!a||!(0,c.isCompatible)(a)){return}return(s=u[p])===null||s===void 0?void 0:s[r]}i.getGlobal=getGlobal;function unregisterGlobal(r,i){i.debug(`@opentelemetry/api: Unregistering a global for ${r} v${l.VERSION}.`);const s=u[p];if(s){delete s[r]}}i.unregisterGlobal=unregisterGlobal},54610:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isCompatible=i._makeCompatibilityCheck=void 0;const a=s(23445);const l=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function _makeCompatibilityCheck(r){const i=new Set([r]);const s=new Set;const a=r.match(l);if(!a){return()=>false}const c={major:+a[1],minor:+a[2],patch:+a[3],prerelease:a[4]};if(c.prerelease!=null){return function isExactmatch(i){return i===r}}function _reject(r){s.add(r);return false}function _accept(r){i.add(r);return true}return function isCompatible(r){if(i.has(r)){return true}if(s.has(r)){return false}const a=r.match(l);if(!a){return _reject(r)}const d={major:+a[1],minor:+a[2],patch:+a[3],prerelease:a[4]};if(d.prerelease!=null){return _reject(r)}if(c.major!==d.major){return _reject(r)}if(c.major===0){if(c.minor===d.minor&&c.patch<=d.patch){return _accept(r)}return _reject(r)}if(c.minor<=d.minor){return _accept(r)}return _reject(r)}}i._makeCompatibilityCheck=_makeCompatibilityCheck;i.isCompatible=_makeCompatibilityCheck(a.VERSION)},77090:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.metrics=void 0;const a=s(42537);i.metrics=a.MetricsAPI.getInstance()},8809:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ValueType=void 0;var s;(function(r){r[r["INT"]=0]="INT";r[r["DOUBLE"]=1]="DOUBLE"})(s=i.ValueType||(i.ValueType={}))},90783:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createNoopMeter=i.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=i.NOOP_OBSERVABLE_GAUGE_METRIC=i.NOOP_OBSERVABLE_COUNTER_METRIC=i.NOOP_UP_DOWN_COUNTER_METRIC=i.NOOP_HISTOGRAM_METRIC=i.NOOP_COUNTER_METRIC=i.NOOP_METER=i.NoopObservableUpDownCounterMetric=i.NoopObservableGaugeMetric=i.NoopObservableCounterMetric=i.NoopObservableMetric=i.NoopHistogramMetric=i.NoopUpDownCounterMetric=i.NoopCounterMetric=i.NoopMetric=i.NoopMeter=void 0;class NoopMeter{constructor(){}createHistogram(r,s){return i.NOOP_HISTOGRAM_METRIC}createCounter(r,s){return i.NOOP_COUNTER_METRIC}createUpDownCounter(r,s){return i.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(r,s){return i.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(r,s){return i.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(r,s){return i.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(r,i){}removeBatchObservableCallback(r){}}i.NoopMeter=NoopMeter;class NoopMetric{}i.NoopMetric=NoopMetric;class NoopCounterMetric extends NoopMetric{add(r,i){}}i.NoopCounterMetric=NoopCounterMetric;class NoopUpDownCounterMetric extends NoopMetric{add(r,i){}}i.NoopUpDownCounterMetric=NoopUpDownCounterMetric;class NoopHistogramMetric extends NoopMetric{record(r,i){}}i.NoopHistogramMetric=NoopHistogramMetric;class NoopObservableMetric{addCallback(r){}removeCallback(r){}}i.NoopObservableMetric=NoopObservableMetric;class NoopObservableCounterMetric extends NoopObservableMetric{}i.NoopObservableCounterMetric=NoopObservableCounterMetric;class NoopObservableGaugeMetric extends NoopObservableMetric{}i.NoopObservableGaugeMetric=NoopObservableGaugeMetric;class NoopObservableUpDownCounterMetric extends NoopObservableMetric{}i.NoopObservableUpDownCounterMetric=NoopObservableUpDownCounterMetric;i.NOOP_METER=new NoopMeter;i.NOOP_COUNTER_METRIC=new NoopCounterMetric;i.NOOP_HISTOGRAM_METRIC=new NoopHistogramMetric;i.NOOP_UP_DOWN_COUNTER_METRIC=new NoopUpDownCounterMetric;i.NOOP_OBSERVABLE_COUNTER_METRIC=new NoopObservableCounterMetric;i.NOOP_OBSERVABLE_GAUGE_METRIC=new NoopObservableGaugeMetric;i.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new NoopObservableUpDownCounterMetric;function createNoopMeter(){return i.NOOP_METER}i.createNoopMeter=createNoopMeter},94749:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NOOP_METER_PROVIDER=i.NoopMeterProvider=void 0;const a=s(90783);class NoopMeterProvider{getMeter(r,i,s){return a.NOOP_METER}}i.NoopMeterProvider=NoopMeterProvider;i.NOOP_METER_PROVIDER=new NoopMeterProvider},11207:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__exportStar||function(r,i){for(var s in r)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s))a(i,r,s)};Object.defineProperty(i,"__esModule",{value:true});l(s(45362),i)},776:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i._globalThis=void 0;i._globalThis=typeof globalThis==="object"?globalThis:global},45362:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__exportStar||function(r,i){for(var s in r)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s))a(i,r,s)};Object.defineProperty(i,"__esModule",{value:true});l(s(776),i)},40113:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.propagation=void 0;const a=s(68276);i.propagation=a.PropagationAPI.getInstance()},95911:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopTextMapPropagator=void 0;class NoopTextMapPropagator{inject(r,i){}extract(r,i){return r}fields(){return[]}}i.NoopTextMapPropagator=NoopTextMapPropagator},84216:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.defaultTextMapSetter=i.defaultTextMapGetter=void 0;i.defaultTextMapGetter={get(r,i){if(r==null){return undefined}return r[i]},keys(r){if(r==null){return[]}return Object.keys(r)}};i.defaultTextMapSetter={set(r,i,s){if(r==null){return}r[i]=s}}},82227:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.trace=void 0;const a=s(80978);i.trace=a.TraceAPI.getInstance()},75484:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NonRecordingSpan=void 0;const a=s(35259);class NonRecordingSpan{constructor(r=a.INVALID_SPAN_CONTEXT){this._spanContext=r}spanContext(){return this._spanContext}setAttribute(r,i){return this}setAttributes(r){return this}addEvent(r,i){return this}setStatus(r){return this}updateName(r){return this}end(r){}isRecording(){return false}recordException(r,i){}}i.NonRecordingSpan=NonRecordingSpan},88248:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopTracer=void 0;const a=s(10597);const l=s(50401);const c=s(75484);const d=s(66659);const p=a.ContextAPI.getInstance();class NoopTracer{startSpan(r,i,s=p.active()){const a=Boolean(i===null||i===void 0?void 0:i.root);if(a){return new c.NonRecordingSpan}const u=s&&(0,l.getSpanContext)(s);if(isSpanContext(u)&&(0,d.isSpanContextValid)(u)){return new c.NonRecordingSpan(u)}else{return new c.NonRecordingSpan}}startActiveSpan(r,i,s,a){let c;let d;let u;if(arguments.length<2){return}else if(arguments.length===2){u=i}else if(arguments.length===3){c=i;u=s}else{c=i;d=s;u=a}const A=d!==null&&d!==void 0?d:p.active();const h=this.startSpan(r,c,A);const g=(0,l.setSpan)(A,h);return p.with(g,u,undefined,h)}}i.NoopTracer=NoopTracer;function isSpanContext(r){return typeof r==="object"&&typeof r["spanId"]==="string"&&typeof r["traceId"]==="string"&&typeof r["traceFlags"]==="number"}},32495:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.NoopTracerProvider=void 0;const a=s(88248);class NoopTracerProvider{getTracer(r,i,s){return new a.NoopTracer}}i.NoopTracerProvider=NoopTracerProvider},91804:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ProxyTracer=void 0;const a=s(88248);const l=new a.NoopTracer;class ProxyTracer{constructor(r,i,s,a){this._provider=r;this.name=i;this.version=s;this.options=a}startSpan(r,i,s){return this._getTracer().startSpan(r,i,s)}startActiveSpan(r,i,s,a){const l=this._getTracer();return Reflect.apply(l.startActiveSpan,l,arguments)}_getTracer(){if(this._delegate){return this._delegate}const r=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!r){return l}this._delegate=r;return this._delegate}}i.ProxyTracer=ProxyTracer},33241:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ProxyTracerProvider=void 0;const a=s(91804);const l=s(32495);const c=new l.NoopTracerProvider;class ProxyTracerProvider{getTracer(r,i,s){var l;return(l=this.getDelegateTracer(r,i,s))!==null&&l!==void 0?l:new a.ProxyTracer(this,r,i,s)}getDelegate(){var r;return(r=this._delegate)!==null&&r!==void 0?r:c}setDelegate(r){this._delegate=r}getDelegateTracer(r,i,s){var a;return(a=this._delegate)===null||a===void 0?void 0:a.getTracer(r,i,s)}}i.ProxyTracerProvider=ProxyTracerProvider},63046:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SamplingDecision=void 0;var s;(function(r){r[r["NOT_RECORD"]=0]="NOT_RECORD";r[r["RECORD"]=1]="RECORD";r[r["RECORD_AND_SAMPLED"]=2]="RECORD_AND_SAMPLED"})(s=i.SamplingDecision||(i.SamplingDecision={}))},50401:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getSpanContext=i.setSpanContext=i.deleteSpan=i.setSpan=i.getActiveSpan=i.getSpan=void 0;const a=s(88521);const l=s(75484);const c=s(10597);const d=(0,a.createContextKey)("OpenTelemetry Context Key SPAN");function getSpan(r){return r.getValue(d)||undefined}i.getSpan=getSpan;function getActiveSpan(){return getSpan(c.ContextAPI.getInstance().active())}i.getActiveSpan=getActiveSpan;function setSpan(r,i){return r.setValue(d,i)}i.setSpan=setSpan;function deleteSpan(r){return r.deleteValue(d)}i.deleteSpan=deleteSpan;function setSpanContext(r,i){return setSpan(r,new l.NonRecordingSpan(i))}i.setSpanContext=setSpanContext;function getSpanContext(r){var i;return(i=getSpan(r))===null||i===void 0?void 0:i.spanContext()}i.getSpanContext=getSpanContext},64503:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.TraceStateImpl=void 0;const a=s(51864);const l=32;const c=512;const d=",";const p="=";class TraceStateImpl{constructor(r){this._internalState=new Map;if(r)this._parse(r)}set(r,i){const s=this._clone();if(s._internalState.has(r)){s._internalState.delete(r)}s._internalState.set(r,i);return s}unset(r){const i=this._clone();i._internalState.delete(r);return i}get(r){return this._internalState.get(r)}serialize(){return this._keys().reduce(((r,i)=>{r.push(i+p+this.get(i));return r}),[]).join(d)}_parse(r){if(r.length>c)return;this._internalState=r.split(d).reverse().reduce(((r,i)=>{const s=i.trim();const l=s.indexOf(p);if(l!==-1){const c=s.slice(0,l);const d=s.slice(l+1,i.length);if((0,a.validateKey)(c)&&(0,a.validateValue)(d)){r.set(c,d)}else{}}return r}),new Map);if(this._internalState.size>l){this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,l))}}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const r=new TraceStateImpl;r._internalState=new Map(this._internalState);return r}}i.TraceStateImpl=TraceStateImpl},51864:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.validateValue=i.validateKey=void 0;const s="[_0-9a-z-*/]";const a=`[a-z]${s}{0,255}`;const l=`[a-z0-9]${s}{0,240}@[a-z]${s}{0,13}`;const c=new RegExp(`^(?:${a}|${l})$`);const d=/^[ -~]{0,255}[!-~]$/;const p=/,|=/;function validateKey(r){return c.test(r)}i.validateKey=validateKey;function validateValue(r){return d.test(r)&&!p.test(r)}i.validateValue=validateValue},93222:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createTraceState=void 0;const a=s(64503);function createTraceState(r){return new a.TraceStateImpl(r)}i.createTraceState=createTraceState},35259:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.INVALID_SPAN_CONTEXT=i.INVALID_TRACEID=i.INVALID_SPANID=void 0;const a=s(52970);i.INVALID_SPANID="0000000000000000";i.INVALID_TRACEID="00000000000000000000000000000000";i.INVALID_SPAN_CONTEXT={traceId:i.INVALID_TRACEID,spanId:i.INVALID_SPANID,traceFlags:a.TraceFlags.NONE}},844:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SpanKind=void 0;var s;(function(r){r[r["INTERNAL"]=0]="INTERNAL";r[r["SERVER"]=1]="SERVER";r[r["CLIENT"]=2]="CLIENT";r[r["PRODUCER"]=3]="PRODUCER";r[r["CONSUMER"]=4]="CONSUMER"})(s=i.SpanKind||(i.SpanKind={}))},66659:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.wrapSpanContext=i.isSpanContextValid=i.isValidSpanId=i.isValidTraceId=void 0;const a=s(35259);const l=s(75484);const c=/^([0-9a-f]{32})$/i;const d=/^[0-9a-f]{16}$/i;function isValidTraceId(r){return c.test(r)&&r!==a.INVALID_TRACEID}i.isValidTraceId=isValidTraceId;function isValidSpanId(r){return d.test(r)&&r!==a.INVALID_SPANID}i.isValidSpanId=isValidSpanId;function isSpanContextValid(r){return isValidTraceId(r.traceId)&&isValidSpanId(r.spanId)}i.isSpanContextValid=isSpanContextValid;function wrapSpanContext(r){return new l.NonRecordingSpan(r)}i.wrapSpanContext=wrapSpanContext},19889:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SpanStatusCode=void 0;var s;(function(r){r[r["UNSET"]=0]="UNSET";r[r["OK"]=1]="OK";r[r["ERROR"]=2]="ERROR"})(s=i.SpanStatusCode||(i.SpanStatusCode={}))},52970:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.TraceFlags=void 0;var s;(function(r){r[r["NONE"]=0]="NONE";r[r["SAMPLED"]=1]="SAMPLED"})(s=i.TraceFlags||(i.TraceFlags={}))},23445:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.VERSION=void 0;i.VERSION="1.8.0"},36655:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.ClientStreamingCall=void 0;class ClientStreamingCall{constructor(r,i,s,a,l,c,d){this.method=r;this.requestHeaders=i;this.requests=s;this.headers=a;this.response=l;this.status=c;this.trailers=d}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return s(this,void 0,void 0,(function*(){let[r,i,s,a]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:r,response:i,status:s,trailers:a}}))}}i.ClientStreamingCall=ClientStreamingCall},33544:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Deferred=i.DeferredState=void 0;var s;(function(r){r[r["PENDING"]=0]="PENDING";r[r["REJECTED"]=1]="REJECTED";r[r["RESOLVED"]=2]="RESOLVED"})(s=i.DeferredState||(i.DeferredState={}));class Deferred{constructor(r=true){this._state=s.PENDING;this._promise=new Promise(((r,i)=>{this._resolve=r;this._reject=i}));if(r){this._promise.catch((r=>{}))}}get state(){return this._state}get promise(){return this._promise}resolve(r){if(this.state!==s.PENDING)throw new Error(`cannot resolve ${s[this.state].toLowerCase()}`);this._resolve(r);this._state=s.RESOLVED}reject(r){if(this.state!==s.PENDING)throw new Error(`cannot reject ${s[this.state].toLowerCase()}`);this._reject(r);this._state=s.REJECTED}resolvePending(r){if(this._state===s.PENDING)this.resolve(r)}rejectPending(r){if(this._state===s.PENDING)this.reject(r)}}i.Deferred=Deferred},12692:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.DuplexStreamingCall=void 0;class DuplexStreamingCall{constructor(r,i,s,a,l,c,d){this.method=r;this.requestHeaders=i;this.requests=s;this.headers=a;this.responses=l;this.status=c;this.trailers=d}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return s(this,void 0,void 0,(function*(){let[r,i,s]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:r,status:i,trailers:s}}))}}i.DuplexStreamingCall=DuplexStreamingCall},83006:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(22345);Object.defineProperty(i,"ServiceType",{enumerable:true,get:function(){return a.ServiceType}});var l=s(72911);Object.defineProperty(i,"readMethodOptions",{enumerable:true,get:function(){return l.readMethodOptions}});Object.defineProperty(i,"readMethodOption",{enumerable:true,get:function(){return l.readMethodOption}});Object.defineProperty(i,"readServiceOption",{enumerable:true,get:function(){return l.readServiceOption}});var c=s(79135);Object.defineProperty(i,"RpcError",{enumerable:true,get:function(){return c.RpcError}});var d=s(10877);Object.defineProperty(i,"mergeRpcOptions",{enumerable:true,get:function(){return d.mergeRpcOptions}});var p=s(18962);Object.defineProperty(i,"RpcOutputStreamController",{enumerable:true,get:function(){return p.RpcOutputStreamController}});var u=s(77578);Object.defineProperty(i,"TestTransport",{enumerable:true,get:function(){return u.TestTransport}});var A=s(33544);Object.defineProperty(i,"Deferred",{enumerable:true,get:function(){return A.Deferred}});Object.defineProperty(i,"DeferredState",{enumerable:true,get:function(){return A.DeferredState}});var h=s(12692);Object.defineProperty(i,"DuplexStreamingCall",{enumerable:true,get:function(){return h.DuplexStreamingCall}});var g=s(36655);Object.defineProperty(i,"ClientStreamingCall",{enumerable:true,get:function(){return g.ClientStreamingCall}});var y=s(80266);Object.defineProperty(i,"ServerStreamingCall",{enumerable:true,get:function(){return y.ServerStreamingCall}});var b=s(50037);Object.defineProperty(i,"UnaryCall",{enumerable:true,get:function(){return b.UnaryCall}});var w=s(85079);Object.defineProperty(i,"stackIntercept",{enumerable:true,get:function(){return w.stackIntercept}});Object.defineProperty(i,"stackDuplexStreamingInterceptors",{enumerable:true,get:function(){return w.stackDuplexStreamingInterceptors}});Object.defineProperty(i,"stackClientStreamingInterceptors",{enumerable:true,get:function(){return w.stackClientStreamingInterceptors}});Object.defineProperty(i,"stackServerStreamingInterceptors",{enumerable:true,get:function(){return w.stackServerStreamingInterceptors}});Object.defineProperty(i,"stackUnaryInterceptors",{enumerable:true,get:function(){return w.stackUnaryInterceptors}});var C=s(44576);Object.defineProperty(i,"ServerCallContextController",{enumerable:true,get:function(){return C.ServerCallContextController}})},72911:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.readServiceOption=i.readMethodOption=i.readMethodOptions=i.normalizeMethodInfo=void 0;const a=s(98604);function normalizeMethodInfo(r,i){var s,l,c;let d=r;d.service=i;d.localName=(s=d.localName)!==null&&s!==void 0?s:a.lowerCamelCase(d.name);d.serverStreaming=!!d.serverStreaming;d.clientStreaming=!!d.clientStreaming;d.options=(l=d.options)!==null&&l!==void 0?l:{};d.idempotency=(c=d.idempotency)!==null&&c!==void 0?c:undefined;return d}i.normalizeMethodInfo=normalizeMethodInfo;function readMethodOptions(r,i,s,a){var l;const c=(l=r.methods.find(((r,s)=>r.localName===i||s===i)))===null||l===void 0?void 0:l.options;return c&&c[s]?a.fromJson(c[s]):undefined}i.readMethodOptions=readMethodOptions;function readMethodOption(r,i,s,a){var l;const c=(l=r.methods.find(((r,s)=>r.localName===i||s===i)))===null||l===void 0?void 0:l.options;if(!c){return undefined}const d=c[s];if(d===undefined){return d}return a?a.fromJson(d):d}i.readMethodOption=readMethodOption;function readServiceOption(r,i,s){const a=r.options;if(!a){return undefined}const l=a[i];if(l===undefined){return l}return s?s.fromJson(l):l}i.readServiceOption=readServiceOption},79135:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.RpcError=void 0;class RpcError extends Error{constructor(r,i="UNKNOWN",s){super(r);this.name="RpcError";Object.setPrototypeOf(this,new.target.prototype);this.code=i;this.meta=s!==null&&s!==void 0?s:{}}toString(){const r=[this.name+": "+this.message];if(this.code){r.push("");r.push("Code: "+this.code)}if(this.serviceName&&this.methodName){r.push("Method: "+this.serviceName+"/"+this.methodName)}let i=Object.entries(this.meta);if(i.length){r.push("");r.push("Meta:");for(let[s,a]of i){r.push(` ${s}: ${a}`)}}return r.join("\n")}}i.RpcError=RpcError},85079:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.stackDuplexStreamingInterceptors=i.stackClientStreamingInterceptors=i.stackServerStreamingInterceptors=i.stackUnaryInterceptors=i.stackIntercept=void 0;const a=s(98604);function stackIntercept(r,i,s,l,c){var d,p,u,A;if(r=="unary"){let tail=(r,s,a)=>i.unary(r,s,a);for(const r of((d=l.interceptors)!==null&&d!==void 0?d:[]).filter((r=>r.interceptUnary)).reverse()){const i=tail;tail=(s,a,l)=>r.interceptUnary(i,s,a,l)}return tail(s,c,l)}if(r=="serverStreaming"){let tail=(r,s,a)=>i.serverStreaming(r,s,a);for(const r of((p=l.interceptors)!==null&&p!==void 0?p:[]).filter((r=>r.interceptServerStreaming)).reverse()){const i=tail;tail=(s,a,l)=>r.interceptServerStreaming(i,s,a,l)}return tail(s,c,l)}if(r=="clientStreaming"){let tail=(r,s)=>i.clientStreaming(r,s);for(const r of((u=l.interceptors)!==null&&u!==void 0?u:[]).filter((r=>r.interceptClientStreaming)).reverse()){const i=tail;tail=(s,a)=>r.interceptClientStreaming(i,s,a)}return tail(s,l)}if(r=="duplex"){let tail=(r,s)=>i.duplex(r,s);for(const r of((A=l.interceptors)!==null&&A!==void 0?A:[]).filter((r=>r.interceptDuplex)).reverse()){const i=tail;tail=(s,a)=>r.interceptDuplex(i,s,a)}return tail(s,l)}a.assertNever(r)}i.stackIntercept=stackIntercept;function stackUnaryInterceptors(r,i,s,a){return stackIntercept("unary",r,i,a,s)}i.stackUnaryInterceptors=stackUnaryInterceptors;function stackServerStreamingInterceptors(r,i,s,a){return stackIntercept("serverStreaming",r,i,a,s)}i.stackServerStreamingInterceptors=stackServerStreamingInterceptors;function stackClientStreamingInterceptors(r,i,s){return stackIntercept("clientStreaming",r,i,s)}i.stackClientStreamingInterceptors=stackClientStreamingInterceptors;function stackDuplexStreamingInterceptors(r,i,s){return stackIntercept("duplex",r,i,s)}i.stackDuplexStreamingInterceptors=stackDuplexStreamingInterceptors},10877:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.mergeRpcOptions=void 0;const a=s(98604);function mergeRpcOptions(r,i){if(!i)return r;let s={};copy(r,s);copy(i,s);for(let l of Object.keys(i)){let c=i[l];switch(l){case"jsonOptions":s.jsonOptions=a.mergeJsonOptions(r.jsonOptions,s.jsonOptions);break;case"binaryOptions":s.binaryOptions=a.mergeBinaryOptions(r.binaryOptions,s.binaryOptions);break;case"meta":s.meta={};copy(r.meta,s.meta);copy(i.meta,s.meta);break;case"interceptors":s.interceptors=r.interceptors?r.interceptors.concat(c):c.concat();break}}return s}i.mergeRpcOptions=mergeRpcOptions;function copy(r,i){if(!r)return;let s=i;for(let[i,a]of Object.entries(r)){if(a instanceof Date)s[i]=new Date(a.getTime());else if(Array.isArray(a))s[i]=a.concat();else s[i]=a}}},18962:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.RpcOutputStreamController=void 0;const a=s(33544);const l=s(98604);class RpcOutputStreamController{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]};this._closed=false}onNext(r){return this.addLis(r,this._lis.nxt)}onMessage(r){return this.addLis(r,this._lis.msg)}onError(r){return this.addLis(r,this._lis.err)}onComplete(r){return this.addLis(r,this._lis.cmp)}addLis(r,i){i.push(r);return()=>{let s=i.indexOf(r);if(s>=0)i.splice(s,1)}}clearLis(){for(let r of Object.values(this._lis))r.splice(0,r.length)}get closed(){return this._closed!==false}notifyNext(r,i,s){l.assert((r?1:0)+(i?1:0)+(s?1:0)<=1,"only one emission at a time");if(r)this.notifyMessage(r);if(i)this.notifyError(i);if(s)this.notifyComplete()}notifyMessage(r){l.assert(!this.closed,"stream is closed");this.pushIt({value:r,done:false});this._lis.msg.forEach((i=>i(r)));this._lis.nxt.forEach((i=>i(r,undefined,false)))}notifyError(r){l.assert(!this.closed,"stream is closed");this._closed=r;this.pushIt(r);this._lis.err.forEach((i=>i(r)));this._lis.nxt.forEach((i=>i(undefined,r,false)));this.clearLis()}notifyComplete(){l.assert(!this.closed,"stream is closed");this._closed=true;this.pushIt({value:null,done:true});this._lis.cmp.forEach((r=>r()));this._lis.nxt.forEach((r=>r(undefined,undefined,true)));this.clearLis()}[Symbol.asyncIterator](){if(!this._itState){this._itState={q:[]}}if(this._closed===true)this.pushIt({value:null,done:true});else if(this._closed!==false)this.pushIt(this._closed);return{next:()=>{let r=this._itState;l.assert(r,"bad state");l.assert(!r.p,"iterator contract broken");let i=r.q.shift();if(i)return"value"in i?Promise.resolve(i):Promise.reject(i);r.p=new a.Deferred;return r.p.promise}}}pushIt(r){let i=this._itState;if(!i)return;if(i.p){const s=i.p;l.assert(s.state==a.DeferredState.PENDING,"iterator contract broken");"value"in r?s.resolve(r):s.reject(r);delete i.p}else{i.q.push(r)}}}i.RpcOutputStreamController=RpcOutputStreamController},44576:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ServerCallContextController=void 0;class ServerCallContextController{constructor(r,i,s,a,l={code:"OK",detail:""}){this._cancelled=false;this._listeners=[];this.method=r;this.headers=i;this.deadline=s;this.trailers={};this._sendRH=a;this.status=l}notifyCancelled(){if(!this._cancelled){this._cancelled=true;for(let r of this._listeners){r()}}}sendResponseHeaders(r){this._sendRH(r)}get cancelled(){return this._cancelled}onCancel(r){const i=this._listeners;i.push(r);return()=>{let s=i.indexOf(r);if(s>=0)i.splice(s,1)}}}i.ServerCallContextController=ServerCallContextController},80266:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.ServerStreamingCall=void 0;class ServerStreamingCall{constructor(r,i,s,a,l,c,d){this.method=r;this.requestHeaders=i;this.request=s;this.headers=a;this.responses=l;this.status=c;this.trailers=d}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return s(this,void 0,void 0,(function*(){let[r,i,s]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:r,status:i,trailers:s}}))}}i.ServerStreamingCall=ServerStreamingCall},22345:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ServiceType=void 0;const a=s(72911);class ServiceType{constructor(r,i,s){this.typeName=r;this.methods=i.map((r=>a.normalizeMethodInfo(r,this)));this.options=s!==null&&s!==void 0?s:{}}}i.ServiceType=ServiceType},77578:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.TestTransport=void 0;const l=s(79135);const c=s(98604);const d=s(18962);const p=s(10877);const u=s(50037);const A=s(80266);const h=s(36655);const g=s(12692);class TestTransport{constructor(r){this.suppressUncaughtRejections=true;this.headerDelay=10;this.responseDelay=50;this.betweenResponseDelay=10;this.afterResponseDelay=10;this.data=r!==null&&r!==void 0?r:{}}get sentMessages(){if(this.lastInput instanceof TestInputStream){return this.lastInput.sent}else if(typeof this.lastInput=="object"){return[this.lastInput.single]}return[]}get sendComplete(){if(this.lastInput instanceof TestInputStream){return this.lastInput.completed}else if(typeof this.lastInput=="object"){return true}return false}promiseHeaders(){var r;const i=(r=this.data.headers)!==null&&r!==void 0?r:TestTransport.defaultHeaders;return i instanceof l.RpcError?Promise.reject(i):Promise.resolve(i)}promiseSingleResponse(r){if(this.data.response instanceof l.RpcError){return Promise.reject(this.data.response)}let i;if(Array.isArray(this.data.response)){c.assert(this.data.response.length>0);i=this.data.response[0]}else if(this.data.response!==undefined){i=this.data.response}else{i=r.O.create()}c.assert(r.O.is(i));return Promise.resolve(i)}streamResponses(r,i,s){return a(this,void 0,void 0,(function*(){const a=[];if(this.data.response===undefined){a.push(r.O.create())}else if(Array.isArray(this.data.response)){for(let i of this.data.response){c.assert(r.O.is(i));a.push(i)}}else if(!(this.data.response instanceof l.RpcError)){c.assert(r.O.is(this.data.response));a.push(this.data.response)}try{yield delay(this.responseDelay,s)(undefined)}catch(r){i.notifyError(r);return}if(this.data.response instanceof l.RpcError){i.notifyError(this.data.response);return}for(let r of a){i.notifyMessage(r);try{yield delay(this.betweenResponseDelay,s)(undefined)}catch(r){i.notifyError(r);return}}if(this.data.status instanceof l.RpcError){i.notifyError(this.data.status);return}if(this.data.trailers instanceof l.RpcError){i.notifyError(this.data.trailers);return}i.notifyComplete()}))}promiseStatus(){var r;const i=(r=this.data.status)!==null&&r!==void 0?r:TestTransport.defaultStatus;return i instanceof l.RpcError?Promise.reject(i):Promise.resolve(i)}promiseTrailers(){var r;const i=(r=this.data.trailers)!==null&&r!==void 0?r:TestTransport.defaultTrailers;return i instanceof l.RpcError?Promise.reject(i):Promise.resolve(i)}maybeSuppressUncaught(...r){if(this.suppressUncaughtRejections){for(let i of r){i.catch((()=>{}))}}}mergeOptions(r){return p.mergeRpcOptions({},r)}unary(r,i,s){var a;const l=(a=s.meta)!==null&&a!==void 0?a:{},c=this.promiseHeaders().then(delay(this.headerDelay,s.abort)),d=c.catch((r=>{})).then(delay(this.responseDelay,s.abort)).then((i=>this.promiseSingleResponse(r))),p=d.catch((r=>{})).then(delay(this.afterResponseDelay,s.abort)).then((r=>this.promiseStatus())),A=d.catch((r=>{})).then(delay(this.afterResponseDelay,s.abort)).then((r=>this.promiseTrailers()));this.maybeSuppressUncaught(p,A);this.lastInput={single:i};return new u.UnaryCall(r,l,i,c,d,p,A)}serverStreaming(r,i,s){var a;const l=(a=s.meta)!==null&&a!==void 0?a:{},c=this.promiseHeaders().then(delay(this.headerDelay,s.abort)),p=new d.RpcOutputStreamController,u=c.then(delay(this.responseDelay,s.abort)).catch((()=>{})).then((()=>this.streamResponses(r,p,s.abort))).then(delay(this.afterResponseDelay,s.abort)),h=u.then((()=>this.promiseStatus())),g=u.then((()=>this.promiseTrailers()));this.maybeSuppressUncaught(h,g);this.lastInput={single:i};return new A.ServerStreamingCall(r,l,i,c,p,h,g)}clientStreaming(r,i){var s;const a=(s=i.meta)!==null&&s!==void 0?s:{},l=this.promiseHeaders().then(delay(this.headerDelay,i.abort)),c=l.catch((r=>{})).then(delay(this.responseDelay,i.abort)).then((i=>this.promiseSingleResponse(r))),d=c.catch((r=>{})).then(delay(this.afterResponseDelay,i.abort)).then((r=>this.promiseStatus())),p=c.catch((r=>{})).then(delay(this.afterResponseDelay,i.abort)).then((r=>this.promiseTrailers()));this.maybeSuppressUncaught(d,p);this.lastInput=new TestInputStream(this.data,i.abort);return new h.ClientStreamingCall(r,a,this.lastInput,l,c,d,p)}duplex(r,i){var s;const a=(s=i.meta)!==null&&s!==void 0?s:{},l=this.promiseHeaders().then(delay(this.headerDelay,i.abort)),c=new d.RpcOutputStreamController,p=l.then(delay(this.responseDelay,i.abort)).catch((()=>{})).then((()=>this.streamResponses(r,c,i.abort))).then(delay(this.afterResponseDelay,i.abort)),u=p.then((()=>this.promiseStatus())),A=p.then((()=>this.promiseTrailers()));this.maybeSuppressUncaught(u,A);this.lastInput=new TestInputStream(this.data,i.abort);return new g.DuplexStreamingCall(r,a,this.lastInput,l,c,u,A)}}i.TestTransport=TestTransport;TestTransport.defaultHeaders={responseHeader:"test"};TestTransport.defaultStatus={code:"OK",detail:"all good"};TestTransport.defaultTrailers={responseTrailer:"test"};function delay(r,i){return s=>new Promise(((a,c)=>{if(i===null||i===void 0?void 0:i.aborted){c(new l.RpcError("user cancel","CANCELLED"))}else{const d=setTimeout((()=>a(s)),r);if(i){i.addEventListener("abort",(r=>{clearTimeout(d);c(new l.RpcError("user cancel","CANCELLED"))}))}}}))}class TestInputStream{constructor(r,i){this._completed=false;this._sent=[];this.data=r;this.abort=i}get sent(){return this._sent}get completed(){return this._completed}send(r){if(this.data.inputMessage instanceof l.RpcError){return Promise.reject(this.data.inputMessage)}const i=this.data.inputMessage===undefined?10:this.data.inputMessage;return Promise.resolve(undefined).then((()=>{this._sent.push(r)})).then(delay(i,this.abort))}complete(){if(this.data.inputComplete instanceof l.RpcError){return Promise.reject(this.data.inputComplete)}const r=this.data.inputComplete===undefined?10:this.data.inputComplete;return Promise.resolve(undefined).then((()=>{this._completed=true})).then(delay(r,this.abort))}}},50037:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.UnaryCall=void 0;class UnaryCall{constructor(r,i,s,a,l,c,d){this.method=r;this.requestHeaders=i;this.request=s;this.headers=a;this.response=l;this.status=c;this.trailers=d}then(r,i){return this.promiseFinished().then((i=>r?Promise.resolve(r(i)):i),(r=>i?Promise.resolve(i(r)):Promise.reject(r)))}promiseFinished(){return s(this,void 0,void 0,(function*(){let[r,i,s,a]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:r,response:i,status:s,trailers:a}}))}}i.UnaryCall=UnaryCall},18238:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.assertFloat32=i.assertUInt32=i.assertInt32=i.assertNever=i.assert=void 0;function assert(r,i){if(!r){throw new Error(i)}}i.assert=assert;function assertNever(r,i){throw new Error(i!==null&&i!==void 0?i:"Unexpected object: "+r)}i.assertNever=assertNever;const s=34028234663852886e22,a=-34028234663852886e22,l=4294967295,c=2147483647,d=-2147483648;function assertInt32(r){if(typeof r!=="number")throw new Error("invalid int 32: "+typeof r);if(!Number.isInteger(r)||r>c||rl||r<0)throw new Error("invalid uint 32: "+r)}i.assertUInt32=assertUInt32;function assertFloat32(r){if(typeof r!=="number")throw new Error("invalid float 32: "+typeof r);if(!Number.isFinite(r))return;if(r>s||r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.base64encode=i.base64decode=void 0;let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");let a=[];for(let r=0;r>4;p=d;c=2;break;case 2:s[l++]=(p&15)<<4|(d&60)>>2;p=d;c=3;break;case 3:s[l++]=(p&3)<<6|d;c=0;break}}if(c==1)throw Error(`invalid base64 string.`);return s.subarray(0,l)}i.base64decode=base64decode;function base64encode(r){let i="",a=0,l,c=0;for(let d=0;d>2];c=(l&3)<<4;a=1;break;case 1:i+=s[c|l>>4];c=(l&15)<<2;a=2;break;case 2:i+=s[c|l>>6];i+=s[l&63];a=0;break}}if(a){i+=s[c];i+="=";if(a==1)i+="="}return i}i.base64encode=base64encode},73775:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.WireType=i.mergeBinaryOptions=i.UnknownFieldHandler=void 0;var s;(function(r){r.symbol=Symbol.for("protobuf-ts/unknown");r.onRead=(i,s,a,l,c)=>{let d=is(s)?s[r.symbol]:s[r.symbol]=[];d.push({no:a,wireType:l,data:c})};r.onWrite=(i,s,a)=>{for(let{no:i,wireType:l,data:c}of r.list(s))a.tag(i,l).raw(c)};r.list=(i,s)=>{if(is(i)){let a=i[r.symbol];return s?a.filter((r=>r.no==s)):a}return[]};r.last=(i,s)=>r.list(i,s).slice(-1)[0];const is=i=>i&&Array.isArray(i[r.symbol])})(s=i.UnknownFieldHandler||(i.UnknownFieldHandler={}));function mergeBinaryOptions(r,i){return Object.assign(Object.assign({},r),i)}i.mergeBinaryOptions=mergeBinaryOptions;var a;(function(r){r[r["Varint"]=0]="Varint";r[r["Bit64"]=1]="Bit64";r[r["LengthDelimited"]=2]="LengthDelimited";r[r["StartGroup"]=3]="StartGroup";r[r["EndGroup"]=4]="EndGroup";r[r["Bit32"]=5]="Bit32"})(a=i.WireType||(i.WireType={}))},85095:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BinaryReader=i.binaryReadOptions=void 0;const a=s(73775);const l=s(25901);const c=s(75170);const d={readUnknownField:true,readerFactory:r=>new BinaryReader(r)};function binaryReadOptions(r){return r?Object.assign(Object.assign({},d),r):d}i.binaryReadOptions=binaryReadOptions;class BinaryReader{constructor(r,i){this.varint64=c.varint64read;this.uint32=c.varint32read;this.buf=r;this.len=r.length;this.pos=0;this.view=new DataView(r.buffer,r.byteOffset,r.byteLength);this.textDecoder=i!==null&&i!==void 0?i:new TextDecoder("utf-8",{fatal:true,ignoreBOM:true})}tag(){let r=this.uint32(),i=r>>>3,s=r&7;if(i<=0||s<0||s>5)throw new Error("illegal tag: field no "+i+" wire type "+s);return[i,s]}skip(r){let i=this.pos;switch(r){case a.WireType.Varint:while(this.buf[this.pos++]&128){}break;case a.WireType.Bit64:this.pos+=4;case a.WireType.Bit32:this.pos+=4;break;case a.WireType.LengthDelimited:let i=this.uint32();this.pos+=i;break;case a.WireType.StartGroup:let s;while((s=this.tag()[1])!==a.WireType.EndGroup){this.skip(s)}break;default:throw new Error("cant skip wire type "+r)}this.assertBounds();return this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let r=this.uint32();return r>>>1^-(r&1)}int64(){return new l.PbLong(...this.varint64())}uint64(){return new l.PbULong(...this.varint64())}sint64(){let[r,i]=this.varint64();let s=-(r&1);r=(r>>>1|(i&1)<<31)^s;i=i>>>1^s;return new l.PbLong(r,i)}bool(){let[r,i]=this.varint64();return r!==0||i!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,true)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,true)}fixed64(){return new l.PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new l.PbLong(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,true)}double(){return this.view.getFloat64((this.pos+=8)-8,true)}bytes(){let r=this.uint32();let i=this.pos;this.pos+=r;this.assertBounds();return this.buf.subarray(i,i+r)}string(){return this.textDecoder.decode(this.bytes())}}i.BinaryReader=BinaryReader},37745:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.BinaryWriter=i.binaryWriteOptions=void 0;const a=s(25901);const l=s(75170);const c=s(18238);const d={writeUnknownFields:true,writerFactory:()=>new BinaryWriter};function binaryWriteOptions(r){return r?Object.assign(Object.assign({},d),r):d}i.binaryWriteOptions=binaryWriteOptions;class BinaryWriter{constructor(r){this.stack=[];this.textEncoder=r!==null&&r!==void 0?r:new TextEncoder;this.chunks=[];this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let r=0;for(let i=0;i>>0)}raw(r){if(this.buf.length){this.chunks.push(new Uint8Array(this.buf));this.buf=[]}this.chunks.push(r);return this}uint32(r){c.assertUInt32(r);while(r>127){this.buf.push(r&127|128);r=r>>>7}this.buf.push(r);return this}int32(r){c.assertInt32(r);l.varint32write(r,this.buf);return this}bool(r){this.buf.push(r?1:0);return this}bytes(r){this.uint32(r.byteLength);return this.raw(r)}string(r){let i=this.textEncoder.encode(r);this.uint32(i.byteLength);return this.raw(i)}float(r){c.assertFloat32(r);let i=new Uint8Array(4);new DataView(i.buffer).setFloat32(0,r,true);return this.raw(i)}double(r){let i=new Uint8Array(8);new DataView(i.buffer).setFloat64(0,r,true);return this.raw(i)}fixed32(r){c.assertUInt32(r);let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,r,true);return this.raw(i)}sfixed32(r){c.assertInt32(r);let i=new Uint8Array(4);new DataView(i.buffer).setInt32(0,r,true);return this.raw(i)}sint32(r){c.assertInt32(r);r=(r<<1^r>>31)>>>0;l.varint32write(r,this.buf);return this}sfixed64(r){let i=new Uint8Array(8);let s=new DataView(i.buffer);let l=a.PbLong.from(r);s.setInt32(0,l.lo,true);s.setInt32(4,l.hi,true);return this.raw(i)}fixed64(r){let i=new Uint8Array(8);let s=new DataView(i.buffer);let l=a.PbULong.from(r);s.setInt32(0,l.lo,true);s.setInt32(4,l.hi,true);return this.raw(i)}int64(r){let i=a.PbLong.from(r);l.varint64write(i.lo,i.hi,this.buf);return this}sint64(r){let i=a.PbLong.from(r),s=i.hi>>31,c=i.lo<<1^s,d=(i.hi<<1|i.lo>>>31)^s;l.varint64write(c,d,this.buf);return this}uint64(r){let i=a.PbULong.from(r);l.varint64write(i.lo,i.hi,this.buf);return this}}i.BinaryWriter=BinaryWriter},41638:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.listEnumNumbers=i.listEnumNames=i.listEnumValues=i.isEnumObject=void 0;function isEnumObject(r){if(typeof r!="object"||r===null){return false}if(!r.hasOwnProperty(0)){return false}for(let i of Object.keys(r)){let s=parseInt(i);if(!Number.isNaN(s)){let i=r[s];if(i===undefined)return false;if(r[i]!==s)return false}else{let s=r[i];if(s===undefined)return false;if(typeof s!=="number")return false;if(r[s]===undefined)return false}}return true}i.isEnumObject=isEnumObject;function listEnumValues(r){if(!isEnumObject(r))throw new Error("not a typescript enum object");let i=[];for(let[s,a]of Object.entries(r))if(typeof a=="number")i.push({name:s,number:a});return i}i.listEnumValues=listEnumValues;function listEnumNames(r){return listEnumValues(r).map((r=>r.name))}i.listEnumNames=listEnumNames;function listEnumNumbers(r){return listEnumValues(r).map((r=>r.number)).filter(((r,i,s)=>s.indexOf(r)==i))}i.listEnumNumbers=listEnumNumbers},75170:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.varint32read=i.varint32write=i.int64toString=i.int64fromString=i.varint64write=i.varint64read=void 0;function varint64read(){let r=0;let i=0;for(let s=0;s<28;s+=7){let a=this.buf[this.pos++];r|=(a&127)<>4;if((s&128)==0){this.assertBounds();return[r,i]}for(let s=3;s<=31;s+=7){let a=this.buf[this.pos++];i|=(a&127)<>>a;const c=!(l>>>7==0&&i==0);const d=(c?l|128:l)&255;s.push(d);if(!c){return}}const a=r>>>28&15|(i&7)<<4;const l=!(i>>3==0);s.push((l?a|128:a)&255);if(!l){return}for(let r=3;r<31;r=r+7){const a=i>>>r;const l=!(a>>>7==0);const c=(l?a|128:a)&255;s.push(c);if(!l){return}}s.push(i>>>31&1)}i.varint64write=varint64write;const s=(1<<16)*(1<<16);function int64fromString(r){let i=r[0]=="-";if(i)r=r.slice(1);const a=1e6;let l=0;let c=0;function add1e6digit(i,d){const p=Number(r.slice(i,d));c*=a;l=l*a+p;if(l>=s){c=c+(l/s|0);l=l%s}}add1e6digit(-24,-18);add1e6digit(-18,-12);add1e6digit(-12,-6);add1e6digit(-6);return[i,l,c]}i.int64fromString=int64fromString;function int64toString(r,i){if(i>>>0<=2097151){return""+(s*i+(r>>>0))}let a=r&16777215;let l=(r>>>24|i<<8)>>>0&16777215;let c=i>>16&65535;let d=a+l*6777216+c*6710656;let p=l+c*8147497;let u=c*2;let A=1e7;if(d>=A){p+=Math.floor(d/A);d%=A}if(p>=A){u+=Math.floor(p/A);p%=A}function decimalFrom1e7(r,i){let s=r?String(r):"";if(i){return"0000000".slice(s.length)+s}return s}return decimalFrom1e7(u,0)+decimalFrom1e7(p,u)+decimalFrom1e7(d,1)}i.int64toString=int64toString;function varint32write(r,i){if(r>=0){while(r>127){i.push(r&127|128);r=r>>>7}i.push(r)}else{for(let s=0;s<9;s++){i.push(r&127|128);r=r>>7}i.push(1)}}i.varint32write=varint32write;function varint32read(){let r=this.buf[this.pos++];let i=r&127;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&127)<<7;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&127)<<14;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&127)<<21;if((r&128)==0){this.assertBounds();return i}r=this.buf[this.pos++];i|=(r&15)<<28;for(let i=5;(r&128)!==0&&i<10;i++)r=this.buf[this.pos++];if((r&128)!=0)throw new Error("invalid varint");this.assertBounds();return i>>>0}i.varint32read=varint32read},98604:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(65668);Object.defineProperty(i,"typeofJsonValue",{enumerable:true,get:function(){return a.typeofJsonValue}});Object.defineProperty(i,"isJsonObject",{enumerable:true,get:function(){return a.isJsonObject}});var l=s(54826);Object.defineProperty(i,"base64decode",{enumerable:true,get:function(){return l.base64decode}});Object.defineProperty(i,"base64encode",{enumerable:true,get:function(){return l.base64encode}});var c=s(93826);Object.defineProperty(i,"utf8read",{enumerable:true,get:function(){return c.utf8read}});var d=s(73775);Object.defineProperty(i,"WireType",{enumerable:true,get:function(){return d.WireType}});Object.defineProperty(i,"mergeBinaryOptions",{enumerable:true,get:function(){return d.mergeBinaryOptions}});Object.defineProperty(i,"UnknownFieldHandler",{enumerable:true,get:function(){return d.UnknownFieldHandler}});var p=s(85095);Object.defineProperty(i,"BinaryReader",{enumerable:true,get:function(){return p.BinaryReader}});Object.defineProperty(i,"binaryReadOptions",{enumerable:true,get:function(){return p.binaryReadOptions}});var u=s(37745);Object.defineProperty(i,"BinaryWriter",{enumerable:true,get:function(){return u.BinaryWriter}});Object.defineProperty(i,"binaryWriteOptions",{enumerable:true,get:function(){return u.binaryWriteOptions}});var A=s(25901);Object.defineProperty(i,"PbLong",{enumerable:true,get:function(){return A.PbLong}});Object.defineProperty(i,"PbULong",{enumerable:true,get:function(){return A.PbULong}});var h=s(24032);Object.defineProperty(i,"jsonReadOptions",{enumerable:true,get:function(){return h.jsonReadOptions}});Object.defineProperty(i,"jsonWriteOptions",{enumerable:true,get:function(){return h.jsonWriteOptions}});Object.defineProperty(i,"mergeJsonOptions",{enumerable:true,get:function(){return h.mergeJsonOptions}});var g=s(63673);Object.defineProperty(i,"MESSAGE_TYPE",{enumerable:true,get:function(){return g.MESSAGE_TYPE}});var y=s(1116);Object.defineProperty(i,"MessageType",{enumerable:true,get:function(){return y.MessageType}});var b=s(6108);Object.defineProperty(i,"ScalarType",{enumerable:true,get:function(){return b.ScalarType}});Object.defineProperty(i,"LongType",{enumerable:true,get:function(){return b.LongType}});Object.defineProperty(i,"RepeatType",{enumerable:true,get:function(){return b.RepeatType}});Object.defineProperty(i,"normalizeFieldInfo",{enumerable:true,get:function(){return b.normalizeFieldInfo}});Object.defineProperty(i,"readFieldOptions",{enumerable:true,get:function(){return b.readFieldOptions}});Object.defineProperty(i,"readFieldOption",{enumerable:true,get:function(){return b.readFieldOption}});Object.defineProperty(i,"readMessageOption",{enumerable:true,get:function(){return b.readMessageOption}});var w=s(86075);Object.defineProperty(i,"ReflectionTypeCheck",{enumerable:true,get:function(){return w.ReflectionTypeCheck}});var C=s(17769);Object.defineProperty(i,"reflectionCreate",{enumerable:true,get:function(){return C.reflectionCreate}});var v=s(31952);Object.defineProperty(i,"reflectionScalarDefault",{enumerable:true,get:function(){return v.reflectionScalarDefault}});var I=s(79155);Object.defineProperty(i,"reflectionMergePartial",{enumerable:true,get:function(){return I.reflectionMergePartial}});var B=s(65566);Object.defineProperty(i,"reflectionEquals",{enumerable:true,get:function(){return B.reflectionEquals}});var S=s(82529);Object.defineProperty(i,"ReflectionBinaryReader",{enumerable:true,get:function(){return S.ReflectionBinaryReader}});var x=s(51870);Object.defineProperty(i,"ReflectionBinaryWriter",{enumerable:true,get:function(){return x.ReflectionBinaryWriter}});var R=s(87298);Object.defineProperty(i,"ReflectionJsonReader",{enumerable:true,get:function(){return R.ReflectionJsonReader}});var Q=s(76015);Object.defineProperty(i,"ReflectionJsonWriter",{enumerable:true,get:function(){return Q.ReflectionJsonWriter}});var _=s(27840);Object.defineProperty(i,"containsMessageType",{enumerable:true,get:function(){return _.containsMessageType}});var N=s(71983);Object.defineProperty(i,"isOneofGroup",{enumerable:true,get:function(){return N.isOneofGroup}});Object.defineProperty(i,"setOneofValue",{enumerable:true,get:function(){return N.setOneofValue}});Object.defineProperty(i,"getOneofValue",{enumerable:true,get:function(){return N.getOneofValue}});Object.defineProperty(i,"clearOneofValue",{enumerable:true,get:function(){return N.clearOneofValue}});Object.defineProperty(i,"getSelectedOneofValue",{enumerable:true,get:function(){return N.getSelectedOneofValue}});var T=s(41638);Object.defineProperty(i,"listEnumValues",{enumerable:true,get:function(){return T.listEnumValues}});Object.defineProperty(i,"listEnumNames",{enumerable:true,get:function(){return T.listEnumNames}});Object.defineProperty(i,"listEnumNumbers",{enumerable:true,get:function(){return T.listEnumNumbers}});Object.defineProperty(i,"isEnumObject",{enumerable:true,get:function(){return T.isEnumObject}});var k=s(86283);Object.defineProperty(i,"lowerCamelCase",{enumerable:true,get:function(){return k.lowerCamelCase}});var D=s(18238);Object.defineProperty(i,"assert",{enumerable:true,get:function(){return D.assert}});Object.defineProperty(i,"assertNever",{enumerable:true,get:function(){return D.assertNever}});Object.defineProperty(i,"assertInt32",{enumerable:true,get:function(){return D.assertInt32}});Object.defineProperty(i,"assertUInt32",{enumerable:true,get:function(){return D.assertUInt32}});Object.defineProperty(i,"assertFloat32",{enumerable:true,get:function(){return D.assertFloat32}})},24032:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.mergeJsonOptions=i.jsonWriteOptions=i.jsonReadOptions=void 0;const s={emitDefaultValues:false,enumAsInteger:false,useProtoFieldName:false,prettySpaces:0},a={ignoreUnknownFields:false};function jsonReadOptions(r){return r?Object.assign(Object.assign({},a),r):a}i.jsonReadOptions=jsonReadOptions;function jsonWriteOptions(r){return r?Object.assign(Object.assign({},s),r):s}i.jsonWriteOptions=jsonWriteOptions;function mergeJsonOptions(r,i){var s,a;let l=Object.assign(Object.assign({},r),i);l.typeRegistry=[...(s=r===null||r===void 0?void 0:r.typeRegistry)!==null&&s!==void 0?s:[],...(a=i===null||i===void 0?void 0:i.typeRegistry)!==null&&a!==void 0?a:[]];return l}i.mergeJsonOptions=mergeJsonOptions},65668:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isJsonObject=i.typeofJsonValue=void 0;function typeofJsonValue(r){let i=typeof r;if(i=="object"){if(Array.isArray(r))return"array";if(r===null)return"null"}return i}i.typeofJsonValue=typeofJsonValue;function isJsonObject(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}i.isJsonObject=isJsonObject},86283:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.lowerCamelCase=void 0;function lowerCamelCase(r){let i=false;const s=[];for(let a=0;a{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MESSAGE_TYPE=void 0;i.MESSAGE_TYPE=Symbol.for("protobuf-ts/message-type")},1116:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.MessageType=void 0;const a=s(63673);const l=s(6108);const c=s(86075);const d=s(87298);const p=s(76015);const u=s(82529);const A=s(51870);const h=s(17769);const g=s(79155);const y=s(65668);const b=s(24032);const w=s(65566);const C=s(37745);const v=s(85095);const I=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));class MessageType{constructor(r,i,s){this.defaultCheckDepth=16;this.typeName=r;this.fields=i.map(l.normalizeFieldInfo);this.options=s!==null&&s!==void 0?s:{};this.messagePrototype=Object.create(null,Object.assign(Object.assign({},I),{[a.MESSAGE_TYPE]:{value:this}}));this.refTypeCheck=new c.ReflectionTypeCheck(this);this.refJsonReader=new d.ReflectionJsonReader(this);this.refJsonWriter=new p.ReflectionJsonWriter(this);this.refBinReader=new u.ReflectionBinaryReader(this);this.refBinWriter=new A.ReflectionBinaryWriter(this)}create(r){let i=h.reflectionCreate(this);if(r!==undefined){g.reflectionMergePartial(this,i,r)}return i}clone(r){let i=this.create();g.reflectionMergePartial(this,i,r);return i}equals(r,i){return w.reflectionEquals(this,r,i)}is(r,i=this.defaultCheckDepth){return this.refTypeCheck.is(r,i,false)}isAssignable(r,i=this.defaultCheckDepth){return this.refTypeCheck.is(r,i,true)}mergePartial(r,i){g.reflectionMergePartial(this,r,i)}fromBinary(r,i){let s=v.binaryReadOptions(i);return this.internalBinaryRead(s.readerFactory(r),r.byteLength,s)}fromJson(r,i){return this.internalJsonRead(r,b.jsonReadOptions(i))}fromJsonString(r,i){let s=JSON.parse(r);return this.fromJson(s,i)}toJson(r,i){return this.internalJsonWrite(r,b.jsonWriteOptions(i))}toJsonString(r,i){var s;let a=this.toJson(r,i);return JSON.stringify(a,null,(s=i===null||i===void 0?void 0:i.prettySpaces)!==null&&s!==void 0?s:0)}toBinary(r,i){let s=C.binaryWriteOptions(i);return this.internalBinaryWrite(r,s.writerFactory(),s).finish()}internalJsonRead(r,i,s){if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let a=s!==null&&s!==void 0?s:this.create();this.refJsonReader.read(r,a,i);return a}throw new Error(`Unable to parse message ${this.typeName} from JSON ${y.typeofJsonValue(r)}.`)}internalJsonWrite(r,i){return this.refJsonWriter.write(r,i)}internalBinaryWrite(r,i,s){this.refBinWriter.write(r,i,s);return i}internalBinaryRead(r,i,s,a){let l=a!==null&&a!==void 0?a:this.create();this.refBinReader.read(r,l,s,i);return l}}i.MessageType=MessageType},71983:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getSelectedOneofValue=i.clearOneofValue=i.setUnknownOneofValue=i.setOneofValue=i.getOneofValue=i.isOneofGroup=void 0;function isOneofGroup(r){if(typeof r!="object"||r===null||!r.hasOwnProperty("oneofKind")){return false}switch(typeof r.oneofKind){case"string":if(r[r.oneofKind]===undefined)return false;return Object.keys(r).length==2;case"undefined":return Object.keys(r).length==1;default:return false}}i.isOneofGroup=isOneofGroup;function getOneofValue(r,i){return r[i]}i.getOneofValue=getOneofValue;function setOneofValue(r,i,s){if(r.oneofKind!==undefined){delete r[r.oneofKind]}r.oneofKind=i;if(s!==undefined){r[i]=s}}i.setOneofValue=setOneofValue;function setUnknownOneofValue(r,i,s){if(r.oneofKind!==undefined){delete r[r.oneofKind]}r.oneofKind=i;if(s!==undefined&&i!==undefined){r[i]=s}}i.setUnknownOneofValue=setUnknownOneofValue;function clearOneofValue(r){if(r.oneofKind!==undefined){delete r[r.oneofKind]}r.oneofKind=undefined}i.clearOneofValue=clearOneofValue;function getSelectedOneofValue(r){if(r.oneofKind===undefined){return undefined}return r[r.oneofKind]}i.getSelectedOneofValue=getSelectedOneofValue},25901:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.PbLong=i.PbULong=i.detectBi=void 0;const a=s(75170);let l;function detectBi(){const r=new DataView(new ArrayBuffer(8));const i=globalThis.BigInt!==undefined&&typeof r.getBigInt64==="function"&&typeof r.getBigUint64==="function"&&typeof r.setBigInt64==="function"&&typeof r.setBigUint64==="function";l=i?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:r}:undefined}i.detectBi=detectBi;detectBi();function assertBi(r){if(!r)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const c=/^-?[0-9]+$/;const d=4294967296;const p=2147483648;class SharedPbLong{constructor(r,i){this.lo=r|0;this.hi=i|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let r=this.hi*d+(this.lo>>>0);if(!Number.isSafeInteger(r))throw new Error("cannot convert to safe number");return r}}class PbULong extends SharedPbLong{static from(r){if(l)switch(typeof r){case"string":if(r=="0")return this.ZERO;if(r=="")throw new Error("string is no integer");r=l.C(r);case"number":if(r===0)return this.ZERO;r=l.C(r);case"bigint":if(!r)return this.ZERO;if(rl.UMAX)throw new Error("ulong too large");l.V.setBigUint64(0,r,true);return new PbULong(l.V.getInt32(0,true),l.V.getInt32(4,true))}else switch(typeof r){case"string":if(r=="0")return this.ZERO;r=r.trim();if(!c.test(r))throw new Error("string is no integer");let[i,s,l]=a.int64fromString(r);if(i)throw new Error("signed value for ulong");return new PbULong(s,l);case"number":if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw new Error("number is no integer");if(r<0)throw new Error("signed value for ulong");return new PbULong(r,r/d)}throw new Error("unknown value "+typeof r)}toString(){return l?this.toBigInt().toString():a.int64toString(this.lo,this.hi)}toBigInt(){assertBi(l);l.V.setInt32(0,this.lo,true);l.V.setInt32(4,this.hi,true);return l.V.getBigUint64(0,true)}}i.PbULong=PbULong;PbULong.ZERO=new PbULong(0,0);class PbLong extends SharedPbLong{static from(r){if(l)switch(typeof r){case"string":if(r=="0")return this.ZERO;if(r=="")throw new Error("string is no integer");r=l.C(r);case"number":if(r===0)return this.ZERO;r=l.C(r);case"bigint":if(!r)return this.ZERO;if(rl.MAX)throw new Error("signed long too large");l.V.setBigInt64(0,r,true);return new PbLong(l.V.getInt32(0,true),l.V.getInt32(4,true))}else switch(typeof r){case"string":if(r=="0")return this.ZERO;r=r.trim();if(!c.test(r))throw new Error("string is no integer");let[i,s,l]=a.int64fromString(r);if(i){if(l>p||l==p&&s!=0)throw new Error("signed long too small")}else if(l>=p)throw new Error("signed long too large");let u=new PbLong(s,l);return i?u.negate():u;case"number":if(r==0)return this.ZERO;if(!Number.isSafeInteger(r))throw new Error("number is no integer");return r>0?new PbLong(r,r/d):new PbLong(-r,-r/d).negate()}throw new Error("unknown value "+typeof r)}isNegative(){return(this.hi&p)!==0}negate(){let r=~this.hi,i=this.lo;if(i)i=~i+1;else r+=1;return new PbLong(i,r)}toString(){if(l)return this.toBigInt().toString();if(this.isNegative()){let r=this.negate();return"-"+a.int64toString(r.lo,r.hi)}return a.int64toString(this.lo,this.hi)}toBigInt(){assertBi(l);l.V.setInt32(0,this.lo,true);l.V.setInt32(4,this.hi,true);return l.V.getBigInt64(0,true)}}i.PbLong=PbLong;PbLong.ZERO=new PbLong(0,0)},93826:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.utf8read=void 0;const fromCharCodes=r=>String.fromCharCode.apply(String,r);function utf8read(r){if(r.length<1)return"";let i=0,s=[],a=[],l=0,c;let d=r.length;while(i191&&c<224)a[l++]=(c&31)<<6|r[i++]&63;else if(c>239&&c<365){c=((c&7)<<18|(r[i++]&63)<<12|(r[i++]&63)<<6|r[i++]&63)-65536;a[l++]=55296+(c>>10);a[l++]=56320+(c&1023)}else a[l++]=(c&15)<<12|(r[i++]&63)<<6|r[i++]&63;if(l>8191){s.push(fromCharCodes(a));l=0}}if(s.length){if(l)s.push(fromCharCodes(a.slice(0,l)));return s.join("")}return fromCharCodes(a.slice(0,l))}i.utf8read=utf8read},82529:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionBinaryReader=void 0;const a=s(73775);const l=s(6108);const c=s(13136);const d=s(31952);class ReflectionBinaryReader{constructor(r){this.info=r}prepare(){var r;if(!this.fieldNoToField){const i=(r=this.info.fields)!==null&&r!==void 0?r:[];this.fieldNoToField=new Map(i.map((r=>[r.no,r])))}}read(r,i,s,c){this.prepare();const d=c===undefined?r.len:r.pos+c;while(r.pos{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionBinaryWriter=void 0;const a=s(73775);const l=s(6108);const c=s(18238);const d=s(25901);class ReflectionBinaryWriter{constructor(r){this.info=r}prepare(){if(!this.fields){const r=this.info.fields?this.info.fields.concat():[];this.fields=r.sort(((r,i)=>r.no-i.no))}}write(r,i,s){this.prepare();for(const a of this.fields){let d,p,u=a.repeat,A=a.localName;if(a.oneof){const i=r[a.oneof];if(i.oneofKind!==A)continue;d=i[A];p=true}else{d=r[A];p=false}switch(a.kind){case"scalar":case"enum":let r=a.kind=="enum"?l.ScalarType.INT32:a.T;if(u){c.assert(Array.isArray(d));if(u==l.RepeatType.PACKED)this.packed(i,r,a.no,d);else for(const s of d)this.scalar(i,r,a.no,s,true)}else if(d===undefined)c.assert(a.opt);else this.scalar(i,r,a.no,d,p||a.opt);break;case"message":if(u){c.assert(Array.isArray(d));for(const r of d)this.message(i,s,a.T(),a.no,r)}else{this.message(i,s,a.T(),a.no,d)}break;case"map":c.assert(typeof d=="object"&&d!==null);for(const[r,l]of Object.entries(d))this.mapEntry(i,s,a,r,l);break}}let d=s.writeUnknownFields;if(d!==false)(d===true?a.UnknownFieldHandler.onWrite:d)(this.info.typeName,r,i)}mapEntry(r,i,s,d,p){r.tag(s.no,a.WireType.LengthDelimited);r.fork();let u=d;switch(s.K){case l.ScalarType.INT32:case l.ScalarType.FIXED32:case l.ScalarType.UINT32:case l.ScalarType.SFIXED32:case l.ScalarType.SINT32:u=Number.parseInt(d);break;case l.ScalarType.BOOL:c.assert(d=="true"||d=="false");u=d=="true";break}this.scalar(r,s.K,1,u,true);switch(s.V.kind){case"scalar":this.scalar(r,s.V.T,2,p,true);break;case"enum":this.scalar(r,l.ScalarType.INT32,2,p,true);break;case"message":this.message(r,i,s.V.T(),2,p);break}r.join()}message(r,i,s,l,c){if(c===undefined)return;s.internalBinaryWrite(c,r.tag(l,a.WireType.LengthDelimited).fork(),i);r.join()}scalar(r,i,s,a,l){let[c,d,p]=this.scalarInfo(i,a);if(!p||l){r.tag(s,c);r[d](a)}}packed(r,i,s,d){if(!d.length)return;c.assert(i!==l.ScalarType.BYTES&&i!==l.ScalarType.STRING);r.tag(s,a.WireType.LengthDelimited);r.fork();let[,p]=this.scalarInfo(i);for(let i=0;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.containsMessageType=void 0;const a=s(63673);function containsMessageType(r){return r[a.MESSAGE_TYPE]!=null}i.containsMessageType=containsMessageType},17769:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionCreate=void 0;const a=s(31952);const l=s(63673);function reflectionCreate(r){const i=r.messagePrototype?Object.create(r.messagePrototype):Object.defineProperty({},l.MESSAGE_TYPE,{value:r});for(let s of r.fields){let r=s.localName;if(s.opt)continue;if(s.oneof)i[s.oneof]={oneofKind:undefined};else if(s.repeat)i[r]=[];else switch(s.kind){case"scalar":i[r]=a.reflectionScalarDefault(s.T,s.L);break;case"enum":i[r]=0;break;case"map":i[r]={};break}}return i}i.reflectionCreate=reflectionCreate},65566:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionEquals=void 0;const a=s(6108);function reflectionEquals(r,i,s){if(i===s)return true;if(!i||!s)return false;for(let c of r.fields){let r=c.localName;let d=c.oneof?i[c.oneof][r]:i[r];let p=c.oneof?s[c.oneof][r]:s[r];switch(c.kind){case"enum":case"scalar":let r=c.kind=="enum"?a.ScalarType.INT32:c.T;if(!(c.repeat?repeatedPrimitiveEq(r,d,p):primitiveEq(r,d,p)))return false;break;case"map":if(!(c.V.kind=="message"?repeatedMsgEq(c.V.T(),l(d),l(p)):repeatedPrimitiveEq(c.V.kind=="enum"?a.ScalarType.INT32:c.V.T,l(d),l(p))))return false;break;case"message":let i=c.T();if(!(c.repeat?repeatedMsgEq(i,d,p):i.equals(d,p)))return false;break}}return true}i.reflectionEquals=reflectionEquals;const l=Object.values;function primitiveEq(r,i,s){if(i===s)return true;if(r!==a.ScalarType.BYTES)return false;let l=i;let c=s;if(l.length!==c.length)return false;for(let r=0;r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.readMessageOption=i.readFieldOption=i.readFieldOptions=i.normalizeFieldInfo=i.RepeatType=i.LongType=i.ScalarType=void 0;const a=s(86283);var l;(function(r){r[r["DOUBLE"]=1]="DOUBLE";r[r["FLOAT"]=2]="FLOAT";r[r["INT64"]=3]="INT64";r[r["UINT64"]=4]="UINT64";r[r["INT32"]=5]="INT32";r[r["FIXED64"]=6]="FIXED64";r[r["FIXED32"]=7]="FIXED32";r[r["BOOL"]=8]="BOOL";r[r["STRING"]=9]="STRING";r[r["BYTES"]=12]="BYTES";r[r["UINT32"]=13]="UINT32";r[r["SFIXED32"]=15]="SFIXED32";r[r["SFIXED64"]=16]="SFIXED64";r[r["SINT32"]=17]="SINT32";r[r["SINT64"]=18]="SINT64"})(l=i.ScalarType||(i.ScalarType={}));var c;(function(r){r[r["BIGINT"]=0]="BIGINT";r[r["STRING"]=1]="STRING";r[r["NUMBER"]=2]="NUMBER"})(c=i.LongType||(i.LongType={}));var d;(function(r){r[r["NO"]=0]="NO";r[r["PACKED"]=1]="PACKED";r[r["UNPACKED"]=2]="UNPACKED"})(d=i.RepeatType||(i.RepeatType={}));function normalizeFieldInfo(r){var i,s,l,c;r.localName=(i=r.localName)!==null&&i!==void 0?i:a.lowerCamelCase(r.name);r.jsonName=(s=r.jsonName)!==null&&s!==void 0?s:a.lowerCamelCase(r.name);r.repeat=(l=r.repeat)!==null&&l!==void 0?l:d.NO;r.opt=(c=r.opt)!==null&&c!==void 0?c:r.repeat?false:r.oneof?false:r.kind=="message";return r}i.normalizeFieldInfo=normalizeFieldInfo;function readFieldOptions(r,i,s,a){var l;const c=(l=r.fields.find(((r,s)=>r.localName==i||s==i)))===null||l===void 0?void 0:l.options;return c&&c[s]?a.fromJson(c[s]):undefined}i.readFieldOptions=readFieldOptions;function readFieldOption(r,i,s,a){var l;const c=(l=r.fields.find(((r,s)=>r.localName==i||s==i)))===null||l===void 0?void 0:l.options;if(!c){return undefined}const d=c[s];if(d===undefined){return d}return a?a.fromJson(d):d}i.readFieldOption=readFieldOption;function readMessageOption(r,i,s){const a=r.options;const l=a[i];if(l===undefined){return l}return s?s.fromJson(l):l}i.readMessageOption=readMessageOption},87298:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionJsonReader=void 0;const a=s(65668);const l=s(54826);const c=s(6108);const d=s(25901);const p=s(18238);const u=s(13136);class ReflectionJsonReader{constructor(r){this.info=r}prepare(){var r;if(this.fMap===undefined){this.fMap={};const i=(r=this.info.fields)!==null&&r!==void 0?r:[];for(const r of i){this.fMap[r.name]=r;this.fMap[r.jsonName]=r;this.fMap[r.localName]=r}}}assert(r,i,s){if(!r){let r=a.typeofJsonValue(s);if(r=="number"||r=="boolean")r=s.toString();throw new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${i}`)}}read(r,i,s){this.prepare();const l=[];for(const[d,p]of Object.entries(r)){const r=this.fMap[d];if(!r){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${d}`);continue}const u=r.localName;let A;if(r.oneof){if(p===null&&(r.kind!=="enum"||r.T()[0]!=="google.protobuf.NullValue")){continue}if(l.includes(r.oneof))throw new Error(`Multiple members of the oneof group "${r.oneof}" of ${this.info.typeName} are present in JSON.`);l.push(r.oneof);A=i[r.oneof]={oneofKind:u}}else{A=i}if(r.kind=="map"){if(p===null){continue}this.assert(a.isJsonObject(p),r.name,p);const i=A[u];for(const[a,l]of Object.entries(p)){this.assert(l!==null,r.name+" map value",null);let d;switch(r.V.kind){case"message":d=r.V.T().internalJsonRead(l,s);break;case"enum":d=this.enum(r.V.T(),l,r.name,s.ignoreUnknownFields);if(d===false)continue;break;case"scalar":d=this.scalar(l,r.V.T,r.V.L,r.name);break}this.assert(d!==undefined,r.name+" map value",l);let p=a;if(r.K==c.ScalarType.BOOL)p=p=="true"?true:p=="false"?false:p;p=this.scalar(p,r.K,c.LongType.STRING,r.name).toString();i[p]=d}}else if(r.repeat){if(p===null)continue;this.assert(Array.isArray(p),r.name,p);const i=A[u];for(const a of p){this.assert(a!==null,r.name,null);let l;switch(r.kind){case"message":l=r.T().internalJsonRead(a,s);break;case"enum":l=this.enum(r.T(),a,r.name,s.ignoreUnknownFields);if(l===false)continue;break;case"scalar":l=this.scalar(a,r.T,r.L,r.name);break}this.assert(l!==undefined,r.name,p);i.push(l)}}else{switch(r.kind){case"message":if(p===null&&r.T().typeName!="google.protobuf.Value"){this.assert(r.oneof===undefined,r.name+" (oneof member)",null);continue}A[u]=r.T().internalJsonRead(p,s,A[u]);break;case"enum":let i=this.enum(r.T(),p,r.name,s.ignoreUnknownFields);if(i===false)continue;A[u]=i;break;case"scalar":A[u]=this.scalar(p,r.T,r.L,r.name);break}}}}enum(r,i,s,a){if(r[0]=="google.protobuf.NullValue")p.assert(i===null||i==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${s}, enum ${r[0]} only accepts null.`);if(i===null)return 0;switch(typeof i){case"number":p.assert(Number.isInteger(i),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${i}.`);return i;case"string":let l=i;if(r[2]&&i.substring(0,r[2].length)===r[2])l=i.substring(r[2].length);let c=r[1][l];if(typeof c==="undefined"&&a){return false}p.assert(typeof c=="number",`Unable to parse field ${this.info.typeName}#${s}, enum ${r[0]} has no value for "${i}".`);return c}p.assert(false,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof i}".`)}scalar(r,i,s,a){let A;try{switch(i){case c.ScalarType.DOUBLE:case c.ScalarType.FLOAT:if(r===null)return 0;if(r==="NaN")return Number.NaN;if(r==="Infinity")return Number.POSITIVE_INFINITY;if(r==="-Infinity")return Number.NEGATIVE_INFINITY;if(r===""){A="empty string";break}if(typeof r=="string"&&r.trim().length!==r.length){A="extra whitespace";break}if(typeof r!="string"&&typeof r!="number"){break}let a=Number(r);if(Number.isNaN(a)){A="not a number";break}if(!Number.isFinite(a)){A="too large or small";break}if(i==c.ScalarType.FLOAT)p.assertFloat32(a);return a;case c.ScalarType.INT32:case c.ScalarType.FIXED32:case c.ScalarType.SFIXED32:case c.ScalarType.SINT32:case c.ScalarType.UINT32:if(r===null)return 0;let h;if(typeof r=="number")h=r;else if(r==="")A="empty string";else if(typeof r=="string"){if(r.trim().length!==r.length)A="extra whitespace";else h=Number(r)}if(h===undefined)break;if(i==c.ScalarType.UINT32)p.assertUInt32(h);else p.assertInt32(h);return h;case c.ScalarType.INT64:case c.ScalarType.SFIXED64:case c.ScalarType.SINT64:if(r===null)return u.reflectionLongConvert(d.PbLong.ZERO,s);if(typeof r!="number"&&typeof r!="string")break;return u.reflectionLongConvert(d.PbLong.from(r),s);case c.ScalarType.FIXED64:case c.ScalarType.UINT64:if(r===null)return u.reflectionLongConvert(d.PbULong.ZERO,s);if(typeof r!="number"&&typeof r!="string")break;return u.reflectionLongConvert(d.PbULong.from(r),s);case c.ScalarType.BOOL:if(r===null)return false;if(typeof r!=="boolean")break;return r;case c.ScalarType.STRING:if(r===null)return"";if(typeof r!=="string"){A="extra whitespace";break}try{encodeURIComponent(r)}catch(A){A="invalid UTF8";break}return r;case c.ScalarType.BYTES:if(r===null||r==="")return new Uint8Array(0);if(typeof r!=="string")break;return l.base64decode(r)}}catch(r){A=r.message}this.assert(false,a+(A?" - "+A:""),r)}}i.ReflectionJsonReader=ReflectionJsonReader},76015:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionJsonWriter=void 0;const a=s(54826);const l=s(25901);const c=s(6108);const d=s(18238);class ReflectionJsonWriter{constructor(r){var i;this.fields=(i=r.fields)!==null&&i!==void 0?i:[]}write(r,i){const s={},a=r;for(const r of this.fields){if(!r.oneof){let l=this.field(r,a[r.localName],i);if(l!==undefined)s[i.useProtoFieldName?r.name:r.jsonName]=l;continue}const l=a[r.oneof];if(l.oneofKind!==r.localName)continue;const c=r.kind=="scalar"||r.kind=="enum"?Object.assign(Object.assign({},i),{emitDefaultValues:true}):i;let p=this.field(r,l[r.localName],c);d.assert(p!==undefined);s[i.useProtoFieldName?r.name:r.jsonName]=p}return s}field(r,i,s){let a=undefined;if(r.kind=="map"){d.assert(typeof i=="object"&&i!==null);const l={};switch(r.V.kind){case"scalar":for(const[s,a]of Object.entries(i)){const i=this.scalar(r.V.T,a,r.name,false,true);d.assert(i!==undefined);l[s.toString()]=i}break;case"message":const a=r.V.T();for(const[c,p]of Object.entries(i)){const i=this.message(a,p,r.name,s);d.assert(i!==undefined);l[c.toString()]=i}break;case"enum":const c=r.V.T();for(const[a,p]of Object.entries(i)){d.assert(p===undefined||typeof p=="number");const i=this.enum(c,p,r.name,false,true,s.enumAsInteger);d.assert(i!==undefined);l[a.toString()]=i}break}if(s.emitDefaultValues||Object.keys(l).length>0)a=l}else if(r.repeat){d.assert(Array.isArray(i));const l=[];switch(r.kind){case"scalar":for(let s=0;s0||s.emitDefaultValues)a=l}else{switch(r.kind){case"scalar":a=this.scalar(r.T,i,r.name,r.opt,s.emitDefaultValues);break;case"enum":a=this.enum(r.T(),i,r.name,r.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":a=this.message(r.T(),i,r.name,s);break}}return a}enum(r,i,s,a,l,c){if(r[0]=="google.protobuf.NullValue")return!l&&!a?undefined:null;if(i===undefined){d.assert(a);return undefined}if(i===0&&!l&&!a)return undefined;d.assert(typeof i=="number");d.assert(Number.isInteger(i));if(c||!r[1].hasOwnProperty(i))return i;if(r[2])return r[2]+r[1][i];return r[1][i]}message(r,i,s,a){if(i===undefined)return a.emitDefaultValues?null:undefined;return r.internalJsonWrite(i,a)}scalar(r,i,s,p,u){if(i===undefined){d.assert(p);return undefined}const A=u||p;switch(r){case c.ScalarType.INT32:case c.ScalarType.SFIXED32:case c.ScalarType.SINT32:if(i===0)return A?0:undefined;d.assertInt32(i);return i;case c.ScalarType.FIXED32:case c.ScalarType.UINT32:if(i===0)return A?0:undefined;d.assertUInt32(i);return i;case c.ScalarType.FLOAT:d.assertFloat32(i);case c.ScalarType.DOUBLE:if(i===0)return A?0:undefined;d.assert(typeof i=="number");if(Number.isNaN(i))return"NaN";if(i===Number.POSITIVE_INFINITY)return"Infinity";if(i===Number.NEGATIVE_INFINITY)return"-Infinity";return i;case c.ScalarType.STRING:if(i==="")return A?"":undefined;d.assert(typeof i=="string");return i;case c.ScalarType.BOOL:if(i===false)return A?false:undefined;d.assert(typeof i=="boolean");return i;case c.ScalarType.UINT64:case c.ScalarType.FIXED64:d.assert(typeof i=="number"||typeof i=="string"||typeof i=="bigint");let r=l.PbULong.from(i);if(r.isZero()&&!A)return undefined;return r.toString();case c.ScalarType.INT64:case c.ScalarType.SFIXED64:case c.ScalarType.SINT64:d.assert(typeof i=="number"||typeof i=="string"||typeof i=="bigint");let s=l.PbLong.from(i);if(s.isZero()&&!A)return undefined;return s.toString();case c.ScalarType.BYTES:d.assert(i instanceof Uint8Array);if(!i.byteLength)return A?"":undefined;return a.base64encode(i)}}}i.ReflectionJsonWriter=ReflectionJsonWriter},13136:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionLongConvert=void 0;const a=s(6108);function reflectionLongConvert(r,i){switch(i){case a.LongType.BIGINT:return r.toBigInt();case a.LongType.NUMBER:return r.toNumber();default:return r.toString()}}i.reflectionLongConvert=reflectionLongConvert},79155:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionMergePartial=void 0;function reflectionMergePartial(r,i,s){let a,l=s,c;for(let s of r.fields){let r=s.localName;if(s.oneof){const d=l[s.oneof];if((d===null||d===void 0?void 0:d.oneofKind)==undefined){continue}a=d[r];c=i[s.oneof];c.oneofKind=d.oneofKind;if(a==undefined){delete c[r];continue}}else{a=l[r];c=i;if(a==undefined){continue}}if(s.repeat)c[r].length=a.length;switch(s.kind){case"scalar":case"enum":if(s.repeat)for(let i=0;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.reflectionScalarDefault=void 0;const a=s(6108);const l=s(13136);const c=s(25901);function reflectionScalarDefault(r,i=a.LongType.STRING){switch(r){case a.ScalarType.BOOL:return false;case a.ScalarType.UINT64:case a.ScalarType.FIXED64:return l.reflectionLongConvert(c.PbULong.ZERO,i);case a.ScalarType.INT64:case a.ScalarType.SFIXED64:case a.ScalarType.SINT64:return l.reflectionLongConvert(c.PbLong.ZERO,i);case a.ScalarType.DOUBLE:case a.ScalarType.FLOAT:return 0;case a.ScalarType.BYTES:return new Uint8Array(0);case a.ScalarType.STRING:return"";default:return 0}}i.reflectionScalarDefault=reflectionScalarDefault},86075:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ReflectionTypeCheck=void 0;const a=s(6108);const l=s(71983);class ReflectionTypeCheck{constructor(r){var i;this.fields=(i=r.fields)!==null&&i!==void 0?i:[]}prepare(){if(this.data)return;const r=[],i=[],s=[];for(let a of this.fields){if(a.oneof){if(!s.includes(a.oneof)){s.push(a.oneof);r.push(a.oneof);i.push(a.oneof)}}else{i.push(a.localName);switch(a.kind){case"scalar":case"enum":if(!a.opt||a.repeat)r.push(a.localName);break;case"message":if(a.repeat)r.push(a.localName);break;case"map":r.push(a.localName);break}}}this.data={req:r,known:i,oneofs:Object.values(s)}}is(r,i,s=false){if(i<0)return true;if(r===null||r===undefined||typeof r!="object")return false;this.prepare();let a=Object.keys(r),c=this.data;if(a.length!a.includes(r))))return false;if(!s){if(a.some((r=>!c.known.includes(r))))return false}if(i<1){return true}for(const a of c.oneofs){const c=r[a];if(!l.isOneofGroup(c))return false;if(c.oneofKind===undefined)continue;const d=this.fields.find((r=>r.localName===c.oneofKind));if(!d)return false;if(!this.field(c[c.oneofKind],d,s,i))return false}for(const a of this.fields){if(a.oneof!==undefined)continue;if(!this.field(r[a.localName],a,s,i))return false}return true}field(r,i,s,l){let c=i.repeat;switch(i.kind){case"scalar":if(r===undefined)return i.opt;if(c)return this.scalars(r,i.T,l,i.L);return this.scalar(r,i.T,i.L);case"enum":if(r===undefined)return i.opt;if(c)return this.scalars(r,a.ScalarType.INT32,l);return this.scalar(r,a.ScalarType.INT32);case"message":if(r===undefined)return true;if(c)return this.messages(r,i.T(),s,l);return this.message(r,i.T(),s,l);case"map":if(typeof r!="object"||r===null)return false;if(l<2)return true;if(!this.mapKeys(r,i.K,l))return false;switch(i.V.kind){case"scalar":return this.scalars(Object.values(r),i.V.T,l,i.V.L);case"enum":return this.scalars(Object.values(r),a.ScalarType.INT32,l);case"message":return this.messages(Object.values(r),i.V.T(),s,l)}break}return true}message(r,i,s,a){if(s){return i.isAssignable(r,a)}return i.is(r,a)}messages(r,i,s,a){if(!Array.isArray(r))return false;if(a<2)return true;if(s){for(let s=0;sparseInt(r))),i,s);case a.ScalarType.BOOL:return this.scalars(l.slice(0,s).map((r=>r=="true"?true:r=="false"?false:r)),i,s);default:return this.scalars(l,i,s,a.LongType.STRING)}}}i.ReflectionTypeCheck=ReflectionTypeCheck},24995:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});var a=s(42581);class AbortSignal extends a.EventTarget{constructor(){super();throw new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const r=l.get(this);if(typeof r!=="boolean"){throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`)}return r}}a.defineEventAttribute(AbortSignal.prototype,"abort");function createAbortSignal(){const r=Object.create(AbortSignal.prototype);a.EventTarget.call(r);l.set(r,false);return r}function abortSignal(r){if(l.get(r)!==false){return}l.set(r,true);r.dispatchEvent({type:"abort"})}const l=new WeakMap;Object.defineProperties(AbortSignal.prototype,{aborted:{enumerable:true}});if(typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol"){Object.defineProperty(AbortSignal.prototype,Symbol.toStringTag,{configurable:true,value:"AbortSignal"})}class AbortController{constructor(){c.set(this,createAbortSignal())}get signal(){return getSignal(this)}abort(){abortSignal(getSignal(this))}}const c=new WeakMap;function getSignal(r){const i=c.get(r);if(i==null){throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${r===null?"null":typeof r}`)}return i}Object.defineProperties(AbortController.prototype,{signal:{enumerable:true},abort:{enumerable:true}});if(typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol"){Object.defineProperty(AbortController.prototype,Symbol.toStringTag,{configurable:true,value:"AbortController"})}i.AbortController=AbortController;i.AbortSignal=AbortSignal;i["default"]=AbortController;r.exports=AbortController;r.exports.AbortController=r.exports["default"]=AbortController;r.exports.AbortSignal=AbortSignal},2136:(r,i,s)=>{var a=s(1692);var l=s(71017);var c=s(53643);var d=s(32280);var p=s(7266);var u=s(20639);var A=s(98302);var h=r.exports={};var g=/[\/\\]/g;var processPatterns=function(r,i){var s=[];c(r).forEach((function(r){var a=r.indexOf("!")===0;if(a){r=r.slice(1)}var l=i(r);if(a){s=d(s,l)}else{s=p(s,l)}}));return s};h.exists=function(){var r=l.join.apply(l,arguments);return a.existsSync(r)};h.expand=function(...r){var i=u(r[0])?r.shift():{};var s=Array.isArray(r[0])?r[0]:r;if(s.length===0){return[]}var c=processPatterns(s,(function(r){return A.sync(r,i)}));if(i.filter){c=c.filter((function(r){r=l.join(i.cwd||"",r);try{if(typeof i.filter==="function"){return i.filter(r)}else{return a.statSync(r)[i.filter]()}}catch(r){return false}}))}return c};h.expandMapping=function(r,i,s){s=Object.assign({rename:function(r,i){return l.join(r||"",i)}},s);var a=[];var c={};h.expand(s,r).forEach((function(r){var d=r;if(s.flatten){d=l.basename(d)}if(s.ext){d=d.replace(/(\.[^\/]*)?$/,s.ext)}var p=s.rename(i,d,s);if(s.cwd){r=l.join(s.cwd,r)}p=p.replace(g,"/");r=r.replace(g,"/");if(c[p]){c[p].src.push(r)}else{a.push({src:[r],dest:p});c[p]=a[a.length-1]}}));return a};h.normalizeFilesArray=function(r){var i=[];r.forEach((function(r){var s;if("src"in r||"dest"in r){i.push(r)}}));if(i.length===0){return[]}i=_(i).chain().forEach((function(r){if(!("src"in r)||!r.src){return}if(Array.isArray(r.src)){r.src=c(r.src)}else{r.src=[r.src]}})).map((function(r){var i=Object.assign({},r);delete i.src;delete i.dest;if(r.expand){return h.expandMapping(r.src,r.dest,i).map((function(i){var s=Object.assign({},r);s.orig=Object.assign({},r);s.src=i.src;s.dest=i.dest;["expand","cwd","flatten","rename","ext"].forEach((function(r){delete s[r]}));return s}))}var s=Object.assign({},r);s.orig=Object.assign({},r);if("src"in s){Object.defineProperty(s,"src",{enumerable:true,get:function fn(){var s;if(!("result"in fn)){s=r.src;s=Array.isArray(s)?c(s):[s];fn.result=h.expand(i,s)}return fn.result}})}if("dest"in s){s.dest=r.dest}return s})).flatten().value();return i}},78443:(r,i,s)=>{var a=s(1692);var l=s(71017);var c=s(44101);var d=s(73268);var p=s(43766);var u=s(45500);var A=s(12781).Stream;var h=s(94403).PassThrough;var g=r.exports={};g.file=s(2136);g.collectStream=function(r,i){var s=[];var a=0;r.on("error",i);r.on("data",(function(r){s.push(r);a+=r.length}));r.on("end",(function(){var r=Buffer.alloc(a);var l=0;s.forEach((function(i){i.copy(r,l);l+=i.length}));i(null,r)}))};g.dateify=function(r){r=r||new Date;if(r instanceof Date){r=r}else if(typeof r==="string"){r=new Date(r)}else{r=new Date}return r};g.defaults=function(r,i,s){var a=arguments;a[0]=a[0]||{};return u(...a)};g.isStream=function(r){return c(r)};g.lazyReadStream=function(r){return new d.Readable((function(){return a.createReadStream(r)}))};g.normalizeInputSource=function(r){if(r===null){return Buffer.alloc(0)}else if(typeof r==="string"){return Buffer.from(r)}else if(g.isStream(r)){return r.pipe(new h)}return r};g.sanitizePath=function(r){return p(r,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};g.trailingSlashIt=function(r){return r.slice(-1)!=="/"?r+"/":r};g.unixifyPath=function(r){return p(r,false).replace(/^\w+:/,"")};g.walkdir=function(r,i,s){var c=[];if(typeof i==="function"){s=i;i=r}a.readdir(r,(function(d,p){var u=0;var A;var h;if(d){return s(d)}(function next(){A=p[u++];if(!A){return s(null,c)}h=l.join(r,A);a.stat(h,(function(r,a){c.push({path:h,relative:l.relative(i,h).replace(/\\/g,"/"),stats:a});if(a&&a.isDirectory()){g.walkdir(h,i,(function(r,i){if(r){return s(r)}i.forEach((function(r){c.push(r)}));next()}))}else{next()}}))})()}))}},39917:(r,i,s)=>{"use strict";const{SymbolDispose:a}=s(95971);const{AbortError:l,codes:c}=s(46254);const{isNodeStream:d,isWebStream:p,kControllerErrorFunction:u}=s(13300);const A=s(61701);const{ERR_INVALID_ARG_TYPE:h}=c;let g;const validateAbortSignal=(r,i)=>{if(typeof r!=="object"||!("aborted"in r)){throw new h(i,"AbortSignal",r)}};r.exports.addAbortSignal=function addAbortSignal(i,s){validateAbortSignal(i,"signal");if(!d(s)&&!p(s)){throw new h("stream",["ReadableStream","WritableStream","Stream"],s)}return r.exports.addAbortSignalNoValidate(i,s)};r.exports.addAbortSignalNoValidate=function(r,i){if(typeof r!=="object"||!("aborted"in r)){return i}const c=d(i)?()=>{i.destroy(new l(undefined,{cause:r.reason}))}:()=>{i[u](new l(undefined,{cause:r.reason}))};if(r.aborted){c()}else{g=g||s(58472).addAbortListener;const l=g(r,c);A(i,l[a])}return i}},11773:(r,i,s)=>{"use strict";const{StringPrototypeSlice:a,SymbolIterator:l,TypedArrayPrototypeSet:c,Uint8Array:d}=s(95971);const{Buffer:p}=s(14300);const{inspect:u}=s(58472);r.exports=class BufferList{constructor(){this.head=null;this.tail=null;this.length=0}push(r){const i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length}unshift(r){const i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length}shift(){if(this.length===0)return;const r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r}clear(){this.head=this.tail=null;this.length=0}join(r){if(this.length===0)return"";let i=this.head;let s=""+i.data;while((i=i.next)!==null)s+=r+i.data;return s}concat(r){if(this.length===0)return p.alloc(0);const i=p.allocUnsafe(r>>>0);let s=this.head;let a=0;while(s){c(i,s.data,a);a+=s.data.length;s=s.next}return i}consume(r,i){const s=this.head.data;if(rc.length){i+=c;r-=c.length}else{if(r===c.length){i+=c;++l;if(s.next)this.head=s.next;else this.head=this.tail=null}else{i+=a(c,0,r);this.head=s;s.data=a(c,r)}break}++l}while((s=s.next)!==null);this.length-=l;return i}_getBuffer(r){const i=p.allocUnsafe(r);const s=r;let a=this.head;let l=0;do{const p=a.data;if(r>p.length){c(i,p,s-r);r-=p.length}else{if(r===p.length){c(i,p,s-r);++l;if(a.next)this.head=a.next;else this.head=this.tail=null}else{c(i,new d(p.buffer,p.byteOffset,r),s-r);this.head=a;a.data=p.slice(r)}break}++l}while((a=a.next)!==null);this.length-=l;return i}[Symbol.for("nodejs.util.inspect.custom")](r,i){return u(this,{...i,depth:0,customInspect:false})}}},85994:(r,i,s)=>{"use strict";const{pipeline:a}=s(75338);const l=s(84953);const{destroyer:c}=s(36702);const{isNodeStream:d,isReadable:p,isWritable:u,isWebStream:A,isTransformStream:h,isWritableStream:g,isReadableStream:y}=s(13300);const{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:w,ERR_MISSING_ARGS:C}}=s(46254);const v=s(61701);r.exports=function compose(...r){if(r.length===0){throw new C("streams")}if(r.length===1){return l.from(r[0])}const i=[...r];if(typeof r[0]==="function"){r[0]=l.from(r[0])}if(typeof r[r.length-1]==="function"){const i=r.length-1;r[i]=l.from(r[i])}for(let s=0;s0&&!(u(r[s])||g(r[s])||h(r[s]))){throw new w(`streams[${s}]`,i[s],"must be writable")}}let s;let I;let B;let S;let x;function onfinished(r){const i=S;S=null;if(i){i(r)}else if(r){x.destroy(r)}else if(!N&&!_){x.destroy()}}const R=r[0];const Q=a(r,onfinished);const _=!!(u(R)||g(R)||h(R));const N=!!(p(Q)||y(Q)||h(Q));x=new l({writableObjectMode:!!(R!==null&&R!==undefined&&R.writableObjectMode),readableObjectMode:!!(Q!==null&&Q!==undefined&&Q.readableObjectMode),writable:_,readable:N});if(_){if(d(R)){x._write=function(r,i,a){if(R.write(r,i)){a()}else{s=a}};x._final=function(r){R.end();I=r};R.on("drain",(function(){if(s){const r=s;s=null;r()}}))}else if(A(R)){const r=h(R)?R.writable:R;const i=r.getWriter();x._write=async function(r,s,a){try{await i.ready;i.write(r).catch((()=>{}));a()}catch(r){a(r)}};x._final=async function(r){try{await i.ready;i.close().catch((()=>{}));I=r}catch(i){r(i)}}}const r=h(Q)?Q.readable:Q;v(r,(()=>{if(I){const r=I;I=null;r()}}))}if(N){if(d(Q)){Q.on("readable",(function(){if(B){const r=B;B=null;r()}}));Q.on("end",(function(){x.push(null)}));x._read=function(){while(true){const r=Q.read();if(r===null){B=x._read;return}if(!x.push(r)){return}}}}else if(A(Q)){const r=h(Q)?Q.readable:Q;const i=r.getReader();x._read=async function(){while(true){try{const{value:r,done:s}=await i.read();if(!x.push(r)){return}if(s){x.push(null);return}}catch{return}}}}}x._destroy=function(r,i){if(!r&&S!==null){r=new b}B=null;s=null;I=null;if(S===null){i(r)}else{S=i;if(d(Q)){c(Q,r)}}};return x}},36702:(r,i,s)=>{"use strict";const a=s(53568);const{aggregateTwoErrors:l,codes:{ERR_MULTIPLE_CALLBACK:c},AbortError:d}=s(46254);const{Symbol:p}=s(95971);const{kIsDestroyed:u,isDestroyed:A,isFinished:h,isServerRequest:g}=s(13300);const y=p("kDestroy");const b=p("kConstruct");function checkError(r,i,s){if(r){r.stack;if(i&&!i.errored){i.errored=r}if(s&&!s.errored){s.errored=r}}}function destroy(r,i){const s=this._readableState;const a=this._writableState;const c=a||s;if(a!==null&&a!==undefined&&a.destroyed||s!==null&&s!==undefined&&s.destroyed){if(typeof i==="function"){i()}return this}checkError(r,a,s);if(a){a.destroyed=true}if(s){s.destroyed=true}if(!c.constructed){this.once(y,(function(s){_destroy(this,l(s,r),i)}))}else{_destroy(this,r,i)}return this}function _destroy(r,i,s){let l=false;function onDestroy(i){if(l){return}l=true;const c=r._readableState;const d=r._writableState;checkError(i,d,c);if(d){d.closed=true}if(c){c.closed=true}if(typeof s==="function"){s(i)}if(i){a.nextTick(emitErrorCloseNT,r,i)}else{a.nextTick(emitCloseNT,r)}}try{r._destroy(i||null,onDestroy)}catch(i){onDestroy(i)}}function emitErrorCloseNT(r,i){emitErrorNT(r,i);emitCloseNT(r)}function emitCloseNT(r){const i=r._readableState;const s=r._writableState;if(s){s.closeEmitted=true}if(i){i.closeEmitted=true}if(s!==null&&s!==undefined&&s.emitClose||i!==null&&i!==undefined&&i.emitClose){r.emit("close")}}function emitErrorNT(r,i){const s=r._readableState;const a=r._writableState;if(a!==null&&a!==undefined&&a.errorEmitted||s!==null&&s!==undefined&&s.errorEmitted){return}if(a){a.errorEmitted=true}if(s){s.errorEmitted=true}r.emit("error",i)}function undestroy(){const r=this._readableState;const i=this._writableState;if(r){r.constructed=true;r.closed=false;r.closeEmitted=false;r.destroyed=false;r.errored=null;r.errorEmitted=false;r.reading=false;r.ended=r.readable===false;r.endEmitted=r.readable===false}if(i){i.constructed=true;i.destroyed=false;i.closed=false;i.closeEmitted=false;i.errored=null;i.errorEmitted=false;i.finalCalled=false;i.prefinished=false;i.ended=i.writable===false;i.ending=i.writable===false;i.finished=i.writable===false}}function errorOrDestroy(r,i,s){const l=r._readableState;const c=r._writableState;if(c!==null&&c!==undefined&&c.destroyed||l!==null&&l!==undefined&&l.destroyed){return this}if(l!==null&&l!==undefined&&l.autoDestroy||c!==null&&c!==undefined&&c.autoDestroy)r.destroy(i);else if(i){i.stack;if(c&&!c.errored){c.errored=i}if(l&&!l.errored){l.errored=i}if(s){a.nextTick(emitErrorNT,r,i)}else{emitErrorNT(r,i)}}}function construct(r,i){if(typeof r._construct!=="function"){return}const s=r._readableState;const l=r._writableState;if(s){s.constructed=false}if(l){l.constructed=false}r.once(b,i);if(r.listenerCount(b)>1){return}a.nextTick(constructNT,r)}function constructNT(r){let i=false;function onConstruct(s){if(i){errorOrDestroy(r,s!==null&&s!==undefined?s:new c);return}i=true;const l=r._readableState;const d=r._writableState;const p=d||l;if(l){l.constructed=true}if(d){d.constructed=true}if(p.destroyed){r.emit(y,s)}else if(s){errorOrDestroy(r,s,true)}else{a.nextTick(emitConstructNT,r)}}try{r._construct((r=>{a.nextTick(onConstruct,r)}))}catch(r){a.nextTick(onConstruct,r)}}function emitConstructNT(r){r.emit(b)}function isRequest(r){return(r===null||r===undefined?undefined:r.setHeader)&&typeof r.abort==="function"}function emitCloseLegacy(r){r.emit("close")}function emitErrorCloseLegacy(r,i){r.emit("error",i);a.nextTick(emitCloseLegacy,r)}function destroyer(r,i){if(!r||A(r)){return}if(!i&&!h(r)){i=new d}if(g(r)){r.socket=null;r.destroy(i)}else if(isRequest(r)){r.abort()}else if(isRequest(r.req)){r.req.abort()}else if(typeof r.destroy==="function"){r.destroy(i)}else if(typeof r.close==="function"){r.close()}else if(i){a.nextTick(emitErrorCloseLegacy,r,i)}else{a.nextTick(emitCloseLegacy,r)}if(!r.destroyed){r[u]=true}}r.exports={construct:construct,destroyer:destroyer,destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},84953:(r,i,s)=>{"use strict";const{ObjectDefineProperties:a,ObjectGetOwnPropertyDescriptor:l,ObjectKeys:c,ObjectSetPrototypeOf:d}=s(95971);r.exports=Duplex;const p=s(68524);const u=s(39480);d(Duplex.prototype,p.prototype);d(Duplex,p);{const r=c(u.prototype);for(let i=0;i{const a=s(53568);"use strict";const l=s(14300);const{isReadable:c,isWritable:d,isIterable:p,isNodeStream:u,isReadableNodeStream:A,isWritableNodeStream:h,isDuplexNodeStream:g,isReadableStream:y,isWritableStream:b}=s(13300);const w=s(61701);const{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:I}}=s(46254);const{destroyer:B}=s(36702);const S=s(84953);const x=s(68524);const R=s(39480);const{createDeferredPromise:Q}=s(58472);const _=s(37464);const N=globalThis.Blob||l.Blob;const T=typeof N!=="undefined"?function isBlob(r){return r instanceof N}:function isBlob(r){return false};const k=globalThis.AbortController||s(24995).AbortController;const{FunctionPrototypeCall:D}=s(95971);class Duplexify extends S{constructor(r){super(r);if((r===null||r===undefined?undefined:r.readable)===false){this._readableState.readable=false;this._readableState.ended=true;this._readableState.endEmitted=true}if((r===null||r===undefined?undefined:r.writable)===false){this._writableState.writable=false;this._writableState.ending=true;this._writableState.ended=true;this._writableState.finished=true}}}r.exports=function duplexify(r,i){if(g(r)){return r}if(A(r)){return _duplexify({readable:r})}if(h(r)){return _duplexify({writable:r})}if(u(r)){return _duplexify({writable:false,readable:false})}if(y(r)){return _duplexify({readable:x.fromWeb(r)})}if(b(r)){return _duplexify({writable:R.fromWeb(r)})}if(typeof r==="function"){const{value:s,write:l,final:c,destroy:d}=fromAsyncGen(r);if(p(s)){return _(Duplexify,s,{objectMode:true,write:l,final:c,destroy:d})}const u=s===null||s===undefined?undefined:s.then;if(typeof u==="function"){let r;const i=D(u,s,(r=>{if(r!=null){throw new I("nully","body",r)}}),(i=>{B(r,i)}));return r=new Duplexify({objectMode:true,readable:false,write:l,final(r){c((async()=>{try{await i;a.nextTick(r,null)}catch(i){a.nextTick(r,i)}}))},destroy:d})}throw new I("Iterable, AsyncIterable or AsyncFunction",i,s)}if(T(r)){return duplexify(r.arrayBuffer())}if(p(r)){return _(Duplexify,r,{objectMode:true,writable:false})}if(y(r===null||r===undefined?undefined:r.readable)&&b(r===null||r===undefined?undefined:r.writable)){return Duplexify.fromWeb(r)}if(typeof(r===null||r===undefined?undefined:r.writable)==="object"||typeof(r===null||r===undefined?undefined:r.readable)==="object"){const i=r!==null&&r!==undefined&&r.readable?A(r===null||r===undefined?undefined:r.readable)?r===null||r===undefined?undefined:r.readable:duplexify(r.readable):undefined;const s=r!==null&&r!==undefined&&r.writable?h(r===null||r===undefined?undefined:r.writable)?r===null||r===undefined?undefined:r.writable:duplexify(r.writable):undefined;return _duplexify({readable:i,writable:s})}const s=r===null||r===undefined?undefined:r.then;if(typeof s==="function"){let i;D(s,r,(r=>{if(r!=null){i.push(r)}i.push(null)}),(r=>{B(i,r)}));return i=new Duplexify({objectMode:true,writable:false,read(){}})}throw new v(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],r)};function fromAsyncGen(r){let{promise:i,resolve:s}=Q();const l=new k;const c=l.signal;const d=r(async function*(){while(true){const r=i;i=null;const{chunk:l,done:d,cb:p}=await r;a.nextTick(p);if(d)return;if(c.aborted)throw new C(undefined,{cause:c.reason});({promise:i,resolve:s}=Q());yield l}}(),{signal:c});return{value:d,write(r,i,a){const l=s;s=null;l({chunk:r,done:false,cb:a})},final(r){const i=s;s=null;i({done:true,cb:r})},destroy(r,i){l.abort();i(r)}}}function _duplexify(r){const i=r.readable&&typeof r.readable.read!=="function"?x.wrap(r.readable):r.readable;const s=r.writable;let a=!!c(i);let l=!!d(s);let p;let u;let A;let h;let g;function onfinished(r){const i=h;h=null;if(i){i(r)}else if(r){g.destroy(r)}}g=new Duplexify({readableObjectMode:!!(i!==null&&i!==undefined&&i.readableObjectMode),writableObjectMode:!!(s!==null&&s!==undefined&&s.writableObjectMode),readable:a,writable:l});if(l){w(s,(r=>{l=false;if(r){B(i,r)}onfinished(r)}));g._write=function(r,i,a){if(s.write(r,i)){a()}else{p=a}};g._final=function(r){s.end();u=r};s.on("drain",(function(){if(p){const r=p;p=null;r()}}));s.on("finish",(function(){if(u){const r=u;u=null;r()}}))}if(a){w(i,(r=>{a=false;if(r){B(i,r)}onfinished(r)}));i.on("readable",(function(){if(A){const r=A;A=null;r()}}));i.on("end",(function(){g.push(null)}));g._read=function(){while(true){const r=i.read();if(r===null){A=g._read;return}if(!g.push(r)){return}}}}g._destroy=function(r,a){if(!r&&h!==null){r=new C}A=null;p=null;u=null;if(h===null){a(r)}else{h=a;B(s,r);B(i,r)}};return g}},61701:(r,i,s)=>{const a=s(53568);"use strict";const{AbortError:l,codes:c}=s(46254);const{ERR_INVALID_ARG_TYPE:d,ERR_STREAM_PREMATURE_CLOSE:p}=c;const{kEmptyObject:u,once:A}=s(58472);const{validateAbortSignal:h,validateFunction:g,validateObject:y,validateBoolean:b}=s(90813);const{Promise:w,PromisePrototypeThen:C,SymbolDispose:v}=s(95971);const{isClosed:I,isReadable:B,isReadableNodeStream:S,isReadableStream:x,isReadableFinished:R,isReadableErrored:Q,isWritable:_,isWritableNodeStream:N,isWritableStream:T,isWritableFinished:k,isWritableErrored:D,isNodeStream:P,willEmitClose:O,kIsClosedPromise:L}=s(13300);let M;function isRequest(r){return r.setHeader&&typeof r.abort==="function"}const nop=()=>{};function eos(r,i,c){var b,w;if(arguments.length===2){c=i;i=u}else if(i==null){i=u}else{y(i,"options")}g(c,"callback");h(i.signal,"options.signal");c=A(c);if(x(r)||T(r)){return eosWeb(r,i,c)}if(!P(r)){throw new d("stream",["ReadableStream","WritableStream","Stream"],r)}const C=(b=i.readable)!==null&&b!==undefined?b:S(r);const L=(w=i.writable)!==null&&w!==undefined?w:N(r);const U=r._writableState;const j=r._readableState;const onlegacyfinish=()=>{if(!r.writable){onfinish()}};let H=O(r)&&S(r)===C&&N(r)===L;let q=k(r,false);const onfinish=()=>{q=true;if(r.destroyed){H=false}if(H&&(!r.readable||C)){return}if(!C||G){c.call(r)}};let G=R(r,false);const onend=()=>{G=true;if(r.destroyed){H=false}if(H&&(!r.writable||L)){return}if(!L||q){c.call(r)}};const onerror=i=>{c.call(r,i)};let z=I(r);const onclose=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}if(C&&!G&&S(r,true)){if(!R(r,false))return c.call(r,new p)}if(L&&!q){if(!k(r,false))return c.call(r,new p)}c.call(r)};const onclosed=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}c.call(r)};const onrequest=()=>{r.req.on("finish",onfinish)};if(isRequest(r)){r.on("complete",onfinish);if(!H){r.on("abort",onclose)}if(r.req){onrequest()}else{r.on("request",onrequest)}}else if(L&&!U){r.on("end",onlegacyfinish);r.on("close",onlegacyfinish)}if(!H&&typeof r.aborted==="boolean"){r.on("aborted",onclose)}r.on("end",onend);r.on("finish",onfinish);if(i.error!==false){r.on("error",onerror)}r.on("close",onclose);if(z){a.nextTick(onclose)}else if(U!==null&&U!==undefined&&U.errorEmitted||j!==null&&j!==undefined&&j.errorEmitted){if(!H){a.nextTick(onclosed)}}else if(!C&&(!H||B(r))&&(q||_(r)===false)){a.nextTick(onclosed)}else if(!L&&(!H||_(r))&&(G||B(r)===false)){a.nextTick(onclosed)}else if(j&&r.req&&r.aborted){a.nextTick(onclosed)}const cleanup=()=>{c=nop;r.removeListener("aborted",onclose);r.removeListener("complete",onfinish);r.removeListener("abort",onclose);r.removeListener("request",onrequest);if(r.req)r.req.removeListener("finish",onfinish);r.removeListener("end",onlegacyfinish);r.removeListener("close",onlegacyfinish);r.removeListener("finish",onfinish);r.removeListener("end",onend);r.removeListener("error",onerror);r.removeListener("close",onclose)};if(i.signal&&!z){const abort=()=>{const s=c;cleanup();s.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(abort)}else{M=M||s(58472).addAbortListener;const a=M(i.signal,abort);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}return cleanup}function eosWeb(r,i,c){let d=false;let p=nop;if(i.signal){p=()=>{d=true;c.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(p)}else{M=M||s(58472).addAbortListener;const a=M(i.signal,p);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}const resolverFn=(...i)=>{if(!d){a.nextTick((()=>c.apply(r,i)))}};C(r[L].promise,resolverFn,resolverFn);return nop}function finished(r,i){var s;let a=false;if(i===null){i=u}if((s=i)!==null&&s!==undefined&&s.cleanup){b(i.cleanup,"cleanup");a=i.cleanup}return new w(((s,l)=>{const c=eos(r,i,(r=>{if(a){c()}if(r){l(r)}else{s()}}))}))}r.exports=eos;r.exports.finished=finished},37464:(r,i,s)=>{"use strict";const a=s(53568);const{PromisePrototypeThen:l,SymbolAsyncIterator:c,SymbolIterator:d}=s(95971);const{Buffer:p}=s(14300);const{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:A}=s(46254).codes;function from(r,i,s){let h;if(typeof i==="string"||i instanceof p){return new r({objectMode:true,...s,read(){this.push(i);this.push(null)}})}let g;if(i&&i[c]){g=true;h=i[c]()}else if(i&&i[d]){g=false;h=i[d]()}else{throw new u("iterable",["Iterable"],i)}const y=new r({objectMode:true,highWaterMark:1,...s});let b=false;y._read=function(){if(!b){b=true;next()}};y._destroy=function(r,i){l(close(r),(()=>a.nextTick(i,r)),(s=>a.nextTick(i,s||r)))};async function close(r){const i=r!==undefined&&r!==null;const s=typeof h.throw==="function";if(i&&s){const{value:i,done:s}=await h.throw(r);await i;if(s){return}}if(typeof h.return==="function"){const{value:r}=await h.return();await r}}async function next(){for(;;){try{const{value:r,done:i}=g?await h.next():h.next();if(i){y.push(null)}else{const i=r&&typeof r.then==="function"?await r:r;if(i===null){b=false;throw new A}else if(y.push(i)){continue}else{b=false}}}catch(r){y.destroy(r)}break}}return y}r.exports=from},88763:(r,i,s)=>{"use strict";const{ArrayIsArray:a,ObjectSetPrototypeOf:l}=s(95971);const{EventEmitter:c}=s(82361);function Stream(r){c.call(this,r)}l(Stream.prototype,c.prototype);l(Stream,c);Stream.prototype.pipe=function(r,i){const s=this;function ondata(i){if(r.writable&&r.write(i)===false&&s.pause){s.pause()}}s.on("data",ondata);function ondrain(){if(s.readable&&s.resume){s.resume()}}r.on("drain",ondrain);if(!r._isStdio&&(!i||i.end!==false)){s.on("end",onend);s.on("close",onclose)}let a=false;function onend(){if(a)return;a=true;r.end()}function onclose(){if(a)return;a=true;if(typeof r.destroy==="function")r.destroy()}function onerror(r){cleanup();if(c.listenerCount(this,"error")===0){this.emit("error",r)}}prependListener(s,"error",onerror);prependListener(r,"error",onerror);function cleanup(){s.removeListener("data",ondata);r.removeListener("drain",ondrain);s.removeListener("end",onend);s.removeListener("close",onclose);s.removeListener("error",onerror);r.removeListener("error",onerror);s.removeListener("end",cleanup);s.removeListener("close",cleanup);r.removeListener("close",cleanup)}s.on("end",cleanup);s.on("close",cleanup);r.on("close",cleanup);r.emit("pipe",s);return r};function prependListener(r,i,s){if(typeof r.prependListener==="function")return r.prependListener(i,s);if(!r._events||!r._events[i])r.on(i,s);else if(a(r._events[i]))r._events[i].unshift(s);else r._events[i]=[s,r._events[i]]}r.exports={Stream:Stream,prependListener:prependListener}},33815:(r,i,s)=>{"use strict";const a=globalThis.AbortController||s(24995).AbortController;const{codes:{ERR_INVALID_ARG_VALUE:l,ERR_INVALID_ARG_TYPE:c,ERR_MISSING_ARGS:d,ERR_OUT_OF_RANGE:p},AbortError:u}=s(46254);const{validateAbortSignal:A,validateInteger:h,validateObject:g}=s(90813);const y=s(95971).Symbol("kWeak");const b=s(95971).Symbol("kResistStopPropagation");const{finished:w}=s(61701);const C=s(85994);const{addAbortSignalNoValidate:v}=s(39917);const{isWritable:I,isNodeStream:B}=s(13300);const{deprecate:S}=s(58472);const{ArrayPrototypePush:x,Boolean:R,MathFloor:Q,Number:_,NumberIsNaN:N,Promise:T,PromiseReject:k,PromiseResolve:D,PromisePrototypeThen:P,Symbol:O}=s(95971);const L=O("kEmpty");const M=O("kEof");function compose(r,i){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}if(B(r)&&!I(r)){throw new l("stream",r,"must be writable")}const s=C(this,r);if(i!==null&&i!==undefined&&i.signal){v(i.signal,s)}return s}function map(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}let a=1;if((i===null||i===undefined?undefined:i.concurrency)!=null){a=Q(i.concurrency)}let l=a-1;if((i===null||i===undefined?undefined:i.highWaterMark)!=null){l=Q(i.highWaterMark)}h(a,"options.concurrency",1);h(l,"options.highWaterMark",0);l+=a;return async function*map(){const c=s(58472).AbortSignalAny([i===null||i===undefined?undefined:i.signal].filter(R));const d=this;const p=[];const A={signal:c};let h;let g;let y=false;let b=0;function onCatch(){y=true;afterItemProcessed()}function afterItemProcessed(){b-=1;maybeResume()}function maybeResume(){if(g&&!y&&b=l||b>=a)){await new T((r=>{g=r}))}}p.push(M)}catch(r){const i=k(r);P(i,afterItemProcessed,onCatch);p.push(i)}finally{y=true;if(h){h();h=null}}}pump();try{while(true){while(p.length>0){const r=await p[0];if(r===M){return}if(c.aborted){throw new u}if(r!==L){yield r}p.shift();maybeResume()}await new T((r=>{h=r}))}}finally{y=true;if(g){g();g=null}}}.call(this)}function asIndexedPairs(r=undefined){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}return async function*asIndexedPairs(){let i=0;for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u({cause:r.signal.reason})}yield[i++,a]}}.call(this)}async function some(r,i=undefined){for await(const s of filter.call(this,r,i)){return true}return false}async function every(r,i=undefined){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}return!await some.call(this,(async(...i)=>!await r(...i)),i)}async function find(r,i){for await(const s of filter.call(this,r,i)){return s}return undefined}async function forEach(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function forEachFn(i,s){await r(i,s);return L}for await(const r of map.call(this,forEachFn,i));}function filter(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function filterFn(i,s){if(await r(i,s)){return i}return L}return map.call(this,filterFn,i)}class ReduceAwareErrMissingArgs extends d{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function reduce(r,i,s){var l;if(typeof r!=="function"){throw new c("reducer",["Function","AsyncFunction"],r)}if(s!=null){g(s,"options")}if((s===null||s===undefined?undefined:s.signal)!=null){A(s.signal,"options.signal")}let d=arguments.length>1;if(s!==null&&s!==undefined&&(l=s.signal)!==null&&l!==undefined&&l.aborted){const r=new u(undefined,{cause:s.signal.reason});this.once("error",(()=>{}));await w(this.destroy(r));throw r}const p=new a;const h=p.signal;if(s!==null&&s!==undefined&&s.signal){const r={once:true,[y]:this,[b]:true};s.signal.addEventListener("abort",(()=>p.abort()),r)}let C=false;try{for await(const a of this){var v;C=true;if(s!==null&&s!==undefined&&(v=s.signal)!==null&&v!==undefined&&v.aborted){throw new u}if(!d){i=a;d=true}else{i=await r(i,a,{signal:h})}}if(!C&&!d){throw new ReduceAwareErrMissingArgs}}finally{p.abort()}return i}async function toArray(r){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}const i=[];for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u(undefined,{cause:r.signal.reason})}x(i,a)}return i}function flatMap(r,i){const s=map.call(this,r,i);return async function*flatMap(){for await(const r of s){yield*r}}.call(this)}function toIntegerOrInfinity(r){r=_(r);if(N(r)){return 0}if(r<0){throw new p("number",">= 0",r)}return r}function drop(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*drop(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r--<=0){yield s}}}.call(this)}function take(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*take(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r-- >0){yield s}if(r<=0){return}}}.call(this)}r.exports.streamReturningOperators={asIndexedPairs:S(asIndexedPairs,"readable.asIndexedPairs will be removed in a future version."),drop:drop,filter:filter,flatMap:flatMap,map:map,take:take,compose:compose};r.exports.promiseReturningOperators={every:every,forEach:forEach,reduce:reduce,toArray:toArray,some:some,find:find}},60321:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a}=s(95971);r.exports=PassThrough;const l=s(57084);a(PassThrough.prototype,l.prototype);a(PassThrough,l);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);l.call(this,r)}PassThrough.prototype._transform=function(r,i,s){s(null,r)}},75338:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayIsArray:l,Promise:c,SymbolAsyncIterator:d,SymbolDispose:p}=s(95971);const u=s(61701);const{once:A}=s(58472);const h=s(36702);const g=s(84953);const{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:w,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:v,ERR_STREAM_PREMATURE_CLOSE:I},AbortError:B}=s(46254);const{validateFunction:S,validateAbortSignal:x}=s(90813);const{isIterable:R,isReadable:Q,isReadableNodeStream:_,isNodeStream:N,isTransformStream:T,isWebStream:k,isReadableStream:D,isReadableFinished:P}=s(13300);const O=globalThis.AbortController||s(24995).AbortController;let L;let M;let U;function destroyer(r,i,s){let a=false;r.on("close",(()=>{a=true}));const l=u(r,{readable:i,writable:s},(r=>{a=!r}));return{destroy:i=>{if(a)return;a=true;h.destroyer(r,i||new v("pipe"))},cleanup:l}}function popCallback(r){S(r[r.length-1],"streams[stream.length - 1]");return r.pop()}function makeAsyncIterable(r){if(R(r)){return r}else if(_(r)){return fromReadable(r)}throw new b("val",["Readable","Iterable","AsyncIterable"],r)}async function*fromReadable(r){if(!M){M=s(68524)}yield*M.prototype[d].call(r)}async function pumpToNode(r,i,s,{end:a}){let l;let d=null;const resume=r=>{if(r){l=r}if(d){const r=d;d=null;r()}};const wait=()=>new c(((r,i)=>{if(l){i(l)}else{d=()=>{if(l){i(l)}else{r()}}}}));i.on("drain",resume);const p=u(i,{readable:false},resume);try{if(i.writableNeedDrain){await wait()}for await(const s of r){if(!i.write(s)){await wait()}}if(a){i.end();await wait()}s()}catch(r){s(l!==r?y(l,r):r)}finally{p();i.off("drain",resume)}}async function pumpToWeb(r,i,s,{end:a}){if(T(i)){i=i.writable}const l=i.getWriter();try{for await(const i of r){await l.ready;l.write(i).catch((()=>{}))}await l.ready;if(a){await l.close()}s()}catch(r){try{await l.abort(r);s(r)}catch(r){s(r)}}}function pipeline(...r){return pipelineImpl(r,A(popCallback(r)))}function pipelineImpl(r,i,c){if(r.length===1&&l(r[0])){r=r[0]}if(r.length<2){throw new C("streams")}const d=new O;const u=d.signal;const A=c===null||c===undefined?undefined:c.signal;const h=[];x(A,"options.signal");function abort(){finishImpl(new B)}U=U||s(58472).addAbortListener;let y;if(A){y=U(A,abort)}let v;let I;const S=[];let P=0;function finish(r){finishImpl(r,--P===0)}function finishImpl(r,s){var l;if(r&&(!v||v.code==="ERR_STREAM_PREMATURE_CLOSE")){v=r}if(!v&&!s){return}while(S.length){S.shift()(v)}(l=y)===null||l===undefined?undefined:l[p]();d.abort();if(s){if(!v){h.forEach((r=>r()))}a.nextTick(i,v,I)}}let M;for(let q=0;q0;const W=z||(c===null||c===undefined?undefined:c.end)!==false;const Y=q===r.length-1;if(N(G)){if(W){const{destroy:J,cleanup:$}=destroyer(G,z,V);S.push(J);if(Q(G)&&Y){h.push($)}}function onError(r){if(r&&r.name!=="AbortError"&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"){finish(r)}}G.on("error",onError);if(Q(G)&&Y){h.push((()=>{G.removeListener("error",onError)}))}}if(q===0){if(typeof G==="function"){M=G({signal:u});if(!R(M)){throw new w("Iterable, AsyncIterable or Stream","source",M)}}else if(R(G)||_(G)||T(G)){M=G}else{M=g.from(G)}}else if(typeof G==="function"){if(T(M)){var j;M=makeAsyncIterable((j=M)===null||j===undefined?undefined:j.readable)}else{M=makeAsyncIterable(M)}M=G(M,{signal:u});if(z){if(!R(M,true)){throw new w("AsyncIterable",`transform[${q-1}]`,M)}}else{var H;if(!L){L=s(60321)}const X=new L({objectMode:true});const K=(H=M)===null||H===undefined?undefined:H.then;if(typeof K==="function"){P++;K.call(M,(r=>{I=r;if(r!=null){X.write(r)}if(W){X.end()}a.nextTick(finish)}),(r=>{X.destroy(r);a.nextTick(finish,r)}))}else if(R(M,true)){P++;pumpToNode(M,X,finish,{end:W})}else if(D(M)||T(M)){const te=M.readable||M;P++;pumpToNode(te,X,finish,{end:W})}else{throw new w("AsyncIterable or Promise","destination",M)}M=X;const{destroy:Z,cleanup:ee}=destroyer(M,false,true);S.push(Z);if(Y){h.push(ee)}}}else if(N(G)){if(_(M)){P+=2;const re=pipe(M,G,finish,{end:W});if(Q(G)&&Y){h.push(re)}}else if(T(M)||D(M)){const ne=M.readable||M;P++;pumpToNode(ne,G,finish,{end:W})}else if(R(M)){P++;pumpToNode(M,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else if(k(G)){if(_(M)){P++;pumpToWeb(makeAsyncIterable(M),G,finish,{end:W})}else if(D(M)||R(M)){P++;pumpToWeb(M,G,finish,{end:W})}else if(T(M)){P++;pumpToWeb(M.readable,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else{M=g.from(G)}}if(u!==null&&u!==undefined&&u.aborted||A!==null&&A!==undefined&&A.aborted){a.nextTick(abort)}return M}function pipe(r,i,s,{end:l}){let c=false;i.on("close",(()=>{if(!c){s(new I)}}));r.pipe(i,{end:false});if(l){function endFn(){c=true;i.end()}if(P(r)){a.nextTick(endFn)}else{r.once("end",endFn)}}else{s()}u(r,{readable:true,writable:false},(i=>{const a=r._readableState;if(i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted){r.once("end",s).once("error",s)}else{s(i)}}));return u(i,{readable:false,writable:true},s)}r.exports={pipelineImpl:pipelineImpl,pipeline:pipeline}},68524:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeIndexOf:l,NumberIsInteger:c,NumberIsNaN:d,NumberParseInt:p,ObjectDefineProperties:u,ObjectKeys:A,ObjectSetPrototypeOf:h,Promise:g,SafeSet:y,SymbolAsyncDispose:b,SymbolAsyncIterator:w,Symbol:C}=s(95971);r.exports=Readable;Readable.ReadableState=ReadableState;const{EventEmitter:v}=s(82361);const{Stream:I,prependListener:B}=s(88763);const{Buffer:S}=s(14300);const{addAbortSignal:x}=s(39917);const R=s(61701);let Q=s(58472).debuglog("stream",(r=>{Q=r}));const _=s(11773);const N=s(36702);const{getHighWaterMark:T,getDefaultHighWaterMark:k}=s(66208);const{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:L,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:j}=s(46254);const{validateObject:H}=s(90813);const q=C("kPaused");const{StringDecoder:G}=s(71576);const z=s(37464);h(Readable.prototype,I.prototype);h(Readable,I);const nop=()=>{};const{errorOrDestroy:V}=N;const W=1<<0;const Y=1<<1;const J=1<<2;const $=1<<3;const X=1<<4;const K=1<<5;const Z=1<<6;const ee=1<<7;const te=1<<8;const re=1<<9;const ne=1<<10;const ie=1<<11;const se=1<<12;const ae=1<<13;const oe=1<<14;const le=1<<15;const ce=1<<16;const de=1<<17;const pe=1<<18;function makeBitMapDescriptor(r){return{enumerable:false,get(){return(this.state&r)!==0},set(i){if(i)this.state|=r;else this.state&=~r}}}u(ReadableState.prototype,{objectMode:makeBitMapDescriptor(W),ended:makeBitMapDescriptor(Y),endEmitted:makeBitMapDescriptor(J),reading:makeBitMapDescriptor($),constructed:makeBitMapDescriptor(X),sync:makeBitMapDescriptor(K),needReadable:makeBitMapDescriptor(Z),emittedReadable:makeBitMapDescriptor(ee),readableListening:makeBitMapDescriptor(te),resumeScheduled:makeBitMapDescriptor(re),errorEmitted:makeBitMapDescriptor(ne),emitClose:makeBitMapDescriptor(ie),autoDestroy:makeBitMapDescriptor(se),destroyed:makeBitMapDescriptor(ae),closed:makeBitMapDescriptor(oe),closeEmitted:makeBitMapDescriptor(le),multiAwaitDrain:makeBitMapDescriptor(ce),readingMore:makeBitMapDescriptor(de),dataEmitted:makeBitMapDescriptor(pe)});function ReadableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(84953);this.state=ie|se|X|K;if(r&&r.objectMode)this.state|=W;if(a&&r&&r.readableObjectMode)this.state|=W;this.highWaterMark=r?T(this,r,"readableHighWaterMark",a):k(false);this.buffer=new _;this.length=0;this.pipes=[];this.flowing=null;this[q]=null;if(r&&r.emitClose===false)this.state&=~ie;if(r&&r.autoDestroy===false)this.state&=~se;this.errored=null;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.awaitDrainWriters=null;this.decoder=null;this.encoding=null;if(r&&r.encoding){this.decoder=new G(r.encoding);this.encoding=r.encoding}}function Readable(r){if(!(this instanceof Readable))return new Readable(r);const i=this instanceof s(84953);this._readableState=new ReadableState(r,this,i);if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal&&!i)x(r.signal,this)}I.call(this,r);N.construct(this,(()=>{if(this._readableState.needReadable){maybeReadMore(this,this._readableState)}}))}Readable.prototype.destroy=N.destroy;Readable.prototype._undestroy=N.undestroy;Readable.prototype._destroy=function(r,i){i(r)};Readable.prototype[v.captureRejectionSymbol]=function(r){this.destroy(r)};Readable.prototype[b]=function(){let r;if(!this.destroyed){r=this.readableEnded?null:new j;this.destroy(r)}return new g(((i,s)=>R(this,(a=>a&&a!==r?s(a):i(null)))))};Readable.prototype.push=function(r,i){return readableAddChunk(this,r,i,false)};Readable.prototype.unshift=function(r,i){return readableAddChunk(this,r,i,true)};function readableAddChunk(r,i,s,a){Q("readableAddChunk",i);const l=r._readableState;let c;if((l.state&W)===0){if(typeof i==="string"){s=s||l.defaultEncoding;if(l.encoding!==s){if(a&&l.encoding){i=S.from(i,s).toString(l.encoding)}else{i=S.from(i,s);s=""}}}else if(i instanceof S){s=""}else if(I._isUint8Array(i)){i=I._uint8ArrayToBuffer(i);s=""}else if(i!=null){c=new P("chunk",["string","Buffer","Uint8Array"],i)}}if(c){V(r,c)}else if(i===null){l.state&=~$;onEofChunk(r,l)}else if((l.state&W)!==0||i&&i.length>0){if(a){if((l.state&J)!==0)V(r,new U);else if(l.destroyed||l.errored)return false;else addChunk(r,l,i,true)}else if(l.ended){V(r,new M)}else if(l.destroyed||l.errored){return false}else{l.state&=~$;if(l.decoder&&!s){i=l.decoder.write(i);if(l.objectMode||i.length!==0)addChunk(r,l,i,false);else maybeReadMore(r,l)}else{addChunk(r,l,i,false)}}}else if(!a){l.state&=~$;maybeReadMore(r,l)}return!l.ended&&(l.length0){if((i.state&ce)!==0){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}i.dataEmitted=true;r.emit("data",s)}else{i.length+=i.objectMode?1:s.length;if(a)i.buffer.unshift(s);else i.buffer.push(s);if((i.state&Z)!==0)emitReadable(r)}maybeReadMore(r,i)}Readable.prototype.isPaused=function(){const r=this._readableState;return r[q]===true||r.flowing===false};Readable.prototype.setEncoding=function(r){const i=new G(r);this._readableState.decoder=i;this._readableState.encoding=this._readableState.decoder.encoding;const s=this._readableState.buffer;let a="";for(const r of s){a+=i.write(r)}s.clear();if(a!=="")s.push(a);this._readableState.length=a.length;return this};const ue=1073741824;function computeNewHighWaterMark(r){if(r>ue){throw new L("size","<= 1GiB",r)}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if((i.state&W)!==0)return 1;if(d(r)){if(i.flowing&&i.length)return i.buffer.first().length;return i.length}if(r<=i.length)return r;return i.ended?i.length:0}Readable.prototype.read=function(r){Q("read",r);if(r===undefined){r=NaN}else if(!c(r)){r=p(r,10)}const i=this._readableState;const s=r;if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r!==0)i.state&=~ee;if(r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){Q("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}let a=(i.state&Z)!==0;Q("need readable",a);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=i.length<=i.highWaterMark;r=0}else{i.length-=r;if(i.multiAwaitDrain){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}}if(i.length===0){if(!i.ended)i.needReadable=true;if(s!==r&&i.ended)endReadable(this)}if(l!==null&&!i.errorEmitted&&!i.closeEmitted){i.dataEmitted=true;this.emit("data",l)}return l};function onEofChunk(r,i){Q("onEofChunk");if(i.ended)return;if(i.decoder){const r=i.decoder.end();if(r&&r.length){i.buffer.push(r);i.length+=i.objectMode?1:r.length}}i.ended=true;if(i.sync){emitReadable(r)}else{i.needReadable=false;i.emittedReadable=true;emitReadable_(r)}}function emitReadable(r){const i=r._readableState;Q("emitReadable",i.needReadable,i.emittedReadable);i.needReadable=false;if(!i.emittedReadable){Q("emitReadable",i.flowing);i.emittedReadable=true;a.nextTick(emitReadable_,r)}}function emitReadable_(r){const i=r._readableState;Q("emitReadable_",i.destroyed,i.length,i.ended);if(!i.destroyed&&!i.errored&&(i.length||i.ended)){r.emit("readable");i.emittedReadable=false}i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark;flow(r)}function maybeReadMore(r,i){if(!i.readingMore&&i.constructed){i.readingMore=true;a.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){while(!i.reading&&!i.ended&&(i.length1&&l.pipes.includes(r)){Q("false write response, pause",l.awaitDrainWriters.size);l.awaitDrainWriters.add(r)}s.pause()}if(!p){p=pipeOnDrain(s,r);r.on("drain",p)}}s.on("data",ondata);function ondata(i){Q("ondata");const s=r.write(i);Q("dest.write",s);if(s===false){pause()}}function onerror(i){Q("onerror",i);unpipe();r.removeListener("error",onerror);if(r.listenerCount("error")===0){const s=r._writableState||r._readableState;if(s&&!s.errorEmitted){V(r,i)}else{r.emit("error",i)}}}B(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){Q("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){Q("unpipe");s.unpipe(r)}r.emit("pipe",s);if(r.writableNeedDrain===true){pause()}else if(!l.flowing){Q("pipe resume");s.resume()}return r};function pipeOnDrain(r,i){return function pipeOnDrainFunctionResult(){const s=r._readableState;if(s.awaitDrainWriters===i){Q("pipeOnDrain",1);s.awaitDrainWriters=null}else if(s.multiAwaitDrain){Q("pipeOnDrain",s.awaitDrainWriters.size);s.awaitDrainWriters.delete(i)}if((!s.awaitDrainWriters||s.awaitDrainWriters.size===0)&&r.listenerCount("data")){r.resume()}}}Readable.prototype.unpipe=function(r){const i=this._readableState;const s={hasUnpiped:false};if(i.pipes.length===0)return this;if(!r){const r=i.pipes;i.pipes=[];this.pause();for(let i=0;i0;if(l.flowing!==false)this.resume()}else if(r==="readable"){if(!l.endEmitted&&!l.readableListening){l.readableListening=l.needReadable=true;l.flowing=false;l.emittedReadable=false;Q("on readable",l.length,l.reading);if(l.length){emitReadable(this)}else if(!l.reading){a.nextTick(nReadingNextTick,this)}}}return s};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(r,i){const s=I.prototype.removeListener.call(this,r,i);if(r==="readable"){a.nextTick(updateReadableListening,this)}return s};Readable.prototype.off=Readable.prototype.removeListener;Readable.prototype.removeAllListeners=function(r){const i=I.prototype.removeAllListeners.apply(this,arguments);if(r==="readable"||r===undefined){a.nextTick(updateReadableListening,this)}return i};function updateReadableListening(r){const i=r._readableState;i.readableListening=r.listenerCount("readable")>0;if(i.resumeScheduled&&i[q]===false){i.flowing=true}else if(r.listenerCount("data")>0){r.resume()}else if(!i.readableListening){i.flowing=null}}function nReadingNextTick(r){Q("readable nexttick read 0");r.read(0)}Readable.prototype.resume=function(){const r=this._readableState;if(!r.flowing){Q("resume");r.flowing=!r.readableListening;resume(this,r)}r[q]=false;return this};function resume(r,i){if(!i.resumeScheduled){i.resumeScheduled=true;a.nextTick(resume_,r,i)}}function resume_(r,i){Q("resume",i.reading);if(!i.reading){r.read(0)}i.resumeScheduled=false;r.emit("resume");flow(r);if(i.flowing&&!i.reading)r.read(0)}Readable.prototype.pause=function(){Q("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){Q("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState[q]=true;return this};function flow(r){const i=r._readableState;Q("flow",i.flowing);while(i.flowing&&r.read()!==null);}Readable.prototype.wrap=function(r){let i=false;r.on("data",(s=>{if(!this.push(s)&&r.pause){i=true;r.pause()}}));r.on("end",(()=>{this.push(null)}));r.on("error",(r=>{V(this,r)}));r.on("close",(()=>{this.destroy()}));r.on("destroy",(()=>{this.destroy()}));this._read=()=>{if(i&&r.resume){i=false;r.resume()}};const s=A(r);for(let i=1;i{a=r?D(a,r):null;s();s=nop}));try{while(true){const i=r.destroyed?null:r.read();if(i!==null){yield i}else if(a){throw a}else if(a===null){return}else{await new g(next)}}}catch(r){a=D(a,r);throw a}finally{if((a||(i===null||i===undefined?undefined:i.destroyOnReturn)!==false)&&(a===undefined||r._readableState.autoDestroy)){N.destroyer(r,null)}else{r.off("readable",next);l()}}}u(Readable.prototype,{readable:{__proto__:null,get(){const r=this._readableState;return!!r&&r.readable!==false&&!r.destroyed&&!r.errorEmitted&&!r.endEmitted},set(r){if(this._readableState){this._readableState.readable=!!r}}},readableDidRead:{__proto__:null,enumerable:false,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:false,get:function(){return!!(this._readableState.readable!==false&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:false,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:false,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:false,get:function(){return this._readableState.flowing},set:function(r){if(this._readableState){this._readableState.flowing=r}}},readableLength:{__proto__:null,enumerable:false,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.objectMode:false}},readableEncoding:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:false}},destroyed:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.destroyed:false},set(r){if(!this._readableState){return}this._readableState.destroyed=r}},readableEnded:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.endEmitted:false}}});u(ReadableState.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[q]!==false},set(r){this[q]=!!r}}});Readable._fromList=fromList;function fromList(r,i){if(i.length===0)return null;let s;if(i.objectMode)s=i.buffer.shift();else if(!r||r>=i.length){if(i.decoder)s=i.buffer.join("");else if(i.buffer.length===1)s=i.buffer.first();else s=i.buffer.concat(i.length);i.buffer.clear()}else{s=i.buffer.consume(r,i.decoder)}return s}function endReadable(r){const i=r._readableState;Q("endReadable",i.endEmitted);if(!i.endEmitted){i.ended=true;a.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){Q("endReadableNT",r.endEmitted,r.length);if(!r.errored&&!r.closeEmitted&&!r.endEmitted&&r.length===0){r.endEmitted=true;i.emit("end");if(i.writable&&i.allowHalfOpen===false){a.nextTick(endWritableNT,i)}else if(r.autoDestroy){const r=i._writableState;const s=!r||r.autoDestroy&&(r.finished||r.writable===false);if(s){i.destroy()}}}}function endWritableNT(r){const i=r.writable&&!r.writableEnded&&!r.destroyed;if(i){r.end()}}Readable.from=function(r,i){return z(Readable,r,i)};let Ae;function lazyWebStreams(){if(Ae===undefined)Ae={};return Ae}Readable.fromWeb=function(r,i){return lazyWebStreams().newStreamReadableFromReadableStream(r,i)};Readable.toWeb=function(r,i){return lazyWebStreams().newReadableStreamFromStreamReadable(r,i)};Readable.wrap=function(r,i){var s,a;return new Readable({objectMode:(s=(a=r.readableObjectMode)!==null&&a!==undefined?a:r.objectMode)!==null&&s!==undefined?s:true,...i,destroy(i,s){N.destroyer(r,i);s(i)}}).wrap(r)}},66208:(r,i,s)=>{"use strict";const{MathFloor:a,NumberIsInteger:l}=s(95971);const{validateInteger:c}=s(90813);const{ERR_INVALID_ARG_VALUE:d}=s(46254).codes;let p=16*1024;let u=16;function highWaterMarkFrom(r,i,s){return r.highWaterMark!=null?r.highWaterMark:i?r[s]:null}function getDefaultHighWaterMark(r){return r?u:p}function setDefaultHighWaterMark(r,i){c(i,"value",0);if(r){u=i}else{p=i}}function getHighWaterMark(r,i,s,c){const p=highWaterMarkFrom(i,c,s);if(p!=null){if(!l(p)||p<0){const r=c?`options.${s}`:"options.highWaterMark";throw new d(r,p)}return a(p)}return getDefaultHighWaterMark(r.objectMode)}r.exports={getHighWaterMark:getHighWaterMark,getDefaultHighWaterMark:getDefaultHighWaterMark,setDefaultHighWaterMark:setDefaultHighWaterMark}},57084:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a,Symbol:l}=s(95971);r.exports=Transform;const{ERR_METHOD_NOT_IMPLEMENTED:c}=s(46254).codes;const d=s(84953);const{getHighWaterMark:p}=s(66208);a(Transform.prototype,d.prototype);a(Transform,d);const u=l("kCallback");function Transform(r){if(!(this instanceof Transform))return new Transform(r);const i=r?p(this,r,"readableHighWaterMark",true):null;if(i===0){r={...r,highWaterMark:null,readableHighWaterMark:i,writableHighWaterMark:r.writableHighWaterMark||0}}d.call(this,r);this._readableState.sync=false;this[u]=null;if(r){if(typeof r.transform==="function")this._transform=r.transform;if(typeof r.flush==="function")this._flush=r.flush}this.on("prefinish",prefinish)}function final(r){if(typeof this._flush==="function"&&!this.destroyed){this._flush(((i,s)=>{if(i){if(r){r(i)}else{this.destroy(i)}return}if(s!=null){this.push(s)}this.push(null);if(r){r()}}))}else{this.push(null);if(r){r()}}}function prefinish(){if(this._final!==final){final.call(this)}}Transform.prototype._final=final;Transform.prototype._transform=function(r,i,s){throw new c("_transform()")};Transform.prototype._write=function(r,i,s){const a=this._readableState;const l=this._writableState;const c=a.length;this._transform(r,i,((r,i)=>{if(r){s(r);return}if(i!=null){this.push(i)}if(l.ended||c===a.length||a.length{"use strict";const{SymbolAsyncIterator:a,SymbolIterator:l,SymbolFor:c}=s(95971);const d=c("nodejs.stream.destroyed");const p=c("nodejs.stream.errored");const u=c("nodejs.stream.readable");const A=c("nodejs.stream.writable");const h=c("nodejs.stream.disturbed");const g=c("nodejs.webstream.isClosedPromise");const y=c("nodejs.webstream.controllerErrorFunction");function isReadableNodeStream(r,i=false){var s;return!!(r&&typeof r.pipe==="function"&&typeof r.on==="function"&&(!i||typeof r.pause==="function"&&typeof r.resume==="function")&&(!r._writableState||((s=r._readableState)===null||s===undefined?undefined:s.readable)!==false)&&(!r._writableState||r._readableState))}function isWritableNodeStream(r){var i;return!!(r&&typeof r.write==="function"&&typeof r.on==="function"&&(!r._readableState||((i=r._writableState)===null||i===undefined?undefined:i.writable)!==false))}function isDuplexNodeStream(r){return!!(r&&typeof r.pipe==="function"&&r._readableState&&typeof r.on==="function"&&typeof r.write==="function")}function isNodeStream(r){return r&&(r._readableState||r._writableState||typeof r.write==="function"&&typeof r.on==="function"||typeof r.pipe==="function"&&typeof r.on==="function")}function isReadableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.pipeThrough==="function"&&typeof r.getReader==="function"&&typeof r.cancel==="function")}function isWritableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.getWriter==="function"&&typeof r.abort==="function")}function isTransformStream(r){return!!(r&&!isNodeStream(r)&&typeof r.readable==="object"&&typeof r.writable==="object")}function isWebStream(r){return isReadableStream(r)||isWritableStream(r)||isTransformStream(r)}function isIterable(r,i){if(r==null)return false;if(i===true)return typeof r[a]==="function";if(i===false)return typeof r[l]==="function";return typeof r[a]==="function"||typeof r[l]==="function"}function isDestroyed(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!!(r.destroyed||r[d]||a!==null&&a!==undefined&&a.destroyed)}function isWritableEnded(r){if(!isWritableNodeStream(r))return null;if(r.writableEnded===true)return true;const i=r._writableState;if(i!==null&&i!==undefined&&i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isWritableFinished(r,i){if(!isWritableNodeStream(r))return null;if(r.writableFinished===true)return true;const s=r._writableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.finished)!=="boolean")return null;return!!(s.finished||i===false&&s.ended===true&&s.length===0)}function isReadableEnded(r){if(!isReadableNodeStream(r))return null;if(r.readableEnded===true)return true;const i=r._readableState;if(!i||i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isReadableFinished(r,i){if(!isReadableNodeStream(r))return null;const s=r._readableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.endEmitted)!=="boolean")return null;return!!(s.endEmitted||i===false&&s.ended===true&&s.length===0)}function isReadable(r){if(r&&r[u]!=null)return r[u];if(typeof(r===null||r===undefined?undefined:r.readable)!=="boolean")return null;if(isDestroyed(r))return false;return isReadableNodeStream(r)&&r.readable&&!isReadableFinished(r)}function isWritable(r){if(r&&r[A]!=null)return r[A];if(typeof(r===null||r===undefined?undefined:r.writable)!=="boolean")return null;if(isDestroyed(r))return false;return isWritableNodeStream(r)&&r.writable&&!isWritableEnded(r)}function isFinished(r,i){if(!isNodeStream(r)){return null}if(isDestroyed(r)){return true}if((i===null||i===undefined?undefined:i.readable)!==false&&isReadable(r)){return false}if((i===null||i===undefined?undefined:i.writable)!==false&&isWritable(r)){return false}return true}function isWritableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.writableErrored){return r.writableErrored}return(i=(s=r._writableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isReadableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.readableErrored){return r.readableErrored}return(i=(s=r._readableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isClosed(r){if(!isNodeStream(r)){return null}if(typeof r.closed==="boolean"){return r.closed}const i=r._writableState;const s=r._readableState;if(typeof(i===null||i===undefined?undefined:i.closed)==="boolean"||typeof(s===null||s===undefined?undefined:s.closed)==="boolean"){return(i===null||i===undefined?undefined:i.closed)||(s===null||s===undefined?undefined:s.closed)}if(typeof r._closed==="boolean"&&isOutgoingMessage(r)){return r._closed}return null}function isOutgoingMessage(r){return typeof r._closed==="boolean"&&typeof r._defaultKeepAlive==="boolean"&&typeof r._removedConnection==="boolean"&&typeof r._removedContLen==="boolean"}function isServerResponse(r){return typeof r._sent100==="boolean"&&isOutgoingMessage(r)}function isServerRequest(r){var i;return typeof r._consuming==="boolean"&&typeof r._dumped==="boolean"&&((i=r.req)===null||i===undefined?undefined:i.upgradeOrConnect)===undefined}function willEmitClose(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!a&&isServerResponse(r)||!!(a&&a.autoDestroy&&a.emitClose&&a.closed===false)}function isDisturbed(r){var i;return!!(r&&((i=r[h])!==null&&i!==undefined?i:r.readableDidRead||r.readableAborted))}function isErrored(r){var i,s,a,l,c,d,u,A,h,g;return!!(r&&((i=(s=(a=(l=(c=(d=r[p])!==null&&d!==undefined?d:r.readableErrored)!==null&&c!==undefined?c:r.writableErrored)!==null&&l!==undefined?l:(u=r._readableState)===null||u===undefined?undefined:u.errorEmitted)!==null&&a!==undefined?a:(A=r._writableState)===null||A===undefined?undefined:A.errorEmitted)!==null&&s!==undefined?s:(h=r._readableState)===null||h===undefined?undefined:h.errored)!==null&&i!==undefined?i:(g=r._writableState)===null||g===undefined?undefined:g.errored))}r.exports={isDestroyed:isDestroyed,kIsDestroyed:d,isDisturbed:isDisturbed,kIsDisturbed:h,isErrored:isErrored,kIsErrored:p,isReadable:isReadable,kIsReadable:u,kIsClosedPromise:g,kControllerErrorFunction:y,kIsWritable:A,isClosed:isClosed,isDuplexNodeStream:isDuplexNodeStream,isFinished:isFinished,isIterable:isIterable,isReadableNodeStream:isReadableNodeStream,isReadableStream:isReadableStream,isReadableEnded:isReadableEnded,isReadableFinished:isReadableFinished,isReadableErrored:isReadableErrored,isNodeStream:isNodeStream,isWebStream:isWebStream,isWritable:isWritable,isWritableNodeStream:isWritableNodeStream,isWritableStream:isWritableStream,isWritableEnded:isWritableEnded,isWritableFinished:isWritableFinished,isWritableErrored:isWritableErrored,isServerRequest:isServerRequest,isServerResponse:isServerResponse,willEmitClose:willEmitClose,isTransformStream:isTransformStream}},39480:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeSlice:l,Error:c,FunctionPrototypeSymbolHasInstance:d,ObjectDefineProperty:p,ObjectDefineProperties:u,ObjectSetPrototypeOf:A,StringPrototypeToLowerCase:h,Symbol:g,SymbolHasInstance:y}=s(95971);r.exports=Writable;Writable.WritableState=WritableState;const{EventEmitter:b}=s(82361);const w=s(88763).Stream;const{Buffer:C}=s(14300);const v=s(36702);const{addAbortSignal:I}=s(39917);const{getHighWaterMark:B,getDefaultHighWaterMark:S}=s(66208);const{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_MULTIPLE_CALLBACK:Q,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:k,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:P}=s(46254).codes;const{errorOrDestroy:O}=v;A(Writable.prototype,w.prototype);A(Writable,w);function nop(){}const L=g("kOnFinished");function WritableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(84953);this.objectMode=!!(r&&r.objectMode);if(a)this.objectMode=this.objectMode||!!(r&&r.writableObjectMode);this.highWaterMark=r?B(this,r,"writableHighWaterMark",a):S(false);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;const l=!!(r&&r.decodeStrings===false);this.decodeStrings=!l;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=onwrite.bind(undefined,i);this.writecb=null;this.writelen=0;this.afterWriteTickInfo=null;resetBuffer(this);this.pendingcb=0;this.constructed=true;this.prefinished=false;this.errorEmitted=false;this.emitClose=!r||r.emitClose!==false;this.autoDestroy=!r||r.autoDestroy!==false;this.errored=null;this.closed=false;this.closeEmitted=false;this[L]=[]}function resetBuffer(r){r.buffered=[];r.bufferedIndex=0;r.allBuffers=true;r.allNoop=true}WritableState.prototype.getBuffer=function getBuffer(){return l(this.buffered,this.bufferedIndex)};p(WritableState.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Writable(r){const i=this instanceof s(84953);if(!i&&!d(Writable,this))return new Writable(r);this._writableState=new WritableState(r,this,i);if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal)I(r.signal,this)}w.call(this,r);v.construct(this,(()=>{const r=this._writableState;if(!r.writing){clearBuffer(this,r)}finishMaybe(this,r)}))}p(Writable,y,{__proto__:null,value:function(r){if(d(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}});Writable.prototype.pipe=function(){O(this,new _)};function _write(r,i,s,l){const c=r._writableState;if(typeof s==="function"){l=s;s=c.defaultEncoding}else{if(!s)s=c.defaultEncoding;else if(s!=="buffer"&&!C.isEncoding(s))throw new P(s);if(typeof l!=="function")l=nop}if(i===null){throw new k}else if(!c.objectMode){if(typeof i==="string"){if(c.decodeStrings!==false){i=C.from(i,s);s="buffer"}}else if(i instanceof C){s="buffer"}else if(w._isUint8Array(i)){i=w._uint8ArrayToBuffer(i);s="buffer"}else{throw new x("chunk",["string","Buffer","Uint8Array"],i)}}let d;if(c.ending){d=new D}else if(c.destroyed){d=new N("write")}if(d){a.nextTick(l,d);O(r,d,true);return d}c.pendingcb++;return writeOrBuffer(r,c,i,s,l)}Writable.prototype.write=function(r,i,s){return _write(this,r,i,s)===true};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){const r=this._writableState;if(r.corked){r.corked--;if(!r.writing)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=h(r);if(!C.isEncoding(r))throw new P(r);this._writableState.defaultEncoding=r;return this};function writeOrBuffer(r,i,s,a,l){const c=i.objectMode?1:s.length;i.length+=c;const d=i.lengths.bufferedIndex){clearBuffer(r,s)}if(l){if(s.afterWriteTickInfo!==null&&s.afterWriteTickInfo.cb===c){s.afterWriteTickInfo.count++}else{s.afterWriteTickInfo={count:1,cb:c,stream:r,state:s};a.nextTick(afterWriteTick,s.afterWriteTickInfo)}}else{afterWrite(r,s,1,c)}}}function afterWriteTick({stream:r,state:i,count:s,cb:a}){i.afterWriteTickInfo=null;return afterWrite(r,i,s,a)}function afterWrite(r,i,s,a){const l=!i.ending&&!r.destroyed&&i.length===0&&i.needDrain;if(l){i.needDrain=false;r.emit("drain")}while(s-- >0){i.pendingcb--;a()}if(i.destroyed){errorBuffer(i)}finishMaybe(r,i)}function errorBuffer(r){if(r.writing){return}for(let s=r.bufferedIndex;s1&&r._writev){i.pendingcb-=d-1;const a=i.allNoop?nop:r=>{for(let i=p;i256){s.splice(0,p);i.bufferedIndex=0}else{i.bufferedIndex=p}}i.bufferProcessing=false}Writable.prototype._write=function(r,i,s){if(this._writev){this._writev([{chunk:r,encoding:i}],s)}else{throw new R("_write()")}};Writable.prototype._writev=null;Writable.prototype.end=function(r,i,s){const l=this._writableState;if(typeof r==="function"){s=r;r=null;i=null}else if(typeof i==="function"){s=i;i=null}let d;if(r!==null&&r!==undefined){const s=_write(this,r,i);if(s instanceof c){d=s}}if(l.corked){l.corked=1;this.uncork()}if(d){}else if(!l.errored&&!l.ending){l.ending=true;finishMaybe(this,l,true);l.ended=true}else if(l.finished){d=new T("end")}else if(l.destroyed){d=new N("end")}if(typeof s==="function"){if(d||l.finished){a.nextTick(s,d)}else{l[L].push(s)}}return this};function needFinish(r){return r.ending&&!r.destroyed&&r.constructed&&r.length===0&&!r.errored&&r.buffered.length===0&&!r.finished&&!r.writing&&!r.errorEmitted&&!r.closeEmitted}function callFinal(r,i){let s=false;function onFinish(l){if(s){O(r,l!==null&&l!==undefined?l:Q());return}s=true;i.pendingcb--;if(l){const s=i[L].splice(0);for(let r=0;r{if(needFinish(i)){finish(r,i)}else{i.pendingcb--}}),r,i)}else if(needFinish(i)){i.pendingcb++;finish(r,i)}}}}function finish(r,i){i.pendingcb--;i.finished=true;const s=i[L].splice(0);for(let r=0;r{"use strict";const{ArrayIsArray:a,ArrayPrototypeIncludes:l,ArrayPrototypeJoin:c,ArrayPrototypeMap:d,NumberIsInteger:p,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:A,NumberMIN_SAFE_INTEGER:h,NumberParseInt:g,ObjectPrototypeHasOwnProperty:y,RegExpPrototypeExec:b,String:w,StringPrototypeToUpperCase:C,StringPrototypeTrim:v}=s(95971);const{hideStackFrames:I,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:S,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:R,ERR_UNKNOWN_SIGNAL:Q}}=s(46254);const{normalizeEncoding:_}=s(58472);const{isAsyncFunction:N,isArrayBufferView:T}=s(58472).types;const k={};function isInt32(r){return r===(r|0)}function isUint32(r){return r===r>>>0}const D=/^[0-7]+$/;const P="must be a 32-bit unsigned integer or an octal string";function parseFileMode(r,i,s){if(typeof r==="undefined"){r=s}if(typeof r==="string"){if(b(D,r)===null){throw new x(i,r,P)}r=g(r,8)}M(r,i);return r}const O=I(((r,i,s=h,a=A)=>{if(typeof r!=="number")throw new S(i,"number",r);if(!p(r))throw new R(i,"an integer",r);if(ra)throw new R(i,`>= ${s} && <= ${a}`,r)}));const L=I(((r,i,s=-2147483648,a=2147483647)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}if(ra){throw new R(i,`>= ${s} && <= ${a}`,r)}}));const M=I(((r,i,s=false)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}const a=s?1:0;const l=4294967295;if(rl){throw new R(i,`>= ${a} && <= ${l}`,r)}}));function validateString(r,i){if(typeof r!=="string")throw new S(i,"string",r)}function validateNumber(r,i,s=undefined,a){if(typeof r!=="number")throw new S(i,"number",r);if(s!=null&&ra||(s!=null||a!=null)&&u(r)){throw new R(i,`${s!=null?`>= ${s}`:""}${s!=null&&a!=null?" && ":""}${a!=null?`<= ${a}`:""}`,r)}}const U=I(((r,i,s)=>{if(!l(s,r)){const a=c(d(s,(r=>typeof r==="string"?`'${r}'`:w(r))),", ");const l="must be one of: "+a;throw new x(i,r,l)}}));function validateBoolean(r,i){if(typeof r!=="boolean")throw new S(i,"boolean",r)}function getOwnPropertyValueOrDefault(r,i,s){return r==null||!y(r,i)?s:r[i]}const j=I(((r,i,s=null)=>{const l=getOwnPropertyValueOrDefault(s,"allowArray",false);const c=getOwnPropertyValueOrDefault(s,"allowFunction",false);const d=getOwnPropertyValueOrDefault(s,"nullable",false);if(!d&&r===null||!l&&a(r)||typeof r!=="object"&&(!c||typeof r!=="function")){throw new S(i,"Object",r)}}));const H=I(((r,i)=>{if(r!=null&&typeof r!=="object"&&typeof r!=="function"){throw new S(i,"a dictionary",r)}}));const q=I(((r,i,s=0)=>{if(!a(r)){throw new S(i,"Array",r)}if(r.length{if(!T(r)){throw new S(i,["Buffer","TypedArray","DataView"],r)}}));function validateEncoding(r,i){const s=_(i);const a=r.length;if(s==="hex"&&a%2!==0){throw new x("encoding",i,`is invalid for data of length ${a}`)}}function validatePort(r,i="Port",s=true){if(typeof r!=="number"&&typeof r!=="string"||typeof r==="string"&&v(r).length===0||+r!==+r>>>0||r>65535||r===0&&!s){throw new B(i,r,s)}return r|0}const z=I(((r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new S(i,"AbortSignal",r)}}));const V=I(((r,i)=>{if(typeof r!=="function")throw new S(i,"Function",r)}));const W=I(((r,i)=>{if(typeof r!=="function"||N(r))throw new S(i,"Function",r)}));const Y=I(((r,i)=>{if(r!==undefined)throw new S(i,"undefined",r)}));function validateUnion(r,i,s){if(!l(s,r)){throw new S(i,`('${c(s,"|")}')`,r)}}const J=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function validateLinkHeaderFormat(r,i){if(typeof r==="undefined"||!b(J,r)){throw new x(i,r,'must be an array or string of format "; rel=preload; as=style"')}}function validateLinkHeaderValue(r){if(typeof r==="string"){validateLinkHeaderFormat(r,"hints");return r}else if(a(r)){const i=r.length;let s="";if(i===0){return s}for(let a=0;a; rel=preload; as=style"')}r.exports={isInt32:isInt32,isUint32:isUint32,parseFileMode:parseFileMode,validateArray:q,validateStringArray:validateStringArray,validateBooleanArray:validateBooleanArray,validateAbortSignalArray:validateAbortSignalArray,validateBoolean:validateBoolean,validateBuffer:G,validateDictionary:H,validateEncoding:validateEncoding,validateFunction:V,validateInt32:L,validateInteger:O,validateNumber:validateNumber,validateObject:j,validateOneOf:U,validatePlainFunction:W,validatePort:validatePort,validateSignalName:validateSignalName,validateString:validateString,validateUint32:M,validateUndefined:Y,validateUnion:validateUnion,validateAbortSignal:z,validateLinkHeaderValue:validateLinkHeaderValue}},46254:(r,i,s)=>{"use strict";const{format:a,inspect:l,AggregateError:c}=s(58472);const d=globalThis.AggregateError||c;const p=Symbol("kIsNodeError");const u=["string","function","number","object","Function","Object","boolean","bigint","symbol"];const A=/^([A-Z][a-z0-9]*)+$/;const h="__node_internal_";const g={};function assert(r,i){if(!r){throw new g.ERR_INTERNAL_ASSERTION(i)}}function addNumericalSeparator(r){let i="";let s=r.length;const a=r[0]==="-"?1:0;for(;s>=a+4;s-=3){i=`_${r.slice(s-3,s)}${i}`}return`${r.slice(0,s)}${i}`}function getMessage(r,i,s){if(typeof i==="function"){assert(i.length<=s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${i.length}).`);return i(...s)}const l=(i.match(/%[dfijoOs]/g)||[]).length;assert(l===s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${l}).`);if(s.length===0){return i}return a(i,...s)}function E(r,i,s){if(!s){s=Error}class NodeError extends s{constructor(...s){super(getMessage(r,i,s))}toString(){return`${this.name} [${r}]: ${this.message}`}}Object.defineProperties(NodeError.prototype,{name:{value:s.name,writable:true,enumerable:false,configurable:true},toString:{value(){return`${this.name} [${r}]: ${this.message}`},writable:true,enumerable:false,configurable:true}});NodeError.prototype.code=r;NodeError.prototype[p]=true;g[r]=NodeError}function hideStackFrames(r){const i=h+r.name;Object.defineProperty(r,"name",{value:i});return r}function aggregateTwoErrors(r,i){if(r&&i&&r!==i){if(Array.isArray(i.errors)){i.errors.push(r);return i}const s=new d([i,r],i.message);s.code=i.code;return s}return r||i}class AbortError extends Error{constructor(r="The operation was aborted",i=undefined){if(i!==undefined&&typeof i!=="object"){throw new g.ERR_INVALID_ARG_TYPE("options","Object",i)}super(r,i);this.code="ABORT_ERR";this.name="AbortError"}}E("ERR_ASSERTION","%s",Error);E("ERR_INVALID_ARG_TYPE",((r,i,s)=>{assert(typeof r==="string","'name' must be a string");if(!Array.isArray(i)){i=[i]}let a="The ";if(r.endsWith(" argument")){a+=`${r} `}else{a+=`"${r}" ${r.includes(".")?"property":"argument"} `}a+="must be ";const c=[];const d=[];const p=[];for(const r of i){assert(typeof r==="string","All expected entries have to be of type string");if(u.includes(r)){c.push(r.toLowerCase())}else if(A.test(r)){d.push(r)}else{assert(r!=="object",'The value "object" should be written as "Object"');p.push(r)}}if(d.length>0){const r=c.indexOf("object");if(r!==-1){c.splice(c,r,1);d.push("Object")}}if(c.length>0){switch(c.length){case 1:a+=`of type ${c[0]}`;break;case 2:a+=`one of type ${c[0]} or ${c[1]}`;break;default:{const r=c.pop();a+=`one of type ${c.join(", ")}, or ${r}`}}if(d.length>0||p.length>0){a+=" or "}}if(d.length>0){switch(d.length){case 1:a+=`an instance of ${d[0]}`;break;case 2:a+=`an instance of ${d[0]} or ${d[1]}`;break;default:{const r=d.pop();a+=`an instance of ${d.join(", ")}, or ${r}`}}if(p.length>0){a+=" or "}}switch(p.length){case 0:break;case 1:if(p[0].toLowerCase()!==p[0]){a+="an "}a+=`${p[0]}`;break;case 2:a+=`one of ${p[0]} or ${p[1]}`;break;default:{const r=p.pop();a+=`one of ${p.join(", ")}, or ${r}`}}if(s==null){a+=`. Received ${s}`}else if(typeof s==="function"&&s.name){a+=`. Received function ${s.name}`}else if(typeof s==="object"){var h;if((h=s.constructor)!==null&&h!==undefined&&h.name){a+=`. Received an instance of ${s.constructor.name}`}else{const r=l(s,{depth:-1});a+=`. Received ${r}`}}else{let r=l(s,{colors:false});if(r.length>25){r=`${r.slice(0,25)}...`}a+=`. Received type ${typeof s} (${r})`}return a}),TypeError);E("ERR_INVALID_ARG_VALUE",((r,i,s="is invalid")=>{let a=l(i);if(a.length>128){a=a.slice(0,128)+"..."}const c=r.includes(".")?"property":"argument";return`The ${c} '${r}' ${s}. Received ${a}`}),TypeError);E("ERR_INVALID_RETURN_VALUE",((r,i,s)=>{var a;const l=s!==null&&s!==undefined&&(a=s.constructor)!==null&&a!==undefined&&a.name?`instance of ${s.constructor.name}`:`type ${typeof s}`;return`Expected ${r} to be returned from the "${i}"`+` function but got ${l}.`}),TypeError);E("ERR_MISSING_ARGS",((...r)=>{assert(r.length>0,"At least one arg needs to be specified");let i;const s=r.length;r=(Array.isArray(r)?r:[r]).map((r=>`"${r}"`)).join(" or ");switch(s){case 1:i+=`The ${r[0]} argument`;break;case 2:i+=`The ${r[0]} and ${r[1]} arguments`;break;default:{const s=r.pop();i+=`The ${r.join(", ")}, and ${s} arguments`}break}return`${i} must be specified`}),TypeError);E("ERR_OUT_OF_RANGE",((r,i,s)=>{assert(i,'Missing "range" argument');let a;if(Number.isInteger(s)&&Math.abs(s)>2**32){a=addNumericalSeparator(String(s))}else if(typeof s==="bigint"){a=String(s);if(s>2n**32n||s<-(2n**32n)){a=addNumericalSeparator(a)}a+="n"}else{a=l(s)}return`The value of "${r}" is out of range. It must be ${i}. Received ${a}`}),RangeError);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);E("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);E("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);E("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);E("ERR_STREAM_WRITE_AFTER_END","write after end",Error);E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);r.exports={AbortError:AbortError,aggregateTwoErrors:hideStackFrames(aggregateTwoErrors),hideStackFrames:hideStackFrames,codes:g}},94403:(r,i,s)=>{"use strict";const a=s(12781);if(a&&process.env.READABLE_STREAM==="disable"){const i=a.promises;r.exports._uint8ArrayToBuffer=a._uint8ArrayToBuffer;r.exports._isUint8Array=a._isUint8Array;r.exports.isDisturbed=a.isDisturbed;r.exports.isErrored=a.isErrored;r.exports.isReadable=a.isReadable;r.exports.Readable=a.Readable;r.exports.Writable=a.Writable;r.exports.Duplex=a.Duplex;r.exports.Transform=a.Transform;r.exports.PassThrough=a.PassThrough;r.exports.addAbortSignal=a.addAbortSignal;r.exports.finished=a.finished;r.exports.destroy=a.destroy;r.exports.pipeline=a.pipeline;r.exports.compose=a.compose;Object.defineProperty(a,"promises",{configurable:true,enumerable:true,get(){return i}});r.exports.Stream=a.Stream}else{const i=s(94047);const a=s(37678);const l=i.Readable.destroy;r.exports=i.Readable;r.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer;r.exports._isUint8Array=i._isUint8Array;r.exports.isDisturbed=i.isDisturbed;r.exports.isErrored=i.isErrored;r.exports.isReadable=i.isReadable;r.exports.Readable=i.Readable;r.exports.Writable=i.Writable;r.exports.Duplex=i.Duplex;r.exports.Transform=i.Transform;r.exports.PassThrough=i.PassThrough;r.exports.addAbortSignal=i.addAbortSignal;r.exports.finished=i.finished;r.exports.destroy=i.destroy;r.exports.destroy=l;r.exports.pipeline=i.pipeline;r.exports.compose=i.compose;Object.defineProperty(i,"promises",{configurable:true,enumerable:true,get(){return a}});r.exports.Stream=i.Stream}r.exports["default"]=r.exports},95971:r=>{"use strict";r.exports={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,i){return r.includes(i)},ArrayPrototypeIndexOf(r,i){return r.indexOf(i)},ArrayPrototypeJoin(r,i){return r.join(i)},ArrayPrototypeMap(r,i){return r.map(i)},ArrayPrototypePop(r,i){return r.pop(i)},ArrayPrototypePush(r,i){return r.push(i)},ArrayPrototypeSlice(r,i,s){return r.slice(i,s)},Error:Error,FunctionPrototypeCall(r,i,...s){return r.call(i,...s)},FunctionPrototypeSymbolHasInstance(r,i){return Function.prototype[Symbol.hasInstance].call(r,i)},MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,i){return Object.defineProperties(r,i)},ObjectDefineProperty(r,i,s){return Object.defineProperty(r,i,s)},ObjectGetOwnPropertyDescriptor(r,i){return Object.getOwnPropertyDescriptor(r,i)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,i){return Object.setPrototypeOf(r,i)},Promise:Promise,PromisePrototypeCatch(r,i){return r.catch(i)},PromisePrototypeThen(r,i,s){return r.then(i,s)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,i){return r.test(i)},SafeSet:Set,String:String,StringPrototypeSlice(r,i,s){return r.slice(i,s)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,i,s){return r.set(i,s)},Boolean:Boolean,Uint8Array:Uint8Array}},58472:(r,i,s)=>{"use strict";const a=s(14300);const{kResistStopPropagation:l,SymbolDispose:c}=s(95971);const d=globalThis.AbortSignal||s(24995).AbortSignal;const p=globalThis.AbortController||s(24995).AbortController;const u=Object.getPrototypeOf((async function(){})).constructor;const A=globalThis.Blob||a.Blob;const h=typeof A!=="undefined"?function isBlob(r){return r instanceof A}:function isBlob(r){return false};const validateAbortSignal=(r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new ERR_INVALID_ARG_TYPE(i,"AbortSignal",r)}};const validateFunction=(r,i)=>{if(typeof r!=="function")throw new ERR_INVALID_ARG_TYPE(i,"Function",r)};class AggregateError extends Error{constructor(r){if(!Array.isArray(r)){throw new TypeError(`Expected input to be an Array, got ${typeof r}`)}let i="";for(let s=0;s{r=s;i=a}));return{promise:s,resolve:r,reject:i}},promisify(r){return new Promise(((i,s)=>{r(((r,...a)=>{if(r){return s(r)}return i(...a)}))}))},debuglog(){return function(){}},format(r,...i){return r.replace(/%([sdifj])/g,(function(...[r,s]){const a=i.shift();if(s==="f"){return a.toFixed(6)}else if(s==="j"){return JSON.stringify(a)}else if(s==="s"&&typeof a==="object"){const r=a.constructor!==Object?a.constructor.name:"";return`${r} {}`.trim()}else{return a.toString()}}))},inspect(r){switch(typeof r){case"string":if(r.includes("'")){if(!r.includes('"')){return`"${r}"`}else if(!r.includes("`")&&!r.includes("${")){return`\`${r}\``}}return`'${r}'`;case"number":if(isNaN(r)){return"NaN"}else if(Object.is(r,-0)){return String(r)}return r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}},types:{isAsyncFunction(r){return r instanceof u},isArrayBufferView(r){return ArrayBuffer.isView(r)}},isBlob:h,deprecate(r,i){return r},addAbortListener:s(82361).addAbortListener||function addAbortListener(r,i){if(r===undefined){throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",r)}validateAbortSignal(r,"signal");validateFunction(i,"listener");let s;if(r.aborted){queueMicrotask((()=>i()))}else{r.addEventListener("abort",i,{__proto__:null,once:true,[l]:true});s=()=>{r.removeEventListener("abort",i)}}return{__proto__:null,[c](){var r;(r=s)===null||r===undefined?undefined:r()}}},AbortSignalAny:d.any||function AbortSignalAny(r){if(r.length===1){return r[0]}const i=new p;const abort=()=>i.abort();r.forEach((r=>{validateAbortSignal(r,"signals");r.addEventListener("abort",abort,{once:true})}));i.signal.addEventListener("abort",(()=>{r.forEach((r=>r.removeEventListener("abort",abort)))}),{once:true});return i.signal}};r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},94047:(r,i,s)=>{const{Buffer:a}=s(14300);"use strict";const{ObjectDefineProperty:l,ObjectKeys:c,ReflectApply:d}=s(95971);const{promisify:{custom:p}}=s(58472);const{streamReturningOperators:u,promiseReturningOperators:A}=s(33815);const{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=s(46254);const g=s(85994);const{setDefaultHighWaterMark:y,getDefaultHighWaterMark:b}=s(66208);const{pipeline:w}=s(75338);const{destroyer:C}=s(36702);const v=s(61701);const I={};const B=s(37678);const S=s(13300);const x=r.exports=s(88763).Stream;x.isDestroyed=S.isDestroyed;x.isDisturbed=S.isDisturbed;x.isErrored=S.isErrored;x.isReadable=S.isReadable;x.isWritable=S.isWritable;x.Readable=s(68524);for(const Q of c(u)){const _=u[Q];function fn(...r){if(new.target){throw h()}return x.Readable.from(d(_,this,r))}l(fn,"name",{__proto__:null,value:_.name});l(fn,"length",{__proto__:null,value:_.length});l(x.Readable.prototype,Q,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}for(const N of c(A)){const T=A[N];function fn(...r){if(new.target){throw h()}return d(T,this,r)}l(fn,"name",{__proto__:null,value:T.name});l(fn,"length",{__proto__:null,value:T.length});l(x.Readable.prototype,N,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}x.Writable=s(39480);x.Duplex=s(84953);x.Transform=s(57084);x.PassThrough=s(60321);x.pipeline=w;const{addAbortSignal:R}=s(39917);x.addAbortSignal=R;x.finished=v;x.destroy=C;x.compose=g;x.setDefaultHighWaterMark=y;x.getDefaultHighWaterMark=b;l(x,"promises",{__proto__:null,configurable:true,enumerable:true,get(){return B}});l(w,p,{__proto__:null,enumerable:true,get(){return B.pipeline}});l(v,p,{__proto__:null,enumerable:true,get(){return B.finished}});x.Stream=x;x._isUint8Array=function isUint8Array(r){return r instanceof Uint8Array};x._uint8ArrayToBuffer=function _uint8ArrayToBuffer(r){return a.from(r.buffer,r.byteOffset,r.byteLength)}},37678:(r,i,s)=>{"use strict";const{ArrayPrototypePop:a,Promise:l}=s(95971);const{isIterable:c,isNodeStream:d,isWebStream:p}=s(13300);const{pipelineImpl:u}=s(75338);const{finished:A}=s(61701);s(94047);function pipeline(...r){return new l(((i,s)=>{let l;let A;const h=r[r.length-1];if(h&&typeof h==="object"&&!d(h)&&!c(h)&&!p(h)){const i=a(r);l=i.signal;A=i.end}u(r,((r,a)=>{if(r){s(r)}else{i(a)}}),{signal:l,end:A})}))}r.exports={finished:A,pipeline:pipeline}},15387:(r,i,s)=>{ /** * Archiver Vending * @@ -6,7 +6,7 @@ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var s=a(53429);var l={};var vending=function(r,i){return vending.create(r,i)};vending.create=function(r,i){if(l[r]){var a=new s(r,i);a.setFormat(r);a.setModule(new l[r](i));return a}else{throw new Error("create("+r+"): format not registered")}};vending.registerFormat=function(r,i){if(l[r]){throw new Error("register("+r+"): format already registered")}if(typeof i!=="function"){throw new Error("register("+r+"): format module invalid")}if(typeof i.prototype.append!=="function"||typeof i.prototype.finalize!=="function"){throw new Error("register("+r+"): format module missing methods")}l[r]=i};vending.isRegisteredFormat=function(r){if(l[r]){return true}return false};vending.registerFormat("zip",a(17012));vending.registerFormat("tar",a(30030));vending.registerFormat("json",a(85559));r.exports=vending},53429:(r,i,a)=>{ +var a=s(53429);var l={};var vending=function(r,i){return vending.create(r,i)};vending.create=function(r,i){if(l[r]){var s=new a(r,i);s.setFormat(r);s.setModule(new l[r](i));return s}else{throw new Error("create("+r+"): format not registered")}};vending.registerFormat=function(r,i){if(l[r]){throw new Error("register("+r+"): format already registered")}if(typeof i!=="function"){throw new Error("register("+r+"): format module invalid")}if(typeof i.prototype.append!=="function"||typeof i.prototype.finalize!=="function"){throw new Error("register("+r+"): format module missing methods")}l[r]=i};vending.isRegisteredFormat=function(r){if(l[r]){return true}return false};vending.registerFormat("zip",s(17012));vending.registerFormat("tar",s(30030));vending.registerFormat("json",s(85559));r.exports=vending},53429:(r,i,s)=>{ /** * Archiver Core * @@ -14,7 +14,7 @@ var s=a(53429);var l={};var vending=function(r,i){return vending.create(r,i)};ve * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var s=a(57147);var l=a(48059);var c=a(47466);var p=a(71017);var d=a(78443);var u=a(73837).inherits;var A=a(67090);var h=a(19173).Transform;var g=process.platform==="win32";var Archiver=function(r,i){if(!(this instanceof Archiver)){return new Archiver(r,i)}if(typeof r!=="string"){i=r;r="zip"}i=this.options=d.defaults(i,{highWaterMark:1024*1024,statConcurrency:4});h.call(this,i);this._format=false;this._module=false;this._pending=0;this._pointer=0;this._entriesCount=0;this._entriesProcessedCount=0;this._fsEntriesTotalBytes=0;this._fsEntriesProcessedBytes=0;this._queue=c.queue(this._onQueueTask.bind(this),1);this._queue.drain(this._onQueueDrain.bind(this));this._statQueue=c.queue(this._onStatQueueTask.bind(this),i.statConcurrency);this._statQueue.drain(this._onQueueDrain.bind(this));this._state={aborted:false,finalize:false,finalizing:false,finalized:false,modulePiped:false};this._streams=[]};u(Archiver,h);Archiver.prototype._abort=function(){this._state.aborted=true;this._queue.kill();this._statQueue.kill();if(this._queue.idle()){this._shutdown()}};Archiver.prototype._append=function(r,i){i=i||{};var a={source:null,filepath:r};if(!i.name){i.name=r}i.sourcePath=r;a.data=i;this._entriesCount++;if(i.stats&&i.stats instanceof s.Stats){a=this._updateQueueTaskWithStats(a,i.stats);if(a){if(i.stats.size){this._fsEntriesTotalBytes+=i.stats.size}this._queue.push(a)}}else{this._statQueue.push(a)}};Archiver.prototype._finalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}this._state.finalizing=true;this._moduleFinalize();this._state.finalizing=false;this._state.finalized=true};Archiver.prototype._maybeFinalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return false}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize();return true}return false};Archiver.prototype._moduleAppend=function(r,i,a){if(this._state.aborted){a();return}this._module.append(r,i,function(r){this._task=null;if(this._state.aborted){this._shutdown();return}if(r){this.emit("error",r);setImmediate(a);return}this.emit("entry",i);this._entriesProcessedCount++;if(i.stats&&i.stats.size){this._fsEntriesProcessedBytes+=i.stats.size}this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}});setImmediate(a)}.bind(this))};Archiver.prototype._moduleFinalize=function(){if(typeof this._module.finalize==="function"){this._module.finalize()}else if(typeof this._module.end==="function"){this._module.end()}else{this.emit("error",new A("NOENDMETHOD"))}};Archiver.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this));this._module.pipe(this);this._state.modulePiped=true};Archiver.prototype._moduleSupports=function(r){if(!this._module.supports||!this._module.supports[r]){return false}return this._module.supports[r]};Archiver.prototype._moduleUnpipe=function(){this._module.unpipe(this);this._state.modulePiped=false};Archiver.prototype._normalizeEntryData=function(r,i){r=d.defaults(r,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:false});if(i&&r.stats===false){r.stats=i}var a=r.type==="directory";if(r.name){if(typeof r.prefix==="string"&&""!==r.prefix){r.name=r.prefix+"/"+r.name;r.prefix=null}r.name=d.sanitizePath(r.name);if(r.type!=="symlink"&&r.name.slice(-1)==="/"){a=true;r.type="directory"}else if(a){r.name+="/"}}if(typeof r.mode==="number"){if(g){r.mode&=511}else{r.mode&=4095}}else if(r.stats&&r.mode===null){if(g){r.mode=r.stats.mode&511}else{r.mode=r.stats.mode&4095}if(g&&a){r.mode=493}}else if(r.mode===null){r.mode=a?493:420}if(r.stats&&r.date===null){r.date=r.stats.mtime}else{r.date=d.dateify(r.date)}return r};Archiver.prototype._onModuleError=function(r){this.emit("error",r)};Archiver.prototype._onQueueDrain=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}};Archiver.prototype._onQueueTask=function(r,i){var fullCallback=()=>{if(r.data.callback){r.data.callback()}i()};if(this._state.finalizing||this._state.finalized||this._state.aborted){fullCallback();return}this._task=r;this._moduleAppend(r.source,r.data,fullCallback)};Archiver.prototype._onStatQueueTask=function(r,i){if(this._state.finalizing||this._state.finalized||this._state.aborted){i();return}s.lstat(r.filepath,function(a,s){if(this._state.aborted){setImmediate(i);return}if(a){this._entriesCount--;this.emit("warning",a);setImmediate(i);return}r=this._updateQueueTaskWithStats(r,s);if(r){if(s.size){this._fsEntriesTotalBytes+=s.size}this._queue.push(r)}setImmediate(i)}.bind(this))};Archiver.prototype._shutdown=function(){this._moduleUnpipe();this.end()};Archiver.prototype._transform=function(r,i,a){if(r){this._pointer+=r.length}a(null,r)};Archiver.prototype._updateQueueTaskWithStats=function(r,i){if(i.isFile()){r.data.type="file";r.data.sourceType="stream";r.source=d.lazyReadStream(r.filepath)}else if(i.isDirectory()&&this._moduleSupports("directory")){r.data.name=d.trailingSlashIt(r.data.name);r.data.type="directory";r.data.sourcePath=d.trailingSlashIt(r.filepath);r.data.sourceType="buffer";r.source=Buffer.concat([])}else if(i.isSymbolicLink()&&this._moduleSupports("symlink")){var a=s.readlinkSync(r.filepath);var l=p.dirname(r.filepath);r.data.type="symlink";r.data.linkname=p.relative(l,p.resolve(l,a));r.data.sourceType="buffer";r.source=Buffer.concat([])}else{if(i.isDirectory()){this.emit("warning",new A("DIRECTORYNOTSUPPORTED",r.data))}else if(i.isSymbolicLink()){this.emit("warning",new A("SYMLINKNOTSUPPORTED",r.data))}else{this.emit("warning",new A("ENTRYNOTSUPPORTED",r.data))}return null}r.data=this._normalizeEntryData(r.data,i);return r};Archiver.prototype.abort=function(){if(this._state.aborted||this._state.finalized){return this}this._abort();return this};Archiver.prototype.append=function(r,i){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}i=this._normalizeEntryData(i);if(typeof i.name!=="string"||i.name.length===0){this.emit("error",new A("ENTRYNAMEREQUIRED"));return this}if(i.type==="directory"&&!this._moduleSupports("directory")){this.emit("error",new A("DIRECTORYNOTSUPPORTED",{name:i.name}));return this}r=d.normalizeInputSource(r);if(Buffer.isBuffer(r)){i.sourceType="buffer"}else if(d.isStream(r)){i.sourceType="stream"}else{this.emit("error",new A("INPUTSTEAMBUFFERREQUIRED",{name:i.name}));return this}this._entriesCount++;this._queue.push({data:i,source:r});return this};Archiver.prototype.directory=function(r,i,a){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new A("DIRECTORYDIRPATHREQUIRED"));return this}this._pending++;if(i===false){i=""}else if(typeof i!=="string"){i=r}var s=false;if(typeof a==="function"){s=a;a={}}else if(typeof a!=="object"){a={}}var c={stat:true,dot:true};function onGlobEnd(){this._pending--;this._maybeFinalize()}function onGlobError(r){this.emit("error",r)}function onGlobMatch(l){p.pause();var c=false;var d=Object.assign({},a);d.name=l.relative;d.prefix=i;d.stats=l.stat;d.callback=p.resume.bind(p);try{if(s){d=s(d);if(d===false){c=true}else if(typeof d!=="object"){throw new A("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:r})}}}catch(r){this.emit("error",r);return}if(c){p.resume();return}this._append(l.absolute,d)}var p=l(r,c);p.on("error",onGlobError.bind(this));p.on("match",onGlobMatch.bind(this));p.on("end",onGlobEnd.bind(this));return this};Archiver.prototype.file=function(r,i){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new A("FILEFILEPATHREQUIRED"));return this}this._append(r,i);return this};Archiver.prototype.glob=function(r,i,a){this._pending++;i=d.defaults(i,{stat:true,pattern:r});function onGlobEnd(){this._pending--;this._maybeFinalize()}function onGlobError(r){this.emit("error",r)}function onGlobMatch(r){s.pause();var i=Object.assign({},a);i.callback=s.resume.bind(s);i.stats=r.stat;i.name=r.relative;this._append(r.absolute,i)}var s=l(i.cwd||".",i);s.on("error",onGlobError.bind(this));s.on("match",onGlobMatch.bind(this));s.on("end",onGlobEnd.bind(this));return this};Archiver.prototype.finalize=function(){if(this._state.aborted){var r=new A("ABORTED");this.emit("error",r);return Promise.reject(r)}if(this._state.finalize){var i=new A("FINALIZING");this.emit("error",i);return Promise.reject(i)}this._state.finalize=true;if(this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}var a=this;return new Promise((function(r,i){var s;a._module.on("end",(function(){if(!s){r()}}));a._module.on("error",(function(r){s=true;i(r)}))}))};Archiver.prototype.setFormat=function(r){if(this._format){this.emit("error",new A("FORMATSET"));return this}this._format=r;return this};Archiver.prototype.setModule=function(r){if(this._state.aborted){this.emit("error",new A("ABORTED"));return this}if(this._state.module){this.emit("error",new A("MODULESET"));return this}this._module=r;this._modulePipe();return this};Archiver.prototype.symlink=function(r,i,a){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new A("SYMLINKFILEPATHREQUIRED"));return this}if(typeof i!=="string"||i.length===0){this.emit("error",new A("SYMLINKTARGETREQUIRED",{filepath:r}));return this}if(!this._moduleSupports("symlink")){this.emit("error",new A("SYMLINKNOTSUPPORTED",{filepath:r}));return this}var s={};s.type="symlink";s.name=r.replace(/\\/g,"/");s.linkname=i.replace(/\\/g,"/");s.sourceType="buffer";if(typeof a==="number"){s.mode=a}this._entriesCount++;this._queue.push({data:s,source:Buffer.concat([])});return this};Archiver.prototype.pointer=function(){return this._pointer};Archiver.prototype.use=function(r){this._streams.push(r);return this};r.exports=Archiver},67090:(r,i,a)=>{ +var a=s(57147);var l=s(48059);var c=s(47466);var d=s(71017);var p=s(78443);var u=s(73837).inherits;var A=s(67090);var h=s(91650).Transform;var g=process.platform==="win32";var Archiver=function(r,i){if(!(this instanceof Archiver)){return new Archiver(r,i)}if(typeof r!=="string"){i=r;r="zip"}i=this.options=p.defaults(i,{highWaterMark:1024*1024,statConcurrency:4});h.call(this,i);this._format=false;this._module=false;this._pending=0;this._pointer=0;this._entriesCount=0;this._entriesProcessedCount=0;this._fsEntriesTotalBytes=0;this._fsEntriesProcessedBytes=0;this._queue=c.queue(this._onQueueTask.bind(this),1);this._queue.drain(this._onQueueDrain.bind(this));this._statQueue=c.queue(this._onStatQueueTask.bind(this),i.statConcurrency);this._statQueue.drain(this._onQueueDrain.bind(this));this._state={aborted:false,finalize:false,finalizing:false,finalized:false,modulePiped:false};this._streams=[]};u(Archiver,h);Archiver.prototype._abort=function(){this._state.aborted=true;this._queue.kill();this._statQueue.kill();if(this._queue.idle()){this._shutdown()}};Archiver.prototype._append=function(r,i){i=i||{};var s={source:null,filepath:r};if(!i.name){i.name=r}i.sourcePath=r;s.data=i;this._entriesCount++;if(i.stats&&i.stats instanceof a.Stats){s=this._updateQueueTaskWithStats(s,i.stats);if(s){if(i.stats.size){this._fsEntriesTotalBytes+=i.stats.size}this._queue.push(s)}}else{this._statQueue.push(s)}};Archiver.prototype._finalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}this._state.finalizing=true;this._moduleFinalize();this._state.finalizing=false;this._state.finalized=true};Archiver.prototype._maybeFinalize=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return false}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize();return true}return false};Archiver.prototype._moduleAppend=function(r,i,s){if(this._state.aborted){s();return}this._module.append(r,i,function(r){this._task=null;if(this._state.aborted){this._shutdown();return}if(r){this.emit("error",r);setImmediate(s);return}this.emit("entry",i);this._entriesProcessedCount++;if(i.stats&&i.stats.size){this._fsEntriesProcessedBytes+=i.stats.size}this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}});setImmediate(s)}.bind(this))};Archiver.prototype._moduleFinalize=function(){if(typeof this._module.finalize==="function"){this._module.finalize()}else if(typeof this._module.end==="function"){this._module.end()}else{this.emit("error",new A("NOENDMETHOD"))}};Archiver.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this));this._module.pipe(this);this._state.modulePiped=true};Archiver.prototype._moduleSupports=function(r){if(!this._module.supports||!this._module.supports[r]){return false}return this._module.supports[r]};Archiver.prototype._moduleUnpipe=function(){this._module.unpipe(this);this._state.modulePiped=false};Archiver.prototype._normalizeEntryData=function(r,i){r=p.defaults(r,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:false});if(i&&r.stats===false){r.stats=i}var s=r.type==="directory";if(r.name){if(typeof r.prefix==="string"&&""!==r.prefix){r.name=r.prefix+"/"+r.name;r.prefix=null}r.name=p.sanitizePath(r.name);if(r.type!=="symlink"&&r.name.slice(-1)==="/"){s=true;r.type="directory"}else if(s){r.name+="/"}}if(typeof r.mode==="number"){if(g){r.mode&=511}else{r.mode&=4095}}else if(r.stats&&r.mode===null){if(g){r.mode=r.stats.mode&511}else{r.mode=r.stats.mode&4095}if(g&&s){r.mode=493}}else if(r.mode===null){r.mode=s?493:420}if(r.stats&&r.date===null){r.date=r.stats.mtime}else{r.date=p.dateify(r.date)}return r};Archiver.prototype._onModuleError=function(r){this.emit("error",r)};Archiver.prototype._onQueueDrain=function(){if(this._state.finalizing||this._state.finalized||this._state.aborted){return}if(this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}};Archiver.prototype._onQueueTask=function(r,i){var fullCallback=()=>{if(r.data.callback){r.data.callback()}i()};if(this._state.finalizing||this._state.finalized||this._state.aborted){fullCallback();return}this._task=r;this._moduleAppend(r.source,r.data,fullCallback)};Archiver.prototype._onStatQueueTask=function(r,i){if(this._state.finalizing||this._state.finalized||this._state.aborted){i();return}a.lstat(r.filepath,function(s,a){if(this._state.aborted){setImmediate(i);return}if(s){this._entriesCount--;this.emit("warning",s);setImmediate(i);return}r=this._updateQueueTaskWithStats(r,a);if(r){if(a.size){this._fsEntriesTotalBytes+=a.size}this._queue.push(r)}setImmediate(i)}.bind(this))};Archiver.prototype._shutdown=function(){this._moduleUnpipe();this.end()};Archiver.prototype._transform=function(r,i,s){if(r){this._pointer+=r.length}s(null,r)};Archiver.prototype._updateQueueTaskWithStats=function(r,i){if(i.isFile()){r.data.type="file";r.data.sourceType="stream";r.source=p.lazyReadStream(r.filepath)}else if(i.isDirectory()&&this._moduleSupports("directory")){r.data.name=p.trailingSlashIt(r.data.name);r.data.type="directory";r.data.sourcePath=p.trailingSlashIt(r.filepath);r.data.sourceType="buffer";r.source=Buffer.concat([])}else if(i.isSymbolicLink()&&this._moduleSupports("symlink")){var s=a.readlinkSync(r.filepath);var l=d.dirname(r.filepath);r.data.type="symlink";r.data.linkname=d.relative(l,d.resolve(l,s));r.data.sourceType="buffer";r.source=Buffer.concat([])}else{if(i.isDirectory()){this.emit("warning",new A("DIRECTORYNOTSUPPORTED",r.data))}else if(i.isSymbolicLink()){this.emit("warning",new A("SYMLINKNOTSUPPORTED",r.data))}else{this.emit("warning",new A("ENTRYNOTSUPPORTED",r.data))}return null}r.data=this._normalizeEntryData(r.data,i);return r};Archiver.prototype.abort=function(){if(this._state.aborted||this._state.finalized){return this}this._abort();return this};Archiver.prototype.append=function(r,i){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}i=this._normalizeEntryData(i);if(typeof i.name!=="string"||i.name.length===0){this.emit("error",new A("ENTRYNAMEREQUIRED"));return this}if(i.type==="directory"&&!this._moduleSupports("directory")){this.emit("error",new A("DIRECTORYNOTSUPPORTED",{name:i.name}));return this}r=p.normalizeInputSource(r);if(Buffer.isBuffer(r)){i.sourceType="buffer"}else if(p.isStream(r)){i.sourceType="stream"}else{this.emit("error",new A("INPUTSTEAMBUFFERREQUIRED",{name:i.name}));return this}this._entriesCount++;this._queue.push({data:i,source:r});return this};Archiver.prototype.directory=function(r,i,s){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new A("DIRECTORYDIRPATHREQUIRED"));return this}this._pending++;if(i===false){i=""}else if(typeof i!=="string"){i=r}var a=false;if(typeof s==="function"){a=s;s={}}else if(typeof s!=="object"){s={}}var c={stat:true,dot:true};function onGlobEnd(){this._pending--;this._maybeFinalize()}function onGlobError(r){this.emit("error",r)}function onGlobMatch(l){d.pause();var c=false;var p=Object.assign({},s);p.name=l.relative;p.prefix=i;p.stats=l.stat;p.callback=d.resume.bind(d);try{if(a){p=a(p);if(p===false){c=true}else if(typeof p!=="object"){throw new A("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:r})}}}catch(r){this.emit("error",r);return}if(c){d.resume();return}this._append(l.absolute,p)}var d=l(r,c);d.on("error",onGlobError.bind(this));d.on("match",onGlobMatch.bind(this));d.on("end",onGlobEnd.bind(this));return this};Archiver.prototype.file=function(r,i){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new A("FILEFILEPATHREQUIRED"));return this}this._append(r,i);return this};Archiver.prototype.glob=function(r,i,s){this._pending++;i=p.defaults(i,{stat:true,pattern:r});function onGlobEnd(){this._pending--;this._maybeFinalize()}function onGlobError(r){this.emit("error",r)}function onGlobMatch(r){a.pause();var i=Object.assign({},s);i.callback=a.resume.bind(a);i.stats=r.stat;i.name=r.relative;this._append(r.absolute,i)}var a=l(i.cwd||".",i);a.on("error",onGlobError.bind(this));a.on("match",onGlobMatch.bind(this));a.on("end",onGlobEnd.bind(this));return this};Archiver.prototype.finalize=function(){if(this._state.aborted){var r=new A("ABORTED");this.emit("error",r);return Promise.reject(r)}if(this._state.finalize){var i=new A("FINALIZING");this.emit("error",i);return Promise.reject(i)}this._state.finalize=true;if(this._pending===0&&this._queue.idle()&&this._statQueue.idle()){this._finalize()}var s=this;return new Promise((function(r,i){var a;s._module.on("end",(function(){if(!a){r()}}));s._module.on("error",(function(r){a=true;i(r)}))}))};Archiver.prototype.setFormat=function(r){if(this._format){this.emit("error",new A("FORMATSET"));return this}this._format=r;return this};Archiver.prototype.setModule=function(r){if(this._state.aborted){this.emit("error",new A("ABORTED"));return this}if(this._state.module){this.emit("error",new A("MODULESET"));return this}this._module=r;this._modulePipe();return this};Archiver.prototype.symlink=function(r,i,s){if(this._state.finalize||this._state.aborted){this.emit("error",new A("QUEUECLOSED"));return this}if(typeof r!=="string"||r.length===0){this.emit("error",new A("SYMLINKFILEPATHREQUIRED"));return this}if(typeof i!=="string"||i.length===0){this.emit("error",new A("SYMLINKTARGETREQUIRED",{filepath:r}));return this}if(!this._moduleSupports("symlink")){this.emit("error",new A("SYMLINKNOTSUPPORTED",{filepath:r}));return this}var a={};a.type="symlink";a.name=r.replace(/\\/g,"/");a.linkname=i.replace(/\\/g,"/");a.sourceType="buffer";if(typeof s==="number"){a.mode=s}this._entriesCount++;this._queue.push({data:a,source:Buffer.concat([])});return this};Archiver.prototype.pointer=function(){return this._pointer};Archiver.prototype.use=function(r){this._streams.push(r);return this};r.exports=Archiver},67090:(r,i,s)=>{ /** * Archiver Core * @@ -22,7 +22,7 @@ var s=a(57147);var l=a(48059);var c=a(47466);var p=a(71017);var d=a(78443);var u * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var s=a(73837);const l={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function ArchiverError(r,i){Error.captureStackTrace(this,this.constructor);this.message=l[r]||r;this.code=r;this.data=i}s.inherits(ArchiverError,Error);i=r.exports=ArchiverError},85559:(r,i,a)=>{ +var a=s(73837);const l={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function ArchiverError(r,i){Error.captureStackTrace(this,this.constructor);this.message=l[r]||r;this.code=r;this.data=i}a.inherits(ArchiverError,Error);i=r.exports=ArchiverError},85559:(r,i,s)=>{ /** * JSON Format Plugin * @@ -30,7 +30,7 @@ var s=a(73837);const l={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:" * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var s=a(73837).inherits;var l=a(19173).Transform;var c=a(66066);var p=a(78443);var Json=function(r){if(!(this instanceof Json)){return new Json(r)}r=this.options=p.defaults(r,{});l.call(this,r);this.supports={directory:true,symlink:true};this.files=[]};s(Json,l);Json.prototype._transform=function(r,i,a){a(null,r)};Json.prototype._writeStringified=function(){var r=JSON.stringify(this.files);this.write(r)};Json.prototype.append=function(r,i,a){var s=this;i.crc32=0;function onend(r,l){if(r){a(r);return}i.size=l.length||0;i.crc32=c.unsigned(l);s.files.push(i);a(null,i)}if(i.sourceType==="buffer"){onend(null,r)}else if(i.sourceType==="stream"){p.collectStream(r,onend)}};Json.prototype.finalize=function(){this._writeStringified();this.end()};r.exports=Json},30030:(r,i,a)=>{ +var a=s(73837).inherits;var l=s(91650).Transform;var c=s(23367);var d=s(78443);var Json=function(r){if(!(this instanceof Json)){return new Json(r)}r=this.options=d.defaults(r,{});l.call(this,r);this.supports={directory:true,symlink:true};this.files=[]};a(Json,l);Json.prototype._transform=function(r,i,s){s(null,r)};Json.prototype._writeStringified=function(){var r=JSON.stringify(this.files);this.write(r)};Json.prototype.append=function(r,i,s){var a=this;i.crc32=0;function onend(r,l){if(r){s(r);return}i.size=l.length||0;i.crc32=c.unsigned(l);a.files.push(i);s(null,i)}if(i.sourceType==="buffer"){onend(null,r)}else if(i.sourceType==="stream"){d.collectStream(r,onend)}};Json.prototype.finalize=function(){this._writeStringified();this.end()};r.exports=Json},30030:(r,i,s)=>{ /** * TAR Format Plugin * @@ -38,7 +38,7 @@ var s=a(73837).inherits;var l=a(19173).Transform;var c=a(66066);var p=a(78443);v * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var s=a(59796);var l=a(28344);var c=a(78443);var Tar=function(r){if(!(this instanceof Tar)){return new Tar(r)}r=this.options=c.defaults(r,{gzip:false});if(typeof r.gzipOptions!=="object"){r.gzipOptions={}}this.supports={directory:true,symlink:true};this.engine=l.pack(r);this.compressor=false;if(r.gzip){this.compressor=s.createGzip(r.gzipOptions);this.compressor.on("error",this._onCompressorError.bind(this))}};Tar.prototype._onCompressorError=function(r){this.engine.emit("error",r)};Tar.prototype.append=function(r,i,a){var s=this;i.mtime=i.date;function append(r,l){if(r){a(r);return}s.engine.entry(i,l,(function(r){a(r,i)}))}if(i.sourceType==="buffer"){append(null,r)}else if(i.sourceType==="stream"&&i.stats){i.size=i.stats.size;var l=s.engine.entry(i,(function(r){a(r,i)}));r.pipe(l)}else if(i.sourceType==="stream"){c.collectStream(r,append)}};Tar.prototype.finalize=function(){this.engine.finalize()};Tar.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Tar.prototype.pipe=function(r,i){if(this.compressor){return this.engine.pipe.apply(this.engine,[this.compressor]).pipe(r,i)}else{return this.engine.pipe.apply(this.engine,arguments)}};Tar.prototype.unpipe=function(){if(this.compressor){return this.compressor.unpipe.apply(this.compressor,arguments)}else{return this.engine.unpipe.apply(this.engine,arguments)}};r.exports=Tar},17012:(r,i,a)=>{ +var a=s(59796);var l=s(28344);var c=s(78443);var Tar=function(r){if(!(this instanceof Tar)){return new Tar(r)}r=this.options=c.defaults(r,{gzip:false});if(typeof r.gzipOptions!=="object"){r.gzipOptions={}}this.supports={directory:true,symlink:true};this.engine=l.pack(r);this.compressor=false;if(r.gzip){this.compressor=a.createGzip(r.gzipOptions);this.compressor.on("error",this._onCompressorError.bind(this))}};Tar.prototype._onCompressorError=function(r){this.engine.emit("error",r)};Tar.prototype.append=function(r,i,s){var a=this;i.mtime=i.date;function append(r,l){if(r){s(r);return}a.engine.entry(i,l,(function(r){s(r,i)}))}if(i.sourceType==="buffer"){append(null,r)}else if(i.sourceType==="stream"&&i.stats){i.size=i.stats.size;var l=a.engine.entry(i,(function(r){s(r,i)}));r.pipe(l)}else if(i.sourceType==="stream"){c.collectStream(r,append)}};Tar.prototype.finalize=function(){this.engine.finalize()};Tar.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Tar.prototype.pipe=function(r,i){if(this.compressor){return this.engine.pipe.apply(this.engine,[this.compressor]).pipe(r,i)}else{return this.engine.pipe.apply(this.engine,arguments)}};Tar.prototype.unpipe=function(){if(this.compressor){return this.compressor.unpipe.apply(this.compressor,arguments)}else{return this.engine.unpipe.apply(this.engine,arguments)}};r.exports=Tar},17012:(r,i,s)=>{ /** * ZIP Format Plugin * @@ -46,40 +46,43 @@ var s=a(59796);var l=a(28344);var c=a(78443);var Tar=function(r){if(!(this insta * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE} * @copyright (c) 2012-2014 Chris Talkington, contributors. */ -var s=a(63463);var l=a(78443);var Zip=function(r){if(!(this instanceof Zip)){return new Zip(r)}r=this.options=l.defaults(r,{comment:"",forceUTC:false,namePrependSlash:false,store:false});this.supports={directory:true,symlink:true};this.engine=new s(r)};Zip.prototype.append=function(r,i,a){this.engine.entry(r,i,a)};Zip.prototype.finalize=function(){this.engine.finalize()};Zip.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Zip.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};Zip.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};r.exports=Zip},47466:function(r,i){(function(r,a){true?a(i):0})(this,(function(r){"use strict";function apply(r,...i){return(...a)=>r(...i,...a)}function initialParams(r){return function(...i){var a=i.pop();return r.call(this,i,a)}}var i=typeof queueMicrotask==="function"&&queueMicrotask;var a=typeof setImmediate==="function"&&setImmediate;var s=typeof process==="object"&&typeof process.nextTick==="function";function fallback(r){setTimeout(r,0)}function wrap(r){return(i,...a)=>r((()=>i(...a)))}var l;if(i){l=queueMicrotask}else if(a){l=setImmediate}else if(s){l=process.nextTick}else{l=fallback}var c=wrap(l);function asyncify(r){if(isAsync(r)){return function(...i){const a=i.pop();const s=r.apply(this,i);return handlePromise(s,a)}}return initialParams((function(i,a){var s;try{s=r.apply(this,i)}catch(r){return a(r)}if(s&&typeof s.then==="function"){return handlePromise(s,a)}else{a(null,s)}}))}function handlePromise(r,i){return r.then((r=>{invokeCallback(i,null,r)}),(r=>{invokeCallback(i,r&&(r instanceof Error||r.message)?r:new Error(r))}))}function invokeCallback(r,i,a){try{r(i,a)}catch(r){c((r=>{throw r}),r)}}function isAsync(r){return r[Symbol.toStringTag]==="AsyncFunction"}function isAsyncGenerator(r){return r[Symbol.toStringTag]==="AsyncGenerator"}function isAsyncIterable(r){return typeof r[Symbol.asyncIterator]==="function"}function wrapAsync(r){if(typeof r!=="function")throw new Error("expected a function");return isAsync(r)?asyncify(r):r}function awaitify(r,i){if(!i)i=r.length;if(!i)throw new Error("arity is undefined");function awaitable(...a){if(typeof a[i-1]==="function"){return r.apply(this,a)}return new Promise(((s,l)=>{a[i-1]=(r,...i)=>{if(r)return l(r);s(i.length>1?i:i[0])};r.apply(this,a)}))}return awaitable}function applyEach$1(r){return function applyEach(i,...a){const s=awaitify((function(s){var l=this;return r(i,((r,i)=>{wrapAsync(r).apply(l,a.concat(i))}),s)}));return s}}function _asyncMap(r,i,a,s){i=i||[];var l=[];var c=0;var p=wrapAsync(a);return r(i,((r,i,a)=>{var s=c++;p(r,((r,i)=>{l[s]=i;a(r)}))}),(r=>{s(r,l)}))}function isArrayLike(r){return r&&typeof r.length==="number"&&r.length>=0&&r.length%1===0}const p={};var d=p;function once(r){function wrapper(...i){if(r===null)return;var a=r;r=null;a.apply(this,i)}Object.assign(wrapper,r);return wrapper}function getIterator(r){return r[Symbol.iterator]&&r[Symbol.iterator]()}function createArrayIterator(r){var i=-1;var a=r.length;return function next(){return++i=i||p||l)return;p=true;r.next().then((({value:r,done:i})=>{if(c||l)return;p=false;if(i){l=true;if(u<=0){s(null)}return}u++;a(r,A,iterateeCallback);A++;replenish()})).catch(handleError)}function iterateeCallback(r,i){u-=1;if(c)return;if(r)return handleError(r);if(r===false){l=true;c=true;return}if(i===d||l&&u<=0){l=true;return s(null)}replenish()}function handleError(r){if(c)return;p=false;l=true;s(r)}replenish()}var eachOfLimit$2=r=>(i,a,s)=>{s=once(s);if(r<=0){throw new RangeError("concurrency limit cannot be less than 1")}if(!i){return s(null)}if(isAsyncGenerator(i)){return asyncEachOfLimit(i,r,a,s)}if(isAsyncIterable(i)){return asyncEachOfLimit(i[Symbol.asyncIterator](),r,a,s)}var l=createIterator(i);var c=false;var p=false;var u=0;var A=false;function iterateeCallback(r,i){if(p)return;u-=1;if(r){c=true;s(r)}else if(r===false){c=true;p=true}else if(i===d||c&&u<=0){c=true;return s(null)}else if(!A){replenish()}}function replenish(){A=true;while(u1?s:s[0])}callback[C]=new Promise(((a,s)=>{r=a,i=s}));return callback}function auto(r,i,a){if(typeof i!=="number"){a=i;i=null}a=once(a||promiseCallback());var s=Object.keys(r).length;if(!s){return a(null)}if(!i){i=s}var l={};var c=0;var p=false;var d=false;var u=Object.create(null);var A=[];var h=[];var g={};Object.keys(r).forEach((i=>{var a=r[i];if(!Array.isArray(a)){enqueueTask(i,[a]);h.push(i);return}var s=a.slice(0,a.length-1);var l=s.length;if(l===0){enqueueTask(i,a);h.push(i);return}g[i]=l;s.forEach((c=>{if(!r[c]){throw new Error("async.auto task `"+i+"` has a non-existent dependency `"+c+"` in "+s.join(", "))}addListener(c,(()=>{l--;if(l===0){enqueueTask(i,a)}}))}))}));checkForDeadlocks();processQueue();function enqueueTask(r,i){A.push((()=>runTask(r,i)))}function processQueue(){if(p)return;if(A.length===0&&c===0){return a(null,l)}while(A.length&&cr()));processQueue()}function runTask(r,i){if(d)return;var s=onlyOnce(((i,...s)=>{c--;if(i===false){p=true;return}if(s.length<2){[s]=s}if(i){var A={};Object.keys(l).forEach((r=>{A[r]=l[r]}));A[r]=s;d=true;u=Object.create(null);if(p)return;a(i,A)}else{l[r]=s;taskComplete(r)}}));c++;var A=wrapAsync(i[i.length-1]);if(i.length>1){A(l,s)}else{A(s)}}function checkForDeadlocks(){var r;var i=0;while(h.length){r=h.pop();i++;getDependents(r).forEach((r=>{if(--g[r]===0){h.push(r)}}))}if(i!==s){throw new Error("async.auto cannot execute tasks due to a recursive dependency")}}function getDependents(i){var a=[];Object.keys(r).forEach((s=>{const l=r[s];if(Array.isArray(l)&&l.indexOf(i)>=0){a.push(s)}}));return a}return a[C]}var v=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/;var B=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;var I=/,/;var w=/(=.+)?(\s*)$/;function stripComments(r){let i="";let a=0;let s=r.indexOf("*/");while(ar.replace(w,"").trim()))}function autoInject(r,i){var a={};Object.keys(r).forEach((i=>{var s=r[i];var l;var c=isAsync(s);var p=!c&&s.length===1||c&&s.length===0;if(Array.isArray(s)){l=[...s];s=l.pop();a[i]=l.concat(l.length>0?newTask:s)}else if(p){a[i]=s}else{l=parseParams(s);if(s.length===0&&!c&&l.length===0){throw new Error("autoInject task functions require explicit parameters.")}if(!c)l.pop();a[i]=l.concat(newTask)}function newTask(r,i){var a=l.map((i=>r[i]));a.push(i);wrapAsync(s)(...a)}}));return auto(a,i)}class DLL{constructor(){this.head=this.tail=null;this.length=0}removeLink(r){if(r.prev)r.prev.next=r.next;else this.head=r.next;if(r.next)r.next.prev=r.prev;else this.tail=r.prev;r.prev=r.next=null;this.length-=1;return r}empty(){while(this.head)this.shift();return this}insertAfter(r,i){i.prev=r;i.next=r.next;if(r.next)r.next.prev=i;else this.tail=i;r.next=i;this.length+=1}insertBefore(r,i){i.prev=r.prev;i.next=r;if(r.prev)r.prev.next=i;else this.head=i;r.prev=i;this.length+=1}unshift(r){if(this.head)this.insertBefore(this.head,r);else setInitial(this,r)}push(r){if(this.tail)this.insertAfter(this.tail,r);else setInitial(this,r)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var r=this.head;while(r){yield r.data;r=r.next}}remove(r){var i=this.head;while(i){var{next:a}=i;if(r(i)){this.removeLink(i)}i=a}return this}}function setInitial(r,i){r.length=1;r.head=r.tail=i}function queue$1(r,i,a){if(i==null){i=1}else if(i===0){throw new RangeError("Concurrency must not be zero")}var s=wrapAsync(r);var l=0;var p=[];const d={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function on(r,i){d[r].push(i)}function once(r,i){const handleAndRemove=(...a)=>{off(r,handleAndRemove);i(...a)};d[r].push(handleAndRemove)}function off(r,i){if(!r)return Object.keys(d).forEach((r=>d[r]=[]));if(!i)return d[r]=[];d[r]=d[r].filter((r=>r!==i))}function trigger(r,...i){d[r].forEach((r=>r(...i)))}var u=false;function _insert(r,i,a,s){if(s!=null&&typeof s!=="function"){throw new Error("task callback must be a function")}h.started=true;var l,p;function promiseCallback(r,...i){if(r)return a?p(r):l();if(i.length<=1)return l(i[0]);l(i)}var d=h._createTaskItem(r,a?promiseCallback:s||promiseCallback);if(i){h._tasks.unshift(d)}else{h._tasks.push(d)}if(!u){u=true;c((()=>{u=false;h.process()}))}if(a||!s){return new Promise(((r,i)=>{l=r;p=i}))}}function _createCB(r){return function(i,...a){l-=1;for(var s=0,c=r.length;s0){p.splice(u,1)}d.callback(i,...a);if(i!=null){trigger("error",i,d.data)}}if(l<=h.concurrency-h.buffer){trigger("unsaturated")}if(h.idle()){trigger("drain")}h.process()}}function _maybeDrain(r){if(r.length===0&&h.idle()){c((()=>trigger("drain")));return true}return false}const eventMethod=r=>i=>{if(!i){return new Promise(((i,a)=>{once(r,((r,s)=>{if(r)return a(r);i(s)}))}))}off(r);on(r,i)};var A=false;var h={_tasks:new DLL,_createTaskItem(r,i){return{data:r,callback:i}},*[Symbol.iterator](){yield*h._tasks[Symbol.iterator]()},concurrency:i,payload:a,buffer:i/4,started:false,paused:false,push(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,false,false,i)))}return _insert(r,false,false,i)},pushAsync(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,false,true,i)))}return _insert(r,false,true,i)},kill(){off();h._tasks.empty()},unshift(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,true,false,i)))}return _insert(r,true,false,i)},unshiftAsync(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,true,true,i)))}return _insert(r,true,true,i)},remove(r){h._tasks.remove(r)},process(){if(A){return}A=true;while(!h.paused&&l{l(i,r,((r,a)=>{i=a;s(r)}))}),(r=>s(r,i)))}var S=awaitify(reduce,4);function seq(...r){var i=r.map(wrapAsync);return function(...r){var a=this;var s=r[r.length-1];if(typeof s=="function"){r.pop()}else{s=promiseCallback()}S(i,r,((r,i,s)=>{i.apply(a,r.concat(((r,...i)=>{s(r,i)})))}),((r,i)=>s(r,...i)));return s[C]}}function compose(...r){return seq(...r.reverse())}function mapLimit(r,i,a,s){return _asyncMap(eachOfLimit$2(i),r,a,s)}var Q=awaitify(mapLimit,4);function concatLimit(r,i,a,s){var l=wrapAsync(a);return Q(r,i,((r,i)=>{l(r,((r,...a)=>{if(r)return i(r);return i(r,a)}))}),((r,i)=>{var a=[];for(var l=0;l{var p=false;var u;const A=wrapAsync(l);a(s,((a,s,l)=>{A(a,((s,c)=>{if(s||s===false)return l(s);if(r(c)&&!u){p=true;u=i(true,a);return l(null,d)}l()}))}),(r=>{if(r)return c(r);c(null,p?u:i(false))}))}}function detect(r,i,a){return _createTester((r=>r),((r,i)=>i))(A,r,i,a)}var T=awaitify(detect,3);function detectLimit(r,i,a,s){return _createTester((r=>r),((r,i)=>i))(eachOfLimit$2(i),r,a,s)}var D=awaitify(detectLimit,4);function detectSeries(r,i,a){return _createTester((r=>r),((r,i)=>i))(eachOfLimit$2(1),r,i,a)}var k=awaitify(detectSeries,3);function consoleFunc(r){return(i,...a)=>wrapAsync(i)(...a,((i,...a)=>{if(typeof console==="object"){if(i){if(console.error){console.error(i)}}else if(console[r]){a.forEach((i=>console[r](i)))}}}))}var _=consoleFunc("dir");function doWhilst(r,i,a){a=onlyOnce(a);var s=wrapAsync(r);var l=wrapAsync(i);var c;function next(r,...i){if(r)return a(r);if(r===false)return;c=i;l(...i,check)}function check(r,i){if(r)return a(r);if(r===false)return;if(!i)return a(null,...c);s(next)}return check(null,true)}var O=awaitify(doWhilst,3);function doUntil(r,i,a){const s=wrapAsync(i);return O(r,((...r)=>{const i=r.pop();s(...r,((r,a)=>i(r,!a)))}),a)}function _withoutIndex(r){return(i,a,s)=>r(i,s)}function eachLimit$2(r,i,a){return A(r,_withoutIndex(wrapAsync(i)),a)}var P=awaitify(eachLimit$2,3);function eachLimit(r,i,a,s){return eachOfLimit$2(i)(r,_withoutIndex(wrapAsync(a)),s)}var L=awaitify(eachLimit,4);function eachSeries(r,i,a){return L(r,1,i,a)}var M=awaitify(eachSeries,3);function ensureAsync(r){if(isAsync(r))return r;return function(...i){var a=i.pop();var s=true;i.push(((...r)=>{if(s){c((()=>a(...r)))}else{a(...r)}}));r.apply(this,i);s=false}}function every(r,i,a){return _createTester((r=>!r),(r=>!r))(A,r,i,a)}var U=awaitify(every,3);function everyLimit(r,i,a,s){return _createTester((r=>!r),(r=>!r))(eachOfLimit$2(i),r,a,s)}var q=awaitify(everyLimit,4);function everySeries(r,i,a){return _createTester((r=>!r),(r=>!r))(y,r,i,a)}var H=awaitify(everySeries,3);function filterArray(r,i,a,s){var l=new Array(i.length);r(i,((r,i,s)=>{a(r,((r,a)=>{l[i]=!!a;s(r)}))}),(r=>{if(r)return s(r);var a=[];for(var c=0;c{a(r,((a,c)=>{if(a)return s(a);if(c){l.push({index:i,value:r})}s(a)}))}),(r=>{if(r)return s(r);s(null,l.sort(((r,i)=>r.index-i.index)).map((r=>r.value)))}))}function _filter(r,i,a,s){var l=isArrayLike(i)?filterArray:filterGeneric;return l(r,i,wrapAsync(a),s)}function filter(r,i,a){return _filter(A,r,i,a)}var j=awaitify(filter,3);function filterLimit(r,i,a,s){return _filter(eachOfLimit$2(i),r,a,s)}var G=awaitify(filterLimit,4);function filterSeries(r,i,a){return _filter(y,r,i,a)}var z=awaitify(filterSeries,3);function forever(r,i){var a=onlyOnce(i);var s=wrapAsync(ensureAsync(r));function next(r){if(r)return a(r);if(r===false)return;s(next)}return next()}var V=awaitify(forever,2);function groupByLimit(r,i,a,s){var l=wrapAsync(a);return Q(r,i,((r,i)=>{l(r,((a,s)=>{if(a)return i(a);return i(a,{key:s,val:r})}))}),((r,i)=>{var a={};var{hasOwnProperty:l}=Object.prototype;for(var c=0;c{c(r,i,((r,s)=>{if(r)return a(r);l[i]=s;a(r)}))}),(r=>s(r,l)))}var W=awaitify(mapValuesLimit,4);function mapValues(r,i,a){return W(r,Infinity,i,a)}function mapValuesSeries(r,i,a){return W(r,1,i,a)}function memoize(r,i=(r=>r)){var a=Object.create(null);var s=Object.create(null);var l=wrapAsync(r);var p=initialParams(((r,p)=>{var d=i(...r);if(d in a){c((()=>p(null,...a[d])))}else if(d in s){s[d].push(p)}else{s[d]=[p];l(...r,((r,...i)=>{if(!r){a[d]=i}var l=s[d];delete s[d];for(var c=0,p=l.length;c{var s=isArrayLike(i)?[]:{};r(i,((r,i,a)=>{wrapAsync(r)(((r,...l)=>{if(l.length<2){[l]=l}s[i]=l;a(r)}))}),(r=>a(r,s)))}),3);function parallel(r,i){return $(A,r,i)}function parallelLimit(r,i,a){return $(eachOfLimit$2(i),r,a)}function queue(r,i){var a=wrapAsync(r);return queue$1(((r,i)=>{a(r[0],i)}),i,1)}class Heap{constructor(){this.heap=[];this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){this.heap=[];return this}percUp(r){let i;while(r>0&&smaller(this.heap[r],this.heap[i=parent(r)])){let a=this.heap[r];this.heap[r]=this.heap[i];this.heap[i]=a;r=i}}percDown(r){let i;while((i=leftChi(r))=0;r--){this.percDown(r)}return this}}function leftChi(r){return(r<<1)+1}function parent(r){return(r+1>>1)-1}function smaller(r,i){if(r.priority!==i.priority){return r.priority({data:r,priority:i,callback:a});function createDataItems(r,i){if(!Array.isArray(r)){return{data:r,priority:i}}return r.map((r=>({data:r,priority:i})))}a.push=function(r,i=0,a){return s(createDataItems(r,i),a)};a.pushAsync=function(r,i=0,a){return l(createDataItems(r,i),a)};delete a.unshift;delete a.unshiftAsync;return a}function race(r,i){i=once(i);if(!Array.isArray(r))return i(new TypeError("First argument to race must be an array of functions"));if(!r.length)return i();for(var a=0,s=r.length;a{let s={};if(r){s.error=r}if(i.length>0){var l=i;if(i.length<=1){[l]=i}s.value=l}a(null,s)}));return i.apply(this,r)}))}function reflectAll(r){var i;if(Array.isArray(r)){i=r.map(reflect)}else{i={};Object.keys(r).forEach((a=>{i[a]=reflect.call(this,r[a])}))}return i}function reject$2(r,i,a,s){const l=wrapAsync(a);return _filter(r,i,((r,i)=>{l(r,((r,a)=>{i(r,!a)}))}),s)}function reject(r,i,a){return reject$2(A,r,i,a)}var ee=awaitify(reject,3);function rejectLimit(r,i,a,s){return reject$2(eachOfLimit$2(i),r,a,s)}var te=awaitify(rejectLimit,4);function rejectSeries(r,i,a){return reject$2(y,r,i,a)}var re=awaitify(rejectSeries,3);function constant(r){return function(){return r}}const ie=5;const ne=0;function retry(r,i,a){var s={times:ie,intervalFunc:constant(ne)};if(arguments.length<3&&typeof r==="function"){a=i||promiseCallback();i=r}else{parseTimes(s,r);a=a||promiseCallback()}if(typeof i!=="function"){throw new Error("Invalid arguments for async.retry")}var l=wrapAsync(i);var c=1;function retryAttempt(){l(((r,...i)=>{if(r===false)return;if(r&&c++{if(i.lengthr))(A,r,i,a)}var ae=awaitify(some,3);function someLimit(r,i,a,s){return _createTester(Boolean,(r=>r))(eachOfLimit$2(i),r,a,s)}var se=awaitify(someLimit,4);function someSeries(r,i,a){return _createTester(Boolean,(r=>r))(y,r,i,a)}var oe=awaitify(someSeries,3);function sortBy(r,i,a){var s=wrapAsync(i);return h(r,((r,i)=>{s(r,((a,s)=>{if(a)return i(a);i(a,{value:r,criteria:s})}))}),((r,i)=>{if(r)return a(r);a(null,i.sort(comparator).map((r=>r.value)))}));function comparator(r,i){var a=r.criteria,s=i.criteria;return as?1:0}}var le=awaitify(sortBy,3);function timeout(r,i,a){var s=wrapAsync(r);return initialParams(((l,c)=>{var p=false;var d;function timeoutCallback(){var i=r.name||"anonymous";var s=new Error('Callback function "'+i+'" timed out.');s.code="ETIMEDOUT";if(a){s.info=a}p=true;c(s)}l.push(((...r)=>{if(!p){c(...r);clearTimeout(d)}}));d=setTimeout(timeoutCallback,i);s(...l)}))}function range(r){var i=Array(r);while(r--){i[r]=r}return i}function timesLimit(r,i,a,s){var l=wrapAsync(a);return Q(range(r),i,l,s)}function times(r,i,a){return timesLimit(r,Infinity,i,a)}function timesSeries(r,i,a){return timesLimit(r,1,i,a)}function transform(r,i,a,s){if(arguments.length<=3&&typeof i==="function"){s=a;a=i;i=Array.isArray(r)?[]:{}}s=once(s||promiseCallback());var l=wrapAsync(a);A(r,((r,a,s)=>{l(i,r,a,s)}),(r=>s(r,i)));return s[C]}function tryEach(r,i){var a=null;var s;return M(r,((r,i)=>{wrapAsync(r)(((r,...l)=>{if(r===false)return i(r);if(l.length<2){[s]=l}else{s=l}a=r;i(r?null:{})}))}),(()=>i(a,s)))}var ce=awaitify(tryEach);function unmemoize(r){return(...i)=>(r.unmemoized||r)(...i)}function whilst(r,i,a){a=onlyOnce(a);var s=wrapAsync(i);var l=wrapAsync(r);var c=[];function next(r,...i){if(r)return a(r);c=i;if(r===false)return;l(check)}function check(r,i){if(r)return a(r);if(r===false)return;if(!i)return a(null,...c);s(next)}return l(check)}var pe=awaitify(whilst,3);function until(r,i,a){const s=wrapAsync(r);return pe((r=>s(((i,a)=>r(i,!a)))),i,a)}function waterfall(r,i){i=once(i);if(!Array.isArray(r))return i(new Error("First argument to waterfall must be an array of functions"));if(!r.length)return i();var a=0;function nextTask(i){var s=wrapAsync(r[a++]);s(...i,onlyOnce(next))}function next(s,...l){if(s===false)return;if(s||a===r.length){return i(s,...l)}nextTask(l)}nextTask([])}var de=awaitify(waterfall);var ue={apply:apply,applyEach:g,applyEachSeries:b,asyncify:asyncify,auto:auto,autoInject:autoInject,cargo:cargo$1,cargoQueue:cargo,compose:compose,concat:N,concatLimit:x,concatSeries:R,constant:constant$1,detect:T,detectLimit:D,detectSeries:k,dir:_,doUntil:doUntil,doWhilst:O,each:P,eachLimit:L,eachOf:A,eachOfLimit:u,eachOfSeries:y,eachSeries:M,ensureAsync:ensureAsync,every:U,everyLimit:q,everySeries:H,filter:j,filterLimit:G,filterSeries:z,forever:V,groupBy:groupBy,groupByLimit:J,groupBySeries:groupBySeries,log:Y,map:h,mapLimit:Q,mapSeries:E,mapValues:mapValues,mapValuesLimit:W,mapValuesSeries:mapValuesSeries,memoize:memoize,nextTick:K,parallel:parallel,parallelLimit:parallelLimit,priorityQueue:priorityQueue,queue:queue,race:Z,reduce:S,reduceRight:reduceRight,reflect:reflect,reflectAll:reflectAll,reject:ee,rejectLimit:te,rejectSeries:re,retry:retry,retryable:retryable,seq:seq,series:series,setImmediate:c,some:ae,someLimit:se,someSeries:oe,sortBy:le,timeout:timeout,times:times,timesLimit:timesLimit,timesSeries:timesSeries,transform:transform,tryEach:ce,unmemoize:unmemoize,until:until,waterfall:de,whilst:pe,all:U,allLimit:q,allSeries:H,any:ae,anyLimit:se,anySeries:oe,find:T,findLimit:D,findSeries:k,flatMap:N,flatMapLimit:x,flatMapSeries:R,forEach:P,forEachSeries:M,forEachLimit:L,forEachOf:A,forEachOfSeries:y,forEachOfLimit:u,inject:S,foldl:S,foldr:reduceRight,select:j,selectLimit:G,selectSeries:z,wrapSync:asyncify,during:pe,doDuring:O};r.all=U;r.allLimit=q;r.allSeries=H;r.any=ae;r.anyLimit=se;r.anySeries=oe;r.apply=apply;r.applyEach=g;r.applyEachSeries=b;r.asyncify=asyncify;r.auto=auto;r.autoInject=autoInject;r.cargo=cargo$1;r.cargoQueue=cargo;r.compose=compose;r.concat=N;r.concatLimit=x;r.concatSeries=R;r.constant=constant$1;r.default=ue;r.detect=T;r.detectLimit=D;r.detectSeries=k;r.dir=_;r.doDuring=O;r.doUntil=doUntil;r.doWhilst=O;r.during=pe;r.each=P;r.eachLimit=L;r.eachOf=A;r.eachOfLimit=u;r.eachOfSeries=y;r.eachSeries=M;r.ensureAsync=ensureAsync;r.every=U;r.everyLimit=q;r.everySeries=H;r.filter=j;r.filterLimit=G;r.filterSeries=z;r.find=T;r.findLimit=D;r.findSeries=k;r.flatMap=N;r.flatMapLimit=x;r.flatMapSeries=R;r.foldl=S;r.foldr=reduceRight;r.forEach=P;r.forEachLimit=L;r.forEachOf=A;r.forEachOfLimit=u;r.forEachOfSeries=y;r.forEachSeries=M;r.forever=V;r.groupBy=groupBy;r.groupByLimit=J;r.groupBySeries=groupBySeries;r.inject=S;r.log=Y;r.map=h;r.mapLimit=Q;r.mapSeries=E;r.mapValues=mapValues;r.mapValuesLimit=W;r.mapValuesSeries=mapValuesSeries;r.memoize=memoize;r.nextTick=K;r.parallel=parallel;r.parallelLimit=parallelLimit;r.priorityQueue=priorityQueue;r.queue=queue;r.race=Z;r.reduce=S;r.reduceRight=reduceRight;r.reflect=reflect;r.reflectAll=reflectAll;r.reject=ee;r.rejectLimit=te;r.rejectSeries=re;r.retry=retry;r.retryable=retryable;r.select=j;r.selectLimit=G;r.selectSeries=z;r.seq=seq;r.series=series;r.setImmediate=c;r.some=ae;r.someLimit=se;r.someSeries=oe;r.sortBy=le;r.timeout=timeout;r.times=times;r.timesLimit=timesLimit;r.timesSeries=timesSeries;r.transform=transform;r.tryEach=ce;r.unmemoize=unmemoize;r.until=until;r.waterfall=de;r.whilst=pe;r.wrapSync=asyncify;Object.defineProperty(r,"__esModule",{value:true})}))},55633:(r,i,a)=>{r.exports={parallel:a(40300),serial:a(47164),serialOrdered:a(27898)}},37856:r=>{r.exports=abort;function abort(r){Object.keys(r.jobs).forEach(clean.bind(r));r.jobs={}}function clean(r){if(typeof this.jobs[r]=="function"){this.jobs[r]()}}},18464:(r,i,a)=>{var s=a(34043);r.exports=async;function async(r){var i=false;s((function(){i=true}));return function async_callback(a,l){if(i){r(a,l)}else{s((function nextTick_callback(){r(a,l)}))}}}},34043:r=>{r.exports=defer;function defer(r){var i=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(i){i(r)}else{setTimeout(r,0)}}},95756:(r,i,a)=>{var s=a(18464),l=a(37856);r.exports=iterate;function iterate(r,i,a,s){var c=a["keyedList"]?a["keyedList"][a.index]:a.index;a.jobs[c]=runJob(i,c,r[c],(function(r,i){if(!(c in a.jobs)){return}delete a.jobs[c];if(r){l(a)}else{a.results[c]=i}s(r,a.results)}))}function runJob(r,i,a,l){var c;if(r.length==2){c=r(a,s(l))}else{c=r(a,i,s(l))}return c}},94773:r=>{r.exports=state;function state(r,i){var a=!Array.isArray(r),s={index:0,keyedList:a||i?Object.keys(r):null,jobs:{},results:a?{}:[],size:a?Object.keys(r).length:r.length};if(i){s.keyedList.sort(a?i:function(a,s){return i(r[a],r[s])})}return s}},17484:(r,i,a)=>{var s=a(37856),l=a(18464);r.exports=terminator;function terminator(r){if(!Object.keys(this.jobs).length){return}this.index=this.size;s(this);l(r)(null,this.results)}},40300:(r,i,a)=>{var s=a(95756),l=a(94773),c=a(17484);r.exports=parallel;function parallel(r,i,a){var p=l(r);while(p.index<(p["keyedList"]||r).length){s(r,i,p,(function(r,i){if(r){a(r,i);return}if(Object.keys(p.jobs).length===0){a(null,p.results);return}}));p.index++}return c.bind(p,a)}},47164:(r,i,a)=>{var s=a(27898);r.exports=serial;function serial(r,i,a){return s(r,i,null,a)}},27898:(r,i,a)=>{var s=a(95756),l=a(94773),c=a(17484);r.exports=serialOrdered;r.exports.ascending=ascending;r.exports.descending=descending;function serialOrdered(r,i,a,p){var d=l(r,a);s(r,i,d,(function iteratorHandler(a,l){if(a){p(a,l);return}d.index++;if(d.index<(d["keyedList"]||r).length){s(r,i,d,iteratorHandler);return}p(null,d.results)}));return c.bind(d,p)}function ascending(r,i){return ri?1:0}function descending(r,i){return-1*ascending(r,i)}},44350:r=>{"use strict";r.exports=balanced;function balanced(r,i,a){if(r instanceof RegExp)r=maybeMatch(r,a);if(i instanceof RegExp)i=maybeMatch(i,a);var s=range(r,i,a);return s&&{start:s[0],end:s[1],pre:a.slice(0,s[0]),body:a.slice(s[0]+r.length,s[1]),post:a.slice(s[1]+i.length)}}function maybeMatch(r,i){var a=i.match(r);return a?a[0]:null}balanced.range=range;function range(r,i,a){var s,l,c,p,d;var u=a.indexOf(r);var A=a.indexOf(i,u+1);var h=u;if(u>=0&&A>0){if(r===i){return[u,A]}s=[];c=a.length;while(h>=0&&!d){if(h==u){s.push(h);u=a.indexOf(r,h+1)}else if(s.length==1){d=[s.pop(),A]}else{l=s.pop();if(l=0?u:A}if(s.length){d=[c,p]}}return d}},15546:(r,i,a)=>{var s=a(35109);var l=a(87614);var c=a(26538);var p=Function.bind;var d=p.bind(p);function bindApi(r,i,a){var s=d(c,null).apply(null,a?[i,a]:[i]);r.api={remove:s};r.remove=s;["before","error","after","wrap"].forEach((function(s){var c=a?[i,s,a]:[i,s];r[s]=r.api[s]=d(l,null).apply(null,c)}))}function HookSingular(){var r="h";var i={registry:{}};var a=s.bind(null,i,r);bindApi(a,i,r);return a}function HookCollection(){var r={registry:{}};var i=s.bind(null,r);bindApi(i,r);return i}var u=false;function Hook(){if(!u){console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4');u=true}return HookCollection()}Hook.Singular=HookSingular.bind();Hook.Collection=HookCollection.bind();r.exports=Hook;r.exports.Hook=Hook;r.exports.Singular=Hook.Singular;r.exports.Collection=Hook.Collection},87614:r=>{r.exports=addHook;function addHook(r,i,a,s){var l=s;if(!r.registry[a]){r.registry[a]=[]}if(i==="before"){s=function(r,i){return Promise.resolve().then(l.bind(null,i)).then(r.bind(null,i))}}if(i==="after"){s=function(r,i){var a;return Promise.resolve().then(r.bind(null,i)).then((function(r){a=r;return l(a,i)})).then((function(){return a}))}}if(i==="error"){s=function(r,i){return Promise.resolve().then(r.bind(null,i)).catch((function(r){return l(r,i)}))}}r.registry[a].push({hook:s,orig:l})}},35109:r=>{r.exports=register;function register(r,i,a,s){if(typeof a!=="function"){throw new Error("method for before hook must be a function")}if(!s){s={}}if(Array.isArray(i)){return i.reverse().reduce((function(i,a){return register.bind(null,r,a,i,s)}),a)()}return Promise.resolve().then((function(){if(!r.registry[i]){return a(s)}return r.registry[i].reduce((function(r,i){return i.hook.bind(null,r,s)}),a)()}))}},26538:r=>{r.exports=removeHook;function removeHook(r,i,a){if(!r.registry[i]){return}var s=r.registry[i].map((function(r){return r.orig})).indexOf(a);if(s===-1){return}r.registry[i].splice(s,1)}},20593:(r,i,a)=>{var s=a(39416);var l=a(82361).EventEmitter;var c=a(75506);var p=a(93771);var d=a(12781).Stream;i=r.exports=function(r,a){if(Buffer.isBuffer(r)){return i.parse(r)}var s=i.stream();if(r&&r.pipe){r.pipe(s)}else if(r){r.on(a||"data",(function(r){s.write(r)}));r.on("end",(function(){s.end()}))}return s};i.stream=function(r){if(r)return i.apply(null,arguments);var a=null;function getBytes(r,i,s){a={bytes:r,skip:s,cb:function(r){a=null;i(r)}};dispatch()}var u=null;function dispatch(){if(!a){if(E)y=true;return}if(typeof a==="function"){a()}else{var r=u+a.bytes;if(h.length>=r){var i;if(u==null){i=h.splice(0,r);if(!a.skip){i=i.slice()}}else{if(!a.skip){i=h.slice(u,r)}u=r}if(a.skip){a.cb()}else{a.cb(i)}}}}function builder(r){function next(){if(!y)r.next()}var i=words((function(r,i){return function(a){getBytes(r,(function(r){g.set(a,i(r));next()}))}}));i.tap=function(i){r.nest(i,g.store)};i.into=function(i,a){if(!g.get(i))g.set(i,{});var s=g;g=p(s.get(i));r.nest((function(){a.apply(this,arguments);this.tap((function(){g=s}))}),g.store)};i.flush=function(){g.store={};next()};i.loop=function(i){var a=false;r.nest(false,(function loop(){this.vars=g.store;i.call(this,(function(){a=true;next()}),g.store);this.tap(function(){if(a)r.next();else loop.call(this)}.bind(this))}),g.store)};i.buffer=function(r,i){if(typeof i==="string"){i=g.get(i)}getBytes(i,(function(i){g.set(r,i);next()}))};i.skip=function(r){if(typeof r==="string"){r=g.get(r)}getBytes(r,(function(){next()}))};i.scan=function find(r,i){if(typeof i==="string"){i=new Buffer(i)}else if(!Buffer.isBuffer(i)){throw new Error("search must be a Buffer or a string")}var s=0;a=function(){var l=h.indexOf(i,u+s);var c=l-u-s;if(l!==-1){a=null;if(u!=null){g.set(r,h.slice(u,u+s+c));u+=s+c+i.length}else{g.set(r,h.slice(0,s+c));h.splice(0,s+c+i.length)}next();dispatch()}else{c=Math.max(h.length-i.length-u-s,0)}s+=c};dispatch()};i.peek=function(i){u=0;r.nest((function(){i.call(this,g.store);this.tap((function(){u=null}))}))};return i}var A=s.light(builder);A.writable=true;var h=c();A.write=function(r){h.push(r);dispatch()};var g=p();var y=false,E=false;A.end=function(){E=true};A.pipe=d.prototype.pipe;Object.getOwnPropertyNames(l.prototype).forEach((function(r){A[r]=l.prototype[r]}));return A};i.parse=function parse(r){var i=words((function(l,c){return function(p){if(a+l<=r.length){var d=r.slice(a,a+l);a+=l;s.set(p,c(d))}else{s.set(p,null)}return i}}));var a=0;var s=p();i.vars=s.store;i.tap=function(r){r.call(i,s.store);return i};i.into=function(r,a){if(!s.get(r)){s.set(r,{})}var l=s;s=p(l.get(r));a.call(i,s.store);s=l;return i};i.loop=function(r){var a=false;var ender=function(){a=true};while(a===false){r.call(i,ender,s.store)}return i};i.buffer=function(l,c){if(typeof c==="string"){c=s.get(c)}var p=r.slice(a,Math.min(r.length,a+c));a+=c;s.set(l,p);return i};i.skip=function(r){if(typeof r==="string"){r=s.get(r)}a+=r;return i};i.scan=function(l,c){if(typeof c==="string"){c=new Buffer(c)}else if(!Buffer.isBuffer(c)){throw new Error("search must be a Buffer or a string")}s.set(l,null);for(var p=0;p+a<=r.length-c.length+1;p++){for(var d=0;d=r.length};return i};function decodeLEu(r){var i=0;for(var a=0;a{r.exports=function(r){function getset(r,a){var s=i.store;var l=r.split(".");l.slice(0,-1).forEach((function(r){if(s[r]===undefined)s[r]={};s=s[r]}));var c=l[l.length-1];if(arguments.length==1){return s[c]}else{return s[c]=a}}var i={get:function(r){return getset(r)},set:function(r,i){return getset(r,i)},store:r||{}};return i}},65163:(r,i,a)=>{"use strict";const{Buffer:s}=a(14300);const l=Symbol.for("BufferList");function BufferList(r){if(!(this instanceof BufferList)){return new BufferList(r)}BufferList._init.call(this,r)}BufferList._init=function _init(r){Object.defineProperty(this,l,{value:true});this._bufs=[];this.length=0;if(r){this.append(r)}};BufferList.prototype._new=function _new(r){return new BufferList(r)};BufferList.prototype._offset=function _offset(r){if(r===0){return[0,0]}let i=0;for(let a=0;athis.length||r<0){return undefined}const i=this._offset(r);return this._bufs[i[0]][i[1]]};BufferList.prototype.slice=function slice(r,i){if(typeof r==="number"&&r<0){r+=this.length}if(typeof i==="number"&&i<0){i+=this.length}return this.copy(null,0,r,i)};BufferList.prototype.copy=function copy(r,i,a,l){if(typeof a!=="number"||a<0){a=0}if(typeof l!=="number"||l>this.length){l=this.length}if(a>=this.length){return r||s.alloc(0)}if(l<=0){return r||s.alloc(0)}const copy=!!r;const c=this._offset(a);const p=l-a;let d=p;let u=copy&&i||0;let A=c[1];if(a===0&&l===this.length){if(!copy){return this._bufs.length===1?this._bufs[0]:s.concat(this._bufs,this.length)}for(let i=0;ia){this._bufs[i].copy(r,u,A);u+=a}else{this._bufs[i].copy(r,u,A,A+d);u+=a;break}d-=a;if(A){A=0}}if(r.length>u)return r.slice(0,u);return r};BufferList.prototype.shallowSlice=function shallowSlice(r,i){r=r||0;i=typeof i!=="number"?this.length:i;if(r<0){r+=this.length}if(i<0){i+=this.length}if(r===i){return this._new()}const a=this._offset(r);const s=this._offset(i);const l=this._bufs.slice(a[0],s[0]+1);if(s[1]===0){l.pop()}else{l[l.length-1]=l[l.length-1].slice(0,s[1])}if(a[1]!==0){l[0]=l[0].slice(a[1])}return this._new(l)};BufferList.prototype.toString=function toString(r,i,a){return this.slice(i,a).toString(r)};BufferList.prototype.consume=function consume(r){r=Math.trunc(r);if(Number.isNaN(r)||r<=0)return this;while(this._bufs.length){if(r>=this._bufs[0].length){r-=this._bufs[0].length;this.length-=this._bufs[0].length;this._bufs.shift()}else{this._bufs[0]=this._bufs[0].slice(r);this.length-=r;break}}return this};BufferList.prototype.duplicate=function duplicate(){const r=this._new();for(let i=0;ithis.length?this.length:i}const l=this._offset(i);let c=l[0];let p=l[1];for(;c=r.length){const a=i.indexOf(r,p);if(a!==-1){return this._reverseOffset([c,a])}p=i.length-r.length+1}else{const i=this._reverseOffset([c,p]);if(this._match(i,r)){return i}p++}}p=0}return-1};BufferList.prototype._match=function(r,i){if(this.length-r{"use strict";const s=a(19173).Duplex;const l=a(55806);const c=a(65163);function BufferListStream(r){if(!(this instanceof BufferListStream)){return new BufferListStream(r)}if(typeof r==="function"){this._callback=r;const i=function piper(r){if(this._callback){this._callback(r);this._callback=null}}.bind(this);this.on("pipe",(function onPipe(r){r.on("error",i)}));this.on("unpipe",(function onUnpipe(r){r.removeListener("error",i)}));r=null}c._init.call(this,r);s.call(this)}l(BufferListStream,s);Object.assign(BufferListStream.prototype,c.prototype);BufferListStream.prototype._new=function _new(r){return new BufferListStream(r)};BufferListStream.prototype._write=function _write(r,i,a){this._appendBuffer(r);if(typeof a==="function"){a()}};BufferListStream.prototype._read=function _read(r){if(!this.length){return this.push(null)}r=Math.min(r,this.length);this.push(this.slice(0,r));this.consume(r)};BufferListStream.prototype.end=function end(r){s.prototype.end.call(this,r);if(this._callback){this._callback(null,this.slice());this._callback=null}};BufferListStream.prototype._destroy=function _destroy(r,i){this._bufs.length=0;this.length=0;i(r)};BufferListStream.prototype._isBufferList=function _isBufferList(r){return r instanceof BufferListStream||r instanceof c||BufferListStream.isBufferList(r)};BufferListStream.isBufferList=c.isBufferList;r.exports=BufferListStream;r.exports.BufferListStream=BufferListStream;r.exports.BufferList=c},93860:function(r){(function(i,a){true?r.exports=a():0})(this,(function(){"use strict";var r=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getCjsExportFromNamespace(r){return r&&r["default"]||r}var load=function(r,i,a={}){var s,l,c;for(s in i){c=i[s];a[s]=(l=r[s])!=null?l:c}return a};var overwrite=function(r,i,a={}){var s,l;for(s in r){l=r[s];if(i[s]!==void 0){a[s]=l}}return a};var i={load:load,overwrite:overwrite};var a;a=class DLList{constructor(r,i){this.incr=r;this.decr=i;this._first=null;this._last=null;this.length=0}push(r){var i;this.length++;if(typeof this.incr==="function"){this.incr()}i={value:r,prev:this._last,next:null};if(this._last!=null){this._last.next=i;this._last=i}else{this._first=this._last=i}return void 0}shift(){var r;if(this._first==null){return}else{this.length--;if(typeof this.decr==="function"){this.decr()}}r=this._first.value;if((this._first=this._first.next)!=null){this._first.prev=null}else{this._last=null}return r}first(){if(this._first!=null){return this._first.value}}getArray(){var r,i,a;r=this._first;a=[];while(r!=null){a.push((i=r,r=r.next,i.value))}return a}forEachShift(r){var i;i=this.shift();while(i!=null){r(i),i=this.shift()}return void 0}debug(){var r,i,a,s,l;r=this._first;l=[];while(r!=null){l.push((i=r,r=r.next,{value:i.value,prev:(a=i.prev)!=null?a.value:void 0,next:(s=i.next)!=null?s.value:void 0}))}return l}};var s=a;var l;l=class Events{constructor(r){this.instance=r;this._events={};if(this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null){throw new Error("An Emitter already exists for this object")}this.instance.on=(r,i)=>this._addListener(r,"many",i);this.instance.once=(r,i)=>this._addListener(r,"once",i);this.instance.removeAllListeners=(r=null)=>{if(r!=null){return delete this._events[r]}else{return this._events={}}}}_addListener(r,i,a){var s;if((s=this._events)[r]==null){s[r]=[]}this._events[r].push({cb:a,status:i});return this.instance}listenerCount(r){if(this._events[r]!=null){return this._events[r].length}else{return 0}}async trigger(r,...i){var a,s;try{if(r!=="debug"){this.trigger("debug",`Event triggered: ${r}`,i)}if(this._events[r]==null){return}this._events[r]=this._events[r].filter((function(r){return r.status!=="none"}));s=this._events[r].map((async r=>{var a,s;if(r.status==="none"){return}if(r.status==="once"){r.status="none"}try{s=typeof r.cb==="function"?r.cb(...i):void 0;if(typeof(s!=null?s.then:void 0)==="function"){return await s}else{return s}}catch(r){a=r;{this.trigger("error",a)}return null}}));return(await Promise.all(s)).find((function(r){return r!=null}))}catch(r){a=r;{this.trigger("error",a)}return null}}};var c=l;var p,d,u;p=s;d=c;u=class Queues{constructor(r){var i;this.Events=new d(this);this._length=0;this._lists=function(){var a,s,l;l=[];for(i=a=1,s=r;1<=s?a<=s:a>=s;i=1<=s?++a:--a){l.push(new p((()=>this.incr()),(()=>this.decr())))}return l}.call(this)}incr(){if(this._length++===0){return this.Events.trigger("leftzero")}}decr(){if(--this._length===0){return this.Events.trigger("zero")}}push(r){return this._lists[r.options.priority].push(r)}queued(r){if(r!=null){return this._lists[r].length}else{return this._length}}shiftAll(r){return this._lists.forEach((function(i){return i.forEachShift(r)}))}getFirst(r=this._lists){var i,a,s;for(i=0,a=r.length;i0){return s}}return[]}shiftLastFrom(r){return this.getFirst(this._lists.slice(r).reverse()).shift()}};var A=u;var h;h=class BottleneckError extends Error{};var g=h;var y,E,b,C,v;C=10;E=5;v=i;y=g;b=class Job{constructor(r,i,a,s,l,c,p,d){this.task=r;this.args=i;this.rejectOnDrop=l;this.Events=c;this._states=p;this.Promise=d;this.options=v.load(a,s);this.options.priority=this._sanitizePriority(this.options.priority);if(this.options.id===s.id){this.options.id=`${this.options.id}-${this._randomIndex()}`}this.promise=new this.Promise(((r,i)=>{this._resolve=r;this._reject=i}));this.retryCount=0}_sanitizePriority(r){var i;i=~~r!==r?E:r;if(i<0){return 0}else if(i>C-1){return C-1}else{return i}}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:r,message:i="This job has been dropped by Bottleneck"}={}){if(this._states.remove(this.options.id)){if(this.rejectOnDrop){this._reject(r!=null?r:new y(i))}this.Events.trigger("dropped",{args:this.args,options:this.options,task:this.task,promise:this.promise});return true}else{return false}}_assertStatus(r){var i;i=this._states.jobStatus(this.options.id);if(!(i===r||r==="DONE"&&i===null)){throw new y(`Invalid job status ${i}, expected ${r}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}}doReceive(){this._states.start(this.options.id);return this.Events.trigger("received",{args:this.args,options:this.options})}doQueue(r,i){this._assertStatus("RECEIVED");this._states.next(this.options.id);return this.Events.trigger("queued",{args:this.args,options:this.options,reachedHWM:r,blocked:i})}doRun(){if(this.retryCount===0){this._assertStatus("QUEUED");this._states.next(this.options.id)}else{this._assertStatus("EXECUTING")}return this.Events.trigger("scheduled",{args:this.args,options:this.options})}async doExecute(r,i,a,s){var l,c,p;if(this.retryCount===0){this._assertStatus("RUNNING");this._states.next(this.options.id)}else{this._assertStatus("EXECUTING")}c={args:this.args,options:this.options,retryCount:this.retryCount};this.Events.trigger("executing",c);try{p=await(r!=null?r.schedule(this.options,this.task,...this.args):this.task(...this.args));if(i()){this.doDone(c);await s(this.options,c);this._assertStatus("DONE");return this._resolve(p)}}catch(r){l=r;return this._onFailure(l,c,i,a,s)}}doExpire(r,i,a){var s,l;if(this._states.jobStatus(this.options.id==="RUNNING")){this._states.next(this.options.id)}this._assertStatus("EXECUTING");l={args:this.args,options:this.options,retryCount:this.retryCount};s=new y(`This job timed out after ${this.options.expiration} ms.`);return this._onFailure(s,l,r,i,a)}async _onFailure(r,i,a,s,l){var c,p;if(a()){c=await this.Events.trigger("failed",r,i);if(c!=null){p=~~c;this.Events.trigger("retry",`Retrying ${this.options.id} after ${p} ms`,i);this.retryCount++;return s(p)}else{this.doDone(i);await l(this.options,i);this._assertStatus("DONE");return this._reject(r)}}}doDone(r){this._assertStatus("EXECUTING");this._states.next(this.options.id);return this.Events.trigger("done",r)}};var B=b;var I,w,S;S=i;I=g;w=class LocalDatastore{constructor(r,i,a){this.instance=r;this.storeOptions=i;this.clientId=this.instance._randomIndex();S.load(a,a,this);this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now();this._running=0;this._done=0;this._unblockTime=0;this.ready=this.Promise.resolve();this.clients={};this._startHeartbeat()}_startHeartbeat(){var r;if(this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)){return typeof(r=this.heartbeat=setInterval((()=>{var r,i,a,s,l;s=Date.now();if(this.storeOptions.reservoirRefreshInterval!=null&&s>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval){this._lastReservoirRefresh=s;this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount;this.instance._drainAll(this.computeCapacity())}if(this.storeOptions.reservoirIncreaseInterval!=null&&s>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval){({reservoirIncreaseAmount:r,reservoirIncreaseMaximum:a,reservoir:l}=this.storeOptions);this._lastReservoirIncrease=s;i=a!=null?Math.min(r,a-l):r;if(i>0){this.storeOptions.reservoir+=i;return this.instance._drainAll(this.computeCapacity())}}}),this.heartbeatInterval)).unref==="function"?r.unref():void 0}else{return clearInterval(this.heartbeat)}}async __publish__(r){await this.yieldLoop();return this.instance.Events.trigger("message",r.toString())}async __disconnect__(r){await this.yieldLoop();clearInterval(this.heartbeat);return this.Promise.resolve()}yieldLoop(r=0){return new this.Promise((function(i,a){return setTimeout(i,r)}))}computePenalty(){var r;return(r=this.storeOptions.penalty)!=null?r:15*this.storeOptions.minTime||5e3}async __updateSettings__(r){await this.yieldLoop();S.overwrite(r,r,this.storeOptions);this._startHeartbeat();this.instance._drainAll(this.computeCapacity());return true}async __running__(){await this.yieldLoop();return this._running}async __queued__(){await this.yieldLoop();return this.instance.queued()}async __done__(){await this.yieldLoop();return this._done}async __groupCheck__(r){await this.yieldLoop();return this._nextRequest+this.timeout=r}check(r,i){return this.conditionsCheck(r)&&this._nextRequest-i<=0}async __check__(r){var i;await this.yieldLoop();i=Date.now();return this.check(r,i)}async __register__(r,i,a){var s,l;await this.yieldLoop();s=Date.now();if(this.conditionsCheck(i)){this._running+=i;if(this.storeOptions.reservoir!=null){this.storeOptions.reservoir-=i}l=Math.max(this._nextRequest-s,0);this._nextRequest=s+l+this.storeOptions.minTime;return{success:true,wait:l,reservoir:this.storeOptions.reservoir}}else{return{success:false}}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(r,i){var a,s,l;await this.yieldLoop();if(this.storeOptions.maxConcurrent!=null&&i>this.storeOptions.maxConcurrent){throw new I(`Impossible to add a job having a weight of ${i} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`)}s=Date.now();l=this.storeOptions.highWater!=null&&r===this.storeOptions.highWater&&!this.check(i,s);a=this.strategyIsBlock()&&(l||this.isBlocked(s));if(a){this._unblockTime=s+this.computePenalty();this._nextRequest=this._unblockTime+this.storeOptions.minTime;this.instance._dropAllQueued()}return{reachedHWM:l,blocked:a,strategy:this.storeOptions.strategy}}async __free__(r,i){await this.yieldLoop();this._running-=i;this._done+=i;this.instance._drainAll(this.computeCapacity());return{running:this._running}}};var Q=w;var x,N;x=g;N=class States{constructor(r){this.status=r;this._jobs={};this.counts=this.status.map((function(){return 0}))}next(r){var i,a;i=this._jobs[r];a=i+1;if(i!=null&&a{r[this.status[a]]=i;return r}),{})}};var R=N;var T,D;T=s;D=class Sync{constructor(r,i){this.schedule=this.schedule.bind(this);this.name=r;this.Promise=i;this._running=0;this._queue=new T}isEmpty(){return this._queue.length===0}async _tryToRun(){var r,i,a,s,l,c,p;if(this._running<1&&this._queue.length>0){this._running++;({task:p,args:r,resolve:l,reject:s}=this._queue.shift());i=await async function(){try{c=await p(...r);return function(){return l(c)}}catch(r){a=r;return function(){return s(a)}}}();this._running--;this._tryToRun();return i()}}schedule(r,...i){var a,s,l;l=s=null;a=new this.Promise((function(r,i){l=r;return s=i}));this._queue.push({task:r,args:i,resolve:l,reject:s});this._tryToRun();return a}};var k=D;var _="2.19.5";var O={version:_};var P=Object.freeze({version:_,default:O});var require$$2=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var require$$3=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var require$$4=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var L,M,U,q,H,j;j=i;L=c;q=require$$2;U=require$$3;H=require$$4;M=function(){class Group{constructor(r={}){this.deleteKey=this.deleteKey.bind(this);this.limiterOptions=r;j.load(this.limiterOptions,this.defaults,this);this.Events=new L(this);this.instances={};this.Bottleneck=le;this._startAutoCleanup();this.sharedConnection=this.connection!=null;if(this.connection==null){if(this.limiterOptions.datastore==="redis"){this.connection=new q(Object.assign({},this.limiterOptions,{Events:this.Events}))}else if(this.limiterOptions.datastore==="ioredis"){this.connection=new U(Object.assign({},this.limiterOptions,{Events:this.Events}))}}}key(r=""){var i;return(i=this.instances[r])!=null?i:(()=>{var i;i=this.instances[r]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${r}`,timeout:this.timeout,connection:this.connection}));this.Events.trigger("created",i,r);return i})()}async deleteKey(r=""){var i,a;a=this.instances[r];if(this.connection){i=await this.connection.__runCommand__(["del",...H.allKeys(`${this.id}-${r}`)])}if(a!=null){delete this.instances[r];await a.disconnect()}return a!=null||i>0}limiters(){var r,i,a,s;i=this.instances;a=[];for(r in i){s=i[r];a.push({key:r,limiter:s})}return a}keys(){return Object.keys(this.instances)}async clusterKeys(){var r,i,a,s,l,c,p,d,u;if(this.connection==null){return this.Promise.resolve(this.keys())}c=[];r=null;u=`b_${this.id}-`.length;i="_settings".length;while(r!==0){[d,a]=await this.connection.__runCommand__(["scan",r!=null?r:0,"match",`b_${this.id}-*_settings`,"count",1e4]);r=~~d;for(s=0,p=a.length;s{var r,i,a,s,l,c;l=Date.now();a=this.instances;s=[];for(i in a){c=a[i];try{if(await c._store.__groupCheck__(l)){s.push(this.deleteKey(i))}else{s.push(void 0)}}catch(i){r=i;s.push(c.Events.trigger("error",r))}}return s}),this.timeout/2)).unref==="function"?r.unref():void 0}updateSettings(r={}){j.overwrite(r,this.defaults,this);j.overwrite(r,r,this.limiterOptions);if(r.timeout!=null){return this._startAutoCleanup()}}disconnect(r=true){var i;if(!this.sharedConnection){return(i=this.connection)!=null?i.disconnect(r):void 0}}}Group.prototype.defaults={timeout:1e3*60*5,connection:null,Promise:Promise,id:"group-key"};return Group}.call(r);var G=M;var z,V,J;J=i;V=c;z=function(){class Batcher{constructor(r={}){this.options=r;J.load(this.options,this.defaults,this);this.Events=new V(this);this._arr=[];this._resetPromise();this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise(((r,i)=>this._resolve=r))}_flush(){clearTimeout(this._timeout);this._lastFlush=Date.now();this._resolve();this.Events.trigger("batch",this._arr);this._arr=[];return this._resetPromise()}add(r){var i;this._arr.push(r);i=this._promise;if(this._arr.length===this.maxSize){this._flush()}else if(this.maxTime!=null&&this._arr.length===1){this._timeout=setTimeout((()=>this._flush()),this.maxTime)}return i}}Batcher.prototype.defaults={maxTime:null,maxSize:null,Promise:Promise};return Batcher}.call(r);var Y=z;var require$$4$1=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var W=getCjsExportFromNamespace(P);var X,K,$,Z,ee,te,re,ie,ne,ae,se,oe=[].splice;te=10;K=5;se=i;re=A;Z=B;ee=Q;ie=require$$4$1;$=c;ne=R;ae=k;X=function(){class Bottleneck{constructor(r={},...i){var a,s;this._addToQueue=this._addToQueue.bind(this);this._validateOptions(r,i);se.load(r,this.instanceDefaults,this);this._queues=new re(te);this._scheduled={};this._states=new ne(["RECEIVED","QUEUED","RUNNING","EXECUTING"].concat(this.trackDoneStatus?["DONE"]:[]));this._limiter=null;this.Events=new $(this);this._submitLock=new ae("submit",this.Promise);this._registerLock=new ae("register",this.Promise);s=se.load(r,this.storeDefaults,{});this._store=function(){if(this.datastore==="redis"||this.datastore==="ioredis"||this.connection!=null){a=se.load(r,this.redisStoreDefaults,{});return new ie(this,s,a)}else if(this.datastore==="local"){a=se.load(r,this.localStoreDefaults,{});return new ee(this,s,a)}else{throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}}.call(this);this._queues.on("leftzero",(()=>{var r;return(r=this._store.heartbeat)!=null?typeof r.ref==="function"?r.ref():void 0:void 0}));this._queues.on("zero",(()=>{var r;return(r=this._store.heartbeat)!=null?typeof r.unref==="function"?r.unref():void 0:void 0}))}_validateOptions(r,i){if(!(r!=null&&typeof r==="object"&&i.length===0)){throw new Bottleneck.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.")}}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(r){return this._store.__publish__(r)}disconnect(r=true){return this._store.__disconnect__(r)}chain(r){this._limiter=r;return this}queued(r){return this._queues.queued(r)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(r){return this._states.jobStatus(r)}jobs(r){return this._states.statusJobs(r)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(r=1){return this._store.__check__(r)}_clearGlobalState(r){if(this._scheduled[r]!=null){clearTimeout(this._scheduled[r].expiration);delete this._scheduled[r];return true}else{return false}}async _free(r,i,a,s){var l,c;try{({running:c}=await this._store.__free__(r,a.weight));this.Events.trigger("debug",`Freed ${a.id}`,s);if(c===0&&this.empty()){return this.Events.trigger("idle")}}catch(r){l=r;return this.Events.trigger("error",l)}}_run(r,i,a){var s,l,c;i.doRun();s=this._clearGlobalState.bind(this,r);c=this._run.bind(this,r,i);l=this._free.bind(this,r,i);return this._scheduled[r]={timeout:setTimeout((()=>i.doExecute(this._limiter,s,c,l)),a),expiration:i.options.expiration!=null?setTimeout((function(){return i.doExpire(s,c,l)}),a+i.options.expiration):void 0,job:i}}_drainOne(r){return this._registerLock.schedule((()=>{var i,a,s,l,c;if(this.queued()===0){return this.Promise.resolve(null)}c=this._queues.getFirst();({options:l,args:i}=s=c.first());if(r!=null&&l.weight>r){return this.Promise.resolve(null)}this.Events.trigger("debug",`Draining ${l.id}`,{args:i,options:l});a=this._randomIndex();return this._store.__register__(a,l.weight,l.expiration).then((({success:r,wait:p,reservoir:d})=>{var u;this.Events.trigger("debug",`Drained ${l.id}`,{success:r,args:i,options:l});if(r){c.shift();u=this.empty();if(u){this.Events.trigger("empty")}if(d===0){this.Events.trigger("depleted",u)}this._run(a,s,p);return this.Promise.resolve(l.weight)}else{return this.Promise.resolve(null)}}))}))}_drainAll(r,i=0){return this._drainOne(r).then((a=>{var s;if(a!=null){s=r!=null?r-a:r;return this._drainAll(s,i+a)}else{return this.Promise.resolve(i)}})).catch((r=>this.Events.trigger("error",r)))}_dropAllQueued(r){return this._queues.shiftAll((function(i){return i.doDrop({message:r})}))}stop(r={}){var i,a;r=se.load(r,this.stopDefaults);a=r=>{var i;i=()=>{var i;i=this._states.counts;return i[0]+i[1]+i[2]+i[3]===r};return new this.Promise(((r,a)=>{if(i()){return r()}else{return this.on("done",(()=>{if(i()){this.removeAllListeners("done");return r()}}))}}))};i=r.dropWaitingJobs?(this._run=function(i,a){return a.doDrop({message:r.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule((()=>this._submitLock.schedule((()=>{var i,s,l;s=this._scheduled;for(i in s){l=s[i];if(this.jobStatus(l.job.options.id)==="RUNNING"){clearTimeout(l.timeout);clearTimeout(l.expiration);l.job.doDrop({message:r.dropErrorMessage})}}this._dropAllQueued(r.dropErrorMessage);return a(0)}))))):this.schedule({priority:te-1,weight:0},(()=>a(1)));this._receive=function(i){return i._reject(new Bottleneck.prototype.BottleneckError(r.enqueueErrorMessage))};this.stop=()=>this.Promise.reject(new Bottleneck.prototype.BottleneckError("stop() has already been called"));return i}async _addToQueue(r){var i,a,s,l,c,p,d;({args:i,options:l}=r);try{({reachedHWM:c,blocked:a,strategy:d}=await this._store.__submit__(this.queued(),l.weight))}catch(a){s=a;this.Events.trigger("debug",`Could not queue ${l.id}`,{args:i,options:l,error:s});r.doDrop({error:s});return false}if(a){r.doDrop();return true}else if(c){p=d===Bottleneck.prototype.strategy.LEAK?this._queues.shiftLastFrom(l.priority):d===Bottleneck.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(l.priority+1):d===Bottleneck.prototype.strategy.OVERFLOW?r:void 0;if(p!=null){p.doDrop()}if(p==null||d===Bottleneck.prototype.strategy.OVERFLOW){if(p==null){r.doDrop()}return c}}r.doQueue(c,a);this._queues.push(r);await this._drainAll();return c}_receive(r){if(this._states.jobStatus(r.options.id)!=null){r._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${r.options.id})`));return false}else{r.doReceive();return this._submitLock.schedule(this._addToQueue,r)}}submit(...r){var i,a,s,l,c,p,d;if(typeof r[0]==="function"){c=r,[a,...r]=c,[i]=oe.call(r,-1);l=se.load({},this.jobDefaults)}else{p=r,[l,a,...r]=p,[i]=oe.call(r,-1);l=se.load(l,this.jobDefaults)}d=(...r)=>new this.Promise((function(i,s){return a(...r,(function(...r){return(r[0]!=null?s:i)(r)}))}));s=new Z(d,r,l,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise);s.promise.then((function(r){return typeof i==="function"?i(...r):void 0})).catch((function(r){if(Array.isArray(r)){return typeof i==="function"?i(...r):void 0}else{return typeof i==="function"?i(r):void 0}}));return this._receive(s)}schedule(...r){var i,a,s;if(typeof r[0]==="function"){[s,...r]=r;a={}}else{[a,s,...r]=r}i=new Z(s,r,a,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise);this._receive(i);return i.promise}wrap(r){var i,a;i=this.schedule.bind(this);a=function(...a){return i(r.bind(this),...a)};a.withOptions=function(a,...s){return i(a,r,...s)};return a}async updateSettings(r={}){await this._store.__updateSettings__(se.overwrite(r,this.storeDefaults));se.overwrite(r,this.instanceDefaults,this);return this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(r=0){return this._store.__incrementReservoir__(r)}}Bottleneck.default=Bottleneck;Bottleneck.Events=$;Bottleneck.version=Bottleneck.prototype.version=W.version;Bottleneck.strategy=Bottleneck.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3};Bottleneck.BottleneckError=Bottleneck.prototype.BottleneckError=g;Bottleneck.Group=Bottleneck.prototype.Group=G;Bottleneck.RedisConnection=Bottleneck.prototype.RedisConnection=require$$2;Bottleneck.IORedisConnection=Bottleneck.prototype.IORedisConnection=require$$3;Bottleneck.Batcher=Bottleneck.prototype.Batcher=Y;Bottleneck.prototype.jobDefaults={priority:K,weight:1,expiration:null,id:""};Bottleneck.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:Bottleneck.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null};Bottleneck.prototype.localStoreDefaults={Promise:Promise,timeout:null,heartbeatInterval:250};Bottleneck.prototype.redisStoreDefaults={Promise:Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:false,connection:null};Bottleneck.prototype.instanceDefaults={datastore:"local",connection:null,id:"",rejectOnDrop:true,trackDoneStatus:false,Promise:Promise};Bottleneck.prototype.stopDefaults={enqueueErrorMessage:"This limiter has been stopped and cannot accept new jobs.",dropWaitingJobs:true,dropErrorMessage:"This limiter has been stopped."};return Bottleneck}.call(r);var le=X;var ce=le;return ce}))},11469:(r,i,a)=>{var s=a(44350);r.exports=expandTop;var l="\0SLASH"+Math.random()+"\0";var c="\0OPEN"+Math.random()+"\0";var p="\0CLOSE"+Math.random()+"\0";var d="\0COMMA"+Math.random()+"\0";var u="\0PERIOD"+Math.random()+"\0";function numeric(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function escapeBraces(r){return r.split("\\\\").join(l).split("\\{").join(c).split("\\}").join(p).split("\\,").join(d).split("\\.").join(u)}function unescapeBraces(r){return r.split(l).join("\\").split(c).join("{").split(p).join("}").split(d).join(",").split(u).join(".")}function parseCommaParts(r){if(!r)return[""];var i=[];var a=s("{","}",r);if(!a)return r.split(",");var l=a.pre;var c=a.body;var p=a.post;var d=l.split(",");d[d.length-1]+="{"+c+"}";var u=parseCommaParts(p);if(p.length){d[d.length-1]+=u.shift();d.push.apply(d,u)}i.push.apply(i,d);return i}function expandTop(r){if(!r)return[];if(r.substr(0,2)==="{}"){r="\\{\\}"+r.substr(2)}return expand(escapeBraces(r),true).map(unescapeBraces)}function embrace(r){return"{"+r+"}"}function isPadded(r){return/^-?0\d/.test(r)}function lte(r,i){return r<=i}function gte(r,i){return r>=i}function expand(r,i){var a=[];var l=s("{","}",r);if(!l)return[r];var c=l.pre;var d=l.post.length?expand(l.post,false):[""];if(/\$$/.test(l.pre)){for(var u=0;u=0;if(!y&&!E){if(l.post.match(/,.*\}/)){r=l.pre+"{"+l.body+p+l.post;return expand(r)}return[r]}var b;if(y){b=l.body.split(/\.\./)}else{b=parseCommaParts(l.body);if(b.length===1){b=expand(b[0],false).map(embrace);if(b.length===1){return d.map((function(r){return l.pre+b[0]+r}))}}}var C;if(y){var v=numeric(b[0]);var B=numeric(b[1]);var I=Math.max(b[0].length,b[1].length);var w=b.length==3?Math.abs(numeric(b[2])):1;var S=lte;var Q=B0){var D=new Array(T+1).join("0");if(N<0)R="-"+D+R.slice(1);else R=D+R}}}C.push(R)}}else{C=[];for(var k=0;k{var s=a(14300).Buffer;var l=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined"){l=new Int32Array(l)}function ensureBuffer(r){if(s.isBuffer(r)){return r}var i=typeof s.alloc==="function"&&typeof s.from==="function";if(typeof r==="number"){return i?s.alloc(r):new s(r)}else if(typeof r==="string"){return i?s.from(r):new s(r)}else{throw new Error("input must be buffer, number, or string, received "+typeof r)}}function bufferizeInt(r){var i=ensureBuffer(4);i.writeInt32BE(r,0);return i}function _crc32(r,i){r=ensureBuffer(r);if(s.isBuffer(i)){i=i.readUInt32BE(0)}var a=~~i^-1;for(var c=0;c>>8}return a^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};r.exports=crc32},75506:r=>{r.exports=Buffers;function Buffers(r){if(!(this instanceof Buffers))return new Buffers(r);this.buffers=r||[];this.length=this.buffers.reduce((function(r,i){return r+i.length}),0)}Buffers.prototype.push=function(){for(var r=0;r=0?r:this.length-r;var l=[].slice.call(arguments,2);if(i===undefined){i=this.length-s}else if(i>this.length-s){i=this.length-s}for(var r=0;r0){var A=s-d;if(A+i0){var E=l.slice();E.unshift(g);E.push(y);a.splice.apply(a,[u,1].concat(E));u+=E.length;l=[]}else{a.splice(u,1,g,y);u+=2}}else{c.push(a[u].slice(A));a[u]=a[u].slice(0,A);u++}}if(l.length>0){a.splice.apply(a,[u,0].concat(l));u+=l.length}while(c.lengththis.length)i=this.length;var s=0;for(var l=0;l=i-r?Math.min(A+(i-r)-p,u):u;a[d].copy(c,p,A,h);p+=h-A}return c};Buffers.prototype.pos=function(r){if(r<0||r>=this.length)throw new Error("oob");var i=r,a=0,s=null;for(;;){s=this.buffers[a];if(i=this.buffers[a].length){s=0;a++;if(a>=this.buffers.length){return-1}}var u=this.buffers[a][s];if(u==r[l]){if(l==0){c={i:a,j:s,pos:p}}l++;if(l==r.length){return c.pos}}else if(l!=0){a=c.i;s=c.j;p=c.pos;l=0}s++;p++}};Buffers.prototype.toBuffer=function(){return this.slice()};Buffers.prototype.toString=function(r,i,a){return this.slice(i,a).toString(r)}},39416:(r,i,a)=>{var s=a(35363);var l=a(82361).EventEmitter;r.exports=Chainsaw;function Chainsaw(r){var i=Chainsaw.saw(r,{});var a=r.call(i.handlers,i);if(a!==undefined)i.handlers=a;i.record();return i.chain()}Chainsaw.light=function ChainsawLight(r){var i=Chainsaw.saw(r,{});var a=r.call(i.handlers,i);if(a!==undefined)i.handlers=a;return i.chain()};Chainsaw.saw=function(r,i){var a=new l;a.handlers=i;a.actions=[];a.chain=function(){var r=s(a.handlers).map((function(i){if(this.isRoot)return i;var s=this.path;if(typeof i==="function"){this.update((function(){a.actions.push({path:s,args:[].slice.call(arguments)});return r}))}}));process.nextTick((function(){a.emit("begin");a.next()}));return r};a.pop=function(){return a.actions.shift()};a.next=function(){var r=a.pop();if(!r){a.emit("end")}else if(!r.trap){var i=a.handlers;r.path.forEach((function(r){i=i[r]}));i.apply(a.handlers,r.args)}};a.nest=function(i){var s=[].slice.call(arguments,1);var l=true;if(typeof i==="boolean"){var l=i;i=s.shift()}var c=Chainsaw.saw(r,{});var p=r.call(c.handlers,c);if(p!==undefined)c.handlers=p;if("undefined"!==typeof a.step){c.record()}i.apply(c.chain(),s);if(l!==false)c.on("end",a.next)};a.record=function(){upgradeChainsaw(a)};["trap","down","jump"].forEach((function(r){a[r]=function(){throw new Error("To use the trap, down and jump features, please "+"call record() first to start recording actions.")}}));return a};function upgradeChainsaw(r){r.step=0;r.pop=function(){return r.actions[r.step++]};r.trap=function(i,a){var s=Array.isArray(i)?i:[i];r.actions.push({path:s,step:r.step,cb:a,trap:true})};r.down=function(i){var a=(Array.isArray(i)?i:[i]).join("/");var s=r.actions.slice(r.step).map((function(i){if(i.trap&&i.step<=r.step)return false;return i.path.join("/")==a})).indexOf(true);if(s>=0)r.step+=s;else r.step=r.actions.length;var l=r.actions[r.step-1];if(l&&l.trap){r.step=l.step;l.cb()}else r.next()};r.jump=function(i){r.step=i;r.next()}}},36835:(r,i,a)=>{var s=a(73837);var l=a(12781).Stream;var c=a(83908);r.exports=CombinedStream;function CombinedStream(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}s.inherits(CombinedStream,l);CombinedStream.create=function(r){var i=new this;r=r||{};for(var a in r){i[a]=r[a]}return i};CombinedStream.isStreamLike=function(r){return typeof r!=="function"&&typeof r!=="string"&&typeof r!=="boolean"&&typeof r!=="number"&&!Buffer.isBuffer(r)};CombinedStream.prototype.append=function(r){var i=CombinedStream.isStreamLike(r);if(i){if(!(r instanceof c)){var a=c.create(r,{maxDataSize:Infinity,pauseStream:this.pauseStreams});r.on("data",this._checkDataSize.bind(this));r=a}this._handleErrors(r);if(this.pauseStreams){r.pause()}}this._streams.push(r);return this};CombinedStream.prototype.pipe=function(r,i){l.prototype.pipe.call(this,r,i);this.resume();return r};CombinedStream.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};CombinedStream.prototype._realGetNext=function(){var r=this._streams.shift();if(typeof r=="undefined"){this.end();return}if(typeof r!=="function"){this._pipeNext(r);return}var i=r;i(function(r){var i=CombinedStream.isStreamLike(r);if(i){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};CombinedStream.prototype._pipeNext=function(r){this._currentStream=r;var i=CombinedStream.isStreamLike(r);if(i){r.on("end",this._getNext.bind(this));r.pipe(this,{end:false});return}var a=r;this.write(a);this._getNext()};CombinedStream.prototype._handleErrors=function(r){var i=this;r.on("error",(function(r){i._emitError(r)}))};CombinedStream.prototype.write=function(r){this.emit("data",r)};CombinedStream.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};CombinedStream.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};CombinedStream.prototype.end=function(){this._reset();this.emit("end")};CombinedStream.prototype.destroy=function(){this._reset();this.emit("close")};CombinedStream.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};CombinedStream.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var r="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(r))};CombinedStream.prototype._updateDataSize=function(){this.dataSize=0;var r=this;this._streams.forEach((function(i){if(!i.dataSize){return}r.dataSize+=i.dataSize}));if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};CombinedStream.prototype._emitError=function(r){this._reset();this.emit("error",r)}},96514:r=>{var i=r.exports=function(){};i.prototype.getName=function(){};i.prototype.getSize=function(){};i.prototype.getLastModifiedDate=function(){};i.prototype.isDirectory=function(){}},11070:(r,i,a)=>{var s=a(73837).inherits;var l=a(19173).Transform;var c=a(96514);var p=a(92468);var d=r.exports=function(r){if(!(this instanceof d)){return new d(r)}l.call(this,r);this.offset=0;this._archive={finish:false,finished:false,processing:false}};s(d,l);d.prototype._appendBuffer=function(r,i,a){};d.prototype._appendStream=function(r,i,a){};d.prototype._emitErrorCallback=function(r){if(r){this.emit("error",r)}};d.prototype._finish=function(r){};d.prototype._normalizeEntry=function(r){};d.prototype._transform=function(r,i,a){a(null,r)};d.prototype.entry=function(r,i,a){i=i||null;if(typeof a!=="function"){a=this._emitErrorCallback.bind(this)}if(!(r instanceof c)){a(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){a(new Error("unacceptable entry after finish"));return}if(this._archive.processing){a(new Error("already processing an entry"));return}this._archive.processing=true;this._normalizeEntry(r);this._entry=r;i=p.normalizeInputSource(i);if(Buffer.isBuffer(i)){this._appendBuffer(r,i,a)}else if(p.isStream(i)){this._appendStream(r,i,a)}else{this._archive.processing=false;a(new Error("input source must be valid Stream or Buffer instance"));return}return this};d.prototype.finish=function(){if(this._archive.processing){this._archive.finish=true;return}this._finish()};d.prototype.getBytesWritten=function(){return this.offset};d.prototype.write=function(r,i){if(r){this.offset+=r.length}return l.prototype.write.call(this,r,i)}},25984:r=>{r.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}},55865:(r,i,a)=>{var s=a(13593);var l=1<<3;var c=1<<0;var p=1<<2;var d=1<<1;var u=1<<6;var A=1<<11;var h=r.exports=function(){if(!(this instanceof h)){return new h}this.descriptor=false;this.encryption=false;this.utf8=false;this.numberOfShannonFanoTrees=0;this.strongEncryption=false;this.slidingDictionarySize=0;return this};h.prototype.encode=function(){return s.getShortBytes((this.descriptor?l:0)|(this.utf8?A:0)|(this.encryption?c:0)|(this.strongEncryption?u:0))};h.prototype.parse=function(r,i){var a=s.getShortBytesValue(r,i);var g=new h;g.useDataDescriptor((a&l)!==0);g.useUTF8ForNames((a&A)!==0);g.useStrongEncryption((a&u)!==0);g.useEncryption((a&c)!==0);g.setSlidingDictionarySize((a&d)!==0?8192:4096);g.setNumberOfShannonFanoTrees((a&p)!==0?3:2);return g};h.prototype.setNumberOfShannonFanoTrees=function(r){this.numberOfShannonFanoTrees=r};h.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};h.prototype.setSlidingDictionarySize=function(r){this.slidingDictionarySize=r};h.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};h.prototype.useDataDescriptor=function(r){this.descriptor=r};h.prototype.usesDataDescriptor=function(){return this.descriptor};h.prototype.useEncryption=function(r){this.encryption=r};h.prototype.usesEncryption=function(){return this.encryption};h.prototype.useStrongEncryption=function(r){this.strongEncryption=r};h.prototype.usesStrongEncryption=function(){return this.strongEncryption};h.prototype.useUTF8ForNames=function(r){this.utf8=r};h.prototype.usesUTF8ForNames=function(){return this.utf8}},30792:r=>{r.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}},13593:r=>{var i=r.exports={};i.dateToDos=function(r,i){i=i||false;var a=i?r.getFullYear():r.getUTCFullYear();if(a<1980){return 2162688}else if(a>=2044){return 2141175677}var s={year:a,month:i?r.getMonth():r.getUTCMonth(),date:i?r.getDate():r.getUTCDate(),hours:i?r.getHours():r.getUTCHours(),minutes:i?r.getMinutes():r.getUTCMinutes(),seconds:i?r.getSeconds():r.getUTCSeconds()};return s.year-1980<<25|s.month+1<<21|s.date<<16|s.hours<<11|s.minutes<<5|s.seconds/2};i.dosToDate=function(r){return new Date((r>>25&127)+1980,(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(r&31)<<1)};i.fromDosTime=function(r){return i.dosToDate(r.readUInt32LE(0))};i.getEightBytes=function(r){var i=Buffer.alloc(8);i.writeUInt32LE(r%4294967296,0);i.writeUInt32LE(r/4294967296|0,4);return i};i.getShortBytes=function(r){var i=Buffer.alloc(2);i.writeUInt16LE((r&65535)>>>0,0);return i};i.getShortBytesValue=function(r,i){return r.readUInt16LE(i)};i.getLongBytes=function(r){var i=Buffer.alloc(4);i.writeUInt32LE((r&4294967295)>>>0,0);return i};i.getLongBytesValue=function(r,i){return r.readUInt32LE(i)};i.toDosTime=function(r){return i.getLongBytes(i.dateToDos(r))}},32036:(r,i,a)=>{var s=a(73837).inherits;var l=a(43766);var c=a(96514);var p=a(55865);var d=a(30792);var u=a(25984);var A=a(13593);var h=r.exports=function(r){if(!(this instanceof h)){return new h(r)}c.call(this);this.platform=u.PLATFORM_FAT;this.method=-1;this.name=null;this.size=0;this.csize=0;this.gpb=new p;this.crc=0;this.time=-1;this.minver=u.MIN_VERSION_INITIAL;this.mode=-1;this.extra=null;this.exattr=0;this.inattr=0;this.comment=null;if(r){this.setName(r)}};s(h,c);h.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};h.prototype.getComment=function(){return this.comment!==null?this.comment:""};h.prototype.getCompressedSize=function(){return this.csize};h.prototype.getCrc=function(){return this.crc};h.prototype.getExternalAttributes=function(){return this.exattr};h.prototype.getExtra=function(){return this.extra!==null?this.extra:u.EMPTY};h.prototype.getGeneralPurposeBit=function(){return this.gpb};h.prototype.getInternalAttributes=function(){return this.inattr};h.prototype.getLastModifiedDate=function(){return this.getTime()};h.prototype.getLocalFileDataExtra=function(){return this.getExtra()};h.prototype.getMethod=function(){return this.method};h.prototype.getName=function(){return this.name};h.prototype.getPlatform=function(){return this.platform};h.prototype.getSize=function(){return this.size};h.prototype.getTime=function(){return this.time!==-1?A.dosToDate(this.time):-1};h.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};h.prototype.getUnixMode=function(){return this.platform!==u.PLATFORM_UNIX?0:this.getExternalAttributes()>>u.SHORT_SHIFT&u.SHORT_MASK};h.prototype.getVersionNeededToExtract=function(){return this.minver};h.prototype.setComment=function(r){if(Buffer.byteLength(r)!==r.length){this.getGeneralPurposeBit().useUTF8ForNames(true)}this.comment=r};h.prototype.setCompressedSize=function(r){if(r<0){throw new Error("invalid entry compressed size")}this.csize=r};h.prototype.setCrc=function(r){if(r<0){throw new Error("invalid entry crc32")}this.crc=r};h.prototype.setExternalAttributes=function(r){this.exattr=r>>>0};h.prototype.setExtra=function(r){this.extra=r};h.prototype.setGeneralPurposeBit=function(r){if(!(r instanceof p)){throw new Error("invalid entry GeneralPurposeBit")}this.gpb=r};h.prototype.setInternalAttributes=function(r){this.inattr=r};h.prototype.setMethod=function(r){if(r<0){throw new Error("invalid entry compression method")}this.method=r};h.prototype.setName=function(r,i=false){r=l(r,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"");if(i){r=`/${r}`}if(Buffer.byteLength(r)!==r.length){this.getGeneralPurposeBit().useUTF8ForNames(true)}this.name=r};h.prototype.setPlatform=function(r){this.platform=r};h.prototype.setSize=function(r){if(r<0){throw new Error("invalid entry size")}this.size=r};h.prototype.setTime=function(r,i){if(!(r instanceof Date)){throw new Error("invalid entry time")}this.time=A.dateToDos(r,i)};h.prototype.setUnixMode=function(r){r|=this.isDirectory()?u.S_IFDIR:u.S_IFREG;var i=0;i|=r<u.ZIP64_MAGIC||this.size>u.ZIP64_MAGIC}},46094:(r,i,a)=>{var s=a(73837).inherits;var l=a(66066);var{CRC32Stream:c}=a(25547);var{DeflateCRC32Stream:p}=a(25547);var d=a(11070);var u=a(32036);var A=a(55865);var h=a(25984);var g=a(92468);var y=a(13593);var E=r.exports=function(r){if(!(this instanceof E)){return new E(r)}r=this.options=this._defaults(r);d.call(this,r);this._entry=null;this._entries=[];this._archive={centralLength:0,centralOffset:0,comment:"",finish:false,finished:false,processing:false,forceZip64:r.forceZip64,forceLocalTime:r.forceLocalTime}};s(E,d);E.prototype._afterAppend=function(r){this._entries.push(r);if(r.getGeneralPurposeBit().usesDataDescriptor()){this._writeDataDescriptor(r)}this._archive.processing=false;this._entry=null;if(this._archive.finish&&!this._archive.finished){this._finish()}};E.prototype._appendBuffer=function(r,i,a){if(i.length===0){r.setMethod(h.METHOD_STORED)}var s=r.getMethod();if(s===h.METHOD_STORED){r.setSize(i.length);r.setCompressedSize(i.length);r.setCrc(l.unsigned(i))}this._writeLocalFileHeader(r);if(s===h.METHOD_STORED){this.write(i);this._afterAppend(r);a(null,r);return}else if(s===h.METHOD_DEFLATED){this._smartStream(r,a).end(i);return}else{a(new Error("compression method "+s+" not implemented"));return}};E.prototype._appendStream=function(r,i,a){r.getGeneralPurposeBit().useDataDescriptor(true);r.setVersionNeededToExtract(h.MIN_VERSION_DATA_DESCRIPTOR);this._writeLocalFileHeader(r);var s=this._smartStream(r,a);i.once("error",(function(r){s.emit("error",r);s.end()}));i.pipe(s)};E.prototype._defaults=function(r){if(typeof r!=="object"){r={}}if(typeof r.zlib!=="object"){r.zlib={}}if(typeof r.zlib.level!=="number"){r.zlib.level=h.ZLIB_BEST_SPEED}r.forceZip64=!!r.forceZip64;r.forceLocalTime=!!r.forceLocalTime;return r};E.prototype._finish=function(){this._archive.centralOffset=this.offset;this._entries.forEach(function(r){this._writeCentralFileHeader(r)}.bind(this));this._archive.centralLength=this.offset-this._archive.centralOffset;if(this.isZip64()){this._writeCentralDirectoryZip64()}this._writeCentralDirectoryEnd();this._archive.processing=false;this._archive.finish=true;this._archive.finished=true;this.end()};E.prototype._normalizeEntry=function(r){if(r.getMethod()===-1){r.setMethod(h.METHOD_DEFLATED)}if(r.getMethod()===h.METHOD_DEFLATED){r.getGeneralPurposeBit().useDataDescriptor(true);r.setVersionNeededToExtract(h.MIN_VERSION_DATA_DESCRIPTOR)}if(r.getTime()===-1){r.setTime(new Date,this._archive.forceLocalTime)}r._offsets={file:0,data:0,contents:0}};E.prototype._smartStream=function(r,i){var a=r.getMethod()===h.METHOD_DEFLATED;var s=a?new p(this.options.zlib):new c;var l=null;function handleStuff(){var a=s.digest().readUInt32BE(0);r.setCrc(a);r.setSize(s.size());r.setCompressedSize(s.size(true));this._afterAppend(r);i(l,r)}s.once("end",handleStuff.bind(this));s.once("error",(function(r){l=r}));s.pipe(this,{end:false});return s};E.prototype._writeCentralDirectoryEnd=function(){var r=this._entries.length;var i=this._archive.centralLength;var a=this._archive.centralOffset;if(this.isZip64()){r=h.ZIP64_MAGIC_SHORT;i=h.ZIP64_MAGIC;a=h.ZIP64_MAGIC}this.write(y.getLongBytes(h.SIG_EOCD));this.write(h.SHORT_ZERO);this.write(h.SHORT_ZERO);this.write(y.getShortBytes(r));this.write(y.getShortBytes(r));this.write(y.getLongBytes(i));this.write(y.getLongBytes(a));var s=this.getComment();var l=Buffer.byteLength(s);this.write(y.getShortBytes(l));this.write(s)};E.prototype._writeCentralDirectoryZip64=function(){this.write(y.getLongBytes(h.SIG_ZIP64_EOCD));this.write(y.getEightBytes(44));this.write(y.getShortBytes(h.MIN_VERSION_ZIP64));this.write(y.getShortBytes(h.MIN_VERSION_ZIP64));this.write(h.LONG_ZERO);this.write(h.LONG_ZERO);this.write(y.getEightBytes(this._entries.length));this.write(y.getEightBytes(this._entries.length));this.write(y.getEightBytes(this._archive.centralLength));this.write(y.getEightBytes(this._archive.centralOffset));this.write(y.getLongBytes(h.SIG_ZIP64_EOCD_LOC));this.write(h.LONG_ZERO);this.write(y.getEightBytes(this._archive.centralOffset+this._archive.centralLength));this.write(y.getLongBytes(1))};E.prototype._writeCentralFileHeader=function(r){var i=r.getGeneralPurposeBit();var a=r.getMethod();var s=r._offsets;var l=r.getSize();var c=r.getCompressedSize();if(r.isZip64()||s.file>h.ZIP64_MAGIC){l=h.ZIP64_MAGIC;c=h.ZIP64_MAGIC;r.setVersionNeededToExtract(h.MIN_VERSION_ZIP64);var p=Buffer.concat([y.getShortBytes(h.ZIP64_EXTRA_ID),y.getShortBytes(24),y.getEightBytes(r.getSize()),y.getEightBytes(r.getCompressedSize()),y.getEightBytes(s.file)],28);r.setExtra(p)}this.write(y.getLongBytes(h.SIG_CFH));this.write(y.getShortBytes(r.getPlatform()<<8|h.VERSION_MADEBY));this.write(y.getShortBytes(r.getVersionNeededToExtract()));this.write(i.encode());this.write(y.getShortBytes(a));this.write(y.getLongBytes(r.getTimeDos()));this.write(y.getLongBytes(r.getCrc()));this.write(y.getLongBytes(c));this.write(y.getLongBytes(l));var d=r.getName();var u=r.getComment();var A=r.getCentralDirectoryExtra();if(i.usesUTF8ForNames()){d=Buffer.from(d);u=Buffer.from(u)}this.write(y.getShortBytes(d.length));this.write(y.getShortBytes(A.length));this.write(y.getShortBytes(u.length));this.write(h.SHORT_ZERO);this.write(y.getShortBytes(r.getInternalAttributes()));this.write(y.getLongBytes(r.getExternalAttributes()));if(s.file>h.ZIP64_MAGIC){this.write(y.getLongBytes(h.ZIP64_MAGIC))}else{this.write(y.getLongBytes(s.file))}this.write(d);this.write(A);this.write(u)};E.prototype._writeDataDescriptor=function(r){this.write(y.getLongBytes(h.SIG_DD));this.write(y.getLongBytes(r.getCrc()));if(r.isZip64()){this.write(y.getEightBytes(r.getCompressedSize()));this.write(y.getEightBytes(r.getSize()))}else{this.write(y.getLongBytes(r.getCompressedSize()));this.write(y.getLongBytes(r.getSize()))}};E.prototype._writeLocalFileHeader=function(r){var i=r.getGeneralPurposeBit();var a=r.getMethod();var s=r.getName();var l=r.getLocalFileDataExtra();if(r.isZip64()){i.useDataDescriptor(true);r.setVersionNeededToExtract(h.MIN_VERSION_ZIP64)}if(i.usesUTF8ForNames()){s=Buffer.from(s)}r._offsets.file=this.offset;this.write(y.getLongBytes(h.SIG_LFH));this.write(y.getShortBytes(r.getVersionNeededToExtract()));this.write(i.encode());this.write(y.getShortBytes(a));this.write(y.getLongBytes(r.getTimeDos()));r._offsets.data=this.offset;if(i.usesDataDescriptor()){this.write(h.LONG_ZERO);this.write(h.LONG_ZERO);this.write(h.LONG_ZERO)}else{this.write(y.getLongBytes(r.getCrc()));this.write(y.getLongBytes(r.getCompressedSize()));this.write(y.getLongBytes(r.getSize()))}this.write(y.getShortBytes(s.length));this.write(y.getShortBytes(l.length));this.write(s);this.write(l);r._offsets.contents=this.offset};E.prototype.getComment=function(r){return this._archive.comment!==null?this._archive.comment:""};E.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>h.ZIP64_MAGIC_SHORT||this._archive.centralLength>h.ZIP64_MAGIC||this._archive.centralOffset>h.ZIP64_MAGIC};E.prototype.setComment=function(r){this._archive.comment=r}},91374:(r,i,a)=>{r.exports={ArchiveEntry:a(96514),ZipArchiveEntry:a(32036),ArchiveOutputStream:a(11070),ZipArchiveOutputStream:a(46094)}},92468:(r,i,a)=>{var s=a(12781).Stream;var l=a(19173).PassThrough;var c=r.exports={};c.isStream=function(r){return r instanceof s};c.normalizeInputSource=function(r){if(r===null){return Buffer.alloc(0)}else if(typeof r==="string"){return Buffer.from(r)}else if(c.isStream(r)&&!r._readableState){var i=new l;r.pipe(i);return i}return r}},98955:r=>{r.exports=function(r,a){var s=[];for(var l=0;l{function isArray(r){if(Array.isArray){return Array.isArray(r)}return objectToString(r)==="[object Array]"}i.isArray=isArray;function isBoolean(r){return typeof r==="boolean"}i.isBoolean=isBoolean;function isNull(r){return r===null}i.isNull=isNull;function isNullOrUndefined(r){return r==null}i.isNullOrUndefined=isNullOrUndefined;function isNumber(r){return typeof r==="number"}i.isNumber=isNumber;function isString(r){return typeof r==="string"}i.isString=isString;function isSymbol(r){return typeof r==="symbol"}i.isSymbol=isSymbol;function isUndefined(r){return r===void 0}i.isUndefined=isUndefined;function isRegExp(r){return objectToString(r)==="[object RegExp]"}i.isRegExp=isRegExp;function isObject(r){return typeof r==="object"&&r!==null}i.isObject=isObject;function isDate(r){return objectToString(r)==="[object Date]"}i.isDate=isDate;function isError(r){return objectToString(r)==="[object Error]"||r instanceof Error}i.isError=isError;function isFunction(r){return typeof r==="function"}i.isFunction=isFunction;function isPrimitive(r){return r===null||typeof r==="boolean"||typeof r==="number"||typeof r==="string"||typeof r==="symbol"||typeof r==="undefined"}i.isPrimitive=isPrimitive;i.isBuffer=a(14300).Buffer.isBuffer;function objectToString(r){return Object.prototype.toString.call(r)}},61813:(r,i)=>{ +var a=s(63463);var l=s(78443);var Zip=function(r){if(!(this instanceof Zip)){return new Zip(r)}r=this.options=l.defaults(r,{comment:"",forceUTC:false,namePrependSlash:false,store:false});this.supports={directory:true,symlink:true};this.engine=new a(r)};Zip.prototype.append=function(r,i,s){this.engine.entry(r,i,s)};Zip.prototype.finalize=function(){this.engine.finalize()};Zip.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Zip.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};Zip.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};r.exports=Zip},18697:(r,i,s)=>{"use strict";const{SymbolDispose:a}=s(67734);const{AbortError:l,codes:c}=s(76101);const{isNodeStream:d,isWebStream:p,kControllerErrorFunction:u}=s(11283);const A=s(84985);const{ERR_INVALID_ARG_TYPE:h}=c;let g;const validateAbortSignal=(r,i)=>{if(typeof r!=="object"||!("aborted"in r)){throw new h(i,"AbortSignal",r)}};r.exports.addAbortSignal=function addAbortSignal(i,s){validateAbortSignal(i,"signal");if(!d(s)&&!p(s)){throw new h("stream",["ReadableStream","WritableStream","Stream"],s)}return r.exports.addAbortSignalNoValidate(i,s)};r.exports.addAbortSignalNoValidate=function(r,i){if(typeof r!=="object"||!("aborted"in r)){return i}const c=d(i)?()=>{i.destroy(new l(undefined,{cause:r.reason}))}:()=>{i[u](new l(undefined,{cause:r.reason}))};if(r.aborted){c()}else{g=g||s(26346).addAbortListener;const l=g(r,c);A(i,l[a])}return i}},72775:(r,i,s)=>{"use strict";const{StringPrototypeSlice:a,SymbolIterator:l,TypedArrayPrototypeSet:c,Uint8Array:d}=s(67734);const{Buffer:p}=s(14300);const{inspect:u}=s(26346);r.exports=class BufferList{constructor(){this.head=null;this.tail=null;this.length=0}push(r){const i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length}unshift(r){const i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length}shift(){if(this.length===0)return;const r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r}clear(){this.head=this.tail=null;this.length=0}join(r){if(this.length===0)return"";let i=this.head;let s=""+i.data;while((i=i.next)!==null)s+=r+i.data;return s}concat(r){if(this.length===0)return p.alloc(0);const i=p.allocUnsafe(r>>>0);let s=this.head;let a=0;while(s){c(i,s.data,a);a+=s.data.length;s=s.next}return i}consume(r,i){const s=this.head.data;if(rc.length){i+=c;r-=c.length}else{if(r===c.length){i+=c;++l;if(s.next)this.head=s.next;else this.head=this.tail=null}else{i+=a(c,0,r);this.head=s;s.data=a(c,r)}break}++l}while((s=s.next)!==null);this.length-=l;return i}_getBuffer(r){const i=p.allocUnsafe(r);const s=r;let a=this.head;let l=0;do{const p=a.data;if(r>p.length){c(i,p,s-r);r-=p.length}else{if(r===p.length){c(i,p,s-r);++l;if(a.next)this.head=a.next;else this.head=this.tail=null}else{c(i,new d(p.buffer,p.byteOffset,r),s-r);this.head=a;a.data=p.slice(r)}break}++l}while((a=a.next)!==null);this.length-=l;return i}[Symbol.for("nodejs.util.inspect.custom")](r,i){return u(this,{...i,depth:0,customInspect:false})}}},75966:(r,i,s)=>{"use strict";const{pipeline:a}=s(2396);const l=s(60262);const{destroyer:c}=s(30589);const{isNodeStream:d,isReadable:p,isWritable:u,isWebStream:A,isTransformStream:h,isWritableStream:g,isReadableStream:y}=s(11283);const{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:w,ERR_MISSING_ARGS:C}}=s(76101);const v=s(84985);r.exports=function compose(...r){if(r.length===0){throw new C("streams")}if(r.length===1){return l.from(r[0])}const i=[...r];if(typeof r[0]==="function"){r[0]=l.from(r[0])}if(typeof r[r.length-1]==="function"){const i=r.length-1;r[i]=l.from(r[i])}for(let s=0;s0&&!(u(r[s])||g(r[s])||h(r[s]))){throw new w(`streams[${s}]`,i[s],"must be writable")}}let s;let I;let B;let S;let x;function onfinished(r){const i=S;S=null;if(i){i(r)}else if(r){x.destroy(r)}else if(!N&&!_){x.destroy()}}const R=r[0];const Q=a(r,onfinished);const _=!!(u(R)||g(R)||h(R));const N=!!(p(Q)||y(Q)||h(Q));x=new l({writableObjectMode:!!(R!==null&&R!==undefined&&R.writableObjectMode),readableObjectMode:!!(Q!==null&&Q!==undefined&&Q.readableObjectMode),writable:_,readable:N});if(_){if(d(R)){x._write=function(r,i,a){if(R.write(r,i)){a()}else{s=a}};x._final=function(r){R.end();I=r};R.on("drain",(function(){if(s){const r=s;s=null;r()}}))}else if(A(R)){const r=h(R)?R.writable:R;const i=r.getWriter();x._write=async function(r,s,a){try{await i.ready;i.write(r).catch((()=>{}));a()}catch(r){a(r)}};x._final=async function(r){try{await i.ready;i.close().catch((()=>{}));I=r}catch(i){r(i)}}}const r=h(Q)?Q.readable:Q;v(r,(()=>{if(I){const r=I;I=null;r()}}))}if(N){if(d(Q)){Q.on("readable",(function(){if(B){const r=B;B=null;r()}}));Q.on("end",(function(){x.push(null)}));x._read=function(){while(true){const r=Q.read();if(r===null){B=x._read;return}if(!x.push(r)){return}}}}else if(A(Q)){const r=h(Q)?Q.readable:Q;const i=r.getReader();x._read=async function(){while(true){try{const{value:r,done:s}=await i.read();if(!x.push(r)){return}if(s){x.push(null);return}}catch{return}}}}}x._destroy=function(r,i){if(!r&&S!==null){r=new b}B=null;s=null;I=null;if(S===null){i(r)}else{S=i;if(d(Q)){c(Q,r)}}};return x}},30589:(r,i,s)=>{"use strict";const a=s(53568);const{aggregateTwoErrors:l,codes:{ERR_MULTIPLE_CALLBACK:c},AbortError:d}=s(76101);const{Symbol:p}=s(67734);const{kIsDestroyed:u,isDestroyed:A,isFinished:h,isServerRequest:g}=s(11283);const y=p("kDestroy");const b=p("kConstruct");function checkError(r,i,s){if(r){r.stack;if(i&&!i.errored){i.errored=r}if(s&&!s.errored){s.errored=r}}}function destroy(r,i){const s=this._readableState;const a=this._writableState;const c=a||s;if(a!==null&&a!==undefined&&a.destroyed||s!==null&&s!==undefined&&s.destroyed){if(typeof i==="function"){i()}return this}checkError(r,a,s);if(a){a.destroyed=true}if(s){s.destroyed=true}if(!c.constructed){this.once(y,(function(s){_destroy(this,l(s,r),i)}))}else{_destroy(this,r,i)}return this}function _destroy(r,i,s){let l=false;function onDestroy(i){if(l){return}l=true;const c=r._readableState;const d=r._writableState;checkError(i,d,c);if(d){d.closed=true}if(c){c.closed=true}if(typeof s==="function"){s(i)}if(i){a.nextTick(emitErrorCloseNT,r,i)}else{a.nextTick(emitCloseNT,r)}}try{r._destroy(i||null,onDestroy)}catch(i){onDestroy(i)}}function emitErrorCloseNT(r,i){emitErrorNT(r,i);emitCloseNT(r)}function emitCloseNT(r){const i=r._readableState;const s=r._writableState;if(s){s.closeEmitted=true}if(i){i.closeEmitted=true}if(s!==null&&s!==undefined&&s.emitClose||i!==null&&i!==undefined&&i.emitClose){r.emit("close")}}function emitErrorNT(r,i){const s=r._readableState;const a=r._writableState;if(a!==null&&a!==undefined&&a.errorEmitted||s!==null&&s!==undefined&&s.errorEmitted){return}if(a){a.errorEmitted=true}if(s){s.errorEmitted=true}r.emit("error",i)}function undestroy(){const r=this._readableState;const i=this._writableState;if(r){r.constructed=true;r.closed=false;r.closeEmitted=false;r.destroyed=false;r.errored=null;r.errorEmitted=false;r.reading=false;r.ended=r.readable===false;r.endEmitted=r.readable===false}if(i){i.constructed=true;i.destroyed=false;i.closed=false;i.closeEmitted=false;i.errored=null;i.errorEmitted=false;i.finalCalled=false;i.prefinished=false;i.ended=i.writable===false;i.ending=i.writable===false;i.finished=i.writable===false}}function errorOrDestroy(r,i,s){const l=r._readableState;const c=r._writableState;if(c!==null&&c!==undefined&&c.destroyed||l!==null&&l!==undefined&&l.destroyed){return this}if(l!==null&&l!==undefined&&l.autoDestroy||c!==null&&c!==undefined&&c.autoDestroy)r.destroy(i);else if(i){i.stack;if(c&&!c.errored){c.errored=i}if(l&&!l.errored){l.errored=i}if(s){a.nextTick(emitErrorNT,r,i)}else{emitErrorNT(r,i)}}}function construct(r,i){if(typeof r._construct!=="function"){return}const s=r._readableState;const l=r._writableState;if(s){s.constructed=false}if(l){l.constructed=false}r.once(b,i);if(r.listenerCount(b)>1){return}a.nextTick(constructNT,r)}function constructNT(r){let i=false;function onConstruct(s){if(i){errorOrDestroy(r,s!==null&&s!==undefined?s:new c);return}i=true;const l=r._readableState;const d=r._writableState;const p=d||l;if(l){l.constructed=true}if(d){d.constructed=true}if(p.destroyed){r.emit(y,s)}else if(s){errorOrDestroy(r,s,true)}else{a.nextTick(emitConstructNT,r)}}try{r._construct((r=>{a.nextTick(onConstruct,r)}))}catch(r){a.nextTick(onConstruct,r)}}function emitConstructNT(r){r.emit(b)}function isRequest(r){return(r===null||r===undefined?undefined:r.setHeader)&&typeof r.abort==="function"}function emitCloseLegacy(r){r.emit("close")}function emitErrorCloseLegacy(r,i){r.emit("error",i);a.nextTick(emitCloseLegacy,r)}function destroyer(r,i){if(!r||A(r)){return}if(!i&&!h(r)){i=new d}if(g(r)){r.socket=null;r.destroy(i)}else if(isRequest(r)){r.abort()}else if(isRequest(r.req)){r.req.abort()}else if(typeof r.destroy==="function"){r.destroy(i)}else if(typeof r.close==="function"){r.close()}else if(i){a.nextTick(emitErrorCloseLegacy,r,i)}else{a.nextTick(emitCloseLegacy,r)}if(!r.destroyed){r[u]=true}}r.exports={construct:construct,destroyer:destroyer,destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},60262:(r,i,s)=>{"use strict";const{ObjectDefineProperties:a,ObjectGetOwnPropertyDescriptor:l,ObjectKeys:c,ObjectSetPrototypeOf:d}=s(67734);r.exports=Duplex;const p=s(71001);const u=s(78281);d(Duplex.prototype,p.prototype);d(Duplex,p);{const r=c(u.prototype);for(let i=0;i{const a=s(53568);"use strict";const l=s(14300);const{isReadable:c,isWritable:d,isIterable:p,isNodeStream:u,isReadableNodeStream:A,isWritableNodeStream:h,isDuplexNodeStream:g,isReadableStream:y,isWritableStream:b}=s(11283);const w=s(84985);const{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:I}}=s(76101);const{destroyer:B}=s(30589);const S=s(60262);const x=s(71001);const R=s(78281);const{createDeferredPromise:Q}=s(26346);const _=s(66706);const N=globalThis.Blob||l.Blob;const T=typeof N!=="undefined"?function isBlob(r){return r instanceof N}:function isBlob(r){return false};const k=globalThis.AbortController||s(24995).AbortController;const{FunctionPrototypeCall:D}=s(67734);class Duplexify extends S{constructor(r){super(r);if((r===null||r===undefined?undefined:r.readable)===false){this._readableState.readable=false;this._readableState.ended=true;this._readableState.endEmitted=true}if((r===null||r===undefined?undefined:r.writable)===false){this._writableState.writable=false;this._writableState.ending=true;this._writableState.ended=true;this._writableState.finished=true}}}r.exports=function duplexify(r,i){if(g(r)){return r}if(A(r)){return _duplexify({readable:r})}if(h(r)){return _duplexify({writable:r})}if(u(r)){return _duplexify({writable:false,readable:false})}if(y(r)){return _duplexify({readable:x.fromWeb(r)})}if(b(r)){return _duplexify({writable:R.fromWeb(r)})}if(typeof r==="function"){const{value:s,write:l,final:c,destroy:d}=fromAsyncGen(r);if(p(s)){return _(Duplexify,s,{objectMode:true,write:l,final:c,destroy:d})}const u=s===null||s===undefined?undefined:s.then;if(typeof u==="function"){let r;const i=D(u,s,(r=>{if(r!=null){throw new I("nully","body",r)}}),(i=>{B(r,i)}));return r=new Duplexify({objectMode:true,readable:false,write:l,final(r){c((async()=>{try{await i;a.nextTick(r,null)}catch(i){a.nextTick(r,i)}}))},destroy:d})}throw new I("Iterable, AsyncIterable or AsyncFunction",i,s)}if(T(r)){return duplexify(r.arrayBuffer())}if(p(r)){return _(Duplexify,r,{objectMode:true,writable:false})}if(y(r===null||r===undefined?undefined:r.readable)&&b(r===null||r===undefined?undefined:r.writable)){return Duplexify.fromWeb(r)}if(typeof(r===null||r===undefined?undefined:r.writable)==="object"||typeof(r===null||r===undefined?undefined:r.readable)==="object"){const i=r!==null&&r!==undefined&&r.readable?A(r===null||r===undefined?undefined:r.readable)?r===null||r===undefined?undefined:r.readable:duplexify(r.readable):undefined;const s=r!==null&&r!==undefined&&r.writable?h(r===null||r===undefined?undefined:r.writable)?r===null||r===undefined?undefined:r.writable:duplexify(r.writable):undefined;return _duplexify({readable:i,writable:s})}const s=r===null||r===undefined?undefined:r.then;if(typeof s==="function"){let i;D(s,r,(r=>{if(r!=null){i.push(r)}i.push(null)}),(r=>{B(i,r)}));return i=new Duplexify({objectMode:true,writable:false,read(){}})}throw new v(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],r)};function fromAsyncGen(r){let{promise:i,resolve:s}=Q();const l=new k;const c=l.signal;const d=r(async function*(){while(true){const r=i;i=null;const{chunk:l,done:d,cb:p}=await r;a.nextTick(p);if(d)return;if(c.aborted)throw new C(undefined,{cause:c.reason});({promise:i,resolve:s}=Q());yield l}}(),{signal:c});return{value:d,write(r,i,a){const l=s;s=null;l({chunk:r,done:false,cb:a})},final(r){const i=s;s=null;i({done:true,cb:r})},destroy(r,i){l.abort();i(r)}}}function _duplexify(r){const i=r.readable&&typeof r.readable.read!=="function"?x.wrap(r.readable):r.readable;const s=r.writable;let a=!!c(i);let l=!!d(s);let p;let u;let A;let h;let g;function onfinished(r){const i=h;h=null;if(i){i(r)}else if(r){g.destroy(r)}}g=new Duplexify({readableObjectMode:!!(i!==null&&i!==undefined&&i.readableObjectMode),writableObjectMode:!!(s!==null&&s!==undefined&&s.writableObjectMode),readable:a,writable:l});if(l){w(s,(r=>{l=false;if(r){B(i,r)}onfinished(r)}));g._write=function(r,i,a){if(s.write(r,i)){a()}else{p=a}};g._final=function(r){s.end();u=r};s.on("drain",(function(){if(p){const r=p;p=null;r()}}));s.on("finish",(function(){if(u){const r=u;u=null;r()}}))}if(a){w(i,(r=>{a=false;if(r){B(i,r)}onfinished(r)}));i.on("readable",(function(){if(A){const r=A;A=null;r()}}));i.on("end",(function(){g.push(null)}));g._read=function(){while(true){const r=i.read();if(r===null){A=g._read;return}if(!g.push(r)){return}}}}g._destroy=function(r,a){if(!r&&h!==null){r=new C}A=null;p=null;u=null;if(h===null){a(r)}else{h=a;B(s,r);B(i,r)}};return g}},84985:(r,i,s)=>{const a=s(53568);"use strict";const{AbortError:l,codes:c}=s(76101);const{ERR_INVALID_ARG_TYPE:d,ERR_STREAM_PREMATURE_CLOSE:p}=c;const{kEmptyObject:u,once:A}=s(26346);const{validateAbortSignal:h,validateFunction:g,validateObject:y,validateBoolean:b}=s(67164);const{Promise:w,PromisePrototypeThen:C,SymbolDispose:v}=s(67734);const{isClosed:I,isReadable:B,isReadableNodeStream:S,isReadableStream:x,isReadableFinished:R,isReadableErrored:Q,isWritable:_,isWritableNodeStream:N,isWritableStream:T,isWritableFinished:k,isWritableErrored:D,isNodeStream:P,willEmitClose:O,kIsClosedPromise:L}=s(11283);let M;function isRequest(r){return r.setHeader&&typeof r.abort==="function"}const nop=()=>{};function eos(r,i,c){var b,w;if(arguments.length===2){c=i;i=u}else if(i==null){i=u}else{y(i,"options")}g(c,"callback");h(i.signal,"options.signal");c=A(c);if(x(r)||T(r)){return eosWeb(r,i,c)}if(!P(r)){throw new d("stream",["ReadableStream","WritableStream","Stream"],r)}const C=(b=i.readable)!==null&&b!==undefined?b:S(r);const L=(w=i.writable)!==null&&w!==undefined?w:N(r);const U=r._writableState;const j=r._readableState;const onlegacyfinish=()=>{if(!r.writable){onfinish()}};let H=O(r)&&S(r)===C&&N(r)===L;let q=k(r,false);const onfinish=()=>{q=true;if(r.destroyed){H=false}if(H&&(!r.readable||C)){return}if(!C||G){c.call(r)}};let G=R(r,false);const onend=()=>{G=true;if(r.destroyed){H=false}if(H&&(!r.writable||L)){return}if(!L||q){c.call(r)}};const onerror=i=>{c.call(r,i)};let z=I(r);const onclose=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}if(C&&!G&&S(r,true)){if(!R(r,false))return c.call(r,new p)}if(L&&!q){if(!k(r,false))return c.call(r,new p)}c.call(r)};const onclosed=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}c.call(r)};const onrequest=()=>{r.req.on("finish",onfinish)};if(isRequest(r)){r.on("complete",onfinish);if(!H){r.on("abort",onclose)}if(r.req){onrequest()}else{r.on("request",onrequest)}}else if(L&&!U){r.on("end",onlegacyfinish);r.on("close",onlegacyfinish)}if(!H&&typeof r.aborted==="boolean"){r.on("aborted",onclose)}r.on("end",onend);r.on("finish",onfinish);if(i.error!==false){r.on("error",onerror)}r.on("close",onclose);if(z){a.nextTick(onclose)}else if(U!==null&&U!==undefined&&U.errorEmitted||j!==null&&j!==undefined&&j.errorEmitted){if(!H){a.nextTick(onclosed)}}else if(!C&&(!H||B(r))&&(q||_(r)===false)){a.nextTick(onclosed)}else if(!L&&(!H||_(r))&&(G||B(r)===false)){a.nextTick(onclosed)}else if(j&&r.req&&r.aborted){a.nextTick(onclosed)}const cleanup=()=>{c=nop;r.removeListener("aborted",onclose);r.removeListener("complete",onfinish);r.removeListener("abort",onclose);r.removeListener("request",onrequest);if(r.req)r.req.removeListener("finish",onfinish);r.removeListener("end",onlegacyfinish);r.removeListener("close",onlegacyfinish);r.removeListener("finish",onfinish);r.removeListener("end",onend);r.removeListener("error",onerror);r.removeListener("close",onclose)};if(i.signal&&!z){const abort=()=>{const s=c;cleanup();s.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(abort)}else{M=M||s(26346).addAbortListener;const a=M(i.signal,abort);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}return cleanup}function eosWeb(r,i,c){let d=false;let p=nop;if(i.signal){p=()=>{d=true;c.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(p)}else{M=M||s(26346).addAbortListener;const a=M(i.signal,p);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}const resolverFn=(...i)=>{if(!d){a.nextTick((()=>c.apply(r,i)))}};C(r[L].promise,resolverFn,resolverFn);return nop}function finished(r,i){var s;let a=false;if(i===null){i=u}if((s=i)!==null&&s!==undefined&&s.cleanup){b(i.cleanup,"cleanup");a=i.cleanup}return new w(((s,l)=>{const c=eos(r,i,(r=>{if(a){c()}if(r){l(r)}else{s()}}))}))}r.exports=eos;r.exports.finished=finished},66706:(r,i,s)=>{"use strict";const a=s(53568);const{PromisePrototypeThen:l,SymbolAsyncIterator:c,SymbolIterator:d}=s(67734);const{Buffer:p}=s(14300);const{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:A}=s(76101).codes;function from(r,i,s){let h;if(typeof i==="string"||i instanceof p){return new r({objectMode:true,...s,read(){this.push(i);this.push(null)}})}let g;if(i&&i[c]){g=true;h=i[c]()}else if(i&&i[d]){g=false;h=i[d]()}else{throw new u("iterable",["Iterable"],i)}const y=new r({objectMode:true,highWaterMark:1,...s});let b=false;y._read=function(){if(!b){b=true;next()}};y._destroy=function(r,i){l(close(r),(()=>a.nextTick(i,r)),(s=>a.nextTick(i,s||r)))};async function close(r){const i=r!==undefined&&r!==null;const s=typeof h.throw==="function";if(i&&s){const{value:i,done:s}=await h.throw(r);await i;if(s){return}}if(typeof h.return==="function"){const{value:r}=await h.return();await r}}async function next(){for(;;){try{const{value:r,done:i}=g?await h.next():h.next();if(i){y.push(null)}else{const i=r&&typeof r.then==="function"?await r:r;if(i===null){b=false;throw new A}else if(y.push(i)){continue}else{b=false}}}catch(r){y.destroy(r)}break}}return y}r.exports=from},41900:(r,i,s)=>{"use strict";const{ArrayIsArray:a,ObjectSetPrototypeOf:l}=s(67734);const{EventEmitter:c}=s(82361);function Stream(r){c.call(this,r)}l(Stream.prototype,c.prototype);l(Stream,c);Stream.prototype.pipe=function(r,i){const s=this;function ondata(i){if(r.writable&&r.write(i)===false&&s.pause){s.pause()}}s.on("data",ondata);function ondrain(){if(s.readable&&s.resume){s.resume()}}r.on("drain",ondrain);if(!r._isStdio&&(!i||i.end!==false)){s.on("end",onend);s.on("close",onclose)}let a=false;function onend(){if(a)return;a=true;r.end()}function onclose(){if(a)return;a=true;if(typeof r.destroy==="function")r.destroy()}function onerror(r){cleanup();if(c.listenerCount(this,"error")===0){this.emit("error",r)}}prependListener(s,"error",onerror);prependListener(r,"error",onerror);function cleanup(){s.removeListener("data",ondata);r.removeListener("drain",ondrain);s.removeListener("end",onend);s.removeListener("close",onclose);s.removeListener("error",onerror);r.removeListener("error",onerror);s.removeListener("end",cleanup);s.removeListener("close",cleanup);r.removeListener("close",cleanup)}s.on("end",cleanup);s.on("close",cleanup);r.on("close",cleanup);r.emit("pipe",s);return r};function prependListener(r,i,s){if(typeof r.prependListener==="function")return r.prependListener(i,s);if(!r._events||!r._events[i])r.on(i,s);else if(a(r._events[i]))r._events[i].unshift(s);else r._events[i]=[s,r._events[i]]}r.exports={Stream:Stream,prependListener:prependListener}},80953:(r,i,s)=>{"use strict";const a=globalThis.AbortController||s(24995).AbortController;const{codes:{ERR_INVALID_ARG_VALUE:l,ERR_INVALID_ARG_TYPE:c,ERR_MISSING_ARGS:d,ERR_OUT_OF_RANGE:p},AbortError:u}=s(76101);const{validateAbortSignal:A,validateInteger:h,validateObject:g}=s(67164);const y=s(67734).Symbol("kWeak");const b=s(67734).Symbol("kResistStopPropagation");const{finished:w}=s(84985);const C=s(75966);const{addAbortSignalNoValidate:v}=s(18697);const{isWritable:I,isNodeStream:B}=s(11283);const{deprecate:S}=s(26346);const{ArrayPrototypePush:x,Boolean:R,MathFloor:Q,Number:_,NumberIsNaN:N,Promise:T,PromiseReject:k,PromiseResolve:D,PromisePrototypeThen:P,Symbol:O}=s(67734);const L=O("kEmpty");const M=O("kEof");function compose(r,i){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}if(B(r)&&!I(r)){throw new l("stream",r,"must be writable")}const s=C(this,r);if(i!==null&&i!==undefined&&i.signal){v(i.signal,s)}return s}function map(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}let a=1;if((i===null||i===undefined?undefined:i.concurrency)!=null){a=Q(i.concurrency)}let l=a-1;if((i===null||i===undefined?undefined:i.highWaterMark)!=null){l=Q(i.highWaterMark)}h(a,"options.concurrency",1);h(l,"options.highWaterMark",0);l+=a;return async function*map(){const c=s(26346).AbortSignalAny([i===null||i===undefined?undefined:i.signal].filter(R));const d=this;const p=[];const A={signal:c};let h;let g;let y=false;let b=0;function onCatch(){y=true;afterItemProcessed()}function afterItemProcessed(){b-=1;maybeResume()}function maybeResume(){if(g&&!y&&b=l||b>=a)){await new T((r=>{g=r}))}}p.push(M)}catch(r){const i=k(r);P(i,afterItemProcessed,onCatch);p.push(i)}finally{y=true;if(h){h();h=null}}}pump();try{while(true){while(p.length>0){const r=await p[0];if(r===M){return}if(c.aborted){throw new u}if(r!==L){yield r}p.shift();maybeResume()}await new T((r=>{h=r}))}}finally{y=true;if(g){g();g=null}}}.call(this)}function asIndexedPairs(r=undefined){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}return async function*asIndexedPairs(){let i=0;for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u({cause:r.signal.reason})}yield[i++,a]}}.call(this)}async function some(r,i=undefined){for await(const s of filter.call(this,r,i)){return true}return false}async function every(r,i=undefined){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}return!await some.call(this,(async(...i)=>!await r(...i)),i)}async function find(r,i){for await(const s of filter.call(this,r,i)){return s}return undefined}async function forEach(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function forEachFn(i,s){await r(i,s);return L}for await(const r of map.call(this,forEachFn,i));}function filter(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function filterFn(i,s){if(await r(i,s)){return i}return L}return map.call(this,filterFn,i)}class ReduceAwareErrMissingArgs extends d{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function reduce(r,i,s){var l;if(typeof r!=="function"){throw new c("reducer",["Function","AsyncFunction"],r)}if(s!=null){g(s,"options")}if((s===null||s===undefined?undefined:s.signal)!=null){A(s.signal,"options.signal")}let d=arguments.length>1;if(s!==null&&s!==undefined&&(l=s.signal)!==null&&l!==undefined&&l.aborted){const r=new u(undefined,{cause:s.signal.reason});this.once("error",(()=>{}));await w(this.destroy(r));throw r}const p=new a;const h=p.signal;if(s!==null&&s!==undefined&&s.signal){const r={once:true,[y]:this,[b]:true};s.signal.addEventListener("abort",(()=>p.abort()),r)}let C=false;try{for await(const a of this){var v;C=true;if(s!==null&&s!==undefined&&(v=s.signal)!==null&&v!==undefined&&v.aborted){throw new u}if(!d){i=a;d=true}else{i=await r(i,a,{signal:h})}}if(!C&&!d){throw new ReduceAwareErrMissingArgs}}finally{p.abort()}return i}async function toArray(r){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}const i=[];for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u(undefined,{cause:r.signal.reason})}x(i,a)}return i}function flatMap(r,i){const s=map.call(this,r,i);return async function*flatMap(){for await(const r of s){yield*r}}.call(this)}function toIntegerOrInfinity(r){r=_(r);if(N(r)){return 0}if(r<0){throw new p("number",">= 0",r)}return r}function drop(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*drop(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r--<=0){yield s}}}.call(this)}function take(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*take(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r-- >0){yield s}if(r<=0){return}}}.call(this)}r.exports.streamReturningOperators={asIndexedPairs:S(asIndexedPairs,"readable.asIndexedPairs will be removed in a future version."),drop:drop,filter:filter,flatMap:flatMap,map:map,take:take,compose:compose};r.exports.promiseReturningOperators={every:every,forEach:forEach,reduce:reduce,toArray:toArray,some:some,find:find}},41651:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a}=s(67734);r.exports=PassThrough;const l=s(26478);a(PassThrough.prototype,l.prototype);a(PassThrough,l);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);l.call(this,r)}PassThrough.prototype._transform=function(r,i,s){s(null,r)}},2396:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayIsArray:l,Promise:c,SymbolAsyncIterator:d,SymbolDispose:p}=s(67734);const u=s(84985);const{once:A}=s(26346);const h=s(30589);const g=s(60262);const{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:w,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:v,ERR_STREAM_PREMATURE_CLOSE:I},AbortError:B}=s(76101);const{validateFunction:S,validateAbortSignal:x}=s(67164);const{isIterable:R,isReadable:Q,isReadableNodeStream:_,isNodeStream:N,isTransformStream:T,isWebStream:k,isReadableStream:D,isReadableFinished:P}=s(11283);const O=globalThis.AbortController||s(24995).AbortController;let L;let M;let U;function destroyer(r,i,s){let a=false;r.on("close",(()=>{a=true}));const l=u(r,{readable:i,writable:s},(r=>{a=!r}));return{destroy:i=>{if(a)return;a=true;h.destroyer(r,i||new v("pipe"))},cleanup:l}}function popCallback(r){S(r[r.length-1],"streams[stream.length - 1]");return r.pop()}function makeAsyncIterable(r){if(R(r)){return r}else if(_(r)){return fromReadable(r)}throw new b("val",["Readable","Iterable","AsyncIterable"],r)}async function*fromReadable(r){if(!M){M=s(71001)}yield*M.prototype[d].call(r)}async function pumpToNode(r,i,s,{end:a}){let l;let d=null;const resume=r=>{if(r){l=r}if(d){const r=d;d=null;r()}};const wait=()=>new c(((r,i)=>{if(l){i(l)}else{d=()=>{if(l){i(l)}else{r()}}}}));i.on("drain",resume);const p=u(i,{readable:false},resume);try{if(i.writableNeedDrain){await wait()}for await(const s of r){if(!i.write(s)){await wait()}}if(a){i.end();await wait()}s()}catch(r){s(l!==r?y(l,r):r)}finally{p();i.off("drain",resume)}}async function pumpToWeb(r,i,s,{end:a}){if(T(i)){i=i.writable}const l=i.getWriter();try{for await(const i of r){await l.ready;l.write(i).catch((()=>{}))}await l.ready;if(a){await l.close()}s()}catch(r){try{await l.abort(r);s(r)}catch(r){s(r)}}}function pipeline(...r){return pipelineImpl(r,A(popCallback(r)))}function pipelineImpl(r,i,c){if(r.length===1&&l(r[0])){r=r[0]}if(r.length<2){throw new C("streams")}const d=new O;const u=d.signal;const A=c===null||c===undefined?undefined:c.signal;const h=[];x(A,"options.signal");function abort(){finishImpl(new B)}U=U||s(26346).addAbortListener;let y;if(A){y=U(A,abort)}let v;let I;const S=[];let P=0;function finish(r){finishImpl(r,--P===0)}function finishImpl(r,s){var l;if(r&&(!v||v.code==="ERR_STREAM_PREMATURE_CLOSE")){v=r}if(!v&&!s){return}while(S.length){S.shift()(v)}(l=y)===null||l===undefined?undefined:l[p]();d.abort();if(s){if(!v){h.forEach((r=>r()))}a.nextTick(i,v,I)}}let M;for(let q=0;q0;const W=z||(c===null||c===undefined?undefined:c.end)!==false;const Y=q===r.length-1;if(N(G)){if(W){const{destroy:J,cleanup:$}=destroyer(G,z,V);S.push(J);if(Q(G)&&Y){h.push($)}}function onError(r){if(r&&r.name!=="AbortError"&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"){finish(r)}}G.on("error",onError);if(Q(G)&&Y){h.push((()=>{G.removeListener("error",onError)}))}}if(q===0){if(typeof G==="function"){M=G({signal:u});if(!R(M)){throw new w("Iterable, AsyncIterable or Stream","source",M)}}else if(R(G)||_(G)||T(G)){M=G}else{M=g.from(G)}}else if(typeof G==="function"){if(T(M)){var j;M=makeAsyncIterable((j=M)===null||j===undefined?undefined:j.readable)}else{M=makeAsyncIterable(M)}M=G(M,{signal:u});if(z){if(!R(M,true)){throw new w("AsyncIterable",`transform[${q-1}]`,M)}}else{var H;if(!L){L=s(41651)}const X=new L({objectMode:true});const K=(H=M)===null||H===undefined?undefined:H.then;if(typeof K==="function"){P++;K.call(M,(r=>{I=r;if(r!=null){X.write(r)}if(W){X.end()}a.nextTick(finish)}),(r=>{X.destroy(r);a.nextTick(finish,r)}))}else if(R(M,true)){P++;pumpToNode(M,X,finish,{end:W})}else if(D(M)||T(M)){const te=M.readable||M;P++;pumpToNode(te,X,finish,{end:W})}else{throw new w("AsyncIterable or Promise","destination",M)}M=X;const{destroy:Z,cleanup:ee}=destroyer(M,false,true);S.push(Z);if(Y){h.push(ee)}}}else if(N(G)){if(_(M)){P+=2;const re=pipe(M,G,finish,{end:W});if(Q(G)&&Y){h.push(re)}}else if(T(M)||D(M)){const ne=M.readable||M;P++;pumpToNode(ne,G,finish,{end:W})}else if(R(M)){P++;pumpToNode(M,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else if(k(G)){if(_(M)){P++;pumpToWeb(makeAsyncIterable(M),G,finish,{end:W})}else if(D(M)||R(M)){P++;pumpToWeb(M,G,finish,{end:W})}else if(T(M)){P++;pumpToWeb(M.readable,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else{M=g.from(G)}}if(u!==null&&u!==undefined&&u.aborted||A!==null&&A!==undefined&&A.aborted){a.nextTick(abort)}return M}function pipe(r,i,s,{end:l}){let c=false;i.on("close",(()=>{if(!c){s(new I)}}));r.pipe(i,{end:false});if(l){function endFn(){c=true;i.end()}if(P(r)){a.nextTick(endFn)}else{r.once("end",endFn)}}else{s()}u(r,{readable:true,writable:false},(i=>{const a=r._readableState;if(i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted){r.once("end",s).once("error",s)}else{s(i)}}));return u(i,{readable:false,writable:true},s)}r.exports={pipelineImpl:pipelineImpl,pipeline:pipeline}},71001:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeIndexOf:l,NumberIsInteger:c,NumberIsNaN:d,NumberParseInt:p,ObjectDefineProperties:u,ObjectKeys:A,ObjectSetPrototypeOf:h,Promise:g,SafeSet:y,SymbolAsyncDispose:b,SymbolAsyncIterator:w,Symbol:C}=s(67734);r.exports=Readable;Readable.ReadableState=ReadableState;const{EventEmitter:v}=s(82361);const{Stream:I,prependListener:B}=s(41900);const{Buffer:S}=s(14300);const{addAbortSignal:x}=s(18697);const R=s(84985);let Q=s(26346).debuglog("stream",(r=>{Q=r}));const _=s(72775);const N=s(30589);const{getHighWaterMark:T,getDefaultHighWaterMark:k}=s(67405);const{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:L,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:j}=s(76101);const{validateObject:H}=s(67164);const q=C("kPaused");const{StringDecoder:G}=s(71576);const z=s(66706);h(Readable.prototype,I.prototype);h(Readable,I);const nop=()=>{};const{errorOrDestroy:V}=N;const W=1<<0;const Y=1<<1;const J=1<<2;const $=1<<3;const X=1<<4;const K=1<<5;const Z=1<<6;const ee=1<<7;const te=1<<8;const re=1<<9;const ne=1<<10;const ie=1<<11;const se=1<<12;const ae=1<<13;const oe=1<<14;const le=1<<15;const ce=1<<16;const de=1<<17;const pe=1<<18;function makeBitMapDescriptor(r){return{enumerable:false,get(){return(this.state&r)!==0},set(i){if(i)this.state|=r;else this.state&=~r}}}u(ReadableState.prototype,{objectMode:makeBitMapDescriptor(W),ended:makeBitMapDescriptor(Y),endEmitted:makeBitMapDescriptor(J),reading:makeBitMapDescriptor($),constructed:makeBitMapDescriptor(X),sync:makeBitMapDescriptor(K),needReadable:makeBitMapDescriptor(Z),emittedReadable:makeBitMapDescriptor(ee),readableListening:makeBitMapDescriptor(te),resumeScheduled:makeBitMapDescriptor(re),errorEmitted:makeBitMapDescriptor(ne),emitClose:makeBitMapDescriptor(ie),autoDestroy:makeBitMapDescriptor(se),destroyed:makeBitMapDescriptor(ae),closed:makeBitMapDescriptor(oe),closeEmitted:makeBitMapDescriptor(le),multiAwaitDrain:makeBitMapDescriptor(ce),readingMore:makeBitMapDescriptor(de),dataEmitted:makeBitMapDescriptor(pe)});function ReadableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(60262);this.state=ie|se|X|K;if(r&&r.objectMode)this.state|=W;if(a&&r&&r.readableObjectMode)this.state|=W;this.highWaterMark=r?T(this,r,"readableHighWaterMark",a):k(false);this.buffer=new _;this.length=0;this.pipes=[];this.flowing=null;this[q]=null;if(r&&r.emitClose===false)this.state&=~ie;if(r&&r.autoDestroy===false)this.state&=~se;this.errored=null;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.awaitDrainWriters=null;this.decoder=null;this.encoding=null;if(r&&r.encoding){this.decoder=new G(r.encoding);this.encoding=r.encoding}}function Readable(r){if(!(this instanceof Readable))return new Readable(r);const i=this instanceof s(60262);this._readableState=new ReadableState(r,this,i);if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal&&!i)x(r.signal,this)}I.call(this,r);N.construct(this,(()=>{if(this._readableState.needReadable){maybeReadMore(this,this._readableState)}}))}Readable.prototype.destroy=N.destroy;Readable.prototype._undestroy=N.undestroy;Readable.prototype._destroy=function(r,i){i(r)};Readable.prototype[v.captureRejectionSymbol]=function(r){this.destroy(r)};Readable.prototype[b]=function(){let r;if(!this.destroyed){r=this.readableEnded?null:new j;this.destroy(r)}return new g(((i,s)=>R(this,(a=>a&&a!==r?s(a):i(null)))))};Readable.prototype.push=function(r,i){return readableAddChunk(this,r,i,false)};Readable.prototype.unshift=function(r,i){return readableAddChunk(this,r,i,true)};function readableAddChunk(r,i,s,a){Q("readableAddChunk",i);const l=r._readableState;let c;if((l.state&W)===0){if(typeof i==="string"){s=s||l.defaultEncoding;if(l.encoding!==s){if(a&&l.encoding){i=S.from(i,s).toString(l.encoding)}else{i=S.from(i,s);s=""}}}else if(i instanceof S){s=""}else if(I._isUint8Array(i)){i=I._uint8ArrayToBuffer(i);s=""}else if(i!=null){c=new P("chunk",["string","Buffer","Uint8Array"],i)}}if(c){V(r,c)}else if(i===null){l.state&=~$;onEofChunk(r,l)}else if((l.state&W)!==0||i&&i.length>0){if(a){if((l.state&J)!==0)V(r,new U);else if(l.destroyed||l.errored)return false;else addChunk(r,l,i,true)}else if(l.ended){V(r,new M)}else if(l.destroyed||l.errored){return false}else{l.state&=~$;if(l.decoder&&!s){i=l.decoder.write(i);if(l.objectMode||i.length!==0)addChunk(r,l,i,false);else maybeReadMore(r,l)}else{addChunk(r,l,i,false)}}}else if(!a){l.state&=~$;maybeReadMore(r,l)}return!l.ended&&(l.length0){if((i.state&ce)!==0){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}i.dataEmitted=true;r.emit("data",s)}else{i.length+=i.objectMode?1:s.length;if(a)i.buffer.unshift(s);else i.buffer.push(s);if((i.state&Z)!==0)emitReadable(r)}maybeReadMore(r,i)}Readable.prototype.isPaused=function(){const r=this._readableState;return r[q]===true||r.flowing===false};Readable.prototype.setEncoding=function(r){const i=new G(r);this._readableState.decoder=i;this._readableState.encoding=this._readableState.decoder.encoding;const s=this._readableState.buffer;let a="";for(const r of s){a+=i.write(r)}s.clear();if(a!=="")s.push(a);this._readableState.length=a.length;return this};const ue=1073741824;function computeNewHighWaterMark(r){if(r>ue){throw new L("size","<= 1GiB",r)}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if((i.state&W)!==0)return 1;if(d(r)){if(i.flowing&&i.length)return i.buffer.first().length;return i.length}if(r<=i.length)return r;return i.ended?i.length:0}Readable.prototype.read=function(r){Q("read",r);if(r===undefined){r=NaN}else if(!c(r)){r=p(r,10)}const i=this._readableState;const s=r;if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r!==0)i.state&=~ee;if(r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){Q("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}let a=(i.state&Z)!==0;Q("need readable",a);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=i.length<=i.highWaterMark;r=0}else{i.length-=r;if(i.multiAwaitDrain){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}}if(i.length===0){if(!i.ended)i.needReadable=true;if(s!==r&&i.ended)endReadable(this)}if(l!==null&&!i.errorEmitted&&!i.closeEmitted){i.dataEmitted=true;this.emit("data",l)}return l};function onEofChunk(r,i){Q("onEofChunk");if(i.ended)return;if(i.decoder){const r=i.decoder.end();if(r&&r.length){i.buffer.push(r);i.length+=i.objectMode?1:r.length}}i.ended=true;if(i.sync){emitReadable(r)}else{i.needReadable=false;i.emittedReadable=true;emitReadable_(r)}}function emitReadable(r){const i=r._readableState;Q("emitReadable",i.needReadable,i.emittedReadable);i.needReadable=false;if(!i.emittedReadable){Q("emitReadable",i.flowing);i.emittedReadable=true;a.nextTick(emitReadable_,r)}}function emitReadable_(r){const i=r._readableState;Q("emitReadable_",i.destroyed,i.length,i.ended);if(!i.destroyed&&!i.errored&&(i.length||i.ended)){r.emit("readable");i.emittedReadable=false}i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark;flow(r)}function maybeReadMore(r,i){if(!i.readingMore&&i.constructed){i.readingMore=true;a.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){while(!i.reading&&!i.ended&&(i.length1&&l.pipes.includes(r)){Q("false write response, pause",l.awaitDrainWriters.size);l.awaitDrainWriters.add(r)}s.pause()}if(!p){p=pipeOnDrain(s,r);r.on("drain",p)}}s.on("data",ondata);function ondata(i){Q("ondata");const s=r.write(i);Q("dest.write",s);if(s===false){pause()}}function onerror(i){Q("onerror",i);unpipe();r.removeListener("error",onerror);if(r.listenerCount("error")===0){const s=r._writableState||r._readableState;if(s&&!s.errorEmitted){V(r,i)}else{r.emit("error",i)}}}B(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){Q("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){Q("unpipe");s.unpipe(r)}r.emit("pipe",s);if(r.writableNeedDrain===true){pause()}else if(!l.flowing){Q("pipe resume");s.resume()}return r};function pipeOnDrain(r,i){return function pipeOnDrainFunctionResult(){const s=r._readableState;if(s.awaitDrainWriters===i){Q("pipeOnDrain",1);s.awaitDrainWriters=null}else if(s.multiAwaitDrain){Q("pipeOnDrain",s.awaitDrainWriters.size);s.awaitDrainWriters.delete(i)}if((!s.awaitDrainWriters||s.awaitDrainWriters.size===0)&&r.listenerCount("data")){r.resume()}}}Readable.prototype.unpipe=function(r){const i=this._readableState;const s={hasUnpiped:false};if(i.pipes.length===0)return this;if(!r){const r=i.pipes;i.pipes=[];this.pause();for(let i=0;i0;if(l.flowing!==false)this.resume()}else if(r==="readable"){if(!l.endEmitted&&!l.readableListening){l.readableListening=l.needReadable=true;l.flowing=false;l.emittedReadable=false;Q("on readable",l.length,l.reading);if(l.length){emitReadable(this)}else if(!l.reading){a.nextTick(nReadingNextTick,this)}}}return s};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(r,i){const s=I.prototype.removeListener.call(this,r,i);if(r==="readable"){a.nextTick(updateReadableListening,this)}return s};Readable.prototype.off=Readable.prototype.removeListener;Readable.prototype.removeAllListeners=function(r){const i=I.prototype.removeAllListeners.apply(this,arguments);if(r==="readable"||r===undefined){a.nextTick(updateReadableListening,this)}return i};function updateReadableListening(r){const i=r._readableState;i.readableListening=r.listenerCount("readable")>0;if(i.resumeScheduled&&i[q]===false){i.flowing=true}else if(r.listenerCount("data")>0){r.resume()}else if(!i.readableListening){i.flowing=null}}function nReadingNextTick(r){Q("readable nexttick read 0");r.read(0)}Readable.prototype.resume=function(){const r=this._readableState;if(!r.flowing){Q("resume");r.flowing=!r.readableListening;resume(this,r)}r[q]=false;return this};function resume(r,i){if(!i.resumeScheduled){i.resumeScheduled=true;a.nextTick(resume_,r,i)}}function resume_(r,i){Q("resume",i.reading);if(!i.reading){r.read(0)}i.resumeScheduled=false;r.emit("resume");flow(r);if(i.flowing&&!i.reading)r.read(0)}Readable.prototype.pause=function(){Q("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){Q("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState[q]=true;return this};function flow(r){const i=r._readableState;Q("flow",i.flowing);while(i.flowing&&r.read()!==null);}Readable.prototype.wrap=function(r){let i=false;r.on("data",(s=>{if(!this.push(s)&&r.pause){i=true;r.pause()}}));r.on("end",(()=>{this.push(null)}));r.on("error",(r=>{V(this,r)}));r.on("close",(()=>{this.destroy()}));r.on("destroy",(()=>{this.destroy()}));this._read=()=>{if(i&&r.resume){i=false;r.resume()}};const s=A(r);for(let i=1;i{a=r?D(a,r):null;s();s=nop}));try{while(true){const i=r.destroyed?null:r.read();if(i!==null){yield i}else if(a){throw a}else if(a===null){return}else{await new g(next)}}}catch(r){a=D(a,r);throw a}finally{if((a||(i===null||i===undefined?undefined:i.destroyOnReturn)!==false)&&(a===undefined||r._readableState.autoDestroy)){N.destroyer(r,null)}else{r.off("readable",next);l()}}}u(Readable.prototype,{readable:{__proto__:null,get(){const r=this._readableState;return!!r&&r.readable!==false&&!r.destroyed&&!r.errorEmitted&&!r.endEmitted},set(r){if(this._readableState){this._readableState.readable=!!r}}},readableDidRead:{__proto__:null,enumerable:false,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:false,get:function(){return!!(this._readableState.readable!==false&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:false,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:false,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:false,get:function(){return this._readableState.flowing},set:function(r){if(this._readableState){this._readableState.flowing=r}}},readableLength:{__proto__:null,enumerable:false,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.objectMode:false}},readableEncoding:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:false}},destroyed:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.destroyed:false},set(r){if(!this._readableState){return}this._readableState.destroyed=r}},readableEnded:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.endEmitted:false}}});u(ReadableState.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[q]!==false},set(r){this[q]=!!r}}});Readable._fromList=fromList;function fromList(r,i){if(i.length===0)return null;let s;if(i.objectMode)s=i.buffer.shift();else if(!r||r>=i.length){if(i.decoder)s=i.buffer.join("");else if(i.buffer.length===1)s=i.buffer.first();else s=i.buffer.concat(i.length);i.buffer.clear()}else{s=i.buffer.consume(r,i.decoder)}return s}function endReadable(r){const i=r._readableState;Q("endReadable",i.endEmitted);if(!i.endEmitted){i.ended=true;a.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){Q("endReadableNT",r.endEmitted,r.length);if(!r.errored&&!r.closeEmitted&&!r.endEmitted&&r.length===0){r.endEmitted=true;i.emit("end");if(i.writable&&i.allowHalfOpen===false){a.nextTick(endWritableNT,i)}else if(r.autoDestroy){const r=i._writableState;const s=!r||r.autoDestroy&&(r.finished||r.writable===false);if(s){i.destroy()}}}}function endWritableNT(r){const i=r.writable&&!r.writableEnded&&!r.destroyed;if(i){r.end()}}Readable.from=function(r,i){return z(Readable,r,i)};let Ae;function lazyWebStreams(){if(Ae===undefined)Ae={};return Ae}Readable.fromWeb=function(r,i){return lazyWebStreams().newStreamReadableFromReadableStream(r,i)};Readable.toWeb=function(r,i){return lazyWebStreams().newReadableStreamFromStreamReadable(r,i)};Readable.wrap=function(r,i){var s,a;return new Readable({objectMode:(s=(a=r.readableObjectMode)!==null&&a!==undefined?a:r.objectMode)!==null&&s!==undefined?s:true,...i,destroy(i,s){N.destroyer(r,i);s(i)}}).wrap(r)}},67405:(r,i,s)=>{"use strict";const{MathFloor:a,NumberIsInteger:l}=s(67734);const{validateInteger:c}=s(67164);const{ERR_INVALID_ARG_VALUE:d}=s(76101).codes;let p=16*1024;let u=16;function highWaterMarkFrom(r,i,s){return r.highWaterMark!=null?r.highWaterMark:i?r[s]:null}function getDefaultHighWaterMark(r){return r?u:p}function setDefaultHighWaterMark(r,i){c(i,"value",0);if(r){u=i}else{p=i}}function getHighWaterMark(r,i,s,c){const p=highWaterMarkFrom(i,c,s);if(p!=null){if(!l(p)||p<0){const r=c?`options.${s}`:"options.highWaterMark";throw new d(r,p)}return a(p)}return getDefaultHighWaterMark(r.objectMode)}r.exports={getHighWaterMark:getHighWaterMark,getDefaultHighWaterMark:getDefaultHighWaterMark,setDefaultHighWaterMark:setDefaultHighWaterMark}},26478:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a,Symbol:l}=s(67734);r.exports=Transform;const{ERR_METHOD_NOT_IMPLEMENTED:c}=s(76101).codes;const d=s(60262);const{getHighWaterMark:p}=s(67405);a(Transform.prototype,d.prototype);a(Transform,d);const u=l("kCallback");function Transform(r){if(!(this instanceof Transform))return new Transform(r);const i=r?p(this,r,"readableHighWaterMark",true):null;if(i===0){r={...r,highWaterMark:null,readableHighWaterMark:i,writableHighWaterMark:r.writableHighWaterMark||0}}d.call(this,r);this._readableState.sync=false;this[u]=null;if(r){if(typeof r.transform==="function")this._transform=r.transform;if(typeof r.flush==="function")this._flush=r.flush}this.on("prefinish",prefinish)}function final(r){if(typeof this._flush==="function"&&!this.destroyed){this._flush(((i,s)=>{if(i){if(r){r(i)}else{this.destroy(i)}return}if(s!=null){this.push(s)}this.push(null);if(r){r()}}))}else{this.push(null);if(r){r()}}}function prefinish(){if(this._final!==final){final.call(this)}}Transform.prototype._final=final;Transform.prototype._transform=function(r,i,s){throw new c("_transform()")};Transform.prototype._write=function(r,i,s){const a=this._readableState;const l=this._writableState;const c=a.length;this._transform(r,i,((r,i)=>{if(r){s(r);return}if(i!=null){this.push(i)}if(l.ended||c===a.length||a.length{"use strict";const{SymbolAsyncIterator:a,SymbolIterator:l,SymbolFor:c}=s(67734);const d=c("nodejs.stream.destroyed");const p=c("nodejs.stream.errored");const u=c("nodejs.stream.readable");const A=c("nodejs.stream.writable");const h=c("nodejs.stream.disturbed");const g=c("nodejs.webstream.isClosedPromise");const y=c("nodejs.webstream.controllerErrorFunction");function isReadableNodeStream(r,i=false){var s;return!!(r&&typeof r.pipe==="function"&&typeof r.on==="function"&&(!i||typeof r.pause==="function"&&typeof r.resume==="function")&&(!r._writableState||((s=r._readableState)===null||s===undefined?undefined:s.readable)!==false)&&(!r._writableState||r._readableState))}function isWritableNodeStream(r){var i;return!!(r&&typeof r.write==="function"&&typeof r.on==="function"&&(!r._readableState||((i=r._writableState)===null||i===undefined?undefined:i.writable)!==false))}function isDuplexNodeStream(r){return!!(r&&typeof r.pipe==="function"&&r._readableState&&typeof r.on==="function"&&typeof r.write==="function")}function isNodeStream(r){return r&&(r._readableState||r._writableState||typeof r.write==="function"&&typeof r.on==="function"||typeof r.pipe==="function"&&typeof r.on==="function")}function isReadableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.pipeThrough==="function"&&typeof r.getReader==="function"&&typeof r.cancel==="function")}function isWritableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.getWriter==="function"&&typeof r.abort==="function")}function isTransformStream(r){return!!(r&&!isNodeStream(r)&&typeof r.readable==="object"&&typeof r.writable==="object")}function isWebStream(r){return isReadableStream(r)||isWritableStream(r)||isTransformStream(r)}function isIterable(r,i){if(r==null)return false;if(i===true)return typeof r[a]==="function";if(i===false)return typeof r[l]==="function";return typeof r[a]==="function"||typeof r[l]==="function"}function isDestroyed(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!!(r.destroyed||r[d]||a!==null&&a!==undefined&&a.destroyed)}function isWritableEnded(r){if(!isWritableNodeStream(r))return null;if(r.writableEnded===true)return true;const i=r._writableState;if(i!==null&&i!==undefined&&i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isWritableFinished(r,i){if(!isWritableNodeStream(r))return null;if(r.writableFinished===true)return true;const s=r._writableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.finished)!=="boolean")return null;return!!(s.finished||i===false&&s.ended===true&&s.length===0)}function isReadableEnded(r){if(!isReadableNodeStream(r))return null;if(r.readableEnded===true)return true;const i=r._readableState;if(!i||i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isReadableFinished(r,i){if(!isReadableNodeStream(r))return null;const s=r._readableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.endEmitted)!=="boolean")return null;return!!(s.endEmitted||i===false&&s.ended===true&&s.length===0)}function isReadable(r){if(r&&r[u]!=null)return r[u];if(typeof(r===null||r===undefined?undefined:r.readable)!=="boolean")return null;if(isDestroyed(r))return false;return isReadableNodeStream(r)&&r.readable&&!isReadableFinished(r)}function isWritable(r){if(r&&r[A]!=null)return r[A];if(typeof(r===null||r===undefined?undefined:r.writable)!=="boolean")return null;if(isDestroyed(r))return false;return isWritableNodeStream(r)&&r.writable&&!isWritableEnded(r)}function isFinished(r,i){if(!isNodeStream(r)){return null}if(isDestroyed(r)){return true}if((i===null||i===undefined?undefined:i.readable)!==false&&isReadable(r)){return false}if((i===null||i===undefined?undefined:i.writable)!==false&&isWritable(r)){return false}return true}function isWritableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.writableErrored){return r.writableErrored}return(i=(s=r._writableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isReadableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.readableErrored){return r.readableErrored}return(i=(s=r._readableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isClosed(r){if(!isNodeStream(r)){return null}if(typeof r.closed==="boolean"){return r.closed}const i=r._writableState;const s=r._readableState;if(typeof(i===null||i===undefined?undefined:i.closed)==="boolean"||typeof(s===null||s===undefined?undefined:s.closed)==="boolean"){return(i===null||i===undefined?undefined:i.closed)||(s===null||s===undefined?undefined:s.closed)}if(typeof r._closed==="boolean"&&isOutgoingMessage(r)){return r._closed}return null}function isOutgoingMessage(r){return typeof r._closed==="boolean"&&typeof r._defaultKeepAlive==="boolean"&&typeof r._removedConnection==="boolean"&&typeof r._removedContLen==="boolean"}function isServerResponse(r){return typeof r._sent100==="boolean"&&isOutgoingMessage(r)}function isServerRequest(r){var i;return typeof r._consuming==="boolean"&&typeof r._dumped==="boolean"&&((i=r.req)===null||i===undefined?undefined:i.upgradeOrConnect)===undefined}function willEmitClose(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!a&&isServerResponse(r)||!!(a&&a.autoDestroy&&a.emitClose&&a.closed===false)}function isDisturbed(r){var i;return!!(r&&((i=r[h])!==null&&i!==undefined?i:r.readableDidRead||r.readableAborted))}function isErrored(r){var i,s,a,l,c,d,u,A,h,g;return!!(r&&((i=(s=(a=(l=(c=(d=r[p])!==null&&d!==undefined?d:r.readableErrored)!==null&&c!==undefined?c:r.writableErrored)!==null&&l!==undefined?l:(u=r._readableState)===null||u===undefined?undefined:u.errorEmitted)!==null&&a!==undefined?a:(A=r._writableState)===null||A===undefined?undefined:A.errorEmitted)!==null&&s!==undefined?s:(h=r._readableState)===null||h===undefined?undefined:h.errored)!==null&&i!==undefined?i:(g=r._writableState)===null||g===undefined?undefined:g.errored))}r.exports={isDestroyed:isDestroyed,kIsDestroyed:d,isDisturbed:isDisturbed,kIsDisturbed:h,isErrored:isErrored,kIsErrored:p,isReadable:isReadable,kIsReadable:u,kIsClosedPromise:g,kControllerErrorFunction:y,kIsWritable:A,isClosed:isClosed,isDuplexNodeStream:isDuplexNodeStream,isFinished:isFinished,isIterable:isIterable,isReadableNodeStream:isReadableNodeStream,isReadableStream:isReadableStream,isReadableEnded:isReadableEnded,isReadableFinished:isReadableFinished,isReadableErrored:isReadableErrored,isNodeStream:isNodeStream,isWebStream:isWebStream,isWritable:isWritable,isWritableNodeStream:isWritableNodeStream,isWritableStream:isWritableStream,isWritableEnded:isWritableEnded,isWritableFinished:isWritableFinished,isWritableErrored:isWritableErrored,isServerRequest:isServerRequest,isServerResponse:isServerResponse,willEmitClose:willEmitClose,isTransformStream:isTransformStream}},78281:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeSlice:l,Error:c,FunctionPrototypeSymbolHasInstance:d,ObjectDefineProperty:p,ObjectDefineProperties:u,ObjectSetPrototypeOf:A,StringPrototypeToLowerCase:h,Symbol:g,SymbolHasInstance:y}=s(67734);r.exports=Writable;Writable.WritableState=WritableState;const{EventEmitter:b}=s(82361);const w=s(41900).Stream;const{Buffer:C}=s(14300);const v=s(30589);const{addAbortSignal:I}=s(18697);const{getHighWaterMark:B,getDefaultHighWaterMark:S}=s(67405);const{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_MULTIPLE_CALLBACK:Q,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:k,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:P}=s(76101).codes;const{errorOrDestroy:O}=v;A(Writable.prototype,w.prototype);A(Writable,w);function nop(){}const L=g("kOnFinished");function WritableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(60262);this.objectMode=!!(r&&r.objectMode);if(a)this.objectMode=this.objectMode||!!(r&&r.writableObjectMode);this.highWaterMark=r?B(this,r,"writableHighWaterMark",a):S(false);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;const l=!!(r&&r.decodeStrings===false);this.decodeStrings=!l;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=onwrite.bind(undefined,i);this.writecb=null;this.writelen=0;this.afterWriteTickInfo=null;resetBuffer(this);this.pendingcb=0;this.constructed=true;this.prefinished=false;this.errorEmitted=false;this.emitClose=!r||r.emitClose!==false;this.autoDestroy=!r||r.autoDestroy!==false;this.errored=null;this.closed=false;this.closeEmitted=false;this[L]=[]}function resetBuffer(r){r.buffered=[];r.bufferedIndex=0;r.allBuffers=true;r.allNoop=true}WritableState.prototype.getBuffer=function getBuffer(){return l(this.buffered,this.bufferedIndex)};p(WritableState.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Writable(r){const i=this instanceof s(60262);if(!i&&!d(Writable,this))return new Writable(r);this._writableState=new WritableState(r,this,i);if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal)I(r.signal,this)}w.call(this,r);v.construct(this,(()=>{const r=this._writableState;if(!r.writing){clearBuffer(this,r)}finishMaybe(this,r)}))}p(Writable,y,{__proto__:null,value:function(r){if(d(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}});Writable.prototype.pipe=function(){O(this,new _)};function _write(r,i,s,l){const c=r._writableState;if(typeof s==="function"){l=s;s=c.defaultEncoding}else{if(!s)s=c.defaultEncoding;else if(s!=="buffer"&&!C.isEncoding(s))throw new P(s);if(typeof l!=="function")l=nop}if(i===null){throw new k}else if(!c.objectMode){if(typeof i==="string"){if(c.decodeStrings!==false){i=C.from(i,s);s="buffer"}}else if(i instanceof C){s="buffer"}else if(w._isUint8Array(i)){i=w._uint8ArrayToBuffer(i);s="buffer"}else{throw new x("chunk",["string","Buffer","Uint8Array"],i)}}let d;if(c.ending){d=new D}else if(c.destroyed){d=new N("write")}if(d){a.nextTick(l,d);O(r,d,true);return d}c.pendingcb++;return writeOrBuffer(r,c,i,s,l)}Writable.prototype.write=function(r,i,s){return _write(this,r,i,s)===true};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){const r=this._writableState;if(r.corked){r.corked--;if(!r.writing)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=h(r);if(!C.isEncoding(r))throw new P(r);this._writableState.defaultEncoding=r;return this};function writeOrBuffer(r,i,s,a,l){const c=i.objectMode?1:s.length;i.length+=c;const d=i.lengths.bufferedIndex){clearBuffer(r,s)}if(l){if(s.afterWriteTickInfo!==null&&s.afterWriteTickInfo.cb===c){s.afterWriteTickInfo.count++}else{s.afterWriteTickInfo={count:1,cb:c,stream:r,state:s};a.nextTick(afterWriteTick,s.afterWriteTickInfo)}}else{afterWrite(r,s,1,c)}}}function afterWriteTick({stream:r,state:i,count:s,cb:a}){i.afterWriteTickInfo=null;return afterWrite(r,i,s,a)}function afterWrite(r,i,s,a){const l=!i.ending&&!r.destroyed&&i.length===0&&i.needDrain;if(l){i.needDrain=false;r.emit("drain")}while(s-- >0){i.pendingcb--;a()}if(i.destroyed){errorBuffer(i)}finishMaybe(r,i)}function errorBuffer(r){if(r.writing){return}for(let s=r.bufferedIndex;s1&&r._writev){i.pendingcb-=d-1;const a=i.allNoop?nop:r=>{for(let i=p;i256){s.splice(0,p);i.bufferedIndex=0}else{i.bufferedIndex=p}}i.bufferProcessing=false}Writable.prototype._write=function(r,i,s){if(this._writev){this._writev([{chunk:r,encoding:i}],s)}else{throw new R("_write()")}};Writable.prototype._writev=null;Writable.prototype.end=function(r,i,s){const l=this._writableState;if(typeof r==="function"){s=r;r=null;i=null}else if(typeof i==="function"){s=i;i=null}let d;if(r!==null&&r!==undefined){const s=_write(this,r,i);if(s instanceof c){d=s}}if(l.corked){l.corked=1;this.uncork()}if(d){}else if(!l.errored&&!l.ending){l.ending=true;finishMaybe(this,l,true);l.ended=true}else if(l.finished){d=new T("end")}else if(l.destroyed){d=new N("end")}if(typeof s==="function"){if(d||l.finished){a.nextTick(s,d)}else{l[L].push(s)}}return this};function needFinish(r){return r.ending&&!r.destroyed&&r.constructed&&r.length===0&&!r.errored&&r.buffered.length===0&&!r.finished&&!r.writing&&!r.errorEmitted&&!r.closeEmitted}function callFinal(r,i){let s=false;function onFinish(l){if(s){O(r,l!==null&&l!==undefined?l:Q());return}s=true;i.pendingcb--;if(l){const s=i[L].splice(0);for(let r=0;r{if(needFinish(i)){finish(r,i)}else{i.pendingcb--}}),r,i)}else if(needFinish(i)){i.pendingcb++;finish(r,i)}}}}function finish(r,i){i.pendingcb--;i.finished=true;const s=i[L].splice(0);for(let r=0;r{"use strict";const{ArrayIsArray:a,ArrayPrototypeIncludes:l,ArrayPrototypeJoin:c,ArrayPrototypeMap:d,NumberIsInteger:p,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:A,NumberMIN_SAFE_INTEGER:h,NumberParseInt:g,ObjectPrototypeHasOwnProperty:y,RegExpPrototypeExec:b,String:w,StringPrototypeToUpperCase:C,StringPrototypeTrim:v}=s(67734);const{hideStackFrames:I,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:S,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:R,ERR_UNKNOWN_SIGNAL:Q}}=s(76101);const{normalizeEncoding:_}=s(26346);const{isAsyncFunction:N,isArrayBufferView:T}=s(26346).types;const k={};function isInt32(r){return r===(r|0)}function isUint32(r){return r===r>>>0}const D=/^[0-7]+$/;const P="must be a 32-bit unsigned integer or an octal string";function parseFileMode(r,i,s){if(typeof r==="undefined"){r=s}if(typeof r==="string"){if(b(D,r)===null){throw new x(i,r,P)}r=g(r,8)}M(r,i);return r}const O=I(((r,i,s=h,a=A)=>{if(typeof r!=="number")throw new S(i,"number",r);if(!p(r))throw new R(i,"an integer",r);if(ra)throw new R(i,`>= ${s} && <= ${a}`,r)}));const L=I(((r,i,s=-2147483648,a=2147483647)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}if(ra){throw new R(i,`>= ${s} && <= ${a}`,r)}}));const M=I(((r,i,s=false)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}const a=s?1:0;const l=4294967295;if(rl){throw new R(i,`>= ${a} && <= ${l}`,r)}}));function validateString(r,i){if(typeof r!=="string")throw new S(i,"string",r)}function validateNumber(r,i,s=undefined,a){if(typeof r!=="number")throw new S(i,"number",r);if(s!=null&&ra||(s!=null||a!=null)&&u(r)){throw new R(i,`${s!=null?`>= ${s}`:""}${s!=null&&a!=null?" && ":""}${a!=null?`<= ${a}`:""}`,r)}}const U=I(((r,i,s)=>{if(!l(s,r)){const a=c(d(s,(r=>typeof r==="string"?`'${r}'`:w(r))),", ");const l="must be one of: "+a;throw new x(i,r,l)}}));function validateBoolean(r,i){if(typeof r!=="boolean")throw new S(i,"boolean",r)}function getOwnPropertyValueOrDefault(r,i,s){return r==null||!y(r,i)?s:r[i]}const j=I(((r,i,s=null)=>{const l=getOwnPropertyValueOrDefault(s,"allowArray",false);const c=getOwnPropertyValueOrDefault(s,"allowFunction",false);const d=getOwnPropertyValueOrDefault(s,"nullable",false);if(!d&&r===null||!l&&a(r)||typeof r!=="object"&&(!c||typeof r!=="function")){throw new S(i,"Object",r)}}));const H=I(((r,i)=>{if(r!=null&&typeof r!=="object"&&typeof r!=="function"){throw new S(i,"a dictionary",r)}}));const q=I(((r,i,s=0)=>{if(!a(r)){throw new S(i,"Array",r)}if(r.length{if(!T(r)){throw new S(i,["Buffer","TypedArray","DataView"],r)}}));function validateEncoding(r,i){const s=_(i);const a=r.length;if(s==="hex"&&a%2!==0){throw new x("encoding",i,`is invalid for data of length ${a}`)}}function validatePort(r,i="Port",s=true){if(typeof r!=="number"&&typeof r!=="string"||typeof r==="string"&&v(r).length===0||+r!==+r>>>0||r>65535||r===0&&!s){throw new B(i,r,s)}return r|0}const z=I(((r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new S(i,"AbortSignal",r)}}));const V=I(((r,i)=>{if(typeof r!=="function")throw new S(i,"Function",r)}));const W=I(((r,i)=>{if(typeof r!=="function"||N(r))throw new S(i,"Function",r)}));const Y=I(((r,i)=>{if(r!==undefined)throw new S(i,"undefined",r)}));function validateUnion(r,i,s){if(!l(s,r)){throw new S(i,`('${c(s,"|")}')`,r)}}const J=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function validateLinkHeaderFormat(r,i){if(typeof r==="undefined"||!b(J,r)){throw new x(i,r,'must be an array or string of format "; rel=preload; as=style"')}}function validateLinkHeaderValue(r){if(typeof r==="string"){validateLinkHeaderFormat(r,"hints");return r}else if(a(r)){const i=r.length;let s="";if(i===0){return s}for(let a=0;a; rel=preload; as=style"')}r.exports={isInt32:isInt32,isUint32:isUint32,parseFileMode:parseFileMode,validateArray:q,validateStringArray:validateStringArray,validateBooleanArray:validateBooleanArray,validateAbortSignalArray:validateAbortSignalArray,validateBoolean:validateBoolean,validateBuffer:G,validateDictionary:H,validateEncoding:validateEncoding,validateFunction:V,validateInt32:L,validateInteger:O,validateNumber:validateNumber,validateObject:j,validateOneOf:U,validatePlainFunction:W,validatePort:validatePort,validateSignalName:validateSignalName,validateString:validateString,validateUint32:M,validateUndefined:Y,validateUnion:validateUnion,validateAbortSignal:z,validateLinkHeaderValue:validateLinkHeaderValue}},76101:(r,i,s)=>{"use strict";const{format:a,inspect:l,AggregateError:c}=s(26346);const d=globalThis.AggregateError||c;const p=Symbol("kIsNodeError");const u=["string","function","number","object","Function","Object","boolean","bigint","symbol"];const A=/^([A-Z][a-z0-9]*)+$/;const h="__node_internal_";const g={};function assert(r,i){if(!r){throw new g.ERR_INTERNAL_ASSERTION(i)}}function addNumericalSeparator(r){let i="";let s=r.length;const a=r[0]==="-"?1:0;for(;s>=a+4;s-=3){i=`_${r.slice(s-3,s)}${i}`}return`${r.slice(0,s)}${i}`}function getMessage(r,i,s){if(typeof i==="function"){assert(i.length<=s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${i.length}).`);return i(...s)}const l=(i.match(/%[dfijoOs]/g)||[]).length;assert(l===s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${l}).`);if(s.length===0){return i}return a(i,...s)}function E(r,i,s){if(!s){s=Error}class NodeError extends s{constructor(...s){super(getMessage(r,i,s))}toString(){return`${this.name} [${r}]: ${this.message}`}}Object.defineProperties(NodeError.prototype,{name:{value:s.name,writable:true,enumerable:false,configurable:true},toString:{value(){return`${this.name} [${r}]: ${this.message}`},writable:true,enumerable:false,configurable:true}});NodeError.prototype.code=r;NodeError.prototype[p]=true;g[r]=NodeError}function hideStackFrames(r){const i=h+r.name;Object.defineProperty(r,"name",{value:i});return r}function aggregateTwoErrors(r,i){if(r&&i&&r!==i){if(Array.isArray(i.errors)){i.errors.push(r);return i}const s=new d([i,r],i.message);s.code=i.code;return s}return r||i}class AbortError extends Error{constructor(r="The operation was aborted",i=undefined){if(i!==undefined&&typeof i!=="object"){throw new g.ERR_INVALID_ARG_TYPE("options","Object",i)}super(r,i);this.code="ABORT_ERR";this.name="AbortError"}}E("ERR_ASSERTION","%s",Error);E("ERR_INVALID_ARG_TYPE",((r,i,s)=>{assert(typeof r==="string","'name' must be a string");if(!Array.isArray(i)){i=[i]}let a="The ";if(r.endsWith(" argument")){a+=`${r} `}else{a+=`"${r}" ${r.includes(".")?"property":"argument"} `}a+="must be ";const c=[];const d=[];const p=[];for(const r of i){assert(typeof r==="string","All expected entries have to be of type string");if(u.includes(r)){c.push(r.toLowerCase())}else if(A.test(r)){d.push(r)}else{assert(r!=="object",'The value "object" should be written as "Object"');p.push(r)}}if(d.length>0){const r=c.indexOf("object");if(r!==-1){c.splice(c,r,1);d.push("Object")}}if(c.length>0){switch(c.length){case 1:a+=`of type ${c[0]}`;break;case 2:a+=`one of type ${c[0]} or ${c[1]}`;break;default:{const r=c.pop();a+=`one of type ${c.join(", ")}, or ${r}`}}if(d.length>0||p.length>0){a+=" or "}}if(d.length>0){switch(d.length){case 1:a+=`an instance of ${d[0]}`;break;case 2:a+=`an instance of ${d[0]} or ${d[1]}`;break;default:{const r=d.pop();a+=`an instance of ${d.join(", ")}, or ${r}`}}if(p.length>0){a+=" or "}}switch(p.length){case 0:break;case 1:if(p[0].toLowerCase()!==p[0]){a+="an "}a+=`${p[0]}`;break;case 2:a+=`one of ${p[0]} or ${p[1]}`;break;default:{const r=p.pop();a+=`one of ${p.join(", ")}, or ${r}`}}if(s==null){a+=`. Received ${s}`}else if(typeof s==="function"&&s.name){a+=`. Received function ${s.name}`}else if(typeof s==="object"){var h;if((h=s.constructor)!==null&&h!==undefined&&h.name){a+=`. Received an instance of ${s.constructor.name}`}else{const r=l(s,{depth:-1});a+=`. Received ${r}`}}else{let r=l(s,{colors:false});if(r.length>25){r=`${r.slice(0,25)}...`}a+=`. Received type ${typeof s} (${r})`}return a}),TypeError);E("ERR_INVALID_ARG_VALUE",((r,i,s="is invalid")=>{let a=l(i);if(a.length>128){a=a.slice(0,128)+"..."}const c=r.includes(".")?"property":"argument";return`The ${c} '${r}' ${s}. Received ${a}`}),TypeError);E("ERR_INVALID_RETURN_VALUE",((r,i,s)=>{var a;const l=s!==null&&s!==undefined&&(a=s.constructor)!==null&&a!==undefined&&a.name?`instance of ${s.constructor.name}`:`type ${typeof s}`;return`Expected ${r} to be returned from the "${i}"`+` function but got ${l}.`}),TypeError);E("ERR_MISSING_ARGS",((...r)=>{assert(r.length>0,"At least one arg needs to be specified");let i;const s=r.length;r=(Array.isArray(r)?r:[r]).map((r=>`"${r}"`)).join(" or ");switch(s){case 1:i+=`The ${r[0]} argument`;break;case 2:i+=`The ${r[0]} and ${r[1]} arguments`;break;default:{const s=r.pop();i+=`The ${r.join(", ")}, and ${s} arguments`}break}return`${i} must be specified`}),TypeError);E("ERR_OUT_OF_RANGE",((r,i,s)=>{assert(i,'Missing "range" argument');let a;if(Number.isInteger(s)&&Math.abs(s)>2**32){a=addNumericalSeparator(String(s))}else if(typeof s==="bigint"){a=String(s);if(s>2n**32n||s<-(2n**32n)){a=addNumericalSeparator(a)}a+="n"}else{a=l(s)}return`The value of "${r}" is out of range. It must be ${i}. Received ${a}`}),RangeError);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);E("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);E("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);E("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);E("ERR_STREAM_WRITE_AFTER_END","write after end",Error);E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);r.exports={AbortError:AbortError,aggregateTwoErrors:hideStackFrames(aggregateTwoErrors),hideStackFrames:hideStackFrames,codes:g}},91650:(r,i,s)=>{"use strict";const a=s(12781);if(a&&process.env.READABLE_STREAM==="disable"){const i=a.promises;r.exports._uint8ArrayToBuffer=a._uint8ArrayToBuffer;r.exports._isUint8Array=a._isUint8Array;r.exports.isDisturbed=a.isDisturbed;r.exports.isErrored=a.isErrored;r.exports.isReadable=a.isReadable;r.exports.Readable=a.Readable;r.exports.Writable=a.Writable;r.exports.Duplex=a.Duplex;r.exports.Transform=a.Transform;r.exports.PassThrough=a.PassThrough;r.exports.addAbortSignal=a.addAbortSignal;r.exports.finished=a.finished;r.exports.destroy=a.destroy;r.exports.pipeline=a.pipeline;r.exports.compose=a.compose;Object.defineProperty(a,"promises",{configurable:true,enumerable:true,get(){return i}});r.exports.Stream=a.Stream}else{const i=s(83046);const a=s(56153);const l=i.Readable.destroy;r.exports=i.Readable;r.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer;r.exports._isUint8Array=i._isUint8Array;r.exports.isDisturbed=i.isDisturbed;r.exports.isErrored=i.isErrored;r.exports.isReadable=i.isReadable;r.exports.Readable=i.Readable;r.exports.Writable=i.Writable;r.exports.Duplex=i.Duplex;r.exports.Transform=i.Transform;r.exports.PassThrough=i.PassThrough;r.exports.addAbortSignal=i.addAbortSignal;r.exports.finished=i.finished;r.exports.destroy=i.destroy;r.exports.destroy=l;r.exports.pipeline=i.pipeline;r.exports.compose=i.compose;Object.defineProperty(i,"promises",{configurable:true,enumerable:true,get(){return a}});r.exports.Stream=i.Stream}r.exports["default"]=r.exports},67734:r=>{"use strict";r.exports={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,i){return r.includes(i)},ArrayPrototypeIndexOf(r,i){return r.indexOf(i)},ArrayPrototypeJoin(r,i){return r.join(i)},ArrayPrototypeMap(r,i){return r.map(i)},ArrayPrototypePop(r,i){return r.pop(i)},ArrayPrototypePush(r,i){return r.push(i)},ArrayPrototypeSlice(r,i,s){return r.slice(i,s)},Error:Error,FunctionPrototypeCall(r,i,...s){return r.call(i,...s)},FunctionPrototypeSymbolHasInstance(r,i){return Function.prototype[Symbol.hasInstance].call(r,i)},MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,i){return Object.defineProperties(r,i)},ObjectDefineProperty(r,i,s){return Object.defineProperty(r,i,s)},ObjectGetOwnPropertyDescriptor(r,i){return Object.getOwnPropertyDescriptor(r,i)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,i){return Object.setPrototypeOf(r,i)},Promise:Promise,PromisePrototypeCatch(r,i){return r.catch(i)},PromisePrototypeThen(r,i,s){return r.then(i,s)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,i){return r.test(i)},SafeSet:Set,String:String,StringPrototypeSlice(r,i,s){return r.slice(i,s)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,i,s){return r.set(i,s)},Boolean:Boolean,Uint8Array:Uint8Array}},26346:(r,i,s)=>{"use strict";const a=s(14300);const{kResistStopPropagation:l,SymbolDispose:c}=s(67734);const d=globalThis.AbortSignal||s(24995).AbortSignal;const p=globalThis.AbortController||s(24995).AbortController;const u=Object.getPrototypeOf((async function(){})).constructor;const A=globalThis.Blob||a.Blob;const h=typeof A!=="undefined"?function isBlob(r){return r instanceof A}:function isBlob(r){return false};const validateAbortSignal=(r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new ERR_INVALID_ARG_TYPE(i,"AbortSignal",r)}};const validateFunction=(r,i)=>{if(typeof r!=="function")throw new ERR_INVALID_ARG_TYPE(i,"Function",r)};class AggregateError extends Error{constructor(r){if(!Array.isArray(r)){throw new TypeError(`Expected input to be an Array, got ${typeof r}`)}let i="";for(let s=0;s{r=s;i=a}));return{promise:s,resolve:r,reject:i}},promisify(r){return new Promise(((i,s)=>{r(((r,...a)=>{if(r){return s(r)}return i(...a)}))}))},debuglog(){return function(){}},format(r,...i){return r.replace(/%([sdifj])/g,(function(...[r,s]){const a=i.shift();if(s==="f"){return a.toFixed(6)}else if(s==="j"){return JSON.stringify(a)}else if(s==="s"&&typeof a==="object"){const r=a.constructor!==Object?a.constructor.name:"";return`${r} {}`.trim()}else{return a.toString()}}))},inspect(r){switch(typeof r){case"string":if(r.includes("'")){if(!r.includes('"')){return`"${r}"`}else if(!r.includes("`")&&!r.includes("${")){return`\`${r}\``}}return`'${r}'`;case"number":if(isNaN(r)){return"NaN"}else if(Object.is(r,-0)){return String(r)}return r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}},types:{isAsyncFunction(r){return r instanceof u},isArrayBufferView(r){return ArrayBuffer.isView(r)}},isBlob:h,deprecate(r,i){return r},addAbortListener:s(82361).addAbortListener||function addAbortListener(r,i){if(r===undefined){throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",r)}validateAbortSignal(r,"signal");validateFunction(i,"listener");let s;if(r.aborted){queueMicrotask((()=>i()))}else{r.addEventListener("abort",i,{__proto__:null,once:true,[l]:true});s=()=>{r.removeEventListener("abort",i)}}return{__proto__:null,[c](){var r;(r=s)===null||r===undefined?undefined:r()}}},AbortSignalAny:d.any||function AbortSignalAny(r){if(r.length===1){return r[0]}const i=new p;const abort=()=>i.abort();r.forEach((r=>{validateAbortSignal(r,"signals");r.addEventListener("abort",abort,{once:true})}));i.signal.addEventListener("abort",(()=>{r.forEach((r=>r.removeEventListener("abort",abort)))}),{once:true});return i.signal}};r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},83046:(r,i,s)=>{const{Buffer:a}=s(14300);"use strict";const{ObjectDefineProperty:l,ObjectKeys:c,ReflectApply:d}=s(67734);const{promisify:{custom:p}}=s(26346);const{streamReturningOperators:u,promiseReturningOperators:A}=s(80953);const{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=s(76101);const g=s(75966);const{setDefaultHighWaterMark:y,getDefaultHighWaterMark:b}=s(67405);const{pipeline:w}=s(2396);const{destroyer:C}=s(30589);const v=s(84985);const I={};const B=s(56153);const S=s(11283);const x=r.exports=s(41900).Stream;x.isDestroyed=S.isDestroyed;x.isDisturbed=S.isDisturbed;x.isErrored=S.isErrored;x.isReadable=S.isReadable;x.isWritable=S.isWritable;x.Readable=s(71001);for(const Q of c(u)){const _=u[Q];function fn(...r){if(new.target){throw h()}return x.Readable.from(d(_,this,r))}l(fn,"name",{__proto__:null,value:_.name});l(fn,"length",{__proto__:null,value:_.length});l(x.Readable.prototype,Q,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}for(const N of c(A)){const T=A[N];function fn(...r){if(new.target){throw h()}return d(T,this,r)}l(fn,"name",{__proto__:null,value:T.name});l(fn,"length",{__proto__:null,value:T.length});l(x.Readable.prototype,N,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}x.Writable=s(78281);x.Duplex=s(60262);x.Transform=s(26478);x.PassThrough=s(41651);x.pipeline=w;const{addAbortSignal:R}=s(18697);x.addAbortSignal=R;x.finished=v;x.destroy=C;x.compose=g;x.setDefaultHighWaterMark=y;x.getDefaultHighWaterMark=b;l(x,"promises",{__proto__:null,configurable:true,enumerable:true,get(){return B}});l(w,p,{__proto__:null,enumerable:true,get(){return B.pipeline}});l(v,p,{__proto__:null,enumerable:true,get(){return B.finished}});x.Stream=x;x._isUint8Array=function isUint8Array(r){return r instanceof Uint8Array};x._uint8ArrayToBuffer=function _uint8ArrayToBuffer(r){return a.from(r.buffer,r.byteOffset,r.byteLength)}},56153:(r,i,s)=>{"use strict";const{ArrayPrototypePop:a,Promise:l}=s(67734);const{isIterable:c,isNodeStream:d,isWebStream:p}=s(11283);const{pipelineImpl:u}=s(2396);const{finished:A}=s(84985);s(83046);function pipeline(...r){return new l(((i,s)=>{let l;let A;const h=r[r.length-1];if(h&&typeof h==="object"&&!d(h)&&!c(h)&&!p(h)){const i=a(r);l=i.signal;A=i.end}u(r,((r,a)=>{if(r){s(r)}else{i(a)}}),{signal:l,end:A})}))}r.exports={finished:A,pipeline:pipeline}},47466:function(r,i){(function(r,s){true?s(i):0})(this,(function(r){"use strict";function apply(r,...i){return(...s)=>r(...i,...s)}function initialParams(r){return function(...i){var s=i.pop();return r.call(this,i,s)}}var i=typeof queueMicrotask==="function"&&queueMicrotask;var s=typeof setImmediate==="function"&&setImmediate;var a=typeof process==="object"&&typeof process.nextTick==="function";function fallback(r){setTimeout(r,0)}function wrap(r){return(i,...s)=>r((()=>i(...s)))}var l;if(i){l=queueMicrotask}else if(s){l=setImmediate}else if(a){l=process.nextTick}else{l=fallback}var c=wrap(l);function asyncify(r){if(isAsync(r)){return function(...i){const s=i.pop();const a=r.apply(this,i);return handlePromise(a,s)}}return initialParams((function(i,s){var a;try{a=r.apply(this,i)}catch(r){return s(r)}if(a&&typeof a.then==="function"){return handlePromise(a,s)}else{s(null,a)}}))}function handlePromise(r,i){return r.then((r=>{invokeCallback(i,null,r)}),(r=>{invokeCallback(i,r&&(r instanceof Error||r.message)?r:new Error(r))}))}function invokeCallback(r,i,s){try{r(i,s)}catch(r){c((r=>{throw r}),r)}}function isAsync(r){return r[Symbol.toStringTag]==="AsyncFunction"}function isAsyncGenerator(r){return r[Symbol.toStringTag]==="AsyncGenerator"}function isAsyncIterable(r){return typeof r[Symbol.asyncIterator]==="function"}function wrapAsync(r){if(typeof r!=="function")throw new Error("expected a function");return isAsync(r)?asyncify(r):r}function awaitify(r,i){if(!i)i=r.length;if(!i)throw new Error("arity is undefined");function awaitable(...s){if(typeof s[i-1]==="function"){return r.apply(this,s)}return new Promise(((a,l)=>{s[i-1]=(r,...i)=>{if(r)return l(r);a(i.length>1?i:i[0])};r.apply(this,s)}))}return awaitable}function applyEach$1(r){return function applyEach(i,...s){const a=awaitify((function(a){var l=this;return r(i,((r,i)=>{wrapAsync(r).apply(l,s.concat(i))}),a)}));return a}}function _asyncMap(r,i,s,a){i=i||[];var l=[];var c=0;var d=wrapAsync(s);return r(i,((r,i,s)=>{var a=c++;d(r,((r,i)=>{l[a]=i;s(r)}))}),(r=>{a(r,l)}))}function isArrayLike(r){return r&&typeof r.length==="number"&&r.length>=0&&r.length%1===0}const d={};var p=d;function once(r){function wrapper(...i){if(r===null)return;var s=r;r=null;s.apply(this,i)}Object.assign(wrapper,r);return wrapper}function getIterator(r){return r[Symbol.iterator]&&r[Symbol.iterator]()}function createArrayIterator(r){var i=-1;var s=r.length;return function next(){return++i=i||d||l)return;d=true;r.next().then((({value:r,done:i})=>{if(c||l)return;d=false;if(i){l=true;if(u<=0){a(null)}return}u++;s(r,A,iterateeCallback);A++;replenish()})).catch(handleError)}function iterateeCallback(r,i){u-=1;if(c)return;if(r)return handleError(r);if(r===false){l=true;c=true;return}if(i===p||l&&u<=0){l=true;return a(null)}replenish()}function handleError(r){if(c)return;d=false;l=true;a(r)}replenish()}var eachOfLimit$2=r=>(i,s,a)=>{a=once(a);if(r<=0){throw new RangeError("concurrency limit cannot be less than 1")}if(!i){return a(null)}if(isAsyncGenerator(i)){return asyncEachOfLimit(i,r,s,a)}if(isAsyncIterable(i)){return asyncEachOfLimit(i[Symbol.asyncIterator](),r,s,a)}var l=createIterator(i);var c=false;var d=false;var u=0;var A=false;function iterateeCallback(r,i){if(d)return;u-=1;if(r){c=true;a(r)}else if(r===false){c=true;d=true}else if(i===p||c&&u<=0){c=true;return a(null)}else if(!A){replenish()}}function replenish(){A=true;while(u1?a:a[0])}callback[C]=new Promise(((s,a)=>{r=s,i=a}));return callback}function auto(r,i,s){if(typeof i!=="number"){s=i;i=null}s=once(s||promiseCallback());var a=Object.keys(r).length;if(!a){return s(null)}if(!i){i=a}var l={};var c=0;var d=false;var p=false;var u=Object.create(null);var A=[];var h=[];var g={};Object.keys(r).forEach((i=>{var s=r[i];if(!Array.isArray(s)){enqueueTask(i,[s]);h.push(i);return}var a=s.slice(0,s.length-1);var l=a.length;if(l===0){enqueueTask(i,s);h.push(i);return}g[i]=l;a.forEach((c=>{if(!r[c]){throw new Error("async.auto task `"+i+"` has a non-existent dependency `"+c+"` in "+a.join(", "))}addListener(c,(()=>{l--;if(l===0){enqueueTask(i,s)}}))}))}));checkForDeadlocks();processQueue();function enqueueTask(r,i){A.push((()=>runTask(r,i)))}function processQueue(){if(d)return;if(A.length===0&&c===0){return s(null,l)}while(A.length&&cr()));processQueue()}function runTask(r,i){if(p)return;var a=onlyOnce(((i,...a)=>{c--;if(i===false){d=true;return}if(a.length<2){[a]=a}if(i){var A={};Object.keys(l).forEach((r=>{A[r]=l[r]}));A[r]=a;p=true;u=Object.create(null);if(d)return;s(i,A)}else{l[r]=a;taskComplete(r)}}));c++;var A=wrapAsync(i[i.length-1]);if(i.length>1){A(l,a)}else{A(a)}}function checkForDeadlocks(){var r;var i=0;while(h.length){r=h.pop();i++;getDependents(r).forEach((r=>{if(--g[r]===0){h.push(r)}}))}if(i!==a){throw new Error("async.auto cannot execute tasks due to a recursive dependency")}}function getDependents(i){var s=[];Object.keys(r).forEach((a=>{const l=r[a];if(Array.isArray(l)&&l.indexOf(i)>=0){s.push(a)}}));return s}return s[C]}var v=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/;var I=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;var B=/,/;var S=/(=.+)?(\s*)$/;function stripComments(r){let i="";let s=0;let a=r.indexOf("*/");while(sr.replace(S,"").trim()))}function autoInject(r,i){var s={};Object.keys(r).forEach((i=>{var a=r[i];var l;var c=isAsync(a);var d=!c&&a.length===1||c&&a.length===0;if(Array.isArray(a)){l=[...a];a=l.pop();s[i]=l.concat(l.length>0?newTask:a)}else if(d){s[i]=a}else{l=parseParams(a);if(a.length===0&&!c&&l.length===0){throw new Error("autoInject task functions require explicit parameters.")}if(!c)l.pop();s[i]=l.concat(newTask)}function newTask(r,i){var s=l.map((i=>r[i]));s.push(i);wrapAsync(a)(...s)}}));return auto(s,i)}class DLL{constructor(){this.head=this.tail=null;this.length=0}removeLink(r){if(r.prev)r.prev.next=r.next;else this.head=r.next;if(r.next)r.next.prev=r.prev;else this.tail=r.prev;r.prev=r.next=null;this.length-=1;return r}empty(){while(this.head)this.shift();return this}insertAfter(r,i){i.prev=r;i.next=r.next;if(r.next)r.next.prev=i;else this.tail=i;r.next=i;this.length+=1}insertBefore(r,i){i.prev=r.prev;i.next=r;if(r.prev)r.prev.next=i;else this.head=i;r.prev=i;this.length+=1}unshift(r){if(this.head)this.insertBefore(this.head,r);else setInitial(this,r)}push(r){if(this.tail)this.insertAfter(this.tail,r);else setInitial(this,r)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var r=this.head;while(r){yield r.data;r=r.next}}remove(r){var i=this.head;while(i){var{next:s}=i;if(r(i)){this.removeLink(i)}i=s}return this}}function setInitial(r,i){r.length=1;r.head=r.tail=i}function queue$1(r,i,s){if(i==null){i=1}else if(i===0){throw new RangeError("Concurrency must not be zero")}var a=wrapAsync(r);var l=0;var d=[];const p={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function on(r,i){p[r].push(i)}function once(r,i){const handleAndRemove=(...s)=>{off(r,handleAndRemove);i(...s)};p[r].push(handleAndRemove)}function off(r,i){if(!r)return Object.keys(p).forEach((r=>p[r]=[]));if(!i)return p[r]=[];p[r]=p[r].filter((r=>r!==i))}function trigger(r,...i){p[r].forEach((r=>r(...i)))}var u=false;function _insert(r,i,s,a){if(a!=null&&typeof a!=="function"){throw new Error("task callback must be a function")}h.started=true;var l,d;function promiseCallback(r,...i){if(r)return s?d(r):l();if(i.length<=1)return l(i[0]);l(i)}var p=h._createTaskItem(r,s?promiseCallback:a||promiseCallback);if(i){h._tasks.unshift(p)}else{h._tasks.push(p)}if(!u){u=true;c((()=>{u=false;h.process()}))}if(s||!a){return new Promise(((r,i)=>{l=r;d=i}))}}function _createCB(r){return function(i,...s){l-=1;for(var a=0,c=r.length;a0){d.splice(u,1)}p.callback(i,...s);if(i!=null){trigger("error",i,p.data)}}if(l<=h.concurrency-h.buffer){trigger("unsaturated")}if(h.idle()){trigger("drain")}h.process()}}function _maybeDrain(r){if(r.length===0&&h.idle()){c((()=>trigger("drain")));return true}return false}const eventMethod=r=>i=>{if(!i){return new Promise(((i,s)=>{once(r,((r,a)=>{if(r)return s(r);i(a)}))}))}off(r);on(r,i)};var A=false;var h={_tasks:new DLL,_createTaskItem(r,i){return{data:r,callback:i}},*[Symbol.iterator](){yield*h._tasks[Symbol.iterator]()},concurrency:i,payload:s,buffer:i/4,started:false,paused:false,push(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,false,false,i)))}return _insert(r,false,false,i)},pushAsync(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,false,true,i)))}return _insert(r,false,true,i)},kill(){off();h._tasks.empty()},unshift(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,true,false,i)))}return _insert(r,true,false,i)},unshiftAsync(r,i){if(Array.isArray(r)){if(_maybeDrain(r))return;return r.map((r=>_insert(r,true,true,i)))}return _insert(r,true,true,i)},remove(r){h._tasks.remove(r)},process(){if(A){return}A=true;while(!h.paused&&l{l(i,r,((r,s)=>{i=s;a(r)}))}),(r=>a(r,i)))}var x=awaitify(reduce,4);function seq(...r){var i=r.map(wrapAsync);return function(...r){var s=this;var a=r[r.length-1];if(typeof a=="function"){r.pop()}else{a=promiseCallback()}x(i,r,((r,i,a)=>{i.apply(s,r.concat(((r,...i)=>{a(r,i)})))}),((r,i)=>a(r,...i)));return a[C]}}function compose(...r){return seq(...r.reverse())}function mapLimit(r,i,s,a){return _asyncMap(eachOfLimit$2(i),r,s,a)}var R=awaitify(mapLimit,4);function concatLimit(r,i,s,a){var l=wrapAsync(s);return R(r,i,((r,i)=>{l(r,((r,...s)=>{if(r)return i(r);return i(r,s)}))}),((r,i)=>{var s=[];for(var l=0;l{var d=false;var u;const A=wrapAsync(l);s(a,((s,a,l)=>{A(s,((a,c)=>{if(a||a===false)return l(a);if(r(c)&&!u){d=true;u=i(true,s);return l(null,p)}l()}))}),(r=>{if(r)return c(r);c(null,d?u:i(false))}))}}function detect(r,i,s){return _createTester((r=>r),((r,i)=>i))(A,r,i,s)}var T=awaitify(detect,3);function detectLimit(r,i,s,a){return _createTester((r=>r),((r,i)=>i))(eachOfLimit$2(i),r,s,a)}var k=awaitify(detectLimit,4);function detectSeries(r,i,s){return _createTester((r=>r),((r,i)=>i))(eachOfLimit$2(1),r,i,s)}var D=awaitify(detectSeries,3);function consoleFunc(r){return(i,...s)=>wrapAsync(i)(...s,((i,...s)=>{if(typeof console==="object"){if(i){if(console.error){console.error(i)}}else if(console[r]){s.forEach((i=>console[r](i)))}}}))}var P=consoleFunc("dir");function doWhilst(r,i,s){s=onlyOnce(s);var a=wrapAsync(r);var l=wrapAsync(i);var c;function next(r,...i){if(r)return s(r);if(r===false)return;c=i;l(...i,check)}function check(r,i){if(r)return s(r);if(r===false)return;if(!i)return s(null,...c);a(next)}return check(null,true)}var O=awaitify(doWhilst,3);function doUntil(r,i,s){const a=wrapAsync(i);return O(r,((...r)=>{const i=r.pop();a(...r,((r,s)=>i(r,!s)))}),s)}function _withoutIndex(r){return(i,s,a)=>r(i,a)}function eachLimit$2(r,i,s){return A(r,_withoutIndex(wrapAsync(i)),s)}var L=awaitify(eachLimit$2,3);function eachLimit(r,i,s,a){return eachOfLimit$2(i)(r,_withoutIndex(wrapAsync(s)),a)}var M=awaitify(eachLimit,4);function eachSeries(r,i,s){return M(r,1,i,s)}var U=awaitify(eachSeries,3);function ensureAsync(r){if(isAsync(r))return r;return function(...i){var s=i.pop();var a=true;i.push(((...r)=>{if(a){c((()=>s(...r)))}else{s(...r)}}));r.apply(this,i);a=false}}function every(r,i,s){return _createTester((r=>!r),(r=>!r))(A,r,i,s)}var j=awaitify(every,3);function everyLimit(r,i,s,a){return _createTester((r=>!r),(r=>!r))(eachOfLimit$2(i),r,s,a)}var H=awaitify(everyLimit,4);function everySeries(r,i,s){return _createTester((r=>!r),(r=>!r))(y,r,i,s)}var q=awaitify(everySeries,3);function filterArray(r,i,s,a){var l=new Array(i.length);r(i,((r,i,a)=>{s(r,((r,s)=>{l[i]=!!s;a(r)}))}),(r=>{if(r)return a(r);var s=[];for(var c=0;c{s(r,((s,c)=>{if(s)return a(s);if(c){l.push({index:i,value:r})}a(s)}))}),(r=>{if(r)return a(r);a(null,l.sort(((r,i)=>r.index-i.index)).map((r=>r.value)))}))}function _filter(r,i,s,a){var l=isArrayLike(i)?filterArray:filterGeneric;return l(r,i,wrapAsync(s),a)}function filter(r,i,s){return _filter(A,r,i,s)}var G=awaitify(filter,3);function filterLimit(r,i,s,a){return _filter(eachOfLimit$2(i),r,s,a)}var z=awaitify(filterLimit,4);function filterSeries(r,i,s){return _filter(y,r,i,s)}var V=awaitify(filterSeries,3);function forever(r,i){var s=onlyOnce(i);var a=wrapAsync(ensureAsync(r));function next(r){if(r)return s(r);if(r===false)return;a(next)}return next()}var W=awaitify(forever,2);function groupByLimit(r,i,s,a){var l=wrapAsync(s);return R(r,i,((r,i)=>{l(r,((s,a)=>{if(s)return i(s);return i(s,{key:a,val:r})}))}),((r,i)=>{var s={};var{hasOwnProperty:l}=Object.prototype;for(var c=0;c{c(r,i,((r,a)=>{if(r)return s(r);l[i]=a;s(r)}))}),(r=>a(r,l)))}var $=awaitify(mapValuesLimit,4);function mapValues(r,i,s){return $(r,Infinity,i,s)}function mapValuesSeries(r,i,s){return $(r,1,i,s)}function memoize(r,i=(r=>r)){var s=Object.create(null);var a=Object.create(null);var l=wrapAsync(r);var d=initialParams(((r,d)=>{var p=i(...r);if(p in s){c((()=>d(null,...s[p])))}else if(p in a){a[p].push(d)}else{a[p]=[d];l(...r,((r,...i)=>{if(!r){s[p]=i}var l=a[p];delete a[p];for(var c=0,d=l.length;c{var a=isArrayLike(i)?[]:{};r(i,((r,i,s)=>{wrapAsync(r)(((r,...l)=>{if(l.length<2){[l]=l}a[i]=l;s(r)}))}),(r=>s(r,a)))}),3);function parallel(r,i){return Z(A,r,i)}function parallelLimit(r,i,s){return Z(eachOfLimit$2(i),r,s)}function queue(r,i){var s=wrapAsync(r);return queue$1(((r,i)=>{s(r[0],i)}),i,1)}class Heap{constructor(){this.heap=[];this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){this.heap=[];return this}percUp(r){let i;while(r>0&&smaller(this.heap[r],this.heap[i=parent(r)])){let s=this.heap[r];this.heap[r]=this.heap[i];this.heap[i]=s;r=i}}percDown(r){let i;while((i=leftChi(r))=0;r--){this.percDown(r)}return this}}function leftChi(r){return(r<<1)+1}function parent(r){return(r+1>>1)-1}function smaller(r,i){if(r.priority!==i.priority){return r.priority({data:r,priority:i,callback:s});function createDataItems(r,i){if(!Array.isArray(r)){return{data:r,priority:i}}return r.map((r=>({data:r,priority:i})))}s.push=function(r,i=0,s){return a(createDataItems(r,i),s)};s.pushAsync=function(r,i=0,s){return l(createDataItems(r,i),s)};delete s.unshift;delete s.unshiftAsync;return s}function race(r,i){i=once(i);if(!Array.isArray(r))return i(new TypeError("First argument to race must be an array of functions"));if(!r.length)return i();for(var s=0,a=r.length;s{let a={};if(r){a.error=r}if(i.length>0){var l=i;if(i.length<=1){[l]=i}a.value=l}s(null,a)}));return i.apply(this,r)}))}function reflectAll(r){var i;if(Array.isArray(r)){i=r.map(reflect)}else{i={};Object.keys(r).forEach((s=>{i[s]=reflect.call(this,r[s])}))}return i}function reject$2(r,i,s,a){const l=wrapAsync(s);return _filter(r,i,((r,i)=>{l(r,((r,s)=>{i(r,!s)}))}),a)}function reject(r,i,s){return reject$2(A,r,i,s)}var te=awaitify(reject,3);function rejectLimit(r,i,s,a){return reject$2(eachOfLimit$2(i),r,s,a)}var re=awaitify(rejectLimit,4);function rejectSeries(r,i,s){return reject$2(y,r,i,s)}var ne=awaitify(rejectSeries,3);function constant(r){return function(){return r}}const ie=5;const se=0;function retry(r,i,s){var a={times:ie,intervalFunc:constant(se)};if(arguments.length<3&&typeof r==="function"){s=i||promiseCallback();i=r}else{parseTimes(a,r);s=s||promiseCallback()}if(typeof i!=="function"){throw new Error("Invalid arguments for async.retry")}var l=wrapAsync(i);var c=1;function retryAttempt(){l(((r,...i)=>{if(r===false)return;if(r&&c++{if(i.lengthr))(A,r,i,s)}var ae=awaitify(some,3);function someLimit(r,i,s,a){return _createTester(Boolean,(r=>r))(eachOfLimit$2(i),r,s,a)}var oe=awaitify(someLimit,4);function someSeries(r,i,s){return _createTester(Boolean,(r=>r))(y,r,i,s)}var le=awaitify(someSeries,3);function sortBy(r,i,s){var a=wrapAsync(i);return h(r,((r,i)=>{a(r,((s,a)=>{if(s)return i(s);i(s,{value:r,criteria:a})}))}),((r,i)=>{if(r)return s(r);s(null,i.sort(comparator).map((r=>r.value)))}));function comparator(r,i){var s=r.criteria,a=i.criteria;return sa?1:0}}var ce=awaitify(sortBy,3);function timeout(r,i,s){var a=wrapAsync(r);return initialParams(((l,c)=>{var d=false;var p;function timeoutCallback(){var i=r.name||"anonymous";var a=new Error('Callback function "'+i+'" timed out.');a.code="ETIMEDOUT";if(s){a.info=s}d=true;c(a)}l.push(((...r)=>{if(!d){c(...r);clearTimeout(p)}}));p=setTimeout(timeoutCallback,i);a(...l)}))}function range(r){var i=Array(r);while(r--){i[r]=r}return i}function timesLimit(r,i,s,a){var l=wrapAsync(s);return R(range(r),i,l,a)}function times(r,i,s){return timesLimit(r,Infinity,i,s)}function timesSeries(r,i,s){return timesLimit(r,1,i,s)}function transform(r,i,s,a){if(arguments.length<=3&&typeof i==="function"){a=s;s=i;i=Array.isArray(r)?[]:{}}a=once(a||promiseCallback());var l=wrapAsync(s);A(r,((r,s,a)=>{l(i,r,s,a)}),(r=>a(r,i)));return a[C]}function tryEach(r,i){var s=null;var a;return U(r,((r,i)=>{wrapAsync(r)(((r,...l)=>{if(r===false)return i(r);if(l.length<2){[a]=l}else{a=l}s=r;i(r?null:{})}))}),(()=>i(s,a)))}var de=awaitify(tryEach);function unmemoize(r){return(...i)=>(r.unmemoized||r)(...i)}function whilst(r,i,s){s=onlyOnce(s);var a=wrapAsync(i);var l=wrapAsync(r);var c=[];function next(r,...i){if(r)return s(r);c=i;if(r===false)return;l(check)}function check(r,i){if(r)return s(r);if(r===false)return;if(!i)return s(null,...c);a(next)}return l(check)}var pe=awaitify(whilst,3);function until(r,i,s){const a=wrapAsync(r);return pe((r=>a(((i,s)=>r(i,!s)))),i,s)}function waterfall(r,i){i=once(i);if(!Array.isArray(r))return i(new Error("First argument to waterfall must be an array of functions"));if(!r.length)return i();var s=0;function nextTask(i){var a=wrapAsync(r[s++]);a(...i,onlyOnce(next))}function next(a,...l){if(a===false)return;if(a||s===r.length){return i(a,...l)}nextTask(l)}nextTask([])}var ue=awaitify(waterfall);var Ae={apply:apply,applyEach:g,applyEachSeries:w,asyncify:asyncify,auto:auto,autoInject:autoInject,cargo:cargo$1,cargoQueue:cargo,compose:compose,concat:_,concatLimit:Q,concatSeries:N,constant:constant$1,detect:T,detectLimit:k,detectSeries:D,dir:P,doUntil:doUntil,doWhilst:O,each:L,eachLimit:M,eachOf:A,eachOfLimit:u,eachOfSeries:y,eachSeries:U,ensureAsync:ensureAsync,every:j,everyLimit:H,everySeries:q,filter:G,filterLimit:z,filterSeries:V,forever:W,groupBy:groupBy,groupByLimit:Y,groupBySeries:groupBySeries,log:J,map:h,mapLimit:R,mapSeries:b,mapValues:mapValues,mapValuesLimit:$,mapValuesSeries:mapValuesSeries,memoize:memoize,nextTick:K,parallel:parallel,parallelLimit:parallelLimit,priorityQueue:priorityQueue,queue:queue,race:ee,reduce:x,reduceRight:reduceRight,reflect:reflect,reflectAll:reflectAll,reject:te,rejectLimit:re,rejectSeries:ne,retry:retry,retryable:retryable,seq:seq,series:series,setImmediate:c,some:ae,someLimit:oe,someSeries:le,sortBy:ce,timeout:timeout,times:times,timesLimit:timesLimit,timesSeries:timesSeries,transform:transform,tryEach:de,unmemoize:unmemoize,until:until,waterfall:ue,whilst:pe,all:j,allLimit:H,allSeries:q,any:ae,anyLimit:oe,anySeries:le,find:T,findLimit:k,findSeries:D,flatMap:_,flatMapLimit:Q,flatMapSeries:N,forEach:L,forEachSeries:U,forEachLimit:M,forEachOf:A,forEachOfSeries:y,forEachOfLimit:u,inject:x,foldl:x,foldr:reduceRight,select:G,selectLimit:z,selectSeries:V,wrapSync:asyncify,during:pe,doDuring:O};r.all=j;r.allLimit=H;r.allSeries=q;r.any=ae;r.anyLimit=oe;r.anySeries=le;r.apply=apply;r.applyEach=g;r.applyEachSeries=w;r.asyncify=asyncify;r.auto=auto;r.autoInject=autoInject;r.cargo=cargo$1;r.cargoQueue=cargo;r.compose=compose;r.concat=_;r.concatLimit=Q;r.concatSeries=N;r.constant=constant$1;r.default=Ae;r.detect=T;r.detectLimit=k;r.detectSeries=D;r.dir=P;r.doDuring=O;r.doUntil=doUntil;r.doWhilst=O;r.during=pe;r.each=L;r.eachLimit=M;r.eachOf=A;r.eachOfLimit=u;r.eachOfSeries=y;r.eachSeries=U;r.ensureAsync=ensureAsync;r.every=j;r.everyLimit=H;r.everySeries=q;r.filter=G;r.filterLimit=z;r.filterSeries=V;r.find=T;r.findLimit=k;r.findSeries=D;r.flatMap=_;r.flatMapLimit=Q;r.flatMapSeries=N;r.foldl=x;r.foldr=reduceRight;r.forEach=L;r.forEachLimit=M;r.forEachOf=A;r.forEachOfLimit=u;r.forEachOfSeries=y;r.forEachSeries=U;r.forever=W;r.groupBy=groupBy;r.groupByLimit=Y;r.groupBySeries=groupBySeries;r.inject=x;r.log=J;r.map=h;r.mapLimit=R;r.mapSeries=b;r.mapValues=mapValues;r.mapValuesLimit=$;r.mapValuesSeries=mapValuesSeries;r.memoize=memoize;r.nextTick=K;r.parallel=parallel;r.parallelLimit=parallelLimit;r.priorityQueue=priorityQueue;r.queue=queue;r.race=ee;r.reduce=x;r.reduceRight=reduceRight;r.reflect=reflect;r.reflectAll=reflectAll;r.reject=te;r.rejectLimit=re;r.rejectSeries=ne;r.retry=retry;r.retryable=retryable;r.select=G;r.selectLimit=z;r.selectSeries=V;r.seq=seq;r.series=series;r.setImmediate=c;r.some=ae;r.someLimit=oe;r.someSeries=le;r.sortBy=ce;r.timeout=timeout;r.times=times;r.timesLimit=timesLimit;r.timesSeries=timesSeries;r.transform=transform;r.tryEach=de;r.unmemoize=unmemoize;r.until=until;r.waterfall=ue;r.whilst=pe;r.wrapSync=asyncify;Object.defineProperty(r,"__esModule",{value:true})}))},55633:(r,i,s)=>{r.exports={parallel:s(40300),serial:s(47164),serialOrdered:s(27898)}},37856:r=>{r.exports=abort;function abort(r){Object.keys(r.jobs).forEach(clean.bind(r));r.jobs={}}function clean(r){if(typeof this.jobs[r]=="function"){this.jobs[r]()}}},18464:(r,i,s)=>{var a=s(34043);r.exports=async;function async(r){var i=false;a((function(){i=true}));return function async_callback(s,l){if(i){r(s,l)}else{a((function nextTick_callback(){r(s,l)}))}}}},34043:r=>{r.exports=defer;function defer(r){var i=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(i){i(r)}else{setTimeout(r,0)}}},95756:(r,i,s)=>{var a=s(18464),l=s(37856);r.exports=iterate;function iterate(r,i,s,a){var c=s["keyedList"]?s["keyedList"][s.index]:s.index;s.jobs[c]=runJob(i,c,r[c],(function(r,i){if(!(c in s.jobs)){return}delete s.jobs[c];if(r){l(s)}else{s.results[c]=i}a(r,s.results)}))}function runJob(r,i,s,l){var c;if(r.length==2){c=r(s,a(l))}else{c=r(s,i,a(l))}return c}},94773:r=>{r.exports=state;function state(r,i){var s=!Array.isArray(r),a={index:0,keyedList:s||i?Object.keys(r):null,jobs:{},results:s?{}:[],size:s?Object.keys(r).length:r.length};if(i){a.keyedList.sort(s?i:function(s,a){return i(r[s],r[a])})}return a}},17484:(r,i,s)=>{var a=s(37856),l=s(18464);r.exports=terminator;function terminator(r){if(!Object.keys(this.jobs).length){return}this.index=this.size;a(this);l(r)(null,this.results)}},40300:(r,i,s)=>{var a=s(95756),l=s(94773),c=s(17484);r.exports=parallel;function parallel(r,i,s){var d=l(r);while(d.index<(d["keyedList"]||r).length){a(r,i,d,(function(r,i){if(r){s(r,i);return}if(Object.keys(d.jobs).length===0){s(null,d.results);return}}));d.index++}return c.bind(d,s)}},47164:(r,i,s)=>{var a=s(27898);r.exports=serial;function serial(r,i,s){return a(r,i,null,s)}},27898:(r,i,s)=>{var a=s(95756),l=s(94773),c=s(17484);r.exports=serialOrdered;r.exports.ascending=ascending;r.exports.descending=descending;function serialOrdered(r,i,s,d){var p=l(r,s);a(r,i,p,(function iteratorHandler(s,l){if(s){d(s,l);return}p.index++;if(p.index<(p["keyedList"]||r).length){a(r,i,p,iteratorHandler);return}d(null,p.results)}));return c.bind(p,d)}function ascending(r,i){return ri?1:0}function descending(r,i){return-1*ascending(r,i)}},49320:r=>{function isBuffer(r){return Buffer.isBuffer(r)||r instanceof Uint8Array}function isEncoding(r){return Buffer.isEncoding(r)}function alloc(r,i,s){return Buffer.alloc(r,i,s)}function allocUnsafe(r){return Buffer.allocUnsafe(r)}function allocUnsafeSlow(r){return Buffer.allocUnsafeSlow(r)}function byteLength(r,i){return Buffer.byteLength(r,i)}function compare(r,i){return Buffer.compare(r,i)}function concat(r,i){return Buffer.concat(r,i)}function copy(r,i,s,a,l){return toBuffer(r).copy(i,s,a,l)}function equals(r,i){return toBuffer(r).equals(i)}function fill(r,i,s,a,l){return toBuffer(r).fill(i,s,a,l)}function from(r,i,s){return Buffer.from(r,i,s)}function includes(r,i,s,a){return toBuffer(r).includes(i,s,a)}function indexOf(r,i,s,a){return toBuffer(r).indexOf(i,s,a)}function lastIndexOf(r,i,s,a){return toBuffer(r).lastIndexOf(i,s,a)}function swap16(r){return toBuffer(r).swap16()}function swap32(r){return toBuffer(r).swap32()}function swap64(r){return toBuffer(r).swap64()}function toBuffer(r){if(Buffer.isBuffer(r))return r;return Buffer.from(r.buffer,r.byteOffset,r.byteLength)}function toString(r,i,s,a){return toBuffer(r).toString(i,s,a)}function write(r,i,s,a,l){return toBuffer(r).write(i,s,a,l)}function writeDoubleLE(r,i,s){return toBuffer(r).writeDoubleLE(i,s)}function writeFloatLE(r,i,s){return toBuffer(r).writeFloatLE(i,s)}function writeUInt32LE(r,i,s){return toBuffer(r).writeUInt32LE(i,s)}function writeInt32LE(r,i,s){return toBuffer(r).writeInt32LE(i,s)}function readDoubleLE(r,i){return toBuffer(r).readDoubleLE(i)}function readFloatLE(r,i){return toBuffer(r).readFloatLE(i)}function readUInt32LE(r,i){return toBuffer(r).readUInt32LE(i)}function readInt32LE(r,i){return toBuffer(r).readInt32LE(i)}r.exports={isBuffer:isBuffer,isEncoding:isEncoding,alloc:alloc,allocUnsafe:allocUnsafe,allocUnsafeSlow:allocUnsafeSlow,byteLength:byteLength,compare:compare,concat:concat,copy:copy,equals:equals,fill:fill,from:from,includes:includes,indexOf:indexOf,lastIndexOf:lastIndexOf,swap16:swap16,swap32:swap32,swap64:swap64,toBuffer:toBuffer,toString:toString,write:write,writeDoubleLE:writeDoubleLE,writeFloatLE:writeFloatLE,writeUInt32LE:writeUInt32LE,writeInt32LE:writeInt32LE,readDoubleLE:readDoubleLE,readFloatLE:readFloatLE,readUInt32LE:readUInt32LE,readInt32LE:readInt32LE}},44350:r=>{"use strict";r.exports=balanced;function balanced(r,i,s){if(r instanceof RegExp)r=maybeMatch(r,s);if(i instanceof RegExp)i=maybeMatch(i,s);var a=range(r,i,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+r.length,a[1]),post:s.slice(a[1]+i.length)}}function maybeMatch(r,i){var s=i.match(r);return s?s[0]:null}balanced.range=range;function range(r,i,s){var a,l,c,d,p;var u=s.indexOf(r);var A=s.indexOf(i,u+1);var h=u;if(u>=0&&A>0){if(r===i){return[u,A]}a=[];c=s.length;while(h>=0&&!p){if(h==u){a.push(h);u=s.indexOf(r,h+1)}else if(a.length==1){p=[a.pop(),A]}else{l=a.pop();if(l=0?u:A}if(a.length){p=[c,d]}}return p}},15546:(r,i,s)=>{var a=s(35109);var l=s(87614);var c=s(26538);var d=Function.bind;var p=d.bind(d);function bindApi(r,i,s){var a=p(c,null).apply(null,s?[i,s]:[i]);r.api={remove:a};r.remove=a;["before","error","after","wrap"].forEach((function(a){var c=s?[i,a,s]:[i,a];r[a]=r.api[a]=p(l,null).apply(null,c)}))}function HookSingular(){var r="h";var i={registry:{}};var s=a.bind(null,i,r);bindApi(s,i,r);return s}function HookCollection(){var r={registry:{}};var i=a.bind(null,r);bindApi(i,r);return i}var u=false;function Hook(){if(!u){console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4');u=true}return HookCollection()}Hook.Singular=HookSingular.bind();Hook.Collection=HookCollection.bind();r.exports=Hook;r.exports.Hook=Hook;r.exports.Singular=Hook.Singular;r.exports.Collection=Hook.Collection},87614:r=>{r.exports=addHook;function addHook(r,i,s,a){var l=a;if(!r.registry[s]){r.registry[s]=[]}if(i==="before"){a=function(r,i){return Promise.resolve().then(l.bind(null,i)).then(r.bind(null,i))}}if(i==="after"){a=function(r,i){var s;return Promise.resolve().then(r.bind(null,i)).then((function(r){s=r;return l(s,i)})).then((function(){return s}))}}if(i==="error"){a=function(r,i){return Promise.resolve().then(r.bind(null,i)).catch((function(r){return l(r,i)}))}}r.registry[s].push({hook:a,orig:l})}},35109:r=>{r.exports=register;function register(r,i,s,a){if(typeof s!=="function"){throw new Error("method for before hook must be a function")}if(!a){a={}}if(Array.isArray(i)){return i.reverse().reduce((function(i,s){return register.bind(null,r,s,i,a)}),s)()}return Promise.resolve().then((function(){if(!r.registry[i]){return s(a)}return r.registry[i].reduce((function(r,i){return i.hook.bind(null,r,a)}),s)()}))}},26538:r=>{r.exports=removeHook;function removeHook(r,i,s){if(!r.registry[i]){return}var a=r.registry[i].map((function(r){return r.orig})).indexOf(s);if(a===-1){return}r.registry[i].splice(a,1)}},20593:(r,i,s)=>{var a=s(39416);var l=s(82361).EventEmitter;var c=s(75506);var d=s(93771);var p=s(12781).Stream;i=r.exports=function(r,s){if(Buffer.isBuffer(r)){return i.parse(r)}var a=i.stream();if(r&&r.pipe){r.pipe(a)}else if(r){r.on(s||"data",(function(r){a.write(r)}));r.on("end",(function(){a.end()}))}return a};i.stream=function(r){if(r)return i.apply(null,arguments);var s=null;function getBytes(r,i,a){s={bytes:r,skip:a,cb:function(r){s=null;i(r)}};dispatch()}var u=null;function dispatch(){if(!s){if(b)y=true;return}if(typeof s==="function"){s()}else{var r=u+s.bytes;if(h.length>=r){var i;if(u==null){i=h.splice(0,r);if(!s.skip){i=i.slice()}}else{if(!s.skip){i=h.slice(u,r)}u=r}if(s.skip){s.cb()}else{s.cb(i)}}}}function builder(r){function next(){if(!y)r.next()}var i=words((function(r,i){return function(s){getBytes(r,(function(r){g.set(s,i(r));next()}))}}));i.tap=function(i){r.nest(i,g.store)};i.into=function(i,s){if(!g.get(i))g.set(i,{});var a=g;g=d(a.get(i));r.nest((function(){s.apply(this,arguments);this.tap((function(){g=a}))}),g.store)};i.flush=function(){g.store={};next()};i.loop=function(i){var s=false;r.nest(false,(function loop(){this.vars=g.store;i.call(this,(function(){s=true;next()}),g.store);this.tap(function(){if(s)r.next();else loop.call(this)}.bind(this))}),g.store)};i.buffer=function(r,i){if(typeof i==="string"){i=g.get(i)}getBytes(i,(function(i){g.set(r,i);next()}))};i.skip=function(r){if(typeof r==="string"){r=g.get(r)}getBytes(r,(function(){next()}))};i.scan=function find(r,i){if(typeof i==="string"){i=new Buffer(i)}else if(!Buffer.isBuffer(i)){throw new Error("search must be a Buffer or a string")}var a=0;s=function(){var l=h.indexOf(i,u+a);var c=l-u-a;if(l!==-1){s=null;if(u!=null){g.set(r,h.slice(u,u+a+c));u+=a+c+i.length}else{g.set(r,h.slice(0,a+c));h.splice(0,a+c+i.length)}next();dispatch()}else{c=Math.max(h.length-i.length-u-a,0)}a+=c};dispatch()};i.peek=function(i){u=0;r.nest((function(){i.call(this,g.store);this.tap((function(){u=null}))}))};return i}var A=a.light(builder);A.writable=true;var h=c();A.write=function(r){h.push(r);dispatch()};var g=d();var y=false,b=false;A.end=function(){b=true};A.pipe=p.prototype.pipe;Object.getOwnPropertyNames(l.prototype).forEach((function(r){A[r]=l.prototype[r]}));return A};i.parse=function parse(r){var i=words((function(l,c){return function(d){if(s+l<=r.length){var p=r.slice(s,s+l);s+=l;a.set(d,c(p))}else{a.set(d,null)}return i}}));var s=0;var a=d();i.vars=a.store;i.tap=function(r){r.call(i,a.store);return i};i.into=function(r,s){if(!a.get(r)){a.set(r,{})}var l=a;a=d(l.get(r));s.call(i,a.store);a=l;return i};i.loop=function(r){var s=false;var ender=function(){s=true};while(s===false){r.call(i,ender,a.store)}return i};i.buffer=function(l,c){if(typeof c==="string"){c=a.get(c)}var d=r.slice(s,Math.min(r.length,s+c));s+=c;a.set(l,d);return i};i.skip=function(r){if(typeof r==="string"){r=a.get(r)}s+=r;return i};i.scan=function(l,c){if(typeof c==="string"){c=new Buffer(c)}else if(!Buffer.isBuffer(c)){throw new Error("search must be a Buffer or a string")}a.set(l,null);for(var d=0;d+s<=r.length-c.length+1;d++){for(var p=0;p=r.length};return i};function decodeLEu(r){var i=0;for(var s=0;s{r.exports=function(r){function getset(r,s){var a=i.store;var l=r.split(".");l.slice(0,-1).forEach((function(r){if(a[r]===undefined)a[r]={};a=a[r]}));var c=l[l.length-1];if(arguments.length==1){return a[c]}else{return a[c]=s}}var i={get:function(r){return getset(r)},set:function(r,i){return getset(r,i)},store:r||{}};return i}},93860:function(r){(function(i,s){true?r.exports=s():0})(this,(function(){"use strict";var r=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getCjsExportFromNamespace(r){return r&&r["default"]||r}var load=function(r,i,s={}){var a,l,c;for(a in i){c=i[a];s[a]=(l=r[a])!=null?l:c}return s};var overwrite=function(r,i,s={}){var a,l;for(a in r){l=r[a];if(i[a]!==void 0){s[a]=l}}return s};var i={load:load,overwrite:overwrite};var s;s=class DLList{constructor(r,i){this.incr=r;this.decr=i;this._first=null;this._last=null;this.length=0}push(r){var i;this.length++;if(typeof this.incr==="function"){this.incr()}i={value:r,prev:this._last,next:null};if(this._last!=null){this._last.next=i;this._last=i}else{this._first=this._last=i}return void 0}shift(){var r;if(this._first==null){return}else{this.length--;if(typeof this.decr==="function"){this.decr()}}r=this._first.value;if((this._first=this._first.next)!=null){this._first.prev=null}else{this._last=null}return r}first(){if(this._first!=null){return this._first.value}}getArray(){var r,i,s;r=this._first;s=[];while(r!=null){s.push((i=r,r=r.next,i.value))}return s}forEachShift(r){var i;i=this.shift();while(i!=null){r(i),i=this.shift()}return void 0}debug(){var r,i,s,a,l;r=this._first;l=[];while(r!=null){l.push((i=r,r=r.next,{value:i.value,prev:(s=i.prev)!=null?s.value:void 0,next:(a=i.next)!=null?a.value:void 0}))}return l}};var a=s;var l;l=class Events{constructor(r){this.instance=r;this._events={};if(this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null){throw new Error("An Emitter already exists for this object")}this.instance.on=(r,i)=>this._addListener(r,"many",i);this.instance.once=(r,i)=>this._addListener(r,"once",i);this.instance.removeAllListeners=(r=null)=>{if(r!=null){return delete this._events[r]}else{return this._events={}}}}_addListener(r,i,s){var a;if((a=this._events)[r]==null){a[r]=[]}this._events[r].push({cb:s,status:i});return this.instance}listenerCount(r){if(this._events[r]!=null){return this._events[r].length}else{return 0}}async trigger(r,...i){var s,a;try{if(r!=="debug"){this.trigger("debug",`Event triggered: ${r}`,i)}if(this._events[r]==null){return}this._events[r]=this._events[r].filter((function(r){return r.status!=="none"}));a=this._events[r].map((async r=>{var s,a;if(r.status==="none"){return}if(r.status==="once"){r.status="none"}try{a=typeof r.cb==="function"?r.cb(...i):void 0;if(typeof(a!=null?a.then:void 0)==="function"){return await a}else{return a}}catch(r){s=r;{this.trigger("error",s)}return null}}));return(await Promise.all(a)).find((function(r){return r!=null}))}catch(r){s=r;{this.trigger("error",s)}return null}}};var c=l;var d,p,u;d=a;p=c;u=class Queues{constructor(r){var i;this.Events=new p(this);this._length=0;this._lists=function(){var s,a,l;l=[];for(i=s=1,a=r;1<=a?s<=a:s>=a;i=1<=a?++s:--s){l.push(new d((()=>this.incr()),(()=>this.decr())))}return l}.call(this)}incr(){if(this._length++===0){return this.Events.trigger("leftzero")}}decr(){if(--this._length===0){return this.Events.trigger("zero")}}push(r){return this._lists[r.options.priority].push(r)}queued(r){if(r!=null){return this._lists[r].length}else{return this._length}}shiftAll(r){return this._lists.forEach((function(i){return i.forEachShift(r)}))}getFirst(r=this._lists){var i,s,a;for(i=0,s=r.length;i0){return a}}return[]}shiftLastFrom(r){return this.getFirst(this._lists.slice(r).reverse()).shift()}};var A=u;var h;h=class BottleneckError extends Error{};var g=h;var y,b,w,C,v;C=10;b=5;v=i;y=g;w=class Job{constructor(r,i,s,a,l,c,d,p){this.task=r;this.args=i;this.rejectOnDrop=l;this.Events=c;this._states=d;this.Promise=p;this.options=v.load(s,a);this.options.priority=this._sanitizePriority(this.options.priority);if(this.options.id===a.id){this.options.id=`${this.options.id}-${this._randomIndex()}`}this.promise=new this.Promise(((r,i)=>{this._resolve=r;this._reject=i}));this.retryCount=0}_sanitizePriority(r){var i;i=~~r!==r?b:r;if(i<0){return 0}else if(i>C-1){return C-1}else{return i}}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:r,message:i="This job has been dropped by Bottleneck"}={}){if(this._states.remove(this.options.id)){if(this.rejectOnDrop){this._reject(r!=null?r:new y(i))}this.Events.trigger("dropped",{args:this.args,options:this.options,task:this.task,promise:this.promise});return true}else{return false}}_assertStatus(r){var i;i=this._states.jobStatus(this.options.id);if(!(i===r||r==="DONE"&&i===null)){throw new y(`Invalid job status ${i}, expected ${r}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}}doReceive(){this._states.start(this.options.id);return this.Events.trigger("received",{args:this.args,options:this.options})}doQueue(r,i){this._assertStatus("RECEIVED");this._states.next(this.options.id);return this.Events.trigger("queued",{args:this.args,options:this.options,reachedHWM:r,blocked:i})}doRun(){if(this.retryCount===0){this._assertStatus("QUEUED");this._states.next(this.options.id)}else{this._assertStatus("EXECUTING")}return this.Events.trigger("scheduled",{args:this.args,options:this.options})}async doExecute(r,i,s,a){var l,c,d;if(this.retryCount===0){this._assertStatus("RUNNING");this._states.next(this.options.id)}else{this._assertStatus("EXECUTING")}c={args:this.args,options:this.options,retryCount:this.retryCount};this.Events.trigger("executing",c);try{d=await(r!=null?r.schedule(this.options,this.task,...this.args):this.task(...this.args));if(i()){this.doDone(c);await a(this.options,c);this._assertStatus("DONE");return this._resolve(d)}}catch(r){l=r;return this._onFailure(l,c,i,s,a)}}doExpire(r,i,s){var a,l;if(this._states.jobStatus(this.options.id==="RUNNING")){this._states.next(this.options.id)}this._assertStatus("EXECUTING");l={args:this.args,options:this.options,retryCount:this.retryCount};a=new y(`This job timed out after ${this.options.expiration} ms.`);return this._onFailure(a,l,r,i,s)}async _onFailure(r,i,s,a,l){var c,d;if(s()){c=await this.Events.trigger("failed",r,i);if(c!=null){d=~~c;this.Events.trigger("retry",`Retrying ${this.options.id} after ${d} ms`,i);this.retryCount++;return a(d)}else{this.doDone(i);await l(this.options,i);this._assertStatus("DONE");return this._reject(r)}}}doDone(r){this._assertStatus("EXECUTING");this._states.next(this.options.id);return this.Events.trigger("done",r)}};var I=w;var B,S,x;x=i;B=g;S=class LocalDatastore{constructor(r,i,s){this.instance=r;this.storeOptions=i;this.clientId=this.instance._randomIndex();x.load(s,s,this);this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now();this._running=0;this._done=0;this._unblockTime=0;this.ready=this.Promise.resolve();this.clients={};this._startHeartbeat()}_startHeartbeat(){var r;if(this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)){return typeof(r=this.heartbeat=setInterval((()=>{var r,i,s,a,l;a=Date.now();if(this.storeOptions.reservoirRefreshInterval!=null&&a>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval){this._lastReservoirRefresh=a;this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount;this.instance._drainAll(this.computeCapacity())}if(this.storeOptions.reservoirIncreaseInterval!=null&&a>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval){({reservoirIncreaseAmount:r,reservoirIncreaseMaximum:s,reservoir:l}=this.storeOptions);this._lastReservoirIncrease=a;i=s!=null?Math.min(r,s-l):r;if(i>0){this.storeOptions.reservoir+=i;return this.instance._drainAll(this.computeCapacity())}}}),this.heartbeatInterval)).unref==="function"?r.unref():void 0}else{return clearInterval(this.heartbeat)}}async __publish__(r){await this.yieldLoop();return this.instance.Events.trigger("message",r.toString())}async __disconnect__(r){await this.yieldLoop();clearInterval(this.heartbeat);return this.Promise.resolve()}yieldLoop(r=0){return new this.Promise((function(i,s){return setTimeout(i,r)}))}computePenalty(){var r;return(r=this.storeOptions.penalty)!=null?r:15*this.storeOptions.minTime||5e3}async __updateSettings__(r){await this.yieldLoop();x.overwrite(r,r,this.storeOptions);this._startHeartbeat();this.instance._drainAll(this.computeCapacity());return true}async __running__(){await this.yieldLoop();return this._running}async __queued__(){await this.yieldLoop();return this.instance.queued()}async __done__(){await this.yieldLoop();return this._done}async __groupCheck__(r){await this.yieldLoop();return this._nextRequest+this.timeout=r}check(r,i){return this.conditionsCheck(r)&&this._nextRequest-i<=0}async __check__(r){var i;await this.yieldLoop();i=Date.now();return this.check(r,i)}async __register__(r,i,s){var a,l;await this.yieldLoop();a=Date.now();if(this.conditionsCheck(i)){this._running+=i;if(this.storeOptions.reservoir!=null){this.storeOptions.reservoir-=i}l=Math.max(this._nextRequest-a,0);this._nextRequest=a+l+this.storeOptions.minTime;return{success:true,wait:l,reservoir:this.storeOptions.reservoir}}else{return{success:false}}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(r,i){var s,a,l;await this.yieldLoop();if(this.storeOptions.maxConcurrent!=null&&i>this.storeOptions.maxConcurrent){throw new B(`Impossible to add a job having a weight of ${i} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`)}a=Date.now();l=this.storeOptions.highWater!=null&&r===this.storeOptions.highWater&&!this.check(i,a);s=this.strategyIsBlock()&&(l||this.isBlocked(a));if(s){this._unblockTime=a+this.computePenalty();this._nextRequest=this._unblockTime+this.storeOptions.minTime;this.instance._dropAllQueued()}return{reachedHWM:l,blocked:s,strategy:this.storeOptions.strategy}}async __free__(r,i){await this.yieldLoop();this._running-=i;this._done+=i;this.instance._drainAll(this.computeCapacity());return{running:this._running}}};var R=S;var Q,_;Q=g;_=class States{constructor(r){this.status=r;this._jobs={};this.counts=this.status.map((function(){return 0}))}next(r){var i,s;i=this._jobs[r];s=i+1;if(i!=null&&s{r[this.status[s]]=i;return r}),{})}};var N=_;var T,k;T=a;k=class Sync{constructor(r,i){this.schedule=this.schedule.bind(this);this.name=r;this.Promise=i;this._running=0;this._queue=new T}isEmpty(){return this._queue.length===0}async _tryToRun(){var r,i,s,a,l,c,d;if(this._running<1&&this._queue.length>0){this._running++;({task:d,args:r,resolve:l,reject:a}=this._queue.shift());i=await async function(){try{c=await d(...r);return function(){return l(c)}}catch(r){s=r;return function(){return a(s)}}}();this._running--;this._tryToRun();return i()}}schedule(r,...i){var s,a,l;l=a=null;s=new this.Promise((function(r,i){l=r;return a=i}));this._queue.push({task:r,args:i,resolve:l,reject:a});this._tryToRun();return s}};var D=k;var P="2.19.5";var O={version:P};var L=Object.freeze({version:P,default:O});var require$$2=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var require$$3=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var require$$4=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var M,U,j,H,q,G;G=i;M=c;H=require$$2;j=require$$3;q=require$$4;U=function(){class Group{constructor(r={}){this.deleteKey=this.deleteKey.bind(this);this.limiterOptions=r;G.load(this.limiterOptions,this.defaults,this);this.Events=new M(this);this.instances={};this.Bottleneck=ce;this._startAutoCleanup();this.sharedConnection=this.connection!=null;if(this.connection==null){if(this.limiterOptions.datastore==="redis"){this.connection=new H(Object.assign({},this.limiterOptions,{Events:this.Events}))}else if(this.limiterOptions.datastore==="ioredis"){this.connection=new j(Object.assign({},this.limiterOptions,{Events:this.Events}))}}}key(r=""){var i;return(i=this.instances[r])!=null?i:(()=>{var i;i=this.instances[r]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${r}`,timeout:this.timeout,connection:this.connection}));this.Events.trigger("created",i,r);return i})()}async deleteKey(r=""){var i,s;s=this.instances[r];if(this.connection){i=await this.connection.__runCommand__(["del",...q.allKeys(`${this.id}-${r}`)])}if(s!=null){delete this.instances[r];await s.disconnect()}return s!=null||i>0}limiters(){var r,i,s,a;i=this.instances;s=[];for(r in i){a=i[r];s.push({key:r,limiter:a})}return s}keys(){return Object.keys(this.instances)}async clusterKeys(){var r,i,s,a,l,c,d,p,u;if(this.connection==null){return this.Promise.resolve(this.keys())}c=[];r=null;u=`b_${this.id}-`.length;i="_settings".length;while(r!==0){[p,s]=await this.connection.__runCommand__(["scan",r!=null?r:0,"match",`b_${this.id}-*_settings`,"count",1e4]);r=~~p;for(a=0,d=s.length;a{var r,i,s,a,l,c;l=Date.now();s=this.instances;a=[];for(i in s){c=s[i];try{if(await c._store.__groupCheck__(l)){a.push(this.deleteKey(i))}else{a.push(void 0)}}catch(i){r=i;a.push(c.Events.trigger("error",r))}}return a}),this.timeout/2)).unref==="function"?r.unref():void 0}updateSettings(r={}){G.overwrite(r,this.defaults,this);G.overwrite(r,r,this.limiterOptions);if(r.timeout!=null){return this._startAutoCleanup()}}disconnect(r=true){var i;if(!this.sharedConnection){return(i=this.connection)!=null?i.disconnect(r):void 0}}}Group.prototype.defaults={timeout:1e3*60*5,connection:null,Promise:Promise,id:"group-key"};return Group}.call(r);var z=U;var V,W,Y;Y=i;W=c;V=function(){class Batcher{constructor(r={}){this.options=r;Y.load(this.options,this.defaults,this);this.Events=new W(this);this._arr=[];this._resetPromise();this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise(((r,i)=>this._resolve=r))}_flush(){clearTimeout(this._timeout);this._lastFlush=Date.now();this._resolve();this.Events.trigger("batch",this._arr);this._arr=[];return this._resetPromise()}add(r){var i;this._arr.push(r);i=this._promise;if(this._arr.length===this.maxSize){this._flush()}else if(this.maxTime!=null&&this._arr.length===1){this._timeout=setTimeout((()=>this._flush()),this.maxTime)}return i}}Batcher.prototype.defaults={maxTime:null,maxSize:null,Promise:Promise};return Batcher}.call(r);var J=V;var require$$4$1=()=>console.log("You must import the full version of Bottleneck in order to use this feature.");var $=getCjsExportFromNamespace(L);var X,K,Z,ee,te,re,ne,ie,se,ae,oe,le=[].splice;re=10;K=5;oe=i;ne=A;ee=I;te=R;ie=require$$4$1;Z=c;se=N;ae=D;X=function(){class Bottleneck{constructor(r={},...i){var s,a;this._addToQueue=this._addToQueue.bind(this);this._validateOptions(r,i);oe.load(r,this.instanceDefaults,this);this._queues=new ne(re);this._scheduled={};this._states=new se(["RECEIVED","QUEUED","RUNNING","EXECUTING"].concat(this.trackDoneStatus?["DONE"]:[]));this._limiter=null;this.Events=new Z(this);this._submitLock=new ae("submit",this.Promise);this._registerLock=new ae("register",this.Promise);a=oe.load(r,this.storeDefaults,{});this._store=function(){if(this.datastore==="redis"||this.datastore==="ioredis"||this.connection!=null){s=oe.load(r,this.redisStoreDefaults,{});return new ie(this,a,s)}else if(this.datastore==="local"){s=oe.load(r,this.localStoreDefaults,{});return new te(this,a,s)}else{throw new Bottleneck.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}}.call(this);this._queues.on("leftzero",(()=>{var r;return(r=this._store.heartbeat)!=null?typeof r.ref==="function"?r.ref():void 0:void 0}));this._queues.on("zero",(()=>{var r;return(r=this._store.heartbeat)!=null?typeof r.unref==="function"?r.unref():void 0:void 0}))}_validateOptions(r,i){if(!(r!=null&&typeof r==="object"&&i.length===0)){throw new Bottleneck.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.")}}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(r){return this._store.__publish__(r)}disconnect(r=true){return this._store.__disconnect__(r)}chain(r){this._limiter=r;return this}queued(r){return this._queues.queued(r)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(r){return this._states.jobStatus(r)}jobs(r){return this._states.statusJobs(r)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(r=1){return this._store.__check__(r)}_clearGlobalState(r){if(this._scheduled[r]!=null){clearTimeout(this._scheduled[r].expiration);delete this._scheduled[r];return true}else{return false}}async _free(r,i,s,a){var l,c;try{({running:c}=await this._store.__free__(r,s.weight));this.Events.trigger("debug",`Freed ${s.id}`,a);if(c===0&&this.empty()){return this.Events.trigger("idle")}}catch(r){l=r;return this.Events.trigger("error",l)}}_run(r,i,s){var a,l,c;i.doRun();a=this._clearGlobalState.bind(this,r);c=this._run.bind(this,r,i);l=this._free.bind(this,r,i);return this._scheduled[r]={timeout:setTimeout((()=>i.doExecute(this._limiter,a,c,l)),s),expiration:i.options.expiration!=null?setTimeout((function(){return i.doExpire(a,c,l)}),s+i.options.expiration):void 0,job:i}}_drainOne(r){return this._registerLock.schedule((()=>{var i,s,a,l,c;if(this.queued()===0){return this.Promise.resolve(null)}c=this._queues.getFirst();({options:l,args:i}=a=c.first());if(r!=null&&l.weight>r){return this.Promise.resolve(null)}this.Events.trigger("debug",`Draining ${l.id}`,{args:i,options:l});s=this._randomIndex();return this._store.__register__(s,l.weight,l.expiration).then((({success:r,wait:d,reservoir:p})=>{var u;this.Events.trigger("debug",`Drained ${l.id}`,{success:r,args:i,options:l});if(r){c.shift();u=this.empty();if(u){this.Events.trigger("empty")}if(p===0){this.Events.trigger("depleted",u)}this._run(s,a,d);return this.Promise.resolve(l.weight)}else{return this.Promise.resolve(null)}}))}))}_drainAll(r,i=0){return this._drainOne(r).then((s=>{var a;if(s!=null){a=r!=null?r-s:r;return this._drainAll(a,i+s)}else{return this.Promise.resolve(i)}})).catch((r=>this.Events.trigger("error",r)))}_dropAllQueued(r){return this._queues.shiftAll((function(i){return i.doDrop({message:r})}))}stop(r={}){var i,s;r=oe.load(r,this.stopDefaults);s=r=>{var i;i=()=>{var i;i=this._states.counts;return i[0]+i[1]+i[2]+i[3]===r};return new this.Promise(((r,s)=>{if(i()){return r()}else{return this.on("done",(()=>{if(i()){this.removeAllListeners("done");return r()}}))}}))};i=r.dropWaitingJobs?(this._run=function(i,s){return s.doDrop({message:r.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule((()=>this._submitLock.schedule((()=>{var i,a,l;a=this._scheduled;for(i in a){l=a[i];if(this.jobStatus(l.job.options.id)==="RUNNING"){clearTimeout(l.timeout);clearTimeout(l.expiration);l.job.doDrop({message:r.dropErrorMessage})}}this._dropAllQueued(r.dropErrorMessage);return s(0)}))))):this.schedule({priority:re-1,weight:0},(()=>s(1)));this._receive=function(i){return i._reject(new Bottleneck.prototype.BottleneckError(r.enqueueErrorMessage))};this.stop=()=>this.Promise.reject(new Bottleneck.prototype.BottleneckError("stop() has already been called"));return i}async _addToQueue(r){var i,s,a,l,c,d,p;({args:i,options:l}=r);try{({reachedHWM:c,blocked:s,strategy:p}=await this._store.__submit__(this.queued(),l.weight))}catch(s){a=s;this.Events.trigger("debug",`Could not queue ${l.id}`,{args:i,options:l,error:a});r.doDrop({error:a});return false}if(s){r.doDrop();return true}else if(c){d=p===Bottleneck.prototype.strategy.LEAK?this._queues.shiftLastFrom(l.priority):p===Bottleneck.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(l.priority+1):p===Bottleneck.prototype.strategy.OVERFLOW?r:void 0;if(d!=null){d.doDrop()}if(d==null||p===Bottleneck.prototype.strategy.OVERFLOW){if(d==null){r.doDrop()}return c}}r.doQueue(c,s);this._queues.push(r);await this._drainAll();return c}_receive(r){if(this._states.jobStatus(r.options.id)!=null){r._reject(new Bottleneck.prototype.BottleneckError(`A job with the same id already exists (id=${r.options.id})`));return false}else{r.doReceive();return this._submitLock.schedule(this._addToQueue,r)}}submit(...r){var i,s,a,l,c,d,p;if(typeof r[0]==="function"){c=r,[s,...r]=c,[i]=le.call(r,-1);l=oe.load({},this.jobDefaults)}else{d=r,[l,s,...r]=d,[i]=le.call(r,-1);l=oe.load(l,this.jobDefaults)}p=(...r)=>new this.Promise((function(i,a){return s(...r,(function(...r){return(r[0]!=null?a:i)(r)}))}));a=new ee(p,r,l,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise);a.promise.then((function(r){return typeof i==="function"?i(...r):void 0})).catch((function(r){if(Array.isArray(r)){return typeof i==="function"?i(...r):void 0}else{return typeof i==="function"?i(r):void 0}}));return this._receive(a)}schedule(...r){var i,s,a;if(typeof r[0]==="function"){[a,...r]=r;s={}}else{[s,a,...r]=r}i=new ee(a,r,s,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise);this._receive(i);return i.promise}wrap(r){var i,s;i=this.schedule.bind(this);s=function(...s){return i(r.bind(this),...s)};s.withOptions=function(s,...a){return i(s,r,...a)};return s}async updateSettings(r={}){await this._store.__updateSettings__(oe.overwrite(r,this.storeDefaults));oe.overwrite(r,this.instanceDefaults,this);return this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(r=0){return this._store.__incrementReservoir__(r)}}Bottleneck.default=Bottleneck;Bottleneck.Events=Z;Bottleneck.version=Bottleneck.prototype.version=$.version;Bottleneck.strategy=Bottleneck.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3};Bottleneck.BottleneckError=Bottleneck.prototype.BottleneckError=g;Bottleneck.Group=Bottleneck.prototype.Group=z;Bottleneck.RedisConnection=Bottleneck.prototype.RedisConnection=require$$2;Bottleneck.IORedisConnection=Bottleneck.prototype.IORedisConnection=require$$3;Bottleneck.Batcher=Bottleneck.prototype.Batcher=J;Bottleneck.prototype.jobDefaults={priority:K,weight:1,expiration:null,id:""};Bottleneck.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:Bottleneck.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null};Bottleneck.prototype.localStoreDefaults={Promise:Promise,timeout:null,heartbeatInterval:250};Bottleneck.prototype.redisStoreDefaults={Promise:Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:false,connection:null};Bottleneck.prototype.instanceDefaults={datastore:"local",connection:null,id:"",rejectOnDrop:true,trackDoneStatus:false,Promise:Promise};Bottleneck.prototype.stopDefaults={enqueueErrorMessage:"This limiter has been stopped and cannot accept new jobs.",dropWaitingJobs:true,dropErrorMessage:"This limiter has been stopped."};return Bottleneck}.call(r);var ce=X;var de=ce;return de}))},11469:(r,i,s)=>{var a=s(44350);r.exports=expandTop;var l="\0SLASH"+Math.random()+"\0";var c="\0OPEN"+Math.random()+"\0";var d="\0CLOSE"+Math.random()+"\0";var p="\0COMMA"+Math.random()+"\0";var u="\0PERIOD"+Math.random()+"\0";function numeric(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function escapeBraces(r){return r.split("\\\\").join(l).split("\\{").join(c).split("\\}").join(d).split("\\,").join(p).split("\\.").join(u)}function unescapeBraces(r){return r.split(l).join("\\").split(c).join("{").split(d).join("}").split(p).join(",").split(u).join(".")}function parseCommaParts(r){if(!r)return[""];var i=[];var s=a("{","}",r);if(!s)return r.split(",");var l=s.pre;var c=s.body;var d=s.post;var p=l.split(",");p[p.length-1]+="{"+c+"}";var u=parseCommaParts(d);if(d.length){p[p.length-1]+=u.shift();p.push.apply(p,u)}i.push.apply(i,p);return i}function expandTop(r){if(!r)return[];if(r.substr(0,2)==="{}"){r="\\{\\}"+r.substr(2)}return expand(escapeBraces(r),true).map(unescapeBraces)}function embrace(r){return"{"+r+"}"}function isPadded(r){return/^-?0\d/.test(r)}function lte(r,i){return r<=i}function gte(r,i){return r>=i}function expand(r,i){var s=[];var l=a("{","}",r);if(!l)return[r];var c=l.pre;var p=l.post.length?expand(l.post,false):[""];if(/\$$/.test(l.pre)){for(var u=0;u=0;if(!y&&!b){if(l.post.match(/,.*\}/)){r=l.pre+"{"+l.body+d+l.post;return expand(r)}return[r]}var w;if(y){w=l.body.split(/\.\./)}else{w=parseCommaParts(l.body);if(w.length===1){w=expand(w[0],false).map(embrace);if(w.length===1){return p.map((function(r){return l.pre+w[0]+r}))}}}var C;if(y){var v=numeric(w[0]);var I=numeric(w[1]);var B=Math.max(w[0].length,w[1].length);var S=w.length==3?Math.abs(numeric(w[2])):1;var x=lte;var R=I0){var k=new Array(T+1).join("0");if(_<0)N="-"+k+N.slice(1);else N=k+N}}}C.push(N)}}else{C=[];for(var D=0;D{r.exports=Buffers;function Buffers(r){if(!(this instanceof Buffers))return new Buffers(r);this.buffers=r||[];this.length=this.buffers.reduce((function(r,i){return r+i.length}),0)}Buffers.prototype.push=function(){for(var r=0;r=0?r:this.length-r;var l=[].slice.call(arguments,2);if(i===undefined){i=this.length-a}else if(i>this.length-a){i=this.length-a}for(var r=0;r0){var A=a-p;if(A+i0){var b=l.slice();b.unshift(g);b.push(y);s.splice.apply(s,[u,1].concat(b));u+=b.length;l=[]}else{s.splice(u,1,g,y);u+=2}}else{c.push(s[u].slice(A));s[u]=s[u].slice(0,A);u++}}if(l.length>0){s.splice.apply(s,[u,0].concat(l));u+=l.length}while(c.lengththis.length)i=this.length;var a=0;for(var l=0;l=i-r?Math.min(A+(i-r)-d,u):u;s[p].copy(c,d,A,h);d+=h-A}return c};Buffers.prototype.pos=function(r){if(r<0||r>=this.length)throw new Error("oob");var i=r,s=0,a=null;for(;;){a=this.buffers[s];if(i=this.buffers[s].length){a=0;s++;if(s>=this.buffers.length){return-1}}var u=this.buffers[s][a];if(u==r[l]){if(l==0){c={i:s,j:a,pos:d}}l++;if(l==r.length){return c.pos}}else if(l!=0){s=c.i;a=c.j;d=c.pos;l=0}a++;d++}};Buffers.prototype.toBuffer=function(){return this.slice()};Buffers.prototype.toString=function(r,i,s){return this.slice(i,s).toString(r)}},39416:(r,i,s)=>{var a=s(35363);var l=s(82361).EventEmitter;r.exports=Chainsaw;function Chainsaw(r){var i=Chainsaw.saw(r,{});var s=r.call(i.handlers,i);if(s!==undefined)i.handlers=s;i.record();return i.chain()}Chainsaw.light=function ChainsawLight(r){var i=Chainsaw.saw(r,{});var s=r.call(i.handlers,i);if(s!==undefined)i.handlers=s;return i.chain()};Chainsaw.saw=function(r,i){var s=new l;s.handlers=i;s.actions=[];s.chain=function(){var r=a(s.handlers).map((function(i){if(this.isRoot)return i;var a=this.path;if(typeof i==="function"){this.update((function(){s.actions.push({path:a,args:[].slice.call(arguments)});return r}))}}));process.nextTick((function(){s.emit("begin");s.next()}));return r};s.pop=function(){return s.actions.shift()};s.next=function(){var r=s.pop();if(!r){s.emit("end")}else if(!r.trap){var i=s.handlers;r.path.forEach((function(r){i=i[r]}));i.apply(s.handlers,r.args)}};s.nest=function(i){var a=[].slice.call(arguments,1);var l=true;if(typeof i==="boolean"){var l=i;i=a.shift()}var c=Chainsaw.saw(r,{});var d=r.call(c.handlers,c);if(d!==undefined)c.handlers=d;if("undefined"!==typeof s.step){c.record()}i.apply(c.chain(),a);if(l!==false)c.on("end",s.next)};s.record=function(){upgradeChainsaw(s)};["trap","down","jump"].forEach((function(r){s[r]=function(){throw new Error("To use the trap, down and jump features, please "+"call record() first to start recording actions.")}}));return s};function upgradeChainsaw(r){r.step=0;r.pop=function(){return r.actions[r.step++]};r.trap=function(i,s){var a=Array.isArray(i)?i:[i];r.actions.push({path:a,step:r.step,cb:s,trap:true})};r.down=function(i){var s=(Array.isArray(i)?i:[i]).join("/");var a=r.actions.slice(r.step).map((function(i){if(i.trap&&i.step<=r.step)return false;return i.path.join("/")==s})).indexOf(true);if(a>=0)r.step+=a;else r.step=r.actions.length;var l=r.actions[r.step-1];if(l&&l.trap){r.step=l.step;l.cb()}else r.next()};r.jump=function(i){r.step=i;r.next()}}},36835:(r,i,s)=>{var a=s(73837);var l=s(12781).Stream;var c=s(83908);r.exports=CombinedStream;function CombinedStream(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}a.inherits(CombinedStream,l);CombinedStream.create=function(r){var i=new this;r=r||{};for(var s in r){i[s]=r[s]}return i};CombinedStream.isStreamLike=function(r){return typeof r!=="function"&&typeof r!=="string"&&typeof r!=="boolean"&&typeof r!=="number"&&!Buffer.isBuffer(r)};CombinedStream.prototype.append=function(r){var i=CombinedStream.isStreamLike(r);if(i){if(!(r instanceof c)){var s=c.create(r,{maxDataSize:Infinity,pauseStream:this.pauseStreams});r.on("data",this._checkDataSize.bind(this));r=s}this._handleErrors(r);if(this.pauseStreams){r.pause()}}this._streams.push(r);return this};CombinedStream.prototype.pipe=function(r,i){l.prototype.pipe.call(this,r,i);this.resume();return r};CombinedStream.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};CombinedStream.prototype._realGetNext=function(){var r=this._streams.shift();if(typeof r=="undefined"){this.end();return}if(typeof r!=="function"){this._pipeNext(r);return}var i=r;i(function(r){var i=CombinedStream.isStreamLike(r);if(i){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};CombinedStream.prototype._pipeNext=function(r){this._currentStream=r;var i=CombinedStream.isStreamLike(r);if(i){r.on("end",this._getNext.bind(this));r.pipe(this,{end:false});return}var s=r;this.write(s);this._getNext()};CombinedStream.prototype._handleErrors=function(r){var i=this;r.on("error",(function(r){i._emitError(r)}))};CombinedStream.prototype.write=function(r){this.emit("data",r)};CombinedStream.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};CombinedStream.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};CombinedStream.prototype.end=function(){this._reset();this.emit("end")};CombinedStream.prototype.destroy=function(){this._reset();this.emit("close")};CombinedStream.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};CombinedStream.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var r="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(r))};CombinedStream.prototype._updateDataSize=function(){this.dataSize=0;var r=this;this._streams.forEach((function(i){if(!i.dataSize){return}r.dataSize+=i.dataSize}));if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};CombinedStream.prototype._emitError=function(r){this._reset();this.emit("error",r)}},96514:r=>{var i=r.exports=function(){};i.prototype.getName=function(){};i.prototype.getSize=function(){};i.prototype.getLastModifiedDate=function(){};i.prototype.isDirectory=function(){}},11070:(r,i,s)=>{var a=s(73837).inherits;var l=s(44101);var c=s(78084).Transform;var d=s(96514);var p=s(92468);var u=r.exports=function(r){if(!(this instanceof u)){return new u(r)}c.call(this,r);this.offset=0;this._archive={finish:false,finished:false,processing:false}};a(u,c);u.prototype._appendBuffer=function(r,i,s){};u.prototype._appendStream=function(r,i,s){};u.prototype._emitErrorCallback=function(r){if(r){this.emit("error",r)}};u.prototype._finish=function(r){};u.prototype._normalizeEntry=function(r){};u.prototype._transform=function(r,i,s){s(null,r)};u.prototype.entry=function(r,i,s){i=i||null;if(typeof s!=="function"){s=this._emitErrorCallback.bind(this)}if(!(r instanceof d)){s(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){s(new Error("unacceptable entry after finish"));return}if(this._archive.processing){s(new Error("already processing an entry"));return}this._archive.processing=true;this._normalizeEntry(r);this._entry=r;i=p.normalizeInputSource(i);if(Buffer.isBuffer(i)){this._appendBuffer(r,i,s)}else if(l(i)){this._appendStream(r,i,s)}else{this._archive.processing=false;s(new Error("input source must be valid Stream or Buffer instance"));return}return this};u.prototype.finish=function(){if(this._archive.processing){this._archive.finish=true;return}this._finish()};u.prototype.getBytesWritten=function(){return this.offset};u.prototype.write=function(r,i){if(r){this.offset+=r.length}return c.prototype.write.call(this,r,i)}},25984:r=>{r.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}},55865:(r,i,s)=>{var a=s(13593);var l=1<<3;var c=1<<0;var d=1<<2;var p=1<<1;var u=1<<6;var A=1<<11;var h=r.exports=function(){if(!(this instanceof h)){return new h}this.descriptor=false;this.encryption=false;this.utf8=false;this.numberOfShannonFanoTrees=0;this.strongEncryption=false;this.slidingDictionarySize=0;return this};h.prototype.encode=function(){return a.getShortBytes((this.descriptor?l:0)|(this.utf8?A:0)|(this.encryption?c:0)|(this.strongEncryption?u:0))};h.prototype.parse=function(r,i){var s=a.getShortBytesValue(r,i);var g=new h;g.useDataDescriptor((s&l)!==0);g.useUTF8ForNames((s&A)!==0);g.useStrongEncryption((s&u)!==0);g.useEncryption((s&c)!==0);g.setSlidingDictionarySize((s&p)!==0?8192:4096);g.setNumberOfShannonFanoTrees((s&d)!==0?3:2);return g};h.prototype.setNumberOfShannonFanoTrees=function(r){this.numberOfShannonFanoTrees=r};h.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};h.prototype.setSlidingDictionarySize=function(r){this.slidingDictionarySize=r};h.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};h.prototype.useDataDescriptor=function(r){this.descriptor=r};h.prototype.usesDataDescriptor=function(){return this.descriptor};h.prototype.useEncryption=function(r){this.encryption=r};h.prototype.usesEncryption=function(){return this.encryption};h.prototype.useStrongEncryption=function(r){this.strongEncryption=r};h.prototype.usesStrongEncryption=function(){return this.strongEncryption};h.prototype.useUTF8ForNames=function(r){this.utf8=r};h.prototype.usesUTF8ForNames=function(){return this.utf8}},30792:r=>{r.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}},13593:r=>{var i=r.exports={};i.dateToDos=function(r,i){i=i||false;var s=i?r.getFullYear():r.getUTCFullYear();if(s<1980){return 2162688}else if(s>=2044){return 2141175677}var a={year:s,month:i?r.getMonth():r.getUTCMonth(),date:i?r.getDate():r.getUTCDate(),hours:i?r.getHours():r.getUTCHours(),minutes:i?r.getMinutes():r.getUTCMinutes(),seconds:i?r.getSeconds():r.getUTCSeconds()};return a.year-1980<<25|a.month+1<<21|a.date<<16|a.hours<<11|a.minutes<<5|a.seconds/2};i.dosToDate=function(r){return new Date((r>>25&127)+1980,(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(r&31)<<1)};i.fromDosTime=function(r){return i.dosToDate(r.readUInt32LE(0))};i.getEightBytes=function(r){var i=Buffer.alloc(8);i.writeUInt32LE(r%4294967296,0);i.writeUInt32LE(r/4294967296|0,4);return i};i.getShortBytes=function(r){var i=Buffer.alloc(2);i.writeUInt16LE((r&65535)>>>0,0);return i};i.getShortBytesValue=function(r,i){return r.readUInt16LE(i)};i.getLongBytes=function(r){var i=Buffer.alloc(4);i.writeUInt32LE((r&4294967295)>>>0,0);return i};i.getLongBytesValue=function(r,i){return r.readUInt32LE(i)};i.toDosTime=function(r){return i.getLongBytes(i.dateToDos(r))}},32036:(r,i,s)=>{var a=s(73837).inherits;var l=s(43766);var c=s(96514);var d=s(55865);var p=s(30792);var u=s(25984);var A=s(13593);var h=r.exports=function(r){if(!(this instanceof h)){return new h(r)}c.call(this);this.platform=u.PLATFORM_FAT;this.method=-1;this.name=null;this.size=0;this.csize=0;this.gpb=new d;this.crc=0;this.time=-1;this.minver=u.MIN_VERSION_INITIAL;this.mode=-1;this.extra=null;this.exattr=0;this.inattr=0;this.comment=null;if(r){this.setName(r)}};a(h,c);h.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};h.prototype.getComment=function(){return this.comment!==null?this.comment:""};h.prototype.getCompressedSize=function(){return this.csize};h.prototype.getCrc=function(){return this.crc};h.prototype.getExternalAttributes=function(){return this.exattr};h.prototype.getExtra=function(){return this.extra!==null?this.extra:u.EMPTY};h.prototype.getGeneralPurposeBit=function(){return this.gpb};h.prototype.getInternalAttributes=function(){return this.inattr};h.prototype.getLastModifiedDate=function(){return this.getTime()};h.prototype.getLocalFileDataExtra=function(){return this.getExtra()};h.prototype.getMethod=function(){return this.method};h.prototype.getName=function(){return this.name};h.prototype.getPlatform=function(){return this.platform};h.prototype.getSize=function(){return this.size};h.prototype.getTime=function(){return this.time!==-1?A.dosToDate(this.time):-1};h.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};h.prototype.getUnixMode=function(){return this.platform!==u.PLATFORM_UNIX?0:this.getExternalAttributes()>>u.SHORT_SHIFT&u.SHORT_MASK};h.prototype.getVersionNeededToExtract=function(){return this.minver};h.prototype.setComment=function(r){if(Buffer.byteLength(r)!==r.length){this.getGeneralPurposeBit().useUTF8ForNames(true)}this.comment=r};h.prototype.setCompressedSize=function(r){if(r<0){throw new Error("invalid entry compressed size")}this.csize=r};h.prototype.setCrc=function(r){if(r<0){throw new Error("invalid entry crc32")}this.crc=r};h.prototype.setExternalAttributes=function(r){this.exattr=r>>>0};h.prototype.setExtra=function(r){this.extra=r};h.prototype.setGeneralPurposeBit=function(r){if(!(r instanceof d)){throw new Error("invalid entry GeneralPurposeBit")}this.gpb=r};h.prototype.setInternalAttributes=function(r){this.inattr=r};h.prototype.setMethod=function(r){if(r<0){throw new Error("invalid entry compression method")}this.method=r};h.prototype.setName=function(r,i=false){r=l(r,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"");if(i){r=`/${r}`}if(Buffer.byteLength(r)!==r.length){this.getGeneralPurposeBit().useUTF8ForNames(true)}this.name=r};h.prototype.setPlatform=function(r){this.platform=r};h.prototype.setSize=function(r){if(r<0){throw new Error("invalid entry size")}this.size=r};h.prototype.setTime=function(r,i){if(!(r instanceof Date)){throw new Error("invalid entry time")}this.time=A.dateToDos(r,i)};h.prototype.setUnixMode=function(r){r|=this.isDirectory()?u.S_IFDIR:u.S_IFREG;var i=0;i|=r<u.ZIP64_MAGIC||this.size>u.ZIP64_MAGIC}},46094:(r,i,s)=>{var a=s(73837).inherits;var l=s(61813);var{CRC32Stream:c}=s(25547);var{DeflateCRC32Stream:d}=s(25547);var p=s(11070);var u=s(32036);var A=s(55865);var h=s(25984);var g=s(92468);var y=s(13593);var b=r.exports=function(r){if(!(this instanceof b)){return new b(r)}r=this.options=this._defaults(r);p.call(this,r);this._entry=null;this._entries=[];this._archive={centralLength:0,centralOffset:0,comment:"",finish:false,finished:false,processing:false,forceZip64:r.forceZip64,forceLocalTime:r.forceLocalTime}};a(b,p);b.prototype._afterAppend=function(r){this._entries.push(r);if(r.getGeneralPurposeBit().usesDataDescriptor()){this._writeDataDescriptor(r)}this._archive.processing=false;this._entry=null;if(this._archive.finish&&!this._archive.finished){this._finish()}};b.prototype._appendBuffer=function(r,i,s){if(i.length===0){r.setMethod(h.METHOD_STORED)}var a=r.getMethod();if(a===h.METHOD_STORED){r.setSize(i.length);r.setCompressedSize(i.length);r.setCrc(l.buf(i)>>>0)}this._writeLocalFileHeader(r);if(a===h.METHOD_STORED){this.write(i);this._afterAppend(r);s(null,r);return}else if(a===h.METHOD_DEFLATED){this._smartStream(r,s).end(i);return}else{s(new Error("compression method "+a+" not implemented"));return}};b.prototype._appendStream=function(r,i,s){r.getGeneralPurposeBit().useDataDescriptor(true);r.setVersionNeededToExtract(h.MIN_VERSION_DATA_DESCRIPTOR);this._writeLocalFileHeader(r);var a=this._smartStream(r,s);i.once("error",(function(r){a.emit("error",r);a.end()}));i.pipe(a)};b.prototype._defaults=function(r){if(typeof r!=="object"){r={}}if(typeof r.zlib!=="object"){r.zlib={}}if(typeof r.zlib.level!=="number"){r.zlib.level=h.ZLIB_BEST_SPEED}r.forceZip64=!!r.forceZip64;r.forceLocalTime=!!r.forceLocalTime;return r};b.prototype._finish=function(){this._archive.centralOffset=this.offset;this._entries.forEach(function(r){this._writeCentralFileHeader(r)}.bind(this));this._archive.centralLength=this.offset-this._archive.centralOffset;if(this.isZip64()){this._writeCentralDirectoryZip64()}this._writeCentralDirectoryEnd();this._archive.processing=false;this._archive.finish=true;this._archive.finished=true;this.end()};b.prototype._normalizeEntry=function(r){if(r.getMethod()===-1){r.setMethod(h.METHOD_DEFLATED)}if(r.getMethod()===h.METHOD_DEFLATED){r.getGeneralPurposeBit().useDataDescriptor(true);r.setVersionNeededToExtract(h.MIN_VERSION_DATA_DESCRIPTOR)}if(r.getTime()===-1){r.setTime(new Date,this._archive.forceLocalTime)}r._offsets={file:0,data:0,contents:0}};b.prototype._smartStream=function(r,i){var s=r.getMethod()===h.METHOD_DEFLATED;var a=s?new d(this.options.zlib):new c;var l=null;function handleStuff(){var s=a.digest().readUInt32BE(0);r.setCrc(s);r.setSize(a.size());r.setCompressedSize(a.size(true));this._afterAppend(r);i(l,r)}a.once("end",handleStuff.bind(this));a.once("error",(function(r){l=r}));a.pipe(this,{end:false});return a};b.prototype._writeCentralDirectoryEnd=function(){var r=this._entries.length;var i=this._archive.centralLength;var s=this._archive.centralOffset;if(this.isZip64()){r=h.ZIP64_MAGIC_SHORT;i=h.ZIP64_MAGIC;s=h.ZIP64_MAGIC}this.write(y.getLongBytes(h.SIG_EOCD));this.write(h.SHORT_ZERO);this.write(h.SHORT_ZERO);this.write(y.getShortBytes(r));this.write(y.getShortBytes(r));this.write(y.getLongBytes(i));this.write(y.getLongBytes(s));var a=this.getComment();var l=Buffer.byteLength(a);this.write(y.getShortBytes(l));this.write(a)};b.prototype._writeCentralDirectoryZip64=function(){this.write(y.getLongBytes(h.SIG_ZIP64_EOCD));this.write(y.getEightBytes(44));this.write(y.getShortBytes(h.MIN_VERSION_ZIP64));this.write(y.getShortBytes(h.MIN_VERSION_ZIP64));this.write(h.LONG_ZERO);this.write(h.LONG_ZERO);this.write(y.getEightBytes(this._entries.length));this.write(y.getEightBytes(this._entries.length));this.write(y.getEightBytes(this._archive.centralLength));this.write(y.getEightBytes(this._archive.centralOffset));this.write(y.getLongBytes(h.SIG_ZIP64_EOCD_LOC));this.write(h.LONG_ZERO);this.write(y.getEightBytes(this._archive.centralOffset+this._archive.centralLength));this.write(y.getLongBytes(1))};b.prototype._writeCentralFileHeader=function(r){var i=r.getGeneralPurposeBit();var s=r.getMethod();var a=r._offsets.file;var l=r.getSize();var c=r.getCompressedSize();if(r.isZip64()||a>h.ZIP64_MAGIC){l=h.ZIP64_MAGIC;c=h.ZIP64_MAGIC;a=h.ZIP64_MAGIC;r.setVersionNeededToExtract(h.MIN_VERSION_ZIP64);var d=Buffer.concat([y.getShortBytes(h.ZIP64_EXTRA_ID),y.getShortBytes(24),y.getEightBytes(r.getSize()),y.getEightBytes(r.getCompressedSize()),y.getEightBytes(r._offsets.file)],28);r.setExtra(d)}this.write(y.getLongBytes(h.SIG_CFH));this.write(y.getShortBytes(r.getPlatform()<<8|h.VERSION_MADEBY));this.write(y.getShortBytes(r.getVersionNeededToExtract()));this.write(i.encode());this.write(y.getShortBytes(s));this.write(y.getLongBytes(r.getTimeDos()));this.write(y.getLongBytes(r.getCrc()));this.write(y.getLongBytes(c));this.write(y.getLongBytes(l));var p=r.getName();var u=r.getComment();var A=r.getCentralDirectoryExtra();if(i.usesUTF8ForNames()){p=Buffer.from(p);u=Buffer.from(u)}this.write(y.getShortBytes(p.length));this.write(y.getShortBytes(A.length));this.write(y.getShortBytes(u.length));this.write(h.SHORT_ZERO);this.write(y.getShortBytes(r.getInternalAttributes()));this.write(y.getLongBytes(r.getExternalAttributes()));this.write(y.getLongBytes(a));this.write(p);this.write(A);this.write(u)};b.prototype._writeDataDescriptor=function(r){this.write(y.getLongBytes(h.SIG_DD));this.write(y.getLongBytes(r.getCrc()));if(r.isZip64()){this.write(y.getEightBytes(r.getCompressedSize()));this.write(y.getEightBytes(r.getSize()))}else{this.write(y.getLongBytes(r.getCompressedSize()));this.write(y.getLongBytes(r.getSize()))}};b.prototype._writeLocalFileHeader=function(r){var i=r.getGeneralPurposeBit();var s=r.getMethod();var a=r.getName();var l=r.getLocalFileDataExtra();if(r.isZip64()){i.useDataDescriptor(true);r.setVersionNeededToExtract(h.MIN_VERSION_ZIP64)}if(i.usesUTF8ForNames()){a=Buffer.from(a)}r._offsets.file=this.offset;this.write(y.getLongBytes(h.SIG_LFH));this.write(y.getShortBytes(r.getVersionNeededToExtract()));this.write(i.encode());this.write(y.getShortBytes(s));this.write(y.getLongBytes(r.getTimeDos()));r._offsets.data=this.offset;if(i.usesDataDescriptor()){this.write(h.LONG_ZERO);this.write(h.LONG_ZERO);this.write(h.LONG_ZERO)}else{this.write(y.getLongBytes(r.getCrc()));this.write(y.getLongBytes(r.getCompressedSize()));this.write(y.getLongBytes(r.getSize()))}this.write(y.getShortBytes(a.length));this.write(y.getShortBytes(l.length));this.write(a);this.write(l);r._offsets.contents=this.offset};b.prototype.getComment=function(r){return this._archive.comment!==null?this._archive.comment:""};b.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>h.ZIP64_MAGIC_SHORT||this._archive.centralLength>h.ZIP64_MAGIC||this._archive.centralOffset>h.ZIP64_MAGIC};b.prototype.setComment=function(r){this._archive.comment=r}},91374:(r,i,s)=>{r.exports={ArchiveEntry:s(96514),ZipArchiveEntry:s(32036),ArchiveOutputStream:s(11070),ZipArchiveOutputStream:s(46094)}},92468:(r,i,s)=>{var a=s(12781).Stream;var l=s(78084).PassThrough;var c=s(44101);var d=r.exports={};d.normalizeInputSource=function(r){if(r===null){return Buffer.alloc(0)}else if(typeof r==="string"){return Buffer.from(r)}else if(c(r)&&!r._readableState){var i=new l;r.pipe(i);return i}return r}},48624:(r,i,s)=>{"use strict";const{SymbolDispose:a}=s(91495);const{AbortError:l,codes:c}=s(53862);const{isNodeStream:d,isWebStream:p,kControllerErrorFunction:u}=s(48229);const A=s(1475);const{ERR_INVALID_ARG_TYPE:h}=c;let g;const validateAbortSignal=(r,i)=>{if(typeof r!=="object"||!("aborted"in r)){throw new h(i,"AbortSignal",r)}};r.exports.addAbortSignal=function addAbortSignal(i,s){validateAbortSignal(i,"signal");if(!d(s)&&!p(s)){throw new h("stream",["ReadableStream","WritableStream","Stream"],s)}return r.exports.addAbortSignalNoValidate(i,s)};r.exports.addAbortSignalNoValidate=function(r,i){if(typeof r!=="object"||!("aborted"in r)){return i}const c=d(i)?()=>{i.destroy(new l(undefined,{cause:r.reason}))}:()=>{i[u](new l(undefined,{cause:r.reason}))};if(r.aborted){c()}else{g=g||s(63030).addAbortListener;const l=g(r,c);A(i,l[a])}return i}},67939:(r,i,s)=>{"use strict";const{StringPrototypeSlice:a,SymbolIterator:l,TypedArrayPrototypeSet:c,Uint8Array:d}=s(91495);const{Buffer:p}=s(14300);const{inspect:u}=s(63030);r.exports=class BufferList{constructor(){this.head=null;this.tail=null;this.length=0}push(r){const i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length}unshift(r){const i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length}shift(){if(this.length===0)return;const r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r}clear(){this.head=this.tail=null;this.length=0}join(r){if(this.length===0)return"";let i=this.head;let s=""+i.data;while((i=i.next)!==null)s+=r+i.data;return s}concat(r){if(this.length===0)return p.alloc(0);const i=p.allocUnsafe(r>>>0);let s=this.head;let a=0;while(s){c(i,s.data,a);a+=s.data.length;s=s.next}return i}consume(r,i){const s=this.head.data;if(rc.length){i+=c;r-=c.length}else{if(r===c.length){i+=c;++l;if(s.next)this.head=s.next;else this.head=this.tail=null}else{i+=a(c,0,r);this.head=s;s.data=a(c,r)}break}++l}while((s=s.next)!==null);this.length-=l;return i}_getBuffer(r){const i=p.allocUnsafe(r);const s=r;let a=this.head;let l=0;do{const p=a.data;if(r>p.length){c(i,p,s-r);r-=p.length}else{if(r===p.length){c(i,p,s-r);++l;if(a.next)this.head=a.next;else this.head=this.tail=null}else{c(i,new d(p.buffer,p.byteOffset,r),s-r);this.head=a;a.data=p.slice(r)}break}++l}while((a=a.next)!==null);this.length-=l;return i}[Symbol.for("nodejs.util.inspect.custom")](r,i){return u(this,{...i,depth:0,customInspect:false})}}},82648:(r,i,s)=>{"use strict";const{pipeline:a}=s(64073);const l=s(99215);const{destroyer:c}=s(28050);const{isNodeStream:d,isReadable:p,isWritable:u,isWebStream:A,isTransformStream:h,isWritableStream:g,isReadableStream:y}=s(48229);const{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:w,ERR_MISSING_ARGS:C}}=s(53862);const v=s(1475);r.exports=function compose(...r){if(r.length===0){throw new C("streams")}if(r.length===1){return l.from(r[0])}const i=[...r];if(typeof r[0]==="function"){r[0]=l.from(r[0])}if(typeof r[r.length-1]==="function"){const i=r.length-1;r[i]=l.from(r[i])}for(let s=0;s0&&!(u(r[s])||g(r[s])||h(r[s]))){throw new w(`streams[${s}]`,i[s],"must be writable")}}let s;let I;let B;let S;let x;function onfinished(r){const i=S;S=null;if(i){i(r)}else if(r){x.destroy(r)}else if(!N&&!_){x.destroy()}}const R=r[0];const Q=a(r,onfinished);const _=!!(u(R)||g(R)||h(R));const N=!!(p(Q)||y(Q)||h(Q));x=new l({writableObjectMode:!!(R!==null&&R!==undefined&&R.writableObjectMode),readableObjectMode:!!(Q!==null&&Q!==undefined&&Q.readableObjectMode),writable:_,readable:N});if(_){if(d(R)){x._write=function(r,i,a){if(R.write(r,i)){a()}else{s=a}};x._final=function(r){R.end();I=r};R.on("drain",(function(){if(s){const r=s;s=null;r()}}))}else if(A(R)){const r=h(R)?R.writable:R;const i=r.getWriter();x._write=async function(r,s,a){try{await i.ready;i.write(r).catch((()=>{}));a()}catch(r){a(r)}};x._final=async function(r){try{await i.ready;i.close().catch((()=>{}));I=r}catch(i){r(i)}}}const r=h(Q)?Q.readable:Q;v(r,(()=>{if(I){const r=I;I=null;r()}}))}if(N){if(d(Q)){Q.on("readable",(function(){if(B){const r=B;B=null;r()}}));Q.on("end",(function(){x.push(null)}));x._read=function(){while(true){const r=Q.read();if(r===null){B=x._read;return}if(!x.push(r)){return}}}}else if(A(Q)){const r=h(Q)?Q.readable:Q;const i=r.getReader();x._read=async function(){while(true){try{const{value:r,done:s}=await i.read();if(!x.push(r)){return}if(s){x.push(null);return}}catch{return}}}}}x._destroy=function(r,i){if(!r&&S!==null){r=new b}B=null;s=null;I=null;if(S===null){i(r)}else{S=i;if(d(Q)){c(Q,r)}}};return x}},28050:(r,i,s)=>{"use strict";const a=s(53568);const{aggregateTwoErrors:l,codes:{ERR_MULTIPLE_CALLBACK:c},AbortError:d}=s(53862);const{Symbol:p}=s(91495);const{kIsDestroyed:u,isDestroyed:A,isFinished:h,isServerRequest:g}=s(48229);const y=p("kDestroy");const b=p("kConstruct");function checkError(r,i,s){if(r){r.stack;if(i&&!i.errored){i.errored=r}if(s&&!s.errored){s.errored=r}}}function destroy(r,i){const s=this._readableState;const a=this._writableState;const c=a||s;if(a!==null&&a!==undefined&&a.destroyed||s!==null&&s!==undefined&&s.destroyed){if(typeof i==="function"){i()}return this}checkError(r,a,s);if(a){a.destroyed=true}if(s){s.destroyed=true}if(!c.constructed){this.once(y,(function(s){_destroy(this,l(s,r),i)}))}else{_destroy(this,r,i)}return this}function _destroy(r,i,s){let l=false;function onDestroy(i){if(l){return}l=true;const c=r._readableState;const d=r._writableState;checkError(i,d,c);if(d){d.closed=true}if(c){c.closed=true}if(typeof s==="function"){s(i)}if(i){a.nextTick(emitErrorCloseNT,r,i)}else{a.nextTick(emitCloseNT,r)}}try{r._destroy(i||null,onDestroy)}catch(i){onDestroy(i)}}function emitErrorCloseNT(r,i){emitErrorNT(r,i);emitCloseNT(r)}function emitCloseNT(r){const i=r._readableState;const s=r._writableState;if(s){s.closeEmitted=true}if(i){i.closeEmitted=true}if(s!==null&&s!==undefined&&s.emitClose||i!==null&&i!==undefined&&i.emitClose){r.emit("close")}}function emitErrorNT(r,i){const s=r._readableState;const a=r._writableState;if(a!==null&&a!==undefined&&a.errorEmitted||s!==null&&s!==undefined&&s.errorEmitted){return}if(a){a.errorEmitted=true}if(s){s.errorEmitted=true}r.emit("error",i)}function undestroy(){const r=this._readableState;const i=this._writableState;if(r){r.constructed=true;r.closed=false;r.closeEmitted=false;r.destroyed=false;r.errored=null;r.errorEmitted=false;r.reading=false;r.ended=r.readable===false;r.endEmitted=r.readable===false}if(i){i.constructed=true;i.destroyed=false;i.closed=false;i.closeEmitted=false;i.errored=null;i.errorEmitted=false;i.finalCalled=false;i.prefinished=false;i.ended=i.writable===false;i.ending=i.writable===false;i.finished=i.writable===false}}function errorOrDestroy(r,i,s){const l=r._readableState;const c=r._writableState;if(c!==null&&c!==undefined&&c.destroyed||l!==null&&l!==undefined&&l.destroyed){return this}if(l!==null&&l!==undefined&&l.autoDestroy||c!==null&&c!==undefined&&c.autoDestroy)r.destroy(i);else if(i){i.stack;if(c&&!c.errored){c.errored=i}if(l&&!l.errored){l.errored=i}if(s){a.nextTick(emitErrorNT,r,i)}else{emitErrorNT(r,i)}}}function construct(r,i){if(typeof r._construct!=="function"){return}const s=r._readableState;const l=r._writableState;if(s){s.constructed=false}if(l){l.constructed=false}r.once(b,i);if(r.listenerCount(b)>1){return}a.nextTick(constructNT,r)}function constructNT(r){let i=false;function onConstruct(s){if(i){errorOrDestroy(r,s!==null&&s!==undefined?s:new c);return}i=true;const l=r._readableState;const d=r._writableState;const p=d||l;if(l){l.constructed=true}if(d){d.constructed=true}if(p.destroyed){r.emit(y,s)}else if(s){errorOrDestroy(r,s,true)}else{a.nextTick(emitConstructNT,r)}}try{r._construct((r=>{a.nextTick(onConstruct,r)}))}catch(r){a.nextTick(onConstruct,r)}}function emitConstructNT(r){r.emit(b)}function isRequest(r){return(r===null||r===undefined?undefined:r.setHeader)&&typeof r.abort==="function"}function emitCloseLegacy(r){r.emit("close")}function emitErrorCloseLegacy(r,i){r.emit("error",i);a.nextTick(emitCloseLegacy,r)}function destroyer(r,i){if(!r||A(r)){return}if(!i&&!h(r)){i=new d}if(g(r)){r.socket=null;r.destroy(i)}else if(isRequest(r)){r.abort()}else if(isRequest(r.req)){r.req.abort()}else if(typeof r.destroy==="function"){r.destroy(i)}else if(typeof r.close==="function"){r.close()}else if(i){a.nextTick(emitErrorCloseLegacy,r,i)}else{a.nextTick(emitCloseLegacy,r)}if(!r.destroyed){r[u]=true}}r.exports={construct:construct,destroyer:destroyer,destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},99215:(r,i,s)=>{"use strict";const{ObjectDefineProperties:a,ObjectGetOwnPropertyDescriptor:l,ObjectKeys:c,ObjectSetPrototypeOf:d}=s(91495);r.exports=Duplex;const p=s(40952);const u=s(70274);d(Duplex.prototype,p.prototype);d(Duplex,p);{const r=c(u.prototype);for(let i=0;i{const a=s(53568);"use strict";const l=s(14300);const{isReadable:c,isWritable:d,isIterable:p,isNodeStream:u,isReadableNodeStream:A,isWritableNodeStream:h,isDuplexNodeStream:g,isReadableStream:y,isWritableStream:b}=s(48229);const w=s(1475);const{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:I}}=s(53862);const{destroyer:B}=s(28050);const S=s(99215);const x=s(40952);const R=s(70274);const{createDeferredPromise:Q}=s(63030);const _=s(30835);const N=globalThis.Blob||l.Blob;const T=typeof N!=="undefined"?function isBlob(r){return r instanceof N}:function isBlob(r){return false};const k=globalThis.AbortController||s(24995).AbortController;const{FunctionPrototypeCall:D}=s(91495);class Duplexify extends S{constructor(r){super(r);if((r===null||r===undefined?undefined:r.readable)===false){this._readableState.readable=false;this._readableState.ended=true;this._readableState.endEmitted=true}if((r===null||r===undefined?undefined:r.writable)===false){this._writableState.writable=false;this._writableState.ending=true;this._writableState.ended=true;this._writableState.finished=true}}}r.exports=function duplexify(r,i){if(g(r)){return r}if(A(r)){return _duplexify({readable:r})}if(h(r)){return _duplexify({writable:r})}if(u(r)){return _duplexify({writable:false,readable:false})}if(y(r)){return _duplexify({readable:x.fromWeb(r)})}if(b(r)){return _duplexify({writable:R.fromWeb(r)})}if(typeof r==="function"){const{value:s,write:l,final:c,destroy:d}=fromAsyncGen(r);if(p(s)){return _(Duplexify,s,{objectMode:true,write:l,final:c,destroy:d})}const u=s===null||s===undefined?undefined:s.then;if(typeof u==="function"){let r;const i=D(u,s,(r=>{if(r!=null){throw new I("nully","body",r)}}),(i=>{B(r,i)}));return r=new Duplexify({objectMode:true,readable:false,write:l,final(r){c((async()=>{try{await i;a.nextTick(r,null)}catch(i){a.nextTick(r,i)}}))},destroy:d})}throw new I("Iterable, AsyncIterable or AsyncFunction",i,s)}if(T(r)){return duplexify(r.arrayBuffer())}if(p(r)){return _(Duplexify,r,{objectMode:true,writable:false})}if(y(r===null||r===undefined?undefined:r.readable)&&b(r===null||r===undefined?undefined:r.writable)){return Duplexify.fromWeb(r)}if(typeof(r===null||r===undefined?undefined:r.writable)==="object"||typeof(r===null||r===undefined?undefined:r.readable)==="object"){const i=r!==null&&r!==undefined&&r.readable?A(r===null||r===undefined?undefined:r.readable)?r===null||r===undefined?undefined:r.readable:duplexify(r.readable):undefined;const s=r!==null&&r!==undefined&&r.writable?h(r===null||r===undefined?undefined:r.writable)?r===null||r===undefined?undefined:r.writable:duplexify(r.writable):undefined;return _duplexify({readable:i,writable:s})}const s=r===null||r===undefined?undefined:r.then;if(typeof s==="function"){let i;D(s,r,(r=>{if(r!=null){i.push(r)}i.push(null)}),(r=>{B(i,r)}));return i=new Duplexify({objectMode:true,writable:false,read(){}})}throw new v(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],r)};function fromAsyncGen(r){let{promise:i,resolve:s}=Q();const l=new k;const c=l.signal;const d=r(async function*(){while(true){const r=i;i=null;const{chunk:l,done:d,cb:p}=await r;a.nextTick(p);if(d)return;if(c.aborted)throw new C(undefined,{cause:c.reason});({promise:i,resolve:s}=Q());yield l}}(),{signal:c});return{value:d,write(r,i,a){const l=s;s=null;l({chunk:r,done:false,cb:a})},final(r){const i=s;s=null;i({done:true,cb:r})},destroy(r,i){l.abort();i(r)}}}function _duplexify(r){const i=r.readable&&typeof r.readable.read!=="function"?x.wrap(r.readable):r.readable;const s=r.writable;let a=!!c(i);let l=!!d(s);let p;let u;let A;let h;let g;function onfinished(r){const i=h;h=null;if(i){i(r)}else if(r){g.destroy(r)}}g=new Duplexify({readableObjectMode:!!(i!==null&&i!==undefined&&i.readableObjectMode),writableObjectMode:!!(s!==null&&s!==undefined&&s.writableObjectMode),readable:a,writable:l});if(l){w(s,(r=>{l=false;if(r){B(i,r)}onfinished(r)}));g._write=function(r,i,a){if(s.write(r,i)){a()}else{p=a}};g._final=function(r){s.end();u=r};s.on("drain",(function(){if(p){const r=p;p=null;r()}}));s.on("finish",(function(){if(u){const r=u;u=null;r()}}))}if(a){w(i,(r=>{a=false;if(r){B(i,r)}onfinished(r)}));i.on("readable",(function(){if(A){const r=A;A=null;r()}}));i.on("end",(function(){g.push(null)}));g._read=function(){while(true){const r=i.read();if(r===null){A=g._read;return}if(!g.push(r)){return}}}}g._destroy=function(r,a){if(!r&&h!==null){r=new C}A=null;p=null;u=null;if(h===null){a(r)}else{h=a;B(s,r);B(i,r)}};return g}},1475:(r,i,s)=>{const a=s(53568);"use strict";const{AbortError:l,codes:c}=s(53862);const{ERR_INVALID_ARG_TYPE:d,ERR_STREAM_PREMATURE_CLOSE:p}=c;const{kEmptyObject:u,once:A}=s(63030);const{validateAbortSignal:h,validateFunction:g,validateObject:y,validateBoolean:b}=s(19726);const{Promise:w,PromisePrototypeThen:C,SymbolDispose:v}=s(91495);const{isClosed:I,isReadable:B,isReadableNodeStream:S,isReadableStream:x,isReadableFinished:R,isReadableErrored:Q,isWritable:_,isWritableNodeStream:N,isWritableStream:T,isWritableFinished:k,isWritableErrored:D,isNodeStream:P,willEmitClose:O,kIsClosedPromise:L}=s(48229);let M;function isRequest(r){return r.setHeader&&typeof r.abort==="function"}const nop=()=>{};function eos(r,i,c){var b,w;if(arguments.length===2){c=i;i=u}else if(i==null){i=u}else{y(i,"options")}g(c,"callback");h(i.signal,"options.signal");c=A(c);if(x(r)||T(r)){return eosWeb(r,i,c)}if(!P(r)){throw new d("stream",["ReadableStream","WritableStream","Stream"],r)}const C=(b=i.readable)!==null&&b!==undefined?b:S(r);const L=(w=i.writable)!==null&&w!==undefined?w:N(r);const U=r._writableState;const j=r._readableState;const onlegacyfinish=()=>{if(!r.writable){onfinish()}};let H=O(r)&&S(r)===C&&N(r)===L;let q=k(r,false);const onfinish=()=>{q=true;if(r.destroyed){H=false}if(H&&(!r.readable||C)){return}if(!C||G){c.call(r)}};let G=R(r,false);const onend=()=>{G=true;if(r.destroyed){H=false}if(H&&(!r.writable||L)){return}if(!L||q){c.call(r)}};const onerror=i=>{c.call(r,i)};let z=I(r);const onclose=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}if(C&&!G&&S(r,true)){if(!R(r,false))return c.call(r,new p)}if(L&&!q){if(!k(r,false))return c.call(r,new p)}c.call(r)};const onclosed=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}c.call(r)};const onrequest=()=>{r.req.on("finish",onfinish)};if(isRequest(r)){r.on("complete",onfinish);if(!H){r.on("abort",onclose)}if(r.req){onrequest()}else{r.on("request",onrequest)}}else if(L&&!U){r.on("end",onlegacyfinish);r.on("close",onlegacyfinish)}if(!H&&typeof r.aborted==="boolean"){r.on("aborted",onclose)}r.on("end",onend);r.on("finish",onfinish);if(i.error!==false){r.on("error",onerror)}r.on("close",onclose);if(z){a.nextTick(onclose)}else if(U!==null&&U!==undefined&&U.errorEmitted||j!==null&&j!==undefined&&j.errorEmitted){if(!H){a.nextTick(onclosed)}}else if(!C&&(!H||B(r))&&(q||_(r)===false)){a.nextTick(onclosed)}else if(!L&&(!H||_(r))&&(G||B(r)===false)){a.nextTick(onclosed)}else if(j&&r.req&&r.aborted){a.nextTick(onclosed)}const cleanup=()=>{c=nop;r.removeListener("aborted",onclose);r.removeListener("complete",onfinish);r.removeListener("abort",onclose);r.removeListener("request",onrequest);if(r.req)r.req.removeListener("finish",onfinish);r.removeListener("end",onlegacyfinish);r.removeListener("close",onlegacyfinish);r.removeListener("finish",onfinish);r.removeListener("end",onend);r.removeListener("error",onerror);r.removeListener("close",onclose)};if(i.signal&&!z){const abort=()=>{const s=c;cleanup();s.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(abort)}else{M=M||s(63030).addAbortListener;const a=M(i.signal,abort);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}return cleanup}function eosWeb(r,i,c){let d=false;let p=nop;if(i.signal){p=()=>{d=true;c.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(p)}else{M=M||s(63030).addAbortListener;const a=M(i.signal,p);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}const resolverFn=(...i)=>{if(!d){a.nextTick((()=>c.apply(r,i)))}};C(r[L].promise,resolverFn,resolverFn);return nop}function finished(r,i){var s;let a=false;if(i===null){i=u}if((s=i)!==null&&s!==undefined&&s.cleanup){b(i.cleanup,"cleanup");a=i.cleanup}return new w(((s,l)=>{const c=eos(r,i,(r=>{if(a){c()}if(r){l(r)}else{s()}}))}))}r.exports=eos;r.exports.finished=finished},30835:(r,i,s)=>{"use strict";const a=s(53568);const{PromisePrototypeThen:l,SymbolAsyncIterator:c,SymbolIterator:d}=s(91495);const{Buffer:p}=s(14300);const{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:A}=s(53862).codes;function from(r,i,s){let h;if(typeof i==="string"||i instanceof p){return new r({objectMode:true,...s,read(){this.push(i);this.push(null)}})}let g;if(i&&i[c]){g=true;h=i[c]()}else if(i&&i[d]){g=false;h=i[d]()}else{throw new u("iterable",["Iterable"],i)}const y=new r({objectMode:true,highWaterMark:1,...s});let b=false;y._read=function(){if(!b){b=true;next()}};y._destroy=function(r,i){l(close(r),(()=>a.nextTick(i,r)),(s=>a.nextTick(i,s||r)))};async function close(r){const i=r!==undefined&&r!==null;const s=typeof h.throw==="function";if(i&&s){const{value:i,done:s}=await h.throw(r);await i;if(s){return}}if(typeof h.return==="function"){const{value:r}=await h.return();await r}}async function next(){for(;;){try{const{value:r,done:i}=g?await h.next():h.next();if(i){y.push(null)}else{const i=r&&typeof r.then==="function"?await r:r;if(i===null){b=false;throw new A}else if(y.push(i)){continue}else{b=false}}}catch(r){y.destroy(r)}break}}return y}r.exports=from},57369:(r,i,s)=>{"use strict";const{ArrayIsArray:a,ObjectSetPrototypeOf:l}=s(91495);const{EventEmitter:c}=s(82361);function Stream(r){c.call(this,r)}l(Stream.prototype,c.prototype);l(Stream,c);Stream.prototype.pipe=function(r,i){const s=this;function ondata(i){if(r.writable&&r.write(i)===false&&s.pause){s.pause()}}s.on("data",ondata);function ondrain(){if(s.readable&&s.resume){s.resume()}}r.on("drain",ondrain);if(!r._isStdio&&(!i||i.end!==false)){s.on("end",onend);s.on("close",onclose)}let a=false;function onend(){if(a)return;a=true;r.end()}function onclose(){if(a)return;a=true;if(typeof r.destroy==="function")r.destroy()}function onerror(r){cleanup();if(c.listenerCount(this,"error")===0){this.emit("error",r)}}prependListener(s,"error",onerror);prependListener(r,"error",onerror);function cleanup(){s.removeListener("data",ondata);r.removeListener("drain",ondrain);s.removeListener("end",onend);s.removeListener("close",onclose);s.removeListener("error",onerror);r.removeListener("error",onerror);s.removeListener("end",cleanup);s.removeListener("close",cleanup);r.removeListener("close",cleanup)}s.on("end",cleanup);s.on("close",cleanup);r.on("close",cleanup);r.emit("pipe",s);return r};function prependListener(r,i,s){if(typeof r.prependListener==="function")return r.prependListener(i,s);if(!r._events||!r._events[i])r.on(i,s);else if(a(r._events[i]))r._events[i].unshift(s);else r._events[i]=[s,r._events[i]]}r.exports={Stream:Stream,prependListener:prependListener}},40526:(r,i,s)=>{"use strict";const a=globalThis.AbortController||s(24995).AbortController;const{codes:{ERR_INVALID_ARG_VALUE:l,ERR_INVALID_ARG_TYPE:c,ERR_MISSING_ARGS:d,ERR_OUT_OF_RANGE:p},AbortError:u}=s(53862);const{validateAbortSignal:A,validateInteger:h,validateObject:g}=s(19726);const y=s(91495).Symbol("kWeak");const b=s(91495).Symbol("kResistStopPropagation");const{finished:w}=s(1475);const C=s(82648);const{addAbortSignalNoValidate:v}=s(48624);const{isWritable:I,isNodeStream:B}=s(48229);const{deprecate:S}=s(63030);const{ArrayPrototypePush:x,Boolean:R,MathFloor:Q,Number:_,NumberIsNaN:N,Promise:T,PromiseReject:k,PromiseResolve:D,PromisePrototypeThen:P,Symbol:O}=s(91495);const L=O("kEmpty");const M=O("kEof");function compose(r,i){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}if(B(r)&&!I(r)){throw new l("stream",r,"must be writable")}const s=C(this,r);if(i!==null&&i!==undefined&&i.signal){v(i.signal,s)}return s}function map(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}let a=1;if((i===null||i===undefined?undefined:i.concurrency)!=null){a=Q(i.concurrency)}let l=a-1;if((i===null||i===undefined?undefined:i.highWaterMark)!=null){l=Q(i.highWaterMark)}h(a,"options.concurrency",1);h(l,"options.highWaterMark",0);l+=a;return async function*map(){const c=s(63030).AbortSignalAny([i===null||i===undefined?undefined:i.signal].filter(R));const d=this;const p=[];const A={signal:c};let h;let g;let y=false;let b=0;function onCatch(){y=true;afterItemProcessed()}function afterItemProcessed(){b-=1;maybeResume()}function maybeResume(){if(g&&!y&&b=l||b>=a)){await new T((r=>{g=r}))}}p.push(M)}catch(r){const i=k(r);P(i,afterItemProcessed,onCatch);p.push(i)}finally{y=true;if(h){h();h=null}}}pump();try{while(true){while(p.length>0){const r=await p[0];if(r===M){return}if(c.aborted){throw new u}if(r!==L){yield r}p.shift();maybeResume()}await new T((r=>{h=r}))}}finally{y=true;if(g){g();g=null}}}.call(this)}function asIndexedPairs(r=undefined){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}return async function*asIndexedPairs(){let i=0;for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u({cause:r.signal.reason})}yield[i++,a]}}.call(this)}async function some(r,i=undefined){for await(const s of filter.call(this,r,i)){return true}return false}async function every(r,i=undefined){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}return!await some.call(this,(async(...i)=>!await r(...i)),i)}async function find(r,i){for await(const s of filter.call(this,r,i)){return s}return undefined}async function forEach(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function forEachFn(i,s){await r(i,s);return L}for await(const r of map.call(this,forEachFn,i));}function filter(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function filterFn(i,s){if(await r(i,s)){return i}return L}return map.call(this,filterFn,i)}class ReduceAwareErrMissingArgs extends d{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function reduce(r,i,s){var l;if(typeof r!=="function"){throw new c("reducer",["Function","AsyncFunction"],r)}if(s!=null){g(s,"options")}if((s===null||s===undefined?undefined:s.signal)!=null){A(s.signal,"options.signal")}let d=arguments.length>1;if(s!==null&&s!==undefined&&(l=s.signal)!==null&&l!==undefined&&l.aborted){const r=new u(undefined,{cause:s.signal.reason});this.once("error",(()=>{}));await w(this.destroy(r));throw r}const p=new a;const h=p.signal;if(s!==null&&s!==undefined&&s.signal){const r={once:true,[y]:this,[b]:true};s.signal.addEventListener("abort",(()=>p.abort()),r)}let C=false;try{for await(const a of this){var v;C=true;if(s!==null&&s!==undefined&&(v=s.signal)!==null&&v!==undefined&&v.aborted){throw new u}if(!d){i=a;d=true}else{i=await r(i,a,{signal:h})}}if(!C&&!d){throw new ReduceAwareErrMissingArgs}}finally{p.abort()}return i}async function toArray(r){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}const i=[];for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u(undefined,{cause:r.signal.reason})}x(i,a)}return i}function flatMap(r,i){const s=map.call(this,r,i);return async function*flatMap(){for await(const r of s){yield*r}}.call(this)}function toIntegerOrInfinity(r){r=_(r);if(N(r)){return 0}if(r<0){throw new p("number",">= 0",r)}return r}function drop(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*drop(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r--<=0){yield s}}}.call(this)}function take(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*take(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r-- >0){yield s}if(r<=0){return}}}.call(this)}r.exports.streamReturningOperators={asIndexedPairs:S(asIndexedPairs,"readable.asIndexedPairs will be removed in a future version."),drop:drop,filter:filter,flatMap:flatMap,map:map,take:take,compose:compose};r.exports.promiseReturningOperators={every:every,forEach:forEach,reduce:reduce,toArray:toArray,some:some,find:find}},29477:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a}=s(91495);r.exports=PassThrough;const l=s(83417);a(PassThrough.prototype,l.prototype);a(PassThrough,l);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);l.call(this,r)}PassThrough.prototype._transform=function(r,i,s){s(null,r)}},64073:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayIsArray:l,Promise:c,SymbolAsyncIterator:d,SymbolDispose:p}=s(91495);const u=s(1475);const{once:A}=s(63030);const h=s(28050);const g=s(99215);const{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:w,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:v,ERR_STREAM_PREMATURE_CLOSE:I},AbortError:B}=s(53862);const{validateFunction:S,validateAbortSignal:x}=s(19726);const{isIterable:R,isReadable:Q,isReadableNodeStream:_,isNodeStream:N,isTransformStream:T,isWebStream:k,isReadableStream:D,isReadableFinished:P}=s(48229);const O=globalThis.AbortController||s(24995).AbortController;let L;let M;let U;function destroyer(r,i,s){let a=false;r.on("close",(()=>{a=true}));const l=u(r,{readable:i,writable:s},(r=>{a=!r}));return{destroy:i=>{if(a)return;a=true;h.destroyer(r,i||new v("pipe"))},cleanup:l}}function popCallback(r){S(r[r.length-1],"streams[stream.length - 1]");return r.pop()}function makeAsyncIterable(r){if(R(r)){return r}else if(_(r)){return fromReadable(r)}throw new b("val",["Readable","Iterable","AsyncIterable"],r)}async function*fromReadable(r){if(!M){M=s(40952)}yield*M.prototype[d].call(r)}async function pumpToNode(r,i,s,{end:a}){let l;let d=null;const resume=r=>{if(r){l=r}if(d){const r=d;d=null;r()}};const wait=()=>new c(((r,i)=>{if(l){i(l)}else{d=()=>{if(l){i(l)}else{r()}}}}));i.on("drain",resume);const p=u(i,{readable:false},resume);try{if(i.writableNeedDrain){await wait()}for await(const s of r){if(!i.write(s)){await wait()}}if(a){i.end();await wait()}s()}catch(r){s(l!==r?y(l,r):r)}finally{p();i.off("drain",resume)}}async function pumpToWeb(r,i,s,{end:a}){if(T(i)){i=i.writable}const l=i.getWriter();try{for await(const i of r){await l.ready;l.write(i).catch((()=>{}))}await l.ready;if(a){await l.close()}s()}catch(r){try{await l.abort(r);s(r)}catch(r){s(r)}}}function pipeline(...r){return pipelineImpl(r,A(popCallback(r)))}function pipelineImpl(r,i,c){if(r.length===1&&l(r[0])){r=r[0]}if(r.length<2){throw new C("streams")}const d=new O;const u=d.signal;const A=c===null||c===undefined?undefined:c.signal;const h=[];x(A,"options.signal");function abort(){finishImpl(new B)}U=U||s(63030).addAbortListener;let y;if(A){y=U(A,abort)}let v;let I;const S=[];let P=0;function finish(r){finishImpl(r,--P===0)}function finishImpl(r,s){var l;if(r&&(!v||v.code==="ERR_STREAM_PREMATURE_CLOSE")){v=r}if(!v&&!s){return}while(S.length){S.shift()(v)}(l=y)===null||l===undefined?undefined:l[p]();d.abort();if(s){if(!v){h.forEach((r=>r()))}a.nextTick(i,v,I)}}let M;for(let q=0;q0;const W=z||(c===null||c===undefined?undefined:c.end)!==false;const Y=q===r.length-1;if(N(G)){if(W){const{destroy:J,cleanup:$}=destroyer(G,z,V);S.push(J);if(Q(G)&&Y){h.push($)}}function onError(r){if(r&&r.name!=="AbortError"&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"){finish(r)}}G.on("error",onError);if(Q(G)&&Y){h.push((()=>{G.removeListener("error",onError)}))}}if(q===0){if(typeof G==="function"){M=G({signal:u});if(!R(M)){throw new w("Iterable, AsyncIterable or Stream","source",M)}}else if(R(G)||_(G)||T(G)){M=G}else{M=g.from(G)}}else if(typeof G==="function"){if(T(M)){var j;M=makeAsyncIterable((j=M)===null||j===undefined?undefined:j.readable)}else{M=makeAsyncIterable(M)}M=G(M,{signal:u});if(z){if(!R(M,true)){throw new w("AsyncIterable",`transform[${q-1}]`,M)}}else{var H;if(!L){L=s(29477)}const X=new L({objectMode:true});const K=(H=M)===null||H===undefined?undefined:H.then;if(typeof K==="function"){P++;K.call(M,(r=>{I=r;if(r!=null){X.write(r)}if(W){X.end()}a.nextTick(finish)}),(r=>{X.destroy(r);a.nextTick(finish,r)}))}else if(R(M,true)){P++;pumpToNode(M,X,finish,{end:W})}else if(D(M)||T(M)){const te=M.readable||M;P++;pumpToNode(te,X,finish,{end:W})}else{throw new w("AsyncIterable or Promise","destination",M)}M=X;const{destroy:Z,cleanup:ee}=destroyer(M,false,true);S.push(Z);if(Y){h.push(ee)}}}else if(N(G)){if(_(M)){P+=2;const re=pipe(M,G,finish,{end:W});if(Q(G)&&Y){h.push(re)}}else if(T(M)||D(M)){const ne=M.readable||M;P++;pumpToNode(ne,G,finish,{end:W})}else if(R(M)){P++;pumpToNode(M,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else if(k(G)){if(_(M)){P++;pumpToWeb(makeAsyncIterable(M),G,finish,{end:W})}else if(D(M)||R(M)){P++;pumpToWeb(M,G,finish,{end:W})}else if(T(M)){P++;pumpToWeb(M.readable,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else{M=g.from(G)}}if(u!==null&&u!==undefined&&u.aborted||A!==null&&A!==undefined&&A.aborted){a.nextTick(abort)}return M}function pipe(r,i,s,{end:l}){let c=false;i.on("close",(()=>{if(!c){s(new I)}}));r.pipe(i,{end:false});if(l){function endFn(){c=true;i.end()}if(P(r)){a.nextTick(endFn)}else{r.once("end",endFn)}}else{s()}u(r,{readable:true,writable:false},(i=>{const a=r._readableState;if(i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted){r.once("end",s).once("error",s)}else{s(i)}}));return u(i,{readable:false,writable:true},s)}r.exports={pipelineImpl:pipelineImpl,pipeline:pipeline}},40952:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeIndexOf:l,NumberIsInteger:c,NumberIsNaN:d,NumberParseInt:p,ObjectDefineProperties:u,ObjectKeys:A,ObjectSetPrototypeOf:h,Promise:g,SafeSet:y,SymbolAsyncDispose:b,SymbolAsyncIterator:w,Symbol:C}=s(91495);r.exports=Readable;Readable.ReadableState=ReadableState;const{EventEmitter:v}=s(82361);const{Stream:I,prependListener:B}=s(57369);const{Buffer:S}=s(14300);const{addAbortSignal:x}=s(48624);const R=s(1475);let Q=s(63030).debuglog("stream",(r=>{Q=r}));const _=s(67939);const N=s(28050);const{getHighWaterMark:T,getDefaultHighWaterMark:k}=s(2261);const{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:L,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:j}=s(53862);const{validateObject:H}=s(19726);const q=C("kPaused");const{StringDecoder:G}=s(71576);const z=s(30835);h(Readable.prototype,I.prototype);h(Readable,I);const nop=()=>{};const{errorOrDestroy:V}=N;const W=1<<0;const Y=1<<1;const J=1<<2;const $=1<<3;const X=1<<4;const K=1<<5;const Z=1<<6;const ee=1<<7;const te=1<<8;const re=1<<9;const ne=1<<10;const ie=1<<11;const se=1<<12;const ae=1<<13;const oe=1<<14;const le=1<<15;const ce=1<<16;const de=1<<17;const pe=1<<18;function makeBitMapDescriptor(r){return{enumerable:false,get(){return(this.state&r)!==0},set(i){if(i)this.state|=r;else this.state&=~r}}}u(ReadableState.prototype,{objectMode:makeBitMapDescriptor(W),ended:makeBitMapDescriptor(Y),endEmitted:makeBitMapDescriptor(J),reading:makeBitMapDescriptor($),constructed:makeBitMapDescriptor(X),sync:makeBitMapDescriptor(K),needReadable:makeBitMapDescriptor(Z),emittedReadable:makeBitMapDescriptor(ee),readableListening:makeBitMapDescriptor(te),resumeScheduled:makeBitMapDescriptor(re),errorEmitted:makeBitMapDescriptor(ne),emitClose:makeBitMapDescriptor(ie),autoDestroy:makeBitMapDescriptor(se),destroyed:makeBitMapDescriptor(ae),closed:makeBitMapDescriptor(oe),closeEmitted:makeBitMapDescriptor(le),multiAwaitDrain:makeBitMapDescriptor(ce),readingMore:makeBitMapDescriptor(de),dataEmitted:makeBitMapDescriptor(pe)});function ReadableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(99215);this.state=ie|se|X|K;if(r&&r.objectMode)this.state|=W;if(a&&r&&r.readableObjectMode)this.state|=W;this.highWaterMark=r?T(this,r,"readableHighWaterMark",a):k(false);this.buffer=new _;this.length=0;this.pipes=[];this.flowing=null;this[q]=null;if(r&&r.emitClose===false)this.state&=~ie;if(r&&r.autoDestroy===false)this.state&=~se;this.errored=null;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.awaitDrainWriters=null;this.decoder=null;this.encoding=null;if(r&&r.encoding){this.decoder=new G(r.encoding);this.encoding=r.encoding}}function Readable(r){if(!(this instanceof Readable))return new Readable(r);const i=this instanceof s(99215);this._readableState=new ReadableState(r,this,i);if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal&&!i)x(r.signal,this)}I.call(this,r);N.construct(this,(()=>{if(this._readableState.needReadable){maybeReadMore(this,this._readableState)}}))}Readable.prototype.destroy=N.destroy;Readable.prototype._undestroy=N.undestroy;Readable.prototype._destroy=function(r,i){i(r)};Readable.prototype[v.captureRejectionSymbol]=function(r){this.destroy(r)};Readable.prototype[b]=function(){let r;if(!this.destroyed){r=this.readableEnded?null:new j;this.destroy(r)}return new g(((i,s)=>R(this,(a=>a&&a!==r?s(a):i(null)))))};Readable.prototype.push=function(r,i){return readableAddChunk(this,r,i,false)};Readable.prototype.unshift=function(r,i){return readableAddChunk(this,r,i,true)};function readableAddChunk(r,i,s,a){Q("readableAddChunk",i);const l=r._readableState;let c;if((l.state&W)===0){if(typeof i==="string"){s=s||l.defaultEncoding;if(l.encoding!==s){if(a&&l.encoding){i=S.from(i,s).toString(l.encoding)}else{i=S.from(i,s);s=""}}}else if(i instanceof S){s=""}else if(I._isUint8Array(i)){i=I._uint8ArrayToBuffer(i);s=""}else if(i!=null){c=new P("chunk",["string","Buffer","Uint8Array"],i)}}if(c){V(r,c)}else if(i===null){l.state&=~$;onEofChunk(r,l)}else if((l.state&W)!==0||i&&i.length>0){if(a){if((l.state&J)!==0)V(r,new U);else if(l.destroyed||l.errored)return false;else addChunk(r,l,i,true)}else if(l.ended){V(r,new M)}else if(l.destroyed||l.errored){return false}else{l.state&=~$;if(l.decoder&&!s){i=l.decoder.write(i);if(l.objectMode||i.length!==0)addChunk(r,l,i,false);else maybeReadMore(r,l)}else{addChunk(r,l,i,false)}}}else if(!a){l.state&=~$;maybeReadMore(r,l)}return!l.ended&&(l.length0){if((i.state&ce)!==0){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}i.dataEmitted=true;r.emit("data",s)}else{i.length+=i.objectMode?1:s.length;if(a)i.buffer.unshift(s);else i.buffer.push(s);if((i.state&Z)!==0)emitReadable(r)}maybeReadMore(r,i)}Readable.prototype.isPaused=function(){const r=this._readableState;return r[q]===true||r.flowing===false};Readable.prototype.setEncoding=function(r){const i=new G(r);this._readableState.decoder=i;this._readableState.encoding=this._readableState.decoder.encoding;const s=this._readableState.buffer;let a="";for(const r of s){a+=i.write(r)}s.clear();if(a!=="")s.push(a);this._readableState.length=a.length;return this};const ue=1073741824;function computeNewHighWaterMark(r){if(r>ue){throw new L("size","<= 1GiB",r)}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if((i.state&W)!==0)return 1;if(d(r)){if(i.flowing&&i.length)return i.buffer.first().length;return i.length}if(r<=i.length)return r;return i.ended?i.length:0}Readable.prototype.read=function(r){Q("read",r);if(r===undefined){r=NaN}else if(!c(r)){r=p(r,10)}const i=this._readableState;const s=r;if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r!==0)i.state&=~ee;if(r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){Q("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}let a=(i.state&Z)!==0;Q("need readable",a);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=i.length<=i.highWaterMark;r=0}else{i.length-=r;if(i.multiAwaitDrain){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}}if(i.length===0){if(!i.ended)i.needReadable=true;if(s!==r&&i.ended)endReadable(this)}if(l!==null&&!i.errorEmitted&&!i.closeEmitted){i.dataEmitted=true;this.emit("data",l)}return l};function onEofChunk(r,i){Q("onEofChunk");if(i.ended)return;if(i.decoder){const r=i.decoder.end();if(r&&r.length){i.buffer.push(r);i.length+=i.objectMode?1:r.length}}i.ended=true;if(i.sync){emitReadable(r)}else{i.needReadable=false;i.emittedReadable=true;emitReadable_(r)}}function emitReadable(r){const i=r._readableState;Q("emitReadable",i.needReadable,i.emittedReadable);i.needReadable=false;if(!i.emittedReadable){Q("emitReadable",i.flowing);i.emittedReadable=true;a.nextTick(emitReadable_,r)}}function emitReadable_(r){const i=r._readableState;Q("emitReadable_",i.destroyed,i.length,i.ended);if(!i.destroyed&&!i.errored&&(i.length||i.ended)){r.emit("readable");i.emittedReadable=false}i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark;flow(r)}function maybeReadMore(r,i){if(!i.readingMore&&i.constructed){i.readingMore=true;a.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){while(!i.reading&&!i.ended&&(i.length1&&l.pipes.includes(r)){Q("false write response, pause",l.awaitDrainWriters.size);l.awaitDrainWriters.add(r)}s.pause()}if(!p){p=pipeOnDrain(s,r);r.on("drain",p)}}s.on("data",ondata);function ondata(i){Q("ondata");const s=r.write(i);Q("dest.write",s);if(s===false){pause()}}function onerror(i){Q("onerror",i);unpipe();r.removeListener("error",onerror);if(r.listenerCount("error")===0){const s=r._writableState||r._readableState;if(s&&!s.errorEmitted){V(r,i)}else{r.emit("error",i)}}}B(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){Q("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){Q("unpipe");s.unpipe(r)}r.emit("pipe",s);if(r.writableNeedDrain===true){pause()}else if(!l.flowing){Q("pipe resume");s.resume()}return r};function pipeOnDrain(r,i){return function pipeOnDrainFunctionResult(){const s=r._readableState;if(s.awaitDrainWriters===i){Q("pipeOnDrain",1);s.awaitDrainWriters=null}else if(s.multiAwaitDrain){Q("pipeOnDrain",s.awaitDrainWriters.size);s.awaitDrainWriters.delete(i)}if((!s.awaitDrainWriters||s.awaitDrainWriters.size===0)&&r.listenerCount("data")){r.resume()}}}Readable.prototype.unpipe=function(r){const i=this._readableState;const s={hasUnpiped:false};if(i.pipes.length===0)return this;if(!r){const r=i.pipes;i.pipes=[];this.pause();for(let i=0;i0;if(l.flowing!==false)this.resume()}else if(r==="readable"){if(!l.endEmitted&&!l.readableListening){l.readableListening=l.needReadable=true;l.flowing=false;l.emittedReadable=false;Q("on readable",l.length,l.reading);if(l.length){emitReadable(this)}else if(!l.reading){a.nextTick(nReadingNextTick,this)}}}return s};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(r,i){const s=I.prototype.removeListener.call(this,r,i);if(r==="readable"){a.nextTick(updateReadableListening,this)}return s};Readable.prototype.off=Readable.prototype.removeListener;Readable.prototype.removeAllListeners=function(r){const i=I.prototype.removeAllListeners.apply(this,arguments);if(r==="readable"||r===undefined){a.nextTick(updateReadableListening,this)}return i};function updateReadableListening(r){const i=r._readableState;i.readableListening=r.listenerCount("readable")>0;if(i.resumeScheduled&&i[q]===false){i.flowing=true}else if(r.listenerCount("data")>0){r.resume()}else if(!i.readableListening){i.flowing=null}}function nReadingNextTick(r){Q("readable nexttick read 0");r.read(0)}Readable.prototype.resume=function(){const r=this._readableState;if(!r.flowing){Q("resume");r.flowing=!r.readableListening;resume(this,r)}r[q]=false;return this};function resume(r,i){if(!i.resumeScheduled){i.resumeScheduled=true;a.nextTick(resume_,r,i)}}function resume_(r,i){Q("resume",i.reading);if(!i.reading){r.read(0)}i.resumeScheduled=false;r.emit("resume");flow(r);if(i.flowing&&!i.reading)r.read(0)}Readable.prototype.pause=function(){Q("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){Q("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState[q]=true;return this};function flow(r){const i=r._readableState;Q("flow",i.flowing);while(i.flowing&&r.read()!==null);}Readable.prototype.wrap=function(r){let i=false;r.on("data",(s=>{if(!this.push(s)&&r.pause){i=true;r.pause()}}));r.on("end",(()=>{this.push(null)}));r.on("error",(r=>{V(this,r)}));r.on("close",(()=>{this.destroy()}));r.on("destroy",(()=>{this.destroy()}));this._read=()=>{if(i&&r.resume){i=false;r.resume()}};const s=A(r);for(let i=1;i{a=r?D(a,r):null;s();s=nop}));try{while(true){const i=r.destroyed?null:r.read();if(i!==null){yield i}else if(a){throw a}else if(a===null){return}else{await new g(next)}}}catch(r){a=D(a,r);throw a}finally{if((a||(i===null||i===undefined?undefined:i.destroyOnReturn)!==false)&&(a===undefined||r._readableState.autoDestroy)){N.destroyer(r,null)}else{r.off("readable",next);l()}}}u(Readable.prototype,{readable:{__proto__:null,get(){const r=this._readableState;return!!r&&r.readable!==false&&!r.destroyed&&!r.errorEmitted&&!r.endEmitted},set(r){if(this._readableState){this._readableState.readable=!!r}}},readableDidRead:{__proto__:null,enumerable:false,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:false,get:function(){return!!(this._readableState.readable!==false&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:false,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:false,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:false,get:function(){return this._readableState.flowing},set:function(r){if(this._readableState){this._readableState.flowing=r}}},readableLength:{__proto__:null,enumerable:false,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.objectMode:false}},readableEncoding:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:false}},destroyed:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.destroyed:false},set(r){if(!this._readableState){return}this._readableState.destroyed=r}},readableEnded:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.endEmitted:false}}});u(ReadableState.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[q]!==false},set(r){this[q]=!!r}}});Readable._fromList=fromList;function fromList(r,i){if(i.length===0)return null;let s;if(i.objectMode)s=i.buffer.shift();else if(!r||r>=i.length){if(i.decoder)s=i.buffer.join("");else if(i.buffer.length===1)s=i.buffer.first();else s=i.buffer.concat(i.length);i.buffer.clear()}else{s=i.buffer.consume(r,i.decoder)}return s}function endReadable(r){const i=r._readableState;Q("endReadable",i.endEmitted);if(!i.endEmitted){i.ended=true;a.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){Q("endReadableNT",r.endEmitted,r.length);if(!r.errored&&!r.closeEmitted&&!r.endEmitted&&r.length===0){r.endEmitted=true;i.emit("end");if(i.writable&&i.allowHalfOpen===false){a.nextTick(endWritableNT,i)}else if(r.autoDestroy){const r=i._writableState;const s=!r||r.autoDestroy&&(r.finished||r.writable===false);if(s){i.destroy()}}}}function endWritableNT(r){const i=r.writable&&!r.writableEnded&&!r.destroyed;if(i){r.end()}}Readable.from=function(r,i){return z(Readable,r,i)};let Ae;function lazyWebStreams(){if(Ae===undefined)Ae={};return Ae}Readable.fromWeb=function(r,i){return lazyWebStreams().newStreamReadableFromReadableStream(r,i)};Readable.toWeb=function(r,i){return lazyWebStreams().newReadableStreamFromStreamReadable(r,i)};Readable.wrap=function(r,i){var s,a;return new Readable({objectMode:(s=(a=r.readableObjectMode)!==null&&a!==undefined?a:r.objectMode)!==null&&s!==undefined?s:true,...i,destroy(i,s){N.destroyer(r,i);s(i)}}).wrap(r)}},2261:(r,i,s)=>{"use strict";const{MathFloor:a,NumberIsInteger:l}=s(91495);const{validateInteger:c}=s(19726);const{ERR_INVALID_ARG_VALUE:d}=s(53862).codes;let p=16*1024;let u=16;function highWaterMarkFrom(r,i,s){return r.highWaterMark!=null?r.highWaterMark:i?r[s]:null}function getDefaultHighWaterMark(r){return r?u:p}function setDefaultHighWaterMark(r,i){c(i,"value",0);if(r){u=i}else{p=i}}function getHighWaterMark(r,i,s,c){const p=highWaterMarkFrom(i,c,s);if(p!=null){if(!l(p)||p<0){const r=c?`options.${s}`:"options.highWaterMark";throw new d(r,p)}return a(p)}return getDefaultHighWaterMark(r.objectMode)}r.exports={getHighWaterMark:getHighWaterMark,getDefaultHighWaterMark:getDefaultHighWaterMark,setDefaultHighWaterMark:setDefaultHighWaterMark}},83417:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a,Symbol:l}=s(91495);r.exports=Transform;const{ERR_METHOD_NOT_IMPLEMENTED:c}=s(53862).codes;const d=s(99215);const{getHighWaterMark:p}=s(2261);a(Transform.prototype,d.prototype);a(Transform,d);const u=l("kCallback");function Transform(r){if(!(this instanceof Transform))return new Transform(r);const i=r?p(this,r,"readableHighWaterMark",true):null;if(i===0){r={...r,highWaterMark:null,readableHighWaterMark:i,writableHighWaterMark:r.writableHighWaterMark||0}}d.call(this,r);this._readableState.sync=false;this[u]=null;if(r){if(typeof r.transform==="function")this._transform=r.transform;if(typeof r.flush==="function")this._flush=r.flush}this.on("prefinish",prefinish)}function final(r){if(typeof this._flush==="function"&&!this.destroyed){this._flush(((i,s)=>{if(i){if(r){r(i)}else{this.destroy(i)}return}if(s!=null){this.push(s)}this.push(null);if(r){r()}}))}else{this.push(null);if(r){r()}}}function prefinish(){if(this._final!==final){final.call(this)}}Transform.prototype._final=final;Transform.prototype._transform=function(r,i,s){throw new c("_transform()")};Transform.prototype._write=function(r,i,s){const a=this._readableState;const l=this._writableState;const c=a.length;this._transform(r,i,((r,i)=>{if(r){s(r);return}if(i!=null){this.push(i)}if(l.ended||c===a.length||a.length{"use strict";const{SymbolAsyncIterator:a,SymbolIterator:l,SymbolFor:c}=s(91495);const d=c("nodejs.stream.destroyed");const p=c("nodejs.stream.errored");const u=c("nodejs.stream.readable");const A=c("nodejs.stream.writable");const h=c("nodejs.stream.disturbed");const g=c("nodejs.webstream.isClosedPromise");const y=c("nodejs.webstream.controllerErrorFunction");function isReadableNodeStream(r,i=false){var s;return!!(r&&typeof r.pipe==="function"&&typeof r.on==="function"&&(!i||typeof r.pause==="function"&&typeof r.resume==="function")&&(!r._writableState||((s=r._readableState)===null||s===undefined?undefined:s.readable)!==false)&&(!r._writableState||r._readableState))}function isWritableNodeStream(r){var i;return!!(r&&typeof r.write==="function"&&typeof r.on==="function"&&(!r._readableState||((i=r._writableState)===null||i===undefined?undefined:i.writable)!==false))}function isDuplexNodeStream(r){return!!(r&&typeof r.pipe==="function"&&r._readableState&&typeof r.on==="function"&&typeof r.write==="function")}function isNodeStream(r){return r&&(r._readableState||r._writableState||typeof r.write==="function"&&typeof r.on==="function"||typeof r.pipe==="function"&&typeof r.on==="function")}function isReadableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.pipeThrough==="function"&&typeof r.getReader==="function"&&typeof r.cancel==="function")}function isWritableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.getWriter==="function"&&typeof r.abort==="function")}function isTransformStream(r){return!!(r&&!isNodeStream(r)&&typeof r.readable==="object"&&typeof r.writable==="object")}function isWebStream(r){return isReadableStream(r)||isWritableStream(r)||isTransformStream(r)}function isIterable(r,i){if(r==null)return false;if(i===true)return typeof r[a]==="function";if(i===false)return typeof r[l]==="function";return typeof r[a]==="function"||typeof r[l]==="function"}function isDestroyed(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!!(r.destroyed||r[d]||a!==null&&a!==undefined&&a.destroyed)}function isWritableEnded(r){if(!isWritableNodeStream(r))return null;if(r.writableEnded===true)return true;const i=r._writableState;if(i!==null&&i!==undefined&&i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isWritableFinished(r,i){if(!isWritableNodeStream(r))return null;if(r.writableFinished===true)return true;const s=r._writableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.finished)!=="boolean")return null;return!!(s.finished||i===false&&s.ended===true&&s.length===0)}function isReadableEnded(r){if(!isReadableNodeStream(r))return null;if(r.readableEnded===true)return true;const i=r._readableState;if(!i||i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isReadableFinished(r,i){if(!isReadableNodeStream(r))return null;const s=r._readableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.endEmitted)!=="boolean")return null;return!!(s.endEmitted||i===false&&s.ended===true&&s.length===0)}function isReadable(r){if(r&&r[u]!=null)return r[u];if(typeof(r===null||r===undefined?undefined:r.readable)!=="boolean")return null;if(isDestroyed(r))return false;return isReadableNodeStream(r)&&r.readable&&!isReadableFinished(r)}function isWritable(r){if(r&&r[A]!=null)return r[A];if(typeof(r===null||r===undefined?undefined:r.writable)!=="boolean")return null;if(isDestroyed(r))return false;return isWritableNodeStream(r)&&r.writable&&!isWritableEnded(r)}function isFinished(r,i){if(!isNodeStream(r)){return null}if(isDestroyed(r)){return true}if((i===null||i===undefined?undefined:i.readable)!==false&&isReadable(r)){return false}if((i===null||i===undefined?undefined:i.writable)!==false&&isWritable(r)){return false}return true}function isWritableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.writableErrored){return r.writableErrored}return(i=(s=r._writableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isReadableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.readableErrored){return r.readableErrored}return(i=(s=r._readableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isClosed(r){if(!isNodeStream(r)){return null}if(typeof r.closed==="boolean"){return r.closed}const i=r._writableState;const s=r._readableState;if(typeof(i===null||i===undefined?undefined:i.closed)==="boolean"||typeof(s===null||s===undefined?undefined:s.closed)==="boolean"){return(i===null||i===undefined?undefined:i.closed)||(s===null||s===undefined?undefined:s.closed)}if(typeof r._closed==="boolean"&&isOutgoingMessage(r)){return r._closed}return null}function isOutgoingMessage(r){return typeof r._closed==="boolean"&&typeof r._defaultKeepAlive==="boolean"&&typeof r._removedConnection==="boolean"&&typeof r._removedContLen==="boolean"}function isServerResponse(r){return typeof r._sent100==="boolean"&&isOutgoingMessage(r)}function isServerRequest(r){var i;return typeof r._consuming==="boolean"&&typeof r._dumped==="boolean"&&((i=r.req)===null||i===undefined?undefined:i.upgradeOrConnect)===undefined}function willEmitClose(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!a&&isServerResponse(r)||!!(a&&a.autoDestroy&&a.emitClose&&a.closed===false)}function isDisturbed(r){var i;return!!(r&&((i=r[h])!==null&&i!==undefined?i:r.readableDidRead||r.readableAborted))}function isErrored(r){var i,s,a,l,c,d,u,A,h,g;return!!(r&&((i=(s=(a=(l=(c=(d=r[p])!==null&&d!==undefined?d:r.readableErrored)!==null&&c!==undefined?c:r.writableErrored)!==null&&l!==undefined?l:(u=r._readableState)===null||u===undefined?undefined:u.errorEmitted)!==null&&a!==undefined?a:(A=r._writableState)===null||A===undefined?undefined:A.errorEmitted)!==null&&s!==undefined?s:(h=r._readableState)===null||h===undefined?undefined:h.errored)!==null&&i!==undefined?i:(g=r._writableState)===null||g===undefined?undefined:g.errored))}r.exports={isDestroyed:isDestroyed,kIsDestroyed:d,isDisturbed:isDisturbed,kIsDisturbed:h,isErrored:isErrored,kIsErrored:p,isReadable:isReadable,kIsReadable:u,kIsClosedPromise:g,kControllerErrorFunction:y,kIsWritable:A,isClosed:isClosed,isDuplexNodeStream:isDuplexNodeStream,isFinished:isFinished,isIterable:isIterable,isReadableNodeStream:isReadableNodeStream,isReadableStream:isReadableStream,isReadableEnded:isReadableEnded,isReadableFinished:isReadableFinished,isReadableErrored:isReadableErrored,isNodeStream:isNodeStream,isWebStream:isWebStream,isWritable:isWritable,isWritableNodeStream:isWritableNodeStream,isWritableStream:isWritableStream,isWritableEnded:isWritableEnded,isWritableFinished:isWritableFinished,isWritableErrored:isWritableErrored,isServerRequest:isServerRequest,isServerResponse:isServerResponse,willEmitClose:willEmitClose,isTransformStream:isTransformStream}},70274:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeSlice:l,Error:c,FunctionPrototypeSymbolHasInstance:d,ObjectDefineProperty:p,ObjectDefineProperties:u,ObjectSetPrototypeOf:A,StringPrototypeToLowerCase:h,Symbol:g,SymbolHasInstance:y}=s(91495);r.exports=Writable;Writable.WritableState=WritableState;const{EventEmitter:b}=s(82361);const w=s(57369).Stream;const{Buffer:C}=s(14300);const v=s(28050);const{addAbortSignal:I}=s(48624);const{getHighWaterMark:B,getDefaultHighWaterMark:S}=s(2261);const{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_MULTIPLE_CALLBACK:Q,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:k,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:P}=s(53862).codes;const{errorOrDestroy:O}=v;A(Writable.prototype,w.prototype);A(Writable,w);function nop(){}const L=g("kOnFinished");function WritableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(99215);this.objectMode=!!(r&&r.objectMode);if(a)this.objectMode=this.objectMode||!!(r&&r.writableObjectMode);this.highWaterMark=r?B(this,r,"writableHighWaterMark",a):S(false);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;const l=!!(r&&r.decodeStrings===false);this.decodeStrings=!l;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=onwrite.bind(undefined,i);this.writecb=null;this.writelen=0;this.afterWriteTickInfo=null;resetBuffer(this);this.pendingcb=0;this.constructed=true;this.prefinished=false;this.errorEmitted=false;this.emitClose=!r||r.emitClose!==false;this.autoDestroy=!r||r.autoDestroy!==false;this.errored=null;this.closed=false;this.closeEmitted=false;this[L]=[]}function resetBuffer(r){r.buffered=[];r.bufferedIndex=0;r.allBuffers=true;r.allNoop=true}WritableState.prototype.getBuffer=function getBuffer(){return l(this.buffered,this.bufferedIndex)};p(WritableState.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Writable(r){const i=this instanceof s(99215);if(!i&&!d(Writable,this))return new Writable(r);this._writableState=new WritableState(r,this,i);if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal)I(r.signal,this)}w.call(this,r);v.construct(this,(()=>{const r=this._writableState;if(!r.writing){clearBuffer(this,r)}finishMaybe(this,r)}))}p(Writable,y,{__proto__:null,value:function(r){if(d(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}});Writable.prototype.pipe=function(){O(this,new _)};function _write(r,i,s,l){const c=r._writableState;if(typeof s==="function"){l=s;s=c.defaultEncoding}else{if(!s)s=c.defaultEncoding;else if(s!=="buffer"&&!C.isEncoding(s))throw new P(s);if(typeof l!=="function")l=nop}if(i===null){throw new k}else if(!c.objectMode){if(typeof i==="string"){if(c.decodeStrings!==false){i=C.from(i,s);s="buffer"}}else if(i instanceof C){s="buffer"}else if(w._isUint8Array(i)){i=w._uint8ArrayToBuffer(i);s="buffer"}else{throw new x("chunk",["string","Buffer","Uint8Array"],i)}}let d;if(c.ending){d=new D}else if(c.destroyed){d=new N("write")}if(d){a.nextTick(l,d);O(r,d,true);return d}c.pendingcb++;return writeOrBuffer(r,c,i,s,l)}Writable.prototype.write=function(r,i,s){return _write(this,r,i,s)===true};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){const r=this._writableState;if(r.corked){r.corked--;if(!r.writing)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=h(r);if(!C.isEncoding(r))throw new P(r);this._writableState.defaultEncoding=r;return this};function writeOrBuffer(r,i,s,a,l){const c=i.objectMode?1:s.length;i.length+=c;const d=i.lengths.bufferedIndex){clearBuffer(r,s)}if(l){if(s.afterWriteTickInfo!==null&&s.afterWriteTickInfo.cb===c){s.afterWriteTickInfo.count++}else{s.afterWriteTickInfo={count:1,cb:c,stream:r,state:s};a.nextTick(afterWriteTick,s.afterWriteTickInfo)}}else{afterWrite(r,s,1,c)}}}function afterWriteTick({stream:r,state:i,count:s,cb:a}){i.afterWriteTickInfo=null;return afterWrite(r,i,s,a)}function afterWrite(r,i,s,a){const l=!i.ending&&!r.destroyed&&i.length===0&&i.needDrain;if(l){i.needDrain=false;r.emit("drain")}while(s-- >0){i.pendingcb--;a()}if(i.destroyed){errorBuffer(i)}finishMaybe(r,i)}function errorBuffer(r){if(r.writing){return}for(let s=r.bufferedIndex;s1&&r._writev){i.pendingcb-=d-1;const a=i.allNoop?nop:r=>{for(let i=p;i256){s.splice(0,p);i.bufferedIndex=0}else{i.bufferedIndex=p}}i.bufferProcessing=false}Writable.prototype._write=function(r,i,s){if(this._writev){this._writev([{chunk:r,encoding:i}],s)}else{throw new R("_write()")}};Writable.prototype._writev=null;Writable.prototype.end=function(r,i,s){const l=this._writableState;if(typeof r==="function"){s=r;r=null;i=null}else if(typeof i==="function"){s=i;i=null}let d;if(r!==null&&r!==undefined){const s=_write(this,r,i);if(s instanceof c){d=s}}if(l.corked){l.corked=1;this.uncork()}if(d){}else if(!l.errored&&!l.ending){l.ending=true;finishMaybe(this,l,true);l.ended=true}else if(l.finished){d=new T("end")}else if(l.destroyed){d=new N("end")}if(typeof s==="function"){if(d||l.finished){a.nextTick(s,d)}else{l[L].push(s)}}return this};function needFinish(r){return r.ending&&!r.destroyed&&r.constructed&&r.length===0&&!r.errored&&r.buffered.length===0&&!r.finished&&!r.writing&&!r.errorEmitted&&!r.closeEmitted}function callFinal(r,i){let s=false;function onFinish(l){if(s){O(r,l!==null&&l!==undefined?l:Q());return}s=true;i.pendingcb--;if(l){const s=i[L].splice(0);for(let r=0;r{if(needFinish(i)){finish(r,i)}else{i.pendingcb--}}),r,i)}else if(needFinish(i)){i.pendingcb++;finish(r,i)}}}}function finish(r,i){i.pendingcb--;i.finished=true;const s=i[L].splice(0);for(let r=0;r{"use strict";const{ArrayIsArray:a,ArrayPrototypeIncludes:l,ArrayPrototypeJoin:c,ArrayPrototypeMap:d,NumberIsInteger:p,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:A,NumberMIN_SAFE_INTEGER:h,NumberParseInt:g,ObjectPrototypeHasOwnProperty:y,RegExpPrototypeExec:b,String:w,StringPrototypeToUpperCase:C,StringPrototypeTrim:v}=s(91495);const{hideStackFrames:I,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:S,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:R,ERR_UNKNOWN_SIGNAL:Q}}=s(53862);const{normalizeEncoding:_}=s(63030);const{isAsyncFunction:N,isArrayBufferView:T}=s(63030).types;const k={};function isInt32(r){return r===(r|0)}function isUint32(r){return r===r>>>0}const D=/^[0-7]+$/;const P="must be a 32-bit unsigned integer or an octal string";function parseFileMode(r,i,s){if(typeof r==="undefined"){r=s}if(typeof r==="string"){if(b(D,r)===null){throw new x(i,r,P)}r=g(r,8)}M(r,i);return r}const O=I(((r,i,s=h,a=A)=>{if(typeof r!=="number")throw new S(i,"number",r);if(!p(r))throw new R(i,"an integer",r);if(ra)throw new R(i,`>= ${s} && <= ${a}`,r)}));const L=I(((r,i,s=-2147483648,a=2147483647)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}if(ra){throw new R(i,`>= ${s} && <= ${a}`,r)}}));const M=I(((r,i,s=false)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}const a=s?1:0;const l=4294967295;if(rl){throw new R(i,`>= ${a} && <= ${l}`,r)}}));function validateString(r,i){if(typeof r!=="string")throw new S(i,"string",r)}function validateNumber(r,i,s=undefined,a){if(typeof r!=="number")throw new S(i,"number",r);if(s!=null&&ra||(s!=null||a!=null)&&u(r)){throw new R(i,`${s!=null?`>= ${s}`:""}${s!=null&&a!=null?" && ":""}${a!=null?`<= ${a}`:""}`,r)}}const U=I(((r,i,s)=>{if(!l(s,r)){const a=c(d(s,(r=>typeof r==="string"?`'${r}'`:w(r))),", ");const l="must be one of: "+a;throw new x(i,r,l)}}));function validateBoolean(r,i){if(typeof r!=="boolean")throw new S(i,"boolean",r)}function getOwnPropertyValueOrDefault(r,i,s){return r==null||!y(r,i)?s:r[i]}const j=I(((r,i,s=null)=>{const l=getOwnPropertyValueOrDefault(s,"allowArray",false);const c=getOwnPropertyValueOrDefault(s,"allowFunction",false);const d=getOwnPropertyValueOrDefault(s,"nullable",false);if(!d&&r===null||!l&&a(r)||typeof r!=="object"&&(!c||typeof r!=="function")){throw new S(i,"Object",r)}}));const H=I(((r,i)=>{if(r!=null&&typeof r!=="object"&&typeof r!=="function"){throw new S(i,"a dictionary",r)}}));const q=I(((r,i,s=0)=>{if(!a(r)){throw new S(i,"Array",r)}if(r.length{if(!T(r)){throw new S(i,["Buffer","TypedArray","DataView"],r)}}));function validateEncoding(r,i){const s=_(i);const a=r.length;if(s==="hex"&&a%2!==0){throw new x("encoding",i,`is invalid for data of length ${a}`)}}function validatePort(r,i="Port",s=true){if(typeof r!=="number"&&typeof r!=="string"||typeof r==="string"&&v(r).length===0||+r!==+r>>>0||r>65535||r===0&&!s){throw new B(i,r,s)}return r|0}const z=I(((r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new S(i,"AbortSignal",r)}}));const V=I(((r,i)=>{if(typeof r!=="function")throw new S(i,"Function",r)}));const W=I(((r,i)=>{if(typeof r!=="function"||N(r))throw new S(i,"Function",r)}));const Y=I(((r,i)=>{if(r!==undefined)throw new S(i,"undefined",r)}));function validateUnion(r,i,s){if(!l(s,r)){throw new S(i,`('${c(s,"|")}')`,r)}}const J=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function validateLinkHeaderFormat(r,i){if(typeof r==="undefined"||!b(J,r)){throw new x(i,r,'must be an array or string of format "; rel=preload; as=style"')}}function validateLinkHeaderValue(r){if(typeof r==="string"){validateLinkHeaderFormat(r,"hints");return r}else if(a(r)){const i=r.length;let s="";if(i===0){return s}for(let a=0;a; rel=preload; as=style"')}r.exports={isInt32:isInt32,isUint32:isUint32,parseFileMode:parseFileMode,validateArray:q,validateStringArray:validateStringArray,validateBooleanArray:validateBooleanArray,validateAbortSignalArray:validateAbortSignalArray,validateBoolean:validateBoolean,validateBuffer:G,validateDictionary:H,validateEncoding:validateEncoding,validateFunction:V,validateInt32:L,validateInteger:O,validateNumber:validateNumber,validateObject:j,validateOneOf:U,validatePlainFunction:W,validatePort:validatePort,validateSignalName:validateSignalName,validateString:validateString,validateUint32:M,validateUndefined:Y,validateUnion:validateUnion,validateAbortSignal:z,validateLinkHeaderValue:validateLinkHeaderValue}},53862:(r,i,s)=>{"use strict";const{format:a,inspect:l,AggregateError:c}=s(63030);const d=globalThis.AggregateError||c;const p=Symbol("kIsNodeError");const u=["string","function","number","object","Function","Object","boolean","bigint","symbol"];const A=/^([A-Z][a-z0-9]*)+$/;const h="__node_internal_";const g={};function assert(r,i){if(!r){throw new g.ERR_INTERNAL_ASSERTION(i)}}function addNumericalSeparator(r){let i="";let s=r.length;const a=r[0]==="-"?1:0;for(;s>=a+4;s-=3){i=`_${r.slice(s-3,s)}${i}`}return`${r.slice(0,s)}${i}`}function getMessage(r,i,s){if(typeof i==="function"){assert(i.length<=s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${i.length}).`);return i(...s)}const l=(i.match(/%[dfijoOs]/g)||[]).length;assert(l===s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${l}).`);if(s.length===0){return i}return a(i,...s)}function E(r,i,s){if(!s){s=Error}class NodeError extends s{constructor(...s){super(getMessage(r,i,s))}toString(){return`${this.name} [${r}]: ${this.message}`}}Object.defineProperties(NodeError.prototype,{name:{value:s.name,writable:true,enumerable:false,configurable:true},toString:{value(){return`${this.name} [${r}]: ${this.message}`},writable:true,enumerable:false,configurable:true}});NodeError.prototype.code=r;NodeError.prototype[p]=true;g[r]=NodeError}function hideStackFrames(r){const i=h+r.name;Object.defineProperty(r,"name",{value:i});return r}function aggregateTwoErrors(r,i){if(r&&i&&r!==i){if(Array.isArray(i.errors)){i.errors.push(r);return i}const s=new d([i,r],i.message);s.code=i.code;return s}return r||i}class AbortError extends Error{constructor(r="The operation was aborted",i=undefined){if(i!==undefined&&typeof i!=="object"){throw new g.ERR_INVALID_ARG_TYPE("options","Object",i)}super(r,i);this.code="ABORT_ERR";this.name="AbortError"}}E("ERR_ASSERTION","%s",Error);E("ERR_INVALID_ARG_TYPE",((r,i,s)=>{assert(typeof r==="string","'name' must be a string");if(!Array.isArray(i)){i=[i]}let a="The ";if(r.endsWith(" argument")){a+=`${r} `}else{a+=`"${r}" ${r.includes(".")?"property":"argument"} `}a+="must be ";const c=[];const d=[];const p=[];for(const r of i){assert(typeof r==="string","All expected entries have to be of type string");if(u.includes(r)){c.push(r.toLowerCase())}else if(A.test(r)){d.push(r)}else{assert(r!=="object",'The value "object" should be written as "Object"');p.push(r)}}if(d.length>0){const r=c.indexOf("object");if(r!==-1){c.splice(c,r,1);d.push("Object")}}if(c.length>0){switch(c.length){case 1:a+=`of type ${c[0]}`;break;case 2:a+=`one of type ${c[0]} or ${c[1]}`;break;default:{const r=c.pop();a+=`one of type ${c.join(", ")}, or ${r}`}}if(d.length>0||p.length>0){a+=" or "}}if(d.length>0){switch(d.length){case 1:a+=`an instance of ${d[0]}`;break;case 2:a+=`an instance of ${d[0]} or ${d[1]}`;break;default:{const r=d.pop();a+=`an instance of ${d.join(", ")}, or ${r}`}}if(p.length>0){a+=" or "}}switch(p.length){case 0:break;case 1:if(p[0].toLowerCase()!==p[0]){a+="an "}a+=`${p[0]}`;break;case 2:a+=`one of ${p[0]} or ${p[1]}`;break;default:{const r=p.pop();a+=`one of ${p.join(", ")}, or ${r}`}}if(s==null){a+=`. Received ${s}`}else if(typeof s==="function"&&s.name){a+=`. Received function ${s.name}`}else if(typeof s==="object"){var h;if((h=s.constructor)!==null&&h!==undefined&&h.name){a+=`. Received an instance of ${s.constructor.name}`}else{const r=l(s,{depth:-1});a+=`. Received ${r}`}}else{let r=l(s,{colors:false});if(r.length>25){r=`${r.slice(0,25)}...`}a+=`. Received type ${typeof s} (${r})`}return a}),TypeError);E("ERR_INVALID_ARG_VALUE",((r,i,s="is invalid")=>{let a=l(i);if(a.length>128){a=a.slice(0,128)+"..."}const c=r.includes(".")?"property":"argument";return`The ${c} '${r}' ${s}. Received ${a}`}),TypeError);E("ERR_INVALID_RETURN_VALUE",((r,i,s)=>{var a;const l=s!==null&&s!==undefined&&(a=s.constructor)!==null&&a!==undefined&&a.name?`instance of ${s.constructor.name}`:`type ${typeof s}`;return`Expected ${r} to be returned from the "${i}"`+` function but got ${l}.`}),TypeError);E("ERR_MISSING_ARGS",((...r)=>{assert(r.length>0,"At least one arg needs to be specified");let i;const s=r.length;r=(Array.isArray(r)?r:[r]).map((r=>`"${r}"`)).join(" or ");switch(s){case 1:i+=`The ${r[0]} argument`;break;case 2:i+=`The ${r[0]} and ${r[1]} arguments`;break;default:{const s=r.pop();i+=`The ${r.join(", ")}, and ${s} arguments`}break}return`${i} must be specified`}),TypeError);E("ERR_OUT_OF_RANGE",((r,i,s)=>{assert(i,'Missing "range" argument');let a;if(Number.isInteger(s)&&Math.abs(s)>2**32){a=addNumericalSeparator(String(s))}else if(typeof s==="bigint"){a=String(s);if(s>2n**32n||s<-(2n**32n)){a=addNumericalSeparator(a)}a+="n"}else{a=l(s)}return`The value of "${r}" is out of range. It must be ${i}. Received ${a}`}),RangeError);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);E("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);E("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);E("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);E("ERR_STREAM_WRITE_AFTER_END","write after end",Error);E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);r.exports={AbortError:AbortError,aggregateTwoErrors:hideStackFrames(aggregateTwoErrors),hideStackFrames:hideStackFrames,codes:g}},78084:(r,i,s)=>{"use strict";const a=s(12781);if(a&&process.env.READABLE_STREAM==="disable"){const i=a.promises;r.exports._uint8ArrayToBuffer=a._uint8ArrayToBuffer;r.exports._isUint8Array=a._isUint8Array;r.exports.isDisturbed=a.isDisturbed;r.exports.isErrored=a.isErrored;r.exports.isReadable=a.isReadable;r.exports.Readable=a.Readable;r.exports.Writable=a.Writable;r.exports.Duplex=a.Duplex;r.exports.Transform=a.Transform;r.exports.PassThrough=a.PassThrough;r.exports.addAbortSignal=a.addAbortSignal;r.exports.finished=a.finished;r.exports.destroy=a.destroy;r.exports.pipeline=a.pipeline;r.exports.compose=a.compose;Object.defineProperty(a,"promises",{configurable:true,enumerable:true,get(){return i}});r.exports.Stream=a.Stream}else{const i=s(19497);const a=s(54649);const l=i.Readable.destroy;r.exports=i.Readable;r.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer;r.exports._isUint8Array=i._isUint8Array;r.exports.isDisturbed=i.isDisturbed;r.exports.isErrored=i.isErrored;r.exports.isReadable=i.isReadable;r.exports.Readable=i.Readable;r.exports.Writable=i.Writable;r.exports.Duplex=i.Duplex;r.exports.Transform=i.Transform;r.exports.PassThrough=i.PassThrough;r.exports.addAbortSignal=i.addAbortSignal;r.exports.finished=i.finished;r.exports.destroy=i.destroy;r.exports.destroy=l;r.exports.pipeline=i.pipeline;r.exports.compose=i.compose;Object.defineProperty(i,"promises",{configurable:true,enumerable:true,get(){return a}});r.exports.Stream=i.Stream}r.exports["default"]=r.exports},91495:r=>{"use strict";r.exports={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,i){return r.includes(i)},ArrayPrototypeIndexOf(r,i){return r.indexOf(i)},ArrayPrototypeJoin(r,i){return r.join(i)},ArrayPrototypeMap(r,i){return r.map(i)},ArrayPrototypePop(r,i){return r.pop(i)},ArrayPrototypePush(r,i){return r.push(i)},ArrayPrototypeSlice(r,i,s){return r.slice(i,s)},Error:Error,FunctionPrototypeCall(r,i,...s){return r.call(i,...s)},FunctionPrototypeSymbolHasInstance(r,i){return Function.prototype[Symbol.hasInstance].call(r,i)},MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,i){return Object.defineProperties(r,i)},ObjectDefineProperty(r,i,s){return Object.defineProperty(r,i,s)},ObjectGetOwnPropertyDescriptor(r,i){return Object.getOwnPropertyDescriptor(r,i)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,i){return Object.setPrototypeOf(r,i)},Promise:Promise,PromisePrototypeCatch(r,i){return r.catch(i)},PromisePrototypeThen(r,i,s){return r.then(i,s)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,i){return r.test(i)},SafeSet:Set,String:String,StringPrototypeSlice(r,i,s){return r.slice(i,s)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,i,s){return r.set(i,s)},Boolean:Boolean,Uint8Array:Uint8Array}},63030:(r,i,s)=>{"use strict";const a=s(14300);const{kResistStopPropagation:l,SymbolDispose:c}=s(91495);const d=globalThis.AbortSignal||s(24995).AbortSignal;const p=globalThis.AbortController||s(24995).AbortController;const u=Object.getPrototypeOf((async function(){})).constructor;const A=globalThis.Blob||a.Blob;const h=typeof A!=="undefined"?function isBlob(r){return r instanceof A}:function isBlob(r){return false};const validateAbortSignal=(r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new ERR_INVALID_ARG_TYPE(i,"AbortSignal",r)}};const validateFunction=(r,i)=>{if(typeof r!=="function")throw new ERR_INVALID_ARG_TYPE(i,"Function",r)};class AggregateError extends Error{constructor(r){if(!Array.isArray(r)){throw new TypeError(`Expected input to be an Array, got ${typeof r}`)}let i="";for(let s=0;s{r=s;i=a}));return{promise:s,resolve:r,reject:i}},promisify(r){return new Promise(((i,s)=>{r(((r,...a)=>{if(r){return s(r)}return i(...a)}))}))},debuglog(){return function(){}},format(r,...i){return r.replace(/%([sdifj])/g,(function(...[r,s]){const a=i.shift();if(s==="f"){return a.toFixed(6)}else if(s==="j"){return JSON.stringify(a)}else if(s==="s"&&typeof a==="object"){const r=a.constructor!==Object?a.constructor.name:"";return`${r} {}`.trim()}else{return a.toString()}}))},inspect(r){switch(typeof r){case"string":if(r.includes("'")){if(!r.includes('"')){return`"${r}"`}else if(!r.includes("`")&&!r.includes("${")){return`\`${r}\``}}return`'${r}'`;case"number":if(isNaN(r)){return"NaN"}else if(Object.is(r,-0)){return String(r)}return r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}},types:{isAsyncFunction(r){return r instanceof u},isArrayBufferView(r){return ArrayBuffer.isView(r)}},isBlob:h,deprecate(r,i){return r},addAbortListener:s(82361).addAbortListener||function addAbortListener(r,i){if(r===undefined){throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",r)}validateAbortSignal(r,"signal");validateFunction(i,"listener");let s;if(r.aborted){queueMicrotask((()=>i()))}else{r.addEventListener("abort",i,{__proto__:null,once:true,[l]:true});s=()=>{r.removeEventListener("abort",i)}}return{__proto__:null,[c](){var r;(r=s)===null||r===undefined?undefined:r()}}},AbortSignalAny:d.any||function AbortSignalAny(r){if(r.length===1){return r[0]}const i=new p;const abort=()=>i.abort();r.forEach((r=>{validateAbortSignal(r,"signals");r.addEventListener("abort",abort,{once:true})}));i.signal.addEventListener("abort",(()=>{r.forEach((r=>r.removeEventListener("abort",abort)))}),{once:true});return i.signal}};r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},19497:(r,i,s)=>{const{Buffer:a}=s(14300);"use strict";const{ObjectDefineProperty:l,ObjectKeys:c,ReflectApply:d}=s(91495);const{promisify:{custom:p}}=s(63030);const{streamReturningOperators:u,promiseReturningOperators:A}=s(40526);const{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=s(53862);const g=s(82648);const{setDefaultHighWaterMark:y,getDefaultHighWaterMark:b}=s(2261);const{pipeline:w}=s(64073);const{destroyer:C}=s(28050);const v=s(1475);const I={};const B=s(54649);const S=s(48229);const x=r.exports=s(57369).Stream;x.isDestroyed=S.isDestroyed;x.isDisturbed=S.isDisturbed;x.isErrored=S.isErrored;x.isReadable=S.isReadable;x.isWritable=S.isWritable;x.Readable=s(40952);for(const Q of c(u)){const _=u[Q];function fn(...r){if(new.target){throw h()}return x.Readable.from(d(_,this,r))}l(fn,"name",{__proto__:null,value:_.name});l(fn,"length",{__proto__:null,value:_.length});l(x.Readable.prototype,Q,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}for(const N of c(A)){const T=A[N];function fn(...r){if(new.target){throw h()}return d(T,this,r)}l(fn,"name",{__proto__:null,value:T.name});l(fn,"length",{__proto__:null,value:T.length});l(x.Readable.prototype,N,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}x.Writable=s(70274);x.Duplex=s(99215);x.Transform=s(83417);x.PassThrough=s(29477);x.pipeline=w;const{addAbortSignal:R}=s(48624);x.addAbortSignal=R;x.finished=v;x.destroy=C;x.compose=g;x.setDefaultHighWaterMark=y;x.getDefaultHighWaterMark=b;l(x,"promises",{__proto__:null,configurable:true,enumerable:true,get(){return B}});l(w,p,{__proto__:null,enumerable:true,get(){return B.pipeline}});l(v,p,{__proto__:null,enumerable:true,get(){return B.finished}});x.Stream=x;x._isUint8Array=function isUint8Array(r){return r instanceof Uint8Array};x._uint8ArrayToBuffer=function _uint8ArrayToBuffer(r){return a.from(r.buffer,r.byteOffset,r.byteLength)}},54649:(r,i,s)=>{"use strict";const{ArrayPrototypePop:a,Promise:l}=s(91495);const{isIterable:c,isNodeStream:d,isWebStream:p}=s(48229);const{pipelineImpl:u}=s(64073);const{finished:A}=s(1475);s(19497);function pipeline(...r){return new l(((i,s)=>{let l;let A;const h=r[r.length-1];if(h&&typeof h==="object"&&!d(h)&&!c(h)&&!p(h)){const i=a(r);l=i.signal;A=i.end}u(r,((r,a)=>{if(r){s(r)}else{i(a)}}),{signal:l,end:A})}))}r.exports={finished:A,pipeline:pipeline}},98955:r=>{r.exports=function(r,s){var a=[];for(var l=0;l{function isArray(r){if(Array.isArray){return Array.isArray(r)}return objectToString(r)==="[object Array]"}i.isArray=isArray;function isBoolean(r){return typeof r==="boolean"}i.isBoolean=isBoolean;function isNull(r){return r===null}i.isNull=isNull;function isNullOrUndefined(r){return r==null}i.isNullOrUndefined=isNullOrUndefined;function isNumber(r){return typeof r==="number"}i.isNumber=isNumber;function isString(r){return typeof r==="string"}i.isString=isString;function isSymbol(r){return typeof r==="symbol"}i.isSymbol=isSymbol;function isUndefined(r){return r===void 0}i.isUndefined=isUndefined;function isRegExp(r){return objectToString(r)==="[object RegExp]"}i.isRegExp=isRegExp;function isObject(r){return typeof r==="object"&&r!==null}i.isObject=isObject;function isDate(r){return objectToString(r)==="[object Date]"}i.isDate=isDate;function isError(r){return objectToString(r)==="[object Error]"||r instanceof Error}i.isError=isError;function isFunction(r){return typeof r==="function"}i.isFunction=isFunction;function isPrimitive(r){return r===null||typeof r==="boolean"||typeof r==="number"||typeof r==="string"||typeof r==="symbol"||typeof r==="undefined"}i.isPrimitive=isPrimitive;i.isBuffer=s(14300).Buffer.isBuffer;function objectToString(r){return Object.prototype.toString.call(r)}},61813:(r,i)=>{ /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ -var a;(function(r){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if(true){r(i)}else{}}else{r(a={})}})((function(r){r.version="1.2.2";function signed_crc_table(){var r=0,i=new Array(256);for(var a=0;a!=256;++a){r=a;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;i[a]=r}return typeof Int32Array!=="undefined"?new Int32Array(i):i}var i=signed_crc_table();function slice_by_16_tables(r){var i=0,a=0,s=0,l=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(s=0;s!=256;++s)l[s]=r[s];for(s=0;s!=256;++s){a=r[s];for(i=256+s;i<4096;i+=256)a=l[i]=a>>>8^r[a&255]}var c=[];for(s=1;s!=16;++s)c[s-1]=typeof Int32Array!=="undefined"?l.subarray(s*256,s*256+256):l.slice(s*256,s*256+256);return c}var a=slice_by_16_tables(i);var s=a[0],l=a[1],c=a[2],p=a[3],d=a[4];var u=a[5],A=a[6],h=a[7],g=a[8],y=a[9];var E=a[10],b=a[11],C=a[12],v=a[13],B=a[14];function crc32_bstr(r,a){var s=a^-1;for(var l=0,c=r.length;l>>8^i[(s^r.charCodeAt(l++))&255];return~s}function crc32_buf(r,a){var I=a^-1,w=r.length-15,S=0;for(;S>8&255]^C[r[S++]^I>>16&255]^b[r[S++]^I>>>24]^E[r[S++]]^y[r[S++]]^g[r[S++]]^h[r[S++]]^A[r[S++]]^u[r[S++]]^d[r[S++]]^p[r[S++]]^c[r[S++]]^l[r[S++]]^s[r[S++]]^i[r[S++]];w+=15;while(S>>8^i[(I^r[S++])&255];return~I}function crc32_str(r,a){var s=a^-1;for(var l=0,c=r.length,p=0,d=0;l>>8^i[(s^p)&255]}else if(p<2048){s=s>>>8^i[(s^(192|p>>6&31))&255];s=s>>>8^i[(s^(128|p&63))&255]}else if(p>=55296&&p<57344){p=(p&1023)+64;d=r.charCodeAt(l++)&1023;s=s>>>8^i[(s^(240|p>>8&7))&255];s=s>>>8^i[(s^(128|p>>2&63))&255];s=s>>>8^i[(s^(128|d>>6&15|(p&3)<<4))&255];s=s>>>8^i[(s^(128|d&63))&255]}else{s=s>>>8^i[(s^(224|p>>12&15))&255];s=s>>>8^i[(s^(128|p>>6&63))&255];s=s>>>8^i[(s^(128|p&63))&255]}}return~s}r.table=i;r.bstr=crc32_bstr;r.buf=crc32_buf;r.str=crc32_str}))},38782:(r,i,a)=>{"use strict";const{Transform:s}=a(19173);const l=a(61813);class CRC32Stream extends s{constructor(r){super(r);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0}_transform(r,i,a){if(r){this.checksum=l.buf(r,this.checksum)>>>0;this.rawSize+=r.length}a(null,r)}digest(r){const i=Buffer.allocUnsafe(4);i.writeUInt32BE(this.checksum>>>0,0);return r?i.toString(r):i}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}}r.exports=CRC32Stream},50968:(r,i,a)=>{"use strict";const{DeflateRaw:s}=a(59796);const l=a(61813);class DeflateCRC32Stream extends s{constructor(r){super(r);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0;this.compressedSize=0}push(r,i){if(r){this.compressedSize+=r.length}return super.push(r,i)}_transform(r,i,a){if(r){this.checksum=l.buf(r,this.checksum)>>>0;this.rawSize+=r.length}super._transform(r,i,a)}digest(r){const i=Buffer.allocUnsafe(4);i.writeUInt32BE(this.checksum>>>0,0);return r?i.toString(r):i}hex(){return this.digest("hex").toUpperCase()}size(r=false){if(r){return this.compressedSize}else{return this.rawSize}}}r.exports=DeflateCRC32Stream},25547:(r,i,a)=>{"use strict";r.exports={CRC32Stream:a(38782),DeflateCRC32Stream:a(50968)}},83908:(r,i,a)=>{var s=a(12781).Stream;var l=a(73837);r.exports=DelayedStream;function DelayedStream(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}l.inherits(DelayedStream,s);DelayedStream.create=function(r,i){var a=new this;i=i||{};for(var s in i){a[s]=i[s]}a.source=r;var l=r.emit;r.emit=function(){a._handleEmit(arguments);return l.apply(r,arguments)};r.on("error",(function(){}));if(a.pauseStream){r.pause()}return a};Object.defineProperty(DelayedStream.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});DelayedStream.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};DelayedStream.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};DelayedStream.prototype.pause=function(){this.source.pause()};DelayedStream.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(r){this.emit.apply(this,r)}.bind(this));this._bufferedEvents=[]};DelayedStream.prototype.pipe=function(){var r=s.prototype.pipe.apply(this,arguments);this.resume();return r};DelayedStream.prototype._handleEmit=function(r){if(this._released){this.emit.apply(this,r);return}if(r[0]==="data"){this.dataSize+=r[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(r)};DelayedStream.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var r="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(r))}},33383:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});class Deprecation extends Error{constructor(r){super(r);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="Deprecation"}}i.Deprecation=Deprecation},29690:r=>{"use strict";function _process(r,i){var a;var s;if(typeof i==="function"){s=i(r);if(s!==undefined){r=s}}else if(Array.isArray(i)){for(a=0;a=0){r=r.replace(/\[/g,i).replace(/]/g,"")}var a=r.split(i);var s=a.filter(blacklistFilter);if(s.length!==a.length){throw Error("Refusing to update blacklisted property "+r)}return a}var a=Object.prototype.hasOwnProperty;function DotObject(r,i,a,s){if(!(this instanceof DotObject)){return new DotObject(r,i,a,s)}if(typeof i==="undefined")i=false;if(typeof a==="undefined")a=true;if(typeof s==="undefined")s=true;this.separator=r||".";this.override=i;this.useArray=a;this.useBrackets=s;this.keepArray=false;this.cleanup=[]}var s=new DotObject(".",false,true,true);function wrap(r){return function(){return s[r].apply(s,arguments)}}DotObject.prototype._fill=function(r,i,a,s){var l=r.shift();if(r.length>0){i[l]=i[l]||(this.useArray&&isIndex(r[0])?[]:{});if(!isArrayOrObject(i[l])){if(this.override){i[l]={}}else{if(!(isArrayOrObject(a)&&isEmptyObject(a))){throw new Error("Trying to redefine `"+l+"` which is a "+typeof i[l])}return}}this._fill(r,i[l],a,s)}else{if(!this.override&&isArrayOrObject(i[l])&&!isEmptyObject(i[l])){if(!(isArrayOrObject(a)&&isEmptyObject(a))){throw new Error("Trying to redefine non-empty obj['"+l+"']")}return}i[l]=_process(a,s)}};DotObject.prototype.object=function(r,i){var a=this;Object.keys(r).forEach((function(s){var l=i===undefined?null:i[s];var c=parsePath(s,a.separator).join(a.separator);if(c.indexOf(a.separator)!==-1){a._fill(c.split(a.separator),r,r[s],l);delete r[s]}else{r[s]=_process(r[s],l)}}));return r};DotObject.prototype.str=function(r,i,a,s){var l=parsePath(r,this.separator).join(this.separator);if(r.indexOf(this.separator)!==-1){this._fill(l.split(this.separator),a,i,s)}else{a[r]=_process(i,s)}return a};DotObject.prototype.pick=function(r,i,a,s){var l;var c;var p;var d;var u;c=parsePath(r,this.separator);for(l=0;l{var s=a(28995);var noop=function(){};var isRequest=function(r){return r.setHeader&&typeof r.abort==="function"};var isChildProcess=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3};var eos=function(r,i,a){if(typeof i==="function")return eos(r,null,i);if(!i)i={};a=s(a||noop);var l=r._writableState;var c=r._readableState;var p=i.readable||i.readable!==false&&r.readable;var d=i.writable||i.writable!==false&&r.writable;var u=false;var onlegacyfinish=function(){if(!r.writable)onfinish()};var onfinish=function(){d=false;if(!p)a.call(r)};var onend=function(){p=false;if(!d)a.call(r)};var onexit=function(i){a.call(r,i?new Error("exited with error code: "+i):null)};var onerror=function(i){a.call(r,i)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(u)return;if(p&&!(c&&(c.ended&&!c.destroyed)))return a.call(r,new Error("premature close"));if(d&&!(l&&(l.ended&&!l.destroyed)))return a.call(r,new Error("premature close"))};var onrequest=function(){r.req.on("finish",onfinish)};if(isRequest(r)){r.on("complete",onfinish);r.on("abort",onclose);if(r.req)onrequest();else r.on("request",onrequest)}else if(d&&!l){r.on("end",onlegacyfinish);r.on("close",onlegacyfinish)}if(isChildProcess(r))r.on("exit",onexit);r.on("end",onend);r.on("finish",onfinish);if(i.error!==false)r.on("error",onerror);r.on("close",onclose);return function(){u=true;r.removeListener("complete",onfinish);r.removeListener("abort",onclose);r.removeListener("request",onrequest);if(r.req)r.req.removeListener("finish",onfinish);r.removeListener("end",onlegacyfinish);r.removeListener("close",onlegacyfinish);r.removeListener("finish",onfinish);r.removeListener("exit",onexit);r.removeListener("end",onend);r.removeListener("error",onerror);r.removeListener("close",onclose)}};r.exports=eos},97010:(r,i,a)=>{var s=a(36835);var l=a(73837);var c=a(71017);var p=a(13685);var d=a(95687);var u=a(57310).parse;var A=a(57147);var h=a(12781).Stream;var g=a(57567);var y=a(55633);var E=a(56532);r.exports=FormData;l.inherits(FormData,s);function FormData(r){if(!(this instanceof FormData)){return new FormData(r)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];s.call(this);r=r||{};for(var i in r){this[i]=r[i]}}FormData.LINE_BREAK="\r\n";FormData.DEFAULT_CONTENT_TYPE="application/octet-stream";FormData.prototype.append=function(r,i,a){a=a||{};if(typeof a=="string"){a={filename:a}}var c=s.prototype.append.bind(this);if(typeof i=="number"){i=""+i}if(l.isArray(i)){this._error(new Error("Arrays are not supported."));return}var p=this._multiPartHeader(r,i,a);var d=this._multiPartFooter();c(p);c(i);c(d);this._trackLength(p,i,a)};FormData.prototype._trackLength=function(r,i,a){var s=0;if(a.knownLength!=null){s+=+a.knownLength}else if(Buffer.isBuffer(i)){s=i.length}else if(typeof i==="string"){s=Buffer.byteLength(i)}this._valueLength+=s;this._overheadLength+=Buffer.byteLength(r)+FormData.LINE_BREAK.length;if(!i||!i.path&&!(i.readable&&i.hasOwnProperty("httpVersion"))&&!(i instanceof h)){return}if(!a.knownLength){this._valuesToMeasure.push(i)}};FormData.prototype._lengthRetriever=function(r,i){if(r.hasOwnProperty("fd")){if(r.end!=undefined&&r.end!=Infinity&&r.start!=undefined){i(null,r.end+1-(r.start?r.start:0))}else{A.stat(r.path,(function(a,s){var l;if(a){i(a);return}l=s.size-(r.start?r.start:0);i(null,l)}))}}else if(r.hasOwnProperty("httpVersion")){i(null,+r.headers["content-length"])}else if(r.hasOwnProperty("httpModule")){r.on("response",(function(a){r.pause();i(null,+a.headers["content-length"])}));r.resume()}else{i("Unknown stream")}};FormData.prototype._multiPartHeader=function(r,i,a){if(typeof a.header=="string"){return a.header}var s=this._getContentDisposition(i,a);var l=this._getContentType(i,a);var c="";var p={"Content-Disposition":["form-data",'name="'+r+'"'].concat(s||[]),"Content-Type":[].concat(l||[])};if(typeof a.header=="object"){E(p,a.header)}var d;for(var u in p){if(!p.hasOwnProperty(u))continue;d=p[u];if(d==null){continue}if(!Array.isArray(d)){d=[d]}if(d.length){c+=u+": "+d.join("; ")+FormData.LINE_BREAK}}return"--"+this.getBoundary()+FormData.LINE_BREAK+c+FormData.LINE_BREAK};FormData.prototype._getContentDisposition=function(r,i){var a,s;if(typeof i.filepath==="string"){a=c.normalize(i.filepath).replace(/\\/g,"/")}else if(i.filename||r.name||r.path){a=c.basename(i.filename||r.name||r.path)}else if(r.readable&&r.hasOwnProperty("httpVersion")){a=c.basename(r.client._httpMessage.path||"")}if(a){s='filename="'+a+'"'}return s};FormData.prototype._getContentType=function(r,i){var a=i.contentType;if(!a&&r.name){a=g.lookup(r.name)}if(!a&&r.path){a=g.lookup(r.path)}if(!a&&r.readable&&r.hasOwnProperty("httpVersion")){a=r.headers["content-type"]}if(!a&&(i.filepath||i.filename)){a=g.lookup(i.filepath||i.filename)}if(!a&&typeof r=="object"){a=FormData.DEFAULT_CONTENT_TYPE}return a};FormData.prototype._multiPartFooter=function(){return function(r){var i=FormData.LINE_BREAK;var a=this._streams.length===0;if(a){i+=this._lastBoundary()}r(i)}.bind(this)};FormData.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+FormData.LINE_BREAK};FormData.prototype.getHeaders=function(r){var i;var a={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(i in r){if(r.hasOwnProperty(i)){a[i.toLowerCase()]=r[i]}}return a};FormData.prototype.setBoundary=function(r){this._boundary=r};FormData.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};FormData.prototype.getBuffer=function(){var r=new Buffer.alloc(0);var i=this.getBoundary();for(var a=0,s=this._streams.length;a{r.exports=function(r,i){Object.keys(i).forEach((function(a){r[a]=r[a]||i[a]}));return r}},9741:(r,i,a)=>{r.exports=a(57147).constants||a(22057)},1235:(r,i,a)=>{r.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var s=a(57147);var l=s.realpath;var c=s.realpathSync;var p=process.version;var d=/^v[0-5]\./.test(p);var u=a(92672);function newError(r){return r&&r.syscall==="realpath"&&(r.code==="ELOOP"||r.code==="ENOMEM"||r.code==="ENAMETOOLONG")}function realpath(r,i,a){if(d){return l(r,i,a)}if(typeof i==="function"){a=i;i=null}l(r,i,(function(s,l){if(newError(s)){u.realpath(r,i,a)}else{a(s,l)}}))}function realpathSync(r,i){if(d){return c(r,i)}try{return c(r,i)}catch(a){if(newError(a)){return u.realpathSync(r,i)}else{throw a}}}function monkeypatch(){s.realpath=realpath;s.realpathSync=realpathSync}function unmonkeypatch(){s.realpath=l;s.realpathSync=c}},92672:(r,i,a)=>{var s=a(71017);var l=process.platform==="win32";var c=a(57147);var p=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var r;if(p){var i=new Error;r=debugCallback}else r=missingCallback;return r;function debugCallback(r){if(r){i.message=r.message;r=i;missingCallback(r)}}function missingCallback(r){if(r){if(process.throwDeprecation)throw r;else if(!process.noDeprecation){var i="fs: missing callback "+(r.stack||r.message);if(process.traceDeprecation)console.trace(i);else console.error(i)}}}}function maybeCallback(r){return typeof r==="function"?r:rethrow()}var d=s.normalize;if(l){var u=/(.*?)(?:[\/\\]+|$)/g}else{var u=/(.*?)(?:[\/]+|$)/g}if(l){var A=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var A=/^[\/]*/}i.realpathSync=function realpathSync(r,i){r=s.resolve(r);if(i&&Object.prototype.hasOwnProperty.call(i,r)){return i[r]}var a=r,p={},d={};var h;var g;var y;var E;start();function start(){var i=A.exec(r);h=i[0].length;g=i[0];y=i[0];E="";if(l&&!d[y]){c.lstatSync(y);d[y]=true}}while(h=r.length){if(i)i[p]=r;return a(null,r)}u.lastIndex=g;var s=u.exec(r);b=y;y+=s[0];E=b+s[1];g=u.lastIndex;if(h[E]||i&&i[E]===E){return process.nextTick(LOOP)}if(i&&Object.prototype.hasOwnProperty.call(i,E)){return gotResolvedLink(i[E])}return c.lstat(E,gotStat)}function gotStat(r,s){if(r)return a(r);if(!s.isSymbolicLink()){h[E]=true;if(i)i[E]=E;return process.nextTick(LOOP)}if(!l){var p=s.dev.toString(32)+":"+s.ino.toString(32);if(d.hasOwnProperty(p)){return gotTarget(null,d[p],E)}}c.stat(E,(function(r){if(r)return a(r);c.readlink(E,(function(r,i){if(!l)d[p]=i;gotTarget(r,i)}))}))}function gotTarget(r,l,c){if(r)return a(r);var p=s.resolve(b,l);if(i)i[c]=p;gotResolvedLink(p)}function gotResolvedLink(i){r=s.resolve(i,r.slice(g));start()}}},76083:(r,i,a)=>{i.setopts=setopts;i.ownProp=ownProp;i.makeAbs=makeAbs;i.finish=finish;i.mark=mark;i.isIgnored=isIgnored;i.childrenIgnored=childrenIgnored;function ownProp(r,i){return Object.prototype.hasOwnProperty.call(r,i)}var s=a(57147);var l=a(71017);var c=a(94193);var p=a(65964);var d=c.Minimatch;function alphasort(r,i){return r.localeCompare(i,"en")}function setupIgnores(r,i){r.ignore=i.ignore||[];if(!Array.isArray(r.ignore))r.ignore=[r.ignore];if(r.ignore.length){r.ignore=r.ignore.map(ignoreMap)}}function ignoreMap(r){var i=null;if(r.slice(-3)==="/**"){var a=r.replace(/(\/\*\*)+$/,"");i=new d(a,{dot:true})}return{matcher:new d(r,{dot:true}),gmatcher:i}}function setopts(r,i,a){if(!a)a={};if(a.matchBase&&-1===i.indexOf("/")){if(a.noglobstar){throw new Error("base matching requires globstar")}i="**/"+i}r.silent=!!a.silent;r.pattern=i;r.strict=a.strict!==false;r.realpath=!!a.realpath;r.realpathCache=a.realpathCache||Object.create(null);r.follow=!!a.follow;r.dot=!!a.dot;r.mark=!!a.mark;r.nodir=!!a.nodir;if(r.nodir)r.mark=true;r.sync=!!a.sync;r.nounique=!!a.nounique;r.nonull=!!a.nonull;r.nosort=!!a.nosort;r.nocase=!!a.nocase;r.stat=!!a.stat;r.noprocess=!!a.noprocess;r.absolute=!!a.absolute;r.fs=a.fs||s;r.maxLength=a.maxLength||Infinity;r.cache=a.cache||Object.create(null);r.statCache=a.statCache||Object.create(null);r.symlinks=a.symlinks||Object.create(null);setupIgnores(r,a);r.changedCwd=false;var c=process.cwd();if(!ownProp(a,"cwd"))r.cwd=c;else{r.cwd=l.resolve(a.cwd);r.changedCwd=r.cwd!==c}r.root=a.root||l.resolve(r.cwd,"/");r.root=l.resolve(r.root);if(process.platform==="win32")r.root=r.root.replace(/\\/g,"/");r.cwdAbs=p(r.cwd)?r.cwd:makeAbs(r,r.cwd);if(process.platform==="win32")r.cwdAbs=r.cwdAbs.replace(/\\/g,"/");r.nomount=!!a.nomount;a.nonegate=true;a.nocomment=true;a.allowWindowsEscape=false;r.minimatch=new d(i,a);r.options=r.minimatch.options}function finish(r){var i=r.nounique;var a=i?[]:Object.create(null);for(var s=0,l=r.matches.length;s{r.exports=glob;var s=a(1235);var l=a(94193);var c=l.Minimatch;var p=a(55806);var d=a(82361).EventEmitter;var u=a(71017);var A=a(39491);var h=a(65964);var g=a(41113);var y=a(76083);var E=y.setopts;var b=y.ownProp;var C=a(47834);var v=a(73837);var B=y.childrenIgnored;var I=y.isIgnored;var w=a(28995);function glob(r,i,a){if(typeof i==="function")a=i,i={};if(!i)i={};if(i.sync){if(a)throw new TypeError("callback provided to sync glob");return g(r,i)}return new Glob(r,i,a)}glob.sync=g;var S=glob.GlobSync=g.GlobSync;glob.glob=glob;function extend(r,i){if(i===null||typeof i!=="object"){return r}var a=Object.keys(i);var s=a.length;while(s--){r[a[s]]=i[a[s]]}return r}glob.hasMagic=function(r,i){var a=extend({},i);a.noprocess=true;var s=new Glob(r,a);var l=s.minimatch.set;if(!r)return false;if(l.length>1)return true;for(var c=0;cthis.maxLength)return i();if(!this.stat&&b(this.cache,a)){var l=this.cache[a];if(Array.isArray(l))l="DIR";if(!s||l==="DIR")return i(null,l);if(s&&l==="FILE")return i()}var c;var p=this.statCache[a];if(p!==undefined){if(p===false)return i(null,p);else{var d=p.isDirectory()?"DIR":"FILE";if(s&&d==="FILE")return i();else return i(null,d,p)}}var u=this;var A=C("stat\0"+a,lstatcb_);if(A)u.fs.lstat(a,A);function lstatcb_(s,l){if(l&&l.isSymbolicLink()){return u.fs.stat(a,(function(s,c){if(s)u._stat2(r,a,null,l,i);else u._stat2(r,a,s,c,i)}))}else{u._stat2(r,a,s,l,i)}}};Glob.prototype._stat2=function(r,i,a,s,l){if(a&&(a.code==="ENOENT"||a.code==="ENOTDIR")){this.statCache[i]=false;return l()}var c=r.slice(-1)==="/";this.statCache[i]=s;if(i.slice(-1)==="/"&&s&&!s.isDirectory())return l(null,false,s);var p=true;if(s)p=s.isDirectory()?"DIR":"FILE";this.cache[i]=this.cache[i]||p;if(c&&p==="FILE")return l();return l(null,p,s)}},41113:(r,i,a)=>{r.exports=globSync;globSync.GlobSync=GlobSync;var s=a(1235);var l=a(94193);var c=l.Minimatch;var p=a(81201).Glob;var d=a(73837);var u=a(71017);var A=a(39491);var h=a(65964);var g=a(76083);var y=g.setopts;var E=g.ownProp;var b=g.childrenIgnored;var C=g.isIgnored;function globSync(r,i){if(typeof i==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(r,i).found}function GlobSync(r,i){if(!r)throw new Error("must provide pattern");if(typeof i==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(r,i);y(this,r,i);if(this.noprocess)return this;var a=this.minimatch.set.length;this.matches=new Array(a);for(var s=0;sthis.maxLength)return false;if(!this.stat&&E(this.cache,i)){var s=this.cache[i];if(Array.isArray(s))s="DIR";if(!a||s==="DIR")return s;if(a&&s==="FILE")return false}var l;var c=this.statCache[i];if(!c){var p;try{p=this.fs.lstatSync(i)}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[i]=false;return false}}if(p&&p.isSymbolicLink()){try{c=this.fs.statSync(i)}catch(r){c=p}}else{c=p}}this.statCache[i]=c;var s=true;if(c)s=c.isDirectory()?"DIR":"FILE";this.cache[i]=this.cache[i]||s;if(a&&s==="FILE")return false;return s};GlobSync.prototype._mark=function(r){return g.mark(this,r)};GlobSync.prototype._makeAbs=function(r){return g.makeAbs(this,r)}},53349:r=>{"use strict";r.exports=clone;var i=Object.getPrototypeOf||function(r){return r.__proto__};function clone(r){if(r===null||typeof r!=="object")return r;if(r instanceof Object)var a={__proto__:i(r)};else var a=Object.create(null);Object.getOwnPropertyNames(r).forEach((function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(r,i))}));return a}},1692:(r,i,a)=>{var s=a(57147);var l=a(24913);var c=a(83830);var p=a(53349);var d=a(73837);var u;var A;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){u=Symbol.for("graceful-fs.queue");A=Symbol.for("graceful-fs.previous")}else{u="___graceful-fs.queue";A="___graceful-fs.previous"}function noop(){}function publishQueue(r,i){Object.defineProperty(r,u,{get:function(){return i}})}var h=noop;if(d.debuglog)h=d.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))h=function(){var r=d.format.apply(d,arguments);r="GFS4: "+r.split(/\n/).join("\nGFS4: ");console.error(r)};if(!s[u]){var g=global[u]||[];publishQueue(s,g);s.close=function(r){function close(i,a){return r.call(s,i,(function(r){if(!r){resetQueue()}if(typeof a==="function")a.apply(this,arguments)}))}Object.defineProperty(close,A,{value:r});return close}(s.close);s.closeSync=function(r){function closeSync(i){r.apply(s,arguments);resetQueue()}Object.defineProperty(closeSync,A,{value:r});return closeSync}(s.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){h(s[u]);a(39491).equal(s[u].length,0)}))}}if(!global[u]){publishQueue(global,s[u])}r.exports=patch(p(s));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched){r.exports=patch(s);s.__patched=true}function patch(r){l(r);r.gracefulify=patch;r.createReadStream=createReadStream;r.createWriteStream=createWriteStream;var i=r.readFile;r.readFile=readFile;function readFile(r,a,s){if(typeof a==="function")s=a,a=null;return go$readFile(r,a,s);function go$readFile(r,a,s,l){return i(r,a,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$readFile,[r,a,s],i,l||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var a=r.writeFile;r.writeFile=writeFile;function writeFile(r,i,s,l){if(typeof s==="function")l=s,s=null;return go$writeFile(r,i,s,l);function go$writeFile(r,i,s,l,c){return a(r,i,s,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$writeFile,[r,i,s,l],a,c||Date.now(),Date.now()]);else{if(typeof l==="function")l.apply(this,arguments)}}))}}var s=r.appendFile;if(s)r.appendFile=appendFile;function appendFile(r,i,a,l){if(typeof a==="function")l=a,a=null;return go$appendFile(r,i,a,l);function go$appendFile(r,i,a,l,c){return s(r,i,a,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$appendFile,[r,i,a,l],s,c||Date.now(),Date.now()]);else{if(typeof l==="function")l.apply(this,arguments)}}))}}var p=r.copyFile;if(p)r.copyFile=copyFile;function copyFile(r,i,a,s){if(typeof a==="function"){s=a;a=0}return go$copyFile(r,i,a,s);function go$copyFile(r,i,a,s,l){return p(r,i,a,(function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$copyFile,[r,i,a,s],c,l||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var d=r.readdir;r.readdir=readdir;var u=/^v[0-5]\./;function readdir(r,i,a){if(typeof i==="function")a=i,i=null;var s=u.test(process.version)?function go$readdir(r,i,a,s){return d(r,fs$readdirCallback(r,i,a,s))}:function go$readdir(r,i,a,s){return d(r,i,fs$readdirCallback(r,i,a,s))};return s(r,i,a);function fs$readdirCallback(r,i,a,l){return function(c,p){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([s,[r,i,a],c,l||Date.now(),Date.now()]);else{if(p&&p.sort)p.sort();if(typeof a==="function")a.call(this,c,p)}}}}if(process.version.substr(0,4)==="v0.8"){var A=c(r);ReadStream=A.ReadStream;WriteStream=A.WriteStream}var h=r.ReadStream;if(h){ReadStream.prototype=Object.create(h.prototype);ReadStream.prototype.open=ReadStream$open}var g=r.WriteStream;if(g){WriteStream.prototype=Object.create(g.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(r,"ReadStream",{get:function(){return ReadStream},set:function(r){ReadStream=r},enumerable:true,configurable:true});Object.defineProperty(r,"WriteStream",{get:function(){return WriteStream},set:function(r){WriteStream=r},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(r,"FileReadStream",{get:function(){return y},set:function(r){y=r},enumerable:true,configurable:true});var E=WriteStream;Object.defineProperty(r,"FileWriteStream",{get:function(){return E},set:function(r){E=r},enumerable:true,configurable:true});function ReadStream(r,i){if(this instanceof ReadStream)return h.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var r=this;open(r.path,r.flags,r.mode,(function(i,a){if(i){if(r.autoClose)r.destroy();r.emit("error",i)}else{r.fd=a;r.emit("open",a);r.read()}}))}function WriteStream(r,i){if(this instanceof WriteStream)return g.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var r=this;open(r.path,r.flags,r.mode,(function(i,a){if(i){r.destroy();r.emit("error",i)}else{r.fd=a;r.emit("open",a)}}))}function createReadStream(i,a){return new r.ReadStream(i,a)}function createWriteStream(i,a){return new r.WriteStream(i,a)}var b=r.open;r.open=open;function open(r,i,a,s){if(typeof a==="function")s=a,a=null;return go$open(r,i,a,s);function go$open(r,i,a,s,l){return b(r,i,a,(function(c,p){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$open,[r,i,a,s],c,l||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}return r}function enqueue(r){h("ENQUEUE",r[0].name,r[1]);s[u].push(r);retry()}var y;function resetQueue(){var r=Date.now();for(var i=0;i2){s[u][i][3]=r;s[u][i][4]=r}}retry()}function retry(){clearTimeout(y);y=undefined;if(s[u].length===0)return;var r=s[u].shift();var i=r[0];var a=r[1];var l=r[2];var c=r[3];var p=r[4];if(c===undefined){h("RETRY",i.name,a);i.apply(null,a)}else if(Date.now()-c>=6e4){h("TIMEOUT",i.name,a);var d=a.pop();if(typeof d==="function")d.call(null,l)}else{var A=Date.now()-p;var g=Math.max(p-c,1);var E=Math.min(g*1.2,100);if(A>=E){h("RETRY",i.name,a);i.apply(null,a.concat([c]))}else{s[u].push(r)}}if(y===undefined){y=setTimeout(retry,0)}}},83830:(r,i,a)=>{var s=a(12781).Stream;r.exports=legacy;function legacy(r){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(i,a){if(!(this instanceof ReadStream))return new ReadStream(i,a);s.call(this);var l=this;this.path=i;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;a=a||{};var c=Object.keys(a);for(var p=0,d=c.length;pthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){l._read()}));return}r.open(this.path,this.flags,this.mode,(function(r,i){if(r){l.emit("error",r);l.readable=false;return}l.fd=i;l.emit("open",i);l._read()}))}function WriteStream(i,a){if(!(this instanceof WriteStream))return new WriteStream(i,a);s.call(this);this.path=i;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;a=a||{};var l=Object.keys(a);for(var c=0,p=l.length;c= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=r.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},24913:(r,i,a)=>{var s=a(22057);var l=process.cwd;var c=null;var p=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!c)c=l.call(process);return c};try{process.cwd()}catch(r){}if(typeof process.chdir==="function"){var d=process.chdir;process.chdir=function(r){c=null;d.call(process,r)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,d)}r.exports=patch;function patch(r){if(s.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(r)}if(!r.lutimes){patchLutimes(r)}r.chown=chownFix(r.chown);r.fchown=chownFix(r.fchown);r.lchown=chownFix(r.lchown);r.chmod=chmodFix(r.chmod);r.fchmod=chmodFix(r.fchmod);r.lchmod=chmodFix(r.lchmod);r.chownSync=chownFixSync(r.chownSync);r.fchownSync=chownFixSync(r.fchownSync);r.lchownSync=chownFixSync(r.lchownSync);r.chmodSync=chmodFixSync(r.chmodSync);r.fchmodSync=chmodFixSync(r.fchmodSync);r.lchmodSync=chmodFixSync(r.lchmodSync);r.stat=statFix(r.stat);r.fstat=statFix(r.fstat);r.lstat=statFix(r.lstat);r.statSync=statFixSync(r.statSync);r.fstatSync=statFixSync(r.fstatSync);r.lstatSync=statFixSync(r.lstatSync);if(r.chmod&&!r.lchmod){r.lchmod=function(r,i,a){if(a)process.nextTick(a)};r.lchmodSync=function(){}}if(r.chown&&!r.lchown){r.lchown=function(r,i,a,s){if(s)process.nextTick(s)};r.lchownSync=function(){}}if(p==="win32"){r.rename=typeof r.rename!=="function"?r.rename:function(i){function rename(a,s,l){var c=Date.now();var p=0;i(a,s,(function CB(d){if(d&&(d.code==="EACCES"||d.code==="EPERM"||d.code==="EBUSY")&&Date.now()-c<6e4){setTimeout((function(){r.stat(s,(function(r,c){if(r&&r.code==="ENOENT")i(a,s,CB);else l(d)}))}),p);if(p<100)p+=10;return}if(l)l(d)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,i);return rename}(r.rename)}r.read=typeof r.read!=="function"?r.read:function(i){function read(a,s,l,c,p,d){var u;if(d&&typeof d==="function"){var A=0;u=function(h,g,y){if(h&&h.code==="EAGAIN"&&A<10){A++;return i.call(r,a,s,l,c,p,u)}d.apply(this,arguments)}}return i.call(r,a,s,l,c,p,u)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,i);return read}(r.read);r.readSync=typeof r.readSync!=="function"?r.readSync:function(i){return function(a,s,l,c,p){var d=0;while(true){try{return i.call(r,a,s,l,c,p)}catch(r){if(r.code==="EAGAIN"&&d<10){d++;continue}throw r}}}}(r.readSync);function patchLchmod(r){r.lchmod=function(i,a,l){r.open(i,s.O_WRONLY|s.O_SYMLINK,a,(function(i,s){if(i){if(l)l(i);return}r.fchmod(s,a,(function(i){r.close(s,(function(r){if(l)l(i||r)}))}))}))};r.lchmodSync=function(i,a){var l=r.openSync(i,s.O_WRONLY|s.O_SYMLINK,a);var c=true;var p;try{p=r.fchmodSync(l,a);c=false}finally{if(c){try{r.closeSync(l)}catch(r){}}else{r.closeSync(l)}}return p}}function patchLutimes(r){if(s.hasOwnProperty("O_SYMLINK")&&r.futimes){r.lutimes=function(i,a,l,c){r.open(i,s.O_SYMLINK,(function(i,s){if(i){if(c)c(i);return}r.futimes(s,a,l,(function(i){r.close(s,(function(r){if(c)c(i||r)}))}))}))};r.lutimesSync=function(i,a,l){var c=r.openSync(i,s.O_SYMLINK);var p;var d=true;try{p=r.futimesSync(c,a,l);d=false}finally{if(d){try{r.closeSync(c)}catch(r){}}else{r.closeSync(c)}}return p}}else if(r.futimes){r.lutimes=function(r,i,a,s){if(s)process.nextTick(s)};r.lutimesSync=function(){}}}function chmodFix(i){if(!i)return i;return function(a,s,l){return i.call(r,a,s,(function(r){if(chownErOk(r))r=null;if(l)l.apply(this,arguments)}))}}function chmodFixSync(i){if(!i)return i;return function(a,s){try{return i.call(r,a,s)}catch(r){if(!chownErOk(r))throw r}}}function chownFix(i){if(!i)return i;return function(a,s,l,c){return i.call(r,a,s,l,(function(r){if(chownErOk(r))r=null;if(c)c.apply(this,arguments)}))}}function chownFixSync(i){if(!i)return i;return function(a,s,l){try{return i.call(r,a,s,l)}catch(r){if(!chownErOk(r))throw r}}}function statFix(i){if(!i)return i;return function(a,s,l){if(typeof s==="function"){l=s;s=null}function callback(r,i){if(i){if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296}if(l)l.apply(this,arguments)}return s?i.call(r,a,s,callback):i.call(r,a,callback)}}function statFixSync(i){if(!i)return i;return function(a,s){var l=s?i.call(r,a,s):i.call(r,a);if(l){if(l.uid<0)l.uid+=4294967296;if(l.gid<0)l.gid+=4294967296}return l}}function chownErOk(r){if(!r)return true;if(r.code==="ENOSYS")return true;var i=!process.getuid||process.getuid()!==0;if(i){if(r.code==="EINVAL"||r.code==="EPERM")return true}return false}}},47834:(r,i,a)=>{var s=a(55788);var l=Object.create(null);var c=a(28995);r.exports=s(inflight);function inflight(r,i){if(l[r]){l[r].push(i);return null}else{l[r]=[i];return makeres(r)}}function makeres(r){return c((function RES(){var i=l[r];var a=i.length;var s=slice(arguments);try{for(var c=0;ca){i.splice(0,a);process.nextTick((function(){RES.apply(null,s)}))}else{delete l[r]}}}))}function slice(r){var i=r.length;var a=[];for(var s=0;s{try{var s=a(73837);if(typeof s.inherits!=="function")throw"";r.exports=s.inherits}catch(i){r.exports=a(57039)}},57039:r=>{if(typeof Object.create==="function"){r.exports=function inherits(r,i){if(i){r.super_=i;r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}})}}}else{r.exports=function inherits(r,i){if(i){r.super_=i;var TempCtor=function(){};TempCtor.prototype=i.prototype;r.prototype=new TempCtor;r.prototype.constructor=r}}}},1363:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true}); +var s;(function(r){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if(true){r(i)}else{}}else{r(s={})}})((function(r){r.version="1.2.2";function signed_crc_table(){var r=0,i=new Array(256);for(var s=0;s!=256;++s){r=s;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;r=r&1?-306674912^r>>>1:r>>>1;i[s]=r}return typeof Int32Array!=="undefined"?new Int32Array(i):i}var i=signed_crc_table();function slice_by_16_tables(r){var i=0,s=0,a=0,l=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(a=0;a!=256;++a)l[a]=r[a];for(a=0;a!=256;++a){s=r[a];for(i=256+a;i<4096;i+=256)s=l[i]=s>>>8^r[s&255]}var c=[];for(a=1;a!=16;++a)c[a-1]=typeof Int32Array!=="undefined"?l.subarray(a*256,a*256+256):l.slice(a*256,a*256+256);return c}var s=slice_by_16_tables(i);var a=s[0],l=s[1],c=s[2],d=s[3],p=s[4];var u=s[5],A=s[6],h=s[7],g=s[8],y=s[9];var b=s[10],w=s[11],C=s[12],v=s[13],I=s[14];function crc32_bstr(r,s){var a=s^-1;for(var l=0,c=r.length;l>>8^i[(a^r.charCodeAt(l++))&255];return~a}function crc32_buf(r,s){var B=s^-1,S=r.length-15,x=0;for(;x>8&255]^C[r[x++]^B>>16&255]^w[r[x++]^B>>>24]^b[r[x++]]^y[r[x++]]^g[r[x++]]^h[r[x++]]^A[r[x++]]^u[r[x++]]^p[r[x++]]^d[r[x++]]^c[r[x++]]^l[r[x++]]^a[r[x++]]^i[r[x++]];S+=15;while(x>>8^i[(B^r[x++])&255];return~B}function crc32_str(r,s){var a=s^-1;for(var l=0,c=r.length,d=0,p=0;l>>8^i[(a^d)&255]}else if(d<2048){a=a>>>8^i[(a^(192|d>>6&31))&255];a=a>>>8^i[(a^(128|d&63))&255]}else if(d>=55296&&d<57344){d=(d&1023)+64;p=r.charCodeAt(l++)&1023;a=a>>>8^i[(a^(240|d>>8&7))&255];a=a>>>8^i[(a^(128|d>>2&63))&255];a=a>>>8^i[(a^(128|p>>6&15|(d&3)<<4))&255];a=a>>>8^i[(a^(128|p&63))&255]}else{a=a>>>8^i[(a^(224|d>>12&15))&255];a=a>>>8^i[(a^(128|d>>6&63))&255];a=a>>>8^i[(a^(128|d&63))&255]}}return~a}r.table=i;r.bstr=crc32_bstr;r.buf=crc32_buf;r.str=crc32_str}))},38782:(r,i,s)=>{"use strict";const{Transform:a}=s(70672);const l=s(61813);class CRC32Stream extends a{constructor(r){super(r);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0}_transform(r,i,s){if(r){this.checksum=l.buf(r,this.checksum)>>>0;this.rawSize+=r.length}s(null,r)}digest(r){const i=Buffer.allocUnsafe(4);i.writeUInt32BE(this.checksum>>>0,0);return r?i.toString(r):i}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}}r.exports=CRC32Stream},50968:(r,i,s)=>{"use strict";const{DeflateRaw:a}=s(59796);const l=s(61813);class DeflateCRC32Stream extends a{constructor(r){super(r);this.checksum=Buffer.allocUnsafe(4);this.checksum.writeInt32BE(0,0);this.rawSize=0;this.compressedSize=0}push(r,i){if(r){this.compressedSize+=r.length}return super.push(r,i)}_transform(r,i,s){if(r){this.checksum=l.buf(r,this.checksum)>>>0;this.rawSize+=r.length}super._transform(r,i,s)}digest(r){const i=Buffer.allocUnsafe(4);i.writeUInt32BE(this.checksum>>>0,0);return r?i.toString(r):i}hex(){return this.digest("hex").toUpperCase()}size(r=false){if(r){return this.compressedSize}else{return this.rawSize}}}r.exports=DeflateCRC32Stream},25547:(r,i,s)=>{"use strict";r.exports={CRC32Stream:s(38782),DeflateCRC32Stream:s(50968)}},59558:(r,i,s)=>{"use strict";const{SymbolDispose:a}=s(78368);const{AbortError:l,codes:c}=s(5312);const{isNodeStream:d,isWebStream:p,kControllerErrorFunction:u}=s(98535);const A=s(7002);const{ERR_INVALID_ARG_TYPE:h}=c;let g;const validateAbortSignal=(r,i)=>{if(typeof r!=="object"||!("aborted"in r)){throw new h(i,"AbortSignal",r)}};r.exports.addAbortSignal=function addAbortSignal(i,s){validateAbortSignal(i,"signal");if(!d(s)&&!p(s)){throw new h("stream",["ReadableStream","WritableStream","Stream"],s)}return r.exports.addAbortSignalNoValidate(i,s)};r.exports.addAbortSignalNoValidate=function(r,i){if(typeof r!=="object"||!("aborted"in r)){return i}const c=d(i)?()=>{i.destroy(new l(undefined,{cause:r.reason}))}:()=>{i[u](new l(undefined,{cause:r.reason}))};if(r.aborted){c()}else{g=g||s(12973).addAbortListener;const l=g(r,c);A(i,l[a])}return i}},87784:(r,i,s)=>{"use strict";const{StringPrototypeSlice:a,SymbolIterator:l,TypedArrayPrototypeSet:c,Uint8Array:d}=s(78368);const{Buffer:p}=s(14300);const{inspect:u}=s(12973);r.exports=class BufferList{constructor(){this.head=null;this.tail=null;this.length=0}push(r){const i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length}unshift(r){const i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length}shift(){if(this.length===0)return;const r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r}clear(){this.head=this.tail=null;this.length=0}join(r){if(this.length===0)return"";let i=this.head;let s=""+i.data;while((i=i.next)!==null)s+=r+i.data;return s}concat(r){if(this.length===0)return p.alloc(0);const i=p.allocUnsafe(r>>>0);let s=this.head;let a=0;while(s){c(i,s.data,a);a+=s.data.length;s=s.next}return i}consume(r,i){const s=this.head.data;if(rc.length){i+=c;r-=c.length}else{if(r===c.length){i+=c;++l;if(s.next)this.head=s.next;else this.head=this.tail=null}else{i+=a(c,0,r);this.head=s;s.data=a(c,r)}break}++l}while((s=s.next)!==null);this.length-=l;return i}_getBuffer(r){const i=p.allocUnsafe(r);const s=r;let a=this.head;let l=0;do{const p=a.data;if(r>p.length){c(i,p,s-r);r-=p.length}else{if(r===p.length){c(i,p,s-r);++l;if(a.next)this.head=a.next;else this.head=this.tail=null}else{c(i,new d(p.buffer,p.byteOffset,r),s-r);this.head=a;a.data=p.slice(r)}break}++l}while((a=a.next)!==null);this.length-=l;return i}[Symbol.for("nodejs.util.inspect.custom")](r,i){return u(this,{...i,depth:0,customInspect:false})}}},29423:(r,i,s)=>{"use strict";const{pipeline:a}=s(93345);const l=s(62431);const{destroyer:c}=s(13586);const{isNodeStream:d,isReadable:p,isWritable:u,isWebStream:A,isTransformStream:h,isWritableStream:g,isReadableStream:y}=s(98535);const{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:w,ERR_MISSING_ARGS:C}}=s(5312);const v=s(7002);r.exports=function compose(...r){if(r.length===0){throw new C("streams")}if(r.length===1){return l.from(r[0])}const i=[...r];if(typeof r[0]==="function"){r[0]=l.from(r[0])}if(typeof r[r.length-1]==="function"){const i=r.length-1;r[i]=l.from(r[i])}for(let s=0;s0&&!(u(r[s])||g(r[s])||h(r[s]))){throw new w(`streams[${s}]`,i[s],"must be writable")}}let s;let I;let B;let S;let x;function onfinished(r){const i=S;S=null;if(i){i(r)}else if(r){x.destroy(r)}else if(!N&&!_){x.destroy()}}const R=r[0];const Q=a(r,onfinished);const _=!!(u(R)||g(R)||h(R));const N=!!(p(Q)||y(Q)||h(Q));x=new l({writableObjectMode:!!(R!==null&&R!==undefined&&R.writableObjectMode),readableObjectMode:!!(Q!==null&&Q!==undefined&&Q.readableObjectMode),writable:_,readable:N});if(_){if(d(R)){x._write=function(r,i,a){if(R.write(r,i)){a()}else{s=a}};x._final=function(r){R.end();I=r};R.on("drain",(function(){if(s){const r=s;s=null;r()}}))}else if(A(R)){const r=h(R)?R.writable:R;const i=r.getWriter();x._write=async function(r,s,a){try{await i.ready;i.write(r).catch((()=>{}));a()}catch(r){a(r)}};x._final=async function(r){try{await i.ready;i.close().catch((()=>{}));I=r}catch(i){r(i)}}}const r=h(Q)?Q.readable:Q;v(r,(()=>{if(I){const r=I;I=null;r()}}))}if(N){if(d(Q)){Q.on("readable",(function(){if(B){const r=B;B=null;r()}}));Q.on("end",(function(){x.push(null)}));x._read=function(){while(true){const r=Q.read();if(r===null){B=x._read;return}if(!x.push(r)){return}}}}else if(A(Q)){const r=h(Q)?Q.readable:Q;const i=r.getReader();x._read=async function(){while(true){try{const{value:r,done:s}=await i.read();if(!x.push(r)){return}if(s){x.push(null);return}}catch{return}}}}}x._destroy=function(r,i){if(!r&&S!==null){r=new b}B=null;s=null;I=null;if(S===null){i(r)}else{S=i;if(d(Q)){c(Q,r)}}};return x}},13586:(r,i,s)=>{"use strict";const a=s(53568);const{aggregateTwoErrors:l,codes:{ERR_MULTIPLE_CALLBACK:c},AbortError:d}=s(5312);const{Symbol:p}=s(78368);const{kIsDestroyed:u,isDestroyed:A,isFinished:h,isServerRequest:g}=s(98535);const y=p("kDestroy");const b=p("kConstruct");function checkError(r,i,s){if(r){r.stack;if(i&&!i.errored){i.errored=r}if(s&&!s.errored){s.errored=r}}}function destroy(r,i){const s=this._readableState;const a=this._writableState;const c=a||s;if(a!==null&&a!==undefined&&a.destroyed||s!==null&&s!==undefined&&s.destroyed){if(typeof i==="function"){i()}return this}checkError(r,a,s);if(a){a.destroyed=true}if(s){s.destroyed=true}if(!c.constructed){this.once(y,(function(s){_destroy(this,l(s,r),i)}))}else{_destroy(this,r,i)}return this}function _destroy(r,i,s){let l=false;function onDestroy(i){if(l){return}l=true;const c=r._readableState;const d=r._writableState;checkError(i,d,c);if(d){d.closed=true}if(c){c.closed=true}if(typeof s==="function"){s(i)}if(i){a.nextTick(emitErrorCloseNT,r,i)}else{a.nextTick(emitCloseNT,r)}}try{r._destroy(i||null,onDestroy)}catch(i){onDestroy(i)}}function emitErrorCloseNT(r,i){emitErrorNT(r,i);emitCloseNT(r)}function emitCloseNT(r){const i=r._readableState;const s=r._writableState;if(s){s.closeEmitted=true}if(i){i.closeEmitted=true}if(s!==null&&s!==undefined&&s.emitClose||i!==null&&i!==undefined&&i.emitClose){r.emit("close")}}function emitErrorNT(r,i){const s=r._readableState;const a=r._writableState;if(a!==null&&a!==undefined&&a.errorEmitted||s!==null&&s!==undefined&&s.errorEmitted){return}if(a){a.errorEmitted=true}if(s){s.errorEmitted=true}r.emit("error",i)}function undestroy(){const r=this._readableState;const i=this._writableState;if(r){r.constructed=true;r.closed=false;r.closeEmitted=false;r.destroyed=false;r.errored=null;r.errorEmitted=false;r.reading=false;r.ended=r.readable===false;r.endEmitted=r.readable===false}if(i){i.constructed=true;i.destroyed=false;i.closed=false;i.closeEmitted=false;i.errored=null;i.errorEmitted=false;i.finalCalled=false;i.prefinished=false;i.ended=i.writable===false;i.ending=i.writable===false;i.finished=i.writable===false}}function errorOrDestroy(r,i,s){const l=r._readableState;const c=r._writableState;if(c!==null&&c!==undefined&&c.destroyed||l!==null&&l!==undefined&&l.destroyed){return this}if(l!==null&&l!==undefined&&l.autoDestroy||c!==null&&c!==undefined&&c.autoDestroy)r.destroy(i);else if(i){i.stack;if(c&&!c.errored){c.errored=i}if(l&&!l.errored){l.errored=i}if(s){a.nextTick(emitErrorNT,r,i)}else{emitErrorNT(r,i)}}}function construct(r,i){if(typeof r._construct!=="function"){return}const s=r._readableState;const l=r._writableState;if(s){s.constructed=false}if(l){l.constructed=false}r.once(b,i);if(r.listenerCount(b)>1){return}a.nextTick(constructNT,r)}function constructNT(r){let i=false;function onConstruct(s){if(i){errorOrDestroy(r,s!==null&&s!==undefined?s:new c);return}i=true;const l=r._readableState;const d=r._writableState;const p=d||l;if(l){l.constructed=true}if(d){d.constructed=true}if(p.destroyed){r.emit(y,s)}else if(s){errorOrDestroy(r,s,true)}else{a.nextTick(emitConstructNT,r)}}try{r._construct((r=>{a.nextTick(onConstruct,r)}))}catch(r){a.nextTick(onConstruct,r)}}function emitConstructNT(r){r.emit(b)}function isRequest(r){return(r===null||r===undefined?undefined:r.setHeader)&&typeof r.abort==="function"}function emitCloseLegacy(r){r.emit("close")}function emitErrorCloseLegacy(r,i){r.emit("error",i);a.nextTick(emitCloseLegacy,r)}function destroyer(r,i){if(!r||A(r)){return}if(!i&&!h(r)){i=new d}if(g(r)){r.socket=null;r.destroy(i)}else if(isRequest(r)){r.abort()}else if(isRequest(r.req)){r.req.abort()}else if(typeof r.destroy==="function"){r.destroy(i)}else if(typeof r.close==="function"){r.close()}else if(i){a.nextTick(emitErrorCloseLegacy,r,i)}else{a.nextTick(emitCloseLegacy,r)}if(!r.destroyed){r[u]=true}}r.exports={construct:construct,destroyer:destroyer,destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},62431:(r,i,s)=>{"use strict";const{ObjectDefineProperties:a,ObjectGetOwnPropertyDescriptor:l,ObjectKeys:c,ObjectSetPrototypeOf:d}=s(78368);r.exports=Duplex;const p=s(75182);const u=s(24331);d(Duplex.prototype,p.prototype);d(Duplex,p);{const r=c(u.prototype);for(let i=0;i{const a=s(53568);"use strict";const l=s(14300);const{isReadable:c,isWritable:d,isIterable:p,isNodeStream:u,isReadableNodeStream:A,isWritableNodeStream:h,isDuplexNodeStream:g,isReadableStream:y,isWritableStream:b}=s(98535);const w=s(7002);const{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:I}}=s(5312);const{destroyer:B}=s(13586);const S=s(62431);const x=s(75182);const R=s(24331);const{createDeferredPromise:Q}=s(12973);const _=s(83643);const N=globalThis.Blob||l.Blob;const T=typeof N!=="undefined"?function isBlob(r){return r instanceof N}:function isBlob(r){return false};const k=globalThis.AbortController||s(24995).AbortController;const{FunctionPrototypeCall:D}=s(78368);class Duplexify extends S{constructor(r){super(r);if((r===null||r===undefined?undefined:r.readable)===false){this._readableState.readable=false;this._readableState.ended=true;this._readableState.endEmitted=true}if((r===null||r===undefined?undefined:r.writable)===false){this._writableState.writable=false;this._writableState.ending=true;this._writableState.ended=true;this._writableState.finished=true}}}r.exports=function duplexify(r,i){if(g(r)){return r}if(A(r)){return _duplexify({readable:r})}if(h(r)){return _duplexify({writable:r})}if(u(r)){return _duplexify({writable:false,readable:false})}if(y(r)){return _duplexify({readable:x.fromWeb(r)})}if(b(r)){return _duplexify({writable:R.fromWeb(r)})}if(typeof r==="function"){const{value:s,write:l,final:c,destroy:d}=fromAsyncGen(r);if(p(s)){return _(Duplexify,s,{objectMode:true,write:l,final:c,destroy:d})}const u=s===null||s===undefined?undefined:s.then;if(typeof u==="function"){let r;const i=D(u,s,(r=>{if(r!=null){throw new I("nully","body",r)}}),(i=>{B(r,i)}));return r=new Duplexify({objectMode:true,readable:false,write:l,final(r){c((async()=>{try{await i;a.nextTick(r,null)}catch(i){a.nextTick(r,i)}}))},destroy:d})}throw new I("Iterable, AsyncIterable or AsyncFunction",i,s)}if(T(r)){return duplexify(r.arrayBuffer())}if(p(r)){return _(Duplexify,r,{objectMode:true,writable:false})}if(y(r===null||r===undefined?undefined:r.readable)&&b(r===null||r===undefined?undefined:r.writable)){return Duplexify.fromWeb(r)}if(typeof(r===null||r===undefined?undefined:r.writable)==="object"||typeof(r===null||r===undefined?undefined:r.readable)==="object"){const i=r!==null&&r!==undefined&&r.readable?A(r===null||r===undefined?undefined:r.readable)?r===null||r===undefined?undefined:r.readable:duplexify(r.readable):undefined;const s=r!==null&&r!==undefined&&r.writable?h(r===null||r===undefined?undefined:r.writable)?r===null||r===undefined?undefined:r.writable:duplexify(r.writable):undefined;return _duplexify({readable:i,writable:s})}const s=r===null||r===undefined?undefined:r.then;if(typeof s==="function"){let i;D(s,r,(r=>{if(r!=null){i.push(r)}i.push(null)}),(r=>{B(i,r)}));return i=new Duplexify({objectMode:true,writable:false,read(){}})}throw new v(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],r)};function fromAsyncGen(r){let{promise:i,resolve:s}=Q();const l=new k;const c=l.signal;const d=r(async function*(){while(true){const r=i;i=null;const{chunk:l,done:d,cb:p}=await r;a.nextTick(p);if(d)return;if(c.aborted)throw new C(undefined,{cause:c.reason});({promise:i,resolve:s}=Q());yield l}}(),{signal:c});return{value:d,write(r,i,a){const l=s;s=null;l({chunk:r,done:false,cb:a})},final(r){const i=s;s=null;i({done:true,cb:r})},destroy(r,i){l.abort();i(r)}}}function _duplexify(r){const i=r.readable&&typeof r.readable.read!=="function"?x.wrap(r.readable):r.readable;const s=r.writable;let a=!!c(i);let l=!!d(s);let p;let u;let A;let h;let g;function onfinished(r){const i=h;h=null;if(i){i(r)}else if(r){g.destroy(r)}}g=new Duplexify({readableObjectMode:!!(i!==null&&i!==undefined&&i.readableObjectMode),writableObjectMode:!!(s!==null&&s!==undefined&&s.writableObjectMode),readable:a,writable:l});if(l){w(s,(r=>{l=false;if(r){B(i,r)}onfinished(r)}));g._write=function(r,i,a){if(s.write(r,i)){a()}else{p=a}};g._final=function(r){s.end();u=r};s.on("drain",(function(){if(p){const r=p;p=null;r()}}));s.on("finish",(function(){if(u){const r=u;u=null;r()}}))}if(a){w(i,(r=>{a=false;if(r){B(i,r)}onfinished(r)}));i.on("readable",(function(){if(A){const r=A;A=null;r()}}));i.on("end",(function(){g.push(null)}));g._read=function(){while(true){const r=i.read();if(r===null){A=g._read;return}if(!g.push(r)){return}}}}g._destroy=function(r,a){if(!r&&h!==null){r=new C}A=null;p=null;u=null;if(h===null){a(r)}else{h=a;B(s,r);B(i,r)}};return g}},7002:(r,i,s)=>{const a=s(53568);"use strict";const{AbortError:l,codes:c}=s(5312);const{ERR_INVALID_ARG_TYPE:d,ERR_STREAM_PREMATURE_CLOSE:p}=c;const{kEmptyObject:u,once:A}=s(12973);const{validateAbortSignal:h,validateFunction:g,validateObject:y,validateBoolean:b}=s(20836);const{Promise:w,PromisePrototypeThen:C,SymbolDispose:v}=s(78368);const{isClosed:I,isReadable:B,isReadableNodeStream:S,isReadableStream:x,isReadableFinished:R,isReadableErrored:Q,isWritable:_,isWritableNodeStream:N,isWritableStream:T,isWritableFinished:k,isWritableErrored:D,isNodeStream:P,willEmitClose:O,kIsClosedPromise:L}=s(98535);let M;function isRequest(r){return r.setHeader&&typeof r.abort==="function"}const nop=()=>{};function eos(r,i,c){var b,w;if(arguments.length===2){c=i;i=u}else if(i==null){i=u}else{y(i,"options")}g(c,"callback");h(i.signal,"options.signal");c=A(c);if(x(r)||T(r)){return eosWeb(r,i,c)}if(!P(r)){throw new d("stream",["ReadableStream","WritableStream","Stream"],r)}const C=(b=i.readable)!==null&&b!==undefined?b:S(r);const L=(w=i.writable)!==null&&w!==undefined?w:N(r);const U=r._writableState;const j=r._readableState;const onlegacyfinish=()=>{if(!r.writable){onfinish()}};let H=O(r)&&S(r)===C&&N(r)===L;let q=k(r,false);const onfinish=()=>{q=true;if(r.destroyed){H=false}if(H&&(!r.readable||C)){return}if(!C||G){c.call(r)}};let G=R(r,false);const onend=()=>{G=true;if(r.destroyed){H=false}if(H&&(!r.writable||L)){return}if(!L||q){c.call(r)}};const onerror=i=>{c.call(r,i)};let z=I(r);const onclose=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}if(C&&!G&&S(r,true)){if(!R(r,false))return c.call(r,new p)}if(L&&!q){if(!k(r,false))return c.call(r,new p)}c.call(r)};const onclosed=()=>{z=true;const i=D(r)||Q(r);if(i&&typeof i!=="boolean"){return c.call(r,i)}c.call(r)};const onrequest=()=>{r.req.on("finish",onfinish)};if(isRequest(r)){r.on("complete",onfinish);if(!H){r.on("abort",onclose)}if(r.req){onrequest()}else{r.on("request",onrequest)}}else if(L&&!U){r.on("end",onlegacyfinish);r.on("close",onlegacyfinish)}if(!H&&typeof r.aborted==="boolean"){r.on("aborted",onclose)}r.on("end",onend);r.on("finish",onfinish);if(i.error!==false){r.on("error",onerror)}r.on("close",onclose);if(z){a.nextTick(onclose)}else if(U!==null&&U!==undefined&&U.errorEmitted||j!==null&&j!==undefined&&j.errorEmitted){if(!H){a.nextTick(onclosed)}}else if(!C&&(!H||B(r))&&(q||_(r)===false)){a.nextTick(onclosed)}else if(!L&&(!H||_(r))&&(G||B(r)===false)){a.nextTick(onclosed)}else if(j&&r.req&&r.aborted){a.nextTick(onclosed)}const cleanup=()=>{c=nop;r.removeListener("aborted",onclose);r.removeListener("complete",onfinish);r.removeListener("abort",onclose);r.removeListener("request",onrequest);if(r.req)r.req.removeListener("finish",onfinish);r.removeListener("end",onlegacyfinish);r.removeListener("close",onlegacyfinish);r.removeListener("finish",onfinish);r.removeListener("end",onend);r.removeListener("error",onerror);r.removeListener("close",onclose)};if(i.signal&&!z){const abort=()=>{const s=c;cleanup();s.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(abort)}else{M=M||s(12973).addAbortListener;const a=M(i.signal,abort);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}return cleanup}function eosWeb(r,i,c){let d=false;let p=nop;if(i.signal){p=()=>{d=true;c.call(r,new l(undefined,{cause:i.signal.reason}))};if(i.signal.aborted){a.nextTick(p)}else{M=M||s(12973).addAbortListener;const a=M(i.signal,p);const l=c;c=A(((...i)=>{a[v]();l.apply(r,i)}))}}const resolverFn=(...i)=>{if(!d){a.nextTick((()=>c.apply(r,i)))}};C(r[L].promise,resolverFn,resolverFn);return nop}function finished(r,i){var s;let a=false;if(i===null){i=u}if((s=i)!==null&&s!==undefined&&s.cleanup){b(i.cleanup,"cleanup");a=i.cleanup}return new w(((s,l)=>{const c=eos(r,i,(r=>{if(a){c()}if(r){l(r)}else{s()}}))}))}r.exports=eos;r.exports.finished=finished},83643:(r,i,s)=>{"use strict";const a=s(53568);const{PromisePrototypeThen:l,SymbolAsyncIterator:c,SymbolIterator:d}=s(78368);const{Buffer:p}=s(14300);const{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:A}=s(5312).codes;function from(r,i,s){let h;if(typeof i==="string"||i instanceof p){return new r({objectMode:true,...s,read(){this.push(i);this.push(null)}})}let g;if(i&&i[c]){g=true;h=i[c]()}else if(i&&i[d]){g=false;h=i[d]()}else{throw new u("iterable",["Iterable"],i)}const y=new r({objectMode:true,highWaterMark:1,...s});let b=false;y._read=function(){if(!b){b=true;next()}};y._destroy=function(r,i){l(close(r),(()=>a.nextTick(i,r)),(s=>a.nextTick(i,s||r)))};async function close(r){const i=r!==undefined&&r!==null;const s=typeof h.throw==="function";if(i&&s){const{value:i,done:s}=await h.throw(r);await i;if(s){return}}if(typeof h.return==="function"){const{value:r}=await h.return();await r}}async function next(){for(;;){try{const{value:r,done:i}=g?await h.next():h.next();if(i){y.push(null)}else{const i=r&&typeof r.then==="function"?await r:r;if(i===null){b=false;throw new A}else if(y.push(i)){continue}else{b=false}}}catch(r){y.destroy(r)}break}}return y}r.exports=from},42869:(r,i,s)=>{"use strict";const{ArrayIsArray:a,ObjectSetPrototypeOf:l}=s(78368);const{EventEmitter:c}=s(82361);function Stream(r){c.call(this,r)}l(Stream.prototype,c.prototype);l(Stream,c);Stream.prototype.pipe=function(r,i){const s=this;function ondata(i){if(r.writable&&r.write(i)===false&&s.pause){s.pause()}}s.on("data",ondata);function ondrain(){if(s.readable&&s.resume){s.resume()}}r.on("drain",ondrain);if(!r._isStdio&&(!i||i.end!==false)){s.on("end",onend);s.on("close",onclose)}let a=false;function onend(){if(a)return;a=true;r.end()}function onclose(){if(a)return;a=true;if(typeof r.destroy==="function")r.destroy()}function onerror(r){cleanup();if(c.listenerCount(this,"error")===0){this.emit("error",r)}}prependListener(s,"error",onerror);prependListener(r,"error",onerror);function cleanup(){s.removeListener("data",ondata);r.removeListener("drain",ondrain);s.removeListener("end",onend);s.removeListener("close",onclose);s.removeListener("error",onerror);r.removeListener("error",onerror);s.removeListener("end",cleanup);s.removeListener("close",cleanup);r.removeListener("close",cleanup)}s.on("end",cleanup);s.on("close",cleanup);r.on("close",cleanup);r.emit("pipe",s);return r};function prependListener(r,i,s){if(typeof r.prependListener==="function")return r.prependListener(i,s);if(!r._events||!r._events[i])r.on(i,s);else if(a(r._events[i]))r._events[i].unshift(s);else r._events[i]=[s,r._events[i]]}r.exports={Stream:Stream,prependListener:prependListener}},25244:(r,i,s)=>{"use strict";const a=globalThis.AbortController||s(24995).AbortController;const{codes:{ERR_INVALID_ARG_VALUE:l,ERR_INVALID_ARG_TYPE:c,ERR_MISSING_ARGS:d,ERR_OUT_OF_RANGE:p},AbortError:u}=s(5312);const{validateAbortSignal:A,validateInteger:h,validateObject:g}=s(20836);const y=s(78368).Symbol("kWeak");const b=s(78368).Symbol("kResistStopPropagation");const{finished:w}=s(7002);const C=s(29423);const{addAbortSignalNoValidate:v}=s(59558);const{isWritable:I,isNodeStream:B}=s(98535);const{deprecate:S}=s(12973);const{ArrayPrototypePush:x,Boolean:R,MathFloor:Q,Number:_,NumberIsNaN:N,Promise:T,PromiseReject:k,PromiseResolve:D,PromisePrototypeThen:P,Symbol:O}=s(78368);const L=O("kEmpty");const M=O("kEof");function compose(r,i){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}if(B(r)&&!I(r)){throw new l("stream",r,"must be writable")}const s=C(this,r);if(i!==null&&i!==undefined&&i.signal){v(i.signal,s)}return s}function map(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}let a=1;if((i===null||i===undefined?undefined:i.concurrency)!=null){a=Q(i.concurrency)}let l=a-1;if((i===null||i===undefined?undefined:i.highWaterMark)!=null){l=Q(i.highWaterMark)}h(a,"options.concurrency",1);h(l,"options.highWaterMark",0);l+=a;return async function*map(){const c=s(12973).AbortSignalAny([i===null||i===undefined?undefined:i.signal].filter(R));const d=this;const p=[];const A={signal:c};let h;let g;let y=false;let b=0;function onCatch(){y=true;afterItemProcessed()}function afterItemProcessed(){b-=1;maybeResume()}function maybeResume(){if(g&&!y&&b=l||b>=a)){await new T((r=>{g=r}))}}p.push(M)}catch(r){const i=k(r);P(i,afterItemProcessed,onCatch);p.push(i)}finally{y=true;if(h){h();h=null}}}pump();try{while(true){while(p.length>0){const r=await p[0];if(r===M){return}if(c.aborted){throw new u}if(r!==L){yield r}p.shift();maybeResume()}await new T((r=>{h=r}))}}finally{y=true;if(g){g();g=null}}}.call(this)}function asIndexedPairs(r=undefined){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}return async function*asIndexedPairs(){let i=0;for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u({cause:r.signal.reason})}yield[i++,a]}}.call(this)}async function some(r,i=undefined){for await(const s of filter.call(this,r,i)){return true}return false}async function every(r,i=undefined){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}return!await some.call(this,(async(...i)=>!await r(...i)),i)}async function find(r,i){for await(const s of filter.call(this,r,i)){return s}return undefined}async function forEach(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function forEachFn(i,s){await r(i,s);return L}for await(const r of map.call(this,forEachFn,i));}function filter(r,i){if(typeof r!=="function"){throw new c("fn",["Function","AsyncFunction"],r)}async function filterFn(i,s){if(await r(i,s)){return i}return L}return map.call(this,filterFn,i)}class ReduceAwareErrMissingArgs extends d{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function reduce(r,i,s){var l;if(typeof r!=="function"){throw new c("reducer",["Function","AsyncFunction"],r)}if(s!=null){g(s,"options")}if((s===null||s===undefined?undefined:s.signal)!=null){A(s.signal,"options.signal")}let d=arguments.length>1;if(s!==null&&s!==undefined&&(l=s.signal)!==null&&l!==undefined&&l.aborted){const r=new u(undefined,{cause:s.signal.reason});this.once("error",(()=>{}));await w(this.destroy(r));throw r}const p=new a;const h=p.signal;if(s!==null&&s!==undefined&&s.signal){const r={once:true,[y]:this,[b]:true};s.signal.addEventListener("abort",(()=>p.abort()),r)}let C=false;try{for await(const a of this){var v;C=true;if(s!==null&&s!==undefined&&(v=s.signal)!==null&&v!==undefined&&v.aborted){throw new u}if(!d){i=a;d=true}else{i=await r(i,a,{signal:h})}}if(!C&&!d){throw new ReduceAwareErrMissingArgs}}finally{p.abort()}return i}async function toArray(r){if(r!=null){g(r,"options")}if((r===null||r===undefined?undefined:r.signal)!=null){A(r.signal,"options.signal")}const i=[];for await(const a of this){var s;if(r!==null&&r!==undefined&&(s=r.signal)!==null&&s!==undefined&&s.aborted){throw new u(undefined,{cause:r.signal.reason})}x(i,a)}return i}function flatMap(r,i){const s=map.call(this,r,i);return async function*flatMap(){for await(const r of s){yield*r}}.call(this)}function toIntegerOrInfinity(r){r=_(r);if(N(r)){return 0}if(r<0){throw new p("number",">= 0",r)}return r}function drop(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*drop(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r--<=0){yield s}}}.call(this)}function take(r,i=undefined){if(i!=null){g(i,"options")}if((i===null||i===undefined?undefined:i.signal)!=null){A(i.signal,"options.signal")}r=toIntegerOrInfinity(r);return async function*take(){var s;if(i!==null&&i!==undefined&&(s=i.signal)!==null&&s!==undefined&&s.aborted){throw new u}for await(const s of this){var a;if(i!==null&&i!==undefined&&(a=i.signal)!==null&&a!==undefined&&a.aborted){throw new u}if(r-- >0){yield s}if(r<=0){return}}}.call(this)}r.exports.streamReturningOperators={asIndexedPairs:S(asIndexedPairs,"readable.asIndexedPairs will be removed in a future version."),drop:drop,filter:filter,flatMap:flatMap,map:map,take:take,compose:compose};r.exports.promiseReturningOperators={every:every,forEach:forEach,reduce:reduce,toArray:toArray,some:some,find:find}},55748:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a}=s(78368);r.exports=PassThrough;const l=s(37202);a(PassThrough.prototype,l.prototype);a(PassThrough,l);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);l.call(this,r)}PassThrough.prototype._transform=function(r,i,s){s(null,r)}},93345:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayIsArray:l,Promise:c,SymbolAsyncIterator:d,SymbolDispose:p}=s(78368);const u=s(7002);const{once:A}=s(12973);const h=s(13586);const g=s(62431);const{aggregateTwoErrors:y,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:w,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:v,ERR_STREAM_PREMATURE_CLOSE:I},AbortError:B}=s(5312);const{validateFunction:S,validateAbortSignal:x}=s(20836);const{isIterable:R,isReadable:Q,isReadableNodeStream:_,isNodeStream:N,isTransformStream:T,isWebStream:k,isReadableStream:D,isReadableFinished:P}=s(98535);const O=globalThis.AbortController||s(24995).AbortController;let L;let M;let U;function destroyer(r,i,s){let a=false;r.on("close",(()=>{a=true}));const l=u(r,{readable:i,writable:s},(r=>{a=!r}));return{destroy:i=>{if(a)return;a=true;h.destroyer(r,i||new v("pipe"))},cleanup:l}}function popCallback(r){S(r[r.length-1],"streams[stream.length - 1]");return r.pop()}function makeAsyncIterable(r){if(R(r)){return r}else if(_(r)){return fromReadable(r)}throw new b("val",["Readable","Iterable","AsyncIterable"],r)}async function*fromReadable(r){if(!M){M=s(75182)}yield*M.prototype[d].call(r)}async function pumpToNode(r,i,s,{end:a}){let l;let d=null;const resume=r=>{if(r){l=r}if(d){const r=d;d=null;r()}};const wait=()=>new c(((r,i)=>{if(l){i(l)}else{d=()=>{if(l){i(l)}else{r()}}}}));i.on("drain",resume);const p=u(i,{readable:false},resume);try{if(i.writableNeedDrain){await wait()}for await(const s of r){if(!i.write(s)){await wait()}}if(a){i.end();await wait()}s()}catch(r){s(l!==r?y(l,r):r)}finally{p();i.off("drain",resume)}}async function pumpToWeb(r,i,s,{end:a}){if(T(i)){i=i.writable}const l=i.getWriter();try{for await(const i of r){await l.ready;l.write(i).catch((()=>{}))}await l.ready;if(a){await l.close()}s()}catch(r){try{await l.abort(r);s(r)}catch(r){s(r)}}}function pipeline(...r){return pipelineImpl(r,A(popCallback(r)))}function pipelineImpl(r,i,c){if(r.length===1&&l(r[0])){r=r[0]}if(r.length<2){throw new C("streams")}const d=new O;const u=d.signal;const A=c===null||c===undefined?undefined:c.signal;const h=[];x(A,"options.signal");function abort(){finishImpl(new B)}U=U||s(12973).addAbortListener;let y;if(A){y=U(A,abort)}let v;let I;const S=[];let P=0;function finish(r){finishImpl(r,--P===0)}function finishImpl(r,s){var l;if(r&&(!v||v.code==="ERR_STREAM_PREMATURE_CLOSE")){v=r}if(!v&&!s){return}while(S.length){S.shift()(v)}(l=y)===null||l===undefined?undefined:l[p]();d.abort();if(s){if(!v){h.forEach((r=>r()))}a.nextTick(i,v,I)}}let M;for(let q=0;q0;const W=z||(c===null||c===undefined?undefined:c.end)!==false;const Y=q===r.length-1;if(N(G)){if(W){const{destroy:J,cleanup:$}=destroyer(G,z,V);S.push(J);if(Q(G)&&Y){h.push($)}}function onError(r){if(r&&r.name!=="AbortError"&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"){finish(r)}}G.on("error",onError);if(Q(G)&&Y){h.push((()=>{G.removeListener("error",onError)}))}}if(q===0){if(typeof G==="function"){M=G({signal:u});if(!R(M)){throw new w("Iterable, AsyncIterable or Stream","source",M)}}else if(R(G)||_(G)||T(G)){M=G}else{M=g.from(G)}}else if(typeof G==="function"){if(T(M)){var j;M=makeAsyncIterable((j=M)===null||j===undefined?undefined:j.readable)}else{M=makeAsyncIterable(M)}M=G(M,{signal:u});if(z){if(!R(M,true)){throw new w("AsyncIterable",`transform[${q-1}]`,M)}}else{var H;if(!L){L=s(55748)}const X=new L({objectMode:true});const K=(H=M)===null||H===undefined?undefined:H.then;if(typeof K==="function"){P++;K.call(M,(r=>{I=r;if(r!=null){X.write(r)}if(W){X.end()}a.nextTick(finish)}),(r=>{X.destroy(r);a.nextTick(finish,r)}))}else if(R(M,true)){P++;pumpToNode(M,X,finish,{end:W})}else if(D(M)||T(M)){const te=M.readable||M;P++;pumpToNode(te,X,finish,{end:W})}else{throw new w("AsyncIterable or Promise","destination",M)}M=X;const{destroy:Z,cleanup:ee}=destroyer(M,false,true);S.push(Z);if(Y){h.push(ee)}}}else if(N(G)){if(_(M)){P+=2;const re=pipe(M,G,finish,{end:W});if(Q(G)&&Y){h.push(re)}}else if(T(M)||D(M)){const ne=M.readable||M;P++;pumpToNode(ne,G,finish,{end:W})}else if(R(M)){P++;pumpToNode(M,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else if(k(G)){if(_(M)){P++;pumpToWeb(makeAsyncIterable(M),G,finish,{end:W})}else if(D(M)||R(M)){P++;pumpToWeb(M,G,finish,{end:W})}else if(T(M)){P++;pumpToWeb(M.readable,G,finish,{end:W})}else{throw new b("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],M)}M=G}else{M=g.from(G)}}if(u!==null&&u!==undefined&&u.aborted||A!==null&&A!==undefined&&A.aborted){a.nextTick(abort)}return M}function pipe(r,i,s,{end:l}){let c=false;i.on("close",(()=>{if(!c){s(new I)}}));r.pipe(i,{end:false});if(l){function endFn(){c=true;i.end()}if(P(r)){a.nextTick(endFn)}else{r.once("end",endFn)}}else{s()}u(r,{readable:true,writable:false},(i=>{const a=r._readableState;if(i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted){r.once("end",s).once("error",s)}else{s(i)}}));return u(i,{readable:false,writable:true},s)}r.exports={pipelineImpl:pipelineImpl,pipeline:pipeline}},75182:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeIndexOf:l,NumberIsInteger:c,NumberIsNaN:d,NumberParseInt:p,ObjectDefineProperties:u,ObjectKeys:A,ObjectSetPrototypeOf:h,Promise:g,SafeSet:y,SymbolAsyncDispose:b,SymbolAsyncIterator:w,Symbol:C}=s(78368);r.exports=Readable;Readable.ReadableState=ReadableState;const{EventEmitter:v}=s(82361);const{Stream:I,prependListener:B}=s(42869);const{Buffer:S}=s(14300);const{addAbortSignal:x}=s(59558);const R=s(7002);let Q=s(12973).debuglog("stream",(r=>{Q=r}));const _=s(87784);const N=s(13586);const{getHighWaterMark:T,getDefaultHighWaterMark:k}=s(98225);const{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:L,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:j}=s(5312);const{validateObject:H}=s(20836);const q=C("kPaused");const{StringDecoder:G}=s(71576);const z=s(83643);h(Readable.prototype,I.prototype);h(Readable,I);const nop=()=>{};const{errorOrDestroy:V}=N;const W=1<<0;const Y=1<<1;const J=1<<2;const $=1<<3;const X=1<<4;const K=1<<5;const Z=1<<6;const ee=1<<7;const te=1<<8;const re=1<<9;const ne=1<<10;const ie=1<<11;const se=1<<12;const ae=1<<13;const oe=1<<14;const le=1<<15;const ce=1<<16;const de=1<<17;const pe=1<<18;function makeBitMapDescriptor(r){return{enumerable:false,get(){return(this.state&r)!==0},set(i){if(i)this.state|=r;else this.state&=~r}}}u(ReadableState.prototype,{objectMode:makeBitMapDescriptor(W),ended:makeBitMapDescriptor(Y),endEmitted:makeBitMapDescriptor(J),reading:makeBitMapDescriptor($),constructed:makeBitMapDescriptor(X),sync:makeBitMapDescriptor(K),needReadable:makeBitMapDescriptor(Z),emittedReadable:makeBitMapDescriptor(ee),readableListening:makeBitMapDescriptor(te),resumeScheduled:makeBitMapDescriptor(re),errorEmitted:makeBitMapDescriptor(ne),emitClose:makeBitMapDescriptor(ie),autoDestroy:makeBitMapDescriptor(se),destroyed:makeBitMapDescriptor(ae),closed:makeBitMapDescriptor(oe),closeEmitted:makeBitMapDescriptor(le),multiAwaitDrain:makeBitMapDescriptor(ce),readingMore:makeBitMapDescriptor(de),dataEmitted:makeBitMapDescriptor(pe)});function ReadableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(62431);this.state=ie|se|X|K;if(r&&r.objectMode)this.state|=W;if(a&&r&&r.readableObjectMode)this.state|=W;this.highWaterMark=r?T(this,r,"readableHighWaterMark",a):k(false);this.buffer=new _;this.length=0;this.pipes=[];this.flowing=null;this[q]=null;if(r&&r.emitClose===false)this.state&=~ie;if(r&&r.autoDestroy===false)this.state&=~se;this.errored=null;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.awaitDrainWriters=null;this.decoder=null;this.encoding=null;if(r&&r.encoding){this.decoder=new G(r.encoding);this.encoding=r.encoding}}function Readable(r){if(!(this instanceof Readable))return new Readable(r);const i=this instanceof s(62431);this._readableState=new ReadableState(r,this,i);if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal&&!i)x(r.signal,this)}I.call(this,r);N.construct(this,(()=>{if(this._readableState.needReadable){maybeReadMore(this,this._readableState)}}))}Readable.prototype.destroy=N.destroy;Readable.prototype._undestroy=N.undestroy;Readable.prototype._destroy=function(r,i){i(r)};Readable.prototype[v.captureRejectionSymbol]=function(r){this.destroy(r)};Readable.prototype[b]=function(){let r;if(!this.destroyed){r=this.readableEnded?null:new j;this.destroy(r)}return new g(((i,s)=>R(this,(a=>a&&a!==r?s(a):i(null)))))};Readable.prototype.push=function(r,i){return readableAddChunk(this,r,i,false)};Readable.prototype.unshift=function(r,i){return readableAddChunk(this,r,i,true)};function readableAddChunk(r,i,s,a){Q("readableAddChunk",i);const l=r._readableState;let c;if((l.state&W)===0){if(typeof i==="string"){s=s||l.defaultEncoding;if(l.encoding!==s){if(a&&l.encoding){i=S.from(i,s).toString(l.encoding)}else{i=S.from(i,s);s=""}}}else if(i instanceof S){s=""}else if(I._isUint8Array(i)){i=I._uint8ArrayToBuffer(i);s=""}else if(i!=null){c=new P("chunk",["string","Buffer","Uint8Array"],i)}}if(c){V(r,c)}else if(i===null){l.state&=~$;onEofChunk(r,l)}else if((l.state&W)!==0||i&&i.length>0){if(a){if((l.state&J)!==0)V(r,new U);else if(l.destroyed||l.errored)return false;else addChunk(r,l,i,true)}else if(l.ended){V(r,new M)}else if(l.destroyed||l.errored){return false}else{l.state&=~$;if(l.decoder&&!s){i=l.decoder.write(i);if(l.objectMode||i.length!==0)addChunk(r,l,i,false);else maybeReadMore(r,l)}else{addChunk(r,l,i,false)}}}else if(!a){l.state&=~$;maybeReadMore(r,l)}return!l.ended&&(l.length0){if((i.state&ce)!==0){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}i.dataEmitted=true;r.emit("data",s)}else{i.length+=i.objectMode?1:s.length;if(a)i.buffer.unshift(s);else i.buffer.push(s);if((i.state&Z)!==0)emitReadable(r)}maybeReadMore(r,i)}Readable.prototype.isPaused=function(){const r=this._readableState;return r[q]===true||r.flowing===false};Readable.prototype.setEncoding=function(r){const i=new G(r);this._readableState.decoder=i;this._readableState.encoding=this._readableState.decoder.encoding;const s=this._readableState.buffer;let a="";for(const r of s){a+=i.write(r)}s.clear();if(a!=="")s.push(a);this._readableState.length=a.length;return this};const ue=1073741824;function computeNewHighWaterMark(r){if(r>ue){throw new L("size","<= 1GiB",r)}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if((i.state&W)!==0)return 1;if(d(r)){if(i.flowing&&i.length)return i.buffer.first().length;return i.length}if(r<=i.length)return r;return i.ended?i.length:0}Readable.prototype.read=function(r){Q("read",r);if(r===undefined){r=NaN}else if(!c(r)){r=p(r,10)}const i=this._readableState;const s=r;if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r!==0)i.state&=~ee;if(r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){Q("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}let a=(i.state&Z)!==0;Q("need readable",a);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=i.length<=i.highWaterMark;r=0}else{i.length-=r;if(i.multiAwaitDrain){i.awaitDrainWriters.clear()}else{i.awaitDrainWriters=null}}if(i.length===0){if(!i.ended)i.needReadable=true;if(s!==r&&i.ended)endReadable(this)}if(l!==null&&!i.errorEmitted&&!i.closeEmitted){i.dataEmitted=true;this.emit("data",l)}return l};function onEofChunk(r,i){Q("onEofChunk");if(i.ended)return;if(i.decoder){const r=i.decoder.end();if(r&&r.length){i.buffer.push(r);i.length+=i.objectMode?1:r.length}}i.ended=true;if(i.sync){emitReadable(r)}else{i.needReadable=false;i.emittedReadable=true;emitReadable_(r)}}function emitReadable(r){const i=r._readableState;Q("emitReadable",i.needReadable,i.emittedReadable);i.needReadable=false;if(!i.emittedReadable){Q("emitReadable",i.flowing);i.emittedReadable=true;a.nextTick(emitReadable_,r)}}function emitReadable_(r){const i=r._readableState;Q("emitReadable_",i.destroyed,i.length,i.ended);if(!i.destroyed&&!i.errored&&(i.length||i.ended)){r.emit("readable");i.emittedReadable=false}i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark;flow(r)}function maybeReadMore(r,i){if(!i.readingMore&&i.constructed){i.readingMore=true;a.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){while(!i.reading&&!i.ended&&(i.length1&&l.pipes.includes(r)){Q("false write response, pause",l.awaitDrainWriters.size);l.awaitDrainWriters.add(r)}s.pause()}if(!p){p=pipeOnDrain(s,r);r.on("drain",p)}}s.on("data",ondata);function ondata(i){Q("ondata");const s=r.write(i);Q("dest.write",s);if(s===false){pause()}}function onerror(i){Q("onerror",i);unpipe();r.removeListener("error",onerror);if(r.listenerCount("error")===0){const s=r._writableState||r._readableState;if(s&&!s.errorEmitted){V(r,i)}else{r.emit("error",i)}}}B(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){Q("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){Q("unpipe");s.unpipe(r)}r.emit("pipe",s);if(r.writableNeedDrain===true){pause()}else if(!l.flowing){Q("pipe resume");s.resume()}return r};function pipeOnDrain(r,i){return function pipeOnDrainFunctionResult(){const s=r._readableState;if(s.awaitDrainWriters===i){Q("pipeOnDrain",1);s.awaitDrainWriters=null}else if(s.multiAwaitDrain){Q("pipeOnDrain",s.awaitDrainWriters.size);s.awaitDrainWriters.delete(i)}if((!s.awaitDrainWriters||s.awaitDrainWriters.size===0)&&r.listenerCount("data")){r.resume()}}}Readable.prototype.unpipe=function(r){const i=this._readableState;const s={hasUnpiped:false};if(i.pipes.length===0)return this;if(!r){const r=i.pipes;i.pipes=[];this.pause();for(let i=0;i0;if(l.flowing!==false)this.resume()}else if(r==="readable"){if(!l.endEmitted&&!l.readableListening){l.readableListening=l.needReadable=true;l.flowing=false;l.emittedReadable=false;Q("on readable",l.length,l.reading);if(l.length){emitReadable(this)}else if(!l.reading){a.nextTick(nReadingNextTick,this)}}}return s};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(r,i){const s=I.prototype.removeListener.call(this,r,i);if(r==="readable"){a.nextTick(updateReadableListening,this)}return s};Readable.prototype.off=Readable.prototype.removeListener;Readable.prototype.removeAllListeners=function(r){const i=I.prototype.removeAllListeners.apply(this,arguments);if(r==="readable"||r===undefined){a.nextTick(updateReadableListening,this)}return i};function updateReadableListening(r){const i=r._readableState;i.readableListening=r.listenerCount("readable")>0;if(i.resumeScheduled&&i[q]===false){i.flowing=true}else if(r.listenerCount("data")>0){r.resume()}else if(!i.readableListening){i.flowing=null}}function nReadingNextTick(r){Q("readable nexttick read 0");r.read(0)}Readable.prototype.resume=function(){const r=this._readableState;if(!r.flowing){Q("resume");r.flowing=!r.readableListening;resume(this,r)}r[q]=false;return this};function resume(r,i){if(!i.resumeScheduled){i.resumeScheduled=true;a.nextTick(resume_,r,i)}}function resume_(r,i){Q("resume",i.reading);if(!i.reading){r.read(0)}i.resumeScheduled=false;r.emit("resume");flow(r);if(i.flowing&&!i.reading)r.read(0)}Readable.prototype.pause=function(){Q("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){Q("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState[q]=true;return this};function flow(r){const i=r._readableState;Q("flow",i.flowing);while(i.flowing&&r.read()!==null);}Readable.prototype.wrap=function(r){let i=false;r.on("data",(s=>{if(!this.push(s)&&r.pause){i=true;r.pause()}}));r.on("end",(()=>{this.push(null)}));r.on("error",(r=>{V(this,r)}));r.on("close",(()=>{this.destroy()}));r.on("destroy",(()=>{this.destroy()}));this._read=()=>{if(i&&r.resume){i=false;r.resume()}};const s=A(r);for(let i=1;i{a=r?D(a,r):null;s();s=nop}));try{while(true){const i=r.destroyed?null:r.read();if(i!==null){yield i}else if(a){throw a}else if(a===null){return}else{await new g(next)}}}catch(r){a=D(a,r);throw a}finally{if((a||(i===null||i===undefined?undefined:i.destroyOnReturn)!==false)&&(a===undefined||r._readableState.autoDestroy)){N.destroyer(r,null)}else{r.off("readable",next);l()}}}u(Readable.prototype,{readable:{__proto__:null,get(){const r=this._readableState;return!!r&&r.readable!==false&&!r.destroyed&&!r.errorEmitted&&!r.endEmitted},set(r){if(this._readableState){this._readableState.readable=!!r}}},readableDidRead:{__proto__:null,enumerable:false,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:false,get:function(){return!!(this._readableState.readable!==false&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:false,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:false,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:false,get:function(){return this._readableState.flowing},set:function(r){if(this._readableState){this._readableState.flowing=r}}},readableLength:{__proto__:null,enumerable:false,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.objectMode:false}},readableEncoding:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:false}},destroyed:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.destroyed:false},set(r){if(!this._readableState){return}this._readableState.destroyed=r}},readableEnded:{__proto__:null,enumerable:false,get(){return this._readableState?this._readableState.endEmitted:false}}});u(ReadableState.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[q]!==false},set(r){this[q]=!!r}}});Readable._fromList=fromList;function fromList(r,i){if(i.length===0)return null;let s;if(i.objectMode)s=i.buffer.shift();else if(!r||r>=i.length){if(i.decoder)s=i.buffer.join("");else if(i.buffer.length===1)s=i.buffer.first();else s=i.buffer.concat(i.length);i.buffer.clear()}else{s=i.buffer.consume(r,i.decoder)}return s}function endReadable(r){const i=r._readableState;Q("endReadable",i.endEmitted);if(!i.endEmitted){i.ended=true;a.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){Q("endReadableNT",r.endEmitted,r.length);if(!r.errored&&!r.closeEmitted&&!r.endEmitted&&r.length===0){r.endEmitted=true;i.emit("end");if(i.writable&&i.allowHalfOpen===false){a.nextTick(endWritableNT,i)}else if(r.autoDestroy){const r=i._writableState;const s=!r||r.autoDestroy&&(r.finished||r.writable===false);if(s){i.destroy()}}}}function endWritableNT(r){const i=r.writable&&!r.writableEnded&&!r.destroyed;if(i){r.end()}}Readable.from=function(r,i){return z(Readable,r,i)};let Ae;function lazyWebStreams(){if(Ae===undefined)Ae={};return Ae}Readable.fromWeb=function(r,i){return lazyWebStreams().newStreamReadableFromReadableStream(r,i)};Readable.toWeb=function(r,i){return lazyWebStreams().newReadableStreamFromStreamReadable(r,i)};Readable.wrap=function(r,i){var s,a;return new Readable({objectMode:(s=(a=r.readableObjectMode)!==null&&a!==undefined?a:r.objectMode)!==null&&s!==undefined?s:true,...i,destroy(i,s){N.destroyer(r,i);s(i)}}).wrap(r)}},98225:(r,i,s)=>{"use strict";const{MathFloor:a,NumberIsInteger:l}=s(78368);const{validateInteger:c}=s(20836);const{ERR_INVALID_ARG_VALUE:d}=s(5312).codes;let p=16*1024;let u=16;function highWaterMarkFrom(r,i,s){return r.highWaterMark!=null?r.highWaterMark:i?r[s]:null}function getDefaultHighWaterMark(r){return r?u:p}function setDefaultHighWaterMark(r,i){c(i,"value",0);if(r){u=i}else{p=i}}function getHighWaterMark(r,i,s,c){const p=highWaterMarkFrom(i,c,s);if(p!=null){if(!l(p)||p<0){const r=c?`options.${s}`:"options.highWaterMark";throw new d(r,p)}return a(p)}return getDefaultHighWaterMark(r.objectMode)}r.exports={getHighWaterMark:getHighWaterMark,getDefaultHighWaterMark:getDefaultHighWaterMark,setDefaultHighWaterMark:setDefaultHighWaterMark}},37202:(r,i,s)=>{"use strict";const{ObjectSetPrototypeOf:a,Symbol:l}=s(78368);r.exports=Transform;const{ERR_METHOD_NOT_IMPLEMENTED:c}=s(5312).codes;const d=s(62431);const{getHighWaterMark:p}=s(98225);a(Transform.prototype,d.prototype);a(Transform,d);const u=l("kCallback");function Transform(r){if(!(this instanceof Transform))return new Transform(r);const i=r?p(this,r,"readableHighWaterMark",true):null;if(i===0){r={...r,highWaterMark:null,readableHighWaterMark:i,writableHighWaterMark:r.writableHighWaterMark||0}}d.call(this,r);this._readableState.sync=false;this[u]=null;if(r){if(typeof r.transform==="function")this._transform=r.transform;if(typeof r.flush==="function")this._flush=r.flush}this.on("prefinish",prefinish)}function final(r){if(typeof this._flush==="function"&&!this.destroyed){this._flush(((i,s)=>{if(i){if(r){r(i)}else{this.destroy(i)}return}if(s!=null){this.push(s)}this.push(null);if(r){r()}}))}else{this.push(null);if(r){r()}}}function prefinish(){if(this._final!==final){final.call(this)}}Transform.prototype._final=final;Transform.prototype._transform=function(r,i,s){throw new c("_transform()")};Transform.prototype._write=function(r,i,s){const a=this._readableState;const l=this._writableState;const c=a.length;this._transform(r,i,((r,i)=>{if(r){s(r);return}if(i!=null){this.push(i)}if(l.ended||c===a.length||a.length{"use strict";const{SymbolAsyncIterator:a,SymbolIterator:l,SymbolFor:c}=s(78368);const d=c("nodejs.stream.destroyed");const p=c("nodejs.stream.errored");const u=c("nodejs.stream.readable");const A=c("nodejs.stream.writable");const h=c("nodejs.stream.disturbed");const g=c("nodejs.webstream.isClosedPromise");const y=c("nodejs.webstream.controllerErrorFunction");function isReadableNodeStream(r,i=false){var s;return!!(r&&typeof r.pipe==="function"&&typeof r.on==="function"&&(!i||typeof r.pause==="function"&&typeof r.resume==="function")&&(!r._writableState||((s=r._readableState)===null||s===undefined?undefined:s.readable)!==false)&&(!r._writableState||r._readableState))}function isWritableNodeStream(r){var i;return!!(r&&typeof r.write==="function"&&typeof r.on==="function"&&(!r._readableState||((i=r._writableState)===null||i===undefined?undefined:i.writable)!==false))}function isDuplexNodeStream(r){return!!(r&&typeof r.pipe==="function"&&r._readableState&&typeof r.on==="function"&&typeof r.write==="function")}function isNodeStream(r){return r&&(r._readableState||r._writableState||typeof r.write==="function"&&typeof r.on==="function"||typeof r.pipe==="function"&&typeof r.on==="function")}function isReadableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.pipeThrough==="function"&&typeof r.getReader==="function"&&typeof r.cancel==="function")}function isWritableStream(r){return!!(r&&!isNodeStream(r)&&typeof r.getWriter==="function"&&typeof r.abort==="function")}function isTransformStream(r){return!!(r&&!isNodeStream(r)&&typeof r.readable==="object"&&typeof r.writable==="object")}function isWebStream(r){return isReadableStream(r)||isWritableStream(r)||isTransformStream(r)}function isIterable(r,i){if(r==null)return false;if(i===true)return typeof r[a]==="function";if(i===false)return typeof r[l]==="function";return typeof r[a]==="function"||typeof r[l]==="function"}function isDestroyed(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!!(r.destroyed||r[d]||a!==null&&a!==undefined&&a.destroyed)}function isWritableEnded(r){if(!isWritableNodeStream(r))return null;if(r.writableEnded===true)return true;const i=r._writableState;if(i!==null&&i!==undefined&&i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isWritableFinished(r,i){if(!isWritableNodeStream(r))return null;if(r.writableFinished===true)return true;const s=r._writableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.finished)!=="boolean")return null;return!!(s.finished||i===false&&s.ended===true&&s.length===0)}function isReadableEnded(r){if(!isReadableNodeStream(r))return null;if(r.readableEnded===true)return true;const i=r._readableState;if(!i||i.errored)return false;if(typeof(i===null||i===undefined?undefined:i.ended)!=="boolean")return null;return i.ended}function isReadableFinished(r,i){if(!isReadableNodeStream(r))return null;const s=r._readableState;if(s!==null&&s!==undefined&&s.errored)return false;if(typeof(s===null||s===undefined?undefined:s.endEmitted)!=="boolean")return null;return!!(s.endEmitted||i===false&&s.ended===true&&s.length===0)}function isReadable(r){if(r&&r[u]!=null)return r[u];if(typeof(r===null||r===undefined?undefined:r.readable)!=="boolean")return null;if(isDestroyed(r))return false;return isReadableNodeStream(r)&&r.readable&&!isReadableFinished(r)}function isWritable(r){if(r&&r[A]!=null)return r[A];if(typeof(r===null||r===undefined?undefined:r.writable)!=="boolean")return null;if(isDestroyed(r))return false;return isWritableNodeStream(r)&&r.writable&&!isWritableEnded(r)}function isFinished(r,i){if(!isNodeStream(r)){return null}if(isDestroyed(r)){return true}if((i===null||i===undefined?undefined:i.readable)!==false&&isReadable(r)){return false}if((i===null||i===undefined?undefined:i.writable)!==false&&isWritable(r)){return false}return true}function isWritableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.writableErrored){return r.writableErrored}return(i=(s=r._writableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isReadableErrored(r){var i,s;if(!isNodeStream(r)){return null}if(r.readableErrored){return r.readableErrored}return(i=(s=r._readableState)===null||s===undefined?undefined:s.errored)!==null&&i!==undefined?i:null}function isClosed(r){if(!isNodeStream(r)){return null}if(typeof r.closed==="boolean"){return r.closed}const i=r._writableState;const s=r._readableState;if(typeof(i===null||i===undefined?undefined:i.closed)==="boolean"||typeof(s===null||s===undefined?undefined:s.closed)==="boolean"){return(i===null||i===undefined?undefined:i.closed)||(s===null||s===undefined?undefined:s.closed)}if(typeof r._closed==="boolean"&&isOutgoingMessage(r)){return r._closed}return null}function isOutgoingMessage(r){return typeof r._closed==="boolean"&&typeof r._defaultKeepAlive==="boolean"&&typeof r._removedConnection==="boolean"&&typeof r._removedContLen==="boolean"}function isServerResponse(r){return typeof r._sent100==="boolean"&&isOutgoingMessage(r)}function isServerRequest(r){var i;return typeof r._consuming==="boolean"&&typeof r._dumped==="boolean"&&((i=r.req)===null||i===undefined?undefined:i.upgradeOrConnect)===undefined}function willEmitClose(r){if(!isNodeStream(r))return null;const i=r._writableState;const s=r._readableState;const a=i||s;return!a&&isServerResponse(r)||!!(a&&a.autoDestroy&&a.emitClose&&a.closed===false)}function isDisturbed(r){var i;return!!(r&&((i=r[h])!==null&&i!==undefined?i:r.readableDidRead||r.readableAborted))}function isErrored(r){var i,s,a,l,c,d,u,A,h,g;return!!(r&&((i=(s=(a=(l=(c=(d=r[p])!==null&&d!==undefined?d:r.readableErrored)!==null&&c!==undefined?c:r.writableErrored)!==null&&l!==undefined?l:(u=r._readableState)===null||u===undefined?undefined:u.errorEmitted)!==null&&a!==undefined?a:(A=r._writableState)===null||A===undefined?undefined:A.errorEmitted)!==null&&s!==undefined?s:(h=r._readableState)===null||h===undefined?undefined:h.errored)!==null&&i!==undefined?i:(g=r._writableState)===null||g===undefined?undefined:g.errored))}r.exports={isDestroyed:isDestroyed,kIsDestroyed:d,isDisturbed:isDisturbed,kIsDisturbed:h,isErrored:isErrored,kIsErrored:p,isReadable:isReadable,kIsReadable:u,kIsClosedPromise:g,kControllerErrorFunction:y,kIsWritable:A,isClosed:isClosed,isDuplexNodeStream:isDuplexNodeStream,isFinished:isFinished,isIterable:isIterable,isReadableNodeStream:isReadableNodeStream,isReadableStream:isReadableStream,isReadableEnded:isReadableEnded,isReadableFinished:isReadableFinished,isReadableErrored:isReadableErrored,isNodeStream:isNodeStream,isWebStream:isWebStream,isWritable:isWritable,isWritableNodeStream:isWritableNodeStream,isWritableStream:isWritableStream,isWritableEnded:isWritableEnded,isWritableFinished:isWritableFinished,isWritableErrored:isWritableErrored,isServerRequest:isServerRequest,isServerResponse:isServerResponse,willEmitClose:willEmitClose,isTransformStream:isTransformStream}},24331:(r,i,s)=>{const a=s(53568);"use strict";const{ArrayPrototypeSlice:l,Error:c,FunctionPrototypeSymbolHasInstance:d,ObjectDefineProperty:p,ObjectDefineProperties:u,ObjectSetPrototypeOf:A,StringPrototypeToLowerCase:h,Symbol:g,SymbolHasInstance:y}=s(78368);r.exports=Writable;Writable.WritableState=WritableState;const{EventEmitter:b}=s(82361);const w=s(42869).Stream;const{Buffer:C}=s(14300);const v=s(13586);const{addAbortSignal:I}=s(59558);const{getHighWaterMark:B,getDefaultHighWaterMark:S}=s(98225);const{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_MULTIPLE_CALLBACK:Q,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:k,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:P}=s(5312).codes;const{errorOrDestroy:O}=v;A(Writable.prototype,w.prototype);A(Writable,w);function nop(){}const L=g("kOnFinished");function WritableState(r,i,a){if(typeof a!=="boolean")a=i instanceof s(62431);this.objectMode=!!(r&&r.objectMode);if(a)this.objectMode=this.objectMode||!!(r&&r.writableObjectMode);this.highWaterMark=r?B(this,r,"writableHighWaterMark",a):S(false);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;const l=!!(r&&r.decodeStrings===false);this.decodeStrings=!l;this.defaultEncoding=r&&r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=onwrite.bind(undefined,i);this.writecb=null;this.writelen=0;this.afterWriteTickInfo=null;resetBuffer(this);this.pendingcb=0;this.constructed=true;this.prefinished=false;this.errorEmitted=false;this.emitClose=!r||r.emitClose!==false;this.autoDestroy=!r||r.autoDestroy!==false;this.errored=null;this.closed=false;this.closeEmitted=false;this[L]=[]}function resetBuffer(r){r.buffered=[];r.bufferedIndex=0;r.allBuffers=true;r.allNoop=true}WritableState.prototype.getBuffer=function getBuffer(){return l(this.buffered,this.bufferedIndex)};p(WritableState.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Writable(r){const i=this instanceof s(62431);if(!i&&!d(Writable,this))return new Writable(r);this._writableState=new WritableState(r,this,i);if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final;if(typeof r.construct==="function")this._construct=r.construct;if(r.signal)I(r.signal,this)}w.call(this,r);v.construct(this,(()=>{const r=this._writableState;if(!r.writing){clearBuffer(this,r)}finishMaybe(this,r)}))}p(Writable,y,{__proto__:null,value:function(r){if(d(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}});Writable.prototype.pipe=function(){O(this,new _)};function _write(r,i,s,l){const c=r._writableState;if(typeof s==="function"){l=s;s=c.defaultEncoding}else{if(!s)s=c.defaultEncoding;else if(s!=="buffer"&&!C.isEncoding(s))throw new P(s);if(typeof l!=="function")l=nop}if(i===null){throw new k}else if(!c.objectMode){if(typeof i==="string"){if(c.decodeStrings!==false){i=C.from(i,s);s="buffer"}}else if(i instanceof C){s="buffer"}else if(w._isUint8Array(i)){i=w._uint8ArrayToBuffer(i);s="buffer"}else{throw new x("chunk",["string","Buffer","Uint8Array"],i)}}let d;if(c.ending){d=new D}else if(c.destroyed){d=new N("write")}if(d){a.nextTick(l,d);O(r,d,true);return d}c.pendingcb++;return writeOrBuffer(r,c,i,s,l)}Writable.prototype.write=function(r,i,s){return _write(this,r,i,s)===true};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){const r=this._writableState;if(r.corked){r.corked--;if(!r.writing)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=h(r);if(!C.isEncoding(r))throw new P(r);this._writableState.defaultEncoding=r;return this};function writeOrBuffer(r,i,s,a,l){const c=i.objectMode?1:s.length;i.length+=c;const d=i.lengths.bufferedIndex){clearBuffer(r,s)}if(l){if(s.afterWriteTickInfo!==null&&s.afterWriteTickInfo.cb===c){s.afterWriteTickInfo.count++}else{s.afterWriteTickInfo={count:1,cb:c,stream:r,state:s};a.nextTick(afterWriteTick,s.afterWriteTickInfo)}}else{afterWrite(r,s,1,c)}}}function afterWriteTick({stream:r,state:i,count:s,cb:a}){i.afterWriteTickInfo=null;return afterWrite(r,i,s,a)}function afterWrite(r,i,s,a){const l=!i.ending&&!r.destroyed&&i.length===0&&i.needDrain;if(l){i.needDrain=false;r.emit("drain")}while(s-- >0){i.pendingcb--;a()}if(i.destroyed){errorBuffer(i)}finishMaybe(r,i)}function errorBuffer(r){if(r.writing){return}for(let s=r.bufferedIndex;s1&&r._writev){i.pendingcb-=d-1;const a=i.allNoop?nop:r=>{for(let i=p;i256){s.splice(0,p);i.bufferedIndex=0}else{i.bufferedIndex=p}}i.bufferProcessing=false}Writable.prototype._write=function(r,i,s){if(this._writev){this._writev([{chunk:r,encoding:i}],s)}else{throw new R("_write()")}};Writable.prototype._writev=null;Writable.prototype.end=function(r,i,s){const l=this._writableState;if(typeof r==="function"){s=r;r=null;i=null}else if(typeof i==="function"){s=i;i=null}let d;if(r!==null&&r!==undefined){const s=_write(this,r,i);if(s instanceof c){d=s}}if(l.corked){l.corked=1;this.uncork()}if(d){}else if(!l.errored&&!l.ending){l.ending=true;finishMaybe(this,l,true);l.ended=true}else if(l.finished){d=new T("end")}else if(l.destroyed){d=new N("end")}if(typeof s==="function"){if(d||l.finished){a.nextTick(s,d)}else{l[L].push(s)}}return this};function needFinish(r){return r.ending&&!r.destroyed&&r.constructed&&r.length===0&&!r.errored&&r.buffered.length===0&&!r.finished&&!r.writing&&!r.errorEmitted&&!r.closeEmitted}function callFinal(r,i){let s=false;function onFinish(l){if(s){O(r,l!==null&&l!==undefined?l:Q());return}s=true;i.pendingcb--;if(l){const s=i[L].splice(0);for(let r=0;r{if(needFinish(i)){finish(r,i)}else{i.pendingcb--}}),r,i)}else if(needFinish(i)){i.pendingcb++;finish(r,i)}}}}function finish(r,i){i.pendingcb--;i.finished=true;const s=i[L].splice(0);for(let r=0;r{"use strict";const{ArrayIsArray:a,ArrayPrototypeIncludes:l,ArrayPrototypeJoin:c,ArrayPrototypeMap:d,NumberIsInteger:p,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:A,NumberMIN_SAFE_INTEGER:h,NumberParseInt:g,ObjectPrototypeHasOwnProperty:y,RegExpPrototypeExec:b,String:w,StringPrototypeToUpperCase:C,StringPrototypeTrim:v}=s(78368);const{hideStackFrames:I,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:S,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:R,ERR_UNKNOWN_SIGNAL:Q}}=s(5312);const{normalizeEncoding:_}=s(12973);const{isAsyncFunction:N,isArrayBufferView:T}=s(12973).types;const k={};function isInt32(r){return r===(r|0)}function isUint32(r){return r===r>>>0}const D=/^[0-7]+$/;const P="must be a 32-bit unsigned integer or an octal string";function parseFileMode(r,i,s){if(typeof r==="undefined"){r=s}if(typeof r==="string"){if(b(D,r)===null){throw new x(i,r,P)}r=g(r,8)}M(r,i);return r}const O=I(((r,i,s=h,a=A)=>{if(typeof r!=="number")throw new S(i,"number",r);if(!p(r))throw new R(i,"an integer",r);if(ra)throw new R(i,`>= ${s} && <= ${a}`,r)}));const L=I(((r,i,s=-2147483648,a=2147483647)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}if(ra){throw new R(i,`>= ${s} && <= ${a}`,r)}}));const M=I(((r,i,s=false)=>{if(typeof r!=="number"){throw new S(i,"number",r)}if(!p(r)){throw new R(i,"an integer",r)}const a=s?1:0;const l=4294967295;if(rl){throw new R(i,`>= ${a} && <= ${l}`,r)}}));function validateString(r,i){if(typeof r!=="string")throw new S(i,"string",r)}function validateNumber(r,i,s=undefined,a){if(typeof r!=="number")throw new S(i,"number",r);if(s!=null&&ra||(s!=null||a!=null)&&u(r)){throw new R(i,`${s!=null?`>= ${s}`:""}${s!=null&&a!=null?" && ":""}${a!=null?`<= ${a}`:""}`,r)}}const U=I(((r,i,s)=>{if(!l(s,r)){const a=c(d(s,(r=>typeof r==="string"?`'${r}'`:w(r))),", ");const l="must be one of: "+a;throw new x(i,r,l)}}));function validateBoolean(r,i){if(typeof r!=="boolean")throw new S(i,"boolean",r)}function getOwnPropertyValueOrDefault(r,i,s){return r==null||!y(r,i)?s:r[i]}const j=I(((r,i,s=null)=>{const l=getOwnPropertyValueOrDefault(s,"allowArray",false);const c=getOwnPropertyValueOrDefault(s,"allowFunction",false);const d=getOwnPropertyValueOrDefault(s,"nullable",false);if(!d&&r===null||!l&&a(r)||typeof r!=="object"&&(!c||typeof r!=="function")){throw new S(i,"Object",r)}}));const H=I(((r,i)=>{if(r!=null&&typeof r!=="object"&&typeof r!=="function"){throw new S(i,"a dictionary",r)}}));const q=I(((r,i,s=0)=>{if(!a(r)){throw new S(i,"Array",r)}if(r.length{if(!T(r)){throw new S(i,["Buffer","TypedArray","DataView"],r)}}));function validateEncoding(r,i){const s=_(i);const a=r.length;if(s==="hex"&&a%2!==0){throw new x("encoding",i,`is invalid for data of length ${a}`)}}function validatePort(r,i="Port",s=true){if(typeof r!=="number"&&typeof r!=="string"||typeof r==="string"&&v(r).length===0||+r!==+r>>>0||r>65535||r===0&&!s){throw new B(i,r,s)}return r|0}const z=I(((r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new S(i,"AbortSignal",r)}}));const V=I(((r,i)=>{if(typeof r!=="function")throw new S(i,"Function",r)}));const W=I(((r,i)=>{if(typeof r!=="function"||N(r))throw new S(i,"Function",r)}));const Y=I(((r,i)=>{if(r!==undefined)throw new S(i,"undefined",r)}));function validateUnion(r,i,s){if(!l(s,r)){throw new S(i,`('${c(s,"|")}')`,r)}}const J=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function validateLinkHeaderFormat(r,i){if(typeof r==="undefined"||!b(J,r)){throw new x(i,r,'must be an array or string of format "; rel=preload; as=style"')}}function validateLinkHeaderValue(r){if(typeof r==="string"){validateLinkHeaderFormat(r,"hints");return r}else if(a(r)){const i=r.length;let s="";if(i===0){return s}for(let a=0;a; rel=preload; as=style"')}r.exports={isInt32:isInt32,isUint32:isUint32,parseFileMode:parseFileMode,validateArray:q,validateStringArray:validateStringArray,validateBooleanArray:validateBooleanArray,validateAbortSignalArray:validateAbortSignalArray,validateBoolean:validateBoolean,validateBuffer:G,validateDictionary:H,validateEncoding:validateEncoding,validateFunction:V,validateInt32:L,validateInteger:O,validateNumber:validateNumber,validateObject:j,validateOneOf:U,validatePlainFunction:W,validatePort:validatePort,validateSignalName:validateSignalName,validateString:validateString,validateUint32:M,validateUndefined:Y,validateUnion:validateUnion,validateAbortSignal:z,validateLinkHeaderValue:validateLinkHeaderValue}},5312:(r,i,s)=>{"use strict";const{format:a,inspect:l,AggregateError:c}=s(12973);const d=globalThis.AggregateError||c;const p=Symbol("kIsNodeError");const u=["string","function","number","object","Function","Object","boolean","bigint","symbol"];const A=/^([A-Z][a-z0-9]*)+$/;const h="__node_internal_";const g={};function assert(r,i){if(!r){throw new g.ERR_INTERNAL_ASSERTION(i)}}function addNumericalSeparator(r){let i="";let s=r.length;const a=r[0]==="-"?1:0;for(;s>=a+4;s-=3){i=`_${r.slice(s-3,s)}${i}`}return`${r.slice(0,s)}${i}`}function getMessage(r,i,s){if(typeof i==="function"){assert(i.length<=s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${i.length}).`);return i(...s)}const l=(i.match(/%[dfijoOs]/g)||[]).length;assert(l===s.length,`Code: ${r}; The provided arguments length (${s.length}) does not match the required ones (${l}).`);if(s.length===0){return i}return a(i,...s)}function E(r,i,s){if(!s){s=Error}class NodeError extends s{constructor(...s){super(getMessage(r,i,s))}toString(){return`${this.name} [${r}]: ${this.message}`}}Object.defineProperties(NodeError.prototype,{name:{value:s.name,writable:true,enumerable:false,configurable:true},toString:{value(){return`${this.name} [${r}]: ${this.message}`},writable:true,enumerable:false,configurable:true}});NodeError.prototype.code=r;NodeError.prototype[p]=true;g[r]=NodeError}function hideStackFrames(r){const i=h+r.name;Object.defineProperty(r,"name",{value:i});return r}function aggregateTwoErrors(r,i){if(r&&i&&r!==i){if(Array.isArray(i.errors)){i.errors.push(r);return i}const s=new d([i,r],i.message);s.code=i.code;return s}return r||i}class AbortError extends Error{constructor(r="The operation was aborted",i=undefined){if(i!==undefined&&typeof i!=="object"){throw new g.ERR_INVALID_ARG_TYPE("options","Object",i)}super(r,i);this.code="ABORT_ERR";this.name="AbortError"}}E("ERR_ASSERTION","%s",Error);E("ERR_INVALID_ARG_TYPE",((r,i,s)=>{assert(typeof r==="string","'name' must be a string");if(!Array.isArray(i)){i=[i]}let a="The ";if(r.endsWith(" argument")){a+=`${r} `}else{a+=`"${r}" ${r.includes(".")?"property":"argument"} `}a+="must be ";const c=[];const d=[];const p=[];for(const r of i){assert(typeof r==="string","All expected entries have to be of type string");if(u.includes(r)){c.push(r.toLowerCase())}else if(A.test(r)){d.push(r)}else{assert(r!=="object",'The value "object" should be written as "Object"');p.push(r)}}if(d.length>0){const r=c.indexOf("object");if(r!==-1){c.splice(c,r,1);d.push("Object")}}if(c.length>0){switch(c.length){case 1:a+=`of type ${c[0]}`;break;case 2:a+=`one of type ${c[0]} or ${c[1]}`;break;default:{const r=c.pop();a+=`one of type ${c.join(", ")}, or ${r}`}}if(d.length>0||p.length>0){a+=" or "}}if(d.length>0){switch(d.length){case 1:a+=`an instance of ${d[0]}`;break;case 2:a+=`an instance of ${d[0]} or ${d[1]}`;break;default:{const r=d.pop();a+=`an instance of ${d.join(", ")}, or ${r}`}}if(p.length>0){a+=" or "}}switch(p.length){case 0:break;case 1:if(p[0].toLowerCase()!==p[0]){a+="an "}a+=`${p[0]}`;break;case 2:a+=`one of ${p[0]} or ${p[1]}`;break;default:{const r=p.pop();a+=`one of ${p.join(", ")}, or ${r}`}}if(s==null){a+=`. Received ${s}`}else if(typeof s==="function"&&s.name){a+=`. Received function ${s.name}`}else if(typeof s==="object"){var h;if((h=s.constructor)!==null&&h!==undefined&&h.name){a+=`. Received an instance of ${s.constructor.name}`}else{const r=l(s,{depth:-1});a+=`. Received ${r}`}}else{let r=l(s,{colors:false});if(r.length>25){r=`${r.slice(0,25)}...`}a+=`. Received type ${typeof s} (${r})`}return a}),TypeError);E("ERR_INVALID_ARG_VALUE",((r,i,s="is invalid")=>{let a=l(i);if(a.length>128){a=a.slice(0,128)+"..."}const c=r.includes(".")?"property":"argument";return`The ${c} '${r}' ${s}. Received ${a}`}),TypeError);E("ERR_INVALID_RETURN_VALUE",((r,i,s)=>{var a;const l=s!==null&&s!==undefined&&(a=s.constructor)!==null&&a!==undefined&&a.name?`instance of ${s.constructor.name}`:`type ${typeof s}`;return`Expected ${r} to be returned from the "${i}"`+` function but got ${l}.`}),TypeError);E("ERR_MISSING_ARGS",((...r)=>{assert(r.length>0,"At least one arg needs to be specified");let i;const s=r.length;r=(Array.isArray(r)?r:[r]).map((r=>`"${r}"`)).join(" or ");switch(s){case 1:i+=`The ${r[0]} argument`;break;case 2:i+=`The ${r[0]} and ${r[1]} arguments`;break;default:{const s=r.pop();i+=`The ${r.join(", ")}, and ${s} arguments`}break}return`${i} must be specified`}),TypeError);E("ERR_OUT_OF_RANGE",((r,i,s)=>{assert(i,'Missing "range" argument');let a;if(Number.isInteger(s)&&Math.abs(s)>2**32){a=addNumericalSeparator(String(s))}else if(typeof s==="bigint"){a=String(s);if(s>2n**32n||s<-(2n**32n)){a=addNumericalSeparator(a)}a+="n"}else{a=l(s)}return`The value of "${r}" is out of range. It must be ${i}. Received ${a}`}),RangeError);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);E("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);E("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);E("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);E("ERR_STREAM_WRITE_AFTER_END","write after end",Error);E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);r.exports={AbortError:AbortError,aggregateTwoErrors:hideStackFrames(aggregateTwoErrors),hideStackFrames:hideStackFrames,codes:g}},70672:(r,i,s)=>{"use strict";const a=s(12781);if(a&&process.env.READABLE_STREAM==="disable"){const i=a.promises;r.exports._uint8ArrayToBuffer=a._uint8ArrayToBuffer;r.exports._isUint8Array=a._isUint8Array;r.exports.isDisturbed=a.isDisturbed;r.exports.isErrored=a.isErrored;r.exports.isReadable=a.isReadable;r.exports.Readable=a.Readable;r.exports.Writable=a.Writable;r.exports.Duplex=a.Duplex;r.exports.Transform=a.Transform;r.exports.PassThrough=a.PassThrough;r.exports.addAbortSignal=a.addAbortSignal;r.exports.finished=a.finished;r.exports.destroy=a.destroy;r.exports.pipeline=a.pipeline;r.exports.compose=a.compose;Object.defineProperty(a,"promises",{configurable:true,enumerable:true,get(){return i}});r.exports.Stream=a.Stream}else{const i=s(49756);const a=s(45199);const l=i.Readable.destroy;r.exports=i.Readable;r.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer;r.exports._isUint8Array=i._isUint8Array;r.exports.isDisturbed=i.isDisturbed;r.exports.isErrored=i.isErrored;r.exports.isReadable=i.isReadable;r.exports.Readable=i.Readable;r.exports.Writable=i.Writable;r.exports.Duplex=i.Duplex;r.exports.Transform=i.Transform;r.exports.PassThrough=i.PassThrough;r.exports.addAbortSignal=i.addAbortSignal;r.exports.finished=i.finished;r.exports.destroy=i.destroy;r.exports.destroy=l;r.exports.pipeline=i.pipeline;r.exports.compose=i.compose;Object.defineProperty(i,"promises",{configurable:true,enumerable:true,get(){return a}});r.exports.Stream=i.Stream}r.exports["default"]=r.exports},78368:r=>{"use strict";r.exports={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,i){return r.includes(i)},ArrayPrototypeIndexOf(r,i){return r.indexOf(i)},ArrayPrototypeJoin(r,i){return r.join(i)},ArrayPrototypeMap(r,i){return r.map(i)},ArrayPrototypePop(r,i){return r.pop(i)},ArrayPrototypePush(r,i){return r.push(i)},ArrayPrototypeSlice(r,i,s){return r.slice(i,s)},Error:Error,FunctionPrototypeCall(r,i,...s){return r.call(i,...s)},FunctionPrototypeSymbolHasInstance(r,i){return Function.prototype[Symbol.hasInstance].call(r,i)},MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,i){return Object.defineProperties(r,i)},ObjectDefineProperty(r,i,s){return Object.defineProperty(r,i,s)},ObjectGetOwnPropertyDescriptor(r,i){return Object.getOwnPropertyDescriptor(r,i)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,i){return Object.setPrototypeOf(r,i)},Promise:Promise,PromisePrototypeCatch(r,i){return r.catch(i)},PromisePrototypeThen(r,i,s){return r.then(i,s)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,i){return r.test(i)},SafeSet:Set,String:String,StringPrototypeSlice(r,i,s){return r.slice(i,s)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,i,s){return r.set(i,s)},Boolean:Boolean,Uint8Array:Uint8Array}},12973:(r,i,s)=>{"use strict";const a=s(14300);const{kResistStopPropagation:l,SymbolDispose:c}=s(78368);const d=globalThis.AbortSignal||s(24995).AbortSignal;const p=globalThis.AbortController||s(24995).AbortController;const u=Object.getPrototypeOf((async function(){})).constructor;const A=globalThis.Blob||a.Blob;const h=typeof A!=="undefined"?function isBlob(r){return r instanceof A}:function isBlob(r){return false};const validateAbortSignal=(r,i)=>{if(r!==undefined&&(r===null||typeof r!=="object"||!("aborted"in r))){throw new ERR_INVALID_ARG_TYPE(i,"AbortSignal",r)}};const validateFunction=(r,i)=>{if(typeof r!=="function")throw new ERR_INVALID_ARG_TYPE(i,"Function",r)};class AggregateError extends Error{constructor(r){if(!Array.isArray(r)){throw new TypeError(`Expected input to be an Array, got ${typeof r}`)}let i="";for(let s=0;s{r=s;i=a}));return{promise:s,resolve:r,reject:i}},promisify(r){return new Promise(((i,s)=>{r(((r,...a)=>{if(r){return s(r)}return i(...a)}))}))},debuglog(){return function(){}},format(r,...i){return r.replace(/%([sdifj])/g,(function(...[r,s]){const a=i.shift();if(s==="f"){return a.toFixed(6)}else if(s==="j"){return JSON.stringify(a)}else if(s==="s"&&typeof a==="object"){const r=a.constructor!==Object?a.constructor.name:"";return`${r} {}`.trim()}else{return a.toString()}}))},inspect(r){switch(typeof r){case"string":if(r.includes("'")){if(!r.includes('"')){return`"${r}"`}else if(!r.includes("`")&&!r.includes("${")){return`\`${r}\``}}return`'${r}'`;case"number":if(isNaN(r)){return"NaN"}else if(Object.is(r,-0)){return String(r)}return r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}},types:{isAsyncFunction(r){return r instanceof u},isArrayBufferView(r){return ArrayBuffer.isView(r)}},isBlob:h,deprecate(r,i){return r},addAbortListener:s(82361).addAbortListener||function addAbortListener(r,i){if(r===undefined){throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",r)}validateAbortSignal(r,"signal");validateFunction(i,"listener");let s;if(r.aborted){queueMicrotask((()=>i()))}else{r.addEventListener("abort",i,{__proto__:null,once:true,[l]:true});s=()=>{r.removeEventListener("abort",i)}}return{__proto__:null,[c](){var r;(r=s)===null||r===undefined?undefined:r()}}},AbortSignalAny:d.any||function AbortSignalAny(r){if(r.length===1){return r[0]}const i=new p;const abort=()=>i.abort();r.forEach((r=>{validateAbortSignal(r,"signals");r.addEventListener("abort",abort,{once:true})}));i.signal.addEventListener("abort",(()=>{r.forEach((r=>r.removeEventListener("abort",abort)))}),{once:true});return i.signal}};r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},49756:(r,i,s)=>{const{Buffer:a}=s(14300);"use strict";const{ObjectDefineProperty:l,ObjectKeys:c,ReflectApply:d}=s(78368);const{promisify:{custom:p}}=s(12973);const{streamReturningOperators:u,promiseReturningOperators:A}=s(25244);const{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=s(5312);const g=s(29423);const{setDefaultHighWaterMark:y,getDefaultHighWaterMark:b}=s(98225);const{pipeline:w}=s(93345);const{destroyer:C}=s(13586);const v=s(7002);const I={};const B=s(45199);const S=s(98535);const x=r.exports=s(42869).Stream;x.isDestroyed=S.isDestroyed;x.isDisturbed=S.isDisturbed;x.isErrored=S.isErrored;x.isReadable=S.isReadable;x.isWritable=S.isWritable;x.Readable=s(75182);for(const Q of c(u)){const _=u[Q];function fn(...r){if(new.target){throw h()}return x.Readable.from(d(_,this,r))}l(fn,"name",{__proto__:null,value:_.name});l(fn,"length",{__proto__:null,value:_.length});l(x.Readable.prototype,Q,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}for(const N of c(A)){const T=A[N];function fn(...r){if(new.target){throw h()}return d(T,this,r)}l(fn,"name",{__proto__:null,value:T.name});l(fn,"length",{__proto__:null,value:T.length});l(x.Readable.prototype,N,{__proto__:null,value:fn,enumerable:false,configurable:true,writable:true})}x.Writable=s(24331);x.Duplex=s(62431);x.Transform=s(37202);x.PassThrough=s(55748);x.pipeline=w;const{addAbortSignal:R}=s(59558);x.addAbortSignal=R;x.finished=v;x.destroy=C;x.compose=g;x.setDefaultHighWaterMark=y;x.getDefaultHighWaterMark=b;l(x,"promises",{__proto__:null,configurable:true,enumerable:true,get(){return B}});l(w,p,{__proto__:null,enumerable:true,get(){return B.pipeline}});l(v,p,{__proto__:null,enumerable:true,get(){return B.finished}});x.Stream=x;x._isUint8Array=function isUint8Array(r){return r instanceof Uint8Array};x._uint8ArrayToBuffer=function _uint8ArrayToBuffer(r){return a.from(r.buffer,r.byteOffset,r.byteLength)}},45199:(r,i,s)=>{"use strict";const{ArrayPrototypePop:a,Promise:l}=s(78368);const{isIterable:c,isNodeStream:d,isWebStream:p}=s(98535);const{pipelineImpl:u}=s(93345);const{finished:A}=s(7002);s(49756);function pipeline(...r){return new l(((i,s)=>{let l;let A;const h=r[r.length-1];if(h&&typeof h==="object"&&!d(h)&&!c(h)&&!p(h)){const i=a(r);l=i.signal;A=i.end}u(r,((r,a)=>{if(r){s(r)}else{i(a)}}),{signal:l,end:A})}))}r.exports={finished:A,pipeline:pipeline}},83908:(r,i,s)=>{var a=s(12781).Stream;var l=s(73837);r.exports=DelayedStream;function DelayedStream(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}l.inherits(DelayedStream,a);DelayedStream.create=function(r,i){var s=new this;i=i||{};for(var a in i){s[a]=i[a]}s.source=r;var l=r.emit;r.emit=function(){s._handleEmit(arguments);return l.apply(r,arguments)};r.on("error",(function(){}));if(s.pauseStream){r.pause()}return s};Object.defineProperty(DelayedStream.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});DelayedStream.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};DelayedStream.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};DelayedStream.prototype.pause=function(){this.source.pause()};DelayedStream.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(r){this.emit.apply(this,r)}.bind(this));this._bufferedEvents=[]};DelayedStream.prototype.pipe=function(){var r=a.prototype.pipe.apply(this,arguments);this.resume();return r};DelayedStream.prototype._handleEmit=function(r){if(this._released){this.emit.apply(this,r);return}if(r[0]==="data"){this.dataSize+=r[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(r)};DelayedStream.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var r="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(r))}},33383:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});class Deprecation extends Error{constructor(r){super(r);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="Deprecation"}}i.Deprecation=Deprecation},29690:r=>{"use strict";function _process(r,i){var s;var a;if(typeof i==="function"){a=i(r);if(a!==undefined){r=a}}else if(Array.isArray(i)){for(s=0;s=0){r=r.replace(/\[/g,i).replace(/]/g,"")}var s=r.split(i);var a=s.filter(blacklistFilter);if(a.length!==s.length){throw Error("Refusing to update blacklisted property "+r)}return s}var s=Object.prototype.hasOwnProperty;function DotObject(r,i,s,a){if(!(this instanceof DotObject)){return new DotObject(r,i,s,a)}if(typeof i==="undefined")i=false;if(typeof s==="undefined")s=true;if(typeof a==="undefined")a=true;this.separator=r||".";this.override=i;this.useArray=s;this.useBrackets=a;this.keepArray=false;this.cleanup=[]}var a=new DotObject(".",false,true,true);function wrap(r){return function(){return a[r].apply(a,arguments)}}DotObject.prototype._fill=function(r,i,s,a){var l=r.shift();if(r.length>0){i[l]=i[l]||(this.useArray&&isIndex(r[0])?[]:{});if(!isArrayOrObject(i[l])){if(this.override){i[l]={}}else{if(!(isArrayOrObject(s)&&isEmptyObject(s))){throw new Error("Trying to redefine `"+l+"` which is a "+typeof i[l])}return}}this._fill(r,i[l],s,a)}else{if(!this.override&&isArrayOrObject(i[l])&&!isEmptyObject(i[l])){if(!(isArrayOrObject(s)&&isEmptyObject(s))){throw new Error("Trying to redefine non-empty obj['"+l+"']")}return}i[l]=_process(s,a)}};DotObject.prototype.object=function(r,i){var s=this;Object.keys(r).forEach((function(a){var l=i===undefined?null:i[a];var c=parsePath(a,s.separator).join(s.separator);if(c.indexOf(s.separator)!==-1){s._fill(c.split(s.separator),r,r[a],l);delete r[a]}else{r[a]=_process(r[a],l)}}));return r};DotObject.prototype.str=function(r,i,s,a){var l=parsePath(r,this.separator).join(this.separator);if(r.indexOf(this.separator)!==-1){this._fill(l.split(this.separator),s,i,a)}else{s[r]=_process(i,a)}return s};DotObject.prototype.pick=function(r,i,s,a){var l;var c;var d;var p;var u;c=parsePath(r,this.separator);for(l=0;l{"use strict"; +/** + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */Object.defineProperty(i,"__esModule",{value:true});const s=new WeakMap;const a=new WeakMap;function pd(r){const i=s.get(r);console.assert(i!=null,"'this' is expected an Event object, but got",r);return i}function setCancelFlag(r){if(r.passiveListener!=null){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error("Unable to preventDefault inside passive event listener invocation.",r.passiveListener)}return}if(!r.event.cancelable){return}r.canceled=true;if(typeof r.event.preventDefault==="function"){r.event.preventDefault()}}function Event(r,i){s.set(this,{eventTarget:r,event:i,eventPhase:2,currentTarget:r,canceled:false,stopped:false,immediateStopped:false,passiveListener:null,timeStamp:i.timeStamp||Date.now()});Object.defineProperty(this,"isTrusted",{value:false,enumerable:true});const a=Object.keys(i);for(let r=0;r0){const r=new Array(arguments.length);for(let i=0;i{r.exports=class FixedFIFO{constructor(r){if(!(r>0)||(r-1&r)!==0)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(r);this.mask=r-1;this.top=0;this.btm=0;this.next=null}clear(){this.top=this.btm=0;this.next=null;this.buffer.fill(undefined)}push(r){if(this.buffer[this.top]!==undefined)return false;this.buffer[this.top]=r;this.top=this.top+1&this.mask;return true}shift(){const r=this.buffer[this.btm];if(r===undefined)return undefined;this.buffer[this.btm]=undefined;this.btm=this.btm+1&this.mask;return r}peek(){return this.buffer[this.btm]}isEmpty(){return this.buffer[this.btm]===undefined}}},43396:(r,i,s)=>{const a=s(89543);r.exports=class FastFIFO{constructor(r){this.hwm=r||16;this.head=new a(this.hwm);this.tail=this.head;this.length=0}clear(){this.head=this.tail;this.head.clear();this.length=0}push(r){this.length++;if(!this.head.push(r)){const i=this.head;this.head=i.next=new a(2*this.head.buffer.length);this.head.push(r)}}shift(){if(this.length!==0)this.length--;const r=this.tail.shift();if(r===undefined&&this.tail.next){const r=this.tail.next;this.tail.next=null;this.tail=r;return this.tail.shift()}return r}peek(){const r=this.tail.peek();if(r===undefined&&this.tail.next)return this.tail.next.peek();return r}isEmpty(){return this.length===0}}},97010:(r,i,s)=>{var a=s(36835);var l=s(73837);var c=s(71017);var d=s(13685);var p=s(95687);var u=s(57310).parse;var A=s(57147);var h=s(12781).Stream;var g=s(57567);var y=s(55633);var b=s(56532);r.exports=FormData;l.inherits(FormData,a);function FormData(r){if(!(this instanceof FormData)){return new FormData(r)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];a.call(this);r=r||{};for(var i in r){this[i]=r[i]}}FormData.LINE_BREAK="\r\n";FormData.DEFAULT_CONTENT_TYPE="application/octet-stream";FormData.prototype.append=function(r,i,s){s=s||{};if(typeof s=="string"){s={filename:s}}var c=a.prototype.append.bind(this);if(typeof i=="number"){i=""+i}if(l.isArray(i)){this._error(new Error("Arrays are not supported."));return}var d=this._multiPartHeader(r,i,s);var p=this._multiPartFooter();c(d);c(i);c(p);this._trackLength(d,i,s)};FormData.prototype._trackLength=function(r,i,s){var a=0;if(s.knownLength!=null){a+=+s.knownLength}else if(Buffer.isBuffer(i)){a=i.length}else if(typeof i==="string"){a=Buffer.byteLength(i)}this._valueLength+=a;this._overheadLength+=Buffer.byteLength(r)+FormData.LINE_BREAK.length;if(!i||!i.path&&!(i.readable&&i.hasOwnProperty("httpVersion"))&&!(i instanceof h)){return}if(!s.knownLength){this._valuesToMeasure.push(i)}};FormData.prototype._lengthRetriever=function(r,i){if(r.hasOwnProperty("fd")){if(r.end!=undefined&&r.end!=Infinity&&r.start!=undefined){i(null,r.end+1-(r.start?r.start:0))}else{A.stat(r.path,(function(s,a){var l;if(s){i(s);return}l=a.size-(r.start?r.start:0);i(null,l)}))}}else if(r.hasOwnProperty("httpVersion")){i(null,+r.headers["content-length"])}else if(r.hasOwnProperty("httpModule")){r.on("response",(function(s){r.pause();i(null,+s.headers["content-length"])}));r.resume()}else{i("Unknown stream")}};FormData.prototype._multiPartHeader=function(r,i,s){if(typeof s.header=="string"){return s.header}var a=this._getContentDisposition(i,s);var l=this._getContentType(i,s);var c="";var d={"Content-Disposition":["form-data",'name="'+r+'"'].concat(a||[]),"Content-Type":[].concat(l||[])};if(typeof s.header=="object"){b(d,s.header)}var p;for(var u in d){if(!d.hasOwnProperty(u))continue;p=d[u];if(p==null){continue}if(!Array.isArray(p)){p=[p]}if(p.length){c+=u+": "+p.join("; ")+FormData.LINE_BREAK}}return"--"+this.getBoundary()+FormData.LINE_BREAK+c+FormData.LINE_BREAK};FormData.prototype._getContentDisposition=function(r,i){var s,a;if(typeof i.filepath==="string"){s=c.normalize(i.filepath).replace(/\\/g,"/")}else if(i.filename||r.name||r.path){s=c.basename(i.filename||r.name||r.path)}else if(r.readable&&r.hasOwnProperty("httpVersion")){s=c.basename(r.client._httpMessage.path||"")}if(s){a='filename="'+s+'"'}return a};FormData.prototype._getContentType=function(r,i){var s=i.contentType;if(!s&&r.name){s=g.lookup(r.name)}if(!s&&r.path){s=g.lookup(r.path)}if(!s&&r.readable&&r.hasOwnProperty("httpVersion")){s=r.headers["content-type"]}if(!s&&(i.filepath||i.filename)){s=g.lookup(i.filepath||i.filename)}if(!s&&typeof r=="object"){s=FormData.DEFAULT_CONTENT_TYPE}return s};FormData.prototype._multiPartFooter=function(){return function(r){var i=FormData.LINE_BREAK;var s=this._streams.length===0;if(s){i+=this._lastBoundary()}r(i)}.bind(this)};FormData.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+FormData.LINE_BREAK};FormData.prototype.getHeaders=function(r){var i;var s={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(i in r){if(r.hasOwnProperty(i)){s[i.toLowerCase()]=r[i]}}return s};FormData.prototype.setBoundary=function(r){this._boundary=r};FormData.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};FormData.prototype.getBuffer=function(){var r=new Buffer.alloc(0);var i=this.getBoundary();for(var s=0,a=this._streams.length;s{r.exports=function(r,i){Object.keys(i).forEach((function(s){r[s]=r[s]||i[s]}));return r}},53349:r=>{"use strict";r.exports=clone;var i=Object.getPrototypeOf||function(r){return r.__proto__};function clone(r){if(r===null||typeof r!=="object")return r;if(r instanceof Object)var s={__proto__:i(r)};else var s=Object.create(null);Object.getOwnPropertyNames(r).forEach((function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(r,i))}));return s}},1692:(r,i,s)=>{var a=s(57147);var l=s(24913);var c=s(83830);var d=s(53349);var p=s(73837);var u;var A;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){u=Symbol.for("graceful-fs.queue");A=Symbol.for("graceful-fs.previous")}else{u="___graceful-fs.queue";A="___graceful-fs.previous"}function noop(){}function publishQueue(r,i){Object.defineProperty(r,u,{get:function(){return i}})}var h=noop;if(p.debuglog)h=p.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))h=function(){var r=p.format.apply(p,arguments);r="GFS4: "+r.split(/\n/).join("\nGFS4: ");console.error(r)};if(!a[u]){var g=global[u]||[];publishQueue(a,g);a.close=function(r){function close(i,s){return r.call(a,i,(function(r){if(!r){resetQueue()}if(typeof s==="function")s.apply(this,arguments)}))}Object.defineProperty(close,A,{value:r});return close}(a.close);a.closeSync=function(r){function closeSync(i){r.apply(a,arguments);resetQueue()}Object.defineProperty(closeSync,A,{value:r});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){h(a[u]);s(39491).equal(a[u].length,0)}))}}if(!global[u]){publishQueue(global,a[u])}r.exports=patch(d(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){r.exports=patch(a);a.__patched=true}function patch(r){l(r);r.gracefulify=patch;r.createReadStream=createReadStream;r.createWriteStream=createWriteStream;var i=r.readFile;r.readFile=readFile;function readFile(r,s,a){if(typeof s==="function")a=s,s=null;return go$readFile(r,s,a);function go$readFile(r,s,a,l){return i(r,s,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$readFile,[r,s,a],i,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var s=r.writeFile;r.writeFile=writeFile;function writeFile(r,i,a,l){if(typeof a==="function")l=a,a=null;return go$writeFile(r,i,a,l);function go$writeFile(r,i,a,l,c){return s(r,i,a,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$writeFile,[r,i,a,l],s,c||Date.now(),Date.now()]);else{if(typeof l==="function")l.apply(this,arguments)}}))}}var a=r.appendFile;if(a)r.appendFile=appendFile;function appendFile(r,i,s,l){if(typeof s==="function")l=s,s=null;return go$appendFile(r,i,s,l);function go$appendFile(r,i,s,l,c){return a(r,i,s,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[r,i,s,l],a,c||Date.now(),Date.now()]);else{if(typeof l==="function")l.apply(this,arguments)}}))}}var d=r.copyFile;if(d)r.copyFile=copyFile;function copyFile(r,i,s,a){if(typeof s==="function"){a=s;s=0}return go$copyFile(r,i,s,a);function go$copyFile(r,i,s,a,l){return d(r,i,s,(function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$copyFile,[r,i,s,a],c,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var p=r.readdir;r.readdir=readdir;var u=/^v[0-5]\./;function readdir(r,i,s){if(typeof i==="function")s=i,i=null;var a=u.test(process.version)?function go$readdir(r,i,s,a){return p(r,fs$readdirCallback(r,i,s,a))}:function go$readdir(r,i,s,a){return p(r,i,fs$readdirCallback(r,i,s,a))};return a(r,i,s);function fs$readdirCallback(r,i,s,l){return function(c,d){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([a,[r,i,s],c,l||Date.now(),Date.now()]);else{if(d&&d.sort)d.sort();if(typeof s==="function")s.call(this,c,d)}}}}if(process.version.substr(0,4)==="v0.8"){var A=c(r);ReadStream=A.ReadStream;WriteStream=A.WriteStream}var h=r.ReadStream;if(h){ReadStream.prototype=Object.create(h.prototype);ReadStream.prototype.open=ReadStream$open}var g=r.WriteStream;if(g){WriteStream.prototype=Object.create(g.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(r,"ReadStream",{get:function(){return ReadStream},set:function(r){ReadStream=r},enumerable:true,configurable:true});Object.defineProperty(r,"WriteStream",{get:function(){return WriteStream},set:function(r){WriteStream=r},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(r,"FileReadStream",{get:function(){return y},set:function(r){y=r},enumerable:true,configurable:true});var b=WriteStream;Object.defineProperty(r,"FileWriteStream",{get:function(){return b},set:function(r){b=r},enumerable:true,configurable:true});function ReadStream(r,i){if(this instanceof ReadStream)return h.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var r=this;open(r.path,r.flags,r.mode,(function(i,s){if(i){if(r.autoClose)r.destroy();r.emit("error",i)}else{r.fd=s;r.emit("open",s);r.read()}}))}function WriteStream(r,i){if(this instanceof WriteStream)return g.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var r=this;open(r.path,r.flags,r.mode,(function(i,s){if(i){r.destroy();r.emit("error",i)}else{r.fd=s;r.emit("open",s)}}))}function createReadStream(i,s){return new r.ReadStream(i,s)}function createWriteStream(i,s){return new r.WriteStream(i,s)}var w=r.open;r.open=open;function open(r,i,s,a){if(typeof s==="function")a=s,s=null;return go$open(r,i,s,a);function go$open(r,i,s,a,l){return w(r,i,s,(function(c,d){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$open,[r,i,s,a],c,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}return r}function enqueue(r){h("ENQUEUE",r[0].name,r[1]);a[u].push(r);retry()}var y;function resetQueue(){var r=Date.now();for(var i=0;i2){a[u][i][3]=r;a[u][i][4]=r}}retry()}function retry(){clearTimeout(y);y=undefined;if(a[u].length===0)return;var r=a[u].shift();var i=r[0];var s=r[1];var l=r[2];var c=r[3];var d=r[4];if(c===undefined){h("RETRY",i.name,s);i.apply(null,s)}else if(Date.now()-c>=6e4){h("TIMEOUT",i.name,s);var p=s.pop();if(typeof p==="function")p.call(null,l)}else{var A=Date.now()-d;var g=Math.max(d-c,1);var b=Math.min(g*1.2,100);if(A>=b){h("RETRY",i.name,s);i.apply(null,s.concat([c]))}else{a[u].push(r)}}if(y===undefined){y=setTimeout(retry,0)}}},83830:(r,i,s)=>{var a=s(12781).Stream;r.exports=legacy;function legacy(r){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(i,s){if(!(this instanceof ReadStream))return new ReadStream(i,s);a.call(this);var l=this;this.path=i;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;s=s||{};var c=Object.keys(s);for(var d=0,p=c.length;dthis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){l._read()}));return}r.open(this.path,this.flags,this.mode,(function(r,i){if(r){l.emit("error",r);l.readable=false;return}l.fd=i;l.emit("open",i);l._read()}))}function WriteStream(i,s){if(!(this instanceof WriteStream))return new WriteStream(i,s);a.call(this);this.path=i;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;s=s||{};var l=Object.keys(s);for(var c=0,d=l.length;c= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=r.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},24913:(r,i,s)=>{var a=s(22057);var l=process.cwd;var c=null;var d=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!c)c=l.call(process);return c};try{process.cwd()}catch(r){}if(typeof process.chdir==="function"){var p=process.chdir;process.chdir=function(r){c=null;p.call(process,r)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,p)}r.exports=patch;function patch(r){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(r)}if(!r.lutimes){patchLutimes(r)}r.chown=chownFix(r.chown);r.fchown=chownFix(r.fchown);r.lchown=chownFix(r.lchown);r.chmod=chmodFix(r.chmod);r.fchmod=chmodFix(r.fchmod);r.lchmod=chmodFix(r.lchmod);r.chownSync=chownFixSync(r.chownSync);r.fchownSync=chownFixSync(r.fchownSync);r.lchownSync=chownFixSync(r.lchownSync);r.chmodSync=chmodFixSync(r.chmodSync);r.fchmodSync=chmodFixSync(r.fchmodSync);r.lchmodSync=chmodFixSync(r.lchmodSync);r.stat=statFix(r.stat);r.fstat=statFix(r.fstat);r.lstat=statFix(r.lstat);r.statSync=statFixSync(r.statSync);r.fstatSync=statFixSync(r.fstatSync);r.lstatSync=statFixSync(r.lstatSync);if(r.chmod&&!r.lchmod){r.lchmod=function(r,i,s){if(s)process.nextTick(s)};r.lchmodSync=function(){}}if(r.chown&&!r.lchown){r.lchown=function(r,i,s,a){if(a)process.nextTick(a)};r.lchownSync=function(){}}if(d==="win32"){r.rename=typeof r.rename!=="function"?r.rename:function(i){function rename(s,a,l){var c=Date.now();var d=0;i(s,a,(function CB(p){if(p&&(p.code==="EACCES"||p.code==="EPERM"||p.code==="EBUSY")&&Date.now()-c<6e4){setTimeout((function(){r.stat(a,(function(r,c){if(r&&r.code==="ENOENT")i(s,a,CB);else l(p)}))}),d);if(d<100)d+=10;return}if(l)l(p)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,i);return rename}(r.rename)}r.read=typeof r.read!=="function"?r.read:function(i){function read(s,a,l,c,d,p){var u;if(p&&typeof p==="function"){var A=0;u=function(h,g,y){if(h&&h.code==="EAGAIN"&&A<10){A++;return i.call(r,s,a,l,c,d,u)}p.apply(this,arguments)}}return i.call(r,s,a,l,c,d,u)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,i);return read}(r.read);r.readSync=typeof r.readSync!=="function"?r.readSync:function(i){return function(s,a,l,c,d){var p=0;while(true){try{return i.call(r,s,a,l,c,d)}catch(r){if(r.code==="EAGAIN"&&p<10){p++;continue}throw r}}}}(r.readSync);function patchLchmod(r){r.lchmod=function(i,s,l){r.open(i,a.O_WRONLY|a.O_SYMLINK,s,(function(i,a){if(i){if(l)l(i);return}r.fchmod(a,s,(function(i){r.close(a,(function(r){if(l)l(i||r)}))}))}))};r.lchmodSync=function(i,s){var l=r.openSync(i,a.O_WRONLY|a.O_SYMLINK,s);var c=true;var d;try{d=r.fchmodSync(l,s);c=false}finally{if(c){try{r.closeSync(l)}catch(r){}}else{r.closeSync(l)}}return d}}function patchLutimes(r){if(a.hasOwnProperty("O_SYMLINK")&&r.futimes){r.lutimes=function(i,s,l,c){r.open(i,a.O_SYMLINK,(function(i,a){if(i){if(c)c(i);return}r.futimes(a,s,l,(function(i){r.close(a,(function(r){if(c)c(i||r)}))}))}))};r.lutimesSync=function(i,s,l){var c=r.openSync(i,a.O_SYMLINK);var d;var p=true;try{d=r.futimesSync(c,s,l);p=false}finally{if(p){try{r.closeSync(c)}catch(r){}}else{r.closeSync(c)}}return d}}else if(r.futimes){r.lutimes=function(r,i,s,a){if(a)process.nextTick(a)};r.lutimesSync=function(){}}}function chmodFix(i){if(!i)return i;return function(s,a,l){return i.call(r,s,a,(function(r){if(chownErOk(r))r=null;if(l)l.apply(this,arguments)}))}}function chmodFixSync(i){if(!i)return i;return function(s,a){try{return i.call(r,s,a)}catch(r){if(!chownErOk(r))throw r}}}function chownFix(i){if(!i)return i;return function(s,a,l,c){return i.call(r,s,a,l,(function(r){if(chownErOk(r))r=null;if(c)c.apply(this,arguments)}))}}function chownFixSync(i){if(!i)return i;return function(s,a,l){try{return i.call(r,s,a,l)}catch(r){if(!chownErOk(r))throw r}}}function statFix(i){if(!i)return i;return function(s,a,l){if(typeof a==="function"){l=a;a=null}function callback(r,i){if(i){if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296}if(l)l.apply(this,arguments)}return a?i.call(r,s,a,callback):i.call(r,s,callback)}}function statFixSync(i){if(!i)return i;return function(s,a){var l=a?i.call(r,s,a):i.call(r,s);if(l){if(l.uid<0)l.uid+=4294967296;if(l.gid<0)l.gid+=4294967296}return l}}function chownErOk(r){if(!r)return true;if(r.code==="ENOSYS")return true;var i=!process.getuid||process.getuid()!==0;if(i){if(r.code==="EINVAL"||r.code==="EPERM")return true}return false}}},55806:(r,i,s)=>{try{var a=s(73837);if(typeof a.inherits!=="function")throw"";r.exports=a.inherits}catch(i){r.exports=s(57039)}},57039:r=>{if(typeof Object.create==="function"){r.exports=function inherits(r,i){if(i){r.super_=i;r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:false,writable:true,configurable:true}})}}}else{r.exports=function inherits(r,i){if(i){r.super_=i;var TempCtor=function(){};TempCtor.prototype=i.prototype;r.prototype=new TempCtor;r.prototype.constructor=r}}}},1363:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true}); /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */function isObject(r){return Object.prototype.toString.call(r)==="[object Object]"}function isPlainObject(r){var i,a;if(isObject(r)===false)return false;i=r.constructor;if(i===undefined)return true;a=i.prototype;if(isObject(a)===false)return false;if(a.hasOwnProperty("isPrototypeOf")===false){return false}return true}i.isPlainObject=isPlainObject},68829:r=>{"use strict";function e(r){this.message=r}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var i=String(r).replace(/=+$/,"");if(i.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var a,s,l=0,c=0,p="";s=i.charAt(c++);~s&&(a=l%4?64*a+s:s,l++%4)?p+=String.fromCharCode(255&a>>(-2*l&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return p};function t(r){var a=r.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw"Illegal base64url string!"}try{return function(r){return decodeURIComponent(i(r).replace(/(.)/g,(function(r,i){var a=i.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a})))}(a)}catch(r){return i(a)}}function n(r){this.message=r}function o(r,i){if("string"!=typeof r)throw new n("Invalid token specified");var a=!0===(i=i||{}).header?0:1;try{return JSON.parse(t(r.split(".")[a]))}catch(r){throw new n("Invalid token specified: "+r.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const a=o;a.default=o,a.InvalidTokenError=n,r.exports=a},73268:(r,i,a)=>{var s=a(73837);var l=a(6022);r.exports={Readable:Readable,Writable:Writable};s.inherits(Readable,l);s.inherits(Writable,l);function beforeFirstCall(r,i,a){r[i]=function(){delete r[i];a.apply(this,arguments);return this[i].apply(this,arguments)}}function Readable(r,i){if(!(this instanceof Readable))return new Readable(r,i);l.call(this,i);beforeFirstCall(this,"_read",(function(){var a=r.call(this,i);var s=this.emit.bind(this,"error");a.on("error",s);a.pipe(this)}));this.emit("readable")}function Writable(r,i){if(!(this instanceof Writable))return new Writable(r,i);l.call(this,i);beforeFirstCall(this,"_write",(function(){var a=r.call(this,i);var s=this.emit.bind(this,"error");a.on("error",s);this.pipe(a)}));this.emit("writable")}},757:r=>{var i={}.toString;r.exports=Array.isArray||function(r){return i.call(r)=="[object Array]"}},17333:(r,i,a)=>{"use strict";var s=a(72166);var l=Object.keys||function(r){var i=[];for(var a in r){i.push(a)}return i};r.exports=Duplex;var c=Object.create(a(90310));c.inherits=a(55806);var p=a(10847);var d=a(74414);c.inherits(Duplex,p);{var u=l(d.prototype);for(var A=0;A{"use strict";r.exports=PassThrough;var s=a(67630);var l=Object.create(a(90310));l.inherits=a(55806);l.inherits(PassThrough,s);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);s.call(this,r)}PassThrough.prototype._transform=function(r,i,a){a(null,r)}},10847:(r,i,a)=>{"use strict";var s=a(72166);r.exports=Readable;var l=a(757);var c;Readable.ReadableState=ReadableState;var p=a(82361).EventEmitter;var EElistenerCount=function(r,i){return r.listeners(i).length};var d=a(46732);var u=a(90029).Buffer;var A=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return u.from(r)}function _isUint8Array(r){return u.isBuffer(r)||r instanceof A}var h=Object.create(a(90310));h.inherits=a(55806);var g=a(73837);var y=void 0;if(g&&g.debuglog){y=g.debuglog("stream")}else{y=function(){}}var E=a(37063);var b=a(14958);var C;h.inherits(Readable,d);var v=["error","close","destroy","pause","resume"];function prependListener(r,i,a){if(typeof r.prependListener==="function")return r.prependListener(i,a);if(!r._events||!r._events[i])r.on(i,a);else if(l(r._events[i]))r._events[i].unshift(a);else r._events[i]=[a,r._events[i]]}function ReadableState(r,i){c=c||a(17333);r=r||{};var s=i instanceof c;this.objectMode=!!r.objectMode;if(s)this.objectMode=this.objectMode||!!r.readableObjectMode;var l=r.highWaterMark;var p=r.readableHighWaterMark;var d=this.objectMode?16:16*1024;if(l||l===0)this.highWaterMark=l;else if(s&&(p||p===0))this.highWaterMark=p;else this.highWaterMark=d;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new E;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=r.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(r.encoding){if(!C)C=a(44508).s;this.decoder=new C(r.encoding);this.encoding=r.encoding}}function Readable(r){c=c||a(17333);if(!(this instanceof Readable))return new Readable(r);this._readableState=new ReadableState(r,this);this.readable=true;if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy}d.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(r){if(!this._readableState){return}this._readableState.destroyed=r}});Readable.prototype.destroy=b.destroy;Readable.prototype._undestroy=b.undestroy;Readable.prototype._destroy=function(r,i){this.push(null);i(r)};Readable.prototype.push=function(r,i){var a=this._readableState;var s;if(!a.objectMode){if(typeof r==="string"){i=i||a.defaultEncoding;if(i!==a.encoding){r=u.from(r,i);i=""}s=true}}else{s=true}return readableAddChunk(this,r,i,false,s)};Readable.prototype.unshift=function(r){return readableAddChunk(this,r,null,true,false)};function readableAddChunk(r,i,a,s,l){var c=r._readableState;if(i===null){c.reading=false;onEofChunk(r,c)}else{var p;if(!l)p=chunkInvalid(c,i);if(p){r.emit("error",p)}else if(c.objectMode||i&&i.length>0){if(typeof i!=="string"&&!c.objectMode&&Object.getPrototypeOf(i)!==u.prototype){i=_uint8ArrayToBuffer(i)}if(s){if(c.endEmitted)r.emit("error",new Error("stream.unshift() after end event"));else addChunk(r,c,i,true)}else if(c.ended){r.emit("error",new Error("stream.push() after EOF"))}else{c.reading=false;if(c.decoder&&!a){i=c.decoder.write(i);if(c.objectMode||i.length!==0)addChunk(r,c,i,false);else maybeReadMore(r,c)}else{addChunk(r,c,i,false)}}}else if(!s){c.reading=false}}return needMoreData(c)}function addChunk(r,i,a,s){if(i.flowing&&i.length===0&&!i.sync){r.emit("data",a);r.read(0)}else{i.length+=i.objectMode?1:a.length;if(s)i.buffer.unshift(a);else i.buffer.push(a);if(i.needReadable)emitReadable(r)}maybeReadMore(r,i)}function chunkInvalid(r,i){var a;if(!_isUint8Array(i)&&typeof i!=="string"&&i!==undefined&&!r.objectMode){a=new TypeError("Invalid non-string/buffer chunk")}return a}function needMoreData(r){return!r.ended&&(r.needReadable||r.length=B){r=B}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if(i.objectMode)return 1;if(r!==r){if(i.flowing&&i.length)return i.buffer.head.data.length;else return i.length}if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r<=i.length)return r;if(!i.ended){i.needReadable=true;return 0}return i.length}Readable.prototype.read=function(r){y("read",r);r=parseInt(r,10);var i=this._readableState;var a=r;if(r!==0)i.emittedReadable=false;if(r===0&&i.needReadable&&(i.length>=i.highWaterMark||i.ended)){y("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}var s=i.needReadable;y("need readable",s);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=true;r=0}else{i.length-=r}if(i.length===0){if(!i.ended)i.needReadable=true;if(a!==r&&i.ended)endReadable(this)}if(l!==null)this.emit("data",l);return l};function onEofChunk(r,i){if(i.ended)return;if(i.decoder){var a=i.decoder.end();if(a&&a.length){i.buffer.push(a);i.length+=i.objectMode?1:a.length}}i.ended=true;emitReadable(r)}function emitReadable(r){var i=r._readableState;i.needReadable=false;if(!i.emittedReadable){y("emitReadable",i.flowing);i.emittedReadable=true;if(i.sync)s.nextTick(emitReadable_,r);else emitReadable_(r)}}function emitReadable_(r){y("emit readable");r.emit("readable");flow(r)}function maybeReadMore(r,i){if(!i.readingMore){i.readingMore=true;s.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){var a=i.length;while(!i.reading&&!i.flowing&&!i.ended&&i.length1&&indexOf(l.pipes,r)!==-1)&&!u){y("false write response, pause",l.awaitDrain);l.awaitDrain++;A=true}a.pause()}}function onerror(i){y("onerror",i);unpipe();r.removeListener("error",onerror);if(EElistenerCount(r,"error")===0)r.emit("error",i)}prependListener(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){y("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){y("unpipe");a.unpipe(r)}r.emit("pipe",a);if(!l.flowing){y("pipe resume");a.resume()}return r};function pipeOnDrain(r){return function(){var i=r._readableState;y("pipeOnDrain",i.awaitDrain);if(i.awaitDrain)i.awaitDrain--;if(i.awaitDrain===0&&EElistenerCount(r,"data")){i.flowing=true;flow(r)}}}Readable.prototype.unpipe=function(r){var i=this._readableState;var a={hasUnpiped:false};if(i.pipesCount===0)return this;if(i.pipesCount===1){if(r&&r!==i.pipes)return this;if(!r)r=i.pipes;i.pipes=null;i.pipesCount=0;i.flowing=false;if(r)r.emit("unpipe",this,a);return this}if(!r){var s=i.pipes;var l=i.pipesCount;i.pipes=null;i.pipesCount=0;i.flowing=false;for(var c=0;c=i.length){if(i.decoder)a=i.buffer.join("");else if(i.buffer.length===1)a=i.buffer.head.data;else a=i.buffer.concat(i.length);i.buffer.clear()}else{a=fromListPartial(r,i.buffer,i.decoder)}return a}function fromListPartial(r,i,a){var s;if(rc.length?c.length:r;if(p===c.length)l+=c;else l+=c.slice(0,r);r-=p;if(r===0){if(p===c.length){++s;if(a.next)i.head=a.next;else i.head=i.tail=null}else{i.head=a;a.data=c.slice(p)}break}++s}i.length-=s;return l}function copyFromBuffer(r,i){var a=u.allocUnsafe(r);var s=i.head;var l=1;s.data.copy(a);r-=s.data.length;while(s=s.next){var c=s.data;var p=r>c.length?c.length:r;c.copy(a,a.length-r,0,p);r-=p;if(r===0){if(p===c.length){++l;if(s.next)i.head=s.next;else i.head=i.tail=null}else{i.head=s;s.data=c.slice(p)}break}++l}i.length-=l;return a}function endReadable(r){var i=r._readableState;if(i.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!i.endEmitted){i.ended=true;s.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){if(!r.endEmitted&&r.length===0){r.endEmitted=true;i.readable=false;i.emit("end")}}function indexOf(r,i){for(var a=0,s=r.length;a{"use strict";r.exports=Transform;var s=a(17333);var l=Object.create(a(90310));l.inherits=a(55806);l.inherits(Transform,s);function afterTransform(r,i){var a=this._transformState;a.transforming=false;var s=a.writecb;if(!s){return this.emit("error",new Error("write callback called multiple times"))}a.writechunk=null;a.writecb=null;if(i!=null)this.push(i);s(r);var l=this._readableState;l.reading=false;if(l.needReadable||l.length{"use strict";var s=a(72166);r.exports=Writable;function WriteReq(r,i,a){this.chunk=r;this.encoding=i;this.callback=a;this.next=null}function CorkedRequest(r){var i=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(i,r)}}var l=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:s.nextTick;var c;Writable.WritableState=WritableState;var p=Object.create(a(90310));p.inherits=a(55806);var d={deprecate:a(41257)};var u=a(46732);var A=a(90029).Buffer;var h=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return A.from(r)}function _isUint8Array(r){return A.isBuffer(r)||r instanceof h}var g=a(14958);p.inherits(Writable,u);function nop(){}function WritableState(r,i){c=c||a(17333);r=r||{};var s=i instanceof c;this.objectMode=!!r.objectMode;if(s)this.objectMode=this.objectMode||!!r.writableObjectMode;var l=r.highWaterMark;var p=r.writableHighWaterMark;var d=this.objectMode?16:16*1024;if(l||l===0)this.highWaterMark=l;else if(s&&(p||p===0))this.highWaterMark=p;else this.highWaterMark=d;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var u=r.decodeStrings===false;this.decodeStrings=!u;this.defaultEncoding=r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(r){onwrite(i,r)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var r=this.bufferedRequest;var i=[];while(r){i.push(r);r=r.next}return i};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(r){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(r){if(y.call(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}})}else{y=function(r){return r instanceof this}}function Writable(r){c=c||a(17333);if(!y.call(Writable,this)&&!(this instanceof c)){return new Writable(r)}this._writableState=new WritableState(r,this);this.writable=true;if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final}u.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(r,i){var a=new Error("write after end");r.emit("error",a);s.nextTick(i,a)}function validChunk(r,i,a,l){var c=true;var p=false;if(a===null){p=new TypeError("May not write null values to stream")}else if(typeof a!=="string"&&a!==undefined&&!i.objectMode){p=new TypeError("Invalid non-string/buffer chunk")}if(p){r.emit("error",p);s.nextTick(l,p);c=false}return c}Writable.prototype.write=function(r,i,a){var s=this._writableState;var l=false;var c=!s.objectMode&&_isUint8Array(r);if(c&&!A.isBuffer(r)){r=_uint8ArrayToBuffer(r)}if(typeof i==="function"){a=i;i=null}if(c)i="buffer";else if(!i)i=s.defaultEncoding;if(typeof a!=="function")a=nop;if(s.ended)writeAfterEnd(this,a);else if(c||validChunk(this,s,r,a)){s.pendingcb++;l=writeOrBuffer(this,s,c,r,i,a)}return l};Writable.prototype.cork=function(){var r=this._writableState;r.corked++};Writable.prototype.uncork=function(){var r=this._writableState;if(r.corked){r.corked--;if(!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=r.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+r);this._writableState.defaultEncoding=r;return this};function decodeChunk(r,i,a){if(!r.objectMode&&r.decodeStrings!==false&&typeof i==="string"){i=A.from(i,a)}return i}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(r,i,a,s,l,c){if(!a){var p=decodeChunk(i,s,l);if(s!==p){a=true;l="buffer";s=p}}var d=i.objectMode?1:s.length;i.length+=d;var u=i.length{"use strict";function _classCallCheck(r,i){if(!(r instanceof i)){throw new TypeError("Cannot call a class as a function")}}var s=a(90029).Buffer;var l=a(73837);function copyBuffer(r,i,a){r.copy(i,a)}r.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(r){var i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length};BufferList.prototype.unshift=function unshift(r){var i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(r){if(this.length===0)return"";var i=this.head;var a=""+i.data;while(i=i.next){a+=r+i.data}return a};BufferList.prototype.concat=function concat(r){if(this.length===0)return s.alloc(0);var i=s.allocUnsafe(r>>>0);var a=this.head;var l=0;while(a){copyBuffer(a.data,i,l);l+=a.data.length;a=a.next}return i};return BufferList}();if(l&&l.inspect&&l.inspect.custom){r.exports.prototype[l.inspect.custom]=function(){var r=l.inspect({length:this.length});return this.constructor.name+" "+r}}},14958:(r,i,a)=>{"use strict";var s=a(72166);function destroy(r,i){var a=this;var l=this._readableState&&this._readableState.destroyed;var c=this._writableState&&this._writableState.destroyed;if(l||c){if(i){i(r)}else if(r){if(!this._writableState){s.nextTick(emitErrorNT,this,r)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;s.nextTick(emitErrorNT,this,r)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(r||null,(function(r){if(!i&&r){if(!a._writableState){s.nextTick(emitErrorNT,a,r)}else if(!a._writableState.errorEmitted){a._writableState.errorEmitted=true;s.nextTick(emitErrorNT,a,r)}}else if(i){i(r)}}));return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(r,i){r.emit("error",i)}r.exports={destroy:destroy,undestroy:undestroy}},46732:(r,i,a)=>{r.exports=a(12781)},6022:(r,i,a)=>{r.exports=a(76582).PassThrough},76582:(r,i,a)=>{var s=a(12781);if(process.env.READABLE_STREAM==="disable"&&s){r.exports=s;i=r.exports=s.Readable;i.Readable=s.Readable;i.Writable=s.Writable;i.Duplex=s.Duplex;i.Transform=s.Transform;i.PassThrough=s.PassThrough;i.Stream=s}else{i=r.exports=a(10847);i.Stream=s||i;i.Readable=i;i.Writable=a(74414);i.Duplex=a(17333);i.Transform=a(67630);i.PassThrough=a(23017)}},90029:(r,i,a)=>{var s=a(14300);var l=s.Buffer;function copyProps(r,i){for(var a in r){i[a]=r[a]}}if(l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow){r.exports=s}else{copyProps(s,i);i.Buffer=SafeBuffer}function SafeBuffer(r,i,a){return l(r,i,a)}copyProps(l,SafeBuffer);SafeBuffer.from=function(r,i,a){if(typeof r==="number"){throw new TypeError("Argument must not be a number")}return l(r,i,a)};SafeBuffer.alloc=function(r,i,a){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}var s=l(r);if(i!==undefined){if(typeof a==="string"){s.fill(i,a)}else{s.fill(i)}}else{s.fill(0)}return s};SafeBuffer.allocUnsafe=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return l(r)};SafeBuffer.allocUnsafeSlow=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return s.SlowBuffer(r)}},44508:(r,i,a)=>{"use strict";var s=a(90029).Buffer;var l=s.isEncoding||function(r){r=""+r;switch(r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(r){if(!r)return"utf8";var i;while(true){switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(i)return;r=(""+r).toLowerCase();i=true}}}function normalizeEncoding(r){var i=_normalizeEncoding(r);if(typeof i!=="string"&&(s.isEncoding===l||!l(r)))throw new Error("Unknown encoding: "+r);return i||r}i.s=StringDecoder;function StringDecoder(r){this.encoding=normalizeEncoding(r);var i;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;i=4;break;case"utf8":this.fillLast=utf8FillLast;i=4;break;case"base64":this.text=base64Text;this.end=base64End;i=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=s.allocUnsafe(i)}StringDecoder.prototype.write=function(r){if(r.length===0)return"";var i;var a;if(this.lastNeed){i=this.fillLast(r);if(i===undefined)return"";a=this.lastNeed;this.lastNeed=0}else{a=0}if(a>5===6)return 2;else if(r>>4===14)return 3;else if(r>>3===30)return 4;return r>>6===2?-1:-2}function utf8CheckIncomplete(r,i,a){var s=i.length-1;if(s=0){if(l>0)r.lastNeed=l-1;return l}if(--s=0){if(l>0)r.lastNeed=l-2;return l}if(--s=0){if(l>0){if(l===2)l=0;else r.lastNeed=l-3}return l}return 0}function utf8CheckExtraBytes(r,i,a){if((i[0]&192)!==128){r.lastNeed=0;return"�"}if(r.lastNeed>1&&i.length>1){if((i[1]&192)!==128){r.lastNeed=1;return"�"}if(r.lastNeed>2&&i.length>2){if((i[2]&192)!==128){r.lastNeed=2;return"�"}}}}function utf8FillLast(r){var i=this.lastTotal-this.lastNeed;var a=utf8CheckExtraBytes(this,r,i);if(a!==undefined)return a;if(this.lastNeed<=r.length){r.copy(this.lastChar,i,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}r.copy(this.lastChar,i,0,r.length);this.lastNeed-=r.length}function utf8Text(r,i){var a=utf8CheckIncomplete(this,r,i);if(!this.lastNeed)return r.toString("utf8",i);this.lastTotal=a;var s=r.length-(a-this.lastNeed);r.copy(this.lastChar,0,s);return r.toString("utf8",i,s)}function utf8End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+"�";return i}function utf16Text(r,i){if((r.length-i)%2===0){var a=r.toString("utf16le",i);if(a){var s=a.charCodeAt(a.length-1);if(s>=55296&&s<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1];return a.slice(0,-1)}}return a}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=r[r.length-1];return r.toString("utf16le",i,r.length-1)}function utf16End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,a)}return i}function base64Text(r,i){var a=(r.length-i)%3;if(a===0)return r.toString("base64",i);this.lastNeed=3-a;this.lastTotal=3;if(a===1){this.lastChar[0]=r[r.length-1]}else{this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1]}return r.toString("base64",i,r.length-a)}function base64End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+this.lastChar.toString("base64",0,3-this.lastNeed);return i}function simpleWrite(r){return r.toString(this.encoding)}function simpleEnd(r){return r&&r.length?this.write(r):""}},3768:r=>{var i=9007199254740991;var a="[object Arguments]",s="[object Function]",l="[object GeneratorFunction]";var c=/^(?:0|[1-9]\d*)$/;function apply(r,i,a){switch(a.length){case 0:return r.call(i);case 1:return r.call(i,a[0]);case 2:return r.call(i,a[0],a[1]);case 3:return r.call(i,a[0],a[1],a[2])}return r.apply(i,a)}function baseTimes(r,i){var a=-1,s=Array(r);while(++a1?a[l-1]:undefined,p=l>2?a[2]:undefined;c=r.length>3&&typeof c=="function"?(l--,c):undefined;if(p&&isIterateeCall(a[0],a[1],p)){c=l<3?undefined:c;l=1}i=Object(i);while(++s-1&&r%1==0&&r-1&&r%1==0&&r<=i}function isObject(r){var i=typeof r;return!!r&&(i=="object"||i=="function")}function isObjectLike(r){return!!r&&typeof r=="object"}var y=createAssigner((function(r,i,a,s){copyObject(i,keysIn(i),r,s)}));var E=baseRest((function(r){r.push(undefined,assignInDefaults);return apply(y,undefined,r)}));function keysIn(r){return isArrayLike(r)?arrayLikeKeys(r,true):baseKeysIn(r)}r.exports=E},41633:r=>{var i=200;var a="__lodash_hash_undefined__";var s=9007199254740991;var l="[object Arguments]",c="[object Function]",p="[object GeneratorFunction]";var d=/[\\^$.*+?()[\]{}|]/g;var u=/^\[object .+?Constructor\]$/;var A=typeof global=="object"&&global&&global.Object===Object&&global;var h=typeof self=="object"&&self&&self.Object===Object&&self;var g=A||h||Function("return this")();function apply(r,i,a){switch(a.length){case 0:return r.call(i);case 1:return r.call(i,a[0]);case 2:return r.call(i,a[0],a[1]);case 3:return r.call(i,a[0],a[1],a[2])}return r.apply(i,a)}function arrayIncludes(r,i){var a=r?r.length:0;return!!a&&baseIndexOf(r,i,0)>-1}function arrayIncludesWith(r,i,a){var s=-1,l=r?r.length:0;while(++s-1}function listCacheSet(r,i){var a=this.__data__,s=assocIndexOf(a,r);if(s<0){a.push([r,i])}else{a[s][1]=i}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(r){var i=-1,a=r?r.length:0;this.clear();while(++i=i){p=cacheHas;d=false;a=new SetCache(a)}e:while(++c0&&a(d)){if(i>1){baseFlatten(d,i-1,a,s,l)}else{arrayPush(l,d)}}else if(!s){l[l.length]=d}}return l}function baseIsNative(r){if(!isObject(r)||isMasked(r)){return false}var i=isFunction(r)||isHostObject(r)?S:u;return i.test(toSource(r))}function baseRest(r,i){i=T(i===undefined?r.length-1:i,0);return function(){var a=arguments,s=-1,l=T(a.length-i,0),c=Array(l);while(++s-1&&r%1==0&&r<=s}function isObject(r){var i=typeof r;return!!r&&(i=="object"||i=="function")}function isObjectLike(r){return!!r&&typeof r=="object"}r.exports=_},31520:r=>{var i=9007199254740991;var a="[object Arguments]",s="[object Function]",l="[object GeneratorFunction]";var c=typeof global=="object"&&global&&global.Object===Object&&global;var p=typeof self=="object"&&self&&self.Object===Object&&self;var d=c||p||Function("return this")();function arrayPush(r,i){var a=-1,s=i.length,l=r.length;while(++a0&&a(d)){if(i>1){baseFlatten(d,i-1,a,s,l)}else{arrayPush(l,d)}}else if(!s){l[l.length]=d}}return l}function isFlattenable(r){return b(r)||isArguments(r)||!!(E&&r&&r[E])}function flatten(r){var i=r?r.length:0;return i?baseFlatten(r,1):[]}function isArguments(r){return isArrayLikeObject(r)&&A.call(r,"callee")&&(!y.call(r,"callee")||h.call(r)==a)}var b=Array.isArray;function isArrayLike(r){return r!=null&&isLength(r.length)&&!isFunction(r)}function isArrayLikeObject(r){return isObjectLike(r)&&isArrayLike(r)}function isFunction(r){var i=isObject(r)?h.call(r):"";return i==s||i==l}function isLength(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=i}function isObject(r){var i=typeof r;return!!r&&(i=="object"||i=="function")}function isObjectLike(r){return!!r&&typeof r=="object"}r.exports=flatten},77356:r=>{var i="[object Object]";function isHostObject(r){var i=false;if(r!=null&&typeof r.toString!="function"){try{i=!!(r+"")}catch(r){}}return i}function overArg(r,i){return function(a){return r(i(a))}}var a=Function.prototype,s=Object.prototype;var l=a.toString;var c=s.hasOwnProperty;var p=l.call(Object);var d=s.toString;var u=overArg(Object.getPrototypeOf,Object);function isObjectLike(r){return!!r&&typeof r=="object"}function isPlainObject(r){if(!isObjectLike(r)||d.call(r)!=i||isHostObject(r)){return false}var a=u(r);if(a===null){return true}var s=c.call(a,"constructor")&&a.constructor;return typeof s=="function"&&s instanceof s&&l.call(s)==p}r.exports=isPlainObject},85195:r=>{var i=200;var a="__lodash_hash_undefined__";var s=1/0,l=9007199254740991;var c="[object Arguments]",p="[object Function]",d="[object GeneratorFunction]";var u=/[\\^$.*+?()[\]{}|]/g;var A=/^\[object .+?Constructor\]$/;var h=typeof global=="object"&&global&&global.Object===Object&&global;var g=typeof self=="object"&&self&&self.Object===Object&&self;var y=h||g||Function("return this")();function apply(r,i,a){switch(a.length){case 0:return r.call(i);case 1:return r.call(i,a[0]);case 2:return r.call(i,a[0],a[1]);case 3:return r.call(i,a[0],a[1],a[2])}return r.apply(i,a)}function arrayIncludes(r,i){var a=r?r.length:0;return!!a&&baseIndexOf(r,i,0)>-1}function arrayIncludesWith(r,i,a){var s=-1,l=r?r.length:0;while(++s-1}function listCacheSet(r,i){var a=this.__data__,s=assocIndexOf(a,r);if(s<0){a.push([r,i])}else{a[s][1]=i}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(r){var i=-1,a=r?r.length:0;this.clear();while(++i0&&a(d)){if(i>1){baseFlatten(d,i-1,a,s,l)}else{arrayPush(l,d)}}else if(!s){l[l.length]=d}}return l}function baseIsNative(r){if(!isObject(r)||isMasked(r)){return false}var i=isFunction(r)||isHostObject(r)?Q:A;return i.test(toSource(r))}function baseRest(r,i){i=D(i===undefined?r.length-1:i,0);return function(){var a=arguments,s=-1,l=D(a.length-i,0),c=Array(l);while(++s=i){var h=a?null:P(r);if(h){return setToArray(h)}d=false;c=cacheHas;A=new SetCache}else{A=a?[]:u}e:while(++l-1&&r%1==0&&r<=l}function isObject(r){var i=typeof r;return!!r&&(i=="object"||i=="function")}function isObjectLike(r){return!!r&&typeof r=="object"}function noop(){}r.exports=L},30453:(r,i,a)=>{ + */function isObject(r){return Object.prototype.toString.call(r)==="[object Object]"}function isPlainObject(r){var i,s;if(isObject(r)===false)return false;i=r.constructor;if(i===undefined)return true;s=i.prototype;if(isObject(s)===false)return false;if(s.hasOwnProperty("isPrototypeOf")===false){return false}return true}i.isPlainObject=isPlainObject},44101:r=>{"use strict";const isStream=r=>r!==null&&typeof r==="object"&&typeof r.pipe==="function";isStream.writable=r=>isStream(r)&&r.writable!==false&&typeof r._write==="function"&&typeof r._writableState==="object";isStream.readable=r=>isStream(r)&&r.readable!==false&&typeof r._read==="function"&&typeof r._readableState==="object";isStream.duplex=r=>isStream.writable(r)&&isStream.readable(r);isStream.transform=r=>isStream.duplex(r)&&typeof r._transform==="function";r.exports=isStream},68829:r=>{"use strict";function e(r){this.message=r}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var i=String(r).replace(/=+$/,"");if(i.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var s,a,l=0,c=0,d="";a=i.charAt(c++);~a&&(s=l%4?64*s+a:a,l++%4)?d+=String.fromCharCode(255&s>>(-2*l&6)):0)a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a);return d};function t(r){var s=r.replace(/-/g,"+").replace(/_/g,"/");switch(s.length%4){case 0:break;case 2:s+="==";break;case 3:s+="=";break;default:throw"Illegal base64url string!"}try{return function(r){return decodeURIComponent(i(r).replace(/(.)/g,(function(r,i){var s=i.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(s)}catch(r){return i(s)}}function n(r){this.message=r}function o(r,i){if("string"!=typeof r)throw new n("Invalid token specified");var s=!0===(i=i||{}).header?0:1;try{return JSON.parse(t(r.split(".")[s]))}catch(r){throw new n("Invalid token specified: "+r.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const s=o;s.default=o,s.InvalidTokenError=n,r.exports=s},73268:(r,i,s)=>{var a=s(73837);var l=s(57639);r.exports={Readable:Readable,Writable:Writable};a.inherits(Readable,l);a.inherits(Writable,l);function beforeFirstCall(r,i,s){r[i]=function(){delete r[i];s.apply(this,arguments);return this[i].apply(this,arguments)}}function Readable(r,i){if(!(this instanceof Readable))return new Readable(r,i);l.call(this,i);beforeFirstCall(this,"_read",(function(){var s=r.call(this,i);var a=this.emit.bind(this,"error");s.on("error",a);s.pipe(this)}));this.emit("readable")}function Writable(r,i){if(!(this instanceof Writable))return new Writable(r,i);l.call(this,i);beforeFirstCall(this,"_write",(function(){var s=r.call(this,i);var a=this.emit.bind(this,"error");s.on("error",a);this.pipe(s)}));this.emit("writable")}},3279:(r,i,s)=>{var a=s(77308),l=s(22368),c=s(6410),d=s(61401),p=s(79475);function Hash(r){var i=-1,s=r==null?0:r.length;this.clear();while(++i{var a=s(37236),l=s(40092),c=s(17905),d=s(75259),p=s(56450);function ListCache(r){var i=-1,s=r==null?0:r.length;this.clear();while(++i{var a=s(5620),l=s(27413);var c=a(l,"Map");r.exports=c},98723:(r,i,s)=>{var a=s(29467),l=s(78691),c=s(77697),d=s(17268),p=s(93689);function MapCache(r){var i=-1,s=r==null?0:r.length;this.clear();while(++i{var a=s(5620),l=s(27413);var c=a(l,"Set");r.exports=c},8758:(r,i,s)=>{var a=s(98723),l=s(83702),c=s(60008);function SetCache(r){var i=-1,s=r==null?0:r.length;this.__data__=new a;while(++i{var a=s(27413);var l=a.Symbol;r.exports=l},40529:r=>{function apply(r,i,s){switch(s.length){case 0:return r.call(i);case 1:return r.call(i,s[0]);case 2:return r.call(i,s[0],s[1]);case 3:return r.call(i,s[0],s[1],s[2])}return r.apply(i,s)}r.exports=apply},84458:(r,i,s)=>{var a=s(39058);function arrayIncludes(r,i){var s=r==null?0:r.length;return!!s&&a(r,i,0)>-1}r.exports=arrayIncludes},52706:r=>{function arrayIncludesWith(r,i,s){var a=-1,l=r==null?0:r.length;while(++a{var a=s(92548),l=s(21239),c=s(97284),d=s(18004),p=s(44890),u=s(59957);var A=Object.prototype;var h=A.hasOwnProperty;function arrayLikeKeys(r,i){var s=c(r),A=!s&&l(r),g=!s&&!A&&d(r),y=!s&&!A&&!g&&u(r),b=s||A||g||y,w=b?a(r.length,String):[],C=w.length;for(var v in r){if((i||h.call(r,v))&&!(b&&(v=="length"||g&&(v=="offset"||v=="parent")||y&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||p(v,C)))){w.push(v)}}return w}r.exports=arrayLikeKeys},56570:r=>{function arrayMap(r,i){var s=-1,a=r==null?0:r.length,l=Array(a);while(++s{function arrayPush(r,i){var s=-1,a=i.length,l=r.length;while(++s{var a=s(72873);function assocIndexOf(r,i){var s=r.length;while(s--){if(a(r[s][0],i)){return s}}return-1}r.exports=assocIndexOf},43321:(r,i,s)=>{var a=s(8758),l=s(84458),c=s(52706),d=s(56570),p=s(48048),u=s(92323);var A=200;function baseDifference(r,i,s,h){var g=-1,y=l,b=true,w=r.length,C=[],v=i.length;if(!w){return C}if(s){i=d(i,p(s))}if(h){y=c;b=false}else if(i.length>=A){y=u;b=false;i=new a(i)}e:while(++g{function baseFindIndex(r,i,s,a){var l=r.length,c=s+(a?1:-1);while(a?c--:++c{var a=s(87641),l=s(56042);function baseFlatten(r,i,s,c,d){var p=-1,u=r.length;s||(s=l);d||(d=[]);while(++p0&&s(A)){if(i>1){baseFlatten(A,i-1,s,c,d)}else{a(d,A)}}else if(!c){d[d.length]=A}}return d}r.exports=baseFlatten},27794:(r,i,s)=>{var a=s(97507),l=s(71816),c=s(38078);var d="[object Null]",p="[object Undefined]";var u=a?a.toStringTag:undefined;function baseGetTag(r){if(r==null){return r===undefined?p:d}return u&&u in Object(r)?l(r):c(r)}r.exports=baseGetTag},39058:(r,i,s)=>{var a=s(28249),l=s(46075),c=s(10422);function baseIndexOf(r,i,s){return i===i?c(r,i,s):a(r,l,s)}r.exports=baseIndexOf},54124:(r,i,s)=>{var a=s(27794),l=s(79620);var c="[object Arguments]";function baseIsArguments(r){return l(r)&&a(r)==c}r.exports=baseIsArguments},46075:r=>{function baseIsNaN(r){return r!==r}r.exports=baseIsNaN},91029:(r,i,s)=>{var a=s(50593),l=s(52239),c=s(97838),d=s(5856);var p=/[\\^$.*+?()[\]{}|]/g;var u=/^\[object .+?Constructor\]$/;var A=Function.prototype,h=Object.prototype;var g=A.toString;var y=h.hasOwnProperty;var b=RegExp("^"+g.call(y).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(r){if(!c(r)||l(r)){return false}var i=a(r)?b:u;return i.test(d(r))}r.exports=baseIsNative},81797:(r,i,s)=>{var a=s(27794),l=s(35967),c=s(79620);var d="[object Arguments]",p="[object Array]",u="[object Boolean]",A="[object Date]",h="[object Error]",g="[object Function]",y="[object Map]",b="[object Number]",w="[object Object]",C="[object RegExp]",v="[object Set]",I="[object String]",B="[object WeakMap]";var S="[object ArrayBuffer]",x="[object DataView]",R="[object Float32Array]",Q="[object Float64Array]",_="[object Int8Array]",N="[object Int16Array]",T="[object Int32Array]",k="[object Uint8Array]",D="[object Uint8ClampedArray]",P="[object Uint16Array]",O="[object Uint32Array]";var L={};L[R]=L[Q]=L[_]=L[N]=L[T]=L[k]=L[D]=L[P]=L[O]=true;L[d]=L[p]=L[S]=L[u]=L[x]=L[A]=L[h]=L[g]=L[y]=L[b]=L[w]=L[C]=L[v]=L[I]=L[B]=false;function baseIsTypedArray(r){return c(r)&&l(r.length)&&!!L[a(r)]}r.exports=baseIsTypedArray},3368:(r,i,s)=>{var a=s(97838),l=s(64524),c=s(99830);var d=Object.prototype;var p=d.hasOwnProperty;function baseKeysIn(r){if(!a(r)){return c(r)}var i=l(r),s=[];for(var d in r){if(!(d=="constructor"&&(i||!p.call(r,d)))){s.push(d)}}return s}r.exports=baseKeysIn},97593:(r,i,s)=>{var a=s(52185),l=s(50149),c=s(40252);function baseRest(r,i){return c(l(r,i,a),r+"")}r.exports=baseRest},97495:(r,i,s)=>{var a=s(38659),l=s(79266),c=s(52185);var d=!l?c:function(r,i){return l(r,"toString",{configurable:true,enumerable:false,value:a(i),writable:true})};r.exports=d},92548:r=>{function baseTimes(r,i){var s=-1,a=Array(r);while(++s{function baseUnary(r){return function(i){return r(i)}}r.exports=baseUnary},35870:(r,i,s)=>{var a=s(8758),l=s(84458),c=s(52706),d=s(92323),p=s(40834),u=s(19203);var A=200;function baseUniq(r,i,s){var h=-1,g=l,y=r.length,b=true,w=[],C=w;if(s){b=false;g=c}else if(y>=A){var v=i?null:p(r);if(v){return u(v)}b=false;g=d;C=new a}else{C=i?[]:w}e:while(++h{function cacheHas(r,i){return r.has(i)}r.exports=cacheHas},90602:(r,i,s)=>{var a=s(27413);var l=a["__core-js_shared__"];r.exports=l},40834:(r,i,s)=>{var a=s(86214),l=s(59922),c=s(19203);var d=1/0;var p=!(a&&1/c(new a([,-0]))[1]==d)?l:function(r){return new a(r)};r.exports=p},79266:(r,i,s)=>{var a=s(5620);var l=function(){try{var r=a(Object,"defineProperty");r({},"",{});return r}catch(r){}}();r.exports=l},94507:r=>{var i=typeof global=="object"&&global&&global.Object===Object&&global;r.exports=i},71227:(r,i,s)=>{var a=s(86125);function getMapData(r,i){var s=r.__data__;return a(i)?s[typeof i=="string"?"string":"hash"]:s.map}r.exports=getMapData},5620:(r,i,s)=>{var a=s(91029),l=s(22042);function getNative(r,i){var s=l(r,i);return a(s)?s:undefined}r.exports=getNative},53331:(r,i,s)=>{var a=s(67192);var l=a(Object.getPrototypeOf,Object);r.exports=l},71816:(r,i,s)=>{var a=s(97507);var l=Object.prototype;var c=l.hasOwnProperty;var d=l.toString;var p=a?a.toStringTag:undefined;function getRawTag(r){var i=c.call(r,p),s=r[p];try{r[p]=undefined;var a=true}catch(r){}var l=d.call(r);if(a){if(i){r[p]=s}else{delete r[p]}}return l}r.exports=getRawTag},22042:r=>{function getValue(r,i){return r==null?undefined:r[i]}r.exports=getValue},77308:(r,i,s)=>{var a=s(45772);function hashClear(){this.__data__=a?a(null):{};this.size=0}r.exports=hashClear},22368:r=>{function hashDelete(r){var i=this.has(r)&&delete this.__data__[r];this.size-=i?1:0;return i}r.exports=hashDelete},6410:(r,i,s)=>{var a=s(45772);var l="__lodash_hash_undefined__";var c=Object.prototype;var d=c.hasOwnProperty;function hashGet(r){var i=this.__data__;if(a){var s=i[r];return s===l?undefined:s}return d.call(i,r)?i[r]:undefined}r.exports=hashGet},61401:(r,i,s)=>{var a=s(45772);var l=Object.prototype;var c=l.hasOwnProperty;function hashHas(r){var i=this.__data__;return a?i[r]!==undefined:c.call(i,r)}r.exports=hashHas},79475:(r,i,s)=>{var a=s(45772);var l="__lodash_hash_undefined__";function hashSet(r,i){var s=this.__data__;this.size+=this.has(r)?0:1;s[r]=a&&i===undefined?l:i;return this}r.exports=hashSet},56042:(r,i,s)=>{var a=s(97507),l=s(21239),c=s(97284);var d=a?a.isConcatSpreadable:undefined;function isFlattenable(r){return c(r)||l(r)||!!(d&&r&&r[d])}r.exports=isFlattenable},44890:r=>{var i=9007199254740991;var s=/^(?:0|[1-9]\d*)$/;function isIndex(r,a){var l=typeof r;a=a==null?i:a;return!!a&&(l=="number"||l!="symbol"&&s.test(r))&&(r>-1&&r%1==0&&r{var a=s(72873),l=s(92301),c=s(44890),d=s(97838);function isIterateeCall(r,i,s){if(!d(s)){return false}var p=typeof i;if(p=="number"?l(s)&&c(i,s.length):p=="string"&&i in s){return a(s[i],r)}return false}r.exports=isIterateeCall},86125:r=>{function isKeyable(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}r.exports=isKeyable},52239:(r,i,s)=>{var a=s(90602);var l=function(){var r=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function isMasked(r){return!!l&&l in r}r.exports=isMasked},64524:r=>{var i=Object.prototype;function isPrototype(r){var s=r&&r.constructor,a=typeof s=="function"&&s.prototype||i;return r===a}r.exports=isPrototype},37236:r=>{function listCacheClear(){this.__data__=[];this.size=0}r.exports=listCacheClear},40092:(r,i,s)=>{var a=s(15200);var l=Array.prototype;var c=l.splice;function listCacheDelete(r){var i=this.__data__,s=a(i,r);if(s<0){return false}var l=i.length-1;if(s==l){i.pop()}else{c.call(i,s,1)}--this.size;return true}r.exports=listCacheDelete},17905:(r,i,s)=>{var a=s(15200);function listCacheGet(r){var i=this.__data__,s=a(i,r);return s<0?undefined:i[s][1]}r.exports=listCacheGet},75259:(r,i,s)=>{var a=s(15200);function listCacheHas(r){return a(this.__data__,r)>-1}r.exports=listCacheHas},56450:(r,i,s)=>{var a=s(15200);function listCacheSet(r,i){var s=this.__data__,l=a(s,r);if(l<0){++this.size;s.push([r,i])}else{s[l][1]=i}return this}r.exports=listCacheSet},29467:(r,i,s)=>{var a=s(3279),l=s(68070),c=s(43099);function mapCacheClear(){this.size=0;this.__data__={hash:new a,map:new(c||l),string:new a}}r.exports=mapCacheClear},78691:(r,i,s)=>{var a=s(71227);function mapCacheDelete(r){var i=a(this,r)["delete"](r);this.size-=i?1:0;return i}r.exports=mapCacheDelete},77697:(r,i,s)=>{var a=s(71227);function mapCacheGet(r){return a(this,r).get(r)}r.exports=mapCacheGet},17268:(r,i,s)=>{var a=s(71227);function mapCacheHas(r){return a(this,r).has(r)}r.exports=mapCacheHas},93689:(r,i,s)=>{var a=s(71227);function mapCacheSet(r,i){var s=a(this,r),l=s.size;s.set(r,i);this.size+=s.size==l?0:1;return this}r.exports=mapCacheSet},45772:(r,i,s)=>{var a=s(5620);var l=a(Object,"create");r.exports=l},99830:r=>{function nativeKeysIn(r){var i=[];if(r!=null){for(var s in Object(r)){i.push(s)}}return i}r.exports=nativeKeysIn},32465:(r,i,s)=>{r=s.nmd(r);var a=s(94507);var l=true&&i&&!i.nodeType&&i;var c=l&&"object"=="object"&&r&&!r.nodeType&&r;var d=c&&c.exports===l;var p=d&&a.process;var u=function(){try{var r=c&&c.require&&c.require("util").types;if(r){return r}return p&&p.binding&&p.binding("util")}catch(r){}}();r.exports=u},38078:r=>{var i=Object.prototype;var s=i.toString;function objectToString(r){return s.call(r)}r.exports=objectToString},67192:r=>{function overArg(r,i){return function(s){return r(i(s))}}r.exports=overArg},50149:(r,i,s)=>{var a=s(40529);var l=Math.max;function overRest(r,i,s){i=l(i===undefined?r.length-1:i,0);return function(){var c=arguments,d=-1,p=l(c.length-i,0),u=Array(p);while(++d{var a=s(94507);var l=typeof self=="object"&&self&&self.Object===Object&&self;var c=a||l||Function("return this")();r.exports=c},83702:r=>{var i="__lodash_hash_undefined__";function setCacheAdd(r){this.__data__.set(r,i);return this}r.exports=setCacheAdd},60008:r=>{function setCacheHas(r){return this.__data__.has(r)}r.exports=setCacheHas},19203:r=>{function setToArray(r){var i=-1,s=Array(r.size);r.forEach((function(r){s[++i]=r}));return s}r.exports=setToArray},40252:(r,i,s)=>{var a=s(97495),l=s(2837);var c=l(a);r.exports=c},2837:r=>{var i=800,s=16;var a=Date.now;function shortOut(r){var l=0,c=0;return function(){var d=a(),p=s-(d-c);c=d;if(p>0){if(++l>=i){return arguments[0]}}else{l=0}return r.apply(undefined,arguments)}}r.exports=shortOut},10422:r=>{function strictIndexOf(r,i,s){var a=s-1,l=r.length;while(++a{var i=Function.prototype;var s=i.toString;function toSource(r){if(r!=null){try{return s.call(r)}catch(r){}try{return r+""}catch(r){}}return""}r.exports=toSource},38659:r=>{function constant(r){return function(){return r}}r.exports=constant},45500:(r,i,s)=>{var a=s(97593),l=s(72873),c=s(71223),d=s(5635);var p=Object.prototype;var u=p.hasOwnProperty;var A=a((function(r,i){r=Object(r);var s=-1;var a=i.length;var A=a>2?i[2]:undefined;if(A&&c(i[0],i[1],A)){a=1}while(++s{var a=s(43321),l=s(16337),c=s(97593),d=s(49395);var p=c((function(r,i){return d(r)?a(r,l(i,1,d,true)):[]}));r.exports=p},72873:r=>{function eq(r,i){return r===i||r!==r&&i!==i}r.exports=eq},53643:(r,i,s)=>{var a=s(16337);function flatten(r){var i=r==null?0:r.length;return i?a(r,1):[]}r.exports=flatten},52185:r=>{function identity(r){return r}r.exports=identity},21239:(r,i,s)=>{var a=s(54124),l=s(79620);var c=Object.prototype;var d=c.hasOwnProperty;var p=c.propertyIsEnumerable;var u=a(function(){return arguments}())?a:function(r){return l(r)&&d.call(r,"callee")&&!p.call(r,"callee")};r.exports=u},97284:r=>{var i=Array.isArray;r.exports=i},92301:(r,i,s)=>{var a=s(50593),l=s(35967);function isArrayLike(r){return r!=null&&l(r.length)&&!a(r)}r.exports=isArrayLike},49395:(r,i,s)=>{var a=s(92301),l=s(79620);function isArrayLikeObject(r){return l(r)&&a(r)}r.exports=isArrayLikeObject},18004:(r,i,s)=>{r=s.nmd(r);var a=s(27413),l=s(57270);var c=true&&i&&!i.nodeType&&i;var d=c&&"object"=="object"&&r&&!r.nodeType&&r;var p=d&&d.exports===c;var u=p?a.Buffer:undefined;var A=u?u.isBuffer:undefined;var h=A||l;r.exports=h},50593:(r,i,s)=>{var a=s(27794),l=s(97838);var c="[object AsyncFunction]",d="[object Function]",p="[object GeneratorFunction]",u="[object Proxy]";function isFunction(r){if(!l(r)){return false}var i=a(r);return i==d||i==p||i==c||i==u}r.exports=isFunction},35967:r=>{var i=9007199254740991;function isLength(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=i}r.exports=isLength},97838:r=>{function isObject(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}r.exports=isObject},79620:r=>{function isObjectLike(r){return r!=null&&typeof r=="object"}r.exports=isObjectLike},20639:(r,i,s)=>{var a=s(27794),l=s(53331),c=s(79620);var d="[object Object]";var p=Function.prototype,u=Object.prototype;var A=p.toString;var h=u.hasOwnProperty;var g=A.call(Object);function isPlainObject(r){if(!c(r)||a(r)!=d){return false}var i=l(r);if(i===null){return true}var s=h.call(i,"constructor")&&i.constructor;return typeof s=="function"&&s instanceof s&&A.call(s)==g}r.exports=isPlainObject},59957:(r,i,s)=>{var a=s(81797),l=s(48048),c=s(32465);var d=c&&c.isTypedArray;var p=d?l(d):a;r.exports=p},5635:(r,i,s)=>{var a=s(69730),l=s(3368),c=s(92301);function keysIn(r){return c(r)?a(r,true):l(r)}r.exports=keysIn},59922:r=>{function noop(){}r.exports=noop},57270:r=>{function stubFalse(){return false}r.exports=stubFalse},7266:(r,i,s)=>{var a=s(16337),l=s(97593),c=s(35870),d=s(49395);var p=l((function(r){return c(a(r,1,d,true))}));r.exports=p},30453:(r,i,s)=>{ /*! * mime-db * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed */ -r.exports=a(79857)},57567:(r,i,a)=>{"use strict"; +r.exports=s(79857)},57567:(r,i,s)=>{"use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */var s=a(30453);var l=a(71017).extname;var c=/^\s*([^;\s]*)(?:;|\s|$)/;var p=/^text\//i;i.charset=charset;i.charsets={lookup:charset};i.contentType=contentType;i.extension=extension;i.extensions=Object.create(null);i.lookup=lookup;i.types=Object.create(null);populateMaps(i.extensions,i.types);function charset(r){if(!r||typeof r!=="string"){return false}var i=c.exec(r);var a=i&&s[i[1].toLowerCase()];if(a&&a.charset){return a.charset}if(i&&p.test(i[1])){return"UTF-8"}return false}function contentType(r){if(!r||typeof r!=="string"){return false}var a=r.indexOf("/")===-1?i.lookup(r):r;if(!a){return false}if(a.indexOf("charset")===-1){var s=i.charset(a);if(s)a+="; charset="+s.toLowerCase()}return a}function extension(r){if(!r||typeof r!=="string"){return false}var a=c.exec(r);var s=a&&i.extensions[a[1].toLowerCase()];if(!s||!s.length){return false}return s[0]}function lookup(r){if(!r||typeof r!=="string"){return false}var a=l("x."+r).toLowerCase().substr(1);if(!a){return false}return i.types[a]||false}function populateMaps(r,i){var a=["nginx","apache",undefined,"iana"];Object.keys(s).forEach((function forEachMimeType(l){var c=s[l];var p=c.extensions;if(!p||!p.length){return}r[l]=p;for(var d=0;dh||A===h&&i[u].substr(0,12)==="application/")){continue}}i[u]=l}}))}},94193:(r,i,a)=>{r.exports=minimatch;minimatch.Minimatch=Minimatch;var s=function(){try{return a(71017)}catch(r){}}()||{sep:"/"};minimatch.sep=s.sep;var l=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var c=a(46201);var p={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var d="[^/]";var u=d+"*?";var A="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var h="(?:(?!(?:\\/|^)\\.).)*?";var g=charSet("().*{}+?[]^$\\!");function charSet(r){return r.split("").reduce((function(r,i){r[i]=true;return r}),{})}var y=/\/+/;minimatch.filter=filter;function filter(r,i){i=i||{};return function(a,s,l){return minimatch(a,r,i)}}function ext(r,i){i=i||{};var a={};Object.keys(r).forEach((function(i){a[i]=r[i]}));Object.keys(i).forEach((function(r){a[r]=i[r]}));return a}minimatch.defaults=function(r){if(!r||typeof r!=="object"||!Object.keys(r).length){return minimatch}var i=minimatch;var a=function minimatch(a,s,l){return i(a,s,ext(r,l))};a.Minimatch=function Minimatch(a,s){return new i.Minimatch(a,ext(r,s))};a.Minimatch.defaults=function defaults(a){return i.defaults(ext(r,a)).Minimatch};a.filter=function filter(a,s){return i.filter(a,ext(r,s))};a.defaults=function defaults(a){return i.defaults(ext(r,a))};a.makeRe=function makeRe(a,s){return i.makeRe(a,ext(r,s))};a.braceExpand=function braceExpand(a,s){return i.braceExpand(a,ext(r,s))};a.match=function(a,s,l){return i.match(a,s,ext(r,l))};return a};Minimatch.defaults=function(r){return minimatch.defaults(r).Minimatch};function minimatch(r,i,a){assertValidPattern(i);if(!a)a={};if(!a.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,a).match(r)}function Minimatch(r,i){if(!(this instanceof Minimatch)){return new Minimatch(r,i)}assertValidPattern(r);if(!i)i={};r=r.trim();if(!i.allowWindowsEscape&&s.sep!=="/"){r=r.split(s.sep).join("/")}this.options=i;this.set=[];this.pattern=r;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var r=this.pattern;var i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();var a=this.globSet=this.braceExpand();if(i.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,a);a=this.globParts=a.map((function(r){return r.split(y)}));this.debug(this.pattern,a);a=a.map((function(r,i,a){return r.map(this.parse,this)}),this);this.debug(this.pattern,a);a=a.filter((function(r){return r.indexOf(false)===-1}));this.debug(this.pattern,a);this.set=a}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var r=this.pattern;var i=false;var a=this.options;var s=0;if(a.nonegate)return;for(var l=0,c=r.length;lE){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var b={};function parse(r,i){assertValidPattern(r);var a=this.options;if(r==="**"){if(!a.noglobstar)return l;else r="*"}if(r==="")return"";var s="";var c=!!a.nocase;var A=false;var h=[];var y=[];var E;var C=false;var v=-1;var B=-1;var I=r.charAt(0)==="."?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var w=this;function clearStateChar(){if(E){switch(E){case"*":s+=u;c=true;break;case"?":s+=d;c=true;break;default:s+="\\"+E;break}w.debug("clearStateChar %j %j",E,s);E=false}}for(var S=0,Q=r.length,x;S-1;O--){var P=y[O];var L=s.slice(0,P.reStart);var M=s.slice(P.reStart,P.reEnd-8);var U=s.slice(P.reEnd-8,P.reEnd);var q=s.slice(P.reEnd);U+=q;var H=L.split("(").length-1;var j=q;for(S=0;S=0;p--){c=r[p];if(c)break}for(p=0;p>> no match, partial?",r,g,i,y);if(g===d)return true}return false}var b;if(typeof A==="string"){b=h===A;this.debug("string match",A,h,b)}else{b=h.match(A);this.debug("pattern match",A,h,b)}if(!b)return false}if(c===d&&p===u){return true}else if(c===d){return a}else if(p===u){return c===d-1&&r[c]===""}throw new Error("wtf?")};function globUnescape(r){return r.replace(/\\(.)/g,"$1")}function regExpEscape(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},46201:(r,i,a)=>{var s=a(98955);var l=a(44350);r.exports=expandTop;var c="\0SLASH"+Math.random()+"\0";var p="\0OPEN"+Math.random()+"\0";var d="\0CLOSE"+Math.random()+"\0";var u="\0COMMA"+Math.random()+"\0";var A="\0PERIOD"+Math.random()+"\0";function numeric(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function escapeBraces(r){return r.split("\\\\").join(c).split("\\{").join(p).split("\\}").join(d).split("\\,").join(u).split("\\.").join(A)}function unescapeBraces(r){return r.split(c).join("\\").split(p).join("{").split(d).join("}").split(u).join(",").split(A).join(".")}function parseCommaParts(r){if(!r)return[""];var i=[];var a=l("{","}",r);if(!a)return r.split(",");var s=a.pre;var c=a.body;var p=a.post;var d=s.split(",");d[d.length-1]+="{"+c+"}";var u=parseCommaParts(p);if(p.length){d[d.length-1]+=u.shift();d.push.apply(d,u)}i.push.apply(i,d);return i}function expandTop(r){if(!r)return[];if(r.substr(0,2)==="{}"){r="\\{\\}"+r.substr(2)}return expand(escapeBraces(r),true).map(unescapeBraces)}function identity(r){return r}function embrace(r){return"{"+r+"}"}function isPadded(r){return/^-?0\d/.test(r)}function lte(r,i){return r<=i}function gte(r,i){return r>=i}function expand(r,i){var a=[];var c=l("{","}",r);if(!c||/\$$/.test(c.pre))return[r];var p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body);var u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body);var A=p||u;var h=c.body.indexOf(",")>=0;if(!A&&!h){if(c.post.match(/,.*\}/)){r=c.pre+"{"+c.body+d+c.post;return expand(r)}return[r]}var g;if(A){g=c.body.split(/\.\./)}else{g=parseCommaParts(c.body);if(g.length===1){g=expand(g[0],false).map(embrace);if(g.length===1){var y=c.post.length?expand(c.post,false):[""];return y.map((function(r){return c.pre+g[0]+r}))}}}var E=c.pre;var y=c.post.length?expand(c.post,false):[""];var b;if(A){var C=numeric(g[0]);var v=numeric(g[1]);var B=Math.max(g[0].length,g[1].length);var I=g.length==3?Math.abs(numeric(g[2])):1;var w=lte;var S=v0){var T=new Array(R+1).join("0");if(x<0)N="-"+T+N.slice(1);else N=T+N}}}b.push(N)}}else{b=s(g,(function(r){return expand(r,false)}))}for(var D=0;D{var s=a(71017);var l=a(57147);var c=parseInt("0777",8);r.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(r,i,a,p){if(typeof i==="function"){a=i;i={}}else if(!i||typeof i!=="object"){i={mode:i}}var d=i.mode;var u=i.fs||l;if(d===undefined){d=c}if(!p)p=null;var A=a||function(){};r=s.resolve(r);u.mkdir(r,d,(function(a){if(!a){p=p||r;return A(null,p)}switch(a.code){case"ENOENT":if(s.dirname(r)===r)return A(a);mkdirP(s.dirname(r),i,(function(a,s){if(a)A(a,s);else mkdirP(r,i,A,s)}));break;default:u.stat(r,(function(r,i){if(r||!i.isDirectory())A(a,p);else A(null,p)}));break}}))}mkdirP.sync=function sync(r,i,a){if(!i||typeof i!=="object"){i={mode:i}}var p=i.mode;var d=i.fs||l;if(p===undefined){p=c}if(!a)a=null;r=s.resolve(r);try{d.mkdirSync(r,p);a=a||r}catch(l){switch(l.code){case"ENOENT":a=sync(s.dirname(r),i,a);sync(r,i,a);break;default:var u;try{u=d.statSync(r)}catch(r){throw l}if(!u.isDirectory())throw l;break}}return a}},18885:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var s=_interopDefault(a(12781));var l=_interopDefault(a(13685));var c=_interopDefault(a(57310));var p=_interopDefault(a(24055));var d=_interopDefault(a(95687));var u=_interopDefault(a(59796));const A=s.Readable;const h=Symbol("buffer");const g=Symbol("type");class Blob{constructor(){this[g]="";const r=arguments[0];const i=arguments[1];const a=[];let s=0;if(r){const i=r;const l=Number(i.length);for(let r=0;r1&&arguments[1]!==undefined?arguments[1]:{},l=a.size;let c=l===undefined?0:l;var p=a.timeout;let d=p===undefined?0:p;if(r==null){r=null}else if(isURLSearchParams(r)){r=Buffer.from(r.toString())}else if(isBlob(r));else if(Buffer.isBuffer(r));else if(Object.prototype.toString.call(r)==="[object ArrayBuffer]"){r=Buffer.from(r)}else if(ArrayBuffer.isView(r)){r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(r instanceof s);else{r=Buffer.from(String(r))}this[E]={body:r,disturbed:false,error:null};this.size=c;this.timeout=d;if(r instanceof s){r.on("error",(function(r){const a=r.name==="AbortError"?r:new FetchError(`Invalid response body while trying to fetch ${i.url}: ${r.message}`,"system",r);i[E].error=a}))}}Body.prototype={get body(){return this[E].body},get bodyUsed(){return this[E].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(r){return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}))},blob(){let r=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(i){return Object.assign(new Blob([],{type:r.toLowerCase()}),{[h]:i})}))},json(){var r=this;return consumeBody.call(this).then((function(i){try{return JSON.parse(i.toString())}catch(i){return Body.Promise.reject(new FetchError(`invalid json response body at ${r.url} reason: ${i.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(r){return r.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var r=this;return consumeBody.call(this).then((function(i){return convertBody(i,r.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(r){for(const i of Object.getOwnPropertyNames(Body.prototype)){if(!(i in r)){const a=Object.getOwnPropertyDescriptor(Body.prototype,i);Object.defineProperty(r,i,a)}}};function consumeBody(){var r=this;if(this[E].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[E].disturbed=true;if(this[E].error){return Body.Promise.reject(this[E].error)}let i=this.body;if(i===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(i)){i=i.stream()}if(Buffer.isBuffer(i)){return Body.Promise.resolve(i)}if(!(i instanceof s)){return Body.Promise.resolve(Buffer.alloc(0))}let a=[];let l=0;let c=false;return new Body.Promise((function(s,p){let d;if(r.timeout){d=setTimeout((function(){c=true;p(new FetchError(`Response timeout while trying to fetch ${r.url} (over ${r.timeout}ms)`,"body-timeout"))}),r.timeout)}i.on("error",(function(i){if(i.name==="AbortError"){c=true;p(i)}else{p(new FetchError(`Invalid response body while trying to fetch ${r.url}: ${i.message}`,"system",i))}}));i.on("data",(function(i){if(c||i===null){return}if(r.size&&l+i.length>r.size){c=true;p(new FetchError(`content size at ${r.url} over limit: ${r.size}`,"max-size"));return}l+=i.length;a.push(i)}));i.on("end",(function(){if(c){return}clearTimeout(d);try{s(Buffer.concat(a,l))}catch(i){p(new FetchError(`Could not create Buffer from response body for ${r.url}: ${i.message}`,"system",i))}}))}))}function convertBody(r,i){if(typeof y!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const a=i.get("content-type");let s="utf-8";let l,c;if(a){l=/charset=([^;]*)/i.exec(a)}c=r.slice(0,1024).toString();if(!l&&c){l=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[B]=Object.create(null);if(r instanceof Headers){const i=r.raw();const a=Object.keys(i);for(const r of a){for(const a of i[r]){this.append(r,a)}}return}if(r==null);else if(typeof r==="object"){const i=r[Symbol.iterator];if(i!=null){if(typeof i!=="function"){throw new TypeError("Header pairs must be iterable")}const a=[];for(const i of r){if(typeof i!=="object"||typeof i[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}a.push(Array.from(i))}for(const r of a){if(r.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(r[0],r[1])}}else{for(const i of Object.keys(r)){const a=r[i];this.append(i,a)}}}else{throw new TypeError("Provided initializer must be an object")}}get(r){r=`${r}`;validateName(r);const i=find(this[B],r);if(i===undefined){return null}return this[B][i].join(", ")}forEach(r){let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let a=getHeaders(this);let s=0;while(s1&&arguments[1]!==undefined?arguments[1]:"key+value";const a=Object.keys(r[B]).sort();return a.map(i==="key"?function(r){return r.toLowerCase()}:i==="value"?function(i){return r[B][i].join(", ")}:function(i){return[i.toLowerCase(),r[B][i].join(", ")]})}const I=Symbol("internal");function createHeadersIterator(r,i){const a=Object.create(w);a[I]={target:r,kind:i,index:0};return a}const w=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==w){throw new TypeError("Value of `this` is not a HeadersIterator")}var r=this[I];const i=r.target,a=r.kind,s=r.index;const l=getHeaders(i,a);const c=l.length;if(s>=c){return{value:undefined,done:true}}this[I].index=s+1;return{value:l[s],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(w,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(r){const i=Object.assign({__proto__:null},r[B]);const a=find(r[B],"Host");if(a!==undefined){i[a]=i[a][0]}return i}function createHeadersLenient(r){const i=new Headers;for(const a of Object.keys(r)){if(C.test(a)){continue}if(Array.isArray(r[a])){for(const s of r[a]){if(v.test(s)){continue}if(i[B][a]===undefined){i[B][a]=[s]}else{i[B][a].push(s)}}}else if(!v.test(r[a])){i[B][a]=[r[a]]}}return i}const S=Symbol("Response internals");const Q=l.STATUS_CODES;class Response{constructor(){let r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,r,i);const a=i.status||200;const s=new Headers(i.headers);if(r!=null&&!s.has("Content-Type")){const i=extractContentType(r);if(i){s.append("Content-Type",i)}}this[S]={url:i.url,status:a,statusText:i.statusText||Q[a],headers:s,counter:i.counter}}get url(){return this[S].url||""}get status(){return this[S].status}get ok(){return this[S].status>=200&&this[S].status<300}get redirected(){return this[S].counter>0}get statusText(){return this[S].statusText}get headers(){return this[S].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const x=Symbol("Request internals");const N=c.URL||p.URL;const R=c.parse;const T=c.format;function parseURL(r){if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(r)){r=new N(r).toString()}return R(r)}const D="destroy"in s.Readable.prototype;function isRequest(r){return typeof r==="object"&&typeof r[x]==="object"}function isAbortSignal(r){const i=r&&typeof r==="object"&&Object.getPrototypeOf(r);return!!(i&&i.constructor.name==="AbortSignal")}class Request{constructor(r){let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let a;if(!isRequest(r)){if(r&&r.href){a=parseURL(r.href)}else{a=parseURL(`${r}`)}r={}}else{a=parseURL(r.url)}let s=i.method||r.method||"GET";s=s.toUpperCase();if((i.body!=null||isRequest(r)&&r.body!==null)&&(s==="GET"||s==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let l=i.body!=null?i.body:isRequest(r)&&r.body!==null?clone(r):null;Body.call(this,l,{timeout:i.timeout||r.timeout||0,size:i.size||r.size||0});const c=new Headers(i.headers||r.headers||{});if(l!=null&&!c.has("Content-Type")){const r=extractContentType(l);if(r){c.append("Content-Type",r)}}let p=isRequest(r)?r.signal:null;if("signal"in i)p=i.signal;if(p!=null&&!isAbortSignal(p)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[x]={method:s,redirect:i.redirect||r.redirect||"follow",headers:c,parsedURL:a,signal:p};this.follow=i.follow!==undefined?i.follow:r.follow!==undefined?r.follow:20;this.compress=i.compress!==undefined?i.compress:r.compress!==undefined?r.compress:true;this.counter=i.counter||r.counter||0;this.agent=i.agent||r.agent}get method(){return this[x].method}get url(){return T(this[x].parsedURL)}get headers(){return this[x].headers}get redirect(){return this[x].redirect}get signal(){return this[x].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(r){const i=r[x].parsedURL;const a=new Headers(r[x].headers);if(!a.has("Accept")){a.set("Accept","*/*")}if(!i.protocol||!i.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(i.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(r.signal&&r.body instanceof s.Readable&&!D){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let l=null;if(r.body==null&&/^(POST|PUT)$/i.test(r.method)){l="0"}if(r.body!=null){const i=getTotalBytes(r);if(typeof i==="number"){l=String(i)}}if(l){a.set("Content-Length",l)}if(!a.has("User-Agent")){a.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(r.compress&&!a.has("Accept-Encoding")){a.set("Accept-Encoding","gzip,deflate")}let c=r.agent;if(typeof c==="function"){c=c(i)}return Object.assign({},i,{method:r.method,headers:exportNodeCompatibleHeaders(a),agent:c})}function AbortError(r){Error.call(this,r);this.type="aborted";this.message=r;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const k=c.URL||p.URL;const _=s.PassThrough;const O=function isDomainOrSubdomain(r,i){const a=new k(i).hostname;const s=new k(r).hostname;return a===s||a[a.length-s.length-1]==="."&&a.endsWith(s)};const P=function isSameProtocol(r,i){const a=new k(i).protocol;const s=new k(r).protocol;return a===s};function fetch(r,i){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(a,c){const p=new Request(r,i);const A=getNodeRequestOptions(p);const h=(A.protocol==="https:"?d:l).request;const g=p.signal;let y=null;const E=function abort(){let r=new AbortError("The user aborted a request.");c(r);if(p.body&&p.body instanceof s.Readable){destroyStream(p.body,r)}if(!y||!y.body)return;y.body.emit("error",r)};if(g&&g.aborted){E();return}const b=function abortAndFinalize(){E();finalize()};const C=h(A);let v;if(g){g.addEventListener("abort",b)}function finalize(){C.abort();if(g)g.removeEventListener("abort",b);clearTimeout(v)}if(p.timeout){C.once("socket",(function(r){v=setTimeout((function(){c(new FetchError(`network timeout at: ${p.url}`,"request-timeout"));finalize()}),p.timeout)}))}C.on("error",(function(r){c(new FetchError(`request to ${p.url} failed, reason: ${r.message}`,"system",r));if(y&&y.body){destroyStream(y.body,r)}finalize()}));fixResponseChunkedTransferBadEnding(C,(function(r){if(g&&g.aborted){return}if(y&&y.body){destroyStream(y.body,r)}}));if(parseInt(process.version.substring(1))<14){C.on("socket",(function(r){r.addListener("close",(function(i){const a=r.listenerCount("data")>0;if(y&&a&&!i&&!(g&&g.aborted)){const r=new Error("Premature close");r.code="ERR_STREAM_PREMATURE_CLOSE";y.body.emit("error",r)}}))}))}C.on("response",(function(r){clearTimeout(v);const i=createHeadersLenient(r.headers);if(fetch.isRedirect(r.statusCode)){const s=i.get("Location");let l=null;try{l=s===null?null:new k(s,p.url).toString()}catch(r){if(p.redirect!=="manual"){c(new FetchError(`uri requested responds with an invalid redirect URL: ${s}`,"invalid-redirect"));finalize();return}}switch(p.redirect){case"error":c(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${p.url}`,"no-redirect"));finalize();return;case"manual":if(l!==null){try{i.set("Location",l)}catch(r){c(r)}}break;case"follow":if(l===null){break}if(p.counter>=p.follow){c(new FetchError(`maximum redirect reached at: ${p.url}`,"max-redirect"));finalize();return}const s={headers:new Headers(p.headers),follow:p.follow,counter:p.counter+1,agent:p.agent,compress:p.compress,method:p.method,body:p.body,signal:p.signal,timeout:p.timeout,size:p.size};if(!O(p.url,l)||!P(p.url,l)){for(const r of["authorization","www-authenticate","cookie","cookie2"]){s.headers.delete(r)}}if(r.statusCode!==303&&p.body&&getTotalBytes(p)===null){c(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(r.statusCode===303||(r.statusCode===301||r.statusCode===302)&&p.method==="POST"){s.method="GET";s.body=undefined;s.headers.delete("content-length")}a(fetch(new Request(l,s)));finalize();return}}r.once("end",(function(){if(g)g.removeEventListener("abort",b)}));let s=r.pipe(new _);const l={url:p.url,status:r.statusCode,statusText:r.statusMessage,headers:i,size:p.size,timeout:p.timeout,counter:p.counter};const d=i.get("Content-Encoding");if(!p.compress||p.method==="HEAD"||d===null||r.statusCode===204||r.statusCode===304){y=new Response(s,l);a(y);return}const A={flush:u.Z_SYNC_FLUSH,finishFlush:u.Z_SYNC_FLUSH};if(d=="gzip"||d=="x-gzip"){s=s.pipe(u.createGunzip(A));y=new Response(s,l);a(y);return}if(d=="deflate"||d=="x-deflate"){const i=r.pipe(new _);i.once("data",(function(r){if((r[0]&15)===8){s=s.pipe(u.createInflate())}else{s=s.pipe(u.createInflateRaw())}y=new Response(s,l);a(y)}));i.on("end",(function(){if(!y){y=new Response(s,l);a(y)}}));return}if(d=="br"&&typeof u.createBrotliDecompress==="function"){s=s.pipe(u.createBrotliDecompress());y=new Response(s,l);a(y);return}y=new Response(s,l);a(y)}));writeToStream(C,p)}))}function fixResponseChunkedTransferBadEnding(r,i){let a;r.on("socket",(function(r){a=r}));r.on("response",(function(r){const s=r.headers;if(s["transfer-encoding"]==="chunked"&&!s["content-length"]){r.once("close",(function(r){const s=a&&a.listenerCount("data")>0;if(s&&!r){const r=new Error("Premature close");r.code="ERR_STREAM_PREMATURE_CLOSE";i(r)}}))}}))}function destroyStream(r,i){if(r.destroy){r.destroy(i)}else{r.emit("error",i);r.end()}}fetch.isRedirect=function(r){return r===301||r===302||r===303||r===307||r===308};fetch.Promise=global.Promise;r.exports=i=fetch;Object.defineProperty(i,"__esModule",{value:true});i["default"]=i;i.Headers=Headers;i.Request=Request;i.Response=Response;i.FetchError=FetchError;i.AbortError=AbortError},43766:r=>{ + */var a=s(30453);var l=s(71017).extname;var c=/^\s*([^;\s]*)(?:;|\s|$)/;var d=/^text\//i;i.charset=charset;i.charsets={lookup:charset};i.contentType=contentType;i.extension=extension;i.extensions=Object.create(null);i.lookup=lookup;i.types=Object.create(null);populateMaps(i.extensions,i.types);function charset(r){if(!r||typeof r!=="string"){return false}var i=c.exec(r);var s=i&&a[i[1].toLowerCase()];if(s&&s.charset){return s.charset}if(i&&d.test(i[1])){return"UTF-8"}return false}function contentType(r){if(!r||typeof r!=="string"){return false}var s=r.indexOf("/")===-1?i.lookup(r):r;if(!s){return false}if(s.indexOf("charset")===-1){var a=i.charset(s);if(a)s+="; charset="+a.toLowerCase()}return s}function extension(r){if(!r||typeof r!=="string"){return false}var s=c.exec(r);var a=s&&i.extensions[s[1].toLowerCase()];if(!a||!a.length){return false}return a[0]}function lookup(r){if(!r||typeof r!=="string"){return false}var s=l("x."+r).toLowerCase().substr(1);if(!s){return false}return i.types[s]||false}function populateMaps(r,i){var s=["nginx","apache",undefined,"iana"];Object.keys(a).forEach((function forEachMimeType(l){var c=a[l];var d=c.extensions;if(!d||!d.length){return}r[l]=d;for(var p=0;ph||A===h&&i[u].substr(0,12)==="application/")){continue}}i[u]=l}}))}},94193:(r,i,s)=>{r.exports=minimatch;minimatch.Minimatch=Minimatch;var a=function(){try{return s(71017)}catch(r){}}()||{sep:"/"};minimatch.sep=a.sep;var l=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var c=s(46201);var d={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var p="[^/]";var u=p+"*?";var A="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var h="(?:(?!(?:\\/|^)\\.).)*?";var g=charSet("().*{}+?[]^$\\!");function charSet(r){return r.split("").reduce((function(r,i){r[i]=true;return r}),{})}var y=/\/+/;minimatch.filter=filter;function filter(r,i){i=i||{};return function(s,a,l){return minimatch(s,r,i)}}function ext(r,i){i=i||{};var s={};Object.keys(r).forEach((function(i){s[i]=r[i]}));Object.keys(i).forEach((function(r){s[r]=i[r]}));return s}minimatch.defaults=function(r){if(!r||typeof r!=="object"||!Object.keys(r).length){return minimatch}var i=minimatch;var s=function minimatch(s,a,l){return i(s,a,ext(r,l))};s.Minimatch=function Minimatch(s,a){return new i.Minimatch(s,ext(r,a))};s.Minimatch.defaults=function defaults(s){return i.defaults(ext(r,s)).Minimatch};s.filter=function filter(s,a){return i.filter(s,ext(r,a))};s.defaults=function defaults(s){return i.defaults(ext(r,s))};s.makeRe=function makeRe(s,a){return i.makeRe(s,ext(r,a))};s.braceExpand=function braceExpand(s,a){return i.braceExpand(s,ext(r,a))};s.match=function(s,a,l){return i.match(s,a,ext(r,l))};return s};Minimatch.defaults=function(r){return minimatch.defaults(r).Minimatch};function minimatch(r,i,s){assertValidPattern(i);if(!s)s={};if(!s.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,s).match(r)}function Minimatch(r,i){if(!(this instanceof Minimatch)){return new Minimatch(r,i)}assertValidPattern(r);if(!i)i={};r=r.trim();if(!i.allowWindowsEscape&&a.sep!=="/"){r=r.split(a.sep).join("/")}this.options=i;this.set=[];this.pattern=r;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var r=this.pattern;var i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();var s=this.globSet=this.braceExpand();if(i.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,s);s=this.globParts=s.map((function(r){return r.split(y)}));this.debug(this.pattern,s);s=s.map((function(r,i,s){return r.map(this.parse,this)}),this);this.debug(this.pattern,s);s=s.filter((function(r){return r.indexOf(false)===-1}));this.debug(this.pattern,s);this.set=s}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var r=this.pattern;var i=false;var s=this.options;var a=0;if(s.nonegate)return;for(var l=0,c=r.length;lb){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var w={};function parse(r,i){assertValidPattern(r);var s=this.options;if(r==="**"){if(!s.noglobstar)return l;else r="*"}if(r==="")return"";var a="";var c=!!s.nocase;var A=false;var h=[];var y=[];var b;var C=false;var v=-1;var I=-1;var B=r.charAt(0)==="."?"":s.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var S=this;function clearStateChar(){if(b){switch(b){case"*":a+=u;c=true;break;case"?":a+=p;c=true;break;default:a+="\\"+b;break}S.debug("clearStateChar %j %j",b,a);b=false}}for(var x=0,R=r.length,Q;x-1;O--){var L=y[O];var M=a.slice(0,L.reStart);var U=a.slice(L.reStart,L.reEnd-8);var j=a.slice(L.reEnd-8,L.reEnd);var H=a.slice(L.reEnd);j+=H;var q=M.split("(").length-1;var G=H;for(x=0;x=0;d--){c=r[d];if(c)break}for(d=0;d>> no match, partial?",r,g,i,y);if(g===p)return true}return false}var w;if(typeof A==="string"){w=h===A;this.debug("string match",A,h,w)}else{w=h.match(A);this.debug("pattern match",A,h,w)}if(!w)return false}if(c===p&&d===u){return true}else if(c===p){return s}else if(d===u){return c===p-1&&r[c]===""}throw new Error("wtf?")};function globUnescape(r){return r.replace(/\\(.)/g,"$1")}function regExpEscape(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},46201:(r,i,s)=>{var a=s(98955);var l=s(44350);r.exports=expandTop;var c="\0SLASH"+Math.random()+"\0";var d="\0OPEN"+Math.random()+"\0";var p="\0CLOSE"+Math.random()+"\0";var u="\0COMMA"+Math.random()+"\0";var A="\0PERIOD"+Math.random()+"\0";function numeric(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function escapeBraces(r){return r.split("\\\\").join(c).split("\\{").join(d).split("\\}").join(p).split("\\,").join(u).split("\\.").join(A)}function unescapeBraces(r){return r.split(c).join("\\").split(d).join("{").split(p).join("}").split(u).join(",").split(A).join(".")}function parseCommaParts(r){if(!r)return[""];var i=[];var s=l("{","}",r);if(!s)return r.split(",");var a=s.pre;var c=s.body;var d=s.post;var p=a.split(",");p[p.length-1]+="{"+c+"}";var u=parseCommaParts(d);if(d.length){p[p.length-1]+=u.shift();p.push.apply(p,u)}i.push.apply(i,p);return i}function expandTop(r){if(!r)return[];if(r.substr(0,2)==="{}"){r="\\{\\}"+r.substr(2)}return expand(escapeBraces(r),true).map(unescapeBraces)}function identity(r){return r}function embrace(r){return"{"+r+"}"}function isPadded(r){return/^-?0\d/.test(r)}function lte(r,i){return r<=i}function gte(r,i){return r>=i}function expand(r,i){var s=[];var c=l("{","}",r);if(!c||/\$$/.test(c.pre))return[r];var d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body);var u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body);var A=d||u;var h=c.body.indexOf(",")>=0;if(!A&&!h){if(c.post.match(/,.*\}/)){r=c.pre+"{"+c.body+p+c.post;return expand(r)}return[r]}var g;if(A){g=c.body.split(/\.\./)}else{g=parseCommaParts(c.body);if(g.length===1){g=expand(g[0],false).map(embrace);if(g.length===1){var y=c.post.length?expand(c.post,false):[""];return y.map((function(r){return c.pre+g[0]+r}))}}}var b=c.pre;var y=c.post.length?expand(c.post,false):[""];var w;if(A){var C=numeric(g[0]);var v=numeric(g[1]);var I=Math.max(g[0].length,g[1].length);var B=g.length==3?Math.abs(numeric(g[2])):1;var S=lte;var x=v0){var T=new Array(N+1).join("0");if(Q<0)_="-"+T+_.slice(1);else _=T+_}}}w.push(_)}}else{w=a(g,(function(r){return expand(r,false)}))}for(var k=0;k{var a=s(71017);var l=s(57147);var c=parseInt("0777",8);r.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(r,i,s,d){if(typeof i==="function"){s=i;i={}}else if(!i||typeof i!=="object"){i={mode:i}}var p=i.mode;var u=i.fs||l;if(p===undefined){p=c}if(!d)d=null;var A=s||function(){};r=a.resolve(r);u.mkdir(r,p,(function(s){if(!s){d=d||r;return A(null,d)}switch(s.code){case"ENOENT":if(a.dirname(r)===r)return A(s);mkdirP(a.dirname(r),i,(function(s,a){if(s)A(s,a);else mkdirP(r,i,A,a)}));break;default:u.stat(r,(function(r,i){if(r||!i.isDirectory())A(s,d);else A(null,d)}));break}}))}mkdirP.sync=function sync(r,i,s){if(!i||typeof i!=="object"){i={mode:i}}var d=i.mode;var p=i.fs||l;if(d===undefined){d=c}if(!s)s=null;r=a.resolve(r);try{p.mkdirSync(r,d);s=s||r}catch(l){switch(l.code){case"ENOENT":s=sync(a.dirname(r),i,s);sync(r,i,s);break;default:var u;try{u=p.statSync(r)}catch(r){throw l}if(!u.isDirectory())throw l;break}}return s}},18885:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var a=_interopDefault(s(12781));var l=_interopDefault(s(13685));var c=_interopDefault(s(57310));var d=_interopDefault(s(24055));var p=_interopDefault(s(95687));var u=_interopDefault(s(59796));const A=a.Readable;const h=Symbol("buffer");const g=Symbol("type");class Blob{constructor(){this[g]="";const r=arguments[0];const i=arguments[1];const s=[];let a=0;if(r){const i=r;const l=Number(i.length);for(let r=0;r1&&arguments[1]!==undefined?arguments[1]:{},l=s.size;let c=l===undefined?0:l;var d=s.timeout;let p=d===undefined?0:d;if(r==null){r=null}else if(isURLSearchParams(r)){r=Buffer.from(r.toString())}else if(isBlob(r));else if(Buffer.isBuffer(r));else if(Object.prototype.toString.call(r)==="[object ArrayBuffer]"){r=Buffer.from(r)}else if(ArrayBuffer.isView(r)){r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(r instanceof a);else{r=Buffer.from(String(r))}this[b]={body:r,disturbed:false,error:null};this.size=c;this.timeout=p;if(r instanceof a){r.on("error",(function(r){const s=r.name==="AbortError"?r:new FetchError(`Invalid response body while trying to fetch ${i.url}: ${r.message}`,"system",r);i[b].error=s}))}}Body.prototype={get body(){return this[b].body},get bodyUsed(){return this[b].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(r){return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}))},blob(){let r=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(i){return Object.assign(new Blob([],{type:r.toLowerCase()}),{[h]:i})}))},json(){var r=this;return consumeBody.call(this).then((function(i){try{return JSON.parse(i.toString())}catch(i){return Body.Promise.reject(new FetchError(`invalid json response body at ${r.url} reason: ${i.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(r){return r.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var r=this;return consumeBody.call(this).then((function(i){return convertBody(i,r.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(r){for(const i of Object.getOwnPropertyNames(Body.prototype)){if(!(i in r)){const s=Object.getOwnPropertyDescriptor(Body.prototype,i);Object.defineProperty(r,i,s)}}};function consumeBody(){var r=this;if(this[b].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[b].disturbed=true;if(this[b].error){return Body.Promise.reject(this[b].error)}let i=this.body;if(i===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(i)){i=i.stream()}if(Buffer.isBuffer(i)){return Body.Promise.resolve(i)}if(!(i instanceof a)){return Body.Promise.resolve(Buffer.alloc(0))}let s=[];let l=0;let c=false;return new Body.Promise((function(a,d){let p;if(r.timeout){p=setTimeout((function(){c=true;d(new FetchError(`Response timeout while trying to fetch ${r.url} (over ${r.timeout}ms)`,"body-timeout"))}),r.timeout)}i.on("error",(function(i){if(i.name==="AbortError"){c=true;d(i)}else{d(new FetchError(`Invalid response body while trying to fetch ${r.url}: ${i.message}`,"system",i))}}));i.on("data",(function(i){if(c||i===null){return}if(r.size&&l+i.length>r.size){c=true;d(new FetchError(`content size at ${r.url} over limit: ${r.size}`,"max-size"));return}l+=i.length;s.push(i)}));i.on("end",(function(){if(c){return}clearTimeout(p);try{a(Buffer.concat(s,l))}catch(i){d(new FetchError(`Could not create Buffer from response body for ${r.url}: ${i.message}`,"system",i))}}))}))}function convertBody(r,i){if(typeof y!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const s=i.get("content-type");let a="utf-8";let l,c;if(s){l=/charset=([^;]*)/i.exec(s)}c=r.slice(0,1024).toString();if(!l&&c){l=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[I]=Object.create(null);if(r instanceof Headers){const i=r.raw();const s=Object.keys(i);for(const r of s){for(const s of i[r]){this.append(r,s)}}return}if(r==null);else if(typeof r==="object"){const i=r[Symbol.iterator];if(i!=null){if(typeof i!=="function"){throw new TypeError("Header pairs must be iterable")}const s=[];for(const i of r){if(typeof i!=="object"||typeof i[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}s.push(Array.from(i))}for(const r of s){if(r.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(r[0],r[1])}}else{for(const i of Object.keys(r)){const s=r[i];this.append(i,s)}}}else{throw new TypeError("Provided initializer must be an object")}}get(r){r=`${r}`;validateName(r);const i=find(this[I],r);if(i===undefined){return null}return this[I][i].join(", ")}forEach(r){let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let s=getHeaders(this);let a=0;while(a1&&arguments[1]!==undefined?arguments[1]:"key+value";const s=Object.keys(r[I]).sort();return s.map(i==="key"?function(r){return r.toLowerCase()}:i==="value"?function(i){return r[I][i].join(", ")}:function(i){return[i.toLowerCase(),r[I][i].join(", ")]})}const B=Symbol("internal");function createHeadersIterator(r,i){const s=Object.create(S);s[B]={target:r,kind:i,index:0};return s}const S=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==S){throw new TypeError("Value of `this` is not a HeadersIterator")}var r=this[B];const i=r.target,s=r.kind,a=r.index;const l=getHeaders(i,s);const c=l.length;if(a>=c){return{value:undefined,done:true}}this[B].index=a+1;return{value:l[a],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(S,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(r){const i=Object.assign({__proto__:null},r[I]);const s=find(r[I],"Host");if(s!==undefined){i[s]=i[s][0]}return i}function createHeadersLenient(r){const i=new Headers;for(const s of Object.keys(r)){if(C.test(s)){continue}if(Array.isArray(r[s])){for(const a of r[s]){if(v.test(a)){continue}if(i[I][s]===undefined){i[I][s]=[a]}else{i[I][s].push(a)}}}else if(!v.test(r[s])){i[I][s]=[r[s]]}}return i}const x=Symbol("Response internals");const R=l.STATUS_CODES;class Response{constructor(){let r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,r,i);const s=i.status||200;const a=new Headers(i.headers);if(r!=null&&!a.has("Content-Type")){const i=extractContentType(r);if(i){a.append("Content-Type",i)}}this[x]={url:i.url,status:s,statusText:i.statusText||R[s],headers:a,counter:i.counter}}get url(){return this[x].url||""}get status(){return this[x].status}get ok(){return this[x].status>=200&&this[x].status<300}get redirected(){return this[x].counter>0}get statusText(){return this[x].statusText}get headers(){return this[x].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const Q=Symbol("Request internals");const _=c.URL||d.URL;const N=c.parse;const T=c.format;function parseURL(r){if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(r)){r=new _(r).toString()}return N(r)}const k="destroy"in a.Readable.prototype;function isRequest(r){return typeof r==="object"&&typeof r[Q]==="object"}function isAbortSignal(r){const i=r&&typeof r==="object"&&Object.getPrototypeOf(r);return!!(i&&i.constructor.name==="AbortSignal")}class Request{constructor(r){let i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let s;if(!isRequest(r)){if(r&&r.href){s=parseURL(r.href)}else{s=parseURL(`${r}`)}r={}}else{s=parseURL(r.url)}let a=i.method||r.method||"GET";a=a.toUpperCase();if((i.body!=null||isRequest(r)&&r.body!==null)&&(a==="GET"||a==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let l=i.body!=null?i.body:isRequest(r)&&r.body!==null?clone(r):null;Body.call(this,l,{timeout:i.timeout||r.timeout||0,size:i.size||r.size||0});const c=new Headers(i.headers||r.headers||{});if(l!=null&&!c.has("Content-Type")){const r=extractContentType(l);if(r){c.append("Content-Type",r)}}let d=isRequest(r)?r.signal:null;if("signal"in i)d=i.signal;if(d!=null&&!isAbortSignal(d)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[Q]={method:a,redirect:i.redirect||r.redirect||"follow",headers:c,parsedURL:s,signal:d};this.follow=i.follow!==undefined?i.follow:r.follow!==undefined?r.follow:20;this.compress=i.compress!==undefined?i.compress:r.compress!==undefined?r.compress:true;this.counter=i.counter||r.counter||0;this.agent=i.agent||r.agent}get method(){return this[Q].method}get url(){return T(this[Q].parsedURL)}get headers(){return this[Q].headers}get redirect(){return this[Q].redirect}get signal(){return this[Q].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(r){const i=r[Q].parsedURL;const s=new Headers(r[Q].headers);if(!s.has("Accept")){s.set("Accept","*/*")}if(!i.protocol||!i.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(i.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(r.signal&&r.body instanceof a.Readable&&!k){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let l=null;if(r.body==null&&/^(POST|PUT)$/i.test(r.method)){l="0"}if(r.body!=null){const i=getTotalBytes(r);if(typeof i==="number"){l=String(i)}}if(l){s.set("Content-Length",l)}if(!s.has("User-Agent")){s.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(r.compress&&!s.has("Accept-Encoding")){s.set("Accept-Encoding","gzip,deflate")}let c=r.agent;if(typeof c==="function"){c=c(i)}return Object.assign({},i,{method:r.method,headers:exportNodeCompatibleHeaders(s),agent:c})}function AbortError(r){Error.call(this,r);this.type="aborted";this.message=r;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const D=c.URL||d.URL;const P=a.PassThrough;const O=function isDomainOrSubdomain(r,i){const s=new D(i).hostname;const a=new D(r).hostname;return s===a||s[s.length-a.length-1]==="."&&s.endsWith(a)};const L=function isSameProtocol(r,i){const s=new D(i).protocol;const a=new D(r).protocol;return s===a};function fetch(r,i){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(s,c){const d=new Request(r,i);const A=getNodeRequestOptions(d);const h=(A.protocol==="https:"?p:l).request;const g=d.signal;let y=null;const b=function abort(){let r=new AbortError("The user aborted a request.");c(r);if(d.body&&d.body instanceof a.Readable){destroyStream(d.body,r)}if(!y||!y.body)return;y.body.emit("error",r)};if(g&&g.aborted){b();return}const w=function abortAndFinalize(){b();finalize()};const C=h(A);let v;if(g){g.addEventListener("abort",w)}function finalize(){C.abort();if(g)g.removeEventListener("abort",w);clearTimeout(v)}if(d.timeout){C.once("socket",(function(r){v=setTimeout((function(){c(new FetchError(`network timeout at: ${d.url}`,"request-timeout"));finalize()}),d.timeout)}))}C.on("error",(function(r){c(new FetchError(`request to ${d.url} failed, reason: ${r.message}`,"system",r));if(y&&y.body){destroyStream(y.body,r)}finalize()}));fixResponseChunkedTransferBadEnding(C,(function(r){if(g&&g.aborted){return}if(y&&y.body){destroyStream(y.body,r)}}));if(parseInt(process.version.substring(1))<14){C.on("socket",(function(r){r.addListener("close",(function(i){const s=r.listenerCount("data")>0;if(y&&s&&!i&&!(g&&g.aborted)){const r=new Error("Premature close");r.code="ERR_STREAM_PREMATURE_CLOSE";y.body.emit("error",r)}}))}))}C.on("response",(function(r){clearTimeout(v);const i=createHeadersLenient(r.headers);if(fetch.isRedirect(r.statusCode)){const a=i.get("Location");let l=null;try{l=a===null?null:new D(a,d.url).toString()}catch(r){if(d.redirect!=="manual"){c(new FetchError(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect"));finalize();return}}switch(d.redirect){case"error":c(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${d.url}`,"no-redirect"));finalize();return;case"manual":if(l!==null){try{i.set("Location",l)}catch(r){c(r)}}break;case"follow":if(l===null){break}if(d.counter>=d.follow){c(new FetchError(`maximum redirect reached at: ${d.url}`,"max-redirect"));finalize();return}const a={headers:new Headers(d.headers),follow:d.follow,counter:d.counter+1,agent:d.agent,compress:d.compress,method:d.method,body:d.body,signal:d.signal,timeout:d.timeout,size:d.size};if(!O(d.url,l)||!L(d.url,l)){for(const r of["authorization","www-authenticate","cookie","cookie2"]){a.headers.delete(r)}}if(r.statusCode!==303&&d.body&&getTotalBytes(d)===null){c(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(r.statusCode===303||(r.statusCode===301||r.statusCode===302)&&d.method==="POST"){a.method="GET";a.body=undefined;a.headers.delete("content-length")}s(fetch(new Request(l,a)));finalize();return}}r.once("end",(function(){if(g)g.removeEventListener("abort",w)}));let a=r.pipe(new P);const l={url:d.url,status:r.statusCode,statusText:r.statusMessage,headers:i,size:d.size,timeout:d.timeout,counter:d.counter};const p=i.get("Content-Encoding");if(!d.compress||d.method==="HEAD"||p===null||r.statusCode===204||r.statusCode===304){y=new Response(a,l);s(y);return}const A={flush:u.Z_SYNC_FLUSH,finishFlush:u.Z_SYNC_FLUSH};if(p=="gzip"||p=="x-gzip"){a=a.pipe(u.createGunzip(A));y=new Response(a,l);s(y);return}if(p=="deflate"||p=="x-deflate"){const i=r.pipe(new P);i.once("data",(function(r){if((r[0]&15)===8){a=a.pipe(u.createInflate())}else{a=a.pipe(u.createInflateRaw())}y=new Response(a,l);s(y)}));i.on("end",(function(){if(!y){y=new Response(a,l);s(y)}}));return}if(p=="br"&&typeof u.createBrotliDecompress==="function"){a=a.pipe(u.createBrotliDecompress());y=new Response(a,l);s(y);return}y=new Response(a,l);s(y)}));writeToStream(C,d)}))}function fixResponseChunkedTransferBadEnding(r,i){let s;r.on("socket",(function(r){s=r}));r.on("response",(function(r){const a=r.headers;if(a["transfer-encoding"]==="chunked"&&!a["content-length"]){r.once("close",(function(r){const a=s&&s.listenerCount("data")>0;if(a&&!r){const r=new Error("Premature close");r.code="ERR_STREAM_PREMATURE_CLOSE";i(r)}}))}}))}function destroyStream(r,i){if(r.destroy){r.destroy(i)}else{r.emit("error",i);r.end()}}fetch.isRedirect=function(r){return r===301||r===302||r===303||r===307||r===308};fetch.Promise=global.Promise;r.exports=i=fetch;Object.defineProperty(i,"__esModule",{value:true});i["default"]=i;i.Headers=Headers;i.Request=Request;i.Response=Response;i.FetchError=FetchError;i.AbortError=AbortError},43766:r=>{ /*! * normalize-path * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. */ -r.exports=function(r,i){if(typeof r!=="string"){throw new TypeError("expected path to be a string")}if(r==="\\"||r==="/")return"/";var a=r.length;if(a<=1)return r;var s="";if(a>4&&r[3]==="\\"){var l=r[2];if((l==="?"||l===".")&&r.slice(0,2)==="\\\\"){r=r.slice(2);s="//"}}var c=r.split(/[/\\]+/);if(i!==false&&c[c.length-1]===""){c.pop()}return s+c.join("/")}},28995:(r,i,a)=>{var s=a(55788);r.exports=s(once);r.exports.strict=s(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(r){var f=function(){if(f.called)return f.value;f.called=true;return f.value=r.apply(this,arguments)};f.called=false;return f}function onceStrict(r){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=r.apply(this,arguments)};var i=r.name||"Function wrapped with `once`";f.onceError=i+" shouldn't be called more than once";f.called=false;return f}},65964:r=>{"use strict";function posix(r){return r.charAt(0)==="/"}function win32(r){var i=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var a=i.exec(r);var s=a[1]||"";var l=Boolean(s&&s.charAt(1)!==":");return Boolean(a[2]||l)}r.exports=process.platform==="win32"?win32:posix;r.exports.posix=posix;r.exports.win32=win32},72166:r=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){r.exports={nextTick:nextTick}}else{r.exports=process}function nextTick(r,i,a,s){if(typeof r!=="function"){throw new TypeError('"callback" argument must be a function')}var l=arguments.length;var c,p;switch(l){case 0:case 1:return process.nextTick(r);case 2:return process.nextTick((function afterTickOne(){r.call(null,i)}));case 3:return process.nextTick((function afterTickTwo(){r.call(null,i,a)}));case 4:return process.nextTick((function afterTickThree(){r.call(null,i,a,s)}));default:c=new Array(l-1);p=0;while(p{"use strict";const i={};function createErrorType(r,a,s){if(!s){s=Error}function getMessage(r,i,s){if(typeof a==="string"){return a}else{return a(r,i,s)}}class NodeError extends s{constructor(r,i,a){super(getMessage(r,i,a))}}NodeError.prototype.name=s.name;NodeError.prototype.code=r;i[r]=NodeError}function oneOf(r,i){if(Array.isArray(r)){const a=r.length;r=r.map((r=>String(r)));if(a>2){return`one of ${i} ${r.slice(0,a-1).join(", ")}, or `+r[a-1]}else if(a===2){return`one of ${i} ${r[0]} or ${r[1]}`}else{return`of ${i} ${r[0]}`}}else{return`of ${i} ${String(r)}`}}function startsWith(r,i,a){return r.substr(!a||a<0?0:+a,i.length)===i}function endsWith(r,i,a){if(a===undefined||a>r.length){a=r.length}return r.substring(a-i.length,a)===i}function includes(r,i,a){if(typeof a!=="number"){a=0}if(a+i.length>r.length){return false}else{return r.indexOf(i,a)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(r,i){return'The value "'+i+'" is invalid for option "'+r+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(r,i,a){let s;if(typeof i==="string"&&startsWith(i,"not ")){s="must not be";i=i.replace(/^not /,"")}else{s="must be"}let l;if(endsWith(r," argument")){l=`The ${r} ${s} ${oneOf(i,"type")}`}else{const a=includes(r,".")?"property":"argument";l=`The "${r}" ${a} ${s} ${oneOf(i,"type")}`}l+=`. Received type ${typeof a}`;return l}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(r){return"The "+r+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(r){return"Cannot call "+r+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(r){return"Unknown encoding: "+r}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");r.exports.q=i},95639:(r,i,a)=>{"use strict";var s=Object.keys||function(r){var i=[];for(var a in r)i.push(a);return i};r.exports=Duplex;var l=a(33037);var c=a(3522);a(55806)(Duplex,l);{var p=s(c.prototype);for(var d=0;d{"use strict";r.exports=PassThrough;var s=a(68164);a(55806)(PassThrough,s);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);s.call(this,r)}PassThrough.prototype._transform=function(r,i,a){a(null,r)}},33037:(r,i,a)=>{"use strict";r.exports=Readable;var s;Readable.ReadableState=ReadableState;var l=a(82361).EventEmitter;var c=function EElistenerCount(r,i){return r.listeners(i).length};var p=a(58256);var d=a(14300).Buffer;var u=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return d.from(r)}function _isUint8Array(r){return d.isBuffer(r)||r instanceof u}var A=a(73837);var h;if(A&&A.debuglog){h=A.debuglog("stream")}else{h=function debug(){}}var g=a(21801);var y=a(23431);var E=a(72703),b=E.getHighWaterMark;var C=a(6800).q,v=C.ERR_INVALID_ARG_TYPE,B=C.ERR_STREAM_PUSH_AFTER_EOF,I=C.ERR_METHOD_NOT_IMPLEMENTED,w=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var S;var Q;var x;a(55806)(Readable,p);var N=y.errorOrDestroy;var R=["error","close","destroy","pause","resume"];function prependListener(r,i,a){if(typeof r.prependListener==="function")return r.prependListener(i,a);if(!r._events||!r._events[i])r.on(i,a);else if(Array.isArray(r._events[i]))r._events[i].unshift(a);else r._events[i]=[a,r._events[i]]}function ReadableState(r,i,l){s=s||a(95639);r=r||{};if(typeof l!=="boolean")l=i instanceof s;this.objectMode=!!r.objectMode;if(l)this.objectMode=this.objectMode||!!r.readableObjectMode;this.highWaterMark=b(this,r,"readableHighWaterMark",l);this.buffer=new g;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=r.emitClose!==false;this.autoDestroy=!!r.autoDestroy;this.destroyed=false;this.defaultEncoding=r.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(r.encoding){if(!S)S=a(39704).s;this.decoder=new S(r.encoding);this.encoding=r.encoding}}function Readable(r){s=s||a(95639);if(!(this instanceof Readable))return new Readable(r);var i=this instanceof s;this._readableState=new ReadableState(r,this,i);this.readable=true;if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy}p.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function set(r){if(!this._readableState){return}this._readableState.destroyed=r}});Readable.prototype.destroy=y.destroy;Readable.prototype._undestroy=y.undestroy;Readable.prototype._destroy=function(r,i){i(r)};Readable.prototype.push=function(r,i){var a=this._readableState;var s;if(!a.objectMode){if(typeof r==="string"){i=i||a.defaultEncoding;if(i!==a.encoding){r=d.from(r,i);i=""}s=true}}else{s=true}return readableAddChunk(this,r,i,false,s)};Readable.prototype.unshift=function(r){return readableAddChunk(this,r,null,true,false)};function readableAddChunk(r,i,a,s,l){h("readableAddChunk",i);var c=r._readableState;if(i===null){c.reading=false;onEofChunk(r,c)}else{var p;if(!l)p=chunkInvalid(c,i);if(p){N(r,p)}else if(c.objectMode||i&&i.length>0){if(typeof i!=="string"&&!c.objectMode&&Object.getPrototypeOf(i)!==d.prototype){i=_uint8ArrayToBuffer(i)}if(s){if(c.endEmitted)N(r,new w);else addChunk(r,c,i,true)}else if(c.ended){N(r,new B)}else if(c.destroyed){return false}else{c.reading=false;if(c.decoder&&!a){i=c.decoder.write(i);if(c.objectMode||i.length!==0)addChunk(r,c,i,false);else maybeReadMore(r,c)}else{addChunk(r,c,i,false)}}}else if(!s){c.reading=false;maybeReadMore(r,c)}}return!c.ended&&(c.length=T){r=T}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if(i.objectMode)return 1;if(r!==r){if(i.flowing&&i.length)return i.buffer.head.data.length;else return i.length}if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r<=i.length)return r;if(!i.ended){i.needReadable=true;return 0}return i.length}Readable.prototype.read=function(r){h("read",r);r=parseInt(r,10);var i=this._readableState;var a=r;if(r!==0)i.emittedReadable=false;if(r===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){h("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}var s=i.needReadable;h("need readable",s);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=i.length<=i.highWaterMark;r=0}else{i.length-=r;i.awaitDrain=0}if(i.length===0){if(!i.ended)i.needReadable=true;if(a!==r&&i.ended)endReadable(this)}if(l!==null)this.emit("data",l);return l};function onEofChunk(r,i){h("onEofChunk");if(i.ended)return;if(i.decoder){var a=i.decoder.end();if(a&&a.length){i.buffer.push(a);i.length+=i.objectMode?1:a.length}}i.ended=true;if(i.sync){emitReadable(r)}else{i.needReadable=false;if(!i.emittedReadable){i.emittedReadable=true;emitReadable_(r)}}}function emitReadable(r){var i=r._readableState;h("emitReadable",i.needReadable,i.emittedReadable);i.needReadable=false;if(!i.emittedReadable){h("emitReadable",i.flowing);i.emittedReadable=true;process.nextTick(emitReadable_,r)}}function emitReadable_(r){var i=r._readableState;h("emitReadable_",i.destroyed,i.length,i.ended);if(!i.destroyed&&(i.length||i.ended)){r.emit("readable");i.emittedReadable=false}i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark;flow(r)}function maybeReadMore(r,i){if(!i.readingMore){i.readingMore=true;process.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){while(!i.reading&&!i.ended&&(i.length1&&indexOf(s.pipes,r)!==-1)&&!u){h("false write response, pause",s.awaitDrain);s.awaitDrain++}a.pause()}}function onerror(i){h("onerror",i);unpipe();r.removeListener("error",onerror);if(c(r,"error")===0)N(r,i)}prependListener(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){h("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){h("unpipe");a.unpipe(r)}r.emit("pipe",a);if(!s.flowing){h("pipe resume");a.resume()}return r};function pipeOnDrain(r){return function pipeOnDrainFunctionResult(){var i=r._readableState;h("pipeOnDrain",i.awaitDrain);if(i.awaitDrain)i.awaitDrain--;if(i.awaitDrain===0&&c(r,"data")){i.flowing=true;flow(r)}}}Readable.prototype.unpipe=function(r){var i=this._readableState;var a={hasUnpiped:false};if(i.pipesCount===0)return this;if(i.pipesCount===1){if(r&&r!==i.pipes)return this;if(!r)r=i.pipes;i.pipes=null;i.pipesCount=0;i.flowing=false;if(r)r.emit("unpipe",this,a);return this}if(!r){var s=i.pipes;var l=i.pipesCount;i.pipes=null;i.pipesCount=0;i.flowing=false;for(var c=0;c0;if(s.flowing!==false)this.resume()}else if(r==="readable"){if(!s.endEmitted&&!s.readableListening){s.readableListening=s.needReadable=true;s.flowing=false;s.emittedReadable=false;h("on readable",s.length,s.reading);if(s.length){emitReadable(this)}else if(!s.reading){process.nextTick(nReadingNextTick,this)}}}return a};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(r,i){var a=p.prototype.removeListener.call(this,r,i);if(r==="readable"){process.nextTick(updateReadableListening,this)}return a};Readable.prototype.removeAllListeners=function(r){var i=p.prototype.removeAllListeners.apply(this,arguments);if(r==="readable"||r===undefined){process.nextTick(updateReadableListening,this)}return i};function updateReadableListening(r){var i=r._readableState;i.readableListening=r.listenerCount("readable")>0;if(i.resumeScheduled&&!i.paused){i.flowing=true}else if(r.listenerCount("data")>0){r.resume()}}function nReadingNextTick(r){h("readable nexttick read 0");r.read(0)}Readable.prototype.resume=function(){var r=this._readableState;if(!r.flowing){h("resume");r.flowing=!r.readableListening;resume(this,r)}r.paused=false;return this};function resume(r,i){if(!i.resumeScheduled){i.resumeScheduled=true;process.nextTick(resume_,r,i)}}function resume_(r,i){h("resume",i.reading);if(!i.reading){r.read(0)}i.resumeScheduled=false;r.emit("resume");flow(r);if(i.flowing&&!i.reading)r.read(0)}Readable.prototype.pause=function(){h("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){h("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(r){var i=r._readableState;h("flow",i.flowing);while(i.flowing&&r.read()!==null);}Readable.prototype.wrap=function(r){var i=this;var a=this._readableState;var s=false;r.on("end",(function(){h("wrapped end");if(a.decoder&&!a.ended){var r=a.decoder.end();if(r&&r.length)i.push(r)}i.push(null)}));r.on("data",(function(l){h("wrapped data");if(a.decoder)l=a.decoder.write(l);if(a.objectMode&&(l===null||l===undefined))return;else if(!a.objectMode&&(!l||!l.length))return;var c=i.push(l);if(!c){s=true;r.pause()}}));for(var l in r){if(this[l]===undefined&&typeof r[l]==="function"){this[l]=function methodWrap(i){return function methodWrapReturnFunction(){return r[i].apply(r,arguments)}}(l)}}for(var c=0;c=i.length){if(i.decoder)a=i.buffer.join("");else if(i.buffer.length===1)a=i.buffer.first();else a=i.buffer.concat(i.length);i.buffer.clear()}else{a=i.buffer.consume(r,i.decoder)}return a}function endReadable(r){var i=r._readableState;h("endReadable",i.endEmitted);if(!i.endEmitted){i.ended=true;process.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){h("endReadableNT",r.endEmitted,r.length);if(!r.endEmitted&&r.length===0){r.endEmitted=true;i.readable=false;i.emit("end");if(r.autoDestroy){var a=i._writableState;if(!a||a.autoDestroy&&a.finished){i.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(r,i){if(x===undefined){x=a(64418)}return x(Readable,r,i)}}function indexOf(r,i){for(var a=0,s=r.length;a{"use strict";r.exports=Transform;var s=a(6800).q,l=s.ERR_METHOD_NOT_IMPLEMENTED,c=s.ERR_MULTIPLE_CALLBACK,p=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=s.ERR_TRANSFORM_WITH_LENGTH_0;var u=a(95639);a(55806)(Transform,u);function afterTransform(r,i){var a=this._transformState;a.transforming=false;var s=a.writecb;if(s===null){return this.emit("error",new c)}a.writechunk=null;a.writecb=null;if(i!=null)this.push(i);s(r);var l=this._readableState;l.reading=false;if(l.needReadable||l.length{"use strict";r.exports=Writable;function WriteReq(r,i,a){this.chunk=r;this.encoding=i;this.callback=a;this.next=null}function CorkedRequest(r){var i=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(i,r)}}var s;Writable.WritableState=WritableState;var l={deprecate:a(41257)};var c=a(58256);var p=a(14300).Buffer;var d=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return p.from(r)}function _isUint8Array(r){return p.isBuffer(r)||r instanceof d}var u=a(23431);var A=a(72703),h=A.getHighWaterMark;var g=a(6800).q,y=g.ERR_INVALID_ARG_TYPE,E=g.ERR_METHOD_NOT_IMPLEMENTED,b=g.ERR_MULTIPLE_CALLBACK,C=g.ERR_STREAM_CANNOT_PIPE,v=g.ERR_STREAM_DESTROYED,B=g.ERR_STREAM_NULL_VALUES,I=g.ERR_STREAM_WRITE_AFTER_END,w=g.ERR_UNKNOWN_ENCODING;var S=u.errorOrDestroy;a(55806)(Writable,c);function nop(){}function WritableState(r,i,l){s=s||a(95639);r=r||{};if(typeof l!=="boolean")l=i instanceof s;this.objectMode=!!r.objectMode;if(l)this.objectMode=this.objectMode||!!r.writableObjectMode;this.highWaterMark=h(this,r,"writableHighWaterMark",l);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var c=r.decodeStrings===false;this.decodeStrings=!c;this.defaultEncoding=r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(r){onwrite(i,r)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=r.emitClose!==false;this.autoDestroy=!!r.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var r=this.bufferedRequest;var i=[];while(r){i.push(r);r=r.next}return i};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:l.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(r){}})();var Q;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){Q=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(r){if(Q.call(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}})}else{Q=function realHasInstance(r){return r instanceof this}}function Writable(r){s=s||a(95639);var i=this instanceof s;if(!i&&!Q.call(Writable,this))return new Writable(r);this._writableState=new WritableState(r,this,i);this.writable=true;if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final}c.call(this)}Writable.prototype.pipe=function(){S(this,new C)};function writeAfterEnd(r,i){var a=new I;S(r,a);process.nextTick(i,a)}function validChunk(r,i,a,s){var l;if(a===null){l=new B}else if(typeof a!=="string"&&!i.objectMode){l=new y("chunk",["string","Buffer"],a)}if(l){S(r,l);process.nextTick(s,l);return false}return true}Writable.prototype.write=function(r,i,a){var s=this._writableState;var l=false;var c=!s.objectMode&&_isUint8Array(r);if(c&&!p.isBuffer(r)){r=_uint8ArrayToBuffer(r)}if(typeof i==="function"){a=i;i=null}if(c)i="buffer";else if(!i)i=s.defaultEncoding;if(typeof a!=="function")a=nop;if(s.ending)writeAfterEnd(this,a);else if(c||validChunk(this,s,r,a)){s.pendingcb++;l=writeOrBuffer(this,s,c,r,i,a)}return l};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var r=this._writableState;if(r.corked){r.corked--;if(!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=r.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new w(r);this._writableState.defaultEncoding=r;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(r,i,a){if(!r.objectMode&&r.decodeStrings!==false&&typeof i==="string"){i=p.from(i,a)}return i}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(r,i,a,s,l,c){if(!a){var p=decodeChunk(i,s,l);if(s!==p){a=true;l="buffer";s=p}}var d=i.objectMode?1:s.length;i.length+=d;var u=i.length{"use strict";var s;function _defineProperty(r,i,a){i=_toPropertyKey(i);if(i in r){Object.defineProperty(r,i,{value:a,enumerable:true,configurable:true,writable:true})}else{r[i]=a}return r}function _toPropertyKey(r){var i=_toPrimitive(r,"string");return typeof i==="symbol"?i:String(i)}function _toPrimitive(r,i){if(typeof r!=="object"||r===null)return r;var a=r[Symbol.toPrimitive];if(a!==undefined){var s=a.call(r,i||"default");if(typeof s!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}var l=a(67592);var c=Symbol("lastResolve");var p=Symbol("lastReject");var d=Symbol("error");var u=Symbol("ended");var A=Symbol("lastPromise");var h=Symbol("handlePromise");var g=Symbol("stream");function createIterResult(r,i){return{value:r,done:i}}function readAndResolve(r){var i=r[c];if(i!==null){var a=r[g].read();if(a!==null){r[A]=null;r[c]=null;r[p]=null;i(createIterResult(a,false))}}}function onReadable(r){process.nextTick(readAndResolve,r)}function wrapForNext(r,i){return function(a,s){r.then((function(){if(i[u]){a(createIterResult(undefined,true));return}i[h](a,s)}),s)}}var y=Object.getPrototypeOf((function(){}));var E=Object.setPrototypeOf((s={get stream(){return this[g]},next:function next(){var r=this;var i=this[d];if(i!==null){return Promise.reject(i)}if(this[u]){return Promise.resolve(createIterResult(undefined,true))}if(this[g].destroyed){return new Promise((function(i,a){process.nextTick((function(){if(r[d]){a(r[d])}else{i(createIterResult(undefined,true))}}))}))}var a=this[A];var s;if(a){s=new Promise(wrapForNext(a,this))}else{var l=this[g].read();if(l!==null){return Promise.resolve(createIterResult(l,false))}s=new Promise(this[h])}this[A]=s;return s}},_defineProperty(s,Symbol.asyncIterator,(function(){return this})),_defineProperty(s,"return",(function _return(){var r=this;return new Promise((function(i,a){r[g].destroy(null,(function(r){if(r){a(r);return}i(createIterResult(undefined,true))}))}))})),s),y);var b=function createReadableStreamAsyncIterator(r){var i;var a=Object.create(E,(i={},_defineProperty(i,g,{value:r,writable:true}),_defineProperty(i,c,{value:null,writable:true}),_defineProperty(i,p,{value:null,writable:true}),_defineProperty(i,d,{value:null,writable:true}),_defineProperty(i,u,{value:r._readableState.endEmitted,writable:true}),_defineProperty(i,h,{value:function value(r,i){var s=a[g].read();if(s){a[A]=null;a[c]=null;a[p]=null;r(createIterResult(s,false))}else{a[c]=r;a[p]=i}},writable:true}),i));a[A]=null;l(r,(function(r){if(r&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"){var i=a[p];if(i!==null){a[A]=null;a[c]=null;a[p]=null;i(r)}a[d]=r;return}var s=a[c];if(s!==null){a[A]=null;a[c]=null;a[p]=null;s(createIterResult(undefined,true))}a[u]=true}));r.on("readable",onReadable.bind(null,a));return a};r.exports=b},21801:(r,i,a)=>{"use strict";function ownKeys(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),a.push.apply(a,s)}return a}function _objectSpread(r){for(var i=1;i0)this.tail.next=i;else this.head=i;this.tail=i;++this.length}},{key:"unshift",value:function unshift(r){var i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(r){if(this.length===0)return"";var i=this.head;var a=""+i.data;while(i=i.next)a+=r+i.data;return a}},{key:"concat",value:function concat(r){if(this.length===0)return l.alloc(0);var i=l.allocUnsafe(r>>>0);var a=this.head;var s=0;while(a){copyBuffer(a.data,i,s);s+=a.data.length;a=a.next}return i}},{key:"consume",value:function consume(r,i){var a;if(rl.length?l.length:r;if(c===l.length)s+=l;else s+=l.slice(0,r);r-=c;if(r===0){if(c===l.length){++a;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=l.slice(c)}break}++a}this.length-=a;return s}},{key:"_getBuffer",value:function _getBuffer(r){var i=l.allocUnsafe(r);var a=this.head;var s=1;a.data.copy(i);r-=a.data.length;while(a=a.next){var c=a.data;var p=r>c.length?c.length:r;c.copy(i,i.length-r,0,p);r-=p;if(r===0){if(p===c.length){++s;if(a.next)this.head=a.next;else this.head=this.tail=null}else{this.head=a;a.data=c.slice(p)}break}++s}this.length-=s;return i}},{key:d,value:function value(r,i){return p(this,_objectSpread(_objectSpread({},i),{},{depth:0,customInspect:false}))}}]);return BufferList}()},23431:r=>{"use strict";function destroy(r,i){var a=this;var s=this._readableState&&this._readableState.destroyed;var l=this._writableState&&this._writableState.destroyed;if(s||l){if(i){i(r)}else if(r){if(!this._writableState){process.nextTick(emitErrorNT,this,r)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,r)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(r||null,(function(r){if(!i&&r){if(!a._writableState){process.nextTick(emitErrorAndCloseNT,a,r)}else if(!a._writableState.errorEmitted){a._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,a,r)}else{process.nextTick(emitCloseNT,a)}}else if(i){process.nextTick(emitCloseNT,a);i(r)}else{process.nextTick(emitCloseNT,a)}}));return this}function emitErrorAndCloseNT(r,i){emitErrorNT(r,i);emitCloseNT(r)}function emitCloseNT(r){if(r._writableState&&!r._writableState.emitClose)return;if(r._readableState&&!r._readableState.emitClose)return;r.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(r,i){r.emit("error",i)}function errorOrDestroy(r,i){var a=r._readableState;var s=r._writableState;if(a&&a.autoDestroy||s&&s.autoDestroy)r.destroy(i);else r.emit("error",i)}r.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},67592:(r,i,a)=>{"use strict";var s=a(6800).q.ERR_STREAM_PREMATURE_CLOSE;function once(r){var i=false;return function(){if(i)return;i=true;for(var a=arguments.length,s=new Array(a),l=0;l{"use strict";function asyncGeneratorStep(r,i,a,s,l,c,p){try{var d=r[c](p);var u=d.value}catch(r){a(r);return}if(d.done){i(u)}else{Promise.resolve(u).then(s,l)}}function _asyncToGenerator(r){return function(){var i=this,a=arguments;return new Promise((function(s,l){var c=r.apply(i,a);function _next(r){asyncGeneratorStep(c,s,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(c,s,l,_next,_throw,"throw",r)}_next(undefined)}))}}function ownKeys(r,i){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),a.push.apply(a,s)}return a}function _objectSpread(r){for(var i=1;i{"use strict";var s;function once(r){var i=false;return function(){if(i)return;i=true;r.apply(void 0,arguments)}}var l=a(6800).q,c=l.ERR_MISSING_ARGS,p=l.ERR_STREAM_DESTROYED;function noop(r){if(r)throw r}function isRequest(r){return r.setHeader&&typeof r.abort==="function"}function destroyer(r,i,l,c){c=once(c);var d=false;r.on("close",(function(){d=true}));if(s===undefined)s=a(67592);s(r,{readable:i,writable:l},(function(r){if(r)return c(r);d=true;c()}));var u=false;return function(i){if(d)return;if(u)return;u=true;if(isRequest(r))return r.abort();if(typeof r.destroy==="function")return r.destroy();c(i||new p("pipe"))}}function call(r){r()}function pipe(r,i){return r.pipe(i)}function popCallback(r){if(!r.length)return noop;if(typeof r[r.length-1]!=="function")return noop;return r.pop()}function pipeline(){for(var r=arguments.length,i=new Array(r),a=0;a0;return destroyer(r,c,d,(function(r){if(!l)l=r;if(r)p.forEach(call);if(c)return;p.forEach(call);s(l)}))}));return i.reduce(pipe)}r.exports=pipeline},72703:(r,i,a)=>{"use strict";var s=a(6800).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(r,i,a){return r.highWaterMark!=null?r.highWaterMark:i?r[a]:null}function getHighWaterMark(r,i,a,l){var c=highWaterMarkFrom(i,l,a);if(c!=null){if(!(isFinite(c)&&Math.floor(c)===c)||c<0){var p=l?a:"highWaterMark";throw new s(p,c)}return Math.floor(c)}return r.objectMode?16:16*1024}r.exports={getHighWaterMark:getHighWaterMark}},58256:(r,i,a)=>{r.exports=a(12781)},39704:(r,i,a)=>{"use strict";var s=a(18051).Buffer;var l=s.isEncoding||function(r){r=""+r;switch(r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(r){if(!r)return"utf8";var i;while(true){switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(i)return;r=(""+r).toLowerCase();i=true}}}function normalizeEncoding(r){var i=_normalizeEncoding(r);if(typeof i!=="string"&&(s.isEncoding===l||!l(r)))throw new Error("Unknown encoding: "+r);return i||r}i.s=StringDecoder;function StringDecoder(r){this.encoding=normalizeEncoding(r);var i;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;i=4;break;case"utf8":this.fillLast=utf8FillLast;i=4;break;case"base64":this.text=base64Text;this.end=base64End;i=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=s.allocUnsafe(i)}StringDecoder.prototype.write=function(r){if(r.length===0)return"";var i;var a;if(this.lastNeed){i=this.fillLast(r);if(i===undefined)return"";a=this.lastNeed;this.lastNeed=0}else{a=0}if(a>5===6)return 2;else if(r>>4===14)return 3;else if(r>>3===30)return 4;return r>>6===2?-1:-2}function utf8CheckIncomplete(r,i,a){var s=i.length-1;if(s=0){if(l>0)r.lastNeed=l-1;return l}if(--s=0){if(l>0)r.lastNeed=l-2;return l}if(--s=0){if(l>0){if(l===2)l=0;else r.lastNeed=l-3}return l}return 0}function utf8CheckExtraBytes(r,i,a){if((i[0]&192)!==128){r.lastNeed=0;return"�"}if(r.lastNeed>1&&i.length>1){if((i[1]&192)!==128){r.lastNeed=1;return"�"}if(r.lastNeed>2&&i.length>2){if((i[2]&192)!==128){r.lastNeed=2;return"�"}}}}function utf8FillLast(r){var i=this.lastTotal-this.lastNeed;var a=utf8CheckExtraBytes(this,r,i);if(a!==undefined)return a;if(this.lastNeed<=r.length){r.copy(this.lastChar,i,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}r.copy(this.lastChar,i,0,r.length);this.lastNeed-=r.length}function utf8Text(r,i){var a=utf8CheckIncomplete(this,r,i);if(!this.lastNeed)return r.toString("utf8",i);this.lastTotal=a;var s=r.length-(a-this.lastNeed);r.copy(this.lastChar,0,s);return r.toString("utf8",i,s)}function utf8End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+"�";return i}function utf16Text(r,i){if((r.length-i)%2===0){var a=r.toString("utf16le",i);if(a){var s=a.charCodeAt(a.length-1);if(s>=55296&&s<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1];return a.slice(0,-1)}}return a}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=r[r.length-1];return r.toString("utf16le",i,r.length-1)}function utf16End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,a)}return i}function base64Text(r,i){var a=(r.length-i)%3;if(a===0)return r.toString("base64",i);this.lastNeed=3-a;this.lastTotal=3;if(a===1){this.lastChar[0]=r[r.length-1]}else{this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1]}return r.toString("base64",i,r.length-a)}function base64End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+this.lastChar.toString("base64",0,3-this.lastNeed);return i}function simpleWrite(r){return r.toString(this.encoding)}function simpleEnd(r){return r&&r.length?this.write(r):""}},19173:(r,i,a)=>{var s=a(12781);if(process.env.READABLE_STREAM==="disable"&&s){r.exports=s.Readable;Object.assign(r.exports,s);r.exports.Stream=s}else{i=r.exports=a(33037);i.Stream=s||i;i.Readable=i;i.Writable=a(3522);i.Duplex=a(95639);i.Transform=a(68164);i.PassThrough=a(32372);i.finished=a(67592);i.pipeline=a(55518)}},48059:(r,i,a)=>{r.exports=readdirGlob;const s=a(57147);const{EventEmitter:l}=a(82361);const{Minimatch:c}=a(43612);const{resolve:p}=a(71017);function readdir(r,i){return new Promise(((a,l)=>{s.readdir(r,{withFileTypes:true},((r,s)=>{if(r){switch(r.code){case"ENOTDIR":if(i){l(r)}else{a([])}break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":a([]);break;case"ELOOP":default:l(r);break}}else{a(s)}}))}))}function stat(r,i){return new Promise(((a,l)=>{const c=i?s.stat:s.lstat;c(r,((s,l)=>{if(s){switch(s.code){case"ENOENT":if(i){a(stat(r,false))}else{a(null)}break;default:a(null);break}}else{a(l)}}))}))}async function*exploreWalkAsync(r,i,a,s,l,c){let p=await readdir(i+r,c);for(const c of p){let p=c.name;if(p===undefined){p=c;s=true}const d=r+"/"+p;const u=d.slice(1);const A=i+"/"+u;let h=null;if(s||a){h=await stat(A,a)}if(!h&&c.name!==undefined){h=c}if(h===null){h={isDirectory:()=>false}}if(h.isDirectory()){if(!l(u)){yield{relative:u,absolute:A,stats:h};yield*exploreWalkAsync(d,i,a,s,l,false)}}else{yield{relative:u,absolute:A,stats:h}}}}async function*explore(r,i,a,s){yield*exploreWalkAsync("",r,i,a,s,true)}function readOptions(r){return{pattern:r.pattern,dot:!!r.dot,noglobstar:!!r.noglobstar,matchBase:!!r.matchBase,nocase:!!r.nocase,ignore:r.ignore,skip:r.skip,follow:!!r.follow,stat:!!r.stat,nodir:!!r.nodir,mark:!!r.mark,silent:!!r.silent,absolute:!!r.absolute}}class ReaddirGlob extends l{constructor(r,i,a){super();if(typeof i==="function"){a=i;i=null}this.options=readOptions(i||{});this.matchers=[];if(this.options.pattern){const r=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=r.map((r=>new c(r,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase})))}this.ignoreMatchers=[];if(this.options.ignore){const r=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=r.map((r=>new c(r,{dot:true})))}this.skipMatchers=[];if(this.options.skip){const r=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=r.map((r=>new c(r,{dot:true})))}this.iterator=explore(p(r||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this));this.paused=false;this.inactive=false;this.aborted=false;if(a){this._matches=[];this.on("match",(r=>this._matches.push(this.options.absolute?r.absolute:r.relative)));this.on("error",(r=>a(r)));this.on("end",(()=>a(null,this._matches)))}setTimeout((()=>this._next()),0)}_shouldSkipDirectory(r){return this.skipMatchers.some((i=>i.match(r)))}_fileMatches(r,i){const a=r+(i?"/":"");return(this.matchers.length===0||this.matchers.some((r=>r.match(a))))&&!this.ignoreMatchers.some((r=>r.match(a)))&&(!this.options.nodir||!i)}_next(){if(!this.paused&&!this.aborted){this.iterator.next().then((r=>{if(!r.done){const i=r.value.stats.isDirectory();if(this._fileMatches(r.value.relative,i)){let a=r.value.relative;let s=r.value.absolute;if(this.options.mark&&i){a+="/";s+="/"}if(this.options.stat){this.emit("match",{relative:a,absolute:s,stat:r.value.stats})}else{this.emit("match",{relative:a,absolute:s})}}this._next(this.iterator)}else{this.emit("end")}})).catch((r=>{this.abort();this.emit("error",r);if(!r.code&&!this.options.silent){console.error(r)}}))}else{this.inactive=true}}abort(){this.aborted=true}pause(){this.paused=true}resume(){this.paused=false;if(this.inactive){this.inactive=false;this._next()}}}function readdirGlob(r,i,a){return new ReaddirGlob(r,i,a)}readdirGlob.ReaddirGlob=ReaddirGlob},62752:r=>{const i=typeof process==="object"&&process&&process.platform==="win32";r.exports=i?{sep:"\\"}:{sep:"/"}},43612:(r,i,a)=>{const s=r.exports=(r,i,a={})=>{assertValidPattern(i);if(!a.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,a).match(r)};r.exports=s;const l=a(62752);s.sep=l.sep;const c=Symbol("globstar **");s.GLOBSTAR=c;const p=a(11469);const d={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};const u="[^/]";const A=u+"*?";const h="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const g="(?:(?!(?:\\/|^)\\.).)*?";const charSet=r=>r.split("").reduce(((r,i)=>{r[i]=true;return r}),{});const y=charSet("().*{}+?[]^$\\!");const E=charSet("[.(");const b=/\/+/;s.filter=(r,i={})=>(a,l,c)=>s(a,r,i);const ext=(r,i={})=>{const a={};Object.keys(r).forEach((i=>a[i]=r[i]));Object.keys(i).forEach((r=>a[r]=i[r]));return a};s.defaults=r=>{if(!r||typeof r!=="object"||!Object.keys(r).length){return s}const i=s;const m=(a,s,l)=>i(a,s,ext(r,l));m.Minimatch=class Minimatch extends i.Minimatch{constructor(i,a){super(i,ext(r,a))}};m.Minimatch.defaults=a=>i.defaults(ext(r,a)).Minimatch;m.filter=(a,s)=>i.filter(a,ext(r,s));m.defaults=a=>i.defaults(ext(r,a));m.makeRe=(a,s)=>i.makeRe(a,ext(r,s));m.braceExpand=(a,s)=>i.braceExpand(a,ext(r,s));m.match=(a,s,l)=>i.match(a,s,ext(r,l));return m};s.braceExpand=(r,i)=>braceExpand(r,i);const braceExpand=(r,i={})=>{assertValidPattern(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return p(r)};const C=1024*64;const assertValidPattern=r=>{if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>C){throw new TypeError("pattern is too long")}};const v=Symbol("subparse");s.makeRe=(r,i)=>new Minimatch(r,i||{}).makeRe();s.match=(r,i,a={})=>{const s=new Minimatch(i,a);r=r.filter((r=>s.match(r)));if(s.options.nonull&&!r.length){r.push(i)}return r};const globUnescape=r=>r.replace(/\\(.)/g,"$1");const charUnescape=r=>r.replace(/\\([^-\]])/g,"$1");const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const braExpEscape=r=>r.replace(/[[\]\\]/g,"\\$&");class Minimatch{constructor(r,i){assertValidPattern(r);if(!i)i={};this.options=i;this.set=[];this.pattern=r;this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}debug(){}make(){const r=this.pattern;const i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();let a=this.globSet=this.braceExpand();if(i.debug)this.debug=(...r)=>console.error(...r);this.debug(this.pattern,a);a=this.globParts=a.map((r=>r.split(b)));this.debug(this.pattern,a);a=a.map(((r,i,a)=>r.map(this.parse,this)));this.debug(this.pattern,a);a=a.filter((r=>r.indexOf(false)===-1));this.debug(this.pattern,a);this.set=a}parseNegate(){if(this.options.nonegate)return;const r=this.pattern;let i=false;let a=0;for(let s=0;s>> no match, partial?",r,g,i,y);if(g===d)return true}return false}var b;if(typeof A==="string"){b=h===A;this.debug("string match",A,h,b)}else{b=h.match(A);this.debug("pattern match",A,h,b)}if(!b)return false}if(l===d&&p===u){return true}else if(l===d){return a}else if(p===u){return l===d-1&&r[l]===""}throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(r,i){assertValidPattern(r);const a=this.options;if(r==="**"){if(!a.noglobstar)return c;else r="*"}if(r==="")return"";let s="";let l=false;let p=false;const h=[];const g=[];let b;let C=false;let B=-1;let I=-1;let w;let S;let Q;let x=r.charAt(0)===".";let N=a.dot||x;const patternStart=()=>x?"":N?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";const subPatternStart=r=>r.charAt(0)==="."?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";const clearStateChar=()=>{if(b){switch(b){case"*":s+=A;l=true;break;case"?":s+=u;l=true;break;default:s+="\\"+b;break}this.debug("clearStateChar %j %j",b,s);b=false}};for(let i=0,c;i{if(!a){a="\\"}return i+i+a+"|"}));this.debug("tail=%j\n %s",r,r,S,s);const i=S.type==="*"?A:S.type==="?"?u:"\\"+S.type;l=true;s=s.slice(0,S.reStart)+i+"\\("+r}clearStateChar();if(p){s+="\\\\"}const R=E[s.charAt(0)];for(let r=g.length-1;r>-1;r--){const a=g[r];const l=s.slice(0,a.reStart);const c=s.slice(a.reStart,a.reEnd-8);let p=s.slice(a.reEnd);const d=s.slice(a.reEnd-8,a.reEnd)+p;const u=l.split(")").length;const A=l.split("(").length-u;let h=p;for(let r=0;r{r=r.map((r=>typeof r==="string"?regExpEscape(r):r===c?c:r._src)).reduce(((r,i)=>{if(!(r[r.length-1]===c&&i===c)){r.push(i)}return r}),[]);r.forEach(((i,s)=>{if(i!==c||r[s-1]===c){return}if(s===0){if(r.length>1){r[s+1]="(?:\\/|"+a+"\\/)?"+r[s+1]}else{r[s]=a}}else if(s===r.length-1){r[s-1]+="(?:\\/|"+a+")?"}else{r[s-1]+="(?:\\/|\\/"+a+"\\/)"+r[s+1];r[s+1]=c}}));return r.filter((r=>r!==c)).join("/")})).join("|");l="^(?:"+l+")$";if(this.negate)l="^(?!"+l+").*$";try{this.regexp=new RegExp(l,s)}catch(r){this.regexp=false}return this.regexp}match(r,i=this.partial){this.debug("match",r,this.pattern);if(this.comment)return false;if(this.empty)return r==="";if(r==="/"&&i)return true;const a=this.options;if(l.sep!=="/"){r=r.split(l.sep).join("/")}r=r.split(b);this.debug(this.pattern,"split",r);const s=this.set;this.debug(this.pattern,"set",s);let c;for(let i=r.length-1;i>=0;i--){c=r[i];if(c)break}for(let l=0;l{ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -var s=a(14300);var l=s.Buffer;function copyProps(r,i){for(var a in r){i[a]=r[a]}}if(l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow){r.exports=s}else{copyProps(s,i);i.Buffer=SafeBuffer}function SafeBuffer(r,i,a){return l(r,i,a)}SafeBuffer.prototype=Object.create(l.prototype);copyProps(l,SafeBuffer);SafeBuffer.from=function(r,i,a){if(typeof r==="number"){throw new TypeError("Argument must not be a number")}return l(r,i,a)};SafeBuffer.alloc=function(r,i,a){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}var s=l(r);if(i!==undefined){if(typeof a==="string"){s.fill(i,a)}else{s.fill(i)}}else{s.fill(0)}return s};SafeBuffer.allocUnsafe=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return l(r)};SafeBuffer.allocUnsafeSlow=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return s.SlowBuffer(r)}},69467:(r,i,a)=>{(function(r){r.parser=function(r,i){return new SAXParser(r,i)};r.SAXParser=SAXParser;r.SAXStream=SAXStream;r.createStream=createStream;r.MAX_BUFFER_LENGTH=64*1024;var i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(i,a){if(!(this instanceof SAXParser)){return new SAXParser(i,a)}var s=this;clearBuffers(s);s.q=s.c="";s.bufferCheckPosition=r.MAX_BUFFER_LENGTH;s.opt=a||{};s.opt.lowercase=s.opt.lowercase||s.opt.lowercasetags;s.looseCase=s.opt.lowercase?"toLowerCase":"toUpperCase";s.tags=[];s.closed=s.closedRoot=s.sawRoot=false;s.tag=s.error=null;s.strict=!!i;s.noscript=!!(i||s.opt.noscript);s.state=b.BEGIN;s.strictEntities=s.opt.strictEntities;s.ENTITIES=s.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES);s.attribList=[];if(s.opt.xmlns){s.ns=Object.create(A)}s.trackPosition=s.opt.position!==false;if(s.trackPosition){s.position=s.line=s.column=0}emit(s,"onready")}if(!Object.create){Object.create=function(r){function F(){}F.prototype=r;var i=new F;return i}}if(!Object.keys){Object.keys=function(r){var i=[];for(var a in r)if(r.hasOwnProperty(a))i.push(a);return i}}function checkBufferLength(a){var s=Math.max(r.MAX_BUFFER_LENGTH,10);var l=0;for(var c=0,p=i.length;cs){switch(i[c]){case"textNode":closeText(a);break;case"cdata":emitNode(a,"oncdata",a.cdata);a.cdata="";break;case"script":emitNode(a,"onscript",a.script);a.script="";break;default:error(a,"Max buffer length exceeded: "+i[c])}}l=Math.max(l,d)}var u=r.MAX_BUFFER_LENGTH-l;a.bufferCheckPosition=u+a.position}function clearBuffers(r){for(var a=0,s=i.length;a"||isWhitespace(r)}function isMatch(r,i){return r.test(i)}function notMatch(r,i){return!isMatch(r,i)}var b=0;r.STATE={BEGIN:b++,BEGIN_WHITESPACE:b++,TEXT:b++,TEXT_ENTITY:b++,OPEN_WAKA:b++,SGML_DECL:b++,SGML_DECL_QUOTED:b++,DOCTYPE:b++,DOCTYPE_QUOTED:b++,DOCTYPE_DTD:b++,DOCTYPE_DTD_QUOTED:b++,COMMENT_STARTING:b++,COMMENT:b++,COMMENT_ENDING:b++,COMMENT_ENDED:b++,CDATA:b++,CDATA_ENDING:b++,CDATA_ENDING_2:b++,PROC_INST:b++,PROC_INST_BODY:b++,PROC_INST_ENDING:b++,OPEN_TAG:b++,OPEN_TAG_SLASH:b++,ATTRIB:b++,ATTRIB_NAME:b++,ATTRIB_NAME_SAW_WHITE:b++,ATTRIB_VALUE:b++,ATTRIB_VALUE_QUOTED:b++,ATTRIB_VALUE_CLOSED:b++,ATTRIB_VALUE_UNQUOTED:b++,ATTRIB_VALUE_ENTITY_Q:b++,ATTRIB_VALUE_ENTITY_U:b++,CLOSE_TAG:b++,CLOSE_TAG_SAW_WHITE:b++,SCRIPT:b++,SCRIPT_ENDING:b++};r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(r.ENTITIES).forEach((function(i){var a=r.ENTITIES[i];var s=typeof a==="number"?String.fromCharCode(a):a;r.ENTITIES[i]=s}));for(var C in r.STATE){r.STATE[r.STATE[C]]=C}b=r.STATE;function emit(r,i,a){r[i]&&r[i](a)}function emitNode(r,i,a){if(r.textNode)closeText(r);emit(r,i,a)}function closeText(r){r.textNode=textopts(r.opt,r.textNode);if(r.textNode)emit(r,"ontext",r.textNode);r.textNode=""}function textopts(r,i){if(r.trim)i=i.trim();if(r.normalize)i=i.replace(/\s+/g," ");return i}function error(r,i){closeText(r);if(r.trackPosition){i+="\nLine: "+r.line+"\nColumn: "+r.column+"\nChar: "+r.c}i=new Error(i);r.error=i;emit(r,"onerror",i);return r}function end(r){if(r.sawRoot&&!r.closedRoot)strictFail(r,"Unclosed root tag");if(r.state!==b.BEGIN&&r.state!==b.BEGIN_WHITESPACE&&r.state!==b.TEXT){error(r,"Unexpected end")}closeText(r);r.c="";r.closed=true;emit(r,"onend");SAXParser.call(r,r.strict,r.opt);return r}function strictFail(r,i){if(typeof r!=="object"||!(r instanceof SAXParser)){throw new Error("bad call to strictFail")}if(r.strict){error(r,i)}}function newTag(r){if(!r.strict)r.tagName=r.tagName[r.looseCase]();var i=r.tags[r.tags.length-1]||r;var a=r.tag={name:r.tagName,attributes:{}};if(r.opt.xmlns){a.ns=i.ns}r.attribList.length=0;emitNode(r,"onopentagstart",a)}function qname(r,i){var a=r.indexOf(":");var s=a<0?["",r]:r.split(":");var l=s[0];var c=s[1];if(i&&r==="xmlns"){l="xmlns";c=""}return{prefix:l,local:c}}function attrib(r){if(!r.strict){r.attribName=r.attribName[r.looseCase]()}if(r.attribList.indexOf(r.attribName)!==-1||r.tag.attributes.hasOwnProperty(r.attribName)){r.attribName=r.attribValue="";return}if(r.opt.xmlns){var i=qname(r.attribName,true);var a=i.prefix;var s=i.local;if(a==="xmlns"){if(s==="xml"&&r.attribValue!==d){strictFail(r,"xml: prefix must be bound to "+d+"\n"+"Actual: "+r.attribValue)}else if(s==="xmlns"&&r.attribValue!==u){strictFail(r,"xmlns: prefix must be bound to "+u+"\n"+"Actual: "+r.attribValue)}else{var l=r.tag;var c=r.tags[r.tags.length-1]||r;if(l.ns===c.ns){l.ns=Object.create(c.ns)}l.ns[s]=r.attribValue}}r.attribList.push([r.attribName,r.attribValue])}else{r.tag.attributes[r.attribName]=r.attribValue;emitNode(r,"onattribute",{name:r.attribName,value:r.attribValue})}r.attribName=r.attribValue=""}function openTag(r,i){if(r.opt.xmlns){var a=r.tag;var s=qname(r.tagName);a.prefix=s.prefix;a.local=s.local;a.uri=a.ns[s.prefix]||"";if(a.prefix&&!a.uri){strictFail(r,"Unbound namespace prefix: "+JSON.stringify(r.tagName));a.uri=s.prefix}var l=r.tags[r.tags.length-1]||r;if(a.ns&&l.ns!==a.ns){Object.keys(a.ns).forEach((function(i){emitNode(r,"onopennamespace",{prefix:i,uri:a.ns[i]})}))}for(var c=0,p=r.attribList.length;c";r.tagName="";r.state=b.SCRIPT;return}emitNode(r,"onscript",r.script);r.script=""}var i=r.tags.length;var a=r.tagName;if(!r.strict){a=a[r.looseCase]()}var s=a;while(i--){var l=r.tags[i];if(l.name!==s){strictFail(r,"Unexpected close tag")}else{break}}if(i<0){strictFail(r,"Unmatched closing tag: "+r.tagName);r.textNode+="";r.state=b.TEXT;return}r.tagName=a;var c=r.tags.length;while(c-- >i){var p=r.tag=r.tags.pop();r.tagName=r.tag.name;emitNode(r,"onclosetag",r.tagName);var d={};for(var u in p.ns){d[u]=p.ns[u]}var A=r.tags[r.tags.length-1]||r;if(r.opt.xmlns&&p.ns!==A.ns){Object.keys(p.ns).forEach((function(i){var a=p.ns[i];emitNode(r,"onclosenamespace",{prefix:i,uri:a})}))}}if(i===0)r.closedRoot=true;r.tagName=r.attribValue=r.attribName="";r.attribList.length=0;r.state=b.TEXT}function parseEntity(r){var i=r.entity;var a=i.toLowerCase();var s;var l="";if(r.ENTITIES[i]){return r.ENTITIES[i]}if(r.ENTITIES[a]){return r.ENTITIES[a]}i=a;if(i.charAt(0)==="#"){if(i.charAt(1)==="x"){i=i.slice(2);s=parseInt(i,16);l=s.toString(16)}else{i=i.slice(1);s=parseInt(i,10);l=s.toString(10)}}i=i.replace(/^0+/,"");if(isNaN(s)||l.toLowerCase()!==i){strictFail(r,"Invalid character entity");return"&"+r.entity+";"}return String.fromCodePoint(s)}function beginWhiteSpace(r,i){if(i==="<"){r.state=b.OPEN_WAKA;r.startTagPosition=r.position}else if(!isWhitespace(i)){strictFail(r,"Non-whitespace before first tag.");r.textNode=i;r.state=b.TEXT}}function charAt(r,i){var a="";if(i"){emitNode(i,"onsgmldeclaration",i.sgmlDecl);i.sgmlDecl="";i.state=b.TEXT}else if(isQuote(s)){i.state=b.SGML_DECL_QUOTED;i.sgmlDecl+=s}else{i.sgmlDecl+=s}continue;case b.SGML_DECL_QUOTED:if(s===i.q){i.state=b.SGML_DECL;i.q=""}i.sgmlDecl+=s;continue;case b.DOCTYPE:if(s===">"){i.state=b.TEXT;emitNode(i,"ondoctype",i.doctype);i.doctype=true}else{i.doctype+=s;if(s==="["){i.state=b.DOCTYPE_DTD}else if(isQuote(s)){i.state=b.DOCTYPE_QUOTED;i.q=s}}continue;case b.DOCTYPE_QUOTED:i.doctype+=s;if(s===i.q){i.q="";i.state=b.DOCTYPE}continue;case b.DOCTYPE_DTD:i.doctype+=s;if(s==="]"){i.state=b.DOCTYPE}else if(isQuote(s)){i.state=b.DOCTYPE_DTD_QUOTED;i.q=s}continue;case b.DOCTYPE_DTD_QUOTED:i.doctype+=s;if(s===i.q){i.state=b.DOCTYPE_DTD;i.q=""}continue;case b.COMMENT:if(s==="-"){i.state=b.COMMENT_ENDING}else{i.comment+=s}continue;case b.COMMENT_ENDING:if(s==="-"){i.state=b.COMMENT_ENDED;i.comment=textopts(i.opt,i.comment);if(i.comment){emitNode(i,"oncomment",i.comment)}i.comment=""}else{i.comment+="-"+s;i.state=b.COMMENT}continue;case b.COMMENT_ENDED:if(s!==">"){strictFail(i,"Malformed comment");i.comment+="--"+s;i.state=b.COMMENT}else{i.state=b.TEXT}continue;case b.CDATA:if(s==="]"){i.state=b.CDATA_ENDING}else{i.cdata+=s}continue;case b.CDATA_ENDING:if(s==="]"){i.state=b.CDATA_ENDING_2}else{i.cdata+="]"+s;i.state=b.CDATA}continue;case b.CDATA_ENDING_2:if(s===">"){if(i.cdata){emitNode(i,"oncdata",i.cdata)}emitNode(i,"onclosecdata");i.cdata="";i.state=b.TEXT}else if(s==="]"){i.cdata+="]"}else{i.cdata+="]]"+s;i.state=b.CDATA}continue;case b.PROC_INST:if(s==="?"){i.state=b.PROC_INST_ENDING}else if(isWhitespace(s)){i.state=b.PROC_INST_BODY}else{i.procInstName+=s}continue;case b.PROC_INST_BODY:if(!i.procInstBody&&isWhitespace(s)){continue}else if(s==="?"){i.state=b.PROC_INST_ENDING}else{i.procInstBody+=s}continue;case b.PROC_INST_ENDING:if(s===">"){emitNode(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody});i.procInstName=i.procInstBody="";i.state=b.TEXT}else{i.procInstBody+="?"+s;i.state=b.PROC_INST_BODY}continue;case b.OPEN_TAG:if(isMatch(g,s)){i.tagName+=s}else{newTag(i);if(s===">"){openTag(i)}else if(s==="/"){i.state=b.OPEN_TAG_SLASH}else{if(!isWhitespace(s)){strictFail(i,"Invalid character in tag name")}i.state=b.ATTRIB}}continue;case b.OPEN_TAG_SLASH:if(s===">"){openTag(i,true);closeTag(i)}else{strictFail(i,"Forward-slash in opening tag not followed by >");i.state=b.ATTRIB}continue;case b.ATTRIB:if(isWhitespace(s)){continue}else if(s===">"){openTag(i)}else if(s==="/"){i.state=b.OPEN_TAG_SLASH}else if(isMatch(h,s)){i.attribName=s;i.attribValue="";i.state=b.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case b.ATTRIB_NAME:if(s==="="){i.state=b.ATTRIB_VALUE}else if(s===">"){strictFail(i,"Attribute without value");i.attribValue=i.attribName;attrib(i);openTag(i)}else if(isWhitespace(s)){i.state=b.ATTRIB_NAME_SAW_WHITE}else if(isMatch(g,s)){i.attribName+=s}else{strictFail(i,"Invalid attribute name")}continue;case b.ATTRIB_NAME_SAW_WHITE:if(s==="="){i.state=b.ATTRIB_VALUE}else if(isWhitespace(s)){continue}else{strictFail(i,"Attribute without value");i.tag.attributes[i.attribName]="";i.attribValue="";emitNode(i,"onattribute",{name:i.attribName,value:""});i.attribName="";if(s===">"){openTag(i)}else if(isMatch(h,s)){i.attribName=s;i.state=b.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name");i.state=b.ATTRIB}}continue;case b.ATTRIB_VALUE:if(isWhitespace(s)){continue}else if(isQuote(s)){i.q=s;i.state=b.ATTRIB_VALUE_QUOTED}else{strictFail(i,"Unquoted attribute value");i.state=b.ATTRIB_VALUE_UNQUOTED;i.attribValue=s}continue;case b.ATTRIB_VALUE_QUOTED:if(s!==i.q){if(s==="&"){i.state=b.ATTRIB_VALUE_ENTITY_Q}else{i.attribValue+=s}continue}attrib(i);i.q="";i.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:if(isWhitespace(s)){i.state=b.ATTRIB}else if(s===">"){openTag(i)}else if(s==="/"){i.state=b.OPEN_TAG_SLASH}else if(isMatch(h,s)){strictFail(i,"No whitespace between attributes");i.attribName=s;i.attribValue="";i.state=b.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case b.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(s)){if(s==="&"){i.state=b.ATTRIB_VALUE_ENTITY_U}else{i.attribValue+=s}continue}attrib(i);if(s===">"){openTag(i)}else{i.state=b.ATTRIB}continue;case b.CLOSE_TAG:if(!i.tagName){if(isWhitespace(s)){continue}else if(notMatch(h,s)){if(i.script){i.script+=""){closeTag(i)}else if(isMatch(g,s)){i.tagName+=s}else if(i.script){i.script+=""){closeTag(i)}else{strictFail(i,"Invalid characters in closing tag")}continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var u;var A;switch(i.state){case b.TEXT_ENTITY:u=b.TEXT;A="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:u=b.ATTRIB_VALUE_QUOTED;A="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:u=b.ATTRIB_VALUE_UNQUOTED;A="attribValue";break}if(s===";"){if(i.opt.unparsedEntities){var C=parseEntity(i);i.entity="";i.state=u;i.write(C)}else{i[A]+=parseEntity(i);i.entity="";i.state=u}}else if(isMatch(i.entity.length?E:y,s)){i.entity+=s}else{strictFail(i,"Invalid character in entity name");i[A]+="&"+i.entity+s;i.entity="";i.state=u}continue;default:{throw new Error(i,"Unknown state: "+i.state)}}}if(i.position>=i.bufferCheckPosition){checkBufferLength(i)}return i} -/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var a=16384;var s=[];var l;var c;var p=-1;var d=arguments.length;if(!d){return""}var u="";while(++p1114111||i(A)!==A){throw RangeError("Invalid code point: "+A)}if(A<=65535){s.push(A)}else{A-=65536;l=(A>>10)+55296;c=A%1024+56320;s.push(l,c)}if(p+1===d||s.length>a){u+=r.apply(null,s);s.length=0}}return u};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},18246:(r,i,a)=>{var s=a(73837);var l=a(92433);var c=a(80209);var p=a(19173).Writable;var d=a(19173).PassThrough;var noop=function(){};var overflow=function(r){r&=511;return r&&512-r};var emptyStream=function(r,i){var a=new Source(r,i);a.end();return a};var mixinPax=function(r,i){if(i.path)r.name=i.path;if(i.linkpath)r.linkname=i.linkpath;if(i.size)r.size=parseInt(i.size,10);r.pax=i;return r};var Source=function(r,i){this._parent=r;this.offset=i;d.call(this,{autoDestroy:false})};s.inherits(Source,d);Source.prototype.destroy=function(r){this._parent.destroy(r)};var Extract=function(r){if(!(this instanceof Extract))return new Extract(r);p.call(this,r);r=r||{};this._offset=0;this._buffer=l();this._missing=0;this._partial=false;this._onparse=noop;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var i=this;var a=i._buffer;var oncontinue=function(){i._continue()};var onunlock=function(r){i._locked=false;if(r)return i.destroy(r);if(!i._stream)oncontinue()};var onstreamend=function(){i._stream=null;var r=overflow(i._header.size);if(r)i._parse(r,ondrain);else i._parse(512,onheader);if(!i._locked)oncontinue()};var ondrain=function(){i._buffer.consume(overflow(i._header.size));i._parse(512,onheader);oncontinue()};var onpaxglobalheader=function(){var r=i._header.size;i._paxGlobal=c.decodePax(a.slice(0,r));a.consume(r);onstreamend()};var onpaxheader=function(){var r=i._header.size;i._pax=c.decodePax(a.slice(0,r));if(i._paxGlobal)i._pax=Object.assign({},i._paxGlobal,i._pax);a.consume(r);onstreamend()};var ongnulongpath=function(){var s=i._header.size;this._gnuLongPath=c.decodeLongPath(a.slice(0,s),r.filenameEncoding);a.consume(s);onstreamend()};var ongnulonglinkpath=function(){var s=i._header.size;this._gnuLongLinkPath=c.decodeLongPath(a.slice(0,s),r.filenameEncoding);a.consume(s);onstreamend()};var onheader=function(){var s=i._offset;var l;try{l=i._header=c.decode(a.slice(0,512),r.filenameEncoding,r.allowUnknownFormat)}catch(r){i.emit("error",r)}a.consume(512);if(!l){i._parse(512,onheader);oncontinue();return}if(l.type==="gnu-long-path"){i._parse(l.size,ongnulongpath);oncontinue();return}if(l.type==="gnu-long-link-path"){i._parse(l.size,ongnulonglinkpath);oncontinue();return}if(l.type==="pax-global-header"){i._parse(l.size,onpaxglobalheader);oncontinue();return}if(l.type==="pax-header"){i._parse(l.size,onpaxheader);oncontinue();return}if(i._gnuLongPath){l.name=i._gnuLongPath;i._gnuLongPath=null}if(i._gnuLongLinkPath){l.linkname=i._gnuLongLinkPath;i._gnuLongLinkPath=null}if(i._pax){i._header=l=mixinPax(l,i._pax);i._pax=null}i._locked=true;if(!l.size||l.type==="directory"){i._parse(512,onheader);i.emit("entry",l,emptyStream(i,s),onunlock);return}i._stream=new Source(i,s);i.emit("entry",l,i._stream,onunlock);i._parse(l.size,onstreamend);oncontinue()};this._onheader=onheader;this._parse(512,onheader)};s.inherits(Extract,p);Extract.prototype.destroy=function(r){if(this._destroyed)return;this._destroyed=true;if(r)this.emit("error",r);this.emit("close");if(this._stream)this._stream.emit("close")};Extract.prototype._parse=function(r,i){if(this._destroyed)return;this._offset+=r;this._missing=r;if(i===this._onheader)this._partial=false;this._onparse=i};Extract.prototype._continue=function(){if(this._destroyed)return;var r=this._cb;this._cb=noop;if(this._overflow)this._write(this._overflow,undefined,r);else r()};Extract.prototype._write=function(r,i,a){if(this._destroyed)return;var s=this._stream;var l=this._buffer;var c=this._missing;if(r.length)this._partial=true;if(r.lengthc){p=r.slice(c);r=r.slice(0,c)}if(s)s.end(r);else l.append(r);this._overflow=p;this._onparse()};Extract.prototype._final=function(r){if(this._partial)return this.destroy(new Error("Unexpected end of data"));r()};r.exports=Extract},80209:(r,i)=>{var a=Buffer.alloc;var s="0000000000000000000";var l="7777777777777777777";var c="0".charCodeAt(0);var p=Buffer.from("ustar\0","binary");var d=Buffer.from("00","binary");var u=Buffer.from("ustar ","binary");var A=Buffer.from(" \0","binary");var h=parseInt("7777",8);var g=257;var y=263;var clamp=function(r,i,a){if(typeof r!=="number")return a;r=~~r;if(r>=i)return i;if(r>=0)return r;r+=i;if(r>=0)return r;return 0};var toType=function(r){switch(r){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null};var toTypeflag=function(r){switch(r){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0};var indexOf=function(r,i,a,s){for(;ai)return l.slice(0,i)+" ";else return s.slice(0,i-r.length)+r+" "};function parse256(r){var i;if(r[0]===128)i=true;else if(r[0]===255)i=false;else return null;var a=[];for(var s=r.length-1;s>0;s--){var l=r[s];if(i)a.push(l);else a.push(255-l)}var c=0;var p=a.length;for(s=0;s=Math.pow(10,a))a++;return i+a+r};i.decodeLongPath=function(r,i){return decodeStr(r,0,r.length,i)};i.encodePax=function(r){var i="";if(r.name)i+=addLength(" path="+r.name+"\n");if(r.linkname)i+=addLength(" linkpath="+r.linkname+"\n");var a=r.pax;if(a){for(var s in a){i+=addLength(" "+s+"="+a[s]+"\n")}}return Buffer.from(i)};i.decodePax=function(r){var i={};while(r.length){var a=0;while(a100){var u=s.indexOf("/");if(u===-1)return null;l+=l?"/"+s.slice(0,u):s.slice(0,u);s=s.slice(u+1)}if(Buffer.byteLength(s)>100||Buffer.byteLength(l)>155)return null;if(r.linkname&&Buffer.byteLength(r.linkname)>100)return null;i.write(s);i.write(encodeOct(r.mode&h,6),100);i.write(encodeOct(r.uid,6),108);i.write(encodeOct(r.gid,6),116);i.write(encodeOct(r.size,11),124);i.write(encodeOct(r.mtime.getTime()/1e3|0,11),136);i[156]=c+toTypeflag(r.type);if(r.linkname)i.write(r.linkname,157);p.copy(i,g);d.copy(i,y);if(r.uname)i.write(r.uname,265);if(r.gname)i.write(r.gname,297);i.write(encodeOct(r.devmajor||0,6),329);i.write(encodeOct(r.devminor||0,6),337);if(l)i.write(l,345);i.write(encodeOct(cksum(i),6),148);return i};i.decode=function(r,i,a){var s=r[156]===0?0:r[156]-c;var l=decodeStr(r,0,100,i);var d=decodeOct(r,100,8);var h=decodeOct(r,108,8);var E=decodeOct(r,116,8);var b=decodeOct(r,124,12);var C=decodeOct(r,136,12);var v=toType(s);var B=r[157]===0?null:decodeStr(r,157,100,i);var I=decodeStr(r,265,32);var w=decodeStr(r,297,32);var S=decodeOct(r,329,8);var Q=decodeOct(r,337,8);var x=cksum(r);if(x===8*32)return null;if(x!==decodeOct(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(p.compare(r,g,g+6)===0){if(r[345])l=decodeStr(r,345,155,i)+"/"+l}else if(u.compare(r,g,g+6)===0&&A.compare(r,y,y+2)===0){}else{if(!a){throw new Error("Invalid tar header: unknown format.")}}if(s===0&&l&&l[l.length-1]==="/")s=5;return{name:l,mode:d,uid:h,gid:E,size:b,mtime:new Date(1e3*C),type:v,linkname:B,uname:I,gname:w,devmajor:S,devminor:Q}}},28344:(r,i,a)=>{i.extract=a(18246);i.pack=a(87875)},87875:(r,i,a)=>{var s=a(9741);var l=a(37953);var c=a(55806);var p=Buffer.alloc;var d=a(19173).Readable;var u=a(19173).Writable;var A=a(71576).StringDecoder;var h=a(80209);var g=parseInt("755",8);var y=parseInt("644",8);var E=p(1024);var noop=function(){};var overflow=function(r,i){i&=511;if(i)r.push(E.slice(0,512-i))};function modeToType(r){switch(r&s.S_IFMT){case s.S_IFBLK:return"block-device";case s.S_IFCHR:return"character-device";case s.S_IFDIR:return"directory";case s.S_IFIFO:return"fifo";case s.S_IFLNK:return"symlink"}return"file"}var Sink=function(r){u.call(this);this.written=0;this._to=r;this._destroyed=false};c(Sink,u);Sink.prototype._write=function(r,i,a){this.written+=r.length;if(this._to.push(r))return a();this._to._drain=a};Sink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var LinkSink=function(){u.call(this);this.linkname="";this._decoder=new A("utf-8");this._destroyed=false};c(LinkSink,u);LinkSink.prototype._write=function(r,i,a){this.linkname+=this._decoder.write(r);a()};LinkSink.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Void=function(){u.call(this);this._destroyed=false};c(Void,u);Void.prototype._write=function(r,i,a){a(new Error("No body allowed for this entry"))};Void.prototype.destroy=function(){if(this._destroyed)return;this._destroyed=true;this.emit("close")};var Pack=function(r){if(!(this instanceof Pack))return new Pack(r);d.call(this,r);this._drain=noop;this._finalized=false;this._finalizing=false;this._destroyed=false;this._stream=null};c(Pack,d);Pack.prototype.entry=function(r,i,a){if(this._stream)throw new Error("already piping an entry");if(this._finalized||this._destroyed)return;if(typeof i==="function"){a=i;i=null}if(!a)a=noop;var s=this;if(!r.size||r.type==="symlink")r.size=0;if(!r.type)r.type=modeToType(r.mode);if(!r.mode)r.mode=r.type==="directory"?g:y;if(!r.uid)r.uid=0;if(!r.gid)r.gid=0;if(!r.mtime)r.mtime=new Date;if(typeof i==="string")i=Buffer.from(i);if(Buffer.isBuffer(i)){r.size=i.length;this._encode(r);var c=this.push(i);overflow(s,r.size);if(c)process.nextTick(a);else this._drain=a;return new Void}if(r.type==="symlink"&&!r.linkname){var p=new LinkSink;l(p,(function(i){if(i){s.destroy();return a(i)}r.linkname=p.linkname;s._encode(r);a()}));return p}this._encode(r);if(r.type!=="file"&&r.type!=="contiguous-file"){process.nextTick(a);return new Void}var d=new Sink(this);this._stream=d;l(d,(function(i){s._stream=null;if(i){s.destroy();return a(i)}if(d.written!==r.size){s.destroy();return a(new Error("size mismatch"))}overflow(s,r.size);if(s._finalizing)s.finalize();a()}));return d};Pack.prototype.finalize=function(){if(this._stream){this._finalizing=true;return}if(this._finalized)return;this._finalized=true;this.push(E);this.push(null)};Pack.prototype.destroy=function(r){if(this._destroyed)return;this._destroyed=true;if(r)this.emit("error",r);this.emit("close");if(this._stream&&this._stream.destroy)this._stream.destroy()};Pack.prototype._encode=function(r){if(!r.pax){var i=h.encode(r);if(i){this.push(i);return}}this._encodePax(r)};Pack.prototype._encodePax=function(r){var i=h.encodePax({name:r.name,linkname:r.linkname,pax:r.pax});var a={name:"PaxHeader",mode:r.mode,uid:r.uid,gid:r.gid,size:i.length,mtime:r.mtime,type:"pax-header",linkname:r.linkname&&"PaxHeader",uname:r.uname,gname:r.gname,devmajor:r.devmajor,devminor:r.devminor};this.push(h.encode(a));this.push(i);overflow(this,i.length);a.size=r.size;a.type=r.type;this.push(h.encode(a))};Pack.prototype._read=function(r){var i=this._drain;this._drain=noop;i()};r.exports=Pack},60265:(r,i,a)=>{"use strict";var s=a(85477);var l=a(65441);var c={TRANSITIONAL:0,NONTRANSITIONAL:1};function normalize(r){return r.split("\0").map((function(r){return r.normalize("NFC")})).join("\0")}function findStatus(r){var i=0;var a=l.length-1;while(i<=a){var s=Math.floor((i+a)/2);var c=l[s];if(c[0][0]<=r&&c[0][1]>=r){return c}else if(c[0][0]>r){a=s-1}else{i=s+1}}return null}var p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function countSymbols(r){return r.replace(p,"_").length}function mapChars(r,i,a){var s=false;var l="";var p=countSymbols(r);for(var d=0;d253||d.length===0){c.error=true}for(var u=0;u63||p.length===0){c.error=true;break}}}if(c.error)return null;return p.join(".")};r.exports.toUnicode=function(r,i){var a=processing(r,i,c.NONTRANSITIONAL);return{domain:a.string,error:a.error}};r.exports.PROCESSING_OPTIONS=c},35363:r=>{r.exports=Traverse;function Traverse(r){if(!(this instanceof Traverse))return new Traverse(r);this.value=r}Traverse.prototype.get=function(r){var i=this.value;for(var a=0;a{var i;var a;var s;var l;var c;var p;var d;var u;var A;var h;var g;var y;var E;var b;var C;var v;var B;var I;var w;var S;var Q;var x;var N;var R;var T;var D;var k;var _;var O;var P;var L;(function(i){var a=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(r){i(createExporter(a,createExporter(r)))}))}else if(true&&typeof r.exports==="object"){i(createExporter(a,createExporter(r.exports)))}else{i(createExporter(a))}function createExporter(r,i){if(r!==a){if(typeof Object.create==="function"){Object.defineProperty(r,"__esModule",{value:true})}else{r.__esModule=true}}return function(a,s){return r[a]=i?i(a,s):s}}})((function(r){var M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a))r[a]=i[a]};i=function(r,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");M(r,i);function __(){this.constructor=r}r.prototype=i===null?Object.create(i):(__.prototype=i.prototype,new __)};a=Object.assign||function(r){for(var i,a=1,s=arguments.length;a=0;d--)if(p=r[d])c=(l<3?p(c):l>3?p(i,a,c):p(i,a))||c;return l>3&&c&&Object.defineProperty(i,a,c),c};c=function(r,i){return function(a,s){i(a,s,r)}};p=function(r,i,a,s,l,c){function accept(r){if(r!==void 0&&typeof r!=="function")throw new TypeError("Function expected");return r}var p=s.kind,d=p==="getter"?"get":p==="setter"?"set":"value";var u=!i&&r?s["static"]?r:r.prototype:null;var A=i||(u?Object.getOwnPropertyDescriptor(u,s.name):{});var h,g=false;for(var y=a.length-1;y>=0;y--){var E={};for(var b in s)E[b]=b==="access"?{}:s[b];for(var b in s.access)E.access[b]=s.access[b];E.addInitializer=function(r){if(g)throw new TypeError("Cannot add initializers after decoration has completed");c.push(accept(r||null))};var C=(0,a[y])(p==="accessor"?{get:A.get,set:A.set}:A[d],E);if(p==="accessor"){if(C===void 0)continue;if(C===null||typeof C!=="object")throw new TypeError("Object expected");if(h=accept(C.get))A.get=h;if(h=accept(C.set))A.set=h;if(h=accept(C.init))l.unshift(h)}else if(h=accept(C)){if(p==="field")l.unshift(h);else A[d]=h}}if(u)Object.defineProperty(u,s.name,A);g=true};d=function(r,i,a){var s=arguments.length>2;for(var l=0;l0&&c[c.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!c||d[1]>c[0]&&d[1]=r.length)r=void 0;return{value:r&&r[s++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")};C=function(r,i){var a=typeof Symbol==="function"&&r[Symbol.iterator];if(!a)return r;var s=a.call(r),l,c=[],p;try{while((i===void 0||i-- >0)&&!(l=s.next()).done)c.push(l.value)}catch(r){p={error:r}}finally{try{if(l&&!l.done&&(a=s["return"]))a.call(s)}finally{if(p)throw p.error}}return c};v=function(){for(var r=[],i=0;i1||resume(r,i)}))}}function resume(r,i){try{step(s[r](i))}catch(r){settle(c[0][3],r)}}function step(r){r.value instanceof w?Promise.resolve(r.value.v).then(fulfill,reject):settle(c[0][2],r)}function fulfill(r){resume("next",r)}function reject(r){resume("throw",r)}function settle(r,i){if(r(i),c.shift(),c.length)resume(c[0][0],c[0][1])}};Q=function(r){var i,a;return i={},verb("next"),verb("throw",(function(r){throw r})),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(s,l){i[s]=r[s]?function(i){return(a=!a)?{value:w(r[s](i)),done:false}:l?l(i):i}:l}};x=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],a;return i?i.call(r):(r=typeof b==="function"?b(r):r[Symbol.iterator](),a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a);function verb(i){a[i]=r[i]&&function(a){return new Promise((function(s,l){a=r[i](a),settle(s,l,a.done,a.value)}))}}function settle(r,i,a,s){Promise.resolve(s).then((function(i){r({value:i,done:a})}),i)}};N=function(r,i){if(Object.defineProperty){Object.defineProperty(r,"raw",{value:i})}else{r.raw=i}return r};var U=Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i};R=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))O(i,r,a);U(i,r);return i};T=function(r){return r&&r.__esModule?r:{default:r}};D=function(r,i,a,s){if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?r!==i||!s:!i.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?s:a==="a"?s.call(r):s?s.value:i.get(r)};k=function(r,i,a,s,l){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?r!==i||!l:!i.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?l.call(r,a):l?l.value=a:i.set(r,a),a};_=function(r,i){if(i===null||typeof i!=="object"&&typeof i!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r==="function"?i===r:r.has(i)};P=function(r,i,a){if(i!==null&&i!==void 0){if(typeof i!=="object"&&typeof i!=="function")throw new TypeError("Object expected.");var s;if(a){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=i[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=i[Symbol.dispose]}if(typeof s!=="function")throw new TypeError("Object not disposable.");r.stack.push({value:i,dispose:s,async:a})}else if(a){r.stack.push({async:true})}return i};var q=typeof SuppressedError==="function"?SuppressedError:function(r,i,a){var s=new Error(a);return s.name="SuppressedError",s.error=r,s.suppressed=i,s};L=function(r){function fail(i){r.error=r.hasError?new q(i,r.error,"An error was suppressed during disposal."):i;r.hasError=true}function next(){while(r.stack.length){var i=r.stack.pop();try{var a=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(a).then(next,(function(r){fail(r);return next()}))}catch(r){fail(r)}}if(r.hasError)throw r.error}return next()};r("__extends",i);r("__assign",a);r("__rest",s);r("__decorate",l);r("__param",c);r("__esDecorate",p);r("__runInitializers",d);r("__propKey",u);r("__setFunctionName",A);r("__metadata",h);r("__awaiter",g);r("__generator",y);r("__exportStar",E);r("__createBinding",O);r("__values",b);r("__read",C);r("__spread",v);r("__spreadArrays",B);r("__spreadArray",I);r("__await",w);r("__asyncGenerator",S);r("__asyncDelegator",Q);r("__asyncValues",x);r("__makeTemplateObject",N);r("__importStar",R);r("__importDefault",T);r("__classPrivateFieldGet",D);r("__classPrivateFieldSet",k);r("__classPrivateFieldIn",_);r("__addDisposableResource",P);r("__disposeResources",L)}))},70391:(r,i,a)=>{r.exports=a(37832)},37832:(r,i,a)=>{"use strict";var s=a(41808);var l=a(24404);var c=a(13685);var p=a(95687);var d=a(82361);var u=a(39491);var A=a(73837);i.httpOverHttp=httpOverHttp;i.httpsOverHttp=httpsOverHttp;i.httpOverHttps=httpOverHttps;i.httpsOverHttps=httpsOverHttps;function httpOverHttp(r){var i=new TunnelingAgent(r);i.request=c.request;return i}function httpsOverHttp(r){var i=new TunnelingAgent(r);i.request=c.request;i.createSocket=createSecureSocket;i.defaultPort=443;return i}function httpOverHttps(r){var i=new TunnelingAgent(r);i.request=p.request;return i}function httpsOverHttps(r){var i=new TunnelingAgent(r);i.request=p.request;i.createSocket=createSecureSocket;i.defaultPort=443;return i}function TunnelingAgent(r){var i=this;i.options=r||{};i.proxyOptions=i.options.proxy||{};i.maxSockets=i.options.maxSockets||c.Agent.defaultMaxSockets;i.requests=[];i.sockets=[];i.on("free",(function onFree(r,a,s,l){var c=toOptions(a,s,l);for(var p=0,d=i.requests.length;p=this.maxSockets){l.requests.push(c);return}l.createSocket(c,(function(i){i.on("free",onFree);i.on("close",onCloseOrRemove);i.on("agentRemove",onCloseOrRemove);r.onSocket(i);function onFree(){l.emit("free",i,c)}function onCloseOrRemove(r){l.removeSocket(i);i.removeListener("free",onFree);i.removeListener("close",onCloseOrRemove);i.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(r,i){var a=this;var s={};a.sockets.push(s);var l=mergeOptions({},a.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:false,headers:{host:r.host+":"+r.port}});if(r.localAddress){l.localAddress=r.localAddress}if(l.proxyAuth){l.headers=l.headers||{};l.headers["Proxy-Authorization"]="Basic "+new Buffer(l.proxyAuth).toString("base64")}h("making CONNECT request");var c=a.request(l);c.useChunkedEncodingByDefault=false;c.once("response",onResponse);c.once("upgrade",onUpgrade);c.once("connect",onConnect);c.once("error",onError);c.end();function onResponse(r){r.upgrade=true}function onUpgrade(r,i,a){process.nextTick((function(){onConnect(r,i,a)}))}function onConnect(l,p,d){c.removeAllListeners();p.removeAllListeners();if(l.statusCode!==200){h("tunneling socket could not be established, statusCode=%d",l.statusCode);p.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+l.statusCode);u.code="ECONNRESET";r.request.emit("error",u);a.removeSocket(s);return}if(d.length>0){h("got illegal response body from proxy");p.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";r.request.emit("error",u);a.removeSocket(s);return}h("tunneling connection has established");a.sockets[a.sockets.indexOf(s)]=p;return i(p)}function onError(i){c.removeAllListeners();h("tunneling socket could not be established, cause=%s\n",i.message,i.stack);var l=new Error("tunneling socket could not be established, "+"cause="+i.message);l.code="ECONNRESET";r.request.emit("error",l);a.removeSocket(s)}};TunnelingAgent.prototype.removeSocket=function removeSocket(r){var i=this.sockets.indexOf(r);if(i===-1){return}this.sockets.splice(i,1);var a=this.requests.shift();if(a){this.createSocket(a,(function(r){a.request.onSocket(r)}))}};function createSecureSocket(r,i){var a=this;TunnelingAgent.prototype.createSocket.call(a,r,(function(s){var c=r.request.getHeader("host");var p=mergeOptions({},a.options,{socket:s,servername:c?c.replace(/:.*$/,""):r.host});var d=l.connect(0,p);a.sockets[a.sockets.indexOf(s)]=d;i(d)}))}function toOptions(r,i,a){if(typeof r==="string"){return{host:r,port:i,localAddress:a}}return r}function mergeOptions(r){for(var i=1,a=arguments.length;i{"use strict";Object.defineProperty(i,"__esModule",{value:true})},21322:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isValidErrorCode=i.httpStatusFromErrorCode=i.TwirpErrorCode=i.BadRouteError=i.InternalServerErrorWith=i.InternalServerError=i.RequiredArgumentError=i.InvalidArgumentError=i.NotFoundError=i.TwirpError=void 0;class TwirpError extends Error{constructor(r,i){super(i);this.code=a.Internal;this.meta={};this.code=r;this.msg=i;Object.setPrototypeOf(this,TwirpError.prototype)}withMeta(r,i){this.meta[r]=i;return this}getMeta(r){return this.meta[r]||""}withCause(r,i=false){this._originalCause=r;if(i){this.withMeta("cause",r.message)}return this}cause(){return this._originalCause}toJSON(){try{return JSON.stringify({code:this.code,msg:this.msg,meta:this.meta})}catch(r){return`{"code": "internal", "msg": "There was an error but it could not be serialized into JSON"}`}}static fromObject(r){const i=r["code"]||a.Unknown;const s=r["msg"]||"unknown";const l=new TwirpError(i,s);if(r["meta"]){Object.keys(r["meta"]).forEach((i=>{l.withMeta(i,r["meta"][i])}))}return l}}i.TwirpError=TwirpError;class NotFoundError extends TwirpError{constructor(r){super(a.NotFound,r)}}i.NotFoundError=NotFoundError;class InvalidArgumentError extends TwirpError{constructor(r,i){super(a.InvalidArgument,r+" "+i);this.withMeta("argument",r)}}i.InvalidArgumentError=InvalidArgumentError;class RequiredArgumentError extends InvalidArgumentError{constructor(r){super(r,"is required")}}i.RequiredArgumentError=RequiredArgumentError;class InternalServerError extends TwirpError{constructor(r){super(a.Internal,r)}}i.InternalServerError=InternalServerError;class InternalServerErrorWith extends InternalServerError{constructor(r){super(r.message);this.withMeta("cause",r.name);this.withCause(r)}}i.InternalServerErrorWith=InternalServerErrorWith;class BadRouteError extends TwirpError{constructor(r,i,s){super(a.BadRoute,r);this.withMeta("twirp_invalid_route",i+" "+s)}}i.BadRouteError=BadRouteError;var a;(function(r){r["Canceled"]="canceled";r["Unknown"]="unknown";r["InvalidArgument"]="invalid_argument";r["Malformed"]="malformed";r["DeadlineExceeded"]="deadline_exceeded";r["NotFound"]="not_found";r["BadRoute"]="bad_route";r["AlreadyExists"]="already_exists";r["PermissionDenied"]="permission_denied";r["Unauthenticated"]="unauthenticated";r["ResourceExhausted"]="resource_exhausted";r["FailedPrecondition"]="failed_precondition";r["Aborted"]="aborted";r["OutOfRange"]="out_of_range";r["Unimplemented"]="unimplemented";r["Internal"]="internal";r["Unavailable"]="unavailable";r["DataLoss"]="data_loss"})(a=i.TwirpErrorCode||(i.TwirpErrorCode={}));function httpStatusFromErrorCode(r){switch(r){case a.Canceled:return 408;case a.Unknown:return 500;case a.InvalidArgument:return 400;case a.Malformed:return 400;case a.DeadlineExceeded:return 408;case a.NotFound:return 404;case a.BadRoute:return 404;case a.AlreadyExists:return 409;case a.PermissionDenied:return 403;case a.Unauthenticated:return 401;case a.ResourceExhausted:return 429;case a.FailedPrecondition:return 412;case a.Aborted:return 409;case a.OutOfRange:return 400;case a.Unimplemented:return 501;case a.Internal:return 500;case a.Unavailable:return 503;case a.DataLoss:return 500;default:return 0}}i.httpStatusFromErrorCode=httpStatusFromErrorCode;function isValidErrorCode(r){return httpStatusFromErrorCode(r)!=0}i.isValidErrorCode=isValidErrorCode},92258:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};var d=this&&this.__rest||function(r,i){var a={};for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&i.indexOf(s)<0)a[s]=r[s];if(r!=null&&typeof Object.getOwnPropertySymbols==="function")for(var l=0,s=Object.getOwnPropertySymbols(r);l{this.rewrite(i,a,r).then((()=>s())).catch((r=>{if(r instanceof g.TwirpError){if(r.code!==g.TwirpErrorCode.NotFound){E.writeError(a,r)}else{s()}}}))}}rewrite(r,i,a="/twirp"){return p(this,void 0,void 0,(function*(){const[s,l]=this.matchRoute(r);const c=yield this.prepareTwirpBody(r,s,l);const p=`${a}/${l.packageName}.${l.serviceName}/${l.methodName}`;r.url=p;r.originalUrl=p;r.method="POST";r.headers["content-type"]="application/json";r.rawBody=Buffer.from(JSON.stringify(c));if(l.responseBodyKey){const r=i.end.bind(i);i.end=function(a){if(i.statusCode===200){r(`{ "${l.responseBodyKey}": ${a} }`)}else{r(a)}}}}))}reverseProxy(r){const i=y.NodeHttpRPC(r);return(r,a)=>p(this,void 0,void 0,(function*(){try{const[s,l]=this.matchRoute(r);const c=yield this.prepareTwirpBody(r,s,l);const p=yield i.request(`${l.packageName}.${l.serviceName}`,l.methodName,"application/json",c);a.statusCode=200;a.setHeader("content-type","application/json");let d;if(l.responseBodyKey){d=JSON.stringify({[l.responseBodyKey]:p})}else{d=JSON.stringify(p)}a.end(d)}catch(r){E.writeError(a,r)}}))}prepareTwirpBody(r,i,a){return p(this,void 0,void 0,(function*(){const s=i.params,{query_string:l}=s,c=d(s,["query_string"]);let p=Object.assign({},c);if(l&&a.bodyKey!=="*"){const r=this.parseQueryString(l);p=Object.assign(Object.assign({},r),p)}let u={};if(a.bodyKey){const i=yield h.getRequestData(r);try{const r=JSON.parse(i.toString()||"{}");if(a.bodyKey==="*"){u=r}else{u[a.bodyKey]=r}}catch(r){const i="the json request could not be decoded";throw new g.TwirpError(g.TwirpErrorCode.Malformed,i).withCause(r,true)}}return Object.assign(Object.assign({},u),p)}))}matchRoute(r){var i;const a=(i=r.method)===null||i===void 0?void 0:i.toLowerCase();if(!a){throw new g.BadRouteError(`method not allowed`,r.method||"",r.url||"")}const s=this.routes[a];for(const i of s){const a=i.matcher(r.url||"/");if(a){return[a,i]}}throw new g.NotFoundError(`url ${r.url} not found`)}parseQueryString(r){const i=u.parse(r.replace("?",""));return A.object(i)}}i.Gateway=Gateway},85966:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.isHook=i.chainHooks=void 0;function chainHooks(...r){if(r.length===0){return null}if(r.length===1){return r[0]}const i={requestReceived(i){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.requestReceived){continue}yield a.requestReceived(i)}}))},requestPrepared(i){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.requestPrepared){continue}console.warn("hook requestPrepared is deprecated and will be removed in the next release. "+"Please use responsePrepared instead.");yield a.requestPrepared(i)}}))},responsePrepared(i){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.responsePrepared){continue}yield a.responsePrepared(i)}}))},requestSent(i){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.requestSent){continue}console.warn("hook requestSent is deprecated and will be removed in the next release. "+"Please use responseSent instead.");yield a.requestSent(i)}}))},responseSent(i){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.responseSent){continue}yield a.responseSent(i)}}))},requestRouted(i){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.requestRouted){continue}yield a.requestRouted(i)}}))},error(i,s){return a(this,void 0,void 0,(function*(){for(const a of r){if(!a.error){continue}yield a.error(i,s)}}))}};return i}i.chainHooks=chainHooks;function isHook(r){return"requestReceived"in r||"requestPrepared"in r||"requestSent"in r||"requestRouted"in r||"responsePrepared"in r||"responseSent"in r||"error"in r}i.isHook=isHook},4153:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);l(i,r);return i};var p=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.FetchRPC=i.wrapErrorResponseToTwirpError=i.NodeHttpRPC=void 0;const d=c(a(13685));const u=c(a(95687));const A=a(57310);const h=a(21322);const NodeHttpRPC=r=>({request(i,a,s,l){let c;return new Promise(((p,h)=>{const g=[];const y=s==="application/protobuf"?Buffer.from(l):JSON.stringify(l);const E=new A.URL(r.baseUrl);const b=E.protocol==="https:";if(b){c=u}else{c=d}const C=E.pathname!=="/"?E.pathname:"";const v=c.request(Object.assign(Object.assign({},r?r:{}),{method:"POST",protocol:E.protocol,host:E.hostname,port:E.port?E.port:b?443:80,path:`${C}/${i}/${a}`,headers:Object.assign(Object.assign({},r.headers?r.headers:{}),{"Content-Type":s,"Content-Length":s==="application/protobuf"?Buffer.byteLength(y):Buffer.from(y).byteLength})}),(r=>{r.on("data",(r=>g.push(r)));r.on("end",(()=>{const i=Buffer.concat(g);if(r.statusCode!=200){h(wrapErrorResponseToTwirpError(i.toString()))}else{if(s==="application/json"){p(JSON.parse(i.toString()))}else{p(i)}}}));r.on("error",(r=>{h(r)}))})).on("error",(r=>{h(r)}));v.end(y)}))}});i.NodeHttpRPC=NodeHttpRPC;function wrapErrorResponseToTwirpError(r){return h.TwirpError.fromObject(JSON.parse(r))}i.wrapErrorResponseToTwirpError=wrapErrorResponseToTwirpError;const FetchRPC=r=>({request(i,a,s,l){return p(this,void 0,void 0,(function*(){const c=new Headers(r.headers);c.set("content-type",s);const p=yield fetch(`${r.baseUrl}/${i}/${a}`,Object.assign(Object.assign({},r),{method:"POST",headers:c,body:l instanceof Uint8Array?l:JSON.stringify(l)}));if(p.status===200){if(s==="application/json"){return yield p.json()}return new Uint8Array(yield p.arrayBuffer())}throw h.TwirpError.fromObject(yield p.json())}))}});i.FetchRPC=FetchRPC},9728:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;Object.defineProperty(r,s,{enumerable:true,get:function(){return i[a]}})}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var l=this&&this.__exportStar||function(r,i){for(var a in r)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a))s(i,r,a)};Object.defineProperty(i,"__esModule",{value:true});i.TwirpContentType=void 0;l(a(4008),i);l(a(83111),i);l(a(35181),i);l(a(85966),i);l(a(21322),i);l(a(92258),i);l(a(4153),i);var c=a(41583);Object.defineProperty(i,"TwirpContentType",{enumerable:true,get:function(){return c.TwirpContentType}})},35181:function(r,i){"use strict";var a=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.chainInterceptors=void 0;function chainInterceptors(...r){if(r.length===0){return}if(r.length===1){return r[0]}const i=r[0];return(s,l,c)=>a(this,void 0,void 0,(function*(){let a=c;for(let i=r.length-1;i>0;i--){a=(a=>(s,l)=>r[i](s,l,a))(a)}return i(s,l,a)}))}i.chainInterceptors=chainInterceptors},41583:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.parseTwirpPath=i.getRequestData=i.validateRequest=i.getContentType=i.TwirpContentType=void 0;const l=a(21322);var c;(function(r){r[r["Protobuf"]=0]="Protobuf";r[r["JSON"]=1]="JSON";r[r["Unknown"]=2]="Unknown"})(c=i.TwirpContentType||(i.TwirpContentType={}));function getContentType(r){switch(r){case"application/protobuf":return c.Protobuf;case"application/json":return c.JSON;default:return c.Unknown}}i.getContentType=getContentType;function validateRequest(r,i,a){if(i.method!=="POST"){const r=`unsupported method ${i.method} (only POST is allowed)`;throw new l.BadRouteError(r,i.method||"",i.url||"")}const s=parseTwirpPath(i.url||"");if(s.pkgService!==(r.packageName?r.packageName+".":"")+r.serviceName){const r=`no handler for path ${i.url}`;throw new l.BadRouteError(r,i.method||"",i.url||"")}if(s.prefix!==a){const r=`invalid path prefix ${s.prefix}, expected ${a}, on path ${i.url}`;throw new l.BadRouteError(r,i.method||"",i.url||"")}const p=i.headers["content-type"]||"";if(r.contentType===c.Unknown){const r=`unexpected Content-Type: ${i.headers["content-type"]}`;throw new l.BadRouteError(r,i.method||"",i.url||"")}return Object.assign(Object.assign({},s),{mimeContentType:p,contentType:r.contentType})}i.validateRequest=validateRequest;function getRequestData(r){return new Promise(((i,a)=>{const c=r;if(c.rawBody instanceof Buffer){i(c.rawBody);return}const p=[];r.on("data",(r=>p.push(r)));r.on("end",(()=>s(this,void 0,void 0,(function*(){const r=Buffer.concat(p);i(r)}))));r.on("error",(i=>{if(r.aborted){a(new l.TwirpError(l.TwirpErrorCode.DeadlineExceeded,"failed to read request: deadline exceeded"))}else{a(new l.TwirpError(l.TwirpErrorCode.Malformed,i.message).withCause(i))}}));r.on("close",(()=>{a(new l.TwirpError(l.TwirpErrorCode.Canceled,"failed to read request: context canceled"))}))}))}i.getRequestData=getRequestData;function parseTwirpPath(r){const i=r.split("/");if(i.length<2){return{pkgService:"",method:"",prefix:""}}return{method:i[i.length-1],pkgService:i[i.length-2],prefix:i.slice(0,i.length-2).join("/")}}i.parseTwirpPath=parseTwirpPath},83111:function(r,i,a){"use strict";var s=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.writeError=i.TwirpServer=void 0;const l=a(85966);const c=a(41583);const p=a(21322);class TwirpServer{constructor(r){this.pathPrefix="/twirp";this.hooks=[];this.interceptors=[];this.packageName=r.packageName;this.serviceName=r.serviceName;this.methodList=r.methodList;this.matchRoute=r.matchRoute;this.service=r.service}get prefix(){return this.pathPrefix}httpHandler(r){return(i,a)=>{if((r===null||r===void 0?void 0:r.prefix)!==undefined){this.withPrefix(r.prefix)}return this._httpHandler(i,a)}}use(...r){r.forEach((r=>{if(l.isHook(r)){this.hooks.push(r);return this}this.interceptors.push(r)}));return this}withPrefix(r){if(r===false){this.pathPrefix=""}else{this.pathPrefix=r}return this}matchingPath(){const r=this.baseURI().replace(/\./g,"\\.");return new RegExp(`${r}/(${this.methodList.join("|")})`)}baseURI(){return`${this.pathPrefix}/${this.packageName?this.packageName+".":""}${this.serviceName}`}createContext(r,i){return{packageName:this.packageName,serviceName:this.serviceName,methodName:"",contentType:c.getContentType(r.headers["content-type"]),req:r,res:i}}_httpHandler(r,i){return s(this,void 0,void 0,(function*(){const a=this.createContext(r,i);try{yield this.invokeHook("requestReceived",a);const{method:s,mimeContentType:l}=c.validateRequest(a,r,this.pathPrefix||"");const d=this.matchRoute(s,{onMatch:r=>this.invokeHook("requestRouted",r),onNotFound:()=>{const i=`no handler for path ${r.url}`;throw new p.BadRouteError(i,r.method||"",r.url||"")}});const u=yield c.getRequestData(r);const A=yield d(a,this.service,u,this.interceptors);yield Promise.all([this.invokeHook("responsePrepared",a),this.invokeHook("requestPrepared",a)]);i.statusCode=200;i.setHeader("Content-Type",l);i.end(A)}catch(r){yield this.invokeHook("error",a,mustBeTwirpError(r));if(!i.headersSent){writeError(i,r)}}finally{yield Promise.all([this.invokeHook("responseSent",a),this.invokeHook("requestSent",a)])}}))}invokeHook(r,i,a){return s(this,void 0,void 0,(function*(){if(this.hooks.length===0){return}const s=l.chainHooks(...this.hooks);const c=s===null||s===void 0?void 0:s[r];if(c){yield c(i,a||new p.InternalServerError("internal server error"))}}))}}i.TwirpServer=TwirpServer;function writeError(r,i){const a=mustBeTwirpError(i);r.setHeader("Content-Type","application/json");r.statusCode=p.httpStatusFromErrorCode(a.code);r.end(a.toJSON())}i.writeError=writeError;function mustBeTwirpError(r){if(r instanceof p.TwirpError){return r}return new p.InternalServerErrorWith(r)}},16096:(r,i,a)=>{"use strict";const s=a(55179);const l=a(78824);const c=a(76291);const p=a(94427);const d=a(85678);const u=a(72916);const A=a(94766);const{InvalidArgumentError:h}=c;const g=a(92747);const y=a(98742);const E=a(16518);const b=a(51441);const C=a(15196);const v=a(11025);const B=a(76650);const I=a(39935);const{getGlobalDispatcher:w,setGlobalDispatcher:S}=a(18826);const Q=a(96474);const x=a(81465);const N=a(76459);let R;try{a(6113);R=true}catch{R=false}Object.assign(l.prototype,g);r.exports.Dispatcher=l;r.exports.Client=s;r.exports.Pool=p;r.exports.BalancedPool=d;r.exports.Agent=u;r.exports.ProxyAgent=B;r.exports.RetryHandler=I;r.exports.DecoratorHandler=Q;r.exports.RedirectHandler=x;r.exports.createRedirectInterceptor=N;r.exports.buildConnector=y;r.exports.errors=c;function makeDispatcher(r){return(i,a,s)=>{if(typeof a==="function"){s=a;a=null}if(!i||typeof i!=="string"&&typeof i!=="object"&&!(i instanceof URL)){throw new h("invalid url")}if(a!=null&&typeof a!=="object"){throw new h("invalid opts")}if(a&&a.path!=null){if(typeof a.path!=="string"){throw new h("invalid opts.path")}let r=a.path;if(!a.path.startsWith("/")){r=`/${r}`}i=new URL(A.parseOrigin(i).origin+r)}else{if(!a){a=typeof i==="object"?i:{}}i=A.parseURL(i)}const{agent:l,dispatcher:c=w()}=a;if(l){throw new h("unsupported opts.agent. Did you mean opts.client?")}return r.call(c,{...a,origin:i.origin,path:i.search?`${i.pathname}${i.search}`:i.pathname,method:a.method||(a.body?"PUT":"GET")},s)}}r.exports.setGlobalDispatcher=S;r.exports.getGlobalDispatcher=w;if(A.nodeMajor>16||A.nodeMajor===16&&A.nodeMinor>=8){let i=null;r.exports.fetch=async function fetch(r){if(!i){i=a(79890).fetch}try{return await i(...arguments)}catch(r){if(typeof r==="object"){Error.captureStackTrace(r,this)}throw r}};r.exports.Headers=a(8247).Headers;r.exports.Response=a(55032).Response;r.exports.Request=a(11287).Request;r.exports.FormData=a(72489).FormData;r.exports.File=a(81636).File;r.exports.FileReader=a(62414).FileReader;const{setGlobalOrigin:s,getGlobalOrigin:l}=a(46670);r.exports.setGlobalOrigin=s;r.exports.getGlobalOrigin=l;const{CacheStorage:c}=a(43425);const{kConstruct:p}=a(23450);r.exports.caches=new c(p)}if(A.nodeMajor>=16){const{deleteCookie:i,getCookies:s,getSetCookies:l,setCookie:c}=a(62549);r.exports.deleteCookie=i;r.exports.getCookies=s;r.exports.getSetCookies=l;r.exports.setCookie=c;const{parseMIMEType:p,serializeAMimeType:d}=a(80097);r.exports.parseMIMEType=p;r.exports.serializeAMimeType=d}if(A.nodeMajor>=18&&R){const{WebSocket:i}=a(82439);r.exports.WebSocket=i}r.exports.request=makeDispatcher(g.request);r.exports.stream=makeDispatcher(g.stream);r.exports.pipeline=makeDispatcher(g.pipeline);r.exports.connect=makeDispatcher(g.connect);r.exports.upgrade=makeDispatcher(g.upgrade);r.exports.MockClient=E;r.exports.MockPool=C;r.exports.MockAgent=b;r.exports.mockErrors=v},72916:(r,i,a)=>{"use strict";const{InvalidArgumentError:s}=a(76291);const{kClients:l,kRunning:c,kClose:p,kDestroy:d,kDispatch:u,kInterceptors:A}=a(31915);const h=a(36228);const g=a(94427);const y=a(55179);const E=a(94766);const b=a(76459);const{WeakRef:C,FinalizationRegistry:v}=a(17428)();const B=Symbol("onConnect");const I=Symbol("onDisconnect");const w=Symbol("onConnectionError");const S=Symbol("maxRedirections");const Q=Symbol("onDrain");const x=Symbol("factory");const N=Symbol("finalizer");const R=Symbol("options");function defaultFactory(r,i){return i&&i.connections===1?new y(r,i):new g(r,i)}class Agent extends h{constructor({factory:r=defaultFactory,maxRedirections:i=0,connect:a,...c}={}){super();if(typeof r!=="function"){throw new s("factory must be a function.")}if(a!=null&&typeof a!=="function"&&typeof a!=="object"){throw new s("connect must be a function or an object")}if(!Number.isInteger(i)||i<0){throw new s("maxRedirections must be a positive number")}if(a&&typeof a!=="function"){a={...a}}this[A]=c.interceptors&&c.interceptors.Agent&&Array.isArray(c.interceptors.Agent)?c.interceptors.Agent:[b({maxRedirections:i})];this[R]={...E.deepClone(c),connect:a};this[R].interceptors=c.interceptors?{...c.interceptors}:undefined;this[S]=i;this[x]=r;this[l]=new Map;this[N]=new v((r=>{const i=this[l].get(r);if(i!==undefined&&i.deref()===undefined){this[l].delete(r)}}));const p=this;this[Q]=(r,i)=>{p.emit("drain",r,[p,...i])};this[B]=(r,i)=>{p.emit("connect",r,[p,...i])};this[I]=(r,i,a)=>{p.emit("disconnect",r,[p,...i],a)};this[w]=(r,i,a)=>{p.emit("connectionError",r,[p,...i],a)}}get[c](){let r=0;for(const i of this[l].values()){const a=i.deref();if(a){r+=a[c]}}return r}[u](r,i){let a;if(r.origin&&(typeof r.origin==="string"||r.origin instanceof URL)){a=String(r.origin)}else{throw new s("opts.origin must be a non-empty string or URL.")}const c=this[l].get(a);let p=c?c.deref():null;if(!p){p=this[x](r.origin,this[R]).on("drain",this[Q]).on("connect",this[B]).on("disconnect",this[I]).on("connectionError",this[w]);this[l].set(a,new C(p));this[N].register(p,a)}return p.dispatch(r,i)}async[p](){const r=[];for(const i of this[l].values()){const a=i.deref();if(a){r.push(a.close())}}await Promise.all(r)}async[d](r){const i=[];for(const a of this[l].values()){const s=a.deref();if(s){i.push(s.destroy(r))}}await Promise.all(i)}}r.exports=Agent},71796:(r,i,a)=>{const{addAbortListener:s}=a(94766);const{RequestAbortedError:l}=a(76291);const c=Symbol("kListener");const p=Symbol("kSignal");function abort(r){if(r.abort){r.abort()}else{r.onError(new l)}}function addSignal(r,i){r[p]=null;r[c]=null;if(!i){return}if(i.aborted){abort(r);return}r[p]=i;r[c]=()=>{abort(r)};s(r[p],r[c])}function removeSignal(r){if(!r[p]){return}if("removeEventListener"in r[p]){r[p].removeEventListener("abort",r[c])}else{r[p].removeListener("abort",r[c])}r[p]=null;r[c]=null}r.exports={addSignal:addSignal,removeSignal:removeSignal}},12770:(r,i,a)=>{"use strict";const{AsyncResource:s}=a(50852);const{InvalidArgumentError:l,RequestAbortedError:c,SocketError:p}=a(76291);const d=a(94766);const{addSignal:u,removeSignal:A}=a(71796);class ConnectHandler extends s{constructor(r,i){if(!r||typeof r!=="object"){throw new l("invalid opts")}if(typeof i!=="function"){throw new l("invalid callback")}const{signal:a,opaque:s,responseHeaders:c}=r;if(a&&typeof a.on!=="function"&&typeof a.addEventListener!=="function"){throw new l("signal must be an EventEmitter or EventTarget")}super("UNDICI_CONNECT");this.opaque=s||null;this.responseHeaders=c||null;this.callback=i;this.abort=null;u(this,a)}onConnect(r,i){if(!this.callback){throw new c}this.abort=r;this.context=i}onHeaders(){throw new p("bad connect",null)}onUpgrade(r,i,a){const{callback:s,opaque:l,context:c}=this;A(this);this.callback=null;let p=i;if(p!=null){p=this.responseHeaders==="raw"?d.parseRawHeaders(i):d.parseHeaders(i)}this.runInAsyncScope(s,null,null,{statusCode:r,headers:p,socket:a,opaque:l,context:c})}onError(r){const{callback:i,opaque:a}=this;A(this);if(i){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(i,null,r,{opaque:a})}))}}}function connect(r,i){if(i===undefined){return new Promise(((i,a)=>{connect.call(this,r,((r,s)=>r?a(r):i(s)))}))}try{const a=new ConnectHandler(r,i);this.dispatch({...r,method:"CONNECT"},a)}catch(a){if(typeof i!=="function"){throw a}const s=r&&r.opaque;queueMicrotask((()=>i(a,{opaque:s})))}}r.exports=connect},73624:(r,i,a)=>{"use strict";const{Readable:s,Duplex:l,PassThrough:c}=a(12781);const{InvalidArgumentError:p,InvalidReturnValueError:d,RequestAbortedError:u}=a(76291);const A=a(94766);const{AsyncResource:h}=a(50852);const{addSignal:g,removeSignal:y}=a(71796);const E=a(39491);const b=Symbol("resume");class PipelineRequest extends s{constructor(){super({autoDestroy:true});this[b]=null}_read(){const{[b]:r}=this;if(r){this[b]=null;r()}}_destroy(r,i){this._read();i(r)}}class PipelineResponse extends s{constructor(r){super({autoDestroy:true});this[b]=r}_read(){this[b]()}_destroy(r,i){if(!r&&!this._readableState.endEmitted){r=new u}i(r)}}class PipelineHandler extends h{constructor(r,i){if(!r||typeof r!=="object"){throw new p("invalid opts")}if(typeof i!=="function"){throw new p("invalid handler")}const{signal:a,method:s,opaque:c,onInfo:d,responseHeaders:h}=r;if(a&&typeof a.on!=="function"&&typeof a.addEventListener!=="function"){throw new p("signal must be an EventEmitter or EventTarget")}if(s==="CONNECT"){throw new p("invalid method")}if(d&&typeof d!=="function"){throw new p("invalid onInfo callback")}super("UNDICI_PIPELINE");this.opaque=c||null;this.responseHeaders=h||null;this.handler=i;this.abort=null;this.context=null;this.onInfo=d||null;this.req=(new PipelineRequest).on("error",A.nop);this.ret=new l({readableObjectMode:r.objectMode,autoDestroy:true,read:()=>{const{body:r}=this;if(r&&r.resume){r.resume()}},write:(r,i,a)=>{const{req:s}=this;if(s.push(r,i)||s._readableState.destroyed){a()}else{s[b]=a}},destroy:(r,i)=>{const{body:a,req:s,res:l,ret:c,abort:p}=this;if(!r&&!c._readableState.endEmitted){r=new u}if(p&&r){p()}A.destroy(a,r);A.destroy(s,r);A.destroy(l,r);y(this);i(r)}}).on("prefinish",(()=>{const{req:r}=this;r.push(null)}));this.res=null;g(this,a)}onConnect(r,i){const{ret:a,res:s}=this;E(!s,"pipeline cannot be retried");if(a.destroyed){throw new u}this.abort=r;this.context=i}onHeaders(r,i,a){const{opaque:s,handler:l,context:c}=this;if(r<200){if(this.onInfo){const a=this.responseHeaders==="raw"?A.parseRawHeaders(i):A.parseHeaders(i);this.onInfo({statusCode:r,headers:a})}return}this.res=new PipelineResponse(a);let p;try{this.handler=null;const a=this.responseHeaders==="raw"?A.parseRawHeaders(i):A.parseHeaders(i);p=this.runInAsyncScope(l,null,{statusCode:r,headers:a,opaque:s,body:this.res,context:c})}catch(r){this.res.on("error",A.nop);throw r}if(!p||typeof p.on!=="function"){throw new d("expected Readable")}p.on("data",(r=>{const{ret:i,body:a}=this;if(!i.push(r)&&a.pause){a.pause()}})).on("error",(r=>{const{ret:i}=this;A.destroy(i,r)})).on("end",(()=>{const{ret:r}=this;r.push(null)})).on("close",(()=>{const{ret:r}=this;if(!r._readableState.ended){A.destroy(r,new u)}}));this.body=p}onData(r){const{res:i}=this;return i.push(r)}onComplete(r){const{res:i}=this;i.push(null)}onError(r){const{ret:i}=this;this.handler=null;A.destroy(i,r)}}function pipeline(r,i){try{const a=new PipelineHandler(r,i);this.dispatch({...r,body:a.req},a);return a.ret}catch(r){return(new c).destroy(r)}}r.exports=pipeline},3860:(r,i,a)=>{"use strict";const s=a(56200);const{InvalidArgumentError:l,RequestAbortedError:c}=a(76291);const p=a(94766);const{getResolveErrorBodyCallback:d}=a(64904);const{AsyncResource:u}=a(50852);const{addSignal:A,removeSignal:h}=a(71796);class RequestHandler extends u{constructor(r,i){if(!r||typeof r!=="object"){throw new l("invalid opts")}const{signal:a,method:s,opaque:c,body:d,onInfo:u,responseHeaders:h,throwOnError:g,highWaterMark:y}=r;try{if(typeof i!=="function"){throw new l("invalid callback")}if(y&&(typeof y!=="number"||y<0)){throw new l("invalid highWaterMark")}if(a&&typeof a.on!=="function"&&typeof a.addEventListener!=="function"){throw new l("signal must be an EventEmitter or EventTarget")}if(s==="CONNECT"){throw new l("invalid method")}if(u&&typeof u!=="function"){throw new l("invalid onInfo callback")}super("UNDICI_REQUEST")}catch(r){if(p.isStream(d)){p.destroy(d.on("error",p.nop),r)}throw r}this.responseHeaders=h||null;this.opaque=c||null;this.callback=i;this.res=null;this.abort=null;this.body=d;this.trailers={};this.context=null;this.onInfo=u||null;this.throwOnError=g;this.highWaterMark=y;if(p.isStream(d)){d.on("error",(r=>{this.onError(r)}))}A(this,a)}onConnect(r,i){if(!this.callback){throw new c}this.abort=r;this.context=i}onHeaders(r,i,a,l){const{callback:c,opaque:u,abort:A,context:h,responseHeaders:g,highWaterMark:y}=this;const E=g==="raw"?p.parseRawHeaders(i):p.parseHeaders(i);if(r<200){if(this.onInfo){this.onInfo({statusCode:r,headers:E})}return}const b=g==="raw"?p.parseHeaders(i):E;const C=b["content-type"];const v=new s({resume:a,abort:A,contentType:C,highWaterMark:y});this.callback=null;this.res=v;if(c!==null){if(this.throwOnError&&r>=400){this.runInAsyncScope(d,null,{callback:c,body:v,contentType:C,statusCode:r,statusMessage:l,headers:E})}else{this.runInAsyncScope(c,null,null,{statusCode:r,headers:E,trailers:this.trailers,opaque:u,body:v,context:h})}}}onData(r){const{res:i}=this;return i.push(r)}onComplete(r){const{res:i}=this;h(this);p.parseHeaders(r,this.trailers);i.push(null)}onError(r){const{res:i,callback:a,body:s,opaque:l}=this;h(this);if(a){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(a,null,r,{opaque:l})}))}if(i){this.res=null;queueMicrotask((()=>{p.destroy(i,r)}))}if(s){this.body=null;p.destroy(s,r)}}}function request(r,i){if(i===undefined){return new Promise(((i,a)=>{request.call(this,r,((r,s)=>r?a(r):i(s)))}))}try{this.dispatch(r,new RequestHandler(r,i))}catch(a){if(typeof i!=="function"){throw a}const s=r&&r.opaque;queueMicrotask((()=>i(a,{opaque:s})))}}r.exports=request;r.exports.RequestHandler=RequestHandler},2932:(r,i,a)=>{"use strict";const{finished:s,PassThrough:l}=a(12781);const{InvalidArgumentError:c,InvalidReturnValueError:p,RequestAbortedError:d}=a(76291);const u=a(94766);const{getResolveErrorBodyCallback:A}=a(64904);const{AsyncResource:h}=a(50852);const{addSignal:g,removeSignal:y}=a(71796);class StreamHandler extends h{constructor(r,i,a){if(!r||typeof r!=="object"){throw new c("invalid opts")}const{signal:s,method:l,opaque:p,body:d,onInfo:A,responseHeaders:h,throwOnError:y}=r;try{if(typeof a!=="function"){throw new c("invalid callback")}if(typeof i!=="function"){throw new c("invalid factory")}if(s&&typeof s.on!=="function"&&typeof s.addEventListener!=="function"){throw new c("signal must be an EventEmitter or EventTarget")}if(l==="CONNECT"){throw new c("invalid method")}if(A&&typeof A!=="function"){throw new c("invalid onInfo callback")}super("UNDICI_STREAM")}catch(r){if(u.isStream(d)){u.destroy(d.on("error",u.nop),r)}throw r}this.responseHeaders=h||null;this.opaque=p||null;this.factory=i;this.callback=a;this.res=null;this.abort=null;this.context=null;this.trailers=null;this.body=d;this.onInfo=A||null;this.throwOnError=y||false;if(u.isStream(d)){d.on("error",(r=>{this.onError(r)}))}g(this,s)}onConnect(r,i){if(!this.callback){throw new d}this.abort=r;this.context=i}onHeaders(r,i,a,c){const{factory:d,opaque:h,context:g,callback:y,responseHeaders:E}=this;const b=E==="raw"?u.parseRawHeaders(i):u.parseHeaders(i);if(r<200){if(this.onInfo){this.onInfo({statusCode:r,headers:b})}return}this.factory=null;let C;if(this.throwOnError&&r>=400){const a=E==="raw"?u.parseHeaders(i):b;const s=a["content-type"];C=new l;this.callback=null;this.runInAsyncScope(A,null,{callback:y,body:C,contentType:s,statusCode:r,statusMessage:c,headers:b})}else{if(d===null){return}C=this.runInAsyncScope(d,null,{statusCode:r,headers:b,opaque:h,context:g});if(!C||typeof C.write!=="function"||typeof C.end!=="function"||typeof C.on!=="function"){throw new p("expected Writable")}s(C,{readable:false},(r=>{const{callback:i,res:a,opaque:s,trailers:l,abort:c}=this;this.res=null;if(r||!a.readable){u.destroy(a,r)}this.callback=null;this.runInAsyncScope(i,null,r||null,{opaque:s,trailers:l});if(r){c()}}))}C.on("drain",a);this.res=C;const v=C.writableNeedDrain!==undefined?C.writableNeedDrain:C._writableState&&C._writableState.needDrain;return v!==true}onData(r){const{res:i}=this;return i?i.write(r):true}onComplete(r){const{res:i}=this;y(this);if(!i){return}this.trailers=u.parseHeaders(r);i.end()}onError(r){const{res:i,callback:a,opaque:s,body:l}=this;y(this);this.factory=null;if(i){this.res=null;u.destroy(i,r)}else if(a){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(a,null,r,{opaque:s})}))}if(l){this.body=null;u.destroy(l,r)}}}function stream(r,i,a){if(a===undefined){return new Promise(((a,s)=>{stream.call(this,r,i,((r,i)=>r?s(r):a(i)))}))}try{this.dispatch(r,new StreamHandler(r,i,a))}catch(i){if(typeof a!=="function"){throw i}const s=r&&r.opaque;queueMicrotask((()=>a(i,{opaque:s})))}}r.exports=stream},44273:(r,i,a)=>{"use strict";const{InvalidArgumentError:s,RequestAbortedError:l,SocketError:c}=a(76291);const{AsyncResource:p}=a(50852);const d=a(94766);const{addSignal:u,removeSignal:A}=a(71796);const h=a(39491);class UpgradeHandler extends p{constructor(r,i){if(!r||typeof r!=="object"){throw new s("invalid opts")}if(typeof i!=="function"){throw new s("invalid callback")}const{signal:a,opaque:l,responseHeaders:c}=r;if(a&&typeof a.on!=="function"&&typeof a.addEventListener!=="function"){throw new s("signal must be an EventEmitter or EventTarget")}super("UNDICI_UPGRADE");this.responseHeaders=c||null;this.opaque=l||null;this.callback=i;this.abort=null;this.context=null;u(this,a)}onConnect(r,i){if(!this.callback){throw new l}this.abort=r;this.context=null}onHeaders(){throw new c("bad upgrade",null)}onUpgrade(r,i,a){const{callback:s,opaque:l,context:c}=this;h.strictEqual(r,101);A(this);this.callback=null;const p=this.responseHeaders==="raw"?d.parseRawHeaders(i):d.parseHeaders(i);this.runInAsyncScope(s,null,null,{headers:p,socket:a,opaque:l,context:c})}onError(r){const{callback:i,opaque:a}=this;A(this);if(i){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(i,null,r,{opaque:a})}))}}}function upgrade(r,i){if(i===undefined){return new Promise(((i,a)=>{upgrade.call(this,r,((r,s)=>r?a(r):i(s)))}))}try{const a=new UpgradeHandler(r,i);this.dispatch({...r,method:r.method||"GET",upgrade:r.protocol||"Websocket"},a)}catch(a){if(typeof i!=="function"){throw a}const s=r&&r.opaque;queueMicrotask((()=>i(a,{opaque:s})))}}r.exports=upgrade},92747:(r,i,a)=>{"use strict";r.exports.request=a(3860);r.exports.stream=a(2932);r.exports.pipeline=a(73624);r.exports.upgrade=a(44273);r.exports.connect=a(12770)},56200:(r,i,a)=>{"use strict";const s=a(39491);const{Readable:l}=a(12781);const{RequestAbortedError:c,NotSupportedError:p,InvalidArgumentError:d}=a(76291);const u=a(94766);const{ReadableStreamFrom:A,toUSVString:h}=a(94766);let g;const y=Symbol("kConsume");const E=Symbol("kReading");const b=Symbol("kBody");const C=Symbol("abort");const v=Symbol("kContentType");const noop=()=>{};r.exports=class BodyReadable extends l{constructor({resume:r,abort:i,contentType:a="",highWaterMark:s=64*1024}){super({autoDestroy:true,read:r,highWaterMark:s});this._readableState.dataEmitted=false;this[C]=i;this[y]=null;this[b]=null;this[v]=a;this[E]=false}destroy(r){if(this.destroyed){return this}if(!r&&!this._readableState.endEmitted){r=new c}if(r){this[C]()}return super.destroy(r)}emit(r,...i){if(r==="data"){this._readableState.dataEmitted=true}else if(r==="error"){this._readableState.errorEmitted=true}return super.emit(r,...i)}on(r,...i){if(r==="data"||r==="readable"){this[E]=true}return super.on(r,...i)}addListener(r,...i){return this.on(r,...i)}off(r,...i){const a=super.off(r,...i);if(r==="data"||r==="readable"){this[E]=this.listenerCount("data")>0||this.listenerCount("readable")>0}return a}removeListener(r,...i){return this.off(r,...i)}push(r){if(this[y]&&r!==null&&this.readableLength===0){consumePush(this[y],r);return this[E]?super.push(r):true}return super.push(r)}async text(){return consume(this,"text")}async json(){return consume(this,"json")}async blob(){return consume(this,"blob")}async arrayBuffer(){return consume(this,"arrayBuffer")}async formData(){throw new p}get bodyUsed(){return u.isDisturbed(this)}get body(){if(!this[b]){this[b]=A(this);if(this[y]){this[b].getReader();s(this[b].locked)}}return this[b]}dump(r){let i=r&&Number.isFinite(r.limit)?r.limit:262144;const a=r&&r.signal;if(a){try{if(typeof a!=="object"||!("aborted"in a)){throw new d("signal must be an AbortSignal")}u.throwIfAborted(a)}catch(r){return Promise.reject(r)}}if(this.closed){return Promise.resolve(null)}return new Promise(((r,s)=>{const l=a?u.addAbortListener(a,(()=>{this.destroy()})):noop;this.on("close",(function(){l();if(a&&a.aborted){s(a.reason||Object.assign(new Error("The operation was aborted"),{name:"AbortError"}))}else{r(null)}})).on("error",noop).on("data",(function(r){i-=r.length;if(i<=0){this.destroy()}})).resume()}))}};function isLocked(r){return r[b]&&r[b].locked===true||r[y]}function isUnusable(r){return u.isDisturbed(r)||isLocked(r)}async function consume(r,i){if(isUnusable(r)){throw new TypeError("unusable")}s(!r[y]);return new Promise(((a,s)=>{r[y]={type:i,stream:r,resolve:a,reject:s,length:0,body:[]};r.on("error",(function(r){consumeFinish(this[y],r)})).on("close",(function(){if(this[y].body!==null){consumeFinish(this[y],new c)}}));process.nextTick(consumeStart,r[y])}))}function consumeStart(r){if(r.body===null){return}const{_readableState:i}=r.stream;for(const a of i.buffer){consumePush(r,a)}if(i.endEmitted){consumeEnd(this[y])}else{r.stream.on("end",(function(){consumeEnd(this[y])}))}r.stream.resume();while(r.stream.read()!=null){}}function consumeEnd(r){const{type:i,body:s,resolve:l,stream:c,length:p}=r;try{if(i==="text"){l(h(Buffer.concat(s)))}else if(i==="json"){l(JSON.parse(Buffer.concat(s)))}else if(i==="arrayBuffer"){const r=new Uint8Array(p);let i=0;for(const a of s){r.set(a,i);i+=a.byteLength}l(r.buffer)}else if(i==="blob"){if(!g){g=a(14300).Blob}l(new g(s,{type:c[v]}))}consumeFinish(r)}catch(r){c.destroy(r)}}function consumePush(r,i){r.length+=i.length;r.body.push(i)}function consumeFinish(r,i){if(r.body===null){return}if(i){r.reject(i)}else{r.resolve()}r.type=null;r.stream=null;r.resolve=null;r.reject=null;r.length=0;r.body=null}},64904:(r,i,a)=>{const s=a(39491);const{ResponseStatusCodeError:l}=a(76291);const{toUSVString:c}=a(94766);async function getResolveErrorBodyCallback({callback:r,body:i,contentType:a,statusCode:p,statusMessage:d,headers:u}){s(i);let A=[];let h=0;for await(const r of i){A.push(r);h+=r.length;if(h>128*1024){A=null;break}}if(p===204||!a||!A){process.nextTick(r,new l(`Response status code ${p}${d?`: ${d}`:""}`,p,u));return}try{if(a.startsWith("application/json")){const i=JSON.parse(c(Buffer.concat(A)));process.nextTick(r,new l(`Response status code ${p}${d?`: ${d}`:""}`,p,u,i));return}if(a.startsWith("text/")){const i=c(Buffer.concat(A));process.nextTick(r,new l(`Response status code ${p}${d?`: ${d}`:""}`,p,u,i));return}}catch(r){}process.nextTick(r,new l(`Response status code ${p}${d?`: ${d}`:""}`,p,u))}r.exports={getResolveErrorBodyCallback:getResolveErrorBodyCallback}},85678:(r,i,a)=>{"use strict";const{BalancedPoolMissingUpstreamError:s,InvalidArgumentError:l}=a(76291);const{PoolBase:c,kClients:p,kNeedDrain:d,kAddClient:u,kRemoveClient:A,kGetDispatcher:h}=a(52673);const g=a(94427);const{kUrl:y,kInterceptors:E}=a(31915);const{parseOrigin:b}=a(94766);const C=Symbol("factory");const v=Symbol("options");const B=Symbol("kGreatestCommonDivisor");const I=Symbol("kCurrentWeight");const w=Symbol("kIndex");const S=Symbol("kWeight");const Q=Symbol("kMaxWeightPerServer");const x=Symbol("kErrorPenalty");function getGreatestCommonDivisor(r,i){if(i===0)return r;return getGreatestCommonDivisor(i,r%i)}function defaultFactory(r,i){return new g(r,i)}class BalancedPool extends c{constructor(r=[],{factory:i=defaultFactory,...a}={}){super();this[v]=a;this[w]=-1;this[I]=0;this[Q]=this[v].maxWeightPerServer||100;this[x]=this[v].errorPenalty||15;if(!Array.isArray(r)){r=[r]}if(typeof i!=="function"){throw new l("factory must be a function.")}this[E]=a.interceptors&&a.interceptors.BalancedPool&&Array.isArray(a.interceptors.BalancedPool)?a.interceptors.BalancedPool:[];this[C]=i;for(const i of r){this.addUpstream(i)}this._updateBalancedPoolStats()}addUpstream(r){const i=b(r).origin;if(this[p].find((r=>r[y].origin===i&&r.closed!==true&&r.destroyed!==true))){return this}const a=this[C](i,Object.assign({},this[v]));this[u](a);a.on("connect",(()=>{a[S]=Math.min(this[Q],a[S]+this[x])}));a.on("connectionError",(()=>{a[S]=Math.max(1,a[S]-this[x]);this._updateBalancedPoolStats()}));a.on("disconnect",((...r)=>{const i=r[2];if(i&&i.code==="UND_ERR_SOCKET"){a[S]=Math.max(1,a[S]-this[x]);this._updateBalancedPoolStats()}}));for(const r of this[p]){r[S]=this[Q]}this._updateBalancedPoolStats();return this}_updateBalancedPoolStats(){this[B]=this[p].map((r=>r[S])).reduce(getGreatestCommonDivisor,0)}removeUpstream(r){const i=b(r).origin;const a=this[p].find((r=>r[y].origin===i&&r.closed!==true&&r.destroyed!==true));if(a){this[A](a)}return this}get upstreams(){return this[p].filter((r=>r.closed!==true&&r.destroyed!==true)).map((r=>r[y].origin))}[h](){if(this[p].length===0){throw new s}const r=this[p].find((r=>!r[d]&&r.closed!==true&&r.destroyed!==true));if(!r){return}const i=this[p].map((r=>r[d])).reduce(((r,i)=>r&&i),true);if(i){return}let a=0;let l=this[p].findIndex((r=>!r[d]));while(a++this[p][l][S]&&!r[d]){l=this[w]}if(this[w]===0){this[I]=this[I]-this[B];if(this[I]<=0){this[I]=this[Q]}}if(r[S]>=this[I]&&!r[d]){return r}}this[I]=this[p][l][S];this[w]=l;return this[p][l]}}r.exports=BalancedPool},89385:(r,i,a)=>{"use strict";const{kConstruct:s}=a(23450);const{urlEquals:l,fieldValues:c}=a(8581);const{kEnumerableProperty:p,isDisturbed:d}=a(94766);const{kHeadersList:u}=a(31915);const{webidl:A}=a(87591);const{Response:h,cloneResponse:g}=a(55032);const{Request:y}=a(11287);const{kState:E,kHeaders:b,kGuard:C,kRealm:v}=a(9411);const{fetching:B}=a(79890);const{urlIsHttpHttpsScheme:I,createDeferredPromise:w,readAllBytes:S}=a(40336);const Q=a(39491);const{getGlobalDispatcher:x}=a(18826);class Cache{#e;constructor(){if(arguments[0]!==s){A.illegalConstructor()}this.#e=arguments[1]}async match(r,i={}){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.match"});r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);const a=await this.matchAll(r,i);if(a.length===0){return}return a[0]}async matchAll(r=undefined,i={}){A.brandCheck(this,Cache);if(r!==undefined)r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);let a=null;if(r!==undefined){if(r instanceof y){a=r[E];if(a.method!=="GET"&&!i.ignoreMethod){return[]}}else if(typeof r==="string"){a=new y(r)[E]}}const s=[];if(r===undefined){for(const r of this.#e){s.push(r[1])}}else{const r=this.#t(a,i);for(const i of r){s.push(i[1])}}const l=[];for(const r of s){const i=new h(r.body?.source??null);const a=i[E].body;i[E]=r;i[E].body=a;i[b][u]=r.headersList;i[b][C]="immutable";l.push(i)}return Object.freeze(l)}async add(r){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.add"});r=A.converters.RequestInfo(r);const i=[r];const a=this.addAll(i);return await a}async addAll(r){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.addAll"});r=A.converters["sequence"](r);const i=[];const a=[];for(const i of r){if(typeof i==="string"){continue}const r=i[E];if(!I(r.url)||r.method!=="GET"){throw A.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}}const s=[];for(const l of r){const r=new y(l)[E];if(!I(r.url)){throw A.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."})}r.initiator="fetch";r.destination="subresource";a.push(r);const p=w();s.push(B({request:r,dispatcher:x(),processResponse(r){if(r.type==="error"||r.status===206||r.status<200||r.status>299){p.reject(A.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}))}else if(r.headersList.contains("vary")){const i=c(r.headersList.get("vary"));for(const r of i){if(r==="*"){p.reject(A.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(const r of s){r.abort()}return}}}},processResponseEndOfBody(r){if(r.aborted){p.reject(new DOMException("aborted","AbortError"));return}p.resolve(r)}}));i.push(p.promise)}const l=Promise.all(i);const p=await l;const d=[];let u=0;for(const r of p){const i={type:"put",request:a[u],response:r};d.push(i);u++}const h=w();let g=null;try{this.#r(d)}catch(r){g=r}queueMicrotask((()=>{if(g===null){h.resolve(undefined)}else{h.reject(g)}}));return h.promise}async put(r,i){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,2,{header:"Cache.put"});r=A.converters.RequestInfo(r);i=A.converters.Response(i);let a=null;if(r instanceof y){a=r[E]}else{a=new y(r)[E]}if(!I(a.url)||a.method!=="GET"){throw A.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"})}const s=i[E];if(s.status===206){throw A.errors.exception({header:"Cache.put",message:"Got 206 status"})}if(s.headersList.contains("vary")){const r=c(s.headersList.get("vary"));for(const i of r){if(i==="*"){throw A.errors.exception({header:"Cache.put",message:"Got * vary field value"})}}}if(s.body&&(d(s.body.stream)||s.body.stream.locked)){throw A.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"})}const l=g(s);const p=w();if(s.body!=null){const r=s.body.stream;const i=r.getReader();S(i).then(p.resolve,p.reject)}else{p.resolve(undefined)}const u=[];const h={type:"put",request:a,response:l};u.push(h);const b=await p.promise;if(l.body!=null){l.body.source=b}const C=w();let v=null;try{this.#r(u)}catch(r){v=r}queueMicrotask((()=>{if(v===null){C.resolve()}else{C.reject(v)}}));return C.promise}async delete(r,i={}){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.delete"});r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);let a=null;if(r instanceof y){a=r[E];if(a.method!=="GET"&&!i.ignoreMethod){return false}}else{Q(typeof r==="string");a=new y(r)[E]}const s=[];const l={type:"delete",request:a,options:i};s.push(l);const c=w();let p=null;let d;try{d=this.#r(s)}catch(r){p=r}queueMicrotask((()=>{if(p===null){c.resolve(!!d?.length)}else{c.reject(p)}}));return c.promise}async keys(r=undefined,i={}){A.brandCheck(this,Cache);if(r!==undefined)r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);let a=null;if(r!==undefined){if(r instanceof y){a=r[E];if(a.method!=="GET"&&!i.ignoreMethod){return[]}}else if(typeof r==="string"){a=new y(r)[E]}}const s=w();const l=[];if(r===undefined){for(const r of this.#e){l.push(r[0])}}else{const r=this.#t(a,i);for(const i of r){l.push(i[0])}}queueMicrotask((()=>{const r=[];for(const i of l){const a=new y("https://a");a[E]=i;a[b][u]=i.headersList;a[b][C]="immutable";a[v]=i.client;r.push(a)}s.resolve(Object.freeze(r))}));return s.promise}#r(r){const i=this.#e;const a=[...i];const s=[];const l=[];try{for(const a of r){if(a.type!=="delete"&&a.type!=="put"){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'})}if(a.type==="delete"&&a.response!=null){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"})}if(this.#t(a.request,a.options,s).length){throw new DOMException("???","InvalidStateError")}let r;if(a.type==="delete"){r=this.#t(a.request,a.options);if(r.length===0){return[]}for(const a of r){const r=i.indexOf(a);Q(r!==-1);i.splice(r,1)}}else if(a.type==="put"){if(a.response==null){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"})}const l=a.request;if(!I(l.url)){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"})}if(l.method!=="GET"){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"})}if(a.options!=null){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"})}r=this.#t(a.request);for(const a of r){const r=i.indexOf(a);Q(r!==-1);i.splice(r,1)}i.push([a.request,a.response]);s.push([a.request,a.response])}l.push([a.request,a.response])}return l}catch(r){this.#e.length=0;this.#e=a;throw r}}#t(r,i,a){const s=[];const l=a??this.#e;for(const a of l){const[l,c]=a;if(this.#i(r,l,c,i)){s.push(a)}}return s}#i(r,i,a=null,s){const p=new URL(r.url);const d=new URL(i.url);if(s?.ignoreSearch){d.search="";p.search=""}if(!l(p,d,true)){return false}if(a==null||s?.ignoreVary||!a.headersList.contains("vary")){return true}const u=c(a.headersList.get("vary"));for(const a of u){if(a==="*"){return false}const s=i.headersList.get(a);const l=r.headersList.get(a);if(s!==l){return false}}return true}}Object.defineProperties(Cache.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:true},match:p,matchAll:p,add:p,addAll:p,put:p,delete:p,keys:p});const N=[{key:"ignoreSearch",converter:A.converters.boolean,defaultValue:false},{key:"ignoreMethod",converter:A.converters.boolean,defaultValue:false},{key:"ignoreVary",converter:A.converters.boolean,defaultValue:false}];A.converters.CacheQueryOptions=A.dictionaryConverter(N);A.converters.MultiCacheQueryOptions=A.dictionaryConverter([...N,{key:"cacheName",converter:A.converters.DOMString}]);A.converters.Response=A.interfaceConverter(h);A.converters["sequence"]=A.sequenceConverter(A.converters.RequestInfo);r.exports={Cache:Cache}},43425:(r,i,a)=>{"use strict";const{kConstruct:s}=a(23450);const{Cache:l}=a(89385);const{webidl:c}=a(87591);const{kEnumerableProperty:p}=a(94766);class CacheStorage{#n=new Map;constructor(){if(arguments[0]!==s){c.illegalConstructor()}}async match(r,i={}){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"});r=c.converters.RequestInfo(r);i=c.converters.MultiCacheQueryOptions(i);if(i.cacheName!=null){if(this.#n.has(i.cacheName)){const a=this.#n.get(i.cacheName);const c=new l(s,a);return await c.match(r,i)}}else{for(const a of this.#n.values()){const c=new l(s,a);const p=await c.match(r,i);if(p!==undefined){return p}}}}async has(r){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"});r=c.converters.DOMString(r);return this.#n.has(r)}async open(r){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"});r=c.converters.DOMString(r);if(this.#n.has(r)){const i=this.#n.get(r);return new l(s,i)}const i=[];this.#n.set(r,i);return new l(s,i)}async delete(r){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"});r=c.converters.DOMString(r);return this.#n.delete(r)}async keys(){c.brandCheck(this,CacheStorage);const r=this.#n.keys();return[...r]}}Object.defineProperties(CacheStorage.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:true},match:p,has:p,open:p,delete:p,keys:p});r.exports={CacheStorage:CacheStorage}},23450:(r,i,a)=>{"use strict";r.exports={kConstruct:a(31915).kConstruct}},8581:(r,i,a)=>{"use strict";const s=a(39491);const{URLSerializer:l}=a(80097);const{isValidHeaderName:c}=a(40336);function urlEquals(r,i,a=false){const s=l(r,a);const c=l(i,a);return s===c}function fieldValues(r){s(r!==null);const i=[];for(let a of r.split(",")){a=a.trim();if(!a.length){continue}else if(!c(a)){continue}i.push(a)}return i}r.exports={urlEquals:urlEquals,fieldValues:fieldValues}},55179:(r,i,a)=>{"use strict";const s=a(39491);const l=a(41808);const c=a(13685);const{pipeline:p}=a(12781);const d=a(94766);const u=a(90683);const A=a(50548);const h=a(36228);const{RequestContentLengthMismatchError:g,ResponseContentLengthMismatchError:y,InvalidArgumentError:E,RequestAbortedError:b,HeadersTimeoutError:C,HeadersOverflowError:v,SocketError:B,InformationalError:I,BodyTimeoutError:w,HTTPParserError:S,ResponseExceededMaxSizeError:Q,ClientDestroyedError:x}=a(76291);const N=a(98742);const{kUrl:R,kReset:T,kServerName:D,kClient:k,kBusy:_,kParser:O,kConnect:P,kBlocking:L,kResuming:M,kRunning:U,kPending:q,kSize:H,kWriting:j,kQueue:G,kConnected:z,kConnecting:V,kNeedDrain:J,kNoRef:Y,kKeepAliveDefaultTimeout:W,kHostHeader:X,kPendingIdx:K,kRunningIdx:$,kError:Z,kPipelining:ee,kSocket:te,kKeepAliveTimeoutValue:re,kMaxHeadersSize:ie,kKeepAliveMaxTimeout:ne,kKeepAliveTimeoutThreshold:ae,kHeadersTimeout:se,kBodyTimeout:oe,kStrictContentLength:le,kConnector:ce,kMaxRedirections:pe,kMaxRequests:de,kCounter:ue,kClose:Ae,kDestroy:me,kDispatch:fe,kInterceptors:he,kLocalAddress:ge,kMaxResponseSize:ye,kHTTPConnVersion:Ee,kHost:be,kHTTP2Session:Ce,kHTTP2SessionState:ve,kHTTP2BuildRequest:Be,kHTTP2CopyHeaders:Ie,kHTTP1BuildRequest:we}=a(31915);let Se;try{Se=a(85158)}catch{Se={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY:Qe,HTTP2_HEADER_METHOD:xe,HTTP2_HEADER_PATH:Ne,HTTP2_HEADER_SCHEME:Re,HTTP2_HEADER_CONTENT_LENGTH:Te,HTTP2_HEADER_EXPECT:De,HTTP2_HEADER_STATUS:ke}}=Se;let _e=false;const Oe=Buffer[Symbol.species];const Pe=Symbol("kClosedResolve");const Le={};try{const r=a(67643);Le.sendHeaders=r.channel("undici:client:sendHeaders");Le.beforeConnect=r.channel("undici:client:beforeConnect");Le.connectError=r.channel("undici:client:connectError");Le.connected=r.channel("undici:client:connected")}catch{Le.sendHeaders={hasSubscribers:false};Le.beforeConnect={hasSubscribers:false};Le.connectError={hasSubscribers:false};Le.connected={hasSubscribers:false}}class Client extends h{constructor(r,{interceptors:i,maxHeaderSize:a,headersTimeout:s,socketTimeout:p,requestTimeout:u,connectTimeout:A,bodyTimeout:h,idleTimeout:g,keepAlive:y,keepAliveTimeout:b,maxKeepAliveTimeout:C,keepAliveMaxTimeout:v,keepAliveTimeoutThreshold:B,socketPath:I,pipelining:w,tls:S,strictContentLength:Q,maxCachedSessions:x,maxRedirections:T,connect:k,maxRequestsPerClient:_,localAddress:O,maxResponseSize:P,autoSelectFamily:L,autoSelectFamilyAttemptTimeout:U,allowH2:q,maxConcurrentStreams:H}={}){super();if(y!==undefined){throw new E("unsupported keepAlive, use pipelining=0 instead")}if(p!==undefined){throw new E("unsupported socketTimeout, use headersTimeout & bodyTimeout instead")}if(u!==undefined){throw new E("unsupported requestTimeout, use headersTimeout & bodyTimeout instead")}if(g!==undefined){throw new E("unsupported idleTimeout, use keepAliveTimeout instead")}if(C!==undefined){throw new E("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead")}if(a!=null&&!Number.isFinite(a)){throw new E("invalid maxHeaderSize")}if(I!=null&&typeof I!=="string"){throw new E("invalid socketPath")}if(A!=null&&(!Number.isFinite(A)||A<0)){throw new E("invalid connectTimeout")}if(b!=null&&(!Number.isFinite(b)||b<=0)){throw new E("invalid keepAliveTimeout")}if(v!=null&&(!Number.isFinite(v)||v<=0)){throw new E("invalid keepAliveMaxTimeout")}if(B!=null&&!Number.isFinite(B)){throw new E("invalid keepAliveTimeoutThreshold")}if(s!=null&&(!Number.isInteger(s)||s<0)){throw new E("headersTimeout must be a positive integer or zero")}if(h!=null&&(!Number.isInteger(h)||h<0)){throw new E("bodyTimeout must be a positive integer or zero")}if(k!=null&&typeof k!=="function"&&typeof k!=="object"){throw new E("connect must be a function or an object")}if(T!=null&&(!Number.isInteger(T)||T<0)){throw new E("maxRedirections must be a positive number")}if(_!=null&&(!Number.isInteger(_)||_<0)){throw new E("maxRequestsPerClient must be a positive number")}if(O!=null&&(typeof O!=="string"||l.isIP(O)===0)){throw new E("localAddress must be valid string IP address")}if(P!=null&&(!Number.isInteger(P)||P<-1)){throw new E("maxResponseSize must be a positive number")}if(U!=null&&(!Number.isInteger(U)||U<-1)){throw new E("autoSelectFamilyAttemptTimeout must be a positive number")}if(q!=null&&typeof q!=="boolean"){throw new E("allowH2 must be a valid boolean value")}if(H!=null&&(typeof H!=="number"||H<1)){throw new E("maxConcurrentStreams must be a possitive integer, greater than 0")}if(typeof k!=="function"){k=N({...S,maxCachedSessions:x,allowH2:q,socketPath:I,timeout:A,...d.nodeHasAutoSelectFamily&&L?{autoSelectFamily:L,autoSelectFamilyAttemptTimeout:U}:undefined,...k})}this[he]=i&&i.Client&&Array.isArray(i.Client)?i.Client:[Fe({maxRedirections:T})];this[R]=d.parseOrigin(r);this[ce]=k;this[te]=null;this[ee]=w!=null?w:1;this[ie]=a||c.maxHeaderSize;this[W]=b==null?4e3:b;this[ne]=v==null?6e5:v;this[ae]=B==null?1e3:B;this[re]=this[W];this[D]=null;this[ge]=O!=null?O:null;this[M]=0;this[J]=0;this[X]=`host: ${this[R].hostname}${this[R].port?`:${this[R].port}`:""}\r\n`;this[oe]=h!=null?h:3e5;this[se]=s!=null?s:3e5;this[le]=Q==null?true:Q;this[pe]=T;this[de]=_;this[Pe]=null;this[ye]=P>-1?P:-1;this[Ee]="h1";this[Ce]=null;this[ve]=!q?null:{openStreams:0,maxConcurrentStreams:H!=null?H:100};this[be]=`${this[R].hostname}${this[R].port?`:${this[R].port}`:""}`;this[G]=[];this[$]=0;this[K]=0}get pipelining(){return this[ee]}set pipelining(r){this[ee]=r;resume(this,true)}get[q](){return this[G].length-this[K]}get[U](){return this[K]-this[$]}get[H](){return this[G].length-this[$]}get[z](){return!!this[te]&&!this[V]&&!this[te].destroyed}get[_](){const r=this[te];return r&&(r[T]||r[j]||r[L])||this[H]>=(this[ee]||1)||this[q]>0}[P](r){connect(this);this.once("connect",r)}[fe](r,i){const a=r.origin||this[R].origin;const s=this[Ee]==="h2"?A[Be](a,r,i):A[we](a,r,i);this[G].push(s);if(this[M]){}else if(d.bodyLength(s.body)==null&&d.isIterable(s.body)){this[M]=1;process.nextTick(resume,this)}else{resume(this,true)}if(this[M]&&this[J]!==2&&this[_]){this[J]=2}return this[J]<2}async[Ae](){return new Promise((r=>{if(!this[H]){r(null)}else{this[Pe]=r}}))}async[me](r){return new Promise((i=>{const a=this[G].splice(this[K]);for(let i=0;i{if(this[Pe]){this[Pe]();this[Pe]=null}i()};if(this[Ce]!=null){d.destroy(this[Ce],r);this[Ce]=null;this[ve]=null}if(!this[te]){queueMicrotask(callback)}else{d.destroy(this[te].on("close",callback),r)}resume(this)}))}}function onHttp2SessionError(r){s(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID");this[te][Z]=r;onError(this[k],r)}function onHttp2FrameError(r,i,a){const s=new I(`HTTP/2: "frameError" received - type ${r}, code ${i}`);if(a===0){this[te][Z]=s;onError(this[k],s)}}function onHttp2SessionEnd(){d.destroy(this,new B("other side closed"));d.destroy(this[te],new B("other side closed"))}function onHTTP2GoAway(r){const i=this[k];const a=new I(`HTTP/2: "GOAWAY" frame received with code ${r}`);i[te]=null;i[Ce]=null;if(i.destroyed){s(this[q]===0);const r=i[G].splice(i[$]);for(let i=0;i0){const r=i[G][i[$]];i[G][i[$]++]=null;errorRequest(i,r,a)}i[K]=i[$];s(i[U]===0);i.emit("disconnect",i[R],[i],a);resume(i)}const Me=a(83993);const Fe=a(76459);const Ue=Buffer.alloc(0);async function lazyllhttp(){const r=process.env.JEST_WORKER_ID?a(29702):undefined;let i;try{i=await WebAssembly.compile(Buffer.from(a(16594),"base64"))}catch(s){i=await WebAssembly.compile(Buffer.from(r||a(29702),"base64"))}return await WebAssembly.instantiate(i,{env:{wasm_on_url:(r,i,a)=>0,wasm_on_status:(r,i,a)=>{s.strictEqual(je.ptr,r);const l=i-Ve+Ge.byteOffset;return je.onStatus(new Oe(Ge.buffer,l,a))||0},wasm_on_message_begin:r=>{s.strictEqual(je.ptr,r);return je.onMessageBegin()||0},wasm_on_header_field:(r,i,a)=>{s.strictEqual(je.ptr,r);const l=i-Ve+Ge.byteOffset;return je.onHeaderField(new Oe(Ge.buffer,l,a))||0},wasm_on_header_value:(r,i,a)=>{s.strictEqual(je.ptr,r);const l=i-Ve+Ge.byteOffset;return je.onHeaderValue(new Oe(Ge.buffer,l,a))||0},wasm_on_headers_complete:(r,i,a,l)=>{s.strictEqual(je.ptr,r);return je.onHeadersComplete(i,Boolean(a),Boolean(l))||0},wasm_on_body:(r,i,a)=>{s.strictEqual(je.ptr,r);const l=i-Ve+Ge.byteOffset;return je.onBody(new Oe(Ge.buffer,l,a))||0},wasm_on_message_complete:r=>{s.strictEqual(je.ptr,r);return je.onMessageComplete()||0}}})}let qe=null;let He=lazyllhttp();He.catch();let je=null;let Ge=null;let ze=0;let Ve=null;const Je=1;const Ye=2;const We=3;class Parser{constructor(r,i,{exports:a}){s(Number.isFinite(r[ie])&&r[ie]>0);this.llhttp=a;this.ptr=this.llhttp.llhttp_alloc(Me.TYPE.RESPONSE);this.client=r;this.socket=i;this.timeout=null;this.timeoutValue=null;this.timeoutType=null;this.statusCode=null;this.statusText="";this.upgrade=false;this.headers=[];this.headersSize=0;this.headersMaxSize=r[ie];this.shouldKeepAlive=false;this.paused=false;this.resume=this.resume.bind(this);this.bytesRead=0;this.keepAlive="";this.contentLength="";this.connection="";this.maxResponseSize=r[ye]}setTimeout(r,i){this.timeoutType=i;if(r!==this.timeoutValue){u.clearTimeout(this.timeout);if(r){this.timeout=u.setTimeout(onParserTimeout,r,this);if(this.timeout.unref){this.timeout.unref()}}else{this.timeout=null}this.timeoutValue=r}else if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}}resume(){if(this.socket.destroyed||!this.paused){return}s(this.ptr!=null);s(je==null);this.llhttp.llhttp_resume(this.ptr);s(this.timeoutType===Ye);if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}this.paused=false;this.execute(this.socket.read()||Ue);this.readMore()}readMore(){while(!this.paused&&this.ptr){const r=this.socket.read();if(r===null){break}this.execute(r)}}execute(r){s(this.ptr!=null);s(je==null);s(!this.paused);const{socket:i,llhttp:a}=this;if(r.length>ze){if(Ve){a.free(Ve)}ze=Math.ceil(r.length/4096)*4096;Ve=a.malloc(ze)}new Uint8Array(a.memory.buffer,Ve,ze).set(r);try{let s;try{Ge=r;je=this;s=a.llhttp_execute(this.ptr,Ve,r.length)}catch(r){throw r}finally{je=null;Ge=null}const l=a.llhttp_get_error_pos(this.ptr)-Ve;if(s===Me.ERROR.PAUSED_UPGRADE){this.onUpgrade(r.slice(l))}else if(s===Me.ERROR.PAUSED){this.paused=true;i.unshift(r.slice(l))}else if(s!==Me.ERROR.OK){const i=a.llhttp_get_error_reason(this.ptr);let c="";if(i){const r=new Uint8Array(a.memory.buffer,i).indexOf(0);c="Response does not match the HTTP/1.1 protocol ("+Buffer.from(a.memory.buffer,i,r).toString()+")"}throw new S(c,Me.ERROR[s],r.slice(l))}}catch(r){d.destroy(i,r)}}destroy(){s(this.ptr!=null);s(je==null);this.llhttp.llhttp_free(this.ptr);this.ptr=null;u.clearTimeout(this.timeout);this.timeout=null;this.timeoutValue=null;this.timeoutType=null;this.paused=false}onStatus(r){this.statusText=r.toString()}onMessageBegin(){const{socket:r,client:i}=this;if(r.destroyed){return-1}const a=i[G][i[$]];if(!a){return-1}}onHeaderField(r){const i=this.headers.length;if((i&1)===0){this.headers.push(r)}else{this.headers[i-1]=Buffer.concat([this.headers[i-1],r])}this.trackHeader(r.length)}onHeaderValue(r){let i=this.headers.length;if((i&1)===1){this.headers.push(r);i+=1}else{this.headers[i-1]=Buffer.concat([this.headers[i-1],r])}const a=this.headers[i-2];if(a.length===10&&a.toString().toLowerCase()==="keep-alive"){this.keepAlive+=r.toString()}else if(a.length===10&&a.toString().toLowerCase()==="connection"){this.connection+=r.toString()}else if(a.length===14&&a.toString().toLowerCase()==="content-length"){this.contentLength+=r.toString()}this.trackHeader(r.length)}trackHeader(r){this.headersSize+=r;if(this.headersSize>=this.headersMaxSize){d.destroy(this.socket,new v)}}onUpgrade(r){const{upgrade:i,client:a,socket:l,headers:c,statusCode:p}=this;s(i);const u=a[G][a[$]];s(u);s(!l.destroyed);s(l===a[te]);s(!this.paused);s(u.upgrade||u.method==="CONNECT");this.statusCode=null;this.statusText="";this.shouldKeepAlive=null;s(this.headers.length%2===0);this.headers=[];this.headersSize=0;l.unshift(r);l[O].destroy();l[O]=null;l[k]=null;l[Z]=null;l.removeListener("error",onSocketError).removeListener("readable",onSocketReadable).removeListener("end",onSocketEnd).removeListener("close",onSocketClose);a[te]=null;a[G][a[$]++]=null;a.emit("disconnect",a[R],[a],new I("upgrade"));try{u.onUpgrade(p,c,l)}catch(r){d.destroy(l,r)}resume(a)}onHeadersComplete(r,i,a){const{client:l,socket:c,headers:p,statusText:u}=this;if(c.destroyed){return-1}const A=l[G][l[$]];if(!A){return-1}s(!this.upgrade);s(this.statusCode<200);if(r===100){d.destroy(c,new B("bad response",d.getSocketInfo(c)));return-1}if(i&&!A.upgrade){d.destroy(c,new B("bad upgrade",d.getSocketInfo(c)));return-1}s.strictEqual(this.timeoutType,Je);this.statusCode=r;this.shouldKeepAlive=a||A.method==="HEAD"&&!c[T]&&this.connection.toLowerCase()==="keep-alive";if(this.statusCode>=200){const r=A.bodyTimeout!=null?A.bodyTimeout:l[oe];this.setTimeout(r,Ye)}else if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}if(A.method==="CONNECT"){s(l[U]===1);this.upgrade=true;return 2}if(i){s(l[U]===1);this.upgrade=true;return 2}s(this.headers.length%2===0);this.headers=[];this.headersSize=0;if(this.shouldKeepAlive&&l[ee]){const r=this.keepAlive?d.parseKeepAliveTimeout(this.keepAlive):null;if(r!=null){const i=Math.min(r-l[ae],l[ne]);if(i<=0){c[T]=true}else{l[re]=i}}else{l[re]=l[W]}}else{c[T]=true}const h=A.onHeaders(r,p,this.resume,u)===false;if(A.aborted){return-1}if(A.method==="HEAD"){return 1}if(r<200){return 1}if(c[L]){c[L]=false;resume(l)}return h?Me.ERROR.PAUSED:0}onBody(r){const{client:i,socket:a,statusCode:l,maxResponseSize:c}=this;if(a.destroyed){return-1}const p=i[G][i[$]];s(p);s.strictEqual(this.timeoutType,Ye);if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}s(l>=200);if(c>-1&&this.bytesRead+r.length>c){d.destroy(a,new Q);return-1}this.bytesRead+=r.length;if(p.onData(r)===false){return Me.ERROR.PAUSED}}onMessageComplete(){const{client:r,socket:i,statusCode:a,upgrade:l,headers:c,contentLength:p,bytesRead:u,shouldKeepAlive:A}=this;if(i.destroyed&&(!a||A)){return-1}if(l){return}const h=r[G][r[$]];s(h);s(a>=100);this.statusCode=null;this.statusText="";this.bytesRead=0;this.contentLength="";this.keepAlive="";this.connection="";s(this.headers.length%2===0);this.headers=[];this.headersSize=0;if(a<200){return}if(h.method!=="HEAD"&&p&&u!==parseInt(p,10)){d.destroy(i,new y);return-1}h.onComplete(c);r[G][r[$]++]=null;if(i[j]){s.strictEqual(r[U],0);d.destroy(i,new I("reset"));return Me.ERROR.PAUSED}else if(!A){d.destroy(i,new I("reset"));return Me.ERROR.PAUSED}else if(i[T]&&r[U]===0){d.destroy(i,new I("reset"));return Me.ERROR.PAUSED}else if(r[ee]===1){setImmediate(resume,r)}else{resume(r)}}}function onParserTimeout(r){const{socket:i,timeoutType:a,client:l}=r;if(a===Je){if(!i[j]||i.writableNeedDrain||l[U]>1){s(!r.paused,"cannot be paused while waiting for headers");d.destroy(i,new C)}}else if(a===Ye){if(!r.paused){d.destroy(i,new w)}}else if(a===We){s(l[U]===0&&l[re]);d.destroy(i,new I("socket idle timeout"))}}function onSocketReadable(){const{[O]:r}=this;if(r){r.readMore()}}function onSocketError(r){const{[k]:i,[O]:a}=this;s(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID");if(i[Ee]!=="h2"){if(r.code==="ECONNRESET"&&a.statusCode&&!a.shouldKeepAlive){a.onMessageComplete();return}}this[Z]=r;onError(this[k],r)}function onError(r,i){if(r[U]===0&&i.code!=="UND_ERR_INFO"&&i.code!=="UND_ERR_SOCKET"){s(r[K]===r[$]);const a=r[G].splice(r[$]);for(let s=0;s0&&a.code!=="UND_ERR_INFO"){const i=r[G][r[$]];r[G][r[$]++]=null;errorRequest(r,i,a)}r[K]=r[$];s(r[U]===0);r.emit("disconnect",r[R],[r],a);resume(r)}async function connect(r){s(!r[V]);s(!r[te]);let{host:i,hostname:a,protocol:c,port:p}=r[R];if(a[0]==="["){const r=a.indexOf("]");s(r!==-1);const i=a.substring(1,r);s(l.isIP(i));a=i}r[V]=true;if(Le.beforeConnect.hasSubscribers){Le.beforeConnect.publish({connectParams:{host:i,hostname:a,protocol:c,port:p,servername:r[D],localAddress:r[ge]},connector:r[ce]})}try{const l=await new Promise(((s,l)=>{r[ce]({host:i,hostname:a,protocol:c,port:p,servername:r[D],localAddress:r[ge]},((r,i)=>{if(r){l(r)}else{s(i)}}))}));if(r.destroyed){d.destroy(l.on("error",(()=>{})),new x);return}r[V]=false;s(l);const u=l.alpnProtocol==="h2";if(u){if(!_e){_e=true;process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"})}const i=Se.connect(r[R],{createConnection:()=>l,peerMaxConcurrentStreams:r[ve].maxConcurrentStreams});r[Ee]="h2";i[k]=r;i[te]=l;i.on("error",onHttp2SessionError);i.on("frameError",onHttp2FrameError);i.on("end",onHttp2SessionEnd);i.on("goaway",onHTTP2GoAway);i.on("close",onSocketClose);i.unref();r[Ce]=i;l[Ce]=i}else{if(!qe){qe=await He;He=null}l[Y]=false;l[j]=false;l[T]=false;l[L]=false;l[O]=new Parser(r,l,qe)}l[ue]=0;l[de]=r[de];l[k]=r;l[Z]=null;l.on("error",onSocketError).on("readable",onSocketReadable).on("end",onSocketEnd).on("close",onSocketClose);r[te]=l;if(Le.connected.hasSubscribers){Le.connected.publish({connectParams:{host:i,hostname:a,protocol:c,port:p,servername:r[D],localAddress:r[ge]},connector:r[ce],socket:l})}r.emit("connect",r[R],[r])}catch(l){if(r.destroyed){return}r[V]=false;if(Le.connectError.hasSubscribers){Le.connectError.publish({connectParams:{host:i,hostname:a,protocol:c,port:p,servername:r[D],localAddress:r[ge]},connector:r[ce],error:l})}if(l.code==="ERR_TLS_CERT_ALTNAME_INVALID"){s(r[U]===0);while(r[q]>0&&r[G][r[K]].servername===r[D]){const i=r[G][r[K]++];errorRequest(r,i,l)}}else{onError(r,l)}r.emit("connectionError",r[R],[r],l)}resume(r)}function emitDrain(r){r[J]=0;r.emit("drain",r[R],[r])}function resume(r,i){if(r[M]===2){return}r[M]=2;_resume(r,i);r[M]=0;if(r[$]>256){r[G].splice(0,r[$]);r[K]-=r[$];r[$]=0}}function _resume(r,i){while(true){if(r.destroyed){s(r[q]===0);return}if(r[Pe]&&!r[H]){r[Pe]();r[Pe]=null;return}const a=r[te];if(a&&!a.destroyed&&a.alpnProtocol!=="h2"){if(r[H]===0){if(!a[Y]&&a.unref){a.unref();a[Y]=true}}else if(a[Y]&&a.ref){a.ref();a[Y]=false}if(r[H]===0){if(a[O].timeoutType!==We){a[O].setTimeout(r[re],We)}}else if(r[U]>0&&a[O].statusCode<200){if(a[O].timeoutType!==Je){const i=r[G][r[$]];const s=i.headersTimeout!=null?i.headersTimeout:r[se];a[O].setTimeout(s,Je)}}}if(r[_]){r[J]=2}else if(r[J]===2){if(i){r[J]=1;process.nextTick(emitDrain,r)}else{emitDrain(r)}continue}if(r[q]===0){return}if(r[U]>=(r[ee]||1)){return}const l=r[G][r[K]];if(r[R].protocol==="https:"&&r[D]!==l.servername){if(r[U]>0){return}r[D]=l.servername;if(a&&a.servername!==l.servername){d.destroy(a,new I("servername changed"));return}}if(r[V]){return}if(!a&&!r[Ce]){connect(r);return}if(a.destroyed||a[j]||a[T]||a[L]){return}if(r[U]>0&&!l.idempotent){return}if(r[U]>0&&(l.upgrade||l.method==="CONNECT")){return}if(r[U]>0&&d.bodyLength(l.body)!==0&&(d.isStream(l.body)||d.isAsyncIterable(l.body))){return}if(!l.aborted&&write(r,l)){r[K]++}else{r[G].splice(r[K],1)}}}function shouldSendContentLength(r){return r!=="GET"&&r!=="HEAD"&&r!=="OPTIONS"&&r!=="TRACE"&&r!=="CONNECT"}function write(r,i){if(r[Ee]==="h2"){writeH2(r,r[Ce],i);return}const{body:a,method:l,path:c,host:p,upgrade:u,headers:A,blocking:h,reset:y}=i;const E=l==="PUT"||l==="POST"||l==="PATCH";if(a&&typeof a.read==="function"){a.read(0)}const C=d.bodyLength(a);let v=C;if(v===null){v=i.contentLength}if(v===0&&!E){v=null}if(shouldSendContentLength(l)&&v>0&&i.contentLength!==null&&i.contentLength!==v){if(r[le]){errorRequest(r,i,new g);return false}process.emitWarning(new g)}const B=r[te];try{i.onConnect((a=>{if(i.aborted||i.completed){return}errorRequest(r,i,a||new b);d.destroy(B,new I("aborted"))}))}catch(a){errorRequest(r,i,a)}if(i.aborted){return false}if(l==="HEAD"){B[T]=true}if(u||l==="CONNECT"){B[T]=true}if(y!=null){B[T]=y}if(r[de]&&B[ue]++>=r[de]){B[T]=true}if(h){B[L]=true}let w=`${l} ${c} HTTP/1.1\r\n`;if(typeof p==="string"){w+=`host: ${p}\r\n`}else{w+=r[X]}if(u){w+=`connection: upgrade\r\nupgrade: ${u}\r\n`}else if(r[ee]&&!B[T]){w+="connection: keep-alive\r\n"}else{w+="connection: close\r\n"}if(A){w+=A}if(Le.sendHeaders.hasSubscribers){Le.sendHeaders.publish({request:i,headers:w,socket:B})}if(!a||C===0){if(v===0){B.write(`${w}content-length: 0\r\n\r\n`,"latin1")}else{s(v===null,"no body must not have content length");B.write(`${w}\r\n`,"latin1")}i.onRequestSent()}else if(d.isBuffer(a)){s(v===a.byteLength,"buffer body must have content length");B.cork();B.write(`${w}content-length: ${v}\r\n\r\n`,"latin1");B.write(a);B.uncork();i.onBodySent(a);i.onRequestSent();if(!E){B[T]=true}}else if(d.isBlobLike(a)){if(typeof a.stream==="function"){writeIterable({body:a.stream(),client:r,request:i,socket:B,contentLength:v,header:w,expectsPayload:E})}else{writeBlob({body:a,client:r,request:i,socket:B,contentLength:v,header:w,expectsPayload:E})}}else if(d.isStream(a)){writeStream({body:a,client:r,request:i,socket:B,contentLength:v,header:w,expectsPayload:E})}else if(d.isIterable(a)){writeIterable({body:a,client:r,request:i,socket:B,contentLength:v,header:w,expectsPayload:E})}else{s(false)}return true}function writeH2(r,i,a){const{body:l,method:c,path:p,host:u,upgrade:h,expectContinue:y,signal:E,headers:C}=a;let v;if(typeof C==="string")v=A[Ie](C.trim());else v=C;if(h){errorRequest(r,a,new Error("Upgrade not supported for H2"));return false}try{a.onConnect((i=>{if(a.aborted||a.completed){return}errorRequest(r,a,i||new b)}))}catch(i){errorRequest(r,a,i)}if(a.aborted){return false}let B;const w=r[ve];v[Qe]=u||r[be];v[xe]=c;if(c==="CONNECT"){i.ref();B=i.request(v,{endStream:false,signal:E});if(B.id&&!B.pending){a.onUpgrade(null,null,B);++w.openStreams}else{B.once("ready",(()=>{a.onUpgrade(null,null,B);++w.openStreams}))}B.once("close",(()=>{w.openStreams-=1;if(w.openStreams===0)i.unref()}));return true}v[Ne]=p;v[Re]="https";const S=c==="PUT"||c==="POST"||c==="PATCH";if(l&&typeof l.read==="function"){l.read(0)}let Q=d.bodyLength(l);if(Q==null){Q=a.contentLength}if(Q===0||!S){Q=null}if(shouldSendContentLength(c)&&Q>0&&a.contentLength!=null&&a.contentLength!==Q){if(r[le]){errorRequest(r,a,new g);return false}process.emitWarning(new g)}if(Q!=null){s(l,"no body must not have content length");v[Te]=`${Q}`}i.ref();const x=c==="GET"||c==="HEAD";if(y){v[De]="100-continue";B=i.request(v,{endStream:x,signal:E});B.once("continue",writeBodyH2)}else{B=i.request(v,{endStream:x,signal:E});writeBodyH2()}++w.openStreams;B.once("response",(r=>{const{[ke]:i,...s}=r;if(a.onHeaders(Number(i),s,B.resume.bind(B),"")===false){B.pause()}}));B.once("end",(()=>{a.onComplete([])}));B.on("data",(r=>{if(a.onData(r)===false){B.pause()}}));B.once("close",(()=>{w.openStreams-=1;if(w.openStreams===0){i.unref()}}));B.once("error",(function(i){if(r[Ce]&&!r[Ce].destroyed&&!this.closed&&!this.destroyed){w.streams-=1;d.destroy(B,i)}}));B.once("frameError",((i,s)=>{const l=new I(`HTTP/2: "frameError" received - type ${i}, code ${s}`);errorRequest(r,a,l);if(r[Ce]&&!r[Ce].destroyed&&!this.closed&&!this.destroyed){w.streams-=1;d.destroy(B,l)}}));return true;function writeBodyH2(){if(!l){a.onRequestSent()}else if(d.isBuffer(l)){s(Q===l.byteLength,"buffer body must have content length");B.cork();B.write(l);B.uncork();B.end();a.onBodySent(l);a.onRequestSent()}else if(d.isBlobLike(l)){if(typeof l.stream==="function"){writeIterable({client:r,request:a,contentLength:Q,h2stream:B,expectsPayload:S,body:l.stream(),socket:r[te],header:""})}else{writeBlob({body:l,client:r,request:a,contentLength:Q,expectsPayload:S,h2stream:B,header:"",socket:r[te]})}}else if(d.isStream(l)){writeStream({body:l,client:r,request:a,contentLength:Q,expectsPayload:S,socket:r[te],h2stream:B,header:""})}else if(d.isIterable(l)){writeIterable({body:l,client:r,request:a,contentLength:Q,expectsPayload:S,header:"",h2stream:B,socket:r[te]})}else{s(false)}}}function writeStream({h2stream:r,body:i,client:a,request:l,socket:c,contentLength:u,header:A,expectsPayload:h}){s(u!==0||a[U]===0,"stream body cannot be pipelined");if(a[Ee]==="h2"){const E=p(i,r,(a=>{if(a){d.destroy(i,a);d.destroy(r,a)}else{l.onRequestSent()}}));E.on("data",onPipeData);E.once("end",(()=>{E.removeListener("data",onPipeData);d.destroy(E)}));function onPipeData(r){l.onBodySent(r)}return}let g=false;const y=new AsyncWriter({socket:c,request:l,contentLength:u,client:a,expectsPayload:h,header:A});const onData=function(r){if(g){return}try{if(!y.write(r)&&this.pause){this.pause()}}catch(r){d.destroy(this,r)}};const onDrain=function(){if(g){return}if(i.resume){i.resume()}};const onAbort=function(){if(g){return}const r=new b;queueMicrotask((()=>onFinished(r)))};const onFinished=function(r){if(g){return}g=true;s(c.destroyed||c[j]&&a[U]<=1);c.off("drain",onDrain).off("error",onFinished);i.removeListener("data",onData).removeListener("end",onFinished).removeListener("error",onFinished).removeListener("close",onAbort);if(!r){try{y.end()}catch(i){r=i}}y.destroy(r);if(r&&(r.code!=="UND_ERR_INFO"||r.message!=="reset")){d.destroy(i,r)}else{d.destroy(i)}};i.on("data",onData).on("end",onFinished).on("error",onFinished).on("close",onAbort);if(i.resume){i.resume()}c.on("drain",onDrain).on("error",onFinished)}async function writeBlob({h2stream:r,body:i,client:a,request:l,socket:c,contentLength:p,header:u,expectsPayload:A}){s(p===i.size,"blob body must have content length");const h=a[Ee]==="h2";try{if(p!=null&&p!==i.size){throw new g}const s=Buffer.from(await i.arrayBuffer());if(h){r.cork();r.write(s);r.uncork()}else{c.cork();c.write(`${u}content-length: ${p}\r\n\r\n`,"latin1");c.write(s);c.uncork()}l.onBodySent(s);l.onRequestSent();if(!A){c[T]=true}resume(a)}catch(i){d.destroy(h?r:c,i)}}async function writeIterable({h2stream:r,body:i,client:a,request:l,socket:c,contentLength:p,header:d,expectsPayload:u}){s(p!==0||a[U]===0,"iterator body cannot be pipelined");let A=null;function onDrain(){if(A){const r=A;A=null;r()}}const waitForDrain=()=>new Promise(((r,i)=>{s(A===null);if(c[Z]){i(c[Z])}else{A=r}}));if(a[Ee]==="h2"){r.on("close",onDrain).on("drain",onDrain);try{for await(const a of i){if(c[Z]){throw c[Z]}const i=r.write(a);l.onBodySent(a);if(!i){await waitForDrain()}}}catch(i){r.destroy(i)}finally{l.onRequestSent();r.end();r.off("close",onDrain).off("drain",onDrain)}return}c.on("close",onDrain).on("drain",onDrain);const h=new AsyncWriter({socket:c,request:l,contentLength:p,client:a,expectsPayload:u,header:d});try{for await(const r of i){if(c[Z]){throw c[Z]}if(!h.write(r)){await waitForDrain()}}h.end()}catch(r){h.destroy(r)}finally{c.off("close",onDrain).off("drain",onDrain)}}class AsyncWriter{constructor({socket:r,request:i,contentLength:a,client:s,expectsPayload:l,header:c}){this.socket=r;this.request=i;this.contentLength=a;this.client=s;this.bytesWritten=0;this.expectsPayload=l;this.header=c;r[j]=true}write(r){const{socket:i,request:a,contentLength:s,client:l,bytesWritten:c,expectsPayload:p,header:d}=this;if(i[Z]){throw i[Z]}if(i.destroyed){return false}const u=Buffer.byteLength(r);if(!u){return true}if(s!==null&&c+u>s){if(l[le]){throw new g}process.emitWarning(new g)}i.cork();if(c===0){if(!p){i[T]=true}if(s===null){i.write(`${d}transfer-encoding: chunked\r\n`,"latin1")}else{i.write(`${d}content-length: ${s}\r\n\r\n`,"latin1")}}if(s===null){i.write(`\r\n${u.toString(16)}\r\n`,"latin1")}this.bytesWritten+=u;const A=i.write(r);i.uncork();a.onBodySent(r);if(!A){if(i[O].timeout&&i[O].timeoutType===Je){if(i[O].timeout.refresh){i[O].timeout.refresh()}}}return A}end(){const{socket:r,contentLength:i,client:a,bytesWritten:s,expectsPayload:l,header:c,request:p}=this;p.onRequestSent();r[j]=false;if(r[Z]){throw r[Z]}if(r.destroyed){return}if(s===0){if(l){r.write(`${c}content-length: 0\r\n\r\n`,"latin1")}else{r.write(`${c}\r\n`,"latin1")}}else if(i===null){r.write("\r\n0\r\n\r\n","latin1")}if(i!==null&&s!==i){if(a[le]){throw new g}else{process.emitWarning(new g)}}if(r[O].timeout&&r[O].timeoutType===Je){if(r[O].timeout.refresh){r[O].timeout.refresh()}}resume(a)}destroy(r){const{socket:i,client:a}=this;i[j]=false;if(r){s(a[U]<=1,"pipeline should only contain this request");d.destroy(i,r)}}}function errorRequest(r,i,a){try{i.onError(a);s(i.aborted)}catch(a){r.emit("error",a)}}r.exports=Client},17428:(r,i,a)=>{"use strict";const{kConnected:s,kSize:l}=a(31915);class CompatWeakRef{constructor(r){this.value=r}deref(){return this.value[s]===0&&this.value[l]===0?undefined:this.value}}class CompatFinalizer{constructor(r){this.finalizer=r}register(r,i){if(r.on){r.on("disconnect",(()=>{if(r[s]===0&&r[l]===0){this.finalizer(i)}}))}}}r.exports=function(){if(process.env.NODE_V8_COVERAGE){return{WeakRef:CompatWeakRef,FinalizationRegistry:CompatFinalizer}}return{WeakRef:global.WeakRef||CompatWeakRef,FinalizationRegistry:global.FinalizationRegistry||CompatFinalizer}}},96747:r=>{"use strict";const i=1024;const a=4096;r.exports={maxAttributeValueSize:i,maxNameValuePairSize:a}},62549:(r,i,a)=>{"use strict";const{parseSetCookie:s}=a(4628);const{stringify:l,getHeadersList:c}=a(17751);const{webidl:p}=a(87591);const{Headers:d}=a(8247);function getCookies(r){p.argumentLengthCheck(arguments,1,{header:"getCookies"});p.brandCheck(r,d,{strict:false});const i=r.get("cookie");const a={};if(!i){return a}for(const r of i.split(";")){const[i,...s]=r.split("=");a[i.trim()]=s.join("=")}return a}function deleteCookie(r,i,a){p.argumentLengthCheck(arguments,2,{header:"deleteCookie"});p.brandCheck(r,d,{strict:false});i=p.converters.DOMString(i);a=p.converters.DeleteCookieAttributes(a);setCookie(r,{name:i,value:"",expires:new Date(0),...a})}function getSetCookies(r){p.argumentLengthCheck(arguments,1,{header:"getSetCookies"});p.brandCheck(r,d,{strict:false});const i=c(r).cookies;if(!i){return[]}return i.map((r=>s(Array.isArray(r)?r[1]:r)))}function setCookie(r,i){p.argumentLengthCheck(arguments,2,{header:"setCookie"});p.brandCheck(r,d,{strict:false});i=p.converters.Cookie(i);const a=l(i);if(a){r.append("Set-Cookie",l(i))}}p.converters.DeleteCookieAttributes=p.dictionaryConverter([{converter:p.nullableConverter(p.converters.DOMString),key:"path",defaultValue:null},{converter:p.nullableConverter(p.converters.DOMString),key:"domain",defaultValue:null}]);p.converters.Cookie=p.dictionaryConverter([{converter:p.converters.DOMString,key:"name"},{converter:p.converters.DOMString,key:"value"},{converter:p.nullableConverter((r=>{if(typeof r==="number"){return p.converters["unsigned long long"](r)}return new Date(r)})),key:"expires",defaultValue:null},{converter:p.nullableConverter(p.converters["long long"]),key:"maxAge",defaultValue:null},{converter:p.nullableConverter(p.converters.DOMString),key:"domain",defaultValue:null},{converter:p.nullableConverter(p.converters.DOMString),key:"path",defaultValue:null},{converter:p.nullableConverter(p.converters.boolean),key:"secure",defaultValue:null},{converter:p.nullableConverter(p.converters.boolean),key:"httpOnly",defaultValue:null},{converter:p.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:p.sequenceConverter(p.converters.DOMString),key:"unparsed",defaultValue:[]}]);r.exports={getCookies:getCookies,deleteCookie:deleteCookie,getSetCookies:getSetCookies,setCookie:setCookie}},4628:(r,i,a)=>{"use strict";const{maxNameValuePairSize:s,maxAttributeValueSize:l}=a(96747);const{isCTLExcludingHtab:c}=a(17751);const{collectASequenceOfCodePointsFast:p}=a(80097);const d=a(39491);function parseSetCookie(r){if(c(r)){return null}let i="";let a="";let l="";let d="";if(r.includes(";")){const s={position:0};i=p(";",r,s);a=r.slice(s.position)}else{i=r}if(!i.includes("=")){d=i}else{const r={position:0};l=p("=",i,r);d=i.slice(r.position+1)}l=l.trim();d=d.trim();if(l.length+d.length>s){return null}return{name:l,value:d,...parseUnparsedAttributes(a)}}function parseUnparsedAttributes(r,i={}){if(r.length===0){return i}d(r[0]===";");r=r.slice(1);let a="";if(r.includes(";")){a=p(";",r,{position:0});r=r.slice(a.length)}else{a=r;r=""}let s="";let c="";if(a.includes("=")){const r={position:0};s=p("=",a,r);c=a.slice(r.position+1)}else{s=a}s=s.trim();c=c.trim();if(c.length>l){return parseUnparsedAttributes(r,i)}const u=s.toLowerCase();if(u==="expires"){const r=new Date(c);i.expires=r}else if(u==="max-age"){const a=c.charCodeAt(0);if((a<48||a>57)&&c[0]!=="-"){return parseUnparsedAttributes(r,i)}if(!/^\d+$/.test(c)){return parseUnparsedAttributes(r,i)}const s=Number(c);i.maxAge=s}else if(u==="domain"){let r=c;if(r[0]==="."){r=r.slice(1)}r=r.toLowerCase();i.domain=r}else if(u==="path"){let r="";if(c.length===0||c[0]!=="/"){r="/"}else{r=c}i.path=r}else if(u==="secure"){i.secure=true}else if(u==="httponly"){i.httpOnly=true}else if(u==="samesite"){let r="Default";const a=c.toLowerCase();if(a.includes("none")){r="None"}if(a.includes("strict")){r="Strict"}if(a.includes("lax")){r="Lax"}i.sameSite=r}else{i.unparsed??=[];i.unparsed.push(`${s}=${c}`)}return parseUnparsedAttributes(r,i)}r.exports={parseSetCookie:parseSetCookie,parseUnparsedAttributes:parseUnparsedAttributes}},17751:(r,i,a)=>{"use strict";const s=a(39491);const{kHeadersList:l}=a(31915);function isCTLExcludingHtab(r){if(r.length===0){return false}for(const i of r){const r=i.charCodeAt(0);if(r>=0||r<=8||(r>=10||r<=31)||r===127){return false}}}function validateCookieName(r){for(const i of r){const r=i.charCodeAt(0);if(r<=32||r>127||i==="("||i===")"||i===">"||i==="<"||i==="@"||i===","||i===";"||i===":"||i==="\\"||i==='"'||i==="/"||i==="["||i==="]"||i==="?"||i==="="||i==="{"||i==="}"){throw new Error("Invalid cookie name")}}}function validateCookieValue(r){for(const i of r){const r=i.charCodeAt(0);if(r<33||r===34||r===44||r===59||r===92||r>126){throw new Error("Invalid header value")}}}function validateCookiePath(r){for(const i of r){const r=i.charCodeAt(0);if(r<33||i===";"){throw new Error("Invalid cookie path")}}}function validateCookieDomain(r){if(r.startsWith("-")||r.endsWith(".")||r.endsWith("-")){throw new Error("Invalid cookie domain")}}function toIMFDate(r){if(typeof r==="number"){r=new Date(r)}const i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];const a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const s=i[r.getUTCDay()];const l=r.getUTCDate().toString().padStart(2,"0");const c=a[r.getUTCMonth()];const p=r.getUTCFullYear();const d=r.getUTCHours().toString().padStart(2,"0");const u=r.getUTCMinutes().toString().padStart(2,"0");const A=r.getUTCSeconds().toString().padStart(2,"0");return`${s}, ${l} ${c} ${p} ${d}:${u}:${A} GMT`}function validateCookieMaxAge(r){if(r<0){throw new Error("Invalid cookie max-age")}}function stringify(r){if(r.name.length===0){return null}validateCookieName(r.name);validateCookieValue(r.value);const i=[`${r.name}=${r.value}`];if(r.name.startsWith("__Secure-")){r.secure=true}if(r.name.startsWith("__Host-")){r.secure=true;r.domain=null;r.path="/"}if(r.secure){i.push("Secure")}if(r.httpOnly){i.push("HttpOnly")}if(typeof r.maxAge==="number"){validateCookieMaxAge(r.maxAge);i.push(`Max-Age=${r.maxAge}`)}if(r.domain){validateCookieDomain(r.domain);i.push(`Domain=${r.domain}`)}if(r.path){validateCookiePath(r.path);i.push(`Path=${r.path}`)}if(r.expires&&r.expires.toString()!=="Invalid Date"){i.push(`Expires=${toIMFDate(r.expires)}`)}if(r.sameSite){i.push(`SameSite=${r.sameSite}`)}for(const a of r.unparsed){if(!a.includes("=")){throw new Error("Invalid unparsed")}const[r,...s]=a.split("=");i.push(`${r.trim()}=${s.join("=")}`)}return i.join("; ")}let c;function getHeadersList(r){if(r[l]){return r[l]}if(!c){c=Object.getOwnPropertySymbols(r).find((r=>r.description==="headers list"));s(c,"Headers cannot be parsed")}const i=r[c];s(i);return i}r.exports={isCTLExcludingHtab:isCTLExcludingHtab,stringify:stringify,getHeadersList:getHeadersList}},98742:(r,i,a)=>{"use strict";const s=a(41808);const l=a(39491);const c=a(94766);const{InvalidArgumentError:p,ConnectTimeoutError:d}=a(76291);let u;let A;if(global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE){A=class WeakSessionCache{constructor(r){this._maxCachedSessions=r;this._sessionCache=new Map;this._sessionRegistry=new global.FinalizationRegistry((r=>{if(this._sessionCache.size=this._maxCachedSessions){const{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(r,i)}}}function buildConnector({allowH2:r,maxCachedSessions:i,socketPath:d,timeout:h,...g}){if(i!=null&&(!Number.isInteger(i)||i<0)){throw new p("maxCachedSessions must be a positive integer or zero")}const y={path:d,...g};const E=new A(i==null?100:i);h=h==null?1e4:h;r=r!=null?r:false;return function connect({hostname:i,host:p,protocol:d,port:A,servername:g,localAddress:b,httpSocket:C},v){let B;if(d==="https:"){if(!u){u=a(24404)}g=g||y.servername||c.getServerName(p)||null;const s=g||i;const d=E.get(s)||null;l(s);B=u.connect({highWaterMark:16384,...y,servername:g,session:d,localAddress:b,ALPNProtocols:r?["http/1.1","h2"]:["http/1.1"],socket:C,port:A||443,host:i});B.on("session",(function(r){E.set(s,r)}))}else{l(!C,"httpSocket can only be sent on TLS update");B=s.connect({highWaterMark:64*1024,...y,localAddress:b,port:A||80,host:i})}if(y.keepAlive==null||y.keepAlive){const r=y.keepAliveInitialDelay===undefined?6e4:y.keepAliveInitialDelay;B.setKeepAlive(true,r)}const I=setupTimeout((()=>onConnectTimeout(B)),h);B.setNoDelay(true).once(d==="https:"?"secureConnect":"connect",(function(){I();if(v){const r=v;v=null;r(null,this)}})).on("error",(function(r){I();if(v){const i=v;v=null;i(r)}}));return B}}function setupTimeout(r,i){if(!i){return()=>{}}let a=null;let s=null;const l=setTimeout((()=>{a=setImmediate((()=>{if(process.platform==="win32"){s=setImmediate((()=>r()))}else{r()}}))}),i);return()=>{clearTimeout(l);clearImmediate(a);clearImmediate(s)}}function onConnectTimeout(r){c.destroy(r,new d)}r.exports=buildConnector},76291:r=>{"use strict";class UndiciError extends Error{constructor(r){super(r);this.name="UndiciError";this.code="UND_ERR"}}class ConnectTimeoutError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ConnectTimeoutError);this.name="ConnectTimeoutError";this.message=r||"Connect Timeout Error";this.code="UND_ERR_CONNECT_TIMEOUT"}}class HeadersTimeoutError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,HeadersTimeoutError);this.name="HeadersTimeoutError";this.message=r||"Headers Timeout Error";this.code="UND_ERR_HEADERS_TIMEOUT"}}class HeadersOverflowError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,HeadersOverflowError);this.name="HeadersOverflowError";this.message=r||"Headers Overflow Error";this.code="UND_ERR_HEADERS_OVERFLOW"}}class BodyTimeoutError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,BodyTimeoutError);this.name="BodyTimeoutError";this.message=r||"Body Timeout Error";this.code="UND_ERR_BODY_TIMEOUT"}}class ResponseStatusCodeError extends UndiciError{constructor(r,i,a,s){super(r);Error.captureStackTrace(this,ResponseStatusCodeError);this.name="ResponseStatusCodeError";this.message=r||"Response Status Code Error";this.code="UND_ERR_RESPONSE_STATUS_CODE";this.body=s;this.status=i;this.statusCode=i;this.headers=a}}class InvalidArgumentError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,InvalidArgumentError);this.name="InvalidArgumentError";this.message=r||"Invalid Argument Error";this.code="UND_ERR_INVALID_ARG"}}class InvalidReturnValueError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,InvalidReturnValueError);this.name="InvalidReturnValueError";this.message=r||"Invalid Return Value Error";this.code="UND_ERR_INVALID_RETURN_VALUE"}}class RequestAbortedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,RequestAbortedError);this.name="AbortError";this.message=r||"Request aborted";this.code="UND_ERR_ABORTED"}}class InformationalError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,InformationalError);this.name="InformationalError";this.message=r||"Request information";this.code="UND_ERR_INFO"}}class RequestContentLengthMismatchError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,RequestContentLengthMismatchError);this.name="RequestContentLengthMismatchError";this.message=r||"Request body length does not match content-length header";this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}}class ResponseContentLengthMismatchError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ResponseContentLengthMismatchError);this.name="ResponseContentLengthMismatchError";this.message=r||"Response body length does not match content-length header";this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}}class ClientDestroyedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ClientDestroyedError);this.name="ClientDestroyedError";this.message=r||"The client is destroyed";this.code="UND_ERR_DESTROYED"}}class ClientClosedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ClientClosedError);this.name="ClientClosedError";this.message=r||"The client is closed";this.code="UND_ERR_CLOSED"}}class SocketError extends UndiciError{constructor(r,i){super(r);Error.captureStackTrace(this,SocketError);this.name="SocketError";this.message=r||"Socket error";this.code="UND_ERR_SOCKET";this.socket=i}}class NotSupportedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,NotSupportedError);this.name="NotSupportedError";this.message=r||"Not supported error";this.code="UND_ERR_NOT_SUPPORTED"}}class BalancedPoolMissingUpstreamError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,NotSupportedError);this.name="MissingUpstreamError";this.message=r||"No upstream has been added to the BalancedPool";this.code="UND_ERR_BPL_MISSING_UPSTREAM"}}class HTTPParserError extends Error{constructor(r,i,a){super(r);Error.captureStackTrace(this,HTTPParserError);this.name="HTTPParserError";this.code=i?`HPE_${i}`:undefined;this.data=a?a.toString():undefined}}class ResponseExceededMaxSizeError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ResponseExceededMaxSizeError);this.name="ResponseExceededMaxSizeError";this.message=r||"Response content exceeded max size";this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}}class RequestRetryError extends UndiciError{constructor(r,i,{headers:a,data:s}){super(r);Error.captureStackTrace(this,RequestRetryError);this.name="RequestRetryError";this.message=r||"Request retry error";this.code="UND_ERR_REQ_RETRY";this.statusCode=i;this.data=s;this.headers=a}}r.exports={HTTPParserError:HTTPParserError,UndiciError:UndiciError,HeadersTimeoutError:HeadersTimeoutError,HeadersOverflowError:HeadersOverflowError,BodyTimeoutError:BodyTimeoutError,RequestContentLengthMismatchError:RequestContentLengthMismatchError,ConnectTimeoutError:ConnectTimeoutError,ResponseStatusCodeError:ResponseStatusCodeError,InvalidArgumentError:InvalidArgumentError,InvalidReturnValueError:InvalidReturnValueError,RequestAbortedError:RequestAbortedError,ClientDestroyedError:ClientDestroyedError,ClientClosedError:ClientClosedError,InformationalError:InformationalError,SocketError:SocketError,NotSupportedError:NotSupportedError,ResponseContentLengthMismatchError:ResponseContentLengthMismatchError,BalancedPoolMissingUpstreamError:BalancedPoolMissingUpstreamError,ResponseExceededMaxSizeError:ResponseExceededMaxSizeError,RequestRetryError:RequestRetryError}},50548:(r,i,a)=>{"use strict";const{InvalidArgumentError:s,NotSupportedError:l}=a(76291);const c=a(39491);const{kHTTP2BuildRequest:p,kHTTP2CopyHeaders:d,kHTTP1BuildRequest:u}=a(31915);const A=a(94766);const h=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;const g=/[^\t\x20-\x7e\x80-\xff]/;const y=/[^\u0021-\u00ff]/;const E=Symbol("handler");const b={};let C;try{const r=a(67643);b.create=r.channel("undici:request:create");b.bodySent=r.channel("undici:request:bodySent");b.headers=r.channel("undici:request:headers");b.trailers=r.channel("undici:request:trailers");b.error=r.channel("undici:request:error")}catch{b.create={hasSubscribers:false};b.bodySent={hasSubscribers:false};b.headers={hasSubscribers:false};b.trailers={hasSubscribers:false};b.error={hasSubscribers:false}}class Request{constructor(r,{path:i,method:l,body:c,headers:p,query:d,idempotent:u,blocking:g,upgrade:v,headersTimeout:B,bodyTimeout:I,reset:w,throwOnError:S,expectContinue:Q},x){if(typeof i!=="string"){throw new s("path must be a string")}else if(i[0]!=="/"&&!(i.startsWith("http://")||i.startsWith("https://"))&&l!=="CONNECT"){throw new s("path must be an absolute URL or start with a slash")}else if(y.exec(i)!==null){throw new s("invalid request path")}if(typeof l!=="string"){throw new s("method must be a string")}else if(h.exec(l)===null){throw new s("invalid request method")}if(v&&typeof v!=="string"){throw new s("upgrade must be a string")}if(B!=null&&(!Number.isFinite(B)||B<0)){throw new s("invalid headersTimeout")}if(I!=null&&(!Number.isFinite(I)||I<0)){throw new s("invalid bodyTimeout")}if(w!=null&&typeof w!=="boolean"){throw new s("invalid reset")}if(Q!=null&&typeof Q!=="boolean"){throw new s("invalid expectContinue")}this.headersTimeout=B;this.bodyTimeout=I;this.throwOnError=S===true;this.method=l;this.abort=null;if(c==null){this.body=null}else if(A.isStream(c)){this.body=c;const r=this.body._readableState;if(!r||!r.autoDestroy){this.endHandler=function autoDestroy(){A.destroy(this)};this.body.on("end",this.endHandler)}this.errorHandler=r=>{if(this.abort){this.abort(r)}else{this.error=r}};this.body.on("error",this.errorHandler)}else if(A.isBuffer(c)){this.body=c.byteLength?c:null}else if(ArrayBuffer.isView(c)){this.body=c.buffer.byteLength?Buffer.from(c.buffer,c.byteOffset,c.byteLength):null}else if(c instanceof ArrayBuffer){this.body=c.byteLength?Buffer.from(c):null}else if(typeof c==="string"){this.body=c.length?Buffer.from(c):null}else if(A.isFormDataLike(c)||A.isIterable(c)||A.isBlobLike(c)){this.body=c}else{throw new s("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable")}this.completed=false;this.aborted=false;this.upgrade=v||null;this.path=d?A.buildURL(i,d):i;this.origin=r;this.idempotent=u==null?l==="HEAD"||l==="GET":u;this.blocking=g==null?false:g;this.reset=w==null?null:w;this.host=null;this.contentLength=null;this.contentType=null;this.headers="";this.expectContinue=Q!=null?Q:false;if(Array.isArray(p)){if(p.length%2!==0){throw new s("headers array must be even")}for(let r=0;r{r.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kHTTP2BuildRequest:Symbol("http2 build request"),kHTTP1BuildRequest:Symbol("http1 build request"),kHTTP2CopyHeaders:Symbol("http2 copy headers"),kHTTPConnVersion:Symbol("http connection version"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable")}},94766:(r,i,a)=>{"use strict";const s=a(39491);const{kDestroyed:l,kBodyUsed:c}=a(31915);const{IncomingMessage:p}=a(13685);const d=a(12781);const u=a(41808);const{InvalidArgumentError:A}=a(76291);const{Blob:h}=a(14300);const g=a(73837);const{stringify:y}=a(63477);const[E,b]=process.versions.node.split(".").map((r=>Number(r)));function nop(){}function isStream(r){return r&&typeof r==="object"&&typeof r.pipe==="function"&&typeof r.on==="function"}function isBlobLike(r){return h&&r instanceof h||r&&typeof r==="object"&&(typeof r.stream==="function"||typeof r.arrayBuffer==="function")&&/^(Blob|File)$/.test(r[Symbol.toStringTag])}function buildURL(r,i){if(r.includes("?")||r.includes("#")){throw new Error('Query params cannot be passed when url already contains "?" or "#".')}const a=y(i);if(a){r+="?"+a}return r}function parseURL(r){if(typeof r==="string"){r=new URL(r);if(!/^https?:/.test(r.origin||r.protocol)){throw new A("Invalid URL protocol: the URL must start with `http:` or `https:`.")}return r}if(!r||typeof r!=="object"){throw new A("Invalid URL: The URL argument must be a non-null object.")}if(!/^https?:/.test(r.origin||r.protocol)){throw new A("Invalid URL protocol: the URL must start with `http:` or `https:`.")}if(!(r instanceof URL)){if(r.port!=null&&r.port!==""&&!Number.isFinite(parseInt(r.port))){throw new A("Invalid URL: port must be a valid integer or a string representation of an integer.")}if(r.path!=null&&typeof r.path!=="string"){throw new A("Invalid URL path: the path must be a string or null/undefined.")}if(r.pathname!=null&&typeof r.pathname!=="string"){throw new A("Invalid URL pathname: the pathname must be a string or null/undefined.")}if(r.hostname!=null&&typeof r.hostname!=="string"){throw new A("Invalid URL hostname: the hostname must be a string or null/undefined.")}if(r.origin!=null&&typeof r.origin!=="string"){throw new A("Invalid URL origin: the origin must be a string or null/undefined.")}const i=r.port!=null?r.port:r.protocol==="https:"?443:80;let a=r.origin!=null?r.origin:`${r.protocol}//${r.hostname}:${i}`;let s=r.path!=null?r.path:`${r.pathname||""}${r.search||""}`;if(a.endsWith("/")){a=a.substring(0,a.length-1)}if(s&&!s.startsWith("/")){s=`/${s}`}r=new URL(a+s)}return r}function parseOrigin(r){r=parseURL(r);if(r.pathname!=="/"||r.search||r.hash){throw new A("invalid url")}return r}function getHostname(r){if(r[0]==="["){const i=r.indexOf("]");s(i!==-1);return r.substring(1,i)}const i=r.indexOf(":");if(i===-1)return r;return r.substring(0,i)}function getServerName(r){if(!r){return null}s.strictEqual(typeof r,"string");const i=getHostname(r);if(u.isIP(i)){return""}return i}function deepClone(r){return JSON.parse(JSON.stringify(r))}function isAsyncIterable(r){return!!(r!=null&&typeof r[Symbol.asyncIterator]==="function")}function isIterable(r){return!!(r!=null&&(typeof r[Symbol.iterator]==="function"||typeof r[Symbol.asyncIterator]==="function"))}function bodyLength(r){if(r==null){return 0}else if(isStream(r)){const i=r._readableState;return i&&i.objectMode===false&&i.ended===true&&Number.isFinite(i.length)?i.length:null}else if(isBlobLike(r)){return r.size!=null?r.size:null}else if(isBuffer(r)){return r.byteLength}return null}function isDestroyed(r){return!r||!!(r.destroyed||r[l])}function isReadableAborted(r){const i=r&&r._readableState;return isDestroyed(r)&&i&&!i.endEmitted}function destroy(r,i){if(r==null||!isStream(r)||isDestroyed(r)){return}if(typeof r.destroy==="function"){if(Object.getPrototypeOf(r).constructor===p){r.socket=null}r.destroy(i)}else if(i){process.nextTick(((r,i)=>{r.emit("error",i)}),r,i)}if(r.destroyed!==true){r[l]=true}}const C=/timeout=(\d+)/;function parseKeepAliveTimeout(r){const i=r.toString().match(C);return i?parseInt(i[1],10)*1e3:null}function parseHeaders(r,i={}){if(!Array.isArray(r))return r;for(let a=0;ar.toString("utf8")))}else{i[s]=r[a+1].toString("utf8")}}else{if(!Array.isArray(l)){l=[l];i[s]=l}l.push(r[a+1].toString("utf8"))}}if("content-length"in i&&"content-disposition"in i){i["content-disposition"]=Buffer.from(i["content-disposition"]).toString("latin1")}return i}function parseRawHeaders(r){const i=[];let a=false;let s=-1;for(let l=0;l{r.close()}))}else{const i=Buffer.isBuffer(s)?s:Buffer.from(s);r.enqueue(new Uint8Array(i))}return r.desiredSize>0},async cancel(r){await i.return()}},0)}function isFormDataLike(r){return r&&typeof r==="object"&&typeof r.append==="function"&&typeof r.delete==="function"&&typeof r.get==="function"&&typeof r.getAll==="function"&&typeof r.has==="function"&&typeof r.set==="function"&&r[Symbol.toStringTag]==="FormData"}function throwIfAborted(r){if(!r){return}if(typeof r.throwIfAborted==="function"){r.throwIfAborted()}else{if(r.aborted){const r=new Error("The operation was aborted");r.name="AbortError";throw r}}}function addAbortListener(r,i){if("addEventListener"in r){r.addEventListener("abort",i,{once:true});return()=>r.removeEventListener("abort",i)}r.addListener("abort",i);return()=>r.removeListener("abort",i)}const B=!!String.prototype.toWellFormed;function toUSVString(r){if(B){return`${r}`.toWellFormed()}else if(g.toUSVString){return g.toUSVString(r)}return`${r}`}function parseRangeHeader(r){if(r==null||r==="")return{start:0,end:null,size:null};const i=r?r.match(/^bytes (\d+)-(\d+)\/(\d+)?$/):null;return i?{start:parseInt(i[1]),end:i[2]?parseInt(i[2]):null,size:i[3]?parseInt(i[3]):null}:null}const I=Object.create(null);I.enumerable=true;r.exports={kEnumerableProperty:I,nop:nop,isDisturbed:isDisturbed,isErrored:isErrored,isReadable:isReadable,toUSVString:toUSVString,isReadableAborted:isReadableAborted,isBlobLike:isBlobLike,parseOrigin:parseOrigin,parseURL:parseURL,getServerName:getServerName,isStream:isStream,isIterable:isIterable,isAsyncIterable:isAsyncIterable,isDestroyed:isDestroyed,parseRawHeaders:parseRawHeaders,parseHeaders:parseHeaders,parseKeepAliveTimeout:parseKeepAliveTimeout,destroy:destroy,bodyLength:bodyLength,deepClone:deepClone,ReadableStreamFrom:ReadableStreamFrom,isBuffer:isBuffer,validateHandler:validateHandler,getSocketInfo:getSocketInfo,isFormDataLike:isFormDataLike,buildURL:buildURL,throwIfAborted:throwIfAborted,addAbortListener:addAbortListener,parseRangeHeader:parseRangeHeader,nodeMajor:E,nodeMinor:b,nodeHasAutoSelectFamily:E>18||E===18&&b>=13,safeHTTPMethods:["GET","HEAD","OPTIONS","TRACE"]}},36228:(r,i,a)=>{"use strict";const s=a(78824);const{ClientDestroyedError:l,ClientClosedError:c,InvalidArgumentError:p}=a(76291);const{kDestroy:d,kClose:u,kDispatch:A,kInterceptors:h}=a(31915);const g=Symbol("destroyed");const y=Symbol("closed");const E=Symbol("onDestroyed");const b=Symbol("onClosed");const C=Symbol("Intercepted Dispatch");class DispatcherBase extends s{constructor(){super();this[g]=false;this[E]=null;this[y]=false;this[b]=[]}get destroyed(){return this[g]}get closed(){return this[y]}get interceptors(){return this[h]}set interceptors(r){if(r){for(let i=r.length-1;i>=0;i--){const r=this[h][i];if(typeof r!=="function"){throw new p("interceptor must be an function")}}}this[h]=r}close(r){if(r===undefined){return new Promise(((r,i)=>{this.close(((a,s)=>a?i(a):r(s)))}))}if(typeof r!=="function"){throw new p("invalid callback")}if(this[g]){queueMicrotask((()=>r(new l,null)));return}if(this[y]){if(this[b]){this[b].push(r)}else{queueMicrotask((()=>r(null,null)))}return}this[y]=true;this[b].push(r);const onClosed=()=>{const r=this[b];this[b]=null;for(let i=0;ithis.destroy())).then((()=>{queueMicrotask(onClosed)}))}destroy(r,i){if(typeof r==="function"){i=r;r=null}if(i===undefined){return new Promise(((i,a)=>{this.destroy(r,((r,s)=>r?a(r):i(s)))}))}if(typeof i!=="function"){throw new p("invalid callback")}if(this[g]){if(this[E]){this[E].push(i)}else{queueMicrotask((()=>i(null,null)))}return}if(!r){r=new l}this[g]=true;this[E]=this[E]||[];this[E].push(i);const onDestroyed=()=>{const r=this[E];this[E]=null;for(let i=0;i{queueMicrotask(onDestroyed)}))}[C](r,i){if(!this[h]||this[h].length===0){this[C]=this[A];return this[A](r,i)}let a=this[A].bind(this);for(let r=this[h].length-1;r>=0;r--){a=this[h][r](a)}this[C]=a;return a(r,i)}dispatch(r,i){if(!i||typeof i!=="object"){throw new p("handler must be an object")}try{if(!r||typeof r!=="object"){throw new p("opts must be an object.")}if(this[g]||this[E]){throw new l}if(this[y]){throw new c}return this[C](r,i)}catch(r){if(typeof i.onError!=="function"){throw new p("invalid onError method")}i.onError(r);return false}}}r.exports=DispatcherBase},78824:(r,i,a)=>{"use strict";const s=a(82361);class Dispatcher extends s{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}}r.exports=Dispatcher},21254:(r,i,a)=>{"use strict";const s=a(61145);const l=a(94766);const{ReadableStreamFrom:c,isBlobLike:p,isReadableStreamLike:d,readableStreamClose:u,createDeferredPromise:A,fullyReadBody:h}=a(40336);const{FormData:g}=a(72489);const{kState:y}=a(9411);const{webidl:E}=a(87591);const{DOMException:b,structuredClone:C}=a(67296);const{Blob:v,File:B}=a(14300);const{kBodyUsed:I}=a(31915);const w=a(39491);const{isErrored:S}=a(94766);const{isUint8Array:Q,isArrayBuffer:x}=a(29830);const{File:N}=a(81636);const{parseMIMEType:R,serializeAMimeType:T}=a(80097);let D=globalThis.ReadableStream;const k=B??N;const _=new TextEncoder;const O=new TextDecoder;function extractBody(r,i=false){if(!D){D=a(35356).ReadableStream}let s=null;if(r instanceof D){s=r}else if(p(r)){s=r.stream()}else{s=new D({async pull(r){r.enqueue(typeof h==="string"?_.encode(h):h);queueMicrotask((()=>u(r)))},start(){},type:undefined})}w(d(s));let A=null;let h=null;let g=null;let y=null;if(typeof r==="string"){h=r;y="text/plain;charset=UTF-8"}else if(r instanceof URLSearchParams){h=r.toString();y="application/x-www-form-urlencoded;charset=UTF-8"}else if(x(r)){h=new Uint8Array(r.slice())}else if(ArrayBuffer.isView(r)){h=new Uint8Array(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength))}else if(l.isFormDataLike(r)){const i=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`;const a=`--${i}\r\nContent-Disposition: form-data` -/*! formdata-polyfill. MIT License. Jimmy Wärting */;const escape=r=>r.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=r=>r.replace(/\r?\n|\r/g,"\r\n");const s=[];const l=new Uint8Array([13,10]);g=0;let c=false;for(const[i,p]of r){if(typeof p==="string"){const r=_.encode(a+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(p)}\r\n`);s.push(r);g+=r.byteLength}else{const r=_.encode(`${a}; name="${escape(normalizeLinefeeds(i))}"`+(p.name?`; filename="${escape(p.name)}"`:"")+"\r\n"+`Content-Type: ${p.type||"application/octet-stream"}\r\n\r\n`);s.push(r,p,l);if(typeof p.size==="number"){g+=r.byteLength+p.size+l.byteLength}else{c=true}}}const p=_.encode(`--${i}--`);s.push(p);g+=p.byteLength;if(c){g=null}h=r;A=async function*(){for(const r of s){if(r.stream){yield*r.stream()}else{yield r}}};y="multipart/form-data; boundary="+i}else if(p(r)){h=r;g=r.size;if(r.type){y=r.type}}else if(typeof r[Symbol.asyncIterator]==="function"){if(i){throw new TypeError("keepalive")}if(l.isDisturbed(r)||r.locked){throw new TypeError("Response body object should not be disturbed or locked")}s=r instanceof D?r:c(r)}if(typeof h==="string"||l.isBuffer(h)){g=Buffer.byteLength(h)}if(A!=null){let i;s=new D({async start(){i=A(r)[Symbol.asyncIterator]()},async pull(r){const{value:a,done:l}=await i.next();if(l){queueMicrotask((()=>{r.close()}))}else{if(!S(s)){r.enqueue(new Uint8Array(a))}}return r.desiredSize>0},async cancel(r){await i.return()},type:undefined})}const E={stream:s,source:h,length:g};return[E,y]}function safelyExtractBody(r,i=false){if(!D){D=a(35356).ReadableStream}if(r instanceof D){w(!l.isDisturbed(r),"The body has already been consumed.");w(!r.locked,"The stream is locked.")}return extractBody(r,i)}function cloneBody(r){const[i,a]=r.stream.tee();const s=C(a,{transfer:[a]});const[,l]=s.tee();r.stream=i;return{stream:l,length:r.length,source:r.source}}async function*consumeBody(r){if(r){if(Q(r)){yield r}else{const i=r.stream;if(l.isDisturbed(i)){throw new TypeError("The body has already been consumed.")}if(i.locked){throw new TypeError("The stream is locked.")}i[I]=true;yield*i}}}function throwIfAborted(r){if(r.aborted){throw new b("The operation was aborted.","AbortError")}}function bodyMixinMethods(r){const i={blob(){return specConsumeBody(this,(r=>{let i=bodyMimeType(this);if(i==="failure"){i=""}else if(i){i=T(i)}return new v([r],{type:i})}),r)},arrayBuffer(){return specConsumeBody(this,(r=>new Uint8Array(r).buffer),r)},text(){return specConsumeBody(this,utf8DecodeBytes,r)},json(){return specConsumeBody(this,parseJSONFromBytes,r)},async formData(){E.brandCheck(this,r);throwIfAborted(this[y]);const i=this.headers.get("Content-Type");if(/multipart\/form-data/.test(i)){const r={};for(const[i,a]of this.headers)r[i.toLowerCase()]=a;const i=new g;let a;try{a=new s({headers:r,preservePath:true})}catch(r){throw new b(`${r}`,"AbortError")}a.on("field",((r,a)=>{i.append(r,a)}));a.on("file",((r,a,s,l,c)=>{const p=[];if(l==="base64"||l.toLowerCase()==="base64"){let l="";a.on("data",(r=>{l+=r.toString().replace(/[\r\n]/gm,"");const i=l.length-l.length%4;p.push(Buffer.from(l.slice(0,i),"base64"));l=l.slice(i)}));a.on("end",(()=>{p.push(Buffer.from(l,"base64"));i.append(r,new k(p,s,{type:c}))}))}else{a.on("data",(r=>{p.push(r)}));a.on("end",(()=>{i.append(r,new k(p,s,{type:c}))}))}}));const l=new Promise(((r,i)=>{a.on("finish",r);a.on("error",(r=>i(new TypeError(r))))}));if(this.body!==null)for await(const r of consumeBody(this[y].body))a.write(r);a.end();await l;return i}else if(/application\/x-www-form-urlencoded/.test(i)){let r;try{let i="";const a=new TextDecoder("utf-8",{ignoreBOM:true});for await(const r of consumeBody(this[y].body)){if(!Q(r)){throw new TypeError("Expected Uint8Array chunk")}i+=a.decode(r,{stream:true})}i+=a.decode();r=new URLSearchParams(i)}catch(r){throw Object.assign(new TypeError,{cause:r})}const i=new g;for(const[a,s]of r){i.append(a,s)}return i}else{await Promise.resolve();throwIfAborted(this[y]);throw E.errors.exception({header:`${r.name}.formData`,message:"Could not parse content as FormData."})}}};return i}function mixinBody(r){Object.assign(r.prototype,bodyMixinMethods(r))}async function specConsumeBody(r,i,a){E.brandCheck(r,a);throwIfAborted(r[y]);if(bodyUnusable(r[y].body)){throw new TypeError("Body is unusable")}const s=A();const errorSteps=r=>s.reject(r);const successSteps=r=>{try{s.resolve(i(r))}catch(r){errorSteps(r)}};if(r[y].body==null){successSteps(new Uint8Array);return s.promise}await h(r[y].body,successSteps,errorSteps);return s.promise}function bodyUnusable(r){return r!=null&&(r.stream.locked||l.isDisturbed(r.stream))}function utf8DecodeBytes(r){if(r.length===0){return""}if(r[0]===239&&r[1]===187&&r[2]===191){r=r.subarray(3)}const i=O.decode(r);return i}function parseJSONFromBytes(r){return JSON.parse(utf8DecodeBytes(r))}function bodyMimeType(r){const{headersList:i}=r[y];const a=i.get("content-type");if(a===null){return"failure"}return R(a)}r.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody}},67296:(r,i,a)=>{"use strict";const{MessageChannel:s,receiveMessageOnPort:l}=a(71267);const c=["GET","HEAD","POST"];const p=new Set(c);const d=[101,204,205,304];const u=[301,302,303,307,308];const A=new Set(u);const h=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","5060","5061","6000","6566","6665","6666","6667","6668","6669","6697","10080"];const g=new Set(h);const y=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const E=new Set(y);const b=["follow","manual","error"];const C=["GET","HEAD","OPTIONS","TRACE"];const v=new Set(C);const B=["navigate","same-origin","no-cors","cors"];const I=["omit","same-origin","include"];const w=["default","no-store","reload","no-cache","force-cache","only-if-cached"];const S=["content-encoding","content-language","content-location","content-type","content-length"];const Q=["half"];const x=["CONNECT","TRACE","TRACK"];const N=new Set(x);const R=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""];const T=new Set(R);const D=globalThis.DOMException??(()=>{try{atob("~")}catch(r){return Object.getPrototypeOf(r).constructor}})();let k;const _=globalThis.structuredClone??function structuredClone(r,i=undefined){if(arguments.length===0){throw new TypeError("missing argument")}if(!k){k=new s}k.port1.unref();k.port2.unref();k.port1.postMessage(r,i?.transfer);return l(k.port2).message};r.exports={DOMException:D,structuredClone:_,subresource:R,forbiddenMethods:x,requestBodyHeader:S,referrerPolicy:y,requestRedirect:b,requestMode:B,requestCredentials:I,requestCache:w,redirectStatus:u,corsSafeListedMethods:c,nullBodyStatus:d,safeMethods:C,badPorts:h,requestDuplex:Q,subresourceSet:T,badPortsSet:g,redirectStatusSet:A,corsSafeListedMethodsSet:p,safeMethodsSet:v,forbiddenMethodsSet:N,referrerPolicySet:E}},80097:(r,i,a)=>{const s=a(39491);const{atob:l}=a(14300);const{isomorphicDecode:c}=a(40336);const p=new TextEncoder;const d=/^[!#$%&'*+-.^_|~A-Za-z0-9]+$/;const u=/(\u000A|\u000D|\u0009|\u0020)/;const A=/[\u0009|\u0020-\u007E|\u0080-\u00FF]/;function dataURLProcessor(r){s(r.protocol==="data:");let i=URLSerializer(r,true);i=i.slice(5);const a={position:0};let l=collectASequenceOfCodePointsFast(",",i,a);const p=l.length;l=removeASCIIWhitespace(l,true,true);if(a.position>=i.length){return"failure"}a.position++;const d=i.slice(p+1);let u=stringPercentDecode(d);if(/;(\u0020){0,}base64$/i.test(l)){const r=c(u);u=forgivingBase64(r);if(u==="failure"){return"failure"}l=l.slice(0,-6);l=l.replace(/(\u0020)+$/,"");l=l.slice(0,-1)}if(l.startsWith(";")){l="text/plain"+l}let A=parseMIMEType(l);if(A==="failure"){A=parseMIMEType("text/plain;charset=US-ASCII")}return{mimeType:A,body:u}}function URLSerializer(r,i=false){if(!i){return r.href}const a=r.href;const s=r.hash.length;return s===0?a:a.substring(0,a.length-s)}function collectASequenceOfCodePoints(r,i,a){let s="";while(a.positionr.length){return"failure"}i.position++;let s=collectASequenceOfCodePointsFast(";",r,i);s=removeHTTPWhitespace(s,false,true);if(s.length===0||!d.test(s)){return"failure"}const l=a.toLowerCase();const c=s.toLowerCase();const p={type:l,subtype:c,parameters:new Map,essence:`${l}/${c}`};while(i.positionu.test(r)),r,i);let a=collectASequenceOfCodePoints((r=>r!==";"&&r!=="="),r,i);a=a.toLowerCase();if(i.positionr.length){break}let s=null;if(r[i.position]==='"'){s=collectAnHTTPQuotedString(r,i,true);collectASequenceOfCodePointsFast(";",r,i)}else{s=collectASequenceOfCodePointsFast(";",r,i);s=removeHTTPWhitespace(s,false,true);if(s.length===0){continue}}if(a.length!==0&&d.test(a)&&(s.length===0||A.test(s))&&!p.parameters.has(a)){p.parameters.set(a,s)}}return p}function forgivingBase64(r){r=r.replace(/[\u0009\u000A\u000C\u000D\u0020]/g,"");if(r.length%4===0){r=r.replace(/=?=$/,"")}if(r.length%4===1){return"failure"}if(/[^+/0-9A-Za-z]/.test(r)){return"failure"}const i=l(r);const a=new Uint8Array(i.length);for(let r=0;rr!=='"'&&r!=="\\"),r,i);if(i.position>=r.length){break}const a=r[i.position];i.position++;if(a==="\\"){if(i.position>=r.length){c+="\\";break}c+=r[i.position];i.position++}else{s(a==='"');break}}if(a){return c}return r.slice(l,i.position)}function serializeAMimeType(r){s(r!=="failure");const{parameters:i,essence:a}=r;let l=a;for(let[r,a]of i.entries()){l+=";";l+=r;l+="=";if(!d.test(a)){a=a.replace(/(\\|")/g,"\\$1");a='"'+a;a+='"'}l+=a}return l}function isHTTPWhiteSpace(r){return r==="\r"||r==="\n"||r==="\t"||r===" "}function removeHTTPWhitespace(r,i=true,a=true){let s=0;let l=r.length-1;if(i){for(;s0&&isHTTPWhiteSpace(r[l]);l--);}return r.slice(s,l+1)}function isASCIIWhitespace(r){return r==="\r"||r==="\n"||r==="\t"||r==="\f"||r===" "}function removeASCIIWhitespace(r,i=true,a=true){let s=0;let l=r.length-1;if(i){for(;s0&&isASCIIWhitespace(r[l]);l--);}return r.slice(s,l+1)}r.exports={dataURLProcessor:dataURLProcessor,URLSerializer:URLSerializer,collectASequenceOfCodePoints:collectASequenceOfCodePoints,collectASequenceOfCodePointsFast:collectASequenceOfCodePointsFast,stringPercentDecode:stringPercentDecode,parseMIMEType:parseMIMEType,collectAnHTTPQuotedString:collectAnHTTPQuotedString,serializeAMimeType:serializeAMimeType}},81636:(r,i,a)=>{"use strict";const{Blob:s,File:l}=a(14300);const{types:c}=a(73837);const{kState:p}=a(9411);const{isBlobLike:d}=a(40336);const{webidl:u}=a(87591);const{parseMIMEType:A,serializeAMimeType:h}=a(80097);const{kEnumerableProperty:g}=a(94766);const y=new TextEncoder;class File extends s{constructor(r,i,a={}){u.argumentLengthCheck(arguments,2,{header:"File constructor"});r=u.converters["sequence"](r);i=u.converters.USVString(i);a=u.converters.FilePropertyBag(a);const s=i;let l=a.type;let c;e:{if(l){l=A(l);if(l==="failure"){l="";break e}l=h(l).toLowerCase()}c=a.lastModified}super(processBlobParts(r,a),{type:l});this[p]={name:s,lastModified:c,type:l}}get name(){u.brandCheck(this,File);return this[p].name}get lastModified(){u.brandCheck(this,File);return this[p].lastModified}get type(){u.brandCheck(this,File);return this[p].type}}class FileLike{constructor(r,i,a={}){const s=i;const l=a.type;const c=a.lastModified??Date.now();this[p]={blobLike:r,name:s,type:l,lastModified:c}}stream(...r){u.brandCheck(this,FileLike);return this[p].blobLike.stream(...r)}arrayBuffer(...r){u.brandCheck(this,FileLike);return this[p].blobLike.arrayBuffer(...r)}slice(...r){u.brandCheck(this,FileLike);return this[p].blobLike.slice(...r)}text(...r){u.brandCheck(this,FileLike);return this[p].blobLike.text(...r)}get size(){u.brandCheck(this,FileLike);return this[p].blobLike.size}get type(){u.brandCheck(this,FileLike);return this[p].blobLike.type}get name(){u.brandCheck(this,FileLike);return this[p].name}get lastModified(){u.brandCheck(this,FileLike);return this[p].lastModified}get[Symbol.toStringTag](){return"File"}}Object.defineProperties(File.prototype,{[Symbol.toStringTag]:{value:"File",configurable:true},name:g,lastModified:g});u.converters.Blob=u.interfaceConverter(s);u.converters.BlobPart=function(r,i){if(u.util.Type(r)==="Object"){if(d(r)){return u.converters.Blob(r,{strict:false})}if(ArrayBuffer.isView(r)||c.isAnyArrayBuffer(r)){return u.converters.BufferSource(r,i)}}return u.converters.USVString(r,i)};u.converters["sequence"]=u.sequenceConverter(u.converters.BlobPart);u.converters.FilePropertyBag=u.dictionaryConverter([{key:"lastModified",converter:u.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:u.converters.DOMString,defaultValue:""},{key:"endings",converter:r=>{r=u.converters.DOMString(r);r=r.toLowerCase();if(r!=="native"){r="transparent"}return r},defaultValue:"transparent"}]);function processBlobParts(r,i){const a=[];for(const s of r){if(typeof s==="string"){let r=s;if(i.endings==="native"){r=convertLineEndingsNative(r)}a.push(y.encode(r))}else if(c.isAnyArrayBuffer(s)||c.isTypedArray(s)){if(!s.buffer){a.push(new Uint8Array(s))}else{a.push(new Uint8Array(s.buffer,s.byteOffset,s.byteLength))}}else if(d(s)){a.push(s)}}return a}function convertLineEndingsNative(r){let i="\n";if(process.platform==="win32"){i="\r\n"}return r.replace(/\r?\n/g,i)}function isFileLike(r){return l&&r instanceof l||r instanceof File||r&&(typeof r.stream==="function"||typeof r.arrayBuffer==="function")&&r[Symbol.toStringTag]==="File"}r.exports={File:File,FileLike:FileLike,isFileLike:isFileLike}},72489:(r,i,a)=>{"use strict";const{isBlobLike:s,toUSVString:l,makeIterator:c}=a(40336);const{kState:p}=a(9411);const{File:d,FileLike:u,isFileLike:A}=a(81636);const{webidl:h}=a(87591);const{Blob:g,File:y}=a(14300);const E=y??d;class FormData{constructor(r){if(r!==undefined){throw h.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}this[p]=[]}append(r,i,a=undefined){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,2,{header:"FormData.append"});if(arguments.length===3&&!s(i)){throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'")}r=h.converters.USVString(r);i=s(i)?h.converters.Blob(i,{strict:false}):h.converters.USVString(i);a=arguments.length===3?h.converters.USVString(a):undefined;const l=makeEntry(r,i,a);this[p].push(l)}delete(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.delete"});r=h.converters.USVString(r);this[p]=this[p].filter((i=>i.name!==r))}get(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.get"});r=h.converters.USVString(r);const i=this[p].findIndex((i=>i.name===r));if(i===-1){return null}return this[p][i].value}getAll(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.getAll"});r=h.converters.USVString(r);return this[p].filter((i=>i.name===r)).map((r=>r.value))}has(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.has"});r=h.converters.USVString(r);return this[p].findIndex((i=>i.name===r))!==-1}set(r,i,a=undefined){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,2,{header:"FormData.set"});if(arguments.length===3&&!s(i)){throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'")}r=h.converters.USVString(r);i=s(i)?h.converters.Blob(i,{strict:false}):h.converters.USVString(i);a=arguments.length===3?l(a):undefined;const c=makeEntry(r,i,a);const d=this[p].findIndex((i=>i.name===r));if(d!==-1){this[p]=[...this[p].slice(0,d),c,...this[p].slice(d+1).filter((i=>i.name!==r))]}else{this[p].push(c)}}entries(){h.brandCheck(this,FormData);return c((()=>this[p].map((r=>[r.name,r.value]))),"FormData","key+value")}keys(){h.brandCheck(this,FormData);return c((()=>this[p].map((r=>[r.name,r.value]))),"FormData","key")}values(){h.brandCheck(this,FormData);return c((()=>this[p].map((r=>[r.name,r.value]))),"FormData","value")}forEach(r,i=globalThis){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.forEach"});if(typeof r!=="function"){throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.")}for(const[a,s]of this){r.apply(i,[s,a,this])}}}FormData.prototype[Symbol.iterator]=FormData.prototype.entries;Object.defineProperties(FormData.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:true}});function makeEntry(r,i,a){r=Buffer.from(r).toString("utf8");if(typeof i==="string"){i=Buffer.from(i).toString("utf8")}else{if(!A(i)){i=i instanceof g?new E([i],"blob",{type:i.type}):new u(i,"blob",{type:i.type})}if(a!==undefined){const r={type:i.type,lastModified:i.lastModified};i=y&&i instanceof y||i instanceof d?new E([i],a,r):new u(i,a,r)}}return{name:r,value:i}}r.exports={FormData:FormData}},46670:r=>{"use strict";const i=Symbol.for("undici.globalOrigin.1");function getGlobalOrigin(){return globalThis[i]}function setGlobalOrigin(r){if(r===undefined){Object.defineProperty(globalThis,i,{value:undefined,writable:true,enumerable:false,configurable:false});return}const a=new URL(r);if(a.protocol!=="http:"&&a.protocol!=="https:"){throw new TypeError(`Only http & https urls are allowed, received ${a.protocol}`)}Object.defineProperty(globalThis,i,{value:a,writable:true,enumerable:false,configurable:false})}r.exports={getGlobalOrigin:getGlobalOrigin,setGlobalOrigin:setGlobalOrigin}},8247:(r,i,a)=>{"use strict";const{kHeadersList:s,kConstruct:l}=a(31915);const{kGuard:c}=a(9411);const{kEnumerableProperty:p}=a(94766);const{makeIterator:d,isValidHeaderName:u,isValidHeaderValue:A}=a(40336);const{webidl:h}=a(87591);const g=a(39491);const y=Symbol("headers map");const E=Symbol("headers map sorted");function isHTTPWhiteSpaceCharCode(r){return r===10||r===13||r===9||r===32}function headerValueNormalize(r){let i=0;let a=r.length;while(a>i&&isHTTPWhiteSpaceCharCode(r.charCodeAt(a-1)))--a;while(a>i&&isHTTPWhiteSpaceCharCode(r.charCodeAt(i)))++i;return i===0&&a===r.length?r:r.substring(i,a)}function fill(r,i){if(Array.isArray(i)){for(let a=0;a>","record"]})}}function appendHeader(r,i,a){a=headerValueNormalize(a);if(!u(i)){throw h.errors.invalidArgument({prefix:"Headers.append",value:i,type:"header name"})}else if(!A(a)){throw h.errors.invalidArgument({prefix:"Headers.append",value:a,type:"header value"})}if(r[c]==="immutable"){throw new TypeError("immutable")}else if(r[c]==="request-no-cors"){}return r[s].append(i,a)}class HeadersList{cookies=null;constructor(r){if(r instanceof HeadersList){this[y]=new Map(r[y]);this[E]=r[E];this.cookies=r.cookies===null?null:[...r.cookies]}else{this[y]=new Map(r);this[E]=null}}contains(r){r=r.toLowerCase();return this[y].has(r)}clear(){this[y].clear();this[E]=null;this.cookies=null}append(r,i){this[E]=null;const a=r.toLowerCase();const s=this[y].get(a);if(s){const r=a==="cookie"?"; ":", ";this[y].set(a,{name:s.name,value:`${s.value}${r}${i}`})}else{this[y].set(a,{name:r,value:i})}if(a==="set-cookie"){this.cookies??=[];this.cookies.push(i)}}set(r,i){this[E]=null;const a=r.toLowerCase();if(a==="set-cookie"){this.cookies=[i]}this[y].set(a,{name:r,value:i})}delete(r){this[E]=null;r=r.toLowerCase();if(r==="set-cookie"){this.cookies=null}this[y].delete(r)}get(r){const i=this[y].get(r.toLowerCase());return i===undefined?null:i.value}*[Symbol.iterator](){for(const[r,{value:i}]of this[y]){yield[r,i]}}get entries(){const r={};if(this[y].size){for(const{name:i,value:a}of this[y].values()){r[i]=a}}return r}}class Headers{constructor(r=undefined){if(r===l){return}this[s]=new HeadersList;this[c]="none";if(r!==undefined){r=h.converters.HeadersInit(r);fill(this,r)}}append(r,i){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,2,{header:"Headers.append"});r=h.converters.ByteString(r);i=h.converters.ByteString(i);return appendHeader(this,r,i)}delete(r){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.delete"});r=h.converters.ByteString(r);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.delete",value:r,type:"header name"})}if(this[c]==="immutable"){throw new TypeError("immutable")}else if(this[c]==="request-no-cors"){}if(!this[s].contains(r)){return}this[s].delete(r)}get(r){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.get"});r=h.converters.ByteString(r);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.get",value:r,type:"header name"})}return this[s].get(r)}has(r){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.has"});r=h.converters.ByteString(r);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.has",value:r,type:"header name"})}return this[s].contains(r)}set(r,i){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,2,{header:"Headers.set"});r=h.converters.ByteString(r);i=h.converters.ByteString(i);i=headerValueNormalize(i);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.set",value:r,type:"header name"})}else if(!A(i)){throw h.errors.invalidArgument({prefix:"Headers.set",value:i,type:"header value"})}if(this[c]==="immutable"){throw new TypeError("immutable")}else if(this[c]==="request-no-cors"){}this[s].set(r,i)}getSetCookie(){h.brandCheck(this,Headers);const r=this[s].cookies;if(r){return[...r]}return[]}get[E](){if(this[s][E]){return this[s][E]}const r=[];const i=[...this[s]].sort(((r,i)=>r[0]r),"Headers","key")}return d((()=>[...this[E].values()]),"Headers","key")}values(){h.brandCheck(this,Headers);if(this[c]==="immutable"){const r=this[E];return d((()=>r),"Headers","value")}return d((()=>[...this[E].values()]),"Headers","value")}entries(){h.brandCheck(this,Headers);if(this[c]==="immutable"){const r=this[E];return d((()=>r),"Headers","key+value")}return d((()=>[...this[E].values()]),"Headers","key+value")}forEach(r,i=globalThis){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.forEach"});if(typeof r!=="function"){throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.")}for(const[a,s]of this){r.apply(i,[s,a,this])}}[Symbol.for("nodejs.util.inspect.custom")](){h.brandCheck(this,Headers);return this[s]}}Headers.prototype[Symbol.iterator]=Headers.prototype.entries;Object.defineProperties(Headers.prototype,{append:p,delete:p,get:p,has:p,set:p,getSetCookie:p,keys:p,values:p,entries:p,forEach:p,[Symbol.iterator]:{enumerable:false},[Symbol.toStringTag]:{value:"Headers",configurable:true}});h.converters.HeadersInit=function(r){if(h.util.Type(r)==="Object"){if(r[Symbol.iterator]){return h.converters["sequence>"](r)}return h.converters["record"](r)}throw h.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};r.exports={fill:fill,Headers:Headers,HeadersList:HeadersList}},79890:(r,i,a)=>{"use strict";const{Response:s,makeNetworkError:l,makeAppropriateNetworkError:c,filterResponse:p,makeResponse:d}=a(55032);const{Headers:u}=a(8247);const{Request:A,makeRequest:h}=a(11287);const g=a(59796);const{bytesMatch:y,makePolicyContainer:E,clonePolicyContainer:b,requestBadPort:C,TAOCheck:v,appendRequestOriginHeader:B,responseLocationURL:I,requestCurrentURL:w,setRequestReferrerPolicyOnRedirect:S,tryUpgradeRequestToAPotentiallyTrustworthyURL:Q,createOpaqueTimingInfo:x,appendFetchMetadata:N,corsCheck:R,crossOriginResourcePolicyCheck:T,determineRequestsReferrer:D,coarsenedSharedCurrentTime:k,createDeferredPromise:_,isBlobLike:O,sameOrigin:P,isCancelled:L,isAborted:M,isErrorLike:U,fullyReadBody:q,readableStreamClose:H,isomorphicEncode:j,urlIsLocal:G,urlIsHttpHttpsScheme:z,urlHasHttpsScheme:V}=a(40336);const{kState:J,kHeaders:Y,kGuard:W,kRealm:X}=a(9411);const K=a(39491);const{safelyExtractBody:$}=a(21254);const{redirectStatusSet:Z,nullBodyStatus:ee,safeMethodsSet:te,requestBodyHeader:re,subresourceSet:ie,DOMException:ne}=a(67296);const{kHeadersList:ae}=a(31915);const se=a(82361);const{Readable:oe,pipeline:le}=a(12781);const{addAbortListener:ce,isErrored:pe,isReadable:de,nodeMajor:ue,nodeMinor:Ae}=a(94766);const{dataURLProcessor:me,serializeAMimeType:fe}=a(80097);const{TransformStream:he}=a(35356);const{getGlobalDispatcher:ge}=a(18826);const{webidl:ye}=a(87591);const{STATUS_CODES:Ee}=a(13685);const be=["GET","HEAD"];let Ce;let ve=globalThis.ReadableStream;class Fetch extends se{constructor(r){super();this.dispatcher=r;this.connection=null;this.dump=false;this.state="ongoing";this.setMaxListeners(21)}terminate(r){if(this.state!=="ongoing"){return}this.state="terminated";this.connection?.destroy(r);this.emit("terminated",r)}abort(r){if(this.state!=="ongoing"){return}this.state="aborted";if(!r){r=new ne("The operation was aborted.","AbortError")}this.serializedAbortReason=r;this.connection?.destroy(r);this.emit("terminated",r)}}function fetch(r,i={}){ye.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});const a=_();let l;try{l=new A(r,i)}catch(r){a.reject(r);return a.promise}const c=l[J];if(l.signal.aborted){abortFetch(a,c,null,l.signal.reason);return a.promise}const p=c.client.globalObject;if(p?.constructor?.name==="ServiceWorkerGlobalScope"){c.serviceWorkers="none"}let d=null;const u=null;let h=false;let g=null;ce(l.signal,(()=>{h=true;K(g!=null);g.abort(l.signal.reason);abortFetch(a,c,d,l.signal.reason)}));const handleFetchDone=r=>finalizeAndReportTiming(r,"fetch");const processResponse=r=>{if(h){return Promise.resolve()}if(r.aborted){abortFetch(a,c,d,g.serializedAbortReason);return Promise.resolve()}if(r.type==="error"){a.reject(Object.assign(new TypeError("fetch failed"),{cause:r.error}));return Promise.resolve()}d=new s;d[J]=r;d[X]=u;d[Y][ae]=r.headersList;d[Y][W]="immutable";d[Y][X]=u;a.resolve(d)};g=fetching({request:c,processResponseEndOfBody:handleFetchDone,processResponse:processResponse,dispatcher:i.dispatcher??ge()});return a.promise}function finalizeAndReportTiming(r,i="other"){if(r.type==="error"&&r.aborted){return}if(!r.urlList?.length){return}const a=r.urlList[0];let s=r.timingInfo;let l=r.cacheState;if(!z(a)){return}if(s===null){return}if(!r.timingAllowPassed){s=x({startTime:s.startTime});l=""}s.endTime=k();r.timingInfo=s;markResourceTiming(s,a,i,globalThis,l)}function markResourceTiming(r,i,a,s,l){if(ue>18||ue===18&&Ae>=2){performance.markResourceTiming(r,i.href,a,s,l)}}function abortFetch(r,i,a,s){if(!s){s=new ne("The operation was aborted.","AbortError")}r.reject(s);if(i.body!=null&&de(i.body?.stream)){i.body.stream.cancel(s).catch((r=>{if(r.code==="ERR_INVALID_STATE"){return}throw r}))}if(a==null){return}const l=a[J];if(l.body!=null&&de(l.body?.stream)){l.body.stream.cancel(s).catch((r=>{if(r.code==="ERR_INVALID_STATE"){return}throw r}))}}function fetching({request:r,processRequestBodyChunkLength:i,processRequestEndOfBody:a,processResponse:s,processResponseEndOfBody:l,processResponseConsumeBody:c,useParallelQueue:p=false,dispatcher:d}){let u=null;let A=false;if(r.client!=null){u=r.client.globalObject;A=r.client.crossOriginIsolatedCapability}const h=k(A);const g=x({startTime:h});const y={controller:new Fetch(d),request:r,timingInfo:g,processRequestBodyChunkLength:i,processRequestEndOfBody:a,processResponse:s,processResponseConsumeBody:c,processResponseEndOfBody:l,taskDestination:u,crossOriginIsolatedCapability:A};K(!r.body||r.body.stream);if(r.window==="client"){r.window=r.client?.globalObject?.constructor?.name==="Window"?r.client:"no-window"}if(r.origin==="client"){r.origin=r.client?.origin}if(r.policyContainer==="client"){if(r.client!=null){r.policyContainer=b(r.client.policyContainer)}else{r.policyContainer=E()}}if(!r.headersList.contains("accept")){const i="*/*";r.headersList.append("accept",i)}if(!r.headersList.contains("accept-language")){r.headersList.append("accept-language","*")}if(r.priority===null){}if(ie.has(r.destination)){}mainFetch(y).catch((r=>{y.controller.terminate(r)}));return y.controller}async function mainFetch(r,i=false){const a=r.request;let s=null;if(a.localURLsOnly&&!G(w(a))){s=l("local URLs only")}Q(a);if(C(a)==="blocked"){s=l("bad port")}if(a.referrerPolicy===""){a.referrerPolicy=a.policyContainer.referrerPolicy}if(a.referrer!=="no-referrer"){a.referrer=D(a)}if(s===null){s=await(async()=>{const i=w(a);if(P(i,a.url)&&a.responseTainting==="basic"||i.protocol==="data:"||(a.mode==="navigate"||a.mode==="websocket")){a.responseTainting="basic";return await schemeFetch(r)}if(a.mode==="same-origin"){return l('request mode cannot be "same-origin"')}if(a.mode==="no-cors"){if(a.redirect!=="follow"){return l('redirect mode cannot be "follow" for "no-cors" request')}a.responseTainting="opaque";return await schemeFetch(r)}if(!z(w(a))){return l("URL scheme must be a HTTP(S) scheme")}a.responseTainting="cors";return await httpFetch(r)})()}if(i){return s}if(s.status!==0&&!s.internalResponse){if(a.responseTainting==="cors"){}if(a.responseTainting==="basic"){s=p(s,"basic")}else if(a.responseTainting==="cors"){s=p(s,"cors")}else if(a.responseTainting==="opaque"){s=p(s,"opaque")}else{K(false)}}let c=s.status===0?s:s.internalResponse;if(c.urlList.length===0){c.urlList.push(...a.urlList)}if(!a.timingAllowFailed){s.timingAllowPassed=true}if(s.type==="opaque"&&c.status===206&&c.rangeRequested&&!a.headers.contains("range")){s=c=l()}if(s.status!==0&&(a.method==="HEAD"||a.method==="CONNECT"||ee.includes(c.status))){c.body=null;r.controller.dump=true}if(a.integrity){const processBodyError=i=>fetchFinale(r,l(i));if(a.responseTainting==="opaque"||s.body==null){processBodyError(s.error);return}const processBody=i=>{if(!y(i,a.integrity)){processBodyError("integrity mismatch");return}s.body=$(i)[0];fetchFinale(r,s)};await q(s.body,processBody,processBodyError)}else{fetchFinale(r,s)}}function schemeFetch(r){if(L(r)&&r.request.redirectCount===0){return Promise.resolve(c(r))}const{request:i}=r;const{protocol:s}=w(i);switch(s){case"about:":{return Promise.resolve(l("about scheme is not supported"))}case"blob:":{if(!Ce){Ce=a(14300).resolveObjectURL}const r=w(i);if(r.search.length!==0){return Promise.resolve(l("NetworkError when attempting to fetch resource."))}const s=Ce(r.toString());if(i.method!=="GET"||!O(s)){return Promise.resolve(l("invalid method"))}const c=$(s);const p=c[0];const u=j(`${p.length}`);const A=c[1]??"";const h=d({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:u}],["content-type",{name:"Content-Type",value:A}]]});h.body=p;return Promise.resolve(h)}case"data:":{const r=w(i);const a=me(r);if(a==="failure"){return Promise.resolve(l("failed to fetch the data URL"))}const s=fe(a.mimeType);return Promise.resolve(d({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:$(a.body)[0]}))}case"file:":{return Promise.resolve(l("not implemented... yet..."))}case"http:":case"https:":{return httpFetch(r).catch((r=>l(r)))}default:{return Promise.resolve(l("unknown scheme"))}}}function finalizeResponse(r,i){r.request.done=true;if(r.processResponseDone!=null){queueMicrotask((()=>r.processResponseDone(i)))}}function fetchFinale(r,i){if(i.type==="error"){i.urlList=[r.request.urlList[0]];i.timingInfo=x({startTime:r.timingInfo.startTime})}const processResponseEndOfBody=()=>{r.request.done=true;if(r.processResponseEndOfBody!=null){queueMicrotask((()=>r.processResponseEndOfBody(i)))}};if(r.processResponse!=null){queueMicrotask((()=>r.processResponse(i)))}if(i.body==null){processResponseEndOfBody()}else{const identityTransformAlgorithm=(r,i)=>{i.enqueue(r)};const r=new he({start(){},transform:identityTransformAlgorithm,flush:processResponseEndOfBody},{size(){return 1}},{size(){return 1}});i.body={stream:i.body.stream.pipeThrough(r)}}if(r.processResponseConsumeBody!=null){const processBody=a=>r.processResponseConsumeBody(i,a);const processBodyError=a=>r.processResponseConsumeBody(i,a);if(i.body==null){queueMicrotask((()=>processBody(null)))}else{return q(i.body,processBody,processBodyError)}return Promise.resolve()}}async function httpFetch(r){const i=r.request;let a=null;let s=null;const c=r.timingInfo;if(i.serviceWorkers==="all"){}if(a===null){if(i.redirect==="follow"){i.serviceWorkers="none"}s=a=await httpNetworkOrCacheFetch(r);if(i.responseTainting==="cors"&&R(i,a)==="failure"){return l("cors failure")}if(v(i,a)==="failure"){i.timingAllowFailed=true}}if((i.responseTainting==="opaque"||a.type==="opaque")&&T(i.origin,i.client,i.destination,s)==="blocked"){return l("blocked")}if(Z.has(s.status)){if(i.redirect!=="manual"){r.controller.connection.destroy()}if(i.redirect==="error"){a=l("unexpected redirect")}else if(i.redirect==="manual"){a=s}else if(i.redirect==="follow"){a=await httpRedirectFetch(r,a)}else{K(false)}}a.timingInfo=c;return a}function httpRedirectFetch(r,i){const a=r.request;const s=i.internalResponse?i.internalResponse:i;let c;try{c=I(s,w(a).hash);if(c==null){return i}}catch(r){return Promise.resolve(l(r))}if(!z(c)){return Promise.resolve(l("URL scheme must be a HTTP(S) scheme"))}if(a.redirectCount===20){return Promise.resolve(l("redirect count exceeded"))}a.redirectCount+=1;if(a.mode==="cors"&&(c.username||c.password)&&!P(a,c)){return Promise.resolve(l('cross origin not allowed for request mode "cors"'))}if(a.responseTainting==="cors"&&(c.username||c.password)){return Promise.resolve(l('URL cannot contain credentials for request mode "cors"'))}if(s.status!==303&&a.body!=null&&a.body.source==null){return Promise.resolve(l())}if([301,302].includes(s.status)&&a.method==="POST"||s.status===303&&!be.includes(a.method)){a.method="GET";a.body=null;for(const r of re){a.headersList.delete(r)}}if(!P(w(a),c)){a.headersList.delete("authorization");a.headersList.delete("proxy-authorization",true);a.headersList.delete("cookie");a.headersList.delete("host")}if(a.body!=null){K(a.body.source!=null);a.body=$(a.body.source)[0]}const p=r.timingInfo;p.redirectEndTime=p.postRedirectStartTime=k(r.crossOriginIsolatedCapability);if(p.redirectStartTime===0){p.redirectStartTime=p.startTime}a.urlList.push(c);S(a,s);return mainFetch(r,true)}async function httpNetworkOrCacheFetch(r,i=false,a=false){const s=r.request;let p=null;let d=null;let u=null;const A=null;const g=false;if(s.window==="no-window"&&s.redirect==="error"){p=r;d=s}else{d=h(s);p={...r};p.request=d}const y=s.credentials==="include"||s.credentials==="same-origin"&&s.responseTainting==="basic";const E=d.body?d.body.length:null;let b=null;if(d.body==null&&["POST","PUT"].includes(d.method)){b="0"}if(E!=null){b=j(`${E}`)}if(b!=null){d.headersList.append("content-length",b)}if(E!=null&&d.keepalive){}if(d.referrer instanceof URL){d.headersList.append("referer",j(d.referrer.href))}B(d);N(d);if(!d.headersList.contains("user-agent")){d.headersList.append("user-agent",typeof esbuildDetection==="undefined"?"undici":"node")}if(d.cache==="default"&&(d.headersList.contains("if-modified-since")||d.headersList.contains("if-none-match")||d.headersList.contains("if-unmodified-since")||d.headersList.contains("if-match")||d.headersList.contains("if-range"))){d.cache="no-store"}if(d.cache==="no-cache"&&!d.preventNoCacheCacheControlHeaderModification&&!d.headersList.contains("cache-control")){d.headersList.append("cache-control","max-age=0")}if(d.cache==="no-store"||d.cache==="reload"){if(!d.headersList.contains("pragma")){d.headersList.append("pragma","no-cache")}if(!d.headersList.contains("cache-control")){d.headersList.append("cache-control","no-cache")}}if(d.headersList.contains("range")){d.headersList.append("accept-encoding","identity")}if(!d.headersList.contains("accept-encoding")){if(V(w(d))){d.headersList.append("accept-encoding","br, gzip, deflate")}else{d.headersList.append("accept-encoding","gzip, deflate")}}d.headersList.delete("host");if(y){}if(A==null){d.cache="no-store"}if(d.mode!=="no-store"&&d.mode!=="reload"){}if(u==null){if(d.mode==="only-if-cached"){return l("only if cached")}const r=await httpNetworkFetch(p,y,a);if(!te.has(d.method)&&r.status>=200&&r.status<=399){}if(g&&r.status===304){}if(u==null){u=r}}u.urlList=[...d.urlList];if(d.headersList.contains("range")){u.rangeRequested=true}u.requestIncludesCredentials=y;if(u.status===407){if(s.window==="no-window"){return l()}if(L(r)){return c(r)}return l("proxy authentication required")}if(u.status===421&&!a&&(s.body==null||s.body.source!=null)){if(L(r)){return c(r)}r.controller.connection.destroy();u=await httpNetworkOrCacheFetch(r,i,true)}if(i){}return u}async function httpNetworkFetch(r,i=false,s=false){K(!r.controller.connection||r.controller.connection.destroyed);r.controller.connection={abort:null,destroyed:false,destroy(r){if(!this.destroyed){this.destroyed=true;this.abort?.(r??new ne("The operation was aborted.","AbortError"))}}};const p=r.request;let A=null;const h=r.timingInfo;const y=null;if(y==null){p.cache="no-store"}const E=s?"yes":"no";if(p.mode==="websocket"){}else{}let b=null;if(p.body==null&&r.processRequestEndOfBody){queueMicrotask((()=>r.processRequestEndOfBody()))}else if(p.body!=null){const processBodyChunk=async function*(i){if(L(r)){return}yield i;r.processRequestBodyChunkLength?.(i.byteLength)};const processEndOfBody=()=>{if(L(r)){return}if(r.processRequestEndOfBody){r.processRequestEndOfBody()}};const processBodyError=i=>{if(L(r)){return}if(i.name==="AbortError"){r.controller.abort()}else{r.controller.terminate(i)}};b=async function*(){try{for await(const r of p.body.stream){yield*processBodyChunk(r)}processEndOfBody()}catch(r){processBodyError(r)}}()}try{const{body:i,status:a,statusText:s,headersList:l,socket:c}=await dispatch({body:b});if(c){A=d({status:a,statusText:s,headersList:l,socket:c})}else{const c=i[Symbol.asyncIterator]();r.controller.next=()=>c.next();A=d({status:a,statusText:s,headersList:l})}}catch(i){if(i.name==="AbortError"){r.controller.connection.destroy();return c(r,i)}return l(i)}const pullAlgorithm=()=>{r.controller.resume()};const cancelAlgorithm=i=>{r.controller.abort(i)};if(!ve){ve=a(35356).ReadableStream}const C=new ve({async start(i){r.controller.controller=i},async pull(r){await pullAlgorithm(r)},async cancel(r){await cancelAlgorithm(r)}},{highWaterMark:0,size(){return 1}});A.body={stream:C};r.controller.on("terminated",onAborted);r.controller.resume=async()=>{while(true){let i;let a;try{const{done:a,value:s}=await r.controller.next();if(M(r)){break}i=a?undefined:s}catch(s){if(r.controller.ended&&!h.encodedBodySize){i=undefined}else{i=s;a=true}}if(i===undefined){H(r.controller.controller);finalizeResponse(r,A);return}h.decodedBodySize+=i?.byteLength??0;if(a){r.controller.terminate(i);return}r.controller.controller.enqueue(new Uint8Array(i));if(pe(C)){r.controller.terminate();return}if(!r.controller.controller.desiredSize){return}}};function onAborted(i){if(M(r)){A.aborted=true;if(de(C)){r.controller.controller.error(r.controller.serializedAbortReason)}}else{if(de(C)){r.controller.controller.error(new TypeError("terminated",{cause:U(i)?i:undefined}))}}r.controller.connection.destroy()}return A;async function dispatch({body:i}){const a=w(p);const s=r.controller.dispatcher;return new Promise(((l,c)=>s.dispatch({path:a.pathname+a.search,origin:a.origin,method:p.method,body:r.controller.dispatcher.isMockActive?p.body&&(p.body.source||p.body.stream):i,headers:p.headersList.entries,maxRedirections:0,upgrade:p.mode==="websocket"?"websocket":undefined},{body:null,abort:null,onConnect(i){const{connection:a}=r.controller;if(a.destroyed){i(new ne("The operation was aborted.","AbortError"))}else{r.controller.on("terminated",i);this.abort=a.abort=i}},onHeaders(r,i,a,s){if(r<200){return}let c=[];let d="";const A=new u;if(Array.isArray(i)){for(let r=0;rr.trim()))}else if(a.toLowerCase()==="location"){d=s}A[ae].append(a,s)}}else{const r=Object.keys(i);for(const a of r){const r=i[a];if(a.toLowerCase()==="content-encoding"){c=r.toLowerCase().split(",").map((r=>r.trim())).reverse()}else if(a.toLowerCase()==="location"){d=r}A[ae].append(a,r)}}this.body=new oe({read:a});const h=[];const y=p.redirect==="follow"&&d&&Z.has(r);if(p.method!=="HEAD"&&p.method!=="CONNECT"&&!ee.includes(r)&&!y){for(const r of c){if(r==="x-gzip"||r==="gzip"){h.push(g.createGunzip({flush:g.constants.Z_SYNC_FLUSH,finishFlush:g.constants.Z_SYNC_FLUSH}))}else if(r==="deflate"){h.push(g.createInflate())}else if(r==="br"){h.push(g.createBrotliDecompress())}else{h.length=0;break}}}l({status:r,statusText:s,headersList:A[ae],body:h.length?le(this.body,...h,(()=>{})):this.body.on("error",(()=>{}))});return true},onData(i){if(r.controller.dump){return}const a=i;h.encodedBodySize+=a.byteLength;return this.body.push(a)},onComplete(){if(this.abort){r.controller.off("terminated",this.abort)}r.controller.ended=true;this.body.push(null)},onError(i){if(this.abort){r.controller.off("terminated",this.abort)}this.body?.destroy(i);r.controller.terminate(i);c(i)},onUpgrade(r,i,a){if(r!==101){return}const s=new u;for(let r=0;r{"use strict";const{extractBody:s,mixinBody:l,cloneBody:c}=a(21254);const{Headers:p,fill:d,HeadersList:u}=a(8247);const{FinalizationRegistry:A}=a(17428)();const h=a(94766);const{isValidHTTPToken:g,sameOrigin:y,normalizeMethod:E,makePolicyContainer:b,normalizeMethodRecord:C}=a(40336);const{forbiddenMethodsSet:v,corsSafeListedMethodsSet:B,referrerPolicy:I,requestRedirect:w,requestMode:S,requestCredentials:Q,requestCache:x,requestDuplex:N}=a(67296);const{kEnumerableProperty:R}=h;const{kHeaders:T,kSignal:D,kState:k,kGuard:_,kRealm:O}=a(9411);const{webidl:P}=a(87591);const{getGlobalOrigin:L}=a(46670);const{URLSerializer:M}=a(80097);const{kHeadersList:U,kConstruct:q}=a(31915);const H=a(39491);const{getMaxListeners:j,setMaxListeners:G,getEventListeners:z,defaultMaxListeners:V}=a(82361);let J=globalThis.TransformStream;const Y=Symbol("abortController");const W=new A((({signal:r,abort:i})=>{r.removeEventListener("abort",i)}));class Request{constructor(r,i={}){if(r===q){return}P.argumentLengthCheck(arguments,1,{header:"Request constructor"});r=P.converters.RequestInfo(r);i=P.converters.RequestInit(i);this[O]={settingsObject:{baseUrl:L(),get origin(){return this.baseUrl?.origin},policyContainer:b()}};let l=null;let c=null;const A=this[O].settingsObject.baseUrl;let I=null;if(typeof r==="string"){let i;try{i=new URL(r,A)}catch(i){throw new TypeError("Failed to parse URL from "+r,{cause:i})}if(i.username||i.password){throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+r)}l=makeRequest({urlList:[i]});c="cors"}else{H(r instanceof Request);l=r[k];I=r[D]}const w=this[O].settingsObject.origin;let S="client";if(l.window?.constructor?.name==="EnvironmentSettingsObject"&&y(l.window,w)){S=l.window}if(i.window!=null){throw new TypeError(`'window' option '${S}' must be null`)}if("window"in i){S="no-window"}l=makeRequest({method:l.method,headersList:l.headersList,unsafeRequest:l.unsafeRequest,client:this[O].settingsObject,window:S,priority:l.priority,origin:l.origin,referrer:l.referrer,referrerPolicy:l.referrerPolicy,mode:l.mode,credentials:l.credentials,cache:l.cache,redirect:l.redirect,integrity:l.integrity,keepalive:l.keepalive,reloadNavigation:l.reloadNavigation,historyNavigation:l.historyNavigation,urlList:[...l.urlList]});const Q=Object.keys(i).length!==0;if(Q){if(l.mode==="navigate"){l.mode="same-origin"}l.reloadNavigation=false;l.historyNavigation=false;l.origin="client";l.referrer="client";l.referrerPolicy="";l.url=l.urlList[l.urlList.length-1];l.urlList=[l.url]}if(i.referrer!==undefined){const r=i.referrer;if(r===""){l.referrer="no-referrer"}else{let i;try{i=new URL(r,A)}catch(i){throw new TypeError(`Referrer "${r}" is not a valid URL.`,{cause:i})}if(i.protocol==="about:"&&i.hostname==="client"||w&&!y(i,this[O].settingsObject.baseUrl)){l.referrer="client"}else{l.referrer=i}}}if(i.referrerPolicy!==undefined){l.referrerPolicy=i.referrerPolicy}let x;if(i.mode!==undefined){x=i.mode}else{x=c}if(x==="navigate"){throw P.errors.exception({header:"Request constructor",message:"invalid request mode navigate."})}if(x!=null){l.mode=x}if(i.credentials!==undefined){l.credentials=i.credentials}if(i.cache!==undefined){l.cache=i.cache}if(l.cache==="only-if-cached"&&l.mode!=="same-origin"){throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode")}if(i.redirect!==undefined){l.redirect=i.redirect}if(i.integrity!=null){l.integrity=String(i.integrity)}if(i.keepalive!==undefined){l.keepalive=Boolean(i.keepalive)}if(i.method!==undefined){let r=i.method;if(!g(r)){throw new TypeError(`'${r}' is not a valid HTTP method.`)}if(v.has(r.toUpperCase())){throw new TypeError(`'${r}' HTTP method is unsupported.`)}r=C[r]??E(r);l.method=r}if(i.signal!==undefined){I=i.signal}this[k]=l;const N=new AbortController;this[D]=N.signal;this[D][O]=this[O];if(I!=null){if(!I||typeof I.aborted!=="boolean"||typeof I.addEventListener!=="function"){throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.")}if(I.aborted){N.abort(I.reason)}else{this[Y]=N;const r=new WeakRef(N);const abort=function(){const i=r.deref();if(i!==undefined){i.abort(this.reason)}};try{if(typeof j==="function"&&j(I)===V){G(100,I)}else if(z(I,"abort").length>=V){G(100,I)}}catch{}h.addAbortListener(I,abort);W.register(N,{signal:I,abort:abort})}}this[T]=new p(q);this[T][U]=l.headersList;this[T][_]="request";this[T][O]=this[O];if(x==="no-cors"){if(!B.has(l.method)){throw new TypeError(`'${l.method} is unsupported in no-cors mode.`)}this[T][_]="request-no-cors"}if(Q){const r=this[T][U];const a=i.headers!==undefined?i.headers:new u(r);r.clear();if(a instanceof u){for(const[i,s]of a){r.append(i,s)}r.cookies=a.cookies}else{d(this[T],a)}}const R=r instanceof Request?r[k].body:null;if((i.body!=null||R!=null)&&(l.method==="GET"||l.method==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body.")}let M=null;if(i.body!=null){const[r,a]=s(i.body,l.keepalive);M=r;if(a&&!this[T][U].contains("content-type")){this[T].append("content-type",a)}}const X=M??R;if(X!=null&&X.source==null){if(M!=null&&i.duplex==null){throw new TypeError("RequestInit: duplex option is required when sending a body.")}if(l.mode!=="same-origin"&&l.mode!=="cors"){throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"')}l.useCORSPreflightFlag=true}let K=X;if(M==null&&R!=null){if(h.isDisturbed(R.stream)||R.stream.locked){throw new TypeError("Cannot construct a Request with a Request object that has already been used.")}if(!J){J=a(35356).TransformStream}const r=new J;R.stream.pipeThrough(r);K={source:R.source,length:R.length,stream:r.readable}}this[k].body=K}get method(){P.brandCheck(this,Request);return this[k].method}get url(){P.brandCheck(this,Request);return M(this[k].url)}get headers(){P.brandCheck(this,Request);return this[T]}get destination(){P.brandCheck(this,Request);return this[k].destination}get referrer(){P.brandCheck(this,Request);if(this[k].referrer==="no-referrer"){return""}if(this[k].referrer==="client"){return"about:client"}return this[k].referrer.toString()}get referrerPolicy(){P.brandCheck(this,Request);return this[k].referrerPolicy}get mode(){P.brandCheck(this,Request);return this[k].mode}get credentials(){return this[k].credentials}get cache(){P.brandCheck(this,Request);return this[k].cache}get redirect(){P.brandCheck(this,Request);return this[k].redirect}get integrity(){P.brandCheck(this,Request);return this[k].integrity}get keepalive(){P.brandCheck(this,Request);return this[k].keepalive}get isReloadNavigation(){P.brandCheck(this,Request);return this[k].reloadNavigation}get isHistoryNavigation(){P.brandCheck(this,Request);return this[k].historyNavigation}get signal(){P.brandCheck(this,Request);return this[D]}get body(){P.brandCheck(this,Request);return this[k].body?this[k].body.stream:null}get bodyUsed(){P.brandCheck(this,Request);return!!this[k].body&&h.isDisturbed(this[k].body.stream)}get duplex(){P.brandCheck(this,Request);return"half"}clone(){P.brandCheck(this,Request);if(this.bodyUsed||this.body?.locked){throw new TypeError("unusable")}const r=cloneRequest(this[k]);const i=new Request(q);i[k]=r;i[O]=this[O];i[T]=new p(q);i[T][U]=r.headersList;i[T][_]=this[T][_];i[T][O]=this[T][O];const a=new AbortController;if(this.signal.aborted){a.abort(this.signal.reason)}else{h.addAbortListener(this.signal,(()=>{a.abort(this.signal.reason)}))}i[D]=a.signal;return i}}l(Request);function makeRequest(r){const i={method:"GET",localURLsOnly:false,unsafeRequest:false,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:false,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:false,credentials:"same-origin",useCredentials:false,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:false,historyNavigation:false,userActivation:false,taintedOrigin:false,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:false,done:false,timingAllowFailed:false,...r,headersList:r.headersList?new u(r.headersList):new u};i.url=i.urlList[0];return i}function cloneRequest(r){const i=makeRequest({...r,body:null});if(r.body!=null){i.body=c(r.body)}return i}Object.defineProperties(Request.prototype,{method:R,url:R,headers:R,redirect:R,clone:R,signal:R,duplex:R,destination:R,body:R,bodyUsed:R,isHistoryNavigation:R,isReloadNavigation:R,keepalive:R,integrity:R,cache:R,credentials:R,attribute:R,referrerPolicy:R,referrer:R,mode:R,[Symbol.toStringTag]:{value:"Request",configurable:true}});P.converters.Request=P.interfaceConverter(Request);P.converters.RequestInfo=function(r){if(typeof r==="string"){return P.converters.USVString(r)}if(r instanceof Request){return P.converters.Request(r)}return P.converters.USVString(r)};P.converters.AbortSignal=P.interfaceConverter(AbortSignal);P.converters.RequestInit=P.dictionaryConverter([{key:"method",converter:P.converters.ByteString},{key:"headers",converter:P.converters.HeadersInit},{key:"body",converter:P.nullableConverter(P.converters.BodyInit)},{key:"referrer",converter:P.converters.USVString},{key:"referrerPolicy",converter:P.converters.DOMString,allowedValues:I},{key:"mode",converter:P.converters.DOMString,allowedValues:S},{key:"credentials",converter:P.converters.DOMString,allowedValues:Q},{key:"cache",converter:P.converters.DOMString,allowedValues:x},{key:"redirect",converter:P.converters.DOMString,allowedValues:w},{key:"integrity",converter:P.converters.DOMString},{key:"keepalive",converter:P.converters.boolean},{key:"signal",converter:P.nullableConverter((r=>P.converters.AbortSignal(r,{strict:false})))},{key:"window",converter:P.converters.any},{key:"duplex",converter:P.converters.DOMString,allowedValues:N}]);r.exports={Request:Request,makeRequest:makeRequest}},55032:(r,i,a)=>{"use strict";const{Headers:s,HeadersList:l,fill:c}=a(8247);const{extractBody:p,cloneBody:d,mixinBody:u}=a(21254);const A=a(94766);const{kEnumerableProperty:h}=A;const{isValidReasonPhrase:g,isCancelled:y,isAborted:E,isBlobLike:b,serializeJavascriptValueToJSONString:C,isErrorLike:v,isomorphicEncode:B}=a(40336);const{redirectStatusSet:I,nullBodyStatus:w,DOMException:S}=a(67296);const{kState:Q,kHeaders:x,kGuard:N,kRealm:R}=a(9411);const{webidl:T}=a(87591);const{FormData:D}=a(72489);const{getGlobalOrigin:k}=a(46670);const{URLSerializer:_}=a(80097);const{kHeadersList:O,kConstruct:P}=a(31915);const L=a(39491);const{types:M}=a(73837);const U=globalThis.ReadableStream||a(35356).ReadableStream;const q=new TextEncoder("utf-8");class Response{static error(){const r={settingsObject:{}};const i=new Response;i[Q]=makeNetworkError();i[R]=r;i[x][O]=i[Q].headersList;i[x][N]="immutable";i[x][R]=r;return i}static json(r,i={}){T.argumentLengthCheck(arguments,1,{header:"Response.json"});if(i!==null){i=T.converters.ResponseInit(i)}const a=q.encode(C(r));const s=p(a);const l={settingsObject:{}};const c=new Response;c[R]=l;c[x][N]="response";c[x][R]=l;initializeResponse(c,i,{body:s[0],type:"application/json"});return c}static redirect(r,i=302){const a={settingsObject:{}};T.argumentLengthCheck(arguments,1,{header:"Response.redirect"});r=T.converters.USVString(r);i=T.converters["unsigned short"](i);let s;try{s=new URL(r,k())}catch(i){throw Object.assign(new TypeError("Failed to parse URL from "+r),{cause:i})}if(!I.has(i)){throw new RangeError("Invalid status code "+i)}const l=new Response;l[R]=a;l[x][N]="immutable";l[x][R]=a;l[Q].status=i;const c=B(_(s));l[Q].headersList.append("location",c);return l}constructor(r=null,i={}){if(r!==null){r=T.converters.BodyInit(r)}i=T.converters.ResponseInit(i);this[R]={settingsObject:{}};this[Q]=makeResponse({});this[x]=new s(P);this[x][N]="response";this[x][O]=this[Q].headersList;this[x][R]=this[R];let a=null;if(r!=null){const[i,s]=p(r);a={body:i,type:s}}initializeResponse(this,i,a)}get type(){T.brandCheck(this,Response);return this[Q].type}get url(){T.brandCheck(this,Response);const r=this[Q].urlList;const i=r[r.length-1]??null;if(i===null){return""}return _(i,true)}get redirected(){T.brandCheck(this,Response);return this[Q].urlList.length>1}get status(){T.brandCheck(this,Response);return this[Q].status}get ok(){T.brandCheck(this,Response);return this[Q].status>=200&&this[Q].status<=299}get statusText(){T.brandCheck(this,Response);return this[Q].statusText}get headers(){T.brandCheck(this,Response);return this[x]}get body(){T.brandCheck(this,Response);return this[Q].body?this[Q].body.stream:null}get bodyUsed(){T.brandCheck(this,Response);return!!this[Q].body&&A.isDisturbed(this[Q].body.stream)}clone(){T.brandCheck(this,Response);if(this.bodyUsed||this.body&&this.body.locked){throw T.errors.exception({header:"Response.clone",message:"Body has already been consumed."})}const r=cloneResponse(this[Q]);const i=new Response;i[Q]=r;i[R]=this[R];i[x][O]=r.headersList;i[x][N]=this[x][N];i[x][R]=this[x][R];return i}}u(Response);Object.defineProperties(Response.prototype,{type:h,url:h,status:h,ok:h,redirected:h,statusText:h,headers:h,clone:h,body:h,bodyUsed:h,[Symbol.toStringTag]:{value:"Response",configurable:true}});Object.defineProperties(Response,{json:h,redirect:h,error:h});function cloneResponse(r){if(r.internalResponse){return filterResponse(cloneResponse(r.internalResponse),r.type)}const i=makeResponse({...r,body:null});if(r.body!=null){i.body=d(r.body)}return i}function makeResponse(r){return{aborted:false,rangeRequested:false,timingAllowPassed:false,requestIncludesCredentials:false,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...r,headersList:r.headersList?new l(r.headersList):new l,urlList:r.urlList?[...r.urlList]:[]}}function makeNetworkError(r){const i=v(r);return makeResponse({type:"error",status:0,error:i?r:new Error(r?String(r):r),aborted:r&&r.name==="AbortError"})}function makeFilteredResponse(r,i){i={internalResponse:r,...i};return new Proxy(r,{get(r,a){return a in i?i[a]:r[a]},set(r,a,s){L(!(a in i));r[a]=s;return true}})}function filterResponse(r,i){if(i==="basic"){return makeFilteredResponse(r,{type:"basic",headersList:r.headersList})}else if(i==="cors"){return makeFilteredResponse(r,{type:"cors",headersList:r.headersList})}else if(i==="opaque"){return makeFilteredResponse(r,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null})}else if(i==="opaqueredirect"){return makeFilteredResponse(r,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null})}else{L(false)}}function makeAppropriateNetworkError(r,i=null){L(y(r));return E(r)?makeNetworkError(Object.assign(new S("The operation was aborted.","AbortError"),{cause:i})):makeNetworkError(Object.assign(new S("Request was cancelled."),{cause:i}))}function initializeResponse(r,i,a){if(i.status!==null&&(i.status<200||i.status>599)){throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')}if("statusText"in i&&i.statusText!=null){if(!g(String(i.statusText))){throw new TypeError("Invalid statusText")}}if("status"in i&&i.status!=null){r[Q].status=i.status}if("statusText"in i&&i.statusText!=null){r[Q].statusText=i.statusText}if("headers"in i&&i.headers!=null){c(r[x],i.headers)}if(a){if(w.includes(r.status)){throw T.errors.exception({header:"Response constructor",message:"Invalid response status code "+r.status})}r[Q].body=a.body;if(a.type!=null&&!r[Q].headersList.contains("Content-Type")){r[Q].headersList.append("content-type",a.type)}}}T.converters.ReadableStream=T.interfaceConverter(U);T.converters.FormData=T.interfaceConverter(D);T.converters.URLSearchParams=T.interfaceConverter(URLSearchParams);T.converters.XMLHttpRequestBodyInit=function(r){if(typeof r==="string"){return T.converters.USVString(r)}if(b(r)){return T.converters.Blob(r,{strict:false})}if(M.isArrayBuffer(r)||M.isTypedArray(r)||M.isDataView(r)){return T.converters.BufferSource(r)}if(A.isFormDataLike(r)){return T.converters.FormData(r,{strict:false})}if(r instanceof URLSearchParams){return T.converters.URLSearchParams(r)}return T.converters.DOMString(r)};T.converters.BodyInit=function(r){if(r instanceof U){return T.converters.ReadableStream(r)}if(r?.[Symbol.asyncIterator]){return r}return T.converters.XMLHttpRequestBodyInit(r)};T.converters.ResponseInit=T.dictionaryConverter([{key:"status",converter:T.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:T.converters.ByteString,defaultValue:""},{key:"headers",converter:T.converters.HeadersInit}]);r.exports={makeNetworkError:makeNetworkError,makeResponse:makeResponse,makeAppropriateNetworkError:makeAppropriateNetworkError,filterResponse:filterResponse,Response:Response,cloneResponse:cloneResponse}},9411:r=>{"use strict";r.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kGuard:Symbol("guard"),kRealm:Symbol("realm")}},40336:(r,i,a)=>{"use strict";const{redirectStatusSet:s,referrerPolicySet:l,badPortsSet:c}=a(67296);const{getGlobalOrigin:p}=a(46670);const{performance:d}=a(4074);const{isBlobLike:u,toUSVString:A,ReadableStreamFrom:h}=a(94766);const g=a(39491);const{isUint8Array:y}=a(29830);let E;try{E=a(6113)}catch{}function responseURL(r){const i=r.urlList;const a=i.length;return a===0?null:i[a-1].toString()}function responseLocationURL(r,i){if(!s.has(r.status)){return null}let a=r.headersList.get("location");if(a!==null&&isValidHeaderValue(a)){a=new URL(a,responseURL(r))}if(a&&!a.hash){a.hash=i}return a}function requestCurrentURL(r){return r.urlList[r.urlList.length-1]}function requestBadPort(r){const i=requestCurrentURL(r);if(urlIsHttpHttpsScheme(i)&&c.has(i.port)){return"blocked"}return"allowed"}function isErrorLike(r){return r instanceof Error||(r?.constructor?.name==="Error"||r?.constructor?.name==="DOMException")}function isValidReasonPhrase(r){for(let i=0;i=32&&a<=126||a>=128&&a<=255)){return false}}return true}function isTokenCharCode(r){switch(r){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return false;default:return r>=33&&r<=126}}function isValidHTTPToken(r){if(r.length===0){return false}for(let i=0;i0){for(let r=s.length;r!==0;r--){const i=s[r-1].trim();if(l.has(i)){c=i;break}}}if(c!==""){r.referrerPolicy=c}}function crossOriginResourcePolicyCheck(){return"allowed"}function corsCheck(){return"success"}function TAOCheck(){return"success"}function appendFetchMetadata(r){let i=null;i=r.mode;r.headersList.set("sec-fetch-mode",i)}function appendRequestOriginHeader(r){let i=r.origin;if(r.responseTainting==="cors"||r.mode==="websocket"){if(i){r.headersList.append("origin",i)}}else if(r.method!=="GET"&&r.method!=="HEAD"){switch(r.referrerPolicy){case"no-referrer":i=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":if(r.origin&&urlHasHttpsScheme(r.origin)&&!urlHasHttpsScheme(requestCurrentURL(r))){i=null}break;case"same-origin":if(!sameOrigin(r,requestCurrentURL(r))){i=null}break;default:}if(i){r.headersList.append("origin",i)}}}function coarsenedSharedCurrentTime(r){return d.now()}function createOpaqueTimingInfo(r){return{startTime:r.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:r.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function makePolicyContainer(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function clonePolicyContainer(r){return{referrerPolicy:r.referrerPolicy}}function determineRequestsReferrer(r){const i=r.referrerPolicy;g(i);let a=null;if(r.referrer==="client"){const r=p();if(!r||r.origin==="null"){return"no-referrer"}a=new URL(r)}else if(r.referrer instanceof URL){a=r.referrer}let s=stripURLForReferrer(a);const l=stripURLForReferrer(a,true);if(s.toString().length>4096){s=l}const c=sameOrigin(r,s);const d=isURLPotentiallyTrustworthy(s)&&!isURLPotentiallyTrustworthy(r.url);switch(i){case"origin":return l!=null?l:stripURLForReferrer(a,true);case"unsafe-url":return s;case"same-origin":return c?l:"no-referrer";case"origin-when-cross-origin":return c?s:l;case"strict-origin-when-cross-origin":{const i=requestCurrentURL(r);if(sameOrigin(s,i)){return s}if(isURLPotentiallyTrustworthy(s)&&!isURLPotentiallyTrustworthy(i)){return"no-referrer"}return l}case"strict-origin":case"no-referrer-when-downgrade":default:return d?"no-referrer":l}}function stripURLForReferrer(r,i){g(r instanceof URL);if(r.protocol==="file:"||r.protocol==="about:"||r.protocol==="blank:"){return"no-referrer"}r.username="";r.password="";r.hash="";if(i){r.pathname="";r.search=""}return r}function isURLPotentiallyTrustworthy(r){if(!(r instanceof URL)){return false}if(r.href==="about:blank"||r.href==="about:srcdoc"){return true}if(r.protocol==="data:")return true;if(r.protocol==="file:")return true;return isOriginPotentiallyTrustworthy(r.origin);function isOriginPotentiallyTrustworthy(r){if(r==null||r==="null")return false;const i=new URL(r);if(i.protocol==="https:"||i.protocol==="wss:"){return true}if(/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(i.hostname)||(i.hostname==="localhost"||i.hostname.includes("localhost."))||i.hostname.endsWith(".localhost")){return true}return false}}function bytesMatch(r,i){if(E===undefined){return true}const a=parseMetadata(i);if(a==="no metadata"){return true}if(a.length===0){return true}const s=a.sort(((r,i)=>i.algo.localeCompare(r.algo)));const l=s[0].algo;const c=s.filter((r=>r.algo===l));for(const i of c){const a=i.algo;let s=i.hash;if(s.endsWith("==")){s=s.slice(0,-2)}let l=E.createHash(a).update(r).digest("base64");if(l.endsWith("==")){l=l.slice(0,-2)}if(l===s){return true}let c=E.createHash(a).update(r).digest("base64url");if(c.endsWith("==")){c=c.slice(0,-2)}if(c===s){return true}}return false}const b=/((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i;function parseMetadata(r){const i=[];let a=true;const s=E.getHashes();for(const l of r.split(" ")){a=false;const r=b.exec(l);if(r===null||r.groups===undefined){continue}const c=r.groups.algo;if(s.includes(c.toLowerCase())){i.push(r.groups)}}if(a===true){return"no metadata"}return i}function tryUpgradeRequestToAPotentiallyTrustworthyURL(r){}function sameOrigin(r,i){if(r.origin===i.origin&&r.origin==="null"){return true}if(r.protocol===i.protocol&&r.hostname===i.hostname&&r.port===i.port){return true}return false}function createDeferredPromise(){let r;let i;const a=new Promise(((a,s)=>{r=a;i=s}));return{promise:a,resolve:r,reject:i}}function isAborted(r){return r.controller.state==="aborted"}function isCancelled(r){return r.controller.state==="aborted"||r.controller.state==="terminated"}const C={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"};Object.setPrototypeOf(C,null);function normalizeMethod(r){return C[r.toLowerCase()]??r}function serializeJavascriptValueToJSONString(r){const i=JSON.stringify(r);if(i===undefined){throw new TypeError("Value is not JSON serializable")}g(typeof i==="string");return i}const v=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function makeIterator(r,i,a){const s={index:0,kind:a,target:r};const l={next(){if(Object.getPrototypeOf(this)!==l){throw new TypeError(`'next' called on an object that does not implement interface ${i} Iterator.`)}const{index:r,kind:a,target:c}=s;const p=c();const d=p.length;if(r>=d){return{value:undefined,done:true}}const u=p[r];s.index=r+1;return iteratorResult(u,a)},[Symbol.toStringTag]:`${i} Iterator`};Object.setPrototypeOf(l,v);return Object.setPrototypeOf({},l)}function iteratorResult(r,i){let a;switch(i){case"key":{a=r[0];break}case"value":{a=r[1];break}case"key+value":{a=r;break}}return{value:a,done:false}}async function fullyReadBody(r,i,a){const s=i;const l=a;let c;try{c=r.stream.getReader()}catch(r){l(r);return}try{const r=await readAllBytes(c);s(r)}catch(r){l(r)}}let B=globalThis.ReadableStream;function isReadableStreamLike(r){if(!B){B=a(35356).ReadableStream}return r instanceof B||r[Symbol.toStringTag]==="ReadableStream"&&typeof r.tee==="function"}const I=65535;function isomorphicDecode(r){if(r.lengthr+String.fromCharCode(i)),"")}function readableStreamClose(r){try{r.close()}catch(r){if(!r.message.includes("Controller is already closed")){throw r}}}function isomorphicEncode(r){for(let i=0;iObject.prototype.hasOwnProperty.call(r,i));r.exports={isAborted:isAborted,isCancelled:isCancelled,createDeferredPromise:createDeferredPromise,ReadableStreamFrom:h,toUSVString:A,tryUpgradeRequestToAPotentiallyTrustworthyURL:tryUpgradeRequestToAPotentiallyTrustworthyURL,coarsenedSharedCurrentTime:coarsenedSharedCurrentTime,determineRequestsReferrer:determineRequestsReferrer,makePolicyContainer:makePolicyContainer,clonePolicyContainer:clonePolicyContainer,appendFetchMetadata:appendFetchMetadata,appendRequestOriginHeader:appendRequestOriginHeader,TAOCheck:TAOCheck,corsCheck:corsCheck,crossOriginResourcePolicyCheck:crossOriginResourcePolicyCheck,createOpaqueTimingInfo:createOpaqueTimingInfo,setRequestReferrerPolicyOnRedirect:setRequestReferrerPolicyOnRedirect,isValidHTTPToken:isValidHTTPToken,requestBadPort:requestBadPort,requestCurrentURL:requestCurrentURL,responseURL:responseURL,responseLocationURL:responseLocationURL,isBlobLike:u,isURLPotentiallyTrustworthy:isURLPotentiallyTrustworthy,isValidReasonPhrase:isValidReasonPhrase,sameOrigin:sameOrigin,normalizeMethod:normalizeMethod,serializeJavascriptValueToJSONString:serializeJavascriptValueToJSONString,makeIterator:makeIterator,isValidHeaderName:isValidHeaderName,isValidHeaderValue:isValidHeaderValue,hasOwn:w,isErrorLike:isErrorLike,fullyReadBody:fullyReadBody,bytesMatch:bytesMatch,isReadableStreamLike:isReadableStreamLike,readableStreamClose:readableStreamClose,isomorphicEncode:isomorphicEncode,isomorphicDecode:isomorphicDecode,urlIsLocal:urlIsLocal,urlHasHttpsScheme:urlHasHttpsScheme,urlIsHttpHttpsScheme:urlIsHttpHttpsScheme,readAllBytes:readAllBytes,normalizeMethodRecord:C}},87591:(r,i,a)=>{"use strict";const{types:s}=a(73837);const{hasOwn:l,toUSVString:c}=a(40336);const p={};p.converters={};p.util={};p.errors={};p.errors.exception=function(r){return new TypeError(`${r.header}: ${r.message}`)};p.errors.conversionFailed=function(r){const i=r.types.length===1?"":" one of";const a=`${r.argument} could not be converted to`+`${i}: ${r.types.join(", ")}.`;return p.errors.exception({header:r.prefix,message:a})};p.errors.invalidArgument=function(r){return p.errors.exception({header:r.prefix,message:`"${r.value}" is an invalid ${r.type}.`})};p.brandCheck=function(r,i,a=undefined){if(a?.strict!==false&&!(r instanceof i)){throw new TypeError("Illegal invocation")}else{return r?.[Symbol.toStringTag]===i.prototype[Symbol.toStringTag]}};p.argumentLengthCheck=function({length:r},i,a){if(rl){throw p.errors.exception({header:"Integer conversion",message:`Value must be between ${c}-${l}, got ${d}.`})}return d}if(!Number.isNaN(d)&&s.clamp===true){d=Math.min(Math.max(d,c),l);if(Math.floor(d)%2===0){d=Math.floor(d)}else{d=Math.ceil(d)}return d}if(Number.isNaN(d)||d===0&&Object.is(0,d)||d===Number.POSITIVE_INFINITY||d===Number.NEGATIVE_INFINITY){return 0}d=p.util.IntegerPart(d);d=d%Math.pow(2,i);if(a==="signed"&&d>=Math.pow(2,i)-1){return d-Math.pow(2,i)}return d};p.util.IntegerPart=function(r){const i=Math.floor(Math.abs(r));if(r<0){return-1*i}return i};p.sequenceConverter=function(r){return i=>{if(p.util.Type(i)!=="Object"){throw p.errors.exception({header:"Sequence",message:`Value of type ${p.util.Type(i)} is not an Object.`})}const a=i?.[Symbol.iterator]?.();const s=[];if(a===undefined||typeof a.next!=="function"){throw p.errors.exception({header:"Sequence",message:"Object is not an iterator."})}while(true){const{done:i,value:l}=a.next();if(i){break}s.push(r(l))}return s}};p.recordConverter=function(r,i){return a=>{if(p.util.Type(a)!=="Object"){throw p.errors.exception({header:"Record",message:`Value of type ${p.util.Type(a)} is not an Object.`})}const l={};if(!s.isProxy(a)){const s=Object.keys(a);for(const c of s){const s=r(c);const p=i(a[c]);l[s]=p}return l}const c=Reflect.ownKeys(a);for(const s of c){const c=Reflect.getOwnPropertyDescriptor(a,s);if(c?.enumerable){const c=r(s);const p=i(a[s]);l[c]=p}}return l}};p.interfaceConverter=function(r){return(i,a={})=>{if(a.strict!==false&&!(i instanceof r)){throw p.errors.exception({header:r.name,message:`Expected ${i} to be an instance of ${r.name}.`})}return i}};p.dictionaryConverter=function(r){return i=>{const a=p.util.Type(i);const s={};if(a==="Null"||a==="Undefined"){return s}else if(a!=="Object"){throw p.errors.exception({header:"Dictionary",message:`Expected ${i} to be one of: Null, Undefined, Object.`})}for(const a of r){const{key:r,defaultValue:c,required:d,converter:u}=a;if(d===true){if(!l(i,r)){throw p.errors.exception({header:"Dictionary",message:`Missing required key "${r}".`})}}let A=i[r];const h=l(a,"defaultValue");if(h&&A!==null){A=A??c}if(d||h||A!==undefined){A=u(A);if(a.allowedValues&&!a.allowedValues.includes(A)){throw p.errors.exception({header:"Dictionary",message:`${A} is not an accepted type. Expected one of ${a.allowedValues.join(", ")}.`})}s[r]=A}}return s}};p.nullableConverter=function(r){return i=>{if(i===null){return i}return r(i)}};p.converters.DOMString=function(r,i={}){if(r===null&&i.legacyNullToEmptyString){return""}if(typeof r==="symbol"){throw new TypeError("Could not convert argument of type symbol to string.")}return String(r)};p.converters.ByteString=function(r){const i=p.converters.DOMString(r);for(let r=0;r255){throw new TypeError("Cannot convert argument to a ByteString because the character at "+`index ${r} has a value of ${i.charCodeAt(r)} which is greater than 255.`)}}return i};p.converters.USVString=c;p.converters.boolean=function(r){const i=Boolean(r);return i};p.converters.any=function(r){return r};p.converters["long long"]=function(r){const i=p.util.ConvertToInt(r,64,"signed");return i};p.converters["unsigned long long"]=function(r){const i=p.util.ConvertToInt(r,64,"unsigned");return i};p.converters["unsigned long"]=function(r){const i=p.util.ConvertToInt(r,32,"unsigned");return i};p.converters["unsigned short"]=function(r,i){const a=p.util.ConvertToInt(r,16,"unsigned",i);return a};p.converters.ArrayBuffer=function(r,i={}){if(p.util.Type(r)!=="Object"||!s.isAnyArrayBuffer(r)){throw p.errors.conversionFailed({prefix:`${r}`,argument:`${r}`,types:["ArrayBuffer"]})}if(i.allowShared===false&&s.isSharedArrayBuffer(r)){throw p.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."})}return r};p.converters.TypedArray=function(r,i,a={}){if(p.util.Type(r)!=="Object"||!s.isTypedArray(r)||r.constructor.name!==i.name){throw p.errors.conversionFailed({prefix:`${i.name}`,argument:`${r}`,types:[i.name]})}if(a.allowShared===false&&s.isSharedArrayBuffer(r.buffer)){throw p.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."})}return r};p.converters.DataView=function(r,i={}){if(p.util.Type(r)!=="Object"||!s.isDataView(r)){throw p.errors.exception({header:"DataView",message:"Object is not a DataView."})}if(i.allowShared===false&&s.isSharedArrayBuffer(r.buffer)){throw p.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."})}return r};p.converters.BufferSource=function(r,i={}){if(s.isAnyArrayBuffer(r)){return p.converters.ArrayBuffer(r,i)}if(s.isTypedArray(r)){return p.converters.TypedArray(r,r.constructor)}if(s.isDataView(r)){return p.converters.DataView(r,i)}throw new TypeError(`Could not convert ${r} to a BufferSource.`)};p.converters["sequence"]=p.sequenceConverter(p.converters.ByteString);p.converters["sequence>"]=p.sequenceConverter(p.converters["sequence"]);p.converters["record"]=p.recordConverter(p.converters.ByteString,p.converters.ByteString);r.exports={webidl:p}},49757:r=>{"use strict";function getEncoding(r){if(!r){return"failure"}switch(r.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}r.exports={getEncoding:getEncoding}},62414:(r,i,a)=>{"use strict";const{staticPropertyDescriptors:s,readOperation:l,fireAProgressEvent:c}=a(24992);const{kState:p,kError:d,kResult:u,kEvents:A,kAborted:h}=a(2326);const{webidl:g}=a(87591);const{kEnumerableProperty:y}=a(94766);class FileReader extends EventTarget{constructor(){super();this[p]="empty";this[u]=null;this[d]=null;this[A]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(r){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"});r=g.converters.Blob(r,{strict:false});l(this,r,"ArrayBuffer")}readAsBinaryString(r){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"});r=g.converters.Blob(r,{strict:false});l(this,r,"BinaryString")}readAsText(r,i=undefined){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"});r=g.converters.Blob(r,{strict:false});if(i!==undefined){i=g.converters.DOMString(i)}l(this,r,"Text",i)}readAsDataURL(r){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"});r=g.converters.Blob(r,{strict:false});l(this,r,"DataURL")}abort(){if(this[p]==="empty"||this[p]==="done"){this[u]=null;return}if(this[p]==="loading"){this[p]="done";this[u]=null}this[h]=true;c("abort",this);if(this[p]!=="loading"){c("loadend",this)}}get readyState(){g.brandCheck(this,FileReader);switch(this[p]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){g.brandCheck(this,FileReader);return this[u]}get error(){g.brandCheck(this,FileReader);return this[d]}get onloadend(){g.brandCheck(this,FileReader);return this[A].loadend}set onloadend(r){g.brandCheck(this,FileReader);if(this[A].loadend){this.removeEventListener("loadend",this[A].loadend)}if(typeof r==="function"){this[A].loadend=r;this.addEventListener("loadend",r)}else{this[A].loadend=null}}get onerror(){g.brandCheck(this,FileReader);return this[A].error}set onerror(r){g.brandCheck(this,FileReader);if(this[A].error){this.removeEventListener("error",this[A].error)}if(typeof r==="function"){this[A].error=r;this.addEventListener("error",r)}else{this[A].error=null}}get onloadstart(){g.brandCheck(this,FileReader);return this[A].loadstart}set onloadstart(r){g.brandCheck(this,FileReader);if(this[A].loadstart){this.removeEventListener("loadstart",this[A].loadstart)}if(typeof r==="function"){this[A].loadstart=r;this.addEventListener("loadstart",r)}else{this[A].loadstart=null}}get onprogress(){g.brandCheck(this,FileReader);return this[A].progress}set onprogress(r){g.brandCheck(this,FileReader);if(this[A].progress){this.removeEventListener("progress",this[A].progress)}if(typeof r==="function"){this[A].progress=r;this.addEventListener("progress",r)}else{this[A].progress=null}}get onload(){g.brandCheck(this,FileReader);return this[A].load}set onload(r){g.brandCheck(this,FileReader);if(this[A].load){this.removeEventListener("load",this[A].load)}if(typeof r==="function"){this[A].load=r;this.addEventListener("load",r)}else{this[A].load=null}}get onabort(){g.brandCheck(this,FileReader);return this[A].abort}set onabort(r){g.brandCheck(this,FileReader);if(this[A].abort){this.removeEventListener("abort",this[A].abort)}if(typeof r==="function"){this[A].abort=r;this.addEventListener("abort",r)}else{this[A].abort=null}}}FileReader.EMPTY=FileReader.prototype.EMPTY=0;FileReader.LOADING=FileReader.prototype.LOADING=1;FileReader.DONE=FileReader.prototype.DONE=2;Object.defineProperties(FileReader.prototype,{EMPTY:s,LOADING:s,DONE:s,readAsArrayBuffer:y,readAsBinaryString:y,readAsText:y,readAsDataURL:y,abort:y,readyState:y,result:y,error:y,onloadstart:y,onprogress:y,onload:y,onabort:y,onerror:y,onloadend:y,[Symbol.toStringTag]:{value:"FileReader",writable:false,enumerable:false,configurable:true}});Object.defineProperties(FileReader,{EMPTY:s,LOADING:s,DONE:s});r.exports={FileReader:FileReader}},96255:(r,i,a)=>{"use strict";const{webidl:s}=a(87591);const l=Symbol("ProgressEvent state");class ProgressEvent extends Event{constructor(r,i={}){r=s.converters.DOMString(r);i=s.converters.ProgressEventInit(i??{});super(r,i);this[l]={lengthComputable:i.lengthComputable,loaded:i.loaded,total:i.total}}get lengthComputable(){s.brandCheck(this,ProgressEvent);return this[l].lengthComputable}get loaded(){s.brandCheck(this,ProgressEvent);return this[l].loaded}get total(){s.brandCheck(this,ProgressEvent);return this[l].total}}s.converters.ProgressEventInit=s.dictionaryConverter([{key:"lengthComputable",converter:s.converters.boolean,defaultValue:false},{key:"loaded",converter:s.converters["unsigned long long"],defaultValue:0},{key:"total",converter:s.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:s.converters.boolean,defaultValue:false},{key:"cancelable",converter:s.converters.boolean,defaultValue:false},{key:"composed",converter:s.converters.boolean,defaultValue:false}]);r.exports={ProgressEvent:ProgressEvent}},2326:r=>{"use strict";r.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}},24992:(r,i,a)=>{"use strict";const{kState:s,kError:l,kResult:c,kAborted:p,kLastProgressEventFired:d}=a(2326);const{ProgressEvent:u}=a(96255);const{getEncoding:A}=a(49757);const{DOMException:h}=a(67296);const{serializeAMimeType:g,parseMIMEType:y}=a(80097);const{types:E}=a(73837);const{StringDecoder:b}=a(71576);const{btoa:C}=a(14300);const v={enumerable:true,writable:false,configurable:false};function readOperation(r,i,a,u){if(r[s]==="loading"){throw new h("Invalid state","InvalidStateError")}r[s]="loading";r[c]=null;r[l]=null;const A=i.stream();const g=A.getReader();const y=[];let b=g.read();let C=true;(async()=>{while(!r[p]){try{const{done:A,value:h}=await b;if(C&&!r[p]){queueMicrotask((()=>{fireAProgressEvent("loadstart",r)}))}C=false;if(!A&&E.isUint8Array(h)){y.push(h);if((r[d]===undefined||Date.now()-r[d]>=50)&&!r[p]){r[d]=Date.now();queueMicrotask((()=>{fireAProgressEvent("progress",r)}))}b=g.read()}else if(A){queueMicrotask((()=>{r[s]="done";try{const s=packageData(y,a,i.type,u);if(r[p]){return}r[c]=s;fireAProgressEvent("load",r)}catch(i){r[l]=i;fireAProgressEvent("error",r)}if(r[s]!=="loading"){fireAProgressEvent("loadend",r)}}));break}}catch(i){if(r[p]){return}queueMicrotask((()=>{r[s]="done";r[l]=i;fireAProgressEvent("error",r);if(r[s]!=="loading"){fireAProgressEvent("loadend",r)}}));break}}})()}function fireAProgressEvent(r,i){const a=new u(r,{bubbles:false,cancelable:false});i.dispatchEvent(a)}function packageData(r,i,a,s){switch(i){case"DataURL":{let i="data:";const s=y(a||"application/octet-stream");if(s!=="failure"){i+=g(s)}i+=";base64,";const l=new b("latin1");for(const a of r){i+=C(l.write(a))}i+=C(l.end());return i}case"Text":{let i="failure";if(s){i=A(s)}if(i==="failure"&&a){const r=y(a);if(r!=="failure"){i=A(r.parameters.get("charset"))}}if(i==="failure"){i="UTF-8"}return decode(r,i)}case"ArrayBuffer":{const i=combineByteSequences(r);return i.buffer}case"BinaryString":{let i="";const a=new b("latin1");for(const s of r){i+=a.write(s)}i+=a.end();return i}}}function decode(r,i){const a=combineByteSequences(r);const s=BOMSniffing(a);let l=0;if(s!==null){i=s;l=s==="UTF-8"?3:2}const c=a.slice(l);return new TextDecoder(i).decode(c)}function BOMSniffing(r){const[i,a,s]=r;if(i===239&&a===187&&s===191){return"UTF-8"}else if(i===254&&a===255){return"UTF-16BE"}else if(i===255&&a===254){return"UTF-16LE"}return null}function combineByteSequences(r){const i=r.reduce(((r,i)=>r+i.byteLength),0);let a=0;return r.reduce(((r,i)=>{r.set(i,a);a+=i.byteLength;return r}),new Uint8Array(i))}r.exports={staticPropertyDescriptors:v,readOperation:readOperation,fireAProgressEvent:fireAProgressEvent}},18826:(r,i,a)=>{"use strict";const s=Symbol.for("undici.globalDispatcher.1");const{InvalidArgumentError:l}=a(76291);const c=a(72916);if(getGlobalDispatcher()===undefined){setGlobalDispatcher(new c)}function setGlobalDispatcher(r){if(!r||typeof r.dispatch!=="function"){throw new l("Argument agent must implement Agent")}Object.defineProperty(globalThis,s,{value:r,writable:true,enumerable:false,configurable:false})}function getGlobalDispatcher(){return globalThis[s]}r.exports={setGlobalDispatcher:setGlobalDispatcher,getGlobalDispatcher:getGlobalDispatcher}},96474:r=>{"use strict";r.exports=class DecoratorHandler{constructor(r){this.handler=r}onConnect(...r){return this.handler.onConnect(...r)}onError(...r){return this.handler.onError(...r)}onUpgrade(...r){return this.handler.onUpgrade(...r)}onHeaders(...r){return this.handler.onHeaders(...r)}onData(...r){return this.handler.onData(...r)}onComplete(...r){return this.handler.onComplete(...r)}onBodySent(...r){return this.handler.onBodySent(...r)}}},81465:(r,i,a)=>{"use strict";const s=a(94766);const{kBodyUsed:l}=a(31915);const c=a(39491);const{InvalidArgumentError:p}=a(76291);const d=a(82361);const u=[300,301,302,303,307,308];const A=Symbol("body");class BodyAsyncIterable{constructor(r){this[A]=r;this[l]=false}async*[Symbol.asyncIterator](){c(!this[l],"disturbed");this[l]=true;yield*this[A]}}class RedirectHandler{constructor(r,i,a,u){if(i!=null&&(!Number.isInteger(i)||i<0)){throw new p("maxRedirections must be a positive number")}s.validateHandler(u,a.method,a.upgrade);this.dispatch=r;this.location=null;this.abort=null;this.opts={...a,maxRedirections:0};this.maxRedirections=i;this.handler=u;this.history=[];if(s.isStream(this.opts.body)){if(s.bodyLength(this.opts.body)===0){this.opts.body.on("data",(function(){c(false)}))}if(typeof this.opts.body.readableDidRead!=="boolean"){this.opts.body[l]=false;d.prototype.on.call(this.opts.body,"data",(function(){this[l]=true}))}}else if(this.opts.body&&typeof this.opts.body.pipeTo==="function"){this.opts.body=new BodyAsyncIterable(this.opts.body)}else if(this.opts.body&&typeof this.opts.body!=="string"&&!ArrayBuffer.isView(this.opts.body)&&s.isIterable(this.opts.body)){this.opts.body=new BodyAsyncIterable(this.opts.body)}}onConnect(r){this.abort=r;this.handler.onConnect(r,{history:this.history})}onUpgrade(r,i,a){this.handler.onUpgrade(r,i,a)}onError(r){this.handler.onError(r)}onHeaders(r,i,a,l){this.location=this.history.length>=this.maxRedirections||s.isDisturbed(this.opts.body)?null:parseLocation(r,i);if(this.opts.origin){this.history.push(new URL(this.opts.path,this.opts.origin))}if(!this.location){return this.handler.onHeaders(r,i,a,l)}const{origin:c,pathname:p,search:d}=s.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin)));const u=d?`${p}${d}`:p;this.opts.headers=cleanRequestHeaders(this.opts.headers,r===303,this.opts.origin!==c);this.opts.path=u;this.opts.origin=c;this.opts.maxRedirections=0;this.opts.query=null;if(r===303&&this.opts.method!=="HEAD"){this.opts.method="GET";this.opts.body=null}}onData(r){if(this.location){}else{return this.handler.onData(r)}}onComplete(r){if(this.location){this.location=null;this.abort=null;this.dispatch(this.opts,this)}else{this.handler.onComplete(r)}}onBodySent(r){if(this.handler.onBodySent){this.handler.onBodySent(r)}}}function parseLocation(r,i){if(u.indexOf(r)===-1){return null}for(let r=0;r{const s=a(39491);const{kRetryHandlerDefaultRetry:l}=a(31915);const{RequestRetryError:c}=a(76291);const{isDisturbed:p,parseHeaders:d,parseRangeHeader:u}=a(94766);function calculateRetryAfterHeader(r){const i=Date.now();const a=new Date(r).getTime()-i;return a}class RetryHandler{constructor(r,i){const{retryOptions:a,...s}=r;const{retry:c,maxRetries:p,maxTimeout:d,minTimeout:u,timeoutFactor:A,methods:h,errorCodes:g,retryAfter:y,statusCodes:E}=a??{};this.dispatch=i.dispatch;this.handler=i.handler;this.opts=s;this.abort=null;this.aborted=false;this.retryOpts={retry:c??RetryHandler[l],retryAfter:y??true,maxTimeout:d??30*1e3,timeout:u??500,timeoutFactor:A??2,maxRetries:p??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:E??[500,502,503,504,429],errorCodes:g??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]};this.retryCount=0;this.start=0;this.end=null;this.etag=null;this.resume=null;this.handler.onConnect((r=>{this.aborted=true;if(this.abort){this.abort(r)}else{this.reason=r}}))}onRequestSent(){if(this.handler.onRequestSent){this.handler.onRequestSent()}}onUpgrade(r,i,a){if(this.handler.onUpgrade){this.handler.onUpgrade(r,i,a)}}onConnect(r){if(this.aborted){r(this.reason)}else{this.abort=r}}onBodySent(r){if(this.handler.onBodySent)return this.handler.onBodySent(r)}static[l](r,{state:i,opts:a},s){const{statusCode:l,code:c,headers:p}=r;const{method:d,retryOptions:u}=a;const{maxRetries:A,timeout:h,maxTimeout:g,timeoutFactor:y,statusCodes:E,errorCodes:b,methods:C}=u;let{counter:v,currentTimeout:B}=i;B=B!=null&&B>0?B:h;if(c&&c!=="UND_ERR_REQ_RETRY"&&c!=="UND_ERR_SOCKET"&&!b.includes(c)){s(r);return}if(Array.isArray(C)&&!C.includes(d)){s(r);return}if(l!=null&&Array.isArray(E)&&!E.includes(l)){s(r);return}if(v>A){s(r);return}let I=p!=null&&p["retry-after"];if(I){I=Number(I);I=isNaN(I)?calculateRetryAfterHeader(I):I*1e3}const w=I>0?Math.min(I,g):Math.min(B*y**v,g);i.currentTimeout=w;setTimeout((()=>s(null)),w)}onHeaders(r,i,a,l){const p=d(i);this.retryCount+=1;if(r>=300){this.abort(new c("Request failed",r,{headers:p,count:this.retryCount}));return false}if(this.resume!=null){this.resume=null;if(r!==206){return true}const i=u(p["content-range"]);if(!i){this.abort(new c("Content-Range mismatch",r,{headers:p,count:this.retryCount}));return false}if(this.etag!=null&&this.etag!==p.etag){this.abort(new c("ETag mismatch",r,{headers:p,count:this.retryCount}));return false}const{start:l,size:d,end:A=d}=i;s(this.start===l,"content-range mismatch");s(this.end==null||this.end===A,"content-range mismatch");this.resume=a;return true}if(this.end==null){if(r===206){const c=u(p["content-range"]);if(c==null){return this.handler.onHeaders(r,i,a,l)}const{start:d,size:A,end:h=A}=c;s(d!=null&&Number.isFinite(d)&&this.start!==d,"content-range mismatch");s(Number.isFinite(d));s(h!=null&&Number.isFinite(h)&&this.end!==h,"invalid content-length");this.start=d;this.end=h}if(this.end==null){const r=p["content-length"];this.end=r!=null?Number(r):null}s(Number.isFinite(this.start));s(this.end==null||Number.isFinite(this.end),"invalid content-length");this.resume=a;this.etag=p.etag!=null?p.etag:null;return this.handler.onHeaders(r,i,a,l)}const A=new c("Request failed",r,{headers:p,count:this.retryCount});this.abort(A);return false}onData(r){this.start+=r.length;return this.handler.onData(r)}onComplete(r){this.retryCount=0;return this.handler.onComplete(r)}onError(r){if(this.aborted||p(this.opts.body)){return this.handler.onError(r)}this.retryOpts.retry(r,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},opts:{retryOptions:this.retryOpts,...this.opts}},onRetry.bind(this));function onRetry(r){if(r!=null||this.aborted||p(this.opts.body)){return this.handler.onError(r)}if(this.start!==0){this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${this.end??""}`}}}try{this.dispatch(this.opts,this)}catch(r){this.handler.onError(r)}}}}r.exports=RetryHandler},76459:(r,i,a)=>{"use strict";const s=a(81465);function createRedirectInterceptor({maxRedirections:r}){return i=>function Intercept(a,l){const{maxRedirections:c=r}=a;if(!c){return i(a,l)}const p=new s(i,c,a,l);a={...a,maxRedirections:0};return i(a,p)}}r.exports=createRedirectInterceptor},83993:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SPECIAL_HEADERS=i.HEADER_STATE=i.MINOR=i.MAJOR=i.CONNECTION_TOKEN_CHARS=i.HEADER_CHARS=i.TOKEN=i.STRICT_TOKEN=i.HEX=i.URL_CHAR=i.STRICT_URL_CHAR=i.USERINFO_CHARS=i.MARK=i.ALPHANUM=i.NUM=i.HEX_MAP=i.NUM_MAP=i.ALPHA=i.FINISH=i.H_METHOD_MAP=i.METHOD_MAP=i.METHODS_RTSP=i.METHODS_ICE=i.METHODS_HTTP=i.METHODS=i.LENIENT_FLAGS=i.FLAGS=i.TYPE=i.ERROR=void 0;const s=a(18994);var l;(function(r){r[r["OK"]=0]="OK";r[r["INTERNAL"]=1]="INTERNAL";r[r["STRICT"]=2]="STRICT";r[r["LF_EXPECTED"]=3]="LF_EXPECTED";r[r["UNEXPECTED_CONTENT_LENGTH"]=4]="UNEXPECTED_CONTENT_LENGTH";r[r["CLOSED_CONNECTION"]=5]="CLOSED_CONNECTION";r[r["INVALID_METHOD"]=6]="INVALID_METHOD";r[r["INVALID_URL"]=7]="INVALID_URL";r[r["INVALID_CONSTANT"]=8]="INVALID_CONSTANT";r[r["INVALID_VERSION"]=9]="INVALID_VERSION";r[r["INVALID_HEADER_TOKEN"]=10]="INVALID_HEADER_TOKEN";r[r["INVALID_CONTENT_LENGTH"]=11]="INVALID_CONTENT_LENGTH";r[r["INVALID_CHUNK_SIZE"]=12]="INVALID_CHUNK_SIZE";r[r["INVALID_STATUS"]=13]="INVALID_STATUS";r[r["INVALID_EOF_STATE"]=14]="INVALID_EOF_STATE";r[r["INVALID_TRANSFER_ENCODING"]=15]="INVALID_TRANSFER_ENCODING";r[r["CB_MESSAGE_BEGIN"]=16]="CB_MESSAGE_BEGIN";r[r["CB_HEADERS_COMPLETE"]=17]="CB_HEADERS_COMPLETE";r[r["CB_MESSAGE_COMPLETE"]=18]="CB_MESSAGE_COMPLETE";r[r["CB_CHUNK_HEADER"]=19]="CB_CHUNK_HEADER";r[r["CB_CHUNK_COMPLETE"]=20]="CB_CHUNK_COMPLETE";r[r["PAUSED"]=21]="PAUSED";r[r["PAUSED_UPGRADE"]=22]="PAUSED_UPGRADE";r[r["PAUSED_H2_UPGRADE"]=23]="PAUSED_H2_UPGRADE";r[r["USER"]=24]="USER"})(l=i.ERROR||(i.ERROR={}));var c;(function(r){r[r["BOTH"]=0]="BOTH";r[r["REQUEST"]=1]="REQUEST";r[r["RESPONSE"]=2]="RESPONSE"})(c=i.TYPE||(i.TYPE={}));var p;(function(r){r[r["CONNECTION_KEEP_ALIVE"]=1]="CONNECTION_KEEP_ALIVE";r[r["CONNECTION_CLOSE"]=2]="CONNECTION_CLOSE";r[r["CONNECTION_UPGRADE"]=4]="CONNECTION_UPGRADE";r[r["CHUNKED"]=8]="CHUNKED";r[r["UPGRADE"]=16]="UPGRADE";r[r["CONTENT_LENGTH"]=32]="CONTENT_LENGTH";r[r["SKIPBODY"]=64]="SKIPBODY";r[r["TRAILING"]=128]="TRAILING";r[r["TRANSFER_ENCODING"]=512]="TRANSFER_ENCODING"})(p=i.FLAGS||(i.FLAGS={}));var d;(function(r){r[r["HEADERS"]=1]="HEADERS";r[r["CHUNKED_LENGTH"]=2]="CHUNKED_LENGTH";r[r["KEEP_ALIVE"]=4]="KEEP_ALIVE"})(d=i.LENIENT_FLAGS||(i.LENIENT_FLAGS={}));var u;(function(r){r[r["DELETE"]=0]="DELETE";r[r["GET"]=1]="GET";r[r["HEAD"]=2]="HEAD";r[r["POST"]=3]="POST";r[r["PUT"]=4]="PUT";r[r["CONNECT"]=5]="CONNECT";r[r["OPTIONS"]=6]="OPTIONS";r[r["TRACE"]=7]="TRACE";r[r["COPY"]=8]="COPY";r[r["LOCK"]=9]="LOCK";r[r["MKCOL"]=10]="MKCOL";r[r["MOVE"]=11]="MOVE";r[r["PROPFIND"]=12]="PROPFIND";r[r["PROPPATCH"]=13]="PROPPATCH";r[r["SEARCH"]=14]="SEARCH";r[r["UNLOCK"]=15]="UNLOCK";r[r["BIND"]=16]="BIND";r[r["REBIND"]=17]="REBIND";r[r["UNBIND"]=18]="UNBIND";r[r["ACL"]=19]="ACL";r[r["REPORT"]=20]="REPORT";r[r["MKACTIVITY"]=21]="MKACTIVITY";r[r["CHECKOUT"]=22]="CHECKOUT";r[r["MERGE"]=23]="MERGE";r[r["M-SEARCH"]=24]="M-SEARCH";r[r["NOTIFY"]=25]="NOTIFY";r[r["SUBSCRIBE"]=26]="SUBSCRIBE";r[r["UNSUBSCRIBE"]=27]="UNSUBSCRIBE";r[r["PATCH"]=28]="PATCH";r[r["PURGE"]=29]="PURGE";r[r["MKCALENDAR"]=30]="MKCALENDAR";r[r["LINK"]=31]="LINK";r[r["UNLINK"]=32]="UNLINK";r[r["SOURCE"]=33]="SOURCE";r[r["PRI"]=34]="PRI";r[r["DESCRIBE"]=35]="DESCRIBE";r[r["ANNOUNCE"]=36]="ANNOUNCE";r[r["SETUP"]=37]="SETUP";r[r["PLAY"]=38]="PLAY";r[r["PAUSE"]=39]="PAUSE";r[r["TEARDOWN"]=40]="TEARDOWN";r[r["GET_PARAMETER"]=41]="GET_PARAMETER";r[r["SET_PARAMETER"]=42]="SET_PARAMETER";r[r["REDIRECT"]=43]="REDIRECT";r[r["RECORD"]=44]="RECORD";r[r["FLUSH"]=45]="FLUSH"})(u=i.METHODS||(i.METHODS={}));i.METHODS_HTTP=[u.DELETE,u.GET,u.HEAD,u.POST,u.PUT,u.CONNECT,u.OPTIONS,u.TRACE,u.COPY,u.LOCK,u.MKCOL,u.MOVE,u.PROPFIND,u.PROPPATCH,u.SEARCH,u.UNLOCK,u.BIND,u.REBIND,u.UNBIND,u.ACL,u.REPORT,u.MKACTIVITY,u.CHECKOUT,u.MERGE,u["M-SEARCH"],u.NOTIFY,u.SUBSCRIBE,u.UNSUBSCRIBE,u.PATCH,u.PURGE,u.MKCALENDAR,u.LINK,u.UNLINK,u.PRI,u.SOURCE];i.METHODS_ICE=[u.SOURCE];i.METHODS_RTSP=[u.OPTIONS,u.DESCRIBE,u.ANNOUNCE,u.SETUP,u.PLAY,u.PAUSE,u.TEARDOWN,u.GET_PARAMETER,u.SET_PARAMETER,u.REDIRECT,u.RECORD,u.FLUSH,u.GET,u.POST];i.METHOD_MAP=s.enumToMap(u);i.H_METHOD_MAP={};Object.keys(i.METHOD_MAP).forEach((r=>{if(/^H/.test(r)){i.H_METHOD_MAP[r]=i.METHOD_MAP[r]}}));var A;(function(r){r[r["SAFE"]=0]="SAFE";r[r["SAFE_WITH_CB"]=1]="SAFE_WITH_CB";r[r["UNSAFE"]=2]="UNSAFE"})(A=i.FINISH||(i.FINISH={}));i.ALPHA=[];for(let r="A".charCodeAt(0);r<="Z".charCodeAt(0);r++){i.ALPHA.push(String.fromCharCode(r));i.ALPHA.push(String.fromCharCode(r+32))}i.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};i.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};i.NUM=["0","1","2","3","4","5","6","7","8","9"];i.ALPHANUM=i.ALPHA.concat(i.NUM);i.MARK=["-","_",".","!","~","*","'","(",")"];i.USERINFO_CHARS=i.ALPHANUM.concat(i.MARK).concat(["%",";",":","&","=","+","$",","]);i.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(i.ALPHANUM);i.URL_CHAR=i.STRICT_URL_CHAR.concat(["\t","\f"]);for(let r=128;r<=255;r++){i.URL_CHAR.push(r)}i.HEX=i.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);i.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(i.ALPHANUM);i.TOKEN=i.STRICT_TOKEN.concat([" "]);i.HEADER_CHARS=["\t"];for(let r=32;r<=255;r++){if(r!==127){i.HEADER_CHARS.push(r)}}i.CONNECTION_TOKEN_CHARS=i.HEADER_CHARS.filter((r=>r!==44));i.MAJOR=i.NUM_MAP;i.MINOR=i.MAJOR;var h;(function(r){r[r["GENERAL"]=0]="GENERAL";r[r["CONNECTION"]=1]="CONNECTION";r[r["CONTENT_LENGTH"]=2]="CONTENT_LENGTH";r[r["TRANSFER_ENCODING"]=3]="TRANSFER_ENCODING";r[r["UPGRADE"]=4]="UPGRADE";r[r["CONNECTION_KEEP_ALIVE"]=5]="CONNECTION_KEEP_ALIVE";r[r["CONNECTION_CLOSE"]=6]="CONNECTION_CLOSE";r[r["CONNECTION_UPGRADE"]=7]="CONNECTION_UPGRADE";r[r["TRANSFER_ENCODING_CHUNKED"]=8]="TRANSFER_ENCODING_CHUNKED"})(h=i.HEADER_STATE||(i.HEADER_STATE={}));i.SPECIAL_HEADERS={connection:h.CONNECTION,"content-length":h.CONTENT_LENGTH,"proxy-connection":h.CONNECTION,"transfer-encoding":h.TRANSFER_ENCODING,upgrade:h.UPGRADE}},29702:r=>{r.exports="AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwHLAcoBuAHJAbkByAG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAQDcAQtBACEQDMYBC0EOIRAMxQELQQ0hEAzEAQtBDyEQDMMBC0EQIRAMwgELQRMhEAzBAQtBFCEQDMABC0EVIRAMvwELQRYhEAy+AQtBFyEQDL0BC0EYIRAMvAELQRkhEAy7AQtBGiEQDLoBC0EbIRAMuQELQRwhEAy4AQtBCCEQDLcBC0EdIRAMtgELQSAhEAy1AQtBHyEQDLQBC0EHIRAMswELQSEhEAyyAQtBIiEQDLEBC0EeIRAMsAELQSMhEAyvAQtBEiEQDK4BC0ERIRAMrQELQSQhEAysAQtBJSEQDKsBC0EmIRAMqgELQSchEAypAQtBwwEhEAyoAQtBKSEQDKcBC0ErIRAMpgELQSwhEAylAQtBLSEQDKQBC0EuIRAMowELQS8hEAyiAQtBxAEhEAyhAQtBMCEQDKABC0E0IRAMnwELQQwhEAyeAQtBMSEQDJ0BC0EyIRAMnAELQTMhEAybAQtBOSEQDJoBC0E1IRAMmQELQcUBIRAMmAELQQshEAyXAQtBOiEQDJYBC0E2IRAMlQELQQohEAyUAQtBNyEQDJMBC0E4IRAMkgELQTwhEAyRAQtBOyEQDJABC0E9IRAMjwELQQkhEAyOAQtBKCEQDI0BC0E+IRAMjAELQT8hEAyLAQtBwAAhEAyKAQtBwQAhEAyJAQtBwgAhEAyIAQtBwwAhEAyHAQtBxAAhEAyGAQtBxQAhEAyFAQtBxgAhEAyEAQtBKiEQDIMBC0HHACEQDIIBC0HIACEQDIEBC0HJACEQDIABC0HKACEQDH8LQcsAIRAMfgtBzQAhEAx9C0HMACEQDHwLQc4AIRAMewtBzwAhEAx6C0HQACEQDHkLQdEAIRAMeAtB0gAhEAx3C0HTACEQDHYLQdQAIRAMdQtB1gAhEAx0C0HVACEQDHMLQQYhEAxyC0HXACEQDHELQQUhEAxwC0HYACEQDG8LQQQhEAxuC0HZACEQDG0LQdoAIRAMbAtB2wAhEAxrC0HcACEQDGoLQQMhEAxpC0HdACEQDGgLQd4AIRAMZwtB3wAhEAxmC0HhACEQDGULQeAAIRAMZAtB4gAhEAxjC0HjACEQDGILQQIhEAxhC0HkACEQDGALQeUAIRAMXwtB5gAhEAxeC0HnACEQDF0LQegAIRAMXAtB6QAhEAxbC0HqACEQDFoLQesAIRAMWQtB7AAhEAxYC0HtACEQDFcLQe4AIRAMVgtB7wAhEAxVC0HwACEQDFQLQfEAIRAMUwtB8gAhEAxSC0HzACEQDFELQfQAIRAMUAtB9QAhEAxPC0H2ACEQDE4LQfcAIRAMTQtB+AAhEAxMC0H5ACEQDEsLQfoAIRAMSgtB+wAhEAxJC0H8ACEQDEgLQf0AIRAMRwtB/gAhEAxGC0H/ACEQDEULQYABIRAMRAtBgQEhEAxDC0GCASEQDEILQYMBIRAMQQtBhAEhEAxAC0GFASEQDD8LQYYBIRAMPgtBhwEhEAw9C0GIASEQDDwLQYkBIRAMOwtBigEhEAw6C0GLASEQDDkLQYwBIRAMOAtBjQEhEAw3C0GOASEQDDYLQY8BIRAMNQtBkAEhEAw0C0GRASEQDDMLQZIBIRAMMgtBkwEhEAwxC0GUASEQDDALQZUBIRAMLwtBlgEhEAwuC0GXASEQDC0LQZgBIRAMLAtBmQEhEAwrC0GaASEQDCoLQZsBIRAMKQtBnAEhEAwoC0GdASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAEiBCACRw3zAUHdASEQDP8DCyABIhAgAkcN3QFBwwEhEAz+AwsgASIBIAJHDZABQfcAIRAM/QMLIAEiASACRw2GAUHvACEQDPwDCyABIgEgAkcNf0HqACEQDPsDCyABIgEgAkcNe0HoACEQDPoDCyABIgEgAkcNeEHmACEQDPkDCyABIgEgAkcNGkEYIRAM+AMLIAEiASACRw0UQRIhEAz3AwsgASIBIAJHDVlBxQAhEAz2AwsgASIBIAJHDUpBPyEQDPUDCyABIgEgAkcNSEE8IRAM9AMLIAEiASACRw1BQTEhEAzzAwsgAC0ALkEBRg3rAwyHAgsgACABIgEgAhDAgICAAEEBRw3mASAAQgA3AyAM5wELIAAgASIBIAIQtICAgAAiEA3nASABIQEM9QILAkAgASIBIAJHDQBBBiEQDPADCyAAIAFBAWoiASACELuAgIAAIhAN6AEgASEBDDELIABCADcDIEESIRAM1QMLIAEiECACRw0rQR0hEAztAwsCQCABIgEgAkYNACABQQFqIQFBECEQDNQDC0EHIRAM7AMLIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN5QFBCCEQDOsDCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEUIRAM0gMLQQkhEAzqAwsgASEBIAApAyBQDeQBIAEhAQzyAgsCQCABIgEgAkcNAEELIRAM6QMLIAAgAUEBaiIBIAIQtoCAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3mASABIQEMDQsgACABIgEgAhC6gICAACIQDecBIAEhAQzwAgsCQCABIgEgAkcNAEEPIRAM5QMLIAEtAAAiEEE7Rg0IIBBBDUcN6AEgAUEBaiEBDO8CCyAAIAEiASACELqAgIAAIhAN6AEgASEBDPICCwNAAkAgAS0AAEHwtYCAAGotAAAiEEEBRg0AIBBBAkcN6wEgACgCBCEQIABBADYCBCAAIBAgAUEBaiIBELmAgIAAIhAN6gEgASEBDPQCCyABQQFqIgEgAkcNAAtBEiEQDOIDCyAAIAEiASACELqAgIAAIhAN6QEgASEBDAoLIAEiASACRw0GQRshEAzgAwsCQCABIgEgAkcNAEEWIRAM4AMLIABBioCAgAA2AgggACABNgIEIAAgASACELiAgIAAIhAN6gEgASEBQSAhEAzGAwsCQCABIgEgAkYNAANAAkAgAS0AAEHwt4CAAGotAAAiEEECRg0AAkAgEEF/ag4E5QHsAQDrAewBCyABQQFqIQFBCCEQDMgDCyABQQFqIgEgAkcNAAtBFSEQDN8DC0EVIRAM3gMLA0ACQCABLQAAQfC5gIAAai0AACIQQQJGDQAgEEF/ag4E3gHsAeAB6wHsAQsgAUEBaiIBIAJHDQALQRghEAzdAwsCQCABIgEgAkYNACAAQYuAgIAANgIIIAAgATYCBCABIQFBByEQDMQDC0EZIRAM3AMLIAFBAWohAQwCCwJAIAEiFCACRw0AQRohEAzbAwsgFCEBAkAgFC0AAEFzag4U3QLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gIA7gILQQAhECAAQQA2AhwgAEGvi4CAADYCECAAQQI2AgwgACAUQQFqNgIUDNoDCwJAIAEtAAAiEEE7Rg0AIBBBDUcN6AEgAUEBaiEBDOUCCyABQQFqIQELQSIhEAy/AwsCQCABIhAgAkcNAEEcIRAM2AMLQgAhESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUEJRg0AIAFBIEcN1QELIAAtACxBCEYN0wEgECEBDJEDCwJAIAEiASACRw0AQSwhEAy0AwsgAS0AAEEKRw3VASABQQFqIQEMyQILIAEiDiACRw3VAUEvIRAMsgMLA0ACQCABLQAAIhBBIEYNAAJAIBBBdmoOBADcAdwBANoBCyABIQEM4AELIAFBAWoiASACRw0AC0ExIRAMsQMLQTIhECABIhQgAkYNsAMgAiAUayAAKAIAIgFqIRUgFCABa0EDaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfC7gIAAai0AAEcNAQJAIAFBA0cNAEEGIQEMlgMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLEDCyAAQQA2AgAgFCEBDNkBC0EzIRAgASIUIAJGDa8DIAIgFGsgACgCACIBaiEVIBQgAWtBCGohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUH0u4CAAGotAABHDQECQCABQQhHDQBBBSEBDJUDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAywAwsgAEEANgIAIBQhAQzYAQtBNCEQIAEiFCACRg2uAyACIBRrIAAoAgAiAWohFSAUIAFrQQVqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw0BAkAgAUEFRw0AQQchAQyUAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMrwMLIABBADYCACAUIQEM1wELAkAgASIBIAJGDQADQAJAIAEtAABBgL6AgABqLQAAIhBBAUYNACAQQQJGDQogASEBDN0BCyABQQFqIgEgAkcNAAtBMCEQDK4DC0EwIRAMrQMLAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AIBBBdmoOBNkB2gHaAdkB2gELIAFBAWoiASACRw0AC0E4IRAMrQMLQTghEAysAwsDQAJAIAEtAAAiEEEgRg0AIBBBCUcNAwsgAUEBaiIBIAJHDQALQTwhEAyrAwsDQAJAIAEtAAAiEEEgRg0AAkACQCAQQXZqDgTaAQEB2gEACyAQQSxGDdsBCyABIQEMBAsgAUEBaiIBIAJHDQALQT8hEAyqAwsgASEBDNsBC0HAACEQIAEiFCACRg2oAyACIBRrIAAoAgAiAWohFiAUIAFrQQZqIRcCQANAIBQtAABBIHIgAUGAwICAAGotAABHDQEgAUEGRg2OAyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAypAwsgAEEANgIAIBQhAQtBNiEQDI4DCwJAIAEiDyACRw0AQcEAIRAMpwMLIABBjICAgAA2AgggACAPNgIEIA8hASAALQAsQX9qDgTNAdUB1wHZAYcDCyABQQFqIQEMzAELAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgciAQIBBBv39qQf8BcUEaSRtB/wFxIhBBCUYNACAQQSBGDQACQAJAAkACQCAQQZ1/ag4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIRAMkQMLIAFBAWohAUEyIRAMkAMLIAFBAWohAUEzIRAMjwMLIAEhAQzQAQsgAUEBaiIBIAJHDQALQTUhEAylAwtBNSEQDKQDCwJAIAEiASACRg0AA0ACQCABLQAAQYC8gIAAai0AAEEBRg0AIAEhAQzTAQsgAUEBaiIBIAJHDQALQT0hEAykAwtBPSEQDKMDCyAAIAEiASACELCAgIAAIhAN1gEgASEBDAELIBBBAWohAQtBPCEQDIcDCwJAIAEiASACRw0AQcIAIRAMoAMLAkADQAJAIAEtAABBd2oOGAAC/gL+AoQD/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4CAP4CCyABQQFqIgEgAkcNAAtBwgAhEAygAwsgAUEBaiEBIAAtAC1BAXFFDb0BIAEhAQtBLCEQDIUDCyABIgEgAkcN0wFBxAAhEAydAwsDQAJAIAEtAABBkMCAgABqLQAAQQFGDQAgASEBDLcCCyABQQFqIgEgAkcNAAtBxQAhEAycAwsgDS0AACIQQSBGDbMBIBBBOkcNgQMgACgCBCEBIABBADYCBCAAIAEgDRCvgICAACIBDdABIA1BAWohAQyzAgtBxwAhECABIg0gAkYNmgMgAiANayAAKAIAIgFqIRYgDSABa0EFaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGQwoCAAGotAABHDYADIAFBBUYN9AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmgMLQcgAIRAgASINIAJGDZkDIAIgDWsgACgCACIBaiEWIA0gAWtBCWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBlsKAgABqLQAARw3/AgJAIAFBCUcNAEECIQEM9QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJkDCwJAIAEiDSACRw0AQckAIRAMmQMLAkACQCANLQAAIgFBIHIgASABQb9/akH/AXFBGkkbQf8BcUGSf2oOBwCAA4ADgAOAA4ADAYADCyANQQFqIQFBPiEQDIADCyANQQFqIQFBPyEQDP8CC0HKACEQIAEiDSACRg2XAyACIA1rIAAoAgAiAWohFiANIAFrQQFqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaDCgIAAai0AAEcN/QIgAUEBRg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyXAwtBywAhECABIg0gAkYNlgMgAiANayAAKAIAIgFqIRYgDSABa0EOaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGiwoCAAGotAABHDfwCIAFBDkYN8AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlgMLQcwAIRAgASINIAJGDZUDIAIgDWsgACgCACIBaiEWIA0gAWtBD2ohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBwMKAgABqLQAARw37AgJAIAFBD0cNAEEDIQEM8QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJUDC0HNACEQIAEiDSACRg2UAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQdDCgIAAai0AAEcN+gICQCABQQVHDQBBBCEBDPACCyABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyUAwsCQCABIg0gAkcNAEHOACEQDJQDCwJAAkACQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZ1/ag4TAP0C/QL9Av0C/QL9Av0C/QL9Av0C/QL9AgH9Av0C/QICA/0CCyANQQFqIQFBwQAhEAz9AgsgDUEBaiEBQcIAIRAM/AILIA1BAWohAUHDACEQDPsCCyANQQFqIQFBxAAhEAz6AgsCQCABIgEgAkYNACAAQY2AgIAANgIIIAAgATYCBCABIQFBxQAhEAz6AgtBzwAhEAySAwsgECEBAkACQCAQLQAAQXZqDgQBqAKoAgCoAgsgEEEBaiEBC0EnIRAM+AILAkAgASIBIAJHDQBB0QAhEAyRAwsCQCABLQAAQSBGDQAgASEBDI0BCyABQQFqIQEgAC0ALUEBcUUNxwEgASEBDIwBCyABIhcgAkcNyAFB0gAhEAyPAwtB0wAhECABIhQgAkYNjgMgAiAUayAAKAIAIgFqIRYgFCABa0EBaiEXA0AgFC0AACABQdbCgIAAai0AAEcNzAEgAUEBRg3HASABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAyOAwsCQCABIgEgAkcNAEHVACEQDI4DCyABLQAAQQpHDcwBIAFBAWohAQzHAQsCQCABIgEgAkcNAEHWACEQDI0DCwJAAkAgAS0AAEF2ag4EAM0BzQEBzQELIAFBAWohAQzHAQsgAUEBaiEBQcoAIRAM8wILIAAgASIBIAIQroCAgAAiEA3LASABIQFBzQAhEAzyAgsgAC0AKUEiRg2FAwymAgsCQCABIgEgAkcNAEHbACEQDIoDC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgAS0AAEFQag4K1AHTAQABAgMEBQYI1QELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMzAELQQkhEEEBIRRBACEXQQAhFgzLAQsCQCABIgEgAkcNAEHdACEQDIkDCyABLQAAQS5HDcwBIAFBAWohAQymAgsgASIBIAJHDcwBQd8AIRAMhwMLAkAgASIBIAJGDQAgAEGOgICAADYCCCAAIAE2AgQgASEBQdAAIRAM7gILQeAAIRAMhgMLQeEAIRAgASIBIAJGDYUDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHiwoCAAGotAABHDc0BIBRBA0YNzAEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhQMLQeIAIRAgASIBIAJGDYQDIAIgAWsgACgCACIUaiEWIAEgFGtBAmohFwNAIAEtAAAgFEHmwoCAAGotAABHDcwBIBRBAkYNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhAMLQeMAIRAgASIBIAJGDYMDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHpwoCAAGotAABHDcsBIBRBA0YNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMgwMLAkAgASIBIAJHDQBB5QAhEAyDAwsgACABQQFqIgEgAhCogICAACIQDc0BIAEhAUHWACEQDOkCCwJAIAEiASACRg0AA0ACQCABLQAAIhBBIEYNAAJAAkACQCAQQbh/ag4LAAHPAc8BzwHPAc8BzwHPAc8BAs8BCyABQQFqIQFB0gAhEAztAgsgAUEBaiEBQdMAIRAM7AILIAFBAWohAUHUACEQDOsCCyABQQFqIgEgAkcNAAtB5AAhEAyCAwtB5AAhEAyBAwsDQAJAIAEtAABB8MKAgABqLQAAIhBBAUYNACAQQX5qDgPPAdAB0QHSAQsgAUEBaiIBIAJHDQALQeYAIRAMgAMLAkAgASIBIAJGDQAgAUEBaiEBDAMLQecAIRAM/wILA0ACQCABLQAAQfDEgIAAai0AACIQQQFGDQACQCAQQX5qDgTSAdMB1AEA1QELIAEhAUHXACEQDOcCCyABQQFqIgEgAkcNAAtB6AAhEAz+AgsCQCABIgEgAkcNAEHpACEQDP4CCwJAIAEtAAAiEEF2ag4augHVAdUBvAHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHKAdUB1QEA0wELIAFBAWohAQtBBiEQDOMCCwNAAkAgAS0AAEHwxoCAAGotAABBAUYNACABIQEMngILIAFBAWoiASACRw0AC0HqACEQDPsCCwJAIAEiASACRg0AIAFBAWohAQwDC0HrACEQDPoCCwJAIAEiASACRw0AQewAIRAM+gILIAFBAWohAQwBCwJAIAEiASACRw0AQe0AIRAM+QILIAFBAWohAQtBBCEQDN4CCwJAIAEiFCACRw0AQe4AIRAM9wILIBQhAQJAAkACQCAULQAAQfDIgIAAai0AAEF/ag4H1AHVAdYBAJwCAQLXAQsgFEEBaiEBDAoLIBRBAWohAQzNAQtBACEQIABBADYCHCAAQZuSgIAANgIQIABBBzYCDCAAIBRBAWo2AhQM9gILAkADQAJAIAEtAABB8MiAgABqLQAAIhBBBEYNAAJAAkAgEEF/ag4H0gHTAdQB2QEABAHZAQsgASEBQdoAIRAM4AILIAFBAWohAUHcACEQDN8CCyABQQFqIgEgAkcNAAtB7wAhEAz2AgsgAUEBaiEBDMsBCwJAIAEiFCACRw0AQfAAIRAM9QILIBQtAABBL0cN1AEgFEEBaiEBDAYLAkAgASIUIAJHDQBB8QAhEAz0AgsCQCAULQAAIgFBL0cNACAUQQFqIQFB3QAhEAzbAgsgAUF2aiIEQRZLDdMBQQEgBHRBiYCAAnFFDdMBDMoCCwJAIAEiASACRg0AIAFBAWohAUHeACEQDNoCC0HyACEQDPICCwJAIAEiFCACRw0AQfQAIRAM8gILIBQhAQJAIBQtAABB8MyAgABqLQAAQX9qDgPJApQCANQBC0HhACEQDNgCCwJAIAEiFCACRg0AA0ACQCAULQAAQfDKgIAAai0AACIBQQNGDQACQCABQX9qDgLLAgDVAQsgFCEBQd8AIRAM2gILIBRBAWoiFCACRw0AC0HzACEQDPECC0HzACEQDPACCwJAIAEiASACRg0AIABBj4CAgAA2AgggACABNgIEIAEhAUHgACEQDNcCC0H1ACEQDO8CCwJAIAEiASACRw0AQfYAIRAM7wILIABBj4CAgAA2AgggACABNgIEIAEhAQtBAyEQDNQCCwNAIAEtAABBIEcNwwIgAUEBaiIBIAJHDQALQfcAIRAM7AILAkAgASIBIAJHDQBB+AAhEAzsAgsgAS0AAEEgRw3OASABQQFqIQEM7wELIAAgASIBIAIQrICAgAAiEA3OASABIQEMjgILAkAgASIEIAJHDQBB+gAhEAzqAgsgBC0AAEHMAEcN0QEgBEEBaiEBQRMhEAzPAQsCQCABIgQgAkcNAEH7ACEQDOkCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRADQCAELQAAIAFB8M6AgABqLQAARw3QASABQQVGDc4BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQfsAIRAM6AILAkAgASIEIAJHDQBB/AAhEAzoAgsCQAJAIAQtAABBvX9qDgwA0QHRAdEB0QHRAdEB0QHRAdEB0QEB0QELIARBAWohAUHmACEQDM8CCyAEQQFqIQFB5wAhEAzOAgsCQCABIgQgAkcNAEH9ACEQDOcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDc8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH9ACEQDOcCCyAAQQA2AgAgEEEBaiEBQRAhEAzMAQsCQCABIgQgAkcNAEH+ACEQDOYCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUH2zoCAAGotAABHDc4BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH+ACEQDOYCCyAAQQA2AgAgEEEBaiEBQRYhEAzLAQsCQCABIgQgAkcNAEH/ACEQDOUCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUH8zoCAAGotAABHDc0BIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH/ACEQDOUCCyAAQQA2AgAgEEEBaiEBQQUhEAzKAQsCQCABIgQgAkcNAEGAASEQDOQCCyAELQAAQdkARw3LASAEQQFqIQFBCCEQDMkBCwJAIAEiBCACRw0AQYEBIRAM4wILAkACQCAELQAAQbJ/ag4DAMwBAcwBCyAEQQFqIQFB6wAhEAzKAgsgBEEBaiEBQewAIRAMyQILAkAgASIEIAJHDQBBggEhEAziAgsCQAJAIAQtAABBuH9qDggAywHLAcsBywHLAcsBAcsBCyAEQQFqIQFB6gAhEAzJAgsgBEEBaiEBQe0AIRAMyAILAkAgASIEIAJHDQBBgwEhEAzhAgsgAiAEayAAKAIAIgFqIRAgBCABa0ECaiEUAkADQCAELQAAIAFBgM+AgABqLQAARw3JASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBA2AgBBgwEhEAzhAgtBACEQIABBADYCACAUQQFqIQEMxgELAkAgASIEIAJHDQBBhAEhEAzgAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBg8+AgABqLQAARw3IASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhAEhEAzgAgsgAEEANgIAIBBBAWohAUEjIRAMxQELAkAgASIEIAJHDQBBhQEhEAzfAgsCQAJAIAQtAABBtH9qDggAyAHIAcgByAHIAcgBAcgBCyAEQQFqIQFB7wAhEAzGAgsgBEEBaiEBQfAAIRAMxQILAkAgASIEIAJHDQBBhgEhEAzeAgsgBC0AAEHFAEcNxQEgBEEBaiEBDIMCCwJAIAEiBCACRw0AQYcBIRAM3QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQYjPgIAAai0AAEcNxQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYcBIRAM3QILIABBADYCACAQQQFqIQFBLSEQDMIBCwJAIAEiBCACRw0AQYgBIRAM3AILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNxAEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYgBIRAM3AILIABBADYCACAQQQFqIQFBKSEQDMEBCwJAIAEiASACRw0AQYkBIRAM2wILQQEhECABLQAAQd8ARw3AASABQQFqIQEMgQILAkAgASIEIAJHDQBBigEhEAzaAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQA0AgBC0AACABQYzPgIAAai0AAEcNwQEgAUEBRg2vAiABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGKASEQDNkCCwJAIAEiBCACRw0AQYsBIRAM2QILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQY7PgIAAai0AAEcNwQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYsBIRAM2QILIABBADYCACAQQQFqIQFBAiEQDL4BCwJAIAEiBCACRw0AQYwBIRAM2AILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNwAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYwBIRAM2AILIABBADYCACAQQQFqIQFBHyEQDL0BCwJAIAEiBCACRw0AQY0BIRAM1wILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNvwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY0BIRAM1wILIABBADYCACAQQQFqIQFBCSEQDLwBCwJAIAEiBCACRw0AQY4BIRAM1gILAkACQCAELQAAQbd/ag4HAL8BvwG/Ab8BvwEBvwELIARBAWohAUH4ACEQDL0CCyAEQQFqIQFB+QAhEAy8AgsCQCABIgQgAkcNAEGPASEQDNUCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGRz4CAAGotAABHDb0BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGPASEQDNUCCyAAQQA2AgAgEEEBaiEBQRghEAy6AQsCQCABIgQgAkcNAEGQASEQDNQCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUGXz4CAAGotAABHDbwBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGQASEQDNQCCyAAQQA2AgAgEEEBaiEBQRchEAy5AQsCQCABIgQgAkcNAEGRASEQDNMCCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUGaz4CAAGotAABHDbsBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGRASEQDNMCCyAAQQA2AgAgEEEBaiEBQRUhEAy4AQsCQCABIgQgAkcNAEGSASEQDNICCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGhz4CAAGotAABHDboBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGSASEQDNICCyAAQQA2AgAgEEEBaiEBQR4hEAy3AQsCQCABIgQgAkcNAEGTASEQDNECCyAELQAAQcwARw24ASAEQQFqIQFBCiEQDLYBCwJAIAQgAkcNAEGUASEQDNACCwJAAkAgBC0AAEG/f2oODwC5AbkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AQG5AQsgBEEBaiEBQf4AIRAMtwILIARBAWohAUH/ACEQDLYCCwJAIAQgAkcNAEGVASEQDM8CCwJAAkAgBC0AAEG/f2oOAwC4AQG4AQsgBEEBaiEBQf0AIRAMtgILIARBAWohBEGAASEQDLUCCwJAIAQgAkcNAEGWASEQDM4CCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUGnz4CAAGotAABHDbYBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGWASEQDM4CCyAAQQA2AgAgEEEBaiEBQQshEAyzAQsCQCAEIAJHDQBBlwEhEAzNAgsCQAJAAkACQCAELQAAQVNqDiMAuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AQG4AbgBuAG4AbgBArgBuAG4AQO4AQsgBEEBaiEBQfsAIRAMtgILIARBAWohAUH8ACEQDLUCCyAEQQFqIQRBgQEhEAy0AgsgBEEBaiEEQYIBIRAMswILAkAgBCACRw0AQZgBIRAMzAILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQanPgIAAai0AAEcNtAEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZgBIRAMzAILIABBADYCACAQQQFqIQFBGSEQDLEBCwJAIAQgAkcNAEGZASEQDMsCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGuz4CAAGotAABHDbMBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGZASEQDMsCCyAAQQA2AgAgEEEBaiEBQQYhEAywAQsCQCAEIAJHDQBBmgEhEAzKAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBtM+AgABqLQAARw2yASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmgEhEAzKAgsgAEEANgIAIBBBAWohAUEcIRAMrwELAkAgBCACRw0AQZsBIRAMyQILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbbPgIAAai0AAEcNsQEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZsBIRAMyQILIABBADYCACAQQQFqIQFBJyEQDK4BCwJAIAQgAkcNAEGcASEQDMgCCwJAAkAgBC0AAEGsf2oOAgABsQELIARBAWohBEGGASEQDK8CCyAEQQFqIQRBhwEhEAyuAgsCQCAEIAJHDQBBnQEhEAzHAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBuM+AgABqLQAARw2vASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBnQEhEAzHAgsgAEEANgIAIBBBAWohAUEmIRAMrAELAkAgBCACRw0AQZ4BIRAMxgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbrPgIAAai0AAEcNrgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ4BIRAMxgILIABBADYCACAQQQFqIQFBAyEQDKsBCwJAIAQgAkcNAEGfASEQDMUCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDa0BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGfASEQDMUCCyAAQQA2AgAgEEEBaiEBQQwhEAyqAQsCQCAEIAJHDQBBoAEhEAzEAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBvM+AgABqLQAARw2sASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBoAEhEAzEAgsgAEEANgIAIBBBAWohAUENIRAMqQELAkAgBCACRw0AQaEBIRAMwwILAkACQCAELQAAQbp/ag4LAKwBrAGsAawBrAGsAawBrAGsAQGsAQsgBEEBaiEEQYsBIRAMqgILIARBAWohBEGMASEQDKkCCwJAIAQgAkcNAEGiASEQDMICCyAELQAAQdAARw2pASAEQQFqIQQM6QELAkAgBCACRw0AQaMBIRAMwQILAkACQCAELQAAQbd/ag4HAaoBqgGqAaoBqgEAqgELIARBAWohBEGOASEQDKgCCyAEQQFqIQFBIiEQDKYBCwJAIAQgAkcNAEGkASEQDMACCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHAz4CAAGotAABHDagBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGkASEQDMACCyAAQQA2AgAgEEEBaiEBQR0hEAylAQsCQCAEIAJHDQBBpQEhEAy/AgsCQAJAIAQtAABBrn9qDgMAqAEBqAELIARBAWohBEGQASEQDKYCCyAEQQFqIQFBBCEQDKQBCwJAIAQgAkcNAEGmASEQDL4CCwJAAkACQAJAAkAgBC0AAEG/f2oOFQCqAaoBqgGqAaoBqgGqAaoBqgGqAQGqAaoBAqoBqgEDqgGqAQSqAQsgBEEBaiEEQYgBIRAMqAILIARBAWohBEGJASEQDKcCCyAEQQFqIQRBigEhEAymAgsgBEEBaiEEQY8BIRAMpQILIARBAWohBEGRASEQDKQCCwJAIAQgAkcNAEGnASEQDL0CCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDaUBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGnASEQDL0CCyAAQQA2AgAgEEEBaiEBQREhEAyiAQsCQCAEIAJHDQBBqAEhEAy8AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBws+AgABqLQAARw2kASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqAEhEAy8AgsgAEEANgIAIBBBAWohAUEsIRAMoQELAkAgBCACRw0AQakBIRAMuwILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQcXPgIAAai0AAEcNowEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQakBIRAMuwILIABBADYCACAQQQFqIQFBKyEQDKABCwJAIAQgAkcNAEGqASEQDLoCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHKz4CAAGotAABHDaIBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGqASEQDLoCCyAAQQA2AgAgEEEBaiEBQRQhEAyfAQsCQCAEIAJHDQBBqwEhEAy5AgsCQAJAAkACQCAELQAAQb5/ag4PAAECpAGkAaQBpAGkAaQBpAGkAaQBpAGkAQOkAQsgBEEBaiEEQZMBIRAMogILIARBAWohBEGUASEQDKECCyAEQQFqIQRBlQEhEAygAgsgBEEBaiEEQZYBIRAMnwILAkAgBCACRw0AQawBIRAMuAILIAQtAABBxQBHDZ8BIARBAWohBAzgAQsCQCAEIAJHDQBBrQEhEAy3AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBzc+AgABqLQAARw2fASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrQEhEAy3AgsgAEEANgIAIBBBAWohAUEOIRAMnAELAkAgBCACRw0AQa4BIRAMtgILIAQtAABB0ABHDZ0BIARBAWohAUElIRAMmwELAkAgBCACRw0AQa8BIRAMtQILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNnQEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQa8BIRAMtQILIABBADYCACAQQQFqIQFBKiEQDJoBCwJAIAQgAkcNAEGwASEQDLQCCwJAAkAgBC0AAEGrf2oOCwCdAZ0BnQGdAZ0BnQGdAZ0BnQEBnQELIARBAWohBEGaASEQDJsCCyAEQQFqIQRBmwEhEAyaAgsCQCAEIAJHDQBBsQEhEAyzAgsCQAJAIAQtAABBv39qDhQAnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBAZwBCyAEQQFqIQRBmQEhEAyaAgsgBEEBaiEEQZwBIRAMmQILAkAgBCACRw0AQbIBIRAMsgILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQdnPgIAAai0AAEcNmgEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbIBIRAMsgILIABBADYCACAQQQFqIQFBISEQDJcBCwJAIAQgAkcNAEGzASEQDLECCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUHdz4CAAGotAABHDZkBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGzASEQDLECCyAAQQA2AgAgEEEBaiEBQRohEAyWAQsCQCAEIAJHDQBBtAEhEAywAgsCQAJAAkAgBC0AAEG7f2oOEQCaAZoBmgGaAZoBmgGaAZoBmgEBmgGaAZoBmgGaAQKaAQsgBEEBaiEEQZ0BIRAMmAILIARBAWohBEGeASEQDJcCCyAEQQFqIQRBnwEhEAyWAgsCQCAEIAJHDQBBtQEhEAyvAgsgAiAEayAAKAIAIgFqIRQgBCABa0EFaiEQAkADQCAELQAAIAFB5M+AgABqLQAARw2XASABQQVGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtQEhEAyvAgsgAEEANgIAIBBBAWohAUEoIRAMlAELAkAgBCACRw0AQbYBIRAMrgILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQerPgIAAai0AAEcNlgEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbYBIRAMrgILIABBADYCACAQQQFqIQFBByEQDJMBCwJAIAQgAkcNAEG3ASEQDK0CCwJAAkAgBC0AAEG7f2oODgCWAZYBlgGWAZYBlgGWAZYBlgGWAZYBlgEBlgELIARBAWohBEGhASEQDJQCCyAEQQFqIQRBogEhEAyTAgsCQCAEIAJHDQBBuAEhEAysAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB7c+AgABqLQAARw2UASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuAEhEAysAgsgAEEANgIAIBBBAWohAUESIRAMkQELAkAgBCACRw0AQbkBIRAMqwILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNkwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbkBIRAMqwILIABBADYCACAQQQFqIQFBICEQDJABCwJAIAQgAkcNAEG6ASEQDKoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHyz4CAAGotAABHDZIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG6ASEQDKoCCyAAQQA2AgAgEEEBaiEBQQ8hEAyPAQsCQCAEIAJHDQBBuwEhEAypAgsCQAJAIAQtAABBt39qDgcAkgGSAZIBkgGSAQGSAQsgBEEBaiEEQaUBIRAMkAILIARBAWohBEGmASEQDI8CCwJAIAQgAkcNAEG8ASEQDKgCCyACIARrIAAoAgAiAWohFCAEIAFrQQdqIRACQANAIAQtAAAgAUH0z4CAAGotAABHDZABIAFBB0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG8ASEQDKgCCyAAQQA2AgAgEEEBaiEBQRshEAyNAQsCQCAEIAJHDQBBvQEhEAynAgsCQAJAAkAgBC0AAEG+f2oOEgCRAZEBkQGRAZEBkQGRAZEBkQEBkQGRAZEBkQGRAZEBApEBCyAEQQFqIQRBpAEhEAyPAgsgBEEBaiEEQacBIRAMjgILIARBAWohBEGoASEQDI0CCwJAIAQgAkcNAEG+ASEQDKYCCyAELQAAQc4ARw2NASAEQQFqIQQMzwELAkAgBCACRw0AQb8BIRAMpQILAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgBC0AAEG/f2oOFQABAgOcAQQFBpwBnAGcAQcICQoLnAEMDQ4PnAELIARBAWohAUHoACEQDJoCCyAEQQFqIQFB6QAhEAyZAgsgBEEBaiEBQe4AIRAMmAILIARBAWohAUHyACEQDJcCCyAEQQFqIQFB8wAhEAyWAgsgBEEBaiEBQfYAIRAMlQILIARBAWohAUH3ACEQDJQCCyAEQQFqIQFB+gAhEAyTAgsgBEEBaiEEQYMBIRAMkgILIARBAWohBEGEASEQDJECCyAEQQFqIQRBhQEhEAyQAgsgBEEBaiEEQZIBIRAMjwILIARBAWohBEGYASEQDI4CCyAEQQFqIQRBoAEhEAyNAgsgBEEBaiEEQaMBIRAMjAILIARBAWohBEGqASEQDIsCCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEGrASEQDIsCC0HAASEQDKMCCyAAIAUgAhCqgICAACIBDYsBIAUhAQxcCwJAIAYgAkYNACAGQQFqIQUMjQELQcIBIRAMoQILA0ACQCAQLQAAQXZqDgSMAQAAjwEACyAQQQFqIhAgAkcNAAtBwwEhEAygAgsCQCAHIAJGDQAgAEGRgICAADYCCCAAIAc2AgQgByEBQQEhEAyHAgtBxAEhEAyfAgsCQCAHIAJHDQBBxQEhEAyfAgsCQAJAIActAABBdmoOBAHOAc4BAM4BCyAHQQFqIQYMjQELIAdBAWohBQyJAQsCQCAHIAJHDQBBxgEhEAyeAgsCQAJAIActAABBdmoOFwGPAY8BAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAQCPAQsgB0EBaiEHC0GwASEQDIQCCwJAIAggAkcNAEHIASEQDJ0CCyAILQAAQSBHDY0BIABBADsBMiAIQQFqIQFBswEhEAyDAgsgASEXAkADQCAXIgcgAkYNASAHLQAAQVBqQf8BcSIQQQpPDcwBAkAgAC8BMiIUQZkzSw0AIAAgFEEKbCIUOwEyIBBB//8DcyAUQf7/A3FJDQAgB0EBaiEXIAAgFCAQaiIQOwEyIBBB//8DcUHoB0kNAQsLQQAhECAAQQA2AhwgAEHBiYCAADYCECAAQQ02AgwgACAHQQFqNgIUDJwCC0HHASEQDJsCCyAAIAggAhCugICAACIQRQ3KASAQQRVHDYwBIABByAE2AhwgACAINgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAyaAgsCQCAJIAJHDQBBzAEhEAyaAgtBACEUQQEhF0EBIRZBACEQAkACQAJAAkACQAJAAkACQAJAIAktAABBUGoOCpYBlQEAAQIDBAUGCJcBC0ECIRAMBgtBAyEQDAULQQQhEAwEC0EFIRAMAwtBBiEQDAILQQchEAwBC0EIIRALQQAhF0EAIRZBACEUDI4BC0EJIRBBASEUQQAhF0EAIRYMjQELAkAgCiACRw0AQc4BIRAMmQILIAotAABBLkcNjgEgCkEBaiEJDMoBCyALIAJHDY4BQdABIRAMlwILAkAgCyACRg0AIABBjoCAgAA2AgggACALNgIEQbcBIRAM/gELQdEBIRAMlgILAkAgBCACRw0AQdIBIRAMlgILIAIgBGsgACgCACIQaiEUIAQgEGtBBGohCwNAIAQtAAAgEEH8z4CAAGotAABHDY4BIBBBBEYN6QEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB0gEhEAyVAgsgACAMIAIQrICAgAAiAQ2NASAMIQEMuAELAkAgBCACRw0AQdQBIRAMlAILIAIgBGsgACgCACIQaiEUIAQgEGtBAWohDANAIAQtAAAgEEGB0ICAAGotAABHDY8BIBBBAUYNjgEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB1AEhEAyTAgsCQCAEIAJHDQBB1gEhEAyTAgsgAiAEayAAKAIAIhBqIRQgBCAQa0ECaiELA0AgBC0AACAQQYPQgIAAai0AAEcNjgEgEEECRg2QASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHWASEQDJICCwJAIAQgAkcNAEHXASEQDJICCwJAAkAgBC0AAEG7f2oOEACPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAY8BCyAEQQFqIQRBuwEhEAz5AQsgBEEBaiEEQbwBIRAM+AELAkAgBCACRw0AQdgBIRAMkQILIAQtAABByABHDYwBIARBAWohBAzEAQsCQCAEIAJGDQAgAEGQgICAADYCCCAAIAQ2AgRBvgEhEAz3AQtB2QEhEAyPAgsCQCAEIAJHDQBB2gEhEAyPAgsgBC0AAEHIAEYNwwEgAEEBOgAoDLkBCyAAQQI6AC8gACAEIAIQpoCAgAAiEA2NAUHCASEQDPQBCyAALQAoQX9qDgK3AbkBuAELA0ACQCAELQAAQXZqDgQAjgGOAQCOAQsgBEEBaiIEIAJHDQALQd0BIRAMiwILIABBADoALyAALQAtQQRxRQ2EAgsgAEEAOgAvIABBAToANCABIQEMjAELIBBBFUYN2gEgAEEANgIcIAAgATYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMiAILAkAgACAQIAIQtICAgAAiBA0AIBAhAQyBAgsCQCAEQRVHDQAgAEEDNgIcIAAgEDYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMiAILIABBADYCHCAAIBA2AhQgAEGnjoCAADYCECAAQRI2AgxBACEQDIcCCyAQQRVGDdYBIABBADYCHCAAIAE2AhQgAEHajYCAADYCECAAQRQ2AgxBACEQDIYCCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNjQEgAEEHNgIcIAAgEDYCFCAAIBQ2AgxBACEQDIUCCyAAIAAvATBBgAFyOwEwIAEhAQtBKiEQDOoBCyAQQRVGDdEBIABBADYCHCAAIAE2AhQgAEGDjICAADYCECAAQRM2AgxBACEQDIICCyAQQRVGDc8BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDIECCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyNAQsgAEEMNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDIACCyAQQRVGDcwBIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDP8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyMAQsgAEENNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDP4BCyAQQRVGDckBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDP0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyLAQsgAEEONgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPwBCyAAQQA2AhwgACABNgIUIABBwJWAgAA2AhAgAEECNgIMQQAhEAz7AQsgEEEVRg3FASAAQQA2AhwgACABNgIUIABBxoyAgAA2AhAgAEEjNgIMQQAhEAz6AQsgAEEQNgIcIAAgATYCFCAAIBA2AgxBACEQDPkBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQzxAQsgAEERNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPgBCyAQQRVGDcEBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPcBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyIAQsgAEETNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPYBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQztAQsgAEEUNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPUBCyAQQRVGDb0BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDPQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyGAQsgAEEWNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPMBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQt4CAgAAiBA0AIAFBAWohAQzpAQsgAEEXNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPIBCyAAQQA2AhwgACABNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzxAQtCASERCyAQQQFqIQECQCAAKQMgIhJC//////////8PVg0AIAAgEkIEhiARhDcDICABIQEMhAELIABBADYCHCAAIAE2AhQgAEGtiYCAADYCECAAQQw2AgxBACEQDO8BCyAAQQA2AhwgACAQNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzuAQsgACgCBCEXIABBADYCBCAQIBGnaiIWIQEgACAXIBAgFiAUGyIQELWAgIAAIhRFDXMgAEEFNgIcIAAgEDYCFCAAIBQ2AgxBACEQDO0BCyAAQQA2AhwgACAQNgIUIABBqpyAgAA2AhAgAEEPNgIMQQAhEAzsAQsgACAQIAIQtICAgAAiAQ0BIBAhAQtBDiEQDNEBCwJAIAFBFUcNACAAQQI2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAzqAQsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAM6QELIAFBAWohEAJAIAAvATAiAUGAAXFFDQACQCAAIBAgAhC7gICAACIBDQAgECEBDHALIAFBFUcNugEgAEEFNgIcIAAgEDYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAM6QELAkAgAUGgBHFBoARHDQAgAC0ALUECcQ0AIABBADYCHCAAIBA2AhQgAEGWk4CAADYCECAAQQQ2AgxBACEQDOkBCyAAIBAgAhC9gICAABogECEBAkACQAJAAkACQCAAIBAgAhCzgICAAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIABBAToALgsgACAALwEwQcAAcjsBMCAQIQELQSYhEAzRAQsgAEEjNgIcIAAgEDYCFCAAQaWWgIAANgIQIABBFTYCDEEAIRAM6QELIABBADYCHCAAIBA2AhQgAEHVi4CAADYCECAAQRE2AgxBACEQDOgBCyAALQAtQQFxRQ0BQcMBIRAMzgELAkAgDSACRg0AA0ACQCANLQAAQSBGDQAgDSEBDMQBCyANQQFqIg0gAkcNAAtBJSEQDOcBC0ElIRAM5gELIAAoAgQhBCAAQQA2AgQgACAEIA0Qr4CAgAAiBEUNrQEgAEEmNgIcIAAgBDYCDCAAIA1BAWo2AhRBACEQDOUBCyAQQRVGDasBIABBADYCHCAAIAE2AhQgAEH9jYCAADYCECAAQR02AgxBACEQDOQBCyAAQSc2AhwgACABNgIUIAAgEDYCDEEAIRAM4wELIBAhAUEBIRQCQAJAAkACQAJAAkACQCAALQAsQX5qDgcGBQUDAQIABQsgACAALwEwQQhyOwEwDAMLQQIhFAwBC0EEIRQLIABBAToALCAAIAAvATAgFHI7ATALIBAhAQtBKyEQDMoBCyAAQQA2AhwgACAQNgIUIABBq5KAgAA2AhAgAEELNgIMQQAhEAziAQsgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDEEAIRAM4QELIABBADoALCAQIQEMvQELIBAhAUEBIRQCQAJAAkACQAJAIAAtACxBe2oOBAMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0EpIRAMxQELIABBADYCHCAAIAE2AhQgAEHwlICAADYCECAAQQM2AgxBACEQDN0BCwJAIA4tAABBDUcNACAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA5BAWohAQx1CyAAQSw2AhwgACABNgIMIAAgDkEBajYCFEEAIRAM3QELIAAtAC1BAXFFDQFBxAEhEAzDAQsCQCAOIAJHDQBBLSEQDNwBCwJAAkADQAJAIA4tAABBdmoOBAIAAAMACyAOQQFqIg4gAkcNAAtBLSEQDN0BCyAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA4hAQx0CyAAQSw2AhwgACAONgIUIAAgATYCDEEAIRAM3AELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHMLIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzbAQsgACgCBCEEIABBADYCBCAAIAQgDhCxgICAACIEDaABIA4hAQzOAQsgEEEsRw0BIAFBAWohEEEBIQECQAJAAkACQAJAIAAtACxBe2oOBAMBAgQACyAQIQEMBAtBAiEBDAELQQQhAQsgAEEBOgAsIAAgAC8BMCABcjsBMCAQIQEMAQsgACAALwEwQQhyOwEwIBAhAQtBOSEQDL8BCyAAQQA6ACwgASEBC0E0IRAMvQELIAAgAC8BMEEgcjsBMCABIQEMAgsgACgCBCEEIABBADYCBAJAIAAgBCABELGAgIAAIgQNACABIQEMxwELIABBNzYCHCAAIAE2AhQgACAENgIMQQAhEAzUAQsgAEEIOgAsIAEhAQtBMCEQDLkBCwJAIAAtAChBAUYNACABIQEMBAsgAC0ALUEIcUUNkwEgASEBDAMLIAAtADBBIHENlAFBxQEhEAy3AQsCQCAPIAJGDQACQANAAkAgDy0AAEFQaiIBQf8BcUEKSQ0AIA8hAUE1IRAMugELIAApAyAiEUKZs+bMmbPmzBlWDQEgACARQgp+IhE3AyAgESABrUL/AYMiEkJ/hVYNASAAIBEgEnw3AyAgD0EBaiIPIAJHDQALQTkhEAzRAQsgACgCBCECIABBADYCBCAAIAIgD0EBaiIEELGAgIAAIgINlQEgBCEBDMMBC0E5IRAMzwELAkAgAC8BMCIBQQhxRQ0AIAAtAChBAUcNACAALQAtQQhxRQ2QAQsgACABQff7A3FBgARyOwEwIA8hAQtBNyEQDLQBCyAAIAAvATBBEHI7ATAMqwELIBBBFUYNiwEgAEEANgIcIAAgATYCFCAAQfCOgIAANgIQIABBHDYCDEEAIRAMywELIABBwwA2AhwgACABNgIMIAAgDUEBajYCFEEAIRAMygELAkAgAS0AAEE6Rw0AIAAoAgQhECAAQQA2AgQCQCAAIBAgARCvgICAACIQDQAgAUEBaiEBDGMLIABBwwA2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMygELIABBADYCHCAAIAE2AhQgAEGxkYCAADYCECAAQQo2AgxBACEQDMkBCyAAQQA2AhwgACABNgIUIABBoJmAgAA2AhAgAEEeNgIMQQAhEAzIAQsgAEEANgIACyAAQYASOwEqIAAgF0EBaiIBIAIQqICAgAAiEA0BIAEhAQtBxwAhEAysAQsgEEEVRw2DASAAQdEANgIcIAAgATYCFCAAQeOXgIAANgIQIABBFTYCDEEAIRAMxAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDF4LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMwwELIABBADYCHCAAIBQ2AhQgAEHBqICAADYCECAAQQc2AgwgAEEANgIAQQAhEAzCAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAzBAQtBACEQIABBADYCHCAAIAE2AhQgAEGAkYCAADYCECAAQQk2AgwMwAELIBBBFUYNfSAAQQA2AhwgACABNgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAy/AQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgAUEBaiEBAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBAJAIAAgECABEK2AgIAAIhANACABIQEMXAsgAEHYADYCHCAAIAE2AhQgACAQNgIMQQAhEAy+AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMrQELIABB2QA2AhwgACABNgIUIAAgBDYCDEEAIRAMvQELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKsBCyAAQdoANgIcIAAgATYCFCAAIAQ2AgxBACEQDLwBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQypAQsgAEHcADYCHCAAIAE2AhQgACAENgIMQQAhEAy7AQsCQCABLQAAQVBqIhBB/wFxQQpPDQAgACAQOgAqIAFBAWohAUHPACEQDKIBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQynAQsgAEHeADYCHCAAIAE2AhQgACAENgIMQQAhEAy6AQsgAEEANgIAIBdBAWohAQJAIAAtAClBI08NACABIQEMWQsgAEEANgIcIAAgATYCFCAAQdOJgIAANgIQIABBCDYCDEEAIRAMuQELIABBADYCAAtBACEQIABBADYCHCAAIAE2AhQgAEGQs4CAADYCECAAQQg2AgwMtwELIABBADYCACAXQQFqIQECQCAALQApQSFHDQAgASEBDFYLIABBADYCHCAAIAE2AhQgAEGbioCAADYCECAAQQg2AgxBACEQDLYBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKSIQQV1qQQtPDQAgASEBDFULAkAgEEEGSw0AQQEgEHRBygBxRQ0AIAEhAQxVC0EAIRAgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDAy1AQsgEEEVRg1xIABBADYCHCAAIAE2AhQgAEG5jYCAADYCECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIABBADYCHCAAIAU2AhQgAEHwjICAADYCECAAQRs2AgxBACEQDJYBCyAAKAIEIQUgAEEANgIEIAAgBSAQEKmAgIAAIgUNASAQQQFqIQULQa0BIRAMewsgAEHBATYCHCAAIAU2AgwgACAQQQFqNgIUQQAhEAyTAQsgACgCBCEGIABBADYCBCAAIAYgEBCpgICAACIGDQEgEEEBaiEGC0GuASEQDHgLIABBwgE2AhwgACAGNgIMIAAgEEEBajYCFEEAIRAMkAELIABBADYCHCAAIAc2AhQgAEGXi4CAADYCECAAQQ02AgxBACEQDI8BCyAAQQA2AhwgACAINgIUIABB45CAgAA2AhAgAEEJNgIMQQAhEAyOAQsgAEEANgIcIAAgCDYCFCAAQZSNgIAANgIQIABBITYCDEEAIRAMjQELQQEhFkEAIRdBACEUQQEhEAsgACAQOgArIAlBAWohCAJAAkAgAC0ALUEQcQ0AAkACQAJAIAAtACoOAwEAAgQLIBZFDQMMAgsgFA0BDAILIBdFDQELIAAoAgQhECAAQQA2AgQgACAQIAgQrYCAgAAiEEUNPSAAQckBNgIcIAAgCDYCFCAAIBA2AgxBACEQDIwBCyAAKAIEIQQgAEEANgIEIAAgBCAIEK2AgIAAIgRFDXYgAEHKATYCHCAAIAg2AhQgACAENgIMQQAhEAyLAQsgACgCBCEEIABBADYCBCAAIAQgCRCtgICAACIERQ10IABBywE2AhwgACAJNgIUIAAgBDYCDEEAIRAMigELIAAoAgQhBCAAQQA2AgQgACAEIAoQrYCAgAAiBEUNciAAQc0BNgIcIAAgCjYCFCAAIAQ2AgxBACEQDIkBCwJAIAstAABBUGoiEEH/AXFBCk8NACAAIBA6ACogC0EBaiEKQbYBIRAMcAsgACgCBCEEIABBADYCBCAAIAQgCxCtgICAACIERQ1wIABBzwE2AhwgACALNgIUIAAgBDYCDEEAIRAMiAELIABBADYCHCAAIAQ2AhQgAEGQs4CAADYCECAAQQg2AgwgAEEANgIAQQAhEAyHAQsgAUEVRg0/IABBADYCHCAAIAw2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDIYBCyAAQYEEOwEoIAAoAgQhECAAQgA3AwAgACAQIAxBAWoiDBCrgICAACIQRQ04IABB0wE2AhwgACAMNgIUIAAgEDYCDEEAIRAMhQELIABBADYCAAtBACEQIABBADYCHCAAIAQ2AhQgAEHYm4CAADYCECAAQQg2AgwMgwELIAAoAgQhECAAQgA3AwAgACAQIAtBAWoiCxCrgICAACIQDQFBxgEhEAxpCyAAQQI6ACgMVQsgAEHVATYCHCAAIAs2AhQgACAQNgIMQQAhEAyAAQsgEEEVRg03IABBADYCHCAAIAQ2AhQgAEGkjICAADYCECAAQRA2AgxBACEQDH8LIAAtADRBAUcNNCAAIAQgAhC8gICAACIQRQ00IBBBFUcNNSAAQdwBNgIcIAAgBDYCFCAAQdWWgIAANgIQIABBFTYCDEEAIRAMfgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQMfQtBACEQDGMLQQIhEAxiC0ENIRAMYQtBDyEQDGALQSUhEAxfC0ETIRAMXgtBFSEQDF0LQRYhEAxcC0EXIRAMWwtBGCEQDFoLQRkhEAxZC0EaIRAMWAtBGyEQDFcLQRwhEAxWC0EdIRAMVQtBHyEQDFQLQSEhEAxTC0EjIRAMUgtBxgAhEAxRC0EuIRAMUAtBLyEQDE8LQTshEAxOC0E9IRAMTQtByAAhEAxMC0HJACEQDEsLQcsAIRAMSgtBzAAhEAxJC0HOACEQDEgLQdEAIRAMRwtB1QAhEAxGC0HYACEQDEULQdkAIRAMRAtB2wAhEAxDC0HkACEQDEILQeUAIRAMQQtB8QAhEAxAC0H0ACEQDD8LQY0BIRAMPgtBlwEhEAw9C0GpASEQDDwLQawBIRAMOwtBwAEhEAw6C0G5ASEQDDkLQa8BIRAMOAtBsQEhEAw3C0GyASEQDDYLQbQBIRAMNQtBtQEhEAw0C0G6ASEQDDMLQb0BIRAMMgtBvwEhEAwxC0HBASEQDDALIABBADYCHCAAIAQ2AhQgAEHpi4CAADYCECAAQR82AgxBACEQDEgLIABB2wE2AhwgACAENgIUIABB+paAgAA2AhAgAEEVNgIMQQAhEAxHCyAAQfgANgIcIAAgDDYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMRgsgAEHRADYCHCAAIAU2AhQgAEGwl4CAADYCECAAQRU2AgxBACEQDEULIABB+QA2AhwgACABNgIUIAAgEDYCDEEAIRAMRAsgAEH4ADYCHCAAIAE2AhQgAEHKmICAADYCECAAQRU2AgxBACEQDEMLIABB5AA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAxCCyAAQdcANgIcIAAgATYCFCAAQcmXgIAANgIQIABBFTYCDEEAIRAMQQsgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMQAsgAEHCADYCHCAAIAE2AhQgAEHjmICAADYCECAAQRU2AgxBACEQDD8LIABBADYCBCAAIA8gDxCxgICAACIERQ0BIABBOjYCHCAAIAQ2AgwgACAPQQFqNgIUQQAhEAw+CyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBEUNACAAQTs2AhwgACAENgIMIAAgAUEBajYCFEEAIRAMPgsgAUEBaiEBDC0LIA9BAWohAQwtCyAAQQA2AhwgACAPNgIUIABB5JKAgAA2AhAgAEEENgIMQQAhEAw7CyAAQTY2AhwgACAENgIUIAAgAjYCDEEAIRAMOgsgAEEuNgIcIAAgDjYCFCAAIAQ2AgxBACEQDDkLIABB0AA2AhwgACABNgIUIABBkZiAgAA2AhAgAEEVNgIMQQAhEAw4CyANQQFqIQEMLAsgAEEVNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMNgsgAEEbNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNQsgAEEPNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNAsgAEELNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMMwsgAEEaNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMgsgAEELNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMQsgAEEKNgIcIAAgATYCFCAAQeSWgIAANgIQIABBFTYCDEEAIRAMMAsgAEEeNgIcIAAgATYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAMLwsgAEEANgIcIAAgEDYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMLgsgAEEENgIcIAAgATYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMLQsgAEEANgIAIAtBAWohCwtBuAEhEAwSCyAAQQA2AgAgEEEBaiEBQfUAIRAMEQsgASEBAkAgAC0AKUEFRw0AQeMAIRAMEQtB4gAhEAwQC0EAIRAgAEEANgIcIABB5JGAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAwoCyAAQQA2AgAgF0EBaiEBQcAAIRAMDgtBASEBCyAAIAE6ACwgAEEANgIAIBdBAWohAQtBKCEQDAsLIAEhAQtBOCEQDAkLAkAgASIPIAJGDQADQAJAIA8tAABBgL6AgABqLQAAIgFBAUYNACABQQJHDQMgD0EBaiEBDAQLIA9BAWoiDyACRw0AC0E+IRAMIgtBPiEQDCELIABBADoALCAPIQEMAQtBCyEQDAYLQTohEAwFCyABQQFqIQFBLSEQDAQLIAAgAToALCAAQQA2AgAgFkEBaiEBQQwhEAwDCyAAQQA2AgAgF0EBaiEBQQohEAwCCyAAQQA2AgALIABBADoALCANIQFBCSEQDAALC0EAIRAgAEEANgIcIAAgCzYCFCAAQc2QgIAANgIQIABBCTYCDAwXC0EAIRAgAEEANgIcIAAgCjYCFCAAQemKgIAANgIQIABBCTYCDAwWC0EAIRAgAEEANgIcIAAgCTYCFCAAQbeQgIAANgIQIABBCTYCDAwVC0EAIRAgAEEANgIcIAAgCDYCFCAAQZyRgIAANgIQIABBCTYCDAwUC0EAIRAgAEEANgIcIAAgATYCFCAAQc2QgIAANgIQIABBCTYCDAwTC0EAIRAgAEEANgIcIAAgATYCFCAAQemKgIAANgIQIABBCTYCDAwSC0EAIRAgAEEANgIcIAAgATYCFCAAQbeQgIAANgIQIABBCTYCDAwRC0EAIRAgAEEANgIcIAAgATYCFCAAQZyRgIAANgIQIABBCTYCDAwQC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwPC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwOC0EAIRAgAEEANgIcIAAgATYCFCAAQcCSgIAANgIQIABBCzYCDAwNC0EAIRAgAEEANgIcIAAgATYCFCAAQZWJgIAANgIQIABBCzYCDAwMC0EAIRAgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDAwLC0EAIRAgAEEANgIcIAAgATYCFCAAQfuPgIAANgIQIABBCjYCDAwKC0EAIRAgAEEANgIcIAAgATYCFCAAQfGZgIAANgIQIABBAjYCDAwJC0EAIRAgAEEANgIcIAAgATYCFCAAQcSUgIAANgIQIABBAjYCDAwIC0EAIRAgAEEANgIcIAAgATYCFCAAQfKVgIAANgIQIABBAjYCDAwHCyAAQQI2AhwgACABNgIUIABBnJqAgAA2AhAgAEEWNgIMQQAhEAwGC0EBIRAMBQtB1AAhECABIgQgAkYNBCADQQhqIAAgBCACQdjCgIAAQQoQxYCAgAAgAygCDCEEIAMoAggOAwEEAgALEMqAgIAAAAsgAEEANgIcIABBtZqAgAA2AhAgAEEXNgIMIAAgBEEBajYCFEEAIRAMAgsgAEEANgIcIAAgBDYCFCAAQcqagIAANgIQIABBCTYCDEEAIRAMAQsCQCABIgQgAkcNAEEiIRAMAQsgAEGJgICAADYCCCAAIAQ2AgRBISEQCyADQRBqJICAgIAAIBALrwEBAn8gASgCACEGAkACQCACIANGDQAgBCAGaiEEIAYgA2ogAmshByACIAZBf3MgBWoiBmohBQNAAkAgAi0AACAELQAARg0AQQIhBAwDCwJAIAYNAEEAIQQgBSECDAMLIAZBf2ohBiAEQQFqIQQgAkEBaiICIANHDQALIAchBiADIQILIABBATYCACABIAY2AgAgACACNgIEDwsgAUEANgIAIAAgBDYCACAAIAI2AgQLCgAgABDHgICAAAvyNgELfyOAgICAAEEQayIBJICAgIAAAkBBACgCoNCAgAANAEEAEMuAgIAAQYDUhIAAayICQdkASQ0AQQAhAwJAQQAoAuDTgIAAIgQNAEEAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEIakFwcUHYqtWqBXMiBDYC4NOAgABBAEEANgL004CAAEEAQQA2AsTTgIAAC0EAIAI2AszTgIAAQQBBgNSEgAA2AsjTgIAAQQBBgNSEgAA2ApjQgIAAQQAgBDYCrNCAgABBAEF/NgKo0ICAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALQYDUhIAAQXhBgNSEgABrQQ9xQQBBgNSEgABBCGpBD3EbIgNqIgRBBGogAkFIaiIFIANrIgNBAXI2AgBBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAQYDUhIAAIAVqQTg2AgQLAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFLDQACQEEAKAKI0ICAACIGQRAgAEETakFwcSAAQQtJGyICQQN2IgR2IgNBA3FFDQACQAJAIANBAXEgBHJBAXMiBUEDdCIEQbDQgIAAaiIDIARBuNCAgABqKAIAIgQoAggiAkcNAEEAIAZBfiAFd3E2AojQgIAADAELIAMgAjYCCCACIAM2AgwLIARBCGohAyAEIAVBA3QiBUEDcjYCBCAEIAVqIgQgBCgCBEEBcjYCBAwMCyACQQAoApDQgIAAIgdNDQECQCADRQ0AAkACQCADIAR0QQIgBHQiA0EAIANrcnEiA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqIgRBA3QiA0Gw0ICAAGoiBSADQbjQgIAAaigCACIDKAIIIgBHDQBBACAGQX4gBHdxIgY2AojQgIAADAELIAUgADYCCCAAIAU2AgwLIAMgAkEDcjYCBCADIARBA3QiBGogBCACayIFNgIAIAMgAmoiACAFQQFyNgIEAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQQCQAJAIAZBASAHQQN2dCIIcQ0AQQAgBiAIcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCAENgIMIAIgBDYCCCAEIAI2AgwgBCAINgIICyADQQhqIQNBACAANgKc0ICAAEEAIAU2ApDQgIAADAwLQQAoAozQgIAAIglFDQEgCUEAIAlrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqQQJ0QbjSgIAAaigCACIAKAIEQXhxIAJrIQQgACEFAkADQAJAIAUoAhAiAw0AIAVBFGooAgAiA0UNAgsgAygCBEF4cSACayIFIAQgBSAESSIFGyEEIAMgACAFGyEAIAMhBQwACwsgACgCGCEKAkAgACgCDCIIIABGDQAgACgCCCIDQQAoApjQgIAASRogCCADNgIIIAMgCDYCDAwLCwJAIABBFGoiBSgCACIDDQAgACgCECIDRQ0DIABBEGohBQsDQCAFIQsgAyIIQRRqIgUoAgAiAw0AIAhBEGohBSAIKAIQIgMNAAsgC0EANgIADAoLQX8hAiAAQb9/Sw0AIABBE2oiA0FwcSECQQAoAozQgIAAIgdFDQBBACELAkAgAkGAAkkNAEEfIQsgAkH///8HSw0AIANBCHYiAyADQYD+P2pBEHZBCHEiA3QiBCAEQYDgH2pBEHZBBHEiBHQiBSAFQYCAD2pBEHZBAnEiBXRBD3YgAyAEciAFcmsiA0EBdCACIANBFWp2QQFxckEcaiELC0EAIAJrIQQCQAJAAkACQCALQQJ0QbjSgIAAaigCACIFDQBBACEDQQAhCAwBC0EAIQMgAkEAQRkgC0EBdmsgC0EfRht0IQBBACEIA0ACQCAFKAIEQXhxIAJrIgYgBE8NACAGIQQgBSEIIAYNAEEAIQQgBSEIIAUhAwwDCyADIAVBFGooAgAiBiAGIAUgAEEddkEEcWpBEGooAgAiBUYbIAMgBhshAyAAQQF0IQAgBQ0ACwsCQCADIAhyDQBBACEIQQIgC3QiA0EAIANrciAHcSIDRQ0DIANBACADa3FBf2oiAyADQQx2QRBxIgN2IgVBBXZBCHEiACADciAFIAB2IgNBAnZBBHEiBXIgAyAFdiIDQQF2QQJxIgVyIAMgBXYiA0EBdkEBcSIFciADIAV2akECdEG40oCAAGooAgAhAwsgA0UNAQsDQCADKAIEQXhxIAJrIgYgBEkhAAJAIAMoAhAiBQ0AIANBFGooAgAhBQsgBiAEIAAbIQQgAyAIIAAbIQggBSEDIAUNAAsLIAhFDQAgBEEAKAKQ0ICAACACa08NACAIKAIYIQsCQCAIKAIMIgAgCEYNACAIKAIIIgNBACgCmNCAgABJGiAAIAM2AgggAyAANgIMDAkLAkAgCEEUaiIFKAIAIgMNACAIKAIQIgNFDQMgCEEQaiEFCwNAIAUhBiADIgBBFGoiBSgCACIDDQAgAEEQaiEFIAAoAhAiAw0ACyAGQQA2AgAMCAsCQEEAKAKQ0ICAACIDIAJJDQBBACgCnNCAgAAhBAJAAkAgAyACayIFQRBJDQAgBCACaiIAIAVBAXI2AgRBACAFNgKQ0ICAAEEAIAA2ApzQgIAAIAQgA2ogBTYCACAEIAJBA3I2AgQMAQsgBCADQQNyNgIEIAQgA2oiAyADKAIEQQFyNgIEQQBBADYCnNCAgABBAEEANgKQ0ICAAAsgBEEIaiEDDAoLAkBBACgClNCAgAAiACACTQ0AQQAoAqDQgIAAIgMgAmoiBCAAIAJrIgVBAXI2AgRBACAFNgKU0ICAAEEAIAQ2AqDQgIAAIAMgAkEDcjYCBCADQQhqIQMMCgsCQAJAQQAoAuDTgIAARQ0AQQAoAujTgIAAIQQMAQtBAEJ/NwLs04CAAEEAQoCAhICAgMAANwLk04CAAEEAIAFBDGpBcHFB2KrVqgVzNgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgABBgIAEIQQLQQAhAwJAIAQgAkHHAGoiB2oiBkEAIARrIgtxIgggAksNAEEAQTA2AvjTgIAADAoLAkBBACgCwNOAgAAiA0UNAAJAQQAoArjTgIAAIgQgCGoiBSAETQ0AIAUgA00NAQtBACEDQQBBMDYC+NOAgAAMCgtBAC0AxNOAgABBBHENBAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQAJAIAMoAgAiBSAESw0AIAUgAygCBGogBEsNAwsgAygCCCIDDQALC0EAEMuAgIAAIgBBf0YNBSAIIQYCQEEAKALk04CAACIDQX9qIgQgAHFFDQAgCCAAayAEIABqQQAgA2txaiEGCyAGIAJNDQUgBkH+////B0sNBQJAQQAoAsDTgIAAIgNFDQBBACgCuNOAgAAiBCAGaiIFIARNDQYgBSADSw0GCyAGEMuAgIAAIgMgAEcNAQwHCyAGIABrIAtxIgZB/v///wdLDQQgBhDLgICAACIAIAMoAgAgAygCBGpGDQMgACEDCwJAIANBf0YNACACQcgAaiAGTQ0AAkAgByAGa0EAKALo04CAACIEakEAIARrcSIEQf7///8HTQ0AIAMhAAwHCwJAIAQQy4CAgABBf0YNACAEIAZqIQYgAyEADAcLQQAgBmsQy4CAgAAaDAQLIAMhACADQX9HDQUMAwtBACEIDAcLQQAhAAwFCyAAQX9HDQILQQBBACgCxNOAgABBBHI2AsTTgIAACyAIQf7///8HSw0BIAgQy4CAgAAhAEEAEMuAgIAAIQMgAEF/Rg0BIANBf0YNASAAIANPDQEgAyAAayIGIAJBOGpNDQELQQBBACgCuNOAgAAgBmoiAzYCuNOAgAACQCADQQAoArzTgIAATQ0AQQAgAzYCvNOAgAALAkACQAJAAkBBACgCoNCAgAAiBEUNAEHI04CAACEDA0AgACADKAIAIgUgAygCBCIIakYNAiADKAIIIgMNAAwDCwsCQAJAQQAoApjQgIAAIgNFDQAgACADTw0BC0EAIAA2ApjQgIAAC0EAIQNBACAGNgLM04CAAEEAIAA2AsjTgIAAQQBBfzYCqNCAgABBAEEAKALg04CAADYCrNCAgABBAEEANgLU04CAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgQgBkFIaiIFIANrIgNBAXI2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAIAAgBWpBODYCBAwCCyADLQAMQQhxDQAgBCAFSQ0AIAQgAE8NACAEQXggBGtBD3FBACAEQQhqQQ9xGyIFaiIAQQAoApTQgIAAIAZqIgsgBWsiBUEBcjYCBCADIAggBmo2AgRBAEEAKALw04CAADYCpNCAgABBACAFNgKU0ICAAEEAIAA2AqDQgIAAIAQgC2pBODYCBAwBCwJAIABBACgCmNCAgAAiCE8NAEEAIAA2ApjQgIAAIAAhCAsgACAGaiEFQcjTgIAAIQMCQAJAAkACQAJAAkACQANAIAMoAgAgBUYNASADKAIIIgMNAAwCCwsgAy0ADEEIcUUNAQtByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiIFIARLDQMLIAMoAgghAwwACwsgAyAANgIAIAMgAygCBCAGajYCBCAAQXggAGtBD3FBACAAQQhqQQ9xG2oiCyACQQNyNgIEIAVBeCAFa0EPcUEAIAVBCGpBD3EbaiIGIAsgAmoiAmshAwJAIAYgBEcNAEEAIAI2AqDQgIAAQQBBACgClNCAgAAgA2oiAzYClNCAgAAgAiADQQFyNgIEDAMLAkAgBkEAKAKc0ICAAEcNAEEAIAI2ApzQgIAAQQBBACgCkNCAgAAgA2oiAzYCkNCAgAAgAiADQQFyNgIEIAIgA2ogAzYCAAwDCwJAIAYoAgQiBEEDcUEBRw0AIARBeHEhBwJAAkAgBEH/AUsNACAGKAIIIgUgBEEDdiIIQQN0QbDQgIAAaiIARhoCQCAGKAIMIgQgBUcNAEEAQQAoAojQgIAAQX4gCHdxNgKI0ICAAAwCCyAEIABGGiAEIAU2AgggBSAENgIMDAELIAYoAhghCQJAAkAgBigCDCIAIAZGDQAgBigCCCIEIAhJGiAAIAQ2AgggBCAANgIMDAELAkAgBkEUaiIEKAIAIgUNACAGQRBqIgQoAgAiBQ0AQQAhAAwBCwNAIAQhCCAFIgBBFGoiBCgCACIFDQAgAEEQaiEEIAAoAhAiBQ0ACyAIQQA2AgALIAlFDQACQAJAIAYgBigCHCIFQQJ0QbjSgIAAaiIEKAIARw0AIAQgADYCACAADQFBAEEAKAKM0ICAAEF+IAV3cTYCjNCAgAAMAgsgCUEQQRQgCSgCECAGRhtqIAA2AgAgAEUNAQsgACAJNgIYAkAgBigCECIERQ0AIAAgBDYCECAEIAA2AhgLIAYoAhQiBEUNACAAQRRqIAQ2AgAgBCAANgIYCyAHIANqIQMgBiAHaiIGKAIEIQQLIAYgBEF+cTYCBCACIANqIAM2AgAgAiADQQFyNgIEAkAgA0H/AUsNACADQXhxQbDQgIAAaiEEAkACQEEAKAKI0ICAACIFQQEgA0EDdnQiA3ENAEEAIAUgA3I2AojQgIAAIAQhAwwBCyAEKAIIIQMLIAMgAjYCDCAEIAI2AgggAiAENgIMIAIgAzYCCAwDC0EfIQQCQCADQf///wdLDQAgA0EIdiIEIARBgP4/akEQdkEIcSIEdCIFIAVBgOAfakEQdkEEcSIFdCIAIABBgIAPakEQdkECcSIAdEEPdiAEIAVyIAByayIEQQF0IAMgBEEVanZBAXFyQRxqIQQLIAIgBDYCHCACQgA3AhAgBEECdEG40oCAAGohBQJAQQAoAozQgIAAIgBBASAEdCIIcQ0AIAUgAjYCAEEAIAAgCHI2AozQgIAAIAIgBTYCGCACIAI2AgggAiACNgIMDAMLIANBAEEZIARBAXZrIARBH0YbdCEEIAUoAgAhAANAIAAiBSgCBEF4cSADRg0CIARBHXYhACAEQQF0IQQgBSAAQQRxakEQaiIIKAIAIgANAAsgCCACNgIAIAIgBTYCGCACIAI2AgwgAiACNgIIDAILIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgsgBkFIaiIIIANrIgNBAXI2AgQgACAIakE4NgIEIAQgBUE3IAVrQQ9xQQAgBUFJakEPcRtqQUFqIgggCCAEQRBqSRsiCEEjNgIEQQBBACgC8NOAgAA2AqTQgIAAQQAgAzYClNCAgABBACALNgKg0ICAACAIQRBqQQApAtDTgIAANwIAIAhBACkCyNOAgAA3AghBACAIQQhqNgLQ04CAAEEAIAY2AszTgIAAQQAgADYCyNOAgABBAEEANgLU04CAACAIQSRqIQMDQCADQQc2AgAgA0EEaiIDIAVJDQALIAggBEYNAyAIIAgoAgRBfnE2AgQgCCAIIARrIgA2AgAgBCAAQQFyNgIEAkAgAEH/AUsNACAAQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgAEEDdnQiAHENAEEAIAUgAHI2AojQgIAAIAMhBQwBCyADKAIIIQULIAUgBDYCDCADIAQ2AgggBCADNgIMIAQgBTYCCAwEC0EfIQMCQCAAQf///wdLDQAgAEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCIIIAhBgIAPakEQdkECcSIIdEEPdiADIAVyIAhyayIDQQF0IAAgA0EVanZBAXFyQRxqIQMLIAQgAzYCHCAEQgA3AhAgA0ECdEG40oCAAGohBQJAQQAoAozQgIAAIghBASADdCIGcQ0AIAUgBDYCAEEAIAggBnI2AozQgIAAIAQgBTYCGCAEIAQ2AgggBCAENgIMDAQLIABBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhCANAIAgiBSgCBEF4cSAARg0DIANBHXYhCCADQQF0IQMgBSAIQQRxakEQaiIGKAIAIggNAAsgBiAENgIAIAQgBTYCGCAEIAQ2AgwgBCAENgIIDAMLIAUoAggiAyACNgIMIAUgAjYCCCACQQA2AhggAiAFNgIMIAIgAzYCCAsgC0EIaiEDDAULIAUoAggiAyAENgIMIAUgBDYCCCAEQQA2AhggBCAFNgIMIAQgAzYCCAtBACgClNCAgAAiAyACTQ0AQQAoAqDQgIAAIgQgAmoiBSADIAJrIgNBAXI2AgRBACADNgKU0ICAAEEAIAU2AqDQgIAAIAQgAkEDcjYCBCAEQQhqIQMMAwtBACEDQQBBMDYC+NOAgAAMAgsCQCALRQ0AAkACQCAIIAgoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAA2AgAgAA0BQQAgB0F+IAV3cSIHNgKM0ICAAAwCCyALQRBBFCALKAIQIAhGG2ogADYCACAARQ0BCyAAIAs2AhgCQCAIKAIQIgNFDQAgACADNgIQIAMgADYCGAsgCEEUaigCACIDRQ0AIABBFGogAzYCACADIAA2AhgLAkACQCAEQQ9LDQAgCCAEIAJqIgNBA3I2AgQgCCADaiIDIAMoAgRBAXI2AgQMAQsgCCACaiIAIARBAXI2AgQgCCACQQNyNgIEIAAgBGogBDYCAAJAIARB/wFLDQAgBEF4cUGw0ICAAGohAwJAAkBBACgCiNCAgAAiBUEBIARBA3Z0IgRxDQBBACAFIARyNgKI0ICAACADIQQMAQsgAygCCCEECyAEIAA2AgwgAyAANgIIIAAgAzYCDCAAIAQ2AggMAQtBHyEDAkAgBEH///8HSw0AIARBCHYiAyADQYD+P2pBEHZBCHEiA3QiBSAFQYDgH2pBEHZBBHEiBXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgAyAFciACcmsiA0EBdCAEIANBFWp2QQFxckEcaiEDCyAAIAM2AhwgAEIANwIQIANBAnRBuNKAgABqIQUCQCAHQQEgA3QiAnENACAFIAA2AgBBACAHIAJyNgKM0ICAACAAIAU2AhggACAANgIIIAAgADYCDAwBCyAEQQBBGSADQQF2ayADQR9GG3QhAyAFKAIAIQICQANAIAIiBSgCBEF4cSAERg0BIANBHXYhAiADQQF0IQMgBSACQQRxakEQaiIGKAIAIgINAAsgBiAANgIAIAAgBTYCGCAAIAA2AgwgACAANgIIDAELIAUoAggiAyAANgIMIAUgADYCCCAAQQA2AhggACAFNgIMIAAgAzYCCAsgCEEIaiEDDAELAkAgCkUNAAJAAkAgACAAKAIcIgVBAnRBuNKAgABqIgMoAgBHDQAgAyAINgIAIAgNAUEAIAlBfiAFd3E2AozQgIAADAILIApBEEEUIAooAhAgAEYbaiAINgIAIAhFDQELIAggCjYCGAJAIAAoAhAiA0UNACAIIAM2AhAgAyAINgIYCyAAQRRqKAIAIgNFDQAgCEEUaiADNgIAIAMgCDYCGAsCQAJAIARBD0sNACAAIAQgAmoiA0EDcjYCBCAAIANqIgMgAygCBEEBcjYCBAwBCyAAIAJqIgUgBEEBcjYCBCAAIAJBA3I2AgQgBSAEaiAENgIAAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQMCQAJAQQEgB0EDdnQiCCAGcQ0AQQAgCCAGcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCADNgIMIAIgAzYCCCADIAI2AgwgAyAINgIIC0EAIAU2ApzQgIAAQQAgBDYCkNCAgAALIABBCGohAwsgAUEQaiSAgICAACADCwoAIAAQyYCAgAAL4g0BB38CQCAARQ0AIABBeGoiASAAQXxqKAIAIgJBeHEiAGohAwJAIAJBAXENACACQQNxRQ0BIAEgASgCACICayIBQQAoApjQgIAAIgRJDQEgAiAAaiEAAkAgAUEAKAKc0ICAAEYNAAJAIAJB/wFLDQAgASgCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgASgCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAwsgAiAGRhogAiAENgIIIAQgAjYCDAwCCyABKAIYIQcCQAJAIAEoAgwiBiABRg0AIAEoAggiAiAESRogBiACNgIIIAIgBjYCDAwBCwJAIAFBFGoiAigCACIEDQAgAUEQaiICKAIAIgQNAEEAIQYMAQsDQCACIQUgBCIGQRRqIgIoAgAiBA0AIAZBEGohAiAGKAIQIgQNAAsgBUEANgIACyAHRQ0BAkACQCABIAEoAhwiBEECdEG40oCAAGoiAigCAEcNACACIAY2AgAgBg0BQQBBACgCjNCAgABBfiAEd3E2AozQgIAADAMLIAdBEEEUIAcoAhAgAUYbaiAGNgIAIAZFDQILIAYgBzYCGAJAIAEoAhAiAkUNACAGIAI2AhAgAiAGNgIYCyABKAIUIgJFDQEgBkEUaiACNgIAIAIgBjYCGAwBCyADKAIEIgJBA3FBA0cNACADIAJBfnE2AgRBACAANgKQ0ICAACABIABqIAA2AgAgASAAQQFyNgIEDwsgASADTw0AIAMoAgQiAkEBcUUNAAJAAkAgAkECcQ0AAkAgA0EAKAKg0ICAAEcNAEEAIAE2AqDQgIAAQQBBACgClNCAgAAgAGoiADYClNCAgAAgASAAQQFyNgIEIAFBACgCnNCAgABHDQNBAEEANgKQ0ICAAEEAQQA2ApzQgIAADwsCQCADQQAoApzQgIAARw0AQQAgATYCnNCAgABBAEEAKAKQ0ICAACAAaiIANgKQ0ICAACABIABBAXI2AgQgASAAaiAANgIADwsgAkF4cSAAaiEAAkACQCACQf8BSw0AIAMoAggiBCACQQN2IgVBA3RBsNCAgABqIgZGGgJAIAMoAgwiAiAERw0AQQBBACgCiNCAgABBfiAFd3E2AojQgIAADAILIAIgBkYaIAIgBDYCCCAEIAI2AgwMAQsgAygCGCEHAkACQCADKAIMIgYgA0YNACADKAIIIgJBACgCmNCAgABJGiAGIAI2AgggAiAGNgIMDAELAkAgA0EUaiICKAIAIgQNACADQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQACQAJAIAMgAygCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAgsgB0EQQRQgBygCECADRhtqIAY2AgAgBkUNAQsgBiAHNgIYAkAgAygCECICRQ0AIAYgAjYCECACIAY2AhgLIAMoAhQiAkUNACAGQRRqIAI2AgAgAiAGNgIYCyABIABqIAA2AgAgASAAQQFyNgIEIAFBACgCnNCAgABHDQFBACAANgKQ0ICAAA8LIAMgAkF+cTYCBCABIABqIAA2AgAgASAAQQFyNgIECwJAIABB/wFLDQAgAEF4cUGw0ICAAGohAgJAAkBBACgCiNCAgAAiBEEBIABBA3Z0IgBxDQBBACAEIAByNgKI0ICAACACIQAMAQsgAigCCCEACyAAIAE2AgwgAiABNgIIIAEgAjYCDCABIAA2AggPC0EfIQICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgBB+IQYgAyAFaiEBA0AgASAGNwMYIAEgBjcDECABIAY3AwggASAGNwMAIAFBIGohASACQWBqIgJBH0sNAAsLIAALC45IAQBBgAgLhkgBAAAAAgAAAAMAAAAAAAAAAAAAAAQAAAAFAAAAAAAAAAAAAAAGAAAABwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEludmFsaWQgY2hhciBpbiB1cmwgcXVlcnkAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9ib2R5AENvbnRlbnQtTGVuZ3RoIG92ZXJmbG93AENodW5rIHNpemUgb3ZlcmZsb3cAUmVzcG9uc2Ugb3ZlcmZsb3cASW52YWxpZCBtZXRob2QgZm9yIEhUVFAveC54IHJlcXVlc3QASW52YWxpZCBtZXRob2QgZm9yIFJUU1AveC54IHJlcXVlc3QARXhwZWN0ZWQgU09VUkNFIG1ldGhvZCBmb3IgSUNFL3gueCByZXF1ZXN0AEludmFsaWQgY2hhciBpbiB1cmwgZnJhZ21lbnQgc3RhcnQARXhwZWN0ZWQgZG90AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fc3RhdHVzAEludmFsaWQgcmVzcG9uc2Ugc3RhdHVzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8="},16594:r=>{r.exports="AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AcsBygG4AckBuQHIAboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBANwBC0EAIRAMxgELQQ4hEAzFAQtBDSEQDMQBC0EPIRAMwwELQRAhEAzCAQtBEyEQDMEBC0EUIRAMwAELQRUhEAy/AQtBFiEQDL4BC0EXIRAMvQELQRghEAy8AQtBGSEQDLsBC0EaIRAMugELQRshEAy5AQtBHCEQDLgBC0EIIRAMtwELQR0hEAy2AQtBICEQDLUBC0EfIRAMtAELQQchEAyzAQtBISEQDLIBC0EiIRAMsQELQR4hEAywAQtBIyEQDK8BC0ESIRAMrgELQREhEAytAQtBJCEQDKwBC0ElIRAMqwELQSYhEAyqAQtBJyEQDKkBC0HDASEQDKgBC0EpIRAMpwELQSshEAymAQtBLCEQDKUBC0EtIRAMpAELQS4hEAyjAQtBLyEQDKIBC0HEASEQDKEBC0EwIRAMoAELQTQhEAyfAQtBDCEQDJ4BC0ExIRAMnQELQTIhEAycAQtBMyEQDJsBC0E5IRAMmgELQTUhEAyZAQtBxQEhEAyYAQtBCyEQDJcBC0E6IRAMlgELQTYhEAyVAQtBCiEQDJQBC0E3IRAMkwELQTghEAySAQtBPCEQDJEBC0E7IRAMkAELQT0hEAyPAQtBCSEQDI4BC0EoIRAMjQELQT4hEAyMAQtBPyEQDIsBC0HAACEQDIoBC0HBACEQDIkBC0HCACEQDIgBC0HDACEQDIcBC0HEACEQDIYBC0HFACEQDIUBC0HGACEQDIQBC0EqIRAMgwELQccAIRAMggELQcgAIRAMgQELQckAIRAMgAELQcoAIRAMfwtBywAhEAx+C0HNACEQDH0LQcwAIRAMfAtBzgAhEAx7C0HPACEQDHoLQdAAIRAMeQtB0QAhEAx4C0HSACEQDHcLQdMAIRAMdgtB1AAhEAx1C0HWACEQDHQLQdUAIRAMcwtBBiEQDHILQdcAIRAMcQtBBSEQDHALQdgAIRAMbwtBBCEQDG4LQdkAIRAMbQtB2gAhEAxsC0HbACEQDGsLQdwAIRAMagtBAyEQDGkLQd0AIRAMaAtB3gAhEAxnC0HfACEQDGYLQeEAIRAMZQtB4AAhEAxkC0HiACEQDGMLQeMAIRAMYgtBAiEQDGELQeQAIRAMYAtB5QAhEAxfC0HmACEQDF4LQecAIRAMXQtB6AAhEAxcC0HpACEQDFsLQeoAIRAMWgtB6wAhEAxZC0HsACEQDFgLQe0AIRAMVwtB7gAhEAxWC0HvACEQDFULQfAAIRAMVAtB8QAhEAxTC0HyACEQDFILQfMAIRAMUQtB9AAhEAxQC0H1ACEQDE8LQfYAIRAMTgtB9wAhEAxNC0H4ACEQDEwLQfkAIRAMSwtB+gAhEAxKC0H7ACEQDEkLQfwAIRAMSAtB/QAhEAxHC0H+ACEQDEYLQf8AIRAMRQtBgAEhEAxEC0GBASEQDEMLQYIBIRAMQgtBgwEhEAxBC0GEASEQDEALQYUBIRAMPwtBhgEhEAw+C0GHASEQDD0LQYgBIRAMPAtBiQEhEAw7C0GKASEQDDoLQYsBIRAMOQtBjAEhEAw4C0GNASEQDDcLQY4BIRAMNgtBjwEhEAw1C0GQASEQDDQLQZEBIRAMMwtBkgEhEAwyC0GTASEQDDELQZQBIRAMMAtBlQEhEAwvC0GWASEQDC4LQZcBIRAMLQtBmAEhEAwsC0GZASEQDCsLQZoBIRAMKgtBmwEhEAwpC0GcASEQDCgLQZ0BIRAMJwtBngEhEAwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQM2gMLAkAgAS0AACIQQTtGDQAgEEENRw3oASABQQFqIQEM5QILIAFBAWohAQtBIiEQDL8DCwJAIAEiECACRw0AQRwhEAzYAwtCACERIBAhASAQLQAAQVBqDjfnAeYBAQIDBAUGBwgAAAAAAAAACQoLDA0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBESExQAC0EeIRAMvQMLQgIhEQzlAQtCAyERDOQBC0IEIREM4wELQgUhEQziAQtCBiERDOEBC0IHIREM4AELQgghEQzfAQtCCSERDN4BC0IKIREM3QELQgshEQzcAQtCDCERDNsBC0INIREM2gELQg4hEQzZAQtCDyERDNgBC0IKIREM1wELQgshEQzWAQtCDCERDNUBC0INIREM1AELQg4hEQzTAQtCDyERDNIBC0IAIRECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAtAABBUGoON+UB5AEAAQIDBAUGB+YB5gHmAeYB5gHmAeYBCAkKCwwN5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAQ4PEBESE+YBC0ICIREM5AELQgMhEQzjAQtCBCERDOIBC0IFIREM4QELQgYhEQzgAQtCByERDN8BC0IIIREM3gELQgkhEQzdAQtCCiERDNwBC0ILIREM2wELQgwhEQzaAQtCDSERDNkBC0IOIREM2AELQg8hEQzXAQtCCiERDNYBC0ILIREM1QELQgwhEQzUAQtCDSERDNMBC0IOIREM0gELQg8hEQzRAQsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3SAUEfIRAMwAMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQSQhEAynAwtBICEQDL8DCyAAIAEiECACEL6AgIAAQX9qDgW2AQDFAgHRAdIBC0ERIRAMpAMLIABBAToALyAQIQEMuwMLIAEiASACRw3SAUEkIRAMuwMLIAEiDSACRw0eQcYAIRAMugMLIAAgASIBIAIQsoCAgAAiEA3UASABIQEMtQELIAEiECACRw0mQdAAIRAMuAMLAkAgASIBIAJHDQBBKCEQDLgDCyAAQQA2AgQgAEGMgICAADYCCCAAIAEgARCxgICAACIQDdMBIAEhAQzYAQsCQCABIhAgAkcNAEEpIRAMtwMLIBAtAAAiAUEgRg0UIAFBCUcN0wEgEEEBaiEBDBULAkAgASIBIAJGDQAgAUEBaiEBDBcLQSohEAy1AwsCQCABIhAgAkcNAEErIRAMtQMLAkAgEC0AACIBQQlGDQAgAUEgRw3VAQsgAC0ALEEIRg3TASAQIQEMkQMLAkAgASIBIAJHDQBBLCEQDLQDCyABLQAAQQpHDdUBIAFBAWohAQzJAgsgASIOIAJHDdUBQS8hEAyyAwsDQAJAIAEtAAAiEEEgRg0AAkAgEEF2ag4EANwB3AEA2gELIAEhAQzgAQsgAUEBaiIBIAJHDQALQTEhEAyxAwtBMiEQIAEiFCACRg2wAyACIBRrIAAoAgAiAWohFSAUIAFrQQNqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB8LuAgABqLQAARw0BAkAgAUEDRw0AQQYhAQyWAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMsQMLIABBADYCACAUIQEM2QELQTMhECABIhQgAkYNrwMgAiAUayAAKAIAIgFqIRUgFCABa0EIaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfS7gIAAai0AAEcNAQJAIAFBCEcNAEEFIQEMlQMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLADCyAAQQA2AgAgFCEBDNgBC0E0IRAgASIUIAJGDa4DIAIgFGsgACgCACIBaiEVIBQgAWtBBWohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUHQwoCAAGotAABHDQECQCABQQVHDQBBByEBDJQDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAyvAwsgAEEANgIAIBQhAQzXAQsCQCABIgEgAkYNAANAAkAgAS0AAEGAvoCAAGotAAAiEEEBRg0AIBBBAkYNCiABIQEM3QELIAFBAWoiASACRw0AC0EwIRAMrgMLQTAhEAytAwsCQCABIgEgAkYNAANAAkAgAS0AACIQQSBGDQAgEEF2ag4E2QHaAdoB2QHaAQsgAUEBaiIBIAJHDQALQTghEAytAwtBOCEQDKwDCwNAAkAgAS0AACIQQSBGDQAgEEEJRw0DCyABQQFqIgEgAkcNAAtBPCEQDKsDCwNAAkAgAS0AACIQQSBGDQACQAJAIBBBdmoOBNoBAQHaAQALIBBBLEYN2wELIAEhAQwECyABQQFqIgEgAkcNAAtBPyEQDKoDCyABIQEM2wELQcAAIRAgASIUIAJGDagDIAIgFGsgACgCACIBaiEWIBQgAWtBBmohFwJAA0AgFC0AAEEgciABQYDAgIAAai0AAEcNASABQQZGDY4DIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADKkDCyAAQQA2AgAgFCEBC0E2IRAMjgMLAkAgASIPIAJHDQBBwQAhEAynAwsgAEGMgICAADYCCCAAIA82AgQgDyEBIAAtACxBf2oOBM0B1QHXAdkBhwMLIAFBAWohAQzMAQsCQCABIgEgAkYNAANAAkAgAS0AACIQQSByIBAgEEG/f2pB/wFxQRpJG0H/AXEiEEEJRg0AIBBBIEYNAAJAAkACQAJAIBBBnX9qDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTEhEAyRAwsgAUEBaiEBQTIhEAyQAwsgAUEBaiEBQTMhEAyPAwsgASEBDNABCyABQQFqIgEgAkcNAAtBNSEQDKUDC0E1IRAMpAMLAkAgASIBIAJGDQADQAJAIAEtAABBgLyAgABqLQAAQQFGDQAgASEBDNMBCyABQQFqIgEgAkcNAAtBPSEQDKQDC0E9IRAMowMLIAAgASIBIAIQsICAgAAiEA3WASABIQEMAQsgEEEBaiEBC0E8IRAMhwMLAkAgASIBIAJHDQBBwgAhEAygAwsCQANAAkAgAS0AAEF3ag4YAAL+Av4ChAP+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gIA/gILIAFBAWoiASACRw0AC0HCACEQDKADCyABQQFqIQEgAC0ALUEBcUUNvQEgASEBC0EsIRAMhQMLIAEiASACRw3TAUHEACEQDJ0DCwNAAkAgAS0AAEGQwICAAGotAABBAUYNACABIQEMtwILIAFBAWoiASACRw0AC0HFACEQDJwDCyANLQAAIhBBIEYNswEgEEE6Rw2BAyAAKAIEIQEgAEEANgIEIAAgASANEK+AgIAAIgEN0AEgDUEBaiEBDLMCC0HHACEQIAEiDSACRg2aAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQZDCgIAAai0AAEcNgAMgAUEFRg30AiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyaAwtByAAhECABIg0gAkYNmQMgAiANayAAKAIAIgFqIRYgDSABa0EJaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGWwoCAAGotAABHDf8CAkAgAUEJRw0AQQIhAQz1AgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmQMLAkAgASINIAJHDQBByQAhEAyZAwsCQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZJ/ag4HAIADgAOAA4ADgAMBgAMLIA1BAWohAUE+IRAMgAMLIA1BAWohAUE/IRAM/wILQcoAIRAgASINIAJGDZcDIAIgDWsgACgCACIBaiEWIA0gAWtBAWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBoMKAgABqLQAARw39AiABQQFGDfACIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJcDC0HLACEQIAEiDSACRg2WAyACIA1rIAAoAgAiAWohFiANIAFrQQ5qIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaLCgIAAai0AAEcN/AIgAUEORg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyWAwtBzAAhECABIg0gAkYNlQMgAiANayAAKAIAIgFqIRYgDSABa0EPaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUHAwoCAAGotAABHDfsCAkAgAUEPRw0AQQMhAQzxAgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlQMLQc0AIRAgASINIAJGDZQDIAIgDWsgACgCACIBaiEWIA0gAWtBBWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw36AgJAIAFBBUcNAEEEIQEM8AILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJQDCwJAIAEiDSACRw0AQc4AIRAMlAMLAkACQAJAAkAgDS0AACIBQSByIAEgAUG/f2pB/wFxQRpJG0H/AXFBnX9qDhMA/QL9Av0C/QL9Av0C/QL9Av0C/QL9Av0CAf0C/QL9AgID/QILIA1BAWohAUHBACEQDP0CCyANQQFqIQFBwgAhEAz8AgsgDUEBaiEBQcMAIRAM+wILIA1BAWohAUHEACEQDPoCCwJAIAEiASACRg0AIABBjYCAgAA2AgggACABNgIEIAEhAUHFACEQDPoCC0HPACEQDJIDCyAQIQECQAJAIBAtAABBdmoOBAGoAqgCAKgCCyAQQQFqIQELQSchEAz4AgsCQCABIgEgAkcNAEHRACEQDJEDCwJAIAEtAABBIEYNACABIQEMjQELIAFBAWohASAALQAtQQFxRQ3HASABIQEMjAELIAEiFyACRw3IAUHSACEQDI8DC0HTACEQIAEiFCACRg2OAyACIBRrIAAoAgAiAWohFiAUIAFrQQFqIRcDQCAULQAAIAFB1sKAgABqLQAARw3MASABQQFGDccBIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADI4DCwJAIAEiASACRw0AQdUAIRAMjgMLIAEtAABBCkcNzAEgAUEBaiEBDMcBCwJAIAEiASACRw0AQdYAIRAMjQMLAkACQCABLQAAQXZqDgQAzQHNAQHNAQsgAUEBaiEBDMcBCyABQQFqIQFBygAhEAzzAgsgACABIgEgAhCugICAACIQDcsBIAEhAUHNACEQDPICCyAALQApQSJGDYUDDKYCCwJAIAEiASACRw0AQdsAIRAMigMLQQAhFEEBIRdBASEWQQAhEAJAAkACQAJAAkACQAJAAkACQCABLQAAQVBqDgrUAdMBAAECAwQFBgjVAQtBAiEQDAYLQQMhEAwFC0EEIRAMBAtBBSEQDAMLQQYhEAwCC0EHIRAMAQtBCCEQC0EAIRdBACEWQQAhFAzMAQtBCSEQQQEhFEEAIRdBACEWDMsBCwJAIAEiASACRw0AQd0AIRAMiQMLIAEtAABBLkcNzAEgAUEBaiEBDKYCCyABIgEgAkcNzAFB3wAhEAyHAwsCQCABIgEgAkYNACAAQY6AgIAANgIIIAAgATYCBCABIQFB0AAhEAzuAgtB4AAhEAyGAwtB4QAhECABIgEgAkYNhQMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQeLCgIAAai0AAEcNzQEgFEEDRg3MASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyFAwtB4gAhECABIgEgAkYNhAMgAiABayAAKAIAIhRqIRYgASAUa0ECaiEXA0AgAS0AACAUQebCgIAAai0AAEcNzAEgFEECRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyEAwtB4wAhECABIgEgAkYNgwMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQenCgIAAai0AAEcNywEgFEEDRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyDAwsCQCABIgEgAkcNAEHlACEQDIMDCyAAIAFBAWoiASACEKiAgIAAIhANzQEgASEBQdYAIRAM6QILAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AAkACQAJAIBBBuH9qDgsAAc8BzwHPAc8BzwHPAc8BzwECzwELIAFBAWohAUHSACEQDO0CCyABQQFqIQFB0wAhEAzsAgsgAUEBaiEBQdQAIRAM6wILIAFBAWoiASACRw0AC0HkACEQDIIDC0HkACEQDIEDCwNAAkAgAS0AAEHwwoCAAGotAAAiEEEBRg0AIBBBfmoOA88B0AHRAdIBCyABQQFqIgEgAkcNAAtB5gAhEAyAAwsCQCABIgEgAkYNACABQQFqIQEMAwtB5wAhEAz/AgsDQAJAIAEtAABB8MSAgABqLQAAIhBBAUYNAAJAIBBBfmoOBNIB0wHUAQDVAQsgASEBQdcAIRAM5wILIAFBAWoiASACRw0AC0HoACEQDP4CCwJAIAEiASACRw0AQekAIRAM/gILAkAgAS0AACIQQXZqDhq6AdUB1QG8AdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAcoB1QHVAQDTAQsgAUEBaiEBC0EGIRAM4wILA0ACQCABLQAAQfDGgIAAai0AAEEBRg0AIAEhAQyeAgsgAUEBaiIBIAJHDQALQeoAIRAM+wILAkAgASIBIAJGDQAgAUEBaiEBDAMLQesAIRAM+gILAkAgASIBIAJHDQBB7AAhEAz6AgsgAUEBaiEBDAELAkAgASIBIAJHDQBB7QAhEAz5AgsgAUEBaiEBC0EEIRAM3gILAkAgASIUIAJHDQBB7gAhEAz3AgsgFCEBAkACQAJAIBQtAABB8MiAgABqLQAAQX9qDgfUAdUB1gEAnAIBAtcBCyAUQQFqIQEMCgsgFEEBaiEBDM0BC0EAIRAgAEEANgIcIABBm5KAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAz2AgsCQANAAkAgAS0AAEHwyICAAGotAAAiEEEERg0AAkACQCAQQX9qDgfSAdMB1AHZAQAEAdkBCyABIQFB2gAhEAzgAgsgAUEBaiEBQdwAIRAM3wILIAFBAWoiASACRw0AC0HvACEQDPYCCyABQQFqIQEMywELAkAgASIUIAJHDQBB8AAhEAz1AgsgFC0AAEEvRw3UASAUQQFqIQEMBgsCQCABIhQgAkcNAEHxACEQDPQCCwJAIBQtAAAiAUEvRw0AIBRBAWohAUHdACEQDNsCCyABQXZqIgRBFksN0wFBASAEdEGJgIACcUUN0wEMygILAkAgASIBIAJGDQAgAUEBaiEBQd4AIRAM2gILQfIAIRAM8gILAkAgASIUIAJHDQBB9AAhEAzyAgsgFCEBAkAgFC0AAEHwzICAAGotAABBf2oOA8kClAIA1AELQeEAIRAM2AILAkAgASIUIAJGDQADQAJAIBQtAABB8MqAgABqLQAAIgFBA0YNAAJAIAFBf2oOAssCANUBCyAUIQFB3wAhEAzaAgsgFEEBaiIUIAJHDQALQfMAIRAM8QILQfMAIRAM8AILAkAgASIBIAJGDQAgAEGPgICAADYCCCAAIAE2AgQgASEBQeAAIRAM1wILQfUAIRAM7wILAkAgASIBIAJHDQBB9gAhEAzvAgsgAEGPgICAADYCCCAAIAE2AgQgASEBC0EDIRAM1AILA0AgAS0AAEEgRw3DAiABQQFqIgEgAkcNAAtB9wAhEAzsAgsCQCABIgEgAkcNAEH4ACEQDOwCCyABLQAAQSBHDc4BIAFBAWohAQzvAQsgACABIgEgAhCsgICAACIQDc4BIAEhAQyOAgsCQCABIgQgAkcNAEH6ACEQDOoCCyAELQAAQcwARw3RASAEQQFqIQFBEyEQDM8BCwJAIAEiBCACRw0AQfsAIRAM6QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEANAIAQtAAAgAUHwzoCAAGotAABHDdABIAFBBUYNzgEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBB+wAhEAzoAgsCQCABIgQgAkcNAEH8ACEQDOgCCwJAAkAgBC0AAEG9f2oODADRAdEB0QHRAdEB0QHRAdEB0QHRAQHRAQsgBEEBaiEBQeYAIRAMzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGEASEQDOACCyAAQQA2AgAgEEEBaiEBQSMhEAzFAQsCQCABIgQgAkcNAEGFASEQDN8CCwJAAkAgBC0AAEG0f2oOCADIAcgByAHIAcgByAEByAELIARBAWohAUHvACEQDMYCCyAEQQFqIQFB8AAhEAzFAgsCQCABIgQgAkcNAEGGASEQDN4CCyAELQAAQcUARw3FASAEQQFqIQEMgwILAkAgASIEIAJHDQBBhwEhEAzdAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBiM+AgABqLQAARw3FASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhwEhEAzdAgsgAEEANgIAIBBBAWohAUEtIRAMwgELAkAgASIEIAJHDQBBiAEhEAzcAgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw3EASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiAEhEAzcAgsgAEEANgIAIBBBAWohAUEpIRAMwQELAkAgASIBIAJHDQBBiQEhEAzbAgtBASEQIAEtAABB3wBHDcABIAFBAWohAQyBAgsCQCABIgQgAkcNAEGKASEQDNoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRADQCAELQAAIAFBjM+AgABqLQAARw3BASABQQFGDa8CIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYoBIRAM2QILAkAgASIEIAJHDQBBiwEhEAzZAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBjs+AgABqLQAARw3BASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiwEhEAzZAgsgAEEANgIAIBBBAWohAUECIRAMvgELAkAgASIEIAJHDQBBjAEhEAzYAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw3AASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjAEhEAzYAgsgAEEANgIAIBBBAWohAUEfIRAMvQELAkAgASIEIAJHDQBBjQEhEAzXAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8s+AgABqLQAARw2/ASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjQEhEAzXAgsgAEEANgIAIBBBAWohAUEJIRAMvAELAkAgASIEIAJHDQBBjgEhEAzWAgsCQAJAIAQtAABBt39qDgcAvwG/Ab8BvwG/AQG/AQsgBEEBaiEBQfgAIRAMvQILIARBAWohAUH5ACEQDLwCCwJAIAEiBCACRw0AQY8BIRAM1QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQZHPgIAAai0AAEcNvQEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY8BIRAM1QILIABBADYCACAQQQFqIQFBGCEQDLoBCwJAIAEiBCACRw0AQZABIRAM1AILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQZfPgIAAai0AAEcNvAEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZABIRAM1AILIABBADYCACAQQQFqIQFBFyEQDLkBCwJAIAEiBCACRw0AQZEBIRAM0wILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQZrPgIAAai0AAEcNuwEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZEBIRAM0wILIABBADYCACAQQQFqIQFBFSEQDLgBCwJAIAEiBCACRw0AQZIBIRAM0gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQaHPgIAAai0AAEcNugEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZIBIRAM0gILIABBADYCACAQQQFqIQFBHiEQDLcBCwJAIAEiBCACRw0AQZMBIRAM0QILIAQtAABBzABHDbgBIARBAWohAUEKIRAMtgELAkAgBCACRw0AQZQBIRAM0AILAkACQCAELQAAQb9/ag4PALkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AbkBAbkBCyAEQQFqIQFB/gAhEAy3AgsgBEEBaiEBQf8AIRAMtgILAkAgBCACRw0AQZUBIRAMzwILAkACQCAELQAAQb9/ag4DALgBAbgBCyAEQQFqIQFB/QAhEAy2AgsgBEEBaiEEQYABIRAMtQILAkAgBCACRw0AQZYBIRAMzgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQafPgIAAai0AAEcNtgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZYBIRAMzgILIABBADYCACAQQQFqIQFBCyEQDLMBCwJAIAQgAkcNAEGXASEQDM0CCwJAAkACQAJAIAQtAABBU2oOIwC4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBAbgBuAG4AbgBuAECuAG4AbgBA7gBCyAEQQFqIQFB+wAhEAy2AgsgBEEBaiEBQfwAIRAMtQILIARBAWohBEGBASEQDLQCCyAEQQFqIQRBggEhEAyzAgsCQCAEIAJHDQBBmAEhEAzMAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBqc+AgABqLQAARw20ASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmAEhEAzMAgsgAEEANgIAIBBBAWohAUEZIRAMsQELAkAgBCACRw0AQZkBIRAMywILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQa7PgIAAai0AAEcNswEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZkBIRAMywILIABBADYCACAQQQFqIQFBBiEQDLABCwJAIAQgAkcNAEGaASEQDMoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG0z4CAAGotAABHDbIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGaASEQDMoCCyAAQQA2AgAgEEEBaiEBQRwhEAyvAQsCQCAEIAJHDQBBmwEhEAzJAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBts+AgABqLQAARw2xASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmwEhEAzJAgsgAEEANgIAIBBBAWohAUEnIRAMrgELAkAgBCACRw0AQZwBIRAMyAILAkACQCAELQAAQax/ag4CAAGxAQsgBEEBaiEEQYYBIRAMrwILIARBAWohBEGHASEQDK4CCwJAIAQgAkcNAEGdASEQDMcCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG4z4CAAGotAABHDa8BIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGdASEQDMcCCyAAQQA2AgAgEEEBaiEBQSYhEAysAQsCQCAEIAJHDQBBngEhEAzGAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBus+AgABqLQAARw2uASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBngEhEAzGAgsgAEEANgIAIBBBAWohAUEDIRAMqwELAkAgBCACRw0AQZ8BIRAMxQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNrQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ8BIRAMxQILIABBADYCACAQQQFqIQFBDCEQDKoBCwJAIAQgAkcNAEGgASEQDMQCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUG8z4CAAGotAABHDawBIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGgASEQDMQCCyAAQQA2AgAgEEEBaiEBQQ0hEAypAQsCQCAEIAJHDQBBoQEhEAzDAgsCQAJAIAQtAABBun9qDgsArAGsAawBrAGsAawBrAGsAawBAawBCyAEQQFqIQRBiwEhEAyqAgsgBEEBaiEEQYwBIRAMqQILAkAgBCACRw0AQaIBIRAMwgILIAQtAABB0ABHDakBIARBAWohBAzpAQsCQCAEIAJHDQBBowEhEAzBAgsCQAJAIAQtAABBt39qDgcBqgGqAaoBqgGqAQCqAQsgBEEBaiEEQY4BIRAMqAILIARBAWohAUEiIRAMpgELAkAgBCACRw0AQaQBIRAMwAILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQcDPgIAAai0AAEcNqAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaQBIRAMwAILIABBADYCACAQQQFqIQFBHSEQDKUBCwJAIAQgAkcNAEGlASEQDL8CCwJAAkAgBC0AAEGuf2oOAwCoAQGoAQsgBEEBaiEEQZABIRAMpgILIARBAWohAUEEIRAMpAELAkAgBCACRw0AQaYBIRAMvgILAkACQAJAAkACQCAELQAAQb9/ag4VAKoBqgGqAaoBqgGqAaoBqgGqAaoBAaoBqgECqgGqAQOqAaoBBKoBCyAEQQFqIQRBiAEhEAyoAgsgBEEBaiEEQYkBIRAMpwILIARBAWohBEGKASEQDKYCCyAEQQFqIQRBjwEhEAylAgsgBEEBaiEEQZEBIRAMpAILAkAgBCACRw0AQacBIRAMvQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNpQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQacBIRAMvQILIABBADYCACAQQQFqIQFBESEQDKIBCwJAIAQgAkcNAEGoASEQDLwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHCz4CAAGotAABHDaQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGoASEQDLwCCyAAQQA2AgAgEEEBaiEBQSwhEAyhAQsCQCAEIAJHDQBBqQEhEAy7AgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBxc+AgABqLQAARw2jASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqQEhEAy7AgsgAEEANgIAIBBBAWohAUErIRAMoAELAkAgBCACRw0AQaoBIRAMugILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQcrPgIAAai0AAEcNogEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaoBIRAMugILIABBADYCACAQQQFqIQFBFCEQDJ8BCwJAIAQgAkcNAEGrASEQDLkCCwJAAkACQAJAIAQtAABBvn9qDg8AAQKkAaQBpAGkAaQBpAGkAaQBpAGkAaQBA6QBCyAEQQFqIQRBkwEhEAyiAgsgBEEBaiEEQZQBIRAMoQILIARBAWohBEGVASEQDKACCyAEQQFqIQRBlgEhEAyfAgsCQCAEIAJHDQBBrAEhEAy4AgsgBC0AAEHFAEcNnwEgBEEBaiEEDOABCwJAIAQgAkcNAEGtASEQDLcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHNz4CAAGotAABHDZ8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGtASEQDLcCCyAAQQA2AgAgEEEBaiEBQQ4hEAycAQsCQCAEIAJHDQBBrgEhEAy2AgsgBC0AAEHQAEcNnQEgBEEBaiEBQSUhEAybAQsCQCAEIAJHDQBBrwEhEAy1AgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw2dASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrwEhEAy1AgsgAEEANgIAIBBBAWohAUEqIRAMmgELAkAgBCACRw0AQbABIRAMtAILAkACQCAELQAAQat/ag4LAJ0BnQGdAZ0BnQGdAZ0BnQGdAQGdAQsgBEEBaiEEQZoBIRAMmwILIARBAWohBEGbASEQDJoCCwJAIAQgAkcNAEGxASEQDLMCCwJAAkAgBC0AAEG/f2oOFACcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAEBnAELIARBAWohBEGZASEQDJoCCyAEQQFqIQRBnAEhEAyZAgsCQCAEIAJHDQBBsgEhEAyyAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFB2c+AgABqLQAARw2aASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBsgEhEAyyAgsgAEEANgIAIBBBAWohAUEhIRAMlwELAkAgBCACRw0AQbMBIRAMsQILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQd3PgIAAai0AAEcNmQEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbMBIRAMsQILIABBADYCACAQQQFqIQFBGiEQDJYBCwJAIAQgAkcNAEG0ASEQDLACCwJAAkACQCAELQAAQbt/ag4RAJoBmgGaAZoBmgGaAZoBmgGaAQGaAZoBmgGaAZoBApoBCyAEQQFqIQRBnQEhEAyYAgsgBEEBaiEEQZ4BIRAMlwILIARBAWohBEGfASEQDJYCCwJAIAQgAkcNAEG1ASEQDK8CCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUHkz4CAAGotAABHDZcBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG1ASEQDK8CCyAAQQA2AgAgEEEBaiEBQSghEAyUAQsCQCAEIAJHDQBBtgEhEAyuAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB6s+AgABqLQAARw2WASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtgEhEAyuAgsgAEEANgIAIBBBAWohAUEHIRAMkwELAkAgBCACRw0AQbcBIRAMrQILAkACQCAELQAAQbt/ag4OAJYBlgGWAZYBlgGWAZYBlgGWAZYBlgGWAQGWAQsgBEEBaiEEQaEBIRAMlAILIARBAWohBEGiASEQDJMCCwJAIAQgAkcNAEG4ASEQDKwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDZQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG4ASEQDKwCCyAAQQA2AgAgEEEBaiEBQRIhEAyRAQsCQCAEIAJHDQBBuQEhEAyrAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw2TASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuQEhEAyrAgsgAEEANgIAIBBBAWohAUEgIRAMkAELAkAgBCACRw0AQboBIRAMqgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNkgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQboBIRAMqgILIABBADYCACAQQQFqIQFBDyEQDI8BCwJAIAQgAkcNAEG7ASEQDKkCCwJAAkAgBC0AAEG3f2oOBwCSAZIBkgGSAZIBAZIBCyAEQQFqIQRBpQEhEAyQAgsgBEEBaiEEQaYBIRAMjwILAkAgBCACRw0AQbwBIRAMqAILIAIgBGsgACgCACIBaiEUIAQgAWtBB2ohEAJAA0AgBC0AACABQfTPgIAAai0AAEcNkAEgAUEHRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbwBIRAMqAILIABBADYCACAQQQFqIQFBGyEQDI0BCwJAIAQgAkcNAEG9ASEQDKcCCwJAAkACQCAELQAAQb5/ag4SAJEBkQGRAZEBkQGRAZEBkQGRAQGRAZEBkQGRAZEBkQECkQELIARBAWohBEGkASEQDI8CCyAEQQFqIQRBpwEhEAyOAgsgBEEBaiEEQagBIRAMjQILAkAgBCACRw0AQb4BIRAMpgILIAQtAABBzgBHDY0BIARBAWohBAzPAQsCQCAEIAJHDQBBvwEhEAylAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAELQAAQb9/ag4VAAECA5wBBAUGnAGcAZwBBwgJCgucAQwNDg+cAQsgBEEBaiEBQegAIRAMmgILIARBAWohAUHpACEQDJkCCyAEQQFqIQFB7gAhEAyYAgsgBEEBaiEBQfIAIRAMlwILIARBAWohAUHzACEQDJYCCyAEQQFqIQFB9gAhEAyVAgsgBEEBaiEBQfcAIRAMlAILIARBAWohAUH6ACEQDJMCCyAEQQFqIQRBgwEhEAySAgsgBEEBaiEEQYQBIRAMkQILIARBAWohBEGFASEQDJACCyAEQQFqIQRBkgEhEAyPAgsgBEEBaiEEQZgBIRAMjgILIARBAWohBEGgASEQDI0CCyAEQQFqIQRBowEhEAyMAgsgBEEBaiEEQaoBIRAMiwILAkAgBCACRg0AIABBkICAgAA2AgggACAENgIEQasBIRAMiwILQcABIRAMowILIAAgBSACEKqAgIAAIgENiwEgBSEBDFwLAkAgBiACRg0AIAZBAWohBQyNAQtBwgEhEAyhAgsDQAJAIBAtAABBdmoOBIwBAACPAQALIBBBAWoiECACRw0AC0HDASEQDKACCwJAIAcgAkYNACAAQZGAgIAANgIIIAAgBzYCBCAHIQFBASEQDIcCC0HEASEQDJ8CCwJAIAcgAkcNAEHFASEQDJ8CCwJAAkAgBy0AAEF2ag4EAc4BzgEAzgELIAdBAWohBgyNAQsgB0EBaiEFDIkBCwJAIAcgAkcNAEHGASEQDJ4CCwJAAkAgBy0AAEF2ag4XAY8BjwEBjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAI8BCyAHQQFqIQcLQbABIRAMhAILAkAgCCACRw0AQcgBIRAMnQILIAgtAABBIEcNjQEgAEEAOwEyIAhBAWohAUGzASEQDIMCCyABIRcCQANAIBciByACRg0BIActAABBUGpB/wFxIhBBCk8NzAECQCAALwEyIhRBmTNLDQAgACAUQQpsIhQ7ATIgEEH//wNzIBRB/v8DcUkNACAHQQFqIRcgACAUIBBqIhA7ATIgEEH//wNxQegHSQ0BCwtBACEQIABBADYCHCAAQcGJgIAANgIQIABBDTYCDCAAIAdBAWo2AhQMnAILQccBIRAMmwILIAAgCCACEK6AgIAAIhBFDcoBIBBBFUcNjAEgAEHIATYCHCAAIAg2AhQgAEHJl4CAADYCECAAQRU2AgxBACEQDJoCCwJAIAkgAkcNAEHMASEQDJoCC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgCS0AAEFQag4KlgGVAQABAgMEBQYIlwELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMjgELQQkhEEEBIRRBACEXQQAhFgyNAQsCQCAKIAJHDQBBzgEhEAyZAgsgCi0AAEEuRw2OASAKQQFqIQkMygELIAsgAkcNjgFB0AEhEAyXAgsCQCALIAJGDQAgAEGOgICAADYCCCAAIAs2AgRBtwEhEAz+AQtB0QEhEAyWAgsCQCAEIAJHDQBB0gEhEAyWAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EEaiELA0AgBC0AACAQQfzPgIAAai0AAEcNjgEgEEEERg3pASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHSASEQDJUCCyAAIAwgAhCsgICAACIBDY0BIAwhAQy4AQsCQCAEIAJHDQBB1AEhEAyUAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EBaiEMA0AgBC0AACAQQYHQgIAAai0AAEcNjwEgEEEBRg2OASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHUASEQDJMCCwJAIAQgAkcNAEHWASEQDJMCCyACIARrIAAoAgAiEGohFCAEIBBrQQJqIQsDQCAELQAAIBBBg9CAgABqLQAARw2OASAQQQJGDZABIBBBAWohECAEQQFqIgQgAkcNAAsgACAUNgIAQdYBIRAMkgILAkAgBCACRw0AQdcBIRAMkgILAkACQCAELQAAQbt/ag4QAI8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwEBjwELIARBAWohBEG7ASEQDPkBCyAEQQFqIQRBvAEhEAz4AQsCQCAEIAJHDQBB2AEhEAyRAgsgBC0AAEHIAEcNjAEgBEEBaiEEDMQBCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEG+ASEQDPcBC0HZASEQDI8CCwJAIAQgAkcNAEHaASEQDI8CCyAELQAAQcgARg3DASAAQQE6ACgMuQELIABBAjoALyAAIAQgAhCmgICAACIQDY0BQcIBIRAM9AELIAAtAChBf2oOArcBuQG4AQsDQAJAIAQtAABBdmoOBACOAY4BAI4BCyAEQQFqIgQgAkcNAAtB3QEhEAyLAgsgAEEAOgAvIAAtAC1BBHFFDYQCCyAAQQA6AC8gAEEBOgA0IAEhAQyMAQsgEEEVRg3aASAAQQA2AhwgACABNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAyIAgsCQCAAIBAgAhC0gICAACIEDQAgECEBDIECCwJAIARBFUcNACAAQQM2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAyIAgsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMhwILIBBBFUYN1gEgAEEANgIcIAAgATYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMhgILIAAoAgQhFyAAQQA2AgQgECARp2oiFiEBIAAgFyAQIBYgFBsiEBC1gICAACIURQ2NASAAQQc2AhwgACAQNgIUIAAgFDYCDEEAIRAMhQILIAAgAC8BMEGAAXI7ATAgASEBC0EqIRAM6gELIBBBFUYN0QEgAEEANgIcIAAgATYCFCAAQYOMgIAANgIQIABBEzYCDEEAIRAMggILIBBBFUYNzwEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAMgQILIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDI0BCyAAQQw2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMgAILIBBBFUYNzAEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM/wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIwBCyAAQQ02AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/gELIBBBFUYNyQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM/QELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIsBCyAAQQ42AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/AELIABBADYCHCAAIAE2AhQgAEHAlYCAADYCECAAQQI2AgxBACEQDPsBCyAQQRVGDcUBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPoBCyAAQRA2AhwgACABNgIUIAAgEDYCDEEAIRAM+QELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDPEBCyAAQRE2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM+AELIBBBFUYNwQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM9wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIgBCyAAQRM2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM9gELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDO0BCyAAQRQ2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM9QELIBBBFUYNvQEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM9AELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIYBCyAAQRY2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM8wELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC3gICAACIEDQAgAUEBaiEBDOkBCyAAQRc2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM8gELIABBADYCHCAAIAE2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDPEBC0IBIRELIBBBAWohAQJAIAApAyAiEkL//////////w9WDQAgACASQgSGIBGENwMgIAEhAQyEAQsgAEEANgIcIAAgATYCFCAAQa2JgIAANgIQIABBDDYCDEEAIRAM7wELIABBADYCHCAAIBA2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDO4BCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNcyAAQQU2AhwgACAQNgIUIAAgFDYCDEEAIRAM7QELIABBADYCHCAAIBA2AhQgAEGqnICAADYCECAAQQ82AgxBACEQDOwBCyAAIBAgAhC0gICAACIBDQEgECEBC0EOIRAM0QELAkAgAUEVRw0AIABBAjYCHCAAIBA2AhQgAEGwmICAADYCECAAQRU2AgxBACEQDOoBCyAAQQA2AhwgACAQNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAzpAQsgAUEBaiEQAkAgAC8BMCIBQYABcUUNAAJAIAAgECACELuAgIAAIgENACAQIQEMcAsgAUEVRw26ASAAQQU2AhwgACAQNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAzpAQsCQCABQaAEcUGgBEcNACAALQAtQQJxDQAgAEEANgIcIAAgEDYCFCAAQZaTgIAANgIQIABBBDYCDEEAIRAM6QELIAAgECACEL2AgIAAGiAQIQECQAJAAkACQAJAIAAgECACELOAgIAADhYCAQAEBAQEBAQEBAQEBAQEBAQEBAQDBAsgAEEBOgAuCyAAIAAvATBBwAByOwEwIBAhAQtBJiEQDNEBCyAAQSM2AhwgACAQNgIUIABBpZaAgAA2AhAgAEEVNgIMQQAhEAzpAQsgAEEANgIcIAAgEDYCFCAAQdWLgIAANgIQIABBETYCDEEAIRAM6AELIAAtAC1BAXFFDQFBwwEhEAzOAQsCQCANIAJGDQADQAJAIA0tAABBIEYNACANIQEMxAELIA1BAWoiDSACRw0AC0ElIRAM5wELQSUhEAzmAQsgACgCBCEEIABBADYCBCAAIAQgDRCvgICAACIERQ2tASAAQSY2AhwgACAENgIMIAAgDUEBajYCFEEAIRAM5QELIBBBFUYNqwEgAEEANgIcIAAgATYCFCAAQf2NgIAANgIQIABBHTYCDEEAIRAM5AELIABBJzYCHCAAIAE2AhQgACAQNgIMQQAhEAzjAQsgECEBQQEhFAJAAkACQAJAAkACQAJAIAAtACxBfmoOBwYFBQMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0ErIRAMygELIABBADYCHCAAIBA2AhQgAEGrkoCAADYCECAAQQs2AgxBACEQDOIBCyAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMQQAhEAzhAQsgAEEAOgAsIBAhAQy9AQsgECEBQQEhFAJAAkACQAJAAkAgAC0ALEF7ag4EAwECAAULIAAgAC8BMEEIcjsBMAwDC0ECIRQMAQtBBCEUCyAAQQE6ACwgACAALwEwIBRyOwEwCyAQIQELQSkhEAzFAQsgAEEANgIcIAAgATYCFCAAQfCUgIAANgIQIABBAzYCDEEAIRAM3QELAkAgDi0AAEENRw0AIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHULIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzdAQsgAC0ALUEBcUUNAUHEASEQDMMBCwJAIA4gAkcNAEEtIRAM3AELAkACQANAAkAgDi0AAEF2ag4EAgAAAwALIA5BAWoiDiACRw0AC0EtIRAM3QELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDiEBDHQLIABBLDYCHCAAIA42AhQgACABNgIMQQAhEAzcAQsgACgCBCEBIABBADYCBAJAIAAgASAOELGAgIAAIgENACAOQQFqIQEMcwsgAEEsNgIcIAAgATYCDCAAIA5BAWo2AhRBACEQDNsBCyAAKAIEIQQgAEEANgIEIAAgBCAOELGAgIAAIgQNoAEgDiEBDM4BCyAQQSxHDQEgAUEBaiEQQQEhAQJAAkACQAJAAkAgAC0ALEF7ag4EAwECBAALIBAhAQwEC0ECIQEMAQtBBCEBCyAAQQE6ACwgACAALwEwIAFyOwEwIBAhAQwBCyAAIAAvATBBCHI7ATAgECEBC0E5IRAMvwELIABBADoALCABIQELQTQhEAy9AQsgACAALwEwQSByOwEwIAEhAQwCCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBA0AIAEhAQzHAQsgAEE3NgIcIAAgATYCFCAAIAQ2AgxBACEQDNQBCyAAQQg6ACwgASEBC0EwIRAMuQELAkAgAC0AKEEBRg0AIAEhAQwECyAALQAtQQhxRQ2TASABIQEMAwsgAC0AMEEgcQ2UAUHFASEQDLcBCwJAIA8gAkYNAAJAA0ACQCAPLQAAQVBqIgFB/wFxQQpJDQAgDyEBQTUhEAy6AQsgACkDICIRQpmz5syZs+bMGVYNASAAIBFCCn4iETcDICARIAGtQv8BgyISQn+FVg0BIAAgESASfDcDICAPQQFqIg8gAkcNAAtBOSEQDNEBCyAAKAIEIQIgAEEANgIEIAAgAiAPQQFqIgQQsYCAgAAiAg2VASAEIQEMwwELQTkhEAzPAQsCQCAALwEwIgFBCHFFDQAgAC0AKEEBRw0AIAAtAC1BCHFFDZABCyAAIAFB9/sDcUGABHI7ATAgDyEBC0E3IRAMtAELIAAgAC8BMEEQcjsBMAyrAQsgEEEVRg2LASAAQQA2AhwgACABNgIUIABB8I6AgAA2AhAgAEEcNgIMQQAhEAzLAQsgAEHDADYCHCAAIAE2AgwgACANQQFqNgIUQQAhEAzKAQsCQCABLQAAQTpHDQAgACgCBCEQIABBADYCBAJAIAAgECABEK+AgIAAIhANACABQQFqIQEMYwsgAEHDADYCHCAAIBA2AgwgACABQQFqNgIUQQAhEAzKAQsgAEEANgIcIAAgATYCFCAAQbGRgIAANgIQIABBCjYCDEEAIRAMyQELIABBADYCHCAAIAE2AhQgAEGgmYCAADYCECAAQR42AgxBACEQDMgBCyAAQQA2AgALIABBgBI7ASogACAXQQFqIgEgAhCogICAACIQDQEgASEBC0HHACEQDKwBCyAQQRVHDYMBIABB0QA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAzEAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAzDAQsgAEEANgIcIAAgFDYCFCAAQcGogIAANgIQIABBBzYCDCAAQQA2AgBBACEQDMIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxdCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDMEBC0EAIRAgAEEANgIcIAAgATYCFCAAQYCRgIAANgIQIABBCTYCDAzAAQsgEEEVRg19IABBADYCHCAAIAE2AhQgAEGUjYCAADYCECAAQSE2AgxBACEQDL8BC0EBIRZBACEXQQAhFEEBIRALIAAgEDoAKyABQQFqIQECQAJAIAAtAC1BEHENAAJAAkACQCAALQAqDgMBAAIECyAWRQ0DDAILIBQNAQwCCyAXRQ0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQrYCAgAAiEA0AIAEhAQxcCyAAQdgANgIcIAAgATYCFCAAIBA2AgxBACEQDL4BCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHTADYCHCAAIBQ2AhQgACABNgIMQQAhEAyjAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMQwsgAEHlADYCHCAAIBQ2AhQgACABNgIMQQAhEAyiAQsgAEEANgIcIAAgFDYCFCAAQcOPgIAANgIQIABBBzYCDEEAIRAMoQELIABBADYCHCAAIAE2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKABC0EAIRAgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDAyfAQsgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDEEAIRAMngELIABBADYCHCAAIBQ2AhQgAEH+kYCAADYCECAAQQc2AgxBACEQDJ0BCyAAQQA2AhwgACABNgIUIABBjpuAgAA2AhAgAEEGNgIMQQAhEAycAQsgEEEVRg1XIABBADYCHCAAIAE2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDJsBCyAAQQA2AgAgEEEBaiEBQSQhEAsgACAQOgApIAAoAgQhECAAQQA2AgQgACAQIAEQq4CAgAAiEA1UIAEhAQw+CyAAQQA2AgALQQAhECAAQQA2AhwgACAENgIUIABB8ZuAgAA2AhAgAEEGNgIMDJcBCyABQRVGDVAgAEEANgIcIAAgBTYCFCAAQfCMgIAANgIQIABBGzYCDEEAIRAMlgELIAAoAgQhBSAAQQA2AgQgACAFIBAQqYCAgAAiBQ0BIBBBAWohBQtBrQEhEAx7CyAAQcEBNgIcIAAgBTYCDCAAIBBBAWo2AhRBACEQDJMBCyAAKAIEIQYgAEEANgIEIAAgBiAQEKmAgIAAIgYNASAQQQFqIQYLQa4BIRAMeAsgAEHCATYCHCAAIAY2AgwgACAQQQFqNgIUQQAhEAyQAQsgAEEANgIcIAAgBzYCFCAAQZeLgIAANgIQIABBDTYCDEEAIRAMjwELIABBADYCHCAAIAg2AhQgAEHjkICAADYCECAAQQk2AgxBACEQDI4BCyAAQQA2AhwgACAINgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAyNAQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgCUEBaiEIAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBCAAIBAgCBCtgICAACIQRQ09IABByQE2AhwgACAINgIUIAAgEDYCDEEAIRAMjAELIAAoAgQhBCAAQQA2AgQgACAEIAgQrYCAgAAiBEUNdiAAQcoBNgIcIAAgCDYCFCAAIAQ2AgxBACEQDIsBCyAAKAIEIQQgAEEANgIEIAAgBCAJEK2AgIAAIgRFDXQgAEHLATYCHCAAIAk2AhQgACAENgIMQQAhEAyKAQsgACgCBCEEIABBADYCBCAAIAQgChCtgICAACIERQ1yIABBzQE2AhwgACAKNgIUIAAgBDYCDEEAIRAMiQELAkAgCy0AAEFQaiIQQf8BcUEKTw0AIAAgEDoAKiALQQFqIQpBtgEhEAxwCyAAKAIEIQQgAEEANgIEIAAgBCALEK2AgIAAIgRFDXAgAEHPATYCHCAAIAs2AhQgACAENgIMQQAhEAyIAQsgAEEANgIcIAAgBDYCFCAAQZCzgIAANgIQIABBCDYCDCAAQQA2AgBBACEQDIcBCyABQRVGDT8gAEEANgIcIAAgDDYCFCAAQcyOgIAANgIQIABBIDYCDEEAIRAMhgELIABBgQQ7ASggACgCBCEQIABCADcDACAAIBAgDEEBaiIMEKuAgIAAIhBFDTggAEHTATYCHCAAIAw2AhQgACAQNgIMQQAhEAyFAQsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQdibgIAANgIQIABBCDYCDAyDAQsgACgCBCEQIABCADcDACAAIBAgC0EBaiILEKuAgIAAIhANAUHGASEQDGkLIABBAjoAKAxVCyAAQdUBNgIcIAAgCzYCFCAAIBA2AgxBACEQDIABCyAQQRVGDTcgAEEANgIcIAAgBDYCFCAAQaSMgIAANgIQIABBEDYCDEEAIRAMfwsgAC0ANEEBRw00IAAgBCACELyAgIAAIhBFDTQgEEEVRw01IABB3AE2AhwgACAENgIUIABB1ZaAgAA2AhAgAEEVNgIMQQAhEAx+C0EAIRAgAEEANgIcIABBr4uAgAA2AhAgAEECNgIMIAAgFEEBajYCFAx9C0EAIRAMYwtBAiEQDGILQQ0hEAxhC0EPIRAMYAtBJSEQDF8LQRMhEAxeC0EVIRAMXQtBFiEQDFwLQRchEAxbC0EYIRAMWgtBGSEQDFkLQRohEAxYC0EbIRAMVwtBHCEQDFYLQR0hEAxVC0EfIRAMVAtBISEQDFMLQSMhEAxSC0HGACEQDFELQS4hEAxQC0EvIRAMTwtBOyEQDE4LQT0hEAxNC0HIACEQDEwLQckAIRAMSwtBywAhEAxKC0HMACEQDEkLQc4AIRAMSAtB0QAhEAxHC0HVACEQDEYLQdgAIRAMRQtB2QAhEAxEC0HbACEQDEMLQeQAIRAMQgtB5QAhEAxBC0HxACEQDEALQfQAIRAMPwtBjQEhEAw+C0GXASEQDD0LQakBIRAMPAtBrAEhEAw7C0HAASEQDDoLQbkBIRAMOQtBrwEhEAw4C0GxASEQDDcLQbIBIRAMNgtBtAEhEAw1C0G1ASEQDDQLQboBIRAMMwtBvQEhEAwyC0G/ASEQDDELQcEBIRAMMAsgAEEANgIcIAAgBDYCFCAAQemLgIAANgIQIABBHzYCDEEAIRAMSAsgAEHbATYCHCAAIAQ2AhQgAEH6loCAADYCECAAQRU2AgxBACEQDEcLIABB+AA2AhwgACAMNgIUIABBypiAgAA2AhAgAEEVNgIMQQAhEAxGCyAAQdEANgIcIAAgBTYCFCAAQbCXgIAANgIQIABBFTYCDEEAIRAMRQsgAEH5ADYCHCAAIAE2AhQgACAQNgIMQQAhEAxECyAAQfgANgIcIAAgATYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMQwsgAEHkADYCHCAAIAE2AhQgAEHjl4CAADYCECAAQRU2AgxBACEQDEILIABB1wA2AhwgACABNgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAxBCyAAQQA2AhwgACABNgIUIABBuY2AgAA2AhAgAEEaNgIMQQAhEAxACyAAQcIANgIcIAAgATYCFCAAQeOYgIAANgIQIABBFTYCDEEAIRAMPwsgAEEANgIEIAAgDyAPELGAgIAAIgRFDQEgAEE6NgIcIAAgBDYCDCAAIA9BAWo2AhRBACEQDD4LIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCxgICAACIERQ0AIABBOzYCHCAAIAQ2AgwgACABQQFqNgIUQQAhEAw+CyABQQFqIQEMLQsgD0EBaiEBDC0LIABBADYCHCAAIA82AhQgAEHkkoCAADYCECAAQQQ2AgxBACEQDDsLIABBNjYCHCAAIAQ2AhQgACACNgIMQQAhEAw6CyAAQS42AhwgACAONgIUIAAgBDYCDEEAIRAMOQsgAEHQADYCHCAAIAE2AhQgAEGRmICAADYCECAAQRU2AgxBACEQDDgLIA1BAWohAQwsCyAAQRU2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAw2CyAAQRs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw1CyAAQQ82AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw0CyAAQQs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAwzCyAAQRo2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwyCyAAQQs2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwxCyAAQQo2AhwgACABNgIUIABB5JaAgAA2AhAgAEEVNgIMQQAhEAwwCyAAQR42AhwgACABNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAwvCyAAQQA2AhwgACAQNgIUIABB2o2AgAA2AhAgAEEUNgIMQQAhEAwuCyAAQQQ2AhwgACABNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAwtCyAAQQA2AgAgC0EBaiELC0G4ASEQDBILIABBADYCACAQQQFqIQFB9QAhEAwRCyABIQECQCAALQApQQVHDQBB4wAhEAwRC0HiACEQDBALQQAhECAAQQA2AhwgAEHkkYCAADYCECAAQQc2AgwgACAUQQFqNgIUDCgLIABBADYCACAXQQFqIQFBwAAhEAwOC0EBIQELIAAgAToALCAAQQA2AgAgF0EBaiEBC0EoIRAMCwsgASEBC0E4IRAMCQsCQCABIg8gAkYNAANAAkAgDy0AAEGAvoCAAGotAAAiAUEBRg0AIAFBAkcNAyAPQQFqIQEMBAsgD0EBaiIPIAJHDQALQT4hEAwiC0E+IRAMIQsgAEEAOgAsIA8hAQwBC0ELIRAMBgtBOiEQDAULIAFBAWohAUEtIRAMBAsgACABOgAsIABBADYCACAWQQFqIQFBDCEQDAMLIABBADYCACAXQQFqIQFBCiEQDAILIABBADYCAAsgAEEAOgAsIA0hAUEJIRAMAAsLQQAhECAAQQA2AhwgACALNgIUIABBzZCAgAA2AhAgAEEJNgIMDBcLQQAhECAAQQA2AhwgACAKNgIUIABB6YqAgAA2AhAgAEEJNgIMDBYLQQAhECAAQQA2AhwgACAJNgIUIABBt5CAgAA2AhAgAEEJNgIMDBULQQAhECAAQQA2AhwgACAINgIUIABBnJGAgAA2AhAgAEEJNgIMDBQLQQAhECAAQQA2AhwgACABNgIUIABBzZCAgAA2AhAgAEEJNgIMDBMLQQAhECAAQQA2AhwgACABNgIUIABB6YqAgAA2AhAgAEEJNgIMDBILQQAhECAAQQA2AhwgACABNgIUIABBt5CAgAA2AhAgAEEJNgIMDBELQQAhECAAQQA2AhwgACABNgIUIABBnJGAgAA2AhAgAEEJNgIMDBALQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA8LQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA4LQQAhECAAQQA2AhwgACABNgIUIABBwJKAgAA2AhAgAEELNgIMDA0LQQAhECAAQQA2AhwgACABNgIUIABBlYmAgAA2AhAgAEELNgIMDAwLQQAhECAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMDAsLQQAhECAAQQA2AhwgACABNgIUIABB+4+AgAA2AhAgAEEKNgIMDAoLQQAhECAAQQA2AhwgACABNgIUIABB8ZmAgAA2AhAgAEECNgIMDAkLQQAhECAAQQA2AhwgACABNgIUIABBxJSAgAA2AhAgAEECNgIMDAgLQQAhECAAQQA2AhwgACABNgIUIABB8pWAgAA2AhAgAEECNgIMDAcLIABBAjYCHCAAIAE2AhQgAEGcmoCAADYCECAAQRY2AgxBACEQDAYLQQEhEAwFC0HUACEQIAEiBCACRg0EIANBCGogACAEIAJB2MKAgABBChDFgICAACADKAIMIQQgAygCCA4DAQQCAAsQyoCAgAAACyAAQQA2AhwgAEG1moCAADYCECAAQRc2AgwgACAEQQFqNgIUQQAhEAwCCyAAQQA2AhwgACAENgIUIABBypqAgAA2AhAgAEEJNgIMQQAhEAwBCwJAIAEiBCACRw0AQSIhEAwBCyAAQYmAgIAANgIIIAAgBDYCBEEhIRALIANBEGokgICAgAAgEAuvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAEMeAgIAAC/I2AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKg0ICAAA0AQQAQy4CAgABBgNSEgABrIgJB2QBJDQBBACEDAkBBACgC4NOAgAAiBA0AQQBCfzcC7NOAgABBAEKAgISAgIDAADcC5NOAgABBACABQQhqQXBxQdiq1aoFcyIENgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgAALQQAgAjYCzNOAgABBAEGA1ISAADYCyNOAgABBAEGA1ISAADYCmNCAgABBACAENgKs0ICAAEEAQX82AqjQgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAtBgNSEgABBeEGA1ISAAGtBD3FBAEGA1ISAAEEIakEPcRsiA2oiBEEEaiACQUhqIgUgA2siA0EBcjYCAEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgABBgNSEgAAgBWpBODYCBAsCQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAUsNAAJAQQAoAojQgIAAIgZBECAAQRNqQXBxIABBC0kbIgJBA3YiBHYiA0EDcUUNAAJAAkAgA0EBcSAEckEBcyIFQQN0IgRBsNCAgABqIgMgBEG40ICAAGooAgAiBCgCCCICRw0AQQAgBkF+IAV3cTYCiNCAgAAMAQsgAyACNgIIIAIgAzYCDAsgBEEIaiEDIAQgBUEDdCIFQQNyNgIEIAQgBWoiBCAEKAIEQQFyNgIEDAwLIAJBACgCkNCAgAAiB00NAQJAIANFDQACQAJAIAMgBHRBAiAEdCIDQQAgA2tycSIDQQAgA2txQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmoiBEEDdCIDQbDQgIAAaiIFIANBuNCAgABqKAIAIgMoAggiAEcNAEEAIAZBfiAEd3EiBjYCiNCAgAAMAQsgBSAANgIIIAAgBTYCDAsgAyACQQNyNgIEIAMgBEEDdCIEaiAEIAJrIgU2AgAgAyACaiIAIAVBAXI2AgQCQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhBAJAAkAgBkEBIAdBA3Z0IghxDQBBACAGIAhyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAQ2AgwgAiAENgIIIAQgAjYCDCAEIAg2AggLIANBCGohA0EAIAA2ApzQgIAAQQAgBTYCkNCAgAAMDAtBACgCjNCAgAAiCUUNASAJQQAgCWtxQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmpBAnRBuNKAgABqKAIAIgAoAgRBeHEgAmshBCAAIQUCQANAAkAgBSgCECIDDQAgBUEUaigCACIDRQ0CCyADKAIEQXhxIAJrIgUgBCAFIARJIgUbIQQgAyAAIAUbIQAgAyEFDAALCyAAKAIYIQoCQCAAKAIMIgggAEYNACAAKAIIIgNBACgCmNCAgABJGiAIIAM2AgggAyAINgIMDAsLAkAgAEEUaiIFKAIAIgMNACAAKAIQIgNFDQMgAEEQaiEFCwNAIAUhCyADIghBFGoiBSgCACIDDQAgCEEQaiEFIAgoAhAiAw0ACyALQQA2AgAMCgtBfyECIABBv39LDQAgAEETaiIDQXBxIQJBACgCjNCAgAAiB0UNAEEAIQsCQCACQYACSQ0AQR8hCyACQf///wdLDQAgA0EIdiIDIANBgP4/akEQdkEIcSIDdCIEIARBgOAfakEQdkEEcSIEdCIFIAVBgIAPakEQdkECcSIFdEEPdiADIARyIAVyayIDQQF0IAIgA0EVanZBAXFyQRxqIQsLQQAgAmshBAJAAkACQAJAIAtBAnRBuNKAgABqKAIAIgUNAEEAIQNBACEIDAELQQAhAyACQQBBGSALQQF2ayALQR9GG3QhAEEAIQgDQAJAIAUoAgRBeHEgAmsiBiAETw0AIAYhBCAFIQggBg0AQQAhBCAFIQggBSEDDAMLIAMgBUEUaigCACIGIAYgBSAAQR12QQRxakEQaigCACIFRhsgAyAGGyEDIABBAXQhACAFDQALCwJAIAMgCHINAEEAIQhBAiALdCIDQQAgA2tyIAdxIgNFDQMgA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBUEFdkEIcSIAIANyIAUgAHYiA0ECdkEEcSIFciADIAV2IgNBAXZBAnEiBXIgAyAFdiIDQQF2QQFxIgVyIAMgBXZqQQJ0QbjSgIAAaigCACEDCyADRQ0BCwNAIAMoAgRBeHEgAmsiBiAESSEAAkAgAygCECIFDQAgA0EUaigCACEFCyAGIAQgABshBCADIAggABshCCAFIQMgBQ0ACwsgCEUNACAEQQAoApDQgIAAIAJrTw0AIAgoAhghCwJAIAgoAgwiACAIRg0AIAgoAggiA0EAKAKY0ICAAEkaIAAgAzYCCCADIAA2AgwMCQsCQCAIQRRqIgUoAgAiAw0AIAgoAhAiA0UNAyAIQRBqIQULA0AgBSEGIAMiAEEUaiIFKAIAIgMNACAAQRBqIQUgACgCECIDDQALIAZBADYCAAwICwJAQQAoApDQgIAAIgMgAkkNAEEAKAKc0ICAACEEAkACQCADIAJrIgVBEEkNACAEIAJqIgAgBUEBcjYCBEEAIAU2ApDQgIAAQQAgADYCnNCAgAAgBCADaiAFNgIAIAQgAkEDcjYCBAwBCyAEIANBA3I2AgQgBCADaiIDIAMoAgRBAXI2AgRBAEEANgKc0ICAAEEAQQA2ApDQgIAACyAEQQhqIQMMCgsCQEEAKAKU0ICAACIAIAJNDQBBACgCoNCAgAAiAyACaiIEIAAgAmsiBUEBcjYCBEEAIAU2ApTQgIAAQQAgBDYCoNCAgAAgAyACQQNyNgIEIANBCGohAwwKCwJAAkBBACgC4NOAgABFDQBBACgC6NOAgAAhBAwBC0EAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEMakFwcUHYqtWqBXM2AuDTgIAAQQBBADYC9NOAgABBAEEANgLE04CAAEGAgAQhBAtBACEDAkAgBCACQccAaiIHaiIGQQAgBGsiC3EiCCACSw0AQQBBMDYC+NOAgAAMCgsCQEEAKALA04CAACIDRQ0AAkBBACgCuNOAgAAiBCAIaiIFIARNDQAgBSADTQ0BC0EAIQNBAEEwNgL404CAAAwKC0EALQDE04CAAEEEcQ0EAkACQAJAQQAoAqDQgIAAIgRFDQBByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiAESw0DCyADKAIIIgMNAAsLQQAQy4CAgAAiAEF/Rg0FIAghBgJAQQAoAuTTgIAAIgNBf2oiBCAAcUUNACAIIABrIAQgAGpBACADa3FqIQYLIAYgAk0NBSAGQf7///8HSw0FAkBBACgCwNOAgAAiA0UNAEEAKAK404CAACIEIAZqIgUgBE0NBiAFIANLDQYLIAYQy4CAgAAiAyAARw0BDAcLIAYgAGsgC3EiBkH+////B0sNBCAGEMuAgIAAIgAgAygCACADKAIEakYNAyAAIQMLAkAgA0F/Rg0AIAJByABqIAZNDQACQCAHIAZrQQAoAujTgIAAIgRqQQAgBGtxIgRB/v///wdNDQAgAyEADAcLAkAgBBDLgICAAEF/Rg0AIAQgBmohBiADIQAMBwtBACAGaxDLgICAABoMBAsgAyEAIANBf0cNBQwDC0EAIQgMBwtBACEADAULIABBf0cNAgtBAEEAKALE04CAAEEEcjYCxNOAgAALIAhB/v///wdLDQEgCBDLgICAACEAQQAQy4CAgAAhAyAAQX9GDQEgA0F/Rg0BIAAgA08NASADIABrIgYgAkE4ak0NAQtBAEEAKAK404CAACAGaiIDNgK404CAAAJAIANBACgCvNOAgABNDQBBACADNgK804CAAAsCQAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQCAAIAMoAgAiBSADKAIEIghqRg0CIAMoAggiAw0ADAMLCwJAAkBBACgCmNCAgAAiA0UNACAAIANPDQELQQAgADYCmNCAgAALQQAhA0EAIAY2AszTgIAAQQAgADYCyNOAgABBAEF/NgKo0ICAAEEAQQAoAuDTgIAANgKs0ICAAEEAQQA2AtTTgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiBCAGQUhqIgUgA2siA0EBcjYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgAAgACAFakE4NgIEDAILIAMtAAxBCHENACAEIAVJDQAgBCAATw0AIARBeCAEa0EPcUEAIARBCGpBD3EbIgVqIgBBACgClNCAgAAgBmoiCyAFayIFQQFyNgIEIAMgCCAGajYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAU2ApTQgIAAQQAgADYCoNCAgAAgBCALakE4NgIEDAELAkAgAEEAKAKY0ICAACIITw0AQQAgADYCmNCAgAAgACEICyAAIAZqIQVByNOAgAAhAwJAAkACQAJAAkACQAJAA0AgAygCACAFRg0BIAMoAggiAw0ADAILCyADLQAMQQhxRQ0BC0HI04CAACEDA0ACQCADKAIAIgUgBEsNACAFIAMoAgRqIgUgBEsNAwsgAygCCCEDDAALCyADIAA2AgAgAyADKAIEIAZqNgIEIABBeCAAa0EPcUEAIABBCGpBD3EbaiILIAJBA3I2AgQgBUF4IAVrQQ9xQQAgBUEIakEPcRtqIgYgCyACaiICayEDAkAgBiAERw0AQQAgAjYCoNCAgABBAEEAKAKU0ICAACADaiIDNgKU0ICAACACIANBAXI2AgQMAwsCQCAGQQAoApzQgIAARw0AQQAgAjYCnNCAgABBAEEAKAKQ0ICAACADaiIDNgKQ0ICAACACIANBAXI2AgQgAiADaiADNgIADAMLAkAgBigCBCIEQQNxQQFHDQAgBEF4cSEHAkACQCAEQf8BSw0AIAYoAggiBSAEQQN2IghBA3RBsNCAgABqIgBGGgJAIAYoAgwiBCAFRw0AQQBBACgCiNCAgABBfiAId3E2AojQgIAADAILIAQgAEYaIAQgBTYCCCAFIAQ2AgwMAQsgBigCGCEJAkACQCAGKAIMIgAgBkYNACAGKAIIIgQgCEkaIAAgBDYCCCAEIAA2AgwMAQsCQCAGQRRqIgQoAgAiBQ0AIAZBEGoiBCgCACIFDQBBACEADAELA0AgBCEIIAUiAEEUaiIEKAIAIgUNACAAQRBqIQQgACgCECIFDQALIAhBADYCAAsgCUUNAAJAAkAgBiAGKAIcIgVBAnRBuNKAgABqIgQoAgBHDQAgBCAANgIAIAANAUEAQQAoAozQgIAAQX4gBXdxNgKM0ICAAAwCCyAJQRBBFCAJKAIQIAZGG2ogADYCACAARQ0BCyAAIAk2AhgCQCAGKAIQIgRFDQAgACAENgIQIAQgADYCGAsgBigCFCIERQ0AIABBFGogBDYCACAEIAA2AhgLIAcgA2ohAyAGIAdqIgYoAgQhBAsgBiAEQX5xNgIEIAIgA2ogAzYCACACIANBAXI2AgQCQCADQf8BSw0AIANBeHFBsNCAgABqIQQCQAJAQQAoAojQgIAAIgVBASADQQN2dCIDcQ0AQQAgBSADcjYCiNCAgAAgBCEDDAELIAQoAgghAwsgAyACNgIMIAQgAjYCCCACIAQ2AgwgAiADNgIIDAMLQR8hBAJAIANB////B0sNACADQQh2IgQgBEGA/j9qQRB2QQhxIgR0IgUgBUGA4B9qQRB2QQRxIgV0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAQgBXIgAHJrIgRBAXQgAyAEQRVqdkEBcXJBHGohBAsgAiAENgIcIAJCADcCECAEQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiAEEBIAR0IghxDQAgBSACNgIAQQAgACAIcjYCjNCAgAAgAiAFNgIYIAIgAjYCCCACIAI2AgwMAwsgA0EAQRkgBEEBdmsgBEEfRht0IQQgBSgCACEAA0AgACIFKAIEQXhxIANGDQIgBEEddiEAIARBAXQhBCAFIABBBHFqQRBqIggoAgAiAA0ACyAIIAI2AgAgAiAFNgIYIAIgAjYCDCACIAI2AggMAgsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiCyAGQUhqIgggA2siA0EBcjYCBCAAIAhqQTg2AgQgBCAFQTcgBWtBD3FBACAFQUlqQQ9xG2pBQWoiCCAIIARBEGpJGyIIQSM2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAs2AqDQgIAAIAhBEGpBACkC0NOAgAA3AgAgCEEAKQLI04CAADcCCEEAIAhBCGo2AtDTgIAAQQAgBjYCzNOAgABBACAANgLI04CAAEEAQQA2AtTTgIAAIAhBJGohAwNAIANBBzYCACADQQRqIgMgBUkNAAsgCCAERg0DIAggCCgCBEF+cTYCBCAIIAggBGsiADYCACAEIABBAXI2AgQCQCAAQf8BSw0AIABBeHFBsNCAgABqIQMCQAJAQQAoAojQgIAAIgVBASAAQQN2dCIAcQ0AQQAgBSAAcjYCiNCAgAAgAyEFDAELIAMoAgghBQsgBSAENgIMIAMgBDYCCCAEIAM2AgwgBCAFNgIIDAQLQR8hAwJAIABB////B0sNACAAQQh2IgMgA0GA/j9qQRB2QQhxIgN0IgUgBUGA4B9qQRB2QQRxIgV0IgggCEGAgA9qQRB2QQJxIgh0QQ92IAMgBXIgCHJrIgNBAXQgACADQRVqdkEBcXJBHGohAwsgBCADNgIcIARCADcCECADQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiCEEBIAN0IgZxDQAgBSAENgIAQQAgCCAGcjYCjNCAgAAgBCAFNgIYIAQgBDYCCCAEIAQ2AgwMBAsgAEEAQRkgA0EBdmsgA0EfRht0IQMgBSgCACEIA0AgCCIFKAIEQXhxIABGDQMgA0EddiEIIANBAXQhAyAFIAhBBHFqQRBqIgYoAgAiCA0ACyAGIAQ2AgAgBCAFNgIYIAQgBDYCDCAEIAQ2AggMAwsgBSgCCCIDIAI2AgwgBSACNgIIIAJBADYCGCACIAU2AgwgAiADNgIICyALQQhqIQMMBQsgBSgCCCIDIAQ2AgwgBSAENgIIIARBADYCGCAEIAU2AgwgBCADNgIIC0EAKAKU0ICAACIDIAJNDQBBACgCoNCAgAAiBCACaiIFIAMgAmsiA0EBcjYCBEEAIAM2ApTQgIAAQQAgBTYCoNCAgAAgBCACQQNyNgIEIARBCGohAwwDC0EAIQNBAEEwNgL404CAAAwCCwJAIAtFDQACQAJAIAggCCgCHCIFQQJ0QbjSgIAAaiIDKAIARw0AIAMgADYCACAADQFBACAHQX4gBXdxIgc2AozQgIAADAILIAtBEEEUIAsoAhAgCEYbaiAANgIAIABFDQELIAAgCzYCGAJAIAgoAhAiA0UNACAAIAM2AhAgAyAANgIYCyAIQRRqKAIAIgNFDQAgAEEUaiADNgIAIAMgADYCGAsCQAJAIARBD0sNACAIIAQgAmoiA0EDcjYCBCAIIANqIgMgAygCBEEBcjYCBAwBCyAIIAJqIgAgBEEBcjYCBCAIIAJBA3I2AgQgACAEaiAENgIAAkAgBEH/AUsNACAEQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgBEEDdnQiBHENAEEAIAUgBHI2AojQgIAAIAMhBAwBCyADKAIIIQQLIAQgADYCDCADIAA2AgggACADNgIMIAAgBDYCCAwBC0EfIQMCQCAEQf///wdLDQAgBEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCICIAJBgIAPakEQdkECcSICdEEPdiADIAVyIAJyayIDQQF0IAQgA0EVanZBAXFyQRxqIQMLIAAgAzYCHCAAQgA3AhAgA0ECdEG40oCAAGohBQJAIAdBASADdCICcQ0AIAUgADYCAEEAIAcgAnI2AozQgIAAIAAgBTYCGCAAIAA2AgggACAANgIMDAELIARBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhAgJAA0AgAiIFKAIEQXhxIARGDQEgA0EddiECIANBAXQhAyAFIAJBBHFqQRBqIgYoAgAiAg0ACyAGIAA2AgAgACAFNgIYIAAgADYCDCAAIAA2AggMAQsgBSgCCCIDIAA2AgwgBSAANgIIIABBADYCGCAAIAU2AgwgACADNgIICyAIQQhqIQMMAQsCQCAKRQ0AAkACQCAAIAAoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAg2AgAgCA0BQQAgCUF+IAV3cTYCjNCAgAAMAgsgCkEQQRQgCigCECAARhtqIAg2AgAgCEUNAQsgCCAKNgIYAkAgACgCECIDRQ0AIAggAzYCECADIAg2AhgLIABBFGooAgAiA0UNACAIQRRqIAM2AgAgAyAINgIYCwJAAkAgBEEPSw0AIAAgBCACaiIDQQNyNgIEIAAgA2oiAyADKAIEQQFyNgIEDAELIAAgAmoiBSAEQQFyNgIEIAAgAkEDcjYCBCAFIARqIAQ2AgACQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhAwJAAkBBASAHQQN2dCIIIAZxDQBBACAIIAZyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAM2AgwgAiADNgIIIAMgAjYCDCADIAg2AggLQQAgBTYCnNCAgABBACAENgKQ0ICAAAsgAEEIaiEDCyABQRBqJICAgIAAIAMLCgAgABDJgICAAAviDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQEgASABKAIAIgJrIgFBACgCmNCAgAAiBEkNASACIABqIQACQCABQQAoApzQgIAARg0AAkAgAkH/AUsNACABKAIIIgQgAkEDdiIFQQN0QbDQgIAAaiIGRhoCQCABKAIMIgIgBEcNAEEAQQAoAojQgIAAQX4gBXdxNgKI0ICAAAwDCyACIAZGGiACIAQ2AgggBCACNgIMDAILIAEoAhghBwJAAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiAGIAI2AgggAiAGNgIMDAELAkAgAUEUaiICKAIAIgQNACABQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQECQAJAIAEgASgCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAwsgB0EQQRQgBygCECABRhtqIAY2AgAgBkUNAgsgBiAHNgIYAkAgASgCECICRQ0AIAYgAjYCECACIAY2AhgLIAEoAhQiAkUNASAGQRRqIAI2AgAgAiAGNgIYDAELIAMoAgQiAkEDcUEDRw0AIAMgAkF+cTYCBEEAIAA2ApDQgIAAIAEgAGogADYCACABIABBAXI2AgQPCyABIANPDQAgAygCBCICQQFxRQ0AAkACQCACQQJxDQACQCADQQAoAqDQgIAARw0AQQAgATYCoNCAgABBAEEAKAKU0ICAACAAaiIANgKU0ICAACABIABBAXI2AgQgAUEAKAKc0ICAAEcNA0EAQQA2ApDQgIAAQQBBADYCnNCAgAAPCwJAIANBACgCnNCAgABHDQBBACABNgKc0ICAAEEAQQAoApDQgIAAIABqIgA2ApDQgIAAIAEgAEEBcjYCBCABIABqIAA2AgAPCyACQXhxIABqIQACQAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgAygCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAgsgAiAGRhogAiAENgIIIAQgAjYCDAwBCyADKAIYIQcCQAJAIAMoAgwiBiADRg0AIAMoAggiAkEAKAKY0ICAAEkaIAYgAjYCCCACIAY2AgwMAQsCQCADQRRqIgIoAgAiBA0AIANBEGoiAigCACIEDQBBACEGDAELA0AgAiEFIAQiBkEUaiICKAIAIgQNACAGQRBqIQIgBigCECIEDQALIAVBADYCAAsgB0UNAAJAAkAgAyADKAIcIgRBAnRBuNKAgABqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoAozQgIAAQX4gBHdxNgKM0ICAAAwCCyAHQRBBFCAHKAIQIANGG2ogBjYCACAGRQ0BCyAGIAc2AhgCQCADKAIQIgJFDQAgBiACNgIQIAIgBjYCGAsgAygCFCICRQ0AIAZBFGogAjYCACACIAY2AhgLIAEgAGogADYCACABIABBAXI2AgQgAUEAKAKc0ICAAEcNAUEAIAA2ApDQgIAADwsgAyACQX5xNgIEIAEgAGogADYCACABIABBAXI2AgQLAkAgAEH/AUsNACAAQXhxQbDQgIAAaiECAkACQEEAKAKI0ICAACIEQQEgAEEDdnQiAHENAEEAIAQgAHI2AojQgIAAIAIhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3AxggASAGNwMQIAEgBjcDCCABIAY3AwAgAUEgaiEBIAJBYGoiAkEfSw0ACwsgAAsLjkgBAEGACAuGSAEAAAACAAAAAwAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAYAAAAHAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=="},18994:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.enumToMap=void 0;function enumToMap(r){const i={};Object.keys(r).forEach((a=>{const s=r[a];if(typeof s==="number"){i[a]=s}}));return i}i.enumToMap=enumToMap},51441:(r,i,a)=>{"use strict";const{kClients:s}=a(31915);const l=a(72916);const{kAgent:c,kMockAgentSet:p,kMockAgentGet:d,kDispatches:u,kIsMockActive:A,kNetConnect:h,kGetNetConnect:g,kOptions:y,kFactory:E}=a(46932);const b=a(16518);const C=a(15196);const{matchValue:v,buildMockOptions:B}=a(67078);const{InvalidArgumentError:I,UndiciError:w}=a(76291);const S=a(78824);const Q=a(14381);const x=a(7796);class FakeWeakRef{constructor(r){this.value=r}deref(){return this.value}}class MockAgent extends S{constructor(r){super(r);this[h]=true;this[A]=true;if(r&&r.agent&&typeof r.agent.dispatch!=="function"){throw new I("Argument opts.agent must implement Agent")}const i=r&&r.agent?r.agent:new l(r);this[c]=i;this[s]=i[s];this[y]=B(r)}get(r){let i=this[d](r);if(!i){i=this[E](r);this[p](r,i)}return i}dispatch(r,i){this.get(r.origin);return this[c].dispatch(r,i)}async close(){await this[c].close();this[s].clear()}deactivate(){this[A]=false}activate(){this[A]=true}enableNetConnect(r){if(typeof r==="string"||typeof r==="function"||r instanceof RegExp){if(Array.isArray(this[h])){this[h].push(r)}else{this[h]=[r]}}else if(typeof r==="undefined"){this[h]=true}else{throw new I("Unsupported matcher. Must be one of String|Function|RegExp.")}}disableNetConnect(){this[h]=false}get isMockActive(){return this[A]}[p](r,i){this[s].set(r,new FakeWeakRef(i))}[E](r){const i=Object.assign({agent:this},this[y]);return this[y]&&this[y].connections===1?new b(r,i):new C(r,i)}[d](r){const i=this[s].get(r);if(i){return i.deref()}if(typeof r!=="string"){const i=this[E]("http://localhost:9999");this[p](r,i);return i}for(const[i,a]of Array.from(this[s])){const s=a.deref();if(s&&typeof i!=="string"&&v(i,r)){const i=this[E](r);this[p](r,i);i[u]=s[u];return i}}}[g](){return this[h]}pendingInterceptors(){const r=this[s];return Array.from(r.entries()).flatMap((([r,i])=>i.deref()[u].map((i=>({...i,origin:r}))))).filter((({pending:r})=>r))}assertNoPendingInterceptors({pendingInterceptorsFormatter:r=new x}={}){const i=this.pendingInterceptors();if(i.length===0){return}const a=new Q("interceptor","interceptors").pluralize(i.length);throw new w(`\n${a.count} ${a.noun} ${a.is} pending:\n\n${r.format(i)}\n`.trim())}}r.exports=MockAgent},16518:(r,i,a)=>{"use strict";const{promisify:s}=a(73837);const l=a(55179);const{buildMockDispatch:c}=a(67078);const{kDispatches:p,kMockAgent:d,kClose:u,kOriginalClose:A,kOrigin:h,kOriginalDispatch:g,kConnected:y}=a(46932);const{MockInterceptor:E}=a(79349);const b=a(31915);const{InvalidArgumentError:C}=a(76291);class MockClient extends l{constructor(r,i){super(r,i);if(!i||!i.agent||typeof i.agent.dispatch!=="function"){throw new C("Argument opts.agent must implement Agent")}this[d]=i.agent;this[h]=r;this[p]=[];this[y]=1;this[g]=this.dispatch;this[A]=this.close.bind(this);this.dispatch=c.call(this);this.close=this[u]}get[b.kConnected](){return this[y]}intercept(r){return new E(r,this[p])}async[u](){await s(this[A])();this[y]=0;this[d][b.kClients].delete(this[h])}}r.exports=MockClient},11025:(r,i,a)=>{"use strict";const{UndiciError:s}=a(76291);class MockNotMatchedError extends s{constructor(r){super(r);Error.captureStackTrace(this,MockNotMatchedError);this.name="MockNotMatchedError";this.message=r||"The request does not match any registered mock dispatches";this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}}r.exports={MockNotMatchedError:MockNotMatchedError}},79349:(r,i,a)=>{"use strict";const{getResponseData:s,buildKey:l,addMockDispatch:c}=a(67078);const{kDispatches:p,kDispatchKey:d,kDefaultHeaders:u,kDefaultTrailers:A,kContentLength:h,kMockDispatch:g}=a(46932);const{InvalidArgumentError:y}=a(76291);const{buildURL:E}=a(94766);class MockScope{constructor(r){this[g]=r}delay(r){if(typeof r!=="number"||!Number.isInteger(r)||r<=0){throw new y("waitInMs must be a valid integer > 0")}this[g].delay=r;return this}persist(){this[g].persist=true;return this}times(r){if(typeof r!=="number"||!Number.isInteger(r)||r<=0){throw new y("repeatTimes must be a valid integer > 0")}this[g].times=r;return this}}class MockInterceptor{constructor(r,i){if(typeof r!=="object"){throw new y("opts must be an object")}if(typeof r.path==="undefined"){throw new y("opts.path must be defined")}if(typeof r.method==="undefined"){r.method="GET"}if(typeof r.path==="string"){if(r.query){r.path=E(r.path,r.query)}else{const i=new URL(r.path,"data://");r.path=i.pathname+i.search}}if(typeof r.method==="string"){r.method=r.method.toUpperCase()}this[d]=l(r);this[p]=i;this[u]={};this[A]={};this[h]=false}createMockScopeDispatchData(r,i,a={}){const l=s(i);const c=this[h]?{"content-length":l.length}:{};const p={...this[u],...c,...a.headers};const d={...this[A],...a.trailers};return{statusCode:r,data:i,headers:p,trailers:d}}validateReplyParameters(r,i,a){if(typeof r==="undefined"){throw new y("statusCode must be defined")}if(typeof i==="undefined"){throw new y("data must be defined")}if(typeof a!=="object"){throw new y("responseOptions must be an object")}}reply(r){if(typeof r==="function"){const wrappedDefaultsCallback=i=>{const a=r(i);if(typeof a!=="object"){throw new y("reply options callback must return an object")}const{statusCode:s,data:l="",responseOptions:c={}}=a;this.validateReplyParameters(s,l,c);return{...this.createMockScopeDispatchData(s,l,c)}};const i=c(this[p],this[d],wrappedDefaultsCallback);return new MockScope(i)}const[i,a="",s={}]=[...arguments];this.validateReplyParameters(i,a,s);const l=this.createMockScopeDispatchData(i,a,s);const u=c(this[p],this[d],l);return new MockScope(u)}replyWithError(r){if(typeof r==="undefined"){throw new y("error must be defined")}const i=c(this[p],this[d],{error:r});return new MockScope(i)}defaultReplyHeaders(r){if(typeof r==="undefined"){throw new y("headers must be defined")}this[u]=r;return this}defaultReplyTrailers(r){if(typeof r==="undefined"){throw new y("trailers must be defined")}this[A]=r;return this}replyContentLength(){this[h]=true;return this}}r.exports.MockInterceptor=MockInterceptor;r.exports.MockScope=MockScope},15196:(r,i,a)=>{"use strict";const{promisify:s}=a(73837);const l=a(94427);const{buildMockDispatch:c}=a(67078);const{kDispatches:p,kMockAgent:d,kClose:u,kOriginalClose:A,kOrigin:h,kOriginalDispatch:g,kConnected:y}=a(46932);const{MockInterceptor:E}=a(79349);const b=a(31915);const{InvalidArgumentError:C}=a(76291);class MockPool extends l{constructor(r,i){super(r,i);if(!i||!i.agent||typeof i.agent.dispatch!=="function"){throw new C("Argument opts.agent must implement Agent")}this[d]=i.agent;this[h]=r;this[p]=[];this[y]=1;this[g]=this.dispatch;this[A]=this.close.bind(this);this.dispatch=c.call(this);this.close=this[u]}get[b.kConnected](){return this[y]}intercept(r){return new E(r,this[p])}async[u](){await s(this[A])();this[y]=0;this[d][b.kClients].delete(this[h])}}r.exports=MockPool},46932:r=>{"use strict";r.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}},67078:(r,i,a)=>{"use strict";const{MockNotMatchedError:s}=a(11025);const{kDispatches:l,kMockAgent:c,kOriginalDispatch:p,kOrigin:d,kGetNetConnect:u}=a(46932);const{buildURL:A,nop:h}=a(94766);const{STATUS_CODES:g}=a(13685);const{types:{isPromise:y}}=a(73837);function matchValue(r,i){if(typeof r==="string"){return r===i}if(r instanceof RegExp){return r.test(i)}if(typeof r==="function"){return r(i)===true}return false}function lowerCaseEntries(r){return Object.fromEntries(Object.entries(r).map((([r,i])=>[r.toLocaleLowerCase(),i])))}function getHeaderByName(r,i){if(Array.isArray(r)){for(let a=0;a!r)).filter((({path:r})=>matchValue(safeUrl(r),l)));if(c.length===0){throw new s(`Mock dispatch not matched for path '${l}'`)}c=c.filter((({method:r})=>matchValue(r,i.method)));if(c.length===0){throw new s(`Mock dispatch not matched for method '${i.method}'`)}c=c.filter((({body:r})=>typeof r!=="undefined"?matchValue(r,i.body):true));if(c.length===0){throw new s(`Mock dispatch not matched for body '${i.body}'`)}c=c.filter((r=>matchHeaders(r,i.headers)));if(c.length===0){throw new s(`Mock dispatch not matched for headers '${typeof i.headers==="object"?JSON.stringify(i.headers):i.headers}'`)}return c[0]}function addMockDispatch(r,i,a){const s={timesInvoked:0,times:1,persist:false,consumed:false};const l=typeof a==="function"?{callback:a}:{...a};const c={...s,...i,pending:true,data:{error:null,...l}};r.push(c);return c}function deleteMockDispatch(r,i){const a=r.findIndex((r=>{if(!r.consumed){return false}return matchKey(r,i)}));if(a!==-1){r.splice(a,1)}}function buildKey(r){const{path:i,method:a,body:s,headers:l,query:c}=r;return{path:i,method:a,body:s,headers:l,query:c}}function generateKeyValues(r){return Object.entries(r).reduce(((r,[i,a])=>[...r,Buffer.from(`${i}`),Array.isArray(a)?a.map((r=>Buffer.from(`${r}`))):Buffer.from(`${a}`)]),[])}function getStatusText(r){return g[r]||"unknown"}async function getResponse(r){const i=[];for await(const a of r){i.push(a)}return Buffer.concat(i).toString("utf8")}function mockDispatch(r,i){const a=buildKey(r);const s=getMockDispatch(this[l],a);s.timesInvoked++;if(s.data.callback){s.data={...s.data,...s.data.callback(r)}}const{data:{statusCode:c,data:p,headers:d,trailers:u,error:A},delay:g,persist:E}=s;const{timesInvoked:b,times:C}=s;s.consumed=!E&&b>=C;s.pending=b0){setTimeout((()=>{handleReply(this[l])}),g)}else{handleReply(this[l])}function handleReply(s,l=p){const A=Array.isArray(r.headers)?buildHeadersFromArray(r.headers):r.headers;const g=typeof l==="function"?l({...r,headers:A}):l;if(y(g)){g.then((r=>handleReply(s,r)));return}const E=getResponseData(g);const b=generateKeyValues(d);const C=generateKeyValues(u);i.abort=h;i.onHeaders(c,b,resume,getStatusText(c));i.onData(Buffer.from(E));i.onComplete(C);deleteMockDispatch(s,a)}function resume(){}return true}function buildMockDispatch(){const r=this[c];const i=this[d];const a=this[p];return function dispatch(l,c){if(r.isMockActive){try{mockDispatch.call(this,l,c)}catch(p){if(p instanceof s){const d=r[u]();if(d===false){throw new s(`${p.message}: subsequent request to origin ${i} was not allowed (net.connect disabled)`)}if(checkNetConnect(d,i)){a.call(this,l,c)}else{throw new s(`${p.message}: subsequent request to origin ${i} was not allowed (net.connect is not enabled for this origin)`)}}else{throw p}}}else{a.call(this,l,c)}}}function checkNetConnect(r,i){const a=new URL(i);if(r===true){return true}else if(Array.isArray(r)&&r.some((r=>matchValue(r,a.host)))){return true}return false}function buildMockOptions(r){if(r){const{agent:i,...a}=r;return a}}r.exports={getResponseData:getResponseData,getMockDispatch:getMockDispatch,addMockDispatch:addMockDispatch,deleteMockDispatch:deleteMockDispatch,buildKey:buildKey,generateKeyValues:generateKeyValues,matchValue:matchValue,getResponse:getResponse,getStatusText:getStatusText,mockDispatch:mockDispatch,buildMockDispatch:buildMockDispatch,checkNetConnect:checkNetConnect,buildMockOptions:buildMockOptions,getHeaderByName:getHeaderByName}},7796:(r,i,a)=>{"use strict";const{Transform:s}=a(12781);const{Console:l}=a(96206);r.exports=class PendingInterceptorsFormatter{constructor({disableColors:r}={}){this.transform=new s({transform(r,i,a){a(null,r)}});this.logger=new l({stdout:this.transform,inspectOptions:{colors:!r&&!process.env.CI}})}format(r){const i=r.map((({method:r,path:i,data:{statusCode:a},persist:s,times:l,timesInvoked:c,origin:p})=>({Method:r,Origin:p,Path:i,"Status code":a,Persistent:s?"✅":"❌",Invocations:c,Remaining:s?Infinity:l-c})));this.logger.table(i);return this.transform.read().toString()}}},14381:r=>{"use strict";const i={pronoun:"it",is:"is",was:"was",this:"this"};const a={pronoun:"they",is:"are",was:"were",this:"these"};r.exports=class Pluralizer{constructor(r,i){this.singular=r;this.plural=i}pluralize(r){const s=r===1;const l=s?i:a;const c=s?this.singular:this.plural;return{...l,count:r,noun:c}}}},99520:r=>{"use strict";const i=2048;const a=i-1;class FixedCircularBuffer{constructor(){this.bottom=0;this.top=0;this.list=new Array(i);this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&a)===this.bottom}push(r){this.list[this.top]=r;this.top=this.top+1&a}shift(){const r=this.list[this.bottom];if(r===undefined)return null;this.list[this.bottom]=undefined;this.bottom=this.bottom+1&a;return r}}r.exports=class FixedQueue{constructor(){this.head=this.tail=new FixedCircularBuffer}isEmpty(){return this.head.isEmpty()}push(r){if(this.head.isFull()){this.head=this.head.next=new FixedCircularBuffer}this.head.push(r)}shift(){const r=this.tail;const i=r.shift();if(r.isEmpty()&&r.next!==null){this.tail=r.next}return i}}},52673:(r,i,a)=>{"use strict";const s=a(36228);const l=a(99520);const{kConnected:c,kSize:p,kRunning:d,kPending:u,kQueued:A,kBusy:h,kFree:g,kUrl:y,kClose:E,kDestroy:b,kDispatch:C}=a(31915);const v=a(31488);const B=Symbol("clients");const I=Symbol("needDrain");const w=Symbol("queue");const S=Symbol("closed resolve");const Q=Symbol("onDrain");const x=Symbol("onConnect");const N=Symbol("onDisconnect");const R=Symbol("onConnectionError");const T=Symbol("get dispatcher");const D=Symbol("add client");const k=Symbol("remove client");const _=Symbol("stats");class PoolBase extends s{constructor(){super();this[w]=new l;this[B]=[];this[A]=0;const r=this;this[Q]=function onDrain(i,a){const s=r[w];let l=false;while(!l){const i=s.shift();if(!i){break}r[A]--;l=!this.dispatch(i.opts,i.handler)}this[I]=l;if(!this[I]&&r[I]){r[I]=false;r.emit("drain",i,[r,...a])}if(r[S]&&s.isEmpty()){Promise.all(r[B].map((r=>r.close()))).then(r[S])}};this[x]=(i,a)=>{r.emit("connect",i,[r,...a])};this[N]=(i,a,s)=>{r.emit("disconnect",i,[r,...a],s)};this[R]=(i,a,s)=>{r.emit("connectionError",i,[r,...a],s)};this[_]=new v(this)}get[h](){return this[I]}get[c](){return this[B].filter((r=>r[c])).length}get[g](){return this[B].filter((r=>r[c]&&!r[I])).length}get[u](){let r=this[A];for(const{[u]:i}of this[B]){r+=i}return r}get[d](){let r=0;for(const{[d]:i}of this[B]){r+=i}return r}get[p](){let r=this[A];for(const{[p]:i}of this[B]){r+=i}return r}get stats(){return this[_]}async[E](){if(this[w].isEmpty()){return Promise.all(this[B].map((r=>r.close())))}else{return new Promise((r=>{this[S]=r}))}}async[b](r){while(true){const i=this[w].shift();if(!i){break}i.handler.onError(r)}return Promise.all(this[B].map((i=>i.destroy(r))))}[C](r,i){const a=this[T]();if(!a){this[I]=true;this[w].push({opts:r,handler:i});this[A]++}else if(!a.dispatch(r,i)){a[I]=true;this[I]=!this[T]()}return!this[I]}[D](r){r.on("drain",this[Q]).on("connect",this[x]).on("disconnect",this[N]).on("connectionError",this[R]);this[B].push(r);if(this[I]){process.nextTick((()=>{if(this[I]){this[Q](r[y],[this,r])}}))}return this}[k](r){r.close((()=>{const i=this[B].indexOf(r);if(i!==-1){this[B].splice(i,1)}}));this[I]=this[B].some((r=>!r[I]&&r.closed!==true&&r.destroyed!==true))}}r.exports={PoolBase:PoolBase,kClients:B,kNeedDrain:I,kAddClient:D,kRemoveClient:k,kGetDispatcher:T}},31488:(r,i,a)=>{const{kFree:s,kConnected:l,kPending:c,kQueued:p,kRunning:d,kSize:u}=a(31915);const A=Symbol("pool");class PoolStats{constructor(r){this[A]=r}get connected(){return this[A][l]}get free(){return this[A][s]}get pending(){return this[A][c]}get queued(){return this[A][p]}get running(){return this[A][d]}get size(){return this[A][u]}}r.exports=PoolStats},94427:(r,i,a)=>{"use strict";const{PoolBase:s,kClients:l,kNeedDrain:c,kAddClient:p,kGetDispatcher:d}=a(52673);const u=a(55179);const{InvalidArgumentError:A}=a(76291);const h=a(94766);const{kUrl:g,kInterceptors:y}=a(31915);const E=a(98742);const b=Symbol("options");const C=Symbol("connections");const v=Symbol("factory");function defaultFactory(r,i){return new u(r,i)}class Pool extends s{constructor(r,{connections:i,factory:a=defaultFactory,connect:s,connectTimeout:l,tls:c,maxCachedSessions:p,socketPath:d,autoSelectFamily:u,autoSelectFamilyAttemptTimeout:B,allowH2:I,...w}={}){super();if(i!=null&&(!Number.isFinite(i)||i<0)){throw new A("invalid connections")}if(typeof a!=="function"){throw new A("factory must be a function.")}if(s!=null&&typeof s!=="function"&&typeof s!=="object"){throw new A("connect must be a function or an object")}if(typeof s!=="function"){s=E({...c,maxCachedSessions:p,allowH2:I,socketPath:d,timeout:l,...h.nodeHasAutoSelectFamily&&u?{autoSelectFamily:u,autoSelectFamilyAttemptTimeout:B}:undefined,...s})}this[y]=w.interceptors&&w.interceptors.Pool&&Array.isArray(w.interceptors.Pool)?w.interceptors.Pool:[];this[C]=i||null;this[g]=h.parseOrigin(r);this[b]={...h.deepClone(w),connect:s,allowH2:I};this[b].interceptors=w.interceptors?{...w.interceptors}:undefined;this[v]=a}[d](){let r=this[l].find((r=>!r[c]));if(r){return r}if(!this[C]||this[l].length{"use strict";const{kProxy:s,kClose:l,kDestroy:c,kInterceptors:p}=a(31915);const{URL:d}=a(57310);const u=a(72916);const A=a(94427);const h=a(36228);const{InvalidArgumentError:g,RequestAbortedError:y}=a(76291);const E=a(98742);const b=Symbol("proxy agent");const C=Symbol("proxy client");const v=Symbol("proxy headers");const B=Symbol("request tls settings");const I=Symbol("proxy tls settings");const w=Symbol("connect endpoint function");function defaultProtocolPort(r){return r==="https:"?443:80}function buildProxyOptions(r){if(typeof r==="string"){r={uri:r}}if(!r||!r.uri){throw new g("Proxy opts.uri is mandatory")}return{uri:r.uri,protocol:r.protocol||"https"}}function defaultFactory(r,i){return new A(r,i)}class ProxyAgent extends h{constructor(r){super(r);this[s]=buildProxyOptions(r);this[b]=new u(r);this[p]=r.interceptors&&r.interceptors.ProxyAgent&&Array.isArray(r.interceptors.ProxyAgent)?r.interceptors.ProxyAgent:[];if(typeof r==="string"){r={uri:r}}if(!r||!r.uri){throw new g("Proxy opts.uri is mandatory")}const{clientFactory:i=defaultFactory}=r;if(typeof i!=="function"){throw new g("Proxy opts.clientFactory must be a function.")}this[B]=r.requestTls;this[I]=r.proxyTls;this[v]=r.headers||{};const a=new d(r.uri);const{origin:l,port:c,host:A,username:h,password:S}=a;if(r.auth&&r.token){throw new g("opts.auth cannot be used in combination with opts.token")}else if(r.auth){this[v]["proxy-authorization"]=`Basic ${r.auth}`}else if(r.token){this[v]["proxy-authorization"]=r.token}else if(h&&S){this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(h)}:${decodeURIComponent(S)}`).toString("base64")}`}const Q=E({...r.proxyTls});this[w]=E({...r.requestTls});this[C]=i(a,{connect:Q});this[b]=new u({...r,connect:async(r,i)=>{let a=r.host;if(!r.port){a+=`:${defaultProtocolPort(r.protocol)}`}try{const{socket:s,statusCode:p}=await this[C].connect({origin:l,port:c,path:a,signal:r.signal,headers:{...this[v],host:A}});if(p!==200){s.on("error",(()=>{})).destroy();i(new y(`Proxy response (${p}) !== 200 when HTTP Tunneling`))}if(r.protocol!=="https:"){i(null,s);return}let d;if(this[B]){d=this[B].servername}else{d=r.servername}this[w]({...r,servername:d,httpSocket:s},i)}catch(r){i(r)}}})}dispatch(r,i){const{host:a}=new d(r.origin);const s=buildHeaders(r.headers);throwIfProxyAuthIsSent(s);return this[b].dispatch({...r,headers:{...s,host:a}},i)}async[l](){await this[b].close();await this[C].close()}async[c](){await this[b].destroy();await this[C].destroy()}}function buildHeaders(r){if(Array.isArray(r)){const i={};for(let a=0;ar.toLowerCase()==="proxy-authorization"));if(i){throw new g("Proxy-Authorization should be sent in ProxyAgent constructor")}}r.exports=ProxyAgent},90683:r=>{"use strict";let i=Date.now();let a;const s=[];function onTimeout(){i=Date.now();let r=s.length;let a=0;while(a0&&i>=l.state){l.state=-1;l.callback(l.opaque)}if(l.state===-1){l.state=-2;if(a!==r-1){s[a]=s.pop()}else{s.pop()}r-=1}else{a+=1}}if(s.length>0){refreshTimeout()}}function refreshTimeout(){if(a&&a.refresh){a.refresh()}else{clearTimeout(a);a=setTimeout(onTimeout,1e3);if(a.unref){a.unref()}}}class Timeout{constructor(r,i,a){this.callback=r;this.delay=i;this.opaque=a;this.state=-2;this.refresh()}refresh(){if(this.state===-2){s.push(this);if(!a||s.length===1){refreshTimeout()}}this.state=0}clear(){this.state=-1}}r.exports={setTimeout(r,i,a){return i<1e3?setTimeout(r,i,a):new Timeout(r,i,a)},clearTimeout(r){if(r instanceof Timeout){r.clear()}else{clearTimeout(r)}}}},81231:(r,i,a)=>{"use strict";const s=a(67643);const{uid:l,states:c}=a(30514);const{kReadyState:p,kSentClose:d,kByteParser:u,kReceivedClose:A}=a(88651);const{fireEvent:h,failWebsocketConnection:g}=a(4593);const{CloseEvent:y}=a(279);const{makeRequest:E}=a(11287);const{fetching:b}=a(79890);const{Headers:C}=a(8247);const{getGlobalDispatcher:v}=a(18826);const{kHeadersList:B}=a(31915);const I={};I.open=s.channel("undici:websocket:open");I.close=s.channel("undici:websocket:close");I.socketError=s.channel("undici:websocket:socket_error");let w;try{w=a(6113)}catch{}function establishWebSocketConnection(r,i,a,s,c){const p=r;p.protocol=r.protocol==="ws:"?"http:":"https:";const d=E({urlList:[p],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(c.headers){const r=new C(c.headers)[B];d.headersList=r}const u=w.randomBytes(16).toString("base64");d.headersList.append("sec-websocket-key",u);d.headersList.append("sec-websocket-version","13");for(const r of i){d.headersList.append("sec-websocket-protocol",r)}const A="";const h=b({request:d,useParallelQueue:true,dispatcher:c.dispatcher??v(),processResponse(r){if(r.type==="error"||r.status!==101){g(a,"Received network error or non-101 status code.");return}if(i.length!==0&&!r.headersList.get("Sec-WebSocket-Protocol")){g(a,"Server did not respond with sent protocols.");return}if(r.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){g(a,'Server did not set Upgrade header to "websocket".');return}if(r.headersList.get("Connection")?.toLowerCase()!=="upgrade"){g(a,'Server did not set Connection header to "upgrade".');return}const c=r.headersList.get("Sec-WebSocket-Accept");const p=w.createHash("sha1").update(u+l).digest("base64");if(c!==p){g(a,"Incorrect hash received in Sec-WebSocket-Accept header.");return}const h=r.headersList.get("Sec-WebSocket-Extensions");if(h!==null&&h!==A){g(a,"Received different permessage-deflate than the one set.");return}const y=r.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&y!==d.headersList.get("Sec-WebSocket-Protocol")){g(a,"Protocol was not set in the opening handshake.");return}r.socket.on("data",onSocketData);r.socket.on("close",onSocketClose);r.socket.on("error",onSocketError);if(I.open.hasSubscribers){I.open.publish({address:r.socket.address(),protocol:y,extensions:h})}s(r)}});return h}function onSocketData(r){if(!this.ws[u].write(r)){this.pause()}}function onSocketClose(){const{ws:r}=this;const i=r[d]&&r[A];let a=1005;let s="";const l=r[u].closingInfo;if(l){a=l.code??1005;s=l.reason}else if(!r[d]){a=1006}r[p]=c.CLOSED;h("close",r,y,{wasClean:i,code:a,reason:s});if(I.close.hasSubscribers){I.close.publish({websocket:r,code:a,reason:s})}}function onSocketError(r){const{ws:i}=this;i[p]=c.CLOSING;if(I.socketError.hasSubscribers){I.socketError.publish(r)}this.destroy()}r.exports={establishWebSocketConnection:establishWebSocketConnection}},30514:r=>{"use strict";const i="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";const a={enumerable:true,writable:false,configurable:false};const s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3};const l={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10};const c=2**16-1;const p={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4};const d=Buffer.allocUnsafe(0);r.exports={uid:i,staticPropertyDescriptors:a,states:s,opcodes:l,maxUnsigned16Bit:c,parserStates:p,emptyBuffer:d}},279:(r,i,a)=>{"use strict";const{webidl:s}=a(87591);const{kEnumerableProperty:l}=a(94766);const{MessagePort:c}=a(71267);class MessageEvent extends Event{#a;constructor(r,i={}){s.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"});r=s.converters.DOMString(r);i=s.converters.MessageEventInit(i);super(r,i);this.#a=i}get data(){s.brandCheck(this,MessageEvent);return this.#a.data}get origin(){s.brandCheck(this,MessageEvent);return this.#a.origin}get lastEventId(){s.brandCheck(this,MessageEvent);return this.#a.lastEventId}get source(){s.brandCheck(this,MessageEvent);return this.#a.source}get ports(){s.brandCheck(this,MessageEvent);if(!Object.isFrozen(this.#a.ports)){Object.freeze(this.#a.ports)}return this.#a.ports}initMessageEvent(r,i=false,a=false,l=null,c="",p="",d=null,u=[]){s.brandCheck(this,MessageEvent);s.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"});return new MessageEvent(r,{bubbles:i,cancelable:a,data:l,origin:c,lastEventId:p,source:d,ports:u})}}class CloseEvent extends Event{#a;constructor(r,i={}){s.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"});r=s.converters.DOMString(r);i=s.converters.CloseEventInit(i);super(r,i);this.#a=i}get wasClean(){s.brandCheck(this,CloseEvent);return this.#a.wasClean}get code(){s.brandCheck(this,CloseEvent);return this.#a.code}get reason(){s.brandCheck(this,CloseEvent);return this.#a.reason}}class ErrorEvent extends Event{#a;constructor(r,i){s.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"});super(r,i);r=s.converters.DOMString(r);i=s.converters.ErrorEventInit(i??{});this.#a=i}get message(){s.brandCheck(this,ErrorEvent);return this.#a.message}get filename(){s.brandCheck(this,ErrorEvent);return this.#a.filename}get lineno(){s.brandCheck(this,ErrorEvent);return this.#a.lineno}get colno(){s.brandCheck(this,ErrorEvent);return this.#a.colno}get error(){s.brandCheck(this,ErrorEvent);return this.#a.error}}Object.defineProperties(MessageEvent.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:true},data:l,origin:l,lastEventId:l,source:l,ports:l,initMessageEvent:l});Object.defineProperties(CloseEvent.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:true},reason:l,code:l,wasClean:l});Object.defineProperties(ErrorEvent.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:true},message:l,filename:l,lineno:l,colno:l,error:l});s.converters.MessagePort=s.interfaceConverter(c);s.converters["sequence"]=s.sequenceConverter(s.converters.MessagePort);const p=[{key:"bubbles",converter:s.converters.boolean,defaultValue:false},{key:"cancelable",converter:s.converters.boolean,defaultValue:false},{key:"composed",converter:s.converters.boolean,defaultValue:false}];s.converters.MessageEventInit=s.dictionaryConverter([...p,{key:"data",converter:s.converters.any,defaultValue:null},{key:"origin",converter:s.converters.USVString,defaultValue:""},{key:"lastEventId",converter:s.converters.DOMString,defaultValue:""},{key:"source",converter:s.nullableConverter(s.converters.MessagePort),defaultValue:null},{key:"ports",converter:s.converters["sequence"],get defaultValue(){return[]}}]);s.converters.CloseEventInit=s.dictionaryConverter([...p,{key:"wasClean",converter:s.converters.boolean,defaultValue:false},{key:"code",converter:s.converters["unsigned short"],defaultValue:0},{key:"reason",converter:s.converters.USVString,defaultValue:""}]);s.converters.ErrorEventInit=s.dictionaryConverter([...p,{key:"message",converter:s.converters.DOMString,defaultValue:""},{key:"filename",converter:s.converters.USVString,defaultValue:""},{key:"lineno",converter:s.converters["unsigned long"],defaultValue:0},{key:"colno",converter:s.converters["unsigned long"],defaultValue:0},{key:"error",converter:s.converters.any}]);r.exports={MessageEvent:MessageEvent,CloseEvent:CloseEvent,ErrorEvent:ErrorEvent}},27022:(r,i,a)=>{"use strict";const{maxUnsigned16Bit:s}=a(30514);let l;try{l=a(6113)}catch{}class WebsocketFrameSend{constructor(r){this.frameData=r;this.maskKey=l.randomBytes(4)}createFrame(r){const i=this.frameData?.byteLength??0;let a=i;let l=6;if(i>s){l+=8;a=127}else if(i>125){l+=2;a=126}const c=Buffer.allocUnsafe(i+l);c[0]=c[1]=0;c[0]|=128;c[0]=(c[0]&240)+r; -/*! ws. MIT License. Einar Otto Stangvik */c[l-4]=this.maskKey[0];c[l-3]=this.maskKey[1];c[l-2]=this.maskKey[2];c[l-1]=this.maskKey[3];c[1]=a;if(a===126){c.writeUInt16BE(i,2)}else if(a===127){c[2]=c[3]=0;c.writeUIntBE(i,4,6)}c[1]|=128;for(let r=0;r{"use strict";const{Writable:s}=a(12781);const l=a(67643);const{parserStates:c,opcodes:p,states:d,emptyBuffer:u}=a(30514);const{kReadyState:A,kSentClose:h,kResponse:g,kReceivedClose:y}=a(88651);const{isValidStatusCode:E,failWebsocketConnection:b,websocketMessageReceived:C}=a(4593);const{WebsocketFrameSend:v}=a(27022);const B={};B.ping=l.channel("undici:websocket:ping");B.pong=l.channel("undici:websocket:pong");class ByteParser extends s{#s=[];#o=0;#l=c.INFO;#c={};#p=[];constructor(r){super();this.ws=r}_write(r,i,a){this.#s.push(r);this.#o+=r.length;this.run(a)}run(r){while(true){if(this.#l===c.INFO){if(this.#o<2){return r()}const i=this.consume(2);this.#c.fin=(i[0]&128)!==0;this.#c.opcode=i[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==p.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==p.BINARY&&this.#c.opcode!==p.TEXT){b(this.ws,"Invalid frame type was fragmented.");return}const a=i[1]&127;if(a<=125){this.#c.payloadLength=a;this.#l=c.READ_DATA}else if(a===126){this.#l=c.PAYLOADLENGTH_16}else if(a===127){this.#l=c.PAYLOADLENGTH_64}if(this.#c.fragmented&&a>125){b(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===p.PING||this.#c.opcode===p.PONG||this.#c.opcode===p.CLOSE)&&a>125){b(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===p.CLOSE){if(a===1){b(this.ws,"Received close frame with a 1-byte body.");return}const r=this.consume(a);this.#c.closeInfo=this.parseCloseBody(false,r);if(!this.ws[h]){const r=Buffer.allocUnsafe(2);r.writeUInt16BE(this.#c.closeInfo.code,0);const i=new v(r);this.ws[g].socket.write(i.createFrame(p.CLOSE),(r=>{if(!r){this.ws[h]=true}}))}this.ws[A]=d.CLOSING;this.ws[y]=true;this.end();return}else if(this.#c.opcode===p.PING){const i=this.consume(a);if(!this.ws[y]){const r=new v(i);this.ws[g].socket.write(r.createFrame(p.PONG));if(B.ping.hasSubscribers){B.ping.publish({payload:i})}}this.#l=c.INFO;if(this.#o>0){continue}else{r();return}}else if(this.#c.opcode===p.PONG){const i=this.consume(a);if(B.pong.hasSubscribers){B.pong.publish({payload:i})}if(this.#o>0){continue}else{r();return}}}else if(this.#l===c.PAYLOADLENGTH_16){if(this.#o<2){return r()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#l=c.READ_DATA}else if(this.#l===c.PAYLOADLENGTH_64){if(this.#o<8){return r()}const i=this.consume(8);const a=i.readUInt32BE(0);if(a>2**31-1){b(this.ws,"Received payload length > 2^31 bytes.");return}const s=i.readUInt32BE(4);this.#c.payloadLength=(a<<8)+s;this.#l=c.READ_DATA}else if(this.#l===c.READ_DATA){if(this.#o=this.#c.payloadLength){const r=this.consume(this.#c.payloadLength);this.#p.push(r);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===p.CONTINUATION){const r=Buffer.concat(this.#p);C(this.ws,this.#c.originalOpcode,r);this.#c={};this.#p.length=0}this.#l=c.INFO}}if(this.#o>0){continue}else{r();break}}}consume(r){if(r>this.#o){return null}else if(r===0){return u}if(this.#s[0].length===r){this.#o-=this.#s[0].length;return this.#s.shift()}const i=Buffer.allocUnsafe(r);let a=0;while(a!==r){const s=this.#s[0];const{length:l}=s;if(l+a===r){i.set(this.#s.shift(),a);break}else if(l+a>r){i.set(s.subarray(0,r-a),a);this.#s[0]=s.subarray(r-a);break}else{i.set(this.#s.shift(),a);a+=s.length}}this.#o-=r;return i}parseCloseBody(r,i){let a;if(i.length>=2){a=i.readUInt16BE(0)}if(r){if(!E(a)){return null}return{code:a}}let s=i.subarray(2);if(s[0]===239&&s[1]===187&&s[2]===191){s=s.subarray(3)}if(a!==undefined&&!E(a)){return null}try{s=new TextDecoder("utf-8",{fatal:true}).decode(s)}catch{return null}return{code:a,reason:s}}get closingInfo(){return this.#c.closeInfo}}r.exports={ByteParser:ByteParser}},88651:r=>{"use strict";r.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},4593:(r,i,a)=>{"use strict";const{kReadyState:s,kController:l,kResponse:c,kBinaryType:p,kWebSocketURL:d}=a(88651);const{states:u,opcodes:A}=a(30514);const{MessageEvent:h,ErrorEvent:g}=a(279);function isEstablished(r){return r[s]===u.OPEN}function isClosing(r){return r[s]===u.CLOSING}function isClosed(r){return r[s]===u.CLOSED}function fireEvent(r,i,a=Event,s){const l=new a(r,s);i.dispatchEvent(l)}function websocketMessageReceived(r,i,a){if(r[s]!==u.OPEN){return}let l;if(i===A.TEXT){try{l=new TextDecoder("utf-8",{fatal:true}).decode(a)}catch{failWebsocketConnection(r,"Received invalid UTF-8 in text frame.");return}}else if(i===A.BINARY){if(r[p]==="blob"){l=new Blob([a])}else{l=new Uint8Array(a).buffer}}fireEvent("message",r,h,{origin:r[d].origin,data:l})}function isValidSubprotocol(r){if(r.length===0){return false}for(const i of r){const r=i.charCodeAt(0);if(r<33||r>126||i==="("||i===")"||i==="<"||i===">"||i==="@"||i===","||i===";"||i===":"||i==="\\"||i==='"'||i==="/"||i==="["||i==="]"||i==="?"||i==="="||i==="{"||i==="}"||r===32||r===9){return false}}return true}function isValidStatusCode(r){if(r>=1e3&&r<1015){return r!==1004&&r!==1005&&r!==1006}return r>=3e3&&r<=4999}function failWebsocketConnection(r,i){const{[l]:a,[c]:s}=r;a.abort();if(s?.socket&&!s.socket.destroyed){s.socket.destroy()}if(i){fireEvent("error",r,g,{error:new Error(i)})}}r.exports={isEstablished:isEstablished,isClosing:isClosing,isClosed:isClosed,fireEvent:fireEvent,isValidSubprotocol:isValidSubprotocol,isValidStatusCode:isValidStatusCode,failWebsocketConnection:failWebsocketConnection,websocketMessageReceived:websocketMessageReceived}},82439:(r,i,a)=>{"use strict";const{webidl:s}=a(87591);const{DOMException:l}=a(67296);const{URLSerializer:c}=a(80097);const{getGlobalOrigin:p}=a(46670);const{staticPropertyDescriptors:d,states:u,opcodes:A,emptyBuffer:h}=a(30514);const{kWebSocketURL:g,kReadyState:y,kController:E,kBinaryType:b,kResponse:C,kSentClose:v,kByteParser:B}=a(88651);const{isEstablished:I,isClosing:w,isValidSubprotocol:S,failWebsocketConnection:Q,fireEvent:x}=a(4593);const{establishWebSocketConnection:N}=a(81231);const{WebsocketFrameSend:R}=a(27022);const{ByteParser:T}=a(96147);const{kEnumerableProperty:D,isBlobLike:k}=a(94766);const{getGlobalDispatcher:_}=a(18826);const{types:O}=a(73837);let P=false;class WebSocket extends EventTarget{#d={open:null,error:null,close:null,message:null};#u=0;#A="";#m="";constructor(r,i=[]){super();s.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"});if(!P){P=true;process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"})}const a=s.converters["DOMString or sequence or WebSocketInit"](i);r=s.converters.USVString(r);i=a.protocols;const c=p();let d;try{d=new URL(r,c)}catch(r){throw new l(r,"SyntaxError")}if(d.protocol==="http:"){d.protocol="ws:"}else if(d.protocol==="https:"){d.protocol="wss:"}if(d.protocol!=="ws:"&&d.protocol!=="wss:"){throw new l(`Expected a ws: or wss: protocol, got ${d.protocol}`,"SyntaxError")}if(d.hash||d.href.endsWith("#")){throw new l("Got fragment","SyntaxError")}if(typeof i==="string"){i=[i]}if(i.length!==new Set(i.map((r=>r.toLowerCase()))).size){throw new l("Invalid Sec-WebSocket-Protocol value","SyntaxError")}if(i.length>0&&!i.every((r=>S(r)))){throw new l("Invalid Sec-WebSocket-Protocol value","SyntaxError")}this[g]=new URL(d.href);this[E]=N(d,i,this,(r=>this.#f(r)),a);this[y]=WebSocket.CONNECTING;this[b]="blob"}close(r=undefined,i=undefined){s.brandCheck(this,WebSocket);if(r!==undefined){r=s.converters["unsigned short"](r,{clamp:true})}if(i!==undefined){i=s.converters.USVString(i)}if(r!==undefined){if(r!==1e3&&(r<3e3||r>4999)){throw new l("invalid code","InvalidAccessError")}}let a=0;if(i!==undefined){a=Buffer.byteLength(i);if(a>123){throw new l(`Reason must be less than 123 bytes; received ${a}`,"SyntaxError")}}if(this[y]===WebSocket.CLOSING||this[y]===WebSocket.CLOSED){}else if(!I(this)){Q(this,"Connection was closed before it was established.");this[y]=WebSocket.CLOSING}else if(!w(this)){const s=new R;if(r!==undefined&&i===undefined){s.frameData=Buffer.allocUnsafe(2);s.frameData.writeUInt16BE(r,0)}else if(r!==undefined&&i!==undefined){s.frameData=Buffer.allocUnsafe(2+a);s.frameData.writeUInt16BE(r,0);s.frameData.write(i,2,"utf-8")}else{s.frameData=h}const l=this[C].socket;l.write(s.createFrame(A.CLOSE),(r=>{if(!r){this[v]=true}}));this[y]=u.CLOSING}else{this[y]=WebSocket.CLOSING}}send(r){s.brandCheck(this,WebSocket);s.argumentLengthCheck(arguments,1,{header:"WebSocket.send"});r=s.converters.WebSocketSendData(r);if(this[y]===WebSocket.CONNECTING){throw new l("Sent before connected.","InvalidStateError")}if(!I(this)||w(this)){return}const i=this[C].socket;if(typeof r==="string"){const a=Buffer.from(r);const s=new R(a);const l=s.createFrame(A.TEXT);this.#u+=a.byteLength;i.write(l,(()=>{this.#u-=a.byteLength}))}else if(O.isArrayBuffer(r)){const a=Buffer.from(r);const s=new R(a);const l=s.createFrame(A.BINARY);this.#u+=a.byteLength;i.write(l,(()=>{this.#u-=a.byteLength}))}else if(ArrayBuffer.isView(r)){const a=Buffer.from(r,r.byteOffset,r.byteLength);const s=new R(a);const l=s.createFrame(A.BINARY);this.#u+=a.byteLength;i.write(l,(()=>{this.#u-=a.byteLength}))}else if(k(r)){const a=new R;r.arrayBuffer().then((r=>{const s=Buffer.from(r);a.frameData=s;const l=a.createFrame(A.BINARY);this.#u+=s.byteLength;i.write(l,(()=>{this.#u-=s.byteLength}))}))}}get readyState(){s.brandCheck(this,WebSocket);return this[y]}get bufferedAmount(){s.brandCheck(this,WebSocket);return this.#u}get url(){s.brandCheck(this,WebSocket);return c(this[g])}get extensions(){s.brandCheck(this,WebSocket);return this.#m}get protocol(){s.brandCheck(this,WebSocket);return this.#A}get onopen(){s.brandCheck(this,WebSocket);return this.#d.open}set onopen(r){s.brandCheck(this,WebSocket);if(this.#d.open){this.removeEventListener("open",this.#d.open)}if(typeof r==="function"){this.#d.open=r;this.addEventListener("open",r)}else{this.#d.open=null}}get onerror(){s.brandCheck(this,WebSocket);return this.#d.error}set onerror(r){s.brandCheck(this,WebSocket);if(this.#d.error){this.removeEventListener("error",this.#d.error)}if(typeof r==="function"){this.#d.error=r;this.addEventListener("error",r)}else{this.#d.error=null}}get onclose(){s.brandCheck(this,WebSocket);return this.#d.close}set onclose(r){s.brandCheck(this,WebSocket);if(this.#d.close){this.removeEventListener("close",this.#d.close)}if(typeof r==="function"){this.#d.close=r;this.addEventListener("close",r)}else{this.#d.close=null}}get onmessage(){s.brandCheck(this,WebSocket);return this.#d.message}set onmessage(r){s.brandCheck(this,WebSocket);if(this.#d.message){this.removeEventListener("message",this.#d.message)}if(typeof r==="function"){this.#d.message=r;this.addEventListener("message",r)}else{this.#d.message=null}}get binaryType(){s.brandCheck(this,WebSocket);return this[b]}set binaryType(r){s.brandCheck(this,WebSocket);if(r!=="blob"&&r!=="arraybuffer"){this[b]="blob"}else{this[b]=r}}#f(r){this[C]=r;const i=new T(this);i.on("drain",(function onParserDrain(){this.ws[C].socket.resume()}));r.socket.ws=this;this[B]=i;this[y]=u.OPEN;const a=r.headersList.get("sec-websocket-extensions");if(a!==null){this.#m=a}const s=r.headersList.get("sec-websocket-protocol");if(s!==null){this.#A=s}x("open",this)}}WebSocket.CONNECTING=WebSocket.prototype.CONNECTING=u.CONNECTING;WebSocket.OPEN=WebSocket.prototype.OPEN=u.OPEN;WebSocket.CLOSING=WebSocket.prototype.CLOSING=u.CLOSING;WebSocket.CLOSED=WebSocket.prototype.CLOSED=u.CLOSED;Object.defineProperties(WebSocket.prototype,{CONNECTING:d,OPEN:d,CLOSING:d,CLOSED:d,url:D,readyState:D,bufferedAmount:D,onopen:D,onerror:D,onclose:D,close:D,onmessage:D,binaryType:D,send:D,extensions:D,protocol:D,[Symbol.toStringTag]:{value:"WebSocket",writable:false,enumerable:false,configurable:true}});Object.defineProperties(WebSocket,{CONNECTING:d,OPEN:d,CLOSING:d,CLOSED:d});s.converters["sequence"]=s.sequenceConverter(s.converters.DOMString);s.converters["DOMString or sequence"]=function(r){if(s.util.Type(r)==="Object"&&Symbol.iterator in r){return s.converters["sequence"](r)}return s.converters.DOMString(r)};s.converters.WebSocketInit=s.dictionaryConverter([{key:"protocols",converter:s.converters["DOMString or sequence"],get defaultValue(){return[]}},{key:"dispatcher",converter:r=>r,get defaultValue(){return _()}},{key:"headers",converter:s.nullableConverter(s.converters.HeadersInit)}]);s.converters["DOMString or sequence or WebSocketInit"]=function(r){if(s.util.Type(r)==="Object"&&!(Symbol.iterator in r)){return s.converters.WebSocketInit(r)}return{protocols:s.converters["DOMString or sequence"](r)}};s.converters.WebSocketSendData=function(r){if(s.util.Type(r)==="Object"){if(k(r)){return s.converters.Blob(r,{strict:false})}if(ArrayBuffer.isView(r)||O.isAnyArrayBuffer(r)){return s.converters.BufferSource(r)}}return s.converters.USVString(r)};r.exports={WebSocket:WebSocket}},85581:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&process.version!==undefined){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}i.getUserAgent=getUserAgent},12929:(r,i,a)=>{"use strict";var s=a(12781);var l=a(73837).inherits;function Entry(){if(!(this instanceof Entry)){return new Entry}s.PassThrough.call(this);this.path=null;this.type=null;this.isDirectory=false}l(Entry,s.PassThrough);Entry.prototype.autodrain=function(){return this.pipe(new s.Transform({transform:function(r,i,a){a()}}))};r.exports=Entry},50055:(r,i,a)=>{var s=a(57147);var l=a(71017);var c=a(73837);var p=a(81414);var d=a(12781).Transform;var u=a(73685);function Extract(r){if(!(this instanceof Extract))return new Extract(r);d.call(this);this.opts=r||{};this.unzipStream=new u(this.opts);this.unfinishedEntries=0;this.afterFlushWait=false;this.createdDirectories={};var i=this;this.unzipStream.on("entry",this._processEntry.bind(this));this.unzipStream.on("error",(function(r){i.emit("error",r)}))}c.inherits(Extract,d);Extract.prototype._transform=function(r,i,a){this.unzipStream.write(r,i,a)};Extract.prototype._flush=function(r){var i=this;var allDone=function(){process.nextTick((function(){i.emit("close")}));r()};this.unzipStream.end((function(){if(i.unfinishedEntries>0){i.afterFlushWait=true;return i.on("await-finished",allDone)}allDone()}))};Extract.prototype._processEntry=function(r){var i=this;var a=l.join(this.opts.path,r.path);var c=r.isDirectory?a:l.dirname(a);this.unfinishedEntries++;var writeFileFn=function(){var l=s.createWriteStream(a);l.on("close",(function(){i.unfinishedEntries--;i._notifyAwaiter()}));l.on("error",(function(r){i.emit("error",r)}));r.pipe(l)};if(this.createdDirectories[c]||c==="."){return writeFileFn()}p(c,(function(a){if(a)return i.emit("error",a);i.createdDirectories[c]=true;if(r.isDirectory){i.unfinishedEntries--;i._notifyAwaiter();return}writeFileFn()}))};Extract.prototype._notifyAwaiter=function(){if(this.afterFlushWait&&this.unfinishedEntries===0){this.emit("await-finished");this.afterFlushWait=false}};r.exports=Extract},43435:(r,i,a)=>{var s=a(12781).Transform;var l=a(73837);function MatcherStream(r,i){if(!(this instanceof MatcherStream)){return new MatcherStream}s.call(this);var a=typeof r==="object"?r.pattern:r;this.pattern=Buffer.isBuffer(a)?a:Buffer.from(a);this.requiredLength=this.pattern.length;if(r.requiredExtraSize)this.requiredLength+=r.requiredExtraSize;this.data=new Buffer("");this.bytesSoFar=0;this.matchFn=i}l.inherits(MatcherStream,s);MatcherStream.prototype.checkDataChunk=function(r){var i=this.data.length>=this.requiredLength;if(!i){return}var a=this.data.indexOf(this.pattern,r?1:0);if(a>=0&&a+this.requiredLength>this.data.length){if(a>0){var s=this.data.slice(0,a);this.push(s);this.bytesSoFar+=a;this.data=this.data.slice(a)}return}if(a===-1){var l=this.data.length-this.requiredLength+1;var s=this.data.slice(0,l);this.push(s);this.bytesSoFar+=l;this.data=this.data.slice(l);return}if(a>0){var s=this.data.slice(0,a);this.data=this.data.slice(a);this.push(s);this.bytesSoFar+=a}var c=this.matchFn?this.matchFn(this.data,this.bytesSoFar):true;if(c){this.data=new Buffer("");return}return true};MatcherStream.prototype._transform=function(r,i,a){this.data=Buffer.concat([this.data,r]);var s=true;while(this.checkDataChunk(!s)){s=false}a()};MatcherStream.prototype._flush=function(r){if(this.data.length>0){var i=true;while(this.checkDataChunk(!i)){i=false}}if(this.data.length>0){this.push(this.data);this.data=null}r()};r.exports=MatcherStream},22607:(r,i,a)=>{var s=a(12781).Transform;var l=a(73837);var c=a(73685);function ParserStream(r){if(!(this instanceof ParserStream)){return new ParserStream(r)}var i=r||{};s.call(this,{readableObjectMode:true});this.opts=r||{};this.unzipStream=new c(this.opts);var a=this;this.unzipStream.on("entry",(function(r){a.push(r)}));this.unzipStream.on("error",(function(r){a.emit("error",r)}))}l.inherits(ParserStream,s);ParserStream.prototype._transform=function(r,i,a){this.unzipStream.write(r,i,a)};ParserStream.prototype._flush=function(r){var i=this;this.unzipStream.end((function(){process.nextTick((function(){i.emit("close")}));r()}))};ParserStream.prototype.on=function(r,i){if(r==="entry"){return s.prototype.on.call(this,"data",i)}return s.prototype.on.call(this,r,i)};ParserStream.prototype.drainAll=function(){this.unzipStream.drainAll();return this.pipe(new s({objectMode:true,transform:function(r,i,a){a()}}))};r.exports=ParserStream},73685:(r,i,a)=>{"use strict";var s=a(20593);var l=a(12781);var c=a(73837);var p=a(59796);var d=a(43435);var u=a(12929);const A={STREAM_START:0,START:1,LOCAL_FILE_HEADER:2,LOCAL_FILE_HEADER_SUFFIX:3,FILE_DATA:4,FILE_DATA_END:5,DATA_DESCRIPTOR:6,CENTRAL_DIRECTORY_FILE_HEADER:7,CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:8,CDIR64_END:9,CDIR64_END_DATA_SECTOR:10,CDIR64_LOCATOR:11,CENTRAL_DIRECTORY_END:12,CENTRAL_DIRECTORY_END_COMMENT:13,TRAILING_JUNK:14,ERROR:99};const h=4294967296;const g=67324752;const y=134695760;const E=33639248;const b=101075792;const C=117853008;const v=101010256;function UnzipStream(r){if(!(this instanceof UnzipStream)){return new UnzipStream(r)}l.Transform.call(this);this.options=r||{};this.data=new Buffer("");this.state=A.STREAM_START;this.skippedBytes=0;this.parsedEntity=null;this.outStreamInfo={}}c.inherits(UnzipStream,l.Transform);UnzipStream.prototype.processDataChunk=function(r){var i;switch(this.state){case A.STREAM_START:case A.START:i=4;break;case A.LOCAL_FILE_HEADER:i=26;break;case A.LOCAL_FILE_HEADER_SUFFIX:i=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength;break;case A.DATA_DESCRIPTOR:i=12;break;case A.CENTRAL_DIRECTORY_FILE_HEADER:i=42;break;case A.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:i=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength+this.parsedEntity.fileCommentLength;break;case A.CDIR64_END:i=52;break;case A.CDIR64_END_DATA_SECTOR:i=this.parsedEntity.centralDirectoryRecordSize-44;break;case A.CDIR64_LOCATOR:i=16;break;case A.CENTRAL_DIRECTORY_END:i=18;break;case A.CENTRAL_DIRECTORY_END_COMMENT:i=this.parsedEntity.commentLength;break;case A.FILE_DATA:return 0;case A.FILE_DATA_END:return 0;case A.TRAILING_JUNK:if(this.options.debug)console.log("found",r.length,"bytes of TRAILING_JUNK");return r.length;default:return r.length}var a=r.length;if(a>>8;if((c&255)===80){p=d;break}}this.skippedBytes+=p;if(this.options.debug)console.log("Skipped",this.skippedBytes,"bytes");return p}this.state=A.ERROR;var y=l?"Not a valid zip file":"Invalid signature in zip file";if(this.options.debug){var B=r.readUInt32LE(0);var I;try{I=r.slice(0,4).toString()}catch(r){}console.log("Unexpected signature in zip file: 0x"+B.toString(16),'"'+I+'", skipped',this.skippedBytes,"bytes")}this.emit("error",new Error(y));return r.length}this.skippedBytes=0;return i;case A.LOCAL_FILE_HEADER:this.parsedEntity=this._readFile(r);this.state=A.LOCAL_FILE_HEADER_SUFFIX;return i;case A.LOCAL_FILE_HEADER_SUFFIX:var w=new u;var S=(this.parsedEntity.flags&2048)!==0;w.path=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),S);var Q=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength);var x=this._readExtraFields(Q);if(x&&x.parsed){if(x.parsed.path&&!S){w.path=x.parsed.path}if(Number.isFinite(x.parsed.uncompressedSize)&&this.parsedEntity.uncompressedSize===h-1){this.parsedEntity.uncompressedSize=x.parsed.uncompressedSize}if(Number.isFinite(x.parsed.compressedSize)&&this.parsedEntity.compressedSize===h-1){this.parsedEntity.compressedSize=x.parsed.compressedSize}}this.parsedEntity.extra=x.parsed||{};if(this.options.debug){const r=Object.assign({},this.parsedEntity,{path:w.path,flags:"0x"+this.parsedEntity.flags.toString(16),extraFields:x&&x.debug});console.log("decoded LOCAL_FILE_HEADER:",JSON.stringify(r,null,2))}this._prepareOutStream(this.parsedEntity,w);this.emit("entry",w);this.state=A.FILE_DATA;return i;case A.CENTRAL_DIRECTORY_FILE_HEADER:this.parsedEntity=this._readCentralDirectoryEntry(r);this.state=A.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX;return i;case A.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:var S=(this.parsedEntity.flags&2048)!==0;var N=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),S);var Q=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength);var x=this._readExtraFields(Q);if(x&&x.parsed&&x.parsed.path&&!S){N=x.parsed.path}this.parsedEntity.extra=x.parsed;var R=(this.parsedEntity.versionMadeBy&65280)>>8===3;var T,D;if(R){T=this.parsedEntity.externalFileAttributes>>>16;var k=T>>>12;D=(k&10)===10}if(this.options.debug){const r=Object.assign({},this.parsedEntity,{path:N,flags:"0x"+this.parsedEntity.flags.toString(16),unixAttrs:T&&"0"+T.toString(8),isSymlink:D,extraFields:x.debug});console.log("decoded CENTRAL_DIRECTORY_FILE_HEADER:",JSON.stringify(r,null,2))}this.state=A.START;return i;case A.CDIR64_END:this.parsedEntity=this._readEndOfCentralDirectory64(r);if(this.options.debug){console.log("decoded CDIR64_END_RECORD:",this.parsedEntity)}this.state=A.CDIR64_END_DATA_SECTOR;return i;case A.CDIR64_END_DATA_SECTOR:this.state=A.START;return i;case A.CDIR64_LOCATOR:this.state=A.START;return i;case A.CENTRAL_DIRECTORY_END:this.parsedEntity=this._readEndOfCentralDirectory(r);if(this.options.debug){console.log("decoded CENTRAL_DIRECTORY_END:",this.parsedEntity)}this.state=A.CENTRAL_DIRECTORY_END_COMMENT;return i;case A.CENTRAL_DIRECTORY_END_COMMENT:if(this.options.debug){console.log("decoded CENTRAL_DIRECTORY_END_COMMENT:",r.slice(0,i).toString())}this.state=A.TRAILING_JUNK;return i;case A.ERROR:return r.length;default:console.log("didn't handle state #",this.state,"discarding");return r.length}};UnzipStream.prototype._prepareOutStream=function(r,i){var a=this;var s=r.uncompressedSize===0&&/[\/\\]$/.test(i.path);i.path=i.path.replace(/^([/\\]*[.]+[/\\]+)*[/\\]*/,"");i.type=s?"Directory":"File";i.isDirectory=s;var c=!(r.flags&8);if(c){i.size=r.uncompressedSize}var g=r.versionsNeededToExtract<=45;this.outStreamInfo={stream:null,limit:c?r.compressedSize:-1,written:0};if(!c){var E=new Buffer(4);E.writeUInt32LE(y,0);var b=r.extra.zip64Mode;var C=b?20:12;var v={pattern:E,requiredExtraSize:C};var B=new d(v,(function(r,i){var s=a._readDataDescriptor(r,b);var l=s.compressedSize===i;if(!b&&!l&&i>=h){var c=i-h;while(c>=0){l=s.compressedSize===c;if(l)break;c-=h}}if(!l){return}a.state=A.FILE_DATA_END;var p=b?24:16;if(a.data.length>0){a.data=Buffer.concat([r.slice(p),a.data])}else{a.data=r.slice(p)}return true}));this.outStreamInfo.stream=B}else{this.outStreamInfo.stream=new l.PassThrough}var I=r.flags&1||r.flags&64;if(I||!g){var w=I?"Encrypted files are not supported!":"Zip version "+Math.floor(r.versionsNeededToExtract/10)+"."+r.versionsNeededToExtract%10+" is not supported";i.skip=true;setImmediate((()=>{i.emit("error",new Error(w))}));this.outStreamInfo.stream.pipe((new u).autodrain());return}var S=r.compressionMethod>0;if(S){var Q=p.createInflateRaw();Q.on("error",(function(r){a.state=A.ERROR;a.emit("error",r)}));this.outStreamInfo.stream.pipe(Q).pipe(i)}else{this.outStreamInfo.stream.pipe(i)}if(this._drainAllEntries){i.autodrain()}};UnzipStream.prototype._readFile=function(r){var i=s.parse(r).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;return i};UnzipStream.prototype._readExtraFields=function(r){var i={};var a={parsed:i};if(this.options.debug){a.debug=[]}var l=0;while(l=A+4&&u&1){i.mtime=new Date(r.readUInt32LE(l+A)*1e3);A+=4}if(c.extraSize>=A+4&&u&2){i.atime=new Date(r.readUInt32LE(l+A)*1e3);A+=4}if(c.extraSize>=A+4&&u&4){i.ctime=new Date(r.readUInt32LE(l+A)*1e3)}break;case 28789:p="Info-ZIP Unicode Path Extra Field";var h=r.readUInt8(l);if(h===1){var A=1;var g=r.readUInt32LE(l+A);A+=4;var y=r.slice(l+A);i.path=y.toString()}break;case 13:case 22613:p=c.extraId===13?"PKWARE Unix":"Info-ZIP UNIX (type 1)";var A=0;if(c.extraSize>=8){var E=new Date(r.readUInt32LE(l+A)*1e3);A+=4;var b=new Date(r.readUInt32LE(l+A)*1e3);A+=4;i.atime=E;i.mtime=b;if(c.extraSize>=12){var C=r.readUInt16LE(l+A);A+=2;var v=r.readUInt16LE(l+A);A+=2;i.uid=C;i.gid=v}}break;case 30805:p="Info-ZIP UNIX (type 2)";var A=0;if(c.extraSize>=4){var C=r.readUInt16LE(l+A);A+=2;var v=r.readUInt16LE(l+A);A+=2;i.uid=C;i.gid=v}break;case 30837:p="Info-ZIP New Unix";var A=0;var B=r.readUInt8(l);A+=1;if(B===1){var I=r.readUInt8(l+A);A+=1;if(I<=6){i.uid=r.readUIntLE(l+A,I)}A+=I;var w=r.readUInt8(l+A);A+=1;if(w<=6){i.gid=r.readUIntLE(l+A,w)}}break;case 30062:p="ASi Unix";var A=0;if(c.extraSize>=14){var S=r.readUInt32LE(l+A);A+=4;var Q=r.readUInt16LE(l+A);A+=2;var x=r.readUInt32LE(l+A);A+=4;var C=r.readUInt16LE(l+A);A+=2;var v=r.readUInt16LE(l+A);A+=2;i.mode=Q;i.uid=C;i.gid=v;if(c.extraSize>14){var N=l+A;var R=l+c.extraSize-14;var T=this._decodeString(r.slice(N,R));i.symlink=T}}break}if(this.options.debug){a.debug.push({extraId:"0x"+c.extraId.toString(16),description:p,data:r.slice(l,l+c.extraSize).inspect()})}l+=c.extraSize}return a};UnzipStream.prototype._readDataDescriptor=function(r,i){if(i){var a=s.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars;return a}var a=s.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;return a};UnzipStream.prototype._readCentralDirectoryEntry=function(r){var i=s.parse(r).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;return i};UnzipStream.prototype._readEndOfCentralDirectory64=function(r){var i=s.parse(r).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;return i};UnzipStream.prototype._readEndOfCentralDirectory=function(r){var i=s.parse(r).word16lu("diskNumber").word16lu("diskStart").word16lu("centralDirectoryEntries").word16lu("totalCentralDirectoryEntries").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;return i};const B="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";UnzipStream.prototype._decodeString=function(r,i){if(i){return r.toString("utf8")}if(this.options.decodeString){return this.options.decodeString(r)}let a="";for(var s=0;s0){this.data=this.data.slice(a);if(this.data.length===0)break}if(this.state===A.FILE_DATA){if(this.outStreamInfo.limit>=0){var s=this.outStreamInfo.limit-this.outStreamInfo.written;var l;if(s{if(this.state===A.FILE_DATA_END){this.state=A.START;return c.end(i)}i()}))}return}i()};UnzipStream.prototype.drainAll=function(){this._drainAllEntries=true};UnzipStream.prototype._transform=function(r,i,a){var s=this;if(s.data.length>0){s.data=Buffer.concat([s.data,r])}else{s.data=r}var l=s.data.length;var done=function(){if(s.data.length>0&&s.data.length0){i._parseOrOutput("buffer",(function(){if(i.data.length>0)return setImmediate((function(){i._flush(r)}));r()}));return}if(i.state===A.FILE_DATA){return r(new Error("Stream finished in an invalid state, uncompression failed"))}setImmediate(r)};r.exports=UnzipStream},89477:(r,i,a)=>{"use strict";i.Parse=a(22607);i.Extract=a(50055)},41257:(r,i,a)=>{r.exports=a(73837).deprecate},50757:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});Object.defineProperty(i,"v1",{enumerable:true,get:function(){return s.default}});Object.defineProperty(i,"v3",{enumerable:true,get:function(){return l.default}});Object.defineProperty(i,"v4",{enumerable:true,get:function(){return c.default}});Object.defineProperty(i,"v5",{enumerable:true,get:function(){return p.default}});Object.defineProperty(i,"NIL",{enumerable:true,get:function(){return d.default}});Object.defineProperty(i,"version",{enumerable:true,get:function(){return u.default}});Object.defineProperty(i,"validate",{enumerable:true,get:function(){return A.default}});Object.defineProperty(i,"stringify",{enumerable:true,get:function(){return h.default}});Object.defineProperty(i,"parse",{enumerable:true,get:function(){return g.default}});var s=_interopRequireDefault(a(56098));var l=_interopRequireDefault(a(31400));var c=_interopRequireDefault(a(25949));var p=_interopRequireDefault(a(20135));var d=_interopRequireDefault(a(74953));var u=_interopRequireDefault(a(99449));var A=_interopRequireDefault(a(70266));var h=_interopRequireDefault(a(28525));var g=_interopRequireDefault(a(32281));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}},83855:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(6113));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function md5(r){if(Array.isArray(r)){r=Buffer.from(r)}else if(typeof r==="string"){r=Buffer.from(r,"utf8")}return s.default.createHash("md5").update(r).digest()}var l=md5;i["default"]=l},74953:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a="00000000-0000-0000-0000-000000000000";i["default"]=a},32281:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(70266));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function parse(r){if(!(0,s.default)(r)){throw TypeError("Invalid UUID")}let i;const a=new Uint8Array(16);a[0]=(i=parseInt(r.slice(0,8),16))>>>24;a[1]=i>>>16&255;a[2]=i>>>8&255;a[3]=i&255;a[4]=(i=parseInt(r.slice(9,13),16))>>>8;a[5]=i&255;a[6]=(i=parseInt(r.slice(14,18),16))>>>8;a[7]=i&255;a[8]=(i=parseInt(r.slice(19,23),16))>>>8;a[9]=i&255;a[10]=(i=parseInt(r.slice(24,36),16))/1099511627776&255;a[11]=i/4294967296&255;a[12]=i>>>24&255;a[13]=i>>>16&255;a[14]=i>>>8&255;a[15]=i&255;return a}var l=parse;i["default"]=l},29741:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;i["default"]=a},29937:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=rng;var s=_interopRequireDefault(a(6113));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const l=new Uint8Array(256);let c=l.length;function rng(){if(c>l.length-16){s.default.randomFillSync(l);c=0}return l.slice(c,c+=16)}},30197:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(6113));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function sha1(r){if(Array.isArray(r)){r=Buffer.from(r)}else if(typeof r==="string"){r=Buffer.from(r,"utf8")}return s.default.createHash("sha1").update(r).digest()}var l=sha1;i["default"]=l},28525:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(70266));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const l=[];for(let r=0;r<256;++r){l.push((r+256).toString(16).substr(1))}function stringify(r,i=0){const a=(l[r[i+0]]+l[r[i+1]]+l[r[i+2]]+l[r[i+3]]+"-"+l[r[i+4]]+l[r[i+5]]+"-"+l[r[i+6]]+l[r[i+7]]+"-"+l[r[i+8]]+l[r[i+9]]+"-"+l[r[i+10]]+l[r[i+11]]+l[r[i+12]]+l[r[i+13]]+l[r[i+14]]+l[r[i+15]]).toLowerCase();if(!(0,s.default)(a)){throw TypeError("Stringified UUID is invalid")}return a}var c=stringify;i["default"]=c},56098:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(29937));var l=_interopRequireDefault(a(28525));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}let c;let p;let d=0;let u=0;function v1(r,i,a){let A=i&&a||0;const h=i||new Array(16);r=r||{};let g=r.node||c;let y=r.clockseq!==undefined?r.clockseq:p;if(g==null||y==null){const i=r.random||(r.rng||s.default)();if(g==null){g=c=[i[0]|1,i[1],i[2],i[3],i[4],i[5]]}if(y==null){y=p=(i[6]<<8|i[7])&16383}}let E=r.msecs!==undefined?r.msecs:Date.now();let b=r.nsecs!==undefined?r.nsecs:u+1;const C=E-d+(b-u)/1e4;if(C<0&&r.clockseq===undefined){y=y+1&16383}if((C<0||E>d)&&r.nsecs===undefined){b=0}if(b>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}d=E;u=b;p=y;E+=122192928e5;const v=((E&268435455)*1e4+b)%4294967296;h[A++]=v>>>24&255;h[A++]=v>>>16&255;h[A++]=v>>>8&255;h[A++]=v&255;const B=E/4294967296*1e4&268435455;h[A++]=B>>>8&255;h[A++]=B&255;h[A++]=B>>>24&15|16;h[A++]=B>>>16&255;h[A++]=y>>>8|128;h[A++]=y&255;for(let r=0;r<6;++r){h[A+r]=g[r]}return i||(0,l.default)(h)}var A=v1;i["default"]=A},31400:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(26230));var l=_interopRequireDefault(a(83855));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const c=(0,s.default)("v3",48,l.default);var p=c;i["default"]=p},26230:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=_default;i.URL=i.DNS=void 0;var s=_interopRequireDefault(a(28525));var l=_interopRequireDefault(a(32281));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function stringToBytes(r){r=unescape(encodeURIComponent(r));const i=[];for(let a=0;a{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(29937));var l=_interopRequireDefault(a(28525));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function v4(r,i,a){r=r||{};const c=r.random||(r.rng||s.default)();c[6]=c[6]&15|64;c[8]=c[8]&63|128;if(i){a=a||0;for(let r=0;r<16;++r){i[a+r]=c[r]}return i}return(0,l.default)(c)}var c=v4;i["default"]=c},20135:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(26230));var l=_interopRequireDefault(a(30197));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const c=(0,s.default)("v5",80,l.default);var p=c;i["default"]=p},70266:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(29741));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function validate(r){return typeof r==="string"&&s.default.test(r)}var l=validate;i["default"]=l},99449:(r,i,a)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=_interopRequireDefault(a(70266));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function version(r){if(!(0,s.default)(r)){throw TypeError("Invalid UUID")}return parseInt(r.substr(14,1),16)}var l=version;i["default"]=l},31268:r=>{"use strict";var i={};r.exports=i;function sign(r){return r<0?-1:1}function evenRound(r){if(r%1===.5&&(r&1)===0){return Math.floor(r)}else{return Math.round(r)}}function createNumberConversion(r,i){if(!i.unsigned){--r}const a=i.unsigned?0:-Math.pow(2,r);const s=Math.pow(2,r)-1;const l=i.moduloBitLength?Math.pow(2,i.moduloBitLength):Math.pow(2,r);const c=i.moduloBitLength?Math.pow(2,i.moduloBitLength-1):Math.pow(2,r-1);return function(r,p){if(!p)p={};let d=+r;if(p.enforceRange){if(!Number.isFinite(d)){throw new TypeError("Argument is not a finite number")}d=sign(d)*Math.floor(Math.abs(d));if(ds){throw new TypeError("Argument is not in byte range")}return d}if(!isNaN(d)&&p.clamp){d=evenRound(d);if(ds)d=s;return d}if(!Number.isFinite(d)||d===0){return 0}d=sign(d)*Math.floor(Math.abs(d));d=d%l;if(!i.unsigned&&d>=c){return d-l}else if(i.unsigned){if(d<0){d+=l}else if(d===-0){return 0}}return d}}i["void"]=function(){return undefined};i["boolean"]=function(r){return!!r};i["byte"]=createNumberConversion(8,{unsigned:false});i["octet"]=createNumberConversion(8,{unsigned:true});i["short"]=createNumberConversion(16,{unsigned:false});i["unsigned short"]=createNumberConversion(16,{unsigned:true});i["long"]=createNumberConversion(32,{unsigned:false});i["unsigned long"]=createNumberConversion(32,{unsigned:true});i["long long"]=createNumberConversion(32,{unsigned:false,moduloBitLength:64});i["unsigned long long"]=createNumberConversion(32,{unsigned:true,moduloBitLength:64});i["double"]=function(r){const i=+r;if(!Number.isFinite(i)){throw new TypeError("Argument is not a finite floating-point value")}return i};i["unrestricted double"]=function(r){const i=+r;if(isNaN(i)){throw new TypeError("Argument is NaN")}return i};i["float"]=i["double"];i["unrestricted float"]=i["unrestricted double"];i["DOMString"]=function(r,i){if(!i)i={};if(i.treatNullAsEmptyString&&r===null){return""}return String(r)};i["ByteString"]=function(r,i){const a=String(r);let s=undefined;for(let r=0;(s=a.codePointAt(r))!==undefined;++r){if(s>255){throw new TypeError("Argument is not a valid bytestring")}}return a};i["USVString"]=function(r){const i=String(r);const a=i.length;const s=[];for(let r=0;r57343){s.push(String.fromCodePoint(l))}else if(56320<=l&&l<=57343){s.push(String.fromCodePoint(65533))}else{if(r===a-1){s.push(String.fromCodePoint(65533))}else{const a=i.charCodeAt(r+1);if(56320<=a&&a<=57343){const i=l&1023;const c=a&1023;s.push(String.fromCodePoint((2<<15)+(2<<9)*i+c));++r}else{s.push(String.fromCodePoint(65533))}}}}return s.join("")};i["Date"]=function(r,i){if(!(r instanceof Date)){throw new TypeError("Argument is not a Date object")}if(isNaN(r)){return undefined}return r};i["RegExp"]=function(r,i){if(!(r instanceof RegExp)){r=new RegExp(r)}return r}},43972:(r,i,a)=>{"use strict";const s=a(41622);i.implementation=class URLImpl{constructor(r){const i=r[0];const a=r[1];let l=null;if(a!==undefined){l=s.basicURLParse(a);if(l==="failure"){throw new TypeError("Invalid base URL")}}const c=s.basicURLParse(i,{baseURL:l});if(c==="failure"){throw new TypeError("Invalid URL")}this._url=c}get href(){return s.serializeURL(this._url)}set href(r){const i=s.basicURLParse(r);if(i==="failure"){throw new TypeError("Invalid URL")}this._url=i}get origin(){return s.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(r){s.basicURLParse(r+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(r){if(s.cannotHaveAUsernamePasswordPort(this._url)){return}s.setTheUsername(this._url,r)}get password(){return this._url.password}set password(r){if(s.cannotHaveAUsernamePasswordPort(this._url)){return}s.setThePassword(this._url,r)}get host(){const r=this._url;if(r.host===null){return""}if(r.port===null){return s.serializeHost(r.host)}return s.serializeHost(r.host)+":"+s.serializeInteger(r.port)}set host(r){if(this._url.cannotBeABaseURL){return}s.basicURLParse(r,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null){return""}return s.serializeHost(this._url.host)}set hostname(r){if(this._url.cannotBeABaseURL){return}s.basicURLParse(r,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null){return""}return s.serializeInteger(this._url.port)}set port(r){if(s.cannotHaveAUsernamePasswordPort(this._url)){return}if(r===""){this._url.port=null}else{s.basicURLParse(r,{url:this._url,stateOverride:"port"})}}get pathname(){if(this._url.cannotBeABaseURL){return this._url.path[0]}if(this._url.path.length===0){return""}return"/"+this._url.path.join("/")}set pathname(r){if(this._url.cannotBeABaseURL){return}this._url.path=[];s.basicURLParse(r,{url:this._url,stateOverride:"path start"})}get search(){if(this._url.query===null||this._url.query===""){return""}return"?"+this._url.query}set search(r){const i=this._url;if(r===""){i.query=null;return}const a=r[0]==="?"?r.substring(1):r;i.query="";s.basicURLParse(a,{url:i,stateOverride:"query"})}get hash(){if(this._url.fragment===null||this._url.fragment===""){return""}return"#"+this._url.fragment}set hash(r){if(r===""){this._url.fragment=null;return}const i=r[0]==="#"?r.substring(1):r;this._url.fragment="";s.basicURLParse(i,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},6432:(r,i,a)=>{"use strict";const s=a(31268);const l=a(15871);const c=a(43972);const p=l.implSymbol;function URL(i){if(!this||this[p]||!(this instanceof URL)){throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.")}if(arguments.length<1){throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.")}const a=[];for(let r=0;r{"use strict";i.URL=a(6432)["interface"];i.serializeURL=a(41622).serializeURL;i.serializeURLOrigin=a(41622).serializeURLOrigin;i.basicURLParse=a(41622).basicURLParse;i.setTheUsername=a(41622).setTheUsername;i.setThePassword=a(41622).setThePassword;i.serializeHost=a(41622).serializeHost;i.serializeInteger=a(41622).serializeInteger;i.parseURL=a(41622).parseURL},41622:(r,i,a)=>{"use strict";const s=a(85477);const l=a(60265);const c={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443};const p=Symbol("failure");function countSymbols(r){return s.ucs2.decode(r).length}function at(r,i){const a=r[i];return isNaN(a)?undefined:String.fromCodePoint(a)}function isASCIIDigit(r){return r>=48&&r<=57}function isASCIIAlpha(r){return r>=65&&r<=90||r>=97&&r<=122}function isASCIIAlphanumeric(r){return isASCIIAlpha(r)||isASCIIDigit(r)}function isASCIIHex(r){return isASCIIDigit(r)||r>=65&&r<=70||r>=97&&r<=102}function isSingleDot(r){return r==="."||r.toLowerCase()==="%2e"}function isDoubleDot(r){r=r.toLowerCase();return r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"}function isWindowsDriveLetterCodePoints(r,i){return isASCIIAlpha(r)&&(i===58||i===124)}function isWindowsDriveLetterString(r){return r.length===2&&isASCIIAlpha(r.codePointAt(0))&&(r[1]===":"||r[1]==="|")}function isNormalizedWindowsDriveLetterString(r){return r.length===2&&isASCIIAlpha(r.codePointAt(0))&&r[1]===":"}function containsForbiddenHostCodePoint(r){return r.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/)!==-1}function containsForbiddenHostCodePointExcludingPercent(r){return r.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/)!==-1}function isSpecialScheme(r){return c[r]!==undefined}function isSpecial(r){return isSpecialScheme(r.scheme)}function defaultPort(r){return c[r]}function percentEncode(r){let i=r.toString(16).toUpperCase();if(i.length===1){i="0"+i}return"%"+i}function utf8PercentEncode(r){const i=new Buffer(r);let a="";for(let r=0;r126}const d=new Set([32,34,35,60,62,63,96,123,125]);function isPathPercentEncode(r){return isC0ControlPercentEncode(r)||d.has(r)}const u=new Set([47,58,59,61,64,91,92,93,94,124]);function isUserinfoPercentEncode(r){return isPathPercentEncode(r)||u.has(r)}function percentEncodeChar(r,i){const a=String.fromCodePoint(r);if(i(r)){return utf8PercentEncode(a)}return a}function parseIPv4Number(r){let i=10;if(r.length>=2&&r.charAt(0)==="0"&&r.charAt(1).toLowerCase()==="x"){r=r.substring(2);i=16}else if(r.length>=2&&r.charAt(0)==="0"){r=r.substring(1);i=8}if(r===""){return 0}const a=i===10?/[^0-9]/:i===16?/[^0-9A-Fa-f]/:/[^0-7]/;if(a.test(r)){return p}return parseInt(r,i)}function parseIPv4(r){const i=r.split(".");if(i[i.length-1]===""){if(i.length>1){i.pop()}}if(i.length>4){return r}const a=[];for(const s of i){if(s===""){return r}const i=parseIPv4Number(s);if(i===p){return r}a.push(i)}for(let r=0;r255){return p}}if(a[a.length-1]>=Math.pow(256,5-a.length)){return p}let s=a.pop();let l=0;for(const r of a){s+=r*Math.pow(256,3-l);++l}return s}function serializeIPv4(r){let i="";let a=r;for(let r=1;r<=4;++r){i=String(a%256)+i;if(r!==4){i="."+i}a=Math.floor(a/256)}return i}function parseIPv6(r){const i=[0,0,0,0,0,0,0,0];let a=0;let l=null;let c=0;r=s.ucs2.decode(r);if(r[c]===58){if(r[c+1]!==58){return p}c+=2;++a;l=a}while(c6){return p}let s=0;while(r[c]!==undefined){let l=null;if(s>0){if(r[c]===46&&s<4){++c}else{return p}}if(!isASCIIDigit(r[c])){return p}while(isASCIIDigit(r[c])){const i=parseInt(at(r,c));if(l===null){l=i}else if(l===0){return p}else{l=l*10+i}if(l>255){return p}++c}i[a]=i[a]*256+l;++s;if(s===2||s===4){++a}}if(s!==4){return p}break}else if(r[c]===58){++c;if(r[c]===undefined){return p}}else if(r[c]!==undefined){return p}i[a]=s;++a}if(l!==null){let r=a-l;a=7;while(a!==0&&r>0){const s=i[l+r-1];i[l+r-1]=i[a];i[a]=s;--a;--r}}else if(l===null&&a!==8){return p}return i}function serializeIPv6(r){let i="";const a=findLongestZeroSequence(r);const s=a.idx;let l=false;for(let a=0;a<=7;++a){if(l&&r[a]===0){continue}else if(l){l=false}if(s===a){const r=a===0?"::":":";i+=r;l=true;continue}i+=r[a].toString(16);if(a!==7){i+=":"}}return i}function parseHost(r,i){if(r[0]==="["){if(r[r.length-1]!=="]"){return p}return parseIPv6(r.substring(1,r.length-1))}if(!i){return parseOpaqueHost(r)}const a=utf8PercentDecode(r);const s=l.toASCII(a,false,l.PROCESSING_OPTIONS.NONTRANSITIONAL,false);if(s===null){return p}if(containsForbiddenHostCodePoint(s)){return p}const c=parseIPv4(s);if(typeof c==="number"||c===p){return c}return s}function parseOpaqueHost(r){if(containsForbiddenHostCodePointExcludingPercent(r)){return p}let i="";const a=s.ucs2.decode(r);for(let r=0;ra){i=s;a=l}s=null;l=0}else{if(s===null){s=c}++l}}if(l>a){i=s;a=l}return{idx:i,len:a}}function serializeHost(r){if(typeof r==="number"){return serializeIPv4(r)}if(r instanceof Array){return"["+serializeIPv6(r)+"]"}return r}function trimControlChars(r){return r.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}function trimTabAndNewline(r){return r.replace(/\u0009|\u000A|\u000D/g,"")}function shortenPath(r){const i=r.path;if(i.length===0){return}if(r.scheme==="file"&&i.length===1&&isNormalizedWindowsDriveLetter(i[0])){return}i.pop()}function includesCredentials(r){return r.username!==""||r.password!==""}function cannotHaveAUsernamePasswordPort(r){return r.host===null||r.host===""||r.cannotBeABaseURL||r.scheme==="file"}function isNormalizedWindowsDriveLetter(r){return/^[A-Za-z]:$/.test(r)}function URLStateMachine(r,i,a,l,c){this.pointer=0;this.input=r;this.base=i||null;this.encodingOverride=a||"utf-8";this.stateOverride=c;this.url=l;this.failure=false;this.parseError=false;if(!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:false};const r=trimControlChars(this.input);if(r!==this.input){this.parseError=true}this.input=r}const d=trimTabAndNewline(this.input);if(d!==this.input){this.parseError=true}this.input=d;this.state=c||"scheme start";this.buffer="";this.atFlag=false;this.arrFlag=false;this.passwordTokenSeenFlag=false;this.input=s.ucs2.decode(this.input);for(;this.pointer<=this.input.length;++this.pointer){const r=this.input[this.pointer];const i=isNaN(r)?undefined:String.fromCodePoint(r);const a=this["parse "+this.state](r,i);if(!a){break}else if(a===p){this.failure=true;break}}}URLStateMachine.prototype["parse scheme start"]=function parseSchemeStart(r,i){if(isASCIIAlpha(r)){this.buffer+=i.toLowerCase();this.state="scheme"}else if(!this.stateOverride){this.state="no scheme";--this.pointer}else{this.parseError=true;return p}return true};URLStateMachine.prototype["parse scheme"]=function parseScheme(r,i){if(isASCIIAlphanumeric(r)||r===43||r===45||r===46){this.buffer+=i.toLowerCase()}else if(r===58){if(this.stateOverride){if(isSpecial(this.url)&&!isSpecialScheme(this.buffer)){return false}if(!isSpecial(this.url)&&isSpecialScheme(this.buffer)){return false}if((includesCredentials(this.url)||this.url.port!==null)&&this.buffer==="file"){return false}if(this.url.scheme==="file"&&(this.url.host===""||this.url.host===null)){return false}}this.url.scheme=this.buffer;this.buffer="";if(this.stateOverride){return false}if(this.url.scheme==="file"){if(this.input[this.pointer+1]!==47||this.input[this.pointer+2]!==47){this.parseError=true}this.state="file"}else if(isSpecial(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme){this.state="special relative or authority"}else if(isSpecial(this.url)){this.state="special authority slashes"}else if(this.input[this.pointer+1]===47){this.state="path or authority";++this.pointer}else{this.url.cannotBeABaseURL=true;this.url.path.push("");this.state="cannot-be-a-base-URL path"}}else if(!this.stateOverride){this.buffer="";this.state="no scheme";this.pointer=-1}else{this.parseError=true;return p}return true};URLStateMachine.prototype["parse no scheme"]=function parseNoScheme(r){if(this.base===null||this.base.cannotBeABaseURL&&r!==35){return p}else if(this.base.cannotBeABaseURL&&r===35){this.url.scheme=this.base.scheme;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.url.cannotBeABaseURL=true;this.state="fragment"}else if(this.base.scheme==="file"){this.state="file";--this.pointer}else{this.state="relative";--this.pointer}return true};URLStateMachine.prototype["parse special relative or authority"]=function parseSpecialRelativeOrAuthority(r){if(r===47&&this.input[this.pointer+1]===47){this.state="special authority ignore slashes";++this.pointer}else{this.parseError=true;this.state="relative";--this.pointer}return true};URLStateMachine.prototype["parse path or authority"]=function parsePathOrAuthority(r){if(r===47){this.state="authority"}else{this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse relative"]=function parseRelative(r){this.url.scheme=this.base.scheme;if(isNaN(r)){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query=this.base.query}else if(r===47){this.state="relative slash"}else if(r===63){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query="";this.state="query"}else if(r===35){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.state="fragment"}else if(isSpecial(this.url)&&r===92){this.parseError=true;this.state="relative slash"}else{this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice(0,this.base.path.length-1);this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse relative slash"]=function parseRelativeSlash(r){if(isSpecial(this.url)&&(r===47||r===92)){if(r===92){this.parseError=true}this.state="special authority ignore slashes"}else if(r===47){this.state="authority"}else{this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse special authority slashes"]=function parseSpecialAuthoritySlashes(r){if(r===47&&this.input[this.pointer+1]===47){this.state="special authority ignore slashes";++this.pointer}else{this.parseError=true;this.state="special authority ignore slashes";--this.pointer}return true};URLStateMachine.prototype["parse special authority ignore slashes"]=function parseSpecialAuthorityIgnoreSlashes(r){if(r!==47&&r!==92){this.state="authority";--this.pointer}else{this.parseError=true}return true};URLStateMachine.prototype["parse authority"]=function parseAuthority(r,i){if(r===64){this.parseError=true;if(this.atFlag){this.buffer="%40"+this.buffer}this.atFlag=true;const r=countSymbols(this.buffer);for(let i=0;iMath.pow(2,16)-1){this.parseError=true;return p}this.url.port=r===defaultPort(this.url.scheme)?null:r;this.buffer=""}if(this.stateOverride){return false}this.state="path start";--this.pointer}else{this.parseError=true;return p}return true};const A=new Set([47,92,63,35]);URLStateMachine.prototype["parse file"]=function parseFile(r){this.url.scheme="file";if(r===47||r===92){if(r===92){this.parseError=true}this.state="file slash"}else if(this.base!==null&&this.base.scheme==="file"){if(isNaN(r)){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query=this.base.query}else if(r===63){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query="";this.state="query"}else if(r===35){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.state="fragment"}else{if(this.input.length-this.pointer-1===0||!isWindowsDriveLetterCodePoints(r,this.input[this.pointer+1])||this.input.length-this.pointer-1>=2&&!A.has(this.input[this.pointer+2])){this.url.host=this.base.host;this.url.path=this.base.path.slice();shortenPath(this.url)}else{this.parseError=true}this.state="path";--this.pointer}}else{this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse file slash"]=function parseFileSlash(r){if(r===47||r===92){if(r===92){this.parseError=true}this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(isNormalizedWindowsDriveLetterString(this.base.path[0])){this.url.path.push(this.base.path[0])}else{this.url.host=this.base.host}}this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse file host"]=function parseFileHost(r,i){if(isNaN(r)||r===47||r===92||r===63||r===35){--this.pointer;if(!this.stateOverride&&isWindowsDriveLetterString(this.buffer)){this.parseError=true;this.state="path"}else if(this.buffer===""){this.url.host="";if(this.stateOverride){return false}this.state="path start"}else{let r=parseHost(this.buffer,isSpecial(this.url));if(r===p){return p}if(r==="localhost"){r=""}this.url.host=r;if(this.stateOverride){return false}this.buffer="";this.state="path start"}}else{this.buffer+=i}return true};URLStateMachine.prototype["parse path start"]=function parsePathStart(r){if(isSpecial(this.url)){if(r===92){this.parseError=true}this.state="path";if(r!==47&&r!==92){--this.pointer}}else if(!this.stateOverride&&r===63){this.url.query="";this.state="query"}else if(!this.stateOverride&&r===35){this.url.fragment="";this.state="fragment"}else if(r!==undefined){this.state="path";if(r!==47){--this.pointer}}return true};URLStateMachine.prototype["parse path"]=function parsePath(r){if(isNaN(r)||r===47||isSpecial(this.url)&&r===92||!this.stateOverride&&(r===63||r===35)){if(isSpecial(this.url)&&r===92){this.parseError=true}if(isDoubleDot(this.buffer)){shortenPath(this.url);if(r!==47&&!(isSpecial(this.url)&&r===92)){this.url.path.push("")}}else if(isSingleDot(this.buffer)&&r!==47&&!(isSpecial(this.url)&&r===92)){this.url.path.push("")}else if(!isSingleDot(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&isWindowsDriveLetterString(this.buffer)){if(this.url.host!==""&&this.url.host!==null){this.parseError=true;this.url.host=""}this.buffer=this.buffer[0]+":"}this.url.path.push(this.buffer)}this.buffer="";if(this.url.scheme==="file"&&(r===undefined||r===63||r===35)){while(this.url.path.length>1&&this.url.path[0]===""){this.parseError=true;this.url.path.shift()}}if(r===63){this.url.query="";this.state="query"}if(r===35){this.url.fragment="";this.state="fragment"}}else{if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.buffer+=percentEncodeChar(r,isPathPercentEncode)}return true};URLStateMachine.prototype["parse cannot-be-a-base-URL path"]=function parseCannotBeABaseURLPath(r){if(r===63){this.url.query="";this.state="query"}else if(r===35){this.url.fragment="";this.state="fragment"}else{if(!isNaN(r)&&r!==37){this.parseError=true}if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}if(!isNaN(r)){this.url.path[0]=this.url.path[0]+percentEncodeChar(r,isC0ControlPercentEncode)}}return true};URLStateMachine.prototype["parse query"]=function parseQuery(r,i){if(isNaN(r)||!this.stateOverride&&r===35){if(!isSpecial(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss"){this.encodingOverride="utf-8"}const i=new Buffer(this.buffer);for(let r=0;r126||i[r]===34||i[r]===35||i[r]===60||i[r]===62){this.url.query+=percentEncode(i[r])}else{this.url.query+=String.fromCodePoint(i[r])}}this.buffer="";if(r===35){this.url.fragment="";this.state="fragment"}}else{if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.buffer+=i}return true};URLStateMachine.prototype["parse fragment"]=function parseFragment(r){if(isNaN(r)){}else if(r===0){this.parseError=true}else{if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.url.fragment+=percentEncodeChar(r,isC0ControlPercentEncode)}return true};function serializeURL(r,i){let a=r.scheme+":";if(r.host!==null){a+="//";if(r.username!==""||r.password!==""){a+=r.username;if(r.password!==""){a+=":"+r.password}a+="@"}a+=serializeHost(r.host);if(r.port!==null){a+=":"+r.port}}else if(r.host===null&&r.scheme==="file"){a+="//"}if(r.cannotBeABaseURL){a+=r.path[0]}else{for(const i of r.path){a+="/"+i}}if(r.query!==null){a+="?"+r.query}if(!i&&r.fragment!==null){a+="#"+r.fragment}return a}function serializeOrigin(r){let i=r.scheme+"://";i+=serializeHost(r.host);if(r.port!==null){i+=":"+r.port}return i}r.exports.serializeURL=serializeURL;r.exports.serializeURLOrigin=function(i){switch(i.scheme){case"blob":try{return r.exports.serializeURLOrigin(r.exports.parseURL(i.path[0]))}catch(r){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return serializeOrigin({scheme:i.scheme,host:i.host,port:i.port});case"file":return"file://";default:return"null"}};r.exports.basicURLParse=function(r,i){if(i===undefined){i={}}const a=new URLStateMachine(r,i.baseURL,i.encodingOverride,i.url,i.stateOverride);if(a.failure){return"failure"}return a.url};r.exports.setTheUsername=function(r,i){r.username="";const a=s.ucs2.decode(i);for(let i=0;i{"use strict";r.exports.mixin=function mixin(r,i){const a=Object.getOwnPropertyNames(i);for(let s=0;s{r.exports=wrappy;function wrappy(r,i){if(r&&i)return wrappy(r)(i);if(typeof r!=="function")throw new TypeError("need wrapper function");Object.keys(r).forEach((function(i){wrapper[i]=r[i]}));return wrapper;function wrapper(){var i=new Array(arguments.length);for(var a=0;a"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},66623:function(r,i,a){(function(){var i,s,l,extend=function(r,i){for(var a in i){if(c.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=a(1917);l=a(13582);r.exports=s=function(r){extend(XMLCData,r);function XMLCData(r,a){XMLCData.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(a)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))};return XMLCData}(l)}).call(this)},13582:function(r,i,a){(function(){var i,s,extend=function(r,i){for(var a in i){if(l.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;s=a(39764);r.exports=i=function(r){extend(XMLCharacterData,r);function XMLCharacterData(r){XMLCharacterData.__super__.constructor.call(this,r);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(r,i,a){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(r){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.data!==this.data){return false}return true};return XMLCharacterData}(s)}).call(this)},61810:function(r,i,a){(function(){var i,s,l,extend=function(r,i){for(var a in i){if(c.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=a(1917);s=a(13582);r.exports=l=function(r){extend(XMLComment,r);function XMLComment(r,a){XMLComment.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(a)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))};return XMLComment}(s)}).call(this)},69502:function(r,i,a){(function(){var i,s,l;s=a(75818);l=a(69795);r.exports=i=function(){function XMLDOMConfiguration(){var r;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new s,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=r=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(r,i){return true};XMLDOMConfiguration.prototype.setParameter=function(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}};return XMLDOMConfiguration}()}).call(this)},75818:function(r){(function(){var i;r.exports=i=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(r){throw new Error(r)};return XMLDOMErrorHandler}()}).call(this)},6277:function(r){(function(){var i;r.exports=i=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(r,i){return true};XMLDOMImplementation.prototype.createDocumentType=function(r,i,a){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(r,i,a){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},69795:function(r){(function(){var i;r.exports=i=function(){function XMLDOMStringList(r){this.arr=r||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(r){return this.arr[r]||null};XMLDOMStringList.prototype.contains=function(r){return this.arr.indexOf(r)!==-1};return XMLDOMStringList}()}).call(this)},18553:function(r,i,a){(function(){var i,s,l,extend=function(r,i){for(var a in i){if(c.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=a(39764);i=a(1917);r.exports=s=function(r){extend(XMLDTDAttList,r);function XMLDTDAttList(r,a,s,l,c,p){XMLDTDAttList.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(s==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(a))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(a))}if(!c){throw new Error("Missing DTD attribute default. "+this.debugInfo(a))}if(c.indexOf("#")!==0){c="#"+c}if(!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(a))}if(p&&!c.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(a))}this.elementName=this.stringify.name(a);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(s);this.attributeType=this.stringify.dtdAttType(l);if(p){this.defaultValue=this.stringify.dtdAttDefault(p)}this.defaultValueType=c}XMLDTDAttList.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))};return XMLDTDAttList}(l)}).call(this)},16766:function(r,i,a){(function(){var i,s,l,extend=function(r,i){for(var a in i){if(c.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=a(39764);i=a(1917);r.exports=s=function(r){extend(XMLDTDElement,r);function XMLDTDElement(r,a,s){XMLDTDElement.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!s){s="(#PCDATA)"}if(Array.isArray(s)){s="("+s.join(",")+")"}this.name=this.stringify.name(a);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(s)}XMLDTDElement.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))};return XMLDTDElement}(l)}).call(this)},58232:function(r,i,a){(function(){var i,s,l,c,extend=function(r,i){for(var a in i){if(p.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},p={}.hasOwnProperty;c=a(9784).isObject;l=a(39764);i=a(1917);r.exports=s=function(r){extend(XMLDTDEntity,r);function XMLDTDEntity(r,a,s,l){XMLDTDEntity.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing DTD entity name. "+this.debugInfo(s))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(s))}this.pe=!!a;this.name=this.stringify.name(s);this.type=i.EntityDeclaration;if(!c(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(s))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(s))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(s))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))};return XMLDTDEntity}(l)}).call(this)},53552:function(r,i,a){(function(){var i,s,l,extend=function(r,i){for(var a in i){if(c.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=a(39764);i=a(1917);r.exports=s=function(r){extend(XMLDTDNotation,r);function XMLDTDNotation(r,a,s){XMLDTDNotation.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD notation name. "+this.debugInfo(a))}if(!s.pubID&&!s.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(a))}this.name=this.stringify.name(a);this.type=i.NotationDeclaration;if(s.pubID!=null){this.pubID=this.stringify.dtdPubID(s.pubID)}if(s.sysID!=null){this.sysID=this.stringify.dtdSysID(s.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))};return XMLDTDNotation}(l)}).call(this)},10731:function(r,i,a){(function(){var i,s,l,c,extend=function(r,i){for(var a in i){if(p.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},p={}.hasOwnProperty;c=a(9784).isObject;l=a(39764);i=a(1917);r.exports=s=function(r){extend(XMLDeclaration,r);function XMLDeclaration(r,a,s,l){var p;XMLDeclaration.__super__.constructor.call(this,r);if(c(a)){p=a,a=p.version,s=p.encoding,l=p.standalone}if(!a){a="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(a);if(s!=null){this.encoding=this.stringify.xmlEncoding(s)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}XMLDeclaration.prototype.toString=function(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))};return XMLDeclaration}(l)}).call(this)},10761:function(r,i,a){(function(){var i,s,l,c,p,d,u,A,h,extend=function(r,i){for(var a in i){if(g.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;h=a(9784).isObject;A=a(39764);i=a(1917);s=a(18553);c=a(58232);l=a(16766);p=a(53552);u=a(55459);r.exports=d=function(r){extend(XMLDocType,r);function XMLDocType(r,a,s){var l,c,p,d,u,A;XMLDocType.__super__.constructor.call(this,r);this.type=i.DocType;if(r.children){d=r.children;for(c=0,p=d.length;c=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(r){var a,l,c,p;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=s.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;p=r.attribs;for(c in p){if(!D.call(p,c))continue;a=p[c];l+=this.writer.attribute(a,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=s.InsideTag}else{this.writerOptions.state=s.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+""}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(r){var a;if(!r.isClosed){a="";this.writerOptions.state=s.CloseTag;if(r.type===i.Element){a=this.writer.indent(r,this.writerOptions,this.currentLevel)+""+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{a=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=s.None;this.onData(a,this.currentLevel);return r.isClosed=true}};XMLDocumentCB.prototype.onData=function(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(r){if(r==null){return""}else{return"node: <"+r+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(r,i,a){return this.node(r,i,a)};XMLDocumentCB.prototype.txt=function(r){return this.text(r)};XMLDocumentCB.prototype.dat=function(r){return this.cdata(r)};XMLDocumentCB.prototype.com=function(r){return this.comment(r)};XMLDocumentCB.prototype.ins=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.dec=function(r,i,a){return this.declaration(r,i,a)};XMLDocumentCB.prototype.dtd=function(r,i,a){return this.doctype(r,i,a)};XMLDocumentCB.prototype.e=function(r,i,a){return this.element(r,i,a)};XMLDocumentCB.prototype.n=function(r,i,a){return this.node(r,i,a)};XMLDocumentCB.prototype.t=function(r){return this.text(r)};XMLDocumentCB.prototype.d=function(r){return this.cdata(r)};XMLDocumentCB.prototype.c=function(r){return this.comment(r)};XMLDocumentCB.prototype.r=function(r){return this.raw(r)};XMLDocumentCB.prototype.i=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocumentCB.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocumentCB.prototype.not=function(r,i){return this.notation(r,i)};return XMLDocumentCB}()}).call(this)},89033:function(r,i,a){(function(){var i,s,l,extend=function(r,i){for(var a in i){if(c.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=a(39764);i=a(1917);r.exports=s=function(r){extend(XMLDummy,r);function XMLDummy(r){XMLDummy.__super__.constructor.call(this,r);this.type=i.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(r){return""};return XMLDummy}(l)}).call(this)},31787:function(r,i,a){(function(){var i,s,l,c,p,d,u,A,h,extend=function(r,i){for(var a in i){if(g.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;h=a(9784),A=h.isObject,u=h.isFunction,d=h.getValue;p=a(39764);i=a(1917);s=a(48370);c=a(55459);r.exports=l=function(r){extend(XMLElement,r);function XMLElement(r,a,s){var l,c,p,d;XMLElement.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(a);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(s!=null){this.attribute(s)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){d=r.children;for(c=0,p=d.length;c=s;i=0<=s?++a:--a){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true};return XMLElement}(p)}).call(this)},55459:function(r){(function(){var i;r.exports=i=function(){function XMLNamedNodeMap(r){this.nodes=r}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(r){return this.nodes[r]};XMLNamedNodeMap.prototype.setNamedItem=function(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null};XMLNamedNodeMap.prototype.removeNamedItem=function(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null};XMLNamedNodeMap.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},39764:function(r,i,a){(function(){var i,s,l,c,p,d,u,A,h,g,y,E,b,C,v,B,I,w,S,Q={}.hasOwnProperty;S=a(9784),w=S.isObject,I=S.isFunction,B=S.isEmpty,v=S.getValue;A=null;l=null;c=null;p=null;d=null;b=null;C=null;E=null;u=null;s=null;y=null;h=null;i=null;r.exports=g=function(){function XMLNode(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!A){A=a(31787);l=a(66623);c=a(61810);p=a(10731);d=a(10761);b=a(67118);C=a(75554);E=a(8120);u=a(89033);s=a(1917);y=a(98770);h=a(55459);i=a(11491)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new y(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,a,l,c;if(this.nodeType===s.Element||this.nodeType===s.DocumentFragment){c="";l=this.children;for(i=0,a=l.length;i"}else if(!((a=this.parent)!=null?a.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(r,i,a){return this.element(r,i,a)};XMLNode.prototype.nod=function(r,i,a){return this.node(r,i,a)};XMLNode.prototype.txt=function(r){return this.text(r)};XMLNode.prototype.dat=function(r){return this.cdata(r)};XMLNode.prototype.com=function(r){return this.comment(r)};XMLNode.prototype.ins=function(r,i){return this.instruction(r,i)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(r,i,a){return this.declaration(r,i,a)};XMLNode.prototype.e=function(r,i,a){return this.element(r,i,a)};XMLNode.prototype.n=function(r,i,a){return this.node(r,i,a)};XMLNode.prototype.t=function(r){return this.text(r)};XMLNode.prototype.d=function(r){return this.cdata(r)};XMLNode.prototype.c=function(r){return this.comment(r)};XMLNode.prototype.r=function(r){return this.raw(r)};XMLNode.prototype.i=function(r,i){return this.instruction(r,i)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(r){return this.importDocument(r)};XMLNode.prototype.replaceChild=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(r,i){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(r){var a,s;a=this;if(a===r){return 0}else if(this.document()!==r.document()){s=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){s|=i.Preceding}else{s|=i.Following}return s}else if(a.isAncestor(r)){return i.Contains|i.Preceding}else if(a.isDescendant(r)){return i.Contains|i.Following}else if(a.isPreceding(r)){return i.Preceding}else{return i.Following}};XMLNode.prototype.isSameNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(r){var i,a,s;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=a=0,s=this.children.length-1;0<=s?a<=s:a>=s;i=0<=s?++a:--a){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true};XMLNode.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(r,i,a){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(r){if(!r){return false}return r===this||this.isDescendant(r)};XMLNode.prototype.isDescendant=function(r){var i,a,s,l,c;c=this.children;for(s=0,l=c.length;sa}};XMLNode.prototype.treePosition=function(r){var i,a;a=0;i=false;this.foreachTreeNode(this.document(),(function(s){a++;if(!i&&s===r){return i=true}}));if(i){return a}else{return-1}};XMLNode.prototype.foreachTreeNode=function(r,i){var a,s,l,c,p;r||(r=this.document());c=r.children;for(s=0,l=c.length;s0){this.stream.write(" [");this.stream.write(this.endline(r,i,a));i.state=s.InsideTag;d=r.children;for(c=0,p=d.length;c");this.stream.write(this.endline(r,i,a));i.state=s.None;return this.closeNode(r,i,a)};XMLStreamWriter.prototype.element=function(r,a,l){var c,d,u,A,h,g,y,E,b,C;l||(l=0);this.openNode(r,a,l);a.state=s.OpenTag;this.stream.write(this.indent(r,a,l)+"<"+r.name);b=r.attribs;for(y in b){if(!p.call(b,y))continue;c=b[y];this.attribute(c,a,l)}u=r.children.length;A=u===0?null:r.children[0];if(u===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(a.allowEmpty){this.stream.write(">");a.state=s.CloseTag;this.stream.write("")}else{a.state=s.CloseTag;this.stream.write(a.spaceBeforeSlash+"/>")}}else if(a.pretty&&u===1&&(A.type===i.Text||A.type===i.Raw)&&A.value!=null){this.stream.write(">");a.state=s.InsideTag;a.suppressPrettyCount++;E=true;this.writeChildNode(A,a,l+1);a.suppressPrettyCount--;E=false;a.state=s.CloseTag;this.stream.write("")}else{this.stream.write(">"+this.endline(r,a,l));a.state=s.InsideTag;C=r.children;for(h=0,g=C.length;h")}this.stream.write(this.endline(r,a,l));a.state=s.None;return this.closeNode(r,a,l)};XMLStreamWriter.prototype.processingInstruction=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,r,i,a))};XMLStreamWriter.prototype.raw=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,r,i,a))};XMLStreamWriter.prototype.text=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.text.call(this,r,i,a))};XMLStreamWriter.prototype.dtdAttList=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,r,i,a))};XMLStreamWriter.prototype.dtdElement=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,r,i,a))};XMLStreamWriter.prototype.dtdEntity=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,r,i,a))};XMLStreamWriter.prototype.dtdNotation=function(r,i,a){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,r,i,a))};return XMLStreamWriter}(c)}).call(this)},50358:function(r,i,a){(function(){var i,s,extend=function(r,i){for(var a in i){if(l.call(i,a))r[a]=i[a]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;s=a(51274);r.exports=i=function(r){extend(XMLStringWriter,r);function XMLStringWriter(r){XMLStringWriter.__super__.constructor.call(this,r)}XMLStringWriter.prototype.document=function(r,i){var a,s,l,c,p;i=this.filterOptions(i);c="";p=r.children;for(s=0,l=p.length;s","]]]]>");return this.assertLegalChar(r)};XMLStringifier.prototype.comment=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.raw=function(r){if(this.options.noValidation){return r}return""+r||""};XMLStringifier.prototype.attValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))};XMLStringifier.prototype.insTarget=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.insValue=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlVersion=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r};XMLStringifier.prototype.xmlEncoding=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlStandalone=function(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdSysID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdElementValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttType=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttDefault=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdEntityValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdNData=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(r){var i,a;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(a=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+a.index)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(a=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+a.index)}}return r};XMLStringifier.prototype.assertLegalName=function(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!r.match(i)){throw new Error("Invalid character in name")}return r};XMLStringifier.prototype.textEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(//g,">").replace(/\r/g," ")};XMLStringifier.prototype.attEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/0){return new Array(s).join(i.indent)}}return""};XMLWriterBase.prototype.endline=function(r,i,a){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}};XMLWriterBase.prototype.attribute=function(r,i,a){var s;this.openAttribute(r,i,a);s=" "+r.name+'="'+r.value+'"';this.closeAttribute(r,i,a);return s};XMLWriterBase.prototype.cdata=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+""+this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.comment=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+"\x3c!-- ";i.state=s.InsideTag;l+=r.value;i.state=s.CloseTag;l+=" --\x3e"+this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.declaration=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+"";l+=this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.docType=function(r,i,a){var l,c,p,d,u;a||(a=0);this.openNode(r,i,a);i.state=s.OpenTag;d=this.indent(r,i,a);d+="0){d+=" [";d+=this.endline(r,i,a);i.state=s.InsideTag;u=r.children;for(c=0,p=u.length;c";d+=this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return d};XMLWriterBase.prototype.element=function(r,a,l){var c,p,d,u,A,h,g,y,E,b,C,v,B,I;l||(l=0);b=false;C="";this.openNode(r,a,l);a.state=s.OpenTag;C+=this.indent(r,a,l)+"<"+r.name;v=r.attribs;for(E in v){if(!w.call(v,E))continue;c=v[E];C+=this.attribute(c,a,l)}d=r.children.length;u=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(a.allowEmpty){C+=">";a.state=s.CloseTag;C+=""+this.endline(r,a,l)}else{a.state=s.CloseTag;C+=a.spaceBeforeSlash+"/>"+this.endline(r,a,l)}}else if(a.pretty&&d===1&&(u.type===i.Text||u.type===i.Raw)&&u.value!=null){C+=">";a.state=s.InsideTag;a.suppressPrettyCount++;b=true;C+=this.writeChildNode(u,a,l+1);a.suppressPrettyCount--;b=false;a.state=s.CloseTag;C+=""+this.endline(r,a,l)}else{if(a.dontPrettyTextNodes){B=r.children;for(A=0,g=B.length;A"+this.endline(r,a,l);a.state=s.InsideTag;I=r.children;for(h=0,y=I.length;h";if(b){a.suppressPrettyCount--}C+=this.endline(r,a,l);a.state=s.None}this.closeNode(r,a,l);return C};XMLWriterBase.prototype.writeChildNode=function(r,a,s){switch(r.type){case i.CData:return this.cdata(r,a,s);case i.Comment:return this.comment(r,a,s);case i.Element:return this.element(r,a,s);case i.Raw:return this.raw(r,a,s);case i.Text:return this.text(r,a,s);case i.ProcessingInstruction:return this.processingInstruction(r,a,s);case i.Dummy:return"";case i.Declaration:return this.declaration(r,a,s);case i.DocType:return this.docType(r,a,s);case i.AttributeDeclaration:return this.dtdAttList(r,a,s);case i.ElementDeclaration:return this.dtdElement(r,a,s);case i.EntityDeclaration:return this.dtdEntity(r,a,s);case i.NotationDeclaration:return this.dtdNotation(r,a,s);default:throw new Error("Unknown XML node type: "+r.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+"";l+=this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.raw=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a);i.state=s.InsideTag;l+=r.value;i.state=s.CloseTag;l+=this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.text=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a);i.state=s.InsideTag;l+=r.value;i.state=s.CloseTag;l+=this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.dtdAttList=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+""+this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.dtdElement=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+""+this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.dtdEntity=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+""+this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.dtdNotation=function(r,i,a){var l;this.openNode(r,i,a);i.state=s.OpenTag;l=this.indent(r,i,a)+""+this.endline(r,i,a);i.state=s.None;this.closeNode(r,i,a);return l};XMLWriterBase.prototype.openNode=function(r,i,a){};XMLWriterBase.prototype.closeNode=function(r,i,a){};XMLWriterBase.prototype.openAttribute=function(r,i,a){};XMLWriterBase.prototype.closeAttribute=function(r,i,a){};return XMLWriterBase}()}).call(this)},50410:function(r,i,a){(function(){var i,s,l,c,p,d,u,A,h,g;g=a(9784),A=g.assign,h=g.isFunction;l=a(6277);c=a(77135);p=a(13100);u=a(50358);d=a(33293);i=a(1917);s=a(49835);r.exports.create=function(r,i,a,s){var l,p;if(r==null){throw new Error("Root element needs a name.")}s=A({},i,a,s);l=new c(s);p=l.element(r);if(!s.headless){l.declaration(s);if(s.pubID!=null||s.sysID!=null){l.dtd(s)}}return p};r.exports.begin=function(r,i,a){var s;if(h(r)){s=[r,i],i=s[0],a=s[1];r={}}if(i){return new p(r,i,a)}else{return new c(r)}};r.exports.stringWriter=function(r){return new u(r)};r.exports.streamWriter=function(r,i){return new d(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=s}).call(this)},63463:(r,i,a)=>{ +r.exports=function(r,i){if(typeof r!=="string"){throw new TypeError("expected path to be a string")}if(r==="\\"||r==="/")return"/";var s=r.length;if(s<=1)return r;var a="";if(s>4&&r[3]==="\\"){var l=r[2];if((l==="?"||l===".")&&r.slice(0,2)==="\\\\"){r=r.slice(2);a="//"}}var c=r.split(/[/\\]+/);if(i!==false&&c[c.length-1]===""){c.pop()}return a+c.join("/")}},28995:(r,i,s)=>{var a=s(55788);r.exports=a(once);r.exports.strict=a(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(r){var f=function(){if(f.called)return f.value;f.called=true;return f.value=r.apply(this,arguments)};f.called=false;return f}function onceStrict(r){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=r.apply(this,arguments)};var i=r.name||"Function wrapped with `once`";f.onceError=i+" shouldn't be called more than once";f.called=false;return f}},72166:r=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){r.exports={nextTick:nextTick}}else{r.exports=process}function nextTick(r,i,s,a){if(typeof r!=="function"){throw new TypeError('"callback" argument must be a function')}var l=arguments.length;var c,d;switch(l){case 0:case 1:return process.nextTick(r);case 2:return process.nextTick((function afterTickOne(){r.call(null,i)}));case 3:return process.nextTick((function afterTickTwo(){r.call(null,i,s)}));case 4:return process.nextTick((function afterTickThree(){r.call(null,i,s,a)}));default:c=new Array(l-1);d=0;while(d{r.exports=global.process},8622:(r,i,s)=>{r.exports=typeof process!=="undefined"&&typeof process.nextTick==="function"?process.nextTick.bind(process):s(49951)},49951:r=>{r.exports=typeof queueMicrotask==="function"?queueMicrotask:r=>Promise.resolve().then(r)},95639:(r,i,s)=>{"use strict";var a=s(72166);var l=Object.keys||function(r){var i=[];for(var s in r){i.push(s)}return i};r.exports=Duplex;var c=Object.create(s(90310));c.inherits=s(55806);var d=s(33037);var p=s(3522);c.inherits(Duplex,d);{var u=l(p.prototype);for(var A=0;A{"use strict";r.exports=PassThrough;var a=s(68164);var l=Object.create(s(90310));l.inherits=s(55806);l.inherits(PassThrough,a);function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);a.call(this,r)}PassThrough.prototype._transform=function(r,i,s){s(null,r)}},33037:(r,i,s)=>{"use strict";var a=s(72166);r.exports=Readable;var l=s(36514);var c;Readable.ReadableState=ReadableState;var d=s(82361).EventEmitter;var EElistenerCount=function(r,i){return r.listeners(i).length};var p=s(58256);var u=s(91452).Buffer;var A=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return u.from(r)}function _isUint8Array(r){return u.isBuffer(r)||r instanceof A}var h=Object.create(s(90310));h.inherits=s(55806);var g=s(73837);var y=void 0;if(g&&g.debuglog){y=g.debuglog("stream")}else{y=function(){}}var b=s(35365);var w=s(23431);var C;h.inherits(Readable,p);var v=["error","close","destroy","pause","resume"];function prependListener(r,i,s){if(typeof r.prependListener==="function")return r.prependListener(i,s);if(!r._events||!r._events[i])r.on(i,s);else if(l(r._events[i]))r._events[i].unshift(s);else r._events[i]=[s,r._events[i]]}function ReadableState(r,i){c=c||s(95639);r=r||{};var a=i instanceof c;this.objectMode=!!r.objectMode;if(a)this.objectMode=this.objectMode||!!r.readableObjectMode;var l=r.highWaterMark;var d=r.readableHighWaterMark;var p=this.objectMode?16:16*1024;if(l||l===0)this.highWaterMark=l;else if(a&&(d||d===0))this.highWaterMark=d;else this.highWaterMark=p;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new b;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=r.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(r.encoding){if(!C)C=s(39704).s;this.decoder=new C(r.encoding);this.encoding=r.encoding}}function Readable(r){c=c||s(95639);if(!(this instanceof Readable))return new Readable(r);this._readableState=new ReadableState(r,this);this.readable=true;if(r){if(typeof r.read==="function")this._read=r.read;if(typeof r.destroy==="function")this._destroy=r.destroy}p.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(r){if(!this._readableState){return}this._readableState.destroyed=r}});Readable.prototype.destroy=w.destroy;Readable.prototype._undestroy=w.undestroy;Readable.prototype._destroy=function(r,i){this.push(null);i(r)};Readable.prototype.push=function(r,i){var s=this._readableState;var a;if(!s.objectMode){if(typeof r==="string"){i=i||s.defaultEncoding;if(i!==s.encoding){r=u.from(r,i);i=""}a=true}}else{a=true}return readableAddChunk(this,r,i,false,a)};Readable.prototype.unshift=function(r){return readableAddChunk(this,r,null,true,false)};function readableAddChunk(r,i,s,a,l){var c=r._readableState;if(i===null){c.reading=false;onEofChunk(r,c)}else{var d;if(!l)d=chunkInvalid(c,i);if(d){r.emit("error",d)}else if(c.objectMode||i&&i.length>0){if(typeof i!=="string"&&!c.objectMode&&Object.getPrototypeOf(i)!==u.prototype){i=_uint8ArrayToBuffer(i)}if(a){if(c.endEmitted)r.emit("error",new Error("stream.unshift() after end event"));else addChunk(r,c,i,true)}else if(c.ended){r.emit("error",new Error("stream.push() after EOF"))}else{c.reading=false;if(c.decoder&&!s){i=c.decoder.write(i);if(c.objectMode||i.length!==0)addChunk(r,c,i,false);else maybeReadMore(r,c)}else{addChunk(r,c,i,false)}}}else if(!a){c.reading=false}}return needMoreData(c)}function addChunk(r,i,s,a){if(i.flowing&&i.length===0&&!i.sync){r.emit("data",s);r.read(0)}else{i.length+=i.objectMode?1:s.length;if(a)i.buffer.unshift(s);else i.buffer.push(s);if(i.needReadable)emitReadable(r)}maybeReadMore(r,i)}function chunkInvalid(r,i){var s;if(!_isUint8Array(i)&&typeof i!=="string"&&i!==undefined&&!r.objectMode){s=new TypeError("Invalid non-string/buffer chunk")}return s}function needMoreData(r){return!r.ended&&(r.needReadable||r.length=I){r=I}else{r--;r|=r>>>1;r|=r>>>2;r|=r>>>4;r|=r>>>8;r|=r>>>16;r++}return r}function howMuchToRead(r,i){if(r<=0||i.length===0&&i.ended)return 0;if(i.objectMode)return 1;if(r!==r){if(i.flowing&&i.length)return i.buffer.head.data.length;else return i.length}if(r>i.highWaterMark)i.highWaterMark=computeNewHighWaterMark(r);if(r<=i.length)return r;if(!i.ended){i.needReadable=true;return 0}return i.length}Readable.prototype.read=function(r){y("read",r);r=parseInt(r,10);var i=this._readableState;var s=r;if(r!==0)i.emittedReadable=false;if(r===0&&i.needReadable&&(i.length>=i.highWaterMark||i.ended)){y("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)endReadable(this);else emitReadable(this);return null}r=howMuchToRead(r,i);if(r===0&&i.ended){if(i.length===0)endReadable(this);return null}var a=i.needReadable;y("need readable",a);if(i.length===0||i.length-r0)l=fromList(r,i);else l=null;if(l===null){i.needReadable=true;r=0}else{i.length-=r}if(i.length===0){if(!i.ended)i.needReadable=true;if(s!==r&&i.ended)endReadable(this)}if(l!==null)this.emit("data",l);return l};function onEofChunk(r,i){if(i.ended)return;if(i.decoder){var s=i.decoder.end();if(s&&s.length){i.buffer.push(s);i.length+=i.objectMode?1:s.length}}i.ended=true;emitReadable(r)}function emitReadable(r){var i=r._readableState;i.needReadable=false;if(!i.emittedReadable){y("emitReadable",i.flowing);i.emittedReadable=true;if(i.sync)a.nextTick(emitReadable_,r);else emitReadable_(r)}}function emitReadable_(r){y("emit readable");r.emit("readable");flow(r)}function maybeReadMore(r,i){if(!i.readingMore){i.readingMore=true;a.nextTick(maybeReadMore_,r,i)}}function maybeReadMore_(r,i){var s=i.length;while(!i.reading&&!i.flowing&&!i.ended&&i.length1&&indexOf(l.pipes,r)!==-1)&&!u){y("false write response, pause",l.awaitDrain);l.awaitDrain++;A=true}s.pause()}}function onerror(i){y("onerror",i);unpipe();r.removeListener("error",onerror);if(EElistenerCount(r,"error")===0)r.emit("error",i)}prependListener(r,"error",onerror);function onclose(){r.removeListener("finish",onfinish);unpipe()}r.once("close",onclose);function onfinish(){y("onfinish");r.removeListener("close",onclose);unpipe()}r.once("finish",onfinish);function unpipe(){y("unpipe");s.unpipe(r)}r.emit("pipe",s);if(!l.flowing){y("pipe resume");s.resume()}return r};function pipeOnDrain(r){return function(){var i=r._readableState;y("pipeOnDrain",i.awaitDrain);if(i.awaitDrain)i.awaitDrain--;if(i.awaitDrain===0&&EElistenerCount(r,"data")){i.flowing=true;flow(r)}}}Readable.prototype.unpipe=function(r){var i=this._readableState;var s={hasUnpiped:false};if(i.pipesCount===0)return this;if(i.pipesCount===1){if(r&&r!==i.pipes)return this;if(!r)r=i.pipes;i.pipes=null;i.pipesCount=0;i.flowing=false;if(r)r.emit("unpipe",this,s);return this}if(!r){var a=i.pipes;var l=i.pipesCount;i.pipes=null;i.pipesCount=0;i.flowing=false;for(var c=0;c=i.length){if(i.decoder)s=i.buffer.join("");else if(i.buffer.length===1)s=i.buffer.head.data;else s=i.buffer.concat(i.length);i.buffer.clear()}else{s=fromListPartial(r,i.buffer,i.decoder)}return s}function fromListPartial(r,i,s){var a;if(rc.length?c.length:r;if(d===c.length)l+=c;else l+=c.slice(0,r);r-=d;if(r===0){if(d===c.length){++a;if(s.next)i.head=s.next;else i.head=i.tail=null}else{i.head=s;s.data=c.slice(d)}break}++a}i.length-=a;return l}function copyFromBuffer(r,i){var s=u.allocUnsafe(r);var a=i.head;var l=1;a.data.copy(s);r-=a.data.length;while(a=a.next){var c=a.data;var d=r>c.length?c.length:r;c.copy(s,s.length-r,0,d);r-=d;if(r===0){if(d===c.length){++l;if(a.next)i.head=a.next;else i.head=i.tail=null}else{i.head=a;a.data=c.slice(d)}break}++l}i.length-=l;return s}function endReadable(r){var i=r._readableState;if(i.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!i.endEmitted){i.ended=true;a.nextTick(endReadableNT,i,r)}}function endReadableNT(r,i){if(!r.endEmitted&&r.length===0){r.endEmitted=true;i.readable=false;i.emit("end")}}function indexOf(r,i){for(var s=0,a=r.length;s{"use strict";r.exports=Transform;var a=s(95639);var l=Object.create(s(90310));l.inherits=s(55806);l.inherits(Transform,a);function afterTransform(r,i){var s=this._transformState;s.transforming=false;var a=s.writecb;if(!a){return this.emit("error",new Error("write callback called multiple times"))}s.writechunk=null;s.writecb=null;if(i!=null)this.push(i);a(r);var l=this._readableState;l.reading=false;if(l.needReadable||l.length{"use strict";var a=s(72166);r.exports=Writable;function WriteReq(r,i,s){this.chunk=r;this.encoding=i;this.callback=s;this.next=null}function CorkedRequest(r){var i=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(i,r)}}var l=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:a.nextTick;var c;Writable.WritableState=WritableState;var d=Object.create(s(90310));d.inherits=s(55806);var p={deprecate:s(41257)};var u=s(58256);var A=s(91452).Buffer;var h=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(r){return A.from(r)}function _isUint8Array(r){return A.isBuffer(r)||r instanceof h}var g=s(23431);d.inherits(Writable,u);function nop(){}function WritableState(r,i){c=c||s(95639);r=r||{};var a=i instanceof c;this.objectMode=!!r.objectMode;if(a)this.objectMode=this.objectMode||!!r.writableObjectMode;var l=r.highWaterMark;var d=r.writableHighWaterMark;var p=this.objectMode?16:16*1024;if(l||l===0)this.highWaterMark=l;else if(a&&(d||d===0))this.highWaterMark=d;else this.highWaterMark=p;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var u=r.decodeStrings===false;this.decodeStrings=!u;this.defaultEncoding=r.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(r){onwrite(i,r)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var r=this.bufferedRequest;var i=[];while(r){i.push(r);r=r.next}return i};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:p.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(r){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(r){if(y.call(this,r))return true;if(this!==Writable)return false;return r&&r._writableState instanceof WritableState}})}else{y=function(r){return r instanceof this}}function Writable(r){c=c||s(95639);if(!y.call(Writable,this)&&!(this instanceof c)){return new Writable(r)}this._writableState=new WritableState(r,this);this.writable=true;if(r){if(typeof r.write==="function")this._write=r.write;if(typeof r.writev==="function")this._writev=r.writev;if(typeof r.destroy==="function")this._destroy=r.destroy;if(typeof r.final==="function")this._final=r.final}u.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(r,i){var s=new Error("write after end");r.emit("error",s);a.nextTick(i,s)}function validChunk(r,i,s,l){var c=true;var d=false;if(s===null){d=new TypeError("May not write null values to stream")}else if(typeof s!=="string"&&s!==undefined&&!i.objectMode){d=new TypeError("Invalid non-string/buffer chunk")}if(d){r.emit("error",d);a.nextTick(l,d);c=false}return c}Writable.prototype.write=function(r,i,s){var a=this._writableState;var l=false;var c=!a.objectMode&&_isUint8Array(r);if(c&&!A.isBuffer(r)){r=_uint8ArrayToBuffer(r)}if(typeof i==="function"){s=i;i=null}if(c)i="buffer";else if(!i)i=a.defaultEncoding;if(typeof s!=="function")s=nop;if(a.ended)writeAfterEnd(this,s);else if(c||validChunk(this,a,r,s)){a.pendingcb++;l=writeOrBuffer(this,a,c,r,i,s)}return l};Writable.prototype.cork=function(){var r=this._writableState;r.corked++};Writable.prototype.uncork=function(){var r=this._writableState;if(r.corked){r.corked--;if(!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest)clearBuffer(this,r)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(r){if(typeof r==="string")r=r.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+r);this._writableState.defaultEncoding=r;return this};function decodeChunk(r,i,s){if(!r.objectMode&&r.decodeStrings!==false&&typeof i==="string"){i=A.from(i,s)}return i}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(r,i,s,a,l,c){if(!s){var d=decodeChunk(i,a,l);if(a!==d){s=true;l="buffer";a=d}}var p=i.objectMode?1:a.length;i.length+=p;var u=i.length{"use strict";function _classCallCheck(r,i){if(!(r instanceof i)){throw new TypeError("Cannot call a class as a function")}}var a=s(91452).Buffer;var l=s(73837);function copyBuffer(r,i,s){r.copy(i,s)}r.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(r){var i={data:r,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length};BufferList.prototype.unshift=function unshift(r){var i={data:r,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(r){if(this.length===0)return"";var i=this.head;var s=""+i.data;while(i=i.next){s+=r+i.data}return s};BufferList.prototype.concat=function concat(r){if(this.length===0)return a.alloc(0);var i=a.allocUnsafe(r>>>0);var s=this.head;var l=0;while(s){copyBuffer(s.data,i,l);l+=s.data.length;s=s.next}return i};return BufferList}();if(l&&l.inspect&&l.inspect.custom){r.exports.prototype[l.inspect.custom]=function(){var r=l.inspect({length:this.length});return this.constructor.name+" "+r}}},23431:(r,i,s)=>{"use strict";var a=s(72166);function destroy(r,i){var s=this;var l=this._readableState&&this._readableState.destroyed;var c=this._writableState&&this._writableState.destroyed;if(l||c){if(i){i(r)}else if(r){if(!this._writableState){a.nextTick(emitErrorNT,this,r)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;a.nextTick(emitErrorNT,this,r)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(r||null,(function(r){if(!i&&r){if(!s._writableState){a.nextTick(emitErrorNT,s,r)}else if(!s._writableState.errorEmitted){s._writableState.errorEmitted=true;a.nextTick(emitErrorNT,s,r)}}else if(i){i(r)}}));return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(r,i){r.emit("error",i)}r.exports={destroy:destroy,undestroy:undestroy}},58256:(r,i,s)=>{r.exports=s(12781)},36514:r=>{var i={}.toString;r.exports=Array.isArray||function(r){return i.call(r)=="[object Array]"}},91452:(r,i,s)=>{var a=s(14300);var l=a.Buffer;function copyProps(r,i){for(var s in r){i[s]=r[s]}}if(l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow){r.exports=a}else{copyProps(a,i);i.Buffer=SafeBuffer}function SafeBuffer(r,i,s){return l(r,i,s)}copyProps(l,SafeBuffer);SafeBuffer.from=function(r,i,s){if(typeof r==="number"){throw new TypeError("Argument must not be a number")}return l(r,i,s)};SafeBuffer.alloc=function(r,i,s){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}var a=l(r);if(i!==undefined){if(typeof s==="string"){a.fill(i,s)}else{a.fill(i)}}else{a.fill(0)}return a};SafeBuffer.allocUnsafe=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return l(r)};SafeBuffer.allocUnsafeSlow=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return a.SlowBuffer(r)}},39704:(r,i,s)=>{"use strict";var a=s(91452).Buffer;var l=a.isEncoding||function(r){r=""+r;switch(r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(r){if(!r)return"utf8";var i;while(true){switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(i)return;r=(""+r).toLowerCase();i=true}}}function normalizeEncoding(r){var i=_normalizeEncoding(r);if(typeof i!=="string"&&(a.isEncoding===l||!l(r)))throw new Error("Unknown encoding: "+r);return i||r}i.s=StringDecoder;function StringDecoder(r){this.encoding=normalizeEncoding(r);var i;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;i=4;break;case"utf8":this.fillLast=utf8FillLast;i=4;break;case"base64":this.text=base64Text;this.end=base64End;i=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=a.allocUnsafe(i)}StringDecoder.prototype.write=function(r){if(r.length===0)return"";var i;var s;if(this.lastNeed){i=this.fillLast(r);if(i===undefined)return"";s=this.lastNeed;this.lastNeed=0}else{s=0}if(s>5===6)return 2;else if(r>>4===14)return 3;else if(r>>3===30)return 4;return r>>6===2?-1:-2}function utf8CheckIncomplete(r,i,s){var a=i.length-1;if(a=0){if(l>0)r.lastNeed=l-1;return l}if(--a=0){if(l>0)r.lastNeed=l-2;return l}if(--a=0){if(l>0){if(l===2)l=0;else r.lastNeed=l-3}return l}return 0}function utf8CheckExtraBytes(r,i,s){if((i[0]&192)!==128){r.lastNeed=0;return"�"}if(r.lastNeed>1&&i.length>1){if((i[1]&192)!==128){r.lastNeed=1;return"�"}if(r.lastNeed>2&&i.length>2){if((i[2]&192)!==128){r.lastNeed=2;return"�"}}}}function utf8FillLast(r){var i=this.lastTotal-this.lastNeed;var s=utf8CheckExtraBytes(this,r,i);if(s!==undefined)return s;if(this.lastNeed<=r.length){r.copy(this.lastChar,i,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}r.copy(this.lastChar,i,0,r.length);this.lastNeed-=r.length}function utf8Text(r,i){var s=utf8CheckIncomplete(this,r,i);if(!this.lastNeed)return r.toString("utf8",i);this.lastTotal=s;var a=r.length-(s-this.lastNeed);r.copy(this.lastChar,0,a);return r.toString("utf8",i,a)}function utf8End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+"�";return i}function utf16Text(r,i){if((r.length-i)%2===0){var s=r.toString("utf16le",i);if(s){var a=s.charCodeAt(s.length-1);if(a>=55296&&a<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1];return s.slice(0,-1)}}return s}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=r[r.length-1];return r.toString("utf16le",i,r.length-1)}function utf16End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,s)}return i}function base64Text(r,i){var s=(r.length-i)%3;if(s===0)return r.toString("base64",i);this.lastNeed=3-s;this.lastTotal=3;if(s===1){this.lastChar[0]=r[r.length-1]}else{this.lastChar[0]=r[r.length-2];this.lastChar[1]=r[r.length-1]}return r.toString("base64",i,r.length-s)}function base64End(r){var i=r&&r.length?this.write(r):"";if(this.lastNeed)return i+this.lastChar.toString("base64",0,3-this.lastNeed);return i}function simpleWrite(r){return r.toString(this.encoding)}function simpleEnd(r){return r&&r.length?this.write(r):""}},57639:(r,i,s)=>{r.exports=s(19173).PassThrough},19173:(r,i,s)=>{var a=s(12781);if(process.env.READABLE_STREAM==="disable"&&a){r.exports=a;i=r.exports=a.Readable;i.Readable=a.Readable;i.Writable=a.Writable;i.Duplex=a.Duplex;i.Transform=a.Transform;i.PassThrough=a.PassThrough;i.Stream=a}else{i=r.exports=s(33037);i.Stream=a||i;i.Readable=i;i.Writable=s(3522);i.Duplex=s(95639);i.Transform=s(68164);i.PassThrough=s(32372)}},48059:(r,i,s)=>{r.exports=readdirGlob;const a=s(57147);const{EventEmitter:l}=s(82361);const{Minimatch:c}=s(43612);const{resolve:d}=s(71017);function readdir(r,i){return new Promise(((s,l)=>{a.readdir(r,{withFileTypes:true},((r,a)=>{if(r){switch(r.code){case"ENOTDIR":if(i){l(r)}else{s([])}break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":s([]);break;case"ELOOP":default:l(r);break}}else{s(a)}}))}))}function stat(r,i){return new Promise(((s,l)=>{const c=i?a.stat:a.lstat;c(r,((a,l)=>{if(a){switch(a.code){case"ENOENT":if(i){s(stat(r,false))}else{s(null)}break;default:s(null);break}}else{s(l)}}))}))}async function*exploreWalkAsync(r,i,s,a,l,c){let d=await readdir(i+r,c);for(const c of d){let d=c.name;if(d===undefined){d=c;a=true}const p=r+"/"+d;const u=p.slice(1);const A=i+"/"+u;let h=null;if(a||s){h=await stat(A,s)}if(!h&&c.name!==undefined){h=c}if(h===null){h={isDirectory:()=>false}}if(h.isDirectory()){if(!l(u)){yield{relative:u,absolute:A,stats:h};yield*exploreWalkAsync(p,i,s,a,l,false)}}else{yield{relative:u,absolute:A,stats:h}}}}async function*explore(r,i,s,a){yield*exploreWalkAsync("",r,i,s,a,true)}function readOptions(r){return{pattern:r.pattern,dot:!!r.dot,noglobstar:!!r.noglobstar,matchBase:!!r.matchBase,nocase:!!r.nocase,ignore:r.ignore,skip:r.skip,follow:!!r.follow,stat:!!r.stat,nodir:!!r.nodir,mark:!!r.mark,silent:!!r.silent,absolute:!!r.absolute}}class ReaddirGlob extends l{constructor(r,i,s){super();if(typeof i==="function"){s=i;i=null}this.options=readOptions(i||{});this.matchers=[];if(this.options.pattern){const r=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=r.map((r=>new c(r,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase})))}this.ignoreMatchers=[];if(this.options.ignore){const r=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=r.map((r=>new c(r,{dot:true})))}this.skipMatchers=[];if(this.options.skip){const r=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=r.map((r=>new c(r,{dot:true})))}this.iterator=explore(d(r||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this));this.paused=false;this.inactive=false;this.aborted=false;if(s){this._matches=[];this.on("match",(r=>this._matches.push(this.options.absolute?r.absolute:r.relative)));this.on("error",(r=>s(r)));this.on("end",(()=>s(null,this._matches)))}setTimeout((()=>this._next()),0)}_shouldSkipDirectory(r){return this.skipMatchers.some((i=>i.match(r)))}_fileMatches(r,i){const s=r+(i?"/":"");return(this.matchers.length===0||this.matchers.some((r=>r.match(s))))&&!this.ignoreMatchers.some((r=>r.match(s)))&&(!this.options.nodir||!i)}_next(){if(!this.paused&&!this.aborted){this.iterator.next().then((r=>{if(!r.done){const i=r.value.stats.isDirectory();if(this._fileMatches(r.value.relative,i)){let s=r.value.relative;let a=r.value.absolute;if(this.options.mark&&i){s+="/";a+="/"}if(this.options.stat){this.emit("match",{relative:s,absolute:a,stat:r.value.stats})}else{this.emit("match",{relative:s,absolute:a})}}this._next(this.iterator)}else{this.emit("end")}})).catch((r=>{this.abort();this.emit("error",r);if(!r.code&&!this.options.silent){console.error(r)}}))}else{this.inactive=true}}abort(){this.aborted=true}pause(){this.paused=true}resume(){this.paused=false;if(this.inactive){this.inactive=false;this._next()}}}function readdirGlob(r,i,s){return new ReaddirGlob(r,i,s)}readdirGlob.ReaddirGlob=ReaddirGlob},62752:r=>{const i=typeof process==="object"&&process&&process.platform==="win32";r.exports=i?{sep:"\\"}:{sep:"/"}},43612:(r,i,s)=>{const a=r.exports=(r,i,s={})=>{assertValidPattern(i);if(!s.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,s).match(r)};r.exports=a;const l=s(62752);a.sep=l.sep;const c=Symbol("globstar **");a.GLOBSTAR=c;const d=s(11469);const p={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};const u="[^/]";const A=u+"*?";const h="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const g="(?:(?!(?:\\/|^)\\.).)*?";const charSet=r=>r.split("").reduce(((r,i)=>{r[i]=true;return r}),{});const y=charSet("().*{}+?[]^$\\!");const b=charSet("[.(");const w=/\/+/;a.filter=(r,i={})=>(s,l,c)=>a(s,r,i);const ext=(r,i={})=>{const s={};Object.keys(r).forEach((i=>s[i]=r[i]));Object.keys(i).forEach((r=>s[r]=i[r]));return s};a.defaults=r=>{if(!r||typeof r!=="object"||!Object.keys(r).length){return a}const i=a;const m=(s,a,l)=>i(s,a,ext(r,l));m.Minimatch=class Minimatch extends i.Minimatch{constructor(i,s){super(i,ext(r,s))}};m.Minimatch.defaults=s=>i.defaults(ext(r,s)).Minimatch;m.filter=(s,a)=>i.filter(s,ext(r,a));m.defaults=s=>i.defaults(ext(r,s));m.makeRe=(s,a)=>i.makeRe(s,ext(r,a));m.braceExpand=(s,a)=>i.braceExpand(s,ext(r,a));m.match=(s,a,l)=>i.match(s,a,ext(r,l));return m};a.braceExpand=(r,i)=>braceExpand(r,i);const braceExpand=(r,i={})=>{assertValidPattern(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return d(r)};const C=1024*64;const assertValidPattern=r=>{if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>C){throw new TypeError("pattern is too long")}};const v=Symbol("subparse");a.makeRe=(r,i)=>new Minimatch(r,i||{}).makeRe();a.match=(r,i,s={})=>{const a=new Minimatch(i,s);r=r.filter((r=>a.match(r)));if(a.options.nonull&&!r.length){r.push(i)}return r};const globUnescape=r=>r.replace(/\\(.)/g,"$1");const charUnescape=r=>r.replace(/\\([^-\]])/g,"$1");const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const braExpEscape=r=>r.replace(/[[\]\\]/g,"\\$&");class Minimatch{constructor(r,i){assertValidPattern(r);if(!i)i={};this.options=i;this.set=[];this.pattern=r;this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}debug(){}make(){const r=this.pattern;const i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();let s=this.globSet=this.braceExpand();if(i.debug)this.debug=(...r)=>console.error(...r);this.debug(this.pattern,s);s=this.globParts=s.map((r=>r.split(w)));this.debug(this.pattern,s);s=s.map(((r,i,s)=>r.map(this.parse,this)));this.debug(this.pattern,s);s=s.filter((r=>r.indexOf(false)===-1));this.debug(this.pattern,s);this.set=s}parseNegate(){if(this.options.nonegate)return;const r=this.pattern;let i=false;let s=0;for(let a=0;a>> no match, partial?",r,g,i,y);if(g===p)return true}return false}var w;if(typeof A==="string"){w=h===A;this.debug("string match",A,h,w)}else{w=h.match(A);this.debug("pattern match",A,h,w)}if(!w)return false}if(l===p&&d===u){return true}else if(l===p){return s}else if(d===u){return l===p-1&&r[l]===""}throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(r,i){assertValidPattern(r);const s=this.options;if(r==="**"){if(!s.noglobstar)return c;else r="*"}if(r==="")return"";let a="";let l=false;let d=false;const h=[];const g=[];let w;let C=false;let I=-1;let B=-1;let S;let x;let R;let Q=r.charAt(0)===".";let _=s.dot||Q;const patternStart=()=>Q?"":_?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";const subPatternStart=r=>r.charAt(0)==="."?"":s.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";const clearStateChar=()=>{if(w){switch(w){case"*":a+=A;l=true;break;case"?":a+=u;l=true;break;default:a+="\\"+w;break}this.debug("clearStateChar %j %j",w,a);w=false}};for(let i=0,c;i{if(!s){s="\\"}return i+i+s+"|"}));this.debug("tail=%j\n %s",r,r,x,a);const i=x.type==="*"?A:x.type==="?"?u:"\\"+x.type;l=true;a=a.slice(0,x.reStart)+i+"\\("+r}clearStateChar();if(d){a+="\\\\"}const N=b[a.charAt(0)];for(let r=g.length-1;r>-1;r--){const s=g[r];const l=a.slice(0,s.reStart);const c=a.slice(s.reStart,s.reEnd-8);let d=a.slice(s.reEnd);const p=a.slice(s.reEnd-8,s.reEnd)+d;const u=l.split(")").length;const A=l.split("(").length-u;let h=d;for(let r=0;r{r=r.map((r=>typeof r==="string"?regExpEscape(r):r===c?c:r._src)).reduce(((r,i)=>{if(!(r[r.length-1]===c&&i===c)){r.push(i)}return r}),[]);r.forEach(((i,a)=>{if(i!==c||r[a-1]===c){return}if(a===0){if(r.length>1){r[a+1]="(?:\\/|"+s+"\\/)?"+r[a+1]}else{r[a]=s}}else if(a===r.length-1){r[a-1]+="(?:\\/|"+s+")?"}else{r[a-1]+="(?:\\/|\\/"+s+"\\/)"+r[a+1];r[a+1]=c}}));return r.filter((r=>r!==c)).join("/")})).join("|");l="^(?:"+l+")$";if(this.negate)l="^(?!"+l+").*$";try{this.regexp=new RegExp(l,a)}catch(r){this.regexp=false}return this.regexp}match(r,i=this.partial){this.debug("match",r,this.pattern);if(this.comment)return false;if(this.empty)return r==="";if(r==="/"&&i)return true;const s=this.options;if(l.sep!=="/"){r=r.split(l.sep).join("/")}r=r.split(w);this.debug(this.pattern,"split",r);const a=this.set;this.debug(this.pattern,"set",a);let c;for(let i=r.length-1;i>=0;i--){c=r[i];if(c)break}for(let l=0;l{(function(r){r.parser=function(r,i){return new SAXParser(r,i)};r.SAXParser=SAXParser;r.SAXStream=SAXStream;r.createStream=createStream;r.MAX_BUFFER_LENGTH=64*1024;var i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(i,s){if(!(this instanceof SAXParser)){return new SAXParser(i,s)}var a=this;clearBuffers(a);a.q=a.c="";a.bufferCheckPosition=r.MAX_BUFFER_LENGTH;a.opt=s||{};a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags;a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase";a.tags=[];a.closed=a.closedRoot=a.sawRoot=false;a.tag=a.error=null;a.strict=!!i;a.noscript=!!(i||a.opt.noscript);a.state=w.BEGIN;a.strictEntities=a.opt.strictEntities;a.ENTITIES=a.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES);a.attribList=[];if(a.opt.xmlns){a.ns=Object.create(A)}a.trackPosition=a.opt.position!==false;if(a.trackPosition){a.position=a.line=a.column=0}emit(a,"onready")}if(!Object.create){Object.create=function(r){function F(){}F.prototype=r;var i=new F;return i}}if(!Object.keys){Object.keys=function(r){var i=[];for(var s in r)if(r.hasOwnProperty(s))i.push(s);return i}}function checkBufferLength(s){var a=Math.max(r.MAX_BUFFER_LENGTH,10);var l=0;for(var c=0,d=i.length;ca){switch(i[c]){case"textNode":closeText(s);break;case"cdata":emitNode(s,"oncdata",s.cdata);s.cdata="";break;case"script":emitNode(s,"onscript",s.script);s.script="";break;default:error(s,"Max buffer length exceeded: "+i[c])}}l=Math.max(l,p)}var u=r.MAX_BUFFER_LENGTH-l;s.bufferCheckPosition=u+s.position}function clearBuffers(r){for(var s=0,a=i.length;s"||isWhitespace(r)}function isMatch(r,i){return r.test(i)}function notMatch(r,i){return!isMatch(r,i)}var w=0;r.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++};r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(r.ENTITIES).forEach((function(i){var s=r.ENTITIES[i];var a=typeof s==="number"?String.fromCharCode(s):s;r.ENTITIES[i]=a}));for(var C in r.STATE){r.STATE[r.STATE[C]]=C}w=r.STATE;function emit(r,i,s){r[i]&&r[i](s)}function emitNode(r,i,s){if(r.textNode)closeText(r);emit(r,i,s)}function closeText(r){r.textNode=textopts(r.opt,r.textNode);if(r.textNode)emit(r,"ontext",r.textNode);r.textNode=""}function textopts(r,i){if(r.trim)i=i.trim();if(r.normalize)i=i.replace(/\s+/g," ");return i}function error(r,i){closeText(r);if(r.trackPosition){i+="\nLine: "+r.line+"\nColumn: "+r.column+"\nChar: "+r.c}i=new Error(i);r.error=i;emit(r,"onerror",i);return r}function end(r){if(r.sawRoot&&!r.closedRoot)strictFail(r,"Unclosed root tag");if(r.state!==w.BEGIN&&r.state!==w.BEGIN_WHITESPACE&&r.state!==w.TEXT){error(r,"Unexpected end")}closeText(r);r.c="";r.closed=true;emit(r,"onend");SAXParser.call(r,r.strict,r.opt);return r}function strictFail(r,i){if(typeof r!=="object"||!(r instanceof SAXParser)){throw new Error("bad call to strictFail")}if(r.strict){error(r,i)}}function newTag(r){if(!r.strict)r.tagName=r.tagName[r.looseCase]();var i=r.tags[r.tags.length-1]||r;var s=r.tag={name:r.tagName,attributes:{}};if(r.opt.xmlns){s.ns=i.ns}r.attribList.length=0;emitNode(r,"onopentagstart",s)}function qname(r,i){var s=r.indexOf(":");var a=s<0?["",r]:r.split(":");var l=a[0];var c=a[1];if(i&&r==="xmlns"){l="xmlns";c=""}return{prefix:l,local:c}}function attrib(r){if(!r.strict){r.attribName=r.attribName[r.looseCase]()}if(r.attribList.indexOf(r.attribName)!==-1||r.tag.attributes.hasOwnProperty(r.attribName)){r.attribName=r.attribValue="";return}if(r.opt.xmlns){var i=qname(r.attribName,true);var s=i.prefix;var a=i.local;if(s==="xmlns"){if(a==="xml"&&r.attribValue!==p){strictFail(r,"xml: prefix must be bound to "+p+"\n"+"Actual: "+r.attribValue)}else if(a==="xmlns"&&r.attribValue!==u){strictFail(r,"xmlns: prefix must be bound to "+u+"\n"+"Actual: "+r.attribValue)}else{var l=r.tag;var c=r.tags[r.tags.length-1]||r;if(l.ns===c.ns){l.ns=Object.create(c.ns)}l.ns[a]=r.attribValue}}r.attribList.push([r.attribName,r.attribValue])}else{r.tag.attributes[r.attribName]=r.attribValue;emitNode(r,"onattribute",{name:r.attribName,value:r.attribValue})}r.attribName=r.attribValue=""}function openTag(r,i){if(r.opt.xmlns){var s=r.tag;var a=qname(r.tagName);s.prefix=a.prefix;s.local=a.local;s.uri=s.ns[a.prefix]||"";if(s.prefix&&!s.uri){strictFail(r,"Unbound namespace prefix: "+JSON.stringify(r.tagName));s.uri=a.prefix}var l=r.tags[r.tags.length-1]||r;if(s.ns&&l.ns!==s.ns){Object.keys(s.ns).forEach((function(i){emitNode(r,"onopennamespace",{prefix:i,uri:s.ns[i]})}))}for(var c=0,d=r.attribList.length;c";r.tagName="";r.state=w.SCRIPT;return}emitNode(r,"onscript",r.script);r.script=""}var i=r.tags.length;var s=r.tagName;if(!r.strict){s=s[r.looseCase]()}var a=s;while(i--){var l=r.tags[i];if(l.name!==a){strictFail(r,"Unexpected close tag")}else{break}}if(i<0){strictFail(r,"Unmatched closing tag: "+r.tagName);r.textNode+="";r.state=w.TEXT;return}r.tagName=s;var c=r.tags.length;while(c-- >i){var d=r.tag=r.tags.pop();r.tagName=r.tag.name;emitNode(r,"onclosetag",r.tagName);var p={};for(var u in d.ns){p[u]=d.ns[u]}var A=r.tags[r.tags.length-1]||r;if(r.opt.xmlns&&d.ns!==A.ns){Object.keys(d.ns).forEach((function(i){var s=d.ns[i];emitNode(r,"onclosenamespace",{prefix:i,uri:s})}))}}if(i===0)r.closedRoot=true;r.tagName=r.attribValue=r.attribName="";r.attribList.length=0;r.state=w.TEXT}function parseEntity(r){var i=r.entity;var s=i.toLowerCase();var a;var l="";if(r.ENTITIES[i]){return r.ENTITIES[i]}if(r.ENTITIES[s]){return r.ENTITIES[s]}i=s;if(i.charAt(0)==="#"){if(i.charAt(1)==="x"){i=i.slice(2);a=parseInt(i,16);l=a.toString(16)}else{i=i.slice(1);a=parseInt(i,10);l=a.toString(10)}}i=i.replace(/^0+/,"");if(isNaN(a)||l.toLowerCase()!==i){strictFail(r,"Invalid character entity");return"&"+r.entity+";"}return String.fromCodePoint(a)}function beginWhiteSpace(r,i){if(i==="<"){r.state=w.OPEN_WAKA;r.startTagPosition=r.position}else if(!isWhitespace(i)){strictFail(r,"Non-whitespace before first tag.");r.textNode=i;r.state=w.TEXT}}function charAt(r,i){var s="";if(i"){emitNode(i,"onsgmldeclaration",i.sgmlDecl);i.sgmlDecl="";i.state=w.TEXT}else if(isQuote(a)){i.state=w.SGML_DECL_QUOTED;i.sgmlDecl+=a}else{i.sgmlDecl+=a}continue;case w.SGML_DECL_QUOTED:if(a===i.q){i.state=w.SGML_DECL;i.q=""}i.sgmlDecl+=a;continue;case w.DOCTYPE:if(a===">"){i.state=w.TEXT;emitNode(i,"ondoctype",i.doctype);i.doctype=true}else{i.doctype+=a;if(a==="["){i.state=w.DOCTYPE_DTD}else if(isQuote(a)){i.state=w.DOCTYPE_QUOTED;i.q=a}}continue;case w.DOCTYPE_QUOTED:i.doctype+=a;if(a===i.q){i.q="";i.state=w.DOCTYPE}continue;case w.DOCTYPE_DTD:i.doctype+=a;if(a==="]"){i.state=w.DOCTYPE}else if(isQuote(a)){i.state=w.DOCTYPE_DTD_QUOTED;i.q=a}continue;case w.DOCTYPE_DTD_QUOTED:i.doctype+=a;if(a===i.q){i.state=w.DOCTYPE_DTD;i.q=""}continue;case w.COMMENT:if(a==="-"){i.state=w.COMMENT_ENDING}else{i.comment+=a}continue;case w.COMMENT_ENDING:if(a==="-"){i.state=w.COMMENT_ENDED;i.comment=textopts(i.opt,i.comment);if(i.comment){emitNode(i,"oncomment",i.comment)}i.comment=""}else{i.comment+="-"+a;i.state=w.COMMENT}continue;case w.COMMENT_ENDED:if(a!==">"){strictFail(i,"Malformed comment");i.comment+="--"+a;i.state=w.COMMENT}else{i.state=w.TEXT}continue;case w.CDATA:if(a==="]"){i.state=w.CDATA_ENDING}else{i.cdata+=a}continue;case w.CDATA_ENDING:if(a==="]"){i.state=w.CDATA_ENDING_2}else{i.cdata+="]"+a;i.state=w.CDATA}continue;case w.CDATA_ENDING_2:if(a===">"){if(i.cdata){emitNode(i,"oncdata",i.cdata)}emitNode(i,"onclosecdata");i.cdata="";i.state=w.TEXT}else if(a==="]"){i.cdata+="]"}else{i.cdata+="]]"+a;i.state=w.CDATA}continue;case w.PROC_INST:if(a==="?"){i.state=w.PROC_INST_ENDING}else if(isWhitespace(a)){i.state=w.PROC_INST_BODY}else{i.procInstName+=a}continue;case w.PROC_INST_BODY:if(!i.procInstBody&&isWhitespace(a)){continue}else if(a==="?"){i.state=w.PROC_INST_ENDING}else{i.procInstBody+=a}continue;case w.PROC_INST_ENDING:if(a===">"){emitNode(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody});i.procInstName=i.procInstBody="";i.state=w.TEXT}else{i.procInstBody+="?"+a;i.state=w.PROC_INST_BODY}continue;case w.OPEN_TAG:if(isMatch(g,a)){i.tagName+=a}else{newTag(i);if(a===">"){openTag(i)}else if(a==="/"){i.state=w.OPEN_TAG_SLASH}else{if(!isWhitespace(a)){strictFail(i,"Invalid character in tag name")}i.state=w.ATTRIB}}continue;case w.OPEN_TAG_SLASH:if(a===">"){openTag(i,true);closeTag(i)}else{strictFail(i,"Forward-slash in opening tag not followed by >");i.state=w.ATTRIB}continue;case w.ATTRIB:if(isWhitespace(a)){continue}else if(a===">"){openTag(i)}else if(a==="/"){i.state=w.OPEN_TAG_SLASH}else if(isMatch(h,a)){i.attribName=a;i.attribValue="";i.state=w.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case w.ATTRIB_NAME:if(a==="="){i.state=w.ATTRIB_VALUE}else if(a===">"){strictFail(i,"Attribute without value");i.attribValue=i.attribName;attrib(i);openTag(i)}else if(isWhitespace(a)){i.state=w.ATTRIB_NAME_SAW_WHITE}else if(isMatch(g,a)){i.attribName+=a}else{strictFail(i,"Invalid attribute name")}continue;case w.ATTRIB_NAME_SAW_WHITE:if(a==="="){i.state=w.ATTRIB_VALUE}else if(isWhitespace(a)){continue}else{strictFail(i,"Attribute without value");i.tag.attributes[i.attribName]="";i.attribValue="";emitNode(i,"onattribute",{name:i.attribName,value:""});i.attribName="";if(a===">"){openTag(i)}else if(isMatch(h,a)){i.attribName=a;i.state=w.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name");i.state=w.ATTRIB}}continue;case w.ATTRIB_VALUE:if(isWhitespace(a)){continue}else if(isQuote(a)){i.q=a;i.state=w.ATTRIB_VALUE_QUOTED}else{strictFail(i,"Unquoted attribute value");i.state=w.ATTRIB_VALUE_UNQUOTED;i.attribValue=a}continue;case w.ATTRIB_VALUE_QUOTED:if(a!==i.q){if(a==="&"){i.state=w.ATTRIB_VALUE_ENTITY_Q}else{i.attribValue+=a}continue}attrib(i);i.q="";i.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:if(isWhitespace(a)){i.state=w.ATTRIB}else if(a===">"){openTag(i)}else if(a==="/"){i.state=w.OPEN_TAG_SLASH}else if(isMatch(h,a)){strictFail(i,"No whitespace between attributes");i.attribName=a;i.attribValue="";i.state=w.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case w.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(a)){if(a==="&"){i.state=w.ATTRIB_VALUE_ENTITY_U}else{i.attribValue+=a}continue}attrib(i);if(a===">"){openTag(i)}else{i.state=w.ATTRIB}continue;case w.CLOSE_TAG:if(!i.tagName){if(isWhitespace(a)){continue}else if(notMatch(h,a)){if(i.script){i.script+=""){closeTag(i)}else if(isMatch(g,a)){i.tagName+=a}else if(i.script){i.script+=""){closeTag(i)}else{strictFail(i,"Invalid characters in closing tag")}continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var u;var A;switch(i.state){case w.TEXT_ENTITY:u=w.TEXT;A="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:u=w.ATTRIB_VALUE_QUOTED;A="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:u=w.ATTRIB_VALUE_UNQUOTED;A="attribValue";break}if(a===";"){if(i.opt.unparsedEntities){var C=parseEntity(i);i.entity="";i.state=u;i.write(C)}else{i[A]+=parseEntity(i);i.entity="";i.state=u}}else if(isMatch(i.entity.length?b:y,a)){i.entity+=a}else{strictFail(i,"Invalid character in entity name");i[A]+="&"+i.entity+a;i.entity="";i.state=u}continue;default:{throw new Error(i,"Unknown state: "+i.state)}}}if(i.position>=i.bufferCheckPosition){checkBufferLength(i)}return i} +/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var s=16384;var a=[];var l;var c;var d=-1;var p=arguments.length;if(!p){return""}var u="";while(++d1114111||i(A)!==A){throw RangeError("Invalid code point: "+A)}if(A<=65535){a.push(A)}else{A-=65536;l=(A>>10)+55296;c=A%1024+56320;a.push(l,c)}if(d+1===p||a.length>s){u+=r.apply(null,a);a.length=0}}return u};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},35359:(r,i,s)=>{const{EventEmitter:a}=s(82361);const l=new Error("Stream was destroyed");const c=new Error("Premature close");const d=s(8622);const p=s(43396);const u=(1<<28)-1;const A=1;const h=2;const g=4;const y=8;const b=u^A;const w=u^h;const C=1<<4;const v=2<<4;const I=4<<4;const B=8<<4;const S=16<<4;const x=32<<4;const R=64<<4;const Q=128<<4;const _=256<<4;const N=512<<4;const T=1024<<4;const k=2048<<4;const D=4096<<4;const P=8192<<4;const O=S|x;const L=C|D;const M=I|C;const U=_|B;const j=S|P;const H=u^C;const q=u^I;const G=u^(I|D);const z=u^D;const V=u^S;const W=u^(B|N);const Y=u^R;const J=u^O;const $=u^k;const X=u^v;const K=u^P;const Z=u^j;const ee=1<<18;const te=2<<18;const re=4<<18;const ne=8<<18;const ie=16<<18;const se=32<<18;const ae=64<<18;const oe=128<<18;const le=256<<18;const ce=512<<18;const de=u^(ee|le);const pe=u^re;const ue=u^ce;const Ae=u^ie;const fe=u^ne;const me=u^oe;const he=u^te;const ge=C|ee;const ye=u^ge;const be=T|se;const Ee=g|y|h;const we=Ee|A;const Ce=Ee|be;const ve=pe&q;const Ie=oe|k;const Be=Ie&ye;const Se=we|Be;const xe=we|R|T;const Re=we|T|B;const Qe=we|R|B;const _e=we|_|B|N;const Ne=we|C|R|T|D|P;const Te=Ee|R|T;const ke=v|we|k|I;const De=we|ce|se;const Pe=ne|ie;const Oe=ne|ee;const Le=ne|ie|we|ee;const Me=we|ee|ne;const Fe=re|ee;const Ue=ee|le;const je=we|ce|Oe|se;const He=ie|Ee|ce|se;const qe=te|we|oe|re;const Ge=Symbol.asyncIterator||Symbol("asyncIterator");class WritableState{constructor(r,{highWaterMark:i=16384,map:s=null,mapWritable:a,byteLength:l,byteLengthWritable:c}={}){this.stream=r;this.queue=new p;this.highWaterMark=i;this.buffered=0;this.error=null;this.pipeline=null;this.drains=null;this.byteLength=c||l||defaultByteLength;this.map=a||s;this.afterWrite=afterWrite.bind(this);this.afterUpdateNextTick=updateWriteNT.bind(this)}get ended(){return(this.stream._duplexState&se)!==0}push(r){if(this.map!==null)r=this.map(r);this.buffered+=this.byteLength(r);this.queue.push(r);if(this.buffered0;this.error=null;this.pipeline=null;this.byteLength=c||l||defaultByteLength;this.map=a||s;this.pipeTo=null;this.afterRead=afterRead.bind(this);this.afterUpdateNextTick=updateReadNT.bind(this)}get ended(){return(this.stream._duplexState&T)!==0}pipe(r,i){if(this.pipeTo!==null)throw new Error("Can only pipe to one destination");if(typeof i!=="function")i=null;this.stream._duplexState|=x;this.pipeTo=r;this.pipeline=new Pipeline(this.stream,r,i);if(i)this.stream.on("error",noop);if(isStreamx(r)){r._writableState.pipeline=this.pipeline;if(i)r.on("error",noop);r.on("finish",this.pipeline.finished.bind(this.pipeline))}else{const i=this.pipeline.done.bind(this.pipeline,r);const s=this.pipeline.done.bind(this.pipeline,r,null);r.on("error",i);r.on("close",s);r.on("finish",this.pipeline.finished.bind(this.pipeline))}r.on("drain",afterDrain.bind(this));this.stream.emit("piping",r);r.emit("pipe",this.stream)}push(r){const i=this.stream;if(r===null){this.highWaterMark=0;i._duplexState=(i._duplexState|R)&G;return false}if(this.map!==null)r=this.map(r);this.buffered+=this.byteLength(r);this.queue.push(r);i._duplexState=(i._duplexState|B)&z;return this.buffered0)i.push(this.shift());for(let r=0;r0)a.drains.shift().resolve(false);if(a.pipeline!==null)a.pipeline.done(i,r)}}function afterWrite(r){const i=this.stream;if(r)i.destroy(r);i._duplexState&=de;if(this.drains!==null)tickDrains(this.drains);if((i._duplexState&Le)===ie){i._duplexState&=Ae;if((i._duplexState&ae)===ae){i.emit("drain")}}this.updateCallback()}function afterRead(r){if(r)this.stream.destroy(r);this.stream._duplexState&=H;if(this.readAhead===false&&(this.stream._duplexState&S)===0)this.stream._duplexState&=K;this.updateCallback()}function updateReadNT(){if((this.stream._duplexState&v)===0){this.stream._duplexState&=$;this.update()}}function updateWriteNT(){if((this.stream._duplexState&te)===0){this.stream._duplexState&=me;this.update()}}function tickDrains(r){for(let i=0;i=r._readableState.highWaterMark}static isPaused(r){return(r._duplexState&S)===0}[Ge](){const r=this;let i=null;let s=null;let a=null;this.on("error",(r=>{i=r}));this.on("readable",onreadable);this.on("close",onclose);return{[Ge](){return this},next(){return new Promise((function(i,l){s=i;a=l;const c=r.read();if(c!==null)ondata(c);else if((r._duplexState&y)!==0)ondata(null)}))},return(){return destroy(null)},throw(r){return destroy(r)}};function onreadable(){if(s!==null)ondata(r.read())}function onclose(){if(s!==null)ondata(null)}function ondata(c){if(a===null)return;if(i)a(i);else if(c===null&&(r._duplexState&T)===0)a(l);else s({value:c,done:c===null});a=s=null}function destroy(i){r.destroy(i);return new Promise(((s,a)=>{if(r._duplexState&y)return s({value:undefined,done:true});r.once("close",(function(){if(i)a(i);else s({value:undefined,done:true})}))}))}}}class Writable extends Stream{constructor(r){super(r);this._duplexState|=A|T;this._writableState=new WritableState(this,r);if(r){if(r.writev)this._writev=r.writev;if(r.write)this._write=r.write;if(r.final)this._final=r.final;if(r.eagerOpen)this._writableState.updateNextTick()}}_writev(r,i){i(null)}_write(r,i){this._writableState.autoBatch(r,i)}_final(r){r(null)}static isBackpressured(r){return(r._duplexState&He)!==0}static drained(r){if(r.destroyed)return Promise.resolve(false);const i=r._writableState;const s=isWritev(r)?Math.min(1,i.queue.length):i.queue.length;const a=s+(r._duplexState&le?1:0);if(a===0)return Promise.resolve(true);if(i.drains===null)i.drains=[];return new Promise((r=>{i.drains.push({writes:a,resolve:r})}))}write(r){this._writableState.updateNextTick();return this._writableState.push(r)}end(r){this._writableState.updateNextTick();this._writableState.end(r);return this}}class Duplex extends Readable{constructor(r){super(r);this._duplexState=A|this._duplexState&P;this._writableState=new WritableState(this,r);if(r){if(r.writev)this._writev=r.writev;if(r.write)this._write=r.write;if(r.final)this._final=r.final}}_writev(r,i){i(null)}_write(r,i){this._writableState.autoBatch(r,i)}_final(r){r(null)}write(r){this._writableState.updateNextTick();return this._writableState.push(r)}end(r){this._writableState.updateNextTick();this._writableState.end(r);return this}}class Transform extends Duplex{constructor(r){super(r);this._transformState=new TransformState(this);if(r){if(r.transform)this._transform=r.transform;if(r.flush)this._flush=r.flush}}_write(r,i){if(this._readableState.buffered>=this._readableState.highWaterMark){this._transformState.data=r}else{this._transform(r,this._transformState.afterTransform)}}_read(r){if(this._transformState.data!==null){const i=this._transformState.data;this._transformState.data=null;r(null);this._transform(i,this._transformState.afterTransform)}else{r(null)}}destroy(r){super.destroy(r);if(this._transformState.data!==null){this._transformState.data=null;this._transformState.afterTransform()}}_transform(r,i){i(null,r)}_flush(r){r(null)}_final(r){this._transformState.afterFinal=r;this._flush(transformAfterFlush.bind(this))}}class PassThrough extends Transform{}function transformAfterFlush(r,i){const s=this._transformState.afterFinal;if(r)return s(r);if(i!==null&&i!==undefined)this.push(i);this.push(null);s(null)}function pipelinePromise(...r){return new Promise(((i,s)=>pipeline(...r,(r=>{if(r)return s(r);i()}))))}function pipeline(r,...i){const s=Array.isArray(r)?[...r,...i]:[r,...i];const a=s.length&&typeof s[s.length-1]==="function"?s.pop():null;if(s.length<2)throw new Error("Pipeline requires at least 2 streams");let l=s[0];let d=null;let p=null;for(let r=1;r1,onerror);l.pipe(d)}l=d}if(a){let r=false;const i=isStreamx(d)||!!(d._writableState&&d._writableState.autoDestroy);d.on("error",(r=>{if(p===null)p=r}));d.on("finish",(()=>{r=true;if(!i)a(p)}));if(i){d.on("close",(()=>a(p||(r?null:c))))}}return d;function errorHandle(r,i,s,a){r.on("error",a);r.on("close",onclose);function onclose(){if(i&&r._readableState&&!r._readableState.ended)return a(c);if(s&&r._writableState&&!r._writableState.ended)return a(c)}}function onerror(r){if(!r||p)return;p=r;for(const i of s){i.destroy(r)}}}function isStream(r){return!!r._readableState||!!r._writableState}function isStreamx(r){return typeof r._duplexState==="number"&&isStream(r)}function getStreamError(r){const i=r._readableState&&r._readableState.error||r._writableState&&r._writableState.error;return i===l?null:i}function isReadStreamx(r){return isStreamx(r)&&r.readable}function isTypedArray(r){return typeof r==="object"&&r!==null&&typeof r.byteLength==="number"}function defaultByteLength(r){return isTypedArray(r)?r.byteLength:1024}function noop(){}function abort(){this.destroy(new Error("Stream aborted."))}function isWritev(r){return r._writev!==Writable.prototype._writev&&r._writev!==Duplex.prototype._writev}r.exports={pipeline:pipeline,pipelinePromise:pipelinePromise,isStream:isStream,isStreamx:isStreamx,getStreamError:getStreamError,Stream:Stream,Writable:Writable,Readable:Readable,Duplex:Duplex,Transform:Transform,PassThrough:PassThrough}},21136:(r,i,s)=>{const a={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{r.exports=s(57147).constants||a}catch{r.exports=a}},18246:(r,i,s)=>{const{Writable:a,Readable:l,getStreamError:c}=s(35359);const d=s(43396);const p=s(49320);const u=s(80209);const A=p.alloc(0);class BufferList{constructor(){this.buffered=0;this.shifted=0;this.queue=new d;this._offset=0}push(r){this.buffered+=r.byteLength;this.queue.push(r)}shiftFirst(r){return this._buffered===0?null:this._next(r)}shift(r){if(r>this.buffered)return null;if(r===0)return A;let i=this._next(r);if(r===i.byteLength)return i;const s=[i];while((r-=i.byteLength)>0){i=this._next(r);s.push(i)}return p.concat(s)}_next(r){const i=this.queue.peek();const s=i.byteLength-this._offset;if(r>=s){const r=this._offset?i.subarray(this._offset,i.byteLength):i;this.queue.shift();this._offset=0;this.buffered-=s;this.shifted+=s;return r}this.buffered-=r;this.shifted+=r;return i.subarray(this._offset,this._offset+=r)}}class Source extends l{constructor(r,i,s){super();this.header=i;this.offset=s;this._parent=r}_read(r){if(this.header.size===0){this.push(null)}if(this._parent._stream===this){this._parent._update()}r(null)}_predestroy(){this._parent.destroy(c(this))}_detach(){if(this._parent._stream===this){this._parent._stream=null;this._parent._missing=overflow(this.header.size);this._parent._update()}}_destroy(r){this._detach();r(null)}}class Extract extends a{constructor(r){super(r);if(!r)r={};this._buffer=new BufferList;this._offset=0;this._header=null;this._stream=null;this._missing=0;this._longHeader=false;this._callback=noop;this._locked=false;this._finished=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;this._filenameEncoding=r.filenameEncoding||"utf-8";this._allowUnknownFormat=!!r.allowUnknownFormat;this._unlockBound=this._unlock.bind(this)}_unlock(r){this._locked=false;if(r){this.destroy(r);this._continueWrite(r);return}this._update()}_consumeHeader(){if(this._locked)return false;this._offset=this._buffer.shifted;try{this._header=u.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(r){this._continueWrite(r);return false}if(!this._header)return true;switch(this._header.type){case"gnu-long-path":case"gnu-long-link-path":case"pax-global-header":case"pax-header":this._longHeader=true;this._missing=this._header.size;return true}this._locked=true;this._applyLongHeaders();if(this._header.size===0||this._header.type==="directory"){this.emit("entry",this._header,this._createStream(),this._unlockBound);return true}this._stream=this._createStream();this._missing=this._header.size;this.emit("entry",this._header,this._stream,this._unlockBound);return true}_applyLongHeaders(){if(this._gnuLongPath){this._header.name=this._gnuLongPath;this._gnuLongPath=null}if(this._gnuLongLinkPath){this._header.linkname=this._gnuLongLinkPath;this._gnuLongLinkPath=null}if(this._pax){if(this._pax.path)this._header.name=this._pax.path;if(this._pax.linkpath)this._header.linkname=this._pax.linkpath;if(this._pax.size)this._header.size=parseInt(this._pax.size,10);this._header.pax=this._pax;this._pax=null}}_decodeLongHeader(r){switch(this._header.type){case"gnu-long-path":this._gnuLongPath=u.decodeLongPath(r,this._filenameEncoding);break;case"gnu-long-link-path":this._gnuLongLinkPath=u.decodeLongPath(r,this._filenameEncoding);break;case"pax-global-header":this._paxGlobal=u.decodePax(r);break;case"pax-header":this._pax=this._paxGlobal===null?u.decodePax(r):Object.assign({},this._paxGlobal,u.decodePax(r));break}}_consumeLongHeader(){this._longHeader=false;this._missing=overflow(this._header.size);const r=this._buffer.shift(this._header.size);try{this._decodeLongHeader(r)}catch(r){this._continueWrite(r);return false}return true}_consumeStream(){const r=this._buffer.shiftFirst(this._missing);if(r===null)return false;this._missing-=r.byteLength;const i=this._stream.push(r);if(this._missing===0){this._stream.push(null);if(i)this._stream._detach();return i&&this._locked===false}return i}_createStream(){return new Source(this,this._header,this._offset)}_update(){while(this._buffer.buffered>0&&!this.destroying){if(this._missing>0){if(this._stream!==null){if(this._consumeStream()===false)return;continue}if(this._longHeader===true){if(this._missing>this._buffer.buffered)break;if(this._consumeLongHeader()===false)return false;continue}const r=this._buffer.shiftFirst(this._missing);if(r!==null)this._missing-=r.byteLength;continue}if(this._buffer.buffered<512)break;if(this._stream!==null||this._consumeHeader()===false)return}this._continueWrite(null)}_continueWrite(r){const i=this._callback;this._callback=noop;i(r)}_write(r,i){this._callback=i;this._buffer.push(r);this._update()}_final(r){this._finished=this._missing===0&&this._buffer.buffered===0;r(this._finished?null:new Error("Unexpected end of data"))}_predestroy(){this._continueWrite(null)}_destroy(r){if(this._stream)this._stream.destroy(c(this));r(null)}[Symbol.asyncIterator](){let r=null;let i=null;let s=null;let a=null;let l=null;const c=this;this.on("entry",onentry);this.on("error",(i=>{r=i}));this.on("close",onclose);return{[Symbol.asyncIterator](){return this},next(){return new Promise(onnext)},return(){return destroy(null)},throw(r){return destroy(r)}};function consumeCallback(r){if(!l)return;const i=l;l=null;i(r)}function onnext(l,d){if(r){return d(r)}if(a){l({value:a,done:false});a=null;return}i=l;s=d;consumeCallback(null);if(c._finished&&i){i({value:undefined,done:true});i=s=null}}function onentry(r,c,d){l=d;c.on("error",noop);if(i){i({value:c,done:false});i=s=null}else{a=c}}function onclose(){consumeCallback(r);if(!i)return;if(r)s(r);else i({value:undefined,done:true});i=s=null}function destroy(r){c.destroy(r);consumeCallback(r);return new Promise(((i,s)=>{if(c.destroyed)return i({value:undefined,done:true});c.once("close",(function(){if(r)s(r);else i({value:undefined,done:true})}))}))}}}r.exports=function extract(r){return new Extract(r)};function noop(){}function overflow(r){r&=511;return r&&512-r}},80209:(r,i,s)=>{const a=s(49320);const l="0000000000000000000";const c="7777777777777777777";const d="0".charCodeAt(0);const p=a.from([117,115,116,97,114,0]);const u=a.from([d,d]);const A=a.from([117,115,116,97,114,32]);const h=a.from([32,0]);const g=4095;const y=257;const b=263;i.decodeLongPath=function decodeLongPath(r,i){return decodeStr(r,0,r.length,i)};i.encodePax=function encodePax(r){let i="";if(r.name)i+=addLength(" path="+r.name+"\n");if(r.linkname)i+=addLength(" linkpath="+r.linkname+"\n");const s=r.pax;if(s){for(const r in s){i+=addLength(" "+r+"="+s[r]+"\n")}}return a.from(i)};i.decodePax=function decodePax(r){const i={};while(r.length){let s=0;while(s100){const r=s.indexOf("/");if(r===-1)return null;l+=l?"/"+s.slice(0,r):s.slice(0,r);s=s.slice(r+1)}if(a.byteLength(s)>100||a.byteLength(l)>155)return null;if(r.linkname&&a.byteLength(r.linkname)>100)return null;a.write(i,s);a.write(i,encodeOct(r.mode&g,6),100);a.write(i,encodeOct(r.uid,6),108);a.write(i,encodeOct(r.gid,6),116);encodeSize(r.size,i,124);a.write(i,encodeOct(r.mtime.getTime()/1e3|0,11),136);i[156]=d+toTypeflag(r.type);if(r.linkname)a.write(i,r.linkname,157);a.copy(p,i,y);a.copy(u,i,b);if(r.uname)a.write(i,r.uname,265);if(r.gname)a.write(i,r.gname,297);a.write(i,encodeOct(r.devmajor||0,6),329);a.write(i,encodeOct(r.devminor||0,6),337);if(l)a.write(i,l,345);a.write(i,encodeOct(cksum(i),6),148);return i};i.decode=function decode(r,i,s){let a=r[156]===0?0:r[156]-d;let l=decodeStr(r,0,100,i);const c=decodeOct(r,100,8);const p=decodeOct(r,108,8);const u=decodeOct(r,116,8);const A=decodeOct(r,124,12);const h=decodeOct(r,136,12);const g=toType(a);const y=r[157]===0?null:decodeStr(r,157,100,i);const b=decodeStr(r,265,32);const w=decodeStr(r,297,32);const C=decodeOct(r,329,8);const v=decodeOct(r,337,8);const I=cksum(r);if(I===8*32)return null;if(I!==decodeOct(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(isUSTAR(r)){if(r[345])l=decodeStr(r,345,155,i)+"/"+l}else if(isGNU(r)){}else{if(!s){throw new Error("Invalid tar header: unknown format.")}}if(a===0&&l&&l[l.length-1]==="/")a=5;return{name:l,mode:c,uid:p,gid:u,size:A,mtime:new Date(1e3*h),type:g,linkname:y,uname:b,gname:w,devmajor:C,devminor:v,pax:null}};function isUSTAR(r){return a.equals(p,r.subarray(y,y+6))}function isGNU(r){return a.equals(A,r.subarray(y,y+6))&&a.equals(h,r.subarray(b,b+2))}function clamp(r,i,s){if(typeof r!=="number")return s;r=~~r;if(r>=i)return i;if(r>=0)return r;r+=i;if(r>=0)return r;return 0}function toType(r){switch(r){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function toTypeflag(r){switch(r){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function indexOf(r,i,s,a){for(;si)return c.slice(0,i)+" ";return l.slice(0,i-r.length)+r+" "}function encodeSizeBin(r,i,s){i[s]=128;for(let a=11;a>0;a--){i[s+a]=r&255;r=Math.floor(r/256)}}function encodeSize(r,i,s){if(r.toString(8).length>11){encodeSizeBin(r,i,s)}else{a.write(i,encodeOct(r,11),s)}}function parse256(r){let i;if(r[0]===128)i=true;else if(r[0]===255)i=false;else return null;const s=[];let a;for(a=r.length-1;a>0;a--){const l=r[a];if(i)s.push(l);else s.push(255-l)}let l=0;const c=s.length;for(a=0;a=Math.pow(10,s))s++;return i+s+r}},28344:(r,i,s)=>{i.extract=s(18246);i.pack=s(87875)},87875:(r,i,s)=>{const{Readable:a,Writable:l,getStreamError:c}=s(35359);const d=s(49320);const p=s(21136);const u=s(80209);const A=493;const h=420;const g=d.alloc(1024);class Sink extends l{constructor(r,i,s){super({mapWritable:mapWritable,eagerOpen:true});this.written=0;this.header=i;this._callback=s;this._linkname=null;this._isLinkname=i.type==="symlink"&&!i.linkname;this._isVoid=i.type!=="file"&&i.type!=="contiguous-file";this._finished=false;this._pack=r;this._openCallback=null;if(this._pack._stream===null)this._pack._stream=this;else this._pack._pending.push(this)}_open(r){this._openCallback=r;if(this._pack._stream===this)this._continueOpen()}_continuePack(r){if(this._callback===null)return;const i=this._callback;this._callback=null;i(r)}_continueOpen(){if(this._pack._stream===null)this._pack._stream=this;const r=this._openCallback;this._openCallback=null;if(r===null)return;if(this._pack.destroying)return r(new Error("pack stream destroyed"));if(this._pack._finalized)return r(new Error("pack stream is already finalized"));this._pack._stream=this;if(!this._isLinkname){this._pack._encode(this.header)}if(this._isVoid){this._finish();this._continuePack(null)}r(null)}_write(r,i){if(this._isLinkname){this._linkname=this._linkname?d.concat([this._linkname,r]):r;return i(null)}if(this._isVoid){if(r.byteLength>0){return i(new Error("No body allowed for this entry"))}return i()}this.written+=r.byteLength;if(this._pack.push(r))return i();this._pack._drain=i}_finish(){if(this._finished)return;this._finished=true;if(this._isLinkname){this.header.linkname=this._linkname?d.toString(this._linkname,"utf-8"):"";this._pack._encode(this.header)}overflow(this._pack,this.header.size);this._pack._done(this)}_final(r){if(this.written!==this.header.size){return r(new Error("Size mismatch"))}this._finish();r(null)}_getError(){return c(this)||new Error("tar entry destroyed")}_predestroy(){this._pack.destroy(this._getError())}_destroy(r){this._pack._done(this);this._continuePack(this._finished?null:this._getError());r()}}class Pack extends a{constructor(r){super(r);this._drain=noop;this._finalized=false;this._finalizing=false;this._pending=[];this._stream=null}entry(r,i,s){if(this._finalized||this.destroying)throw new Error("already finalized or destroyed");if(typeof i==="function"){s=i;i=null}if(!s)s=noop;if(!r.size||r.type==="symlink")r.size=0;if(!r.type)r.type=modeToType(r.mode);if(!r.mode)r.mode=r.type==="directory"?A:h;if(!r.uid)r.uid=0;if(!r.gid)r.gid=0;if(!r.mtime)r.mtime=new Date;if(typeof i==="string")i=d.from(i);const a=new Sink(this,r,s);if(d.isBuffer(i)){r.size=i.byteLength;a.write(i);a.end();return a}if(a._isVoid){return a}return a}finalize(){if(this._stream||this._pending.length>0){this._finalizing=true;return}if(this._finalized)return;this._finalized=true;this.push(g);this.push(null)}_done(r){if(r!==this._stream)return;this._stream=null;if(this._finalizing)this.finalize();if(this._pending.length)this._pending.shift()._continueOpen()}_encode(r){if(!r.pax){const i=u.encode(r);if(i){this.push(i);return}}this._encodePax(r)}_encodePax(r){const i=u.encodePax({name:r.name,linkname:r.linkname,pax:r.pax});const s={name:"PaxHeader",mode:r.mode,uid:r.uid,gid:r.gid,size:i.byteLength,mtime:r.mtime,type:"pax-header",linkname:r.linkname&&"PaxHeader",uname:r.uname,gname:r.gname,devmajor:r.devmajor,devminor:r.devminor};this.push(u.encode(s));this.push(i);overflow(this,i.byteLength);s.size=r.size;s.type=r.type;this.push(u.encode(s))}_doDrain(){const r=this._drain;this._drain=noop;r()}_predestroy(){const r=c(this);if(this._stream)this._stream.destroy(r);while(this._pending.length){const i=this._pending.shift();i.destroy(r);i._continueOpen()}this._doDrain()}_read(r){this._doDrain();r()}}r.exports=function pack(r){return new Pack(r)};function modeToType(r){switch(r&p.S_IFMT){case p.S_IFBLK:return"block-device";case p.S_IFCHR:return"character-device";case p.S_IFDIR:return"directory";case p.S_IFIFO:return"fifo";case p.S_IFLNK:return"symlink"}return"file"}function noop(){}function overflow(r,i){i&=511;if(i)r.push(g.subarray(0,512-i))}function mapWritable(r){return d.isBuffer(r)?r:d.from(r)}},60265:(r,i,s)=>{"use strict";var a=s(85477);var l=s(65441);var c={TRANSITIONAL:0,NONTRANSITIONAL:1};function normalize(r){return r.split("\0").map((function(r){return r.normalize("NFC")})).join("\0")}function findStatus(r){var i=0;var s=l.length-1;while(i<=s){var a=Math.floor((i+s)/2);var c=l[a];if(c[0][0]<=r&&c[0][1]>=r){return c}else if(c[0][0]>r){s=a-1}else{i=a+1}}return null}var d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function countSymbols(r){return r.replace(d,"_").length}function mapChars(r,i,s){var a=false;var l="";var d=countSymbols(r);for(var p=0;p253||p.length===0){c.error=true}for(var u=0;u63||d.length===0){c.error=true;break}}}if(c.error)return null;return d.join(".")};r.exports.toUnicode=function(r,i){var s=processing(r,i,c.NONTRANSITIONAL);return{domain:s.string,error:s.error}};r.exports.PROCESSING_OPTIONS=c},35363:r=>{r.exports=Traverse;function Traverse(r){if(!(this instanceof Traverse))return new Traverse(r);this.value=r}Traverse.prototype.get=function(r){var i=this.value;for(var s=0;s{var i;var s;var a;var l;var c;var d;var p;var u;var A;var h;var g;var y;var b;var w;var C;var v;var I;var B;var S;var x;var R;var Q;var _;var N;var T;var k;var D;var P;var O;var L;var M;(function(i){var s=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(r){i(createExporter(s,createExporter(r)))}))}else if(true&&typeof r.exports==="object"){i(createExporter(s,createExporter(r.exports)))}else{i(createExporter(s))}function createExporter(r,i){if(r!==s){if(typeof Object.create==="function"){Object.defineProperty(r,"__esModule",{value:true})}else{r.__esModule=true}}return function(s,a){return r[s]=i?i(s,a):a}}})((function(r){var U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s))r[s]=i[s]};i=function(r,i){if(typeof i!=="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");U(r,i);function __(){this.constructor=r}r.prototype=i===null?Object.create(i):(__.prototype=i.prototype,new __)};s=Object.assign||function(r){for(var i,s=1,a=arguments.length;s=0;p--)if(d=r[p])c=(l<3?d(c):l>3?d(i,s,c):d(i,s))||c;return l>3&&c&&Object.defineProperty(i,s,c),c};c=function(r,i){return function(s,a){i(s,a,r)}};d=function(r,i,s,a,l,c){function accept(r){if(r!==void 0&&typeof r!=="function")throw new TypeError("Function expected");return r}var d=a.kind,p=d==="getter"?"get":d==="setter"?"set":"value";var u=!i&&r?a["static"]?r:r.prototype:null;var A=i||(u?Object.getOwnPropertyDescriptor(u,a.name):{});var h,g=false;for(var y=s.length-1;y>=0;y--){var b={};for(var w in a)b[w]=w==="access"?{}:a[w];for(var w in a.access)b.access[w]=a.access[w];b.addInitializer=function(r){if(g)throw new TypeError("Cannot add initializers after decoration has completed");c.push(accept(r||null))};var C=(0,s[y])(d==="accessor"?{get:A.get,set:A.set}:A[p],b);if(d==="accessor"){if(C===void 0)continue;if(C===null||typeof C!=="object")throw new TypeError("Object expected");if(h=accept(C.get))A.get=h;if(h=accept(C.set))A.set=h;if(h=accept(C.init))l.unshift(h)}else if(h=accept(C)){if(d==="field")l.unshift(h);else A[p]=h}}if(u)Object.defineProperty(u,a.name,A);g=true};p=function(r,i,s){var a=arguments.length>2;for(var l=0;l0&&c[c.length-1])&&(p[0]===6||p[0]===2)){s=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]=r.length)r=void 0;return{value:r&&r[a++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")};C=function(r,i){var s=typeof Symbol==="function"&&r[Symbol.iterator];if(!s)return r;var a=s.call(r),l,c=[],d;try{while((i===void 0||i-- >0)&&!(l=a.next()).done)c.push(l.value)}catch(r){d={error:r}}finally{try{if(l&&!l.done&&(s=a["return"]))s.call(a)}finally{if(d)throw d.error}}return c};v=function(){for(var r=[],i=0;i1||resume(r,i)}))}}function resume(r,i){try{step(a[r](i))}catch(r){settle(c[0][3],r)}}function step(r){r.value instanceof S?Promise.resolve(r.value.v).then(fulfill,reject):settle(c[0][2],r)}function fulfill(r){resume("next",r)}function reject(r){resume("throw",r)}function settle(r,i){if(r(i),c.shift(),c.length)resume(c[0][0],c[0][1])}};R=function(r){var i,s;return i={},verb("next"),verb("throw",(function(r){throw r})),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(a,l){i[a]=r[a]?function(i){return(s=!s)?{value:S(r[a](i)),done:false}:l?l(i):i}:l}};Q=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],s;return i?i.call(r):(r=typeof w==="function"?w(r):r[Symbol.iterator](),s={},verb("next"),verb("throw"),verb("return"),s[Symbol.asyncIterator]=function(){return this},s);function verb(i){s[i]=r[i]&&function(s){return new Promise((function(a,l){s=r[i](s),settle(a,l,s.done,s.value)}))}}function settle(r,i,s,a){Promise.resolve(a).then((function(i){r({value:i,done:s})}),i)}};_=function(r,i){if(Object.defineProperty){Object.defineProperty(r,"raw",{value:i})}else{r.raw=i}return r};var j=Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i};N=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))O(i,r,s);j(i,r);return i};T=function(r){return r&&r.__esModule?r:{default:r}};k=function(r,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i==="function"?r!==i||!a:!i.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(r):a?a.value:i.get(r)};D=function(r,i,s,a,l){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof i==="function"?r!==i||!l:!i.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?l.call(r,s):l?l.value=s:i.set(r,s),s};P=function(r,i){if(i===null||typeof i!=="object"&&typeof i!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r==="function"?i===r:r.has(i)};L=function(r,i,s){if(i!==null&&i!==void 0){if(typeof i!=="object"&&typeof i!=="function")throw new TypeError("Object expected.");var a;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");a=i[Symbol.asyncDispose]}if(a===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");a=i[Symbol.dispose]}if(typeof a!=="function")throw new TypeError("Object not disposable.");r.stack.push({value:i,dispose:a,async:s})}else if(s){r.stack.push({async:true})}return i};var H=typeof SuppressedError==="function"?SuppressedError:function(r,i,s){var a=new Error(s);return a.name="SuppressedError",a.error=r,a.suppressed=i,a};M=function(r){function fail(i){r.error=r.hasError?new H(i,r.error,"An error was suppressed during disposal."):i;r.hasError=true}function next(){while(r.stack.length){var i=r.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(next,(function(r){fail(r);return next()}))}catch(r){fail(r)}}if(r.hasError)throw r.error}return next()};r("__extends",i);r("__assign",s);r("__rest",a);r("__decorate",l);r("__param",c);r("__esDecorate",d);r("__runInitializers",p);r("__propKey",u);r("__setFunctionName",A);r("__metadata",h);r("__awaiter",g);r("__generator",y);r("__exportStar",b);r("__createBinding",O);r("__values",w);r("__read",C);r("__spread",v);r("__spreadArrays",I);r("__spreadArray",B);r("__await",S);r("__asyncGenerator",x);r("__asyncDelegator",R);r("__asyncValues",Q);r("__makeTemplateObject",_);r("__importStar",N);r("__importDefault",T);r("__classPrivateFieldGet",k);r("__classPrivateFieldSet",D);r("__classPrivateFieldIn",P);r("__addDisposableResource",L);r("__disposeResources",M)}))},70391:(r,i,s)=>{r.exports=s(37832)},37832:(r,i,s)=>{"use strict";var a=s(41808);var l=s(24404);var c=s(13685);var d=s(95687);var p=s(82361);var u=s(39491);var A=s(73837);i.httpOverHttp=httpOverHttp;i.httpsOverHttp=httpsOverHttp;i.httpOverHttps=httpOverHttps;i.httpsOverHttps=httpsOverHttps;function httpOverHttp(r){var i=new TunnelingAgent(r);i.request=c.request;return i}function httpsOverHttp(r){var i=new TunnelingAgent(r);i.request=c.request;i.createSocket=createSecureSocket;i.defaultPort=443;return i}function httpOverHttps(r){var i=new TunnelingAgent(r);i.request=d.request;return i}function httpsOverHttps(r){var i=new TunnelingAgent(r);i.request=d.request;i.createSocket=createSecureSocket;i.defaultPort=443;return i}function TunnelingAgent(r){var i=this;i.options=r||{};i.proxyOptions=i.options.proxy||{};i.maxSockets=i.options.maxSockets||c.Agent.defaultMaxSockets;i.requests=[];i.sockets=[];i.on("free",(function onFree(r,s,a,l){var c=toOptions(s,a,l);for(var d=0,p=i.requests.length;d=this.maxSockets){l.requests.push(c);return}l.createSocket(c,(function(i){i.on("free",onFree);i.on("close",onCloseOrRemove);i.on("agentRemove",onCloseOrRemove);r.onSocket(i);function onFree(){l.emit("free",i,c)}function onCloseOrRemove(r){l.removeSocket(i);i.removeListener("free",onFree);i.removeListener("close",onCloseOrRemove);i.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(r,i){var s=this;var a={};s.sockets.push(a);var l=mergeOptions({},s.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:false,headers:{host:r.host+":"+r.port}});if(r.localAddress){l.localAddress=r.localAddress}if(l.proxyAuth){l.headers=l.headers||{};l.headers["Proxy-Authorization"]="Basic "+new Buffer(l.proxyAuth).toString("base64")}h("making CONNECT request");var c=s.request(l);c.useChunkedEncodingByDefault=false;c.once("response",onResponse);c.once("upgrade",onUpgrade);c.once("connect",onConnect);c.once("error",onError);c.end();function onResponse(r){r.upgrade=true}function onUpgrade(r,i,s){process.nextTick((function(){onConnect(r,i,s)}))}function onConnect(l,d,p){c.removeAllListeners();d.removeAllListeners();if(l.statusCode!==200){h("tunneling socket could not be established, statusCode=%d",l.statusCode);d.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+l.statusCode);u.code="ECONNRESET";r.request.emit("error",u);s.removeSocket(a);return}if(p.length>0){h("got illegal response body from proxy");d.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";r.request.emit("error",u);s.removeSocket(a);return}h("tunneling connection has established");s.sockets[s.sockets.indexOf(a)]=d;return i(d)}function onError(i){c.removeAllListeners();h("tunneling socket could not be established, cause=%s\n",i.message,i.stack);var l=new Error("tunneling socket could not be established, "+"cause="+i.message);l.code="ECONNRESET";r.request.emit("error",l);s.removeSocket(a)}};TunnelingAgent.prototype.removeSocket=function removeSocket(r){var i=this.sockets.indexOf(r);if(i===-1){return}this.sockets.splice(i,1);var s=this.requests.shift();if(s){this.createSocket(s,(function(r){s.request.onSocket(r)}))}};function createSecureSocket(r,i){var s=this;TunnelingAgent.prototype.createSocket.call(s,r,(function(a){var c=r.request.getHeader("host");var d=mergeOptions({},s.options,{socket:a,servername:c?c.replace(/:.*$/,""):r.host});var p=l.connect(0,d);s.sockets[s.sockets.indexOf(a)]=p;i(p)}))}function toOptions(r,i,s){if(typeof r==="string"){return{host:r,port:i,localAddress:s}}return r}function mergeOptions(r){for(var i=1,s=arguments.length;i{"use strict";Object.defineProperty(i,"__esModule",{value:true})},21322:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isValidErrorCode=i.httpStatusFromErrorCode=i.TwirpErrorCode=i.BadRouteError=i.InternalServerErrorWith=i.InternalServerError=i.RequiredArgumentError=i.InvalidArgumentError=i.NotFoundError=i.TwirpError=void 0;class TwirpError extends Error{constructor(r,i){super(i);this.code=s.Internal;this.meta={};this.code=r;this.msg=i;Object.setPrototypeOf(this,TwirpError.prototype)}withMeta(r,i){this.meta[r]=i;return this}getMeta(r){return this.meta[r]||""}withCause(r,i=false){this._originalCause=r;if(i){this.withMeta("cause",r.message)}return this}cause(){return this._originalCause}toJSON(){try{return JSON.stringify({code:this.code,msg:this.msg,meta:this.meta})}catch(r){return`{"code": "internal", "msg": "There was an error but it could not be serialized into JSON"}`}}static fromObject(r){const i=r["code"]||s.Unknown;const a=r["msg"]||"unknown";const l=new TwirpError(i,a);if(r["meta"]){Object.keys(r["meta"]).forEach((i=>{l.withMeta(i,r["meta"][i])}))}return l}}i.TwirpError=TwirpError;class NotFoundError extends TwirpError{constructor(r){super(s.NotFound,r)}}i.NotFoundError=NotFoundError;class InvalidArgumentError extends TwirpError{constructor(r,i){super(s.InvalidArgument,r+" "+i);this.withMeta("argument",r)}}i.InvalidArgumentError=InvalidArgumentError;class RequiredArgumentError extends InvalidArgumentError{constructor(r){super(r,"is required")}}i.RequiredArgumentError=RequiredArgumentError;class InternalServerError extends TwirpError{constructor(r){super(s.Internal,r)}}i.InternalServerError=InternalServerError;class InternalServerErrorWith extends InternalServerError{constructor(r){super(r.message);this.withMeta("cause",r.name);this.withCause(r)}}i.InternalServerErrorWith=InternalServerErrorWith;class BadRouteError extends TwirpError{constructor(r,i,a){super(s.BadRoute,r);this.withMeta("twirp_invalid_route",i+" "+a)}}i.BadRouteError=BadRouteError;var s;(function(r){r["Canceled"]="canceled";r["Unknown"]="unknown";r["InvalidArgument"]="invalid_argument";r["Malformed"]="malformed";r["DeadlineExceeded"]="deadline_exceeded";r["NotFound"]="not_found";r["BadRoute"]="bad_route";r["AlreadyExists"]="already_exists";r["PermissionDenied"]="permission_denied";r["Unauthenticated"]="unauthenticated";r["ResourceExhausted"]="resource_exhausted";r["FailedPrecondition"]="failed_precondition";r["Aborted"]="aborted";r["OutOfRange"]="out_of_range";r["Unimplemented"]="unimplemented";r["Internal"]="internal";r["Unavailable"]="unavailable";r["DataLoss"]="data_loss"})(s=i.TwirpErrorCode||(i.TwirpErrorCode={}));function httpStatusFromErrorCode(r){switch(r){case s.Canceled:return 408;case s.Unknown:return 500;case s.InvalidArgument:return 400;case s.Malformed:return 400;case s.DeadlineExceeded:return 408;case s.NotFound:return 404;case s.BadRoute:return 404;case s.AlreadyExists:return 409;case s.PermissionDenied:return 403;case s.Unauthenticated:return 401;case s.ResourceExhausted:return 429;case s.FailedPrecondition:return 412;case s.Aborted:return 409;case s.OutOfRange:return 400;case s.Unimplemented:return 501;case s.Internal:return 500;case s.Unavailable:return 503;case s.DataLoss:return 500;default:return 0}}i.httpStatusFromErrorCode=httpStatusFromErrorCode;function isValidErrorCode(r){return httpStatusFromErrorCode(r)!=0}i.isValidErrorCode=isValidErrorCode},92258:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};var p=this&&this.__rest||function(r,i){var s={};for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&i.indexOf(a)<0)s[a]=r[a];if(r!=null&&typeof Object.getOwnPropertySymbols==="function")for(var l=0,a=Object.getOwnPropertySymbols(r);l{this.rewrite(i,s,r).then((()=>a())).catch((r=>{if(r instanceof g.TwirpError){if(r.code!==g.TwirpErrorCode.NotFound){b.writeError(s,r)}else{a()}}}))}}rewrite(r,i,s="/twirp"){return d(this,void 0,void 0,(function*(){const[a,l]=this.matchRoute(r);const c=yield this.prepareTwirpBody(r,a,l);const d=`${s}/${l.packageName}.${l.serviceName}/${l.methodName}`;r.url=d;r.originalUrl=d;r.method="POST";r.headers["content-type"]="application/json";r.rawBody=Buffer.from(JSON.stringify(c));if(l.responseBodyKey){const r=i.end.bind(i);i.end=function(s){if(i.statusCode===200){r(`{ "${l.responseBodyKey}": ${s} }`)}else{r(s)}}}}))}reverseProxy(r){const i=y.NodeHttpRPC(r);return(r,s)=>d(this,void 0,void 0,(function*(){try{const[a,l]=this.matchRoute(r);const c=yield this.prepareTwirpBody(r,a,l);const d=yield i.request(`${l.packageName}.${l.serviceName}`,l.methodName,"application/json",c);s.statusCode=200;s.setHeader("content-type","application/json");let p;if(l.responseBodyKey){p=JSON.stringify({[l.responseBodyKey]:d})}else{p=JSON.stringify(d)}s.end(p)}catch(r){b.writeError(s,r)}}))}prepareTwirpBody(r,i,s){return d(this,void 0,void 0,(function*(){const a=i.params,{query_string:l}=a,c=p(a,["query_string"]);let d=Object.assign({},c);if(l&&s.bodyKey!=="*"){const r=this.parseQueryString(l);d=Object.assign(Object.assign({},r),d)}let u={};if(s.bodyKey){const i=yield h.getRequestData(r);try{const r=JSON.parse(i.toString()||"{}");if(s.bodyKey==="*"){u=r}else{u[s.bodyKey]=r}}catch(r){const i="the json request could not be decoded";throw new g.TwirpError(g.TwirpErrorCode.Malformed,i).withCause(r,true)}}return Object.assign(Object.assign({},u),d)}))}matchRoute(r){var i;const s=(i=r.method)===null||i===void 0?void 0:i.toLowerCase();if(!s){throw new g.BadRouteError(`method not allowed`,r.method||"",r.url||"")}const a=this.routes[s];for(const i of a){const s=i.matcher(r.url||"/");if(s){return[s,i]}}throw new g.NotFoundError(`url ${r.url} not found`)}parseQueryString(r){const i=u.parse(r.replace("?",""));return A.object(i)}}i.Gateway=Gateway},85966:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.isHook=i.chainHooks=void 0;function chainHooks(...r){if(r.length===0){return null}if(r.length===1){return r[0]}const i={requestReceived(i){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.requestReceived){continue}yield s.requestReceived(i)}}))},requestPrepared(i){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.requestPrepared){continue}console.warn("hook requestPrepared is deprecated and will be removed in the next release. "+"Please use responsePrepared instead.");yield s.requestPrepared(i)}}))},responsePrepared(i){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.responsePrepared){continue}yield s.responsePrepared(i)}}))},requestSent(i){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.requestSent){continue}console.warn("hook requestSent is deprecated and will be removed in the next release. "+"Please use responseSent instead.");yield s.requestSent(i)}}))},responseSent(i){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.responseSent){continue}yield s.responseSent(i)}}))},requestRouted(i){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.requestRouted){continue}yield s.requestRouted(i)}}))},error(i,a){return s(this,void 0,void 0,(function*(){for(const s of r){if(!s.error){continue}yield s.error(i,a)}}))}};return i}i.chainHooks=chainHooks;function isHook(r){return"requestReceived"in r||"requestPrepared"in r||"requestSent"in r||"requestRouted"in r||"responsePrepared"in r||"responseSent"in r||"error"in r}i.isHook=isHook},4153:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};var d=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.FetchRPC=i.wrapErrorResponseToTwirpError=i.NodeHttpRPC=void 0;const p=c(s(13685));const u=c(s(95687));const A=s(57310);const h=s(21322);const NodeHttpRPC=r=>({request(i,s,a,l){let c;return new Promise(((d,h)=>{const g=[];const y=a==="application/protobuf"?Buffer.from(l):JSON.stringify(l);const b=new A.URL(r.baseUrl);const w=b.protocol==="https:";if(w){c=u}else{c=p}const C=b.pathname!=="/"?b.pathname:"";const v=c.request(Object.assign(Object.assign({},r?r:{}),{method:"POST",protocol:b.protocol,host:b.hostname,port:b.port?b.port:w?443:80,path:`${C}/${i}/${s}`,headers:Object.assign(Object.assign({},r.headers?r.headers:{}),{"Content-Type":a,"Content-Length":a==="application/protobuf"?Buffer.byteLength(y):Buffer.from(y).byteLength})}),(r=>{r.on("data",(r=>g.push(r)));r.on("end",(()=>{const i=Buffer.concat(g);if(r.statusCode!=200){h(wrapErrorResponseToTwirpError(i.toString()))}else{if(a==="application/json"){d(JSON.parse(i.toString()))}else{d(i)}}}));r.on("error",(r=>{h(r)}))})).on("error",(r=>{h(r)}));v.end(y)}))}});i.NodeHttpRPC=NodeHttpRPC;function wrapErrorResponseToTwirpError(r){return h.TwirpError.fromObject(JSON.parse(r))}i.wrapErrorResponseToTwirpError=wrapErrorResponseToTwirpError;const FetchRPC=r=>({request(i,s,a,l){return d(this,void 0,void 0,(function*(){const c=new Headers(r.headers);c.set("content-type",a);const d=yield fetch(`${r.baseUrl}/${i}/${s}`,Object.assign(Object.assign({},r),{method:"POST",headers:c,body:l instanceof Uint8Array?l:JSON.stringify(l)}));if(d.status===200){if(a==="application/json"){return yield d.json()}return new Uint8Array(yield d.arrayBuffer())}throw h.TwirpError.fromObject(yield d.json())}))}});i.FetchRPC=FetchRPC},9728:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;Object.defineProperty(r,a,{enumerable:true,get:function(){return i[s]}})}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__exportStar||function(r,i){for(var s in r)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s))a(i,r,s)};Object.defineProperty(i,"__esModule",{value:true});i.TwirpContentType=void 0;l(s(4008),i);l(s(83111),i);l(s(35181),i);l(s(85966),i);l(s(21322),i);l(s(92258),i);l(s(4153),i);var c=s(41583);Object.defineProperty(i,"TwirpContentType",{enumerable:true,get:function(){return c.TwirpContentType}})},35181:function(r,i){"use strict";var s=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.chainInterceptors=void 0;function chainInterceptors(...r){if(r.length===0){return}if(r.length===1){return r[0]}const i=r[0];return(a,l,c)=>s(this,void 0,void 0,(function*(){let s=c;for(let i=r.length-1;i>0;i--){s=(s=>(a,l)=>r[i](a,l,s))(s)}return i(a,l,s)}))}i.chainInterceptors=chainInterceptors},41583:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.parseTwirpPath=i.getRequestData=i.validateRequest=i.getContentType=i.TwirpContentType=void 0;const l=s(21322);var c;(function(r){r[r["Protobuf"]=0]="Protobuf";r[r["JSON"]=1]="JSON";r[r["Unknown"]=2]="Unknown"})(c=i.TwirpContentType||(i.TwirpContentType={}));function getContentType(r){switch(r){case"application/protobuf":return c.Protobuf;case"application/json":return c.JSON;default:return c.Unknown}}i.getContentType=getContentType;function validateRequest(r,i,s){if(i.method!=="POST"){const r=`unsupported method ${i.method} (only POST is allowed)`;throw new l.BadRouteError(r,i.method||"",i.url||"")}const a=parseTwirpPath(i.url||"");if(a.pkgService!==(r.packageName?r.packageName+".":"")+r.serviceName){const r=`no handler for path ${i.url}`;throw new l.BadRouteError(r,i.method||"",i.url||"")}if(a.prefix!==s){const r=`invalid path prefix ${a.prefix}, expected ${s}, on path ${i.url}`;throw new l.BadRouteError(r,i.method||"",i.url||"")}const d=i.headers["content-type"]||"";if(r.contentType===c.Unknown){const r=`unexpected Content-Type: ${i.headers["content-type"]}`;throw new l.BadRouteError(r,i.method||"",i.url||"")}return Object.assign(Object.assign({},a),{mimeContentType:d,contentType:r.contentType})}i.validateRequest=validateRequest;function getRequestData(r){return new Promise(((i,s)=>{const c=r;if(c.rawBody instanceof Buffer){i(c.rawBody);return}const d=[];r.on("data",(r=>d.push(r)));r.on("end",(()=>a(this,void 0,void 0,(function*(){const r=Buffer.concat(d);i(r)}))));r.on("error",(i=>{if(r.aborted){s(new l.TwirpError(l.TwirpErrorCode.DeadlineExceeded,"failed to read request: deadline exceeded"))}else{s(new l.TwirpError(l.TwirpErrorCode.Malformed,i.message).withCause(i))}}));r.on("close",(()=>{s(new l.TwirpError(l.TwirpErrorCode.Canceled,"failed to read request: context canceled"))}))}))}i.getRequestData=getRequestData;function parseTwirpPath(r){const i=r.split("/");if(i.length<2){return{pkgService:"",method:"",prefix:""}}return{method:i[i.length-1],pkgService:i[i.length-2],prefix:i.slice(0,i.length-2).join("/")}}i.parseTwirpPath=parseTwirpPath},83111:function(r,i,s){"use strict";var a=this&&this.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.writeError=i.TwirpServer=void 0;const l=s(85966);const c=s(41583);const d=s(21322);class TwirpServer{constructor(r){this.pathPrefix="/twirp";this.hooks=[];this.interceptors=[];this.packageName=r.packageName;this.serviceName=r.serviceName;this.methodList=r.methodList;this.matchRoute=r.matchRoute;this.service=r.service}get prefix(){return this.pathPrefix}httpHandler(r){return(i,s)=>{if((r===null||r===void 0?void 0:r.prefix)!==undefined){this.withPrefix(r.prefix)}return this._httpHandler(i,s)}}use(...r){r.forEach((r=>{if(l.isHook(r)){this.hooks.push(r);return this}this.interceptors.push(r)}));return this}withPrefix(r){if(r===false){this.pathPrefix=""}else{this.pathPrefix=r}return this}matchingPath(){const r=this.baseURI().replace(/\./g,"\\.");return new RegExp(`${r}/(${this.methodList.join("|")})`)}baseURI(){return`${this.pathPrefix}/${this.packageName?this.packageName+".":""}${this.serviceName}`}createContext(r,i){return{packageName:this.packageName,serviceName:this.serviceName,methodName:"",contentType:c.getContentType(r.headers["content-type"]),req:r,res:i}}_httpHandler(r,i){return a(this,void 0,void 0,(function*(){const s=this.createContext(r,i);try{yield this.invokeHook("requestReceived",s);const{method:a,mimeContentType:l}=c.validateRequest(s,r,this.pathPrefix||"");const p=this.matchRoute(a,{onMatch:r=>this.invokeHook("requestRouted",r),onNotFound:()=>{const i=`no handler for path ${r.url}`;throw new d.BadRouteError(i,r.method||"",r.url||"")}});const u=yield c.getRequestData(r);const A=yield p(s,this.service,u,this.interceptors);yield Promise.all([this.invokeHook("responsePrepared",s),this.invokeHook("requestPrepared",s)]);i.statusCode=200;i.setHeader("Content-Type",l);i.end(A)}catch(r){yield this.invokeHook("error",s,mustBeTwirpError(r));if(!i.headersSent){writeError(i,r)}}finally{yield Promise.all([this.invokeHook("responseSent",s),this.invokeHook("requestSent",s)])}}))}invokeHook(r,i,s){return a(this,void 0,void 0,(function*(){if(this.hooks.length===0){return}const a=l.chainHooks(...this.hooks);const c=a===null||a===void 0?void 0:a[r];if(c){yield c(i,s||new d.InternalServerError("internal server error"))}}))}}i.TwirpServer=TwirpServer;function writeError(r,i){const s=mustBeTwirpError(i);r.setHeader("Content-Type","application/json");r.statusCode=d.httpStatusFromErrorCode(s.code);r.end(s.toJSON())}i.writeError=writeError;function mustBeTwirpError(r){if(r instanceof d.TwirpError){return r}return new d.InternalServerErrorWith(r)}},16096:(r,i,s)=>{"use strict";const a=s(55179);const l=s(78824);const c=s(76291);const d=s(94427);const p=s(85678);const u=s(72916);const A=s(94766);const{InvalidArgumentError:h}=c;const g=s(92747);const y=s(98742);const b=s(16518);const w=s(51441);const C=s(15196);const v=s(11025);const I=s(76650);const B=s(39935);const{getGlobalDispatcher:S,setGlobalDispatcher:x}=s(18826);const R=s(96474);const Q=s(81465);const _=s(76459);let N;try{s(6113);N=true}catch{N=false}Object.assign(l.prototype,g);r.exports.Dispatcher=l;r.exports.Client=a;r.exports.Pool=d;r.exports.BalancedPool=p;r.exports.Agent=u;r.exports.ProxyAgent=I;r.exports.RetryHandler=B;r.exports.DecoratorHandler=R;r.exports.RedirectHandler=Q;r.exports.createRedirectInterceptor=_;r.exports.buildConnector=y;r.exports.errors=c;function makeDispatcher(r){return(i,s,a)=>{if(typeof s==="function"){a=s;s=null}if(!i||typeof i!=="string"&&typeof i!=="object"&&!(i instanceof URL)){throw new h("invalid url")}if(s!=null&&typeof s!=="object"){throw new h("invalid opts")}if(s&&s.path!=null){if(typeof s.path!=="string"){throw new h("invalid opts.path")}let r=s.path;if(!s.path.startsWith("/")){r=`/${r}`}i=new URL(A.parseOrigin(i).origin+r)}else{if(!s){s=typeof i==="object"?i:{}}i=A.parseURL(i)}const{agent:l,dispatcher:c=S()}=s;if(l){throw new h("unsupported opts.agent. Did you mean opts.client?")}return r.call(c,{...s,origin:i.origin,path:i.search?`${i.pathname}${i.search}`:i.pathname,method:s.method||(s.body?"PUT":"GET")},a)}}r.exports.setGlobalDispatcher=x;r.exports.getGlobalDispatcher=S;if(A.nodeMajor>16||A.nodeMajor===16&&A.nodeMinor>=8){let i=null;r.exports.fetch=async function fetch(r){if(!i){i=s(79890).fetch}try{return await i(...arguments)}catch(r){if(typeof r==="object"){Error.captureStackTrace(r,this)}throw r}};r.exports.Headers=s(8247).Headers;r.exports.Response=s(55032).Response;r.exports.Request=s(11287).Request;r.exports.FormData=s(72489).FormData;r.exports.File=s(81636).File;r.exports.FileReader=s(62414).FileReader;const{setGlobalOrigin:a,getGlobalOrigin:l}=s(46670);r.exports.setGlobalOrigin=a;r.exports.getGlobalOrigin=l;const{CacheStorage:c}=s(43425);const{kConstruct:d}=s(23450);r.exports.caches=new c(d)}if(A.nodeMajor>=16){const{deleteCookie:i,getCookies:a,getSetCookies:l,setCookie:c}=s(62549);r.exports.deleteCookie=i;r.exports.getCookies=a;r.exports.getSetCookies=l;r.exports.setCookie=c;const{parseMIMEType:d,serializeAMimeType:p}=s(80097);r.exports.parseMIMEType=d;r.exports.serializeAMimeType=p}if(A.nodeMajor>=18&&N){const{WebSocket:i}=s(82439);r.exports.WebSocket=i}r.exports.request=makeDispatcher(g.request);r.exports.stream=makeDispatcher(g.stream);r.exports.pipeline=makeDispatcher(g.pipeline);r.exports.connect=makeDispatcher(g.connect);r.exports.upgrade=makeDispatcher(g.upgrade);r.exports.MockClient=b;r.exports.MockPool=C;r.exports.MockAgent=w;r.exports.mockErrors=v},72916:(r,i,s)=>{"use strict";const{InvalidArgumentError:a}=s(76291);const{kClients:l,kRunning:c,kClose:d,kDestroy:p,kDispatch:u,kInterceptors:A}=s(31915);const h=s(36228);const g=s(94427);const y=s(55179);const b=s(94766);const w=s(76459);const{WeakRef:C,FinalizationRegistry:v}=s(17428)();const I=Symbol("onConnect");const B=Symbol("onDisconnect");const S=Symbol("onConnectionError");const x=Symbol("maxRedirections");const R=Symbol("onDrain");const Q=Symbol("factory");const _=Symbol("finalizer");const N=Symbol("options");function defaultFactory(r,i){return i&&i.connections===1?new y(r,i):new g(r,i)}class Agent extends h{constructor({factory:r=defaultFactory,maxRedirections:i=0,connect:s,...c}={}){super();if(typeof r!=="function"){throw new a("factory must be a function.")}if(s!=null&&typeof s!=="function"&&typeof s!=="object"){throw new a("connect must be a function or an object")}if(!Number.isInteger(i)||i<0){throw new a("maxRedirections must be a positive number")}if(s&&typeof s!=="function"){s={...s}}this[A]=c.interceptors&&c.interceptors.Agent&&Array.isArray(c.interceptors.Agent)?c.interceptors.Agent:[w({maxRedirections:i})];this[N]={...b.deepClone(c),connect:s};this[N].interceptors=c.interceptors?{...c.interceptors}:undefined;this[x]=i;this[Q]=r;this[l]=new Map;this[_]=new v((r=>{const i=this[l].get(r);if(i!==undefined&&i.deref()===undefined){this[l].delete(r)}}));const d=this;this[R]=(r,i)=>{d.emit("drain",r,[d,...i])};this[I]=(r,i)=>{d.emit("connect",r,[d,...i])};this[B]=(r,i,s)=>{d.emit("disconnect",r,[d,...i],s)};this[S]=(r,i,s)=>{d.emit("connectionError",r,[d,...i],s)}}get[c](){let r=0;for(const i of this[l].values()){const s=i.deref();if(s){r+=s[c]}}return r}[u](r,i){let s;if(r.origin&&(typeof r.origin==="string"||r.origin instanceof URL)){s=String(r.origin)}else{throw new a("opts.origin must be a non-empty string or URL.")}const c=this[l].get(s);let d=c?c.deref():null;if(!d){d=this[Q](r.origin,this[N]).on("drain",this[R]).on("connect",this[I]).on("disconnect",this[B]).on("connectionError",this[S]);this[l].set(s,new C(d));this[_].register(d,s)}return d.dispatch(r,i)}async[d](){const r=[];for(const i of this[l].values()){const s=i.deref();if(s){r.push(s.close())}}await Promise.all(r)}async[p](r){const i=[];for(const s of this[l].values()){const a=s.deref();if(a){i.push(a.destroy(r))}}await Promise.all(i)}}r.exports=Agent},71796:(r,i,s)=>{const{addAbortListener:a}=s(94766);const{RequestAbortedError:l}=s(76291);const c=Symbol("kListener");const d=Symbol("kSignal");function abort(r){if(r.abort){r.abort()}else{r.onError(new l)}}function addSignal(r,i){r[d]=null;r[c]=null;if(!i){return}if(i.aborted){abort(r);return}r[d]=i;r[c]=()=>{abort(r)};a(r[d],r[c])}function removeSignal(r){if(!r[d]){return}if("removeEventListener"in r[d]){r[d].removeEventListener("abort",r[c])}else{r[d].removeListener("abort",r[c])}r[d]=null;r[c]=null}r.exports={addSignal:addSignal,removeSignal:removeSignal}},12770:(r,i,s)=>{"use strict";const{AsyncResource:a}=s(50852);const{InvalidArgumentError:l,RequestAbortedError:c,SocketError:d}=s(76291);const p=s(94766);const{addSignal:u,removeSignal:A}=s(71796);class ConnectHandler extends a{constructor(r,i){if(!r||typeof r!=="object"){throw new l("invalid opts")}if(typeof i!=="function"){throw new l("invalid callback")}const{signal:s,opaque:a,responseHeaders:c}=r;if(s&&typeof s.on!=="function"&&typeof s.addEventListener!=="function"){throw new l("signal must be an EventEmitter or EventTarget")}super("UNDICI_CONNECT");this.opaque=a||null;this.responseHeaders=c||null;this.callback=i;this.abort=null;u(this,s)}onConnect(r,i){if(!this.callback){throw new c}this.abort=r;this.context=i}onHeaders(){throw new d("bad connect",null)}onUpgrade(r,i,s){const{callback:a,opaque:l,context:c}=this;A(this);this.callback=null;let d=i;if(d!=null){d=this.responseHeaders==="raw"?p.parseRawHeaders(i):p.parseHeaders(i)}this.runInAsyncScope(a,null,null,{statusCode:r,headers:d,socket:s,opaque:l,context:c})}onError(r){const{callback:i,opaque:s}=this;A(this);if(i){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(i,null,r,{opaque:s})}))}}}function connect(r,i){if(i===undefined){return new Promise(((i,s)=>{connect.call(this,r,((r,a)=>r?s(r):i(a)))}))}try{const s=new ConnectHandler(r,i);this.dispatch({...r,method:"CONNECT"},s)}catch(s){if(typeof i!=="function"){throw s}const a=r&&r.opaque;queueMicrotask((()=>i(s,{opaque:a})))}}r.exports=connect},73624:(r,i,s)=>{"use strict";const{Readable:a,Duplex:l,PassThrough:c}=s(12781);const{InvalidArgumentError:d,InvalidReturnValueError:p,RequestAbortedError:u}=s(76291);const A=s(94766);const{AsyncResource:h}=s(50852);const{addSignal:g,removeSignal:y}=s(71796);const b=s(39491);const w=Symbol("resume");class PipelineRequest extends a{constructor(){super({autoDestroy:true});this[w]=null}_read(){const{[w]:r}=this;if(r){this[w]=null;r()}}_destroy(r,i){this._read();i(r)}}class PipelineResponse extends a{constructor(r){super({autoDestroy:true});this[w]=r}_read(){this[w]()}_destroy(r,i){if(!r&&!this._readableState.endEmitted){r=new u}i(r)}}class PipelineHandler extends h{constructor(r,i){if(!r||typeof r!=="object"){throw new d("invalid opts")}if(typeof i!=="function"){throw new d("invalid handler")}const{signal:s,method:a,opaque:c,onInfo:p,responseHeaders:h}=r;if(s&&typeof s.on!=="function"&&typeof s.addEventListener!=="function"){throw new d("signal must be an EventEmitter or EventTarget")}if(a==="CONNECT"){throw new d("invalid method")}if(p&&typeof p!=="function"){throw new d("invalid onInfo callback")}super("UNDICI_PIPELINE");this.opaque=c||null;this.responseHeaders=h||null;this.handler=i;this.abort=null;this.context=null;this.onInfo=p||null;this.req=(new PipelineRequest).on("error",A.nop);this.ret=new l({readableObjectMode:r.objectMode,autoDestroy:true,read:()=>{const{body:r}=this;if(r&&r.resume){r.resume()}},write:(r,i,s)=>{const{req:a}=this;if(a.push(r,i)||a._readableState.destroyed){s()}else{a[w]=s}},destroy:(r,i)=>{const{body:s,req:a,res:l,ret:c,abort:d}=this;if(!r&&!c._readableState.endEmitted){r=new u}if(d&&r){d()}A.destroy(s,r);A.destroy(a,r);A.destroy(l,r);y(this);i(r)}}).on("prefinish",(()=>{const{req:r}=this;r.push(null)}));this.res=null;g(this,s)}onConnect(r,i){const{ret:s,res:a}=this;b(!a,"pipeline cannot be retried");if(s.destroyed){throw new u}this.abort=r;this.context=i}onHeaders(r,i,s){const{opaque:a,handler:l,context:c}=this;if(r<200){if(this.onInfo){const s=this.responseHeaders==="raw"?A.parseRawHeaders(i):A.parseHeaders(i);this.onInfo({statusCode:r,headers:s})}return}this.res=new PipelineResponse(s);let d;try{this.handler=null;const s=this.responseHeaders==="raw"?A.parseRawHeaders(i):A.parseHeaders(i);d=this.runInAsyncScope(l,null,{statusCode:r,headers:s,opaque:a,body:this.res,context:c})}catch(r){this.res.on("error",A.nop);throw r}if(!d||typeof d.on!=="function"){throw new p("expected Readable")}d.on("data",(r=>{const{ret:i,body:s}=this;if(!i.push(r)&&s.pause){s.pause()}})).on("error",(r=>{const{ret:i}=this;A.destroy(i,r)})).on("end",(()=>{const{ret:r}=this;r.push(null)})).on("close",(()=>{const{ret:r}=this;if(!r._readableState.ended){A.destroy(r,new u)}}));this.body=d}onData(r){const{res:i}=this;return i.push(r)}onComplete(r){const{res:i}=this;i.push(null)}onError(r){const{ret:i}=this;this.handler=null;A.destroy(i,r)}}function pipeline(r,i){try{const s=new PipelineHandler(r,i);this.dispatch({...r,body:s.req},s);return s.ret}catch(r){return(new c).destroy(r)}}r.exports=pipeline},3860:(r,i,s)=>{"use strict";const a=s(56200);const{InvalidArgumentError:l,RequestAbortedError:c}=s(76291);const d=s(94766);const{getResolveErrorBodyCallback:p}=s(64904);const{AsyncResource:u}=s(50852);const{addSignal:A,removeSignal:h}=s(71796);class RequestHandler extends u{constructor(r,i){if(!r||typeof r!=="object"){throw new l("invalid opts")}const{signal:s,method:a,opaque:c,body:p,onInfo:u,responseHeaders:h,throwOnError:g,highWaterMark:y}=r;try{if(typeof i!=="function"){throw new l("invalid callback")}if(y&&(typeof y!=="number"||y<0)){throw new l("invalid highWaterMark")}if(s&&typeof s.on!=="function"&&typeof s.addEventListener!=="function"){throw new l("signal must be an EventEmitter or EventTarget")}if(a==="CONNECT"){throw new l("invalid method")}if(u&&typeof u!=="function"){throw new l("invalid onInfo callback")}super("UNDICI_REQUEST")}catch(r){if(d.isStream(p)){d.destroy(p.on("error",d.nop),r)}throw r}this.responseHeaders=h||null;this.opaque=c||null;this.callback=i;this.res=null;this.abort=null;this.body=p;this.trailers={};this.context=null;this.onInfo=u||null;this.throwOnError=g;this.highWaterMark=y;if(d.isStream(p)){p.on("error",(r=>{this.onError(r)}))}A(this,s)}onConnect(r,i){if(!this.callback){throw new c}this.abort=r;this.context=i}onHeaders(r,i,s,l){const{callback:c,opaque:u,abort:A,context:h,responseHeaders:g,highWaterMark:y}=this;const b=g==="raw"?d.parseRawHeaders(i):d.parseHeaders(i);if(r<200){if(this.onInfo){this.onInfo({statusCode:r,headers:b})}return}const w=g==="raw"?d.parseHeaders(i):b;const C=w["content-type"];const v=new a({resume:s,abort:A,contentType:C,highWaterMark:y});this.callback=null;this.res=v;if(c!==null){if(this.throwOnError&&r>=400){this.runInAsyncScope(p,null,{callback:c,body:v,contentType:C,statusCode:r,statusMessage:l,headers:b})}else{this.runInAsyncScope(c,null,null,{statusCode:r,headers:b,trailers:this.trailers,opaque:u,body:v,context:h})}}}onData(r){const{res:i}=this;return i.push(r)}onComplete(r){const{res:i}=this;h(this);d.parseHeaders(r,this.trailers);i.push(null)}onError(r){const{res:i,callback:s,body:a,opaque:l}=this;h(this);if(s){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(s,null,r,{opaque:l})}))}if(i){this.res=null;queueMicrotask((()=>{d.destroy(i,r)}))}if(a){this.body=null;d.destroy(a,r)}}}function request(r,i){if(i===undefined){return new Promise(((i,s)=>{request.call(this,r,((r,a)=>r?s(r):i(a)))}))}try{this.dispatch(r,new RequestHandler(r,i))}catch(s){if(typeof i!=="function"){throw s}const a=r&&r.opaque;queueMicrotask((()=>i(s,{opaque:a})))}}r.exports=request;r.exports.RequestHandler=RequestHandler},2932:(r,i,s)=>{"use strict";const{finished:a,PassThrough:l}=s(12781);const{InvalidArgumentError:c,InvalidReturnValueError:d,RequestAbortedError:p}=s(76291);const u=s(94766);const{getResolveErrorBodyCallback:A}=s(64904);const{AsyncResource:h}=s(50852);const{addSignal:g,removeSignal:y}=s(71796);class StreamHandler extends h{constructor(r,i,s){if(!r||typeof r!=="object"){throw new c("invalid opts")}const{signal:a,method:l,opaque:d,body:p,onInfo:A,responseHeaders:h,throwOnError:y}=r;try{if(typeof s!=="function"){throw new c("invalid callback")}if(typeof i!=="function"){throw new c("invalid factory")}if(a&&typeof a.on!=="function"&&typeof a.addEventListener!=="function"){throw new c("signal must be an EventEmitter or EventTarget")}if(l==="CONNECT"){throw new c("invalid method")}if(A&&typeof A!=="function"){throw new c("invalid onInfo callback")}super("UNDICI_STREAM")}catch(r){if(u.isStream(p)){u.destroy(p.on("error",u.nop),r)}throw r}this.responseHeaders=h||null;this.opaque=d||null;this.factory=i;this.callback=s;this.res=null;this.abort=null;this.context=null;this.trailers=null;this.body=p;this.onInfo=A||null;this.throwOnError=y||false;if(u.isStream(p)){p.on("error",(r=>{this.onError(r)}))}g(this,a)}onConnect(r,i){if(!this.callback){throw new p}this.abort=r;this.context=i}onHeaders(r,i,s,c){const{factory:p,opaque:h,context:g,callback:y,responseHeaders:b}=this;const w=b==="raw"?u.parseRawHeaders(i):u.parseHeaders(i);if(r<200){if(this.onInfo){this.onInfo({statusCode:r,headers:w})}return}this.factory=null;let C;if(this.throwOnError&&r>=400){const s=b==="raw"?u.parseHeaders(i):w;const a=s["content-type"];C=new l;this.callback=null;this.runInAsyncScope(A,null,{callback:y,body:C,contentType:a,statusCode:r,statusMessage:c,headers:w})}else{if(p===null){return}C=this.runInAsyncScope(p,null,{statusCode:r,headers:w,opaque:h,context:g});if(!C||typeof C.write!=="function"||typeof C.end!=="function"||typeof C.on!=="function"){throw new d("expected Writable")}a(C,{readable:false},(r=>{const{callback:i,res:s,opaque:a,trailers:l,abort:c}=this;this.res=null;if(r||!s.readable){u.destroy(s,r)}this.callback=null;this.runInAsyncScope(i,null,r||null,{opaque:a,trailers:l});if(r){c()}}))}C.on("drain",s);this.res=C;const v=C.writableNeedDrain!==undefined?C.writableNeedDrain:C._writableState&&C._writableState.needDrain;return v!==true}onData(r){const{res:i}=this;return i?i.write(r):true}onComplete(r){const{res:i}=this;y(this);if(!i){return}this.trailers=u.parseHeaders(r);i.end()}onError(r){const{res:i,callback:s,opaque:a,body:l}=this;y(this);this.factory=null;if(i){this.res=null;u.destroy(i,r)}else if(s){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(s,null,r,{opaque:a})}))}if(l){this.body=null;u.destroy(l,r)}}}function stream(r,i,s){if(s===undefined){return new Promise(((s,a)=>{stream.call(this,r,i,((r,i)=>r?a(r):s(i)))}))}try{this.dispatch(r,new StreamHandler(r,i,s))}catch(i){if(typeof s!=="function"){throw i}const a=r&&r.opaque;queueMicrotask((()=>s(i,{opaque:a})))}}r.exports=stream},44273:(r,i,s)=>{"use strict";const{InvalidArgumentError:a,RequestAbortedError:l,SocketError:c}=s(76291);const{AsyncResource:d}=s(50852);const p=s(94766);const{addSignal:u,removeSignal:A}=s(71796);const h=s(39491);class UpgradeHandler extends d{constructor(r,i){if(!r||typeof r!=="object"){throw new a("invalid opts")}if(typeof i!=="function"){throw new a("invalid callback")}const{signal:s,opaque:l,responseHeaders:c}=r;if(s&&typeof s.on!=="function"&&typeof s.addEventListener!=="function"){throw new a("signal must be an EventEmitter or EventTarget")}super("UNDICI_UPGRADE");this.responseHeaders=c||null;this.opaque=l||null;this.callback=i;this.abort=null;this.context=null;u(this,s)}onConnect(r,i){if(!this.callback){throw new l}this.abort=r;this.context=null}onHeaders(){throw new c("bad upgrade",null)}onUpgrade(r,i,s){const{callback:a,opaque:l,context:c}=this;h.strictEqual(r,101);A(this);this.callback=null;const d=this.responseHeaders==="raw"?p.parseRawHeaders(i):p.parseHeaders(i);this.runInAsyncScope(a,null,null,{headers:d,socket:s,opaque:l,context:c})}onError(r){const{callback:i,opaque:s}=this;A(this);if(i){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(i,null,r,{opaque:s})}))}}}function upgrade(r,i){if(i===undefined){return new Promise(((i,s)=>{upgrade.call(this,r,((r,a)=>r?s(r):i(a)))}))}try{const s=new UpgradeHandler(r,i);this.dispatch({...r,method:r.method||"GET",upgrade:r.protocol||"Websocket"},s)}catch(s){if(typeof i!=="function"){throw s}const a=r&&r.opaque;queueMicrotask((()=>i(s,{opaque:a})))}}r.exports=upgrade},92747:(r,i,s)=>{"use strict";r.exports.request=s(3860);r.exports.stream=s(2932);r.exports.pipeline=s(73624);r.exports.upgrade=s(44273);r.exports.connect=s(12770)},56200:(r,i,s)=>{"use strict";const a=s(39491);const{Readable:l}=s(12781);const{RequestAbortedError:c,NotSupportedError:d,InvalidArgumentError:p}=s(76291);const u=s(94766);const{ReadableStreamFrom:A,toUSVString:h}=s(94766);let g;const y=Symbol("kConsume");const b=Symbol("kReading");const w=Symbol("kBody");const C=Symbol("abort");const v=Symbol("kContentType");const noop=()=>{};r.exports=class BodyReadable extends l{constructor({resume:r,abort:i,contentType:s="",highWaterMark:a=64*1024}){super({autoDestroy:true,read:r,highWaterMark:a});this._readableState.dataEmitted=false;this[C]=i;this[y]=null;this[w]=null;this[v]=s;this[b]=false}destroy(r){if(this.destroyed){return this}if(!r&&!this._readableState.endEmitted){r=new c}if(r){this[C]()}return super.destroy(r)}emit(r,...i){if(r==="data"){this._readableState.dataEmitted=true}else if(r==="error"){this._readableState.errorEmitted=true}return super.emit(r,...i)}on(r,...i){if(r==="data"||r==="readable"){this[b]=true}return super.on(r,...i)}addListener(r,...i){return this.on(r,...i)}off(r,...i){const s=super.off(r,...i);if(r==="data"||r==="readable"){this[b]=this.listenerCount("data")>0||this.listenerCount("readable")>0}return s}removeListener(r,...i){return this.off(r,...i)}push(r){if(this[y]&&r!==null&&this.readableLength===0){consumePush(this[y],r);return this[b]?super.push(r):true}return super.push(r)}async text(){return consume(this,"text")}async json(){return consume(this,"json")}async blob(){return consume(this,"blob")}async arrayBuffer(){return consume(this,"arrayBuffer")}async formData(){throw new d}get bodyUsed(){return u.isDisturbed(this)}get body(){if(!this[w]){this[w]=A(this);if(this[y]){this[w].getReader();a(this[w].locked)}}return this[w]}dump(r){let i=r&&Number.isFinite(r.limit)?r.limit:262144;const s=r&&r.signal;if(s){try{if(typeof s!=="object"||!("aborted"in s)){throw new p("signal must be an AbortSignal")}u.throwIfAborted(s)}catch(r){return Promise.reject(r)}}if(this.closed){return Promise.resolve(null)}return new Promise(((r,a)=>{const l=s?u.addAbortListener(s,(()=>{this.destroy()})):noop;this.on("close",(function(){l();if(s&&s.aborted){a(s.reason||Object.assign(new Error("The operation was aborted"),{name:"AbortError"}))}else{r(null)}})).on("error",noop).on("data",(function(r){i-=r.length;if(i<=0){this.destroy()}})).resume()}))}};function isLocked(r){return r[w]&&r[w].locked===true||r[y]}function isUnusable(r){return u.isDisturbed(r)||isLocked(r)}async function consume(r,i){if(isUnusable(r)){throw new TypeError("unusable")}a(!r[y]);return new Promise(((s,a)=>{r[y]={type:i,stream:r,resolve:s,reject:a,length:0,body:[]};r.on("error",(function(r){consumeFinish(this[y],r)})).on("close",(function(){if(this[y].body!==null){consumeFinish(this[y],new c)}}));process.nextTick(consumeStart,r[y])}))}function consumeStart(r){if(r.body===null){return}const{_readableState:i}=r.stream;for(const s of i.buffer){consumePush(r,s)}if(i.endEmitted){consumeEnd(this[y])}else{r.stream.on("end",(function(){consumeEnd(this[y])}))}r.stream.resume();while(r.stream.read()!=null){}}function consumeEnd(r){const{type:i,body:a,resolve:l,stream:c,length:d}=r;try{if(i==="text"){l(h(Buffer.concat(a)))}else if(i==="json"){l(JSON.parse(Buffer.concat(a)))}else if(i==="arrayBuffer"){const r=new Uint8Array(d);let i=0;for(const s of a){r.set(s,i);i+=s.byteLength}l(r.buffer)}else if(i==="blob"){if(!g){g=s(14300).Blob}l(new g(a,{type:c[v]}))}consumeFinish(r)}catch(r){c.destroy(r)}}function consumePush(r,i){r.length+=i.length;r.body.push(i)}function consumeFinish(r,i){if(r.body===null){return}if(i){r.reject(i)}else{r.resolve()}r.type=null;r.stream=null;r.resolve=null;r.reject=null;r.length=0;r.body=null}},64904:(r,i,s)=>{const a=s(39491);const{ResponseStatusCodeError:l}=s(76291);const{toUSVString:c}=s(94766);async function getResolveErrorBodyCallback({callback:r,body:i,contentType:s,statusCode:d,statusMessage:p,headers:u}){a(i);let A=[];let h=0;for await(const r of i){A.push(r);h+=r.length;if(h>128*1024){A=null;break}}if(d===204||!s||!A){process.nextTick(r,new l(`Response status code ${d}${p?`: ${p}`:""}`,d,u));return}try{if(s.startsWith("application/json")){const i=JSON.parse(c(Buffer.concat(A)));process.nextTick(r,new l(`Response status code ${d}${p?`: ${p}`:""}`,d,u,i));return}if(s.startsWith("text/")){const i=c(Buffer.concat(A));process.nextTick(r,new l(`Response status code ${d}${p?`: ${p}`:""}`,d,u,i));return}}catch(r){}process.nextTick(r,new l(`Response status code ${d}${p?`: ${p}`:""}`,d,u))}r.exports={getResolveErrorBodyCallback:getResolveErrorBodyCallback}},85678:(r,i,s)=>{"use strict";const{BalancedPoolMissingUpstreamError:a,InvalidArgumentError:l}=s(76291);const{PoolBase:c,kClients:d,kNeedDrain:p,kAddClient:u,kRemoveClient:A,kGetDispatcher:h}=s(52673);const g=s(94427);const{kUrl:y,kInterceptors:b}=s(31915);const{parseOrigin:w}=s(94766);const C=Symbol("factory");const v=Symbol("options");const I=Symbol("kGreatestCommonDivisor");const B=Symbol("kCurrentWeight");const S=Symbol("kIndex");const x=Symbol("kWeight");const R=Symbol("kMaxWeightPerServer");const Q=Symbol("kErrorPenalty");function getGreatestCommonDivisor(r,i){if(i===0)return r;return getGreatestCommonDivisor(i,r%i)}function defaultFactory(r,i){return new g(r,i)}class BalancedPool extends c{constructor(r=[],{factory:i=defaultFactory,...s}={}){super();this[v]=s;this[S]=-1;this[B]=0;this[R]=this[v].maxWeightPerServer||100;this[Q]=this[v].errorPenalty||15;if(!Array.isArray(r)){r=[r]}if(typeof i!=="function"){throw new l("factory must be a function.")}this[b]=s.interceptors&&s.interceptors.BalancedPool&&Array.isArray(s.interceptors.BalancedPool)?s.interceptors.BalancedPool:[];this[C]=i;for(const i of r){this.addUpstream(i)}this._updateBalancedPoolStats()}addUpstream(r){const i=w(r).origin;if(this[d].find((r=>r[y].origin===i&&r.closed!==true&&r.destroyed!==true))){return this}const s=this[C](i,Object.assign({},this[v]));this[u](s);s.on("connect",(()=>{s[x]=Math.min(this[R],s[x]+this[Q])}));s.on("connectionError",(()=>{s[x]=Math.max(1,s[x]-this[Q]);this._updateBalancedPoolStats()}));s.on("disconnect",((...r)=>{const i=r[2];if(i&&i.code==="UND_ERR_SOCKET"){s[x]=Math.max(1,s[x]-this[Q]);this._updateBalancedPoolStats()}}));for(const r of this[d]){r[x]=this[R]}this._updateBalancedPoolStats();return this}_updateBalancedPoolStats(){this[I]=this[d].map((r=>r[x])).reduce(getGreatestCommonDivisor,0)}removeUpstream(r){const i=w(r).origin;const s=this[d].find((r=>r[y].origin===i&&r.closed!==true&&r.destroyed!==true));if(s){this[A](s)}return this}get upstreams(){return this[d].filter((r=>r.closed!==true&&r.destroyed!==true)).map((r=>r[y].origin))}[h](){if(this[d].length===0){throw new a}const r=this[d].find((r=>!r[p]&&r.closed!==true&&r.destroyed!==true));if(!r){return}const i=this[d].map((r=>r[p])).reduce(((r,i)=>r&&i),true);if(i){return}let s=0;let l=this[d].findIndex((r=>!r[p]));while(s++this[d][l][x]&&!r[p]){l=this[S]}if(this[S]===0){this[B]=this[B]-this[I];if(this[B]<=0){this[B]=this[R]}}if(r[x]>=this[B]&&!r[p]){return r}}this[B]=this[d][l][x];this[S]=l;return this[d][l]}}r.exports=BalancedPool},89385:(r,i,s)=>{"use strict";const{kConstruct:a}=s(23450);const{urlEquals:l,fieldValues:c}=s(8581);const{kEnumerableProperty:d,isDisturbed:p}=s(94766);const{kHeadersList:u}=s(31915);const{webidl:A}=s(87591);const{Response:h,cloneResponse:g}=s(55032);const{Request:y}=s(11287);const{kState:b,kHeaders:w,kGuard:C,kRealm:v}=s(9411);const{fetching:I}=s(79890);const{urlIsHttpHttpsScheme:B,createDeferredPromise:S,readAllBytes:x}=s(40336);const R=s(39491);const{getGlobalDispatcher:Q}=s(18826);class Cache{#e;constructor(){if(arguments[0]!==a){A.illegalConstructor()}this.#e=arguments[1]}async match(r,i={}){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.match"});r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);const s=await this.matchAll(r,i);if(s.length===0){return}return s[0]}async matchAll(r=undefined,i={}){A.brandCheck(this,Cache);if(r!==undefined)r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);let s=null;if(r!==undefined){if(r instanceof y){s=r[b];if(s.method!=="GET"&&!i.ignoreMethod){return[]}}else if(typeof r==="string"){s=new y(r)[b]}}const a=[];if(r===undefined){for(const r of this.#e){a.push(r[1])}}else{const r=this.#t(s,i);for(const i of r){a.push(i[1])}}const l=[];for(const r of a){const i=new h(r.body?.source??null);const s=i[b].body;i[b]=r;i[b].body=s;i[w][u]=r.headersList;i[w][C]="immutable";l.push(i)}return Object.freeze(l)}async add(r){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.add"});r=A.converters.RequestInfo(r);const i=[r];const s=this.addAll(i);return await s}async addAll(r){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.addAll"});r=A.converters["sequence"](r);const i=[];const s=[];for(const i of r){if(typeof i==="string"){continue}const r=i[b];if(!B(r.url)||r.method!=="GET"){throw A.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme when method is not GET."})}}const a=[];for(const l of r){const r=new y(l)[b];if(!B(r.url)){throw A.errors.exception({header:"Cache.addAll",message:"Expected http/s scheme."})}r.initiator="fetch";r.destination="subresource";s.push(r);const d=S();a.push(I({request:r,dispatcher:Q(),processResponse(r){if(r.type==="error"||r.status===206||r.status<200||r.status>299){d.reject(A.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}))}else if(r.headersList.contains("vary")){const i=c(r.headersList.get("vary"));for(const r of i){if(r==="*"){d.reject(A.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(const r of a){r.abort()}return}}}},processResponseEndOfBody(r){if(r.aborted){d.reject(new DOMException("aborted","AbortError"));return}d.resolve(r)}}));i.push(d.promise)}const l=Promise.all(i);const d=await l;const p=[];let u=0;for(const r of d){const i={type:"put",request:s[u],response:r};p.push(i);u++}const h=S();let g=null;try{this.#r(p)}catch(r){g=r}queueMicrotask((()=>{if(g===null){h.resolve(undefined)}else{h.reject(g)}}));return h.promise}async put(r,i){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,2,{header:"Cache.put"});r=A.converters.RequestInfo(r);i=A.converters.Response(i);let s=null;if(r instanceof y){s=r[b]}else{s=new y(r)[b]}if(!B(s.url)||s.method!=="GET"){throw A.errors.exception({header:"Cache.put",message:"Expected an http/s scheme when method is not GET"})}const a=i[b];if(a.status===206){throw A.errors.exception({header:"Cache.put",message:"Got 206 status"})}if(a.headersList.contains("vary")){const r=c(a.headersList.get("vary"));for(const i of r){if(i==="*"){throw A.errors.exception({header:"Cache.put",message:"Got * vary field value"})}}}if(a.body&&(p(a.body.stream)||a.body.stream.locked)){throw A.errors.exception({header:"Cache.put",message:"Response body is locked or disturbed"})}const l=g(a);const d=S();if(a.body!=null){const r=a.body.stream;const i=r.getReader();x(i).then(d.resolve,d.reject)}else{d.resolve(undefined)}const u=[];const h={type:"put",request:s,response:l};u.push(h);const w=await d.promise;if(l.body!=null){l.body.source=w}const C=S();let v=null;try{this.#r(u)}catch(r){v=r}queueMicrotask((()=>{if(v===null){C.resolve()}else{C.reject(v)}}));return C.promise}async delete(r,i={}){A.brandCheck(this,Cache);A.argumentLengthCheck(arguments,1,{header:"Cache.delete"});r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);let s=null;if(r instanceof y){s=r[b];if(s.method!=="GET"&&!i.ignoreMethod){return false}}else{R(typeof r==="string");s=new y(r)[b]}const a=[];const l={type:"delete",request:s,options:i};a.push(l);const c=S();let d=null;let p;try{p=this.#r(a)}catch(r){d=r}queueMicrotask((()=>{if(d===null){c.resolve(!!p?.length)}else{c.reject(d)}}));return c.promise}async keys(r=undefined,i={}){A.brandCheck(this,Cache);if(r!==undefined)r=A.converters.RequestInfo(r);i=A.converters.CacheQueryOptions(i);let s=null;if(r!==undefined){if(r instanceof y){s=r[b];if(s.method!=="GET"&&!i.ignoreMethod){return[]}}else if(typeof r==="string"){s=new y(r)[b]}}const a=S();const l=[];if(r===undefined){for(const r of this.#e){l.push(r[0])}}else{const r=this.#t(s,i);for(const i of r){l.push(i[0])}}queueMicrotask((()=>{const r=[];for(const i of l){const s=new y("https://a");s[b]=i;s[w][u]=i.headersList;s[w][C]="immutable";s[v]=i.client;r.push(s)}a.resolve(Object.freeze(r))}));return a.promise}#r(r){const i=this.#e;const s=[...i];const a=[];const l=[];try{for(const s of r){if(s.type!=="delete"&&s.type!=="put"){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'})}if(s.type==="delete"&&s.response!=null){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"})}if(this.#t(s.request,s.options,a).length){throw new DOMException("???","InvalidStateError")}let r;if(s.type==="delete"){r=this.#t(s.request,s.options);if(r.length===0){return[]}for(const s of r){const r=i.indexOf(s);R(r!==-1);i.splice(r,1)}}else if(s.type==="put"){if(s.response==null){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"})}const l=s.request;if(!B(l.url)){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"})}if(l.method!=="GET"){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"})}if(s.options!=null){throw A.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"})}r=this.#t(s.request);for(const s of r){const r=i.indexOf(s);R(r!==-1);i.splice(r,1)}i.push([s.request,s.response]);a.push([s.request,s.response])}l.push([s.request,s.response])}return l}catch(r){this.#e.length=0;this.#e=s;throw r}}#t(r,i,s){const a=[];const l=s??this.#e;for(const s of l){const[l,c]=s;if(this.#n(r,l,c,i)){a.push(s)}}return a}#n(r,i,s=null,a){const d=new URL(r.url);const p=new URL(i.url);if(a?.ignoreSearch){p.search="";d.search=""}if(!l(d,p,true)){return false}if(s==null||a?.ignoreVary||!s.headersList.contains("vary")){return true}const u=c(s.headersList.get("vary"));for(const s of u){if(s==="*"){return false}const a=i.headersList.get(s);const l=r.headersList.get(s);if(a!==l){return false}}return true}}Object.defineProperties(Cache.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:true},match:d,matchAll:d,add:d,addAll:d,put:d,delete:d,keys:d});const _=[{key:"ignoreSearch",converter:A.converters.boolean,defaultValue:false},{key:"ignoreMethod",converter:A.converters.boolean,defaultValue:false},{key:"ignoreVary",converter:A.converters.boolean,defaultValue:false}];A.converters.CacheQueryOptions=A.dictionaryConverter(_);A.converters.MultiCacheQueryOptions=A.dictionaryConverter([..._,{key:"cacheName",converter:A.converters.DOMString}]);A.converters.Response=A.interfaceConverter(h);A.converters["sequence"]=A.sequenceConverter(A.converters.RequestInfo);r.exports={Cache:Cache}},43425:(r,i,s)=>{"use strict";const{kConstruct:a}=s(23450);const{Cache:l}=s(89385);const{webidl:c}=s(87591);const{kEnumerableProperty:d}=s(94766);class CacheStorage{#i=new Map;constructor(){if(arguments[0]!==a){c.illegalConstructor()}}async match(r,i={}){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.match"});r=c.converters.RequestInfo(r);i=c.converters.MultiCacheQueryOptions(i);if(i.cacheName!=null){if(this.#i.has(i.cacheName)){const s=this.#i.get(i.cacheName);const c=new l(a,s);return await c.match(r,i)}}else{for(const s of this.#i.values()){const c=new l(a,s);const d=await c.match(r,i);if(d!==undefined){return d}}}}async has(r){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.has"});r=c.converters.DOMString(r);return this.#i.has(r)}async open(r){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.open"});r=c.converters.DOMString(r);if(this.#i.has(r)){const i=this.#i.get(r);return new l(a,i)}const i=[];this.#i.set(r,i);return new l(a,i)}async delete(r){c.brandCheck(this,CacheStorage);c.argumentLengthCheck(arguments,1,{header:"CacheStorage.delete"});r=c.converters.DOMString(r);return this.#i.delete(r)}async keys(){c.brandCheck(this,CacheStorage);const r=this.#i.keys();return[...r]}}Object.defineProperties(CacheStorage.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:true},match:d,has:d,open:d,delete:d,keys:d});r.exports={CacheStorage:CacheStorage}},23450:(r,i,s)=>{"use strict";r.exports={kConstruct:s(31915).kConstruct}},8581:(r,i,s)=>{"use strict";const a=s(39491);const{URLSerializer:l}=s(80097);const{isValidHeaderName:c}=s(40336);function urlEquals(r,i,s=false){const a=l(r,s);const c=l(i,s);return a===c}function fieldValues(r){a(r!==null);const i=[];for(let s of r.split(",")){s=s.trim();if(!s.length){continue}else if(!c(s)){continue}i.push(s)}return i}r.exports={urlEquals:urlEquals,fieldValues:fieldValues}},55179:(r,i,s)=>{"use strict";const a=s(39491);const l=s(41808);const c=s(13685);const{pipeline:d}=s(12781);const p=s(94766);const u=s(90683);const A=s(50548);const h=s(36228);const{RequestContentLengthMismatchError:g,ResponseContentLengthMismatchError:y,InvalidArgumentError:b,RequestAbortedError:w,HeadersTimeoutError:C,HeadersOverflowError:v,SocketError:I,InformationalError:B,BodyTimeoutError:S,HTTPParserError:x,ResponseExceededMaxSizeError:R,ClientDestroyedError:Q}=s(76291);const _=s(98742);const{kUrl:N,kReset:T,kServerName:k,kClient:D,kBusy:P,kParser:O,kConnect:L,kBlocking:M,kResuming:U,kRunning:j,kPending:H,kSize:q,kWriting:G,kQueue:z,kConnected:V,kConnecting:W,kNeedDrain:Y,kNoRef:J,kKeepAliveDefaultTimeout:$,kHostHeader:X,kPendingIdx:K,kRunningIdx:Z,kError:ee,kPipelining:te,kSocket:re,kKeepAliveTimeoutValue:ne,kMaxHeadersSize:ie,kKeepAliveMaxTimeout:se,kKeepAliveTimeoutThreshold:ae,kHeadersTimeout:oe,kBodyTimeout:le,kStrictContentLength:ce,kConnector:de,kMaxRedirections:pe,kMaxRequests:ue,kCounter:Ae,kClose:fe,kDestroy:me,kDispatch:he,kInterceptors:ge,kLocalAddress:ye,kMaxResponseSize:be,kHTTPConnVersion:Ee,kHost:we,kHTTP2Session:Ce,kHTTP2SessionState:ve,kHTTP2BuildRequest:Ie,kHTTP2CopyHeaders:Be,kHTTP1BuildRequest:Se}=s(31915);let xe;try{xe=s(85158)}catch{xe={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY:Re,HTTP2_HEADER_METHOD:Qe,HTTP2_HEADER_PATH:_e,HTTP2_HEADER_SCHEME:Ne,HTTP2_HEADER_CONTENT_LENGTH:Te,HTTP2_HEADER_EXPECT:ke,HTTP2_HEADER_STATUS:De}}=xe;let Pe=false;const Oe=Buffer[Symbol.species];const Le=Symbol("kClosedResolve");const Me={};try{const r=s(67643);Me.sendHeaders=r.channel("undici:client:sendHeaders");Me.beforeConnect=r.channel("undici:client:beforeConnect");Me.connectError=r.channel("undici:client:connectError");Me.connected=r.channel("undici:client:connected")}catch{Me.sendHeaders={hasSubscribers:false};Me.beforeConnect={hasSubscribers:false};Me.connectError={hasSubscribers:false};Me.connected={hasSubscribers:false}}class Client extends h{constructor(r,{interceptors:i,maxHeaderSize:s,headersTimeout:a,socketTimeout:d,requestTimeout:u,connectTimeout:A,bodyTimeout:h,idleTimeout:g,keepAlive:y,keepAliveTimeout:w,maxKeepAliveTimeout:C,keepAliveMaxTimeout:v,keepAliveTimeoutThreshold:I,socketPath:B,pipelining:S,tls:x,strictContentLength:R,maxCachedSessions:Q,maxRedirections:T,connect:D,maxRequestsPerClient:P,localAddress:O,maxResponseSize:L,autoSelectFamily:M,autoSelectFamilyAttemptTimeout:j,allowH2:H,maxConcurrentStreams:q}={}){super();if(y!==undefined){throw new b("unsupported keepAlive, use pipelining=0 instead")}if(d!==undefined){throw new b("unsupported socketTimeout, use headersTimeout & bodyTimeout instead")}if(u!==undefined){throw new b("unsupported requestTimeout, use headersTimeout & bodyTimeout instead")}if(g!==undefined){throw new b("unsupported idleTimeout, use keepAliveTimeout instead")}if(C!==undefined){throw new b("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead")}if(s!=null&&!Number.isFinite(s)){throw new b("invalid maxHeaderSize")}if(B!=null&&typeof B!=="string"){throw new b("invalid socketPath")}if(A!=null&&(!Number.isFinite(A)||A<0)){throw new b("invalid connectTimeout")}if(w!=null&&(!Number.isFinite(w)||w<=0)){throw new b("invalid keepAliveTimeout")}if(v!=null&&(!Number.isFinite(v)||v<=0)){throw new b("invalid keepAliveMaxTimeout")}if(I!=null&&!Number.isFinite(I)){throw new b("invalid keepAliveTimeoutThreshold")}if(a!=null&&(!Number.isInteger(a)||a<0)){throw new b("headersTimeout must be a positive integer or zero")}if(h!=null&&(!Number.isInteger(h)||h<0)){throw new b("bodyTimeout must be a positive integer or zero")}if(D!=null&&typeof D!=="function"&&typeof D!=="object"){throw new b("connect must be a function or an object")}if(T!=null&&(!Number.isInteger(T)||T<0)){throw new b("maxRedirections must be a positive number")}if(P!=null&&(!Number.isInteger(P)||P<0)){throw new b("maxRequestsPerClient must be a positive number")}if(O!=null&&(typeof O!=="string"||l.isIP(O)===0)){throw new b("localAddress must be valid string IP address")}if(L!=null&&(!Number.isInteger(L)||L<-1)){throw new b("maxResponseSize must be a positive number")}if(j!=null&&(!Number.isInteger(j)||j<-1)){throw new b("autoSelectFamilyAttemptTimeout must be a positive number")}if(H!=null&&typeof H!=="boolean"){throw new b("allowH2 must be a valid boolean value")}if(q!=null&&(typeof q!=="number"||q<1)){throw new b("maxConcurrentStreams must be a possitive integer, greater than 0")}if(typeof D!=="function"){D=_({...x,maxCachedSessions:Q,allowH2:H,socketPath:B,timeout:A,...p.nodeHasAutoSelectFamily&&M?{autoSelectFamily:M,autoSelectFamilyAttemptTimeout:j}:undefined,...D})}this[ge]=i&&i.Client&&Array.isArray(i.Client)?i.Client:[Ue({maxRedirections:T})];this[N]=p.parseOrigin(r);this[de]=D;this[re]=null;this[te]=S!=null?S:1;this[ie]=s||c.maxHeaderSize;this[$]=w==null?4e3:w;this[se]=v==null?6e5:v;this[ae]=I==null?1e3:I;this[ne]=this[$];this[k]=null;this[ye]=O!=null?O:null;this[U]=0;this[Y]=0;this[X]=`host: ${this[N].hostname}${this[N].port?`:${this[N].port}`:""}\r\n`;this[le]=h!=null?h:3e5;this[oe]=a!=null?a:3e5;this[ce]=R==null?true:R;this[pe]=T;this[ue]=P;this[Le]=null;this[be]=L>-1?L:-1;this[Ee]="h1";this[Ce]=null;this[ve]=!H?null:{openStreams:0,maxConcurrentStreams:q!=null?q:100};this[we]=`${this[N].hostname}${this[N].port?`:${this[N].port}`:""}`;this[z]=[];this[Z]=0;this[K]=0}get pipelining(){return this[te]}set pipelining(r){this[te]=r;resume(this,true)}get[H](){return this[z].length-this[K]}get[j](){return this[K]-this[Z]}get[q](){return this[z].length-this[Z]}get[V](){return!!this[re]&&!this[W]&&!this[re].destroyed}get[P](){const r=this[re];return r&&(r[T]||r[G]||r[M])||this[q]>=(this[te]||1)||this[H]>0}[L](r){connect(this);this.once("connect",r)}[he](r,i){const s=r.origin||this[N].origin;const a=this[Ee]==="h2"?A[Ie](s,r,i):A[Se](s,r,i);this[z].push(a);if(this[U]){}else if(p.bodyLength(a.body)==null&&p.isIterable(a.body)){this[U]=1;process.nextTick(resume,this)}else{resume(this,true)}if(this[U]&&this[Y]!==2&&this[P]){this[Y]=2}return this[Y]<2}async[fe](){return new Promise((r=>{if(!this[q]){r(null)}else{this[Le]=r}}))}async[me](r){return new Promise((i=>{const s=this[z].splice(this[K]);for(let i=0;i{if(this[Le]){this[Le]();this[Le]=null}i()};if(this[Ce]!=null){p.destroy(this[Ce],r);this[Ce]=null;this[ve]=null}if(!this[re]){queueMicrotask(callback)}else{p.destroy(this[re].on("close",callback),r)}resume(this)}))}}function onHttp2SessionError(r){a(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID");this[re][ee]=r;onError(this[D],r)}function onHttp2FrameError(r,i,s){const a=new B(`HTTP/2: "frameError" received - type ${r}, code ${i}`);if(s===0){this[re][ee]=a;onError(this[D],a)}}function onHttp2SessionEnd(){p.destroy(this,new I("other side closed"));p.destroy(this[re],new I("other side closed"))}function onHTTP2GoAway(r){const i=this[D];const s=new B(`HTTP/2: "GOAWAY" frame received with code ${r}`);i[re]=null;i[Ce]=null;if(i.destroyed){a(this[H]===0);const r=i[z].splice(i[Z]);for(let i=0;i0){const r=i[z][i[Z]];i[z][i[Z]++]=null;errorRequest(i,r,s)}i[K]=i[Z];a(i[j]===0);i.emit("disconnect",i[N],[i],s);resume(i)}const Fe=s(83993);const Ue=s(76459);const je=Buffer.alloc(0);async function lazyllhttp(){const r=process.env.JEST_WORKER_ID?s(29702):undefined;let i;try{i=await WebAssembly.compile(Buffer.from(s(16594),"base64"))}catch(a){i=await WebAssembly.compile(Buffer.from(r||s(29702),"base64"))}return await WebAssembly.instantiate(i,{env:{wasm_on_url:(r,i,s)=>0,wasm_on_status:(r,i,s)=>{a.strictEqual(Ge.ptr,r);const l=i-We+ze.byteOffset;return Ge.onStatus(new Oe(ze.buffer,l,s))||0},wasm_on_message_begin:r=>{a.strictEqual(Ge.ptr,r);return Ge.onMessageBegin()||0},wasm_on_header_field:(r,i,s)=>{a.strictEqual(Ge.ptr,r);const l=i-We+ze.byteOffset;return Ge.onHeaderField(new Oe(ze.buffer,l,s))||0},wasm_on_header_value:(r,i,s)=>{a.strictEqual(Ge.ptr,r);const l=i-We+ze.byteOffset;return Ge.onHeaderValue(new Oe(ze.buffer,l,s))||0},wasm_on_headers_complete:(r,i,s,l)=>{a.strictEqual(Ge.ptr,r);return Ge.onHeadersComplete(i,Boolean(s),Boolean(l))||0},wasm_on_body:(r,i,s)=>{a.strictEqual(Ge.ptr,r);const l=i-We+ze.byteOffset;return Ge.onBody(new Oe(ze.buffer,l,s))||0},wasm_on_message_complete:r=>{a.strictEqual(Ge.ptr,r);return Ge.onMessageComplete()||0}}})}let He=null;let qe=lazyllhttp();qe.catch();let Ge=null;let ze=null;let Ve=0;let We=null;const Ye=1;const Je=2;const $e=3;class Parser{constructor(r,i,{exports:s}){a(Number.isFinite(r[ie])&&r[ie]>0);this.llhttp=s;this.ptr=this.llhttp.llhttp_alloc(Fe.TYPE.RESPONSE);this.client=r;this.socket=i;this.timeout=null;this.timeoutValue=null;this.timeoutType=null;this.statusCode=null;this.statusText="";this.upgrade=false;this.headers=[];this.headersSize=0;this.headersMaxSize=r[ie];this.shouldKeepAlive=false;this.paused=false;this.resume=this.resume.bind(this);this.bytesRead=0;this.keepAlive="";this.contentLength="";this.connection="";this.maxResponseSize=r[be]}setTimeout(r,i){this.timeoutType=i;if(r!==this.timeoutValue){u.clearTimeout(this.timeout);if(r){this.timeout=u.setTimeout(onParserTimeout,r,this);if(this.timeout.unref){this.timeout.unref()}}else{this.timeout=null}this.timeoutValue=r}else if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}}resume(){if(this.socket.destroyed||!this.paused){return}a(this.ptr!=null);a(Ge==null);this.llhttp.llhttp_resume(this.ptr);a(this.timeoutType===Je);if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}this.paused=false;this.execute(this.socket.read()||je);this.readMore()}readMore(){while(!this.paused&&this.ptr){const r=this.socket.read();if(r===null){break}this.execute(r)}}execute(r){a(this.ptr!=null);a(Ge==null);a(!this.paused);const{socket:i,llhttp:s}=this;if(r.length>Ve){if(We){s.free(We)}Ve=Math.ceil(r.length/4096)*4096;We=s.malloc(Ve)}new Uint8Array(s.memory.buffer,We,Ve).set(r);try{let a;try{ze=r;Ge=this;a=s.llhttp_execute(this.ptr,We,r.length)}catch(r){throw r}finally{Ge=null;ze=null}const l=s.llhttp_get_error_pos(this.ptr)-We;if(a===Fe.ERROR.PAUSED_UPGRADE){this.onUpgrade(r.slice(l))}else if(a===Fe.ERROR.PAUSED){this.paused=true;i.unshift(r.slice(l))}else if(a!==Fe.ERROR.OK){const i=s.llhttp_get_error_reason(this.ptr);let c="";if(i){const r=new Uint8Array(s.memory.buffer,i).indexOf(0);c="Response does not match the HTTP/1.1 protocol ("+Buffer.from(s.memory.buffer,i,r).toString()+")"}throw new x(c,Fe.ERROR[a],r.slice(l))}}catch(r){p.destroy(i,r)}}destroy(){a(this.ptr!=null);a(Ge==null);this.llhttp.llhttp_free(this.ptr);this.ptr=null;u.clearTimeout(this.timeout);this.timeout=null;this.timeoutValue=null;this.timeoutType=null;this.paused=false}onStatus(r){this.statusText=r.toString()}onMessageBegin(){const{socket:r,client:i}=this;if(r.destroyed){return-1}const s=i[z][i[Z]];if(!s){return-1}}onHeaderField(r){const i=this.headers.length;if((i&1)===0){this.headers.push(r)}else{this.headers[i-1]=Buffer.concat([this.headers[i-1],r])}this.trackHeader(r.length)}onHeaderValue(r){let i=this.headers.length;if((i&1)===1){this.headers.push(r);i+=1}else{this.headers[i-1]=Buffer.concat([this.headers[i-1],r])}const s=this.headers[i-2];if(s.length===10&&s.toString().toLowerCase()==="keep-alive"){this.keepAlive+=r.toString()}else if(s.length===10&&s.toString().toLowerCase()==="connection"){this.connection+=r.toString()}else if(s.length===14&&s.toString().toLowerCase()==="content-length"){this.contentLength+=r.toString()}this.trackHeader(r.length)}trackHeader(r){this.headersSize+=r;if(this.headersSize>=this.headersMaxSize){p.destroy(this.socket,new v)}}onUpgrade(r){const{upgrade:i,client:s,socket:l,headers:c,statusCode:d}=this;a(i);const u=s[z][s[Z]];a(u);a(!l.destroyed);a(l===s[re]);a(!this.paused);a(u.upgrade||u.method==="CONNECT");this.statusCode=null;this.statusText="";this.shouldKeepAlive=null;a(this.headers.length%2===0);this.headers=[];this.headersSize=0;l.unshift(r);l[O].destroy();l[O]=null;l[D]=null;l[ee]=null;l.removeListener("error",onSocketError).removeListener("readable",onSocketReadable).removeListener("end",onSocketEnd).removeListener("close",onSocketClose);s[re]=null;s[z][s[Z]++]=null;s.emit("disconnect",s[N],[s],new B("upgrade"));try{u.onUpgrade(d,c,l)}catch(r){p.destroy(l,r)}resume(s)}onHeadersComplete(r,i,s){const{client:l,socket:c,headers:d,statusText:u}=this;if(c.destroyed){return-1}const A=l[z][l[Z]];if(!A){return-1}a(!this.upgrade);a(this.statusCode<200);if(r===100){p.destroy(c,new I("bad response",p.getSocketInfo(c)));return-1}if(i&&!A.upgrade){p.destroy(c,new I("bad upgrade",p.getSocketInfo(c)));return-1}a.strictEqual(this.timeoutType,Ye);this.statusCode=r;this.shouldKeepAlive=s||A.method==="HEAD"&&!c[T]&&this.connection.toLowerCase()==="keep-alive";if(this.statusCode>=200){const r=A.bodyTimeout!=null?A.bodyTimeout:l[le];this.setTimeout(r,Je)}else if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}if(A.method==="CONNECT"){a(l[j]===1);this.upgrade=true;return 2}if(i){a(l[j]===1);this.upgrade=true;return 2}a(this.headers.length%2===0);this.headers=[];this.headersSize=0;if(this.shouldKeepAlive&&l[te]){const r=this.keepAlive?p.parseKeepAliveTimeout(this.keepAlive):null;if(r!=null){const i=Math.min(r-l[ae],l[se]);if(i<=0){c[T]=true}else{l[ne]=i}}else{l[ne]=l[$]}}else{c[T]=true}const h=A.onHeaders(r,d,this.resume,u)===false;if(A.aborted){return-1}if(A.method==="HEAD"){return 1}if(r<200){return 1}if(c[M]){c[M]=false;resume(l)}return h?Fe.ERROR.PAUSED:0}onBody(r){const{client:i,socket:s,statusCode:l,maxResponseSize:c}=this;if(s.destroyed){return-1}const d=i[z][i[Z]];a(d);a.strictEqual(this.timeoutType,Je);if(this.timeout){if(this.timeout.refresh){this.timeout.refresh()}}a(l>=200);if(c>-1&&this.bytesRead+r.length>c){p.destroy(s,new R);return-1}this.bytesRead+=r.length;if(d.onData(r)===false){return Fe.ERROR.PAUSED}}onMessageComplete(){const{client:r,socket:i,statusCode:s,upgrade:l,headers:c,contentLength:d,bytesRead:u,shouldKeepAlive:A}=this;if(i.destroyed&&(!s||A)){return-1}if(l){return}const h=r[z][r[Z]];a(h);a(s>=100);this.statusCode=null;this.statusText="";this.bytesRead=0;this.contentLength="";this.keepAlive="";this.connection="";a(this.headers.length%2===0);this.headers=[];this.headersSize=0;if(s<200){return}if(h.method!=="HEAD"&&d&&u!==parseInt(d,10)){p.destroy(i,new y);return-1}h.onComplete(c);r[z][r[Z]++]=null;if(i[G]){a.strictEqual(r[j],0);p.destroy(i,new B("reset"));return Fe.ERROR.PAUSED}else if(!A){p.destroy(i,new B("reset"));return Fe.ERROR.PAUSED}else if(i[T]&&r[j]===0){p.destroy(i,new B("reset"));return Fe.ERROR.PAUSED}else if(r[te]===1){setImmediate(resume,r)}else{resume(r)}}}function onParserTimeout(r){const{socket:i,timeoutType:s,client:l}=r;if(s===Ye){if(!i[G]||i.writableNeedDrain||l[j]>1){a(!r.paused,"cannot be paused while waiting for headers");p.destroy(i,new C)}}else if(s===Je){if(!r.paused){p.destroy(i,new S)}}else if(s===$e){a(l[j]===0&&l[ne]);p.destroy(i,new B("socket idle timeout"))}}function onSocketReadable(){const{[O]:r}=this;if(r){r.readMore()}}function onSocketError(r){const{[D]:i,[O]:s}=this;a(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID");if(i[Ee]!=="h2"){if(r.code==="ECONNRESET"&&s.statusCode&&!s.shouldKeepAlive){s.onMessageComplete();return}}this[ee]=r;onError(this[D],r)}function onError(r,i){if(r[j]===0&&i.code!=="UND_ERR_INFO"&&i.code!=="UND_ERR_SOCKET"){a(r[K]===r[Z]);const s=r[z].splice(r[Z]);for(let a=0;a0&&s.code!=="UND_ERR_INFO"){const i=r[z][r[Z]];r[z][r[Z]++]=null;errorRequest(r,i,s)}r[K]=r[Z];a(r[j]===0);r.emit("disconnect",r[N],[r],s);resume(r)}async function connect(r){a(!r[W]);a(!r[re]);let{host:i,hostname:s,protocol:c,port:d}=r[N];if(s[0]==="["){const r=s.indexOf("]");a(r!==-1);const i=s.substring(1,r);a(l.isIP(i));s=i}r[W]=true;if(Me.beforeConnect.hasSubscribers){Me.beforeConnect.publish({connectParams:{host:i,hostname:s,protocol:c,port:d,servername:r[k],localAddress:r[ye]},connector:r[de]})}try{const l=await new Promise(((a,l)=>{r[de]({host:i,hostname:s,protocol:c,port:d,servername:r[k],localAddress:r[ye]},((r,i)=>{if(r){l(r)}else{a(i)}}))}));if(r.destroyed){p.destroy(l.on("error",(()=>{})),new Q);return}r[W]=false;a(l);const u=l.alpnProtocol==="h2";if(u){if(!Pe){Pe=true;process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"})}const i=xe.connect(r[N],{createConnection:()=>l,peerMaxConcurrentStreams:r[ve].maxConcurrentStreams});r[Ee]="h2";i[D]=r;i[re]=l;i.on("error",onHttp2SessionError);i.on("frameError",onHttp2FrameError);i.on("end",onHttp2SessionEnd);i.on("goaway",onHTTP2GoAway);i.on("close",onSocketClose);i.unref();r[Ce]=i;l[Ce]=i}else{if(!He){He=await qe;qe=null}l[J]=false;l[G]=false;l[T]=false;l[M]=false;l[O]=new Parser(r,l,He)}l[Ae]=0;l[ue]=r[ue];l[D]=r;l[ee]=null;l.on("error",onSocketError).on("readable",onSocketReadable).on("end",onSocketEnd).on("close",onSocketClose);r[re]=l;if(Me.connected.hasSubscribers){Me.connected.publish({connectParams:{host:i,hostname:s,protocol:c,port:d,servername:r[k],localAddress:r[ye]},connector:r[de],socket:l})}r.emit("connect",r[N],[r])}catch(l){if(r.destroyed){return}r[W]=false;if(Me.connectError.hasSubscribers){Me.connectError.publish({connectParams:{host:i,hostname:s,protocol:c,port:d,servername:r[k],localAddress:r[ye]},connector:r[de],error:l})}if(l.code==="ERR_TLS_CERT_ALTNAME_INVALID"){a(r[j]===0);while(r[H]>0&&r[z][r[K]].servername===r[k]){const i=r[z][r[K]++];errorRequest(r,i,l)}}else{onError(r,l)}r.emit("connectionError",r[N],[r],l)}resume(r)}function emitDrain(r){r[Y]=0;r.emit("drain",r[N],[r])}function resume(r,i){if(r[U]===2){return}r[U]=2;_resume(r,i);r[U]=0;if(r[Z]>256){r[z].splice(0,r[Z]);r[K]-=r[Z];r[Z]=0}}function _resume(r,i){while(true){if(r.destroyed){a(r[H]===0);return}if(r[Le]&&!r[q]){r[Le]();r[Le]=null;return}const s=r[re];if(s&&!s.destroyed&&s.alpnProtocol!=="h2"){if(r[q]===0){if(!s[J]&&s.unref){s.unref();s[J]=true}}else if(s[J]&&s.ref){s.ref();s[J]=false}if(r[q]===0){if(s[O].timeoutType!==$e){s[O].setTimeout(r[ne],$e)}}else if(r[j]>0&&s[O].statusCode<200){if(s[O].timeoutType!==Ye){const i=r[z][r[Z]];const a=i.headersTimeout!=null?i.headersTimeout:r[oe];s[O].setTimeout(a,Ye)}}}if(r[P]){r[Y]=2}else if(r[Y]===2){if(i){r[Y]=1;process.nextTick(emitDrain,r)}else{emitDrain(r)}continue}if(r[H]===0){return}if(r[j]>=(r[te]||1)){return}const l=r[z][r[K]];if(r[N].protocol==="https:"&&r[k]!==l.servername){if(r[j]>0){return}r[k]=l.servername;if(s&&s.servername!==l.servername){p.destroy(s,new B("servername changed"));return}}if(r[W]){return}if(!s&&!r[Ce]){connect(r);return}if(s.destroyed||s[G]||s[T]||s[M]){return}if(r[j]>0&&!l.idempotent){return}if(r[j]>0&&(l.upgrade||l.method==="CONNECT")){return}if(r[j]>0&&p.bodyLength(l.body)!==0&&(p.isStream(l.body)||p.isAsyncIterable(l.body))){return}if(!l.aborted&&write(r,l)){r[K]++}else{r[z].splice(r[K],1)}}}function shouldSendContentLength(r){return r!=="GET"&&r!=="HEAD"&&r!=="OPTIONS"&&r!=="TRACE"&&r!=="CONNECT"}function write(r,i){if(r[Ee]==="h2"){writeH2(r,r[Ce],i);return}const{body:s,method:l,path:c,host:d,upgrade:u,headers:A,blocking:h,reset:y}=i;const b=l==="PUT"||l==="POST"||l==="PATCH";if(s&&typeof s.read==="function"){s.read(0)}const C=p.bodyLength(s);let v=C;if(v===null){v=i.contentLength}if(v===0&&!b){v=null}if(shouldSendContentLength(l)&&v>0&&i.contentLength!==null&&i.contentLength!==v){if(r[ce]){errorRequest(r,i,new g);return false}process.emitWarning(new g)}const I=r[re];try{i.onConnect((s=>{if(i.aborted||i.completed){return}errorRequest(r,i,s||new w);p.destroy(I,new B("aborted"))}))}catch(s){errorRequest(r,i,s)}if(i.aborted){return false}if(l==="HEAD"){I[T]=true}if(u||l==="CONNECT"){I[T]=true}if(y!=null){I[T]=y}if(r[ue]&&I[Ae]++>=r[ue]){I[T]=true}if(h){I[M]=true}let S=`${l} ${c} HTTP/1.1\r\n`;if(typeof d==="string"){S+=`host: ${d}\r\n`}else{S+=r[X]}if(u){S+=`connection: upgrade\r\nupgrade: ${u}\r\n`}else if(r[te]&&!I[T]){S+="connection: keep-alive\r\n"}else{S+="connection: close\r\n"}if(A){S+=A}if(Me.sendHeaders.hasSubscribers){Me.sendHeaders.publish({request:i,headers:S,socket:I})}if(!s||C===0){if(v===0){I.write(`${S}content-length: 0\r\n\r\n`,"latin1")}else{a(v===null,"no body must not have content length");I.write(`${S}\r\n`,"latin1")}i.onRequestSent()}else if(p.isBuffer(s)){a(v===s.byteLength,"buffer body must have content length");I.cork();I.write(`${S}content-length: ${v}\r\n\r\n`,"latin1");I.write(s);I.uncork();i.onBodySent(s);i.onRequestSent();if(!b){I[T]=true}}else if(p.isBlobLike(s)){if(typeof s.stream==="function"){writeIterable({body:s.stream(),client:r,request:i,socket:I,contentLength:v,header:S,expectsPayload:b})}else{writeBlob({body:s,client:r,request:i,socket:I,contentLength:v,header:S,expectsPayload:b})}}else if(p.isStream(s)){writeStream({body:s,client:r,request:i,socket:I,contentLength:v,header:S,expectsPayload:b})}else if(p.isIterable(s)){writeIterable({body:s,client:r,request:i,socket:I,contentLength:v,header:S,expectsPayload:b})}else{a(false)}return true}function writeH2(r,i,s){const{body:l,method:c,path:d,host:u,upgrade:h,expectContinue:y,signal:b,headers:C}=s;let v;if(typeof C==="string")v=A[Be](C.trim());else v=C;if(h){errorRequest(r,s,new Error("Upgrade not supported for H2"));return false}try{s.onConnect((i=>{if(s.aborted||s.completed){return}errorRequest(r,s,i||new w)}))}catch(i){errorRequest(r,s,i)}if(s.aborted){return false}let I;const S=r[ve];v[Re]=u||r[we];v[Qe]=c;if(c==="CONNECT"){i.ref();I=i.request(v,{endStream:false,signal:b});if(I.id&&!I.pending){s.onUpgrade(null,null,I);++S.openStreams}else{I.once("ready",(()=>{s.onUpgrade(null,null,I);++S.openStreams}))}I.once("close",(()=>{S.openStreams-=1;if(S.openStreams===0)i.unref()}));return true}v[_e]=d;v[Ne]="https";const x=c==="PUT"||c==="POST"||c==="PATCH";if(l&&typeof l.read==="function"){l.read(0)}let R=p.bodyLength(l);if(R==null){R=s.contentLength}if(R===0||!x){R=null}if(shouldSendContentLength(c)&&R>0&&s.contentLength!=null&&s.contentLength!==R){if(r[ce]){errorRequest(r,s,new g);return false}process.emitWarning(new g)}if(R!=null){a(l,"no body must not have content length");v[Te]=`${R}`}i.ref();const Q=c==="GET"||c==="HEAD";if(y){v[ke]="100-continue";I=i.request(v,{endStream:Q,signal:b});I.once("continue",writeBodyH2)}else{I=i.request(v,{endStream:Q,signal:b});writeBodyH2()}++S.openStreams;I.once("response",(r=>{const{[De]:i,...a}=r;if(s.onHeaders(Number(i),a,I.resume.bind(I),"")===false){I.pause()}}));I.once("end",(()=>{s.onComplete([])}));I.on("data",(r=>{if(s.onData(r)===false){I.pause()}}));I.once("close",(()=>{S.openStreams-=1;if(S.openStreams===0){i.unref()}}));I.once("error",(function(i){if(r[Ce]&&!r[Ce].destroyed&&!this.closed&&!this.destroyed){S.streams-=1;p.destroy(I,i)}}));I.once("frameError",((i,a)=>{const l=new B(`HTTP/2: "frameError" received - type ${i}, code ${a}`);errorRequest(r,s,l);if(r[Ce]&&!r[Ce].destroyed&&!this.closed&&!this.destroyed){S.streams-=1;p.destroy(I,l)}}));return true;function writeBodyH2(){if(!l){s.onRequestSent()}else if(p.isBuffer(l)){a(R===l.byteLength,"buffer body must have content length");I.cork();I.write(l);I.uncork();I.end();s.onBodySent(l);s.onRequestSent()}else if(p.isBlobLike(l)){if(typeof l.stream==="function"){writeIterable({client:r,request:s,contentLength:R,h2stream:I,expectsPayload:x,body:l.stream(),socket:r[re],header:""})}else{writeBlob({body:l,client:r,request:s,contentLength:R,expectsPayload:x,h2stream:I,header:"",socket:r[re]})}}else if(p.isStream(l)){writeStream({body:l,client:r,request:s,contentLength:R,expectsPayload:x,socket:r[re],h2stream:I,header:""})}else if(p.isIterable(l)){writeIterable({body:l,client:r,request:s,contentLength:R,expectsPayload:x,header:"",h2stream:I,socket:r[re]})}else{a(false)}}}function writeStream({h2stream:r,body:i,client:s,request:l,socket:c,contentLength:u,header:A,expectsPayload:h}){a(u!==0||s[j]===0,"stream body cannot be pipelined");if(s[Ee]==="h2"){const b=d(i,r,(s=>{if(s){p.destroy(i,s);p.destroy(r,s)}else{l.onRequestSent()}}));b.on("data",onPipeData);b.once("end",(()=>{b.removeListener("data",onPipeData);p.destroy(b)}));function onPipeData(r){l.onBodySent(r)}return}let g=false;const y=new AsyncWriter({socket:c,request:l,contentLength:u,client:s,expectsPayload:h,header:A});const onData=function(r){if(g){return}try{if(!y.write(r)&&this.pause){this.pause()}}catch(r){p.destroy(this,r)}};const onDrain=function(){if(g){return}if(i.resume){i.resume()}};const onAbort=function(){if(g){return}const r=new w;queueMicrotask((()=>onFinished(r)))};const onFinished=function(r){if(g){return}g=true;a(c.destroyed||c[G]&&s[j]<=1);c.off("drain",onDrain).off("error",onFinished);i.removeListener("data",onData).removeListener("end",onFinished).removeListener("error",onFinished).removeListener("close",onAbort);if(!r){try{y.end()}catch(i){r=i}}y.destroy(r);if(r&&(r.code!=="UND_ERR_INFO"||r.message!=="reset")){p.destroy(i,r)}else{p.destroy(i)}};i.on("data",onData).on("end",onFinished).on("error",onFinished).on("close",onAbort);if(i.resume){i.resume()}c.on("drain",onDrain).on("error",onFinished)}async function writeBlob({h2stream:r,body:i,client:s,request:l,socket:c,contentLength:d,header:u,expectsPayload:A}){a(d===i.size,"blob body must have content length");const h=s[Ee]==="h2";try{if(d!=null&&d!==i.size){throw new g}const a=Buffer.from(await i.arrayBuffer());if(h){r.cork();r.write(a);r.uncork()}else{c.cork();c.write(`${u}content-length: ${d}\r\n\r\n`,"latin1");c.write(a);c.uncork()}l.onBodySent(a);l.onRequestSent();if(!A){c[T]=true}resume(s)}catch(i){p.destroy(h?r:c,i)}}async function writeIterable({h2stream:r,body:i,client:s,request:l,socket:c,contentLength:d,header:p,expectsPayload:u}){a(d!==0||s[j]===0,"iterator body cannot be pipelined");let A=null;function onDrain(){if(A){const r=A;A=null;r()}}const waitForDrain=()=>new Promise(((r,i)=>{a(A===null);if(c[ee]){i(c[ee])}else{A=r}}));if(s[Ee]==="h2"){r.on("close",onDrain).on("drain",onDrain);try{for await(const s of i){if(c[ee]){throw c[ee]}const i=r.write(s);l.onBodySent(s);if(!i){await waitForDrain()}}}catch(i){r.destroy(i)}finally{l.onRequestSent();r.end();r.off("close",onDrain).off("drain",onDrain)}return}c.on("close",onDrain).on("drain",onDrain);const h=new AsyncWriter({socket:c,request:l,contentLength:d,client:s,expectsPayload:u,header:p});try{for await(const r of i){if(c[ee]){throw c[ee]}if(!h.write(r)){await waitForDrain()}}h.end()}catch(r){h.destroy(r)}finally{c.off("close",onDrain).off("drain",onDrain)}}class AsyncWriter{constructor({socket:r,request:i,contentLength:s,client:a,expectsPayload:l,header:c}){this.socket=r;this.request=i;this.contentLength=s;this.client=a;this.bytesWritten=0;this.expectsPayload=l;this.header=c;r[G]=true}write(r){const{socket:i,request:s,contentLength:a,client:l,bytesWritten:c,expectsPayload:d,header:p}=this;if(i[ee]){throw i[ee]}if(i.destroyed){return false}const u=Buffer.byteLength(r);if(!u){return true}if(a!==null&&c+u>a){if(l[ce]){throw new g}process.emitWarning(new g)}i.cork();if(c===0){if(!d){i[T]=true}if(a===null){i.write(`${p}transfer-encoding: chunked\r\n`,"latin1")}else{i.write(`${p}content-length: ${a}\r\n\r\n`,"latin1")}}if(a===null){i.write(`\r\n${u.toString(16)}\r\n`,"latin1")}this.bytesWritten+=u;const A=i.write(r);i.uncork();s.onBodySent(r);if(!A){if(i[O].timeout&&i[O].timeoutType===Ye){if(i[O].timeout.refresh){i[O].timeout.refresh()}}}return A}end(){const{socket:r,contentLength:i,client:s,bytesWritten:a,expectsPayload:l,header:c,request:d}=this;d.onRequestSent();r[G]=false;if(r[ee]){throw r[ee]}if(r.destroyed){return}if(a===0){if(l){r.write(`${c}content-length: 0\r\n\r\n`,"latin1")}else{r.write(`${c}\r\n`,"latin1")}}else if(i===null){r.write("\r\n0\r\n\r\n","latin1")}if(i!==null&&a!==i){if(s[ce]){throw new g}else{process.emitWarning(new g)}}if(r[O].timeout&&r[O].timeoutType===Ye){if(r[O].timeout.refresh){r[O].timeout.refresh()}}resume(s)}destroy(r){const{socket:i,client:s}=this;i[G]=false;if(r){a(s[j]<=1,"pipeline should only contain this request");p.destroy(i,r)}}}function errorRequest(r,i,s){try{i.onError(s);a(i.aborted)}catch(s){r.emit("error",s)}}r.exports=Client},17428:(r,i,s)=>{"use strict";const{kConnected:a,kSize:l}=s(31915);class CompatWeakRef{constructor(r){this.value=r}deref(){return this.value[a]===0&&this.value[l]===0?undefined:this.value}}class CompatFinalizer{constructor(r){this.finalizer=r}register(r,i){if(r.on){r.on("disconnect",(()=>{if(r[a]===0&&r[l]===0){this.finalizer(i)}}))}}}r.exports=function(){if(process.env.NODE_V8_COVERAGE){return{WeakRef:CompatWeakRef,FinalizationRegistry:CompatFinalizer}}return{WeakRef:global.WeakRef||CompatWeakRef,FinalizationRegistry:global.FinalizationRegistry||CompatFinalizer}}},96747:r=>{"use strict";const i=1024;const s=4096;r.exports={maxAttributeValueSize:i,maxNameValuePairSize:s}},62549:(r,i,s)=>{"use strict";const{parseSetCookie:a}=s(4628);const{stringify:l,getHeadersList:c}=s(17751);const{webidl:d}=s(87591);const{Headers:p}=s(8247);function getCookies(r){d.argumentLengthCheck(arguments,1,{header:"getCookies"});d.brandCheck(r,p,{strict:false});const i=r.get("cookie");const s={};if(!i){return s}for(const r of i.split(";")){const[i,...a]=r.split("=");s[i.trim()]=a.join("=")}return s}function deleteCookie(r,i,s){d.argumentLengthCheck(arguments,2,{header:"deleteCookie"});d.brandCheck(r,p,{strict:false});i=d.converters.DOMString(i);s=d.converters.DeleteCookieAttributes(s);setCookie(r,{name:i,value:"",expires:new Date(0),...s})}function getSetCookies(r){d.argumentLengthCheck(arguments,1,{header:"getSetCookies"});d.brandCheck(r,p,{strict:false});const i=c(r).cookies;if(!i){return[]}return i.map((r=>a(Array.isArray(r)?r[1]:r)))}function setCookie(r,i){d.argumentLengthCheck(arguments,2,{header:"setCookie"});d.brandCheck(r,p,{strict:false});i=d.converters.Cookie(i);const s=l(i);if(s){r.append("Set-Cookie",l(i))}}d.converters.DeleteCookieAttributes=d.dictionaryConverter([{converter:d.nullableConverter(d.converters.DOMString),key:"path",defaultValue:null},{converter:d.nullableConverter(d.converters.DOMString),key:"domain",defaultValue:null}]);d.converters.Cookie=d.dictionaryConverter([{converter:d.converters.DOMString,key:"name"},{converter:d.converters.DOMString,key:"value"},{converter:d.nullableConverter((r=>{if(typeof r==="number"){return d.converters["unsigned long long"](r)}return new Date(r)})),key:"expires",defaultValue:null},{converter:d.nullableConverter(d.converters["long long"]),key:"maxAge",defaultValue:null},{converter:d.nullableConverter(d.converters.DOMString),key:"domain",defaultValue:null},{converter:d.nullableConverter(d.converters.DOMString),key:"path",defaultValue:null},{converter:d.nullableConverter(d.converters.boolean),key:"secure",defaultValue:null},{converter:d.nullableConverter(d.converters.boolean),key:"httpOnly",defaultValue:null},{converter:d.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:d.sequenceConverter(d.converters.DOMString),key:"unparsed",defaultValue:[]}]);r.exports={getCookies:getCookies,deleteCookie:deleteCookie,getSetCookies:getSetCookies,setCookie:setCookie}},4628:(r,i,s)=>{"use strict";const{maxNameValuePairSize:a,maxAttributeValueSize:l}=s(96747);const{isCTLExcludingHtab:c}=s(17751);const{collectASequenceOfCodePointsFast:d}=s(80097);const p=s(39491);function parseSetCookie(r){if(c(r)){return null}let i="";let s="";let l="";let p="";if(r.includes(";")){const a={position:0};i=d(";",r,a);s=r.slice(a.position)}else{i=r}if(!i.includes("=")){p=i}else{const r={position:0};l=d("=",i,r);p=i.slice(r.position+1)}l=l.trim();p=p.trim();if(l.length+p.length>a){return null}return{name:l,value:p,...parseUnparsedAttributes(s)}}function parseUnparsedAttributes(r,i={}){if(r.length===0){return i}p(r[0]===";");r=r.slice(1);let s="";if(r.includes(";")){s=d(";",r,{position:0});r=r.slice(s.length)}else{s=r;r=""}let a="";let c="";if(s.includes("=")){const r={position:0};a=d("=",s,r);c=s.slice(r.position+1)}else{a=s}a=a.trim();c=c.trim();if(c.length>l){return parseUnparsedAttributes(r,i)}const u=a.toLowerCase();if(u==="expires"){const r=new Date(c);i.expires=r}else if(u==="max-age"){const s=c.charCodeAt(0);if((s<48||s>57)&&c[0]!=="-"){return parseUnparsedAttributes(r,i)}if(!/^\d+$/.test(c)){return parseUnparsedAttributes(r,i)}const a=Number(c);i.maxAge=a}else if(u==="domain"){let r=c;if(r[0]==="."){r=r.slice(1)}r=r.toLowerCase();i.domain=r}else if(u==="path"){let r="";if(c.length===0||c[0]!=="/"){r="/"}else{r=c}i.path=r}else if(u==="secure"){i.secure=true}else if(u==="httponly"){i.httpOnly=true}else if(u==="samesite"){let r="Default";const s=c.toLowerCase();if(s.includes("none")){r="None"}if(s.includes("strict")){r="Strict"}if(s.includes("lax")){r="Lax"}i.sameSite=r}else{i.unparsed??=[];i.unparsed.push(`${a}=${c}`)}return parseUnparsedAttributes(r,i)}r.exports={parseSetCookie:parseSetCookie,parseUnparsedAttributes:parseUnparsedAttributes}},17751:(r,i,s)=>{"use strict";const a=s(39491);const{kHeadersList:l}=s(31915);function isCTLExcludingHtab(r){if(r.length===0){return false}for(const i of r){const r=i.charCodeAt(0);if(r>=0||r<=8||(r>=10||r<=31)||r===127){return false}}}function validateCookieName(r){for(const i of r){const r=i.charCodeAt(0);if(r<=32||r>127||i==="("||i===")"||i===">"||i==="<"||i==="@"||i===","||i===";"||i===":"||i==="\\"||i==='"'||i==="/"||i==="["||i==="]"||i==="?"||i==="="||i==="{"||i==="}"){throw new Error("Invalid cookie name")}}}function validateCookieValue(r){for(const i of r){const r=i.charCodeAt(0);if(r<33||r===34||r===44||r===59||r===92||r>126){throw new Error("Invalid header value")}}}function validateCookiePath(r){for(const i of r){const r=i.charCodeAt(0);if(r<33||i===";"){throw new Error("Invalid cookie path")}}}function validateCookieDomain(r){if(r.startsWith("-")||r.endsWith(".")||r.endsWith("-")){throw new Error("Invalid cookie domain")}}function toIMFDate(r){if(typeof r==="number"){r=new Date(r)}const i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];const s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const a=i[r.getUTCDay()];const l=r.getUTCDate().toString().padStart(2,"0");const c=s[r.getUTCMonth()];const d=r.getUTCFullYear();const p=r.getUTCHours().toString().padStart(2,"0");const u=r.getUTCMinutes().toString().padStart(2,"0");const A=r.getUTCSeconds().toString().padStart(2,"0");return`${a}, ${l} ${c} ${d} ${p}:${u}:${A} GMT`}function validateCookieMaxAge(r){if(r<0){throw new Error("Invalid cookie max-age")}}function stringify(r){if(r.name.length===0){return null}validateCookieName(r.name);validateCookieValue(r.value);const i=[`${r.name}=${r.value}`];if(r.name.startsWith("__Secure-")){r.secure=true}if(r.name.startsWith("__Host-")){r.secure=true;r.domain=null;r.path="/"}if(r.secure){i.push("Secure")}if(r.httpOnly){i.push("HttpOnly")}if(typeof r.maxAge==="number"){validateCookieMaxAge(r.maxAge);i.push(`Max-Age=${r.maxAge}`)}if(r.domain){validateCookieDomain(r.domain);i.push(`Domain=${r.domain}`)}if(r.path){validateCookiePath(r.path);i.push(`Path=${r.path}`)}if(r.expires&&r.expires.toString()!=="Invalid Date"){i.push(`Expires=${toIMFDate(r.expires)}`)}if(r.sameSite){i.push(`SameSite=${r.sameSite}`)}for(const s of r.unparsed){if(!s.includes("=")){throw new Error("Invalid unparsed")}const[r,...a]=s.split("=");i.push(`${r.trim()}=${a.join("=")}`)}return i.join("; ")}let c;function getHeadersList(r){if(r[l]){return r[l]}if(!c){c=Object.getOwnPropertySymbols(r).find((r=>r.description==="headers list"));a(c,"Headers cannot be parsed")}const i=r[c];a(i);return i}r.exports={isCTLExcludingHtab:isCTLExcludingHtab,stringify:stringify,getHeadersList:getHeadersList}},98742:(r,i,s)=>{"use strict";const a=s(41808);const l=s(39491);const c=s(94766);const{InvalidArgumentError:d,ConnectTimeoutError:p}=s(76291);let u;let A;if(global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE){A=class WeakSessionCache{constructor(r){this._maxCachedSessions=r;this._sessionCache=new Map;this._sessionRegistry=new global.FinalizationRegistry((r=>{if(this._sessionCache.size=this._maxCachedSessions){const{value:r}=this._sessionCache.keys().next();this._sessionCache.delete(r)}this._sessionCache.set(r,i)}}}function buildConnector({allowH2:r,maxCachedSessions:i,socketPath:p,timeout:h,...g}){if(i!=null&&(!Number.isInteger(i)||i<0)){throw new d("maxCachedSessions must be a positive integer or zero")}const y={path:p,...g};const b=new A(i==null?100:i);h=h==null?1e4:h;r=r!=null?r:false;return function connect({hostname:i,host:d,protocol:p,port:A,servername:g,localAddress:w,httpSocket:C},v){let I;if(p==="https:"){if(!u){u=s(24404)}g=g||y.servername||c.getServerName(d)||null;const a=g||i;const p=b.get(a)||null;l(a);I=u.connect({highWaterMark:16384,...y,servername:g,session:p,localAddress:w,ALPNProtocols:r?["http/1.1","h2"]:["http/1.1"],socket:C,port:A||443,host:i});I.on("session",(function(r){b.set(a,r)}))}else{l(!C,"httpSocket can only be sent on TLS update");I=a.connect({highWaterMark:64*1024,...y,localAddress:w,port:A||80,host:i})}if(y.keepAlive==null||y.keepAlive){const r=y.keepAliveInitialDelay===undefined?6e4:y.keepAliveInitialDelay;I.setKeepAlive(true,r)}const B=setupTimeout((()=>onConnectTimeout(I)),h);I.setNoDelay(true).once(p==="https:"?"secureConnect":"connect",(function(){B();if(v){const r=v;v=null;r(null,this)}})).on("error",(function(r){B();if(v){const i=v;v=null;i(r)}}));return I}}function setupTimeout(r,i){if(!i){return()=>{}}let s=null;let a=null;const l=setTimeout((()=>{s=setImmediate((()=>{if(process.platform==="win32"){a=setImmediate((()=>r()))}else{r()}}))}),i);return()=>{clearTimeout(l);clearImmediate(s);clearImmediate(a)}}function onConnectTimeout(r){c.destroy(r,new p)}r.exports=buildConnector},76291:r=>{"use strict";class UndiciError extends Error{constructor(r){super(r);this.name="UndiciError";this.code="UND_ERR"}}class ConnectTimeoutError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ConnectTimeoutError);this.name="ConnectTimeoutError";this.message=r||"Connect Timeout Error";this.code="UND_ERR_CONNECT_TIMEOUT"}}class HeadersTimeoutError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,HeadersTimeoutError);this.name="HeadersTimeoutError";this.message=r||"Headers Timeout Error";this.code="UND_ERR_HEADERS_TIMEOUT"}}class HeadersOverflowError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,HeadersOverflowError);this.name="HeadersOverflowError";this.message=r||"Headers Overflow Error";this.code="UND_ERR_HEADERS_OVERFLOW"}}class BodyTimeoutError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,BodyTimeoutError);this.name="BodyTimeoutError";this.message=r||"Body Timeout Error";this.code="UND_ERR_BODY_TIMEOUT"}}class ResponseStatusCodeError extends UndiciError{constructor(r,i,s,a){super(r);Error.captureStackTrace(this,ResponseStatusCodeError);this.name="ResponseStatusCodeError";this.message=r||"Response Status Code Error";this.code="UND_ERR_RESPONSE_STATUS_CODE";this.body=a;this.status=i;this.statusCode=i;this.headers=s}}class InvalidArgumentError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,InvalidArgumentError);this.name="InvalidArgumentError";this.message=r||"Invalid Argument Error";this.code="UND_ERR_INVALID_ARG"}}class InvalidReturnValueError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,InvalidReturnValueError);this.name="InvalidReturnValueError";this.message=r||"Invalid Return Value Error";this.code="UND_ERR_INVALID_RETURN_VALUE"}}class RequestAbortedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,RequestAbortedError);this.name="AbortError";this.message=r||"Request aborted";this.code="UND_ERR_ABORTED"}}class InformationalError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,InformationalError);this.name="InformationalError";this.message=r||"Request information";this.code="UND_ERR_INFO"}}class RequestContentLengthMismatchError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,RequestContentLengthMismatchError);this.name="RequestContentLengthMismatchError";this.message=r||"Request body length does not match content-length header";this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}}class ResponseContentLengthMismatchError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ResponseContentLengthMismatchError);this.name="ResponseContentLengthMismatchError";this.message=r||"Response body length does not match content-length header";this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}}class ClientDestroyedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ClientDestroyedError);this.name="ClientDestroyedError";this.message=r||"The client is destroyed";this.code="UND_ERR_DESTROYED"}}class ClientClosedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ClientClosedError);this.name="ClientClosedError";this.message=r||"The client is closed";this.code="UND_ERR_CLOSED"}}class SocketError extends UndiciError{constructor(r,i){super(r);Error.captureStackTrace(this,SocketError);this.name="SocketError";this.message=r||"Socket error";this.code="UND_ERR_SOCKET";this.socket=i}}class NotSupportedError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,NotSupportedError);this.name="NotSupportedError";this.message=r||"Not supported error";this.code="UND_ERR_NOT_SUPPORTED"}}class BalancedPoolMissingUpstreamError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,NotSupportedError);this.name="MissingUpstreamError";this.message=r||"No upstream has been added to the BalancedPool";this.code="UND_ERR_BPL_MISSING_UPSTREAM"}}class HTTPParserError extends Error{constructor(r,i,s){super(r);Error.captureStackTrace(this,HTTPParserError);this.name="HTTPParserError";this.code=i?`HPE_${i}`:undefined;this.data=s?s.toString():undefined}}class ResponseExceededMaxSizeError extends UndiciError{constructor(r){super(r);Error.captureStackTrace(this,ResponseExceededMaxSizeError);this.name="ResponseExceededMaxSizeError";this.message=r||"Response content exceeded max size";this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}}class RequestRetryError extends UndiciError{constructor(r,i,{headers:s,data:a}){super(r);Error.captureStackTrace(this,RequestRetryError);this.name="RequestRetryError";this.message=r||"Request retry error";this.code="UND_ERR_REQ_RETRY";this.statusCode=i;this.data=a;this.headers=s}}r.exports={HTTPParserError:HTTPParserError,UndiciError:UndiciError,HeadersTimeoutError:HeadersTimeoutError,HeadersOverflowError:HeadersOverflowError,BodyTimeoutError:BodyTimeoutError,RequestContentLengthMismatchError:RequestContentLengthMismatchError,ConnectTimeoutError:ConnectTimeoutError,ResponseStatusCodeError:ResponseStatusCodeError,InvalidArgumentError:InvalidArgumentError,InvalidReturnValueError:InvalidReturnValueError,RequestAbortedError:RequestAbortedError,ClientDestroyedError:ClientDestroyedError,ClientClosedError:ClientClosedError,InformationalError:InformationalError,SocketError:SocketError,NotSupportedError:NotSupportedError,ResponseContentLengthMismatchError:ResponseContentLengthMismatchError,BalancedPoolMissingUpstreamError:BalancedPoolMissingUpstreamError,ResponseExceededMaxSizeError:ResponseExceededMaxSizeError,RequestRetryError:RequestRetryError}},50548:(r,i,s)=>{"use strict";const{InvalidArgumentError:a,NotSupportedError:l}=s(76291);const c=s(39491);const{kHTTP2BuildRequest:d,kHTTP2CopyHeaders:p,kHTTP1BuildRequest:u}=s(31915);const A=s(94766);const h=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;const g=/[^\t\x20-\x7e\x80-\xff]/;const y=/[^\u0021-\u00ff]/;const b=Symbol("handler");const w={};let C;try{const r=s(67643);w.create=r.channel("undici:request:create");w.bodySent=r.channel("undici:request:bodySent");w.headers=r.channel("undici:request:headers");w.trailers=r.channel("undici:request:trailers");w.error=r.channel("undici:request:error")}catch{w.create={hasSubscribers:false};w.bodySent={hasSubscribers:false};w.headers={hasSubscribers:false};w.trailers={hasSubscribers:false};w.error={hasSubscribers:false}}class Request{constructor(r,{path:i,method:l,body:c,headers:d,query:p,idempotent:u,blocking:g,upgrade:v,headersTimeout:I,bodyTimeout:B,reset:S,throwOnError:x,expectContinue:R},Q){if(typeof i!=="string"){throw new a("path must be a string")}else if(i[0]!=="/"&&!(i.startsWith("http://")||i.startsWith("https://"))&&l!=="CONNECT"){throw new a("path must be an absolute URL or start with a slash")}else if(y.exec(i)!==null){throw new a("invalid request path")}if(typeof l!=="string"){throw new a("method must be a string")}else if(h.exec(l)===null){throw new a("invalid request method")}if(v&&typeof v!=="string"){throw new a("upgrade must be a string")}if(I!=null&&(!Number.isFinite(I)||I<0)){throw new a("invalid headersTimeout")}if(B!=null&&(!Number.isFinite(B)||B<0)){throw new a("invalid bodyTimeout")}if(S!=null&&typeof S!=="boolean"){throw new a("invalid reset")}if(R!=null&&typeof R!=="boolean"){throw new a("invalid expectContinue")}this.headersTimeout=I;this.bodyTimeout=B;this.throwOnError=x===true;this.method=l;this.abort=null;if(c==null){this.body=null}else if(A.isStream(c)){this.body=c;const r=this.body._readableState;if(!r||!r.autoDestroy){this.endHandler=function autoDestroy(){A.destroy(this)};this.body.on("end",this.endHandler)}this.errorHandler=r=>{if(this.abort){this.abort(r)}else{this.error=r}};this.body.on("error",this.errorHandler)}else if(A.isBuffer(c)){this.body=c.byteLength?c:null}else if(ArrayBuffer.isView(c)){this.body=c.buffer.byteLength?Buffer.from(c.buffer,c.byteOffset,c.byteLength):null}else if(c instanceof ArrayBuffer){this.body=c.byteLength?Buffer.from(c):null}else if(typeof c==="string"){this.body=c.length?Buffer.from(c):null}else if(A.isFormDataLike(c)||A.isIterable(c)||A.isBlobLike(c)){this.body=c}else{throw new a("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable")}this.completed=false;this.aborted=false;this.upgrade=v||null;this.path=p?A.buildURL(i,p):i;this.origin=r;this.idempotent=u==null?l==="HEAD"||l==="GET":u;this.blocking=g==null?false:g;this.reset=S==null?null:S;this.host=null;this.contentLength=null;this.contentType=null;this.headers="";this.expectContinue=R!=null?R:false;if(Array.isArray(d)){if(d.length%2!==0){throw new a("headers array must be even")}for(let r=0;r{r.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kHeadersList:Symbol("headers list"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kHTTP2BuildRequest:Symbol("http2 build request"),kHTTP1BuildRequest:Symbol("http1 build request"),kHTTP2CopyHeaders:Symbol("http2 copy headers"),kHTTPConnVersion:Symbol("http connection version"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable")}},94766:(r,i,s)=>{"use strict";const a=s(39491);const{kDestroyed:l,kBodyUsed:c}=s(31915);const{IncomingMessage:d}=s(13685);const p=s(12781);const u=s(41808);const{InvalidArgumentError:A}=s(76291);const{Blob:h}=s(14300);const g=s(73837);const{stringify:y}=s(63477);const[b,w]=process.versions.node.split(".").map((r=>Number(r)));function nop(){}function isStream(r){return r&&typeof r==="object"&&typeof r.pipe==="function"&&typeof r.on==="function"}function isBlobLike(r){return h&&r instanceof h||r&&typeof r==="object"&&(typeof r.stream==="function"||typeof r.arrayBuffer==="function")&&/^(Blob|File)$/.test(r[Symbol.toStringTag])}function buildURL(r,i){if(r.includes("?")||r.includes("#")){throw new Error('Query params cannot be passed when url already contains "?" or "#".')}const s=y(i);if(s){r+="?"+s}return r}function parseURL(r){if(typeof r==="string"){r=new URL(r);if(!/^https?:/.test(r.origin||r.protocol)){throw new A("Invalid URL protocol: the URL must start with `http:` or `https:`.")}return r}if(!r||typeof r!=="object"){throw new A("Invalid URL: The URL argument must be a non-null object.")}if(!/^https?:/.test(r.origin||r.protocol)){throw new A("Invalid URL protocol: the URL must start with `http:` or `https:`.")}if(!(r instanceof URL)){if(r.port!=null&&r.port!==""&&!Number.isFinite(parseInt(r.port))){throw new A("Invalid URL: port must be a valid integer or a string representation of an integer.")}if(r.path!=null&&typeof r.path!=="string"){throw new A("Invalid URL path: the path must be a string or null/undefined.")}if(r.pathname!=null&&typeof r.pathname!=="string"){throw new A("Invalid URL pathname: the pathname must be a string or null/undefined.")}if(r.hostname!=null&&typeof r.hostname!=="string"){throw new A("Invalid URL hostname: the hostname must be a string or null/undefined.")}if(r.origin!=null&&typeof r.origin!=="string"){throw new A("Invalid URL origin: the origin must be a string or null/undefined.")}const i=r.port!=null?r.port:r.protocol==="https:"?443:80;let s=r.origin!=null?r.origin:`${r.protocol}//${r.hostname}:${i}`;let a=r.path!=null?r.path:`${r.pathname||""}${r.search||""}`;if(s.endsWith("/")){s=s.substring(0,s.length-1)}if(a&&!a.startsWith("/")){a=`/${a}`}r=new URL(s+a)}return r}function parseOrigin(r){r=parseURL(r);if(r.pathname!=="/"||r.search||r.hash){throw new A("invalid url")}return r}function getHostname(r){if(r[0]==="["){const i=r.indexOf("]");a(i!==-1);return r.substring(1,i)}const i=r.indexOf(":");if(i===-1)return r;return r.substring(0,i)}function getServerName(r){if(!r){return null}a.strictEqual(typeof r,"string");const i=getHostname(r);if(u.isIP(i)){return""}return i}function deepClone(r){return JSON.parse(JSON.stringify(r))}function isAsyncIterable(r){return!!(r!=null&&typeof r[Symbol.asyncIterator]==="function")}function isIterable(r){return!!(r!=null&&(typeof r[Symbol.iterator]==="function"||typeof r[Symbol.asyncIterator]==="function"))}function bodyLength(r){if(r==null){return 0}else if(isStream(r)){const i=r._readableState;return i&&i.objectMode===false&&i.ended===true&&Number.isFinite(i.length)?i.length:null}else if(isBlobLike(r)){return r.size!=null?r.size:null}else if(isBuffer(r)){return r.byteLength}return null}function isDestroyed(r){return!r||!!(r.destroyed||r[l])}function isReadableAborted(r){const i=r&&r._readableState;return isDestroyed(r)&&i&&!i.endEmitted}function destroy(r,i){if(r==null||!isStream(r)||isDestroyed(r)){return}if(typeof r.destroy==="function"){if(Object.getPrototypeOf(r).constructor===d){r.socket=null}r.destroy(i)}else if(i){process.nextTick(((r,i)=>{r.emit("error",i)}),r,i)}if(r.destroyed!==true){r[l]=true}}const C=/timeout=(\d+)/;function parseKeepAliveTimeout(r){const i=r.toString().match(C);return i?parseInt(i[1],10)*1e3:null}function parseHeaders(r,i={}){if(!Array.isArray(r))return r;for(let s=0;sr.toString("utf8")))}else{i[a]=r[s+1].toString("utf8")}}else{if(!Array.isArray(l)){l=[l];i[a]=l}l.push(r[s+1].toString("utf8"))}}if("content-length"in i&&"content-disposition"in i){i["content-disposition"]=Buffer.from(i["content-disposition"]).toString("latin1")}return i}function parseRawHeaders(r){const i=[];let s=false;let a=-1;for(let l=0;l{r.close()}))}else{const i=Buffer.isBuffer(a)?a:Buffer.from(a);r.enqueue(new Uint8Array(i))}return r.desiredSize>0},async cancel(r){await i.return()}},0)}function isFormDataLike(r){return r&&typeof r==="object"&&typeof r.append==="function"&&typeof r.delete==="function"&&typeof r.get==="function"&&typeof r.getAll==="function"&&typeof r.has==="function"&&typeof r.set==="function"&&r[Symbol.toStringTag]==="FormData"}function throwIfAborted(r){if(!r){return}if(typeof r.throwIfAborted==="function"){r.throwIfAborted()}else{if(r.aborted){const r=new Error("The operation was aborted");r.name="AbortError";throw r}}}function addAbortListener(r,i){if("addEventListener"in r){r.addEventListener("abort",i,{once:true});return()=>r.removeEventListener("abort",i)}r.addListener("abort",i);return()=>r.removeListener("abort",i)}const I=!!String.prototype.toWellFormed;function toUSVString(r){if(I){return`${r}`.toWellFormed()}else if(g.toUSVString){return g.toUSVString(r)}return`${r}`}function parseRangeHeader(r){if(r==null||r==="")return{start:0,end:null,size:null};const i=r?r.match(/^bytes (\d+)-(\d+)\/(\d+)?$/):null;return i?{start:parseInt(i[1]),end:i[2]?parseInt(i[2]):null,size:i[3]?parseInt(i[3]):null}:null}const B=Object.create(null);B.enumerable=true;r.exports={kEnumerableProperty:B,nop:nop,isDisturbed:isDisturbed,isErrored:isErrored,isReadable:isReadable,toUSVString:toUSVString,isReadableAborted:isReadableAborted,isBlobLike:isBlobLike,parseOrigin:parseOrigin,parseURL:parseURL,getServerName:getServerName,isStream:isStream,isIterable:isIterable,isAsyncIterable:isAsyncIterable,isDestroyed:isDestroyed,parseRawHeaders:parseRawHeaders,parseHeaders:parseHeaders,parseKeepAliveTimeout:parseKeepAliveTimeout,destroy:destroy,bodyLength:bodyLength,deepClone:deepClone,ReadableStreamFrom:ReadableStreamFrom,isBuffer:isBuffer,validateHandler:validateHandler,getSocketInfo:getSocketInfo,isFormDataLike:isFormDataLike,buildURL:buildURL,throwIfAborted:throwIfAborted,addAbortListener:addAbortListener,parseRangeHeader:parseRangeHeader,nodeMajor:b,nodeMinor:w,nodeHasAutoSelectFamily:b>18||b===18&&w>=13,safeHTTPMethods:["GET","HEAD","OPTIONS","TRACE"]}},36228:(r,i,s)=>{"use strict";const a=s(78824);const{ClientDestroyedError:l,ClientClosedError:c,InvalidArgumentError:d}=s(76291);const{kDestroy:p,kClose:u,kDispatch:A,kInterceptors:h}=s(31915);const g=Symbol("destroyed");const y=Symbol("closed");const b=Symbol("onDestroyed");const w=Symbol("onClosed");const C=Symbol("Intercepted Dispatch");class DispatcherBase extends a{constructor(){super();this[g]=false;this[b]=null;this[y]=false;this[w]=[]}get destroyed(){return this[g]}get closed(){return this[y]}get interceptors(){return this[h]}set interceptors(r){if(r){for(let i=r.length-1;i>=0;i--){const r=this[h][i];if(typeof r!=="function"){throw new d("interceptor must be an function")}}}this[h]=r}close(r){if(r===undefined){return new Promise(((r,i)=>{this.close(((s,a)=>s?i(s):r(a)))}))}if(typeof r!=="function"){throw new d("invalid callback")}if(this[g]){queueMicrotask((()=>r(new l,null)));return}if(this[y]){if(this[w]){this[w].push(r)}else{queueMicrotask((()=>r(null,null)))}return}this[y]=true;this[w].push(r);const onClosed=()=>{const r=this[w];this[w]=null;for(let i=0;ithis.destroy())).then((()=>{queueMicrotask(onClosed)}))}destroy(r,i){if(typeof r==="function"){i=r;r=null}if(i===undefined){return new Promise(((i,s)=>{this.destroy(r,((r,a)=>r?s(r):i(a)))}))}if(typeof i!=="function"){throw new d("invalid callback")}if(this[g]){if(this[b]){this[b].push(i)}else{queueMicrotask((()=>i(null,null)))}return}if(!r){r=new l}this[g]=true;this[b]=this[b]||[];this[b].push(i);const onDestroyed=()=>{const r=this[b];this[b]=null;for(let i=0;i{queueMicrotask(onDestroyed)}))}[C](r,i){if(!this[h]||this[h].length===0){this[C]=this[A];return this[A](r,i)}let s=this[A].bind(this);for(let r=this[h].length-1;r>=0;r--){s=this[h][r](s)}this[C]=s;return s(r,i)}dispatch(r,i){if(!i||typeof i!=="object"){throw new d("handler must be an object")}try{if(!r||typeof r!=="object"){throw new d("opts must be an object.")}if(this[g]||this[b]){throw new l}if(this[y]){throw new c}return this[C](r,i)}catch(r){if(typeof i.onError!=="function"){throw new d("invalid onError method")}i.onError(r);return false}}}r.exports=DispatcherBase},78824:(r,i,s)=>{"use strict";const a=s(82361);class Dispatcher extends a{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}}r.exports=Dispatcher},21254:(r,i,s)=>{"use strict";const a=s(61145);const l=s(94766);const{ReadableStreamFrom:c,isBlobLike:d,isReadableStreamLike:p,readableStreamClose:u,createDeferredPromise:A,fullyReadBody:h}=s(40336);const{FormData:g}=s(72489);const{kState:y}=s(9411);const{webidl:b}=s(87591);const{DOMException:w,structuredClone:C}=s(67296);const{Blob:v,File:I}=s(14300);const{kBodyUsed:B}=s(31915);const S=s(39491);const{isErrored:x}=s(94766);const{isUint8Array:R,isArrayBuffer:Q}=s(29830);const{File:_}=s(81636);const{parseMIMEType:N,serializeAMimeType:T}=s(80097);let k=globalThis.ReadableStream;const D=I??_;const P=new TextEncoder;const O=new TextDecoder;function extractBody(r,i=false){if(!k){k=s(35356).ReadableStream}let a=null;if(r instanceof k){a=r}else if(d(r)){a=r.stream()}else{a=new k({async pull(r){r.enqueue(typeof h==="string"?P.encode(h):h);queueMicrotask((()=>u(r)))},start(){},type:undefined})}S(p(a));let A=null;let h=null;let g=null;let y=null;if(typeof r==="string"){h=r;y="text/plain;charset=UTF-8"}else if(r instanceof URLSearchParams){h=r.toString();y="application/x-www-form-urlencoded;charset=UTF-8"}else if(Q(r)){h=new Uint8Array(r.slice())}else if(ArrayBuffer.isView(r)){h=new Uint8Array(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength))}else if(l.isFormDataLike(r)){const i=`----formdata-undici-0${`${Math.floor(Math.random()*1e11)}`.padStart(11,"0")}`;const s=`--${i}\r\nContent-Disposition: form-data` +/*! formdata-polyfill. MIT License. Jimmy Wärting */;const escape=r=>r.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=r=>r.replace(/\r?\n|\r/g,"\r\n");const a=[];const l=new Uint8Array([13,10]);g=0;let c=false;for(const[i,d]of r){if(typeof d==="string"){const r=P.encode(s+`; name="${escape(normalizeLinefeeds(i))}"`+`\r\n\r\n${normalizeLinefeeds(d)}\r\n`);a.push(r);g+=r.byteLength}else{const r=P.encode(`${s}; name="${escape(normalizeLinefeeds(i))}"`+(d.name?`; filename="${escape(d.name)}"`:"")+"\r\n"+`Content-Type: ${d.type||"application/octet-stream"}\r\n\r\n`);a.push(r,d,l);if(typeof d.size==="number"){g+=r.byteLength+d.size+l.byteLength}else{c=true}}}const d=P.encode(`--${i}--`);a.push(d);g+=d.byteLength;if(c){g=null}h=r;A=async function*(){for(const r of a){if(r.stream){yield*r.stream()}else{yield r}}};y="multipart/form-data; boundary="+i}else if(d(r)){h=r;g=r.size;if(r.type){y=r.type}}else if(typeof r[Symbol.asyncIterator]==="function"){if(i){throw new TypeError("keepalive")}if(l.isDisturbed(r)||r.locked){throw new TypeError("Response body object should not be disturbed or locked")}a=r instanceof k?r:c(r)}if(typeof h==="string"||l.isBuffer(h)){g=Buffer.byteLength(h)}if(A!=null){let i;a=new k({async start(){i=A(r)[Symbol.asyncIterator]()},async pull(r){const{value:s,done:l}=await i.next();if(l){queueMicrotask((()=>{r.close()}))}else{if(!x(a)){r.enqueue(new Uint8Array(s))}}return r.desiredSize>0},async cancel(r){await i.return()},type:undefined})}const b={stream:a,source:h,length:g};return[b,y]}function safelyExtractBody(r,i=false){if(!k){k=s(35356).ReadableStream}if(r instanceof k){S(!l.isDisturbed(r),"The body has already been consumed.");S(!r.locked,"The stream is locked.")}return extractBody(r,i)}function cloneBody(r){const[i,s]=r.stream.tee();const a=C(s,{transfer:[s]});const[,l]=a.tee();r.stream=i;return{stream:l,length:r.length,source:r.source}}async function*consumeBody(r){if(r){if(R(r)){yield r}else{const i=r.stream;if(l.isDisturbed(i)){throw new TypeError("The body has already been consumed.")}if(i.locked){throw new TypeError("The stream is locked.")}i[B]=true;yield*i}}}function throwIfAborted(r){if(r.aborted){throw new w("The operation was aborted.","AbortError")}}function bodyMixinMethods(r){const i={blob(){return specConsumeBody(this,(r=>{let i=bodyMimeType(this);if(i==="failure"){i=""}else if(i){i=T(i)}return new v([r],{type:i})}),r)},arrayBuffer(){return specConsumeBody(this,(r=>new Uint8Array(r).buffer),r)},text(){return specConsumeBody(this,utf8DecodeBytes,r)},json(){return specConsumeBody(this,parseJSONFromBytes,r)},async formData(){b.brandCheck(this,r);throwIfAborted(this[y]);const i=this.headers.get("Content-Type");if(/multipart\/form-data/.test(i)){const r={};for(const[i,s]of this.headers)r[i.toLowerCase()]=s;const i=new g;let s;try{s=new a({headers:r,preservePath:true})}catch(r){throw new w(`${r}`,"AbortError")}s.on("field",((r,s)=>{i.append(r,s)}));s.on("file",((r,s,a,l,c)=>{const d=[];if(l==="base64"||l.toLowerCase()==="base64"){let l="";s.on("data",(r=>{l+=r.toString().replace(/[\r\n]/gm,"");const i=l.length-l.length%4;d.push(Buffer.from(l.slice(0,i),"base64"));l=l.slice(i)}));s.on("end",(()=>{d.push(Buffer.from(l,"base64"));i.append(r,new D(d,a,{type:c}))}))}else{s.on("data",(r=>{d.push(r)}));s.on("end",(()=>{i.append(r,new D(d,a,{type:c}))}))}}));const l=new Promise(((r,i)=>{s.on("finish",r);s.on("error",(r=>i(new TypeError(r))))}));if(this.body!==null)for await(const r of consumeBody(this[y].body))s.write(r);s.end();await l;return i}else if(/application\/x-www-form-urlencoded/.test(i)){let r;try{let i="";const s=new TextDecoder("utf-8",{ignoreBOM:true});for await(const r of consumeBody(this[y].body)){if(!R(r)){throw new TypeError("Expected Uint8Array chunk")}i+=s.decode(r,{stream:true})}i+=s.decode();r=new URLSearchParams(i)}catch(r){throw Object.assign(new TypeError,{cause:r})}const i=new g;for(const[s,a]of r){i.append(s,a)}return i}else{await Promise.resolve();throwIfAborted(this[y]);throw b.errors.exception({header:`${r.name}.formData`,message:"Could not parse content as FormData."})}}};return i}function mixinBody(r){Object.assign(r.prototype,bodyMixinMethods(r))}async function specConsumeBody(r,i,s){b.brandCheck(r,s);throwIfAborted(r[y]);if(bodyUnusable(r[y].body)){throw new TypeError("Body is unusable")}const a=A();const errorSteps=r=>a.reject(r);const successSteps=r=>{try{a.resolve(i(r))}catch(r){errorSteps(r)}};if(r[y].body==null){successSteps(new Uint8Array);return a.promise}await h(r[y].body,successSteps,errorSteps);return a.promise}function bodyUnusable(r){return r!=null&&(r.stream.locked||l.isDisturbed(r.stream))}function utf8DecodeBytes(r){if(r.length===0){return""}if(r[0]===239&&r[1]===187&&r[2]===191){r=r.subarray(3)}const i=O.decode(r);return i}function parseJSONFromBytes(r){return JSON.parse(utf8DecodeBytes(r))}function bodyMimeType(r){const{headersList:i}=r[y];const s=i.get("content-type");if(s===null){return"failure"}return N(s)}r.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody}},67296:(r,i,s)=>{"use strict";const{MessageChannel:a,receiveMessageOnPort:l}=s(71267);const c=["GET","HEAD","POST"];const d=new Set(c);const p=[101,204,205,304];const u=[301,302,303,307,308];const A=new Set(u);const h=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","5060","5061","6000","6566","6665","6666","6667","6668","6669","6697","10080"];const g=new Set(h);const y=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const b=new Set(y);const w=["follow","manual","error"];const C=["GET","HEAD","OPTIONS","TRACE"];const v=new Set(C);const I=["navigate","same-origin","no-cors","cors"];const B=["omit","same-origin","include"];const S=["default","no-store","reload","no-cache","force-cache","only-if-cached"];const x=["content-encoding","content-language","content-location","content-type","content-length"];const R=["half"];const Q=["CONNECT","TRACE","TRACK"];const _=new Set(Q);const N=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""];const T=new Set(N);const k=globalThis.DOMException??(()=>{try{atob("~")}catch(r){return Object.getPrototypeOf(r).constructor}})();let D;const P=globalThis.structuredClone??function structuredClone(r,i=undefined){if(arguments.length===0){throw new TypeError("missing argument")}if(!D){D=new a}D.port1.unref();D.port2.unref();D.port1.postMessage(r,i?.transfer);return l(D.port2).message};r.exports={DOMException:k,structuredClone:P,subresource:N,forbiddenMethods:Q,requestBodyHeader:x,referrerPolicy:y,requestRedirect:w,requestMode:I,requestCredentials:B,requestCache:S,redirectStatus:u,corsSafeListedMethods:c,nullBodyStatus:p,safeMethods:C,badPorts:h,requestDuplex:R,subresourceSet:T,badPortsSet:g,redirectStatusSet:A,corsSafeListedMethodsSet:d,safeMethodsSet:v,forbiddenMethodsSet:_,referrerPolicySet:b}},80097:(r,i,s)=>{const a=s(39491);const{atob:l}=s(14300);const{isomorphicDecode:c}=s(40336);const d=new TextEncoder;const p=/^[!#$%&'*+-.^_|~A-Za-z0-9]+$/;const u=/(\u000A|\u000D|\u0009|\u0020)/;const A=/[\u0009|\u0020-\u007E|\u0080-\u00FF]/;function dataURLProcessor(r){a(r.protocol==="data:");let i=URLSerializer(r,true);i=i.slice(5);const s={position:0};let l=collectASequenceOfCodePointsFast(",",i,s);const d=l.length;l=removeASCIIWhitespace(l,true,true);if(s.position>=i.length){return"failure"}s.position++;const p=i.slice(d+1);let u=stringPercentDecode(p);if(/;(\u0020){0,}base64$/i.test(l)){const r=c(u);u=forgivingBase64(r);if(u==="failure"){return"failure"}l=l.slice(0,-6);l=l.replace(/(\u0020)+$/,"");l=l.slice(0,-1)}if(l.startsWith(";")){l="text/plain"+l}let A=parseMIMEType(l);if(A==="failure"){A=parseMIMEType("text/plain;charset=US-ASCII")}return{mimeType:A,body:u}}function URLSerializer(r,i=false){if(!i){return r.href}const s=r.href;const a=r.hash.length;return a===0?s:s.substring(0,s.length-a)}function collectASequenceOfCodePoints(r,i,s){let a="";while(s.positionr.length){return"failure"}i.position++;let a=collectASequenceOfCodePointsFast(";",r,i);a=removeHTTPWhitespace(a,false,true);if(a.length===0||!p.test(a)){return"failure"}const l=s.toLowerCase();const c=a.toLowerCase();const d={type:l,subtype:c,parameters:new Map,essence:`${l}/${c}`};while(i.positionu.test(r)),r,i);let s=collectASequenceOfCodePoints((r=>r!==";"&&r!=="="),r,i);s=s.toLowerCase();if(i.positionr.length){break}let a=null;if(r[i.position]==='"'){a=collectAnHTTPQuotedString(r,i,true);collectASequenceOfCodePointsFast(";",r,i)}else{a=collectASequenceOfCodePointsFast(";",r,i);a=removeHTTPWhitespace(a,false,true);if(a.length===0){continue}}if(s.length!==0&&p.test(s)&&(a.length===0||A.test(a))&&!d.parameters.has(s)){d.parameters.set(s,a)}}return d}function forgivingBase64(r){r=r.replace(/[\u0009\u000A\u000C\u000D\u0020]/g,"");if(r.length%4===0){r=r.replace(/=?=$/,"")}if(r.length%4===1){return"failure"}if(/[^+/0-9A-Za-z]/.test(r)){return"failure"}const i=l(r);const s=new Uint8Array(i.length);for(let r=0;rr!=='"'&&r!=="\\"),r,i);if(i.position>=r.length){break}const s=r[i.position];i.position++;if(s==="\\"){if(i.position>=r.length){c+="\\";break}c+=r[i.position];i.position++}else{a(s==='"');break}}if(s){return c}return r.slice(l,i.position)}function serializeAMimeType(r){a(r!=="failure");const{parameters:i,essence:s}=r;let l=s;for(let[r,s]of i.entries()){l+=";";l+=r;l+="=";if(!p.test(s)){s=s.replace(/(\\|")/g,"\\$1");s='"'+s;s+='"'}l+=s}return l}function isHTTPWhiteSpace(r){return r==="\r"||r==="\n"||r==="\t"||r===" "}function removeHTTPWhitespace(r,i=true,s=true){let a=0;let l=r.length-1;if(i){for(;a0&&isHTTPWhiteSpace(r[l]);l--);}return r.slice(a,l+1)}function isASCIIWhitespace(r){return r==="\r"||r==="\n"||r==="\t"||r==="\f"||r===" "}function removeASCIIWhitespace(r,i=true,s=true){let a=0;let l=r.length-1;if(i){for(;a0&&isASCIIWhitespace(r[l]);l--);}return r.slice(a,l+1)}r.exports={dataURLProcessor:dataURLProcessor,URLSerializer:URLSerializer,collectASequenceOfCodePoints:collectASequenceOfCodePoints,collectASequenceOfCodePointsFast:collectASequenceOfCodePointsFast,stringPercentDecode:stringPercentDecode,parseMIMEType:parseMIMEType,collectAnHTTPQuotedString:collectAnHTTPQuotedString,serializeAMimeType:serializeAMimeType}},81636:(r,i,s)=>{"use strict";const{Blob:a,File:l}=s(14300);const{types:c}=s(73837);const{kState:d}=s(9411);const{isBlobLike:p}=s(40336);const{webidl:u}=s(87591);const{parseMIMEType:A,serializeAMimeType:h}=s(80097);const{kEnumerableProperty:g}=s(94766);const y=new TextEncoder;class File extends a{constructor(r,i,s={}){u.argumentLengthCheck(arguments,2,{header:"File constructor"});r=u.converters["sequence"](r);i=u.converters.USVString(i);s=u.converters.FilePropertyBag(s);const a=i;let l=s.type;let c;e:{if(l){l=A(l);if(l==="failure"){l="";break e}l=h(l).toLowerCase()}c=s.lastModified}super(processBlobParts(r,s),{type:l});this[d]={name:a,lastModified:c,type:l}}get name(){u.brandCheck(this,File);return this[d].name}get lastModified(){u.brandCheck(this,File);return this[d].lastModified}get type(){u.brandCheck(this,File);return this[d].type}}class FileLike{constructor(r,i,s={}){const a=i;const l=s.type;const c=s.lastModified??Date.now();this[d]={blobLike:r,name:a,type:l,lastModified:c}}stream(...r){u.brandCheck(this,FileLike);return this[d].blobLike.stream(...r)}arrayBuffer(...r){u.brandCheck(this,FileLike);return this[d].blobLike.arrayBuffer(...r)}slice(...r){u.brandCheck(this,FileLike);return this[d].blobLike.slice(...r)}text(...r){u.brandCheck(this,FileLike);return this[d].blobLike.text(...r)}get size(){u.brandCheck(this,FileLike);return this[d].blobLike.size}get type(){u.brandCheck(this,FileLike);return this[d].blobLike.type}get name(){u.brandCheck(this,FileLike);return this[d].name}get lastModified(){u.brandCheck(this,FileLike);return this[d].lastModified}get[Symbol.toStringTag](){return"File"}}Object.defineProperties(File.prototype,{[Symbol.toStringTag]:{value:"File",configurable:true},name:g,lastModified:g});u.converters.Blob=u.interfaceConverter(a);u.converters.BlobPart=function(r,i){if(u.util.Type(r)==="Object"){if(p(r)){return u.converters.Blob(r,{strict:false})}if(ArrayBuffer.isView(r)||c.isAnyArrayBuffer(r)){return u.converters.BufferSource(r,i)}}return u.converters.USVString(r,i)};u.converters["sequence"]=u.sequenceConverter(u.converters.BlobPart);u.converters.FilePropertyBag=u.dictionaryConverter([{key:"lastModified",converter:u.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:u.converters.DOMString,defaultValue:""},{key:"endings",converter:r=>{r=u.converters.DOMString(r);r=r.toLowerCase();if(r!=="native"){r="transparent"}return r},defaultValue:"transparent"}]);function processBlobParts(r,i){const s=[];for(const a of r){if(typeof a==="string"){let r=a;if(i.endings==="native"){r=convertLineEndingsNative(r)}s.push(y.encode(r))}else if(c.isAnyArrayBuffer(a)||c.isTypedArray(a)){if(!a.buffer){s.push(new Uint8Array(a))}else{s.push(new Uint8Array(a.buffer,a.byteOffset,a.byteLength))}}else if(p(a)){s.push(a)}}return s}function convertLineEndingsNative(r){let i="\n";if(process.platform==="win32"){i="\r\n"}return r.replace(/\r?\n/g,i)}function isFileLike(r){return l&&r instanceof l||r instanceof File||r&&(typeof r.stream==="function"||typeof r.arrayBuffer==="function")&&r[Symbol.toStringTag]==="File"}r.exports={File:File,FileLike:FileLike,isFileLike:isFileLike}},72489:(r,i,s)=>{"use strict";const{isBlobLike:a,toUSVString:l,makeIterator:c}=s(40336);const{kState:d}=s(9411);const{File:p,FileLike:u,isFileLike:A}=s(81636);const{webidl:h}=s(87591);const{Blob:g,File:y}=s(14300);const b=y??p;class FormData{constructor(r){if(r!==undefined){throw h.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}this[d]=[]}append(r,i,s=undefined){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,2,{header:"FormData.append"});if(arguments.length===3&&!a(i)){throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'")}r=h.converters.USVString(r);i=a(i)?h.converters.Blob(i,{strict:false}):h.converters.USVString(i);s=arguments.length===3?h.converters.USVString(s):undefined;const l=makeEntry(r,i,s);this[d].push(l)}delete(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.delete"});r=h.converters.USVString(r);this[d]=this[d].filter((i=>i.name!==r))}get(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.get"});r=h.converters.USVString(r);const i=this[d].findIndex((i=>i.name===r));if(i===-1){return null}return this[d][i].value}getAll(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.getAll"});r=h.converters.USVString(r);return this[d].filter((i=>i.name===r)).map((r=>r.value))}has(r){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.has"});r=h.converters.USVString(r);return this[d].findIndex((i=>i.name===r))!==-1}set(r,i,s=undefined){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,2,{header:"FormData.set"});if(arguments.length===3&&!a(i)){throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'")}r=h.converters.USVString(r);i=a(i)?h.converters.Blob(i,{strict:false}):h.converters.USVString(i);s=arguments.length===3?l(s):undefined;const c=makeEntry(r,i,s);const p=this[d].findIndex((i=>i.name===r));if(p!==-1){this[d]=[...this[d].slice(0,p),c,...this[d].slice(p+1).filter((i=>i.name!==r))]}else{this[d].push(c)}}entries(){h.brandCheck(this,FormData);return c((()=>this[d].map((r=>[r.name,r.value]))),"FormData","key+value")}keys(){h.brandCheck(this,FormData);return c((()=>this[d].map((r=>[r.name,r.value]))),"FormData","key")}values(){h.brandCheck(this,FormData);return c((()=>this[d].map((r=>[r.name,r.value]))),"FormData","value")}forEach(r,i=globalThis){h.brandCheck(this,FormData);h.argumentLengthCheck(arguments,1,{header:"FormData.forEach"});if(typeof r!=="function"){throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.")}for(const[s,a]of this){r.apply(i,[a,s,this])}}}FormData.prototype[Symbol.iterator]=FormData.prototype.entries;Object.defineProperties(FormData.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:true}});function makeEntry(r,i,s){r=Buffer.from(r).toString("utf8");if(typeof i==="string"){i=Buffer.from(i).toString("utf8")}else{if(!A(i)){i=i instanceof g?new b([i],"blob",{type:i.type}):new u(i,"blob",{type:i.type})}if(s!==undefined){const r={type:i.type,lastModified:i.lastModified};i=y&&i instanceof y||i instanceof p?new b([i],s,r):new u(i,s,r)}}return{name:r,value:i}}r.exports={FormData:FormData}},46670:r=>{"use strict";const i=Symbol.for("undici.globalOrigin.1");function getGlobalOrigin(){return globalThis[i]}function setGlobalOrigin(r){if(r===undefined){Object.defineProperty(globalThis,i,{value:undefined,writable:true,enumerable:false,configurable:false});return}const s=new URL(r);if(s.protocol!=="http:"&&s.protocol!=="https:"){throw new TypeError(`Only http & https urls are allowed, received ${s.protocol}`)}Object.defineProperty(globalThis,i,{value:s,writable:true,enumerable:false,configurable:false})}r.exports={getGlobalOrigin:getGlobalOrigin,setGlobalOrigin:setGlobalOrigin}},8247:(r,i,s)=>{"use strict";const{kHeadersList:a,kConstruct:l}=s(31915);const{kGuard:c}=s(9411);const{kEnumerableProperty:d}=s(94766);const{makeIterator:p,isValidHeaderName:u,isValidHeaderValue:A}=s(40336);const{webidl:h}=s(87591);const g=s(39491);const y=Symbol("headers map");const b=Symbol("headers map sorted");function isHTTPWhiteSpaceCharCode(r){return r===10||r===13||r===9||r===32}function headerValueNormalize(r){let i=0;let s=r.length;while(s>i&&isHTTPWhiteSpaceCharCode(r.charCodeAt(s-1)))--s;while(s>i&&isHTTPWhiteSpaceCharCode(r.charCodeAt(i)))++i;return i===0&&s===r.length?r:r.substring(i,s)}function fill(r,i){if(Array.isArray(i)){for(let s=0;s>","record"]})}}function appendHeader(r,i,s){s=headerValueNormalize(s);if(!u(i)){throw h.errors.invalidArgument({prefix:"Headers.append",value:i,type:"header name"})}else if(!A(s)){throw h.errors.invalidArgument({prefix:"Headers.append",value:s,type:"header value"})}if(r[c]==="immutable"){throw new TypeError("immutable")}else if(r[c]==="request-no-cors"){}return r[a].append(i,s)}class HeadersList{cookies=null;constructor(r){if(r instanceof HeadersList){this[y]=new Map(r[y]);this[b]=r[b];this.cookies=r.cookies===null?null:[...r.cookies]}else{this[y]=new Map(r);this[b]=null}}contains(r){r=r.toLowerCase();return this[y].has(r)}clear(){this[y].clear();this[b]=null;this.cookies=null}append(r,i){this[b]=null;const s=r.toLowerCase();const a=this[y].get(s);if(a){const r=s==="cookie"?"; ":", ";this[y].set(s,{name:a.name,value:`${a.value}${r}${i}`})}else{this[y].set(s,{name:r,value:i})}if(s==="set-cookie"){this.cookies??=[];this.cookies.push(i)}}set(r,i){this[b]=null;const s=r.toLowerCase();if(s==="set-cookie"){this.cookies=[i]}this[y].set(s,{name:r,value:i})}delete(r){this[b]=null;r=r.toLowerCase();if(r==="set-cookie"){this.cookies=null}this[y].delete(r)}get(r){const i=this[y].get(r.toLowerCase());return i===undefined?null:i.value}*[Symbol.iterator](){for(const[r,{value:i}]of this[y]){yield[r,i]}}get entries(){const r={};if(this[y].size){for(const{name:i,value:s}of this[y].values()){r[i]=s}}return r}}class Headers{constructor(r=undefined){if(r===l){return}this[a]=new HeadersList;this[c]="none";if(r!==undefined){r=h.converters.HeadersInit(r);fill(this,r)}}append(r,i){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,2,{header:"Headers.append"});r=h.converters.ByteString(r);i=h.converters.ByteString(i);return appendHeader(this,r,i)}delete(r){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.delete"});r=h.converters.ByteString(r);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.delete",value:r,type:"header name"})}if(this[c]==="immutable"){throw new TypeError("immutable")}else if(this[c]==="request-no-cors"){}if(!this[a].contains(r)){return}this[a].delete(r)}get(r){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.get"});r=h.converters.ByteString(r);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.get",value:r,type:"header name"})}return this[a].get(r)}has(r){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.has"});r=h.converters.ByteString(r);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.has",value:r,type:"header name"})}return this[a].contains(r)}set(r,i){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,2,{header:"Headers.set"});r=h.converters.ByteString(r);i=h.converters.ByteString(i);i=headerValueNormalize(i);if(!u(r)){throw h.errors.invalidArgument({prefix:"Headers.set",value:r,type:"header name"})}else if(!A(i)){throw h.errors.invalidArgument({prefix:"Headers.set",value:i,type:"header value"})}if(this[c]==="immutable"){throw new TypeError("immutable")}else if(this[c]==="request-no-cors"){}this[a].set(r,i)}getSetCookie(){h.brandCheck(this,Headers);const r=this[a].cookies;if(r){return[...r]}return[]}get[b](){if(this[a][b]){return this[a][b]}const r=[];const i=[...this[a]].sort(((r,i)=>r[0]r),"Headers","key")}return p((()=>[...this[b].values()]),"Headers","key")}values(){h.brandCheck(this,Headers);if(this[c]==="immutable"){const r=this[b];return p((()=>r),"Headers","value")}return p((()=>[...this[b].values()]),"Headers","value")}entries(){h.brandCheck(this,Headers);if(this[c]==="immutable"){const r=this[b];return p((()=>r),"Headers","key+value")}return p((()=>[...this[b].values()]),"Headers","key+value")}forEach(r,i=globalThis){h.brandCheck(this,Headers);h.argumentLengthCheck(arguments,1,{header:"Headers.forEach"});if(typeof r!=="function"){throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.")}for(const[s,a]of this){r.apply(i,[a,s,this])}}[Symbol.for("nodejs.util.inspect.custom")](){h.brandCheck(this,Headers);return this[a]}}Headers.prototype[Symbol.iterator]=Headers.prototype.entries;Object.defineProperties(Headers.prototype,{append:d,delete:d,get:d,has:d,set:d,getSetCookie:d,keys:d,values:d,entries:d,forEach:d,[Symbol.iterator]:{enumerable:false},[Symbol.toStringTag]:{value:"Headers",configurable:true}});h.converters.HeadersInit=function(r){if(h.util.Type(r)==="Object"){if(r[Symbol.iterator]){return h.converters["sequence>"](r)}return h.converters["record"](r)}throw h.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};r.exports={fill:fill,Headers:Headers,HeadersList:HeadersList}},79890:(r,i,s)=>{"use strict";const{Response:a,makeNetworkError:l,makeAppropriateNetworkError:c,filterResponse:d,makeResponse:p}=s(55032);const{Headers:u}=s(8247);const{Request:A,makeRequest:h}=s(11287);const g=s(59796);const{bytesMatch:y,makePolicyContainer:b,clonePolicyContainer:w,requestBadPort:C,TAOCheck:v,appendRequestOriginHeader:I,responseLocationURL:B,requestCurrentURL:S,setRequestReferrerPolicyOnRedirect:x,tryUpgradeRequestToAPotentiallyTrustworthyURL:R,createOpaqueTimingInfo:Q,appendFetchMetadata:_,corsCheck:N,crossOriginResourcePolicyCheck:T,determineRequestsReferrer:k,coarsenedSharedCurrentTime:D,createDeferredPromise:P,isBlobLike:O,sameOrigin:L,isCancelled:M,isAborted:U,isErrorLike:j,fullyReadBody:H,readableStreamClose:q,isomorphicEncode:G,urlIsLocal:z,urlIsHttpHttpsScheme:V,urlHasHttpsScheme:W}=s(40336);const{kState:Y,kHeaders:J,kGuard:$,kRealm:X}=s(9411);const K=s(39491);const{safelyExtractBody:Z}=s(21254);const{redirectStatusSet:ee,nullBodyStatus:te,safeMethodsSet:re,requestBodyHeader:ne,subresourceSet:ie,DOMException:se}=s(67296);const{kHeadersList:ae}=s(31915);const oe=s(82361);const{Readable:le,pipeline:ce}=s(12781);const{addAbortListener:de,isErrored:pe,isReadable:ue,nodeMajor:Ae,nodeMinor:fe}=s(94766);const{dataURLProcessor:me,serializeAMimeType:he}=s(80097);const{TransformStream:ge}=s(35356);const{getGlobalDispatcher:ye}=s(18826);const{webidl:be}=s(87591);const{STATUS_CODES:Ee}=s(13685);const we=["GET","HEAD"];let Ce;let ve=globalThis.ReadableStream;class Fetch extends oe{constructor(r){super();this.dispatcher=r;this.connection=null;this.dump=false;this.state="ongoing";this.setMaxListeners(21)}terminate(r){if(this.state!=="ongoing"){return}this.state="terminated";this.connection?.destroy(r);this.emit("terminated",r)}abort(r){if(this.state!=="ongoing"){return}this.state="aborted";if(!r){r=new se("The operation was aborted.","AbortError")}this.serializedAbortReason=r;this.connection?.destroy(r);this.emit("terminated",r)}}function fetch(r,i={}){be.argumentLengthCheck(arguments,1,{header:"globalThis.fetch"});const s=P();let l;try{l=new A(r,i)}catch(r){s.reject(r);return s.promise}const c=l[Y];if(l.signal.aborted){abortFetch(s,c,null,l.signal.reason);return s.promise}const d=c.client.globalObject;if(d?.constructor?.name==="ServiceWorkerGlobalScope"){c.serviceWorkers="none"}let p=null;const u=null;let h=false;let g=null;de(l.signal,(()=>{h=true;K(g!=null);g.abort(l.signal.reason);abortFetch(s,c,p,l.signal.reason)}));const handleFetchDone=r=>finalizeAndReportTiming(r,"fetch");const processResponse=r=>{if(h){return Promise.resolve()}if(r.aborted){abortFetch(s,c,p,g.serializedAbortReason);return Promise.resolve()}if(r.type==="error"){s.reject(Object.assign(new TypeError("fetch failed"),{cause:r.error}));return Promise.resolve()}p=new a;p[Y]=r;p[X]=u;p[J][ae]=r.headersList;p[J][$]="immutable";p[J][X]=u;s.resolve(p)};g=fetching({request:c,processResponseEndOfBody:handleFetchDone,processResponse:processResponse,dispatcher:i.dispatcher??ye()});return s.promise}function finalizeAndReportTiming(r,i="other"){if(r.type==="error"&&r.aborted){return}if(!r.urlList?.length){return}const s=r.urlList[0];let a=r.timingInfo;let l=r.cacheState;if(!V(s)){return}if(a===null){return}if(!r.timingAllowPassed){a=Q({startTime:a.startTime});l=""}a.endTime=D();r.timingInfo=a;markResourceTiming(a,s,i,globalThis,l)}function markResourceTiming(r,i,s,a,l){if(Ae>18||Ae===18&&fe>=2){performance.markResourceTiming(r,i.href,s,a,l)}}function abortFetch(r,i,s,a){if(!a){a=new se("The operation was aborted.","AbortError")}r.reject(a);if(i.body!=null&&ue(i.body?.stream)){i.body.stream.cancel(a).catch((r=>{if(r.code==="ERR_INVALID_STATE"){return}throw r}))}if(s==null){return}const l=s[Y];if(l.body!=null&&ue(l.body?.stream)){l.body.stream.cancel(a).catch((r=>{if(r.code==="ERR_INVALID_STATE"){return}throw r}))}}function fetching({request:r,processRequestBodyChunkLength:i,processRequestEndOfBody:s,processResponse:a,processResponseEndOfBody:l,processResponseConsumeBody:c,useParallelQueue:d=false,dispatcher:p}){let u=null;let A=false;if(r.client!=null){u=r.client.globalObject;A=r.client.crossOriginIsolatedCapability}const h=D(A);const g=Q({startTime:h});const y={controller:new Fetch(p),request:r,timingInfo:g,processRequestBodyChunkLength:i,processRequestEndOfBody:s,processResponse:a,processResponseConsumeBody:c,processResponseEndOfBody:l,taskDestination:u,crossOriginIsolatedCapability:A};K(!r.body||r.body.stream);if(r.window==="client"){r.window=r.client?.globalObject?.constructor?.name==="Window"?r.client:"no-window"}if(r.origin==="client"){r.origin=r.client?.origin}if(r.policyContainer==="client"){if(r.client!=null){r.policyContainer=w(r.client.policyContainer)}else{r.policyContainer=b()}}if(!r.headersList.contains("accept")){const i="*/*";r.headersList.append("accept",i)}if(!r.headersList.contains("accept-language")){r.headersList.append("accept-language","*")}if(r.priority===null){}if(ie.has(r.destination)){}mainFetch(y).catch((r=>{y.controller.terminate(r)}));return y.controller}async function mainFetch(r,i=false){const s=r.request;let a=null;if(s.localURLsOnly&&!z(S(s))){a=l("local URLs only")}R(s);if(C(s)==="blocked"){a=l("bad port")}if(s.referrerPolicy===""){s.referrerPolicy=s.policyContainer.referrerPolicy}if(s.referrer!=="no-referrer"){s.referrer=k(s)}if(a===null){a=await(async()=>{const i=S(s);if(L(i,s.url)&&s.responseTainting==="basic"||i.protocol==="data:"||(s.mode==="navigate"||s.mode==="websocket")){s.responseTainting="basic";return await schemeFetch(r)}if(s.mode==="same-origin"){return l('request mode cannot be "same-origin"')}if(s.mode==="no-cors"){if(s.redirect!=="follow"){return l('redirect mode cannot be "follow" for "no-cors" request')}s.responseTainting="opaque";return await schemeFetch(r)}if(!V(S(s))){return l("URL scheme must be a HTTP(S) scheme")}s.responseTainting="cors";return await httpFetch(r)})()}if(i){return a}if(a.status!==0&&!a.internalResponse){if(s.responseTainting==="cors"){}if(s.responseTainting==="basic"){a=d(a,"basic")}else if(s.responseTainting==="cors"){a=d(a,"cors")}else if(s.responseTainting==="opaque"){a=d(a,"opaque")}else{K(false)}}let c=a.status===0?a:a.internalResponse;if(c.urlList.length===0){c.urlList.push(...s.urlList)}if(!s.timingAllowFailed){a.timingAllowPassed=true}if(a.type==="opaque"&&c.status===206&&c.rangeRequested&&!s.headers.contains("range")){a=c=l()}if(a.status!==0&&(s.method==="HEAD"||s.method==="CONNECT"||te.includes(c.status))){c.body=null;r.controller.dump=true}if(s.integrity){const processBodyError=i=>fetchFinale(r,l(i));if(s.responseTainting==="opaque"||a.body==null){processBodyError(a.error);return}const processBody=i=>{if(!y(i,s.integrity)){processBodyError("integrity mismatch");return}a.body=Z(i)[0];fetchFinale(r,a)};await H(a.body,processBody,processBodyError)}else{fetchFinale(r,a)}}function schemeFetch(r){if(M(r)&&r.request.redirectCount===0){return Promise.resolve(c(r))}const{request:i}=r;const{protocol:a}=S(i);switch(a){case"about:":{return Promise.resolve(l("about scheme is not supported"))}case"blob:":{if(!Ce){Ce=s(14300).resolveObjectURL}const r=S(i);if(r.search.length!==0){return Promise.resolve(l("NetworkError when attempting to fetch resource."))}const a=Ce(r.toString());if(i.method!=="GET"||!O(a)){return Promise.resolve(l("invalid method"))}const c=Z(a);const d=c[0];const u=G(`${d.length}`);const A=c[1]??"";const h=p({statusText:"OK",headersList:[["content-length",{name:"Content-Length",value:u}],["content-type",{name:"Content-Type",value:A}]]});h.body=d;return Promise.resolve(h)}case"data:":{const r=S(i);const s=me(r);if(s==="failure"){return Promise.resolve(l("failed to fetch the data URL"))}const a=he(s.mimeType);return Promise.resolve(p({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:a}]],body:Z(s.body)[0]}))}case"file:":{return Promise.resolve(l("not implemented... yet..."))}case"http:":case"https:":{return httpFetch(r).catch((r=>l(r)))}default:{return Promise.resolve(l("unknown scheme"))}}}function finalizeResponse(r,i){r.request.done=true;if(r.processResponseDone!=null){queueMicrotask((()=>r.processResponseDone(i)))}}function fetchFinale(r,i){if(i.type==="error"){i.urlList=[r.request.urlList[0]];i.timingInfo=Q({startTime:r.timingInfo.startTime})}const processResponseEndOfBody=()=>{r.request.done=true;if(r.processResponseEndOfBody!=null){queueMicrotask((()=>r.processResponseEndOfBody(i)))}};if(r.processResponse!=null){queueMicrotask((()=>r.processResponse(i)))}if(i.body==null){processResponseEndOfBody()}else{const identityTransformAlgorithm=(r,i)=>{i.enqueue(r)};const r=new ge({start(){},transform:identityTransformAlgorithm,flush:processResponseEndOfBody},{size(){return 1}},{size(){return 1}});i.body={stream:i.body.stream.pipeThrough(r)}}if(r.processResponseConsumeBody!=null){const processBody=s=>r.processResponseConsumeBody(i,s);const processBodyError=s=>r.processResponseConsumeBody(i,s);if(i.body==null){queueMicrotask((()=>processBody(null)))}else{return H(i.body,processBody,processBodyError)}return Promise.resolve()}}async function httpFetch(r){const i=r.request;let s=null;let a=null;const c=r.timingInfo;if(i.serviceWorkers==="all"){}if(s===null){if(i.redirect==="follow"){i.serviceWorkers="none"}a=s=await httpNetworkOrCacheFetch(r);if(i.responseTainting==="cors"&&N(i,s)==="failure"){return l("cors failure")}if(v(i,s)==="failure"){i.timingAllowFailed=true}}if((i.responseTainting==="opaque"||s.type==="opaque")&&T(i.origin,i.client,i.destination,a)==="blocked"){return l("blocked")}if(ee.has(a.status)){if(i.redirect!=="manual"){r.controller.connection.destroy()}if(i.redirect==="error"){s=l("unexpected redirect")}else if(i.redirect==="manual"){s=a}else if(i.redirect==="follow"){s=await httpRedirectFetch(r,s)}else{K(false)}}s.timingInfo=c;return s}function httpRedirectFetch(r,i){const s=r.request;const a=i.internalResponse?i.internalResponse:i;let c;try{c=B(a,S(s).hash);if(c==null){return i}}catch(r){return Promise.resolve(l(r))}if(!V(c)){return Promise.resolve(l("URL scheme must be a HTTP(S) scheme"))}if(s.redirectCount===20){return Promise.resolve(l("redirect count exceeded"))}s.redirectCount+=1;if(s.mode==="cors"&&(c.username||c.password)&&!L(s,c)){return Promise.resolve(l('cross origin not allowed for request mode "cors"'))}if(s.responseTainting==="cors"&&(c.username||c.password)){return Promise.resolve(l('URL cannot contain credentials for request mode "cors"'))}if(a.status!==303&&s.body!=null&&s.body.source==null){return Promise.resolve(l())}if([301,302].includes(a.status)&&s.method==="POST"||a.status===303&&!we.includes(s.method)){s.method="GET";s.body=null;for(const r of ne){s.headersList.delete(r)}}if(!L(S(s),c)){s.headersList.delete("authorization");s.headersList.delete("proxy-authorization",true);s.headersList.delete("cookie");s.headersList.delete("host")}if(s.body!=null){K(s.body.source!=null);s.body=Z(s.body.source)[0]}const d=r.timingInfo;d.redirectEndTime=d.postRedirectStartTime=D(r.crossOriginIsolatedCapability);if(d.redirectStartTime===0){d.redirectStartTime=d.startTime}s.urlList.push(c);x(s,a);return mainFetch(r,true)}async function httpNetworkOrCacheFetch(r,i=false,s=false){const a=r.request;let d=null;let p=null;let u=null;const A=null;const g=false;if(a.window==="no-window"&&a.redirect==="error"){d=r;p=a}else{p=h(a);d={...r};d.request=p}const y=a.credentials==="include"||a.credentials==="same-origin"&&a.responseTainting==="basic";const b=p.body?p.body.length:null;let w=null;if(p.body==null&&["POST","PUT"].includes(p.method)){w="0"}if(b!=null){w=G(`${b}`)}if(w!=null){p.headersList.append("content-length",w)}if(b!=null&&p.keepalive){}if(p.referrer instanceof URL){p.headersList.append("referer",G(p.referrer.href))}I(p);_(p);if(!p.headersList.contains("user-agent")){p.headersList.append("user-agent",typeof esbuildDetection==="undefined"?"undici":"node")}if(p.cache==="default"&&(p.headersList.contains("if-modified-since")||p.headersList.contains("if-none-match")||p.headersList.contains("if-unmodified-since")||p.headersList.contains("if-match")||p.headersList.contains("if-range"))){p.cache="no-store"}if(p.cache==="no-cache"&&!p.preventNoCacheCacheControlHeaderModification&&!p.headersList.contains("cache-control")){p.headersList.append("cache-control","max-age=0")}if(p.cache==="no-store"||p.cache==="reload"){if(!p.headersList.contains("pragma")){p.headersList.append("pragma","no-cache")}if(!p.headersList.contains("cache-control")){p.headersList.append("cache-control","no-cache")}}if(p.headersList.contains("range")){p.headersList.append("accept-encoding","identity")}if(!p.headersList.contains("accept-encoding")){if(W(S(p))){p.headersList.append("accept-encoding","br, gzip, deflate")}else{p.headersList.append("accept-encoding","gzip, deflate")}}p.headersList.delete("host");if(y){}if(A==null){p.cache="no-store"}if(p.mode!=="no-store"&&p.mode!=="reload"){}if(u==null){if(p.mode==="only-if-cached"){return l("only if cached")}const r=await httpNetworkFetch(d,y,s);if(!re.has(p.method)&&r.status>=200&&r.status<=399){}if(g&&r.status===304){}if(u==null){u=r}}u.urlList=[...p.urlList];if(p.headersList.contains("range")){u.rangeRequested=true}u.requestIncludesCredentials=y;if(u.status===407){if(a.window==="no-window"){return l()}if(M(r)){return c(r)}return l("proxy authentication required")}if(u.status===421&&!s&&(a.body==null||a.body.source!=null)){if(M(r)){return c(r)}r.controller.connection.destroy();u=await httpNetworkOrCacheFetch(r,i,true)}if(i){}return u}async function httpNetworkFetch(r,i=false,a=false){K(!r.controller.connection||r.controller.connection.destroyed);r.controller.connection={abort:null,destroyed:false,destroy(r){if(!this.destroyed){this.destroyed=true;this.abort?.(r??new se("The operation was aborted.","AbortError"))}}};const d=r.request;let A=null;const h=r.timingInfo;const y=null;if(y==null){d.cache="no-store"}const b=a?"yes":"no";if(d.mode==="websocket"){}else{}let w=null;if(d.body==null&&r.processRequestEndOfBody){queueMicrotask((()=>r.processRequestEndOfBody()))}else if(d.body!=null){const processBodyChunk=async function*(i){if(M(r)){return}yield i;r.processRequestBodyChunkLength?.(i.byteLength)};const processEndOfBody=()=>{if(M(r)){return}if(r.processRequestEndOfBody){r.processRequestEndOfBody()}};const processBodyError=i=>{if(M(r)){return}if(i.name==="AbortError"){r.controller.abort()}else{r.controller.terminate(i)}};w=async function*(){try{for await(const r of d.body.stream){yield*processBodyChunk(r)}processEndOfBody()}catch(r){processBodyError(r)}}()}try{const{body:i,status:s,statusText:a,headersList:l,socket:c}=await dispatch({body:w});if(c){A=p({status:s,statusText:a,headersList:l,socket:c})}else{const c=i[Symbol.asyncIterator]();r.controller.next=()=>c.next();A=p({status:s,statusText:a,headersList:l})}}catch(i){if(i.name==="AbortError"){r.controller.connection.destroy();return c(r,i)}return l(i)}const pullAlgorithm=()=>{r.controller.resume()};const cancelAlgorithm=i=>{r.controller.abort(i)};if(!ve){ve=s(35356).ReadableStream}const C=new ve({async start(i){r.controller.controller=i},async pull(r){await pullAlgorithm(r)},async cancel(r){await cancelAlgorithm(r)}},{highWaterMark:0,size(){return 1}});A.body={stream:C};r.controller.on("terminated",onAborted);r.controller.resume=async()=>{while(true){let i;let s;try{const{done:s,value:a}=await r.controller.next();if(U(r)){break}i=s?undefined:a}catch(a){if(r.controller.ended&&!h.encodedBodySize){i=undefined}else{i=a;s=true}}if(i===undefined){q(r.controller.controller);finalizeResponse(r,A);return}h.decodedBodySize+=i?.byteLength??0;if(s){r.controller.terminate(i);return}r.controller.controller.enqueue(new Uint8Array(i));if(pe(C)){r.controller.terminate();return}if(!r.controller.controller.desiredSize){return}}};function onAborted(i){if(U(r)){A.aborted=true;if(ue(C)){r.controller.controller.error(r.controller.serializedAbortReason)}}else{if(ue(C)){r.controller.controller.error(new TypeError("terminated",{cause:j(i)?i:undefined}))}}r.controller.connection.destroy()}return A;async function dispatch({body:i}){const s=S(d);const a=r.controller.dispatcher;return new Promise(((l,c)=>a.dispatch({path:s.pathname+s.search,origin:s.origin,method:d.method,body:r.controller.dispatcher.isMockActive?d.body&&(d.body.source||d.body.stream):i,headers:d.headersList.entries,maxRedirections:0,upgrade:d.mode==="websocket"?"websocket":undefined},{body:null,abort:null,onConnect(i){const{connection:s}=r.controller;if(s.destroyed){i(new se("The operation was aborted.","AbortError"))}else{r.controller.on("terminated",i);this.abort=s.abort=i}},onHeaders(r,i,s,a){if(r<200){return}let c=[];let p="";const A=new u;if(Array.isArray(i)){for(let r=0;rr.trim()))}else if(s.toLowerCase()==="location"){p=a}A[ae].append(s,a)}}else{const r=Object.keys(i);for(const s of r){const r=i[s];if(s.toLowerCase()==="content-encoding"){c=r.toLowerCase().split(",").map((r=>r.trim())).reverse()}else if(s.toLowerCase()==="location"){p=r}A[ae].append(s,r)}}this.body=new le({read:s});const h=[];const y=d.redirect==="follow"&&p&&ee.has(r);if(d.method!=="HEAD"&&d.method!=="CONNECT"&&!te.includes(r)&&!y){for(const r of c){if(r==="x-gzip"||r==="gzip"){h.push(g.createGunzip({flush:g.constants.Z_SYNC_FLUSH,finishFlush:g.constants.Z_SYNC_FLUSH}))}else if(r==="deflate"){h.push(g.createInflate())}else if(r==="br"){h.push(g.createBrotliDecompress())}else{h.length=0;break}}}l({status:r,statusText:a,headersList:A[ae],body:h.length?ce(this.body,...h,(()=>{})):this.body.on("error",(()=>{}))});return true},onData(i){if(r.controller.dump){return}const s=i;h.encodedBodySize+=s.byteLength;return this.body.push(s)},onComplete(){if(this.abort){r.controller.off("terminated",this.abort)}r.controller.ended=true;this.body.push(null)},onError(i){if(this.abort){r.controller.off("terminated",this.abort)}this.body?.destroy(i);r.controller.terminate(i);c(i)},onUpgrade(r,i,s){if(r!==101){return}const a=new u;for(let r=0;r{"use strict";const{extractBody:a,mixinBody:l,cloneBody:c}=s(21254);const{Headers:d,fill:p,HeadersList:u}=s(8247);const{FinalizationRegistry:A}=s(17428)();const h=s(94766);const{isValidHTTPToken:g,sameOrigin:y,normalizeMethod:b,makePolicyContainer:w,normalizeMethodRecord:C}=s(40336);const{forbiddenMethodsSet:v,corsSafeListedMethodsSet:I,referrerPolicy:B,requestRedirect:S,requestMode:x,requestCredentials:R,requestCache:Q,requestDuplex:_}=s(67296);const{kEnumerableProperty:N}=h;const{kHeaders:T,kSignal:k,kState:D,kGuard:P,kRealm:O}=s(9411);const{webidl:L}=s(87591);const{getGlobalOrigin:M}=s(46670);const{URLSerializer:U}=s(80097);const{kHeadersList:j,kConstruct:H}=s(31915);const q=s(39491);const{getMaxListeners:G,setMaxListeners:z,getEventListeners:V,defaultMaxListeners:W}=s(82361);let Y=globalThis.TransformStream;const J=Symbol("abortController");const $=new A((({signal:r,abort:i})=>{r.removeEventListener("abort",i)}));class Request{constructor(r,i={}){if(r===H){return}L.argumentLengthCheck(arguments,1,{header:"Request constructor"});r=L.converters.RequestInfo(r);i=L.converters.RequestInit(i);this[O]={settingsObject:{baseUrl:M(),get origin(){return this.baseUrl?.origin},policyContainer:w()}};let l=null;let c=null;const A=this[O].settingsObject.baseUrl;let B=null;if(typeof r==="string"){let i;try{i=new URL(r,A)}catch(i){throw new TypeError("Failed to parse URL from "+r,{cause:i})}if(i.username||i.password){throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+r)}l=makeRequest({urlList:[i]});c="cors"}else{q(r instanceof Request);l=r[D];B=r[k]}const S=this[O].settingsObject.origin;let x="client";if(l.window?.constructor?.name==="EnvironmentSettingsObject"&&y(l.window,S)){x=l.window}if(i.window!=null){throw new TypeError(`'window' option '${x}' must be null`)}if("window"in i){x="no-window"}l=makeRequest({method:l.method,headersList:l.headersList,unsafeRequest:l.unsafeRequest,client:this[O].settingsObject,window:x,priority:l.priority,origin:l.origin,referrer:l.referrer,referrerPolicy:l.referrerPolicy,mode:l.mode,credentials:l.credentials,cache:l.cache,redirect:l.redirect,integrity:l.integrity,keepalive:l.keepalive,reloadNavigation:l.reloadNavigation,historyNavigation:l.historyNavigation,urlList:[...l.urlList]});const R=Object.keys(i).length!==0;if(R){if(l.mode==="navigate"){l.mode="same-origin"}l.reloadNavigation=false;l.historyNavigation=false;l.origin="client";l.referrer="client";l.referrerPolicy="";l.url=l.urlList[l.urlList.length-1];l.urlList=[l.url]}if(i.referrer!==undefined){const r=i.referrer;if(r===""){l.referrer="no-referrer"}else{let i;try{i=new URL(r,A)}catch(i){throw new TypeError(`Referrer "${r}" is not a valid URL.`,{cause:i})}if(i.protocol==="about:"&&i.hostname==="client"||S&&!y(i,this[O].settingsObject.baseUrl)){l.referrer="client"}else{l.referrer=i}}}if(i.referrerPolicy!==undefined){l.referrerPolicy=i.referrerPolicy}let Q;if(i.mode!==undefined){Q=i.mode}else{Q=c}if(Q==="navigate"){throw L.errors.exception({header:"Request constructor",message:"invalid request mode navigate."})}if(Q!=null){l.mode=Q}if(i.credentials!==undefined){l.credentials=i.credentials}if(i.cache!==undefined){l.cache=i.cache}if(l.cache==="only-if-cached"&&l.mode!=="same-origin"){throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode")}if(i.redirect!==undefined){l.redirect=i.redirect}if(i.integrity!=null){l.integrity=String(i.integrity)}if(i.keepalive!==undefined){l.keepalive=Boolean(i.keepalive)}if(i.method!==undefined){let r=i.method;if(!g(r)){throw new TypeError(`'${r}' is not a valid HTTP method.`)}if(v.has(r.toUpperCase())){throw new TypeError(`'${r}' HTTP method is unsupported.`)}r=C[r]??b(r);l.method=r}if(i.signal!==undefined){B=i.signal}this[D]=l;const _=new AbortController;this[k]=_.signal;this[k][O]=this[O];if(B!=null){if(!B||typeof B.aborted!=="boolean"||typeof B.addEventListener!=="function"){throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.")}if(B.aborted){_.abort(B.reason)}else{this[J]=_;const r=new WeakRef(_);const abort=function(){const i=r.deref();if(i!==undefined){i.abort(this.reason)}};try{if(typeof G==="function"&&G(B)===W){z(100,B)}else if(V(B,"abort").length>=W){z(100,B)}}catch{}h.addAbortListener(B,abort);$.register(_,{signal:B,abort:abort})}}this[T]=new d(H);this[T][j]=l.headersList;this[T][P]="request";this[T][O]=this[O];if(Q==="no-cors"){if(!I.has(l.method)){throw new TypeError(`'${l.method} is unsupported in no-cors mode.`)}this[T][P]="request-no-cors"}if(R){const r=this[T][j];const s=i.headers!==undefined?i.headers:new u(r);r.clear();if(s instanceof u){for(const[i,a]of s){r.append(i,a)}r.cookies=s.cookies}else{p(this[T],s)}}const N=r instanceof Request?r[D].body:null;if((i.body!=null||N!=null)&&(l.method==="GET"||l.method==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body.")}let U=null;if(i.body!=null){const[r,s]=a(i.body,l.keepalive);U=r;if(s&&!this[T][j].contains("content-type")){this[T].append("content-type",s)}}const X=U??N;if(X!=null&&X.source==null){if(U!=null&&i.duplex==null){throw new TypeError("RequestInit: duplex option is required when sending a body.")}if(l.mode!=="same-origin"&&l.mode!=="cors"){throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"')}l.useCORSPreflightFlag=true}let K=X;if(U==null&&N!=null){if(h.isDisturbed(N.stream)||N.stream.locked){throw new TypeError("Cannot construct a Request with a Request object that has already been used.")}if(!Y){Y=s(35356).TransformStream}const r=new Y;N.stream.pipeThrough(r);K={source:N.source,length:N.length,stream:r.readable}}this[D].body=K}get method(){L.brandCheck(this,Request);return this[D].method}get url(){L.brandCheck(this,Request);return U(this[D].url)}get headers(){L.brandCheck(this,Request);return this[T]}get destination(){L.brandCheck(this,Request);return this[D].destination}get referrer(){L.brandCheck(this,Request);if(this[D].referrer==="no-referrer"){return""}if(this[D].referrer==="client"){return"about:client"}return this[D].referrer.toString()}get referrerPolicy(){L.brandCheck(this,Request);return this[D].referrerPolicy}get mode(){L.brandCheck(this,Request);return this[D].mode}get credentials(){return this[D].credentials}get cache(){L.brandCheck(this,Request);return this[D].cache}get redirect(){L.brandCheck(this,Request);return this[D].redirect}get integrity(){L.brandCheck(this,Request);return this[D].integrity}get keepalive(){L.brandCheck(this,Request);return this[D].keepalive}get isReloadNavigation(){L.brandCheck(this,Request);return this[D].reloadNavigation}get isHistoryNavigation(){L.brandCheck(this,Request);return this[D].historyNavigation}get signal(){L.brandCheck(this,Request);return this[k]}get body(){L.brandCheck(this,Request);return this[D].body?this[D].body.stream:null}get bodyUsed(){L.brandCheck(this,Request);return!!this[D].body&&h.isDisturbed(this[D].body.stream)}get duplex(){L.brandCheck(this,Request);return"half"}clone(){L.brandCheck(this,Request);if(this.bodyUsed||this.body?.locked){throw new TypeError("unusable")}const r=cloneRequest(this[D]);const i=new Request(H);i[D]=r;i[O]=this[O];i[T]=new d(H);i[T][j]=r.headersList;i[T][P]=this[T][P];i[T][O]=this[T][O];const s=new AbortController;if(this.signal.aborted){s.abort(this.signal.reason)}else{h.addAbortListener(this.signal,(()=>{s.abort(this.signal.reason)}))}i[k]=s.signal;return i}}l(Request);function makeRequest(r){const i={method:"GET",localURLsOnly:false,unsafeRequest:false,body:null,client:null,reservedClient:null,replacesClientId:"",window:"client",keepalive:false,serviceWorkers:"all",initiator:"",destination:"",priority:null,origin:"client",policyContainer:"client",referrer:"client",referrerPolicy:"",mode:"no-cors",useCORSPreflightFlag:false,credentials:"same-origin",useCredentials:false,cache:"default",redirect:"follow",integrity:"",cryptoGraphicsNonceMetadata:"",parserMetadata:"",reloadNavigation:false,historyNavigation:false,userActivation:false,taintedOrigin:false,redirectCount:0,responseTainting:"basic",preventNoCacheCacheControlHeaderModification:false,done:false,timingAllowFailed:false,...r,headersList:r.headersList?new u(r.headersList):new u};i.url=i.urlList[0];return i}function cloneRequest(r){const i=makeRequest({...r,body:null});if(r.body!=null){i.body=c(r.body)}return i}Object.defineProperties(Request.prototype,{method:N,url:N,headers:N,redirect:N,clone:N,signal:N,duplex:N,destination:N,body:N,bodyUsed:N,isHistoryNavigation:N,isReloadNavigation:N,keepalive:N,integrity:N,cache:N,credentials:N,attribute:N,referrerPolicy:N,referrer:N,mode:N,[Symbol.toStringTag]:{value:"Request",configurable:true}});L.converters.Request=L.interfaceConverter(Request);L.converters.RequestInfo=function(r){if(typeof r==="string"){return L.converters.USVString(r)}if(r instanceof Request){return L.converters.Request(r)}return L.converters.USVString(r)};L.converters.AbortSignal=L.interfaceConverter(AbortSignal);L.converters.RequestInit=L.dictionaryConverter([{key:"method",converter:L.converters.ByteString},{key:"headers",converter:L.converters.HeadersInit},{key:"body",converter:L.nullableConverter(L.converters.BodyInit)},{key:"referrer",converter:L.converters.USVString},{key:"referrerPolicy",converter:L.converters.DOMString,allowedValues:B},{key:"mode",converter:L.converters.DOMString,allowedValues:x},{key:"credentials",converter:L.converters.DOMString,allowedValues:R},{key:"cache",converter:L.converters.DOMString,allowedValues:Q},{key:"redirect",converter:L.converters.DOMString,allowedValues:S},{key:"integrity",converter:L.converters.DOMString},{key:"keepalive",converter:L.converters.boolean},{key:"signal",converter:L.nullableConverter((r=>L.converters.AbortSignal(r,{strict:false})))},{key:"window",converter:L.converters.any},{key:"duplex",converter:L.converters.DOMString,allowedValues:_}]);r.exports={Request:Request,makeRequest:makeRequest}},55032:(r,i,s)=>{"use strict";const{Headers:a,HeadersList:l,fill:c}=s(8247);const{extractBody:d,cloneBody:p,mixinBody:u}=s(21254);const A=s(94766);const{kEnumerableProperty:h}=A;const{isValidReasonPhrase:g,isCancelled:y,isAborted:b,isBlobLike:w,serializeJavascriptValueToJSONString:C,isErrorLike:v,isomorphicEncode:I}=s(40336);const{redirectStatusSet:B,nullBodyStatus:S,DOMException:x}=s(67296);const{kState:R,kHeaders:Q,kGuard:_,kRealm:N}=s(9411);const{webidl:T}=s(87591);const{FormData:k}=s(72489);const{getGlobalOrigin:D}=s(46670);const{URLSerializer:P}=s(80097);const{kHeadersList:O,kConstruct:L}=s(31915);const M=s(39491);const{types:U}=s(73837);const j=globalThis.ReadableStream||s(35356).ReadableStream;const H=new TextEncoder("utf-8");class Response{static error(){const r={settingsObject:{}};const i=new Response;i[R]=makeNetworkError();i[N]=r;i[Q][O]=i[R].headersList;i[Q][_]="immutable";i[Q][N]=r;return i}static json(r,i={}){T.argumentLengthCheck(arguments,1,{header:"Response.json"});if(i!==null){i=T.converters.ResponseInit(i)}const s=H.encode(C(r));const a=d(s);const l={settingsObject:{}};const c=new Response;c[N]=l;c[Q][_]="response";c[Q][N]=l;initializeResponse(c,i,{body:a[0],type:"application/json"});return c}static redirect(r,i=302){const s={settingsObject:{}};T.argumentLengthCheck(arguments,1,{header:"Response.redirect"});r=T.converters.USVString(r);i=T.converters["unsigned short"](i);let a;try{a=new URL(r,D())}catch(i){throw Object.assign(new TypeError("Failed to parse URL from "+r),{cause:i})}if(!B.has(i)){throw new RangeError("Invalid status code "+i)}const l=new Response;l[N]=s;l[Q][_]="immutable";l[Q][N]=s;l[R].status=i;const c=I(P(a));l[R].headersList.append("location",c);return l}constructor(r=null,i={}){if(r!==null){r=T.converters.BodyInit(r)}i=T.converters.ResponseInit(i);this[N]={settingsObject:{}};this[R]=makeResponse({});this[Q]=new a(L);this[Q][_]="response";this[Q][O]=this[R].headersList;this[Q][N]=this[N];let s=null;if(r!=null){const[i,a]=d(r);s={body:i,type:a}}initializeResponse(this,i,s)}get type(){T.brandCheck(this,Response);return this[R].type}get url(){T.brandCheck(this,Response);const r=this[R].urlList;const i=r[r.length-1]??null;if(i===null){return""}return P(i,true)}get redirected(){T.brandCheck(this,Response);return this[R].urlList.length>1}get status(){T.brandCheck(this,Response);return this[R].status}get ok(){T.brandCheck(this,Response);return this[R].status>=200&&this[R].status<=299}get statusText(){T.brandCheck(this,Response);return this[R].statusText}get headers(){T.brandCheck(this,Response);return this[Q]}get body(){T.brandCheck(this,Response);return this[R].body?this[R].body.stream:null}get bodyUsed(){T.brandCheck(this,Response);return!!this[R].body&&A.isDisturbed(this[R].body.stream)}clone(){T.brandCheck(this,Response);if(this.bodyUsed||this.body&&this.body.locked){throw T.errors.exception({header:"Response.clone",message:"Body has already been consumed."})}const r=cloneResponse(this[R]);const i=new Response;i[R]=r;i[N]=this[N];i[Q][O]=r.headersList;i[Q][_]=this[Q][_];i[Q][N]=this[Q][N];return i}}u(Response);Object.defineProperties(Response.prototype,{type:h,url:h,status:h,ok:h,redirected:h,statusText:h,headers:h,clone:h,body:h,bodyUsed:h,[Symbol.toStringTag]:{value:"Response",configurable:true}});Object.defineProperties(Response,{json:h,redirect:h,error:h});function cloneResponse(r){if(r.internalResponse){return filterResponse(cloneResponse(r.internalResponse),r.type)}const i=makeResponse({...r,body:null});if(r.body!=null){i.body=p(r.body)}return i}function makeResponse(r){return{aborted:false,rangeRequested:false,timingAllowPassed:false,requestIncludesCredentials:false,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...r,headersList:r.headersList?new l(r.headersList):new l,urlList:r.urlList?[...r.urlList]:[]}}function makeNetworkError(r){const i=v(r);return makeResponse({type:"error",status:0,error:i?r:new Error(r?String(r):r),aborted:r&&r.name==="AbortError"})}function makeFilteredResponse(r,i){i={internalResponse:r,...i};return new Proxy(r,{get(r,s){return s in i?i[s]:r[s]},set(r,s,a){M(!(s in i));r[s]=a;return true}})}function filterResponse(r,i){if(i==="basic"){return makeFilteredResponse(r,{type:"basic",headersList:r.headersList})}else if(i==="cors"){return makeFilteredResponse(r,{type:"cors",headersList:r.headersList})}else if(i==="opaque"){return makeFilteredResponse(r,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null})}else if(i==="opaqueredirect"){return makeFilteredResponse(r,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null})}else{M(false)}}function makeAppropriateNetworkError(r,i=null){M(y(r));return b(r)?makeNetworkError(Object.assign(new x("The operation was aborted.","AbortError"),{cause:i})):makeNetworkError(Object.assign(new x("Request was cancelled."),{cause:i}))}function initializeResponse(r,i,s){if(i.status!==null&&(i.status<200||i.status>599)){throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')}if("statusText"in i&&i.statusText!=null){if(!g(String(i.statusText))){throw new TypeError("Invalid statusText")}}if("status"in i&&i.status!=null){r[R].status=i.status}if("statusText"in i&&i.statusText!=null){r[R].statusText=i.statusText}if("headers"in i&&i.headers!=null){c(r[Q],i.headers)}if(s){if(S.includes(r.status)){throw T.errors.exception({header:"Response constructor",message:"Invalid response status code "+r.status})}r[R].body=s.body;if(s.type!=null&&!r[R].headersList.contains("Content-Type")){r[R].headersList.append("content-type",s.type)}}}T.converters.ReadableStream=T.interfaceConverter(j);T.converters.FormData=T.interfaceConverter(k);T.converters.URLSearchParams=T.interfaceConverter(URLSearchParams);T.converters.XMLHttpRequestBodyInit=function(r){if(typeof r==="string"){return T.converters.USVString(r)}if(w(r)){return T.converters.Blob(r,{strict:false})}if(U.isArrayBuffer(r)||U.isTypedArray(r)||U.isDataView(r)){return T.converters.BufferSource(r)}if(A.isFormDataLike(r)){return T.converters.FormData(r,{strict:false})}if(r instanceof URLSearchParams){return T.converters.URLSearchParams(r)}return T.converters.DOMString(r)};T.converters.BodyInit=function(r){if(r instanceof j){return T.converters.ReadableStream(r)}if(r?.[Symbol.asyncIterator]){return r}return T.converters.XMLHttpRequestBodyInit(r)};T.converters.ResponseInit=T.dictionaryConverter([{key:"status",converter:T.converters["unsigned short"],defaultValue:200},{key:"statusText",converter:T.converters.ByteString,defaultValue:""},{key:"headers",converter:T.converters.HeadersInit}]);r.exports={makeNetworkError:makeNetworkError,makeResponse:makeResponse,makeAppropriateNetworkError:makeAppropriateNetworkError,filterResponse:filterResponse,Response:Response,cloneResponse:cloneResponse}},9411:r=>{"use strict";r.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kGuard:Symbol("guard"),kRealm:Symbol("realm")}},40336:(r,i,s)=>{"use strict";const{redirectStatusSet:a,referrerPolicySet:l,badPortsSet:c}=s(67296);const{getGlobalOrigin:d}=s(46670);const{performance:p}=s(4074);const{isBlobLike:u,toUSVString:A,ReadableStreamFrom:h}=s(94766);const g=s(39491);const{isUint8Array:y}=s(29830);let b;try{b=s(6113)}catch{}function responseURL(r){const i=r.urlList;const s=i.length;return s===0?null:i[s-1].toString()}function responseLocationURL(r,i){if(!a.has(r.status)){return null}let s=r.headersList.get("location");if(s!==null&&isValidHeaderValue(s)){s=new URL(s,responseURL(r))}if(s&&!s.hash){s.hash=i}return s}function requestCurrentURL(r){return r.urlList[r.urlList.length-1]}function requestBadPort(r){const i=requestCurrentURL(r);if(urlIsHttpHttpsScheme(i)&&c.has(i.port)){return"blocked"}return"allowed"}function isErrorLike(r){return r instanceof Error||(r?.constructor?.name==="Error"||r?.constructor?.name==="DOMException")}function isValidReasonPhrase(r){for(let i=0;i=32&&s<=126||s>=128&&s<=255)){return false}}return true}function isTokenCharCode(r){switch(r){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return false;default:return r>=33&&r<=126}}function isValidHTTPToken(r){if(r.length===0){return false}for(let i=0;i0){for(let r=a.length;r!==0;r--){const i=a[r-1].trim();if(l.has(i)){c=i;break}}}if(c!==""){r.referrerPolicy=c}}function crossOriginResourcePolicyCheck(){return"allowed"}function corsCheck(){return"success"}function TAOCheck(){return"success"}function appendFetchMetadata(r){let i=null;i=r.mode;r.headersList.set("sec-fetch-mode",i)}function appendRequestOriginHeader(r){let i=r.origin;if(r.responseTainting==="cors"||r.mode==="websocket"){if(i){r.headersList.append("origin",i)}}else if(r.method!=="GET"&&r.method!=="HEAD"){switch(r.referrerPolicy){case"no-referrer":i=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":if(r.origin&&urlHasHttpsScheme(r.origin)&&!urlHasHttpsScheme(requestCurrentURL(r))){i=null}break;case"same-origin":if(!sameOrigin(r,requestCurrentURL(r))){i=null}break;default:}if(i){r.headersList.append("origin",i)}}}function coarsenedSharedCurrentTime(r){return p.now()}function createOpaqueTimingInfo(r){return{startTime:r.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:r.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function makePolicyContainer(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function clonePolicyContainer(r){return{referrerPolicy:r.referrerPolicy}}function determineRequestsReferrer(r){const i=r.referrerPolicy;g(i);let s=null;if(r.referrer==="client"){const r=d();if(!r||r.origin==="null"){return"no-referrer"}s=new URL(r)}else if(r.referrer instanceof URL){s=r.referrer}let a=stripURLForReferrer(s);const l=stripURLForReferrer(s,true);if(a.toString().length>4096){a=l}const c=sameOrigin(r,a);const p=isURLPotentiallyTrustworthy(a)&&!isURLPotentiallyTrustworthy(r.url);switch(i){case"origin":return l!=null?l:stripURLForReferrer(s,true);case"unsafe-url":return a;case"same-origin":return c?l:"no-referrer";case"origin-when-cross-origin":return c?a:l;case"strict-origin-when-cross-origin":{const i=requestCurrentURL(r);if(sameOrigin(a,i)){return a}if(isURLPotentiallyTrustworthy(a)&&!isURLPotentiallyTrustworthy(i)){return"no-referrer"}return l}case"strict-origin":case"no-referrer-when-downgrade":default:return p?"no-referrer":l}}function stripURLForReferrer(r,i){g(r instanceof URL);if(r.protocol==="file:"||r.protocol==="about:"||r.protocol==="blank:"){return"no-referrer"}r.username="";r.password="";r.hash="";if(i){r.pathname="";r.search=""}return r}function isURLPotentiallyTrustworthy(r){if(!(r instanceof URL)){return false}if(r.href==="about:blank"||r.href==="about:srcdoc"){return true}if(r.protocol==="data:")return true;if(r.protocol==="file:")return true;return isOriginPotentiallyTrustworthy(r.origin);function isOriginPotentiallyTrustworthy(r){if(r==null||r==="null")return false;const i=new URL(r);if(i.protocol==="https:"||i.protocol==="wss:"){return true}if(/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(i.hostname)||(i.hostname==="localhost"||i.hostname.includes("localhost."))||i.hostname.endsWith(".localhost")){return true}return false}}function bytesMatch(r,i){if(b===undefined){return true}const s=parseMetadata(i);if(s==="no metadata"){return true}if(s.length===0){return true}const a=s.sort(((r,i)=>i.algo.localeCompare(r.algo)));const l=a[0].algo;const c=a.filter((r=>r.algo===l));for(const i of c){const s=i.algo;let a=i.hash;if(a.endsWith("==")){a=a.slice(0,-2)}let l=b.createHash(s).update(r).digest("base64");if(l.endsWith("==")){l=l.slice(0,-2)}if(l===a){return true}let c=b.createHash(s).update(r).digest("base64url");if(c.endsWith("==")){c=c.slice(0,-2)}if(c===a){return true}}return false}const w=/((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i;function parseMetadata(r){const i=[];let s=true;const a=b.getHashes();for(const l of r.split(" ")){s=false;const r=w.exec(l);if(r===null||r.groups===undefined){continue}const c=r.groups.algo;if(a.includes(c.toLowerCase())){i.push(r.groups)}}if(s===true){return"no metadata"}return i}function tryUpgradeRequestToAPotentiallyTrustworthyURL(r){}function sameOrigin(r,i){if(r.origin===i.origin&&r.origin==="null"){return true}if(r.protocol===i.protocol&&r.hostname===i.hostname&&r.port===i.port){return true}return false}function createDeferredPromise(){let r;let i;const s=new Promise(((s,a)=>{r=s;i=a}));return{promise:s,resolve:r,reject:i}}function isAborted(r){return r.controller.state==="aborted"}function isCancelled(r){return r.controller.state==="aborted"||r.controller.state==="terminated"}const C={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"};Object.setPrototypeOf(C,null);function normalizeMethod(r){return C[r.toLowerCase()]??r}function serializeJavascriptValueToJSONString(r){const i=JSON.stringify(r);if(i===undefined){throw new TypeError("Value is not JSON serializable")}g(typeof i==="string");return i}const v=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function makeIterator(r,i,s){const a={index:0,kind:s,target:r};const l={next(){if(Object.getPrototypeOf(this)!==l){throw new TypeError(`'next' called on an object that does not implement interface ${i} Iterator.`)}const{index:r,kind:s,target:c}=a;const d=c();const p=d.length;if(r>=p){return{value:undefined,done:true}}const u=d[r];a.index=r+1;return iteratorResult(u,s)},[Symbol.toStringTag]:`${i} Iterator`};Object.setPrototypeOf(l,v);return Object.setPrototypeOf({},l)}function iteratorResult(r,i){let s;switch(i){case"key":{s=r[0];break}case"value":{s=r[1];break}case"key+value":{s=r;break}}return{value:s,done:false}}async function fullyReadBody(r,i,s){const a=i;const l=s;let c;try{c=r.stream.getReader()}catch(r){l(r);return}try{const r=await readAllBytes(c);a(r)}catch(r){l(r)}}let I=globalThis.ReadableStream;function isReadableStreamLike(r){if(!I){I=s(35356).ReadableStream}return r instanceof I||r[Symbol.toStringTag]==="ReadableStream"&&typeof r.tee==="function"}const B=65535;function isomorphicDecode(r){if(r.lengthr+String.fromCharCode(i)),"")}function readableStreamClose(r){try{r.close()}catch(r){if(!r.message.includes("Controller is already closed")){throw r}}}function isomorphicEncode(r){for(let i=0;iObject.prototype.hasOwnProperty.call(r,i));r.exports={isAborted:isAborted,isCancelled:isCancelled,createDeferredPromise:createDeferredPromise,ReadableStreamFrom:h,toUSVString:A,tryUpgradeRequestToAPotentiallyTrustworthyURL:tryUpgradeRequestToAPotentiallyTrustworthyURL,coarsenedSharedCurrentTime:coarsenedSharedCurrentTime,determineRequestsReferrer:determineRequestsReferrer,makePolicyContainer:makePolicyContainer,clonePolicyContainer:clonePolicyContainer,appendFetchMetadata:appendFetchMetadata,appendRequestOriginHeader:appendRequestOriginHeader,TAOCheck:TAOCheck,corsCheck:corsCheck,crossOriginResourcePolicyCheck:crossOriginResourcePolicyCheck,createOpaqueTimingInfo:createOpaqueTimingInfo,setRequestReferrerPolicyOnRedirect:setRequestReferrerPolicyOnRedirect,isValidHTTPToken:isValidHTTPToken,requestBadPort:requestBadPort,requestCurrentURL:requestCurrentURL,responseURL:responseURL,responseLocationURL:responseLocationURL,isBlobLike:u,isURLPotentiallyTrustworthy:isURLPotentiallyTrustworthy,isValidReasonPhrase:isValidReasonPhrase,sameOrigin:sameOrigin,normalizeMethod:normalizeMethod,serializeJavascriptValueToJSONString:serializeJavascriptValueToJSONString,makeIterator:makeIterator,isValidHeaderName:isValidHeaderName,isValidHeaderValue:isValidHeaderValue,hasOwn:S,isErrorLike:isErrorLike,fullyReadBody:fullyReadBody,bytesMatch:bytesMatch,isReadableStreamLike:isReadableStreamLike,readableStreamClose:readableStreamClose,isomorphicEncode:isomorphicEncode,isomorphicDecode:isomorphicDecode,urlIsLocal:urlIsLocal,urlHasHttpsScheme:urlHasHttpsScheme,urlIsHttpHttpsScheme:urlIsHttpHttpsScheme,readAllBytes:readAllBytes,normalizeMethodRecord:C}},87591:(r,i,s)=>{"use strict";const{types:a}=s(73837);const{hasOwn:l,toUSVString:c}=s(40336);const d={};d.converters={};d.util={};d.errors={};d.errors.exception=function(r){return new TypeError(`${r.header}: ${r.message}`)};d.errors.conversionFailed=function(r){const i=r.types.length===1?"":" one of";const s=`${r.argument} could not be converted to`+`${i}: ${r.types.join(", ")}.`;return d.errors.exception({header:r.prefix,message:s})};d.errors.invalidArgument=function(r){return d.errors.exception({header:r.prefix,message:`"${r.value}" is an invalid ${r.type}.`})};d.brandCheck=function(r,i,s=undefined){if(s?.strict!==false&&!(r instanceof i)){throw new TypeError("Illegal invocation")}else{return r?.[Symbol.toStringTag]===i.prototype[Symbol.toStringTag]}};d.argumentLengthCheck=function({length:r},i,s){if(rl){throw d.errors.exception({header:"Integer conversion",message:`Value must be between ${c}-${l}, got ${p}.`})}return p}if(!Number.isNaN(p)&&a.clamp===true){p=Math.min(Math.max(p,c),l);if(Math.floor(p)%2===0){p=Math.floor(p)}else{p=Math.ceil(p)}return p}if(Number.isNaN(p)||p===0&&Object.is(0,p)||p===Number.POSITIVE_INFINITY||p===Number.NEGATIVE_INFINITY){return 0}p=d.util.IntegerPart(p);p=p%Math.pow(2,i);if(s==="signed"&&p>=Math.pow(2,i)-1){return p-Math.pow(2,i)}return p};d.util.IntegerPart=function(r){const i=Math.floor(Math.abs(r));if(r<0){return-1*i}return i};d.sequenceConverter=function(r){return i=>{if(d.util.Type(i)!=="Object"){throw d.errors.exception({header:"Sequence",message:`Value of type ${d.util.Type(i)} is not an Object.`})}const s=i?.[Symbol.iterator]?.();const a=[];if(s===undefined||typeof s.next!=="function"){throw d.errors.exception({header:"Sequence",message:"Object is not an iterator."})}while(true){const{done:i,value:l}=s.next();if(i){break}a.push(r(l))}return a}};d.recordConverter=function(r,i){return s=>{if(d.util.Type(s)!=="Object"){throw d.errors.exception({header:"Record",message:`Value of type ${d.util.Type(s)} is not an Object.`})}const l={};if(!a.isProxy(s)){const a=Object.keys(s);for(const c of a){const a=r(c);const d=i(s[c]);l[a]=d}return l}const c=Reflect.ownKeys(s);for(const a of c){const c=Reflect.getOwnPropertyDescriptor(s,a);if(c?.enumerable){const c=r(a);const d=i(s[a]);l[c]=d}}return l}};d.interfaceConverter=function(r){return(i,s={})=>{if(s.strict!==false&&!(i instanceof r)){throw d.errors.exception({header:r.name,message:`Expected ${i} to be an instance of ${r.name}.`})}return i}};d.dictionaryConverter=function(r){return i=>{const s=d.util.Type(i);const a={};if(s==="Null"||s==="Undefined"){return a}else if(s!=="Object"){throw d.errors.exception({header:"Dictionary",message:`Expected ${i} to be one of: Null, Undefined, Object.`})}for(const s of r){const{key:r,defaultValue:c,required:p,converter:u}=s;if(p===true){if(!l(i,r)){throw d.errors.exception({header:"Dictionary",message:`Missing required key "${r}".`})}}let A=i[r];const h=l(s,"defaultValue");if(h&&A!==null){A=A??c}if(p||h||A!==undefined){A=u(A);if(s.allowedValues&&!s.allowedValues.includes(A)){throw d.errors.exception({header:"Dictionary",message:`${A} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`})}a[r]=A}}return a}};d.nullableConverter=function(r){return i=>{if(i===null){return i}return r(i)}};d.converters.DOMString=function(r,i={}){if(r===null&&i.legacyNullToEmptyString){return""}if(typeof r==="symbol"){throw new TypeError("Could not convert argument of type symbol to string.")}return String(r)};d.converters.ByteString=function(r){const i=d.converters.DOMString(r);for(let r=0;r255){throw new TypeError("Cannot convert argument to a ByteString because the character at "+`index ${r} has a value of ${i.charCodeAt(r)} which is greater than 255.`)}}return i};d.converters.USVString=c;d.converters.boolean=function(r){const i=Boolean(r);return i};d.converters.any=function(r){return r};d.converters["long long"]=function(r){const i=d.util.ConvertToInt(r,64,"signed");return i};d.converters["unsigned long long"]=function(r){const i=d.util.ConvertToInt(r,64,"unsigned");return i};d.converters["unsigned long"]=function(r){const i=d.util.ConvertToInt(r,32,"unsigned");return i};d.converters["unsigned short"]=function(r,i){const s=d.util.ConvertToInt(r,16,"unsigned",i);return s};d.converters.ArrayBuffer=function(r,i={}){if(d.util.Type(r)!=="Object"||!a.isAnyArrayBuffer(r)){throw d.errors.conversionFailed({prefix:`${r}`,argument:`${r}`,types:["ArrayBuffer"]})}if(i.allowShared===false&&a.isSharedArrayBuffer(r)){throw d.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."})}return r};d.converters.TypedArray=function(r,i,s={}){if(d.util.Type(r)!=="Object"||!a.isTypedArray(r)||r.constructor.name!==i.name){throw d.errors.conversionFailed({prefix:`${i.name}`,argument:`${r}`,types:[i.name]})}if(s.allowShared===false&&a.isSharedArrayBuffer(r.buffer)){throw d.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."})}return r};d.converters.DataView=function(r,i={}){if(d.util.Type(r)!=="Object"||!a.isDataView(r)){throw d.errors.exception({header:"DataView",message:"Object is not a DataView."})}if(i.allowShared===false&&a.isSharedArrayBuffer(r.buffer)){throw d.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."})}return r};d.converters.BufferSource=function(r,i={}){if(a.isAnyArrayBuffer(r)){return d.converters.ArrayBuffer(r,i)}if(a.isTypedArray(r)){return d.converters.TypedArray(r,r.constructor)}if(a.isDataView(r)){return d.converters.DataView(r,i)}throw new TypeError(`Could not convert ${r} to a BufferSource.`)};d.converters["sequence"]=d.sequenceConverter(d.converters.ByteString);d.converters["sequence>"]=d.sequenceConverter(d.converters["sequence"]);d.converters["record"]=d.recordConverter(d.converters.ByteString,d.converters.ByteString);r.exports={webidl:d}},49757:r=>{"use strict";function getEncoding(r){if(!r){return"failure"}switch(r.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}r.exports={getEncoding:getEncoding}},62414:(r,i,s)=>{"use strict";const{staticPropertyDescriptors:a,readOperation:l,fireAProgressEvent:c}=s(24992);const{kState:d,kError:p,kResult:u,kEvents:A,kAborted:h}=s(2326);const{webidl:g}=s(87591);const{kEnumerableProperty:y}=s(94766);class FileReader extends EventTarget{constructor(){super();this[d]="empty";this[u]=null;this[p]=null;this[A]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(r){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsArrayBuffer"});r=g.converters.Blob(r,{strict:false});l(this,r,"ArrayBuffer")}readAsBinaryString(r){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsBinaryString"});r=g.converters.Blob(r,{strict:false});l(this,r,"BinaryString")}readAsText(r,i=undefined){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsText"});r=g.converters.Blob(r,{strict:false});if(i!==undefined){i=g.converters.DOMString(i)}l(this,r,"Text",i)}readAsDataURL(r){g.brandCheck(this,FileReader);g.argumentLengthCheck(arguments,1,{header:"FileReader.readAsDataURL"});r=g.converters.Blob(r,{strict:false});l(this,r,"DataURL")}abort(){if(this[d]==="empty"||this[d]==="done"){this[u]=null;return}if(this[d]==="loading"){this[d]="done";this[u]=null}this[h]=true;c("abort",this);if(this[d]!=="loading"){c("loadend",this)}}get readyState(){g.brandCheck(this,FileReader);switch(this[d]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){g.brandCheck(this,FileReader);return this[u]}get error(){g.brandCheck(this,FileReader);return this[p]}get onloadend(){g.brandCheck(this,FileReader);return this[A].loadend}set onloadend(r){g.brandCheck(this,FileReader);if(this[A].loadend){this.removeEventListener("loadend",this[A].loadend)}if(typeof r==="function"){this[A].loadend=r;this.addEventListener("loadend",r)}else{this[A].loadend=null}}get onerror(){g.brandCheck(this,FileReader);return this[A].error}set onerror(r){g.brandCheck(this,FileReader);if(this[A].error){this.removeEventListener("error",this[A].error)}if(typeof r==="function"){this[A].error=r;this.addEventListener("error",r)}else{this[A].error=null}}get onloadstart(){g.brandCheck(this,FileReader);return this[A].loadstart}set onloadstart(r){g.brandCheck(this,FileReader);if(this[A].loadstart){this.removeEventListener("loadstart",this[A].loadstart)}if(typeof r==="function"){this[A].loadstart=r;this.addEventListener("loadstart",r)}else{this[A].loadstart=null}}get onprogress(){g.brandCheck(this,FileReader);return this[A].progress}set onprogress(r){g.brandCheck(this,FileReader);if(this[A].progress){this.removeEventListener("progress",this[A].progress)}if(typeof r==="function"){this[A].progress=r;this.addEventListener("progress",r)}else{this[A].progress=null}}get onload(){g.brandCheck(this,FileReader);return this[A].load}set onload(r){g.brandCheck(this,FileReader);if(this[A].load){this.removeEventListener("load",this[A].load)}if(typeof r==="function"){this[A].load=r;this.addEventListener("load",r)}else{this[A].load=null}}get onabort(){g.brandCheck(this,FileReader);return this[A].abort}set onabort(r){g.brandCheck(this,FileReader);if(this[A].abort){this.removeEventListener("abort",this[A].abort)}if(typeof r==="function"){this[A].abort=r;this.addEventListener("abort",r)}else{this[A].abort=null}}}FileReader.EMPTY=FileReader.prototype.EMPTY=0;FileReader.LOADING=FileReader.prototype.LOADING=1;FileReader.DONE=FileReader.prototype.DONE=2;Object.defineProperties(FileReader.prototype,{EMPTY:a,LOADING:a,DONE:a,readAsArrayBuffer:y,readAsBinaryString:y,readAsText:y,readAsDataURL:y,abort:y,readyState:y,result:y,error:y,onloadstart:y,onprogress:y,onload:y,onabort:y,onerror:y,onloadend:y,[Symbol.toStringTag]:{value:"FileReader",writable:false,enumerable:false,configurable:true}});Object.defineProperties(FileReader,{EMPTY:a,LOADING:a,DONE:a});r.exports={FileReader:FileReader}},96255:(r,i,s)=>{"use strict";const{webidl:a}=s(87591);const l=Symbol("ProgressEvent state");class ProgressEvent extends Event{constructor(r,i={}){r=a.converters.DOMString(r);i=a.converters.ProgressEventInit(i??{});super(r,i);this[l]={lengthComputable:i.lengthComputable,loaded:i.loaded,total:i.total}}get lengthComputable(){a.brandCheck(this,ProgressEvent);return this[l].lengthComputable}get loaded(){a.brandCheck(this,ProgressEvent);return this[l].loaded}get total(){a.brandCheck(this,ProgressEvent);return this[l].total}}a.converters.ProgressEventInit=a.dictionaryConverter([{key:"lengthComputable",converter:a.converters.boolean,defaultValue:false},{key:"loaded",converter:a.converters["unsigned long long"],defaultValue:0},{key:"total",converter:a.converters["unsigned long long"],defaultValue:0},{key:"bubbles",converter:a.converters.boolean,defaultValue:false},{key:"cancelable",converter:a.converters.boolean,defaultValue:false},{key:"composed",converter:a.converters.boolean,defaultValue:false}]);r.exports={ProgressEvent:ProgressEvent}},2326:r=>{"use strict";r.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}},24992:(r,i,s)=>{"use strict";const{kState:a,kError:l,kResult:c,kAborted:d,kLastProgressEventFired:p}=s(2326);const{ProgressEvent:u}=s(96255);const{getEncoding:A}=s(49757);const{DOMException:h}=s(67296);const{serializeAMimeType:g,parseMIMEType:y}=s(80097);const{types:b}=s(73837);const{StringDecoder:w}=s(71576);const{btoa:C}=s(14300);const v={enumerable:true,writable:false,configurable:false};function readOperation(r,i,s,u){if(r[a]==="loading"){throw new h("Invalid state","InvalidStateError")}r[a]="loading";r[c]=null;r[l]=null;const A=i.stream();const g=A.getReader();const y=[];let w=g.read();let C=true;(async()=>{while(!r[d]){try{const{done:A,value:h}=await w;if(C&&!r[d]){queueMicrotask((()=>{fireAProgressEvent("loadstart",r)}))}C=false;if(!A&&b.isUint8Array(h)){y.push(h);if((r[p]===undefined||Date.now()-r[p]>=50)&&!r[d]){r[p]=Date.now();queueMicrotask((()=>{fireAProgressEvent("progress",r)}))}w=g.read()}else if(A){queueMicrotask((()=>{r[a]="done";try{const a=packageData(y,s,i.type,u);if(r[d]){return}r[c]=a;fireAProgressEvent("load",r)}catch(i){r[l]=i;fireAProgressEvent("error",r)}if(r[a]!=="loading"){fireAProgressEvent("loadend",r)}}));break}}catch(i){if(r[d]){return}queueMicrotask((()=>{r[a]="done";r[l]=i;fireAProgressEvent("error",r);if(r[a]!=="loading"){fireAProgressEvent("loadend",r)}}));break}}})()}function fireAProgressEvent(r,i){const s=new u(r,{bubbles:false,cancelable:false});i.dispatchEvent(s)}function packageData(r,i,s,a){switch(i){case"DataURL":{let i="data:";const a=y(s||"application/octet-stream");if(a!=="failure"){i+=g(a)}i+=";base64,";const l=new w("latin1");for(const s of r){i+=C(l.write(s))}i+=C(l.end());return i}case"Text":{let i="failure";if(a){i=A(a)}if(i==="failure"&&s){const r=y(s);if(r!=="failure"){i=A(r.parameters.get("charset"))}}if(i==="failure"){i="UTF-8"}return decode(r,i)}case"ArrayBuffer":{const i=combineByteSequences(r);return i.buffer}case"BinaryString":{let i="";const s=new w("latin1");for(const a of r){i+=s.write(a)}i+=s.end();return i}}}function decode(r,i){const s=combineByteSequences(r);const a=BOMSniffing(s);let l=0;if(a!==null){i=a;l=a==="UTF-8"?3:2}const c=s.slice(l);return new TextDecoder(i).decode(c)}function BOMSniffing(r){const[i,s,a]=r;if(i===239&&s===187&&a===191){return"UTF-8"}else if(i===254&&s===255){return"UTF-16BE"}else if(i===255&&s===254){return"UTF-16LE"}return null}function combineByteSequences(r){const i=r.reduce(((r,i)=>r+i.byteLength),0);let s=0;return r.reduce(((r,i)=>{r.set(i,s);s+=i.byteLength;return r}),new Uint8Array(i))}r.exports={staticPropertyDescriptors:v,readOperation:readOperation,fireAProgressEvent:fireAProgressEvent}},18826:(r,i,s)=>{"use strict";const a=Symbol.for("undici.globalDispatcher.1");const{InvalidArgumentError:l}=s(76291);const c=s(72916);if(getGlobalDispatcher()===undefined){setGlobalDispatcher(new c)}function setGlobalDispatcher(r){if(!r||typeof r.dispatch!=="function"){throw new l("Argument agent must implement Agent")}Object.defineProperty(globalThis,a,{value:r,writable:true,enumerable:false,configurable:false})}function getGlobalDispatcher(){return globalThis[a]}r.exports={setGlobalDispatcher:setGlobalDispatcher,getGlobalDispatcher:getGlobalDispatcher}},96474:r=>{"use strict";r.exports=class DecoratorHandler{constructor(r){this.handler=r}onConnect(...r){return this.handler.onConnect(...r)}onError(...r){return this.handler.onError(...r)}onUpgrade(...r){return this.handler.onUpgrade(...r)}onHeaders(...r){return this.handler.onHeaders(...r)}onData(...r){return this.handler.onData(...r)}onComplete(...r){return this.handler.onComplete(...r)}onBodySent(...r){return this.handler.onBodySent(...r)}}},81465:(r,i,s)=>{"use strict";const a=s(94766);const{kBodyUsed:l}=s(31915);const c=s(39491);const{InvalidArgumentError:d}=s(76291);const p=s(82361);const u=[300,301,302,303,307,308];const A=Symbol("body");class BodyAsyncIterable{constructor(r){this[A]=r;this[l]=false}async*[Symbol.asyncIterator](){c(!this[l],"disturbed");this[l]=true;yield*this[A]}}class RedirectHandler{constructor(r,i,s,u){if(i!=null&&(!Number.isInteger(i)||i<0)){throw new d("maxRedirections must be a positive number")}a.validateHandler(u,s.method,s.upgrade);this.dispatch=r;this.location=null;this.abort=null;this.opts={...s,maxRedirections:0};this.maxRedirections=i;this.handler=u;this.history=[];if(a.isStream(this.opts.body)){if(a.bodyLength(this.opts.body)===0){this.opts.body.on("data",(function(){c(false)}))}if(typeof this.opts.body.readableDidRead!=="boolean"){this.opts.body[l]=false;p.prototype.on.call(this.opts.body,"data",(function(){this[l]=true}))}}else if(this.opts.body&&typeof this.opts.body.pipeTo==="function"){this.opts.body=new BodyAsyncIterable(this.opts.body)}else if(this.opts.body&&typeof this.opts.body!=="string"&&!ArrayBuffer.isView(this.opts.body)&&a.isIterable(this.opts.body)){this.opts.body=new BodyAsyncIterable(this.opts.body)}}onConnect(r){this.abort=r;this.handler.onConnect(r,{history:this.history})}onUpgrade(r,i,s){this.handler.onUpgrade(r,i,s)}onError(r){this.handler.onError(r)}onHeaders(r,i,s,l){this.location=this.history.length>=this.maxRedirections||a.isDisturbed(this.opts.body)?null:parseLocation(r,i);if(this.opts.origin){this.history.push(new URL(this.opts.path,this.opts.origin))}if(!this.location){return this.handler.onHeaders(r,i,s,l)}const{origin:c,pathname:d,search:p}=a.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin)));const u=p?`${d}${p}`:d;this.opts.headers=cleanRequestHeaders(this.opts.headers,r===303,this.opts.origin!==c);this.opts.path=u;this.opts.origin=c;this.opts.maxRedirections=0;this.opts.query=null;if(r===303&&this.opts.method!=="HEAD"){this.opts.method="GET";this.opts.body=null}}onData(r){if(this.location){}else{return this.handler.onData(r)}}onComplete(r){if(this.location){this.location=null;this.abort=null;this.dispatch(this.opts,this)}else{this.handler.onComplete(r)}}onBodySent(r){if(this.handler.onBodySent){this.handler.onBodySent(r)}}}function parseLocation(r,i){if(u.indexOf(r)===-1){return null}for(let r=0;r{const a=s(39491);const{kRetryHandlerDefaultRetry:l}=s(31915);const{RequestRetryError:c}=s(76291);const{isDisturbed:d,parseHeaders:p,parseRangeHeader:u}=s(94766);function calculateRetryAfterHeader(r){const i=Date.now();const s=new Date(r).getTime()-i;return s}class RetryHandler{constructor(r,i){const{retryOptions:s,...a}=r;const{retry:c,maxRetries:d,maxTimeout:p,minTimeout:u,timeoutFactor:A,methods:h,errorCodes:g,retryAfter:y,statusCodes:b}=s??{};this.dispatch=i.dispatch;this.handler=i.handler;this.opts=a;this.abort=null;this.aborted=false;this.retryOpts={retry:c??RetryHandler[l],retryAfter:y??true,maxTimeout:p??30*1e3,timeout:u??500,timeoutFactor:A??2,maxRetries:d??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:b??[500,502,503,504,429],errorCodes:g??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]};this.retryCount=0;this.start=0;this.end=null;this.etag=null;this.resume=null;this.handler.onConnect((r=>{this.aborted=true;if(this.abort){this.abort(r)}else{this.reason=r}}))}onRequestSent(){if(this.handler.onRequestSent){this.handler.onRequestSent()}}onUpgrade(r,i,s){if(this.handler.onUpgrade){this.handler.onUpgrade(r,i,s)}}onConnect(r){if(this.aborted){r(this.reason)}else{this.abort=r}}onBodySent(r){if(this.handler.onBodySent)return this.handler.onBodySent(r)}static[l](r,{state:i,opts:s},a){const{statusCode:l,code:c,headers:d}=r;const{method:p,retryOptions:u}=s;const{maxRetries:A,timeout:h,maxTimeout:g,timeoutFactor:y,statusCodes:b,errorCodes:w,methods:C}=u;let{counter:v,currentTimeout:I}=i;I=I!=null&&I>0?I:h;if(c&&c!=="UND_ERR_REQ_RETRY"&&c!=="UND_ERR_SOCKET"&&!w.includes(c)){a(r);return}if(Array.isArray(C)&&!C.includes(p)){a(r);return}if(l!=null&&Array.isArray(b)&&!b.includes(l)){a(r);return}if(v>A){a(r);return}let B=d!=null&&d["retry-after"];if(B){B=Number(B);B=isNaN(B)?calculateRetryAfterHeader(B):B*1e3}const S=B>0?Math.min(B,g):Math.min(I*y**v,g);i.currentTimeout=S;setTimeout((()=>a(null)),S)}onHeaders(r,i,s,l){const d=p(i);this.retryCount+=1;if(r>=300){this.abort(new c("Request failed",r,{headers:d,count:this.retryCount}));return false}if(this.resume!=null){this.resume=null;if(r!==206){return true}const i=u(d["content-range"]);if(!i){this.abort(new c("Content-Range mismatch",r,{headers:d,count:this.retryCount}));return false}if(this.etag!=null&&this.etag!==d.etag){this.abort(new c("ETag mismatch",r,{headers:d,count:this.retryCount}));return false}const{start:l,size:p,end:A=p}=i;a(this.start===l,"content-range mismatch");a(this.end==null||this.end===A,"content-range mismatch");this.resume=s;return true}if(this.end==null){if(r===206){const c=u(d["content-range"]);if(c==null){return this.handler.onHeaders(r,i,s,l)}const{start:p,size:A,end:h=A}=c;a(p!=null&&Number.isFinite(p)&&this.start!==p,"content-range mismatch");a(Number.isFinite(p));a(h!=null&&Number.isFinite(h)&&this.end!==h,"invalid content-length");this.start=p;this.end=h}if(this.end==null){const r=d["content-length"];this.end=r!=null?Number(r):null}a(Number.isFinite(this.start));a(this.end==null||Number.isFinite(this.end),"invalid content-length");this.resume=s;this.etag=d.etag!=null?d.etag:null;return this.handler.onHeaders(r,i,s,l)}const A=new c("Request failed",r,{headers:d,count:this.retryCount});this.abort(A);return false}onData(r){this.start+=r.length;return this.handler.onData(r)}onComplete(r){this.retryCount=0;return this.handler.onComplete(r)}onError(r){if(this.aborted||d(this.opts.body)){return this.handler.onError(r)}this.retryOpts.retry(r,{state:{counter:this.retryCount++,currentTimeout:this.retryAfter},opts:{retryOptions:this.retryOpts,...this.opts}},onRetry.bind(this));function onRetry(r){if(r!=null||this.aborted||d(this.opts.body)){return this.handler.onError(r)}if(this.start!==0){this.opts={...this.opts,headers:{...this.opts.headers,range:`bytes=${this.start}-${this.end??""}`}}}try{this.dispatch(this.opts,this)}catch(r){this.handler.onError(r)}}}}r.exports=RetryHandler},76459:(r,i,s)=>{"use strict";const a=s(81465);function createRedirectInterceptor({maxRedirections:r}){return i=>function Intercept(s,l){const{maxRedirections:c=r}=s;if(!c){return i(s,l)}const d=new a(i,c,s,l);s={...s,maxRedirections:0};return i(s,d)}}r.exports=createRedirectInterceptor},83993:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.SPECIAL_HEADERS=i.HEADER_STATE=i.MINOR=i.MAJOR=i.CONNECTION_TOKEN_CHARS=i.HEADER_CHARS=i.TOKEN=i.STRICT_TOKEN=i.HEX=i.URL_CHAR=i.STRICT_URL_CHAR=i.USERINFO_CHARS=i.MARK=i.ALPHANUM=i.NUM=i.HEX_MAP=i.NUM_MAP=i.ALPHA=i.FINISH=i.H_METHOD_MAP=i.METHOD_MAP=i.METHODS_RTSP=i.METHODS_ICE=i.METHODS_HTTP=i.METHODS=i.LENIENT_FLAGS=i.FLAGS=i.TYPE=i.ERROR=void 0;const a=s(18994);var l;(function(r){r[r["OK"]=0]="OK";r[r["INTERNAL"]=1]="INTERNAL";r[r["STRICT"]=2]="STRICT";r[r["LF_EXPECTED"]=3]="LF_EXPECTED";r[r["UNEXPECTED_CONTENT_LENGTH"]=4]="UNEXPECTED_CONTENT_LENGTH";r[r["CLOSED_CONNECTION"]=5]="CLOSED_CONNECTION";r[r["INVALID_METHOD"]=6]="INVALID_METHOD";r[r["INVALID_URL"]=7]="INVALID_URL";r[r["INVALID_CONSTANT"]=8]="INVALID_CONSTANT";r[r["INVALID_VERSION"]=9]="INVALID_VERSION";r[r["INVALID_HEADER_TOKEN"]=10]="INVALID_HEADER_TOKEN";r[r["INVALID_CONTENT_LENGTH"]=11]="INVALID_CONTENT_LENGTH";r[r["INVALID_CHUNK_SIZE"]=12]="INVALID_CHUNK_SIZE";r[r["INVALID_STATUS"]=13]="INVALID_STATUS";r[r["INVALID_EOF_STATE"]=14]="INVALID_EOF_STATE";r[r["INVALID_TRANSFER_ENCODING"]=15]="INVALID_TRANSFER_ENCODING";r[r["CB_MESSAGE_BEGIN"]=16]="CB_MESSAGE_BEGIN";r[r["CB_HEADERS_COMPLETE"]=17]="CB_HEADERS_COMPLETE";r[r["CB_MESSAGE_COMPLETE"]=18]="CB_MESSAGE_COMPLETE";r[r["CB_CHUNK_HEADER"]=19]="CB_CHUNK_HEADER";r[r["CB_CHUNK_COMPLETE"]=20]="CB_CHUNK_COMPLETE";r[r["PAUSED"]=21]="PAUSED";r[r["PAUSED_UPGRADE"]=22]="PAUSED_UPGRADE";r[r["PAUSED_H2_UPGRADE"]=23]="PAUSED_H2_UPGRADE";r[r["USER"]=24]="USER"})(l=i.ERROR||(i.ERROR={}));var c;(function(r){r[r["BOTH"]=0]="BOTH";r[r["REQUEST"]=1]="REQUEST";r[r["RESPONSE"]=2]="RESPONSE"})(c=i.TYPE||(i.TYPE={}));var d;(function(r){r[r["CONNECTION_KEEP_ALIVE"]=1]="CONNECTION_KEEP_ALIVE";r[r["CONNECTION_CLOSE"]=2]="CONNECTION_CLOSE";r[r["CONNECTION_UPGRADE"]=4]="CONNECTION_UPGRADE";r[r["CHUNKED"]=8]="CHUNKED";r[r["UPGRADE"]=16]="UPGRADE";r[r["CONTENT_LENGTH"]=32]="CONTENT_LENGTH";r[r["SKIPBODY"]=64]="SKIPBODY";r[r["TRAILING"]=128]="TRAILING";r[r["TRANSFER_ENCODING"]=512]="TRANSFER_ENCODING"})(d=i.FLAGS||(i.FLAGS={}));var p;(function(r){r[r["HEADERS"]=1]="HEADERS";r[r["CHUNKED_LENGTH"]=2]="CHUNKED_LENGTH";r[r["KEEP_ALIVE"]=4]="KEEP_ALIVE"})(p=i.LENIENT_FLAGS||(i.LENIENT_FLAGS={}));var u;(function(r){r[r["DELETE"]=0]="DELETE";r[r["GET"]=1]="GET";r[r["HEAD"]=2]="HEAD";r[r["POST"]=3]="POST";r[r["PUT"]=4]="PUT";r[r["CONNECT"]=5]="CONNECT";r[r["OPTIONS"]=6]="OPTIONS";r[r["TRACE"]=7]="TRACE";r[r["COPY"]=8]="COPY";r[r["LOCK"]=9]="LOCK";r[r["MKCOL"]=10]="MKCOL";r[r["MOVE"]=11]="MOVE";r[r["PROPFIND"]=12]="PROPFIND";r[r["PROPPATCH"]=13]="PROPPATCH";r[r["SEARCH"]=14]="SEARCH";r[r["UNLOCK"]=15]="UNLOCK";r[r["BIND"]=16]="BIND";r[r["REBIND"]=17]="REBIND";r[r["UNBIND"]=18]="UNBIND";r[r["ACL"]=19]="ACL";r[r["REPORT"]=20]="REPORT";r[r["MKACTIVITY"]=21]="MKACTIVITY";r[r["CHECKOUT"]=22]="CHECKOUT";r[r["MERGE"]=23]="MERGE";r[r["M-SEARCH"]=24]="M-SEARCH";r[r["NOTIFY"]=25]="NOTIFY";r[r["SUBSCRIBE"]=26]="SUBSCRIBE";r[r["UNSUBSCRIBE"]=27]="UNSUBSCRIBE";r[r["PATCH"]=28]="PATCH";r[r["PURGE"]=29]="PURGE";r[r["MKCALENDAR"]=30]="MKCALENDAR";r[r["LINK"]=31]="LINK";r[r["UNLINK"]=32]="UNLINK";r[r["SOURCE"]=33]="SOURCE";r[r["PRI"]=34]="PRI";r[r["DESCRIBE"]=35]="DESCRIBE";r[r["ANNOUNCE"]=36]="ANNOUNCE";r[r["SETUP"]=37]="SETUP";r[r["PLAY"]=38]="PLAY";r[r["PAUSE"]=39]="PAUSE";r[r["TEARDOWN"]=40]="TEARDOWN";r[r["GET_PARAMETER"]=41]="GET_PARAMETER";r[r["SET_PARAMETER"]=42]="SET_PARAMETER";r[r["REDIRECT"]=43]="REDIRECT";r[r["RECORD"]=44]="RECORD";r[r["FLUSH"]=45]="FLUSH"})(u=i.METHODS||(i.METHODS={}));i.METHODS_HTTP=[u.DELETE,u.GET,u.HEAD,u.POST,u.PUT,u.CONNECT,u.OPTIONS,u.TRACE,u.COPY,u.LOCK,u.MKCOL,u.MOVE,u.PROPFIND,u.PROPPATCH,u.SEARCH,u.UNLOCK,u.BIND,u.REBIND,u.UNBIND,u.ACL,u.REPORT,u.MKACTIVITY,u.CHECKOUT,u.MERGE,u["M-SEARCH"],u.NOTIFY,u.SUBSCRIBE,u.UNSUBSCRIBE,u.PATCH,u.PURGE,u.MKCALENDAR,u.LINK,u.UNLINK,u.PRI,u.SOURCE];i.METHODS_ICE=[u.SOURCE];i.METHODS_RTSP=[u.OPTIONS,u.DESCRIBE,u.ANNOUNCE,u.SETUP,u.PLAY,u.PAUSE,u.TEARDOWN,u.GET_PARAMETER,u.SET_PARAMETER,u.REDIRECT,u.RECORD,u.FLUSH,u.GET,u.POST];i.METHOD_MAP=a.enumToMap(u);i.H_METHOD_MAP={};Object.keys(i.METHOD_MAP).forEach((r=>{if(/^H/.test(r)){i.H_METHOD_MAP[r]=i.METHOD_MAP[r]}}));var A;(function(r){r[r["SAFE"]=0]="SAFE";r[r["SAFE_WITH_CB"]=1]="SAFE_WITH_CB";r[r["UNSAFE"]=2]="UNSAFE"})(A=i.FINISH||(i.FINISH={}));i.ALPHA=[];for(let r="A".charCodeAt(0);r<="Z".charCodeAt(0);r++){i.ALPHA.push(String.fromCharCode(r));i.ALPHA.push(String.fromCharCode(r+32))}i.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};i.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};i.NUM=["0","1","2","3","4","5","6","7","8","9"];i.ALPHANUM=i.ALPHA.concat(i.NUM);i.MARK=["-","_",".","!","~","*","'","(",")"];i.USERINFO_CHARS=i.ALPHANUM.concat(i.MARK).concat(["%",";",":","&","=","+","$",","]);i.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(i.ALPHANUM);i.URL_CHAR=i.STRICT_URL_CHAR.concat(["\t","\f"]);for(let r=128;r<=255;r++){i.URL_CHAR.push(r)}i.HEX=i.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);i.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(i.ALPHANUM);i.TOKEN=i.STRICT_TOKEN.concat([" "]);i.HEADER_CHARS=["\t"];for(let r=32;r<=255;r++){if(r!==127){i.HEADER_CHARS.push(r)}}i.CONNECTION_TOKEN_CHARS=i.HEADER_CHARS.filter((r=>r!==44));i.MAJOR=i.NUM_MAP;i.MINOR=i.MAJOR;var h;(function(r){r[r["GENERAL"]=0]="GENERAL";r[r["CONNECTION"]=1]="CONNECTION";r[r["CONTENT_LENGTH"]=2]="CONTENT_LENGTH";r[r["TRANSFER_ENCODING"]=3]="TRANSFER_ENCODING";r[r["UPGRADE"]=4]="UPGRADE";r[r["CONNECTION_KEEP_ALIVE"]=5]="CONNECTION_KEEP_ALIVE";r[r["CONNECTION_CLOSE"]=6]="CONNECTION_CLOSE";r[r["CONNECTION_UPGRADE"]=7]="CONNECTION_UPGRADE";r[r["TRANSFER_ENCODING_CHUNKED"]=8]="TRANSFER_ENCODING_CHUNKED"})(h=i.HEADER_STATE||(i.HEADER_STATE={}));i.SPECIAL_HEADERS={connection:h.CONNECTION,"content-length":h.CONTENT_LENGTH,"proxy-connection":h.CONNECTION,"transfer-encoding":h.TRANSFER_ENCODING,upgrade:h.UPGRADE}},29702:r=>{r.exports="AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwHLAcoBuAHJAbkByAG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAQDcAQtBACEQDMYBC0EOIRAMxQELQQ0hEAzEAQtBDyEQDMMBC0EQIRAMwgELQRMhEAzBAQtBFCEQDMABC0EVIRAMvwELQRYhEAy+AQtBFyEQDL0BC0EYIRAMvAELQRkhEAy7AQtBGiEQDLoBC0EbIRAMuQELQRwhEAy4AQtBCCEQDLcBC0EdIRAMtgELQSAhEAy1AQtBHyEQDLQBC0EHIRAMswELQSEhEAyyAQtBIiEQDLEBC0EeIRAMsAELQSMhEAyvAQtBEiEQDK4BC0ERIRAMrQELQSQhEAysAQtBJSEQDKsBC0EmIRAMqgELQSchEAypAQtBwwEhEAyoAQtBKSEQDKcBC0ErIRAMpgELQSwhEAylAQtBLSEQDKQBC0EuIRAMowELQS8hEAyiAQtBxAEhEAyhAQtBMCEQDKABC0E0IRAMnwELQQwhEAyeAQtBMSEQDJ0BC0EyIRAMnAELQTMhEAybAQtBOSEQDJoBC0E1IRAMmQELQcUBIRAMmAELQQshEAyXAQtBOiEQDJYBC0E2IRAMlQELQQohEAyUAQtBNyEQDJMBC0E4IRAMkgELQTwhEAyRAQtBOyEQDJABC0E9IRAMjwELQQkhEAyOAQtBKCEQDI0BC0E+IRAMjAELQT8hEAyLAQtBwAAhEAyKAQtBwQAhEAyJAQtBwgAhEAyIAQtBwwAhEAyHAQtBxAAhEAyGAQtBxQAhEAyFAQtBxgAhEAyEAQtBKiEQDIMBC0HHACEQDIIBC0HIACEQDIEBC0HJACEQDIABC0HKACEQDH8LQcsAIRAMfgtBzQAhEAx9C0HMACEQDHwLQc4AIRAMewtBzwAhEAx6C0HQACEQDHkLQdEAIRAMeAtB0gAhEAx3C0HTACEQDHYLQdQAIRAMdQtB1gAhEAx0C0HVACEQDHMLQQYhEAxyC0HXACEQDHELQQUhEAxwC0HYACEQDG8LQQQhEAxuC0HZACEQDG0LQdoAIRAMbAtB2wAhEAxrC0HcACEQDGoLQQMhEAxpC0HdACEQDGgLQd4AIRAMZwtB3wAhEAxmC0HhACEQDGULQeAAIRAMZAtB4gAhEAxjC0HjACEQDGILQQIhEAxhC0HkACEQDGALQeUAIRAMXwtB5gAhEAxeC0HnACEQDF0LQegAIRAMXAtB6QAhEAxbC0HqACEQDFoLQesAIRAMWQtB7AAhEAxYC0HtACEQDFcLQe4AIRAMVgtB7wAhEAxVC0HwACEQDFQLQfEAIRAMUwtB8gAhEAxSC0HzACEQDFELQfQAIRAMUAtB9QAhEAxPC0H2ACEQDE4LQfcAIRAMTQtB+AAhEAxMC0H5ACEQDEsLQfoAIRAMSgtB+wAhEAxJC0H8ACEQDEgLQf0AIRAMRwtB/gAhEAxGC0H/ACEQDEULQYABIRAMRAtBgQEhEAxDC0GCASEQDEILQYMBIRAMQQtBhAEhEAxAC0GFASEQDD8LQYYBIRAMPgtBhwEhEAw9C0GIASEQDDwLQYkBIRAMOwtBigEhEAw6C0GLASEQDDkLQYwBIRAMOAtBjQEhEAw3C0GOASEQDDYLQY8BIRAMNQtBkAEhEAw0C0GRASEQDDMLQZIBIRAMMgtBkwEhEAwxC0GUASEQDDALQZUBIRAMLwtBlgEhEAwuC0GXASEQDC0LQZgBIRAMLAtBmQEhEAwrC0GaASEQDCoLQZsBIRAMKQtBnAEhEAwoC0GdASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAEiBCACRw3zAUHdASEQDP8DCyABIhAgAkcN3QFBwwEhEAz+AwsgASIBIAJHDZABQfcAIRAM/QMLIAEiASACRw2GAUHvACEQDPwDCyABIgEgAkcNf0HqACEQDPsDCyABIgEgAkcNe0HoACEQDPoDCyABIgEgAkcNeEHmACEQDPkDCyABIgEgAkcNGkEYIRAM+AMLIAEiASACRw0UQRIhEAz3AwsgASIBIAJHDVlBxQAhEAz2AwsgASIBIAJHDUpBPyEQDPUDCyABIgEgAkcNSEE8IRAM9AMLIAEiASACRw1BQTEhEAzzAwsgAC0ALkEBRg3rAwyHAgsgACABIgEgAhDAgICAAEEBRw3mASAAQgA3AyAM5wELIAAgASIBIAIQtICAgAAiEA3nASABIQEM9QILAkAgASIBIAJHDQBBBiEQDPADCyAAIAFBAWoiASACELuAgIAAIhAN6AEgASEBDDELIABCADcDIEESIRAM1QMLIAEiECACRw0rQR0hEAztAwsCQCABIgEgAkYNACABQQFqIQFBECEQDNQDC0EHIRAM7AMLIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN5QFBCCEQDOsDCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEUIRAM0gMLQQkhEAzqAwsgASEBIAApAyBQDeQBIAEhAQzyAgsCQCABIgEgAkcNAEELIRAM6QMLIAAgAUEBaiIBIAIQtoCAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3mASABIQEMDQsgACABIgEgAhC6gICAACIQDecBIAEhAQzwAgsCQCABIgEgAkcNAEEPIRAM5QMLIAEtAAAiEEE7Rg0IIBBBDUcN6AEgAUEBaiEBDO8CCyAAIAEiASACELqAgIAAIhAN6AEgASEBDPICCwNAAkAgAS0AAEHwtYCAAGotAAAiEEEBRg0AIBBBAkcN6wEgACgCBCEQIABBADYCBCAAIBAgAUEBaiIBELmAgIAAIhAN6gEgASEBDPQCCyABQQFqIgEgAkcNAAtBEiEQDOIDCyAAIAEiASACELqAgIAAIhAN6QEgASEBDAoLIAEiASACRw0GQRshEAzgAwsCQCABIgEgAkcNAEEWIRAM4AMLIABBioCAgAA2AgggACABNgIEIAAgASACELiAgIAAIhAN6gEgASEBQSAhEAzGAwsCQCABIgEgAkYNAANAAkAgAS0AAEHwt4CAAGotAAAiEEECRg0AAkAgEEF/ag4E5QHsAQDrAewBCyABQQFqIQFBCCEQDMgDCyABQQFqIgEgAkcNAAtBFSEQDN8DC0EVIRAM3gMLA0ACQCABLQAAQfC5gIAAai0AACIQQQJGDQAgEEF/ag4E3gHsAeAB6wHsAQsgAUEBaiIBIAJHDQALQRghEAzdAwsCQCABIgEgAkYNACAAQYuAgIAANgIIIAAgATYCBCABIQFBByEQDMQDC0EZIRAM3AMLIAFBAWohAQwCCwJAIAEiFCACRw0AQRohEAzbAwsgFCEBAkAgFC0AAEFzag4U3QLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gIA7gILQQAhECAAQQA2AhwgAEGvi4CAADYCECAAQQI2AgwgACAUQQFqNgIUDNoDCwJAIAEtAAAiEEE7Rg0AIBBBDUcN6AEgAUEBaiEBDOUCCyABQQFqIQELQSIhEAy/AwsCQCABIhAgAkcNAEEcIRAM2AMLQgAhESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUEJRg0AIAFBIEcN1QELIAAtACxBCEYN0wEgECEBDJEDCwJAIAEiASACRw0AQSwhEAy0AwsgAS0AAEEKRw3VASABQQFqIQEMyQILIAEiDiACRw3VAUEvIRAMsgMLA0ACQCABLQAAIhBBIEYNAAJAIBBBdmoOBADcAdwBANoBCyABIQEM4AELIAFBAWoiASACRw0AC0ExIRAMsQMLQTIhECABIhQgAkYNsAMgAiAUayAAKAIAIgFqIRUgFCABa0EDaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfC7gIAAai0AAEcNAQJAIAFBA0cNAEEGIQEMlgMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLEDCyAAQQA2AgAgFCEBDNkBC0EzIRAgASIUIAJGDa8DIAIgFGsgACgCACIBaiEVIBQgAWtBCGohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUH0u4CAAGotAABHDQECQCABQQhHDQBBBSEBDJUDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAywAwsgAEEANgIAIBQhAQzYAQtBNCEQIAEiFCACRg2uAyACIBRrIAAoAgAiAWohFSAUIAFrQQVqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw0BAkAgAUEFRw0AQQchAQyUAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMrwMLIABBADYCACAUIQEM1wELAkAgASIBIAJGDQADQAJAIAEtAABBgL6AgABqLQAAIhBBAUYNACAQQQJGDQogASEBDN0BCyABQQFqIgEgAkcNAAtBMCEQDK4DC0EwIRAMrQMLAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AIBBBdmoOBNkB2gHaAdkB2gELIAFBAWoiASACRw0AC0E4IRAMrQMLQTghEAysAwsDQAJAIAEtAAAiEEEgRg0AIBBBCUcNAwsgAUEBaiIBIAJHDQALQTwhEAyrAwsDQAJAIAEtAAAiEEEgRg0AAkACQCAQQXZqDgTaAQEB2gEACyAQQSxGDdsBCyABIQEMBAsgAUEBaiIBIAJHDQALQT8hEAyqAwsgASEBDNsBC0HAACEQIAEiFCACRg2oAyACIBRrIAAoAgAiAWohFiAUIAFrQQZqIRcCQANAIBQtAABBIHIgAUGAwICAAGotAABHDQEgAUEGRg2OAyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAypAwsgAEEANgIAIBQhAQtBNiEQDI4DCwJAIAEiDyACRw0AQcEAIRAMpwMLIABBjICAgAA2AgggACAPNgIEIA8hASAALQAsQX9qDgTNAdUB1wHZAYcDCyABQQFqIQEMzAELAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgciAQIBBBv39qQf8BcUEaSRtB/wFxIhBBCUYNACAQQSBGDQACQAJAAkACQCAQQZ1/ag4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIRAMkQMLIAFBAWohAUEyIRAMkAMLIAFBAWohAUEzIRAMjwMLIAEhAQzQAQsgAUEBaiIBIAJHDQALQTUhEAylAwtBNSEQDKQDCwJAIAEiASACRg0AA0ACQCABLQAAQYC8gIAAai0AAEEBRg0AIAEhAQzTAQsgAUEBaiIBIAJHDQALQT0hEAykAwtBPSEQDKMDCyAAIAEiASACELCAgIAAIhAN1gEgASEBDAELIBBBAWohAQtBPCEQDIcDCwJAIAEiASACRw0AQcIAIRAMoAMLAkADQAJAIAEtAABBd2oOGAAC/gL+AoQD/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4CAP4CCyABQQFqIgEgAkcNAAtBwgAhEAygAwsgAUEBaiEBIAAtAC1BAXFFDb0BIAEhAQtBLCEQDIUDCyABIgEgAkcN0wFBxAAhEAydAwsDQAJAIAEtAABBkMCAgABqLQAAQQFGDQAgASEBDLcCCyABQQFqIgEgAkcNAAtBxQAhEAycAwsgDS0AACIQQSBGDbMBIBBBOkcNgQMgACgCBCEBIABBADYCBCAAIAEgDRCvgICAACIBDdABIA1BAWohAQyzAgtBxwAhECABIg0gAkYNmgMgAiANayAAKAIAIgFqIRYgDSABa0EFaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGQwoCAAGotAABHDYADIAFBBUYN9AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmgMLQcgAIRAgASINIAJGDZkDIAIgDWsgACgCACIBaiEWIA0gAWtBCWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBlsKAgABqLQAARw3/AgJAIAFBCUcNAEECIQEM9QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJkDCwJAIAEiDSACRw0AQckAIRAMmQMLAkACQCANLQAAIgFBIHIgASABQb9/akH/AXFBGkkbQf8BcUGSf2oOBwCAA4ADgAOAA4ADAYADCyANQQFqIQFBPiEQDIADCyANQQFqIQFBPyEQDP8CC0HKACEQIAEiDSACRg2XAyACIA1rIAAoAgAiAWohFiANIAFrQQFqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaDCgIAAai0AAEcN/QIgAUEBRg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyXAwtBywAhECABIg0gAkYNlgMgAiANayAAKAIAIgFqIRYgDSABa0EOaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGiwoCAAGotAABHDfwCIAFBDkYN8AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlgMLQcwAIRAgASINIAJGDZUDIAIgDWsgACgCACIBaiEWIA0gAWtBD2ohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBwMKAgABqLQAARw37AgJAIAFBD0cNAEEDIQEM8QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJUDC0HNACEQIAEiDSACRg2UAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQdDCgIAAai0AAEcN+gICQCABQQVHDQBBBCEBDPACCyABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyUAwsCQCABIg0gAkcNAEHOACEQDJQDCwJAAkACQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZ1/ag4TAP0C/QL9Av0C/QL9Av0C/QL9Av0C/QL9AgH9Av0C/QICA/0CCyANQQFqIQFBwQAhEAz9AgsgDUEBaiEBQcIAIRAM/AILIA1BAWohAUHDACEQDPsCCyANQQFqIQFBxAAhEAz6AgsCQCABIgEgAkYNACAAQY2AgIAANgIIIAAgATYCBCABIQFBxQAhEAz6AgtBzwAhEAySAwsgECEBAkACQCAQLQAAQXZqDgQBqAKoAgCoAgsgEEEBaiEBC0EnIRAM+AILAkAgASIBIAJHDQBB0QAhEAyRAwsCQCABLQAAQSBGDQAgASEBDI0BCyABQQFqIQEgAC0ALUEBcUUNxwEgASEBDIwBCyABIhcgAkcNyAFB0gAhEAyPAwtB0wAhECABIhQgAkYNjgMgAiAUayAAKAIAIgFqIRYgFCABa0EBaiEXA0AgFC0AACABQdbCgIAAai0AAEcNzAEgAUEBRg3HASABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAyOAwsCQCABIgEgAkcNAEHVACEQDI4DCyABLQAAQQpHDcwBIAFBAWohAQzHAQsCQCABIgEgAkcNAEHWACEQDI0DCwJAAkAgAS0AAEF2ag4EAM0BzQEBzQELIAFBAWohAQzHAQsgAUEBaiEBQcoAIRAM8wILIAAgASIBIAIQroCAgAAiEA3LASABIQFBzQAhEAzyAgsgAC0AKUEiRg2FAwymAgsCQCABIgEgAkcNAEHbACEQDIoDC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgAS0AAEFQag4K1AHTAQABAgMEBQYI1QELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMzAELQQkhEEEBIRRBACEXQQAhFgzLAQsCQCABIgEgAkcNAEHdACEQDIkDCyABLQAAQS5HDcwBIAFBAWohAQymAgsgASIBIAJHDcwBQd8AIRAMhwMLAkAgASIBIAJGDQAgAEGOgICAADYCCCAAIAE2AgQgASEBQdAAIRAM7gILQeAAIRAMhgMLQeEAIRAgASIBIAJGDYUDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHiwoCAAGotAABHDc0BIBRBA0YNzAEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhQMLQeIAIRAgASIBIAJGDYQDIAIgAWsgACgCACIUaiEWIAEgFGtBAmohFwNAIAEtAAAgFEHmwoCAAGotAABHDcwBIBRBAkYNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhAMLQeMAIRAgASIBIAJGDYMDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHpwoCAAGotAABHDcsBIBRBA0YNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMgwMLAkAgASIBIAJHDQBB5QAhEAyDAwsgACABQQFqIgEgAhCogICAACIQDc0BIAEhAUHWACEQDOkCCwJAIAEiASACRg0AA0ACQCABLQAAIhBBIEYNAAJAAkACQCAQQbh/ag4LAAHPAc8BzwHPAc8BzwHPAc8BAs8BCyABQQFqIQFB0gAhEAztAgsgAUEBaiEBQdMAIRAM7AILIAFBAWohAUHUACEQDOsCCyABQQFqIgEgAkcNAAtB5AAhEAyCAwtB5AAhEAyBAwsDQAJAIAEtAABB8MKAgABqLQAAIhBBAUYNACAQQX5qDgPPAdAB0QHSAQsgAUEBaiIBIAJHDQALQeYAIRAMgAMLAkAgASIBIAJGDQAgAUEBaiEBDAMLQecAIRAM/wILA0ACQCABLQAAQfDEgIAAai0AACIQQQFGDQACQCAQQX5qDgTSAdMB1AEA1QELIAEhAUHXACEQDOcCCyABQQFqIgEgAkcNAAtB6AAhEAz+AgsCQCABIgEgAkcNAEHpACEQDP4CCwJAIAEtAAAiEEF2ag4augHVAdUBvAHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHKAdUB1QEA0wELIAFBAWohAQtBBiEQDOMCCwNAAkAgAS0AAEHwxoCAAGotAABBAUYNACABIQEMngILIAFBAWoiASACRw0AC0HqACEQDPsCCwJAIAEiASACRg0AIAFBAWohAQwDC0HrACEQDPoCCwJAIAEiASACRw0AQewAIRAM+gILIAFBAWohAQwBCwJAIAEiASACRw0AQe0AIRAM+QILIAFBAWohAQtBBCEQDN4CCwJAIAEiFCACRw0AQe4AIRAM9wILIBQhAQJAAkACQCAULQAAQfDIgIAAai0AAEF/ag4H1AHVAdYBAJwCAQLXAQsgFEEBaiEBDAoLIBRBAWohAQzNAQtBACEQIABBADYCHCAAQZuSgIAANgIQIABBBzYCDCAAIBRBAWo2AhQM9gILAkADQAJAIAEtAABB8MiAgABqLQAAIhBBBEYNAAJAAkAgEEF/ag4H0gHTAdQB2QEABAHZAQsgASEBQdoAIRAM4AILIAFBAWohAUHcACEQDN8CCyABQQFqIgEgAkcNAAtB7wAhEAz2AgsgAUEBaiEBDMsBCwJAIAEiFCACRw0AQfAAIRAM9QILIBQtAABBL0cN1AEgFEEBaiEBDAYLAkAgASIUIAJHDQBB8QAhEAz0AgsCQCAULQAAIgFBL0cNACAUQQFqIQFB3QAhEAzbAgsgAUF2aiIEQRZLDdMBQQEgBHRBiYCAAnFFDdMBDMoCCwJAIAEiASACRg0AIAFBAWohAUHeACEQDNoCC0HyACEQDPICCwJAIAEiFCACRw0AQfQAIRAM8gILIBQhAQJAIBQtAABB8MyAgABqLQAAQX9qDgPJApQCANQBC0HhACEQDNgCCwJAIAEiFCACRg0AA0ACQCAULQAAQfDKgIAAai0AACIBQQNGDQACQCABQX9qDgLLAgDVAQsgFCEBQd8AIRAM2gILIBRBAWoiFCACRw0AC0HzACEQDPECC0HzACEQDPACCwJAIAEiASACRg0AIABBj4CAgAA2AgggACABNgIEIAEhAUHgACEQDNcCC0H1ACEQDO8CCwJAIAEiASACRw0AQfYAIRAM7wILIABBj4CAgAA2AgggACABNgIEIAEhAQtBAyEQDNQCCwNAIAEtAABBIEcNwwIgAUEBaiIBIAJHDQALQfcAIRAM7AILAkAgASIBIAJHDQBB+AAhEAzsAgsgAS0AAEEgRw3OASABQQFqIQEM7wELIAAgASIBIAIQrICAgAAiEA3OASABIQEMjgILAkAgASIEIAJHDQBB+gAhEAzqAgsgBC0AAEHMAEcN0QEgBEEBaiEBQRMhEAzPAQsCQCABIgQgAkcNAEH7ACEQDOkCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRADQCAELQAAIAFB8M6AgABqLQAARw3QASABQQVGDc4BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQfsAIRAM6AILAkAgASIEIAJHDQBB/AAhEAzoAgsCQAJAIAQtAABBvX9qDgwA0QHRAdEB0QHRAdEB0QHRAdEB0QEB0QELIARBAWohAUHmACEQDM8CCyAEQQFqIQFB5wAhEAzOAgsCQCABIgQgAkcNAEH9ACEQDOcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDc8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH9ACEQDOcCCyAAQQA2AgAgEEEBaiEBQRAhEAzMAQsCQCABIgQgAkcNAEH+ACEQDOYCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUH2zoCAAGotAABHDc4BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH+ACEQDOYCCyAAQQA2AgAgEEEBaiEBQRYhEAzLAQsCQCABIgQgAkcNAEH/ACEQDOUCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUH8zoCAAGotAABHDc0BIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH/ACEQDOUCCyAAQQA2AgAgEEEBaiEBQQUhEAzKAQsCQCABIgQgAkcNAEGAASEQDOQCCyAELQAAQdkARw3LASAEQQFqIQFBCCEQDMkBCwJAIAEiBCACRw0AQYEBIRAM4wILAkACQCAELQAAQbJ/ag4DAMwBAcwBCyAEQQFqIQFB6wAhEAzKAgsgBEEBaiEBQewAIRAMyQILAkAgASIEIAJHDQBBggEhEAziAgsCQAJAIAQtAABBuH9qDggAywHLAcsBywHLAcsBAcsBCyAEQQFqIQFB6gAhEAzJAgsgBEEBaiEBQe0AIRAMyAILAkAgASIEIAJHDQBBgwEhEAzhAgsgAiAEayAAKAIAIgFqIRAgBCABa0ECaiEUAkADQCAELQAAIAFBgM+AgABqLQAARw3JASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBA2AgBBgwEhEAzhAgtBACEQIABBADYCACAUQQFqIQEMxgELAkAgASIEIAJHDQBBhAEhEAzgAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBg8+AgABqLQAARw3IASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhAEhEAzgAgsgAEEANgIAIBBBAWohAUEjIRAMxQELAkAgASIEIAJHDQBBhQEhEAzfAgsCQAJAIAQtAABBtH9qDggAyAHIAcgByAHIAcgBAcgBCyAEQQFqIQFB7wAhEAzGAgsgBEEBaiEBQfAAIRAMxQILAkAgASIEIAJHDQBBhgEhEAzeAgsgBC0AAEHFAEcNxQEgBEEBaiEBDIMCCwJAIAEiBCACRw0AQYcBIRAM3QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQYjPgIAAai0AAEcNxQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYcBIRAM3QILIABBADYCACAQQQFqIQFBLSEQDMIBCwJAIAEiBCACRw0AQYgBIRAM3AILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNxAEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYgBIRAM3AILIABBADYCACAQQQFqIQFBKSEQDMEBCwJAIAEiASACRw0AQYkBIRAM2wILQQEhECABLQAAQd8ARw3AASABQQFqIQEMgQILAkAgASIEIAJHDQBBigEhEAzaAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQA0AgBC0AACABQYzPgIAAai0AAEcNwQEgAUEBRg2vAiABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGKASEQDNkCCwJAIAEiBCACRw0AQYsBIRAM2QILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQY7PgIAAai0AAEcNwQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYsBIRAM2QILIABBADYCACAQQQFqIQFBAiEQDL4BCwJAIAEiBCACRw0AQYwBIRAM2AILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNwAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYwBIRAM2AILIABBADYCACAQQQFqIQFBHyEQDL0BCwJAIAEiBCACRw0AQY0BIRAM1wILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNvwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY0BIRAM1wILIABBADYCACAQQQFqIQFBCSEQDLwBCwJAIAEiBCACRw0AQY4BIRAM1gILAkACQCAELQAAQbd/ag4HAL8BvwG/Ab8BvwEBvwELIARBAWohAUH4ACEQDL0CCyAEQQFqIQFB+QAhEAy8AgsCQCABIgQgAkcNAEGPASEQDNUCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGRz4CAAGotAABHDb0BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGPASEQDNUCCyAAQQA2AgAgEEEBaiEBQRghEAy6AQsCQCABIgQgAkcNAEGQASEQDNQCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUGXz4CAAGotAABHDbwBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGQASEQDNQCCyAAQQA2AgAgEEEBaiEBQRchEAy5AQsCQCABIgQgAkcNAEGRASEQDNMCCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUGaz4CAAGotAABHDbsBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGRASEQDNMCCyAAQQA2AgAgEEEBaiEBQRUhEAy4AQsCQCABIgQgAkcNAEGSASEQDNICCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGhz4CAAGotAABHDboBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGSASEQDNICCyAAQQA2AgAgEEEBaiEBQR4hEAy3AQsCQCABIgQgAkcNAEGTASEQDNECCyAELQAAQcwARw24ASAEQQFqIQFBCiEQDLYBCwJAIAQgAkcNAEGUASEQDNACCwJAAkAgBC0AAEG/f2oODwC5AbkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AQG5AQsgBEEBaiEBQf4AIRAMtwILIARBAWohAUH/ACEQDLYCCwJAIAQgAkcNAEGVASEQDM8CCwJAAkAgBC0AAEG/f2oOAwC4AQG4AQsgBEEBaiEBQf0AIRAMtgILIARBAWohBEGAASEQDLUCCwJAIAQgAkcNAEGWASEQDM4CCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUGnz4CAAGotAABHDbYBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGWASEQDM4CCyAAQQA2AgAgEEEBaiEBQQshEAyzAQsCQCAEIAJHDQBBlwEhEAzNAgsCQAJAAkACQCAELQAAQVNqDiMAuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AQG4AbgBuAG4AbgBArgBuAG4AQO4AQsgBEEBaiEBQfsAIRAMtgILIARBAWohAUH8ACEQDLUCCyAEQQFqIQRBgQEhEAy0AgsgBEEBaiEEQYIBIRAMswILAkAgBCACRw0AQZgBIRAMzAILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQanPgIAAai0AAEcNtAEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZgBIRAMzAILIABBADYCACAQQQFqIQFBGSEQDLEBCwJAIAQgAkcNAEGZASEQDMsCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGuz4CAAGotAABHDbMBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGZASEQDMsCCyAAQQA2AgAgEEEBaiEBQQYhEAywAQsCQCAEIAJHDQBBmgEhEAzKAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBtM+AgABqLQAARw2yASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmgEhEAzKAgsgAEEANgIAIBBBAWohAUEcIRAMrwELAkAgBCACRw0AQZsBIRAMyQILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbbPgIAAai0AAEcNsQEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZsBIRAMyQILIABBADYCACAQQQFqIQFBJyEQDK4BCwJAIAQgAkcNAEGcASEQDMgCCwJAAkAgBC0AAEGsf2oOAgABsQELIARBAWohBEGGASEQDK8CCyAEQQFqIQRBhwEhEAyuAgsCQCAEIAJHDQBBnQEhEAzHAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBuM+AgABqLQAARw2vASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBnQEhEAzHAgsgAEEANgIAIBBBAWohAUEmIRAMrAELAkAgBCACRw0AQZ4BIRAMxgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbrPgIAAai0AAEcNrgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ4BIRAMxgILIABBADYCACAQQQFqIQFBAyEQDKsBCwJAIAQgAkcNAEGfASEQDMUCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDa0BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGfASEQDMUCCyAAQQA2AgAgEEEBaiEBQQwhEAyqAQsCQCAEIAJHDQBBoAEhEAzEAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBvM+AgABqLQAARw2sASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBoAEhEAzEAgsgAEEANgIAIBBBAWohAUENIRAMqQELAkAgBCACRw0AQaEBIRAMwwILAkACQCAELQAAQbp/ag4LAKwBrAGsAawBrAGsAawBrAGsAQGsAQsgBEEBaiEEQYsBIRAMqgILIARBAWohBEGMASEQDKkCCwJAIAQgAkcNAEGiASEQDMICCyAELQAAQdAARw2pASAEQQFqIQQM6QELAkAgBCACRw0AQaMBIRAMwQILAkACQCAELQAAQbd/ag4HAaoBqgGqAaoBqgEAqgELIARBAWohBEGOASEQDKgCCyAEQQFqIQFBIiEQDKYBCwJAIAQgAkcNAEGkASEQDMACCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHAz4CAAGotAABHDagBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGkASEQDMACCyAAQQA2AgAgEEEBaiEBQR0hEAylAQsCQCAEIAJHDQBBpQEhEAy/AgsCQAJAIAQtAABBrn9qDgMAqAEBqAELIARBAWohBEGQASEQDKYCCyAEQQFqIQFBBCEQDKQBCwJAIAQgAkcNAEGmASEQDL4CCwJAAkACQAJAAkAgBC0AAEG/f2oOFQCqAaoBqgGqAaoBqgGqAaoBqgGqAQGqAaoBAqoBqgEDqgGqAQSqAQsgBEEBaiEEQYgBIRAMqAILIARBAWohBEGJASEQDKcCCyAEQQFqIQRBigEhEAymAgsgBEEBaiEEQY8BIRAMpQILIARBAWohBEGRASEQDKQCCwJAIAQgAkcNAEGnASEQDL0CCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDaUBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGnASEQDL0CCyAAQQA2AgAgEEEBaiEBQREhEAyiAQsCQCAEIAJHDQBBqAEhEAy8AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBws+AgABqLQAARw2kASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqAEhEAy8AgsgAEEANgIAIBBBAWohAUEsIRAMoQELAkAgBCACRw0AQakBIRAMuwILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQcXPgIAAai0AAEcNowEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQakBIRAMuwILIABBADYCACAQQQFqIQFBKyEQDKABCwJAIAQgAkcNAEGqASEQDLoCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHKz4CAAGotAABHDaIBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGqASEQDLoCCyAAQQA2AgAgEEEBaiEBQRQhEAyfAQsCQCAEIAJHDQBBqwEhEAy5AgsCQAJAAkACQCAELQAAQb5/ag4PAAECpAGkAaQBpAGkAaQBpAGkAaQBpAGkAQOkAQsgBEEBaiEEQZMBIRAMogILIARBAWohBEGUASEQDKECCyAEQQFqIQRBlQEhEAygAgsgBEEBaiEEQZYBIRAMnwILAkAgBCACRw0AQawBIRAMuAILIAQtAABBxQBHDZ8BIARBAWohBAzgAQsCQCAEIAJHDQBBrQEhEAy3AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBzc+AgABqLQAARw2fASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrQEhEAy3AgsgAEEANgIAIBBBAWohAUEOIRAMnAELAkAgBCACRw0AQa4BIRAMtgILIAQtAABB0ABHDZ0BIARBAWohAUElIRAMmwELAkAgBCACRw0AQa8BIRAMtQILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNnQEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQa8BIRAMtQILIABBADYCACAQQQFqIQFBKiEQDJoBCwJAIAQgAkcNAEGwASEQDLQCCwJAAkAgBC0AAEGrf2oOCwCdAZ0BnQGdAZ0BnQGdAZ0BnQEBnQELIARBAWohBEGaASEQDJsCCyAEQQFqIQRBmwEhEAyaAgsCQCAEIAJHDQBBsQEhEAyzAgsCQAJAIAQtAABBv39qDhQAnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBAZwBCyAEQQFqIQRBmQEhEAyaAgsgBEEBaiEEQZwBIRAMmQILAkAgBCACRw0AQbIBIRAMsgILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQdnPgIAAai0AAEcNmgEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbIBIRAMsgILIABBADYCACAQQQFqIQFBISEQDJcBCwJAIAQgAkcNAEGzASEQDLECCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUHdz4CAAGotAABHDZkBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGzASEQDLECCyAAQQA2AgAgEEEBaiEBQRohEAyWAQsCQCAEIAJHDQBBtAEhEAywAgsCQAJAAkAgBC0AAEG7f2oOEQCaAZoBmgGaAZoBmgGaAZoBmgEBmgGaAZoBmgGaAQKaAQsgBEEBaiEEQZ0BIRAMmAILIARBAWohBEGeASEQDJcCCyAEQQFqIQRBnwEhEAyWAgsCQCAEIAJHDQBBtQEhEAyvAgsgAiAEayAAKAIAIgFqIRQgBCABa0EFaiEQAkADQCAELQAAIAFB5M+AgABqLQAARw2XASABQQVGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtQEhEAyvAgsgAEEANgIAIBBBAWohAUEoIRAMlAELAkAgBCACRw0AQbYBIRAMrgILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQerPgIAAai0AAEcNlgEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbYBIRAMrgILIABBADYCACAQQQFqIQFBByEQDJMBCwJAIAQgAkcNAEG3ASEQDK0CCwJAAkAgBC0AAEG7f2oODgCWAZYBlgGWAZYBlgGWAZYBlgGWAZYBlgEBlgELIARBAWohBEGhASEQDJQCCyAEQQFqIQRBogEhEAyTAgsCQCAEIAJHDQBBuAEhEAysAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB7c+AgABqLQAARw2UASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuAEhEAysAgsgAEEANgIAIBBBAWohAUESIRAMkQELAkAgBCACRw0AQbkBIRAMqwILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNkwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbkBIRAMqwILIABBADYCACAQQQFqIQFBICEQDJABCwJAIAQgAkcNAEG6ASEQDKoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHyz4CAAGotAABHDZIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG6ASEQDKoCCyAAQQA2AgAgEEEBaiEBQQ8hEAyPAQsCQCAEIAJHDQBBuwEhEAypAgsCQAJAIAQtAABBt39qDgcAkgGSAZIBkgGSAQGSAQsgBEEBaiEEQaUBIRAMkAILIARBAWohBEGmASEQDI8CCwJAIAQgAkcNAEG8ASEQDKgCCyACIARrIAAoAgAiAWohFCAEIAFrQQdqIRACQANAIAQtAAAgAUH0z4CAAGotAABHDZABIAFBB0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG8ASEQDKgCCyAAQQA2AgAgEEEBaiEBQRshEAyNAQsCQCAEIAJHDQBBvQEhEAynAgsCQAJAAkAgBC0AAEG+f2oOEgCRAZEBkQGRAZEBkQGRAZEBkQEBkQGRAZEBkQGRAZEBApEBCyAEQQFqIQRBpAEhEAyPAgsgBEEBaiEEQacBIRAMjgILIARBAWohBEGoASEQDI0CCwJAIAQgAkcNAEG+ASEQDKYCCyAELQAAQc4ARw2NASAEQQFqIQQMzwELAkAgBCACRw0AQb8BIRAMpQILAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgBC0AAEG/f2oOFQABAgOcAQQFBpwBnAGcAQcICQoLnAEMDQ4PnAELIARBAWohAUHoACEQDJoCCyAEQQFqIQFB6QAhEAyZAgsgBEEBaiEBQe4AIRAMmAILIARBAWohAUHyACEQDJcCCyAEQQFqIQFB8wAhEAyWAgsgBEEBaiEBQfYAIRAMlQILIARBAWohAUH3ACEQDJQCCyAEQQFqIQFB+gAhEAyTAgsgBEEBaiEEQYMBIRAMkgILIARBAWohBEGEASEQDJECCyAEQQFqIQRBhQEhEAyQAgsgBEEBaiEEQZIBIRAMjwILIARBAWohBEGYASEQDI4CCyAEQQFqIQRBoAEhEAyNAgsgBEEBaiEEQaMBIRAMjAILIARBAWohBEGqASEQDIsCCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEGrASEQDIsCC0HAASEQDKMCCyAAIAUgAhCqgICAACIBDYsBIAUhAQxcCwJAIAYgAkYNACAGQQFqIQUMjQELQcIBIRAMoQILA0ACQCAQLQAAQXZqDgSMAQAAjwEACyAQQQFqIhAgAkcNAAtBwwEhEAygAgsCQCAHIAJGDQAgAEGRgICAADYCCCAAIAc2AgQgByEBQQEhEAyHAgtBxAEhEAyfAgsCQCAHIAJHDQBBxQEhEAyfAgsCQAJAIActAABBdmoOBAHOAc4BAM4BCyAHQQFqIQYMjQELIAdBAWohBQyJAQsCQCAHIAJHDQBBxgEhEAyeAgsCQAJAIActAABBdmoOFwGPAY8BAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAQCPAQsgB0EBaiEHC0GwASEQDIQCCwJAIAggAkcNAEHIASEQDJ0CCyAILQAAQSBHDY0BIABBADsBMiAIQQFqIQFBswEhEAyDAgsgASEXAkADQCAXIgcgAkYNASAHLQAAQVBqQf8BcSIQQQpPDcwBAkAgAC8BMiIUQZkzSw0AIAAgFEEKbCIUOwEyIBBB//8DcyAUQf7/A3FJDQAgB0EBaiEXIAAgFCAQaiIQOwEyIBBB//8DcUHoB0kNAQsLQQAhECAAQQA2AhwgAEHBiYCAADYCECAAQQ02AgwgACAHQQFqNgIUDJwCC0HHASEQDJsCCyAAIAggAhCugICAACIQRQ3KASAQQRVHDYwBIABByAE2AhwgACAINgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAyaAgsCQCAJIAJHDQBBzAEhEAyaAgtBACEUQQEhF0EBIRZBACEQAkACQAJAAkACQAJAAkACQAJAIAktAABBUGoOCpYBlQEAAQIDBAUGCJcBC0ECIRAMBgtBAyEQDAULQQQhEAwEC0EFIRAMAwtBBiEQDAILQQchEAwBC0EIIRALQQAhF0EAIRZBACEUDI4BC0EJIRBBASEUQQAhF0EAIRYMjQELAkAgCiACRw0AQc4BIRAMmQILIAotAABBLkcNjgEgCkEBaiEJDMoBCyALIAJHDY4BQdABIRAMlwILAkAgCyACRg0AIABBjoCAgAA2AgggACALNgIEQbcBIRAM/gELQdEBIRAMlgILAkAgBCACRw0AQdIBIRAMlgILIAIgBGsgACgCACIQaiEUIAQgEGtBBGohCwNAIAQtAAAgEEH8z4CAAGotAABHDY4BIBBBBEYN6QEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB0gEhEAyVAgsgACAMIAIQrICAgAAiAQ2NASAMIQEMuAELAkAgBCACRw0AQdQBIRAMlAILIAIgBGsgACgCACIQaiEUIAQgEGtBAWohDANAIAQtAAAgEEGB0ICAAGotAABHDY8BIBBBAUYNjgEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB1AEhEAyTAgsCQCAEIAJHDQBB1gEhEAyTAgsgAiAEayAAKAIAIhBqIRQgBCAQa0ECaiELA0AgBC0AACAQQYPQgIAAai0AAEcNjgEgEEECRg2QASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHWASEQDJICCwJAIAQgAkcNAEHXASEQDJICCwJAAkAgBC0AAEG7f2oOEACPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAY8BCyAEQQFqIQRBuwEhEAz5AQsgBEEBaiEEQbwBIRAM+AELAkAgBCACRw0AQdgBIRAMkQILIAQtAABByABHDYwBIARBAWohBAzEAQsCQCAEIAJGDQAgAEGQgICAADYCCCAAIAQ2AgRBvgEhEAz3AQtB2QEhEAyPAgsCQCAEIAJHDQBB2gEhEAyPAgsgBC0AAEHIAEYNwwEgAEEBOgAoDLkBCyAAQQI6AC8gACAEIAIQpoCAgAAiEA2NAUHCASEQDPQBCyAALQAoQX9qDgK3AbkBuAELA0ACQCAELQAAQXZqDgQAjgGOAQCOAQsgBEEBaiIEIAJHDQALQd0BIRAMiwILIABBADoALyAALQAtQQRxRQ2EAgsgAEEAOgAvIABBAToANCABIQEMjAELIBBBFUYN2gEgAEEANgIcIAAgATYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMiAILAkAgACAQIAIQtICAgAAiBA0AIBAhAQyBAgsCQCAEQRVHDQAgAEEDNgIcIAAgEDYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMiAILIABBADYCHCAAIBA2AhQgAEGnjoCAADYCECAAQRI2AgxBACEQDIcCCyAQQRVGDdYBIABBADYCHCAAIAE2AhQgAEHajYCAADYCECAAQRQ2AgxBACEQDIYCCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNjQEgAEEHNgIcIAAgEDYCFCAAIBQ2AgxBACEQDIUCCyAAIAAvATBBgAFyOwEwIAEhAQtBKiEQDOoBCyAQQRVGDdEBIABBADYCHCAAIAE2AhQgAEGDjICAADYCECAAQRM2AgxBACEQDIICCyAQQRVGDc8BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDIECCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyNAQsgAEEMNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDIACCyAQQRVGDcwBIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDP8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyMAQsgAEENNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDP4BCyAQQRVGDckBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDP0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyLAQsgAEEONgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPwBCyAAQQA2AhwgACABNgIUIABBwJWAgAA2AhAgAEECNgIMQQAhEAz7AQsgEEEVRg3FASAAQQA2AhwgACABNgIUIABBxoyAgAA2AhAgAEEjNgIMQQAhEAz6AQsgAEEQNgIcIAAgATYCFCAAIBA2AgxBACEQDPkBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQzxAQsgAEERNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPgBCyAQQRVGDcEBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPcBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyIAQsgAEETNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPYBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQztAQsgAEEUNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPUBCyAQQRVGDb0BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDPQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyGAQsgAEEWNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPMBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQt4CAgAAiBA0AIAFBAWohAQzpAQsgAEEXNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPIBCyAAQQA2AhwgACABNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzxAQtCASERCyAQQQFqIQECQCAAKQMgIhJC//////////8PVg0AIAAgEkIEhiARhDcDICABIQEMhAELIABBADYCHCAAIAE2AhQgAEGtiYCAADYCECAAQQw2AgxBACEQDO8BCyAAQQA2AhwgACAQNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzuAQsgACgCBCEXIABBADYCBCAQIBGnaiIWIQEgACAXIBAgFiAUGyIQELWAgIAAIhRFDXMgAEEFNgIcIAAgEDYCFCAAIBQ2AgxBACEQDO0BCyAAQQA2AhwgACAQNgIUIABBqpyAgAA2AhAgAEEPNgIMQQAhEAzsAQsgACAQIAIQtICAgAAiAQ0BIBAhAQtBDiEQDNEBCwJAIAFBFUcNACAAQQI2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAzqAQsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAM6QELIAFBAWohEAJAIAAvATAiAUGAAXFFDQACQCAAIBAgAhC7gICAACIBDQAgECEBDHALIAFBFUcNugEgAEEFNgIcIAAgEDYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAM6QELAkAgAUGgBHFBoARHDQAgAC0ALUECcQ0AIABBADYCHCAAIBA2AhQgAEGWk4CAADYCECAAQQQ2AgxBACEQDOkBCyAAIBAgAhC9gICAABogECEBAkACQAJAAkACQCAAIBAgAhCzgICAAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIABBAToALgsgACAALwEwQcAAcjsBMCAQIQELQSYhEAzRAQsgAEEjNgIcIAAgEDYCFCAAQaWWgIAANgIQIABBFTYCDEEAIRAM6QELIABBADYCHCAAIBA2AhQgAEHVi4CAADYCECAAQRE2AgxBACEQDOgBCyAALQAtQQFxRQ0BQcMBIRAMzgELAkAgDSACRg0AA0ACQCANLQAAQSBGDQAgDSEBDMQBCyANQQFqIg0gAkcNAAtBJSEQDOcBC0ElIRAM5gELIAAoAgQhBCAAQQA2AgQgACAEIA0Qr4CAgAAiBEUNrQEgAEEmNgIcIAAgBDYCDCAAIA1BAWo2AhRBACEQDOUBCyAQQRVGDasBIABBADYCHCAAIAE2AhQgAEH9jYCAADYCECAAQR02AgxBACEQDOQBCyAAQSc2AhwgACABNgIUIAAgEDYCDEEAIRAM4wELIBAhAUEBIRQCQAJAAkACQAJAAkACQCAALQAsQX5qDgcGBQUDAQIABQsgACAALwEwQQhyOwEwDAMLQQIhFAwBC0EEIRQLIABBAToALCAAIAAvATAgFHI7ATALIBAhAQtBKyEQDMoBCyAAQQA2AhwgACAQNgIUIABBq5KAgAA2AhAgAEELNgIMQQAhEAziAQsgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDEEAIRAM4QELIABBADoALCAQIQEMvQELIBAhAUEBIRQCQAJAAkACQAJAIAAtACxBe2oOBAMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0EpIRAMxQELIABBADYCHCAAIAE2AhQgAEHwlICAADYCECAAQQM2AgxBACEQDN0BCwJAIA4tAABBDUcNACAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA5BAWohAQx1CyAAQSw2AhwgACABNgIMIAAgDkEBajYCFEEAIRAM3QELIAAtAC1BAXFFDQFBxAEhEAzDAQsCQCAOIAJHDQBBLSEQDNwBCwJAAkADQAJAIA4tAABBdmoOBAIAAAMACyAOQQFqIg4gAkcNAAtBLSEQDN0BCyAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA4hAQx0CyAAQSw2AhwgACAONgIUIAAgATYCDEEAIRAM3AELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHMLIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzbAQsgACgCBCEEIABBADYCBCAAIAQgDhCxgICAACIEDaABIA4hAQzOAQsgEEEsRw0BIAFBAWohEEEBIQECQAJAAkACQAJAIAAtACxBe2oOBAMBAgQACyAQIQEMBAtBAiEBDAELQQQhAQsgAEEBOgAsIAAgAC8BMCABcjsBMCAQIQEMAQsgACAALwEwQQhyOwEwIBAhAQtBOSEQDL8BCyAAQQA6ACwgASEBC0E0IRAMvQELIAAgAC8BMEEgcjsBMCABIQEMAgsgACgCBCEEIABBADYCBAJAIAAgBCABELGAgIAAIgQNACABIQEMxwELIABBNzYCHCAAIAE2AhQgACAENgIMQQAhEAzUAQsgAEEIOgAsIAEhAQtBMCEQDLkBCwJAIAAtAChBAUYNACABIQEMBAsgAC0ALUEIcUUNkwEgASEBDAMLIAAtADBBIHENlAFBxQEhEAy3AQsCQCAPIAJGDQACQANAAkAgDy0AAEFQaiIBQf8BcUEKSQ0AIA8hAUE1IRAMugELIAApAyAiEUKZs+bMmbPmzBlWDQEgACARQgp+IhE3AyAgESABrUL/AYMiEkJ/hVYNASAAIBEgEnw3AyAgD0EBaiIPIAJHDQALQTkhEAzRAQsgACgCBCECIABBADYCBCAAIAIgD0EBaiIEELGAgIAAIgINlQEgBCEBDMMBC0E5IRAMzwELAkAgAC8BMCIBQQhxRQ0AIAAtAChBAUcNACAALQAtQQhxRQ2QAQsgACABQff7A3FBgARyOwEwIA8hAQtBNyEQDLQBCyAAIAAvATBBEHI7ATAMqwELIBBBFUYNiwEgAEEANgIcIAAgATYCFCAAQfCOgIAANgIQIABBHDYCDEEAIRAMywELIABBwwA2AhwgACABNgIMIAAgDUEBajYCFEEAIRAMygELAkAgAS0AAEE6Rw0AIAAoAgQhECAAQQA2AgQCQCAAIBAgARCvgICAACIQDQAgAUEBaiEBDGMLIABBwwA2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMygELIABBADYCHCAAIAE2AhQgAEGxkYCAADYCECAAQQo2AgxBACEQDMkBCyAAQQA2AhwgACABNgIUIABBoJmAgAA2AhAgAEEeNgIMQQAhEAzIAQsgAEEANgIACyAAQYASOwEqIAAgF0EBaiIBIAIQqICAgAAiEA0BIAEhAQtBxwAhEAysAQsgEEEVRw2DASAAQdEANgIcIAAgATYCFCAAQeOXgIAANgIQIABBFTYCDEEAIRAMxAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDF4LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMwwELIABBADYCHCAAIBQ2AhQgAEHBqICAADYCECAAQQc2AgwgAEEANgIAQQAhEAzCAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAzBAQtBACEQIABBADYCHCAAIAE2AhQgAEGAkYCAADYCECAAQQk2AgwMwAELIBBBFUYNfSAAQQA2AhwgACABNgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAy/AQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgAUEBaiEBAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBAJAIAAgECABEK2AgIAAIhANACABIQEMXAsgAEHYADYCHCAAIAE2AhQgACAQNgIMQQAhEAy+AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMrQELIABB2QA2AhwgACABNgIUIAAgBDYCDEEAIRAMvQELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKsBCyAAQdoANgIcIAAgATYCFCAAIAQ2AgxBACEQDLwBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQypAQsgAEHcADYCHCAAIAE2AhQgACAENgIMQQAhEAy7AQsCQCABLQAAQVBqIhBB/wFxQQpPDQAgACAQOgAqIAFBAWohAUHPACEQDKIBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQynAQsgAEHeADYCHCAAIAE2AhQgACAENgIMQQAhEAy6AQsgAEEANgIAIBdBAWohAQJAIAAtAClBI08NACABIQEMWQsgAEEANgIcIAAgATYCFCAAQdOJgIAANgIQIABBCDYCDEEAIRAMuQELIABBADYCAAtBACEQIABBADYCHCAAIAE2AhQgAEGQs4CAADYCECAAQQg2AgwMtwELIABBADYCACAXQQFqIQECQCAALQApQSFHDQAgASEBDFYLIABBADYCHCAAIAE2AhQgAEGbioCAADYCECAAQQg2AgxBACEQDLYBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKSIQQV1qQQtPDQAgASEBDFULAkAgEEEGSw0AQQEgEHRBygBxRQ0AIAEhAQxVC0EAIRAgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDAy1AQsgEEEVRg1xIABBADYCHCAAIAE2AhQgAEG5jYCAADYCECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIABBADYCHCAAIAU2AhQgAEHwjICAADYCECAAQRs2AgxBACEQDJYBCyAAKAIEIQUgAEEANgIEIAAgBSAQEKmAgIAAIgUNASAQQQFqIQULQa0BIRAMewsgAEHBATYCHCAAIAU2AgwgACAQQQFqNgIUQQAhEAyTAQsgACgCBCEGIABBADYCBCAAIAYgEBCpgICAACIGDQEgEEEBaiEGC0GuASEQDHgLIABBwgE2AhwgACAGNgIMIAAgEEEBajYCFEEAIRAMkAELIABBADYCHCAAIAc2AhQgAEGXi4CAADYCECAAQQ02AgxBACEQDI8BCyAAQQA2AhwgACAINgIUIABB45CAgAA2AhAgAEEJNgIMQQAhEAyOAQsgAEEANgIcIAAgCDYCFCAAQZSNgIAANgIQIABBITYCDEEAIRAMjQELQQEhFkEAIRdBACEUQQEhEAsgACAQOgArIAlBAWohCAJAAkAgAC0ALUEQcQ0AAkACQAJAIAAtACoOAwEAAgQLIBZFDQMMAgsgFA0BDAILIBdFDQELIAAoAgQhECAAQQA2AgQgACAQIAgQrYCAgAAiEEUNPSAAQckBNgIcIAAgCDYCFCAAIBA2AgxBACEQDIwBCyAAKAIEIQQgAEEANgIEIAAgBCAIEK2AgIAAIgRFDXYgAEHKATYCHCAAIAg2AhQgACAENgIMQQAhEAyLAQsgACgCBCEEIABBADYCBCAAIAQgCRCtgICAACIERQ10IABBywE2AhwgACAJNgIUIAAgBDYCDEEAIRAMigELIAAoAgQhBCAAQQA2AgQgACAEIAoQrYCAgAAiBEUNciAAQc0BNgIcIAAgCjYCFCAAIAQ2AgxBACEQDIkBCwJAIAstAABBUGoiEEH/AXFBCk8NACAAIBA6ACogC0EBaiEKQbYBIRAMcAsgACgCBCEEIABBADYCBCAAIAQgCxCtgICAACIERQ1wIABBzwE2AhwgACALNgIUIAAgBDYCDEEAIRAMiAELIABBADYCHCAAIAQ2AhQgAEGQs4CAADYCECAAQQg2AgwgAEEANgIAQQAhEAyHAQsgAUEVRg0/IABBADYCHCAAIAw2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDIYBCyAAQYEEOwEoIAAoAgQhECAAQgA3AwAgACAQIAxBAWoiDBCrgICAACIQRQ04IABB0wE2AhwgACAMNgIUIAAgEDYCDEEAIRAMhQELIABBADYCAAtBACEQIABBADYCHCAAIAQ2AhQgAEHYm4CAADYCECAAQQg2AgwMgwELIAAoAgQhECAAQgA3AwAgACAQIAtBAWoiCxCrgICAACIQDQFBxgEhEAxpCyAAQQI6ACgMVQsgAEHVATYCHCAAIAs2AhQgACAQNgIMQQAhEAyAAQsgEEEVRg03IABBADYCHCAAIAQ2AhQgAEGkjICAADYCECAAQRA2AgxBACEQDH8LIAAtADRBAUcNNCAAIAQgAhC8gICAACIQRQ00IBBBFUcNNSAAQdwBNgIcIAAgBDYCFCAAQdWWgIAANgIQIABBFTYCDEEAIRAMfgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQMfQtBACEQDGMLQQIhEAxiC0ENIRAMYQtBDyEQDGALQSUhEAxfC0ETIRAMXgtBFSEQDF0LQRYhEAxcC0EXIRAMWwtBGCEQDFoLQRkhEAxZC0EaIRAMWAtBGyEQDFcLQRwhEAxWC0EdIRAMVQtBHyEQDFQLQSEhEAxTC0EjIRAMUgtBxgAhEAxRC0EuIRAMUAtBLyEQDE8LQTshEAxOC0E9IRAMTQtByAAhEAxMC0HJACEQDEsLQcsAIRAMSgtBzAAhEAxJC0HOACEQDEgLQdEAIRAMRwtB1QAhEAxGC0HYACEQDEULQdkAIRAMRAtB2wAhEAxDC0HkACEQDEILQeUAIRAMQQtB8QAhEAxAC0H0ACEQDD8LQY0BIRAMPgtBlwEhEAw9C0GpASEQDDwLQawBIRAMOwtBwAEhEAw6C0G5ASEQDDkLQa8BIRAMOAtBsQEhEAw3C0GyASEQDDYLQbQBIRAMNQtBtQEhEAw0C0G6ASEQDDMLQb0BIRAMMgtBvwEhEAwxC0HBASEQDDALIABBADYCHCAAIAQ2AhQgAEHpi4CAADYCECAAQR82AgxBACEQDEgLIABB2wE2AhwgACAENgIUIABB+paAgAA2AhAgAEEVNgIMQQAhEAxHCyAAQfgANgIcIAAgDDYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMRgsgAEHRADYCHCAAIAU2AhQgAEGwl4CAADYCECAAQRU2AgxBACEQDEULIABB+QA2AhwgACABNgIUIAAgEDYCDEEAIRAMRAsgAEH4ADYCHCAAIAE2AhQgAEHKmICAADYCECAAQRU2AgxBACEQDEMLIABB5AA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAxCCyAAQdcANgIcIAAgATYCFCAAQcmXgIAANgIQIABBFTYCDEEAIRAMQQsgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMQAsgAEHCADYCHCAAIAE2AhQgAEHjmICAADYCECAAQRU2AgxBACEQDD8LIABBADYCBCAAIA8gDxCxgICAACIERQ0BIABBOjYCHCAAIAQ2AgwgACAPQQFqNgIUQQAhEAw+CyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBEUNACAAQTs2AhwgACAENgIMIAAgAUEBajYCFEEAIRAMPgsgAUEBaiEBDC0LIA9BAWohAQwtCyAAQQA2AhwgACAPNgIUIABB5JKAgAA2AhAgAEEENgIMQQAhEAw7CyAAQTY2AhwgACAENgIUIAAgAjYCDEEAIRAMOgsgAEEuNgIcIAAgDjYCFCAAIAQ2AgxBACEQDDkLIABB0AA2AhwgACABNgIUIABBkZiAgAA2AhAgAEEVNgIMQQAhEAw4CyANQQFqIQEMLAsgAEEVNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMNgsgAEEbNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNQsgAEEPNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNAsgAEELNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMMwsgAEEaNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMgsgAEELNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMQsgAEEKNgIcIAAgATYCFCAAQeSWgIAANgIQIABBFTYCDEEAIRAMMAsgAEEeNgIcIAAgATYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAMLwsgAEEANgIcIAAgEDYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMLgsgAEEENgIcIAAgATYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMLQsgAEEANgIAIAtBAWohCwtBuAEhEAwSCyAAQQA2AgAgEEEBaiEBQfUAIRAMEQsgASEBAkAgAC0AKUEFRw0AQeMAIRAMEQtB4gAhEAwQC0EAIRAgAEEANgIcIABB5JGAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAwoCyAAQQA2AgAgF0EBaiEBQcAAIRAMDgtBASEBCyAAIAE6ACwgAEEANgIAIBdBAWohAQtBKCEQDAsLIAEhAQtBOCEQDAkLAkAgASIPIAJGDQADQAJAIA8tAABBgL6AgABqLQAAIgFBAUYNACABQQJHDQMgD0EBaiEBDAQLIA9BAWoiDyACRw0AC0E+IRAMIgtBPiEQDCELIABBADoALCAPIQEMAQtBCyEQDAYLQTohEAwFCyABQQFqIQFBLSEQDAQLIAAgAToALCAAQQA2AgAgFkEBaiEBQQwhEAwDCyAAQQA2AgAgF0EBaiEBQQohEAwCCyAAQQA2AgALIABBADoALCANIQFBCSEQDAALC0EAIRAgAEEANgIcIAAgCzYCFCAAQc2QgIAANgIQIABBCTYCDAwXC0EAIRAgAEEANgIcIAAgCjYCFCAAQemKgIAANgIQIABBCTYCDAwWC0EAIRAgAEEANgIcIAAgCTYCFCAAQbeQgIAANgIQIABBCTYCDAwVC0EAIRAgAEEANgIcIAAgCDYCFCAAQZyRgIAANgIQIABBCTYCDAwUC0EAIRAgAEEANgIcIAAgATYCFCAAQc2QgIAANgIQIABBCTYCDAwTC0EAIRAgAEEANgIcIAAgATYCFCAAQemKgIAANgIQIABBCTYCDAwSC0EAIRAgAEEANgIcIAAgATYCFCAAQbeQgIAANgIQIABBCTYCDAwRC0EAIRAgAEEANgIcIAAgATYCFCAAQZyRgIAANgIQIABBCTYCDAwQC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwPC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwOC0EAIRAgAEEANgIcIAAgATYCFCAAQcCSgIAANgIQIABBCzYCDAwNC0EAIRAgAEEANgIcIAAgATYCFCAAQZWJgIAANgIQIABBCzYCDAwMC0EAIRAgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDAwLC0EAIRAgAEEANgIcIAAgATYCFCAAQfuPgIAANgIQIABBCjYCDAwKC0EAIRAgAEEANgIcIAAgATYCFCAAQfGZgIAANgIQIABBAjYCDAwJC0EAIRAgAEEANgIcIAAgATYCFCAAQcSUgIAANgIQIABBAjYCDAwIC0EAIRAgAEEANgIcIAAgATYCFCAAQfKVgIAANgIQIABBAjYCDAwHCyAAQQI2AhwgACABNgIUIABBnJqAgAA2AhAgAEEWNgIMQQAhEAwGC0EBIRAMBQtB1AAhECABIgQgAkYNBCADQQhqIAAgBCACQdjCgIAAQQoQxYCAgAAgAygCDCEEIAMoAggOAwEEAgALEMqAgIAAAAsgAEEANgIcIABBtZqAgAA2AhAgAEEXNgIMIAAgBEEBajYCFEEAIRAMAgsgAEEANgIcIAAgBDYCFCAAQcqagIAANgIQIABBCTYCDEEAIRAMAQsCQCABIgQgAkcNAEEiIRAMAQsgAEGJgICAADYCCCAAIAQ2AgRBISEQCyADQRBqJICAgIAAIBALrwEBAn8gASgCACEGAkACQCACIANGDQAgBCAGaiEEIAYgA2ogAmshByACIAZBf3MgBWoiBmohBQNAAkAgAi0AACAELQAARg0AQQIhBAwDCwJAIAYNAEEAIQQgBSECDAMLIAZBf2ohBiAEQQFqIQQgAkEBaiICIANHDQALIAchBiADIQILIABBATYCACABIAY2AgAgACACNgIEDwsgAUEANgIAIAAgBDYCACAAIAI2AgQLCgAgABDHgICAAAvyNgELfyOAgICAAEEQayIBJICAgIAAAkBBACgCoNCAgAANAEEAEMuAgIAAQYDUhIAAayICQdkASQ0AQQAhAwJAQQAoAuDTgIAAIgQNAEEAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEIakFwcUHYqtWqBXMiBDYC4NOAgABBAEEANgL004CAAEEAQQA2AsTTgIAAC0EAIAI2AszTgIAAQQBBgNSEgAA2AsjTgIAAQQBBgNSEgAA2ApjQgIAAQQAgBDYCrNCAgABBAEF/NgKo0ICAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALQYDUhIAAQXhBgNSEgABrQQ9xQQBBgNSEgABBCGpBD3EbIgNqIgRBBGogAkFIaiIFIANrIgNBAXI2AgBBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAQYDUhIAAIAVqQTg2AgQLAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFLDQACQEEAKAKI0ICAACIGQRAgAEETakFwcSAAQQtJGyICQQN2IgR2IgNBA3FFDQACQAJAIANBAXEgBHJBAXMiBUEDdCIEQbDQgIAAaiIDIARBuNCAgABqKAIAIgQoAggiAkcNAEEAIAZBfiAFd3E2AojQgIAADAELIAMgAjYCCCACIAM2AgwLIARBCGohAyAEIAVBA3QiBUEDcjYCBCAEIAVqIgQgBCgCBEEBcjYCBAwMCyACQQAoApDQgIAAIgdNDQECQCADRQ0AAkACQCADIAR0QQIgBHQiA0EAIANrcnEiA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqIgRBA3QiA0Gw0ICAAGoiBSADQbjQgIAAaigCACIDKAIIIgBHDQBBACAGQX4gBHdxIgY2AojQgIAADAELIAUgADYCCCAAIAU2AgwLIAMgAkEDcjYCBCADIARBA3QiBGogBCACayIFNgIAIAMgAmoiACAFQQFyNgIEAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQQCQAJAIAZBASAHQQN2dCIIcQ0AQQAgBiAIcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCAENgIMIAIgBDYCCCAEIAI2AgwgBCAINgIICyADQQhqIQNBACAANgKc0ICAAEEAIAU2ApDQgIAADAwLQQAoAozQgIAAIglFDQEgCUEAIAlrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqQQJ0QbjSgIAAaigCACIAKAIEQXhxIAJrIQQgACEFAkADQAJAIAUoAhAiAw0AIAVBFGooAgAiA0UNAgsgAygCBEF4cSACayIFIAQgBSAESSIFGyEEIAMgACAFGyEAIAMhBQwACwsgACgCGCEKAkAgACgCDCIIIABGDQAgACgCCCIDQQAoApjQgIAASRogCCADNgIIIAMgCDYCDAwLCwJAIABBFGoiBSgCACIDDQAgACgCECIDRQ0DIABBEGohBQsDQCAFIQsgAyIIQRRqIgUoAgAiAw0AIAhBEGohBSAIKAIQIgMNAAsgC0EANgIADAoLQX8hAiAAQb9/Sw0AIABBE2oiA0FwcSECQQAoAozQgIAAIgdFDQBBACELAkAgAkGAAkkNAEEfIQsgAkH///8HSw0AIANBCHYiAyADQYD+P2pBEHZBCHEiA3QiBCAEQYDgH2pBEHZBBHEiBHQiBSAFQYCAD2pBEHZBAnEiBXRBD3YgAyAEciAFcmsiA0EBdCACIANBFWp2QQFxckEcaiELC0EAIAJrIQQCQAJAAkACQCALQQJ0QbjSgIAAaigCACIFDQBBACEDQQAhCAwBC0EAIQMgAkEAQRkgC0EBdmsgC0EfRht0IQBBACEIA0ACQCAFKAIEQXhxIAJrIgYgBE8NACAGIQQgBSEIIAYNAEEAIQQgBSEIIAUhAwwDCyADIAVBFGooAgAiBiAGIAUgAEEddkEEcWpBEGooAgAiBUYbIAMgBhshAyAAQQF0IQAgBQ0ACwsCQCADIAhyDQBBACEIQQIgC3QiA0EAIANrciAHcSIDRQ0DIANBACADa3FBf2oiAyADQQx2QRBxIgN2IgVBBXZBCHEiACADciAFIAB2IgNBAnZBBHEiBXIgAyAFdiIDQQF2QQJxIgVyIAMgBXYiA0EBdkEBcSIFciADIAV2akECdEG40oCAAGooAgAhAwsgA0UNAQsDQCADKAIEQXhxIAJrIgYgBEkhAAJAIAMoAhAiBQ0AIANBFGooAgAhBQsgBiAEIAAbIQQgAyAIIAAbIQggBSEDIAUNAAsLIAhFDQAgBEEAKAKQ0ICAACACa08NACAIKAIYIQsCQCAIKAIMIgAgCEYNACAIKAIIIgNBACgCmNCAgABJGiAAIAM2AgggAyAANgIMDAkLAkAgCEEUaiIFKAIAIgMNACAIKAIQIgNFDQMgCEEQaiEFCwNAIAUhBiADIgBBFGoiBSgCACIDDQAgAEEQaiEFIAAoAhAiAw0ACyAGQQA2AgAMCAsCQEEAKAKQ0ICAACIDIAJJDQBBACgCnNCAgAAhBAJAAkAgAyACayIFQRBJDQAgBCACaiIAIAVBAXI2AgRBACAFNgKQ0ICAAEEAIAA2ApzQgIAAIAQgA2ogBTYCACAEIAJBA3I2AgQMAQsgBCADQQNyNgIEIAQgA2oiAyADKAIEQQFyNgIEQQBBADYCnNCAgABBAEEANgKQ0ICAAAsgBEEIaiEDDAoLAkBBACgClNCAgAAiACACTQ0AQQAoAqDQgIAAIgMgAmoiBCAAIAJrIgVBAXI2AgRBACAFNgKU0ICAAEEAIAQ2AqDQgIAAIAMgAkEDcjYCBCADQQhqIQMMCgsCQAJAQQAoAuDTgIAARQ0AQQAoAujTgIAAIQQMAQtBAEJ/NwLs04CAAEEAQoCAhICAgMAANwLk04CAAEEAIAFBDGpBcHFB2KrVqgVzNgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgABBgIAEIQQLQQAhAwJAIAQgAkHHAGoiB2oiBkEAIARrIgtxIgggAksNAEEAQTA2AvjTgIAADAoLAkBBACgCwNOAgAAiA0UNAAJAQQAoArjTgIAAIgQgCGoiBSAETQ0AIAUgA00NAQtBACEDQQBBMDYC+NOAgAAMCgtBAC0AxNOAgABBBHENBAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQAJAIAMoAgAiBSAESw0AIAUgAygCBGogBEsNAwsgAygCCCIDDQALC0EAEMuAgIAAIgBBf0YNBSAIIQYCQEEAKALk04CAACIDQX9qIgQgAHFFDQAgCCAAayAEIABqQQAgA2txaiEGCyAGIAJNDQUgBkH+////B0sNBQJAQQAoAsDTgIAAIgNFDQBBACgCuNOAgAAiBCAGaiIFIARNDQYgBSADSw0GCyAGEMuAgIAAIgMgAEcNAQwHCyAGIABrIAtxIgZB/v///wdLDQQgBhDLgICAACIAIAMoAgAgAygCBGpGDQMgACEDCwJAIANBf0YNACACQcgAaiAGTQ0AAkAgByAGa0EAKALo04CAACIEakEAIARrcSIEQf7///8HTQ0AIAMhAAwHCwJAIAQQy4CAgABBf0YNACAEIAZqIQYgAyEADAcLQQAgBmsQy4CAgAAaDAQLIAMhACADQX9HDQUMAwtBACEIDAcLQQAhAAwFCyAAQX9HDQILQQBBACgCxNOAgABBBHI2AsTTgIAACyAIQf7///8HSw0BIAgQy4CAgAAhAEEAEMuAgIAAIQMgAEF/Rg0BIANBf0YNASAAIANPDQEgAyAAayIGIAJBOGpNDQELQQBBACgCuNOAgAAgBmoiAzYCuNOAgAACQCADQQAoArzTgIAATQ0AQQAgAzYCvNOAgAALAkACQAJAAkBBACgCoNCAgAAiBEUNAEHI04CAACEDA0AgACADKAIAIgUgAygCBCIIakYNAiADKAIIIgMNAAwDCwsCQAJAQQAoApjQgIAAIgNFDQAgACADTw0BC0EAIAA2ApjQgIAAC0EAIQNBACAGNgLM04CAAEEAIAA2AsjTgIAAQQBBfzYCqNCAgABBAEEAKALg04CAADYCrNCAgABBAEEANgLU04CAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgQgBkFIaiIFIANrIgNBAXI2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAIAAgBWpBODYCBAwCCyADLQAMQQhxDQAgBCAFSQ0AIAQgAE8NACAEQXggBGtBD3FBACAEQQhqQQ9xGyIFaiIAQQAoApTQgIAAIAZqIgsgBWsiBUEBcjYCBCADIAggBmo2AgRBAEEAKALw04CAADYCpNCAgABBACAFNgKU0ICAAEEAIAA2AqDQgIAAIAQgC2pBODYCBAwBCwJAIABBACgCmNCAgAAiCE8NAEEAIAA2ApjQgIAAIAAhCAsgACAGaiEFQcjTgIAAIQMCQAJAAkACQAJAAkACQANAIAMoAgAgBUYNASADKAIIIgMNAAwCCwsgAy0ADEEIcUUNAQtByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiIFIARLDQMLIAMoAgghAwwACwsgAyAANgIAIAMgAygCBCAGajYCBCAAQXggAGtBD3FBACAAQQhqQQ9xG2oiCyACQQNyNgIEIAVBeCAFa0EPcUEAIAVBCGpBD3EbaiIGIAsgAmoiAmshAwJAIAYgBEcNAEEAIAI2AqDQgIAAQQBBACgClNCAgAAgA2oiAzYClNCAgAAgAiADQQFyNgIEDAMLAkAgBkEAKAKc0ICAAEcNAEEAIAI2ApzQgIAAQQBBACgCkNCAgAAgA2oiAzYCkNCAgAAgAiADQQFyNgIEIAIgA2ogAzYCAAwDCwJAIAYoAgQiBEEDcUEBRw0AIARBeHEhBwJAAkAgBEH/AUsNACAGKAIIIgUgBEEDdiIIQQN0QbDQgIAAaiIARhoCQCAGKAIMIgQgBUcNAEEAQQAoAojQgIAAQX4gCHdxNgKI0ICAAAwCCyAEIABGGiAEIAU2AgggBSAENgIMDAELIAYoAhghCQJAAkAgBigCDCIAIAZGDQAgBigCCCIEIAhJGiAAIAQ2AgggBCAANgIMDAELAkAgBkEUaiIEKAIAIgUNACAGQRBqIgQoAgAiBQ0AQQAhAAwBCwNAIAQhCCAFIgBBFGoiBCgCACIFDQAgAEEQaiEEIAAoAhAiBQ0ACyAIQQA2AgALIAlFDQACQAJAIAYgBigCHCIFQQJ0QbjSgIAAaiIEKAIARw0AIAQgADYCACAADQFBAEEAKAKM0ICAAEF+IAV3cTYCjNCAgAAMAgsgCUEQQRQgCSgCECAGRhtqIAA2AgAgAEUNAQsgACAJNgIYAkAgBigCECIERQ0AIAAgBDYCECAEIAA2AhgLIAYoAhQiBEUNACAAQRRqIAQ2AgAgBCAANgIYCyAHIANqIQMgBiAHaiIGKAIEIQQLIAYgBEF+cTYCBCACIANqIAM2AgAgAiADQQFyNgIEAkAgA0H/AUsNACADQXhxQbDQgIAAaiEEAkACQEEAKAKI0ICAACIFQQEgA0EDdnQiA3ENAEEAIAUgA3I2AojQgIAAIAQhAwwBCyAEKAIIIQMLIAMgAjYCDCAEIAI2AgggAiAENgIMIAIgAzYCCAwDC0EfIQQCQCADQf///wdLDQAgA0EIdiIEIARBgP4/akEQdkEIcSIEdCIFIAVBgOAfakEQdkEEcSIFdCIAIABBgIAPakEQdkECcSIAdEEPdiAEIAVyIAByayIEQQF0IAMgBEEVanZBAXFyQRxqIQQLIAIgBDYCHCACQgA3AhAgBEECdEG40oCAAGohBQJAQQAoAozQgIAAIgBBASAEdCIIcQ0AIAUgAjYCAEEAIAAgCHI2AozQgIAAIAIgBTYCGCACIAI2AgggAiACNgIMDAMLIANBAEEZIARBAXZrIARBH0YbdCEEIAUoAgAhAANAIAAiBSgCBEF4cSADRg0CIARBHXYhACAEQQF0IQQgBSAAQQRxakEQaiIIKAIAIgANAAsgCCACNgIAIAIgBTYCGCACIAI2AgwgAiACNgIIDAILIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgsgBkFIaiIIIANrIgNBAXI2AgQgACAIakE4NgIEIAQgBUE3IAVrQQ9xQQAgBUFJakEPcRtqQUFqIgggCCAEQRBqSRsiCEEjNgIEQQBBACgC8NOAgAA2AqTQgIAAQQAgAzYClNCAgABBACALNgKg0ICAACAIQRBqQQApAtDTgIAANwIAIAhBACkCyNOAgAA3AghBACAIQQhqNgLQ04CAAEEAIAY2AszTgIAAQQAgADYCyNOAgABBAEEANgLU04CAACAIQSRqIQMDQCADQQc2AgAgA0EEaiIDIAVJDQALIAggBEYNAyAIIAgoAgRBfnE2AgQgCCAIIARrIgA2AgAgBCAAQQFyNgIEAkAgAEH/AUsNACAAQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgAEEDdnQiAHENAEEAIAUgAHI2AojQgIAAIAMhBQwBCyADKAIIIQULIAUgBDYCDCADIAQ2AgggBCADNgIMIAQgBTYCCAwEC0EfIQMCQCAAQf///wdLDQAgAEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCIIIAhBgIAPakEQdkECcSIIdEEPdiADIAVyIAhyayIDQQF0IAAgA0EVanZBAXFyQRxqIQMLIAQgAzYCHCAEQgA3AhAgA0ECdEG40oCAAGohBQJAQQAoAozQgIAAIghBASADdCIGcQ0AIAUgBDYCAEEAIAggBnI2AozQgIAAIAQgBTYCGCAEIAQ2AgggBCAENgIMDAQLIABBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhCANAIAgiBSgCBEF4cSAARg0DIANBHXYhCCADQQF0IQMgBSAIQQRxakEQaiIGKAIAIggNAAsgBiAENgIAIAQgBTYCGCAEIAQ2AgwgBCAENgIIDAMLIAUoAggiAyACNgIMIAUgAjYCCCACQQA2AhggAiAFNgIMIAIgAzYCCAsgC0EIaiEDDAULIAUoAggiAyAENgIMIAUgBDYCCCAEQQA2AhggBCAFNgIMIAQgAzYCCAtBACgClNCAgAAiAyACTQ0AQQAoAqDQgIAAIgQgAmoiBSADIAJrIgNBAXI2AgRBACADNgKU0ICAAEEAIAU2AqDQgIAAIAQgAkEDcjYCBCAEQQhqIQMMAwtBACEDQQBBMDYC+NOAgAAMAgsCQCALRQ0AAkACQCAIIAgoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAA2AgAgAA0BQQAgB0F+IAV3cSIHNgKM0ICAAAwCCyALQRBBFCALKAIQIAhGG2ogADYCACAARQ0BCyAAIAs2AhgCQCAIKAIQIgNFDQAgACADNgIQIAMgADYCGAsgCEEUaigCACIDRQ0AIABBFGogAzYCACADIAA2AhgLAkACQCAEQQ9LDQAgCCAEIAJqIgNBA3I2AgQgCCADaiIDIAMoAgRBAXI2AgQMAQsgCCACaiIAIARBAXI2AgQgCCACQQNyNgIEIAAgBGogBDYCAAJAIARB/wFLDQAgBEF4cUGw0ICAAGohAwJAAkBBACgCiNCAgAAiBUEBIARBA3Z0IgRxDQBBACAFIARyNgKI0ICAACADIQQMAQsgAygCCCEECyAEIAA2AgwgAyAANgIIIAAgAzYCDCAAIAQ2AggMAQtBHyEDAkAgBEH///8HSw0AIARBCHYiAyADQYD+P2pBEHZBCHEiA3QiBSAFQYDgH2pBEHZBBHEiBXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgAyAFciACcmsiA0EBdCAEIANBFWp2QQFxckEcaiEDCyAAIAM2AhwgAEIANwIQIANBAnRBuNKAgABqIQUCQCAHQQEgA3QiAnENACAFIAA2AgBBACAHIAJyNgKM0ICAACAAIAU2AhggACAANgIIIAAgADYCDAwBCyAEQQBBGSADQQF2ayADQR9GG3QhAyAFKAIAIQICQANAIAIiBSgCBEF4cSAERg0BIANBHXYhAiADQQF0IQMgBSACQQRxakEQaiIGKAIAIgINAAsgBiAANgIAIAAgBTYCGCAAIAA2AgwgACAANgIIDAELIAUoAggiAyAANgIMIAUgADYCCCAAQQA2AhggACAFNgIMIAAgAzYCCAsgCEEIaiEDDAELAkAgCkUNAAJAAkAgACAAKAIcIgVBAnRBuNKAgABqIgMoAgBHDQAgAyAINgIAIAgNAUEAIAlBfiAFd3E2AozQgIAADAILIApBEEEUIAooAhAgAEYbaiAINgIAIAhFDQELIAggCjYCGAJAIAAoAhAiA0UNACAIIAM2AhAgAyAINgIYCyAAQRRqKAIAIgNFDQAgCEEUaiADNgIAIAMgCDYCGAsCQAJAIARBD0sNACAAIAQgAmoiA0EDcjYCBCAAIANqIgMgAygCBEEBcjYCBAwBCyAAIAJqIgUgBEEBcjYCBCAAIAJBA3I2AgQgBSAEaiAENgIAAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQMCQAJAQQEgB0EDdnQiCCAGcQ0AQQAgCCAGcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCADNgIMIAIgAzYCCCADIAI2AgwgAyAINgIIC0EAIAU2ApzQgIAAQQAgBDYCkNCAgAALIABBCGohAwsgAUEQaiSAgICAACADCwoAIAAQyYCAgAAL4g0BB38CQCAARQ0AIABBeGoiASAAQXxqKAIAIgJBeHEiAGohAwJAIAJBAXENACACQQNxRQ0BIAEgASgCACICayIBQQAoApjQgIAAIgRJDQEgAiAAaiEAAkAgAUEAKAKc0ICAAEYNAAJAIAJB/wFLDQAgASgCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgASgCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAwsgAiAGRhogAiAENgIIIAQgAjYCDAwCCyABKAIYIQcCQAJAIAEoAgwiBiABRg0AIAEoAggiAiAESRogBiACNgIIIAIgBjYCDAwBCwJAIAFBFGoiAigCACIEDQAgAUEQaiICKAIAIgQNAEEAIQYMAQsDQCACIQUgBCIGQRRqIgIoAgAiBA0AIAZBEGohAiAGKAIQIgQNAAsgBUEANgIACyAHRQ0BAkACQCABIAEoAhwiBEECdEG40oCAAGoiAigCAEcNACACIAY2AgAgBg0BQQBBACgCjNCAgABBfiAEd3E2AozQgIAADAMLIAdBEEEUIAcoAhAgAUYbaiAGNgIAIAZFDQILIAYgBzYCGAJAIAEoAhAiAkUNACAGIAI2AhAgAiAGNgIYCyABKAIUIgJFDQEgBkEUaiACNgIAIAIgBjYCGAwBCyADKAIEIgJBA3FBA0cNACADIAJBfnE2AgRBACAANgKQ0ICAACABIABqIAA2AgAgASAAQQFyNgIEDwsgASADTw0AIAMoAgQiAkEBcUUNAAJAAkAgAkECcQ0AAkAgA0EAKAKg0ICAAEcNAEEAIAE2AqDQgIAAQQBBACgClNCAgAAgAGoiADYClNCAgAAgASAAQQFyNgIEIAFBACgCnNCAgABHDQNBAEEANgKQ0ICAAEEAQQA2ApzQgIAADwsCQCADQQAoApzQgIAARw0AQQAgATYCnNCAgABBAEEAKAKQ0ICAACAAaiIANgKQ0ICAACABIABBAXI2AgQgASAAaiAANgIADwsgAkF4cSAAaiEAAkACQCACQf8BSw0AIAMoAggiBCACQQN2IgVBA3RBsNCAgABqIgZGGgJAIAMoAgwiAiAERw0AQQBBACgCiNCAgABBfiAFd3E2AojQgIAADAILIAIgBkYaIAIgBDYCCCAEIAI2AgwMAQsgAygCGCEHAkACQCADKAIMIgYgA0YNACADKAIIIgJBACgCmNCAgABJGiAGIAI2AgggAiAGNgIMDAELAkAgA0EUaiICKAIAIgQNACADQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQACQAJAIAMgAygCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAgsgB0EQQRQgBygCECADRhtqIAY2AgAgBkUNAQsgBiAHNgIYAkAgAygCECICRQ0AIAYgAjYCECACIAY2AhgLIAMoAhQiAkUNACAGQRRqIAI2AgAgAiAGNgIYCyABIABqIAA2AgAgASAAQQFyNgIEIAFBACgCnNCAgABHDQFBACAANgKQ0ICAAA8LIAMgAkF+cTYCBCABIABqIAA2AgAgASAAQQFyNgIECwJAIABB/wFLDQAgAEF4cUGw0ICAAGohAgJAAkBBACgCiNCAgAAiBEEBIABBA3Z0IgBxDQBBACAEIAByNgKI0ICAACACIQAMAQsgAigCCCEACyAAIAE2AgwgAiABNgIIIAEgAjYCDCABIAA2AggPC0EfIQICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgBB+IQYgAyAFaiEBA0AgASAGNwMYIAEgBjcDECABIAY3AwggASAGNwMAIAFBIGohASACQWBqIgJBH0sNAAsLIAALC45IAQBBgAgLhkgBAAAAAgAAAAMAAAAAAAAAAAAAAAQAAAAFAAAAAAAAAAAAAAAGAAAABwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEludmFsaWQgY2hhciBpbiB1cmwgcXVlcnkAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9ib2R5AENvbnRlbnQtTGVuZ3RoIG92ZXJmbG93AENodW5rIHNpemUgb3ZlcmZsb3cAUmVzcG9uc2Ugb3ZlcmZsb3cASW52YWxpZCBtZXRob2QgZm9yIEhUVFAveC54IHJlcXVlc3QASW52YWxpZCBtZXRob2QgZm9yIFJUU1AveC54IHJlcXVlc3QARXhwZWN0ZWQgU09VUkNFIG1ldGhvZCBmb3IgSUNFL3gueCByZXF1ZXN0AEludmFsaWQgY2hhciBpbiB1cmwgZnJhZ21lbnQgc3RhcnQARXhwZWN0ZWQgZG90AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fc3RhdHVzAEludmFsaWQgcmVzcG9uc2Ugc3RhdHVzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8="},16594:r=>{r.exports="AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AcsBygG4AckBuQHIAboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBANwBC0EAIRAMxgELQQ4hEAzFAQtBDSEQDMQBC0EPIRAMwwELQRAhEAzCAQtBEyEQDMEBC0EUIRAMwAELQRUhEAy/AQtBFiEQDL4BC0EXIRAMvQELQRghEAy8AQtBGSEQDLsBC0EaIRAMugELQRshEAy5AQtBHCEQDLgBC0EIIRAMtwELQR0hEAy2AQtBICEQDLUBC0EfIRAMtAELQQchEAyzAQtBISEQDLIBC0EiIRAMsQELQR4hEAywAQtBIyEQDK8BC0ESIRAMrgELQREhEAytAQtBJCEQDKwBC0ElIRAMqwELQSYhEAyqAQtBJyEQDKkBC0HDASEQDKgBC0EpIRAMpwELQSshEAymAQtBLCEQDKUBC0EtIRAMpAELQS4hEAyjAQtBLyEQDKIBC0HEASEQDKEBC0EwIRAMoAELQTQhEAyfAQtBDCEQDJ4BC0ExIRAMnQELQTIhEAycAQtBMyEQDJsBC0E5IRAMmgELQTUhEAyZAQtBxQEhEAyYAQtBCyEQDJcBC0E6IRAMlgELQTYhEAyVAQtBCiEQDJQBC0E3IRAMkwELQTghEAySAQtBPCEQDJEBC0E7IRAMkAELQT0hEAyPAQtBCSEQDI4BC0EoIRAMjQELQT4hEAyMAQtBPyEQDIsBC0HAACEQDIoBC0HBACEQDIkBC0HCACEQDIgBC0HDACEQDIcBC0HEACEQDIYBC0HFACEQDIUBC0HGACEQDIQBC0EqIRAMgwELQccAIRAMggELQcgAIRAMgQELQckAIRAMgAELQcoAIRAMfwtBywAhEAx+C0HNACEQDH0LQcwAIRAMfAtBzgAhEAx7C0HPACEQDHoLQdAAIRAMeQtB0QAhEAx4C0HSACEQDHcLQdMAIRAMdgtB1AAhEAx1C0HWACEQDHQLQdUAIRAMcwtBBiEQDHILQdcAIRAMcQtBBSEQDHALQdgAIRAMbwtBBCEQDG4LQdkAIRAMbQtB2gAhEAxsC0HbACEQDGsLQdwAIRAMagtBAyEQDGkLQd0AIRAMaAtB3gAhEAxnC0HfACEQDGYLQeEAIRAMZQtB4AAhEAxkC0HiACEQDGMLQeMAIRAMYgtBAiEQDGELQeQAIRAMYAtB5QAhEAxfC0HmACEQDF4LQecAIRAMXQtB6AAhEAxcC0HpACEQDFsLQeoAIRAMWgtB6wAhEAxZC0HsACEQDFgLQe0AIRAMVwtB7gAhEAxWC0HvACEQDFULQfAAIRAMVAtB8QAhEAxTC0HyACEQDFILQfMAIRAMUQtB9AAhEAxQC0H1ACEQDE8LQfYAIRAMTgtB9wAhEAxNC0H4ACEQDEwLQfkAIRAMSwtB+gAhEAxKC0H7ACEQDEkLQfwAIRAMSAtB/QAhEAxHC0H+ACEQDEYLQf8AIRAMRQtBgAEhEAxEC0GBASEQDEMLQYIBIRAMQgtBgwEhEAxBC0GEASEQDEALQYUBIRAMPwtBhgEhEAw+C0GHASEQDD0LQYgBIRAMPAtBiQEhEAw7C0GKASEQDDoLQYsBIRAMOQtBjAEhEAw4C0GNASEQDDcLQY4BIRAMNgtBjwEhEAw1C0GQASEQDDQLQZEBIRAMMwtBkgEhEAwyC0GTASEQDDELQZQBIRAMMAtBlQEhEAwvC0GWASEQDC4LQZcBIRAMLQtBmAEhEAwsC0GZASEQDCsLQZoBIRAMKgtBmwEhEAwpC0GcASEQDCgLQZ0BIRAMJwtBngEhEAwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQM2gMLAkAgAS0AACIQQTtGDQAgEEENRw3oASABQQFqIQEM5QILIAFBAWohAQtBIiEQDL8DCwJAIAEiECACRw0AQRwhEAzYAwtCACERIBAhASAQLQAAQVBqDjfnAeYBAQIDBAUGBwgAAAAAAAAACQoLDA0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBESExQAC0EeIRAMvQMLQgIhEQzlAQtCAyERDOQBC0IEIREM4wELQgUhEQziAQtCBiERDOEBC0IHIREM4AELQgghEQzfAQtCCSERDN4BC0IKIREM3QELQgshEQzcAQtCDCERDNsBC0INIREM2gELQg4hEQzZAQtCDyERDNgBC0IKIREM1wELQgshEQzWAQtCDCERDNUBC0INIREM1AELQg4hEQzTAQtCDyERDNIBC0IAIRECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAtAABBUGoON+UB5AEAAQIDBAUGB+YB5gHmAeYB5gHmAeYBCAkKCwwN5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAQ4PEBESE+YBC0ICIREM5AELQgMhEQzjAQtCBCERDOIBC0IFIREM4QELQgYhEQzgAQtCByERDN8BC0IIIREM3gELQgkhEQzdAQtCCiERDNwBC0ILIREM2wELQgwhEQzaAQtCDSERDNkBC0IOIREM2AELQg8hEQzXAQtCCiERDNYBC0ILIREM1QELQgwhEQzUAQtCDSERDNMBC0IOIREM0gELQg8hEQzRAQsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3SAUEfIRAMwAMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQSQhEAynAwtBICEQDL8DCyAAIAEiECACEL6AgIAAQX9qDgW2AQDFAgHRAdIBC0ERIRAMpAMLIABBAToALyAQIQEMuwMLIAEiASACRw3SAUEkIRAMuwMLIAEiDSACRw0eQcYAIRAMugMLIAAgASIBIAIQsoCAgAAiEA3UASABIQEMtQELIAEiECACRw0mQdAAIRAMuAMLAkAgASIBIAJHDQBBKCEQDLgDCyAAQQA2AgQgAEGMgICAADYCCCAAIAEgARCxgICAACIQDdMBIAEhAQzYAQsCQCABIhAgAkcNAEEpIRAMtwMLIBAtAAAiAUEgRg0UIAFBCUcN0wEgEEEBaiEBDBULAkAgASIBIAJGDQAgAUEBaiEBDBcLQSohEAy1AwsCQCABIhAgAkcNAEErIRAMtQMLAkAgEC0AACIBQQlGDQAgAUEgRw3VAQsgAC0ALEEIRg3TASAQIQEMkQMLAkAgASIBIAJHDQBBLCEQDLQDCyABLQAAQQpHDdUBIAFBAWohAQzJAgsgASIOIAJHDdUBQS8hEAyyAwsDQAJAIAEtAAAiEEEgRg0AAkAgEEF2ag4EANwB3AEA2gELIAEhAQzgAQsgAUEBaiIBIAJHDQALQTEhEAyxAwtBMiEQIAEiFCACRg2wAyACIBRrIAAoAgAiAWohFSAUIAFrQQNqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB8LuAgABqLQAARw0BAkAgAUEDRw0AQQYhAQyWAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMsQMLIABBADYCACAUIQEM2QELQTMhECABIhQgAkYNrwMgAiAUayAAKAIAIgFqIRUgFCABa0EIaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfS7gIAAai0AAEcNAQJAIAFBCEcNAEEFIQEMlQMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLADCyAAQQA2AgAgFCEBDNgBC0E0IRAgASIUIAJGDa4DIAIgFGsgACgCACIBaiEVIBQgAWtBBWohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUHQwoCAAGotAABHDQECQCABQQVHDQBBByEBDJQDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAyvAwsgAEEANgIAIBQhAQzXAQsCQCABIgEgAkYNAANAAkAgAS0AAEGAvoCAAGotAAAiEEEBRg0AIBBBAkYNCiABIQEM3QELIAFBAWoiASACRw0AC0EwIRAMrgMLQTAhEAytAwsCQCABIgEgAkYNAANAAkAgAS0AACIQQSBGDQAgEEF2ag4E2QHaAdoB2QHaAQsgAUEBaiIBIAJHDQALQTghEAytAwtBOCEQDKwDCwNAAkAgAS0AACIQQSBGDQAgEEEJRw0DCyABQQFqIgEgAkcNAAtBPCEQDKsDCwNAAkAgAS0AACIQQSBGDQACQAJAIBBBdmoOBNoBAQHaAQALIBBBLEYN2wELIAEhAQwECyABQQFqIgEgAkcNAAtBPyEQDKoDCyABIQEM2wELQcAAIRAgASIUIAJGDagDIAIgFGsgACgCACIBaiEWIBQgAWtBBmohFwJAA0AgFC0AAEEgciABQYDAgIAAai0AAEcNASABQQZGDY4DIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADKkDCyAAQQA2AgAgFCEBC0E2IRAMjgMLAkAgASIPIAJHDQBBwQAhEAynAwsgAEGMgICAADYCCCAAIA82AgQgDyEBIAAtACxBf2oOBM0B1QHXAdkBhwMLIAFBAWohAQzMAQsCQCABIgEgAkYNAANAAkAgAS0AACIQQSByIBAgEEG/f2pB/wFxQRpJG0H/AXEiEEEJRg0AIBBBIEYNAAJAAkACQAJAIBBBnX9qDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTEhEAyRAwsgAUEBaiEBQTIhEAyQAwsgAUEBaiEBQTMhEAyPAwsgASEBDNABCyABQQFqIgEgAkcNAAtBNSEQDKUDC0E1IRAMpAMLAkAgASIBIAJGDQADQAJAIAEtAABBgLyAgABqLQAAQQFGDQAgASEBDNMBCyABQQFqIgEgAkcNAAtBPSEQDKQDC0E9IRAMowMLIAAgASIBIAIQsICAgAAiEA3WASABIQEMAQsgEEEBaiEBC0E8IRAMhwMLAkAgASIBIAJHDQBBwgAhEAygAwsCQANAAkAgAS0AAEF3ag4YAAL+Av4ChAP+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gIA/gILIAFBAWoiASACRw0AC0HCACEQDKADCyABQQFqIQEgAC0ALUEBcUUNvQEgASEBC0EsIRAMhQMLIAEiASACRw3TAUHEACEQDJ0DCwNAAkAgAS0AAEGQwICAAGotAABBAUYNACABIQEMtwILIAFBAWoiASACRw0AC0HFACEQDJwDCyANLQAAIhBBIEYNswEgEEE6Rw2BAyAAKAIEIQEgAEEANgIEIAAgASANEK+AgIAAIgEN0AEgDUEBaiEBDLMCC0HHACEQIAEiDSACRg2aAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQZDCgIAAai0AAEcNgAMgAUEFRg30AiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyaAwtByAAhECABIg0gAkYNmQMgAiANayAAKAIAIgFqIRYgDSABa0EJaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGWwoCAAGotAABHDf8CAkAgAUEJRw0AQQIhAQz1AgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmQMLAkAgASINIAJHDQBByQAhEAyZAwsCQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZJ/ag4HAIADgAOAA4ADgAMBgAMLIA1BAWohAUE+IRAMgAMLIA1BAWohAUE/IRAM/wILQcoAIRAgASINIAJGDZcDIAIgDWsgACgCACIBaiEWIA0gAWtBAWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBoMKAgABqLQAARw39AiABQQFGDfACIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJcDC0HLACEQIAEiDSACRg2WAyACIA1rIAAoAgAiAWohFiANIAFrQQ5qIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaLCgIAAai0AAEcN/AIgAUEORg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyWAwtBzAAhECABIg0gAkYNlQMgAiANayAAKAIAIgFqIRYgDSABa0EPaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUHAwoCAAGotAABHDfsCAkAgAUEPRw0AQQMhAQzxAgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlQMLQc0AIRAgASINIAJGDZQDIAIgDWsgACgCACIBaiEWIA0gAWtBBWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw36AgJAIAFBBUcNAEEEIQEM8AILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJQDCwJAIAEiDSACRw0AQc4AIRAMlAMLAkACQAJAAkAgDS0AACIBQSByIAEgAUG/f2pB/wFxQRpJG0H/AXFBnX9qDhMA/QL9Av0C/QL9Av0C/QL9Av0C/QL9Av0CAf0C/QL9AgID/QILIA1BAWohAUHBACEQDP0CCyANQQFqIQFBwgAhEAz8AgsgDUEBaiEBQcMAIRAM+wILIA1BAWohAUHEACEQDPoCCwJAIAEiASACRg0AIABBjYCAgAA2AgggACABNgIEIAEhAUHFACEQDPoCC0HPACEQDJIDCyAQIQECQAJAIBAtAABBdmoOBAGoAqgCAKgCCyAQQQFqIQELQSchEAz4AgsCQCABIgEgAkcNAEHRACEQDJEDCwJAIAEtAABBIEYNACABIQEMjQELIAFBAWohASAALQAtQQFxRQ3HASABIQEMjAELIAEiFyACRw3IAUHSACEQDI8DC0HTACEQIAEiFCACRg2OAyACIBRrIAAoAgAiAWohFiAUIAFrQQFqIRcDQCAULQAAIAFB1sKAgABqLQAARw3MASABQQFGDccBIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADI4DCwJAIAEiASACRw0AQdUAIRAMjgMLIAEtAABBCkcNzAEgAUEBaiEBDMcBCwJAIAEiASACRw0AQdYAIRAMjQMLAkACQCABLQAAQXZqDgQAzQHNAQHNAQsgAUEBaiEBDMcBCyABQQFqIQFBygAhEAzzAgsgACABIgEgAhCugICAACIQDcsBIAEhAUHNACEQDPICCyAALQApQSJGDYUDDKYCCwJAIAEiASACRw0AQdsAIRAMigMLQQAhFEEBIRdBASEWQQAhEAJAAkACQAJAAkACQAJAAkACQCABLQAAQVBqDgrUAdMBAAECAwQFBgjVAQtBAiEQDAYLQQMhEAwFC0EEIRAMBAtBBSEQDAMLQQYhEAwCC0EHIRAMAQtBCCEQC0EAIRdBACEWQQAhFAzMAQtBCSEQQQEhFEEAIRdBACEWDMsBCwJAIAEiASACRw0AQd0AIRAMiQMLIAEtAABBLkcNzAEgAUEBaiEBDKYCCyABIgEgAkcNzAFB3wAhEAyHAwsCQCABIgEgAkYNACAAQY6AgIAANgIIIAAgATYCBCABIQFB0AAhEAzuAgtB4AAhEAyGAwtB4QAhECABIgEgAkYNhQMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQeLCgIAAai0AAEcNzQEgFEEDRg3MASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyFAwtB4gAhECABIgEgAkYNhAMgAiABayAAKAIAIhRqIRYgASAUa0ECaiEXA0AgAS0AACAUQebCgIAAai0AAEcNzAEgFEECRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyEAwtB4wAhECABIgEgAkYNgwMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQenCgIAAai0AAEcNywEgFEEDRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyDAwsCQCABIgEgAkcNAEHlACEQDIMDCyAAIAFBAWoiASACEKiAgIAAIhANzQEgASEBQdYAIRAM6QILAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AAkACQAJAIBBBuH9qDgsAAc8BzwHPAc8BzwHPAc8BzwECzwELIAFBAWohAUHSACEQDO0CCyABQQFqIQFB0wAhEAzsAgsgAUEBaiEBQdQAIRAM6wILIAFBAWoiASACRw0AC0HkACEQDIIDC0HkACEQDIEDCwNAAkAgAS0AAEHwwoCAAGotAAAiEEEBRg0AIBBBfmoOA88B0AHRAdIBCyABQQFqIgEgAkcNAAtB5gAhEAyAAwsCQCABIgEgAkYNACABQQFqIQEMAwtB5wAhEAz/AgsDQAJAIAEtAABB8MSAgABqLQAAIhBBAUYNAAJAIBBBfmoOBNIB0wHUAQDVAQsgASEBQdcAIRAM5wILIAFBAWoiASACRw0AC0HoACEQDP4CCwJAIAEiASACRw0AQekAIRAM/gILAkAgAS0AACIQQXZqDhq6AdUB1QG8AdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAcoB1QHVAQDTAQsgAUEBaiEBC0EGIRAM4wILA0ACQCABLQAAQfDGgIAAai0AAEEBRg0AIAEhAQyeAgsgAUEBaiIBIAJHDQALQeoAIRAM+wILAkAgASIBIAJGDQAgAUEBaiEBDAMLQesAIRAM+gILAkAgASIBIAJHDQBB7AAhEAz6AgsgAUEBaiEBDAELAkAgASIBIAJHDQBB7QAhEAz5AgsgAUEBaiEBC0EEIRAM3gILAkAgASIUIAJHDQBB7gAhEAz3AgsgFCEBAkACQAJAIBQtAABB8MiAgABqLQAAQX9qDgfUAdUB1gEAnAIBAtcBCyAUQQFqIQEMCgsgFEEBaiEBDM0BC0EAIRAgAEEANgIcIABBm5KAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAz2AgsCQANAAkAgAS0AAEHwyICAAGotAAAiEEEERg0AAkACQCAQQX9qDgfSAdMB1AHZAQAEAdkBCyABIQFB2gAhEAzgAgsgAUEBaiEBQdwAIRAM3wILIAFBAWoiASACRw0AC0HvACEQDPYCCyABQQFqIQEMywELAkAgASIUIAJHDQBB8AAhEAz1AgsgFC0AAEEvRw3UASAUQQFqIQEMBgsCQCABIhQgAkcNAEHxACEQDPQCCwJAIBQtAAAiAUEvRw0AIBRBAWohAUHdACEQDNsCCyABQXZqIgRBFksN0wFBASAEdEGJgIACcUUN0wEMygILAkAgASIBIAJGDQAgAUEBaiEBQd4AIRAM2gILQfIAIRAM8gILAkAgASIUIAJHDQBB9AAhEAzyAgsgFCEBAkAgFC0AAEHwzICAAGotAABBf2oOA8kClAIA1AELQeEAIRAM2AILAkAgASIUIAJGDQADQAJAIBQtAABB8MqAgABqLQAAIgFBA0YNAAJAIAFBf2oOAssCANUBCyAUIQFB3wAhEAzaAgsgFEEBaiIUIAJHDQALQfMAIRAM8QILQfMAIRAM8AILAkAgASIBIAJGDQAgAEGPgICAADYCCCAAIAE2AgQgASEBQeAAIRAM1wILQfUAIRAM7wILAkAgASIBIAJHDQBB9gAhEAzvAgsgAEGPgICAADYCCCAAIAE2AgQgASEBC0EDIRAM1AILA0AgAS0AAEEgRw3DAiABQQFqIgEgAkcNAAtB9wAhEAzsAgsCQCABIgEgAkcNAEH4ACEQDOwCCyABLQAAQSBHDc4BIAFBAWohAQzvAQsgACABIgEgAhCsgICAACIQDc4BIAEhAQyOAgsCQCABIgQgAkcNAEH6ACEQDOoCCyAELQAAQcwARw3RASAEQQFqIQFBEyEQDM8BCwJAIAEiBCACRw0AQfsAIRAM6QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEANAIAQtAAAgAUHwzoCAAGotAABHDdABIAFBBUYNzgEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBB+wAhEAzoAgsCQCABIgQgAkcNAEH8ACEQDOgCCwJAAkAgBC0AAEG9f2oODADRAdEB0QHRAdEB0QHRAdEB0QHRAQHRAQsgBEEBaiEBQeYAIRAMzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGEASEQDOACCyAAQQA2AgAgEEEBaiEBQSMhEAzFAQsCQCABIgQgAkcNAEGFASEQDN8CCwJAAkAgBC0AAEG0f2oOCADIAcgByAHIAcgByAEByAELIARBAWohAUHvACEQDMYCCyAEQQFqIQFB8AAhEAzFAgsCQCABIgQgAkcNAEGGASEQDN4CCyAELQAAQcUARw3FASAEQQFqIQEMgwILAkAgASIEIAJHDQBBhwEhEAzdAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBiM+AgABqLQAARw3FASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhwEhEAzdAgsgAEEANgIAIBBBAWohAUEtIRAMwgELAkAgASIEIAJHDQBBiAEhEAzcAgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw3EASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiAEhEAzcAgsgAEEANgIAIBBBAWohAUEpIRAMwQELAkAgASIBIAJHDQBBiQEhEAzbAgtBASEQIAEtAABB3wBHDcABIAFBAWohAQyBAgsCQCABIgQgAkcNAEGKASEQDNoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRADQCAELQAAIAFBjM+AgABqLQAARw3BASABQQFGDa8CIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYoBIRAM2QILAkAgASIEIAJHDQBBiwEhEAzZAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBjs+AgABqLQAARw3BASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiwEhEAzZAgsgAEEANgIAIBBBAWohAUECIRAMvgELAkAgASIEIAJHDQBBjAEhEAzYAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw3AASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjAEhEAzYAgsgAEEANgIAIBBBAWohAUEfIRAMvQELAkAgASIEIAJHDQBBjQEhEAzXAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8s+AgABqLQAARw2/ASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjQEhEAzXAgsgAEEANgIAIBBBAWohAUEJIRAMvAELAkAgASIEIAJHDQBBjgEhEAzWAgsCQAJAIAQtAABBt39qDgcAvwG/Ab8BvwG/AQG/AQsgBEEBaiEBQfgAIRAMvQILIARBAWohAUH5ACEQDLwCCwJAIAEiBCACRw0AQY8BIRAM1QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQZHPgIAAai0AAEcNvQEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY8BIRAM1QILIABBADYCACAQQQFqIQFBGCEQDLoBCwJAIAEiBCACRw0AQZABIRAM1AILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQZfPgIAAai0AAEcNvAEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZABIRAM1AILIABBADYCACAQQQFqIQFBFyEQDLkBCwJAIAEiBCACRw0AQZEBIRAM0wILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQZrPgIAAai0AAEcNuwEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZEBIRAM0wILIABBADYCACAQQQFqIQFBFSEQDLgBCwJAIAEiBCACRw0AQZIBIRAM0gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQaHPgIAAai0AAEcNugEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZIBIRAM0gILIABBADYCACAQQQFqIQFBHiEQDLcBCwJAIAEiBCACRw0AQZMBIRAM0QILIAQtAABBzABHDbgBIARBAWohAUEKIRAMtgELAkAgBCACRw0AQZQBIRAM0AILAkACQCAELQAAQb9/ag4PALkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AbkBAbkBCyAEQQFqIQFB/gAhEAy3AgsgBEEBaiEBQf8AIRAMtgILAkAgBCACRw0AQZUBIRAMzwILAkACQCAELQAAQb9/ag4DALgBAbgBCyAEQQFqIQFB/QAhEAy2AgsgBEEBaiEEQYABIRAMtQILAkAgBCACRw0AQZYBIRAMzgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQafPgIAAai0AAEcNtgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZYBIRAMzgILIABBADYCACAQQQFqIQFBCyEQDLMBCwJAIAQgAkcNAEGXASEQDM0CCwJAAkACQAJAIAQtAABBU2oOIwC4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBAbgBuAG4AbgBuAECuAG4AbgBA7gBCyAEQQFqIQFB+wAhEAy2AgsgBEEBaiEBQfwAIRAMtQILIARBAWohBEGBASEQDLQCCyAEQQFqIQRBggEhEAyzAgsCQCAEIAJHDQBBmAEhEAzMAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBqc+AgABqLQAARw20ASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmAEhEAzMAgsgAEEANgIAIBBBAWohAUEZIRAMsQELAkAgBCACRw0AQZkBIRAMywILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQa7PgIAAai0AAEcNswEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZkBIRAMywILIABBADYCACAQQQFqIQFBBiEQDLABCwJAIAQgAkcNAEGaASEQDMoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG0z4CAAGotAABHDbIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGaASEQDMoCCyAAQQA2AgAgEEEBaiEBQRwhEAyvAQsCQCAEIAJHDQBBmwEhEAzJAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBts+AgABqLQAARw2xASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmwEhEAzJAgsgAEEANgIAIBBBAWohAUEnIRAMrgELAkAgBCACRw0AQZwBIRAMyAILAkACQCAELQAAQax/ag4CAAGxAQsgBEEBaiEEQYYBIRAMrwILIARBAWohBEGHASEQDK4CCwJAIAQgAkcNAEGdASEQDMcCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG4z4CAAGotAABHDa8BIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGdASEQDMcCCyAAQQA2AgAgEEEBaiEBQSYhEAysAQsCQCAEIAJHDQBBngEhEAzGAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBus+AgABqLQAARw2uASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBngEhEAzGAgsgAEEANgIAIBBBAWohAUEDIRAMqwELAkAgBCACRw0AQZ8BIRAMxQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNrQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ8BIRAMxQILIABBADYCACAQQQFqIQFBDCEQDKoBCwJAIAQgAkcNAEGgASEQDMQCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUG8z4CAAGotAABHDawBIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGgASEQDMQCCyAAQQA2AgAgEEEBaiEBQQ0hEAypAQsCQCAEIAJHDQBBoQEhEAzDAgsCQAJAIAQtAABBun9qDgsArAGsAawBrAGsAawBrAGsAawBAawBCyAEQQFqIQRBiwEhEAyqAgsgBEEBaiEEQYwBIRAMqQILAkAgBCACRw0AQaIBIRAMwgILIAQtAABB0ABHDakBIARBAWohBAzpAQsCQCAEIAJHDQBBowEhEAzBAgsCQAJAIAQtAABBt39qDgcBqgGqAaoBqgGqAQCqAQsgBEEBaiEEQY4BIRAMqAILIARBAWohAUEiIRAMpgELAkAgBCACRw0AQaQBIRAMwAILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQcDPgIAAai0AAEcNqAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaQBIRAMwAILIABBADYCACAQQQFqIQFBHSEQDKUBCwJAIAQgAkcNAEGlASEQDL8CCwJAAkAgBC0AAEGuf2oOAwCoAQGoAQsgBEEBaiEEQZABIRAMpgILIARBAWohAUEEIRAMpAELAkAgBCACRw0AQaYBIRAMvgILAkACQAJAAkACQCAELQAAQb9/ag4VAKoBqgGqAaoBqgGqAaoBqgGqAaoBAaoBqgECqgGqAQOqAaoBBKoBCyAEQQFqIQRBiAEhEAyoAgsgBEEBaiEEQYkBIRAMpwILIARBAWohBEGKASEQDKYCCyAEQQFqIQRBjwEhEAylAgsgBEEBaiEEQZEBIRAMpAILAkAgBCACRw0AQacBIRAMvQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNpQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQacBIRAMvQILIABBADYCACAQQQFqIQFBESEQDKIBCwJAIAQgAkcNAEGoASEQDLwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHCz4CAAGotAABHDaQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGoASEQDLwCCyAAQQA2AgAgEEEBaiEBQSwhEAyhAQsCQCAEIAJHDQBBqQEhEAy7AgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBxc+AgABqLQAARw2jASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqQEhEAy7AgsgAEEANgIAIBBBAWohAUErIRAMoAELAkAgBCACRw0AQaoBIRAMugILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQcrPgIAAai0AAEcNogEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaoBIRAMugILIABBADYCACAQQQFqIQFBFCEQDJ8BCwJAIAQgAkcNAEGrASEQDLkCCwJAAkACQAJAIAQtAABBvn9qDg8AAQKkAaQBpAGkAaQBpAGkAaQBpAGkAaQBA6QBCyAEQQFqIQRBkwEhEAyiAgsgBEEBaiEEQZQBIRAMoQILIARBAWohBEGVASEQDKACCyAEQQFqIQRBlgEhEAyfAgsCQCAEIAJHDQBBrAEhEAy4AgsgBC0AAEHFAEcNnwEgBEEBaiEEDOABCwJAIAQgAkcNAEGtASEQDLcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHNz4CAAGotAABHDZ8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGtASEQDLcCCyAAQQA2AgAgEEEBaiEBQQ4hEAycAQsCQCAEIAJHDQBBrgEhEAy2AgsgBC0AAEHQAEcNnQEgBEEBaiEBQSUhEAybAQsCQCAEIAJHDQBBrwEhEAy1AgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw2dASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrwEhEAy1AgsgAEEANgIAIBBBAWohAUEqIRAMmgELAkAgBCACRw0AQbABIRAMtAILAkACQCAELQAAQat/ag4LAJ0BnQGdAZ0BnQGdAZ0BnQGdAQGdAQsgBEEBaiEEQZoBIRAMmwILIARBAWohBEGbASEQDJoCCwJAIAQgAkcNAEGxASEQDLMCCwJAAkAgBC0AAEG/f2oOFACcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAEBnAELIARBAWohBEGZASEQDJoCCyAEQQFqIQRBnAEhEAyZAgsCQCAEIAJHDQBBsgEhEAyyAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFB2c+AgABqLQAARw2aASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBsgEhEAyyAgsgAEEANgIAIBBBAWohAUEhIRAMlwELAkAgBCACRw0AQbMBIRAMsQILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQd3PgIAAai0AAEcNmQEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbMBIRAMsQILIABBADYCACAQQQFqIQFBGiEQDJYBCwJAIAQgAkcNAEG0ASEQDLACCwJAAkACQCAELQAAQbt/ag4RAJoBmgGaAZoBmgGaAZoBmgGaAQGaAZoBmgGaAZoBApoBCyAEQQFqIQRBnQEhEAyYAgsgBEEBaiEEQZ4BIRAMlwILIARBAWohBEGfASEQDJYCCwJAIAQgAkcNAEG1ASEQDK8CCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUHkz4CAAGotAABHDZcBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG1ASEQDK8CCyAAQQA2AgAgEEEBaiEBQSghEAyUAQsCQCAEIAJHDQBBtgEhEAyuAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB6s+AgABqLQAARw2WASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtgEhEAyuAgsgAEEANgIAIBBBAWohAUEHIRAMkwELAkAgBCACRw0AQbcBIRAMrQILAkACQCAELQAAQbt/ag4OAJYBlgGWAZYBlgGWAZYBlgGWAZYBlgGWAQGWAQsgBEEBaiEEQaEBIRAMlAILIARBAWohBEGiASEQDJMCCwJAIAQgAkcNAEG4ASEQDKwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDZQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG4ASEQDKwCCyAAQQA2AgAgEEEBaiEBQRIhEAyRAQsCQCAEIAJHDQBBuQEhEAyrAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw2TASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuQEhEAyrAgsgAEEANgIAIBBBAWohAUEgIRAMkAELAkAgBCACRw0AQboBIRAMqgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNkgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQboBIRAMqgILIABBADYCACAQQQFqIQFBDyEQDI8BCwJAIAQgAkcNAEG7ASEQDKkCCwJAAkAgBC0AAEG3f2oOBwCSAZIBkgGSAZIBAZIBCyAEQQFqIQRBpQEhEAyQAgsgBEEBaiEEQaYBIRAMjwILAkAgBCACRw0AQbwBIRAMqAILIAIgBGsgACgCACIBaiEUIAQgAWtBB2ohEAJAA0AgBC0AACABQfTPgIAAai0AAEcNkAEgAUEHRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbwBIRAMqAILIABBADYCACAQQQFqIQFBGyEQDI0BCwJAIAQgAkcNAEG9ASEQDKcCCwJAAkACQCAELQAAQb5/ag4SAJEBkQGRAZEBkQGRAZEBkQGRAQGRAZEBkQGRAZEBkQECkQELIARBAWohBEGkASEQDI8CCyAEQQFqIQRBpwEhEAyOAgsgBEEBaiEEQagBIRAMjQILAkAgBCACRw0AQb4BIRAMpgILIAQtAABBzgBHDY0BIARBAWohBAzPAQsCQCAEIAJHDQBBvwEhEAylAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAELQAAQb9/ag4VAAECA5wBBAUGnAGcAZwBBwgJCgucAQwNDg+cAQsgBEEBaiEBQegAIRAMmgILIARBAWohAUHpACEQDJkCCyAEQQFqIQFB7gAhEAyYAgsgBEEBaiEBQfIAIRAMlwILIARBAWohAUHzACEQDJYCCyAEQQFqIQFB9gAhEAyVAgsgBEEBaiEBQfcAIRAMlAILIARBAWohAUH6ACEQDJMCCyAEQQFqIQRBgwEhEAySAgsgBEEBaiEEQYQBIRAMkQILIARBAWohBEGFASEQDJACCyAEQQFqIQRBkgEhEAyPAgsgBEEBaiEEQZgBIRAMjgILIARBAWohBEGgASEQDI0CCyAEQQFqIQRBowEhEAyMAgsgBEEBaiEEQaoBIRAMiwILAkAgBCACRg0AIABBkICAgAA2AgggACAENgIEQasBIRAMiwILQcABIRAMowILIAAgBSACEKqAgIAAIgENiwEgBSEBDFwLAkAgBiACRg0AIAZBAWohBQyNAQtBwgEhEAyhAgsDQAJAIBAtAABBdmoOBIwBAACPAQALIBBBAWoiECACRw0AC0HDASEQDKACCwJAIAcgAkYNACAAQZGAgIAANgIIIAAgBzYCBCAHIQFBASEQDIcCC0HEASEQDJ8CCwJAIAcgAkcNAEHFASEQDJ8CCwJAAkAgBy0AAEF2ag4EAc4BzgEAzgELIAdBAWohBgyNAQsgB0EBaiEFDIkBCwJAIAcgAkcNAEHGASEQDJ4CCwJAAkAgBy0AAEF2ag4XAY8BjwEBjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAI8BCyAHQQFqIQcLQbABIRAMhAILAkAgCCACRw0AQcgBIRAMnQILIAgtAABBIEcNjQEgAEEAOwEyIAhBAWohAUGzASEQDIMCCyABIRcCQANAIBciByACRg0BIActAABBUGpB/wFxIhBBCk8NzAECQCAALwEyIhRBmTNLDQAgACAUQQpsIhQ7ATIgEEH//wNzIBRB/v8DcUkNACAHQQFqIRcgACAUIBBqIhA7ATIgEEH//wNxQegHSQ0BCwtBACEQIABBADYCHCAAQcGJgIAANgIQIABBDTYCDCAAIAdBAWo2AhQMnAILQccBIRAMmwILIAAgCCACEK6AgIAAIhBFDcoBIBBBFUcNjAEgAEHIATYCHCAAIAg2AhQgAEHJl4CAADYCECAAQRU2AgxBACEQDJoCCwJAIAkgAkcNAEHMASEQDJoCC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgCS0AAEFQag4KlgGVAQABAgMEBQYIlwELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMjgELQQkhEEEBIRRBACEXQQAhFgyNAQsCQCAKIAJHDQBBzgEhEAyZAgsgCi0AAEEuRw2OASAKQQFqIQkMygELIAsgAkcNjgFB0AEhEAyXAgsCQCALIAJGDQAgAEGOgICAADYCCCAAIAs2AgRBtwEhEAz+AQtB0QEhEAyWAgsCQCAEIAJHDQBB0gEhEAyWAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EEaiELA0AgBC0AACAQQfzPgIAAai0AAEcNjgEgEEEERg3pASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHSASEQDJUCCyAAIAwgAhCsgICAACIBDY0BIAwhAQy4AQsCQCAEIAJHDQBB1AEhEAyUAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EBaiEMA0AgBC0AACAQQYHQgIAAai0AAEcNjwEgEEEBRg2OASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHUASEQDJMCCwJAIAQgAkcNAEHWASEQDJMCCyACIARrIAAoAgAiEGohFCAEIBBrQQJqIQsDQCAELQAAIBBBg9CAgABqLQAARw2OASAQQQJGDZABIBBBAWohECAEQQFqIgQgAkcNAAsgACAUNgIAQdYBIRAMkgILAkAgBCACRw0AQdcBIRAMkgILAkACQCAELQAAQbt/ag4QAI8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwEBjwELIARBAWohBEG7ASEQDPkBCyAEQQFqIQRBvAEhEAz4AQsCQCAEIAJHDQBB2AEhEAyRAgsgBC0AAEHIAEcNjAEgBEEBaiEEDMQBCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEG+ASEQDPcBC0HZASEQDI8CCwJAIAQgAkcNAEHaASEQDI8CCyAELQAAQcgARg3DASAAQQE6ACgMuQELIABBAjoALyAAIAQgAhCmgICAACIQDY0BQcIBIRAM9AELIAAtAChBf2oOArcBuQG4AQsDQAJAIAQtAABBdmoOBACOAY4BAI4BCyAEQQFqIgQgAkcNAAtB3QEhEAyLAgsgAEEAOgAvIAAtAC1BBHFFDYQCCyAAQQA6AC8gAEEBOgA0IAEhAQyMAQsgEEEVRg3aASAAQQA2AhwgACABNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAyIAgsCQCAAIBAgAhC0gICAACIEDQAgECEBDIECCwJAIARBFUcNACAAQQM2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAyIAgsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMhwILIBBBFUYN1gEgAEEANgIcIAAgATYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMhgILIAAoAgQhFyAAQQA2AgQgECARp2oiFiEBIAAgFyAQIBYgFBsiEBC1gICAACIURQ2NASAAQQc2AhwgACAQNgIUIAAgFDYCDEEAIRAMhQILIAAgAC8BMEGAAXI7ATAgASEBC0EqIRAM6gELIBBBFUYN0QEgAEEANgIcIAAgATYCFCAAQYOMgIAANgIQIABBEzYCDEEAIRAMggILIBBBFUYNzwEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAMgQILIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDI0BCyAAQQw2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMgAILIBBBFUYNzAEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM/wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIwBCyAAQQ02AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/gELIBBBFUYNyQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM/QELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIsBCyAAQQ42AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/AELIABBADYCHCAAIAE2AhQgAEHAlYCAADYCECAAQQI2AgxBACEQDPsBCyAQQRVGDcUBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPoBCyAAQRA2AhwgACABNgIUIAAgEDYCDEEAIRAM+QELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDPEBCyAAQRE2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM+AELIBBBFUYNwQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM9wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIgBCyAAQRM2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM9gELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDO0BCyAAQRQ2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM9QELIBBBFUYNvQEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM9AELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIYBCyAAQRY2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM8wELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC3gICAACIEDQAgAUEBaiEBDOkBCyAAQRc2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM8gELIABBADYCHCAAIAE2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDPEBC0IBIRELIBBBAWohAQJAIAApAyAiEkL//////////w9WDQAgACASQgSGIBGENwMgIAEhAQyEAQsgAEEANgIcIAAgATYCFCAAQa2JgIAANgIQIABBDDYCDEEAIRAM7wELIABBADYCHCAAIBA2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDO4BCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNcyAAQQU2AhwgACAQNgIUIAAgFDYCDEEAIRAM7QELIABBADYCHCAAIBA2AhQgAEGqnICAADYCECAAQQ82AgxBACEQDOwBCyAAIBAgAhC0gICAACIBDQEgECEBC0EOIRAM0QELAkAgAUEVRw0AIABBAjYCHCAAIBA2AhQgAEGwmICAADYCECAAQRU2AgxBACEQDOoBCyAAQQA2AhwgACAQNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAzpAQsgAUEBaiEQAkAgAC8BMCIBQYABcUUNAAJAIAAgECACELuAgIAAIgENACAQIQEMcAsgAUEVRw26ASAAQQU2AhwgACAQNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAzpAQsCQCABQaAEcUGgBEcNACAALQAtQQJxDQAgAEEANgIcIAAgEDYCFCAAQZaTgIAANgIQIABBBDYCDEEAIRAM6QELIAAgECACEL2AgIAAGiAQIQECQAJAAkACQAJAIAAgECACELOAgIAADhYCAQAEBAQEBAQEBAQEBAQEBAQEBAQDBAsgAEEBOgAuCyAAIAAvATBBwAByOwEwIBAhAQtBJiEQDNEBCyAAQSM2AhwgACAQNgIUIABBpZaAgAA2AhAgAEEVNgIMQQAhEAzpAQsgAEEANgIcIAAgEDYCFCAAQdWLgIAANgIQIABBETYCDEEAIRAM6AELIAAtAC1BAXFFDQFBwwEhEAzOAQsCQCANIAJGDQADQAJAIA0tAABBIEYNACANIQEMxAELIA1BAWoiDSACRw0AC0ElIRAM5wELQSUhEAzmAQsgACgCBCEEIABBADYCBCAAIAQgDRCvgICAACIERQ2tASAAQSY2AhwgACAENgIMIAAgDUEBajYCFEEAIRAM5QELIBBBFUYNqwEgAEEANgIcIAAgATYCFCAAQf2NgIAANgIQIABBHTYCDEEAIRAM5AELIABBJzYCHCAAIAE2AhQgACAQNgIMQQAhEAzjAQsgECEBQQEhFAJAAkACQAJAAkACQAJAIAAtACxBfmoOBwYFBQMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0ErIRAMygELIABBADYCHCAAIBA2AhQgAEGrkoCAADYCECAAQQs2AgxBACEQDOIBCyAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMQQAhEAzhAQsgAEEAOgAsIBAhAQy9AQsgECEBQQEhFAJAAkACQAJAAkAgAC0ALEF7ag4EAwECAAULIAAgAC8BMEEIcjsBMAwDC0ECIRQMAQtBBCEUCyAAQQE6ACwgACAALwEwIBRyOwEwCyAQIQELQSkhEAzFAQsgAEEANgIcIAAgATYCFCAAQfCUgIAANgIQIABBAzYCDEEAIRAM3QELAkAgDi0AAEENRw0AIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHULIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzdAQsgAC0ALUEBcUUNAUHEASEQDMMBCwJAIA4gAkcNAEEtIRAM3AELAkACQANAAkAgDi0AAEF2ag4EAgAAAwALIA5BAWoiDiACRw0AC0EtIRAM3QELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDiEBDHQLIABBLDYCHCAAIA42AhQgACABNgIMQQAhEAzcAQsgACgCBCEBIABBADYCBAJAIAAgASAOELGAgIAAIgENACAOQQFqIQEMcwsgAEEsNgIcIAAgATYCDCAAIA5BAWo2AhRBACEQDNsBCyAAKAIEIQQgAEEANgIEIAAgBCAOELGAgIAAIgQNoAEgDiEBDM4BCyAQQSxHDQEgAUEBaiEQQQEhAQJAAkACQAJAAkAgAC0ALEF7ag4EAwECBAALIBAhAQwEC0ECIQEMAQtBBCEBCyAAQQE6ACwgACAALwEwIAFyOwEwIBAhAQwBCyAAIAAvATBBCHI7ATAgECEBC0E5IRAMvwELIABBADoALCABIQELQTQhEAy9AQsgACAALwEwQSByOwEwIAEhAQwCCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBA0AIAEhAQzHAQsgAEE3NgIcIAAgATYCFCAAIAQ2AgxBACEQDNQBCyAAQQg6ACwgASEBC0EwIRAMuQELAkAgAC0AKEEBRg0AIAEhAQwECyAALQAtQQhxRQ2TASABIQEMAwsgAC0AMEEgcQ2UAUHFASEQDLcBCwJAIA8gAkYNAAJAA0ACQCAPLQAAQVBqIgFB/wFxQQpJDQAgDyEBQTUhEAy6AQsgACkDICIRQpmz5syZs+bMGVYNASAAIBFCCn4iETcDICARIAGtQv8BgyISQn+FVg0BIAAgESASfDcDICAPQQFqIg8gAkcNAAtBOSEQDNEBCyAAKAIEIQIgAEEANgIEIAAgAiAPQQFqIgQQsYCAgAAiAg2VASAEIQEMwwELQTkhEAzPAQsCQCAALwEwIgFBCHFFDQAgAC0AKEEBRw0AIAAtAC1BCHFFDZABCyAAIAFB9/sDcUGABHI7ATAgDyEBC0E3IRAMtAELIAAgAC8BMEEQcjsBMAyrAQsgEEEVRg2LASAAQQA2AhwgACABNgIUIABB8I6AgAA2AhAgAEEcNgIMQQAhEAzLAQsgAEHDADYCHCAAIAE2AgwgACANQQFqNgIUQQAhEAzKAQsCQCABLQAAQTpHDQAgACgCBCEQIABBADYCBAJAIAAgECABEK+AgIAAIhANACABQQFqIQEMYwsgAEHDADYCHCAAIBA2AgwgACABQQFqNgIUQQAhEAzKAQsgAEEANgIcIAAgATYCFCAAQbGRgIAANgIQIABBCjYCDEEAIRAMyQELIABBADYCHCAAIAE2AhQgAEGgmYCAADYCECAAQR42AgxBACEQDMgBCyAAQQA2AgALIABBgBI7ASogACAXQQFqIgEgAhCogICAACIQDQEgASEBC0HHACEQDKwBCyAQQRVHDYMBIABB0QA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAzEAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAzDAQsgAEEANgIcIAAgFDYCFCAAQcGogIAANgIQIABBBzYCDCAAQQA2AgBBACEQDMIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxdCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDMEBC0EAIRAgAEEANgIcIAAgATYCFCAAQYCRgIAANgIQIABBCTYCDAzAAQsgEEEVRg19IABBADYCHCAAIAE2AhQgAEGUjYCAADYCECAAQSE2AgxBACEQDL8BC0EBIRZBACEXQQAhFEEBIRALIAAgEDoAKyABQQFqIQECQAJAIAAtAC1BEHENAAJAAkACQCAALQAqDgMBAAIECyAWRQ0DDAILIBQNAQwCCyAXRQ0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQrYCAgAAiEA0AIAEhAQxcCyAAQdgANgIcIAAgATYCFCAAIBA2AgxBACEQDL4BCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHTADYCHCAAIBQ2AhQgACABNgIMQQAhEAyjAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMQwsgAEHlADYCHCAAIBQ2AhQgACABNgIMQQAhEAyiAQsgAEEANgIcIAAgFDYCFCAAQcOPgIAANgIQIABBBzYCDEEAIRAMoQELIABBADYCHCAAIAE2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKABC0EAIRAgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDAyfAQsgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDEEAIRAMngELIABBADYCHCAAIBQ2AhQgAEH+kYCAADYCECAAQQc2AgxBACEQDJ0BCyAAQQA2AhwgACABNgIUIABBjpuAgAA2AhAgAEEGNgIMQQAhEAycAQsgEEEVRg1XIABBADYCHCAAIAE2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDJsBCyAAQQA2AgAgEEEBaiEBQSQhEAsgACAQOgApIAAoAgQhECAAQQA2AgQgACAQIAEQq4CAgAAiEA1UIAEhAQw+CyAAQQA2AgALQQAhECAAQQA2AhwgACAENgIUIABB8ZuAgAA2AhAgAEEGNgIMDJcBCyABQRVGDVAgAEEANgIcIAAgBTYCFCAAQfCMgIAANgIQIABBGzYCDEEAIRAMlgELIAAoAgQhBSAAQQA2AgQgACAFIBAQqYCAgAAiBQ0BIBBBAWohBQtBrQEhEAx7CyAAQcEBNgIcIAAgBTYCDCAAIBBBAWo2AhRBACEQDJMBCyAAKAIEIQYgAEEANgIEIAAgBiAQEKmAgIAAIgYNASAQQQFqIQYLQa4BIRAMeAsgAEHCATYCHCAAIAY2AgwgACAQQQFqNgIUQQAhEAyQAQsgAEEANgIcIAAgBzYCFCAAQZeLgIAANgIQIABBDTYCDEEAIRAMjwELIABBADYCHCAAIAg2AhQgAEHjkICAADYCECAAQQk2AgxBACEQDI4BCyAAQQA2AhwgACAINgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAyNAQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgCUEBaiEIAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBCAAIBAgCBCtgICAACIQRQ09IABByQE2AhwgACAINgIUIAAgEDYCDEEAIRAMjAELIAAoAgQhBCAAQQA2AgQgACAEIAgQrYCAgAAiBEUNdiAAQcoBNgIcIAAgCDYCFCAAIAQ2AgxBACEQDIsBCyAAKAIEIQQgAEEANgIEIAAgBCAJEK2AgIAAIgRFDXQgAEHLATYCHCAAIAk2AhQgACAENgIMQQAhEAyKAQsgACgCBCEEIABBADYCBCAAIAQgChCtgICAACIERQ1yIABBzQE2AhwgACAKNgIUIAAgBDYCDEEAIRAMiQELAkAgCy0AAEFQaiIQQf8BcUEKTw0AIAAgEDoAKiALQQFqIQpBtgEhEAxwCyAAKAIEIQQgAEEANgIEIAAgBCALEK2AgIAAIgRFDXAgAEHPATYCHCAAIAs2AhQgACAENgIMQQAhEAyIAQsgAEEANgIcIAAgBDYCFCAAQZCzgIAANgIQIABBCDYCDCAAQQA2AgBBACEQDIcBCyABQRVGDT8gAEEANgIcIAAgDDYCFCAAQcyOgIAANgIQIABBIDYCDEEAIRAMhgELIABBgQQ7ASggACgCBCEQIABCADcDACAAIBAgDEEBaiIMEKuAgIAAIhBFDTggAEHTATYCHCAAIAw2AhQgACAQNgIMQQAhEAyFAQsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQdibgIAANgIQIABBCDYCDAyDAQsgACgCBCEQIABCADcDACAAIBAgC0EBaiILEKuAgIAAIhANAUHGASEQDGkLIABBAjoAKAxVCyAAQdUBNgIcIAAgCzYCFCAAIBA2AgxBACEQDIABCyAQQRVGDTcgAEEANgIcIAAgBDYCFCAAQaSMgIAANgIQIABBEDYCDEEAIRAMfwsgAC0ANEEBRw00IAAgBCACELyAgIAAIhBFDTQgEEEVRw01IABB3AE2AhwgACAENgIUIABB1ZaAgAA2AhAgAEEVNgIMQQAhEAx+C0EAIRAgAEEANgIcIABBr4uAgAA2AhAgAEECNgIMIAAgFEEBajYCFAx9C0EAIRAMYwtBAiEQDGILQQ0hEAxhC0EPIRAMYAtBJSEQDF8LQRMhEAxeC0EVIRAMXQtBFiEQDFwLQRchEAxbC0EYIRAMWgtBGSEQDFkLQRohEAxYC0EbIRAMVwtBHCEQDFYLQR0hEAxVC0EfIRAMVAtBISEQDFMLQSMhEAxSC0HGACEQDFELQS4hEAxQC0EvIRAMTwtBOyEQDE4LQT0hEAxNC0HIACEQDEwLQckAIRAMSwtBywAhEAxKC0HMACEQDEkLQc4AIRAMSAtB0QAhEAxHC0HVACEQDEYLQdgAIRAMRQtB2QAhEAxEC0HbACEQDEMLQeQAIRAMQgtB5QAhEAxBC0HxACEQDEALQfQAIRAMPwtBjQEhEAw+C0GXASEQDD0LQakBIRAMPAtBrAEhEAw7C0HAASEQDDoLQbkBIRAMOQtBrwEhEAw4C0GxASEQDDcLQbIBIRAMNgtBtAEhEAw1C0G1ASEQDDQLQboBIRAMMwtBvQEhEAwyC0G/ASEQDDELQcEBIRAMMAsgAEEANgIcIAAgBDYCFCAAQemLgIAANgIQIABBHzYCDEEAIRAMSAsgAEHbATYCHCAAIAQ2AhQgAEH6loCAADYCECAAQRU2AgxBACEQDEcLIABB+AA2AhwgACAMNgIUIABBypiAgAA2AhAgAEEVNgIMQQAhEAxGCyAAQdEANgIcIAAgBTYCFCAAQbCXgIAANgIQIABBFTYCDEEAIRAMRQsgAEH5ADYCHCAAIAE2AhQgACAQNgIMQQAhEAxECyAAQfgANgIcIAAgATYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMQwsgAEHkADYCHCAAIAE2AhQgAEHjl4CAADYCECAAQRU2AgxBACEQDEILIABB1wA2AhwgACABNgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAxBCyAAQQA2AhwgACABNgIUIABBuY2AgAA2AhAgAEEaNgIMQQAhEAxACyAAQcIANgIcIAAgATYCFCAAQeOYgIAANgIQIABBFTYCDEEAIRAMPwsgAEEANgIEIAAgDyAPELGAgIAAIgRFDQEgAEE6NgIcIAAgBDYCDCAAIA9BAWo2AhRBACEQDD4LIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCxgICAACIERQ0AIABBOzYCHCAAIAQ2AgwgACABQQFqNgIUQQAhEAw+CyABQQFqIQEMLQsgD0EBaiEBDC0LIABBADYCHCAAIA82AhQgAEHkkoCAADYCECAAQQQ2AgxBACEQDDsLIABBNjYCHCAAIAQ2AhQgACACNgIMQQAhEAw6CyAAQS42AhwgACAONgIUIAAgBDYCDEEAIRAMOQsgAEHQADYCHCAAIAE2AhQgAEGRmICAADYCECAAQRU2AgxBACEQDDgLIA1BAWohAQwsCyAAQRU2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAw2CyAAQRs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw1CyAAQQ82AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw0CyAAQQs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAwzCyAAQRo2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwyCyAAQQs2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwxCyAAQQo2AhwgACABNgIUIABB5JaAgAA2AhAgAEEVNgIMQQAhEAwwCyAAQR42AhwgACABNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAwvCyAAQQA2AhwgACAQNgIUIABB2o2AgAA2AhAgAEEUNgIMQQAhEAwuCyAAQQQ2AhwgACABNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAwtCyAAQQA2AgAgC0EBaiELC0G4ASEQDBILIABBADYCACAQQQFqIQFB9QAhEAwRCyABIQECQCAALQApQQVHDQBB4wAhEAwRC0HiACEQDBALQQAhECAAQQA2AhwgAEHkkYCAADYCECAAQQc2AgwgACAUQQFqNgIUDCgLIABBADYCACAXQQFqIQFBwAAhEAwOC0EBIQELIAAgAToALCAAQQA2AgAgF0EBaiEBC0EoIRAMCwsgASEBC0E4IRAMCQsCQCABIg8gAkYNAANAAkAgDy0AAEGAvoCAAGotAAAiAUEBRg0AIAFBAkcNAyAPQQFqIQEMBAsgD0EBaiIPIAJHDQALQT4hEAwiC0E+IRAMIQsgAEEAOgAsIA8hAQwBC0ELIRAMBgtBOiEQDAULIAFBAWohAUEtIRAMBAsgACABOgAsIABBADYCACAWQQFqIQFBDCEQDAMLIABBADYCACAXQQFqIQFBCiEQDAILIABBADYCAAsgAEEAOgAsIA0hAUEJIRAMAAsLQQAhECAAQQA2AhwgACALNgIUIABBzZCAgAA2AhAgAEEJNgIMDBcLQQAhECAAQQA2AhwgACAKNgIUIABB6YqAgAA2AhAgAEEJNgIMDBYLQQAhECAAQQA2AhwgACAJNgIUIABBt5CAgAA2AhAgAEEJNgIMDBULQQAhECAAQQA2AhwgACAINgIUIABBnJGAgAA2AhAgAEEJNgIMDBQLQQAhECAAQQA2AhwgACABNgIUIABBzZCAgAA2AhAgAEEJNgIMDBMLQQAhECAAQQA2AhwgACABNgIUIABB6YqAgAA2AhAgAEEJNgIMDBILQQAhECAAQQA2AhwgACABNgIUIABBt5CAgAA2AhAgAEEJNgIMDBELQQAhECAAQQA2AhwgACABNgIUIABBnJGAgAA2AhAgAEEJNgIMDBALQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA8LQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA4LQQAhECAAQQA2AhwgACABNgIUIABBwJKAgAA2AhAgAEELNgIMDA0LQQAhECAAQQA2AhwgACABNgIUIABBlYmAgAA2AhAgAEELNgIMDAwLQQAhECAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMDAsLQQAhECAAQQA2AhwgACABNgIUIABB+4+AgAA2AhAgAEEKNgIMDAoLQQAhECAAQQA2AhwgACABNgIUIABB8ZmAgAA2AhAgAEECNgIMDAkLQQAhECAAQQA2AhwgACABNgIUIABBxJSAgAA2AhAgAEECNgIMDAgLQQAhECAAQQA2AhwgACABNgIUIABB8pWAgAA2AhAgAEECNgIMDAcLIABBAjYCHCAAIAE2AhQgAEGcmoCAADYCECAAQRY2AgxBACEQDAYLQQEhEAwFC0HUACEQIAEiBCACRg0EIANBCGogACAEIAJB2MKAgABBChDFgICAACADKAIMIQQgAygCCA4DAQQCAAsQyoCAgAAACyAAQQA2AhwgAEG1moCAADYCECAAQRc2AgwgACAEQQFqNgIUQQAhEAwCCyAAQQA2AhwgACAENgIUIABBypqAgAA2AhAgAEEJNgIMQQAhEAwBCwJAIAEiBCACRw0AQSIhEAwBCyAAQYmAgIAANgIIIAAgBDYCBEEhIRALIANBEGokgICAgAAgEAuvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAEMeAgIAAC/I2AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKg0ICAAA0AQQAQy4CAgABBgNSEgABrIgJB2QBJDQBBACEDAkBBACgC4NOAgAAiBA0AQQBCfzcC7NOAgABBAEKAgISAgIDAADcC5NOAgABBACABQQhqQXBxQdiq1aoFcyIENgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgAALQQAgAjYCzNOAgABBAEGA1ISAADYCyNOAgABBAEGA1ISAADYCmNCAgABBACAENgKs0ICAAEEAQX82AqjQgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAtBgNSEgABBeEGA1ISAAGtBD3FBAEGA1ISAAEEIakEPcRsiA2oiBEEEaiACQUhqIgUgA2siA0EBcjYCAEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgABBgNSEgAAgBWpBODYCBAsCQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAUsNAAJAQQAoAojQgIAAIgZBECAAQRNqQXBxIABBC0kbIgJBA3YiBHYiA0EDcUUNAAJAAkAgA0EBcSAEckEBcyIFQQN0IgRBsNCAgABqIgMgBEG40ICAAGooAgAiBCgCCCICRw0AQQAgBkF+IAV3cTYCiNCAgAAMAQsgAyACNgIIIAIgAzYCDAsgBEEIaiEDIAQgBUEDdCIFQQNyNgIEIAQgBWoiBCAEKAIEQQFyNgIEDAwLIAJBACgCkNCAgAAiB00NAQJAIANFDQACQAJAIAMgBHRBAiAEdCIDQQAgA2tycSIDQQAgA2txQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmoiBEEDdCIDQbDQgIAAaiIFIANBuNCAgABqKAIAIgMoAggiAEcNAEEAIAZBfiAEd3EiBjYCiNCAgAAMAQsgBSAANgIIIAAgBTYCDAsgAyACQQNyNgIEIAMgBEEDdCIEaiAEIAJrIgU2AgAgAyACaiIAIAVBAXI2AgQCQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhBAJAAkAgBkEBIAdBA3Z0IghxDQBBACAGIAhyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAQ2AgwgAiAENgIIIAQgAjYCDCAEIAg2AggLIANBCGohA0EAIAA2ApzQgIAAQQAgBTYCkNCAgAAMDAtBACgCjNCAgAAiCUUNASAJQQAgCWtxQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmpBAnRBuNKAgABqKAIAIgAoAgRBeHEgAmshBCAAIQUCQANAAkAgBSgCECIDDQAgBUEUaigCACIDRQ0CCyADKAIEQXhxIAJrIgUgBCAFIARJIgUbIQQgAyAAIAUbIQAgAyEFDAALCyAAKAIYIQoCQCAAKAIMIgggAEYNACAAKAIIIgNBACgCmNCAgABJGiAIIAM2AgggAyAINgIMDAsLAkAgAEEUaiIFKAIAIgMNACAAKAIQIgNFDQMgAEEQaiEFCwNAIAUhCyADIghBFGoiBSgCACIDDQAgCEEQaiEFIAgoAhAiAw0ACyALQQA2AgAMCgtBfyECIABBv39LDQAgAEETaiIDQXBxIQJBACgCjNCAgAAiB0UNAEEAIQsCQCACQYACSQ0AQR8hCyACQf///wdLDQAgA0EIdiIDIANBgP4/akEQdkEIcSIDdCIEIARBgOAfakEQdkEEcSIEdCIFIAVBgIAPakEQdkECcSIFdEEPdiADIARyIAVyayIDQQF0IAIgA0EVanZBAXFyQRxqIQsLQQAgAmshBAJAAkACQAJAIAtBAnRBuNKAgABqKAIAIgUNAEEAIQNBACEIDAELQQAhAyACQQBBGSALQQF2ayALQR9GG3QhAEEAIQgDQAJAIAUoAgRBeHEgAmsiBiAETw0AIAYhBCAFIQggBg0AQQAhBCAFIQggBSEDDAMLIAMgBUEUaigCACIGIAYgBSAAQR12QQRxakEQaigCACIFRhsgAyAGGyEDIABBAXQhACAFDQALCwJAIAMgCHINAEEAIQhBAiALdCIDQQAgA2tyIAdxIgNFDQMgA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBUEFdkEIcSIAIANyIAUgAHYiA0ECdkEEcSIFciADIAV2IgNBAXZBAnEiBXIgAyAFdiIDQQF2QQFxIgVyIAMgBXZqQQJ0QbjSgIAAaigCACEDCyADRQ0BCwNAIAMoAgRBeHEgAmsiBiAESSEAAkAgAygCECIFDQAgA0EUaigCACEFCyAGIAQgABshBCADIAggABshCCAFIQMgBQ0ACwsgCEUNACAEQQAoApDQgIAAIAJrTw0AIAgoAhghCwJAIAgoAgwiACAIRg0AIAgoAggiA0EAKAKY0ICAAEkaIAAgAzYCCCADIAA2AgwMCQsCQCAIQRRqIgUoAgAiAw0AIAgoAhAiA0UNAyAIQRBqIQULA0AgBSEGIAMiAEEUaiIFKAIAIgMNACAAQRBqIQUgACgCECIDDQALIAZBADYCAAwICwJAQQAoApDQgIAAIgMgAkkNAEEAKAKc0ICAACEEAkACQCADIAJrIgVBEEkNACAEIAJqIgAgBUEBcjYCBEEAIAU2ApDQgIAAQQAgADYCnNCAgAAgBCADaiAFNgIAIAQgAkEDcjYCBAwBCyAEIANBA3I2AgQgBCADaiIDIAMoAgRBAXI2AgRBAEEANgKc0ICAAEEAQQA2ApDQgIAACyAEQQhqIQMMCgsCQEEAKAKU0ICAACIAIAJNDQBBACgCoNCAgAAiAyACaiIEIAAgAmsiBUEBcjYCBEEAIAU2ApTQgIAAQQAgBDYCoNCAgAAgAyACQQNyNgIEIANBCGohAwwKCwJAAkBBACgC4NOAgABFDQBBACgC6NOAgAAhBAwBC0EAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEMakFwcUHYqtWqBXM2AuDTgIAAQQBBADYC9NOAgABBAEEANgLE04CAAEGAgAQhBAtBACEDAkAgBCACQccAaiIHaiIGQQAgBGsiC3EiCCACSw0AQQBBMDYC+NOAgAAMCgsCQEEAKALA04CAACIDRQ0AAkBBACgCuNOAgAAiBCAIaiIFIARNDQAgBSADTQ0BC0EAIQNBAEEwNgL404CAAAwKC0EALQDE04CAAEEEcQ0EAkACQAJAQQAoAqDQgIAAIgRFDQBByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiAESw0DCyADKAIIIgMNAAsLQQAQy4CAgAAiAEF/Rg0FIAghBgJAQQAoAuTTgIAAIgNBf2oiBCAAcUUNACAIIABrIAQgAGpBACADa3FqIQYLIAYgAk0NBSAGQf7///8HSw0FAkBBACgCwNOAgAAiA0UNAEEAKAK404CAACIEIAZqIgUgBE0NBiAFIANLDQYLIAYQy4CAgAAiAyAARw0BDAcLIAYgAGsgC3EiBkH+////B0sNBCAGEMuAgIAAIgAgAygCACADKAIEakYNAyAAIQMLAkAgA0F/Rg0AIAJByABqIAZNDQACQCAHIAZrQQAoAujTgIAAIgRqQQAgBGtxIgRB/v///wdNDQAgAyEADAcLAkAgBBDLgICAAEF/Rg0AIAQgBmohBiADIQAMBwtBACAGaxDLgICAABoMBAsgAyEAIANBf0cNBQwDC0EAIQgMBwtBACEADAULIABBf0cNAgtBAEEAKALE04CAAEEEcjYCxNOAgAALIAhB/v///wdLDQEgCBDLgICAACEAQQAQy4CAgAAhAyAAQX9GDQEgA0F/Rg0BIAAgA08NASADIABrIgYgAkE4ak0NAQtBAEEAKAK404CAACAGaiIDNgK404CAAAJAIANBACgCvNOAgABNDQBBACADNgK804CAAAsCQAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQCAAIAMoAgAiBSADKAIEIghqRg0CIAMoAggiAw0ADAMLCwJAAkBBACgCmNCAgAAiA0UNACAAIANPDQELQQAgADYCmNCAgAALQQAhA0EAIAY2AszTgIAAQQAgADYCyNOAgABBAEF/NgKo0ICAAEEAQQAoAuDTgIAANgKs0ICAAEEAQQA2AtTTgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiBCAGQUhqIgUgA2siA0EBcjYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgAAgACAFakE4NgIEDAILIAMtAAxBCHENACAEIAVJDQAgBCAATw0AIARBeCAEa0EPcUEAIARBCGpBD3EbIgVqIgBBACgClNCAgAAgBmoiCyAFayIFQQFyNgIEIAMgCCAGajYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAU2ApTQgIAAQQAgADYCoNCAgAAgBCALakE4NgIEDAELAkAgAEEAKAKY0ICAACIITw0AQQAgADYCmNCAgAAgACEICyAAIAZqIQVByNOAgAAhAwJAAkACQAJAAkACQAJAA0AgAygCACAFRg0BIAMoAggiAw0ADAILCyADLQAMQQhxRQ0BC0HI04CAACEDA0ACQCADKAIAIgUgBEsNACAFIAMoAgRqIgUgBEsNAwsgAygCCCEDDAALCyADIAA2AgAgAyADKAIEIAZqNgIEIABBeCAAa0EPcUEAIABBCGpBD3EbaiILIAJBA3I2AgQgBUF4IAVrQQ9xQQAgBUEIakEPcRtqIgYgCyACaiICayEDAkAgBiAERw0AQQAgAjYCoNCAgABBAEEAKAKU0ICAACADaiIDNgKU0ICAACACIANBAXI2AgQMAwsCQCAGQQAoApzQgIAARw0AQQAgAjYCnNCAgABBAEEAKAKQ0ICAACADaiIDNgKQ0ICAACACIANBAXI2AgQgAiADaiADNgIADAMLAkAgBigCBCIEQQNxQQFHDQAgBEF4cSEHAkACQCAEQf8BSw0AIAYoAggiBSAEQQN2IghBA3RBsNCAgABqIgBGGgJAIAYoAgwiBCAFRw0AQQBBACgCiNCAgABBfiAId3E2AojQgIAADAILIAQgAEYaIAQgBTYCCCAFIAQ2AgwMAQsgBigCGCEJAkACQCAGKAIMIgAgBkYNACAGKAIIIgQgCEkaIAAgBDYCCCAEIAA2AgwMAQsCQCAGQRRqIgQoAgAiBQ0AIAZBEGoiBCgCACIFDQBBACEADAELA0AgBCEIIAUiAEEUaiIEKAIAIgUNACAAQRBqIQQgACgCECIFDQALIAhBADYCAAsgCUUNAAJAAkAgBiAGKAIcIgVBAnRBuNKAgABqIgQoAgBHDQAgBCAANgIAIAANAUEAQQAoAozQgIAAQX4gBXdxNgKM0ICAAAwCCyAJQRBBFCAJKAIQIAZGG2ogADYCACAARQ0BCyAAIAk2AhgCQCAGKAIQIgRFDQAgACAENgIQIAQgADYCGAsgBigCFCIERQ0AIABBFGogBDYCACAEIAA2AhgLIAcgA2ohAyAGIAdqIgYoAgQhBAsgBiAEQX5xNgIEIAIgA2ogAzYCACACIANBAXI2AgQCQCADQf8BSw0AIANBeHFBsNCAgABqIQQCQAJAQQAoAojQgIAAIgVBASADQQN2dCIDcQ0AQQAgBSADcjYCiNCAgAAgBCEDDAELIAQoAgghAwsgAyACNgIMIAQgAjYCCCACIAQ2AgwgAiADNgIIDAMLQR8hBAJAIANB////B0sNACADQQh2IgQgBEGA/j9qQRB2QQhxIgR0IgUgBUGA4B9qQRB2QQRxIgV0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAQgBXIgAHJrIgRBAXQgAyAEQRVqdkEBcXJBHGohBAsgAiAENgIcIAJCADcCECAEQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiAEEBIAR0IghxDQAgBSACNgIAQQAgACAIcjYCjNCAgAAgAiAFNgIYIAIgAjYCCCACIAI2AgwMAwsgA0EAQRkgBEEBdmsgBEEfRht0IQQgBSgCACEAA0AgACIFKAIEQXhxIANGDQIgBEEddiEAIARBAXQhBCAFIABBBHFqQRBqIggoAgAiAA0ACyAIIAI2AgAgAiAFNgIYIAIgAjYCDCACIAI2AggMAgsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiCyAGQUhqIgggA2siA0EBcjYCBCAAIAhqQTg2AgQgBCAFQTcgBWtBD3FBACAFQUlqQQ9xG2pBQWoiCCAIIARBEGpJGyIIQSM2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAs2AqDQgIAAIAhBEGpBACkC0NOAgAA3AgAgCEEAKQLI04CAADcCCEEAIAhBCGo2AtDTgIAAQQAgBjYCzNOAgABBACAANgLI04CAAEEAQQA2AtTTgIAAIAhBJGohAwNAIANBBzYCACADQQRqIgMgBUkNAAsgCCAERg0DIAggCCgCBEF+cTYCBCAIIAggBGsiADYCACAEIABBAXI2AgQCQCAAQf8BSw0AIABBeHFBsNCAgABqIQMCQAJAQQAoAojQgIAAIgVBASAAQQN2dCIAcQ0AQQAgBSAAcjYCiNCAgAAgAyEFDAELIAMoAgghBQsgBSAENgIMIAMgBDYCCCAEIAM2AgwgBCAFNgIIDAQLQR8hAwJAIABB////B0sNACAAQQh2IgMgA0GA/j9qQRB2QQhxIgN0IgUgBUGA4B9qQRB2QQRxIgV0IgggCEGAgA9qQRB2QQJxIgh0QQ92IAMgBXIgCHJrIgNBAXQgACADQRVqdkEBcXJBHGohAwsgBCADNgIcIARCADcCECADQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiCEEBIAN0IgZxDQAgBSAENgIAQQAgCCAGcjYCjNCAgAAgBCAFNgIYIAQgBDYCCCAEIAQ2AgwMBAsgAEEAQRkgA0EBdmsgA0EfRht0IQMgBSgCACEIA0AgCCIFKAIEQXhxIABGDQMgA0EddiEIIANBAXQhAyAFIAhBBHFqQRBqIgYoAgAiCA0ACyAGIAQ2AgAgBCAFNgIYIAQgBDYCDCAEIAQ2AggMAwsgBSgCCCIDIAI2AgwgBSACNgIIIAJBADYCGCACIAU2AgwgAiADNgIICyALQQhqIQMMBQsgBSgCCCIDIAQ2AgwgBSAENgIIIARBADYCGCAEIAU2AgwgBCADNgIIC0EAKAKU0ICAACIDIAJNDQBBACgCoNCAgAAiBCACaiIFIAMgAmsiA0EBcjYCBEEAIAM2ApTQgIAAQQAgBTYCoNCAgAAgBCACQQNyNgIEIARBCGohAwwDC0EAIQNBAEEwNgL404CAAAwCCwJAIAtFDQACQAJAIAggCCgCHCIFQQJ0QbjSgIAAaiIDKAIARw0AIAMgADYCACAADQFBACAHQX4gBXdxIgc2AozQgIAADAILIAtBEEEUIAsoAhAgCEYbaiAANgIAIABFDQELIAAgCzYCGAJAIAgoAhAiA0UNACAAIAM2AhAgAyAANgIYCyAIQRRqKAIAIgNFDQAgAEEUaiADNgIAIAMgADYCGAsCQAJAIARBD0sNACAIIAQgAmoiA0EDcjYCBCAIIANqIgMgAygCBEEBcjYCBAwBCyAIIAJqIgAgBEEBcjYCBCAIIAJBA3I2AgQgACAEaiAENgIAAkAgBEH/AUsNACAEQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgBEEDdnQiBHENAEEAIAUgBHI2AojQgIAAIAMhBAwBCyADKAIIIQQLIAQgADYCDCADIAA2AgggACADNgIMIAAgBDYCCAwBC0EfIQMCQCAEQf///wdLDQAgBEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCICIAJBgIAPakEQdkECcSICdEEPdiADIAVyIAJyayIDQQF0IAQgA0EVanZBAXFyQRxqIQMLIAAgAzYCHCAAQgA3AhAgA0ECdEG40oCAAGohBQJAIAdBASADdCICcQ0AIAUgADYCAEEAIAcgAnI2AozQgIAAIAAgBTYCGCAAIAA2AgggACAANgIMDAELIARBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhAgJAA0AgAiIFKAIEQXhxIARGDQEgA0EddiECIANBAXQhAyAFIAJBBHFqQRBqIgYoAgAiAg0ACyAGIAA2AgAgACAFNgIYIAAgADYCDCAAIAA2AggMAQsgBSgCCCIDIAA2AgwgBSAANgIIIABBADYCGCAAIAU2AgwgACADNgIICyAIQQhqIQMMAQsCQCAKRQ0AAkACQCAAIAAoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAg2AgAgCA0BQQAgCUF+IAV3cTYCjNCAgAAMAgsgCkEQQRQgCigCECAARhtqIAg2AgAgCEUNAQsgCCAKNgIYAkAgACgCECIDRQ0AIAggAzYCECADIAg2AhgLIABBFGooAgAiA0UNACAIQRRqIAM2AgAgAyAINgIYCwJAAkAgBEEPSw0AIAAgBCACaiIDQQNyNgIEIAAgA2oiAyADKAIEQQFyNgIEDAELIAAgAmoiBSAEQQFyNgIEIAAgAkEDcjYCBCAFIARqIAQ2AgACQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhAwJAAkBBASAHQQN2dCIIIAZxDQBBACAIIAZyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAM2AgwgAiADNgIIIAMgAjYCDCADIAg2AggLQQAgBTYCnNCAgABBACAENgKQ0ICAAAsgAEEIaiEDCyABQRBqJICAgIAAIAMLCgAgABDJgICAAAviDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQEgASABKAIAIgJrIgFBACgCmNCAgAAiBEkNASACIABqIQACQCABQQAoApzQgIAARg0AAkAgAkH/AUsNACABKAIIIgQgAkEDdiIFQQN0QbDQgIAAaiIGRhoCQCABKAIMIgIgBEcNAEEAQQAoAojQgIAAQX4gBXdxNgKI0ICAAAwDCyACIAZGGiACIAQ2AgggBCACNgIMDAILIAEoAhghBwJAAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiAGIAI2AgggAiAGNgIMDAELAkAgAUEUaiICKAIAIgQNACABQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQECQAJAIAEgASgCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAwsgB0EQQRQgBygCECABRhtqIAY2AgAgBkUNAgsgBiAHNgIYAkAgASgCECICRQ0AIAYgAjYCECACIAY2AhgLIAEoAhQiAkUNASAGQRRqIAI2AgAgAiAGNgIYDAELIAMoAgQiAkEDcUEDRw0AIAMgAkF+cTYCBEEAIAA2ApDQgIAAIAEgAGogADYCACABIABBAXI2AgQPCyABIANPDQAgAygCBCICQQFxRQ0AAkACQCACQQJxDQACQCADQQAoAqDQgIAARw0AQQAgATYCoNCAgABBAEEAKAKU0ICAACAAaiIANgKU0ICAACABIABBAXI2AgQgAUEAKAKc0ICAAEcNA0EAQQA2ApDQgIAAQQBBADYCnNCAgAAPCwJAIANBACgCnNCAgABHDQBBACABNgKc0ICAAEEAQQAoApDQgIAAIABqIgA2ApDQgIAAIAEgAEEBcjYCBCABIABqIAA2AgAPCyACQXhxIABqIQACQAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgAygCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAgsgAiAGRhogAiAENgIIIAQgAjYCDAwBCyADKAIYIQcCQAJAIAMoAgwiBiADRg0AIAMoAggiAkEAKAKY0ICAAEkaIAYgAjYCCCACIAY2AgwMAQsCQCADQRRqIgIoAgAiBA0AIANBEGoiAigCACIEDQBBACEGDAELA0AgAiEFIAQiBkEUaiICKAIAIgQNACAGQRBqIQIgBigCECIEDQALIAVBADYCAAsgB0UNAAJAAkAgAyADKAIcIgRBAnRBuNKAgABqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoAozQgIAAQX4gBHdxNgKM0ICAAAwCCyAHQRBBFCAHKAIQIANGG2ogBjYCACAGRQ0BCyAGIAc2AhgCQCADKAIQIgJFDQAgBiACNgIQIAIgBjYCGAsgAygCFCICRQ0AIAZBFGogAjYCACACIAY2AhgLIAEgAGogADYCACABIABBAXI2AgQgAUEAKAKc0ICAAEcNAUEAIAA2ApDQgIAADwsgAyACQX5xNgIEIAEgAGogADYCACABIABBAXI2AgQLAkAgAEH/AUsNACAAQXhxQbDQgIAAaiECAkACQEEAKAKI0ICAACIEQQEgAEEDdnQiAHENAEEAIAQgAHI2AojQgIAAIAIhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3AxggASAGNwMQIAEgBjcDCCABIAY3AwAgAUEgaiEBIAJBYGoiAkEfSw0ACwsgAAsLjkgBAEGACAuGSAEAAAACAAAAAwAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAYAAAAHAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=="},18994:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.enumToMap=void 0;function enumToMap(r){const i={};Object.keys(r).forEach((s=>{const a=r[s];if(typeof a==="number"){i[s]=a}}));return i}i.enumToMap=enumToMap},51441:(r,i,s)=>{"use strict";const{kClients:a}=s(31915);const l=s(72916);const{kAgent:c,kMockAgentSet:d,kMockAgentGet:p,kDispatches:u,kIsMockActive:A,kNetConnect:h,kGetNetConnect:g,kOptions:y,kFactory:b}=s(46932);const w=s(16518);const C=s(15196);const{matchValue:v,buildMockOptions:I}=s(67078);const{InvalidArgumentError:B,UndiciError:S}=s(76291);const x=s(78824);const R=s(14381);const Q=s(7796);class FakeWeakRef{constructor(r){this.value=r}deref(){return this.value}}class MockAgent extends x{constructor(r){super(r);this[h]=true;this[A]=true;if(r&&r.agent&&typeof r.agent.dispatch!=="function"){throw new B("Argument opts.agent must implement Agent")}const i=r&&r.agent?r.agent:new l(r);this[c]=i;this[a]=i[a];this[y]=I(r)}get(r){let i=this[p](r);if(!i){i=this[b](r);this[d](r,i)}return i}dispatch(r,i){this.get(r.origin);return this[c].dispatch(r,i)}async close(){await this[c].close();this[a].clear()}deactivate(){this[A]=false}activate(){this[A]=true}enableNetConnect(r){if(typeof r==="string"||typeof r==="function"||r instanceof RegExp){if(Array.isArray(this[h])){this[h].push(r)}else{this[h]=[r]}}else if(typeof r==="undefined"){this[h]=true}else{throw new B("Unsupported matcher. Must be one of String|Function|RegExp.")}}disableNetConnect(){this[h]=false}get isMockActive(){return this[A]}[d](r,i){this[a].set(r,new FakeWeakRef(i))}[b](r){const i=Object.assign({agent:this},this[y]);return this[y]&&this[y].connections===1?new w(r,i):new C(r,i)}[p](r){const i=this[a].get(r);if(i){return i.deref()}if(typeof r!=="string"){const i=this[b]("http://localhost:9999");this[d](r,i);return i}for(const[i,s]of Array.from(this[a])){const a=s.deref();if(a&&typeof i!=="string"&&v(i,r)){const i=this[b](r);this[d](r,i);i[u]=a[u];return i}}}[g](){return this[h]}pendingInterceptors(){const r=this[a];return Array.from(r.entries()).flatMap((([r,i])=>i.deref()[u].map((i=>({...i,origin:r}))))).filter((({pending:r})=>r))}assertNoPendingInterceptors({pendingInterceptorsFormatter:r=new Q}={}){const i=this.pendingInterceptors();if(i.length===0){return}const s=new R("interceptor","interceptors").pluralize(i.length);throw new S(`\n${s.count} ${s.noun} ${s.is} pending:\n\n${r.format(i)}\n`.trim())}}r.exports=MockAgent},16518:(r,i,s)=>{"use strict";const{promisify:a}=s(73837);const l=s(55179);const{buildMockDispatch:c}=s(67078);const{kDispatches:d,kMockAgent:p,kClose:u,kOriginalClose:A,kOrigin:h,kOriginalDispatch:g,kConnected:y}=s(46932);const{MockInterceptor:b}=s(79349);const w=s(31915);const{InvalidArgumentError:C}=s(76291);class MockClient extends l{constructor(r,i){super(r,i);if(!i||!i.agent||typeof i.agent.dispatch!=="function"){throw new C("Argument opts.agent must implement Agent")}this[p]=i.agent;this[h]=r;this[d]=[];this[y]=1;this[g]=this.dispatch;this[A]=this.close.bind(this);this.dispatch=c.call(this);this.close=this[u]}get[w.kConnected](){return this[y]}intercept(r){return new b(r,this[d])}async[u](){await a(this[A])();this[y]=0;this[p][w.kClients].delete(this[h])}}r.exports=MockClient},11025:(r,i,s)=>{"use strict";const{UndiciError:a}=s(76291);class MockNotMatchedError extends a{constructor(r){super(r);Error.captureStackTrace(this,MockNotMatchedError);this.name="MockNotMatchedError";this.message=r||"The request does not match any registered mock dispatches";this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}}r.exports={MockNotMatchedError:MockNotMatchedError}},79349:(r,i,s)=>{"use strict";const{getResponseData:a,buildKey:l,addMockDispatch:c}=s(67078);const{kDispatches:d,kDispatchKey:p,kDefaultHeaders:u,kDefaultTrailers:A,kContentLength:h,kMockDispatch:g}=s(46932);const{InvalidArgumentError:y}=s(76291);const{buildURL:b}=s(94766);class MockScope{constructor(r){this[g]=r}delay(r){if(typeof r!=="number"||!Number.isInteger(r)||r<=0){throw new y("waitInMs must be a valid integer > 0")}this[g].delay=r;return this}persist(){this[g].persist=true;return this}times(r){if(typeof r!=="number"||!Number.isInteger(r)||r<=0){throw new y("repeatTimes must be a valid integer > 0")}this[g].times=r;return this}}class MockInterceptor{constructor(r,i){if(typeof r!=="object"){throw new y("opts must be an object")}if(typeof r.path==="undefined"){throw new y("opts.path must be defined")}if(typeof r.method==="undefined"){r.method="GET"}if(typeof r.path==="string"){if(r.query){r.path=b(r.path,r.query)}else{const i=new URL(r.path,"data://");r.path=i.pathname+i.search}}if(typeof r.method==="string"){r.method=r.method.toUpperCase()}this[p]=l(r);this[d]=i;this[u]={};this[A]={};this[h]=false}createMockScopeDispatchData(r,i,s={}){const l=a(i);const c=this[h]?{"content-length":l.length}:{};const d={...this[u],...c,...s.headers};const p={...this[A],...s.trailers};return{statusCode:r,data:i,headers:d,trailers:p}}validateReplyParameters(r,i,s){if(typeof r==="undefined"){throw new y("statusCode must be defined")}if(typeof i==="undefined"){throw new y("data must be defined")}if(typeof s!=="object"){throw new y("responseOptions must be an object")}}reply(r){if(typeof r==="function"){const wrappedDefaultsCallback=i=>{const s=r(i);if(typeof s!=="object"){throw new y("reply options callback must return an object")}const{statusCode:a,data:l="",responseOptions:c={}}=s;this.validateReplyParameters(a,l,c);return{...this.createMockScopeDispatchData(a,l,c)}};const i=c(this[d],this[p],wrappedDefaultsCallback);return new MockScope(i)}const[i,s="",a={}]=[...arguments];this.validateReplyParameters(i,s,a);const l=this.createMockScopeDispatchData(i,s,a);const u=c(this[d],this[p],l);return new MockScope(u)}replyWithError(r){if(typeof r==="undefined"){throw new y("error must be defined")}const i=c(this[d],this[p],{error:r});return new MockScope(i)}defaultReplyHeaders(r){if(typeof r==="undefined"){throw new y("headers must be defined")}this[u]=r;return this}defaultReplyTrailers(r){if(typeof r==="undefined"){throw new y("trailers must be defined")}this[A]=r;return this}replyContentLength(){this[h]=true;return this}}r.exports.MockInterceptor=MockInterceptor;r.exports.MockScope=MockScope},15196:(r,i,s)=>{"use strict";const{promisify:a}=s(73837);const l=s(94427);const{buildMockDispatch:c}=s(67078);const{kDispatches:d,kMockAgent:p,kClose:u,kOriginalClose:A,kOrigin:h,kOriginalDispatch:g,kConnected:y}=s(46932);const{MockInterceptor:b}=s(79349);const w=s(31915);const{InvalidArgumentError:C}=s(76291);class MockPool extends l{constructor(r,i){super(r,i);if(!i||!i.agent||typeof i.agent.dispatch!=="function"){throw new C("Argument opts.agent must implement Agent")}this[p]=i.agent;this[h]=r;this[d]=[];this[y]=1;this[g]=this.dispatch;this[A]=this.close.bind(this);this.dispatch=c.call(this);this.close=this[u]}get[w.kConnected](){return this[y]}intercept(r){return new b(r,this[d])}async[u](){await a(this[A])();this[y]=0;this[p][w.kClients].delete(this[h])}}r.exports=MockPool},46932:r=>{"use strict";r.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}},67078:(r,i,s)=>{"use strict";const{MockNotMatchedError:a}=s(11025);const{kDispatches:l,kMockAgent:c,kOriginalDispatch:d,kOrigin:p,kGetNetConnect:u}=s(46932);const{buildURL:A,nop:h}=s(94766);const{STATUS_CODES:g}=s(13685);const{types:{isPromise:y}}=s(73837);function matchValue(r,i){if(typeof r==="string"){return r===i}if(r instanceof RegExp){return r.test(i)}if(typeof r==="function"){return r(i)===true}return false}function lowerCaseEntries(r){return Object.fromEntries(Object.entries(r).map((([r,i])=>[r.toLocaleLowerCase(),i])))}function getHeaderByName(r,i){if(Array.isArray(r)){for(let s=0;s!r)).filter((({path:r})=>matchValue(safeUrl(r),l)));if(c.length===0){throw new a(`Mock dispatch not matched for path '${l}'`)}c=c.filter((({method:r})=>matchValue(r,i.method)));if(c.length===0){throw new a(`Mock dispatch not matched for method '${i.method}'`)}c=c.filter((({body:r})=>typeof r!=="undefined"?matchValue(r,i.body):true));if(c.length===0){throw new a(`Mock dispatch not matched for body '${i.body}'`)}c=c.filter((r=>matchHeaders(r,i.headers)));if(c.length===0){throw new a(`Mock dispatch not matched for headers '${typeof i.headers==="object"?JSON.stringify(i.headers):i.headers}'`)}return c[0]}function addMockDispatch(r,i,s){const a={timesInvoked:0,times:1,persist:false,consumed:false};const l=typeof s==="function"?{callback:s}:{...s};const c={...a,...i,pending:true,data:{error:null,...l}};r.push(c);return c}function deleteMockDispatch(r,i){const s=r.findIndex((r=>{if(!r.consumed){return false}return matchKey(r,i)}));if(s!==-1){r.splice(s,1)}}function buildKey(r){const{path:i,method:s,body:a,headers:l,query:c}=r;return{path:i,method:s,body:a,headers:l,query:c}}function generateKeyValues(r){return Object.entries(r).reduce(((r,[i,s])=>[...r,Buffer.from(`${i}`),Array.isArray(s)?s.map((r=>Buffer.from(`${r}`))):Buffer.from(`${s}`)]),[])}function getStatusText(r){return g[r]||"unknown"}async function getResponse(r){const i=[];for await(const s of r){i.push(s)}return Buffer.concat(i).toString("utf8")}function mockDispatch(r,i){const s=buildKey(r);const a=getMockDispatch(this[l],s);a.timesInvoked++;if(a.data.callback){a.data={...a.data,...a.data.callback(r)}}const{data:{statusCode:c,data:d,headers:p,trailers:u,error:A},delay:g,persist:b}=a;const{timesInvoked:w,times:C}=a;a.consumed=!b&&w>=C;a.pending=w0){setTimeout((()=>{handleReply(this[l])}),g)}else{handleReply(this[l])}function handleReply(a,l=d){const A=Array.isArray(r.headers)?buildHeadersFromArray(r.headers):r.headers;const g=typeof l==="function"?l({...r,headers:A}):l;if(y(g)){g.then((r=>handleReply(a,r)));return}const b=getResponseData(g);const w=generateKeyValues(p);const C=generateKeyValues(u);i.abort=h;i.onHeaders(c,w,resume,getStatusText(c));i.onData(Buffer.from(b));i.onComplete(C);deleteMockDispatch(a,s)}function resume(){}return true}function buildMockDispatch(){const r=this[c];const i=this[p];const s=this[d];return function dispatch(l,c){if(r.isMockActive){try{mockDispatch.call(this,l,c)}catch(d){if(d instanceof a){const p=r[u]();if(p===false){throw new a(`${d.message}: subsequent request to origin ${i} was not allowed (net.connect disabled)`)}if(checkNetConnect(p,i)){s.call(this,l,c)}else{throw new a(`${d.message}: subsequent request to origin ${i} was not allowed (net.connect is not enabled for this origin)`)}}else{throw d}}}else{s.call(this,l,c)}}}function checkNetConnect(r,i){const s=new URL(i);if(r===true){return true}else if(Array.isArray(r)&&r.some((r=>matchValue(r,s.host)))){return true}return false}function buildMockOptions(r){if(r){const{agent:i,...s}=r;return s}}r.exports={getResponseData:getResponseData,getMockDispatch:getMockDispatch,addMockDispatch:addMockDispatch,deleteMockDispatch:deleteMockDispatch,buildKey:buildKey,generateKeyValues:generateKeyValues,matchValue:matchValue,getResponse:getResponse,getStatusText:getStatusText,mockDispatch:mockDispatch,buildMockDispatch:buildMockDispatch,checkNetConnect:checkNetConnect,buildMockOptions:buildMockOptions,getHeaderByName:getHeaderByName}},7796:(r,i,s)=>{"use strict";const{Transform:a}=s(12781);const{Console:l}=s(96206);r.exports=class PendingInterceptorsFormatter{constructor({disableColors:r}={}){this.transform=new a({transform(r,i,s){s(null,r)}});this.logger=new l({stdout:this.transform,inspectOptions:{colors:!r&&!process.env.CI}})}format(r){const i=r.map((({method:r,path:i,data:{statusCode:s},persist:a,times:l,timesInvoked:c,origin:d})=>({Method:r,Origin:d,Path:i,"Status code":s,Persistent:a?"✅":"❌",Invocations:c,Remaining:a?Infinity:l-c})));this.logger.table(i);return this.transform.read().toString()}}},14381:r=>{"use strict";const i={pronoun:"it",is:"is",was:"was",this:"this"};const s={pronoun:"they",is:"are",was:"were",this:"these"};r.exports=class Pluralizer{constructor(r,i){this.singular=r;this.plural=i}pluralize(r){const a=r===1;const l=a?i:s;const c=a?this.singular:this.plural;return{...l,count:r,noun:c}}}},99520:r=>{"use strict";const i=2048;const s=i-1;class FixedCircularBuffer{constructor(){this.bottom=0;this.top=0;this.list=new Array(i);this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&s)===this.bottom}push(r){this.list[this.top]=r;this.top=this.top+1&s}shift(){const r=this.list[this.bottom];if(r===undefined)return null;this.list[this.bottom]=undefined;this.bottom=this.bottom+1&s;return r}}r.exports=class FixedQueue{constructor(){this.head=this.tail=new FixedCircularBuffer}isEmpty(){return this.head.isEmpty()}push(r){if(this.head.isFull()){this.head=this.head.next=new FixedCircularBuffer}this.head.push(r)}shift(){const r=this.tail;const i=r.shift();if(r.isEmpty()&&r.next!==null){this.tail=r.next}return i}}},52673:(r,i,s)=>{"use strict";const a=s(36228);const l=s(99520);const{kConnected:c,kSize:d,kRunning:p,kPending:u,kQueued:A,kBusy:h,kFree:g,kUrl:y,kClose:b,kDestroy:w,kDispatch:C}=s(31915);const v=s(31488);const I=Symbol("clients");const B=Symbol("needDrain");const S=Symbol("queue");const x=Symbol("closed resolve");const R=Symbol("onDrain");const Q=Symbol("onConnect");const _=Symbol("onDisconnect");const N=Symbol("onConnectionError");const T=Symbol("get dispatcher");const k=Symbol("add client");const D=Symbol("remove client");const P=Symbol("stats");class PoolBase extends a{constructor(){super();this[S]=new l;this[I]=[];this[A]=0;const r=this;this[R]=function onDrain(i,s){const a=r[S];let l=false;while(!l){const i=a.shift();if(!i){break}r[A]--;l=!this.dispatch(i.opts,i.handler)}this[B]=l;if(!this[B]&&r[B]){r[B]=false;r.emit("drain",i,[r,...s])}if(r[x]&&a.isEmpty()){Promise.all(r[I].map((r=>r.close()))).then(r[x])}};this[Q]=(i,s)=>{r.emit("connect",i,[r,...s])};this[_]=(i,s,a)=>{r.emit("disconnect",i,[r,...s],a)};this[N]=(i,s,a)=>{r.emit("connectionError",i,[r,...s],a)};this[P]=new v(this)}get[h](){return this[B]}get[c](){return this[I].filter((r=>r[c])).length}get[g](){return this[I].filter((r=>r[c]&&!r[B])).length}get[u](){let r=this[A];for(const{[u]:i}of this[I]){r+=i}return r}get[p](){let r=0;for(const{[p]:i}of this[I]){r+=i}return r}get[d](){let r=this[A];for(const{[d]:i}of this[I]){r+=i}return r}get stats(){return this[P]}async[b](){if(this[S].isEmpty()){return Promise.all(this[I].map((r=>r.close())))}else{return new Promise((r=>{this[x]=r}))}}async[w](r){while(true){const i=this[S].shift();if(!i){break}i.handler.onError(r)}return Promise.all(this[I].map((i=>i.destroy(r))))}[C](r,i){const s=this[T]();if(!s){this[B]=true;this[S].push({opts:r,handler:i});this[A]++}else if(!s.dispatch(r,i)){s[B]=true;this[B]=!this[T]()}return!this[B]}[k](r){r.on("drain",this[R]).on("connect",this[Q]).on("disconnect",this[_]).on("connectionError",this[N]);this[I].push(r);if(this[B]){process.nextTick((()=>{if(this[B]){this[R](r[y],[this,r])}}))}return this}[D](r){r.close((()=>{const i=this[I].indexOf(r);if(i!==-1){this[I].splice(i,1)}}));this[B]=this[I].some((r=>!r[B]&&r.closed!==true&&r.destroyed!==true))}}r.exports={PoolBase:PoolBase,kClients:I,kNeedDrain:B,kAddClient:k,kRemoveClient:D,kGetDispatcher:T}},31488:(r,i,s)=>{const{kFree:a,kConnected:l,kPending:c,kQueued:d,kRunning:p,kSize:u}=s(31915);const A=Symbol("pool");class PoolStats{constructor(r){this[A]=r}get connected(){return this[A][l]}get free(){return this[A][a]}get pending(){return this[A][c]}get queued(){return this[A][d]}get running(){return this[A][p]}get size(){return this[A][u]}}r.exports=PoolStats},94427:(r,i,s)=>{"use strict";const{PoolBase:a,kClients:l,kNeedDrain:c,kAddClient:d,kGetDispatcher:p}=s(52673);const u=s(55179);const{InvalidArgumentError:A}=s(76291);const h=s(94766);const{kUrl:g,kInterceptors:y}=s(31915);const b=s(98742);const w=Symbol("options");const C=Symbol("connections");const v=Symbol("factory");function defaultFactory(r,i){return new u(r,i)}class Pool extends a{constructor(r,{connections:i,factory:s=defaultFactory,connect:a,connectTimeout:l,tls:c,maxCachedSessions:d,socketPath:p,autoSelectFamily:u,autoSelectFamilyAttemptTimeout:I,allowH2:B,...S}={}){super();if(i!=null&&(!Number.isFinite(i)||i<0)){throw new A("invalid connections")}if(typeof s!=="function"){throw new A("factory must be a function.")}if(a!=null&&typeof a!=="function"&&typeof a!=="object"){throw new A("connect must be a function or an object")}if(typeof a!=="function"){a=b({...c,maxCachedSessions:d,allowH2:B,socketPath:p,timeout:l,...h.nodeHasAutoSelectFamily&&u?{autoSelectFamily:u,autoSelectFamilyAttemptTimeout:I}:undefined,...a})}this[y]=S.interceptors&&S.interceptors.Pool&&Array.isArray(S.interceptors.Pool)?S.interceptors.Pool:[];this[C]=i||null;this[g]=h.parseOrigin(r);this[w]={...h.deepClone(S),connect:a,allowH2:B};this[w].interceptors=S.interceptors?{...S.interceptors}:undefined;this[v]=s}[p](){let r=this[l].find((r=>!r[c]));if(r){return r}if(!this[C]||this[l].length{"use strict";const{kProxy:a,kClose:l,kDestroy:c,kInterceptors:d}=s(31915);const{URL:p}=s(57310);const u=s(72916);const A=s(94427);const h=s(36228);const{InvalidArgumentError:g,RequestAbortedError:y}=s(76291);const b=s(98742);const w=Symbol("proxy agent");const C=Symbol("proxy client");const v=Symbol("proxy headers");const I=Symbol("request tls settings");const B=Symbol("proxy tls settings");const S=Symbol("connect endpoint function");function defaultProtocolPort(r){return r==="https:"?443:80}function buildProxyOptions(r){if(typeof r==="string"){r={uri:r}}if(!r||!r.uri){throw new g("Proxy opts.uri is mandatory")}return{uri:r.uri,protocol:r.protocol||"https"}}function defaultFactory(r,i){return new A(r,i)}class ProxyAgent extends h{constructor(r){super(r);this[a]=buildProxyOptions(r);this[w]=new u(r);this[d]=r.interceptors&&r.interceptors.ProxyAgent&&Array.isArray(r.interceptors.ProxyAgent)?r.interceptors.ProxyAgent:[];if(typeof r==="string"){r={uri:r}}if(!r||!r.uri){throw new g("Proxy opts.uri is mandatory")}const{clientFactory:i=defaultFactory}=r;if(typeof i!=="function"){throw new g("Proxy opts.clientFactory must be a function.")}this[I]=r.requestTls;this[B]=r.proxyTls;this[v]=r.headers||{};const s=new p(r.uri);const{origin:l,port:c,host:A,username:h,password:x}=s;if(r.auth&&r.token){throw new g("opts.auth cannot be used in combination with opts.token")}else if(r.auth){this[v]["proxy-authorization"]=`Basic ${r.auth}`}else if(r.token){this[v]["proxy-authorization"]=r.token}else if(h&&x){this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(h)}:${decodeURIComponent(x)}`).toString("base64")}`}const R=b({...r.proxyTls});this[S]=b({...r.requestTls});this[C]=i(s,{connect:R});this[w]=new u({...r,connect:async(r,i)=>{let s=r.host;if(!r.port){s+=`:${defaultProtocolPort(r.protocol)}`}try{const{socket:a,statusCode:d}=await this[C].connect({origin:l,port:c,path:s,signal:r.signal,headers:{...this[v],host:A}});if(d!==200){a.on("error",(()=>{})).destroy();i(new y(`Proxy response (${d}) !== 200 when HTTP Tunneling`))}if(r.protocol!=="https:"){i(null,a);return}let p;if(this[I]){p=this[I].servername}else{p=r.servername}this[S]({...r,servername:p,httpSocket:a},i)}catch(r){i(r)}}})}dispatch(r,i){const{host:s}=new p(r.origin);const a=buildHeaders(r.headers);throwIfProxyAuthIsSent(a);return this[w].dispatch({...r,headers:{...a,host:s}},i)}async[l](){await this[w].close();await this[C].close()}async[c](){await this[w].destroy();await this[C].destroy()}}function buildHeaders(r){if(Array.isArray(r)){const i={};for(let s=0;sr.toLowerCase()==="proxy-authorization"));if(i){throw new g("Proxy-Authorization should be sent in ProxyAgent constructor")}}r.exports=ProxyAgent},90683:r=>{"use strict";let i=Date.now();let s;const a=[];function onTimeout(){i=Date.now();let r=a.length;let s=0;while(s0&&i>=l.state){l.state=-1;l.callback(l.opaque)}if(l.state===-1){l.state=-2;if(s!==r-1){a[s]=a.pop()}else{a.pop()}r-=1}else{s+=1}}if(a.length>0){refreshTimeout()}}function refreshTimeout(){if(s&&s.refresh){s.refresh()}else{clearTimeout(s);s=setTimeout(onTimeout,1e3);if(s.unref){s.unref()}}}class Timeout{constructor(r,i,s){this.callback=r;this.delay=i;this.opaque=s;this.state=-2;this.refresh()}refresh(){if(this.state===-2){a.push(this);if(!s||a.length===1){refreshTimeout()}}this.state=0}clear(){this.state=-1}}r.exports={setTimeout(r,i,s){return i<1e3?setTimeout(r,i,s):new Timeout(r,i,s)},clearTimeout(r){if(r instanceof Timeout){r.clear()}else{clearTimeout(r)}}}},81231:(r,i,s)=>{"use strict";const a=s(67643);const{uid:l,states:c}=s(30514);const{kReadyState:d,kSentClose:p,kByteParser:u,kReceivedClose:A}=s(88651);const{fireEvent:h,failWebsocketConnection:g}=s(4593);const{CloseEvent:y}=s(279);const{makeRequest:b}=s(11287);const{fetching:w}=s(79890);const{Headers:C}=s(8247);const{getGlobalDispatcher:v}=s(18826);const{kHeadersList:I}=s(31915);const B={};B.open=a.channel("undici:websocket:open");B.close=a.channel("undici:websocket:close");B.socketError=a.channel("undici:websocket:socket_error");let S;try{S=s(6113)}catch{}function establishWebSocketConnection(r,i,s,a,c){const d=r;d.protocol=r.protocol==="ws:"?"http:":"https:";const p=b({urlList:[d],serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(c.headers){const r=new C(c.headers)[I];p.headersList=r}const u=S.randomBytes(16).toString("base64");p.headersList.append("sec-websocket-key",u);p.headersList.append("sec-websocket-version","13");for(const r of i){p.headersList.append("sec-websocket-protocol",r)}const A="";const h=w({request:p,useParallelQueue:true,dispatcher:c.dispatcher??v(),processResponse(r){if(r.type==="error"||r.status!==101){g(s,"Received network error or non-101 status code.");return}if(i.length!==0&&!r.headersList.get("Sec-WebSocket-Protocol")){g(s,"Server did not respond with sent protocols.");return}if(r.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){g(s,'Server did not set Upgrade header to "websocket".');return}if(r.headersList.get("Connection")?.toLowerCase()!=="upgrade"){g(s,'Server did not set Connection header to "upgrade".');return}const c=r.headersList.get("Sec-WebSocket-Accept");const d=S.createHash("sha1").update(u+l).digest("base64");if(c!==d){g(s,"Incorrect hash received in Sec-WebSocket-Accept header.");return}const h=r.headersList.get("Sec-WebSocket-Extensions");if(h!==null&&h!==A){g(s,"Received different permessage-deflate than the one set.");return}const y=r.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&y!==p.headersList.get("Sec-WebSocket-Protocol")){g(s,"Protocol was not set in the opening handshake.");return}r.socket.on("data",onSocketData);r.socket.on("close",onSocketClose);r.socket.on("error",onSocketError);if(B.open.hasSubscribers){B.open.publish({address:r.socket.address(),protocol:y,extensions:h})}a(r)}});return h}function onSocketData(r){if(!this.ws[u].write(r)){this.pause()}}function onSocketClose(){const{ws:r}=this;const i=r[p]&&r[A];let s=1005;let a="";const l=r[u].closingInfo;if(l){s=l.code??1005;a=l.reason}else if(!r[p]){s=1006}r[d]=c.CLOSED;h("close",r,y,{wasClean:i,code:s,reason:a});if(B.close.hasSubscribers){B.close.publish({websocket:r,code:s,reason:a})}}function onSocketError(r){const{ws:i}=this;i[d]=c.CLOSING;if(B.socketError.hasSubscribers){B.socketError.publish(r)}this.destroy()}r.exports={establishWebSocketConnection:establishWebSocketConnection}},30514:r=>{"use strict";const i="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";const s={enumerable:true,writable:false,configurable:false};const a={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3};const l={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10};const c=2**16-1;const d={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4};const p=Buffer.allocUnsafe(0);r.exports={uid:i,staticPropertyDescriptors:s,states:a,opcodes:l,maxUnsigned16Bit:c,parserStates:d,emptyBuffer:p}},279:(r,i,s)=>{"use strict";const{webidl:a}=s(87591);const{kEnumerableProperty:l}=s(94766);const{MessagePort:c}=s(71267);class MessageEvent extends Event{#s;constructor(r,i={}){a.argumentLengthCheck(arguments,1,{header:"MessageEvent constructor"});r=a.converters.DOMString(r);i=a.converters.MessageEventInit(i);super(r,i);this.#s=i}get data(){a.brandCheck(this,MessageEvent);return this.#s.data}get origin(){a.brandCheck(this,MessageEvent);return this.#s.origin}get lastEventId(){a.brandCheck(this,MessageEvent);return this.#s.lastEventId}get source(){a.brandCheck(this,MessageEvent);return this.#s.source}get ports(){a.brandCheck(this,MessageEvent);if(!Object.isFrozen(this.#s.ports)){Object.freeze(this.#s.ports)}return this.#s.ports}initMessageEvent(r,i=false,s=false,l=null,c="",d="",p=null,u=[]){a.brandCheck(this,MessageEvent);a.argumentLengthCheck(arguments,1,{header:"MessageEvent.initMessageEvent"});return new MessageEvent(r,{bubbles:i,cancelable:s,data:l,origin:c,lastEventId:d,source:p,ports:u})}}class CloseEvent extends Event{#s;constructor(r,i={}){a.argumentLengthCheck(arguments,1,{header:"CloseEvent constructor"});r=a.converters.DOMString(r);i=a.converters.CloseEventInit(i);super(r,i);this.#s=i}get wasClean(){a.brandCheck(this,CloseEvent);return this.#s.wasClean}get code(){a.brandCheck(this,CloseEvent);return this.#s.code}get reason(){a.brandCheck(this,CloseEvent);return this.#s.reason}}class ErrorEvent extends Event{#s;constructor(r,i){a.argumentLengthCheck(arguments,1,{header:"ErrorEvent constructor"});super(r,i);r=a.converters.DOMString(r);i=a.converters.ErrorEventInit(i??{});this.#s=i}get message(){a.brandCheck(this,ErrorEvent);return this.#s.message}get filename(){a.brandCheck(this,ErrorEvent);return this.#s.filename}get lineno(){a.brandCheck(this,ErrorEvent);return this.#s.lineno}get colno(){a.brandCheck(this,ErrorEvent);return this.#s.colno}get error(){a.brandCheck(this,ErrorEvent);return this.#s.error}}Object.defineProperties(MessageEvent.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:true},data:l,origin:l,lastEventId:l,source:l,ports:l,initMessageEvent:l});Object.defineProperties(CloseEvent.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:true},reason:l,code:l,wasClean:l});Object.defineProperties(ErrorEvent.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:true},message:l,filename:l,lineno:l,colno:l,error:l});a.converters.MessagePort=a.interfaceConverter(c);a.converters["sequence"]=a.sequenceConverter(a.converters.MessagePort);const d=[{key:"bubbles",converter:a.converters.boolean,defaultValue:false},{key:"cancelable",converter:a.converters.boolean,defaultValue:false},{key:"composed",converter:a.converters.boolean,defaultValue:false}];a.converters.MessageEventInit=a.dictionaryConverter([...d,{key:"data",converter:a.converters.any,defaultValue:null},{key:"origin",converter:a.converters.USVString,defaultValue:""},{key:"lastEventId",converter:a.converters.DOMString,defaultValue:""},{key:"source",converter:a.nullableConverter(a.converters.MessagePort),defaultValue:null},{key:"ports",converter:a.converters["sequence"],get defaultValue(){return[]}}]);a.converters.CloseEventInit=a.dictionaryConverter([...d,{key:"wasClean",converter:a.converters.boolean,defaultValue:false},{key:"code",converter:a.converters["unsigned short"],defaultValue:0},{key:"reason",converter:a.converters.USVString,defaultValue:""}]);a.converters.ErrorEventInit=a.dictionaryConverter([...d,{key:"message",converter:a.converters.DOMString,defaultValue:""},{key:"filename",converter:a.converters.USVString,defaultValue:""},{key:"lineno",converter:a.converters["unsigned long"],defaultValue:0},{key:"colno",converter:a.converters["unsigned long"],defaultValue:0},{key:"error",converter:a.converters.any}]);r.exports={MessageEvent:MessageEvent,CloseEvent:CloseEvent,ErrorEvent:ErrorEvent}},27022:(r,i,s)=>{"use strict";const{maxUnsigned16Bit:a}=s(30514);let l;try{l=s(6113)}catch{}class WebsocketFrameSend{constructor(r){this.frameData=r;this.maskKey=l.randomBytes(4)}createFrame(r){const i=this.frameData?.byteLength??0;let s=i;let l=6;if(i>a){l+=8;s=127}else if(i>125){l+=2;s=126}const c=Buffer.allocUnsafe(i+l);c[0]=c[1]=0;c[0]|=128;c[0]=(c[0]&240)+r; +/*! ws. MIT License. Einar Otto Stangvik */c[l-4]=this.maskKey[0];c[l-3]=this.maskKey[1];c[l-2]=this.maskKey[2];c[l-1]=this.maskKey[3];c[1]=s;if(s===126){c.writeUInt16BE(i,2)}else if(s===127){c[2]=c[3]=0;c.writeUIntBE(i,4,6)}c[1]|=128;for(let r=0;r{"use strict";const{Writable:a}=s(12781);const l=s(67643);const{parserStates:c,opcodes:d,states:p,emptyBuffer:u}=s(30514);const{kReadyState:A,kSentClose:h,kResponse:g,kReceivedClose:y}=s(88651);const{isValidStatusCode:b,failWebsocketConnection:w,websocketMessageReceived:C}=s(4593);const{WebsocketFrameSend:v}=s(27022);const I={};I.ping=l.channel("undici:websocket:ping");I.pong=l.channel("undici:websocket:pong");class ByteParser extends a{#a=[];#o=0;#l=c.INFO;#c={};#d=[];constructor(r){super();this.ws=r}_write(r,i,s){this.#a.push(r);this.#o+=r.length;this.run(s)}run(r){while(true){if(this.#l===c.INFO){if(this.#o<2){return r()}const i=this.consume(2);this.#c.fin=(i[0]&128)!==0;this.#c.opcode=i[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==d.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==d.BINARY&&this.#c.opcode!==d.TEXT){w(this.ws,"Invalid frame type was fragmented.");return}const s=i[1]&127;if(s<=125){this.#c.payloadLength=s;this.#l=c.READ_DATA}else if(s===126){this.#l=c.PAYLOADLENGTH_16}else if(s===127){this.#l=c.PAYLOADLENGTH_64}if(this.#c.fragmented&&s>125){w(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===d.PING||this.#c.opcode===d.PONG||this.#c.opcode===d.CLOSE)&&s>125){w(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===d.CLOSE){if(s===1){w(this.ws,"Received close frame with a 1-byte body.");return}const r=this.consume(s);this.#c.closeInfo=this.parseCloseBody(false,r);if(!this.ws[h]){const r=Buffer.allocUnsafe(2);r.writeUInt16BE(this.#c.closeInfo.code,0);const i=new v(r);this.ws[g].socket.write(i.createFrame(d.CLOSE),(r=>{if(!r){this.ws[h]=true}}))}this.ws[A]=p.CLOSING;this.ws[y]=true;this.end();return}else if(this.#c.opcode===d.PING){const i=this.consume(s);if(!this.ws[y]){const r=new v(i);this.ws[g].socket.write(r.createFrame(d.PONG));if(I.ping.hasSubscribers){I.ping.publish({payload:i})}}this.#l=c.INFO;if(this.#o>0){continue}else{r();return}}else if(this.#c.opcode===d.PONG){const i=this.consume(s);if(I.pong.hasSubscribers){I.pong.publish({payload:i})}if(this.#o>0){continue}else{r();return}}}else if(this.#l===c.PAYLOADLENGTH_16){if(this.#o<2){return r()}const i=this.consume(2);this.#c.payloadLength=i.readUInt16BE(0);this.#l=c.READ_DATA}else if(this.#l===c.PAYLOADLENGTH_64){if(this.#o<8){return r()}const i=this.consume(8);const s=i.readUInt32BE(0);if(s>2**31-1){w(this.ws,"Received payload length > 2^31 bytes.");return}const a=i.readUInt32BE(4);this.#c.payloadLength=(s<<8)+a;this.#l=c.READ_DATA}else if(this.#l===c.READ_DATA){if(this.#o=this.#c.payloadLength){const r=this.consume(this.#c.payloadLength);this.#d.push(r);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===d.CONTINUATION){const r=Buffer.concat(this.#d);C(this.ws,this.#c.originalOpcode,r);this.#c={};this.#d.length=0}this.#l=c.INFO}}if(this.#o>0){continue}else{r();break}}}consume(r){if(r>this.#o){return null}else if(r===0){return u}if(this.#a[0].length===r){this.#o-=this.#a[0].length;return this.#a.shift()}const i=Buffer.allocUnsafe(r);let s=0;while(s!==r){const a=this.#a[0];const{length:l}=a;if(l+s===r){i.set(this.#a.shift(),s);break}else if(l+s>r){i.set(a.subarray(0,r-s),s);this.#a[0]=a.subarray(r-s);break}else{i.set(this.#a.shift(),s);s+=a.length}}this.#o-=r;return i}parseCloseBody(r,i){let s;if(i.length>=2){s=i.readUInt16BE(0)}if(r){if(!b(s)){return null}return{code:s}}let a=i.subarray(2);if(a[0]===239&&a[1]===187&&a[2]===191){a=a.subarray(3)}if(s!==undefined&&!b(s)){return null}try{a=new TextDecoder("utf-8",{fatal:true}).decode(a)}catch{return null}return{code:s,reason:a}}get closingInfo(){return this.#c.closeInfo}}r.exports={ByteParser:ByteParser}},88651:r=>{"use strict";r.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},4593:(r,i,s)=>{"use strict";const{kReadyState:a,kController:l,kResponse:c,kBinaryType:d,kWebSocketURL:p}=s(88651);const{states:u,opcodes:A}=s(30514);const{MessageEvent:h,ErrorEvent:g}=s(279);function isEstablished(r){return r[a]===u.OPEN}function isClosing(r){return r[a]===u.CLOSING}function isClosed(r){return r[a]===u.CLOSED}function fireEvent(r,i,s=Event,a){const l=new s(r,a);i.dispatchEvent(l)}function websocketMessageReceived(r,i,s){if(r[a]!==u.OPEN){return}let l;if(i===A.TEXT){try{l=new TextDecoder("utf-8",{fatal:true}).decode(s)}catch{failWebsocketConnection(r,"Received invalid UTF-8 in text frame.");return}}else if(i===A.BINARY){if(r[d]==="blob"){l=new Blob([s])}else{l=new Uint8Array(s).buffer}}fireEvent("message",r,h,{origin:r[p].origin,data:l})}function isValidSubprotocol(r){if(r.length===0){return false}for(const i of r){const r=i.charCodeAt(0);if(r<33||r>126||i==="("||i===")"||i==="<"||i===">"||i==="@"||i===","||i===";"||i===":"||i==="\\"||i==='"'||i==="/"||i==="["||i==="]"||i==="?"||i==="="||i==="{"||i==="}"||r===32||r===9){return false}}return true}function isValidStatusCode(r){if(r>=1e3&&r<1015){return r!==1004&&r!==1005&&r!==1006}return r>=3e3&&r<=4999}function failWebsocketConnection(r,i){const{[l]:s,[c]:a}=r;s.abort();if(a?.socket&&!a.socket.destroyed){a.socket.destroy()}if(i){fireEvent("error",r,g,{error:new Error(i)})}}r.exports={isEstablished:isEstablished,isClosing:isClosing,isClosed:isClosed,fireEvent:fireEvent,isValidSubprotocol:isValidSubprotocol,isValidStatusCode:isValidStatusCode,failWebsocketConnection:failWebsocketConnection,websocketMessageReceived:websocketMessageReceived}},82439:(r,i,s)=>{"use strict";const{webidl:a}=s(87591);const{DOMException:l}=s(67296);const{URLSerializer:c}=s(80097);const{getGlobalOrigin:d}=s(46670);const{staticPropertyDescriptors:p,states:u,opcodes:A,emptyBuffer:h}=s(30514);const{kWebSocketURL:g,kReadyState:y,kController:b,kBinaryType:w,kResponse:C,kSentClose:v,kByteParser:I}=s(88651);const{isEstablished:B,isClosing:S,isValidSubprotocol:x,failWebsocketConnection:R,fireEvent:Q}=s(4593);const{establishWebSocketConnection:_}=s(81231);const{WebsocketFrameSend:N}=s(27022);const{ByteParser:T}=s(96147);const{kEnumerableProperty:k,isBlobLike:D}=s(94766);const{getGlobalDispatcher:P}=s(18826);const{types:O}=s(73837);let L=false;class WebSocket extends EventTarget{#p={open:null,error:null,close:null,message:null};#u=0;#A="";#f="";constructor(r,i=[]){super();a.argumentLengthCheck(arguments,1,{header:"WebSocket constructor"});if(!L){L=true;process.emitWarning("WebSockets are experimental, expect them to change at any time.",{code:"UNDICI-WS"})}const s=a.converters["DOMString or sequence or WebSocketInit"](i);r=a.converters.USVString(r);i=s.protocols;const c=d();let p;try{p=new URL(r,c)}catch(r){throw new l(r,"SyntaxError")}if(p.protocol==="http:"){p.protocol="ws:"}else if(p.protocol==="https:"){p.protocol="wss:"}if(p.protocol!=="ws:"&&p.protocol!=="wss:"){throw new l(`Expected a ws: or wss: protocol, got ${p.protocol}`,"SyntaxError")}if(p.hash||p.href.endsWith("#")){throw new l("Got fragment","SyntaxError")}if(typeof i==="string"){i=[i]}if(i.length!==new Set(i.map((r=>r.toLowerCase()))).size){throw new l("Invalid Sec-WebSocket-Protocol value","SyntaxError")}if(i.length>0&&!i.every((r=>x(r)))){throw new l("Invalid Sec-WebSocket-Protocol value","SyntaxError")}this[g]=new URL(p.href);this[b]=_(p,i,this,(r=>this.#m(r)),s);this[y]=WebSocket.CONNECTING;this[w]="blob"}close(r=undefined,i=undefined){a.brandCheck(this,WebSocket);if(r!==undefined){r=a.converters["unsigned short"](r,{clamp:true})}if(i!==undefined){i=a.converters.USVString(i)}if(r!==undefined){if(r!==1e3&&(r<3e3||r>4999)){throw new l("invalid code","InvalidAccessError")}}let s=0;if(i!==undefined){s=Buffer.byteLength(i);if(s>123){throw new l(`Reason must be less than 123 bytes; received ${s}`,"SyntaxError")}}if(this[y]===WebSocket.CLOSING||this[y]===WebSocket.CLOSED){}else if(!B(this)){R(this,"Connection was closed before it was established.");this[y]=WebSocket.CLOSING}else if(!S(this)){const a=new N;if(r!==undefined&&i===undefined){a.frameData=Buffer.allocUnsafe(2);a.frameData.writeUInt16BE(r,0)}else if(r!==undefined&&i!==undefined){a.frameData=Buffer.allocUnsafe(2+s);a.frameData.writeUInt16BE(r,0);a.frameData.write(i,2,"utf-8")}else{a.frameData=h}const l=this[C].socket;l.write(a.createFrame(A.CLOSE),(r=>{if(!r){this[v]=true}}));this[y]=u.CLOSING}else{this[y]=WebSocket.CLOSING}}send(r){a.brandCheck(this,WebSocket);a.argumentLengthCheck(arguments,1,{header:"WebSocket.send"});r=a.converters.WebSocketSendData(r);if(this[y]===WebSocket.CONNECTING){throw new l("Sent before connected.","InvalidStateError")}if(!B(this)||S(this)){return}const i=this[C].socket;if(typeof r==="string"){const s=Buffer.from(r);const a=new N(s);const l=a.createFrame(A.TEXT);this.#u+=s.byteLength;i.write(l,(()=>{this.#u-=s.byteLength}))}else if(O.isArrayBuffer(r)){const s=Buffer.from(r);const a=new N(s);const l=a.createFrame(A.BINARY);this.#u+=s.byteLength;i.write(l,(()=>{this.#u-=s.byteLength}))}else if(ArrayBuffer.isView(r)){const s=Buffer.from(r,r.byteOffset,r.byteLength);const a=new N(s);const l=a.createFrame(A.BINARY);this.#u+=s.byteLength;i.write(l,(()=>{this.#u-=s.byteLength}))}else if(D(r)){const s=new N;r.arrayBuffer().then((r=>{const a=Buffer.from(r);s.frameData=a;const l=s.createFrame(A.BINARY);this.#u+=a.byteLength;i.write(l,(()=>{this.#u-=a.byteLength}))}))}}get readyState(){a.brandCheck(this,WebSocket);return this[y]}get bufferedAmount(){a.brandCheck(this,WebSocket);return this.#u}get url(){a.brandCheck(this,WebSocket);return c(this[g])}get extensions(){a.brandCheck(this,WebSocket);return this.#f}get protocol(){a.brandCheck(this,WebSocket);return this.#A}get onopen(){a.brandCheck(this,WebSocket);return this.#p.open}set onopen(r){a.brandCheck(this,WebSocket);if(this.#p.open){this.removeEventListener("open",this.#p.open)}if(typeof r==="function"){this.#p.open=r;this.addEventListener("open",r)}else{this.#p.open=null}}get onerror(){a.brandCheck(this,WebSocket);return this.#p.error}set onerror(r){a.brandCheck(this,WebSocket);if(this.#p.error){this.removeEventListener("error",this.#p.error)}if(typeof r==="function"){this.#p.error=r;this.addEventListener("error",r)}else{this.#p.error=null}}get onclose(){a.brandCheck(this,WebSocket);return this.#p.close}set onclose(r){a.brandCheck(this,WebSocket);if(this.#p.close){this.removeEventListener("close",this.#p.close)}if(typeof r==="function"){this.#p.close=r;this.addEventListener("close",r)}else{this.#p.close=null}}get onmessage(){a.brandCheck(this,WebSocket);return this.#p.message}set onmessage(r){a.brandCheck(this,WebSocket);if(this.#p.message){this.removeEventListener("message",this.#p.message)}if(typeof r==="function"){this.#p.message=r;this.addEventListener("message",r)}else{this.#p.message=null}}get binaryType(){a.brandCheck(this,WebSocket);return this[w]}set binaryType(r){a.brandCheck(this,WebSocket);if(r!=="blob"&&r!=="arraybuffer"){this[w]="blob"}else{this[w]=r}}#m(r){this[C]=r;const i=new T(this);i.on("drain",(function onParserDrain(){this.ws[C].socket.resume()}));r.socket.ws=this;this[I]=i;this[y]=u.OPEN;const s=r.headersList.get("sec-websocket-extensions");if(s!==null){this.#f=s}const a=r.headersList.get("sec-websocket-protocol");if(a!==null){this.#A=a}Q("open",this)}}WebSocket.CONNECTING=WebSocket.prototype.CONNECTING=u.CONNECTING;WebSocket.OPEN=WebSocket.prototype.OPEN=u.OPEN;WebSocket.CLOSING=WebSocket.prototype.CLOSING=u.CLOSING;WebSocket.CLOSED=WebSocket.prototype.CLOSED=u.CLOSED;Object.defineProperties(WebSocket.prototype,{CONNECTING:p,OPEN:p,CLOSING:p,CLOSED:p,url:k,readyState:k,bufferedAmount:k,onopen:k,onerror:k,onclose:k,close:k,onmessage:k,binaryType:k,send:k,extensions:k,protocol:k,[Symbol.toStringTag]:{value:"WebSocket",writable:false,enumerable:false,configurable:true}});Object.defineProperties(WebSocket,{CONNECTING:p,OPEN:p,CLOSING:p,CLOSED:p});a.converters["sequence"]=a.sequenceConverter(a.converters.DOMString);a.converters["DOMString or sequence"]=function(r){if(a.util.Type(r)==="Object"&&Symbol.iterator in r){return a.converters["sequence"](r)}return a.converters.DOMString(r)};a.converters.WebSocketInit=a.dictionaryConverter([{key:"protocols",converter:a.converters["DOMString or sequence"],get defaultValue(){return[]}},{key:"dispatcher",converter:r=>r,get defaultValue(){return P()}},{key:"headers",converter:a.nullableConverter(a.converters.HeadersInit)}]);a.converters["DOMString or sequence or WebSocketInit"]=function(r){if(a.util.Type(r)==="Object"&&!(Symbol.iterator in r)){return a.converters.WebSocketInit(r)}return{protocols:a.converters["DOMString or sequence"](r)}};a.converters.WebSocketSendData=function(r){if(a.util.Type(r)==="Object"){if(D(r)){return a.converters.Blob(r,{strict:false})}if(ArrayBuffer.isView(r)||O.isAnyArrayBuffer(r)){return a.converters.BufferSource(r)}}return a.converters.USVString(r)};r.exports={WebSocket:WebSocket}},85581:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&process.version!==undefined){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}i.getUserAgent=getUserAgent},12929:(r,i,s)=>{"use strict";var a=s(12781);var l=s(73837).inherits;function Entry(){if(!(this instanceof Entry)){return new Entry}a.PassThrough.call(this);this.path=null;this.type=null;this.isDirectory=false}l(Entry,a.PassThrough);Entry.prototype.autodrain=function(){return this.pipe(new a.Transform({transform:function(r,i,s){s()}}))};r.exports=Entry},50055:(r,i,s)=>{var a=s(57147);var l=s(71017);var c=s(73837);var d=s(81414);var p=s(12781).Transform;var u=s(73685);function Extract(r){if(!(this instanceof Extract))return new Extract(r);p.call(this);this.opts=r||{};this.unzipStream=new u(this.opts);this.unfinishedEntries=0;this.afterFlushWait=false;this.createdDirectories={};var i=this;this.unzipStream.on("entry",this._processEntry.bind(this));this.unzipStream.on("error",(function(r){i.emit("error",r)}))}c.inherits(Extract,p);Extract.prototype._transform=function(r,i,s){this.unzipStream.write(r,i,s)};Extract.prototype._flush=function(r){var i=this;var allDone=function(){process.nextTick((function(){i.emit("close")}));r()};this.unzipStream.end((function(){if(i.unfinishedEntries>0){i.afterFlushWait=true;return i.on("await-finished",allDone)}allDone()}))};Extract.prototype._processEntry=function(r){var i=this;var s=l.join(this.opts.path,r.path);var c=r.isDirectory?s:l.dirname(s);this.unfinishedEntries++;var writeFileFn=function(){var l=a.createWriteStream(s);l.on("close",(function(){i.unfinishedEntries--;i._notifyAwaiter()}));l.on("error",(function(r){i.emit("error",r)}));r.pipe(l)};if(this.createdDirectories[c]||c==="."){return writeFileFn()}d(c,(function(s){if(s)return i.emit("error",s);i.createdDirectories[c]=true;if(r.isDirectory){i.unfinishedEntries--;i._notifyAwaiter();return}writeFileFn()}))};Extract.prototype._notifyAwaiter=function(){if(this.afterFlushWait&&this.unfinishedEntries===0){this.emit("await-finished");this.afterFlushWait=false}};r.exports=Extract},43435:(r,i,s)=>{var a=s(12781).Transform;var l=s(73837);function MatcherStream(r,i){if(!(this instanceof MatcherStream)){return new MatcherStream}a.call(this);var s=typeof r==="object"?r.pattern:r;this.pattern=Buffer.isBuffer(s)?s:Buffer.from(s);this.requiredLength=this.pattern.length;if(r.requiredExtraSize)this.requiredLength+=r.requiredExtraSize;this.data=new Buffer("");this.bytesSoFar=0;this.matchFn=i}l.inherits(MatcherStream,a);MatcherStream.prototype.checkDataChunk=function(r){var i=this.data.length>=this.requiredLength;if(!i){return}var s=this.data.indexOf(this.pattern,r?1:0);if(s>=0&&s+this.requiredLength>this.data.length){if(s>0){var a=this.data.slice(0,s);this.push(a);this.bytesSoFar+=s;this.data=this.data.slice(s)}return}if(s===-1){var l=this.data.length-this.requiredLength+1;var a=this.data.slice(0,l);this.push(a);this.bytesSoFar+=l;this.data=this.data.slice(l);return}if(s>0){var a=this.data.slice(0,s);this.data=this.data.slice(s);this.push(a);this.bytesSoFar+=s}var c=this.matchFn?this.matchFn(this.data,this.bytesSoFar):true;if(c){this.data=new Buffer("");return}return true};MatcherStream.prototype._transform=function(r,i,s){this.data=Buffer.concat([this.data,r]);var a=true;while(this.checkDataChunk(!a)){a=false}s()};MatcherStream.prototype._flush=function(r){if(this.data.length>0){var i=true;while(this.checkDataChunk(!i)){i=false}}if(this.data.length>0){this.push(this.data);this.data=null}r()};r.exports=MatcherStream},22607:(r,i,s)=>{var a=s(12781).Transform;var l=s(73837);var c=s(73685);function ParserStream(r){if(!(this instanceof ParserStream)){return new ParserStream(r)}var i=r||{};a.call(this,{readableObjectMode:true});this.opts=r||{};this.unzipStream=new c(this.opts);var s=this;this.unzipStream.on("entry",(function(r){s.push(r)}));this.unzipStream.on("error",(function(r){s.emit("error",r)}))}l.inherits(ParserStream,a);ParserStream.prototype._transform=function(r,i,s){this.unzipStream.write(r,i,s)};ParserStream.prototype._flush=function(r){var i=this;this.unzipStream.end((function(){process.nextTick((function(){i.emit("close")}));r()}))};ParserStream.prototype.on=function(r,i){if(r==="entry"){return a.prototype.on.call(this,"data",i)}return a.prototype.on.call(this,r,i)};ParserStream.prototype.drainAll=function(){this.unzipStream.drainAll();return this.pipe(new a({objectMode:true,transform:function(r,i,s){s()}}))};r.exports=ParserStream},73685:(r,i,s)=>{"use strict";var a=s(20593);var l=s(12781);var c=s(73837);var d=s(59796);var p=s(43435);var u=s(12929);const A={STREAM_START:0,START:1,LOCAL_FILE_HEADER:2,LOCAL_FILE_HEADER_SUFFIX:3,FILE_DATA:4,FILE_DATA_END:5,DATA_DESCRIPTOR:6,CENTRAL_DIRECTORY_FILE_HEADER:7,CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:8,CDIR64_END:9,CDIR64_END_DATA_SECTOR:10,CDIR64_LOCATOR:11,CENTRAL_DIRECTORY_END:12,CENTRAL_DIRECTORY_END_COMMENT:13,TRAILING_JUNK:14,ERROR:99};const h=4294967296;const g=67324752;const y=134695760;const b=33639248;const w=101075792;const C=117853008;const v=101010256;function UnzipStream(r){if(!(this instanceof UnzipStream)){return new UnzipStream(r)}l.Transform.call(this);this.options=r||{};this.data=new Buffer("");this.state=A.STREAM_START;this.skippedBytes=0;this.parsedEntity=null;this.outStreamInfo={}}c.inherits(UnzipStream,l.Transform);UnzipStream.prototype.processDataChunk=function(r){var i;switch(this.state){case A.STREAM_START:case A.START:i=4;break;case A.LOCAL_FILE_HEADER:i=26;break;case A.LOCAL_FILE_HEADER_SUFFIX:i=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength;break;case A.DATA_DESCRIPTOR:i=12;break;case A.CENTRAL_DIRECTORY_FILE_HEADER:i=42;break;case A.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:i=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength+this.parsedEntity.fileCommentLength;break;case A.CDIR64_END:i=52;break;case A.CDIR64_END_DATA_SECTOR:i=this.parsedEntity.centralDirectoryRecordSize-44;break;case A.CDIR64_LOCATOR:i=16;break;case A.CENTRAL_DIRECTORY_END:i=18;break;case A.CENTRAL_DIRECTORY_END_COMMENT:i=this.parsedEntity.commentLength;break;case A.FILE_DATA:return 0;case A.FILE_DATA_END:return 0;case A.TRAILING_JUNK:if(this.options.debug)console.log("found",r.length,"bytes of TRAILING_JUNK");return r.length;default:return r.length}var s=r.length;if(s>>8;if((c&255)===80){d=p;break}}this.skippedBytes+=d;if(this.options.debug)console.log("Skipped",this.skippedBytes,"bytes");return d}this.state=A.ERROR;var y=l?"Not a valid zip file":"Invalid signature in zip file";if(this.options.debug){var I=r.readUInt32LE(0);var B;try{B=r.slice(0,4).toString()}catch(r){}console.log("Unexpected signature in zip file: 0x"+I.toString(16),'"'+B+'", skipped',this.skippedBytes,"bytes")}this.emit("error",new Error(y));return r.length}this.skippedBytes=0;return i;case A.LOCAL_FILE_HEADER:this.parsedEntity=this._readFile(r);this.state=A.LOCAL_FILE_HEADER_SUFFIX;return i;case A.LOCAL_FILE_HEADER_SUFFIX:var S=new u;var x=(this.parsedEntity.flags&2048)!==0;S.path=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),x);var R=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength);var Q=this._readExtraFields(R);if(Q&&Q.parsed){if(Q.parsed.path&&!x){S.path=Q.parsed.path}if(Number.isFinite(Q.parsed.uncompressedSize)&&this.parsedEntity.uncompressedSize===h-1){this.parsedEntity.uncompressedSize=Q.parsed.uncompressedSize}if(Number.isFinite(Q.parsed.compressedSize)&&this.parsedEntity.compressedSize===h-1){this.parsedEntity.compressedSize=Q.parsed.compressedSize}}this.parsedEntity.extra=Q.parsed||{};if(this.options.debug){const r=Object.assign({},this.parsedEntity,{path:S.path,flags:"0x"+this.parsedEntity.flags.toString(16),extraFields:Q&&Q.debug});console.log("decoded LOCAL_FILE_HEADER:",JSON.stringify(r,null,2))}this._prepareOutStream(this.parsedEntity,S);this.emit("entry",S);this.state=A.FILE_DATA;return i;case A.CENTRAL_DIRECTORY_FILE_HEADER:this.parsedEntity=this._readCentralDirectoryEntry(r);this.state=A.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX;return i;case A.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:var x=(this.parsedEntity.flags&2048)!==0;var _=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),x);var R=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength);var Q=this._readExtraFields(R);if(Q&&Q.parsed&&Q.parsed.path&&!x){_=Q.parsed.path}this.parsedEntity.extra=Q.parsed;var N=(this.parsedEntity.versionMadeBy&65280)>>8===3;var T,k;if(N){T=this.parsedEntity.externalFileAttributes>>>16;var D=T>>>12;k=(D&10)===10}if(this.options.debug){const r=Object.assign({},this.parsedEntity,{path:_,flags:"0x"+this.parsedEntity.flags.toString(16),unixAttrs:T&&"0"+T.toString(8),isSymlink:k,extraFields:Q.debug});console.log("decoded CENTRAL_DIRECTORY_FILE_HEADER:",JSON.stringify(r,null,2))}this.state=A.START;return i;case A.CDIR64_END:this.parsedEntity=this._readEndOfCentralDirectory64(r);if(this.options.debug){console.log("decoded CDIR64_END_RECORD:",this.parsedEntity)}this.state=A.CDIR64_END_DATA_SECTOR;return i;case A.CDIR64_END_DATA_SECTOR:this.state=A.START;return i;case A.CDIR64_LOCATOR:this.state=A.START;return i;case A.CENTRAL_DIRECTORY_END:this.parsedEntity=this._readEndOfCentralDirectory(r);if(this.options.debug){console.log("decoded CENTRAL_DIRECTORY_END:",this.parsedEntity)}this.state=A.CENTRAL_DIRECTORY_END_COMMENT;return i;case A.CENTRAL_DIRECTORY_END_COMMENT:if(this.options.debug){console.log("decoded CENTRAL_DIRECTORY_END_COMMENT:",r.slice(0,i).toString())}this.state=A.TRAILING_JUNK;return i;case A.ERROR:return r.length;default:console.log("didn't handle state #",this.state,"discarding");return r.length}};UnzipStream.prototype._prepareOutStream=function(r,i){var s=this;var a=r.uncompressedSize===0&&/[\/\\]$/.test(i.path);i.path=i.path.replace(/^([/\\]*[.]+[/\\]+)*[/\\]*/,"");i.type=a?"Directory":"File";i.isDirectory=a;var c=!(r.flags&8);if(c){i.size=r.uncompressedSize}var g=r.versionsNeededToExtract<=45;this.outStreamInfo={stream:null,limit:c?r.compressedSize:-1,written:0};if(!c){var b=new Buffer(4);b.writeUInt32LE(y,0);var w=r.extra.zip64Mode;var C=w?20:12;var v={pattern:b,requiredExtraSize:C};var I=new p(v,(function(r,i){var a=s._readDataDescriptor(r,w);var l=a.compressedSize===i;if(!w&&!l&&i>=h){var c=i-h;while(c>=0){l=a.compressedSize===c;if(l)break;c-=h}}if(!l){return}s.state=A.FILE_DATA_END;var d=w?24:16;if(s.data.length>0){s.data=Buffer.concat([r.slice(d),s.data])}else{s.data=r.slice(d)}return true}));this.outStreamInfo.stream=I}else{this.outStreamInfo.stream=new l.PassThrough}var B=r.flags&1||r.flags&64;if(B||!g){var S=B?"Encrypted files are not supported!":"Zip version "+Math.floor(r.versionsNeededToExtract/10)+"."+r.versionsNeededToExtract%10+" is not supported";i.skip=true;setImmediate((()=>{i.emit("error",new Error(S))}));this.outStreamInfo.stream.pipe((new u).autodrain());return}var x=r.compressionMethod>0;if(x){var R=d.createInflateRaw();R.on("error",(function(r){s.state=A.ERROR;s.emit("error",r)}));this.outStreamInfo.stream.pipe(R).pipe(i)}else{this.outStreamInfo.stream.pipe(i)}if(this._drainAllEntries){i.autodrain()}};UnzipStream.prototype._readFile=function(r){var i=a.parse(r).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;return i};UnzipStream.prototype._readExtraFields=function(r){var i={};var s={parsed:i};if(this.options.debug){s.debug=[]}var l=0;while(l=A+4&&u&1){i.mtime=new Date(r.readUInt32LE(l+A)*1e3);A+=4}if(c.extraSize>=A+4&&u&2){i.atime=new Date(r.readUInt32LE(l+A)*1e3);A+=4}if(c.extraSize>=A+4&&u&4){i.ctime=new Date(r.readUInt32LE(l+A)*1e3)}break;case 28789:d="Info-ZIP Unicode Path Extra Field";var h=r.readUInt8(l);if(h===1){var A=1;var g=r.readUInt32LE(l+A);A+=4;var y=r.slice(l+A);i.path=y.toString()}break;case 13:case 22613:d=c.extraId===13?"PKWARE Unix":"Info-ZIP UNIX (type 1)";var A=0;if(c.extraSize>=8){var b=new Date(r.readUInt32LE(l+A)*1e3);A+=4;var w=new Date(r.readUInt32LE(l+A)*1e3);A+=4;i.atime=b;i.mtime=w;if(c.extraSize>=12){var C=r.readUInt16LE(l+A);A+=2;var v=r.readUInt16LE(l+A);A+=2;i.uid=C;i.gid=v}}break;case 30805:d="Info-ZIP UNIX (type 2)";var A=0;if(c.extraSize>=4){var C=r.readUInt16LE(l+A);A+=2;var v=r.readUInt16LE(l+A);A+=2;i.uid=C;i.gid=v}break;case 30837:d="Info-ZIP New Unix";var A=0;var I=r.readUInt8(l);A+=1;if(I===1){var B=r.readUInt8(l+A);A+=1;if(B<=6){i.uid=r.readUIntLE(l+A,B)}A+=B;var S=r.readUInt8(l+A);A+=1;if(S<=6){i.gid=r.readUIntLE(l+A,S)}}break;case 30062:d="ASi Unix";var A=0;if(c.extraSize>=14){var x=r.readUInt32LE(l+A);A+=4;var R=r.readUInt16LE(l+A);A+=2;var Q=r.readUInt32LE(l+A);A+=4;var C=r.readUInt16LE(l+A);A+=2;var v=r.readUInt16LE(l+A);A+=2;i.mode=R;i.uid=C;i.gid=v;if(c.extraSize>14){var _=l+A;var N=l+c.extraSize-14;var T=this._decodeString(r.slice(_,N));i.symlink=T}}break}if(this.options.debug){s.debug.push({extraId:"0x"+c.extraId.toString(16),description:d,data:r.slice(l,l+c.extraSize).inspect()})}l+=c.extraSize}return s};UnzipStream.prototype._readDataDescriptor=function(r,i){if(i){var s=a.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars;return s}var s=a.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;return s};UnzipStream.prototype._readCentralDirectoryEntry=function(r){var i=a.parse(r).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;return i};UnzipStream.prototype._readEndOfCentralDirectory64=function(r){var i=a.parse(r).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;return i};UnzipStream.prototype._readEndOfCentralDirectory=function(r){var i=a.parse(r).word16lu("diskNumber").word16lu("diskStart").word16lu("centralDirectoryEntries").word16lu("totalCentralDirectoryEntries").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;return i};const I="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";UnzipStream.prototype._decodeString=function(r,i){if(i){return r.toString("utf8")}if(this.options.decodeString){return this.options.decodeString(r)}let s="";for(var a=0;a0){this.data=this.data.slice(s);if(this.data.length===0)break}if(this.state===A.FILE_DATA){if(this.outStreamInfo.limit>=0){var a=this.outStreamInfo.limit-this.outStreamInfo.written;var l;if(a{if(this.state===A.FILE_DATA_END){this.state=A.START;return c.end(i)}i()}))}return}i()};UnzipStream.prototype.drainAll=function(){this._drainAllEntries=true};UnzipStream.prototype._transform=function(r,i,s){var a=this;if(a.data.length>0){a.data=Buffer.concat([a.data,r])}else{a.data=r}var l=a.data.length;var done=function(){if(a.data.length>0&&a.data.length0){i._parseOrOutput("buffer",(function(){if(i.data.length>0)return setImmediate((function(){i._flush(r)}));r()}));return}if(i.state===A.FILE_DATA){return r(new Error("Stream finished in an invalid state, uncompression failed"))}setImmediate(r)};r.exports=UnzipStream},89477:(r,i,s)=>{"use strict";i.Parse=s(22607);i.Extract=s(50055)},41257:(r,i,s)=>{r.exports=s(73837).deprecate},50757:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});Object.defineProperty(i,"v1",{enumerable:true,get:function(){return a.default}});Object.defineProperty(i,"v3",{enumerable:true,get:function(){return l.default}});Object.defineProperty(i,"v4",{enumerable:true,get:function(){return c.default}});Object.defineProperty(i,"v5",{enumerable:true,get:function(){return d.default}});Object.defineProperty(i,"NIL",{enumerable:true,get:function(){return p.default}});Object.defineProperty(i,"version",{enumerable:true,get:function(){return u.default}});Object.defineProperty(i,"validate",{enumerable:true,get:function(){return A.default}});Object.defineProperty(i,"stringify",{enumerable:true,get:function(){return h.default}});Object.defineProperty(i,"parse",{enumerable:true,get:function(){return g.default}});var a=_interopRequireDefault(s(56098));var l=_interopRequireDefault(s(31400));var c=_interopRequireDefault(s(25949));var d=_interopRequireDefault(s(20135));var p=_interopRequireDefault(s(74953));var u=_interopRequireDefault(s(99449));var A=_interopRequireDefault(s(70266));var h=_interopRequireDefault(s(28525));var g=_interopRequireDefault(s(32281));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}},83855:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(6113));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function md5(r){if(Array.isArray(r)){r=Buffer.from(r)}else if(typeof r==="string"){r=Buffer.from(r,"utf8")}return a.default.createHash("md5").update(r).digest()}var l=md5;i["default"]=l},74953:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s="00000000-0000-0000-0000-000000000000";i["default"]=s},32281:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(70266));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function parse(r){if(!(0,a.default)(r)){throw TypeError("Invalid UUID")}let i;const s=new Uint8Array(16);s[0]=(i=parseInt(r.slice(0,8),16))>>>24;s[1]=i>>>16&255;s[2]=i>>>8&255;s[3]=i&255;s[4]=(i=parseInt(r.slice(9,13),16))>>>8;s[5]=i&255;s[6]=(i=parseInt(r.slice(14,18),16))>>>8;s[7]=i&255;s[8]=(i=parseInt(r.slice(19,23),16))>>>8;s[9]=i&255;s[10]=(i=parseInt(r.slice(24,36),16))/1099511627776&255;s[11]=i/4294967296&255;s[12]=i>>>24&255;s[13]=i>>>16&255;s[14]=i>>>8&255;s[15]=i&255;return s}var l=parse;i["default"]=l},29741:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;i["default"]=s},29937:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=rng;var a=_interopRequireDefault(s(6113));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const l=new Uint8Array(256);let c=l.length;function rng(){if(c>l.length-16){a.default.randomFillSync(l);c=0}return l.slice(c,c+=16)}},30197:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(6113));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function sha1(r){if(Array.isArray(r)){r=Buffer.from(r)}else if(typeof r==="string"){r=Buffer.from(r,"utf8")}return a.default.createHash("sha1").update(r).digest()}var l=sha1;i["default"]=l},28525:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(70266));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const l=[];for(let r=0;r<256;++r){l.push((r+256).toString(16).substr(1))}function stringify(r,i=0){const s=(l[r[i+0]]+l[r[i+1]]+l[r[i+2]]+l[r[i+3]]+"-"+l[r[i+4]]+l[r[i+5]]+"-"+l[r[i+6]]+l[r[i+7]]+"-"+l[r[i+8]]+l[r[i+9]]+"-"+l[r[i+10]]+l[r[i+11]]+l[r[i+12]]+l[r[i+13]]+l[r[i+14]]+l[r[i+15]]).toLowerCase();if(!(0,a.default)(s)){throw TypeError("Stringified UUID is invalid")}return s}var c=stringify;i["default"]=c},56098:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(29937));var l=_interopRequireDefault(s(28525));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}let c;let d;let p=0;let u=0;function v1(r,i,s){let A=i&&s||0;const h=i||new Array(16);r=r||{};let g=r.node||c;let y=r.clockseq!==undefined?r.clockseq:d;if(g==null||y==null){const i=r.random||(r.rng||a.default)();if(g==null){g=c=[i[0]|1,i[1],i[2],i[3],i[4],i[5]]}if(y==null){y=d=(i[6]<<8|i[7])&16383}}let b=r.msecs!==undefined?r.msecs:Date.now();let w=r.nsecs!==undefined?r.nsecs:u+1;const C=b-p+(w-u)/1e4;if(C<0&&r.clockseq===undefined){y=y+1&16383}if((C<0||b>p)&&r.nsecs===undefined){w=0}if(w>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}p=b;u=w;d=y;b+=122192928e5;const v=((b&268435455)*1e4+w)%4294967296;h[A++]=v>>>24&255;h[A++]=v>>>16&255;h[A++]=v>>>8&255;h[A++]=v&255;const I=b/4294967296*1e4&268435455;h[A++]=I>>>8&255;h[A++]=I&255;h[A++]=I>>>24&15|16;h[A++]=I>>>16&255;h[A++]=y>>>8|128;h[A++]=y&255;for(let r=0;r<6;++r){h[A+r]=g[r]}return i||(0,l.default)(h)}var A=v1;i["default"]=A},31400:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(26230));var l=_interopRequireDefault(s(83855));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const c=(0,a.default)("v3",48,l.default);var d=c;i["default"]=d},26230:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=_default;i.URL=i.DNS=void 0;var a=_interopRequireDefault(s(28525));var l=_interopRequireDefault(s(32281));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function stringToBytes(r){r=unescape(encodeURIComponent(r));const i=[];for(let s=0;s{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(29937));var l=_interopRequireDefault(s(28525));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function v4(r,i,s){r=r||{};const c=r.random||(r.rng||a.default)();c[6]=c[6]&15|64;c[8]=c[8]&63|128;if(i){s=s||0;for(let r=0;r<16;++r){i[s+r]=c[r]}return i}return(0,l.default)(c)}var c=v4;i["default"]=c},20135:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(26230));var l=_interopRequireDefault(s(30197));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const c=(0,a.default)("v5",80,l.default);var d=c;i["default"]=d},70266:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(29741));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function validate(r){return typeof r==="string"&&a.default.test(r)}var l=validate;i["default"]=l},99449:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i["default"]=void 0;var a=_interopRequireDefault(s(70266));function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function version(r){if(!(0,a.default)(r)){throw TypeError("Invalid UUID")}return parseInt(r.substr(14,1),16)}var l=version;i["default"]=l},31268:r=>{"use strict";var i={};r.exports=i;function sign(r){return r<0?-1:1}function evenRound(r){if(r%1===.5&&(r&1)===0){return Math.floor(r)}else{return Math.round(r)}}function createNumberConversion(r,i){if(!i.unsigned){--r}const s=i.unsigned?0:-Math.pow(2,r);const a=Math.pow(2,r)-1;const l=i.moduloBitLength?Math.pow(2,i.moduloBitLength):Math.pow(2,r);const c=i.moduloBitLength?Math.pow(2,i.moduloBitLength-1):Math.pow(2,r-1);return function(r,d){if(!d)d={};let p=+r;if(d.enforceRange){if(!Number.isFinite(p)){throw new TypeError("Argument is not a finite number")}p=sign(p)*Math.floor(Math.abs(p));if(pa){throw new TypeError("Argument is not in byte range")}return p}if(!isNaN(p)&&d.clamp){p=evenRound(p);if(pa)p=a;return p}if(!Number.isFinite(p)||p===0){return 0}p=sign(p)*Math.floor(Math.abs(p));p=p%l;if(!i.unsigned&&p>=c){return p-l}else if(i.unsigned){if(p<0){p+=l}else if(p===-0){return 0}}return p}}i["void"]=function(){return undefined};i["boolean"]=function(r){return!!r};i["byte"]=createNumberConversion(8,{unsigned:false});i["octet"]=createNumberConversion(8,{unsigned:true});i["short"]=createNumberConversion(16,{unsigned:false});i["unsigned short"]=createNumberConversion(16,{unsigned:true});i["long"]=createNumberConversion(32,{unsigned:false});i["unsigned long"]=createNumberConversion(32,{unsigned:true});i["long long"]=createNumberConversion(32,{unsigned:false,moduloBitLength:64});i["unsigned long long"]=createNumberConversion(32,{unsigned:true,moduloBitLength:64});i["double"]=function(r){const i=+r;if(!Number.isFinite(i)){throw new TypeError("Argument is not a finite floating-point value")}return i};i["unrestricted double"]=function(r){const i=+r;if(isNaN(i)){throw new TypeError("Argument is NaN")}return i};i["float"]=i["double"];i["unrestricted float"]=i["unrestricted double"];i["DOMString"]=function(r,i){if(!i)i={};if(i.treatNullAsEmptyString&&r===null){return""}return String(r)};i["ByteString"]=function(r,i){const s=String(r);let a=undefined;for(let r=0;(a=s.codePointAt(r))!==undefined;++r){if(a>255){throw new TypeError("Argument is not a valid bytestring")}}return s};i["USVString"]=function(r){const i=String(r);const s=i.length;const a=[];for(let r=0;r57343){a.push(String.fromCodePoint(l))}else if(56320<=l&&l<=57343){a.push(String.fromCodePoint(65533))}else{if(r===s-1){a.push(String.fromCodePoint(65533))}else{const s=i.charCodeAt(r+1);if(56320<=s&&s<=57343){const i=l&1023;const c=s&1023;a.push(String.fromCodePoint((2<<15)+(2<<9)*i+c));++r}else{a.push(String.fromCodePoint(65533))}}}}return a.join("")};i["Date"]=function(r,i){if(!(r instanceof Date)){throw new TypeError("Argument is not a Date object")}if(isNaN(r)){return undefined}return r};i["RegExp"]=function(r,i){if(!(r instanceof RegExp)){r=new RegExp(r)}return r}},43972:(r,i,s)=>{"use strict";const a=s(41622);i.implementation=class URLImpl{constructor(r){const i=r[0];const s=r[1];let l=null;if(s!==undefined){l=a.basicURLParse(s);if(l==="failure"){throw new TypeError("Invalid base URL")}}const c=a.basicURLParse(i,{baseURL:l});if(c==="failure"){throw new TypeError("Invalid URL")}this._url=c}get href(){return a.serializeURL(this._url)}set href(r){const i=a.basicURLParse(r);if(i==="failure"){throw new TypeError("Invalid URL")}this._url=i}get origin(){return a.serializeURLOrigin(this._url)}get protocol(){return this._url.scheme+":"}set protocol(r){a.basicURLParse(r+":",{url:this._url,stateOverride:"scheme start"})}get username(){return this._url.username}set username(r){if(a.cannotHaveAUsernamePasswordPort(this._url)){return}a.setTheUsername(this._url,r)}get password(){return this._url.password}set password(r){if(a.cannotHaveAUsernamePasswordPort(this._url)){return}a.setThePassword(this._url,r)}get host(){const r=this._url;if(r.host===null){return""}if(r.port===null){return a.serializeHost(r.host)}return a.serializeHost(r.host)+":"+a.serializeInteger(r.port)}set host(r){if(this._url.cannotBeABaseURL){return}a.basicURLParse(r,{url:this._url,stateOverride:"host"})}get hostname(){if(this._url.host===null){return""}return a.serializeHost(this._url.host)}set hostname(r){if(this._url.cannotBeABaseURL){return}a.basicURLParse(r,{url:this._url,stateOverride:"hostname"})}get port(){if(this._url.port===null){return""}return a.serializeInteger(this._url.port)}set port(r){if(a.cannotHaveAUsernamePasswordPort(this._url)){return}if(r===""){this._url.port=null}else{a.basicURLParse(r,{url:this._url,stateOverride:"port"})}}get pathname(){if(this._url.cannotBeABaseURL){return this._url.path[0]}if(this._url.path.length===0){return""}return"/"+this._url.path.join("/")}set pathname(r){if(this._url.cannotBeABaseURL){return}this._url.path=[];a.basicURLParse(r,{url:this._url,stateOverride:"path start"})}get search(){if(this._url.query===null||this._url.query===""){return""}return"?"+this._url.query}set search(r){const i=this._url;if(r===""){i.query=null;return}const s=r[0]==="?"?r.substring(1):r;i.query="";a.basicURLParse(s,{url:i,stateOverride:"query"})}get hash(){if(this._url.fragment===null||this._url.fragment===""){return""}return"#"+this._url.fragment}set hash(r){if(r===""){this._url.fragment=null;return}const i=r[0]==="#"?r.substring(1):r;this._url.fragment="";a.basicURLParse(i,{url:this._url,stateOverride:"fragment"})}toJSON(){return this.href}}},6432:(r,i,s)=>{"use strict";const a=s(31268);const l=s(15871);const c=s(43972);const d=l.implSymbol;function URL(i){if(!this||this[d]||!(this instanceof URL)){throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.")}if(arguments.length<1){throw new TypeError("Failed to construct 'URL': 1 argument required, but only "+arguments.length+" present.")}const s=[];for(let r=0;r{"use strict";i.URL=s(6432)["interface"];i.serializeURL=s(41622).serializeURL;i.serializeURLOrigin=s(41622).serializeURLOrigin;i.basicURLParse=s(41622).basicURLParse;i.setTheUsername=s(41622).setTheUsername;i.setThePassword=s(41622).setThePassword;i.serializeHost=s(41622).serializeHost;i.serializeInteger=s(41622).serializeInteger;i.parseURL=s(41622).parseURL},41622:(r,i,s)=>{"use strict";const a=s(85477);const l=s(60265);const c={ftp:21,file:null,gopher:70,http:80,https:443,ws:80,wss:443};const d=Symbol("failure");function countSymbols(r){return a.ucs2.decode(r).length}function at(r,i){const s=r[i];return isNaN(s)?undefined:String.fromCodePoint(s)}function isASCIIDigit(r){return r>=48&&r<=57}function isASCIIAlpha(r){return r>=65&&r<=90||r>=97&&r<=122}function isASCIIAlphanumeric(r){return isASCIIAlpha(r)||isASCIIDigit(r)}function isASCIIHex(r){return isASCIIDigit(r)||r>=65&&r<=70||r>=97&&r<=102}function isSingleDot(r){return r==="."||r.toLowerCase()==="%2e"}function isDoubleDot(r){r=r.toLowerCase();return r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"}function isWindowsDriveLetterCodePoints(r,i){return isASCIIAlpha(r)&&(i===58||i===124)}function isWindowsDriveLetterString(r){return r.length===2&&isASCIIAlpha(r.codePointAt(0))&&(r[1]===":"||r[1]==="|")}function isNormalizedWindowsDriveLetterString(r){return r.length===2&&isASCIIAlpha(r.codePointAt(0))&&r[1]===":"}function containsForbiddenHostCodePoint(r){return r.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/)!==-1}function containsForbiddenHostCodePointExcludingPercent(r){return r.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/)!==-1}function isSpecialScheme(r){return c[r]!==undefined}function isSpecial(r){return isSpecialScheme(r.scheme)}function defaultPort(r){return c[r]}function percentEncode(r){let i=r.toString(16).toUpperCase();if(i.length===1){i="0"+i}return"%"+i}function utf8PercentEncode(r){const i=new Buffer(r);let s="";for(let r=0;r126}const p=new Set([32,34,35,60,62,63,96,123,125]);function isPathPercentEncode(r){return isC0ControlPercentEncode(r)||p.has(r)}const u=new Set([47,58,59,61,64,91,92,93,94,124]);function isUserinfoPercentEncode(r){return isPathPercentEncode(r)||u.has(r)}function percentEncodeChar(r,i){const s=String.fromCodePoint(r);if(i(r)){return utf8PercentEncode(s)}return s}function parseIPv4Number(r){let i=10;if(r.length>=2&&r.charAt(0)==="0"&&r.charAt(1).toLowerCase()==="x"){r=r.substring(2);i=16}else if(r.length>=2&&r.charAt(0)==="0"){r=r.substring(1);i=8}if(r===""){return 0}const s=i===10?/[^0-9]/:i===16?/[^0-9A-Fa-f]/:/[^0-7]/;if(s.test(r)){return d}return parseInt(r,i)}function parseIPv4(r){const i=r.split(".");if(i[i.length-1]===""){if(i.length>1){i.pop()}}if(i.length>4){return r}const s=[];for(const a of i){if(a===""){return r}const i=parseIPv4Number(a);if(i===d){return r}s.push(i)}for(let r=0;r255){return d}}if(s[s.length-1]>=Math.pow(256,5-s.length)){return d}let a=s.pop();let l=0;for(const r of s){a+=r*Math.pow(256,3-l);++l}return a}function serializeIPv4(r){let i="";let s=r;for(let r=1;r<=4;++r){i=String(s%256)+i;if(r!==4){i="."+i}s=Math.floor(s/256)}return i}function parseIPv6(r){const i=[0,0,0,0,0,0,0,0];let s=0;let l=null;let c=0;r=a.ucs2.decode(r);if(r[c]===58){if(r[c+1]!==58){return d}c+=2;++s;l=s}while(c6){return d}let a=0;while(r[c]!==undefined){let l=null;if(a>0){if(r[c]===46&&a<4){++c}else{return d}}if(!isASCIIDigit(r[c])){return d}while(isASCIIDigit(r[c])){const i=parseInt(at(r,c));if(l===null){l=i}else if(l===0){return d}else{l=l*10+i}if(l>255){return d}++c}i[s]=i[s]*256+l;++a;if(a===2||a===4){++s}}if(a!==4){return d}break}else if(r[c]===58){++c;if(r[c]===undefined){return d}}else if(r[c]!==undefined){return d}i[s]=a;++s}if(l!==null){let r=s-l;s=7;while(s!==0&&r>0){const a=i[l+r-1];i[l+r-1]=i[s];i[s]=a;--s;--r}}else if(l===null&&s!==8){return d}return i}function serializeIPv6(r){let i="";const s=findLongestZeroSequence(r);const a=s.idx;let l=false;for(let s=0;s<=7;++s){if(l&&r[s]===0){continue}else if(l){l=false}if(a===s){const r=s===0?"::":":";i+=r;l=true;continue}i+=r[s].toString(16);if(s!==7){i+=":"}}return i}function parseHost(r,i){if(r[0]==="["){if(r[r.length-1]!=="]"){return d}return parseIPv6(r.substring(1,r.length-1))}if(!i){return parseOpaqueHost(r)}const s=utf8PercentDecode(r);const a=l.toASCII(s,false,l.PROCESSING_OPTIONS.NONTRANSITIONAL,false);if(a===null){return d}if(containsForbiddenHostCodePoint(a)){return d}const c=parseIPv4(a);if(typeof c==="number"||c===d){return c}return a}function parseOpaqueHost(r){if(containsForbiddenHostCodePointExcludingPercent(r)){return d}let i="";const s=a.ucs2.decode(r);for(let r=0;rs){i=a;s=l}a=null;l=0}else{if(a===null){a=c}++l}}if(l>s){i=a;s=l}return{idx:i,len:s}}function serializeHost(r){if(typeof r==="number"){return serializeIPv4(r)}if(r instanceof Array){return"["+serializeIPv6(r)+"]"}return r}function trimControlChars(r){return r.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g,"")}function trimTabAndNewline(r){return r.replace(/\u0009|\u000A|\u000D/g,"")}function shortenPath(r){const i=r.path;if(i.length===0){return}if(r.scheme==="file"&&i.length===1&&isNormalizedWindowsDriveLetter(i[0])){return}i.pop()}function includesCredentials(r){return r.username!==""||r.password!==""}function cannotHaveAUsernamePasswordPort(r){return r.host===null||r.host===""||r.cannotBeABaseURL||r.scheme==="file"}function isNormalizedWindowsDriveLetter(r){return/^[A-Za-z]:$/.test(r)}function URLStateMachine(r,i,s,l,c){this.pointer=0;this.input=r;this.base=i||null;this.encodingOverride=s||"utf-8";this.stateOverride=c;this.url=l;this.failure=false;this.parseError=false;if(!this.url){this.url={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,cannotBeABaseURL:false};const r=trimControlChars(this.input);if(r!==this.input){this.parseError=true}this.input=r}const p=trimTabAndNewline(this.input);if(p!==this.input){this.parseError=true}this.input=p;this.state=c||"scheme start";this.buffer="";this.atFlag=false;this.arrFlag=false;this.passwordTokenSeenFlag=false;this.input=a.ucs2.decode(this.input);for(;this.pointer<=this.input.length;++this.pointer){const r=this.input[this.pointer];const i=isNaN(r)?undefined:String.fromCodePoint(r);const s=this["parse "+this.state](r,i);if(!s){break}else if(s===d){this.failure=true;break}}}URLStateMachine.prototype["parse scheme start"]=function parseSchemeStart(r,i){if(isASCIIAlpha(r)){this.buffer+=i.toLowerCase();this.state="scheme"}else if(!this.stateOverride){this.state="no scheme";--this.pointer}else{this.parseError=true;return d}return true};URLStateMachine.prototype["parse scheme"]=function parseScheme(r,i){if(isASCIIAlphanumeric(r)||r===43||r===45||r===46){this.buffer+=i.toLowerCase()}else if(r===58){if(this.stateOverride){if(isSpecial(this.url)&&!isSpecialScheme(this.buffer)){return false}if(!isSpecial(this.url)&&isSpecialScheme(this.buffer)){return false}if((includesCredentials(this.url)||this.url.port!==null)&&this.buffer==="file"){return false}if(this.url.scheme==="file"&&(this.url.host===""||this.url.host===null)){return false}}this.url.scheme=this.buffer;this.buffer="";if(this.stateOverride){return false}if(this.url.scheme==="file"){if(this.input[this.pointer+1]!==47||this.input[this.pointer+2]!==47){this.parseError=true}this.state="file"}else if(isSpecial(this.url)&&this.base!==null&&this.base.scheme===this.url.scheme){this.state="special relative or authority"}else if(isSpecial(this.url)){this.state="special authority slashes"}else if(this.input[this.pointer+1]===47){this.state="path or authority";++this.pointer}else{this.url.cannotBeABaseURL=true;this.url.path.push("");this.state="cannot-be-a-base-URL path"}}else if(!this.stateOverride){this.buffer="";this.state="no scheme";this.pointer=-1}else{this.parseError=true;return d}return true};URLStateMachine.prototype["parse no scheme"]=function parseNoScheme(r){if(this.base===null||this.base.cannotBeABaseURL&&r!==35){return d}else if(this.base.cannotBeABaseURL&&r===35){this.url.scheme=this.base.scheme;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.url.cannotBeABaseURL=true;this.state="fragment"}else if(this.base.scheme==="file"){this.state="file";--this.pointer}else{this.state="relative";--this.pointer}return true};URLStateMachine.prototype["parse special relative or authority"]=function parseSpecialRelativeOrAuthority(r){if(r===47&&this.input[this.pointer+1]===47){this.state="special authority ignore slashes";++this.pointer}else{this.parseError=true;this.state="relative";--this.pointer}return true};URLStateMachine.prototype["parse path or authority"]=function parsePathOrAuthority(r){if(r===47){this.state="authority"}else{this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse relative"]=function parseRelative(r){this.url.scheme=this.base.scheme;if(isNaN(r)){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query=this.base.query}else if(r===47){this.state="relative slash"}else if(r===63){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query="";this.state="query"}else if(r===35){this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.state="fragment"}else if(isSpecial(this.url)&&r===92){this.parseError=true;this.state="relative slash"}else{this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.url.path=this.base.path.slice(0,this.base.path.length-1);this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse relative slash"]=function parseRelativeSlash(r){if(isSpecial(this.url)&&(r===47||r===92)){if(r===92){this.parseError=true}this.state="special authority ignore slashes"}else if(r===47){this.state="authority"}else{this.url.username=this.base.username;this.url.password=this.base.password;this.url.host=this.base.host;this.url.port=this.base.port;this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse special authority slashes"]=function parseSpecialAuthoritySlashes(r){if(r===47&&this.input[this.pointer+1]===47){this.state="special authority ignore slashes";++this.pointer}else{this.parseError=true;this.state="special authority ignore slashes";--this.pointer}return true};URLStateMachine.prototype["parse special authority ignore slashes"]=function parseSpecialAuthorityIgnoreSlashes(r){if(r!==47&&r!==92){this.state="authority";--this.pointer}else{this.parseError=true}return true};URLStateMachine.prototype["parse authority"]=function parseAuthority(r,i){if(r===64){this.parseError=true;if(this.atFlag){this.buffer="%40"+this.buffer}this.atFlag=true;const r=countSymbols(this.buffer);for(let i=0;iMath.pow(2,16)-1){this.parseError=true;return d}this.url.port=r===defaultPort(this.url.scheme)?null:r;this.buffer=""}if(this.stateOverride){return false}this.state="path start";--this.pointer}else{this.parseError=true;return d}return true};const A=new Set([47,92,63,35]);URLStateMachine.prototype["parse file"]=function parseFile(r){this.url.scheme="file";if(r===47||r===92){if(r===92){this.parseError=true}this.state="file slash"}else if(this.base!==null&&this.base.scheme==="file"){if(isNaN(r)){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query=this.base.query}else if(r===63){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query="";this.state="query"}else if(r===35){this.url.host=this.base.host;this.url.path=this.base.path.slice();this.url.query=this.base.query;this.url.fragment="";this.state="fragment"}else{if(this.input.length-this.pointer-1===0||!isWindowsDriveLetterCodePoints(r,this.input[this.pointer+1])||this.input.length-this.pointer-1>=2&&!A.has(this.input[this.pointer+2])){this.url.host=this.base.host;this.url.path=this.base.path.slice();shortenPath(this.url)}else{this.parseError=true}this.state="path";--this.pointer}}else{this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse file slash"]=function parseFileSlash(r){if(r===47||r===92){if(r===92){this.parseError=true}this.state="file host"}else{if(this.base!==null&&this.base.scheme==="file"){if(isNormalizedWindowsDriveLetterString(this.base.path[0])){this.url.path.push(this.base.path[0])}else{this.url.host=this.base.host}}this.state="path";--this.pointer}return true};URLStateMachine.prototype["parse file host"]=function parseFileHost(r,i){if(isNaN(r)||r===47||r===92||r===63||r===35){--this.pointer;if(!this.stateOverride&&isWindowsDriveLetterString(this.buffer)){this.parseError=true;this.state="path"}else if(this.buffer===""){this.url.host="";if(this.stateOverride){return false}this.state="path start"}else{let r=parseHost(this.buffer,isSpecial(this.url));if(r===d){return d}if(r==="localhost"){r=""}this.url.host=r;if(this.stateOverride){return false}this.buffer="";this.state="path start"}}else{this.buffer+=i}return true};URLStateMachine.prototype["parse path start"]=function parsePathStart(r){if(isSpecial(this.url)){if(r===92){this.parseError=true}this.state="path";if(r!==47&&r!==92){--this.pointer}}else if(!this.stateOverride&&r===63){this.url.query="";this.state="query"}else if(!this.stateOverride&&r===35){this.url.fragment="";this.state="fragment"}else if(r!==undefined){this.state="path";if(r!==47){--this.pointer}}return true};URLStateMachine.prototype["parse path"]=function parsePath(r){if(isNaN(r)||r===47||isSpecial(this.url)&&r===92||!this.stateOverride&&(r===63||r===35)){if(isSpecial(this.url)&&r===92){this.parseError=true}if(isDoubleDot(this.buffer)){shortenPath(this.url);if(r!==47&&!(isSpecial(this.url)&&r===92)){this.url.path.push("")}}else if(isSingleDot(this.buffer)&&r!==47&&!(isSpecial(this.url)&&r===92)){this.url.path.push("")}else if(!isSingleDot(this.buffer)){if(this.url.scheme==="file"&&this.url.path.length===0&&isWindowsDriveLetterString(this.buffer)){if(this.url.host!==""&&this.url.host!==null){this.parseError=true;this.url.host=""}this.buffer=this.buffer[0]+":"}this.url.path.push(this.buffer)}this.buffer="";if(this.url.scheme==="file"&&(r===undefined||r===63||r===35)){while(this.url.path.length>1&&this.url.path[0]===""){this.parseError=true;this.url.path.shift()}}if(r===63){this.url.query="";this.state="query"}if(r===35){this.url.fragment="";this.state="fragment"}}else{if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.buffer+=percentEncodeChar(r,isPathPercentEncode)}return true};URLStateMachine.prototype["parse cannot-be-a-base-URL path"]=function parseCannotBeABaseURLPath(r){if(r===63){this.url.query="";this.state="query"}else if(r===35){this.url.fragment="";this.state="fragment"}else{if(!isNaN(r)&&r!==37){this.parseError=true}if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}if(!isNaN(r)){this.url.path[0]=this.url.path[0]+percentEncodeChar(r,isC0ControlPercentEncode)}}return true};URLStateMachine.prototype["parse query"]=function parseQuery(r,i){if(isNaN(r)||!this.stateOverride&&r===35){if(!isSpecial(this.url)||this.url.scheme==="ws"||this.url.scheme==="wss"){this.encodingOverride="utf-8"}const i=new Buffer(this.buffer);for(let r=0;r126||i[r]===34||i[r]===35||i[r]===60||i[r]===62){this.url.query+=percentEncode(i[r])}else{this.url.query+=String.fromCodePoint(i[r])}}this.buffer="";if(r===35){this.url.fragment="";this.state="fragment"}}else{if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.buffer+=i}return true};URLStateMachine.prototype["parse fragment"]=function parseFragment(r){if(isNaN(r)){}else if(r===0){this.parseError=true}else{if(r===37&&(!isASCIIHex(this.input[this.pointer+1])||!isASCIIHex(this.input[this.pointer+2]))){this.parseError=true}this.url.fragment+=percentEncodeChar(r,isC0ControlPercentEncode)}return true};function serializeURL(r,i){let s=r.scheme+":";if(r.host!==null){s+="//";if(r.username!==""||r.password!==""){s+=r.username;if(r.password!==""){s+=":"+r.password}s+="@"}s+=serializeHost(r.host);if(r.port!==null){s+=":"+r.port}}else if(r.host===null&&r.scheme==="file"){s+="//"}if(r.cannotBeABaseURL){s+=r.path[0]}else{for(const i of r.path){s+="/"+i}}if(r.query!==null){s+="?"+r.query}if(!i&&r.fragment!==null){s+="#"+r.fragment}return s}function serializeOrigin(r){let i=r.scheme+"://";i+=serializeHost(r.host);if(r.port!==null){i+=":"+r.port}return i}r.exports.serializeURL=serializeURL;r.exports.serializeURLOrigin=function(i){switch(i.scheme){case"blob":try{return r.exports.serializeURLOrigin(r.exports.parseURL(i.path[0]))}catch(r){return"null"}case"ftp":case"gopher":case"http":case"https":case"ws":case"wss":return serializeOrigin({scheme:i.scheme,host:i.host,port:i.port});case"file":return"file://";default:return"null"}};r.exports.basicURLParse=function(r,i){if(i===undefined){i={}}const s=new URLStateMachine(r,i.baseURL,i.encodingOverride,i.url,i.stateOverride);if(s.failure){return"failure"}return s.url};r.exports.setTheUsername=function(r,i){r.username="";const s=a.ucs2.decode(i);for(let i=0;i{"use strict";r.exports.mixin=function mixin(r,i){const s=Object.getOwnPropertyNames(i);for(let a=0;a{r.exports=wrappy;function wrappy(r,i){if(r&&i)return wrappy(r)(i);if(typeof r!=="function")throw new TypeError("need wrapper function");Object.keys(r).forEach((function(i){wrapper[i]=r[i]}));return wrapper;function wrapper(){var i=new Array(arguments.length);for(var s=0;s"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},66623:function(r,i,s){(function(){var i,a,l,extend=function(r,i){for(var s in i){if(c.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=s(1917);l=s(13582);r.exports=a=function(r){extend(XMLCData,r);function XMLCData(r,s){XMLCData.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(s)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))};return XMLCData}(l)}).call(this)},13582:function(r,i,s){(function(){var i,a,extend=function(r,i){for(var s in i){if(l.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=s(39764);r.exports=i=function(r){extend(XMLCharacterData,r);function XMLCharacterData(r){XMLCharacterData.__super__.constructor.call(this,r);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(r,i,s){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(r){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},61810:function(r,i,s){(function(){var i,a,l,extend=function(r,i){for(var s in i){if(c.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=s(1917);a=s(13582);r.exports=l=function(r){extend(XMLComment,r);function XMLComment(r,s){XMLComment.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(s)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))};return XMLComment}(a)}).call(this)},69502:function(r,i,s){(function(){var i,a,l;a=s(75818);l=s(69795);r.exports=i=function(){function XMLDOMConfiguration(){var r;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=r=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(r,i){return true};XMLDOMConfiguration.prototype.setParameter=function(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}};return XMLDOMConfiguration}()}).call(this)},75818:function(r){(function(){var i;r.exports=i=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(r){throw new Error(r)};return XMLDOMErrorHandler}()}).call(this)},6277:function(r){(function(){var i;r.exports=i=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(r,i){return true};XMLDOMImplementation.prototype.createDocumentType=function(r,i,s){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(r,i,s){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},69795:function(r){(function(){var i;r.exports=i=function(){function XMLDOMStringList(r){this.arr=r||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(r){return this.arr[r]||null};XMLDOMStringList.prototype.contains=function(r){return this.arr.indexOf(r)!==-1};return XMLDOMStringList}()}).call(this)},18553:function(r,i,s){(function(){var i,a,l,extend=function(r,i){for(var s in i){if(c.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=s(39764);i=s(1917);r.exports=a=function(r){extend(XMLDTDAttList,r);function XMLDTDAttList(r,s,a,l,c,d){XMLDTDAttList.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(s))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(s))}if(!c){throw new Error("Missing DTD attribute default. "+this.debugInfo(s))}if(c.indexOf("#")!==0){c="#"+c}if(!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(s))}if(d&&!c.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(s))}this.elementName=this.stringify.name(s);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(d){this.defaultValue=this.stringify.dtdAttDefault(d)}this.defaultValueType=c}XMLDTDAttList.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))};return XMLDTDAttList}(l)}).call(this)},16766:function(r,i,s){(function(){var i,a,l,extend=function(r,i){for(var s in i){if(c.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=s(39764);i=s(1917);r.exports=a=function(r){extend(XMLDTDElement,r);function XMLDTDElement(r,s,a){XMLDTDElement.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(s);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))};return XMLDTDElement}(l)}).call(this)},58232:function(r,i,s){(function(){var i,a,l,c,extend=function(r,i){for(var s in i){if(d.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},d={}.hasOwnProperty;c=s(9784).isObject;l=s(39764);i=s(1917);r.exports=a=function(r){extend(XMLDTDEntity,r);function XMLDTDEntity(r,s,a,l){XMLDTDEntity.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!s;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!c(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))};return XMLDTDEntity}(l)}).call(this)},53552:function(r,i,s){(function(){var i,a,l,extend=function(r,i){for(var s in i){if(c.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=s(39764);i=s(1917);r.exports=a=function(r){extend(XMLDTDNotation,r);function XMLDTDNotation(r,s,a){XMLDTDNotation.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing DTD notation name. "+this.debugInfo(s))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(s))}this.name=this.stringify.name(s);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))};return XMLDTDNotation}(l)}).call(this)},10731:function(r,i,s){(function(){var i,a,l,c,extend=function(r,i){for(var s in i){if(d.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},d={}.hasOwnProperty;c=s(9784).isObject;l=s(39764);i=s(1917);r.exports=a=function(r){extend(XMLDeclaration,r);function XMLDeclaration(r,s,a,l){var d;XMLDeclaration.__super__.constructor.call(this,r);if(c(s)){d=s,s=d.version,a=d.encoding,l=d.standalone}if(!s){s="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(s);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}XMLDeclaration.prototype.toString=function(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))};return XMLDeclaration}(l)}).call(this)},10761:function(r,i,s){(function(){var i,a,l,c,d,p,u,A,h,extend=function(r,i){for(var s in i){if(g.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;h=s(9784).isObject;A=s(39764);i=s(1917);a=s(18553);c=s(58232);l=s(16766);d=s(53552);u=s(55459);r.exports=p=function(r){extend(XMLDocType,r);function XMLDocType(r,s,a){var l,c,d,p,u,A;XMLDocType.__super__.constructor.call(this,r);this.type=i.DocType;if(r.children){p=r.children;for(c=0,d=p.length;c=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(r){var s,l,c,d;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;d=r.attribs;for(c in d){if(!k.call(d,c))continue;s=d[c];l+=this.writer.attribute(s,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+""}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(r){var s;if(!r.isClosed){s="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){s=this.writer.indent(r,this.writerOptions,this.currentLevel)+""+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{s=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(s,this.currentLevel);return r.isClosed=true}};XMLDocumentCB.prototype.onData=function(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(r){if(r==null){return""}else{return"node: <"+r+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(r,i,s){return this.node(r,i,s)};XMLDocumentCB.prototype.txt=function(r){return this.text(r)};XMLDocumentCB.prototype.dat=function(r){return this.cdata(r)};XMLDocumentCB.prototype.com=function(r){return this.comment(r)};XMLDocumentCB.prototype.ins=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.dec=function(r,i,s){return this.declaration(r,i,s)};XMLDocumentCB.prototype.dtd=function(r,i,s){return this.doctype(r,i,s)};XMLDocumentCB.prototype.e=function(r,i,s){return this.element(r,i,s)};XMLDocumentCB.prototype.n=function(r,i,s){return this.node(r,i,s)};XMLDocumentCB.prototype.t=function(r){return this.text(r)};XMLDocumentCB.prototype.d=function(r){return this.cdata(r)};XMLDocumentCB.prototype.c=function(r){return this.comment(r)};XMLDocumentCB.prototype.r=function(r){return this.raw(r)};XMLDocumentCB.prototype.i=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocumentCB.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocumentCB.prototype.not=function(r,i){return this.notation(r,i)};return XMLDocumentCB}()}).call(this)},89033:function(r,i,s){(function(){var i,a,l,extend=function(r,i){for(var s in i){if(c.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=s(39764);i=s(1917);r.exports=a=function(r){extend(XMLDummy,r);function XMLDummy(r){XMLDummy.__super__.constructor.call(this,r);this.type=i.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(r){return""};return XMLDummy}(l)}).call(this)},31787:function(r,i,s){(function(){var i,a,l,c,d,p,u,A,h,extend=function(r,i){for(var s in i){if(g.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;h=s(9784),A=h.isObject,u=h.isFunction,p=h.getValue;d=s(39764);i=s(1917);a=s(48370);c=s(55459);r.exports=l=function(r){extend(XMLElement,r);function XMLElement(r,s,a){var l,c,d,p;XMLElement.__super__.constructor.call(this,r);if(s==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(s);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){p=r.children;for(c=0,d=p.length;c=a;i=0<=a?++s:--s){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true};return XMLElement}(d)}).call(this)},55459:function(r){(function(){var i;r.exports=i=function(){function XMLNamedNodeMap(r){this.nodes=r}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(r){return this.nodes[r]};XMLNamedNodeMap.prototype.setNamedItem=function(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null};XMLNamedNodeMap.prototype.removeNamedItem=function(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null};XMLNamedNodeMap.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},39764:function(r,i,s){(function(){var i,a,l,c,d,p,u,A,h,g,y,b,w,C,v,I,B,S,x,R={}.hasOwnProperty;x=s(9784),S=x.isObject,B=x.isFunction,I=x.isEmpty,v=x.getValue;A=null;l=null;c=null;d=null;p=null;w=null;C=null;b=null;u=null;a=null;y=null;h=null;i=null;r.exports=g=function(){function XMLNode(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!A){A=s(31787);l=s(66623);c=s(61810);d=s(10731);p=s(10761);w=s(67118);C=s(75554);b=s(8120);u=s(89033);a=s(1917);y=s(98770);h=s(55459);i=s(11491)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new y(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,s,l,c;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){c="";l=this.children;for(i=0,s=l.length;i"}else if(!((s=this.parent)!=null?s.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(r,i,s){return this.element(r,i,s)};XMLNode.prototype.nod=function(r,i,s){return this.node(r,i,s)};XMLNode.prototype.txt=function(r){return this.text(r)};XMLNode.prototype.dat=function(r){return this.cdata(r)};XMLNode.prototype.com=function(r){return this.comment(r)};XMLNode.prototype.ins=function(r,i){return this.instruction(r,i)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(r,i,s){return this.declaration(r,i,s)};XMLNode.prototype.e=function(r,i,s){return this.element(r,i,s)};XMLNode.prototype.n=function(r,i,s){return this.node(r,i,s)};XMLNode.prototype.t=function(r){return this.text(r)};XMLNode.prototype.d=function(r){return this.cdata(r)};XMLNode.prototype.c=function(r){return this.comment(r)};XMLNode.prototype.r=function(r){return this.raw(r)};XMLNode.prototype.i=function(r,i){return this.instruction(r,i)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(r){return this.importDocument(r)};XMLNode.prototype.replaceChild=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(r,i){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(r){var s,a;s=this;if(s===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(s.isAncestor(r)){return i.Contains|i.Preceding}else if(s.isDescendant(r)){return i.Contains|i.Following}else if(s.isPreceding(r)){return i.Preceding}else{return i.Following}};XMLNode.prototype.isSameNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(r){var i,s,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=s=0,a=this.children.length-1;0<=a?s<=a:s>=a;i=0<=a?++s:--s){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true};XMLNode.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(r,i,s){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(r){if(!r){return false}return r===this||this.isDescendant(r)};XMLNode.prototype.isDescendant=function(r){var i,s,a,l,c;c=this.children;for(a=0,l=c.length;as}};XMLNode.prototype.treePosition=function(r){var i,s;s=0;i=false;this.foreachTreeNode(this.document(),(function(a){s++;if(!i&&a===r){return i=true}}));if(i){return s}else{return-1}};XMLNode.prototype.foreachTreeNode=function(r,i){var s,a,l,c,d;r||(r=this.document());c=r.children;for(a=0,l=c.length;a0){this.stream.write(" [");this.stream.write(this.endline(r,i,s));i.state=a.InsideTag;p=r.children;for(c=0,d=p.length;c");this.stream.write(this.endline(r,i,s));i.state=a.None;return this.closeNode(r,i,s)};XMLStreamWriter.prototype.element=function(r,s,l){var c,p,u,A,h,g,y,b,w,C;l||(l=0);this.openNode(r,s,l);s.state=a.OpenTag;this.stream.write(this.indent(r,s,l)+"<"+r.name);w=r.attribs;for(y in w){if(!d.call(w,y))continue;c=w[y];this.attribute(c,s,l)}u=r.children.length;A=u===0?null:r.children[0];if(u===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(s.allowEmpty){this.stream.write(">");s.state=a.CloseTag;this.stream.write("")}else{s.state=a.CloseTag;this.stream.write(s.spaceBeforeSlash+"/>")}}else if(s.pretty&&u===1&&(A.type===i.Text||A.type===i.Raw)&&A.value!=null){this.stream.write(">");s.state=a.InsideTag;s.suppressPrettyCount++;b=true;this.writeChildNode(A,s,l+1);s.suppressPrettyCount--;b=false;s.state=a.CloseTag;this.stream.write("")}else{this.stream.write(">"+this.endline(r,s,l));s.state=a.InsideTag;C=r.children;for(h=0,g=C.length;h")}this.stream.write(this.endline(r,s,l));s.state=a.None;return this.closeNode(r,s,l)};XMLStreamWriter.prototype.processingInstruction=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,r,i,s))};XMLStreamWriter.prototype.raw=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,r,i,s))};XMLStreamWriter.prototype.text=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.text.call(this,r,i,s))};XMLStreamWriter.prototype.dtdAttList=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,r,i,s))};XMLStreamWriter.prototype.dtdElement=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,r,i,s))};XMLStreamWriter.prototype.dtdEntity=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,r,i,s))};XMLStreamWriter.prototype.dtdNotation=function(r,i,s){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,r,i,s))};return XMLStreamWriter}(c)}).call(this)},50358:function(r,i,s){(function(){var i,a,extend=function(r,i){for(var s in i){if(l.call(i,s))r[s]=i[s]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=s(51274);r.exports=i=function(r){extend(XMLStringWriter,r);function XMLStringWriter(r){XMLStringWriter.__super__.constructor.call(this,r)}XMLStringWriter.prototype.document=function(r,i){var s,a,l,c,d;i=this.filterOptions(i);c="";d=r.children;for(a=0,l=d.length;a","]]]]>");return this.assertLegalChar(r)};XMLStringifier.prototype.comment=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.raw=function(r){if(this.options.noValidation){return r}return""+r||""};XMLStringifier.prototype.attValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))};XMLStringifier.prototype.insTarget=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.insValue=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlVersion=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r};XMLStringifier.prototype.xmlEncoding=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlStandalone=function(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdSysID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdElementValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttType=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttDefault=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdEntityValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdNData=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(r){var i,s;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(s=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+s.index)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(s=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+s.index)}}return r};XMLStringifier.prototype.assertLegalName=function(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!r.match(i)){throw new Error("Invalid character in name")}return r};XMLStringifier.prototype.textEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(//g,">").replace(/\r/g," ")};XMLStringifier.prototype.attEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&").replace(/0){return new Array(a).join(i.indent)}}return""};XMLWriterBase.prototype.endline=function(r,i,s){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}};XMLWriterBase.prototype.attribute=function(r,i,s){var a;this.openAttribute(r,i,s);a=" "+r.name+'="'+r.value+'"';this.closeAttribute(r,i,s);return a};XMLWriterBase.prototype.cdata=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+""+this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.comment=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.declaration=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+"";l+=this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.docType=function(r,i,s){var l,c,d,p,u;s||(s=0);this.openNode(r,i,s);i.state=a.OpenTag;p=this.indent(r,i,s);p+="0){p+=" [";p+=this.endline(r,i,s);i.state=a.InsideTag;u=r.children;for(c=0,d=u.length;c";p+=this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return p};XMLWriterBase.prototype.element=function(r,s,l){var c,d,p,u,A,h,g,y,b,w,C,v,I,B;l||(l=0);w=false;C="";this.openNode(r,s,l);s.state=a.OpenTag;C+=this.indent(r,s,l)+"<"+r.name;v=r.attribs;for(b in v){if(!S.call(v,b))continue;c=v[b];C+=this.attribute(c,s,l)}p=r.children.length;u=p===0?null:r.children[0];if(p===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(s.allowEmpty){C+=">";s.state=a.CloseTag;C+=""+this.endline(r,s,l)}else{s.state=a.CloseTag;C+=s.spaceBeforeSlash+"/>"+this.endline(r,s,l)}}else if(s.pretty&&p===1&&(u.type===i.Text||u.type===i.Raw)&&u.value!=null){C+=">";s.state=a.InsideTag;s.suppressPrettyCount++;w=true;C+=this.writeChildNode(u,s,l+1);s.suppressPrettyCount--;w=false;s.state=a.CloseTag;C+=""+this.endline(r,s,l)}else{if(s.dontPrettyTextNodes){I=r.children;for(A=0,g=I.length;A"+this.endline(r,s,l);s.state=a.InsideTag;B=r.children;for(h=0,y=B.length;h";if(w){s.suppressPrettyCount--}C+=this.endline(r,s,l);s.state=a.None}this.closeNode(r,s,l);return C};XMLWriterBase.prototype.writeChildNode=function(r,s,a){switch(r.type){case i.CData:return this.cdata(r,s,a);case i.Comment:return this.comment(r,s,a);case i.Element:return this.element(r,s,a);case i.Raw:return this.raw(r,s,a);case i.Text:return this.text(r,s,a);case i.ProcessingInstruction:return this.processingInstruction(r,s,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,s,a);case i.DocType:return this.docType(r,s,a);case i.AttributeDeclaration:return this.dtdAttList(r,s,a);case i.ElementDeclaration:return this.dtdElement(r,s,a);case i.EntityDeclaration:return this.dtdEntity(r,s,a);case i.NotationDeclaration:return this.dtdNotation(r,s,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+"";l+=this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.raw=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.text=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.dtdAttList=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+""+this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.dtdElement=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+""+this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.dtdEntity=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+""+this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.dtdNotation=function(r,i,s){var l;this.openNode(r,i,s);i.state=a.OpenTag;l=this.indent(r,i,s)+""+this.endline(r,i,s);i.state=a.None;this.closeNode(r,i,s);return l};XMLWriterBase.prototype.openNode=function(r,i,s){};XMLWriterBase.prototype.closeNode=function(r,i,s){};XMLWriterBase.prototype.openAttribute=function(r,i,s){};XMLWriterBase.prototype.closeAttribute=function(r,i,s){};return XMLWriterBase}()}).call(this)},50410:function(r,i,s){(function(){var i,a,l,c,d,p,u,A,h,g;g=s(9784),A=g.assign,h=g.isFunction;l=s(6277);c=s(77135);d=s(13100);u=s(50358);p=s(33293);i=s(1917);a=s(49835);r.exports.create=function(r,i,s,a){var l,d;if(r==null){throw new Error("Root element needs a name.")}a=A({},i,s,a);l=new c(a);d=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return d};r.exports.begin=function(r,i,s){var a;if(h(r)){a=[r,i],i=a[0],s=a[1];r={}}if(i){return new d(r,i,s)}else{return new c(r)}};r.exports.stringWriter=function(r){return new u(r)};r.exports.streamWriter=function(r,i){return new p(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},63463:(r,i,s)=>{ /** * ZipStream * @@ -87,4 +90,4 @@ var s=a(14300);var l=s.Buffer;function copyProps(r,i){for(var a in r){i[a]=r[a]} * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE} * @copyright (c) 2014 Chris Talkington, contributors. */ -var s=a(73837).inherits;var l=a(91374).ZipArchiveOutputStream;var c=a(91374).ZipArchiveEntry;var p=a(49175);var d=r.exports=function(r){if(!(this instanceof d)){return new d(r)}r=this.options=r||{};r.zlib=r.zlib||{};l.call(this,r);if(typeof r.level==="number"&&r.level>=0){r.zlib.level=r.level;delete r.level}if(!r.forceZip64&&typeof r.zlib.level==="number"&&r.zlib.level===0){r.store=true}r.namePrependSlash=r.namePrependSlash||false;if(r.comment&&r.comment.length>0){this.setComment(r.comment)}};s(d,l);d.prototype._normalizeFileData=function(r){r=p.defaults(r,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var i=r.type==="directory";var a=r.type==="symlink";if(r.name){r.name=p.sanitizePath(r.name);if(!a&&r.name.slice(-1)==="/"){i=true;r.type="directory"}else if(i){r.name+="/"}}if(i||a){r.store=true}r.date=p.dateify(r.date);return r};d.prototype.entry=function(r,i,a){if(typeof a!=="function"){a=this._emitErrorCallback.bind(this)}i=this._normalizeFileData(i);if(i.type!=="file"&&i.type!=="directory"&&i.type!=="symlink"){a(new Error(i.type+" entries not currently supported"));return}if(typeof i.name!=="string"||i.name.length===0){a(new Error("entry name must be a non-empty string value"));return}if(i.type==="symlink"&&typeof i.linkname!=="string"){a(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var s=new c(i.name);s.setTime(i.date,this.options.forceLocalTime);if(i.namePrependSlash){s.setName(i.name,true)}if(i.store){s.setMethod(0)}if(i.comment.length>0){s.setComment(i.comment)}if(i.type==="symlink"&&typeof i.mode!=="number"){i.mode=40960}if(typeof i.mode==="number"){if(i.type==="symlink"){i.mode|=40960}s.setUnixMode(i.mode)}if(i.type==="symlink"&&typeof i.linkname==="string"){r=Buffer.from(i.linkname)}return l.prototype.entry.call(this,s,r,a)};d.prototype.finalize=function(){this.finish()}},89279:(r,i,a)=>{var s=a(1692);var l=a(71017);var c=a(31520);var p=a(41633);var d=a(85195);var u=a(77356);var A=a(81201);var h=r.exports={};var g=/[\/\\]/g;var processPatterns=function(r,i){var a=[];c(r).forEach((function(r){var s=r.indexOf("!")===0;if(s){r=r.slice(1)}var l=i(r);if(s){a=p(a,l)}else{a=d(a,l)}}));return a};h.exists=function(){var r=l.join.apply(l,arguments);return s.existsSync(r)};h.expand=function(...r){var i=u(r[0])?r.shift():{};var a=Array.isArray(r[0])?r[0]:r;if(a.length===0){return[]}var c=processPatterns(a,(function(r){return A.sync(r,i)}));if(i.filter){c=c.filter((function(r){r=l.join(i.cwd||"",r);try{if(typeof i.filter==="function"){return i.filter(r)}else{return s.statSync(r)[i.filter]()}}catch(r){return false}}))}return c};h.expandMapping=function(r,i,a){a=Object.assign({rename:function(r,i){return l.join(r||"",i)}},a);var s=[];var c={};h.expand(a,r).forEach((function(r){var p=r;if(a.flatten){p=l.basename(p)}if(a.ext){p=p.replace(/(\.[^\/]*)?$/,a.ext)}var d=a.rename(i,p,a);if(a.cwd){r=l.join(a.cwd,r)}d=d.replace(g,"/");r=r.replace(g,"/");if(c[d]){c[d].src.push(r)}else{s.push({src:[r],dest:d});c[d]=s[s.length-1]}}));return s};h.normalizeFilesArray=function(r){var i=[];r.forEach((function(r){var a;if("src"in r||"dest"in r){i.push(r)}}));if(i.length===0){return[]}i=_(i).chain().forEach((function(r){if(!("src"in r)||!r.src){return}if(Array.isArray(r.src)){r.src=c(r.src)}else{r.src=[r.src]}})).map((function(r){var i=Object.assign({},r);delete i.src;delete i.dest;if(r.expand){return h.expandMapping(r.src,r.dest,i).map((function(i){var a=Object.assign({},r);a.orig=Object.assign({},r);a.src=i.src;a.dest=i.dest;["expand","cwd","flatten","rename","ext"].forEach((function(r){delete a[r]}));return a}))}var a=Object.assign({},r);a.orig=Object.assign({},r);if("src"in a){Object.defineProperty(a,"src",{enumerable:true,get:function fn(){var a;if(!("result"in fn)){a=r.src;a=Array.isArray(a)?c(a):[a];fn.result=h.expand(i,a)}return fn.result}})}if("dest"in a){a.dest=r.dest}return a})).flatten().value();return i}},49175:(r,i,a)=>{var s=a(1692);var l=a(71017);var c=a(73268);var p=a(43766);var d=a(3768);var u=a(12781).Stream;var A=a(19173).PassThrough;var h=r.exports={};h.file=a(89279);h.collectStream=function(r,i){var a=[];var s=0;r.on("error",i);r.on("data",(function(r){a.push(r);s+=r.length}));r.on("end",(function(){var r=Buffer.alloc(s);var l=0;a.forEach((function(i){i.copy(r,l);l+=i.length}));i(null,r)}))};h.dateify=function(r){r=r||new Date;if(r instanceof Date){r=r}else if(typeof r==="string"){r=new Date(r)}else{r=new Date}return r};h.defaults=function(r,i,a){var s=arguments;s[0]=s[0]||{};return d(...s)};h.isStream=function(r){return r instanceof u};h.lazyReadStream=function(r){return new c.Readable((function(){return s.createReadStream(r)}))};h.normalizeInputSource=function(r){if(r===null){return Buffer.alloc(0)}else if(typeof r==="string"){return Buffer.from(r)}else if(h.isStream(r)){return r.pipe(new A)}return r};h.sanitizePath=function(r){return p(r,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};h.trailingSlashIt=function(r){return r.slice(-1)!=="/"?r+"/":r};h.unixifyPath=function(r){return p(r,false).replace(/^\w+:/,"")};h.walkdir=function(r,i,a){var c=[];if(typeof i==="function"){a=i;i=r}s.readdir(r,(function(p,d){var u=0;var A;var g;if(p){return a(p)}(function next(){A=d[u++];if(!A){return a(null,c)}g=l.join(r,A);s.stat(g,(function(r,a){c.push({path:g,relative:l.relative(i,g).replace(/\\/g,"/"),stats:a});if(a&&a.isDirectory()){h.walkdir(g,i,(function(r,i){i.forEach((function(r){c.push(r)}));next()}))}else{next()}}))})()}))}},88721:module=>{module.exports=eval("require")("encoding")},39491:r=>{"use strict";r.exports=require("assert")},50852:r=>{"use strict";r.exports=require("async_hooks")},14300:r=>{"use strict";r.exports=require("buffer")},96206:r=>{"use strict";r.exports=require("console")},22057:r=>{"use strict";r.exports=require("constants")},6113:r=>{"use strict";r.exports=require("crypto")},67643:r=>{"use strict";r.exports=require("diagnostics_channel")},82361:r=>{"use strict";r.exports=require("events")},57147:r=>{"use strict";r.exports=require("fs")},73292:r=>{"use strict";r.exports=require("fs/promises")},13685:r=>{"use strict";r.exports=require("http")},85158:r=>{"use strict";r.exports=require("http2")},95687:r=>{"use strict";r.exports=require("https")},41808:r=>{"use strict";r.exports=require("net")},15673:r=>{"use strict";r.exports=require("node:events")},84492:r=>{"use strict";r.exports=require("node:stream")},47261:r=>{"use strict";r.exports=require("node:util")},22037:r=>{"use strict";r.exports=require("os")},71017:r=>{"use strict";r.exports=require("path")},4074:r=>{"use strict";r.exports=require("perf_hooks")},85477:r=>{"use strict";r.exports=require("punycode")},63477:r=>{"use strict";r.exports=require("querystring")},12781:r=>{"use strict";r.exports=require("stream")},35356:r=>{"use strict";r.exports=require("stream/web")},71576:r=>{"use strict";r.exports=require("string_decoder")},39512:r=>{"use strict";r.exports=require("timers")},24404:r=>{"use strict";r.exports=require("tls")},57310:r=>{"use strict";r.exports=require("url")},73837:r=>{"use strict";r.exports=require("util")},29830:r=>{"use strict";r.exports=require("util/types")},71267:r=>{"use strict";r.exports=require("worker_threads")},59796:r=>{"use strict";r.exports=require("zlib")},32966:(r,i,a)=>{"use strict";const s=a(84492).Writable;const l=a(47261).inherits;const c=a(19965);const p=a(70588);const d=a(48330);const u=45;const A=Buffer.from("-");const h=Buffer.from("\r\n");const EMPTY_FN=function(){};function Dicer(r){if(!(this instanceof Dicer)){return new Dicer(r)}s.call(this,r);if(!r||!r.headerFirst&&typeof r.boundary!=="string"){throw new TypeError("Boundary required")}if(typeof r.boundary==="string"){this.setBoundary(r.boundary)}else{this._bparser=undefined}this._headerFirst=r.headerFirst;this._dashes=0;this._parts=0;this._finished=false;this._realFinish=false;this._isPreamble=true;this._justMatched=false;this._firstWrite=true;this._inHeader=true;this._part=undefined;this._cb=undefined;this._ignoreData=false;this._partOpts={highWaterMark:r.partHwm};this._pause=false;const i=this;this._hparser=new d(r);this._hparser.on("header",(function(r){i._inHeader=false;i._part.emit("header",r)}))}l(Dicer,s);Dicer.prototype.emit=function(r){if(r==="finish"&&!this._realFinish){if(!this._finished){const r=this;process.nextTick((function(){r.emit("error",new Error("Unexpected end of multipart data"));if(r._part&&!r._ignoreData){const i=r._isPreamble?"Preamble":"Part";r._part.emit("error",new Error(i+" terminated early due to unexpected end of multipart data"));r._part.push(null);process.nextTick((function(){r._realFinish=true;r.emit("finish");r._realFinish=false}));return}r._realFinish=true;r.emit("finish");r._realFinish=false}))}}else{s.prototype.emit.apply(this,arguments)}};Dicer.prototype._write=function(r,i,a){if(!this._hparser&&!this._bparser){return a()}if(this._headerFirst&&this._isPreamble){if(!this._part){this._part=new p(this._partOpts);if(this.listenerCount("preamble")!==0){this.emit("preamble",this._part)}else{this._ignore()}}const i=this._hparser.push(r);if(!this._inHeader&&i!==undefined&&i{"use strict";const s=a(15673).EventEmitter;const l=a(47261).inherits;const c=a(95691);const p=a(19965);const d=Buffer.from("\r\n\r\n");const u=/\r\n/g;const A=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function HeaderParser(r){s.call(this);r=r||{};const i=this;this.nread=0;this.maxed=false;this.npairs=0;this.maxHeaderPairs=c(r,"maxHeaderPairs",2e3);this.maxHeaderSize=c(r,"maxHeaderSize",80*1024);this.buffer="";this.header={};this.finished=false;this.ss=new p(d);this.ss.on("info",(function(r,a,s,l){if(a&&!i.maxed){if(i.nread+l-s>=i.maxHeaderSize){l=i.maxHeaderSize-i.nread+s;i.nread=i.maxHeaderSize;i.maxed=true}else{i.nread+=l-s}i.buffer+=a.toString("binary",s,l)}if(r){i._finish()}}))}l(HeaderParser,s);HeaderParser.prototype.push=function(r){const i=this.ss.push(r);if(this.finished){return i}};HeaderParser.prototype.reset=function(){this.finished=false;this.buffer="";this.header={};this.ss.reset()};HeaderParser.prototype._finish=function(){if(this.buffer){this._parseHeader()}this.ss.matches=this.ss.maxMatches;const r=this.header;this.header={};this.buffer="";this.finished=true;this.nread=this.npairs=0;this.maxed=false;this.emit("header",r)};HeaderParser.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs){return}const r=this.buffer.split(u);const i=r.length;let a,s;for(var l=0;l{"use strict";const s=a(47261).inherits;const l=a(84492).Readable;function PartStream(r){l.call(this,r)}s(PartStream,l);PartStream.prototype._read=function(r){};r.exports=PartStream},19965:(r,i,a)=>{"use strict";const s=a(15673).EventEmitter;const l=a(47261).inherits;function SBMH(r){if(typeof r==="string"){r=Buffer.from(r)}if(!Buffer.isBuffer(r)){throw new TypeError("The needle has to be a String or a Buffer.")}const i=r.length;if(i===0){throw new Error("The needle cannot be an empty String/Buffer.")}if(i>256){throw new Error("The needle cannot have a length bigger than 256.")}this.maxMatches=Infinity;this.matches=0;this._occ=new Array(256).fill(i);this._lookbehind_size=0;this._needle=r;this._bufpos=0;this._lookbehind=Buffer.alloc(i);for(var a=0;a=0){this.emit("info",false,this._lookbehind,0,this._lookbehind_size);this._lookbehind_size=0}else{const a=this._lookbehind_size+c;if(a>0){this.emit("info",false,this._lookbehind,0,a)}this._lookbehind.copy(this._lookbehind,0,a,this._lookbehind_size-a);this._lookbehind_size-=a;r.copy(this._lookbehind,this._lookbehind_size);this._lookbehind_size+=i;this._bufpos=i;return i}}c+=(c>=0)*this._bufpos;if(r.indexOf(a,c)!==-1){c=r.indexOf(a,c);++this.matches;if(c>0){this.emit("info",true,r,this._bufpos,c)}else{this.emit("info",true)}return this._bufpos=c+s}else{c=i-s}while(c0){this.emit("info",false,r,this._bufpos,c{"use strict";const s=a(84492).Writable;const{inherits:l}=a(47261);const c=a(32966);const p=a(64367);const d=a(9760);const u=a(11161);function Busboy(r){if(!(this instanceof Busboy)){return new Busboy(r)}if(typeof r!=="object"){throw new TypeError("Busboy expected an options-Object.")}if(typeof r.headers!=="object"){throw new TypeError("Busboy expected an options-Object with headers-attribute.")}if(typeof r.headers["content-type"]!=="string"){throw new TypeError("Missing Content-Type-header.")}const{headers:i,...a}=r;this.opts={autoDestroy:false,...a};s.call(this,this.opts);this._done=false;this._parser=this.getParserByHeaders(i);this._finished=false}l(Busboy,s);Busboy.prototype.emit=function(r){if(r==="finish"){if(!this._done){this._parser?.end();return}else if(this._finished){return}this._finished=true}s.prototype.emit.apply(this,arguments)};Busboy.prototype.getParserByHeaders=function(r){const i=u(r["content-type"]);const a={defCharset:this.opts.defCharset,fileHwm:this.opts.fileHwm,headers:r,highWaterMark:this.opts.highWaterMark,isPartAFile:this.opts.isPartAFile,limits:this.opts.limits,parsedConType:i,preservePath:this.opts.preservePath};if(p.detect.test(i[0])){return new p(this,a)}if(d.detect.test(i[0])){return new d(this,a)}throw new Error("Unsupported Content-Type.")};Busboy.prototype._write=function(r,i,a){this._parser.write(r,a)};r.exports=Busboy;r.exports["default"]=Busboy;r.exports.Busboy=Busboy;r.exports.Dicer=c},64367:(r,i,a)=>{"use strict";const{Readable:s}=a(84492);const{inherits:l}=a(47261);const c=a(32966);const p=a(11161);const d=a(43828);const u=a(10669);const A=a(95691);const h=/^boundary$/i;const g=/^form-data$/i;const y=/^charset$/i;const E=/^filename$/i;const b=/^name$/i;Multipart.detect=/^multipart\/form-data/i;function Multipart(r,i){let a;let s;const l=this;let C;const v=i.limits;const B=i.isPartAFile||((r,i,a)=>i==="application/octet-stream"||a!==undefined);const I=i.parsedConType||[];const w=i.defCharset||"utf8";const S=i.preservePath;const Q={highWaterMark:i.fileHwm};for(a=0,s=I.length;aD){l.parser.removeListener("part",onPart);l.parser.on("part",skipPart);r.hitPartsLimit=true;r.emit("partsLimit");return skipPart(i)}if(U){const r=U;r.emit("end");r.removeAllListeners("end")}i.on("header",(function(c){let A;let h;let C;let v;let I;let D;let k=0;if(c["content-type"]){C=p(c["content-type"][0]);if(C[0]){A=C[0].toLowerCase();for(a=0,s=C.length;aN){const s=N-k+r.length;if(s>0){a.push(r.slice(0,s))}a.truncated=true;a.bytesRead=N;i.removeAllListeners("data");a.emit("limit");return}else if(!a.push(r)){l._pause=true}a.bytesRead=k};q=function(){M=undefined;a.push(null)}}else{if(P===T){if(!r.hitFieldsLimit){r.hitFieldsLimit=true;r.emit("fieldsLimit")}return skipPart(i)}++P;++L;let a="";let s=false;U=i;_=function(r){if((k+=r.length)>x){const l=x-(k-r.length);a+=r.toString("binary",0,l);s=true;i.removeAllListeners("data")}else{a+=r.toString("binary")}};q=function(){U=undefined;if(a.length){a=d(a,"binary",v)}r.emit("field",h,a,false,s,I,A);--L;checkFinished()}}i._readableState.sync=false;i.on("data",_);i.on("end",q)})).on("error",(function(r){if(M){M.emit("error",r)}}))})).on("error",(function(i){r.emit("error",i)})).on("finish",(function(){q=true;checkFinished()}))}Multipart.prototype.write=function(r,i){const a=this.parser.write(r);if(a&&!this._pause){i()}else{this._needDrain=!a;this._cb=i}};Multipart.prototype.end=function(){const r=this;if(r.parser.writable){r.parser.end()}else if(!r._boy._done){process.nextTick((function(){r._boy._done=true;r._boy.emit("finish")}))}};function skipPart(r){r.resume()}function FileStream(r){s.call(this,r);this.bytesRead=0;this.truncated=false}l(FileStream,s);FileStream.prototype._read=function(r){};r.exports=Multipart},9760:(r,i,a)=>{"use strict";const s=a(15816);const l=a(43828);const c=a(95691);const p=/^charset$/i;UrlEncoded.detect=/^application\/x-www-form-urlencoded/i;function UrlEncoded(r,i){const a=i.limits;const l=i.parsedConType;this.boy=r;this.fieldSizeLimit=c(a,"fieldSize",1*1024*1024);this.fieldNameSizeLimit=c(a,"fieldNameSize",100);this.fieldsLimit=c(a,"fields",Infinity);let d;for(var u=0,A=l.length;up){this._key+=this.decoder.write(r.toString("binary",p,a))}this._state="val";this._hitLimit=false;this._checkingBytes=true;this._val="";this._bytesVal=0;this._valTrunc=false;this.decoder.reset();p=a+1}else if(s!==undefined){++this._fields;let a;const c=this._keyTrunc;if(s>p){a=this._key+=this.decoder.write(r.toString("binary",p,s))}else{a=this._key}this._hitLimit=false;this._checkingBytes=true;this._key="";this._bytesKey=0;this._keyTrunc=false;this.decoder.reset();if(a.length){this.boy.emit("field",l(a,"binary",this.charset),"",c,false)}p=s+1;if(this._fields===this.fieldsLimit){return i()}}else if(this._hitLimit){if(c>p){this._key+=this.decoder.write(r.toString("binary",p,c))}p=c;if((this._bytesKey=this._key.length)===this.fieldNameSizeLimit){this._checkingBytes=false;this._keyTrunc=true}}else{if(pp){this._val+=this.decoder.write(r.toString("binary",p,s))}this.boy.emit("field",l(this._key,"binary",this.charset),l(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc);this._state="key";this._hitLimit=false;this._checkingBytes=true;this._key="";this._bytesKey=0;this._keyTrunc=false;this.decoder.reset();p=s+1;if(this._fields===this.fieldsLimit){return i()}}else if(this._hitLimit){if(c>p){this._val+=this.decoder.write(r.toString("binary",p,c))}p=c;if(this._val===""&&this.fieldSizeLimit===0||(this._bytesVal=this._val.length)===this.fieldSizeLimit){this._checkingBytes=false;this._valTrunc=true}}else{if(p0){this.boy.emit("field",l(this._key,"binary",this.charset),"",this._keyTrunc,false)}else if(this._state==="val"){this.boy.emit("field",l(this._key,"binary",this.charset),l(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc)}this.boy._done=true;this.boy.emit("finish")};r.exports=UrlEncoded},15816:r=>{"use strict";const i=/\+/g;const a=[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,0,0,0,0,0,0,0,1,1,1,1,1,1,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,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];function Decoder(){this.buffer=undefined}Decoder.prototype.write=function(r){r=r.replace(i," ");let s="";let l=0;let c=0;const p=r.length;for(;lc){s+=r.substring(c,l);c=l}this.buffer="";++c}}if(c{"use strict";r.exports=function basename(r){if(typeof r!=="string"){return""}for(var i=r.length-1;i>=0;--i){switch(r.charCodeAt(i)){case 47:case 92:r=r.slice(i+1);return r===".."||r==="."?"":r}}return r===".."||r==="."?"":r}},43828:function(r){"use strict";const i=new TextDecoder("utf-8");const a=new Map([["utf-8",i],["utf8",i]]);function getDecoder(r){let i;while(true){switch(r){case"utf-8":case"utf8":return s.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return s.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return s.utf16le;case"base64":return s.base64;default:if(i===undefined){i=true;r=r.toLowerCase();continue}return s.other.bind(r)}}}const s={utf8:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}return r.utf8Slice(0,r.length)},latin1:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){return r}return r.latin1Slice(0,r.length)},utf16le:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}return r.ucs2Slice(0,r.length)},base64:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}return r.base64Slice(0,r.length)},other:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}if(a.has(this.toString())){try{return a.get(this).decode(r)}catch{}}return typeof r==="string"?r:r.toString()}};function decodeText(r,i,a){if(r){return getDecoder(a)(r,i)}return r}r.exports=decodeText},95691:r=>{"use strict";r.exports=function getLimit(r,i,a){if(!r||r[i]===undefined||r[i]===null){return a}if(typeof r[i]!=="number"||isNaN(r[i])){throw new TypeError("Limit "+i+" is not a valid number")}return r[i]}},11161:(r,i,a)=>{"use strict";const s=a(43828);const l=/%[a-fA-F0-9][a-fA-F0-9]/g;const c={"%00":"\0","%01":"","%02":"","%03":"","%04":"","%05":"","%06":"","%07":"","%08":"\b","%09":"\t","%0a":"\n","%0A":"\n","%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"","%1B":"","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"","%7F":"","%80":"€","%81":"","%82":"‚","%83":"ƒ","%84":"„","%85":"…","%86":"†","%87":"‡","%88":"ˆ","%89":"‰","%8a":"Š","%8A":"Š","%8b":"‹","%8B":"‹","%8c":"Œ","%8C":"Œ","%8d":"","%8D":"","%8e":"Ž","%8E":"Ž","%8f":"","%8F":"","%90":"","%91":"‘","%92":"’","%93":"“","%94":"”","%95":"•","%96":"–","%97":"—","%98":"˜","%99":"™","%9a":"š","%9A":"š","%9b":"›","%9B":"›","%9c":"œ","%9C":"œ","%9d":"","%9D":"","%9e":"ž","%9E":"ž","%9f":"Ÿ","%9F":"Ÿ","%a0":" ","%A0":" ","%a1":"¡","%A1":"¡","%a2":"¢","%A2":"¢","%a3":"£","%A3":"£","%a4":"¤","%A4":"¤","%a5":"¥","%A5":"¥","%a6":"¦","%A6":"¦","%a7":"§","%A7":"§","%a8":"¨","%A8":"¨","%a9":"©","%A9":"©","%aa":"ª","%Aa":"ª","%aA":"ª","%AA":"ª","%ab":"«","%Ab":"«","%aB":"«","%AB":"«","%ac":"¬","%Ac":"¬","%aC":"¬","%AC":"¬","%ad":"­","%Ad":"­","%aD":"­","%AD":"­","%ae":"®","%Ae":"®","%aE":"®","%AE":"®","%af":"¯","%Af":"¯","%aF":"¯","%AF":"¯","%b0":"°","%B0":"°","%b1":"±","%B1":"±","%b2":"²","%B2":"²","%b3":"³","%B3":"³","%b4":"´","%B4":"´","%b5":"µ","%B5":"µ","%b6":"¶","%B6":"¶","%b7":"·","%B7":"·","%b8":"¸","%B8":"¸","%b9":"¹","%B9":"¹","%ba":"º","%Ba":"º","%bA":"º","%BA":"º","%bb":"»","%Bb":"»","%bB":"»","%BB":"»","%bc":"¼","%Bc":"¼","%bC":"¼","%BC":"¼","%bd":"½","%Bd":"½","%bD":"½","%BD":"½","%be":"¾","%Be":"¾","%bE":"¾","%BE":"¾","%bf":"¿","%Bf":"¿","%bF":"¿","%BF":"¿","%c0":"À","%C0":"À","%c1":"Á","%C1":"Á","%c2":"Â","%C2":"Â","%c3":"Ã","%C3":"Ã","%c4":"Ä","%C4":"Ä","%c5":"Å","%C5":"Å","%c6":"Æ","%C6":"Æ","%c7":"Ç","%C7":"Ç","%c8":"È","%C8":"È","%c9":"É","%C9":"É","%ca":"Ê","%Ca":"Ê","%cA":"Ê","%CA":"Ê","%cb":"Ë","%Cb":"Ë","%cB":"Ë","%CB":"Ë","%cc":"Ì","%Cc":"Ì","%cC":"Ì","%CC":"Ì","%cd":"Í","%Cd":"Í","%cD":"Í","%CD":"Í","%ce":"Î","%Ce":"Î","%cE":"Î","%CE":"Î","%cf":"Ï","%Cf":"Ï","%cF":"Ï","%CF":"Ï","%d0":"Ð","%D0":"Ð","%d1":"Ñ","%D1":"Ñ","%d2":"Ò","%D2":"Ò","%d3":"Ó","%D3":"Ó","%d4":"Ô","%D4":"Ô","%d5":"Õ","%D5":"Õ","%d6":"Ö","%D6":"Ö","%d7":"×","%D7":"×","%d8":"Ø","%D8":"Ø","%d9":"Ù","%D9":"Ù","%da":"Ú","%Da":"Ú","%dA":"Ú","%DA":"Ú","%db":"Û","%Db":"Û","%dB":"Û","%DB":"Û","%dc":"Ü","%Dc":"Ü","%dC":"Ü","%DC":"Ü","%dd":"Ý","%Dd":"Ý","%dD":"Ý","%DD":"Ý","%de":"Þ","%De":"Þ","%dE":"Þ","%DE":"Þ","%df":"ß","%Df":"ß","%dF":"ß","%DF":"ß","%e0":"à","%E0":"à","%e1":"á","%E1":"á","%e2":"â","%E2":"â","%e3":"ã","%E3":"ã","%e4":"ä","%E4":"ä","%e5":"å","%E5":"å","%e6":"æ","%E6":"æ","%e7":"ç","%E7":"ç","%e8":"è","%E8":"è","%e9":"é","%E9":"é","%ea":"ê","%Ea":"ê","%eA":"ê","%EA":"ê","%eb":"ë","%Eb":"ë","%eB":"ë","%EB":"ë","%ec":"ì","%Ec":"ì","%eC":"ì","%EC":"ì","%ed":"í","%Ed":"í","%eD":"í","%ED":"í","%ee":"î","%Ee":"î","%eE":"î","%EE":"î","%ef":"ï","%Ef":"ï","%eF":"ï","%EF":"ï","%f0":"ð","%F0":"ð","%f1":"ñ","%F1":"ñ","%f2":"ò","%F2":"ò","%f3":"ó","%F3":"ó","%f4":"ô","%F4":"ô","%f5":"õ","%F5":"õ","%f6":"ö","%F6":"ö","%f7":"÷","%F7":"÷","%f8":"ø","%F8":"ø","%f9":"ù","%F9":"ù","%fa":"ú","%Fa":"ú","%fA":"ú","%FA":"ú","%fb":"û","%Fb":"û","%fB":"û","%FB":"û","%fc":"ü","%Fc":"ü","%fC":"ü","%FC":"ü","%fd":"ý","%Fd":"ý","%fD":"ý","%FD":"ý","%fe":"þ","%Fe":"þ","%fE":"þ","%FE":"þ","%ff":"ÿ","%Ff":"ÿ","%fF":"ÿ","%FF":"ÿ"};function encodedReplacer(r){return c[r]}const p=0;const d=1;const u=2;const A=3;function parseParams(r){const i=[];let a=p;let c="";let h=false;let g=false;let y=0;let E="";const b=r.length;for(var C=0;C{"use strict";r.exports=JSON.parse('{"name":"@actions/artifact","version":"2.1.3","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","main":"lib/artifact.js","types":"lib/artifact.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/artifact"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"cd ../../ && npm run test ./packages/artifact","bootstrap":"cd ../../ && npm run bootstrap","tsc-run":"tsc","tsc":"npm run bootstrap && npm run tsc-run","gen:docs":"typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.10.0","@actions/github":"^5.1.1","@actions/http-client":"^2.1.0","@azure/storage-blob":"^12.15.0","@octokit/core":"^3.5.1","@octokit/plugin-request-log":"^1.0.4","@octokit/plugin-retry":"^3.0.9","@octokit/request-error":"^5.0.0","@protobuf-ts/plugin":"^2.2.3-alpha.1","archiver":"^5.3.1","crypto":"^1.0.1","jwt-decode":"^3.1.2","twirp-ts":"^2.5.0","unzip-stream":"^0.3.1"},"devDependencies":{"@types/archiver":"^5.3.2","@types/unzip-stream":"^0.3.4","typedoc":"^0.25.4","typedoc-plugin-markdown":"^3.17.1","typescript":"^5.2.2"}}')},79857:r=>{"use strict";r.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')},65441:r=>{"use strict";r.exports=JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"],[[47,47],"disallowed_STD3_valid"],[[48,57],"valid"],[[58,64],"disallowed_STD3_valid"],[[65,65],"mapped",[97]],[[66,66],"mapped",[98]],[[67,67],"mapped",[99]],[[68,68],"mapped",[100]],[[69,69],"mapped",[101]],[[70,70],"mapped",[102]],[[71,71],"mapped",[103]],[[72,72],"mapped",[104]],[[73,73],"mapped",[105]],[[74,74],"mapped",[106]],[[75,75],"mapped",[107]],[[76,76],"mapped",[108]],[[77,77],"mapped",[109]],[[78,78],"mapped",[110]],[[79,79],"mapped",[111]],[[80,80],"mapped",[112]],[[81,81],"mapped",[113]],[[82,82],"mapped",[114]],[[83,83],"mapped",[115]],[[84,84],"mapped",[116]],[[85,85],"mapped",[117]],[[86,86],"mapped",[118]],[[87,87],"mapped",[119]],[[88,88],"mapped",[120]],[[89,89],"mapped",[121]],[[90,90],"mapped",[122]],[[91,96],"disallowed_STD3_valid"],[[97,122],"valid"],[[123,127],"disallowed_STD3_valid"],[[128,159],"disallowed"],[[160,160],"disallowed_STD3_mapped",[32]],[[161,167],"valid",[],"NV8"],[[168,168],"disallowed_STD3_mapped",[32,776]],[[169,169],"valid",[],"NV8"],[[170,170],"mapped",[97]],[[171,172],"valid",[],"NV8"],[[173,173],"ignored"],[[174,174],"valid",[],"NV8"],[[175,175],"disallowed_STD3_mapped",[32,772]],[[176,177],"valid",[],"NV8"],[[178,178],"mapped",[50]],[[179,179],"mapped",[51]],[[180,180],"disallowed_STD3_mapped",[32,769]],[[181,181],"mapped",[956]],[[182,182],"valid",[],"NV8"],[[183,183],"valid"],[[184,184],"disallowed_STD3_mapped",[32,807]],[[185,185],"mapped",[49]],[[186,186],"mapped",[111]],[[187,187],"valid",[],"NV8"],[[188,188],"mapped",[49,8260,52]],[[189,189],"mapped",[49,8260,50]],[[190,190],"mapped",[51,8260,52]],[[191,191],"valid",[],"NV8"],[[192,192],"mapped",[224]],[[193,193],"mapped",[225]],[[194,194],"mapped",[226]],[[195,195],"mapped",[227]],[[196,196],"mapped",[228]],[[197,197],"mapped",[229]],[[198,198],"mapped",[230]],[[199,199],"mapped",[231]],[[200,200],"mapped",[232]],[[201,201],"mapped",[233]],[[202,202],"mapped",[234]],[[203,203],"mapped",[235]],[[204,204],"mapped",[236]],[[205,205],"mapped",[237]],[[206,206],"mapped",[238]],[[207,207],"mapped",[239]],[[208,208],"mapped",[240]],[[209,209],"mapped",[241]],[[210,210],"mapped",[242]],[[211,211],"mapped",[243]],[[212,212],"mapped",[244]],[[213,213],"mapped",[245]],[[214,214],"mapped",[246]],[[215,215],"valid",[],"NV8"],[[216,216],"mapped",[248]],[[217,217],"mapped",[249]],[[218,218],"mapped",[250]],[[219,219],"mapped",[251]],[[220,220],"mapped",[252]],[[221,221],"mapped",[253]],[[222,222],"mapped",[254]],[[223,223],"deviation",[115,115]],[[224,246],"valid"],[[247,247],"valid",[],"NV8"],[[248,255],"valid"],[[256,256],"mapped",[257]],[[257,257],"valid"],[[258,258],"mapped",[259]],[[259,259],"valid"],[[260,260],"mapped",[261]],[[261,261],"valid"],[[262,262],"mapped",[263]],[[263,263],"valid"],[[264,264],"mapped",[265]],[[265,265],"valid"],[[266,266],"mapped",[267]],[[267,267],"valid"],[[268,268],"mapped",[269]],[[269,269],"valid"],[[270,270],"mapped",[271]],[[271,271],"valid"],[[272,272],"mapped",[273]],[[273,273],"valid"],[[274,274],"mapped",[275]],[[275,275],"valid"],[[276,276],"mapped",[277]],[[277,277],"valid"],[[278,278],"mapped",[279]],[[279,279],"valid"],[[280,280],"mapped",[281]],[[281,281],"valid"],[[282,282],"mapped",[283]],[[283,283],"valid"],[[284,284],"mapped",[285]],[[285,285],"valid"],[[286,286],"mapped",[287]],[[287,287],"valid"],[[288,288],"mapped",[289]],[[289,289],"valid"],[[290,290],"mapped",[291]],[[291,291],"valid"],[[292,292],"mapped",[293]],[[293,293],"valid"],[[294,294],"mapped",[295]],[[295,295],"valid"],[[296,296],"mapped",[297]],[[297,297],"valid"],[[298,298],"mapped",[299]],[[299,299],"valid"],[[300,300],"mapped",[301]],[[301,301],"valid"],[[302,302],"mapped",[303]],[[303,303],"valid"],[[304,304],"mapped",[105,775]],[[305,305],"valid"],[[306,307],"mapped",[105,106]],[[308,308],"mapped",[309]],[[309,309],"valid"],[[310,310],"mapped",[311]],[[311,312],"valid"],[[313,313],"mapped",[314]],[[314,314],"valid"],[[315,315],"mapped",[316]],[[316,316],"valid"],[[317,317],"mapped",[318]],[[318,318],"valid"],[[319,320],"mapped",[108,183]],[[321,321],"mapped",[322]],[[322,322],"valid"],[[323,323],"mapped",[324]],[[324,324],"valid"],[[325,325],"mapped",[326]],[[326,326],"valid"],[[327,327],"mapped",[328]],[[328,328],"valid"],[[329,329],"mapped",[700,110]],[[330,330],"mapped",[331]],[[331,331],"valid"],[[332,332],"mapped",[333]],[[333,333],"valid"],[[334,334],"mapped",[335]],[[335,335],"valid"],[[336,336],"mapped",[337]],[[337,337],"valid"],[[338,338],"mapped",[339]],[[339,339],"valid"],[[340,340],"mapped",[341]],[[341,341],"valid"],[[342,342],"mapped",[343]],[[343,343],"valid"],[[344,344],"mapped",[345]],[[345,345],"valid"],[[346,346],"mapped",[347]],[[347,347],"valid"],[[348,348],"mapped",[349]],[[349,349],"valid"],[[350,350],"mapped",[351]],[[351,351],"valid"],[[352,352],"mapped",[353]],[[353,353],"valid"],[[354,354],"mapped",[355]],[[355,355],"valid"],[[356,356],"mapped",[357]],[[357,357],"valid"],[[358,358],"mapped",[359]],[[359,359],"valid"],[[360,360],"mapped",[361]],[[361,361],"valid"],[[362,362],"mapped",[363]],[[363,363],"valid"],[[364,364],"mapped",[365]],[[365,365],"valid"],[[366,366],"mapped",[367]],[[367,367],"valid"],[[368,368],"mapped",[369]],[[369,369],"valid"],[[370,370],"mapped",[371]],[[371,371],"valid"],[[372,372],"mapped",[373]],[[373,373],"valid"],[[374,374],"mapped",[375]],[[375,375],"valid"],[[376,376],"mapped",[255]],[[377,377],"mapped",[378]],[[378,378],"valid"],[[379,379],"mapped",[380]],[[380,380],"valid"],[[381,381],"mapped",[382]],[[382,382],"valid"],[[383,383],"mapped",[115]],[[384,384],"valid"],[[385,385],"mapped",[595]],[[386,386],"mapped",[387]],[[387,387],"valid"],[[388,388],"mapped",[389]],[[389,389],"valid"],[[390,390],"mapped",[596]],[[391,391],"mapped",[392]],[[392,392],"valid"],[[393,393],"mapped",[598]],[[394,394],"mapped",[599]],[[395,395],"mapped",[396]],[[396,397],"valid"],[[398,398],"mapped",[477]],[[399,399],"mapped",[601]],[[400,400],"mapped",[603]],[[401,401],"mapped",[402]],[[402,402],"valid"],[[403,403],"mapped",[608]],[[404,404],"mapped",[611]],[[405,405],"valid"],[[406,406],"mapped",[617]],[[407,407],"mapped",[616]],[[408,408],"mapped",[409]],[[409,411],"valid"],[[412,412],"mapped",[623]],[[413,413],"mapped",[626]],[[414,414],"valid"],[[415,415],"mapped",[629]],[[416,416],"mapped",[417]],[[417,417],"valid"],[[418,418],"mapped",[419]],[[419,419],"valid"],[[420,420],"mapped",[421]],[[421,421],"valid"],[[422,422],"mapped",[640]],[[423,423],"mapped",[424]],[[424,424],"valid"],[[425,425],"mapped",[643]],[[426,427],"valid"],[[428,428],"mapped",[429]],[[429,429],"valid"],[[430,430],"mapped",[648]],[[431,431],"mapped",[432]],[[432,432],"valid"],[[433,433],"mapped",[650]],[[434,434],"mapped",[651]],[[435,435],"mapped",[436]],[[436,436],"valid"],[[437,437],"mapped",[438]],[[438,438],"valid"],[[439,439],"mapped",[658]],[[440,440],"mapped",[441]],[[441,443],"valid"],[[444,444],"mapped",[445]],[[445,451],"valid"],[[452,454],"mapped",[100,382]],[[455,457],"mapped",[108,106]],[[458,460],"mapped",[110,106]],[[461,461],"mapped",[462]],[[462,462],"valid"],[[463,463],"mapped",[464]],[[464,464],"valid"],[[465,465],"mapped",[466]],[[466,466],"valid"],[[467,467],"mapped",[468]],[[468,468],"valid"],[[469,469],"mapped",[470]],[[470,470],"valid"],[[471,471],"mapped",[472]],[[472,472],"valid"],[[473,473],"mapped",[474]],[[474,474],"valid"],[[475,475],"mapped",[476]],[[476,477],"valid"],[[478,478],"mapped",[479]],[[479,479],"valid"],[[480,480],"mapped",[481]],[[481,481],"valid"],[[482,482],"mapped",[483]],[[483,483],"valid"],[[484,484],"mapped",[485]],[[485,485],"valid"],[[486,486],"mapped",[487]],[[487,487],"valid"],[[488,488],"mapped",[489]],[[489,489],"valid"],[[490,490],"mapped",[491]],[[491,491],"valid"],[[492,492],"mapped",[493]],[[493,493],"valid"],[[494,494],"mapped",[495]],[[495,496],"valid"],[[497,499],"mapped",[100,122]],[[500,500],"mapped",[501]],[[501,501],"valid"],[[502,502],"mapped",[405]],[[503,503],"mapped",[447]],[[504,504],"mapped",[505]],[[505,505],"valid"],[[506,506],"mapped",[507]],[[507,507],"valid"],[[508,508],"mapped",[509]],[[509,509],"valid"],[[510,510],"mapped",[511]],[[511,511],"valid"],[[512,512],"mapped",[513]],[[513,513],"valid"],[[514,514],"mapped",[515]],[[515,515],"valid"],[[516,516],"mapped",[517]],[[517,517],"valid"],[[518,518],"mapped",[519]],[[519,519],"valid"],[[520,520],"mapped",[521]],[[521,521],"valid"],[[522,522],"mapped",[523]],[[523,523],"valid"],[[524,524],"mapped",[525]],[[525,525],"valid"],[[526,526],"mapped",[527]],[[527,527],"valid"],[[528,528],"mapped",[529]],[[529,529],"valid"],[[530,530],"mapped",[531]],[[531,531],"valid"],[[532,532],"mapped",[533]],[[533,533],"valid"],[[534,534],"mapped",[535]],[[535,535],"valid"],[[536,536],"mapped",[537]],[[537,537],"valid"],[[538,538],"mapped",[539]],[[539,539],"valid"],[[540,540],"mapped",[541]],[[541,541],"valid"],[[542,542],"mapped",[543]],[[543,543],"valid"],[[544,544],"mapped",[414]],[[545,545],"valid"],[[546,546],"mapped",[547]],[[547,547],"valid"],[[548,548],"mapped",[549]],[[549,549],"valid"],[[550,550],"mapped",[551]],[[551,551],"valid"],[[552,552],"mapped",[553]],[[553,553],"valid"],[[554,554],"mapped",[555]],[[555,555],"valid"],[[556,556],"mapped",[557]],[[557,557],"valid"],[[558,558],"mapped",[559]],[[559,559],"valid"],[[560,560],"mapped",[561]],[[561,561],"valid"],[[562,562],"mapped",[563]],[[563,563],"valid"],[[564,566],"valid"],[[567,569],"valid"],[[570,570],"mapped",[11365]],[[571,571],"mapped",[572]],[[572,572],"valid"],[[573,573],"mapped",[410]],[[574,574],"mapped",[11366]],[[575,576],"valid"],[[577,577],"mapped",[578]],[[578,578],"valid"],[[579,579],"mapped",[384]],[[580,580],"mapped",[649]],[[581,581],"mapped",[652]],[[582,582],"mapped",[583]],[[583,583],"valid"],[[584,584],"mapped",[585]],[[585,585],"valid"],[[586,586],"mapped",[587]],[[587,587],"valid"],[[588,588],"mapped",[589]],[[589,589],"valid"],[[590,590],"mapped",[591]],[[591,591],"valid"],[[592,680],"valid"],[[681,685],"valid"],[[686,687],"valid"],[[688,688],"mapped",[104]],[[689,689],"mapped",[614]],[[690,690],"mapped",[106]],[[691,691],"mapped",[114]],[[692,692],"mapped",[633]],[[693,693],"mapped",[635]],[[694,694],"mapped",[641]],[[695,695],"mapped",[119]],[[696,696],"mapped",[121]],[[697,705],"valid"],[[706,709],"valid",[],"NV8"],[[710,721],"valid"],[[722,727],"valid",[],"NV8"],[[728,728],"disallowed_STD3_mapped",[32,774]],[[729,729],"disallowed_STD3_mapped",[32,775]],[[730,730],"disallowed_STD3_mapped",[32,778]],[[731,731],"disallowed_STD3_mapped",[32,808]],[[732,732],"disallowed_STD3_mapped",[32,771]],[[733,733],"disallowed_STD3_mapped",[32,779]],[[734,734],"valid",[],"NV8"],[[735,735],"valid",[],"NV8"],[[736,736],"mapped",[611]],[[737,737],"mapped",[108]],[[738,738],"mapped",[115]],[[739,739],"mapped",[120]],[[740,740],"mapped",[661]],[[741,745],"valid",[],"NV8"],[[746,747],"valid",[],"NV8"],[[748,748],"valid"],[[749,749],"valid",[],"NV8"],[[750,750],"valid"],[[751,767],"valid",[],"NV8"],[[768,831],"valid"],[[832,832],"mapped",[768]],[[833,833],"mapped",[769]],[[834,834],"valid"],[[835,835],"mapped",[787]],[[836,836],"mapped",[776,769]],[[837,837],"mapped",[953]],[[838,846],"valid"],[[847,847],"ignored"],[[848,855],"valid"],[[856,860],"valid"],[[861,863],"valid"],[[864,865],"valid"],[[866,866],"valid"],[[867,879],"valid"],[[880,880],"mapped",[881]],[[881,881],"valid"],[[882,882],"mapped",[883]],[[883,883],"valid"],[[884,884],"mapped",[697]],[[885,885],"valid"],[[886,886],"mapped",[887]],[[887,887],"valid"],[[888,889],"disallowed"],[[890,890],"disallowed_STD3_mapped",[32,953]],[[891,893],"valid"],[[894,894],"disallowed_STD3_mapped",[59]],[[895,895],"mapped",[1011]],[[896,899],"disallowed"],[[900,900],"disallowed_STD3_mapped",[32,769]],[[901,901],"disallowed_STD3_mapped",[32,776,769]],[[902,902],"mapped",[940]],[[903,903],"mapped",[183]],[[904,904],"mapped",[941]],[[905,905],"mapped",[942]],[[906,906],"mapped",[943]],[[907,907],"disallowed"],[[908,908],"mapped",[972]],[[909,909],"disallowed"],[[910,910],"mapped",[973]],[[911,911],"mapped",[974]],[[912,912],"valid"],[[913,913],"mapped",[945]],[[914,914],"mapped",[946]],[[915,915],"mapped",[947]],[[916,916],"mapped",[948]],[[917,917],"mapped",[949]],[[918,918],"mapped",[950]],[[919,919],"mapped",[951]],[[920,920],"mapped",[952]],[[921,921],"mapped",[953]],[[922,922],"mapped",[954]],[[923,923],"mapped",[955]],[[924,924],"mapped",[956]],[[925,925],"mapped",[957]],[[926,926],"mapped",[958]],[[927,927],"mapped",[959]],[[928,928],"mapped",[960]],[[929,929],"mapped",[961]],[[930,930],"disallowed"],[[931,931],"mapped",[963]],[[932,932],"mapped",[964]],[[933,933],"mapped",[965]],[[934,934],"mapped",[966]],[[935,935],"mapped",[967]],[[936,936],"mapped",[968]],[[937,937],"mapped",[969]],[[938,938],"mapped",[970]],[[939,939],"mapped",[971]],[[940,961],"valid"],[[962,962],"deviation",[963]],[[963,974],"valid"],[[975,975],"mapped",[983]],[[976,976],"mapped",[946]],[[977,977],"mapped",[952]],[[978,978],"mapped",[965]],[[979,979],"mapped",[973]],[[980,980],"mapped",[971]],[[981,981],"mapped",[966]],[[982,982],"mapped",[960]],[[983,983],"valid"],[[984,984],"mapped",[985]],[[985,985],"valid"],[[986,986],"mapped",[987]],[[987,987],"valid"],[[988,988],"mapped",[989]],[[989,989],"valid"],[[990,990],"mapped",[991]],[[991,991],"valid"],[[992,992],"mapped",[993]],[[993,993],"valid"],[[994,994],"mapped",[995]],[[995,995],"valid"],[[996,996],"mapped",[997]],[[997,997],"valid"],[[998,998],"mapped",[999]],[[999,999],"valid"],[[1000,1000],"mapped",[1001]],[[1001,1001],"valid"],[[1002,1002],"mapped",[1003]],[[1003,1003],"valid"],[[1004,1004],"mapped",[1005]],[[1005,1005],"valid"],[[1006,1006],"mapped",[1007]],[[1007,1007],"valid"],[[1008,1008],"mapped",[954]],[[1009,1009],"mapped",[961]],[[1010,1010],"mapped",[963]],[[1011,1011],"valid"],[[1012,1012],"mapped",[952]],[[1013,1013],"mapped",[949]],[[1014,1014],"valid",[],"NV8"],[[1015,1015],"mapped",[1016]],[[1016,1016],"valid"],[[1017,1017],"mapped",[963]],[[1018,1018],"mapped",[1019]],[[1019,1019],"valid"],[[1020,1020],"valid"],[[1021,1021],"mapped",[891]],[[1022,1022],"mapped",[892]],[[1023,1023],"mapped",[893]],[[1024,1024],"mapped",[1104]],[[1025,1025],"mapped",[1105]],[[1026,1026],"mapped",[1106]],[[1027,1027],"mapped",[1107]],[[1028,1028],"mapped",[1108]],[[1029,1029],"mapped",[1109]],[[1030,1030],"mapped",[1110]],[[1031,1031],"mapped",[1111]],[[1032,1032],"mapped",[1112]],[[1033,1033],"mapped",[1113]],[[1034,1034],"mapped",[1114]],[[1035,1035],"mapped",[1115]],[[1036,1036],"mapped",[1116]],[[1037,1037],"mapped",[1117]],[[1038,1038],"mapped",[1118]],[[1039,1039],"mapped",[1119]],[[1040,1040],"mapped",[1072]],[[1041,1041],"mapped",[1073]],[[1042,1042],"mapped",[1074]],[[1043,1043],"mapped",[1075]],[[1044,1044],"mapped",[1076]],[[1045,1045],"mapped",[1077]],[[1046,1046],"mapped",[1078]],[[1047,1047],"mapped",[1079]],[[1048,1048],"mapped",[1080]],[[1049,1049],"mapped",[1081]],[[1050,1050],"mapped",[1082]],[[1051,1051],"mapped",[1083]],[[1052,1052],"mapped",[1084]],[[1053,1053],"mapped",[1085]],[[1054,1054],"mapped",[1086]],[[1055,1055],"mapped",[1087]],[[1056,1056],"mapped",[1088]],[[1057,1057],"mapped",[1089]],[[1058,1058],"mapped",[1090]],[[1059,1059],"mapped",[1091]],[[1060,1060],"mapped",[1092]],[[1061,1061],"mapped",[1093]],[[1062,1062],"mapped",[1094]],[[1063,1063],"mapped",[1095]],[[1064,1064],"mapped",[1096]],[[1065,1065],"mapped",[1097]],[[1066,1066],"mapped",[1098]],[[1067,1067],"mapped",[1099]],[[1068,1068],"mapped",[1100]],[[1069,1069],"mapped",[1101]],[[1070,1070],"mapped",[1102]],[[1071,1071],"mapped",[1103]],[[1072,1103],"valid"],[[1104,1104],"valid"],[[1105,1116],"valid"],[[1117,1117],"valid"],[[1118,1119],"valid"],[[1120,1120],"mapped",[1121]],[[1121,1121],"valid"],[[1122,1122],"mapped",[1123]],[[1123,1123],"valid"],[[1124,1124],"mapped",[1125]],[[1125,1125],"valid"],[[1126,1126],"mapped",[1127]],[[1127,1127],"valid"],[[1128,1128],"mapped",[1129]],[[1129,1129],"valid"],[[1130,1130],"mapped",[1131]],[[1131,1131],"valid"],[[1132,1132],"mapped",[1133]],[[1133,1133],"valid"],[[1134,1134],"mapped",[1135]],[[1135,1135],"valid"],[[1136,1136],"mapped",[1137]],[[1137,1137],"valid"],[[1138,1138],"mapped",[1139]],[[1139,1139],"valid"],[[1140,1140],"mapped",[1141]],[[1141,1141],"valid"],[[1142,1142],"mapped",[1143]],[[1143,1143],"valid"],[[1144,1144],"mapped",[1145]],[[1145,1145],"valid"],[[1146,1146],"mapped",[1147]],[[1147,1147],"valid"],[[1148,1148],"mapped",[1149]],[[1149,1149],"valid"],[[1150,1150],"mapped",[1151]],[[1151,1151],"valid"],[[1152,1152],"mapped",[1153]],[[1153,1153],"valid"],[[1154,1154],"valid",[],"NV8"],[[1155,1158],"valid"],[[1159,1159],"valid"],[[1160,1161],"valid",[],"NV8"],[[1162,1162],"mapped",[1163]],[[1163,1163],"valid"],[[1164,1164],"mapped",[1165]],[[1165,1165],"valid"],[[1166,1166],"mapped",[1167]],[[1167,1167],"valid"],[[1168,1168],"mapped",[1169]],[[1169,1169],"valid"],[[1170,1170],"mapped",[1171]],[[1171,1171],"valid"],[[1172,1172],"mapped",[1173]],[[1173,1173],"valid"],[[1174,1174],"mapped",[1175]],[[1175,1175],"valid"],[[1176,1176],"mapped",[1177]],[[1177,1177],"valid"],[[1178,1178],"mapped",[1179]],[[1179,1179],"valid"],[[1180,1180],"mapped",[1181]],[[1181,1181],"valid"],[[1182,1182],"mapped",[1183]],[[1183,1183],"valid"],[[1184,1184],"mapped",[1185]],[[1185,1185],"valid"],[[1186,1186],"mapped",[1187]],[[1187,1187],"valid"],[[1188,1188],"mapped",[1189]],[[1189,1189],"valid"],[[1190,1190],"mapped",[1191]],[[1191,1191],"valid"],[[1192,1192],"mapped",[1193]],[[1193,1193],"valid"],[[1194,1194],"mapped",[1195]],[[1195,1195],"valid"],[[1196,1196],"mapped",[1197]],[[1197,1197],"valid"],[[1198,1198],"mapped",[1199]],[[1199,1199],"valid"],[[1200,1200],"mapped",[1201]],[[1201,1201],"valid"],[[1202,1202],"mapped",[1203]],[[1203,1203],"valid"],[[1204,1204],"mapped",[1205]],[[1205,1205],"valid"],[[1206,1206],"mapped",[1207]],[[1207,1207],"valid"],[[1208,1208],"mapped",[1209]],[[1209,1209],"valid"],[[1210,1210],"mapped",[1211]],[[1211,1211],"valid"],[[1212,1212],"mapped",[1213]],[[1213,1213],"valid"],[[1214,1214],"mapped",[1215]],[[1215,1215],"valid"],[[1216,1216],"disallowed"],[[1217,1217],"mapped",[1218]],[[1218,1218],"valid"],[[1219,1219],"mapped",[1220]],[[1220,1220],"valid"],[[1221,1221],"mapped",[1222]],[[1222,1222],"valid"],[[1223,1223],"mapped",[1224]],[[1224,1224],"valid"],[[1225,1225],"mapped",[1226]],[[1226,1226],"valid"],[[1227,1227],"mapped",[1228]],[[1228,1228],"valid"],[[1229,1229],"mapped",[1230]],[[1230,1230],"valid"],[[1231,1231],"valid"],[[1232,1232],"mapped",[1233]],[[1233,1233],"valid"],[[1234,1234],"mapped",[1235]],[[1235,1235],"valid"],[[1236,1236],"mapped",[1237]],[[1237,1237],"valid"],[[1238,1238],"mapped",[1239]],[[1239,1239],"valid"],[[1240,1240],"mapped",[1241]],[[1241,1241],"valid"],[[1242,1242],"mapped",[1243]],[[1243,1243],"valid"],[[1244,1244],"mapped",[1245]],[[1245,1245],"valid"],[[1246,1246],"mapped",[1247]],[[1247,1247],"valid"],[[1248,1248],"mapped",[1249]],[[1249,1249],"valid"],[[1250,1250],"mapped",[1251]],[[1251,1251],"valid"],[[1252,1252],"mapped",[1253]],[[1253,1253],"valid"],[[1254,1254],"mapped",[1255]],[[1255,1255],"valid"],[[1256,1256],"mapped",[1257]],[[1257,1257],"valid"],[[1258,1258],"mapped",[1259]],[[1259,1259],"valid"],[[1260,1260],"mapped",[1261]],[[1261,1261],"valid"],[[1262,1262],"mapped",[1263]],[[1263,1263],"valid"],[[1264,1264],"mapped",[1265]],[[1265,1265],"valid"],[[1266,1266],"mapped",[1267]],[[1267,1267],"valid"],[[1268,1268],"mapped",[1269]],[[1269,1269],"valid"],[[1270,1270],"mapped",[1271]],[[1271,1271],"valid"],[[1272,1272],"mapped",[1273]],[[1273,1273],"valid"],[[1274,1274],"mapped",[1275]],[[1275,1275],"valid"],[[1276,1276],"mapped",[1277]],[[1277,1277],"valid"],[[1278,1278],"mapped",[1279]],[[1279,1279],"valid"],[[1280,1280],"mapped",[1281]],[[1281,1281],"valid"],[[1282,1282],"mapped",[1283]],[[1283,1283],"valid"],[[1284,1284],"mapped",[1285]],[[1285,1285],"valid"],[[1286,1286],"mapped",[1287]],[[1287,1287],"valid"],[[1288,1288],"mapped",[1289]],[[1289,1289],"valid"],[[1290,1290],"mapped",[1291]],[[1291,1291],"valid"],[[1292,1292],"mapped",[1293]],[[1293,1293],"valid"],[[1294,1294],"mapped",[1295]],[[1295,1295],"valid"],[[1296,1296],"mapped",[1297]],[[1297,1297],"valid"],[[1298,1298],"mapped",[1299]],[[1299,1299],"valid"],[[1300,1300],"mapped",[1301]],[[1301,1301],"valid"],[[1302,1302],"mapped",[1303]],[[1303,1303],"valid"],[[1304,1304],"mapped",[1305]],[[1305,1305],"valid"],[[1306,1306],"mapped",[1307]],[[1307,1307],"valid"],[[1308,1308],"mapped",[1309]],[[1309,1309],"valid"],[[1310,1310],"mapped",[1311]],[[1311,1311],"valid"],[[1312,1312],"mapped",[1313]],[[1313,1313],"valid"],[[1314,1314],"mapped",[1315]],[[1315,1315],"valid"],[[1316,1316],"mapped",[1317]],[[1317,1317],"valid"],[[1318,1318],"mapped",[1319]],[[1319,1319],"valid"],[[1320,1320],"mapped",[1321]],[[1321,1321],"valid"],[[1322,1322],"mapped",[1323]],[[1323,1323],"valid"],[[1324,1324],"mapped",[1325]],[[1325,1325],"valid"],[[1326,1326],"mapped",[1327]],[[1327,1327],"valid"],[[1328,1328],"disallowed"],[[1329,1329],"mapped",[1377]],[[1330,1330],"mapped",[1378]],[[1331,1331],"mapped",[1379]],[[1332,1332],"mapped",[1380]],[[1333,1333],"mapped",[1381]],[[1334,1334],"mapped",[1382]],[[1335,1335],"mapped",[1383]],[[1336,1336],"mapped",[1384]],[[1337,1337],"mapped",[1385]],[[1338,1338],"mapped",[1386]],[[1339,1339],"mapped",[1387]],[[1340,1340],"mapped",[1388]],[[1341,1341],"mapped",[1389]],[[1342,1342],"mapped",[1390]],[[1343,1343],"mapped",[1391]],[[1344,1344],"mapped",[1392]],[[1345,1345],"mapped",[1393]],[[1346,1346],"mapped",[1394]],[[1347,1347],"mapped",[1395]],[[1348,1348],"mapped",[1396]],[[1349,1349],"mapped",[1397]],[[1350,1350],"mapped",[1398]],[[1351,1351],"mapped",[1399]],[[1352,1352],"mapped",[1400]],[[1353,1353],"mapped",[1401]],[[1354,1354],"mapped",[1402]],[[1355,1355],"mapped",[1403]],[[1356,1356],"mapped",[1404]],[[1357,1357],"mapped",[1405]],[[1358,1358],"mapped",[1406]],[[1359,1359],"mapped",[1407]],[[1360,1360],"mapped",[1408]],[[1361,1361],"mapped",[1409]],[[1362,1362],"mapped",[1410]],[[1363,1363],"mapped",[1411]],[[1364,1364],"mapped",[1412]],[[1365,1365],"mapped",[1413]],[[1366,1366],"mapped",[1414]],[[1367,1368],"disallowed"],[[1369,1369],"valid"],[[1370,1375],"valid",[],"NV8"],[[1376,1376],"disallowed"],[[1377,1414],"valid"],[[1415,1415],"mapped",[1381,1410]],[[1416,1416],"disallowed"],[[1417,1417],"valid",[],"NV8"],[[1418,1418],"valid",[],"NV8"],[[1419,1420],"disallowed"],[[1421,1422],"valid",[],"NV8"],[[1423,1423],"valid",[],"NV8"],[[1424,1424],"disallowed"],[[1425,1441],"valid"],[[1442,1442],"valid"],[[1443,1455],"valid"],[[1456,1465],"valid"],[[1466,1466],"valid"],[[1467,1469],"valid"],[[1470,1470],"valid",[],"NV8"],[[1471,1471],"valid"],[[1472,1472],"valid",[],"NV8"],[[1473,1474],"valid"],[[1475,1475],"valid",[],"NV8"],[[1476,1476],"valid"],[[1477,1477],"valid"],[[1478,1478],"valid",[],"NV8"],[[1479,1479],"valid"],[[1480,1487],"disallowed"],[[1488,1514],"valid"],[[1515,1519],"disallowed"],[[1520,1524],"valid"],[[1525,1535],"disallowed"],[[1536,1539],"disallowed"],[[1540,1540],"disallowed"],[[1541,1541],"disallowed"],[[1542,1546],"valid",[],"NV8"],[[1547,1547],"valid",[],"NV8"],[[1548,1548],"valid",[],"NV8"],[[1549,1551],"valid",[],"NV8"],[[1552,1557],"valid"],[[1558,1562],"valid"],[[1563,1563],"valid",[],"NV8"],[[1564,1564],"disallowed"],[[1565,1565],"disallowed"],[[1566,1566],"valid",[],"NV8"],[[1567,1567],"valid",[],"NV8"],[[1568,1568],"valid"],[[1569,1594],"valid"],[[1595,1599],"valid"],[[1600,1600],"valid",[],"NV8"],[[1601,1618],"valid"],[[1619,1621],"valid"],[[1622,1624],"valid"],[[1625,1630],"valid"],[[1631,1631],"valid"],[[1632,1641],"valid"],[[1642,1645],"valid",[],"NV8"],[[1646,1647],"valid"],[[1648,1652],"valid"],[[1653,1653],"mapped",[1575,1652]],[[1654,1654],"mapped",[1608,1652]],[[1655,1655],"mapped",[1735,1652]],[[1656,1656],"mapped",[1610,1652]],[[1657,1719],"valid"],[[1720,1721],"valid"],[[1722,1726],"valid"],[[1727,1727],"valid"],[[1728,1742],"valid"],[[1743,1743],"valid"],[[1744,1747],"valid"],[[1748,1748],"valid",[],"NV8"],[[1749,1756],"valid"],[[1757,1757],"disallowed"],[[1758,1758],"valid",[],"NV8"],[[1759,1768],"valid"],[[1769,1769],"valid",[],"NV8"],[[1770,1773],"valid"],[[1774,1775],"valid"],[[1776,1785],"valid"],[[1786,1790],"valid"],[[1791,1791],"valid"],[[1792,1805],"valid",[],"NV8"],[[1806,1806],"disallowed"],[[1807,1807],"disallowed"],[[1808,1836],"valid"],[[1837,1839],"valid"],[[1840,1866],"valid"],[[1867,1868],"disallowed"],[[1869,1871],"valid"],[[1872,1901],"valid"],[[1902,1919],"valid"],[[1920,1968],"valid"],[[1969,1969],"valid"],[[1970,1983],"disallowed"],[[1984,2037],"valid"],[[2038,2042],"valid",[],"NV8"],[[2043,2047],"disallowed"],[[2048,2093],"valid"],[[2094,2095],"disallowed"],[[2096,2110],"valid",[],"NV8"],[[2111,2111],"disallowed"],[[2112,2139],"valid"],[[2140,2141],"disallowed"],[[2142,2142],"valid",[],"NV8"],[[2143,2207],"disallowed"],[[2208,2208],"valid"],[[2209,2209],"valid"],[[2210,2220],"valid"],[[2221,2226],"valid"],[[2227,2228],"valid"],[[2229,2274],"disallowed"],[[2275,2275],"valid"],[[2276,2302],"valid"],[[2303,2303],"valid"],[[2304,2304],"valid"],[[2305,2307],"valid"],[[2308,2308],"valid"],[[2309,2361],"valid"],[[2362,2363],"valid"],[[2364,2381],"valid"],[[2382,2382],"valid"],[[2383,2383],"valid"],[[2384,2388],"valid"],[[2389,2389],"valid"],[[2390,2391],"valid"],[[2392,2392],"mapped",[2325,2364]],[[2393,2393],"mapped",[2326,2364]],[[2394,2394],"mapped",[2327,2364]],[[2395,2395],"mapped",[2332,2364]],[[2396,2396],"mapped",[2337,2364]],[[2397,2397],"mapped",[2338,2364]],[[2398,2398],"mapped",[2347,2364]],[[2399,2399],"mapped",[2351,2364]],[[2400,2403],"valid"],[[2404,2405],"valid",[],"NV8"],[[2406,2415],"valid"],[[2416,2416],"valid",[],"NV8"],[[2417,2418],"valid"],[[2419,2423],"valid"],[[2424,2424],"valid"],[[2425,2426],"valid"],[[2427,2428],"valid"],[[2429,2429],"valid"],[[2430,2431],"valid"],[[2432,2432],"valid"],[[2433,2435],"valid"],[[2436,2436],"disallowed"],[[2437,2444],"valid"],[[2445,2446],"disallowed"],[[2447,2448],"valid"],[[2449,2450],"disallowed"],[[2451,2472],"valid"],[[2473,2473],"disallowed"],[[2474,2480],"valid"],[[2481,2481],"disallowed"],[[2482,2482],"valid"],[[2483,2485],"disallowed"],[[2486,2489],"valid"],[[2490,2491],"disallowed"],[[2492,2492],"valid"],[[2493,2493],"valid"],[[2494,2500],"valid"],[[2501,2502],"disallowed"],[[2503,2504],"valid"],[[2505,2506],"disallowed"],[[2507,2509],"valid"],[[2510,2510],"valid"],[[2511,2518],"disallowed"],[[2519,2519],"valid"],[[2520,2523],"disallowed"],[[2524,2524],"mapped",[2465,2492]],[[2525,2525],"mapped",[2466,2492]],[[2526,2526],"disallowed"],[[2527,2527],"mapped",[2479,2492]],[[2528,2531],"valid"],[[2532,2533],"disallowed"],[[2534,2545],"valid"],[[2546,2554],"valid",[],"NV8"],[[2555,2555],"valid",[],"NV8"],[[2556,2560],"disallowed"],[[2561,2561],"valid"],[[2562,2562],"valid"],[[2563,2563],"valid"],[[2564,2564],"disallowed"],[[2565,2570],"valid"],[[2571,2574],"disallowed"],[[2575,2576],"valid"],[[2577,2578],"disallowed"],[[2579,2600],"valid"],[[2601,2601],"disallowed"],[[2602,2608],"valid"],[[2609,2609],"disallowed"],[[2610,2610],"valid"],[[2611,2611],"mapped",[2610,2620]],[[2612,2612],"disallowed"],[[2613,2613],"valid"],[[2614,2614],"mapped",[2616,2620]],[[2615,2615],"disallowed"],[[2616,2617],"valid"],[[2618,2619],"disallowed"],[[2620,2620],"valid"],[[2621,2621],"disallowed"],[[2622,2626],"valid"],[[2627,2630],"disallowed"],[[2631,2632],"valid"],[[2633,2634],"disallowed"],[[2635,2637],"valid"],[[2638,2640],"disallowed"],[[2641,2641],"valid"],[[2642,2648],"disallowed"],[[2649,2649],"mapped",[2582,2620]],[[2650,2650],"mapped",[2583,2620]],[[2651,2651],"mapped",[2588,2620]],[[2652,2652],"valid"],[[2653,2653],"disallowed"],[[2654,2654],"mapped",[2603,2620]],[[2655,2661],"disallowed"],[[2662,2676],"valid"],[[2677,2677],"valid"],[[2678,2688],"disallowed"],[[2689,2691],"valid"],[[2692,2692],"disallowed"],[[2693,2699],"valid"],[[2700,2700],"valid"],[[2701,2701],"valid"],[[2702,2702],"disallowed"],[[2703,2705],"valid"],[[2706,2706],"disallowed"],[[2707,2728],"valid"],[[2729,2729],"disallowed"],[[2730,2736],"valid"],[[2737,2737],"disallowed"],[[2738,2739],"valid"],[[2740,2740],"disallowed"],[[2741,2745],"valid"],[[2746,2747],"disallowed"],[[2748,2757],"valid"],[[2758,2758],"disallowed"],[[2759,2761],"valid"],[[2762,2762],"disallowed"],[[2763,2765],"valid"],[[2766,2767],"disallowed"],[[2768,2768],"valid"],[[2769,2783],"disallowed"],[[2784,2784],"valid"],[[2785,2787],"valid"],[[2788,2789],"disallowed"],[[2790,2799],"valid"],[[2800,2800],"valid",[],"NV8"],[[2801,2801],"valid",[],"NV8"],[[2802,2808],"disallowed"],[[2809,2809],"valid"],[[2810,2816],"disallowed"],[[2817,2819],"valid"],[[2820,2820],"disallowed"],[[2821,2828],"valid"],[[2829,2830],"disallowed"],[[2831,2832],"valid"],[[2833,2834],"disallowed"],[[2835,2856],"valid"],[[2857,2857],"disallowed"],[[2858,2864],"valid"],[[2865,2865],"disallowed"],[[2866,2867],"valid"],[[2868,2868],"disallowed"],[[2869,2869],"valid"],[[2870,2873],"valid"],[[2874,2875],"disallowed"],[[2876,2883],"valid"],[[2884,2884],"valid"],[[2885,2886],"disallowed"],[[2887,2888],"valid"],[[2889,2890],"disallowed"],[[2891,2893],"valid"],[[2894,2901],"disallowed"],[[2902,2903],"valid"],[[2904,2907],"disallowed"],[[2908,2908],"mapped",[2849,2876]],[[2909,2909],"mapped",[2850,2876]],[[2910,2910],"disallowed"],[[2911,2913],"valid"],[[2914,2915],"valid"],[[2916,2917],"disallowed"],[[2918,2927],"valid"],[[2928,2928],"valid",[],"NV8"],[[2929,2929],"valid"],[[2930,2935],"valid",[],"NV8"],[[2936,2945],"disallowed"],[[2946,2947],"valid"],[[2948,2948],"disallowed"],[[2949,2954],"valid"],[[2955,2957],"disallowed"],[[2958,2960],"valid"],[[2961,2961],"disallowed"],[[2962,2965],"valid"],[[2966,2968],"disallowed"],[[2969,2970],"valid"],[[2971,2971],"disallowed"],[[2972,2972],"valid"],[[2973,2973],"disallowed"],[[2974,2975],"valid"],[[2976,2978],"disallowed"],[[2979,2980],"valid"],[[2981,2983],"disallowed"],[[2984,2986],"valid"],[[2987,2989],"disallowed"],[[2990,2997],"valid"],[[2998,2998],"valid"],[[2999,3001],"valid"],[[3002,3005],"disallowed"],[[3006,3010],"valid"],[[3011,3013],"disallowed"],[[3014,3016],"valid"],[[3017,3017],"disallowed"],[[3018,3021],"valid"],[[3022,3023],"disallowed"],[[3024,3024],"valid"],[[3025,3030],"disallowed"],[[3031,3031],"valid"],[[3032,3045],"disallowed"],[[3046,3046],"valid"],[[3047,3055],"valid"],[[3056,3058],"valid",[],"NV8"],[[3059,3066],"valid",[],"NV8"],[[3067,3071],"disallowed"],[[3072,3072],"valid"],[[3073,3075],"valid"],[[3076,3076],"disallowed"],[[3077,3084],"valid"],[[3085,3085],"disallowed"],[[3086,3088],"valid"],[[3089,3089],"disallowed"],[[3090,3112],"valid"],[[3113,3113],"disallowed"],[[3114,3123],"valid"],[[3124,3124],"valid"],[[3125,3129],"valid"],[[3130,3132],"disallowed"],[[3133,3133],"valid"],[[3134,3140],"valid"],[[3141,3141],"disallowed"],[[3142,3144],"valid"],[[3145,3145],"disallowed"],[[3146,3149],"valid"],[[3150,3156],"disallowed"],[[3157,3158],"valid"],[[3159,3159],"disallowed"],[[3160,3161],"valid"],[[3162,3162],"valid"],[[3163,3167],"disallowed"],[[3168,3169],"valid"],[[3170,3171],"valid"],[[3172,3173],"disallowed"],[[3174,3183],"valid"],[[3184,3191],"disallowed"],[[3192,3199],"valid",[],"NV8"],[[3200,3200],"disallowed"],[[3201,3201],"valid"],[[3202,3203],"valid"],[[3204,3204],"disallowed"],[[3205,3212],"valid"],[[3213,3213],"disallowed"],[[3214,3216],"valid"],[[3217,3217],"disallowed"],[[3218,3240],"valid"],[[3241,3241],"disallowed"],[[3242,3251],"valid"],[[3252,3252],"disallowed"],[[3253,3257],"valid"],[[3258,3259],"disallowed"],[[3260,3261],"valid"],[[3262,3268],"valid"],[[3269,3269],"disallowed"],[[3270,3272],"valid"],[[3273,3273],"disallowed"],[[3274,3277],"valid"],[[3278,3284],"disallowed"],[[3285,3286],"valid"],[[3287,3293],"disallowed"],[[3294,3294],"valid"],[[3295,3295],"disallowed"],[[3296,3297],"valid"],[[3298,3299],"valid"],[[3300,3301],"disallowed"],[[3302,3311],"valid"],[[3312,3312],"disallowed"],[[3313,3314],"valid"],[[3315,3328],"disallowed"],[[3329,3329],"valid"],[[3330,3331],"valid"],[[3332,3332],"disallowed"],[[3333,3340],"valid"],[[3341,3341],"disallowed"],[[3342,3344],"valid"],[[3345,3345],"disallowed"],[[3346,3368],"valid"],[[3369,3369],"valid"],[[3370,3385],"valid"],[[3386,3386],"valid"],[[3387,3388],"disallowed"],[[3389,3389],"valid"],[[3390,3395],"valid"],[[3396,3396],"valid"],[[3397,3397],"disallowed"],[[3398,3400],"valid"],[[3401,3401],"disallowed"],[[3402,3405],"valid"],[[3406,3406],"valid"],[[3407,3414],"disallowed"],[[3415,3415],"valid"],[[3416,3422],"disallowed"],[[3423,3423],"valid"],[[3424,3425],"valid"],[[3426,3427],"valid"],[[3428,3429],"disallowed"],[[3430,3439],"valid"],[[3440,3445],"valid",[],"NV8"],[[3446,3448],"disallowed"],[[3449,3449],"valid",[],"NV8"],[[3450,3455],"valid"],[[3456,3457],"disallowed"],[[3458,3459],"valid"],[[3460,3460],"disallowed"],[[3461,3478],"valid"],[[3479,3481],"disallowed"],[[3482,3505],"valid"],[[3506,3506],"disallowed"],[[3507,3515],"valid"],[[3516,3516],"disallowed"],[[3517,3517],"valid"],[[3518,3519],"disallowed"],[[3520,3526],"valid"],[[3527,3529],"disallowed"],[[3530,3530],"valid"],[[3531,3534],"disallowed"],[[3535,3540],"valid"],[[3541,3541],"disallowed"],[[3542,3542],"valid"],[[3543,3543],"disallowed"],[[3544,3551],"valid"],[[3552,3557],"disallowed"],[[3558,3567],"valid"],[[3568,3569],"disallowed"],[[3570,3571],"valid"],[[3572,3572],"valid",[],"NV8"],[[3573,3584],"disallowed"],[[3585,3634],"valid"],[[3635,3635],"mapped",[3661,3634]],[[3636,3642],"valid"],[[3643,3646],"disallowed"],[[3647,3647],"valid",[],"NV8"],[[3648,3662],"valid"],[[3663,3663],"valid",[],"NV8"],[[3664,3673],"valid"],[[3674,3675],"valid",[],"NV8"],[[3676,3712],"disallowed"],[[3713,3714],"valid"],[[3715,3715],"disallowed"],[[3716,3716],"valid"],[[3717,3718],"disallowed"],[[3719,3720],"valid"],[[3721,3721],"disallowed"],[[3722,3722],"valid"],[[3723,3724],"disallowed"],[[3725,3725],"valid"],[[3726,3731],"disallowed"],[[3732,3735],"valid"],[[3736,3736],"disallowed"],[[3737,3743],"valid"],[[3744,3744],"disallowed"],[[3745,3747],"valid"],[[3748,3748],"disallowed"],[[3749,3749],"valid"],[[3750,3750],"disallowed"],[[3751,3751],"valid"],[[3752,3753],"disallowed"],[[3754,3755],"valid"],[[3756,3756],"disallowed"],[[3757,3762],"valid"],[[3763,3763],"mapped",[3789,3762]],[[3764,3769],"valid"],[[3770,3770],"disallowed"],[[3771,3773],"valid"],[[3774,3775],"disallowed"],[[3776,3780],"valid"],[[3781,3781],"disallowed"],[[3782,3782],"valid"],[[3783,3783],"disallowed"],[[3784,3789],"valid"],[[3790,3791],"disallowed"],[[3792,3801],"valid"],[[3802,3803],"disallowed"],[[3804,3804],"mapped",[3755,3737]],[[3805,3805],"mapped",[3755,3745]],[[3806,3807],"valid"],[[3808,3839],"disallowed"],[[3840,3840],"valid"],[[3841,3850],"valid",[],"NV8"],[[3851,3851],"valid"],[[3852,3852],"mapped",[3851]],[[3853,3863],"valid",[],"NV8"],[[3864,3865],"valid"],[[3866,3871],"valid",[],"NV8"],[[3872,3881],"valid"],[[3882,3892],"valid",[],"NV8"],[[3893,3893],"valid"],[[3894,3894],"valid",[],"NV8"],[[3895,3895],"valid"],[[3896,3896],"valid",[],"NV8"],[[3897,3897],"valid"],[[3898,3901],"valid",[],"NV8"],[[3902,3906],"valid"],[[3907,3907],"mapped",[3906,4023]],[[3908,3911],"valid"],[[3912,3912],"disallowed"],[[3913,3916],"valid"],[[3917,3917],"mapped",[3916,4023]],[[3918,3921],"valid"],[[3922,3922],"mapped",[3921,4023]],[[3923,3926],"valid"],[[3927,3927],"mapped",[3926,4023]],[[3928,3931],"valid"],[[3932,3932],"mapped",[3931,4023]],[[3933,3944],"valid"],[[3945,3945],"mapped",[3904,4021]],[[3946,3946],"valid"],[[3947,3948],"valid"],[[3949,3952],"disallowed"],[[3953,3954],"valid"],[[3955,3955],"mapped",[3953,3954]],[[3956,3956],"valid"],[[3957,3957],"mapped",[3953,3956]],[[3958,3958],"mapped",[4018,3968]],[[3959,3959],"mapped",[4018,3953,3968]],[[3960,3960],"mapped",[4019,3968]],[[3961,3961],"mapped",[4019,3953,3968]],[[3962,3968],"valid"],[[3969,3969],"mapped",[3953,3968]],[[3970,3972],"valid"],[[3973,3973],"valid",[],"NV8"],[[3974,3979],"valid"],[[3980,3983],"valid"],[[3984,3986],"valid"],[[3987,3987],"mapped",[3986,4023]],[[3988,3989],"valid"],[[3990,3990],"valid"],[[3991,3991],"valid"],[[3992,3992],"disallowed"],[[3993,3996],"valid"],[[3997,3997],"mapped",[3996,4023]],[[3998,4001],"valid"],[[4002,4002],"mapped",[4001,4023]],[[4003,4006],"valid"],[[4007,4007],"mapped",[4006,4023]],[[4008,4011],"valid"],[[4012,4012],"mapped",[4011,4023]],[[4013,4013],"valid"],[[4014,4016],"valid"],[[4017,4023],"valid"],[[4024,4024],"valid"],[[4025,4025],"mapped",[3984,4021]],[[4026,4028],"valid"],[[4029,4029],"disallowed"],[[4030,4037],"valid",[],"NV8"],[[4038,4038],"valid"],[[4039,4044],"valid",[],"NV8"],[[4045,4045],"disallowed"],[[4046,4046],"valid",[],"NV8"],[[4047,4047],"valid",[],"NV8"],[[4048,4049],"valid",[],"NV8"],[[4050,4052],"valid",[],"NV8"],[[4053,4056],"valid",[],"NV8"],[[4057,4058],"valid",[],"NV8"],[[4059,4095],"disallowed"],[[4096,4129],"valid"],[[4130,4130],"valid"],[[4131,4135],"valid"],[[4136,4136],"valid"],[[4137,4138],"valid"],[[4139,4139],"valid"],[[4140,4146],"valid"],[[4147,4149],"valid"],[[4150,4153],"valid"],[[4154,4159],"valid"],[[4160,4169],"valid"],[[4170,4175],"valid",[],"NV8"],[[4176,4185],"valid"],[[4186,4249],"valid"],[[4250,4253],"valid"],[[4254,4255],"valid",[],"NV8"],[[4256,4293],"disallowed"],[[4294,4294],"disallowed"],[[4295,4295],"mapped",[11559]],[[4296,4300],"disallowed"],[[4301,4301],"mapped",[11565]],[[4302,4303],"disallowed"],[[4304,4342],"valid"],[[4343,4344],"valid"],[[4345,4346],"valid"],[[4347,4347],"valid",[],"NV8"],[[4348,4348],"mapped",[4316]],[[4349,4351],"valid"],[[4352,4441],"valid",[],"NV8"],[[4442,4446],"valid",[],"NV8"],[[4447,4448],"disallowed"],[[4449,4514],"valid",[],"NV8"],[[4515,4519],"valid",[],"NV8"],[[4520,4601],"valid",[],"NV8"],[[4602,4607],"valid",[],"NV8"],[[4608,4614],"valid"],[[4615,4615],"valid"],[[4616,4678],"valid"],[[4679,4679],"valid"],[[4680,4680],"valid"],[[4681,4681],"disallowed"],[[4682,4685],"valid"],[[4686,4687],"disallowed"],[[4688,4694],"valid"],[[4695,4695],"disallowed"],[[4696,4696],"valid"],[[4697,4697],"disallowed"],[[4698,4701],"valid"],[[4702,4703],"disallowed"],[[4704,4742],"valid"],[[4743,4743],"valid"],[[4744,4744],"valid"],[[4745,4745],"disallowed"],[[4746,4749],"valid"],[[4750,4751],"disallowed"],[[4752,4782],"valid"],[[4783,4783],"valid"],[[4784,4784],"valid"],[[4785,4785],"disallowed"],[[4786,4789],"valid"],[[4790,4791],"disallowed"],[[4792,4798],"valid"],[[4799,4799],"disallowed"],[[4800,4800],"valid"],[[4801,4801],"disallowed"],[[4802,4805],"valid"],[[4806,4807],"disallowed"],[[4808,4814],"valid"],[[4815,4815],"valid"],[[4816,4822],"valid"],[[4823,4823],"disallowed"],[[4824,4846],"valid"],[[4847,4847],"valid"],[[4848,4878],"valid"],[[4879,4879],"valid"],[[4880,4880],"valid"],[[4881,4881],"disallowed"],[[4882,4885],"valid"],[[4886,4887],"disallowed"],[[4888,4894],"valid"],[[4895,4895],"valid"],[[4896,4934],"valid"],[[4935,4935],"valid"],[[4936,4954],"valid"],[[4955,4956],"disallowed"],[[4957,4958],"valid"],[[4959,4959],"valid"],[[4960,4960],"valid",[],"NV8"],[[4961,4988],"valid",[],"NV8"],[[4989,4991],"disallowed"],[[4992,5007],"valid"],[[5008,5017],"valid",[],"NV8"],[[5018,5023],"disallowed"],[[5024,5108],"valid"],[[5109,5109],"valid"],[[5110,5111],"disallowed"],[[5112,5112],"mapped",[5104]],[[5113,5113],"mapped",[5105]],[[5114,5114],"mapped",[5106]],[[5115,5115],"mapped",[5107]],[[5116,5116],"mapped",[5108]],[[5117,5117],"mapped",[5109]],[[5118,5119],"disallowed"],[[5120,5120],"valid",[],"NV8"],[[5121,5740],"valid"],[[5741,5742],"valid",[],"NV8"],[[5743,5750],"valid"],[[5751,5759],"valid"],[[5760,5760],"disallowed"],[[5761,5786],"valid"],[[5787,5788],"valid",[],"NV8"],[[5789,5791],"disallowed"],[[5792,5866],"valid"],[[5867,5872],"valid",[],"NV8"],[[5873,5880],"valid"],[[5881,5887],"disallowed"],[[5888,5900],"valid"],[[5901,5901],"disallowed"],[[5902,5908],"valid"],[[5909,5919],"disallowed"],[[5920,5940],"valid"],[[5941,5942],"valid",[],"NV8"],[[5943,5951],"disallowed"],[[5952,5971],"valid"],[[5972,5983],"disallowed"],[[5984,5996],"valid"],[[5997,5997],"disallowed"],[[5998,6000],"valid"],[[6001,6001],"disallowed"],[[6002,6003],"valid"],[[6004,6015],"disallowed"],[[6016,6067],"valid"],[[6068,6069],"disallowed"],[[6070,6099],"valid"],[[6100,6102],"valid",[],"NV8"],[[6103,6103],"valid"],[[6104,6107],"valid",[],"NV8"],[[6108,6108],"valid"],[[6109,6109],"valid"],[[6110,6111],"disallowed"],[[6112,6121],"valid"],[[6122,6127],"disallowed"],[[6128,6137],"valid",[],"NV8"],[[6138,6143],"disallowed"],[[6144,6149],"valid",[],"NV8"],[[6150,6150],"disallowed"],[[6151,6154],"valid",[],"NV8"],[[6155,6157],"ignored"],[[6158,6158],"disallowed"],[[6159,6159],"disallowed"],[[6160,6169],"valid"],[[6170,6175],"disallowed"],[[6176,6263],"valid"],[[6264,6271],"disallowed"],[[6272,6313],"valid"],[[6314,6314],"valid"],[[6315,6319],"disallowed"],[[6320,6389],"valid"],[[6390,6399],"disallowed"],[[6400,6428],"valid"],[[6429,6430],"valid"],[[6431,6431],"disallowed"],[[6432,6443],"valid"],[[6444,6447],"disallowed"],[[6448,6459],"valid"],[[6460,6463],"disallowed"],[[6464,6464],"valid",[],"NV8"],[[6465,6467],"disallowed"],[[6468,6469],"valid",[],"NV8"],[[6470,6509],"valid"],[[6510,6511],"disallowed"],[[6512,6516],"valid"],[[6517,6527],"disallowed"],[[6528,6569],"valid"],[[6570,6571],"valid"],[[6572,6575],"disallowed"],[[6576,6601],"valid"],[[6602,6607],"disallowed"],[[6608,6617],"valid"],[[6618,6618],"valid",[],"XV8"],[[6619,6621],"disallowed"],[[6622,6623],"valid",[],"NV8"],[[6624,6655],"valid",[],"NV8"],[[6656,6683],"valid"],[[6684,6685],"disallowed"],[[6686,6687],"valid",[],"NV8"],[[6688,6750],"valid"],[[6751,6751],"disallowed"],[[6752,6780],"valid"],[[6781,6782],"disallowed"],[[6783,6793],"valid"],[[6794,6799],"disallowed"],[[6800,6809],"valid"],[[6810,6815],"disallowed"],[[6816,6822],"valid",[],"NV8"],[[6823,6823],"valid"],[[6824,6829],"valid",[],"NV8"],[[6830,6831],"disallowed"],[[6832,6845],"valid"],[[6846,6846],"valid",[],"NV8"],[[6847,6911],"disallowed"],[[6912,6987],"valid"],[[6988,6991],"disallowed"],[[6992,7001],"valid"],[[7002,7018],"valid",[],"NV8"],[[7019,7027],"valid"],[[7028,7036],"valid",[],"NV8"],[[7037,7039],"disallowed"],[[7040,7082],"valid"],[[7083,7085],"valid"],[[7086,7097],"valid"],[[7098,7103],"valid"],[[7104,7155],"valid"],[[7156,7163],"disallowed"],[[7164,7167],"valid",[],"NV8"],[[7168,7223],"valid"],[[7224,7226],"disallowed"],[[7227,7231],"valid",[],"NV8"],[[7232,7241],"valid"],[[7242,7244],"disallowed"],[[7245,7293],"valid"],[[7294,7295],"valid",[],"NV8"],[[7296,7359],"disallowed"],[[7360,7367],"valid",[],"NV8"],[[7368,7375],"disallowed"],[[7376,7378],"valid"],[[7379,7379],"valid",[],"NV8"],[[7380,7410],"valid"],[[7411,7414],"valid"],[[7415,7415],"disallowed"],[[7416,7417],"valid"],[[7418,7423],"disallowed"],[[7424,7467],"valid"],[[7468,7468],"mapped",[97]],[[7469,7469],"mapped",[230]],[[7470,7470],"mapped",[98]],[[7471,7471],"valid"],[[7472,7472],"mapped",[100]],[[7473,7473],"mapped",[101]],[[7474,7474],"mapped",[477]],[[7475,7475],"mapped",[103]],[[7476,7476],"mapped",[104]],[[7477,7477],"mapped",[105]],[[7478,7478],"mapped",[106]],[[7479,7479],"mapped",[107]],[[7480,7480],"mapped",[108]],[[7481,7481],"mapped",[109]],[[7482,7482],"mapped",[110]],[[7483,7483],"valid"],[[7484,7484],"mapped",[111]],[[7485,7485],"mapped",[547]],[[7486,7486],"mapped",[112]],[[7487,7487],"mapped",[114]],[[7488,7488],"mapped",[116]],[[7489,7489],"mapped",[117]],[[7490,7490],"mapped",[119]],[[7491,7491],"mapped",[97]],[[7492,7492],"mapped",[592]],[[7493,7493],"mapped",[593]],[[7494,7494],"mapped",[7426]],[[7495,7495],"mapped",[98]],[[7496,7496],"mapped",[100]],[[7497,7497],"mapped",[101]],[[7498,7498],"mapped",[601]],[[7499,7499],"mapped",[603]],[[7500,7500],"mapped",[604]],[[7501,7501],"mapped",[103]],[[7502,7502],"valid"],[[7503,7503],"mapped",[107]],[[7504,7504],"mapped",[109]],[[7505,7505],"mapped",[331]],[[7506,7506],"mapped",[111]],[[7507,7507],"mapped",[596]],[[7508,7508],"mapped",[7446]],[[7509,7509],"mapped",[7447]],[[7510,7510],"mapped",[112]],[[7511,7511],"mapped",[116]],[[7512,7512],"mapped",[117]],[[7513,7513],"mapped",[7453]],[[7514,7514],"mapped",[623]],[[7515,7515],"mapped",[118]],[[7516,7516],"mapped",[7461]],[[7517,7517],"mapped",[946]],[[7518,7518],"mapped",[947]],[[7519,7519],"mapped",[948]],[[7520,7520],"mapped",[966]],[[7521,7521],"mapped",[967]],[[7522,7522],"mapped",[105]],[[7523,7523],"mapped",[114]],[[7524,7524],"mapped",[117]],[[7525,7525],"mapped",[118]],[[7526,7526],"mapped",[946]],[[7527,7527],"mapped",[947]],[[7528,7528],"mapped",[961]],[[7529,7529],"mapped",[966]],[[7530,7530],"mapped",[967]],[[7531,7531],"valid"],[[7532,7543],"valid"],[[7544,7544],"mapped",[1085]],[[7545,7578],"valid"],[[7579,7579],"mapped",[594]],[[7580,7580],"mapped",[99]],[[7581,7581],"mapped",[597]],[[7582,7582],"mapped",[240]],[[7583,7583],"mapped",[604]],[[7584,7584],"mapped",[102]],[[7585,7585],"mapped",[607]],[[7586,7586],"mapped",[609]],[[7587,7587],"mapped",[613]],[[7588,7588],"mapped",[616]],[[7589,7589],"mapped",[617]],[[7590,7590],"mapped",[618]],[[7591,7591],"mapped",[7547]],[[7592,7592],"mapped",[669]],[[7593,7593],"mapped",[621]],[[7594,7594],"mapped",[7557]],[[7595,7595],"mapped",[671]],[[7596,7596],"mapped",[625]],[[7597,7597],"mapped",[624]],[[7598,7598],"mapped",[626]],[[7599,7599],"mapped",[627]],[[7600,7600],"mapped",[628]],[[7601,7601],"mapped",[629]],[[7602,7602],"mapped",[632]],[[7603,7603],"mapped",[642]],[[7604,7604],"mapped",[643]],[[7605,7605],"mapped",[427]],[[7606,7606],"mapped",[649]],[[7607,7607],"mapped",[650]],[[7608,7608],"mapped",[7452]],[[7609,7609],"mapped",[651]],[[7610,7610],"mapped",[652]],[[7611,7611],"mapped",[122]],[[7612,7612],"mapped",[656]],[[7613,7613],"mapped",[657]],[[7614,7614],"mapped",[658]],[[7615,7615],"mapped",[952]],[[7616,7619],"valid"],[[7620,7626],"valid"],[[7627,7654],"valid"],[[7655,7669],"valid"],[[7670,7675],"disallowed"],[[7676,7676],"valid"],[[7677,7677],"valid"],[[7678,7679],"valid"],[[7680,7680],"mapped",[7681]],[[7681,7681],"valid"],[[7682,7682],"mapped",[7683]],[[7683,7683],"valid"],[[7684,7684],"mapped",[7685]],[[7685,7685],"valid"],[[7686,7686],"mapped",[7687]],[[7687,7687],"valid"],[[7688,7688],"mapped",[7689]],[[7689,7689],"valid"],[[7690,7690],"mapped",[7691]],[[7691,7691],"valid"],[[7692,7692],"mapped",[7693]],[[7693,7693],"valid"],[[7694,7694],"mapped",[7695]],[[7695,7695],"valid"],[[7696,7696],"mapped",[7697]],[[7697,7697],"valid"],[[7698,7698],"mapped",[7699]],[[7699,7699],"valid"],[[7700,7700],"mapped",[7701]],[[7701,7701],"valid"],[[7702,7702],"mapped",[7703]],[[7703,7703],"valid"],[[7704,7704],"mapped",[7705]],[[7705,7705],"valid"],[[7706,7706],"mapped",[7707]],[[7707,7707],"valid"],[[7708,7708],"mapped",[7709]],[[7709,7709],"valid"],[[7710,7710],"mapped",[7711]],[[7711,7711],"valid"],[[7712,7712],"mapped",[7713]],[[7713,7713],"valid"],[[7714,7714],"mapped",[7715]],[[7715,7715],"valid"],[[7716,7716],"mapped",[7717]],[[7717,7717],"valid"],[[7718,7718],"mapped",[7719]],[[7719,7719],"valid"],[[7720,7720],"mapped",[7721]],[[7721,7721],"valid"],[[7722,7722],"mapped",[7723]],[[7723,7723],"valid"],[[7724,7724],"mapped",[7725]],[[7725,7725],"valid"],[[7726,7726],"mapped",[7727]],[[7727,7727],"valid"],[[7728,7728],"mapped",[7729]],[[7729,7729],"valid"],[[7730,7730],"mapped",[7731]],[[7731,7731],"valid"],[[7732,7732],"mapped",[7733]],[[7733,7733],"valid"],[[7734,7734],"mapped",[7735]],[[7735,7735],"valid"],[[7736,7736],"mapped",[7737]],[[7737,7737],"valid"],[[7738,7738],"mapped",[7739]],[[7739,7739],"valid"],[[7740,7740],"mapped",[7741]],[[7741,7741],"valid"],[[7742,7742],"mapped",[7743]],[[7743,7743],"valid"],[[7744,7744],"mapped",[7745]],[[7745,7745],"valid"],[[7746,7746],"mapped",[7747]],[[7747,7747],"valid"],[[7748,7748],"mapped",[7749]],[[7749,7749],"valid"],[[7750,7750],"mapped",[7751]],[[7751,7751],"valid"],[[7752,7752],"mapped",[7753]],[[7753,7753],"valid"],[[7754,7754],"mapped",[7755]],[[7755,7755],"valid"],[[7756,7756],"mapped",[7757]],[[7757,7757],"valid"],[[7758,7758],"mapped",[7759]],[[7759,7759],"valid"],[[7760,7760],"mapped",[7761]],[[7761,7761],"valid"],[[7762,7762],"mapped",[7763]],[[7763,7763],"valid"],[[7764,7764],"mapped",[7765]],[[7765,7765],"valid"],[[7766,7766],"mapped",[7767]],[[7767,7767],"valid"],[[7768,7768],"mapped",[7769]],[[7769,7769],"valid"],[[7770,7770],"mapped",[7771]],[[7771,7771],"valid"],[[7772,7772],"mapped",[7773]],[[7773,7773],"valid"],[[7774,7774],"mapped",[7775]],[[7775,7775],"valid"],[[7776,7776],"mapped",[7777]],[[7777,7777],"valid"],[[7778,7778],"mapped",[7779]],[[7779,7779],"valid"],[[7780,7780],"mapped",[7781]],[[7781,7781],"valid"],[[7782,7782],"mapped",[7783]],[[7783,7783],"valid"],[[7784,7784],"mapped",[7785]],[[7785,7785],"valid"],[[7786,7786],"mapped",[7787]],[[7787,7787],"valid"],[[7788,7788],"mapped",[7789]],[[7789,7789],"valid"],[[7790,7790],"mapped",[7791]],[[7791,7791],"valid"],[[7792,7792],"mapped",[7793]],[[7793,7793],"valid"],[[7794,7794],"mapped",[7795]],[[7795,7795],"valid"],[[7796,7796],"mapped",[7797]],[[7797,7797],"valid"],[[7798,7798],"mapped",[7799]],[[7799,7799],"valid"],[[7800,7800],"mapped",[7801]],[[7801,7801],"valid"],[[7802,7802],"mapped",[7803]],[[7803,7803],"valid"],[[7804,7804],"mapped",[7805]],[[7805,7805],"valid"],[[7806,7806],"mapped",[7807]],[[7807,7807],"valid"],[[7808,7808],"mapped",[7809]],[[7809,7809],"valid"],[[7810,7810],"mapped",[7811]],[[7811,7811],"valid"],[[7812,7812],"mapped",[7813]],[[7813,7813],"valid"],[[7814,7814],"mapped",[7815]],[[7815,7815],"valid"],[[7816,7816],"mapped",[7817]],[[7817,7817],"valid"],[[7818,7818],"mapped",[7819]],[[7819,7819],"valid"],[[7820,7820],"mapped",[7821]],[[7821,7821],"valid"],[[7822,7822],"mapped",[7823]],[[7823,7823],"valid"],[[7824,7824],"mapped",[7825]],[[7825,7825],"valid"],[[7826,7826],"mapped",[7827]],[[7827,7827],"valid"],[[7828,7828],"mapped",[7829]],[[7829,7833],"valid"],[[7834,7834],"mapped",[97,702]],[[7835,7835],"mapped",[7777]],[[7836,7837],"valid"],[[7838,7838],"mapped",[115,115]],[[7839,7839],"valid"],[[7840,7840],"mapped",[7841]],[[7841,7841],"valid"],[[7842,7842],"mapped",[7843]],[[7843,7843],"valid"],[[7844,7844],"mapped",[7845]],[[7845,7845],"valid"],[[7846,7846],"mapped",[7847]],[[7847,7847],"valid"],[[7848,7848],"mapped",[7849]],[[7849,7849],"valid"],[[7850,7850],"mapped",[7851]],[[7851,7851],"valid"],[[7852,7852],"mapped",[7853]],[[7853,7853],"valid"],[[7854,7854],"mapped",[7855]],[[7855,7855],"valid"],[[7856,7856],"mapped",[7857]],[[7857,7857],"valid"],[[7858,7858],"mapped",[7859]],[[7859,7859],"valid"],[[7860,7860],"mapped",[7861]],[[7861,7861],"valid"],[[7862,7862],"mapped",[7863]],[[7863,7863],"valid"],[[7864,7864],"mapped",[7865]],[[7865,7865],"valid"],[[7866,7866],"mapped",[7867]],[[7867,7867],"valid"],[[7868,7868],"mapped",[7869]],[[7869,7869],"valid"],[[7870,7870],"mapped",[7871]],[[7871,7871],"valid"],[[7872,7872],"mapped",[7873]],[[7873,7873],"valid"],[[7874,7874],"mapped",[7875]],[[7875,7875],"valid"],[[7876,7876],"mapped",[7877]],[[7877,7877],"valid"],[[7878,7878],"mapped",[7879]],[[7879,7879],"valid"],[[7880,7880],"mapped",[7881]],[[7881,7881],"valid"],[[7882,7882],"mapped",[7883]],[[7883,7883],"valid"],[[7884,7884],"mapped",[7885]],[[7885,7885],"valid"],[[7886,7886],"mapped",[7887]],[[7887,7887],"valid"],[[7888,7888],"mapped",[7889]],[[7889,7889],"valid"],[[7890,7890],"mapped",[7891]],[[7891,7891],"valid"],[[7892,7892],"mapped",[7893]],[[7893,7893],"valid"],[[7894,7894],"mapped",[7895]],[[7895,7895],"valid"],[[7896,7896],"mapped",[7897]],[[7897,7897],"valid"],[[7898,7898],"mapped",[7899]],[[7899,7899],"valid"],[[7900,7900],"mapped",[7901]],[[7901,7901],"valid"],[[7902,7902],"mapped",[7903]],[[7903,7903],"valid"],[[7904,7904],"mapped",[7905]],[[7905,7905],"valid"],[[7906,7906],"mapped",[7907]],[[7907,7907],"valid"],[[7908,7908],"mapped",[7909]],[[7909,7909],"valid"],[[7910,7910],"mapped",[7911]],[[7911,7911],"valid"],[[7912,7912],"mapped",[7913]],[[7913,7913],"valid"],[[7914,7914],"mapped",[7915]],[[7915,7915],"valid"],[[7916,7916],"mapped",[7917]],[[7917,7917],"valid"],[[7918,7918],"mapped",[7919]],[[7919,7919],"valid"],[[7920,7920],"mapped",[7921]],[[7921,7921],"valid"],[[7922,7922],"mapped",[7923]],[[7923,7923],"valid"],[[7924,7924],"mapped",[7925]],[[7925,7925],"valid"],[[7926,7926],"mapped",[7927]],[[7927,7927],"valid"],[[7928,7928],"mapped",[7929]],[[7929,7929],"valid"],[[7930,7930],"mapped",[7931]],[[7931,7931],"valid"],[[7932,7932],"mapped",[7933]],[[7933,7933],"valid"],[[7934,7934],"mapped",[7935]],[[7935,7935],"valid"],[[7936,7943],"valid"],[[7944,7944],"mapped",[7936]],[[7945,7945],"mapped",[7937]],[[7946,7946],"mapped",[7938]],[[7947,7947],"mapped",[7939]],[[7948,7948],"mapped",[7940]],[[7949,7949],"mapped",[7941]],[[7950,7950],"mapped",[7942]],[[7951,7951],"mapped",[7943]],[[7952,7957],"valid"],[[7958,7959],"disallowed"],[[7960,7960],"mapped",[7952]],[[7961,7961],"mapped",[7953]],[[7962,7962],"mapped",[7954]],[[7963,7963],"mapped",[7955]],[[7964,7964],"mapped",[7956]],[[7965,7965],"mapped",[7957]],[[7966,7967],"disallowed"],[[7968,7975],"valid"],[[7976,7976],"mapped",[7968]],[[7977,7977],"mapped",[7969]],[[7978,7978],"mapped",[7970]],[[7979,7979],"mapped",[7971]],[[7980,7980],"mapped",[7972]],[[7981,7981],"mapped",[7973]],[[7982,7982],"mapped",[7974]],[[7983,7983],"mapped",[7975]],[[7984,7991],"valid"],[[7992,7992],"mapped",[7984]],[[7993,7993],"mapped",[7985]],[[7994,7994],"mapped",[7986]],[[7995,7995],"mapped",[7987]],[[7996,7996],"mapped",[7988]],[[7997,7997],"mapped",[7989]],[[7998,7998],"mapped",[7990]],[[7999,7999],"mapped",[7991]],[[8000,8005],"valid"],[[8006,8007],"disallowed"],[[8008,8008],"mapped",[8000]],[[8009,8009],"mapped",[8001]],[[8010,8010],"mapped",[8002]],[[8011,8011],"mapped",[8003]],[[8012,8012],"mapped",[8004]],[[8013,8013],"mapped",[8005]],[[8014,8015],"disallowed"],[[8016,8023],"valid"],[[8024,8024],"disallowed"],[[8025,8025],"mapped",[8017]],[[8026,8026],"disallowed"],[[8027,8027],"mapped",[8019]],[[8028,8028],"disallowed"],[[8029,8029],"mapped",[8021]],[[8030,8030],"disallowed"],[[8031,8031],"mapped",[8023]],[[8032,8039],"valid"],[[8040,8040],"mapped",[8032]],[[8041,8041],"mapped",[8033]],[[8042,8042],"mapped",[8034]],[[8043,8043],"mapped",[8035]],[[8044,8044],"mapped",[8036]],[[8045,8045],"mapped",[8037]],[[8046,8046],"mapped",[8038]],[[8047,8047],"mapped",[8039]],[[8048,8048],"valid"],[[8049,8049],"mapped",[940]],[[8050,8050],"valid"],[[8051,8051],"mapped",[941]],[[8052,8052],"valid"],[[8053,8053],"mapped",[942]],[[8054,8054],"valid"],[[8055,8055],"mapped",[943]],[[8056,8056],"valid"],[[8057,8057],"mapped",[972]],[[8058,8058],"valid"],[[8059,8059],"mapped",[973]],[[8060,8060],"valid"],[[8061,8061],"mapped",[974]],[[8062,8063],"disallowed"],[[8064,8064],"mapped",[7936,953]],[[8065,8065],"mapped",[7937,953]],[[8066,8066],"mapped",[7938,953]],[[8067,8067],"mapped",[7939,953]],[[8068,8068],"mapped",[7940,953]],[[8069,8069],"mapped",[7941,953]],[[8070,8070],"mapped",[7942,953]],[[8071,8071],"mapped",[7943,953]],[[8072,8072],"mapped",[7936,953]],[[8073,8073],"mapped",[7937,953]],[[8074,8074],"mapped",[7938,953]],[[8075,8075],"mapped",[7939,953]],[[8076,8076],"mapped",[7940,953]],[[8077,8077],"mapped",[7941,953]],[[8078,8078],"mapped",[7942,953]],[[8079,8079],"mapped",[7943,953]],[[8080,8080],"mapped",[7968,953]],[[8081,8081],"mapped",[7969,953]],[[8082,8082],"mapped",[7970,953]],[[8083,8083],"mapped",[7971,953]],[[8084,8084],"mapped",[7972,953]],[[8085,8085],"mapped",[7973,953]],[[8086,8086],"mapped",[7974,953]],[[8087,8087],"mapped",[7975,953]],[[8088,8088],"mapped",[7968,953]],[[8089,8089],"mapped",[7969,953]],[[8090,8090],"mapped",[7970,953]],[[8091,8091],"mapped",[7971,953]],[[8092,8092],"mapped",[7972,953]],[[8093,8093],"mapped",[7973,953]],[[8094,8094],"mapped",[7974,953]],[[8095,8095],"mapped",[7975,953]],[[8096,8096],"mapped",[8032,953]],[[8097,8097],"mapped",[8033,953]],[[8098,8098],"mapped",[8034,953]],[[8099,8099],"mapped",[8035,953]],[[8100,8100],"mapped",[8036,953]],[[8101,8101],"mapped",[8037,953]],[[8102,8102],"mapped",[8038,953]],[[8103,8103],"mapped",[8039,953]],[[8104,8104],"mapped",[8032,953]],[[8105,8105],"mapped",[8033,953]],[[8106,8106],"mapped",[8034,953]],[[8107,8107],"mapped",[8035,953]],[[8108,8108],"mapped",[8036,953]],[[8109,8109],"mapped",[8037,953]],[[8110,8110],"mapped",[8038,953]],[[8111,8111],"mapped",[8039,953]],[[8112,8113],"valid"],[[8114,8114],"mapped",[8048,953]],[[8115,8115],"mapped",[945,953]],[[8116,8116],"mapped",[940,953]],[[8117,8117],"disallowed"],[[8118,8118],"valid"],[[8119,8119],"mapped",[8118,953]],[[8120,8120],"mapped",[8112]],[[8121,8121],"mapped",[8113]],[[8122,8122],"mapped",[8048]],[[8123,8123],"mapped",[940]],[[8124,8124],"mapped",[945,953]],[[8125,8125],"disallowed_STD3_mapped",[32,787]],[[8126,8126],"mapped",[953]],[[8127,8127],"disallowed_STD3_mapped",[32,787]],[[8128,8128],"disallowed_STD3_mapped",[32,834]],[[8129,8129],"disallowed_STD3_mapped",[32,776,834]],[[8130,8130],"mapped",[8052,953]],[[8131,8131],"mapped",[951,953]],[[8132,8132],"mapped",[942,953]],[[8133,8133],"disallowed"],[[8134,8134],"valid"],[[8135,8135],"mapped",[8134,953]],[[8136,8136],"mapped",[8050]],[[8137,8137],"mapped",[941]],[[8138,8138],"mapped",[8052]],[[8139,8139],"mapped",[942]],[[8140,8140],"mapped",[951,953]],[[8141,8141],"disallowed_STD3_mapped",[32,787,768]],[[8142,8142],"disallowed_STD3_mapped",[32,787,769]],[[8143,8143],"disallowed_STD3_mapped",[32,787,834]],[[8144,8146],"valid"],[[8147,8147],"mapped",[912]],[[8148,8149],"disallowed"],[[8150,8151],"valid"],[[8152,8152],"mapped",[8144]],[[8153,8153],"mapped",[8145]],[[8154,8154],"mapped",[8054]],[[8155,8155],"mapped",[943]],[[8156,8156],"disallowed"],[[8157,8157],"disallowed_STD3_mapped",[32,788,768]],[[8158,8158],"disallowed_STD3_mapped",[32,788,769]],[[8159,8159],"disallowed_STD3_mapped",[32,788,834]],[[8160,8162],"valid"],[[8163,8163],"mapped",[944]],[[8164,8167],"valid"],[[8168,8168],"mapped",[8160]],[[8169,8169],"mapped",[8161]],[[8170,8170],"mapped",[8058]],[[8171,8171],"mapped",[973]],[[8172,8172],"mapped",[8165]],[[8173,8173],"disallowed_STD3_mapped",[32,776,768]],[[8174,8174],"disallowed_STD3_mapped",[32,776,769]],[[8175,8175],"disallowed_STD3_mapped",[96]],[[8176,8177],"disallowed"],[[8178,8178],"mapped",[8060,953]],[[8179,8179],"mapped",[969,953]],[[8180,8180],"mapped",[974,953]],[[8181,8181],"disallowed"],[[8182,8182],"valid"],[[8183,8183],"mapped",[8182,953]],[[8184,8184],"mapped",[8056]],[[8185,8185],"mapped",[972]],[[8186,8186],"mapped",[8060]],[[8187,8187],"mapped",[974]],[[8188,8188],"mapped",[969,953]],[[8189,8189],"disallowed_STD3_mapped",[32,769]],[[8190,8190],"disallowed_STD3_mapped",[32,788]],[[8191,8191],"disallowed"],[[8192,8202],"disallowed_STD3_mapped",[32]],[[8203,8203],"ignored"],[[8204,8205],"deviation",[]],[[8206,8207],"disallowed"],[[8208,8208],"valid",[],"NV8"],[[8209,8209],"mapped",[8208]],[[8210,8214],"valid",[],"NV8"],[[8215,8215],"disallowed_STD3_mapped",[32,819]],[[8216,8227],"valid",[],"NV8"],[[8228,8230],"disallowed"],[[8231,8231],"valid",[],"NV8"],[[8232,8238],"disallowed"],[[8239,8239],"disallowed_STD3_mapped",[32]],[[8240,8242],"valid",[],"NV8"],[[8243,8243],"mapped",[8242,8242]],[[8244,8244],"mapped",[8242,8242,8242]],[[8245,8245],"valid",[],"NV8"],[[8246,8246],"mapped",[8245,8245]],[[8247,8247],"mapped",[8245,8245,8245]],[[8248,8251],"valid",[],"NV8"],[[8252,8252],"disallowed_STD3_mapped",[33,33]],[[8253,8253],"valid",[],"NV8"],[[8254,8254],"disallowed_STD3_mapped",[32,773]],[[8255,8262],"valid",[],"NV8"],[[8263,8263],"disallowed_STD3_mapped",[63,63]],[[8264,8264],"disallowed_STD3_mapped",[63,33]],[[8265,8265],"disallowed_STD3_mapped",[33,63]],[[8266,8269],"valid",[],"NV8"],[[8270,8274],"valid",[],"NV8"],[[8275,8276],"valid",[],"NV8"],[[8277,8278],"valid",[],"NV8"],[[8279,8279],"mapped",[8242,8242,8242,8242]],[[8280,8286],"valid",[],"NV8"],[[8287,8287],"disallowed_STD3_mapped",[32]],[[8288,8288],"ignored"],[[8289,8291],"disallowed"],[[8292,8292],"ignored"],[[8293,8293],"disallowed"],[[8294,8297],"disallowed"],[[8298,8303],"disallowed"],[[8304,8304],"mapped",[48]],[[8305,8305],"mapped",[105]],[[8306,8307],"disallowed"],[[8308,8308],"mapped",[52]],[[8309,8309],"mapped",[53]],[[8310,8310],"mapped",[54]],[[8311,8311],"mapped",[55]],[[8312,8312],"mapped",[56]],[[8313,8313],"mapped",[57]],[[8314,8314],"disallowed_STD3_mapped",[43]],[[8315,8315],"mapped",[8722]],[[8316,8316],"disallowed_STD3_mapped",[61]],[[8317,8317],"disallowed_STD3_mapped",[40]],[[8318,8318],"disallowed_STD3_mapped",[41]],[[8319,8319],"mapped",[110]],[[8320,8320],"mapped",[48]],[[8321,8321],"mapped",[49]],[[8322,8322],"mapped",[50]],[[8323,8323],"mapped",[51]],[[8324,8324],"mapped",[52]],[[8325,8325],"mapped",[53]],[[8326,8326],"mapped",[54]],[[8327,8327],"mapped",[55]],[[8328,8328],"mapped",[56]],[[8329,8329],"mapped",[57]],[[8330,8330],"disallowed_STD3_mapped",[43]],[[8331,8331],"mapped",[8722]],[[8332,8332],"disallowed_STD3_mapped",[61]],[[8333,8333],"disallowed_STD3_mapped",[40]],[[8334,8334],"disallowed_STD3_mapped",[41]],[[8335,8335],"disallowed"],[[8336,8336],"mapped",[97]],[[8337,8337],"mapped",[101]],[[8338,8338],"mapped",[111]],[[8339,8339],"mapped",[120]],[[8340,8340],"mapped",[601]],[[8341,8341],"mapped",[104]],[[8342,8342],"mapped",[107]],[[8343,8343],"mapped",[108]],[[8344,8344],"mapped",[109]],[[8345,8345],"mapped",[110]],[[8346,8346],"mapped",[112]],[[8347,8347],"mapped",[115]],[[8348,8348],"mapped",[116]],[[8349,8351],"disallowed"],[[8352,8359],"valid",[],"NV8"],[[8360,8360],"mapped",[114,115]],[[8361,8362],"valid",[],"NV8"],[[8363,8363],"valid",[],"NV8"],[[8364,8364],"valid",[],"NV8"],[[8365,8367],"valid",[],"NV8"],[[8368,8369],"valid",[],"NV8"],[[8370,8373],"valid",[],"NV8"],[[8374,8376],"valid",[],"NV8"],[[8377,8377],"valid",[],"NV8"],[[8378,8378],"valid",[],"NV8"],[[8379,8381],"valid",[],"NV8"],[[8382,8382],"valid",[],"NV8"],[[8383,8399],"disallowed"],[[8400,8417],"valid",[],"NV8"],[[8418,8419],"valid",[],"NV8"],[[8420,8426],"valid",[],"NV8"],[[8427,8427],"valid",[],"NV8"],[[8428,8431],"valid",[],"NV8"],[[8432,8432],"valid",[],"NV8"],[[8433,8447],"disallowed"],[[8448,8448],"disallowed_STD3_mapped",[97,47,99]],[[8449,8449],"disallowed_STD3_mapped",[97,47,115]],[[8450,8450],"mapped",[99]],[[8451,8451],"mapped",[176,99]],[[8452,8452],"valid",[],"NV8"],[[8453,8453],"disallowed_STD3_mapped",[99,47,111]],[[8454,8454],"disallowed_STD3_mapped",[99,47,117]],[[8455,8455],"mapped",[603]],[[8456,8456],"valid",[],"NV8"],[[8457,8457],"mapped",[176,102]],[[8458,8458],"mapped",[103]],[[8459,8462],"mapped",[104]],[[8463,8463],"mapped",[295]],[[8464,8465],"mapped",[105]],[[8466,8467],"mapped",[108]],[[8468,8468],"valid",[],"NV8"],[[8469,8469],"mapped",[110]],[[8470,8470],"mapped",[110,111]],[[8471,8472],"valid",[],"NV8"],[[8473,8473],"mapped",[112]],[[8474,8474],"mapped",[113]],[[8475,8477],"mapped",[114]],[[8478,8479],"valid",[],"NV8"],[[8480,8480],"mapped",[115,109]],[[8481,8481],"mapped",[116,101,108]],[[8482,8482],"mapped",[116,109]],[[8483,8483],"valid",[],"NV8"],[[8484,8484],"mapped",[122]],[[8485,8485],"valid",[],"NV8"],[[8486,8486],"mapped",[969]],[[8487,8487],"valid",[],"NV8"],[[8488,8488],"mapped",[122]],[[8489,8489],"valid",[],"NV8"],[[8490,8490],"mapped",[107]],[[8491,8491],"mapped",[229]],[[8492,8492],"mapped",[98]],[[8493,8493],"mapped",[99]],[[8494,8494],"valid",[],"NV8"],[[8495,8496],"mapped",[101]],[[8497,8497],"mapped",[102]],[[8498,8498],"disallowed"],[[8499,8499],"mapped",[109]],[[8500,8500],"mapped",[111]],[[8501,8501],"mapped",[1488]],[[8502,8502],"mapped",[1489]],[[8503,8503],"mapped",[1490]],[[8504,8504],"mapped",[1491]],[[8505,8505],"mapped",[105]],[[8506,8506],"valid",[],"NV8"],[[8507,8507],"mapped",[102,97,120]],[[8508,8508],"mapped",[960]],[[8509,8510],"mapped",[947]],[[8511,8511],"mapped",[960]],[[8512,8512],"mapped",[8721]],[[8513,8516],"valid",[],"NV8"],[[8517,8518],"mapped",[100]],[[8519,8519],"mapped",[101]],[[8520,8520],"mapped",[105]],[[8521,8521],"mapped",[106]],[[8522,8523],"valid",[],"NV8"],[[8524,8524],"valid",[],"NV8"],[[8525,8525],"valid",[],"NV8"],[[8526,8526],"valid"],[[8527,8527],"valid",[],"NV8"],[[8528,8528],"mapped",[49,8260,55]],[[8529,8529],"mapped",[49,8260,57]],[[8530,8530],"mapped",[49,8260,49,48]],[[8531,8531],"mapped",[49,8260,51]],[[8532,8532],"mapped",[50,8260,51]],[[8533,8533],"mapped",[49,8260,53]],[[8534,8534],"mapped",[50,8260,53]],[[8535,8535],"mapped",[51,8260,53]],[[8536,8536],"mapped",[52,8260,53]],[[8537,8537],"mapped",[49,8260,54]],[[8538,8538],"mapped",[53,8260,54]],[[8539,8539],"mapped",[49,8260,56]],[[8540,8540],"mapped",[51,8260,56]],[[8541,8541],"mapped",[53,8260,56]],[[8542,8542],"mapped",[55,8260,56]],[[8543,8543],"mapped",[49,8260]],[[8544,8544],"mapped",[105]],[[8545,8545],"mapped",[105,105]],[[8546,8546],"mapped",[105,105,105]],[[8547,8547],"mapped",[105,118]],[[8548,8548],"mapped",[118]],[[8549,8549],"mapped",[118,105]],[[8550,8550],"mapped",[118,105,105]],[[8551,8551],"mapped",[118,105,105,105]],[[8552,8552],"mapped",[105,120]],[[8553,8553],"mapped",[120]],[[8554,8554],"mapped",[120,105]],[[8555,8555],"mapped",[120,105,105]],[[8556,8556],"mapped",[108]],[[8557,8557],"mapped",[99]],[[8558,8558],"mapped",[100]],[[8559,8559],"mapped",[109]],[[8560,8560],"mapped",[105]],[[8561,8561],"mapped",[105,105]],[[8562,8562],"mapped",[105,105,105]],[[8563,8563],"mapped",[105,118]],[[8564,8564],"mapped",[118]],[[8565,8565],"mapped",[118,105]],[[8566,8566],"mapped",[118,105,105]],[[8567,8567],"mapped",[118,105,105,105]],[[8568,8568],"mapped",[105,120]],[[8569,8569],"mapped",[120]],[[8570,8570],"mapped",[120,105]],[[8571,8571],"mapped",[120,105,105]],[[8572,8572],"mapped",[108]],[[8573,8573],"mapped",[99]],[[8574,8574],"mapped",[100]],[[8575,8575],"mapped",[109]],[[8576,8578],"valid",[],"NV8"],[[8579,8579],"disallowed"],[[8580,8580],"valid"],[[8581,8584],"valid",[],"NV8"],[[8585,8585],"mapped",[48,8260,51]],[[8586,8587],"valid",[],"NV8"],[[8588,8591],"disallowed"],[[8592,8682],"valid",[],"NV8"],[[8683,8691],"valid",[],"NV8"],[[8692,8703],"valid",[],"NV8"],[[8704,8747],"valid",[],"NV8"],[[8748,8748],"mapped",[8747,8747]],[[8749,8749],"mapped",[8747,8747,8747]],[[8750,8750],"valid",[],"NV8"],[[8751,8751],"mapped",[8750,8750]],[[8752,8752],"mapped",[8750,8750,8750]],[[8753,8799],"valid",[],"NV8"],[[8800,8800],"disallowed_STD3_valid"],[[8801,8813],"valid",[],"NV8"],[[8814,8815],"disallowed_STD3_valid"],[[8816,8945],"valid",[],"NV8"],[[8946,8959],"valid",[],"NV8"],[[8960,8960],"valid",[],"NV8"],[[8961,8961],"valid",[],"NV8"],[[8962,9000],"valid",[],"NV8"],[[9001,9001],"mapped",[12296]],[[9002,9002],"mapped",[12297]],[[9003,9082],"valid",[],"NV8"],[[9083,9083],"valid",[],"NV8"],[[9084,9084],"valid",[],"NV8"],[[9085,9114],"valid",[],"NV8"],[[9115,9166],"valid",[],"NV8"],[[9167,9168],"valid",[],"NV8"],[[9169,9179],"valid",[],"NV8"],[[9180,9191],"valid",[],"NV8"],[[9192,9192],"valid",[],"NV8"],[[9193,9203],"valid",[],"NV8"],[[9204,9210],"valid",[],"NV8"],[[9211,9215],"disallowed"],[[9216,9252],"valid",[],"NV8"],[[9253,9254],"valid",[],"NV8"],[[9255,9279],"disallowed"],[[9280,9290],"valid",[],"NV8"],[[9291,9311],"disallowed"],[[9312,9312],"mapped",[49]],[[9313,9313],"mapped",[50]],[[9314,9314],"mapped",[51]],[[9315,9315],"mapped",[52]],[[9316,9316],"mapped",[53]],[[9317,9317],"mapped",[54]],[[9318,9318],"mapped",[55]],[[9319,9319],"mapped",[56]],[[9320,9320],"mapped",[57]],[[9321,9321],"mapped",[49,48]],[[9322,9322],"mapped",[49,49]],[[9323,9323],"mapped",[49,50]],[[9324,9324],"mapped",[49,51]],[[9325,9325],"mapped",[49,52]],[[9326,9326],"mapped",[49,53]],[[9327,9327],"mapped",[49,54]],[[9328,9328],"mapped",[49,55]],[[9329,9329],"mapped",[49,56]],[[9330,9330],"mapped",[49,57]],[[9331,9331],"mapped",[50,48]],[[9332,9332],"disallowed_STD3_mapped",[40,49,41]],[[9333,9333],"disallowed_STD3_mapped",[40,50,41]],[[9334,9334],"disallowed_STD3_mapped",[40,51,41]],[[9335,9335],"disallowed_STD3_mapped",[40,52,41]],[[9336,9336],"disallowed_STD3_mapped",[40,53,41]],[[9337,9337],"disallowed_STD3_mapped",[40,54,41]],[[9338,9338],"disallowed_STD3_mapped",[40,55,41]],[[9339,9339],"disallowed_STD3_mapped",[40,56,41]],[[9340,9340],"disallowed_STD3_mapped",[40,57,41]],[[9341,9341],"disallowed_STD3_mapped",[40,49,48,41]],[[9342,9342],"disallowed_STD3_mapped",[40,49,49,41]],[[9343,9343],"disallowed_STD3_mapped",[40,49,50,41]],[[9344,9344],"disallowed_STD3_mapped",[40,49,51,41]],[[9345,9345],"disallowed_STD3_mapped",[40,49,52,41]],[[9346,9346],"disallowed_STD3_mapped",[40,49,53,41]],[[9347,9347],"disallowed_STD3_mapped",[40,49,54,41]],[[9348,9348],"disallowed_STD3_mapped",[40,49,55,41]],[[9349,9349],"disallowed_STD3_mapped",[40,49,56,41]],[[9350,9350],"disallowed_STD3_mapped",[40,49,57,41]],[[9351,9351],"disallowed_STD3_mapped",[40,50,48,41]],[[9352,9371],"disallowed"],[[9372,9372],"disallowed_STD3_mapped",[40,97,41]],[[9373,9373],"disallowed_STD3_mapped",[40,98,41]],[[9374,9374],"disallowed_STD3_mapped",[40,99,41]],[[9375,9375],"disallowed_STD3_mapped",[40,100,41]],[[9376,9376],"disallowed_STD3_mapped",[40,101,41]],[[9377,9377],"disallowed_STD3_mapped",[40,102,41]],[[9378,9378],"disallowed_STD3_mapped",[40,103,41]],[[9379,9379],"disallowed_STD3_mapped",[40,104,41]],[[9380,9380],"disallowed_STD3_mapped",[40,105,41]],[[9381,9381],"disallowed_STD3_mapped",[40,106,41]],[[9382,9382],"disallowed_STD3_mapped",[40,107,41]],[[9383,9383],"disallowed_STD3_mapped",[40,108,41]],[[9384,9384],"disallowed_STD3_mapped",[40,109,41]],[[9385,9385],"disallowed_STD3_mapped",[40,110,41]],[[9386,9386],"disallowed_STD3_mapped",[40,111,41]],[[9387,9387],"disallowed_STD3_mapped",[40,112,41]],[[9388,9388],"disallowed_STD3_mapped",[40,113,41]],[[9389,9389],"disallowed_STD3_mapped",[40,114,41]],[[9390,9390],"disallowed_STD3_mapped",[40,115,41]],[[9391,9391],"disallowed_STD3_mapped",[40,116,41]],[[9392,9392],"disallowed_STD3_mapped",[40,117,41]],[[9393,9393],"disallowed_STD3_mapped",[40,118,41]],[[9394,9394],"disallowed_STD3_mapped",[40,119,41]],[[9395,9395],"disallowed_STD3_mapped",[40,120,41]],[[9396,9396],"disallowed_STD3_mapped",[40,121,41]],[[9397,9397],"disallowed_STD3_mapped",[40,122,41]],[[9398,9398],"mapped",[97]],[[9399,9399],"mapped",[98]],[[9400,9400],"mapped",[99]],[[9401,9401],"mapped",[100]],[[9402,9402],"mapped",[101]],[[9403,9403],"mapped",[102]],[[9404,9404],"mapped",[103]],[[9405,9405],"mapped",[104]],[[9406,9406],"mapped",[105]],[[9407,9407],"mapped",[106]],[[9408,9408],"mapped",[107]],[[9409,9409],"mapped",[108]],[[9410,9410],"mapped",[109]],[[9411,9411],"mapped",[110]],[[9412,9412],"mapped",[111]],[[9413,9413],"mapped",[112]],[[9414,9414],"mapped",[113]],[[9415,9415],"mapped",[114]],[[9416,9416],"mapped",[115]],[[9417,9417],"mapped",[116]],[[9418,9418],"mapped",[117]],[[9419,9419],"mapped",[118]],[[9420,9420],"mapped",[119]],[[9421,9421],"mapped",[120]],[[9422,9422],"mapped",[121]],[[9423,9423],"mapped",[122]],[[9424,9424],"mapped",[97]],[[9425,9425],"mapped",[98]],[[9426,9426],"mapped",[99]],[[9427,9427],"mapped",[100]],[[9428,9428],"mapped",[101]],[[9429,9429],"mapped",[102]],[[9430,9430],"mapped",[103]],[[9431,9431],"mapped",[104]],[[9432,9432],"mapped",[105]],[[9433,9433],"mapped",[106]],[[9434,9434],"mapped",[107]],[[9435,9435],"mapped",[108]],[[9436,9436],"mapped",[109]],[[9437,9437],"mapped",[110]],[[9438,9438],"mapped",[111]],[[9439,9439],"mapped",[112]],[[9440,9440],"mapped",[113]],[[9441,9441],"mapped",[114]],[[9442,9442],"mapped",[115]],[[9443,9443],"mapped",[116]],[[9444,9444],"mapped",[117]],[[9445,9445],"mapped",[118]],[[9446,9446],"mapped",[119]],[[9447,9447],"mapped",[120]],[[9448,9448],"mapped",[121]],[[9449,9449],"mapped",[122]],[[9450,9450],"mapped",[48]],[[9451,9470],"valid",[],"NV8"],[[9471,9471],"valid",[],"NV8"],[[9472,9621],"valid",[],"NV8"],[[9622,9631],"valid",[],"NV8"],[[9632,9711],"valid",[],"NV8"],[[9712,9719],"valid",[],"NV8"],[[9720,9727],"valid",[],"NV8"],[[9728,9747],"valid",[],"NV8"],[[9748,9749],"valid",[],"NV8"],[[9750,9751],"valid",[],"NV8"],[[9752,9752],"valid",[],"NV8"],[[9753,9753],"valid",[],"NV8"],[[9754,9839],"valid",[],"NV8"],[[9840,9841],"valid",[],"NV8"],[[9842,9853],"valid",[],"NV8"],[[9854,9855],"valid",[],"NV8"],[[9856,9865],"valid",[],"NV8"],[[9866,9873],"valid",[],"NV8"],[[9874,9884],"valid",[],"NV8"],[[9885,9885],"valid",[],"NV8"],[[9886,9887],"valid",[],"NV8"],[[9888,9889],"valid",[],"NV8"],[[9890,9905],"valid",[],"NV8"],[[9906,9906],"valid",[],"NV8"],[[9907,9916],"valid",[],"NV8"],[[9917,9919],"valid",[],"NV8"],[[9920,9923],"valid",[],"NV8"],[[9924,9933],"valid",[],"NV8"],[[9934,9934],"valid",[],"NV8"],[[9935,9953],"valid",[],"NV8"],[[9954,9954],"valid",[],"NV8"],[[9955,9955],"valid",[],"NV8"],[[9956,9959],"valid",[],"NV8"],[[9960,9983],"valid",[],"NV8"],[[9984,9984],"valid",[],"NV8"],[[9985,9988],"valid",[],"NV8"],[[9989,9989],"valid",[],"NV8"],[[9990,9993],"valid",[],"NV8"],[[9994,9995],"valid",[],"NV8"],[[9996,10023],"valid",[],"NV8"],[[10024,10024],"valid",[],"NV8"],[[10025,10059],"valid",[],"NV8"],[[10060,10060],"valid",[],"NV8"],[[10061,10061],"valid",[],"NV8"],[[10062,10062],"valid",[],"NV8"],[[10063,10066],"valid",[],"NV8"],[[10067,10069],"valid",[],"NV8"],[[10070,10070],"valid",[],"NV8"],[[10071,10071],"valid",[],"NV8"],[[10072,10078],"valid",[],"NV8"],[[10079,10080],"valid",[],"NV8"],[[10081,10087],"valid",[],"NV8"],[[10088,10101],"valid",[],"NV8"],[[10102,10132],"valid",[],"NV8"],[[10133,10135],"valid",[],"NV8"],[[10136,10159],"valid",[],"NV8"],[[10160,10160],"valid",[],"NV8"],[[10161,10174],"valid",[],"NV8"],[[10175,10175],"valid",[],"NV8"],[[10176,10182],"valid",[],"NV8"],[[10183,10186],"valid",[],"NV8"],[[10187,10187],"valid",[],"NV8"],[[10188,10188],"valid",[],"NV8"],[[10189,10189],"valid",[],"NV8"],[[10190,10191],"valid",[],"NV8"],[[10192,10219],"valid",[],"NV8"],[[10220,10223],"valid",[],"NV8"],[[10224,10239],"valid",[],"NV8"],[[10240,10495],"valid",[],"NV8"],[[10496,10763],"valid",[],"NV8"],[[10764,10764],"mapped",[8747,8747,8747,8747]],[[10765,10867],"valid",[],"NV8"],[[10868,10868],"disallowed_STD3_mapped",[58,58,61]],[[10869,10869],"disallowed_STD3_mapped",[61,61]],[[10870,10870],"disallowed_STD3_mapped",[61,61,61]],[[10871,10971],"valid",[],"NV8"],[[10972,10972],"mapped",[10973,824]],[[10973,11007],"valid",[],"NV8"],[[11008,11021],"valid",[],"NV8"],[[11022,11027],"valid",[],"NV8"],[[11028,11034],"valid",[],"NV8"],[[11035,11039],"valid",[],"NV8"],[[11040,11043],"valid",[],"NV8"],[[11044,11084],"valid",[],"NV8"],[[11085,11087],"valid",[],"NV8"],[[11088,11092],"valid",[],"NV8"],[[11093,11097],"valid",[],"NV8"],[[11098,11123],"valid",[],"NV8"],[[11124,11125],"disallowed"],[[11126,11157],"valid",[],"NV8"],[[11158,11159],"disallowed"],[[11160,11193],"valid",[],"NV8"],[[11194,11196],"disallowed"],[[11197,11208],"valid",[],"NV8"],[[11209,11209],"disallowed"],[[11210,11217],"valid",[],"NV8"],[[11218,11243],"disallowed"],[[11244,11247],"valid",[],"NV8"],[[11248,11263],"disallowed"],[[11264,11264],"mapped",[11312]],[[11265,11265],"mapped",[11313]],[[11266,11266],"mapped",[11314]],[[11267,11267],"mapped",[11315]],[[11268,11268],"mapped",[11316]],[[11269,11269],"mapped",[11317]],[[11270,11270],"mapped",[11318]],[[11271,11271],"mapped",[11319]],[[11272,11272],"mapped",[11320]],[[11273,11273],"mapped",[11321]],[[11274,11274],"mapped",[11322]],[[11275,11275],"mapped",[11323]],[[11276,11276],"mapped",[11324]],[[11277,11277],"mapped",[11325]],[[11278,11278],"mapped",[11326]],[[11279,11279],"mapped",[11327]],[[11280,11280],"mapped",[11328]],[[11281,11281],"mapped",[11329]],[[11282,11282],"mapped",[11330]],[[11283,11283],"mapped",[11331]],[[11284,11284],"mapped",[11332]],[[11285,11285],"mapped",[11333]],[[11286,11286],"mapped",[11334]],[[11287,11287],"mapped",[11335]],[[11288,11288],"mapped",[11336]],[[11289,11289],"mapped",[11337]],[[11290,11290],"mapped",[11338]],[[11291,11291],"mapped",[11339]],[[11292,11292],"mapped",[11340]],[[11293,11293],"mapped",[11341]],[[11294,11294],"mapped",[11342]],[[11295,11295],"mapped",[11343]],[[11296,11296],"mapped",[11344]],[[11297,11297],"mapped",[11345]],[[11298,11298],"mapped",[11346]],[[11299,11299],"mapped",[11347]],[[11300,11300],"mapped",[11348]],[[11301,11301],"mapped",[11349]],[[11302,11302],"mapped",[11350]],[[11303,11303],"mapped",[11351]],[[11304,11304],"mapped",[11352]],[[11305,11305],"mapped",[11353]],[[11306,11306],"mapped",[11354]],[[11307,11307],"mapped",[11355]],[[11308,11308],"mapped",[11356]],[[11309,11309],"mapped",[11357]],[[11310,11310],"mapped",[11358]],[[11311,11311],"disallowed"],[[11312,11358],"valid"],[[11359,11359],"disallowed"],[[11360,11360],"mapped",[11361]],[[11361,11361],"valid"],[[11362,11362],"mapped",[619]],[[11363,11363],"mapped",[7549]],[[11364,11364],"mapped",[637]],[[11365,11366],"valid"],[[11367,11367],"mapped",[11368]],[[11368,11368],"valid"],[[11369,11369],"mapped",[11370]],[[11370,11370],"valid"],[[11371,11371],"mapped",[11372]],[[11372,11372],"valid"],[[11373,11373],"mapped",[593]],[[11374,11374],"mapped",[625]],[[11375,11375],"mapped",[592]],[[11376,11376],"mapped",[594]],[[11377,11377],"valid"],[[11378,11378],"mapped",[11379]],[[11379,11379],"valid"],[[11380,11380],"valid"],[[11381,11381],"mapped",[11382]],[[11382,11383],"valid"],[[11384,11387],"valid"],[[11388,11388],"mapped",[106]],[[11389,11389],"mapped",[118]],[[11390,11390],"mapped",[575]],[[11391,11391],"mapped",[576]],[[11392,11392],"mapped",[11393]],[[11393,11393],"valid"],[[11394,11394],"mapped",[11395]],[[11395,11395],"valid"],[[11396,11396],"mapped",[11397]],[[11397,11397],"valid"],[[11398,11398],"mapped",[11399]],[[11399,11399],"valid"],[[11400,11400],"mapped",[11401]],[[11401,11401],"valid"],[[11402,11402],"mapped",[11403]],[[11403,11403],"valid"],[[11404,11404],"mapped",[11405]],[[11405,11405],"valid"],[[11406,11406],"mapped",[11407]],[[11407,11407],"valid"],[[11408,11408],"mapped",[11409]],[[11409,11409],"valid"],[[11410,11410],"mapped",[11411]],[[11411,11411],"valid"],[[11412,11412],"mapped",[11413]],[[11413,11413],"valid"],[[11414,11414],"mapped",[11415]],[[11415,11415],"valid"],[[11416,11416],"mapped",[11417]],[[11417,11417],"valid"],[[11418,11418],"mapped",[11419]],[[11419,11419],"valid"],[[11420,11420],"mapped",[11421]],[[11421,11421],"valid"],[[11422,11422],"mapped",[11423]],[[11423,11423],"valid"],[[11424,11424],"mapped",[11425]],[[11425,11425],"valid"],[[11426,11426],"mapped",[11427]],[[11427,11427],"valid"],[[11428,11428],"mapped",[11429]],[[11429,11429],"valid"],[[11430,11430],"mapped",[11431]],[[11431,11431],"valid"],[[11432,11432],"mapped",[11433]],[[11433,11433],"valid"],[[11434,11434],"mapped",[11435]],[[11435,11435],"valid"],[[11436,11436],"mapped",[11437]],[[11437,11437],"valid"],[[11438,11438],"mapped",[11439]],[[11439,11439],"valid"],[[11440,11440],"mapped",[11441]],[[11441,11441],"valid"],[[11442,11442],"mapped",[11443]],[[11443,11443],"valid"],[[11444,11444],"mapped",[11445]],[[11445,11445],"valid"],[[11446,11446],"mapped",[11447]],[[11447,11447],"valid"],[[11448,11448],"mapped",[11449]],[[11449,11449],"valid"],[[11450,11450],"mapped",[11451]],[[11451,11451],"valid"],[[11452,11452],"mapped",[11453]],[[11453,11453],"valid"],[[11454,11454],"mapped",[11455]],[[11455,11455],"valid"],[[11456,11456],"mapped",[11457]],[[11457,11457],"valid"],[[11458,11458],"mapped",[11459]],[[11459,11459],"valid"],[[11460,11460],"mapped",[11461]],[[11461,11461],"valid"],[[11462,11462],"mapped",[11463]],[[11463,11463],"valid"],[[11464,11464],"mapped",[11465]],[[11465,11465],"valid"],[[11466,11466],"mapped",[11467]],[[11467,11467],"valid"],[[11468,11468],"mapped",[11469]],[[11469,11469],"valid"],[[11470,11470],"mapped",[11471]],[[11471,11471],"valid"],[[11472,11472],"mapped",[11473]],[[11473,11473],"valid"],[[11474,11474],"mapped",[11475]],[[11475,11475],"valid"],[[11476,11476],"mapped",[11477]],[[11477,11477],"valid"],[[11478,11478],"mapped",[11479]],[[11479,11479],"valid"],[[11480,11480],"mapped",[11481]],[[11481,11481],"valid"],[[11482,11482],"mapped",[11483]],[[11483,11483],"valid"],[[11484,11484],"mapped",[11485]],[[11485,11485],"valid"],[[11486,11486],"mapped",[11487]],[[11487,11487],"valid"],[[11488,11488],"mapped",[11489]],[[11489,11489],"valid"],[[11490,11490],"mapped",[11491]],[[11491,11492],"valid"],[[11493,11498],"valid",[],"NV8"],[[11499,11499],"mapped",[11500]],[[11500,11500],"valid"],[[11501,11501],"mapped",[11502]],[[11502,11505],"valid"],[[11506,11506],"mapped",[11507]],[[11507,11507],"valid"],[[11508,11512],"disallowed"],[[11513,11519],"valid",[],"NV8"],[[11520,11557],"valid"],[[11558,11558],"disallowed"],[[11559,11559],"valid"],[[11560,11564],"disallowed"],[[11565,11565],"valid"],[[11566,11567],"disallowed"],[[11568,11621],"valid"],[[11622,11623],"valid"],[[11624,11630],"disallowed"],[[11631,11631],"mapped",[11617]],[[11632,11632],"valid",[],"NV8"],[[11633,11646],"disallowed"],[[11647,11647],"valid"],[[11648,11670],"valid"],[[11671,11679],"disallowed"],[[11680,11686],"valid"],[[11687,11687],"disallowed"],[[11688,11694],"valid"],[[11695,11695],"disallowed"],[[11696,11702],"valid"],[[11703,11703],"disallowed"],[[11704,11710],"valid"],[[11711,11711],"disallowed"],[[11712,11718],"valid"],[[11719,11719],"disallowed"],[[11720,11726],"valid"],[[11727,11727],"disallowed"],[[11728,11734],"valid"],[[11735,11735],"disallowed"],[[11736,11742],"valid"],[[11743,11743],"disallowed"],[[11744,11775],"valid"],[[11776,11799],"valid",[],"NV8"],[[11800,11803],"valid",[],"NV8"],[[11804,11805],"valid",[],"NV8"],[[11806,11822],"valid",[],"NV8"],[[11823,11823],"valid"],[[11824,11824],"valid",[],"NV8"],[[11825,11825],"valid",[],"NV8"],[[11826,11835],"valid",[],"NV8"],[[11836,11842],"valid",[],"NV8"],[[11843,11903],"disallowed"],[[11904,11929],"valid",[],"NV8"],[[11930,11930],"disallowed"],[[11931,11934],"valid",[],"NV8"],[[11935,11935],"mapped",[27597]],[[11936,12018],"valid",[],"NV8"],[[12019,12019],"mapped",[40863]],[[12020,12031],"disallowed"],[[12032,12032],"mapped",[19968]],[[12033,12033],"mapped",[20008]],[[12034,12034],"mapped",[20022]],[[12035,12035],"mapped",[20031]],[[12036,12036],"mapped",[20057]],[[12037,12037],"mapped",[20101]],[[12038,12038],"mapped",[20108]],[[12039,12039],"mapped",[20128]],[[12040,12040],"mapped",[20154]],[[12041,12041],"mapped",[20799]],[[12042,12042],"mapped",[20837]],[[12043,12043],"mapped",[20843]],[[12044,12044],"mapped",[20866]],[[12045,12045],"mapped",[20886]],[[12046,12046],"mapped",[20907]],[[12047,12047],"mapped",[20960]],[[12048,12048],"mapped",[20981]],[[12049,12049],"mapped",[20992]],[[12050,12050],"mapped",[21147]],[[12051,12051],"mapped",[21241]],[[12052,12052],"mapped",[21269]],[[12053,12053],"mapped",[21274]],[[12054,12054],"mapped",[21304]],[[12055,12055],"mapped",[21313]],[[12056,12056],"mapped",[21340]],[[12057,12057],"mapped",[21353]],[[12058,12058],"mapped",[21378]],[[12059,12059],"mapped",[21430]],[[12060,12060],"mapped",[21448]],[[12061,12061],"mapped",[21475]],[[12062,12062],"mapped",[22231]],[[12063,12063],"mapped",[22303]],[[12064,12064],"mapped",[22763]],[[12065,12065],"mapped",[22786]],[[12066,12066],"mapped",[22794]],[[12067,12067],"mapped",[22805]],[[12068,12068],"mapped",[22823]],[[12069,12069],"mapped",[22899]],[[12070,12070],"mapped",[23376]],[[12071,12071],"mapped",[23424]],[[12072,12072],"mapped",[23544]],[[12073,12073],"mapped",[23567]],[[12074,12074],"mapped",[23586]],[[12075,12075],"mapped",[23608]],[[12076,12076],"mapped",[23662]],[[12077,12077],"mapped",[23665]],[[12078,12078],"mapped",[24027]],[[12079,12079],"mapped",[24037]],[[12080,12080],"mapped",[24049]],[[12081,12081],"mapped",[24062]],[[12082,12082],"mapped",[24178]],[[12083,12083],"mapped",[24186]],[[12084,12084],"mapped",[24191]],[[12085,12085],"mapped",[24308]],[[12086,12086],"mapped",[24318]],[[12087,12087],"mapped",[24331]],[[12088,12088],"mapped",[24339]],[[12089,12089],"mapped",[24400]],[[12090,12090],"mapped",[24417]],[[12091,12091],"mapped",[24435]],[[12092,12092],"mapped",[24515]],[[12093,12093],"mapped",[25096]],[[12094,12094],"mapped",[25142]],[[12095,12095],"mapped",[25163]],[[12096,12096],"mapped",[25903]],[[12097,12097],"mapped",[25908]],[[12098,12098],"mapped",[25991]],[[12099,12099],"mapped",[26007]],[[12100,12100],"mapped",[26020]],[[12101,12101],"mapped",[26041]],[[12102,12102],"mapped",[26080]],[[12103,12103],"mapped",[26085]],[[12104,12104],"mapped",[26352]],[[12105,12105],"mapped",[26376]],[[12106,12106],"mapped",[26408]],[[12107,12107],"mapped",[27424]],[[12108,12108],"mapped",[27490]],[[12109,12109],"mapped",[27513]],[[12110,12110],"mapped",[27571]],[[12111,12111],"mapped",[27595]],[[12112,12112],"mapped",[27604]],[[12113,12113],"mapped",[27611]],[[12114,12114],"mapped",[27663]],[[12115,12115],"mapped",[27668]],[[12116,12116],"mapped",[27700]],[[12117,12117],"mapped",[28779]],[[12118,12118],"mapped",[29226]],[[12119,12119],"mapped",[29238]],[[12120,12120],"mapped",[29243]],[[12121,12121],"mapped",[29247]],[[12122,12122],"mapped",[29255]],[[12123,12123],"mapped",[29273]],[[12124,12124],"mapped",[29275]],[[12125,12125],"mapped",[29356]],[[12126,12126],"mapped",[29572]],[[12127,12127],"mapped",[29577]],[[12128,12128],"mapped",[29916]],[[12129,12129],"mapped",[29926]],[[12130,12130],"mapped",[29976]],[[12131,12131],"mapped",[29983]],[[12132,12132],"mapped",[29992]],[[12133,12133],"mapped",[30000]],[[12134,12134],"mapped",[30091]],[[12135,12135],"mapped",[30098]],[[12136,12136],"mapped",[30326]],[[12137,12137],"mapped",[30333]],[[12138,12138],"mapped",[30382]],[[12139,12139],"mapped",[30399]],[[12140,12140],"mapped",[30446]],[[12141,12141],"mapped",[30683]],[[12142,12142],"mapped",[30690]],[[12143,12143],"mapped",[30707]],[[12144,12144],"mapped",[31034]],[[12145,12145],"mapped",[31160]],[[12146,12146],"mapped",[31166]],[[12147,12147],"mapped",[31348]],[[12148,12148],"mapped",[31435]],[[12149,12149],"mapped",[31481]],[[12150,12150],"mapped",[31859]],[[12151,12151],"mapped",[31992]],[[12152,12152],"mapped",[32566]],[[12153,12153],"mapped",[32593]],[[12154,12154],"mapped",[32650]],[[12155,12155],"mapped",[32701]],[[12156,12156],"mapped",[32769]],[[12157,12157],"mapped",[32780]],[[12158,12158],"mapped",[32786]],[[12159,12159],"mapped",[32819]],[[12160,12160],"mapped",[32895]],[[12161,12161],"mapped",[32905]],[[12162,12162],"mapped",[33251]],[[12163,12163],"mapped",[33258]],[[12164,12164],"mapped",[33267]],[[12165,12165],"mapped",[33276]],[[12166,12166],"mapped",[33292]],[[12167,12167],"mapped",[33307]],[[12168,12168],"mapped",[33311]],[[12169,12169],"mapped",[33390]],[[12170,12170],"mapped",[33394]],[[12171,12171],"mapped",[33400]],[[12172,12172],"mapped",[34381]],[[12173,12173],"mapped",[34411]],[[12174,12174],"mapped",[34880]],[[12175,12175],"mapped",[34892]],[[12176,12176],"mapped",[34915]],[[12177,12177],"mapped",[35198]],[[12178,12178],"mapped",[35211]],[[12179,12179],"mapped",[35282]],[[12180,12180],"mapped",[35328]],[[12181,12181],"mapped",[35895]],[[12182,12182],"mapped",[35910]],[[12183,12183],"mapped",[35925]],[[12184,12184],"mapped",[35960]],[[12185,12185],"mapped",[35997]],[[12186,12186],"mapped",[36196]],[[12187,12187],"mapped",[36208]],[[12188,12188],"mapped",[36275]],[[12189,12189],"mapped",[36523]],[[12190,12190],"mapped",[36554]],[[12191,12191],"mapped",[36763]],[[12192,12192],"mapped",[36784]],[[12193,12193],"mapped",[36789]],[[12194,12194],"mapped",[37009]],[[12195,12195],"mapped",[37193]],[[12196,12196],"mapped",[37318]],[[12197,12197],"mapped",[37324]],[[12198,12198],"mapped",[37329]],[[12199,12199],"mapped",[38263]],[[12200,12200],"mapped",[38272]],[[12201,12201],"mapped",[38428]],[[12202,12202],"mapped",[38582]],[[12203,12203],"mapped",[38585]],[[12204,12204],"mapped",[38632]],[[12205,12205],"mapped",[38737]],[[12206,12206],"mapped",[38750]],[[12207,12207],"mapped",[38754]],[[12208,12208],"mapped",[38761]],[[12209,12209],"mapped",[38859]],[[12210,12210],"mapped",[38893]],[[12211,12211],"mapped",[38899]],[[12212,12212],"mapped",[38913]],[[12213,12213],"mapped",[39080]],[[12214,12214],"mapped",[39131]],[[12215,12215],"mapped",[39135]],[[12216,12216],"mapped",[39318]],[[12217,12217],"mapped",[39321]],[[12218,12218],"mapped",[39340]],[[12219,12219],"mapped",[39592]],[[12220,12220],"mapped",[39640]],[[12221,12221],"mapped",[39647]],[[12222,12222],"mapped",[39717]],[[12223,12223],"mapped",[39727]],[[12224,12224],"mapped",[39730]],[[12225,12225],"mapped",[39740]],[[12226,12226],"mapped",[39770]],[[12227,12227],"mapped",[40165]],[[12228,12228],"mapped",[40565]],[[12229,12229],"mapped",[40575]],[[12230,12230],"mapped",[40613]],[[12231,12231],"mapped",[40635]],[[12232,12232],"mapped",[40643]],[[12233,12233],"mapped",[40653]],[[12234,12234],"mapped",[40657]],[[12235,12235],"mapped",[40697]],[[12236,12236],"mapped",[40701]],[[12237,12237],"mapped",[40718]],[[12238,12238],"mapped",[40723]],[[12239,12239],"mapped",[40736]],[[12240,12240],"mapped",[40763]],[[12241,12241],"mapped",[40778]],[[12242,12242],"mapped",[40786]],[[12243,12243],"mapped",[40845]],[[12244,12244],"mapped",[40860]],[[12245,12245],"mapped",[40864]],[[12246,12271],"disallowed"],[[12272,12283],"disallowed"],[[12284,12287],"disallowed"],[[12288,12288],"disallowed_STD3_mapped",[32]],[[12289,12289],"valid",[],"NV8"],[[12290,12290],"mapped",[46]],[[12291,12292],"valid",[],"NV8"],[[12293,12295],"valid"],[[12296,12329],"valid",[],"NV8"],[[12330,12333],"valid"],[[12334,12341],"valid",[],"NV8"],[[12342,12342],"mapped",[12306]],[[12343,12343],"valid",[],"NV8"],[[12344,12344],"mapped",[21313]],[[12345,12345],"mapped",[21316]],[[12346,12346],"mapped",[21317]],[[12347,12347],"valid",[],"NV8"],[[12348,12348],"valid"],[[12349,12349],"valid",[],"NV8"],[[12350,12350],"valid",[],"NV8"],[[12351,12351],"valid",[],"NV8"],[[12352,12352],"disallowed"],[[12353,12436],"valid"],[[12437,12438],"valid"],[[12439,12440],"disallowed"],[[12441,12442],"valid"],[[12443,12443],"disallowed_STD3_mapped",[32,12441]],[[12444,12444],"disallowed_STD3_mapped",[32,12442]],[[12445,12446],"valid"],[[12447,12447],"mapped",[12424,12426]],[[12448,12448],"valid",[],"NV8"],[[12449,12542],"valid"],[[12543,12543],"mapped",[12467,12488]],[[12544,12548],"disallowed"],[[12549,12588],"valid"],[[12589,12589],"valid"],[[12590,12592],"disallowed"],[[12593,12593],"mapped",[4352]],[[12594,12594],"mapped",[4353]],[[12595,12595],"mapped",[4522]],[[12596,12596],"mapped",[4354]],[[12597,12597],"mapped",[4524]],[[12598,12598],"mapped",[4525]],[[12599,12599],"mapped",[4355]],[[12600,12600],"mapped",[4356]],[[12601,12601],"mapped",[4357]],[[12602,12602],"mapped",[4528]],[[12603,12603],"mapped",[4529]],[[12604,12604],"mapped",[4530]],[[12605,12605],"mapped",[4531]],[[12606,12606],"mapped",[4532]],[[12607,12607],"mapped",[4533]],[[12608,12608],"mapped",[4378]],[[12609,12609],"mapped",[4358]],[[12610,12610],"mapped",[4359]],[[12611,12611],"mapped",[4360]],[[12612,12612],"mapped",[4385]],[[12613,12613],"mapped",[4361]],[[12614,12614],"mapped",[4362]],[[12615,12615],"mapped",[4363]],[[12616,12616],"mapped",[4364]],[[12617,12617],"mapped",[4365]],[[12618,12618],"mapped",[4366]],[[12619,12619],"mapped",[4367]],[[12620,12620],"mapped",[4368]],[[12621,12621],"mapped",[4369]],[[12622,12622],"mapped",[4370]],[[12623,12623],"mapped",[4449]],[[12624,12624],"mapped",[4450]],[[12625,12625],"mapped",[4451]],[[12626,12626],"mapped",[4452]],[[12627,12627],"mapped",[4453]],[[12628,12628],"mapped",[4454]],[[12629,12629],"mapped",[4455]],[[12630,12630],"mapped",[4456]],[[12631,12631],"mapped",[4457]],[[12632,12632],"mapped",[4458]],[[12633,12633],"mapped",[4459]],[[12634,12634],"mapped",[4460]],[[12635,12635],"mapped",[4461]],[[12636,12636],"mapped",[4462]],[[12637,12637],"mapped",[4463]],[[12638,12638],"mapped",[4464]],[[12639,12639],"mapped",[4465]],[[12640,12640],"mapped",[4466]],[[12641,12641],"mapped",[4467]],[[12642,12642],"mapped",[4468]],[[12643,12643],"mapped",[4469]],[[12644,12644],"disallowed"],[[12645,12645],"mapped",[4372]],[[12646,12646],"mapped",[4373]],[[12647,12647],"mapped",[4551]],[[12648,12648],"mapped",[4552]],[[12649,12649],"mapped",[4556]],[[12650,12650],"mapped",[4558]],[[12651,12651],"mapped",[4563]],[[12652,12652],"mapped",[4567]],[[12653,12653],"mapped",[4569]],[[12654,12654],"mapped",[4380]],[[12655,12655],"mapped",[4573]],[[12656,12656],"mapped",[4575]],[[12657,12657],"mapped",[4381]],[[12658,12658],"mapped",[4382]],[[12659,12659],"mapped",[4384]],[[12660,12660],"mapped",[4386]],[[12661,12661],"mapped",[4387]],[[12662,12662],"mapped",[4391]],[[12663,12663],"mapped",[4393]],[[12664,12664],"mapped",[4395]],[[12665,12665],"mapped",[4396]],[[12666,12666],"mapped",[4397]],[[12667,12667],"mapped",[4398]],[[12668,12668],"mapped",[4399]],[[12669,12669],"mapped",[4402]],[[12670,12670],"mapped",[4406]],[[12671,12671],"mapped",[4416]],[[12672,12672],"mapped",[4423]],[[12673,12673],"mapped",[4428]],[[12674,12674],"mapped",[4593]],[[12675,12675],"mapped",[4594]],[[12676,12676],"mapped",[4439]],[[12677,12677],"mapped",[4440]],[[12678,12678],"mapped",[4441]],[[12679,12679],"mapped",[4484]],[[12680,12680],"mapped",[4485]],[[12681,12681],"mapped",[4488]],[[12682,12682],"mapped",[4497]],[[12683,12683],"mapped",[4498]],[[12684,12684],"mapped",[4500]],[[12685,12685],"mapped",[4510]],[[12686,12686],"mapped",[4513]],[[12687,12687],"disallowed"],[[12688,12689],"valid",[],"NV8"],[[12690,12690],"mapped",[19968]],[[12691,12691],"mapped",[20108]],[[12692,12692],"mapped",[19977]],[[12693,12693],"mapped",[22235]],[[12694,12694],"mapped",[19978]],[[12695,12695],"mapped",[20013]],[[12696,12696],"mapped",[19979]],[[12697,12697],"mapped",[30002]],[[12698,12698],"mapped",[20057]],[[12699,12699],"mapped",[19993]],[[12700,12700],"mapped",[19969]],[[12701,12701],"mapped",[22825]],[[12702,12702],"mapped",[22320]],[[12703,12703],"mapped",[20154]],[[12704,12727],"valid"],[[12728,12730],"valid"],[[12731,12735],"disallowed"],[[12736,12751],"valid",[],"NV8"],[[12752,12771],"valid",[],"NV8"],[[12772,12783],"disallowed"],[[12784,12799],"valid"],[[12800,12800],"disallowed_STD3_mapped",[40,4352,41]],[[12801,12801],"disallowed_STD3_mapped",[40,4354,41]],[[12802,12802],"disallowed_STD3_mapped",[40,4355,41]],[[12803,12803],"disallowed_STD3_mapped",[40,4357,41]],[[12804,12804],"disallowed_STD3_mapped",[40,4358,41]],[[12805,12805],"disallowed_STD3_mapped",[40,4359,41]],[[12806,12806],"disallowed_STD3_mapped",[40,4361,41]],[[12807,12807],"disallowed_STD3_mapped",[40,4363,41]],[[12808,12808],"disallowed_STD3_mapped",[40,4364,41]],[[12809,12809],"disallowed_STD3_mapped",[40,4366,41]],[[12810,12810],"disallowed_STD3_mapped",[40,4367,41]],[[12811,12811],"disallowed_STD3_mapped",[40,4368,41]],[[12812,12812],"disallowed_STD3_mapped",[40,4369,41]],[[12813,12813],"disallowed_STD3_mapped",[40,4370,41]],[[12814,12814],"disallowed_STD3_mapped",[40,44032,41]],[[12815,12815],"disallowed_STD3_mapped",[40,45208,41]],[[12816,12816],"disallowed_STD3_mapped",[40,45796,41]],[[12817,12817],"disallowed_STD3_mapped",[40,46972,41]],[[12818,12818],"disallowed_STD3_mapped",[40,47560,41]],[[12819,12819],"disallowed_STD3_mapped",[40,48148,41]],[[12820,12820],"disallowed_STD3_mapped",[40,49324,41]],[[12821,12821],"disallowed_STD3_mapped",[40,50500,41]],[[12822,12822],"disallowed_STD3_mapped",[40,51088,41]],[[12823,12823],"disallowed_STD3_mapped",[40,52264,41]],[[12824,12824],"disallowed_STD3_mapped",[40,52852,41]],[[12825,12825],"disallowed_STD3_mapped",[40,53440,41]],[[12826,12826],"disallowed_STD3_mapped",[40,54028,41]],[[12827,12827],"disallowed_STD3_mapped",[40,54616,41]],[[12828,12828],"disallowed_STD3_mapped",[40,51452,41]],[[12829,12829],"disallowed_STD3_mapped",[40,50724,51204,41]],[[12830,12830],"disallowed_STD3_mapped",[40,50724,54980,41]],[[12831,12831],"disallowed"],[[12832,12832],"disallowed_STD3_mapped",[40,19968,41]],[[12833,12833],"disallowed_STD3_mapped",[40,20108,41]],[[12834,12834],"disallowed_STD3_mapped",[40,19977,41]],[[12835,12835],"disallowed_STD3_mapped",[40,22235,41]],[[12836,12836],"disallowed_STD3_mapped",[40,20116,41]],[[12837,12837],"disallowed_STD3_mapped",[40,20845,41]],[[12838,12838],"disallowed_STD3_mapped",[40,19971,41]],[[12839,12839],"disallowed_STD3_mapped",[40,20843,41]],[[12840,12840],"disallowed_STD3_mapped",[40,20061,41]],[[12841,12841],"disallowed_STD3_mapped",[40,21313,41]],[[12842,12842],"disallowed_STD3_mapped",[40,26376,41]],[[12843,12843],"disallowed_STD3_mapped",[40,28779,41]],[[12844,12844],"disallowed_STD3_mapped",[40,27700,41]],[[12845,12845],"disallowed_STD3_mapped",[40,26408,41]],[[12846,12846],"disallowed_STD3_mapped",[40,37329,41]],[[12847,12847],"disallowed_STD3_mapped",[40,22303,41]],[[12848,12848],"disallowed_STD3_mapped",[40,26085,41]],[[12849,12849],"disallowed_STD3_mapped",[40,26666,41]],[[12850,12850],"disallowed_STD3_mapped",[40,26377,41]],[[12851,12851],"disallowed_STD3_mapped",[40,31038,41]],[[12852,12852],"disallowed_STD3_mapped",[40,21517,41]],[[12853,12853],"disallowed_STD3_mapped",[40,29305,41]],[[12854,12854],"disallowed_STD3_mapped",[40,36001,41]],[[12855,12855],"disallowed_STD3_mapped",[40,31069,41]],[[12856,12856],"disallowed_STD3_mapped",[40,21172,41]],[[12857,12857],"disallowed_STD3_mapped",[40,20195,41]],[[12858,12858],"disallowed_STD3_mapped",[40,21628,41]],[[12859,12859],"disallowed_STD3_mapped",[40,23398,41]],[[12860,12860],"disallowed_STD3_mapped",[40,30435,41]],[[12861,12861],"disallowed_STD3_mapped",[40,20225,41]],[[12862,12862],"disallowed_STD3_mapped",[40,36039,41]],[[12863,12863],"disallowed_STD3_mapped",[40,21332,41]],[[12864,12864],"disallowed_STD3_mapped",[40,31085,41]],[[12865,12865],"disallowed_STD3_mapped",[40,20241,41]],[[12866,12866],"disallowed_STD3_mapped",[40,33258,41]],[[12867,12867],"disallowed_STD3_mapped",[40,33267,41]],[[12868,12868],"mapped",[21839]],[[12869,12869],"mapped",[24188]],[[12870,12870],"mapped",[25991]],[[12871,12871],"mapped",[31631]],[[12872,12879],"valid",[],"NV8"],[[12880,12880],"mapped",[112,116,101]],[[12881,12881],"mapped",[50,49]],[[12882,12882],"mapped",[50,50]],[[12883,12883],"mapped",[50,51]],[[12884,12884],"mapped",[50,52]],[[12885,12885],"mapped",[50,53]],[[12886,12886],"mapped",[50,54]],[[12887,12887],"mapped",[50,55]],[[12888,12888],"mapped",[50,56]],[[12889,12889],"mapped",[50,57]],[[12890,12890],"mapped",[51,48]],[[12891,12891],"mapped",[51,49]],[[12892,12892],"mapped",[51,50]],[[12893,12893],"mapped",[51,51]],[[12894,12894],"mapped",[51,52]],[[12895,12895],"mapped",[51,53]],[[12896,12896],"mapped",[4352]],[[12897,12897],"mapped",[4354]],[[12898,12898],"mapped",[4355]],[[12899,12899],"mapped",[4357]],[[12900,12900],"mapped",[4358]],[[12901,12901],"mapped",[4359]],[[12902,12902],"mapped",[4361]],[[12903,12903],"mapped",[4363]],[[12904,12904],"mapped",[4364]],[[12905,12905],"mapped",[4366]],[[12906,12906],"mapped",[4367]],[[12907,12907],"mapped",[4368]],[[12908,12908],"mapped",[4369]],[[12909,12909],"mapped",[4370]],[[12910,12910],"mapped",[44032]],[[12911,12911],"mapped",[45208]],[[12912,12912],"mapped",[45796]],[[12913,12913],"mapped",[46972]],[[12914,12914],"mapped",[47560]],[[12915,12915],"mapped",[48148]],[[12916,12916],"mapped",[49324]],[[12917,12917],"mapped",[50500]],[[12918,12918],"mapped",[51088]],[[12919,12919],"mapped",[52264]],[[12920,12920],"mapped",[52852]],[[12921,12921],"mapped",[53440]],[[12922,12922],"mapped",[54028]],[[12923,12923],"mapped",[54616]],[[12924,12924],"mapped",[52280,44256]],[[12925,12925],"mapped",[51452,51032]],[[12926,12926],"mapped",[50864]],[[12927,12927],"valid",[],"NV8"],[[12928,12928],"mapped",[19968]],[[12929,12929],"mapped",[20108]],[[12930,12930],"mapped",[19977]],[[12931,12931],"mapped",[22235]],[[12932,12932],"mapped",[20116]],[[12933,12933],"mapped",[20845]],[[12934,12934],"mapped",[19971]],[[12935,12935],"mapped",[20843]],[[12936,12936],"mapped",[20061]],[[12937,12937],"mapped",[21313]],[[12938,12938],"mapped",[26376]],[[12939,12939],"mapped",[28779]],[[12940,12940],"mapped",[27700]],[[12941,12941],"mapped",[26408]],[[12942,12942],"mapped",[37329]],[[12943,12943],"mapped",[22303]],[[12944,12944],"mapped",[26085]],[[12945,12945],"mapped",[26666]],[[12946,12946],"mapped",[26377]],[[12947,12947],"mapped",[31038]],[[12948,12948],"mapped",[21517]],[[12949,12949],"mapped",[29305]],[[12950,12950],"mapped",[36001]],[[12951,12951],"mapped",[31069]],[[12952,12952],"mapped",[21172]],[[12953,12953],"mapped",[31192]],[[12954,12954],"mapped",[30007]],[[12955,12955],"mapped",[22899]],[[12956,12956],"mapped",[36969]],[[12957,12957],"mapped",[20778]],[[12958,12958],"mapped",[21360]],[[12959,12959],"mapped",[27880]],[[12960,12960],"mapped",[38917]],[[12961,12961],"mapped",[20241]],[[12962,12962],"mapped",[20889]],[[12963,12963],"mapped",[27491]],[[12964,12964],"mapped",[19978]],[[12965,12965],"mapped",[20013]],[[12966,12966],"mapped",[19979]],[[12967,12967],"mapped",[24038]],[[12968,12968],"mapped",[21491]],[[12969,12969],"mapped",[21307]],[[12970,12970],"mapped",[23447]],[[12971,12971],"mapped",[23398]],[[12972,12972],"mapped",[30435]],[[12973,12973],"mapped",[20225]],[[12974,12974],"mapped",[36039]],[[12975,12975],"mapped",[21332]],[[12976,12976],"mapped",[22812]],[[12977,12977],"mapped",[51,54]],[[12978,12978],"mapped",[51,55]],[[12979,12979],"mapped",[51,56]],[[12980,12980],"mapped",[51,57]],[[12981,12981],"mapped",[52,48]],[[12982,12982],"mapped",[52,49]],[[12983,12983],"mapped",[52,50]],[[12984,12984],"mapped",[52,51]],[[12985,12985],"mapped",[52,52]],[[12986,12986],"mapped",[52,53]],[[12987,12987],"mapped",[52,54]],[[12988,12988],"mapped",[52,55]],[[12989,12989],"mapped",[52,56]],[[12990,12990],"mapped",[52,57]],[[12991,12991],"mapped",[53,48]],[[12992,12992],"mapped",[49,26376]],[[12993,12993],"mapped",[50,26376]],[[12994,12994],"mapped",[51,26376]],[[12995,12995],"mapped",[52,26376]],[[12996,12996],"mapped",[53,26376]],[[12997,12997],"mapped",[54,26376]],[[12998,12998],"mapped",[55,26376]],[[12999,12999],"mapped",[56,26376]],[[13000,13000],"mapped",[57,26376]],[[13001,13001],"mapped",[49,48,26376]],[[13002,13002],"mapped",[49,49,26376]],[[13003,13003],"mapped",[49,50,26376]],[[13004,13004],"mapped",[104,103]],[[13005,13005],"mapped",[101,114,103]],[[13006,13006],"mapped",[101,118]],[[13007,13007],"mapped",[108,116,100]],[[13008,13008],"mapped",[12450]],[[13009,13009],"mapped",[12452]],[[13010,13010],"mapped",[12454]],[[13011,13011],"mapped",[12456]],[[13012,13012],"mapped",[12458]],[[13013,13013],"mapped",[12459]],[[13014,13014],"mapped",[12461]],[[13015,13015],"mapped",[12463]],[[13016,13016],"mapped",[12465]],[[13017,13017],"mapped",[12467]],[[13018,13018],"mapped",[12469]],[[13019,13019],"mapped",[12471]],[[13020,13020],"mapped",[12473]],[[13021,13021],"mapped",[12475]],[[13022,13022],"mapped",[12477]],[[13023,13023],"mapped",[12479]],[[13024,13024],"mapped",[12481]],[[13025,13025],"mapped",[12484]],[[13026,13026],"mapped",[12486]],[[13027,13027],"mapped",[12488]],[[13028,13028],"mapped",[12490]],[[13029,13029],"mapped",[12491]],[[13030,13030],"mapped",[12492]],[[13031,13031],"mapped",[12493]],[[13032,13032],"mapped",[12494]],[[13033,13033],"mapped",[12495]],[[13034,13034],"mapped",[12498]],[[13035,13035],"mapped",[12501]],[[13036,13036],"mapped",[12504]],[[13037,13037],"mapped",[12507]],[[13038,13038],"mapped",[12510]],[[13039,13039],"mapped",[12511]],[[13040,13040],"mapped",[12512]],[[13041,13041],"mapped",[12513]],[[13042,13042],"mapped",[12514]],[[13043,13043],"mapped",[12516]],[[13044,13044],"mapped",[12518]],[[13045,13045],"mapped",[12520]],[[13046,13046],"mapped",[12521]],[[13047,13047],"mapped",[12522]],[[13048,13048],"mapped",[12523]],[[13049,13049],"mapped",[12524]],[[13050,13050],"mapped",[12525]],[[13051,13051],"mapped",[12527]],[[13052,13052],"mapped",[12528]],[[13053,13053],"mapped",[12529]],[[13054,13054],"mapped",[12530]],[[13055,13055],"disallowed"],[[13056,13056],"mapped",[12450,12497,12540,12488]],[[13057,13057],"mapped",[12450,12523,12501,12449]],[[13058,13058],"mapped",[12450,12531,12506,12450]],[[13059,13059],"mapped",[12450,12540,12523]],[[13060,13060],"mapped",[12452,12491,12531,12464]],[[13061,13061],"mapped",[12452,12531,12481]],[[13062,13062],"mapped",[12454,12457,12531]],[[13063,13063],"mapped",[12456,12473,12463,12540,12489]],[[13064,13064],"mapped",[12456,12540,12459,12540]],[[13065,13065],"mapped",[12458,12531,12473]],[[13066,13066],"mapped",[12458,12540,12512]],[[13067,13067],"mapped",[12459,12452,12522]],[[13068,13068],"mapped",[12459,12521,12483,12488]],[[13069,13069],"mapped",[12459,12525,12522,12540]],[[13070,13070],"mapped",[12460,12525,12531]],[[13071,13071],"mapped",[12460,12531,12510]],[[13072,13072],"mapped",[12462,12460]],[[13073,13073],"mapped",[12462,12491,12540]],[[13074,13074],"mapped",[12461,12517,12522,12540]],[[13075,13075],"mapped",[12462,12523,12480,12540]],[[13076,13076],"mapped",[12461,12525]],[[13077,13077],"mapped",[12461,12525,12464,12521,12512]],[[13078,13078],"mapped",[12461,12525,12513,12540,12488,12523]],[[13079,13079],"mapped",[12461,12525,12527,12483,12488]],[[13080,13080],"mapped",[12464,12521,12512]],[[13081,13081],"mapped",[12464,12521,12512,12488,12531]],[[13082,13082],"mapped",[12463,12523,12476,12452,12525]],[[13083,13083],"mapped",[12463,12525,12540,12493]],[[13084,13084],"mapped",[12465,12540,12473]],[[13085,13085],"mapped",[12467,12523,12490]],[[13086,13086],"mapped",[12467,12540,12509]],[[13087,13087],"mapped",[12469,12452,12463,12523]],[[13088,13088],"mapped",[12469,12531,12481,12540,12512]],[[13089,13089],"mapped",[12471,12522,12531,12464]],[[13090,13090],"mapped",[12475,12531,12481]],[[13091,13091],"mapped",[12475,12531,12488]],[[13092,13092],"mapped",[12480,12540,12473]],[[13093,13093],"mapped",[12487,12471]],[[13094,13094],"mapped",[12489,12523]],[[13095,13095],"mapped",[12488,12531]],[[13096,13096],"mapped",[12490,12494]],[[13097,13097],"mapped",[12494,12483,12488]],[[13098,13098],"mapped",[12495,12452,12484]],[[13099,13099],"mapped",[12497,12540,12475,12531,12488]],[[13100,13100],"mapped",[12497,12540,12484]],[[13101,13101],"mapped",[12496,12540,12524,12523]],[[13102,13102],"mapped",[12500,12450,12473,12488,12523]],[[13103,13103],"mapped",[12500,12463,12523]],[[13104,13104],"mapped",[12500,12467]],[[13105,13105],"mapped",[12499,12523]],[[13106,13106],"mapped",[12501,12449,12521,12483,12489]],[[13107,13107],"mapped",[12501,12451,12540,12488]],[[13108,13108],"mapped",[12502,12483,12471,12455,12523]],[[13109,13109],"mapped",[12501,12521,12531]],[[13110,13110],"mapped",[12504,12463,12479,12540,12523]],[[13111,13111],"mapped",[12506,12477]],[[13112,13112],"mapped",[12506,12491,12498]],[[13113,13113],"mapped",[12504,12523,12484]],[[13114,13114],"mapped",[12506,12531,12473]],[[13115,13115],"mapped",[12506,12540,12472]],[[13116,13116],"mapped",[12505,12540,12479]],[[13117,13117],"mapped",[12509,12452,12531,12488]],[[13118,13118],"mapped",[12508,12523,12488]],[[13119,13119],"mapped",[12507,12531]],[[13120,13120],"mapped",[12509,12531,12489]],[[13121,13121],"mapped",[12507,12540,12523]],[[13122,13122],"mapped",[12507,12540,12531]],[[13123,13123],"mapped",[12510,12452,12463,12525]],[[13124,13124],"mapped",[12510,12452,12523]],[[13125,13125],"mapped",[12510,12483,12495]],[[13126,13126],"mapped",[12510,12523,12463]],[[13127,13127],"mapped",[12510,12531,12471,12519,12531]],[[13128,13128],"mapped",[12511,12463,12525,12531]],[[13129,13129],"mapped",[12511,12522]],[[13130,13130],"mapped",[12511,12522,12496,12540,12523]],[[13131,13131],"mapped",[12513,12460]],[[13132,13132],"mapped",[12513,12460,12488,12531]],[[13133,13133],"mapped",[12513,12540,12488,12523]],[[13134,13134],"mapped",[12516,12540,12489]],[[13135,13135],"mapped",[12516,12540,12523]],[[13136,13136],"mapped",[12518,12450,12531]],[[13137,13137],"mapped",[12522,12483,12488,12523]],[[13138,13138],"mapped",[12522,12521]],[[13139,13139],"mapped",[12523,12500,12540]],[[13140,13140],"mapped",[12523,12540,12502,12523]],[[13141,13141],"mapped",[12524,12512]],[[13142,13142],"mapped",[12524,12531,12488,12466,12531]],[[13143,13143],"mapped",[12527,12483,12488]],[[13144,13144],"mapped",[48,28857]],[[13145,13145],"mapped",[49,28857]],[[13146,13146],"mapped",[50,28857]],[[13147,13147],"mapped",[51,28857]],[[13148,13148],"mapped",[52,28857]],[[13149,13149],"mapped",[53,28857]],[[13150,13150],"mapped",[54,28857]],[[13151,13151],"mapped",[55,28857]],[[13152,13152],"mapped",[56,28857]],[[13153,13153],"mapped",[57,28857]],[[13154,13154],"mapped",[49,48,28857]],[[13155,13155],"mapped",[49,49,28857]],[[13156,13156],"mapped",[49,50,28857]],[[13157,13157],"mapped",[49,51,28857]],[[13158,13158],"mapped",[49,52,28857]],[[13159,13159],"mapped",[49,53,28857]],[[13160,13160],"mapped",[49,54,28857]],[[13161,13161],"mapped",[49,55,28857]],[[13162,13162],"mapped",[49,56,28857]],[[13163,13163],"mapped",[49,57,28857]],[[13164,13164],"mapped",[50,48,28857]],[[13165,13165],"mapped",[50,49,28857]],[[13166,13166],"mapped",[50,50,28857]],[[13167,13167],"mapped",[50,51,28857]],[[13168,13168],"mapped",[50,52,28857]],[[13169,13169],"mapped",[104,112,97]],[[13170,13170],"mapped",[100,97]],[[13171,13171],"mapped",[97,117]],[[13172,13172],"mapped",[98,97,114]],[[13173,13173],"mapped",[111,118]],[[13174,13174],"mapped",[112,99]],[[13175,13175],"mapped",[100,109]],[[13176,13176],"mapped",[100,109,50]],[[13177,13177],"mapped",[100,109,51]],[[13178,13178],"mapped",[105,117]],[[13179,13179],"mapped",[24179,25104]],[[13180,13180],"mapped",[26157,21644]],[[13181,13181],"mapped",[22823,27491]],[[13182,13182],"mapped",[26126,27835]],[[13183,13183],"mapped",[26666,24335,20250,31038]],[[13184,13184],"mapped",[112,97]],[[13185,13185],"mapped",[110,97]],[[13186,13186],"mapped",[956,97]],[[13187,13187],"mapped",[109,97]],[[13188,13188],"mapped",[107,97]],[[13189,13189],"mapped",[107,98]],[[13190,13190],"mapped",[109,98]],[[13191,13191],"mapped",[103,98]],[[13192,13192],"mapped",[99,97,108]],[[13193,13193],"mapped",[107,99,97,108]],[[13194,13194],"mapped",[112,102]],[[13195,13195],"mapped",[110,102]],[[13196,13196],"mapped",[956,102]],[[13197,13197],"mapped",[956,103]],[[13198,13198],"mapped",[109,103]],[[13199,13199],"mapped",[107,103]],[[13200,13200],"mapped",[104,122]],[[13201,13201],"mapped",[107,104,122]],[[13202,13202],"mapped",[109,104,122]],[[13203,13203],"mapped",[103,104,122]],[[13204,13204],"mapped",[116,104,122]],[[13205,13205],"mapped",[956,108]],[[13206,13206],"mapped",[109,108]],[[13207,13207],"mapped",[100,108]],[[13208,13208],"mapped",[107,108]],[[13209,13209],"mapped",[102,109]],[[13210,13210],"mapped",[110,109]],[[13211,13211],"mapped",[956,109]],[[13212,13212],"mapped",[109,109]],[[13213,13213],"mapped",[99,109]],[[13214,13214],"mapped",[107,109]],[[13215,13215],"mapped",[109,109,50]],[[13216,13216],"mapped",[99,109,50]],[[13217,13217],"mapped",[109,50]],[[13218,13218],"mapped",[107,109,50]],[[13219,13219],"mapped",[109,109,51]],[[13220,13220],"mapped",[99,109,51]],[[13221,13221],"mapped",[109,51]],[[13222,13222],"mapped",[107,109,51]],[[13223,13223],"mapped",[109,8725,115]],[[13224,13224],"mapped",[109,8725,115,50]],[[13225,13225],"mapped",[112,97]],[[13226,13226],"mapped",[107,112,97]],[[13227,13227],"mapped",[109,112,97]],[[13228,13228],"mapped",[103,112,97]],[[13229,13229],"mapped",[114,97,100]],[[13230,13230],"mapped",[114,97,100,8725,115]],[[13231,13231],"mapped",[114,97,100,8725,115,50]],[[13232,13232],"mapped",[112,115]],[[13233,13233],"mapped",[110,115]],[[13234,13234],"mapped",[956,115]],[[13235,13235],"mapped",[109,115]],[[13236,13236],"mapped",[112,118]],[[13237,13237],"mapped",[110,118]],[[13238,13238],"mapped",[956,118]],[[13239,13239],"mapped",[109,118]],[[13240,13240],"mapped",[107,118]],[[13241,13241],"mapped",[109,118]],[[13242,13242],"mapped",[112,119]],[[13243,13243],"mapped",[110,119]],[[13244,13244],"mapped",[956,119]],[[13245,13245],"mapped",[109,119]],[[13246,13246],"mapped",[107,119]],[[13247,13247],"mapped",[109,119]],[[13248,13248],"mapped",[107,969]],[[13249,13249],"mapped",[109,969]],[[13250,13250],"disallowed"],[[13251,13251],"mapped",[98,113]],[[13252,13252],"mapped",[99,99]],[[13253,13253],"mapped",[99,100]],[[13254,13254],"mapped",[99,8725,107,103]],[[13255,13255],"disallowed"],[[13256,13256],"mapped",[100,98]],[[13257,13257],"mapped",[103,121]],[[13258,13258],"mapped",[104,97]],[[13259,13259],"mapped",[104,112]],[[13260,13260],"mapped",[105,110]],[[13261,13261],"mapped",[107,107]],[[13262,13262],"mapped",[107,109]],[[13263,13263],"mapped",[107,116]],[[13264,13264],"mapped",[108,109]],[[13265,13265],"mapped",[108,110]],[[13266,13266],"mapped",[108,111,103]],[[13267,13267],"mapped",[108,120]],[[13268,13268],"mapped",[109,98]],[[13269,13269],"mapped",[109,105,108]],[[13270,13270],"mapped",[109,111,108]],[[13271,13271],"mapped",[112,104]],[[13272,13272],"disallowed"],[[13273,13273],"mapped",[112,112,109]],[[13274,13274],"mapped",[112,114]],[[13275,13275],"mapped",[115,114]],[[13276,13276],"mapped",[115,118]],[[13277,13277],"mapped",[119,98]],[[13278,13278],"mapped",[118,8725,109]],[[13279,13279],"mapped",[97,8725,109]],[[13280,13280],"mapped",[49,26085]],[[13281,13281],"mapped",[50,26085]],[[13282,13282],"mapped",[51,26085]],[[13283,13283],"mapped",[52,26085]],[[13284,13284],"mapped",[53,26085]],[[13285,13285],"mapped",[54,26085]],[[13286,13286],"mapped",[55,26085]],[[13287,13287],"mapped",[56,26085]],[[13288,13288],"mapped",[57,26085]],[[13289,13289],"mapped",[49,48,26085]],[[13290,13290],"mapped",[49,49,26085]],[[13291,13291],"mapped",[49,50,26085]],[[13292,13292],"mapped",[49,51,26085]],[[13293,13293],"mapped",[49,52,26085]],[[13294,13294],"mapped",[49,53,26085]],[[13295,13295],"mapped",[49,54,26085]],[[13296,13296],"mapped",[49,55,26085]],[[13297,13297],"mapped",[49,56,26085]],[[13298,13298],"mapped",[49,57,26085]],[[13299,13299],"mapped",[50,48,26085]],[[13300,13300],"mapped",[50,49,26085]],[[13301,13301],"mapped",[50,50,26085]],[[13302,13302],"mapped",[50,51,26085]],[[13303,13303],"mapped",[50,52,26085]],[[13304,13304],"mapped",[50,53,26085]],[[13305,13305],"mapped",[50,54,26085]],[[13306,13306],"mapped",[50,55,26085]],[[13307,13307],"mapped",[50,56,26085]],[[13308,13308],"mapped",[50,57,26085]],[[13309,13309],"mapped",[51,48,26085]],[[13310,13310],"mapped",[51,49,26085]],[[13311,13311],"mapped",[103,97,108]],[[13312,19893],"valid"],[[19894,19903],"disallowed"],[[19904,19967],"valid",[],"NV8"],[[19968,40869],"valid"],[[40870,40891],"valid"],[[40892,40899],"valid"],[[40900,40907],"valid"],[[40908,40908],"valid"],[[40909,40917],"valid"],[[40918,40959],"disallowed"],[[40960,42124],"valid"],[[42125,42127],"disallowed"],[[42128,42145],"valid",[],"NV8"],[[42146,42147],"valid",[],"NV8"],[[42148,42163],"valid",[],"NV8"],[[42164,42164],"valid",[],"NV8"],[[42165,42176],"valid",[],"NV8"],[[42177,42177],"valid",[],"NV8"],[[42178,42180],"valid",[],"NV8"],[[42181,42181],"valid",[],"NV8"],[[42182,42182],"valid",[],"NV8"],[[42183,42191],"disallowed"],[[42192,42237],"valid"],[[42238,42239],"valid",[],"NV8"],[[42240,42508],"valid"],[[42509,42511],"valid",[],"NV8"],[[42512,42539],"valid"],[[42540,42559],"disallowed"],[[42560,42560],"mapped",[42561]],[[42561,42561],"valid"],[[42562,42562],"mapped",[42563]],[[42563,42563],"valid"],[[42564,42564],"mapped",[42565]],[[42565,42565],"valid"],[[42566,42566],"mapped",[42567]],[[42567,42567],"valid"],[[42568,42568],"mapped",[42569]],[[42569,42569],"valid"],[[42570,42570],"mapped",[42571]],[[42571,42571],"valid"],[[42572,42572],"mapped",[42573]],[[42573,42573],"valid"],[[42574,42574],"mapped",[42575]],[[42575,42575],"valid"],[[42576,42576],"mapped",[42577]],[[42577,42577],"valid"],[[42578,42578],"mapped",[42579]],[[42579,42579],"valid"],[[42580,42580],"mapped",[42581]],[[42581,42581],"valid"],[[42582,42582],"mapped",[42583]],[[42583,42583],"valid"],[[42584,42584],"mapped",[42585]],[[42585,42585],"valid"],[[42586,42586],"mapped",[42587]],[[42587,42587],"valid"],[[42588,42588],"mapped",[42589]],[[42589,42589],"valid"],[[42590,42590],"mapped",[42591]],[[42591,42591],"valid"],[[42592,42592],"mapped",[42593]],[[42593,42593],"valid"],[[42594,42594],"mapped",[42595]],[[42595,42595],"valid"],[[42596,42596],"mapped",[42597]],[[42597,42597],"valid"],[[42598,42598],"mapped",[42599]],[[42599,42599],"valid"],[[42600,42600],"mapped",[42601]],[[42601,42601],"valid"],[[42602,42602],"mapped",[42603]],[[42603,42603],"valid"],[[42604,42604],"mapped",[42605]],[[42605,42607],"valid"],[[42608,42611],"valid",[],"NV8"],[[42612,42619],"valid"],[[42620,42621],"valid"],[[42622,42622],"valid",[],"NV8"],[[42623,42623],"valid"],[[42624,42624],"mapped",[42625]],[[42625,42625],"valid"],[[42626,42626],"mapped",[42627]],[[42627,42627],"valid"],[[42628,42628],"mapped",[42629]],[[42629,42629],"valid"],[[42630,42630],"mapped",[42631]],[[42631,42631],"valid"],[[42632,42632],"mapped",[42633]],[[42633,42633],"valid"],[[42634,42634],"mapped",[42635]],[[42635,42635],"valid"],[[42636,42636],"mapped",[42637]],[[42637,42637],"valid"],[[42638,42638],"mapped",[42639]],[[42639,42639],"valid"],[[42640,42640],"mapped",[42641]],[[42641,42641],"valid"],[[42642,42642],"mapped",[42643]],[[42643,42643],"valid"],[[42644,42644],"mapped",[42645]],[[42645,42645],"valid"],[[42646,42646],"mapped",[42647]],[[42647,42647],"valid"],[[42648,42648],"mapped",[42649]],[[42649,42649],"valid"],[[42650,42650],"mapped",[42651]],[[42651,42651],"valid"],[[42652,42652],"mapped",[1098]],[[42653,42653],"mapped",[1100]],[[42654,42654],"valid"],[[42655,42655],"valid"],[[42656,42725],"valid"],[[42726,42735],"valid",[],"NV8"],[[42736,42737],"valid"],[[42738,42743],"valid",[],"NV8"],[[42744,42751],"disallowed"],[[42752,42774],"valid",[],"NV8"],[[42775,42778],"valid"],[[42779,42783],"valid"],[[42784,42785],"valid",[],"NV8"],[[42786,42786],"mapped",[42787]],[[42787,42787],"valid"],[[42788,42788],"mapped",[42789]],[[42789,42789],"valid"],[[42790,42790],"mapped",[42791]],[[42791,42791],"valid"],[[42792,42792],"mapped",[42793]],[[42793,42793],"valid"],[[42794,42794],"mapped",[42795]],[[42795,42795],"valid"],[[42796,42796],"mapped",[42797]],[[42797,42797],"valid"],[[42798,42798],"mapped",[42799]],[[42799,42801],"valid"],[[42802,42802],"mapped",[42803]],[[42803,42803],"valid"],[[42804,42804],"mapped",[42805]],[[42805,42805],"valid"],[[42806,42806],"mapped",[42807]],[[42807,42807],"valid"],[[42808,42808],"mapped",[42809]],[[42809,42809],"valid"],[[42810,42810],"mapped",[42811]],[[42811,42811],"valid"],[[42812,42812],"mapped",[42813]],[[42813,42813],"valid"],[[42814,42814],"mapped",[42815]],[[42815,42815],"valid"],[[42816,42816],"mapped",[42817]],[[42817,42817],"valid"],[[42818,42818],"mapped",[42819]],[[42819,42819],"valid"],[[42820,42820],"mapped",[42821]],[[42821,42821],"valid"],[[42822,42822],"mapped",[42823]],[[42823,42823],"valid"],[[42824,42824],"mapped",[42825]],[[42825,42825],"valid"],[[42826,42826],"mapped",[42827]],[[42827,42827],"valid"],[[42828,42828],"mapped",[42829]],[[42829,42829],"valid"],[[42830,42830],"mapped",[42831]],[[42831,42831],"valid"],[[42832,42832],"mapped",[42833]],[[42833,42833],"valid"],[[42834,42834],"mapped",[42835]],[[42835,42835],"valid"],[[42836,42836],"mapped",[42837]],[[42837,42837],"valid"],[[42838,42838],"mapped",[42839]],[[42839,42839],"valid"],[[42840,42840],"mapped",[42841]],[[42841,42841],"valid"],[[42842,42842],"mapped",[42843]],[[42843,42843],"valid"],[[42844,42844],"mapped",[42845]],[[42845,42845],"valid"],[[42846,42846],"mapped",[42847]],[[42847,42847],"valid"],[[42848,42848],"mapped",[42849]],[[42849,42849],"valid"],[[42850,42850],"mapped",[42851]],[[42851,42851],"valid"],[[42852,42852],"mapped",[42853]],[[42853,42853],"valid"],[[42854,42854],"mapped",[42855]],[[42855,42855],"valid"],[[42856,42856],"mapped",[42857]],[[42857,42857],"valid"],[[42858,42858],"mapped",[42859]],[[42859,42859],"valid"],[[42860,42860],"mapped",[42861]],[[42861,42861],"valid"],[[42862,42862],"mapped",[42863]],[[42863,42863],"valid"],[[42864,42864],"mapped",[42863]],[[42865,42872],"valid"],[[42873,42873],"mapped",[42874]],[[42874,42874],"valid"],[[42875,42875],"mapped",[42876]],[[42876,42876],"valid"],[[42877,42877],"mapped",[7545]],[[42878,42878],"mapped",[42879]],[[42879,42879],"valid"],[[42880,42880],"mapped",[42881]],[[42881,42881],"valid"],[[42882,42882],"mapped",[42883]],[[42883,42883],"valid"],[[42884,42884],"mapped",[42885]],[[42885,42885],"valid"],[[42886,42886],"mapped",[42887]],[[42887,42888],"valid"],[[42889,42890],"valid",[],"NV8"],[[42891,42891],"mapped",[42892]],[[42892,42892],"valid"],[[42893,42893],"mapped",[613]],[[42894,42894],"valid"],[[42895,42895],"valid"],[[42896,42896],"mapped",[42897]],[[42897,42897],"valid"],[[42898,42898],"mapped",[42899]],[[42899,42899],"valid"],[[42900,42901],"valid"],[[42902,42902],"mapped",[42903]],[[42903,42903],"valid"],[[42904,42904],"mapped",[42905]],[[42905,42905],"valid"],[[42906,42906],"mapped",[42907]],[[42907,42907],"valid"],[[42908,42908],"mapped",[42909]],[[42909,42909],"valid"],[[42910,42910],"mapped",[42911]],[[42911,42911],"valid"],[[42912,42912],"mapped",[42913]],[[42913,42913],"valid"],[[42914,42914],"mapped",[42915]],[[42915,42915],"valid"],[[42916,42916],"mapped",[42917]],[[42917,42917],"valid"],[[42918,42918],"mapped",[42919]],[[42919,42919],"valid"],[[42920,42920],"mapped",[42921]],[[42921,42921],"valid"],[[42922,42922],"mapped",[614]],[[42923,42923],"mapped",[604]],[[42924,42924],"mapped",[609]],[[42925,42925],"mapped",[620]],[[42926,42927],"disallowed"],[[42928,42928],"mapped",[670]],[[42929,42929],"mapped",[647]],[[42930,42930],"mapped",[669]],[[42931,42931],"mapped",[43859]],[[42932,42932],"mapped",[42933]],[[42933,42933],"valid"],[[42934,42934],"mapped",[42935]],[[42935,42935],"valid"],[[42936,42998],"disallowed"],[[42999,42999],"valid"],[[43000,43000],"mapped",[295]],[[43001,43001],"mapped",[339]],[[43002,43002],"valid"],[[43003,43007],"valid"],[[43008,43047],"valid"],[[43048,43051],"valid",[],"NV8"],[[43052,43055],"disallowed"],[[43056,43065],"valid",[],"NV8"],[[43066,43071],"disallowed"],[[43072,43123],"valid"],[[43124,43127],"valid",[],"NV8"],[[43128,43135],"disallowed"],[[43136,43204],"valid"],[[43205,43213],"disallowed"],[[43214,43215],"valid",[],"NV8"],[[43216,43225],"valid"],[[43226,43231],"disallowed"],[[43232,43255],"valid"],[[43256,43258],"valid",[],"NV8"],[[43259,43259],"valid"],[[43260,43260],"valid",[],"NV8"],[[43261,43261],"valid"],[[43262,43263],"disallowed"],[[43264,43309],"valid"],[[43310,43311],"valid",[],"NV8"],[[43312,43347],"valid"],[[43348,43358],"disallowed"],[[43359,43359],"valid",[],"NV8"],[[43360,43388],"valid",[],"NV8"],[[43389,43391],"disallowed"],[[43392,43456],"valid"],[[43457,43469],"valid",[],"NV8"],[[43470,43470],"disallowed"],[[43471,43481],"valid"],[[43482,43485],"disallowed"],[[43486,43487],"valid",[],"NV8"],[[43488,43518],"valid"],[[43519,43519],"disallowed"],[[43520,43574],"valid"],[[43575,43583],"disallowed"],[[43584,43597],"valid"],[[43598,43599],"disallowed"],[[43600,43609],"valid"],[[43610,43611],"disallowed"],[[43612,43615],"valid",[],"NV8"],[[43616,43638],"valid"],[[43639,43641],"valid",[],"NV8"],[[43642,43643],"valid"],[[43644,43647],"valid"],[[43648,43714],"valid"],[[43715,43738],"disallowed"],[[43739,43741],"valid"],[[43742,43743],"valid",[],"NV8"],[[43744,43759],"valid"],[[43760,43761],"valid",[],"NV8"],[[43762,43766],"valid"],[[43767,43776],"disallowed"],[[43777,43782],"valid"],[[43783,43784],"disallowed"],[[43785,43790],"valid"],[[43791,43792],"disallowed"],[[43793,43798],"valid"],[[43799,43807],"disallowed"],[[43808,43814],"valid"],[[43815,43815],"disallowed"],[[43816,43822],"valid"],[[43823,43823],"disallowed"],[[43824,43866],"valid"],[[43867,43867],"valid",[],"NV8"],[[43868,43868],"mapped",[42791]],[[43869,43869],"mapped",[43831]],[[43870,43870],"mapped",[619]],[[43871,43871],"mapped",[43858]],[[43872,43875],"valid"],[[43876,43877],"valid"],[[43878,43887],"disallowed"],[[43888,43888],"mapped",[5024]],[[43889,43889],"mapped",[5025]],[[43890,43890],"mapped",[5026]],[[43891,43891],"mapped",[5027]],[[43892,43892],"mapped",[5028]],[[43893,43893],"mapped",[5029]],[[43894,43894],"mapped",[5030]],[[43895,43895],"mapped",[5031]],[[43896,43896],"mapped",[5032]],[[43897,43897],"mapped",[5033]],[[43898,43898],"mapped",[5034]],[[43899,43899],"mapped",[5035]],[[43900,43900],"mapped",[5036]],[[43901,43901],"mapped",[5037]],[[43902,43902],"mapped",[5038]],[[43903,43903],"mapped",[5039]],[[43904,43904],"mapped",[5040]],[[43905,43905],"mapped",[5041]],[[43906,43906],"mapped",[5042]],[[43907,43907],"mapped",[5043]],[[43908,43908],"mapped",[5044]],[[43909,43909],"mapped",[5045]],[[43910,43910],"mapped",[5046]],[[43911,43911],"mapped",[5047]],[[43912,43912],"mapped",[5048]],[[43913,43913],"mapped",[5049]],[[43914,43914],"mapped",[5050]],[[43915,43915],"mapped",[5051]],[[43916,43916],"mapped",[5052]],[[43917,43917],"mapped",[5053]],[[43918,43918],"mapped",[5054]],[[43919,43919],"mapped",[5055]],[[43920,43920],"mapped",[5056]],[[43921,43921],"mapped",[5057]],[[43922,43922],"mapped",[5058]],[[43923,43923],"mapped",[5059]],[[43924,43924],"mapped",[5060]],[[43925,43925],"mapped",[5061]],[[43926,43926],"mapped",[5062]],[[43927,43927],"mapped",[5063]],[[43928,43928],"mapped",[5064]],[[43929,43929],"mapped",[5065]],[[43930,43930],"mapped",[5066]],[[43931,43931],"mapped",[5067]],[[43932,43932],"mapped",[5068]],[[43933,43933],"mapped",[5069]],[[43934,43934],"mapped",[5070]],[[43935,43935],"mapped",[5071]],[[43936,43936],"mapped",[5072]],[[43937,43937],"mapped",[5073]],[[43938,43938],"mapped",[5074]],[[43939,43939],"mapped",[5075]],[[43940,43940],"mapped",[5076]],[[43941,43941],"mapped",[5077]],[[43942,43942],"mapped",[5078]],[[43943,43943],"mapped",[5079]],[[43944,43944],"mapped",[5080]],[[43945,43945],"mapped",[5081]],[[43946,43946],"mapped",[5082]],[[43947,43947],"mapped",[5083]],[[43948,43948],"mapped",[5084]],[[43949,43949],"mapped",[5085]],[[43950,43950],"mapped",[5086]],[[43951,43951],"mapped",[5087]],[[43952,43952],"mapped",[5088]],[[43953,43953],"mapped",[5089]],[[43954,43954],"mapped",[5090]],[[43955,43955],"mapped",[5091]],[[43956,43956],"mapped",[5092]],[[43957,43957],"mapped",[5093]],[[43958,43958],"mapped",[5094]],[[43959,43959],"mapped",[5095]],[[43960,43960],"mapped",[5096]],[[43961,43961],"mapped",[5097]],[[43962,43962],"mapped",[5098]],[[43963,43963],"mapped",[5099]],[[43964,43964],"mapped",[5100]],[[43965,43965],"mapped",[5101]],[[43966,43966],"mapped",[5102]],[[43967,43967],"mapped",[5103]],[[43968,44010],"valid"],[[44011,44011],"valid",[],"NV8"],[[44012,44013],"valid"],[[44014,44015],"disallowed"],[[44016,44025],"valid"],[[44026,44031],"disallowed"],[[44032,55203],"valid"],[[55204,55215],"disallowed"],[[55216,55238],"valid",[],"NV8"],[[55239,55242],"disallowed"],[[55243,55291],"valid",[],"NV8"],[[55292,55295],"disallowed"],[[55296,57343],"disallowed"],[[57344,63743],"disallowed"],[[63744,63744],"mapped",[35912]],[[63745,63745],"mapped",[26356]],[[63746,63746],"mapped",[36554]],[[63747,63747],"mapped",[36040]],[[63748,63748],"mapped",[28369]],[[63749,63749],"mapped",[20018]],[[63750,63750],"mapped",[21477]],[[63751,63752],"mapped",[40860]],[[63753,63753],"mapped",[22865]],[[63754,63754],"mapped",[37329]],[[63755,63755],"mapped",[21895]],[[63756,63756],"mapped",[22856]],[[63757,63757],"mapped",[25078]],[[63758,63758],"mapped",[30313]],[[63759,63759],"mapped",[32645]],[[63760,63760],"mapped",[34367]],[[63761,63761],"mapped",[34746]],[[63762,63762],"mapped",[35064]],[[63763,63763],"mapped",[37007]],[[63764,63764],"mapped",[27138]],[[63765,63765],"mapped",[27931]],[[63766,63766],"mapped",[28889]],[[63767,63767],"mapped",[29662]],[[63768,63768],"mapped",[33853]],[[63769,63769],"mapped",[37226]],[[63770,63770],"mapped",[39409]],[[63771,63771],"mapped",[20098]],[[63772,63772],"mapped",[21365]],[[63773,63773],"mapped",[27396]],[[63774,63774],"mapped",[29211]],[[63775,63775],"mapped",[34349]],[[63776,63776],"mapped",[40478]],[[63777,63777],"mapped",[23888]],[[63778,63778],"mapped",[28651]],[[63779,63779],"mapped",[34253]],[[63780,63780],"mapped",[35172]],[[63781,63781],"mapped",[25289]],[[63782,63782],"mapped",[33240]],[[63783,63783],"mapped",[34847]],[[63784,63784],"mapped",[24266]],[[63785,63785],"mapped",[26391]],[[63786,63786],"mapped",[28010]],[[63787,63787],"mapped",[29436]],[[63788,63788],"mapped",[37070]],[[63789,63789],"mapped",[20358]],[[63790,63790],"mapped",[20919]],[[63791,63791],"mapped",[21214]],[[63792,63792],"mapped",[25796]],[[63793,63793],"mapped",[27347]],[[63794,63794],"mapped",[29200]],[[63795,63795],"mapped",[30439]],[[63796,63796],"mapped",[32769]],[[63797,63797],"mapped",[34310]],[[63798,63798],"mapped",[34396]],[[63799,63799],"mapped",[36335]],[[63800,63800],"mapped",[38706]],[[63801,63801],"mapped",[39791]],[[63802,63802],"mapped",[40442]],[[63803,63803],"mapped",[30860]],[[63804,63804],"mapped",[31103]],[[63805,63805],"mapped",[32160]],[[63806,63806],"mapped",[33737]],[[63807,63807],"mapped",[37636]],[[63808,63808],"mapped",[40575]],[[63809,63809],"mapped",[35542]],[[63810,63810],"mapped",[22751]],[[63811,63811],"mapped",[24324]],[[63812,63812],"mapped",[31840]],[[63813,63813],"mapped",[32894]],[[63814,63814],"mapped",[29282]],[[63815,63815],"mapped",[30922]],[[63816,63816],"mapped",[36034]],[[63817,63817],"mapped",[38647]],[[63818,63818],"mapped",[22744]],[[63819,63819],"mapped",[23650]],[[63820,63820],"mapped",[27155]],[[63821,63821],"mapped",[28122]],[[63822,63822],"mapped",[28431]],[[63823,63823],"mapped",[32047]],[[63824,63824],"mapped",[32311]],[[63825,63825],"mapped",[38475]],[[63826,63826],"mapped",[21202]],[[63827,63827],"mapped",[32907]],[[63828,63828],"mapped",[20956]],[[63829,63829],"mapped",[20940]],[[63830,63830],"mapped",[31260]],[[63831,63831],"mapped",[32190]],[[63832,63832],"mapped",[33777]],[[63833,63833],"mapped",[38517]],[[63834,63834],"mapped",[35712]],[[63835,63835],"mapped",[25295]],[[63836,63836],"mapped",[27138]],[[63837,63837],"mapped",[35582]],[[63838,63838],"mapped",[20025]],[[63839,63839],"mapped",[23527]],[[63840,63840],"mapped",[24594]],[[63841,63841],"mapped",[29575]],[[63842,63842],"mapped",[30064]],[[63843,63843],"mapped",[21271]],[[63844,63844],"mapped",[30971]],[[63845,63845],"mapped",[20415]],[[63846,63846],"mapped",[24489]],[[63847,63847],"mapped",[19981]],[[63848,63848],"mapped",[27852]],[[63849,63849],"mapped",[25976]],[[63850,63850],"mapped",[32034]],[[63851,63851],"mapped",[21443]],[[63852,63852],"mapped",[22622]],[[63853,63853],"mapped",[30465]],[[63854,63854],"mapped",[33865]],[[63855,63855],"mapped",[35498]],[[63856,63856],"mapped",[27578]],[[63857,63857],"mapped",[36784]],[[63858,63858],"mapped",[27784]],[[63859,63859],"mapped",[25342]],[[63860,63860],"mapped",[33509]],[[63861,63861],"mapped",[25504]],[[63862,63862],"mapped",[30053]],[[63863,63863],"mapped",[20142]],[[63864,63864],"mapped",[20841]],[[63865,63865],"mapped",[20937]],[[63866,63866],"mapped",[26753]],[[63867,63867],"mapped",[31975]],[[63868,63868],"mapped",[33391]],[[63869,63869],"mapped",[35538]],[[63870,63870],"mapped",[37327]],[[63871,63871],"mapped",[21237]],[[63872,63872],"mapped",[21570]],[[63873,63873],"mapped",[22899]],[[63874,63874],"mapped",[24300]],[[63875,63875],"mapped",[26053]],[[63876,63876],"mapped",[28670]],[[63877,63877],"mapped",[31018]],[[63878,63878],"mapped",[38317]],[[63879,63879],"mapped",[39530]],[[63880,63880],"mapped",[40599]],[[63881,63881],"mapped",[40654]],[[63882,63882],"mapped",[21147]],[[63883,63883],"mapped",[26310]],[[63884,63884],"mapped",[27511]],[[63885,63885],"mapped",[36706]],[[63886,63886],"mapped",[24180]],[[63887,63887],"mapped",[24976]],[[63888,63888],"mapped",[25088]],[[63889,63889],"mapped",[25754]],[[63890,63890],"mapped",[28451]],[[63891,63891],"mapped",[29001]],[[63892,63892],"mapped",[29833]],[[63893,63893],"mapped",[31178]],[[63894,63894],"mapped",[32244]],[[63895,63895],"mapped",[32879]],[[63896,63896],"mapped",[36646]],[[63897,63897],"mapped",[34030]],[[63898,63898],"mapped",[36899]],[[63899,63899],"mapped",[37706]],[[63900,63900],"mapped",[21015]],[[63901,63901],"mapped",[21155]],[[63902,63902],"mapped",[21693]],[[63903,63903],"mapped",[28872]],[[63904,63904],"mapped",[35010]],[[63905,63905],"mapped",[35498]],[[63906,63906],"mapped",[24265]],[[63907,63907],"mapped",[24565]],[[63908,63908],"mapped",[25467]],[[63909,63909],"mapped",[27566]],[[63910,63910],"mapped",[31806]],[[63911,63911],"mapped",[29557]],[[63912,63912],"mapped",[20196]],[[63913,63913],"mapped",[22265]],[[63914,63914],"mapped",[23527]],[[63915,63915],"mapped",[23994]],[[63916,63916],"mapped",[24604]],[[63917,63917],"mapped",[29618]],[[63918,63918],"mapped",[29801]],[[63919,63919],"mapped",[32666]],[[63920,63920],"mapped",[32838]],[[63921,63921],"mapped",[37428]],[[63922,63922],"mapped",[38646]],[[63923,63923],"mapped",[38728]],[[63924,63924],"mapped",[38936]],[[63925,63925],"mapped",[20363]],[[63926,63926],"mapped",[31150]],[[63927,63927],"mapped",[37300]],[[63928,63928],"mapped",[38584]],[[63929,63929],"mapped",[24801]],[[63930,63930],"mapped",[20102]],[[63931,63931],"mapped",[20698]],[[63932,63932],"mapped",[23534]],[[63933,63933],"mapped",[23615]],[[63934,63934],"mapped",[26009]],[[63935,63935],"mapped",[27138]],[[63936,63936],"mapped",[29134]],[[63937,63937],"mapped",[30274]],[[63938,63938],"mapped",[34044]],[[63939,63939],"mapped",[36988]],[[63940,63940],"mapped",[40845]],[[63941,63941],"mapped",[26248]],[[63942,63942],"mapped",[38446]],[[63943,63943],"mapped",[21129]],[[63944,63944],"mapped",[26491]],[[63945,63945],"mapped",[26611]],[[63946,63946],"mapped",[27969]],[[63947,63947],"mapped",[28316]],[[63948,63948],"mapped",[29705]],[[63949,63949],"mapped",[30041]],[[63950,63950],"mapped",[30827]],[[63951,63951],"mapped",[32016]],[[63952,63952],"mapped",[39006]],[[63953,63953],"mapped",[20845]],[[63954,63954],"mapped",[25134]],[[63955,63955],"mapped",[38520]],[[63956,63956],"mapped",[20523]],[[63957,63957],"mapped",[23833]],[[63958,63958],"mapped",[28138]],[[63959,63959],"mapped",[36650]],[[63960,63960],"mapped",[24459]],[[63961,63961],"mapped",[24900]],[[63962,63962],"mapped",[26647]],[[63963,63963],"mapped",[29575]],[[63964,63964],"mapped",[38534]],[[63965,63965],"mapped",[21033]],[[63966,63966],"mapped",[21519]],[[63967,63967],"mapped",[23653]],[[63968,63968],"mapped",[26131]],[[63969,63969],"mapped",[26446]],[[63970,63970],"mapped",[26792]],[[63971,63971],"mapped",[27877]],[[63972,63972],"mapped",[29702]],[[63973,63973],"mapped",[30178]],[[63974,63974],"mapped",[32633]],[[63975,63975],"mapped",[35023]],[[63976,63976],"mapped",[35041]],[[63977,63977],"mapped",[37324]],[[63978,63978],"mapped",[38626]],[[63979,63979],"mapped",[21311]],[[63980,63980],"mapped",[28346]],[[63981,63981],"mapped",[21533]],[[63982,63982],"mapped",[29136]],[[63983,63983],"mapped",[29848]],[[63984,63984],"mapped",[34298]],[[63985,63985],"mapped",[38563]],[[63986,63986],"mapped",[40023]],[[63987,63987],"mapped",[40607]],[[63988,63988],"mapped",[26519]],[[63989,63989],"mapped",[28107]],[[63990,63990],"mapped",[33256]],[[63991,63991],"mapped",[31435]],[[63992,63992],"mapped",[31520]],[[63993,63993],"mapped",[31890]],[[63994,63994],"mapped",[29376]],[[63995,63995],"mapped",[28825]],[[63996,63996],"mapped",[35672]],[[63997,63997],"mapped",[20160]],[[63998,63998],"mapped",[33590]],[[63999,63999],"mapped",[21050]],[[64000,64000],"mapped",[20999]],[[64001,64001],"mapped",[24230]],[[64002,64002],"mapped",[25299]],[[64003,64003],"mapped",[31958]],[[64004,64004],"mapped",[23429]],[[64005,64005],"mapped",[27934]],[[64006,64006],"mapped",[26292]],[[64007,64007],"mapped",[36667]],[[64008,64008],"mapped",[34892]],[[64009,64009],"mapped",[38477]],[[64010,64010],"mapped",[35211]],[[64011,64011],"mapped",[24275]],[[64012,64012],"mapped",[20800]],[[64013,64013],"mapped",[21952]],[[64014,64015],"valid"],[[64016,64016],"mapped",[22618]],[[64017,64017],"valid"],[[64018,64018],"mapped",[26228]],[[64019,64020],"valid"],[[64021,64021],"mapped",[20958]],[[64022,64022],"mapped",[29482]],[[64023,64023],"mapped",[30410]],[[64024,64024],"mapped",[31036]],[[64025,64025],"mapped",[31070]],[[64026,64026],"mapped",[31077]],[[64027,64027],"mapped",[31119]],[[64028,64028],"mapped",[38742]],[[64029,64029],"mapped",[31934]],[[64030,64030],"mapped",[32701]],[[64031,64031],"valid"],[[64032,64032],"mapped",[34322]],[[64033,64033],"valid"],[[64034,64034],"mapped",[35576]],[[64035,64036],"valid"],[[64037,64037],"mapped",[36920]],[[64038,64038],"mapped",[37117]],[[64039,64041],"valid"],[[64042,64042],"mapped",[39151]],[[64043,64043],"mapped",[39164]],[[64044,64044],"mapped",[39208]],[[64045,64045],"mapped",[40372]],[[64046,64046],"mapped",[37086]],[[64047,64047],"mapped",[38583]],[[64048,64048],"mapped",[20398]],[[64049,64049],"mapped",[20711]],[[64050,64050],"mapped",[20813]],[[64051,64051],"mapped",[21193]],[[64052,64052],"mapped",[21220]],[[64053,64053],"mapped",[21329]],[[64054,64054],"mapped",[21917]],[[64055,64055],"mapped",[22022]],[[64056,64056],"mapped",[22120]],[[64057,64057],"mapped",[22592]],[[64058,64058],"mapped",[22696]],[[64059,64059],"mapped",[23652]],[[64060,64060],"mapped",[23662]],[[64061,64061],"mapped",[24724]],[[64062,64062],"mapped",[24936]],[[64063,64063],"mapped",[24974]],[[64064,64064],"mapped",[25074]],[[64065,64065],"mapped",[25935]],[[64066,64066],"mapped",[26082]],[[64067,64067],"mapped",[26257]],[[64068,64068],"mapped",[26757]],[[64069,64069],"mapped",[28023]],[[64070,64070],"mapped",[28186]],[[64071,64071],"mapped",[28450]],[[64072,64072],"mapped",[29038]],[[64073,64073],"mapped",[29227]],[[64074,64074],"mapped",[29730]],[[64075,64075],"mapped",[30865]],[[64076,64076],"mapped",[31038]],[[64077,64077],"mapped",[31049]],[[64078,64078],"mapped",[31048]],[[64079,64079],"mapped",[31056]],[[64080,64080],"mapped",[31062]],[[64081,64081],"mapped",[31069]],[[64082,64082],"mapped",[31117]],[[64083,64083],"mapped",[31118]],[[64084,64084],"mapped",[31296]],[[64085,64085],"mapped",[31361]],[[64086,64086],"mapped",[31680]],[[64087,64087],"mapped",[32244]],[[64088,64088],"mapped",[32265]],[[64089,64089],"mapped",[32321]],[[64090,64090],"mapped",[32626]],[[64091,64091],"mapped",[32773]],[[64092,64092],"mapped",[33261]],[[64093,64094],"mapped",[33401]],[[64095,64095],"mapped",[33879]],[[64096,64096],"mapped",[35088]],[[64097,64097],"mapped",[35222]],[[64098,64098],"mapped",[35585]],[[64099,64099],"mapped",[35641]],[[64100,64100],"mapped",[36051]],[[64101,64101],"mapped",[36104]],[[64102,64102],"mapped",[36790]],[[64103,64103],"mapped",[36920]],[[64104,64104],"mapped",[38627]],[[64105,64105],"mapped",[38911]],[[64106,64106],"mapped",[38971]],[[64107,64107],"mapped",[24693]],[[64108,64108],"mapped",[148206]],[[64109,64109],"mapped",[33304]],[[64110,64111],"disallowed"],[[64112,64112],"mapped",[20006]],[[64113,64113],"mapped",[20917]],[[64114,64114],"mapped",[20840]],[[64115,64115],"mapped",[20352]],[[64116,64116],"mapped",[20805]],[[64117,64117],"mapped",[20864]],[[64118,64118],"mapped",[21191]],[[64119,64119],"mapped",[21242]],[[64120,64120],"mapped",[21917]],[[64121,64121],"mapped",[21845]],[[64122,64122],"mapped",[21913]],[[64123,64123],"mapped",[21986]],[[64124,64124],"mapped",[22618]],[[64125,64125],"mapped",[22707]],[[64126,64126],"mapped",[22852]],[[64127,64127],"mapped",[22868]],[[64128,64128],"mapped",[23138]],[[64129,64129],"mapped",[23336]],[[64130,64130],"mapped",[24274]],[[64131,64131],"mapped",[24281]],[[64132,64132],"mapped",[24425]],[[64133,64133],"mapped",[24493]],[[64134,64134],"mapped",[24792]],[[64135,64135],"mapped",[24910]],[[64136,64136],"mapped",[24840]],[[64137,64137],"mapped",[24974]],[[64138,64138],"mapped",[24928]],[[64139,64139],"mapped",[25074]],[[64140,64140],"mapped",[25140]],[[64141,64141],"mapped",[25540]],[[64142,64142],"mapped",[25628]],[[64143,64143],"mapped",[25682]],[[64144,64144],"mapped",[25942]],[[64145,64145],"mapped",[26228]],[[64146,64146],"mapped",[26391]],[[64147,64147],"mapped",[26395]],[[64148,64148],"mapped",[26454]],[[64149,64149],"mapped",[27513]],[[64150,64150],"mapped",[27578]],[[64151,64151],"mapped",[27969]],[[64152,64152],"mapped",[28379]],[[64153,64153],"mapped",[28363]],[[64154,64154],"mapped",[28450]],[[64155,64155],"mapped",[28702]],[[64156,64156],"mapped",[29038]],[[64157,64157],"mapped",[30631]],[[64158,64158],"mapped",[29237]],[[64159,64159],"mapped",[29359]],[[64160,64160],"mapped",[29482]],[[64161,64161],"mapped",[29809]],[[64162,64162],"mapped",[29958]],[[64163,64163],"mapped",[30011]],[[64164,64164],"mapped",[30237]],[[64165,64165],"mapped",[30239]],[[64166,64166],"mapped",[30410]],[[64167,64167],"mapped",[30427]],[[64168,64168],"mapped",[30452]],[[64169,64169],"mapped",[30538]],[[64170,64170],"mapped",[30528]],[[64171,64171],"mapped",[30924]],[[64172,64172],"mapped",[31409]],[[64173,64173],"mapped",[31680]],[[64174,64174],"mapped",[31867]],[[64175,64175],"mapped",[32091]],[[64176,64176],"mapped",[32244]],[[64177,64177],"mapped",[32574]],[[64178,64178],"mapped",[32773]],[[64179,64179],"mapped",[33618]],[[64180,64180],"mapped",[33775]],[[64181,64181],"mapped",[34681]],[[64182,64182],"mapped",[35137]],[[64183,64183],"mapped",[35206]],[[64184,64184],"mapped",[35222]],[[64185,64185],"mapped",[35519]],[[64186,64186],"mapped",[35576]],[[64187,64187],"mapped",[35531]],[[64188,64188],"mapped",[35585]],[[64189,64189],"mapped",[35582]],[[64190,64190],"mapped",[35565]],[[64191,64191],"mapped",[35641]],[[64192,64192],"mapped",[35722]],[[64193,64193],"mapped",[36104]],[[64194,64194],"mapped",[36664]],[[64195,64195],"mapped",[36978]],[[64196,64196],"mapped",[37273]],[[64197,64197],"mapped",[37494]],[[64198,64198],"mapped",[38524]],[[64199,64199],"mapped",[38627]],[[64200,64200],"mapped",[38742]],[[64201,64201],"mapped",[38875]],[[64202,64202],"mapped",[38911]],[[64203,64203],"mapped",[38923]],[[64204,64204],"mapped",[38971]],[[64205,64205],"mapped",[39698]],[[64206,64206],"mapped",[40860]],[[64207,64207],"mapped",[141386]],[[64208,64208],"mapped",[141380]],[[64209,64209],"mapped",[144341]],[[64210,64210],"mapped",[15261]],[[64211,64211],"mapped",[16408]],[[64212,64212],"mapped",[16441]],[[64213,64213],"mapped",[152137]],[[64214,64214],"mapped",[154832]],[[64215,64215],"mapped",[163539]],[[64216,64216],"mapped",[40771]],[[64217,64217],"mapped",[40846]],[[64218,64255],"disallowed"],[[64256,64256],"mapped",[102,102]],[[64257,64257],"mapped",[102,105]],[[64258,64258],"mapped",[102,108]],[[64259,64259],"mapped",[102,102,105]],[[64260,64260],"mapped",[102,102,108]],[[64261,64262],"mapped",[115,116]],[[64263,64274],"disallowed"],[[64275,64275],"mapped",[1396,1398]],[[64276,64276],"mapped",[1396,1381]],[[64277,64277],"mapped",[1396,1387]],[[64278,64278],"mapped",[1406,1398]],[[64279,64279],"mapped",[1396,1389]],[[64280,64284],"disallowed"],[[64285,64285],"mapped",[1497,1460]],[[64286,64286],"valid"],[[64287,64287],"mapped",[1522,1463]],[[64288,64288],"mapped",[1506]],[[64289,64289],"mapped",[1488]],[[64290,64290],"mapped",[1491]],[[64291,64291],"mapped",[1492]],[[64292,64292],"mapped",[1499]],[[64293,64293],"mapped",[1500]],[[64294,64294],"mapped",[1501]],[[64295,64295],"mapped",[1512]],[[64296,64296],"mapped",[1514]],[[64297,64297],"disallowed_STD3_mapped",[43]],[[64298,64298],"mapped",[1513,1473]],[[64299,64299],"mapped",[1513,1474]],[[64300,64300],"mapped",[1513,1468,1473]],[[64301,64301],"mapped",[1513,1468,1474]],[[64302,64302],"mapped",[1488,1463]],[[64303,64303],"mapped",[1488,1464]],[[64304,64304],"mapped",[1488,1468]],[[64305,64305],"mapped",[1489,1468]],[[64306,64306],"mapped",[1490,1468]],[[64307,64307],"mapped",[1491,1468]],[[64308,64308],"mapped",[1492,1468]],[[64309,64309],"mapped",[1493,1468]],[[64310,64310],"mapped",[1494,1468]],[[64311,64311],"disallowed"],[[64312,64312],"mapped",[1496,1468]],[[64313,64313],"mapped",[1497,1468]],[[64314,64314],"mapped",[1498,1468]],[[64315,64315],"mapped",[1499,1468]],[[64316,64316],"mapped",[1500,1468]],[[64317,64317],"disallowed"],[[64318,64318],"mapped",[1502,1468]],[[64319,64319],"disallowed"],[[64320,64320],"mapped",[1504,1468]],[[64321,64321],"mapped",[1505,1468]],[[64322,64322],"disallowed"],[[64323,64323],"mapped",[1507,1468]],[[64324,64324],"mapped",[1508,1468]],[[64325,64325],"disallowed"],[[64326,64326],"mapped",[1510,1468]],[[64327,64327],"mapped",[1511,1468]],[[64328,64328],"mapped",[1512,1468]],[[64329,64329],"mapped",[1513,1468]],[[64330,64330],"mapped",[1514,1468]],[[64331,64331],"mapped",[1493,1465]],[[64332,64332],"mapped",[1489,1471]],[[64333,64333],"mapped",[1499,1471]],[[64334,64334],"mapped",[1508,1471]],[[64335,64335],"mapped",[1488,1500]],[[64336,64337],"mapped",[1649]],[[64338,64341],"mapped",[1659]],[[64342,64345],"mapped",[1662]],[[64346,64349],"mapped",[1664]],[[64350,64353],"mapped",[1658]],[[64354,64357],"mapped",[1663]],[[64358,64361],"mapped",[1657]],[[64362,64365],"mapped",[1700]],[[64366,64369],"mapped",[1702]],[[64370,64373],"mapped",[1668]],[[64374,64377],"mapped",[1667]],[[64378,64381],"mapped",[1670]],[[64382,64385],"mapped",[1671]],[[64386,64387],"mapped",[1677]],[[64388,64389],"mapped",[1676]],[[64390,64391],"mapped",[1678]],[[64392,64393],"mapped",[1672]],[[64394,64395],"mapped",[1688]],[[64396,64397],"mapped",[1681]],[[64398,64401],"mapped",[1705]],[[64402,64405],"mapped",[1711]],[[64406,64409],"mapped",[1715]],[[64410,64413],"mapped",[1713]],[[64414,64415],"mapped",[1722]],[[64416,64419],"mapped",[1723]],[[64420,64421],"mapped",[1728]],[[64422,64425],"mapped",[1729]],[[64426,64429],"mapped",[1726]],[[64430,64431],"mapped",[1746]],[[64432,64433],"mapped",[1747]],[[64434,64449],"valid",[],"NV8"],[[64450,64466],"disallowed"],[[64467,64470],"mapped",[1709]],[[64471,64472],"mapped",[1735]],[[64473,64474],"mapped",[1734]],[[64475,64476],"mapped",[1736]],[[64477,64477],"mapped",[1735,1652]],[[64478,64479],"mapped",[1739]],[[64480,64481],"mapped",[1733]],[[64482,64483],"mapped",[1737]],[[64484,64487],"mapped",[1744]],[[64488,64489],"mapped",[1609]],[[64490,64491],"mapped",[1574,1575]],[[64492,64493],"mapped",[1574,1749]],[[64494,64495],"mapped",[1574,1608]],[[64496,64497],"mapped",[1574,1735]],[[64498,64499],"mapped",[1574,1734]],[[64500,64501],"mapped",[1574,1736]],[[64502,64504],"mapped",[1574,1744]],[[64505,64507],"mapped",[1574,1609]],[[64508,64511],"mapped",[1740]],[[64512,64512],"mapped",[1574,1580]],[[64513,64513],"mapped",[1574,1581]],[[64514,64514],"mapped",[1574,1605]],[[64515,64515],"mapped",[1574,1609]],[[64516,64516],"mapped",[1574,1610]],[[64517,64517],"mapped",[1576,1580]],[[64518,64518],"mapped",[1576,1581]],[[64519,64519],"mapped",[1576,1582]],[[64520,64520],"mapped",[1576,1605]],[[64521,64521],"mapped",[1576,1609]],[[64522,64522],"mapped",[1576,1610]],[[64523,64523],"mapped",[1578,1580]],[[64524,64524],"mapped",[1578,1581]],[[64525,64525],"mapped",[1578,1582]],[[64526,64526],"mapped",[1578,1605]],[[64527,64527],"mapped",[1578,1609]],[[64528,64528],"mapped",[1578,1610]],[[64529,64529],"mapped",[1579,1580]],[[64530,64530],"mapped",[1579,1605]],[[64531,64531],"mapped",[1579,1609]],[[64532,64532],"mapped",[1579,1610]],[[64533,64533],"mapped",[1580,1581]],[[64534,64534],"mapped",[1580,1605]],[[64535,64535],"mapped",[1581,1580]],[[64536,64536],"mapped",[1581,1605]],[[64537,64537],"mapped",[1582,1580]],[[64538,64538],"mapped",[1582,1581]],[[64539,64539],"mapped",[1582,1605]],[[64540,64540],"mapped",[1587,1580]],[[64541,64541],"mapped",[1587,1581]],[[64542,64542],"mapped",[1587,1582]],[[64543,64543],"mapped",[1587,1605]],[[64544,64544],"mapped",[1589,1581]],[[64545,64545],"mapped",[1589,1605]],[[64546,64546],"mapped",[1590,1580]],[[64547,64547],"mapped",[1590,1581]],[[64548,64548],"mapped",[1590,1582]],[[64549,64549],"mapped",[1590,1605]],[[64550,64550],"mapped",[1591,1581]],[[64551,64551],"mapped",[1591,1605]],[[64552,64552],"mapped",[1592,1605]],[[64553,64553],"mapped",[1593,1580]],[[64554,64554],"mapped",[1593,1605]],[[64555,64555],"mapped",[1594,1580]],[[64556,64556],"mapped",[1594,1605]],[[64557,64557],"mapped",[1601,1580]],[[64558,64558],"mapped",[1601,1581]],[[64559,64559],"mapped",[1601,1582]],[[64560,64560],"mapped",[1601,1605]],[[64561,64561],"mapped",[1601,1609]],[[64562,64562],"mapped",[1601,1610]],[[64563,64563],"mapped",[1602,1581]],[[64564,64564],"mapped",[1602,1605]],[[64565,64565],"mapped",[1602,1609]],[[64566,64566],"mapped",[1602,1610]],[[64567,64567],"mapped",[1603,1575]],[[64568,64568],"mapped",[1603,1580]],[[64569,64569],"mapped",[1603,1581]],[[64570,64570],"mapped",[1603,1582]],[[64571,64571],"mapped",[1603,1604]],[[64572,64572],"mapped",[1603,1605]],[[64573,64573],"mapped",[1603,1609]],[[64574,64574],"mapped",[1603,1610]],[[64575,64575],"mapped",[1604,1580]],[[64576,64576],"mapped",[1604,1581]],[[64577,64577],"mapped",[1604,1582]],[[64578,64578],"mapped",[1604,1605]],[[64579,64579],"mapped",[1604,1609]],[[64580,64580],"mapped",[1604,1610]],[[64581,64581],"mapped",[1605,1580]],[[64582,64582],"mapped",[1605,1581]],[[64583,64583],"mapped",[1605,1582]],[[64584,64584],"mapped",[1605,1605]],[[64585,64585],"mapped",[1605,1609]],[[64586,64586],"mapped",[1605,1610]],[[64587,64587],"mapped",[1606,1580]],[[64588,64588],"mapped",[1606,1581]],[[64589,64589],"mapped",[1606,1582]],[[64590,64590],"mapped",[1606,1605]],[[64591,64591],"mapped",[1606,1609]],[[64592,64592],"mapped",[1606,1610]],[[64593,64593],"mapped",[1607,1580]],[[64594,64594],"mapped",[1607,1605]],[[64595,64595],"mapped",[1607,1609]],[[64596,64596],"mapped",[1607,1610]],[[64597,64597],"mapped",[1610,1580]],[[64598,64598],"mapped",[1610,1581]],[[64599,64599],"mapped",[1610,1582]],[[64600,64600],"mapped",[1610,1605]],[[64601,64601],"mapped",[1610,1609]],[[64602,64602],"mapped",[1610,1610]],[[64603,64603],"mapped",[1584,1648]],[[64604,64604],"mapped",[1585,1648]],[[64605,64605],"mapped",[1609,1648]],[[64606,64606],"disallowed_STD3_mapped",[32,1612,1617]],[[64607,64607],"disallowed_STD3_mapped",[32,1613,1617]],[[64608,64608],"disallowed_STD3_mapped",[32,1614,1617]],[[64609,64609],"disallowed_STD3_mapped",[32,1615,1617]],[[64610,64610],"disallowed_STD3_mapped",[32,1616,1617]],[[64611,64611],"disallowed_STD3_mapped",[32,1617,1648]],[[64612,64612],"mapped",[1574,1585]],[[64613,64613],"mapped",[1574,1586]],[[64614,64614],"mapped",[1574,1605]],[[64615,64615],"mapped",[1574,1606]],[[64616,64616],"mapped",[1574,1609]],[[64617,64617],"mapped",[1574,1610]],[[64618,64618],"mapped",[1576,1585]],[[64619,64619],"mapped",[1576,1586]],[[64620,64620],"mapped",[1576,1605]],[[64621,64621],"mapped",[1576,1606]],[[64622,64622],"mapped",[1576,1609]],[[64623,64623],"mapped",[1576,1610]],[[64624,64624],"mapped",[1578,1585]],[[64625,64625],"mapped",[1578,1586]],[[64626,64626],"mapped",[1578,1605]],[[64627,64627],"mapped",[1578,1606]],[[64628,64628],"mapped",[1578,1609]],[[64629,64629],"mapped",[1578,1610]],[[64630,64630],"mapped",[1579,1585]],[[64631,64631],"mapped",[1579,1586]],[[64632,64632],"mapped",[1579,1605]],[[64633,64633],"mapped",[1579,1606]],[[64634,64634],"mapped",[1579,1609]],[[64635,64635],"mapped",[1579,1610]],[[64636,64636],"mapped",[1601,1609]],[[64637,64637],"mapped",[1601,1610]],[[64638,64638],"mapped",[1602,1609]],[[64639,64639],"mapped",[1602,1610]],[[64640,64640],"mapped",[1603,1575]],[[64641,64641],"mapped",[1603,1604]],[[64642,64642],"mapped",[1603,1605]],[[64643,64643],"mapped",[1603,1609]],[[64644,64644],"mapped",[1603,1610]],[[64645,64645],"mapped",[1604,1605]],[[64646,64646],"mapped",[1604,1609]],[[64647,64647],"mapped",[1604,1610]],[[64648,64648],"mapped",[1605,1575]],[[64649,64649],"mapped",[1605,1605]],[[64650,64650],"mapped",[1606,1585]],[[64651,64651],"mapped",[1606,1586]],[[64652,64652],"mapped",[1606,1605]],[[64653,64653],"mapped",[1606,1606]],[[64654,64654],"mapped",[1606,1609]],[[64655,64655],"mapped",[1606,1610]],[[64656,64656],"mapped",[1609,1648]],[[64657,64657],"mapped",[1610,1585]],[[64658,64658],"mapped",[1610,1586]],[[64659,64659],"mapped",[1610,1605]],[[64660,64660],"mapped",[1610,1606]],[[64661,64661],"mapped",[1610,1609]],[[64662,64662],"mapped",[1610,1610]],[[64663,64663],"mapped",[1574,1580]],[[64664,64664],"mapped",[1574,1581]],[[64665,64665],"mapped",[1574,1582]],[[64666,64666],"mapped",[1574,1605]],[[64667,64667],"mapped",[1574,1607]],[[64668,64668],"mapped",[1576,1580]],[[64669,64669],"mapped",[1576,1581]],[[64670,64670],"mapped",[1576,1582]],[[64671,64671],"mapped",[1576,1605]],[[64672,64672],"mapped",[1576,1607]],[[64673,64673],"mapped",[1578,1580]],[[64674,64674],"mapped",[1578,1581]],[[64675,64675],"mapped",[1578,1582]],[[64676,64676],"mapped",[1578,1605]],[[64677,64677],"mapped",[1578,1607]],[[64678,64678],"mapped",[1579,1605]],[[64679,64679],"mapped",[1580,1581]],[[64680,64680],"mapped",[1580,1605]],[[64681,64681],"mapped",[1581,1580]],[[64682,64682],"mapped",[1581,1605]],[[64683,64683],"mapped",[1582,1580]],[[64684,64684],"mapped",[1582,1605]],[[64685,64685],"mapped",[1587,1580]],[[64686,64686],"mapped",[1587,1581]],[[64687,64687],"mapped",[1587,1582]],[[64688,64688],"mapped",[1587,1605]],[[64689,64689],"mapped",[1589,1581]],[[64690,64690],"mapped",[1589,1582]],[[64691,64691],"mapped",[1589,1605]],[[64692,64692],"mapped",[1590,1580]],[[64693,64693],"mapped",[1590,1581]],[[64694,64694],"mapped",[1590,1582]],[[64695,64695],"mapped",[1590,1605]],[[64696,64696],"mapped",[1591,1581]],[[64697,64697],"mapped",[1592,1605]],[[64698,64698],"mapped",[1593,1580]],[[64699,64699],"mapped",[1593,1605]],[[64700,64700],"mapped",[1594,1580]],[[64701,64701],"mapped",[1594,1605]],[[64702,64702],"mapped",[1601,1580]],[[64703,64703],"mapped",[1601,1581]],[[64704,64704],"mapped",[1601,1582]],[[64705,64705],"mapped",[1601,1605]],[[64706,64706],"mapped",[1602,1581]],[[64707,64707],"mapped",[1602,1605]],[[64708,64708],"mapped",[1603,1580]],[[64709,64709],"mapped",[1603,1581]],[[64710,64710],"mapped",[1603,1582]],[[64711,64711],"mapped",[1603,1604]],[[64712,64712],"mapped",[1603,1605]],[[64713,64713],"mapped",[1604,1580]],[[64714,64714],"mapped",[1604,1581]],[[64715,64715],"mapped",[1604,1582]],[[64716,64716],"mapped",[1604,1605]],[[64717,64717],"mapped",[1604,1607]],[[64718,64718],"mapped",[1605,1580]],[[64719,64719],"mapped",[1605,1581]],[[64720,64720],"mapped",[1605,1582]],[[64721,64721],"mapped",[1605,1605]],[[64722,64722],"mapped",[1606,1580]],[[64723,64723],"mapped",[1606,1581]],[[64724,64724],"mapped",[1606,1582]],[[64725,64725],"mapped",[1606,1605]],[[64726,64726],"mapped",[1606,1607]],[[64727,64727],"mapped",[1607,1580]],[[64728,64728],"mapped",[1607,1605]],[[64729,64729],"mapped",[1607,1648]],[[64730,64730],"mapped",[1610,1580]],[[64731,64731],"mapped",[1610,1581]],[[64732,64732],"mapped",[1610,1582]],[[64733,64733],"mapped",[1610,1605]],[[64734,64734],"mapped",[1610,1607]],[[64735,64735],"mapped",[1574,1605]],[[64736,64736],"mapped",[1574,1607]],[[64737,64737],"mapped",[1576,1605]],[[64738,64738],"mapped",[1576,1607]],[[64739,64739],"mapped",[1578,1605]],[[64740,64740],"mapped",[1578,1607]],[[64741,64741],"mapped",[1579,1605]],[[64742,64742],"mapped",[1579,1607]],[[64743,64743],"mapped",[1587,1605]],[[64744,64744],"mapped",[1587,1607]],[[64745,64745],"mapped",[1588,1605]],[[64746,64746],"mapped",[1588,1607]],[[64747,64747],"mapped",[1603,1604]],[[64748,64748],"mapped",[1603,1605]],[[64749,64749],"mapped",[1604,1605]],[[64750,64750],"mapped",[1606,1605]],[[64751,64751],"mapped",[1606,1607]],[[64752,64752],"mapped",[1610,1605]],[[64753,64753],"mapped",[1610,1607]],[[64754,64754],"mapped",[1600,1614,1617]],[[64755,64755],"mapped",[1600,1615,1617]],[[64756,64756],"mapped",[1600,1616,1617]],[[64757,64757],"mapped",[1591,1609]],[[64758,64758],"mapped",[1591,1610]],[[64759,64759],"mapped",[1593,1609]],[[64760,64760],"mapped",[1593,1610]],[[64761,64761],"mapped",[1594,1609]],[[64762,64762],"mapped",[1594,1610]],[[64763,64763],"mapped",[1587,1609]],[[64764,64764],"mapped",[1587,1610]],[[64765,64765],"mapped",[1588,1609]],[[64766,64766],"mapped",[1588,1610]],[[64767,64767],"mapped",[1581,1609]],[[64768,64768],"mapped",[1581,1610]],[[64769,64769],"mapped",[1580,1609]],[[64770,64770],"mapped",[1580,1610]],[[64771,64771],"mapped",[1582,1609]],[[64772,64772],"mapped",[1582,1610]],[[64773,64773],"mapped",[1589,1609]],[[64774,64774],"mapped",[1589,1610]],[[64775,64775],"mapped",[1590,1609]],[[64776,64776],"mapped",[1590,1610]],[[64777,64777],"mapped",[1588,1580]],[[64778,64778],"mapped",[1588,1581]],[[64779,64779],"mapped",[1588,1582]],[[64780,64780],"mapped",[1588,1605]],[[64781,64781],"mapped",[1588,1585]],[[64782,64782],"mapped",[1587,1585]],[[64783,64783],"mapped",[1589,1585]],[[64784,64784],"mapped",[1590,1585]],[[64785,64785],"mapped",[1591,1609]],[[64786,64786],"mapped",[1591,1610]],[[64787,64787],"mapped",[1593,1609]],[[64788,64788],"mapped",[1593,1610]],[[64789,64789],"mapped",[1594,1609]],[[64790,64790],"mapped",[1594,1610]],[[64791,64791],"mapped",[1587,1609]],[[64792,64792],"mapped",[1587,1610]],[[64793,64793],"mapped",[1588,1609]],[[64794,64794],"mapped",[1588,1610]],[[64795,64795],"mapped",[1581,1609]],[[64796,64796],"mapped",[1581,1610]],[[64797,64797],"mapped",[1580,1609]],[[64798,64798],"mapped",[1580,1610]],[[64799,64799],"mapped",[1582,1609]],[[64800,64800],"mapped",[1582,1610]],[[64801,64801],"mapped",[1589,1609]],[[64802,64802],"mapped",[1589,1610]],[[64803,64803],"mapped",[1590,1609]],[[64804,64804],"mapped",[1590,1610]],[[64805,64805],"mapped",[1588,1580]],[[64806,64806],"mapped",[1588,1581]],[[64807,64807],"mapped",[1588,1582]],[[64808,64808],"mapped",[1588,1605]],[[64809,64809],"mapped",[1588,1585]],[[64810,64810],"mapped",[1587,1585]],[[64811,64811],"mapped",[1589,1585]],[[64812,64812],"mapped",[1590,1585]],[[64813,64813],"mapped",[1588,1580]],[[64814,64814],"mapped",[1588,1581]],[[64815,64815],"mapped",[1588,1582]],[[64816,64816],"mapped",[1588,1605]],[[64817,64817],"mapped",[1587,1607]],[[64818,64818],"mapped",[1588,1607]],[[64819,64819],"mapped",[1591,1605]],[[64820,64820],"mapped",[1587,1580]],[[64821,64821],"mapped",[1587,1581]],[[64822,64822],"mapped",[1587,1582]],[[64823,64823],"mapped",[1588,1580]],[[64824,64824],"mapped",[1588,1581]],[[64825,64825],"mapped",[1588,1582]],[[64826,64826],"mapped",[1591,1605]],[[64827,64827],"mapped",[1592,1605]],[[64828,64829],"mapped",[1575,1611]],[[64830,64831],"valid",[],"NV8"],[[64832,64847],"disallowed"],[[64848,64848],"mapped",[1578,1580,1605]],[[64849,64850],"mapped",[1578,1581,1580]],[[64851,64851],"mapped",[1578,1581,1605]],[[64852,64852],"mapped",[1578,1582,1605]],[[64853,64853],"mapped",[1578,1605,1580]],[[64854,64854],"mapped",[1578,1605,1581]],[[64855,64855],"mapped",[1578,1605,1582]],[[64856,64857],"mapped",[1580,1605,1581]],[[64858,64858],"mapped",[1581,1605,1610]],[[64859,64859],"mapped",[1581,1605,1609]],[[64860,64860],"mapped",[1587,1581,1580]],[[64861,64861],"mapped",[1587,1580,1581]],[[64862,64862],"mapped",[1587,1580,1609]],[[64863,64864],"mapped",[1587,1605,1581]],[[64865,64865],"mapped",[1587,1605,1580]],[[64866,64867],"mapped",[1587,1605,1605]],[[64868,64869],"mapped",[1589,1581,1581]],[[64870,64870],"mapped",[1589,1605,1605]],[[64871,64872],"mapped",[1588,1581,1605]],[[64873,64873],"mapped",[1588,1580,1610]],[[64874,64875],"mapped",[1588,1605,1582]],[[64876,64877],"mapped",[1588,1605,1605]],[[64878,64878],"mapped",[1590,1581,1609]],[[64879,64880],"mapped",[1590,1582,1605]],[[64881,64882],"mapped",[1591,1605,1581]],[[64883,64883],"mapped",[1591,1605,1605]],[[64884,64884],"mapped",[1591,1605,1610]],[[64885,64885],"mapped",[1593,1580,1605]],[[64886,64887],"mapped",[1593,1605,1605]],[[64888,64888],"mapped",[1593,1605,1609]],[[64889,64889],"mapped",[1594,1605,1605]],[[64890,64890],"mapped",[1594,1605,1610]],[[64891,64891],"mapped",[1594,1605,1609]],[[64892,64893],"mapped",[1601,1582,1605]],[[64894,64894],"mapped",[1602,1605,1581]],[[64895,64895],"mapped",[1602,1605,1605]],[[64896,64896],"mapped",[1604,1581,1605]],[[64897,64897],"mapped",[1604,1581,1610]],[[64898,64898],"mapped",[1604,1581,1609]],[[64899,64900],"mapped",[1604,1580,1580]],[[64901,64902],"mapped",[1604,1582,1605]],[[64903,64904],"mapped",[1604,1605,1581]],[[64905,64905],"mapped",[1605,1581,1580]],[[64906,64906],"mapped",[1605,1581,1605]],[[64907,64907],"mapped",[1605,1581,1610]],[[64908,64908],"mapped",[1605,1580,1581]],[[64909,64909],"mapped",[1605,1580,1605]],[[64910,64910],"mapped",[1605,1582,1580]],[[64911,64911],"mapped",[1605,1582,1605]],[[64912,64913],"disallowed"],[[64914,64914],"mapped",[1605,1580,1582]],[[64915,64915],"mapped",[1607,1605,1580]],[[64916,64916],"mapped",[1607,1605,1605]],[[64917,64917],"mapped",[1606,1581,1605]],[[64918,64918],"mapped",[1606,1581,1609]],[[64919,64920],"mapped",[1606,1580,1605]],[[64921,64921],"mapped",[1606,1580,1609]],[[64922,64922],"mapped",[1606,1605,1610]],[[64923,64923],"mapped",[1606,1605,1609]],[[64924,64925],"mapped",[1610,1605,1605]],[[64926,64926],"mapped",[1576,1582,1610]],[[64927,64927],"mapped",[1578,1580,1610]],[[64928,64928],"mapped",[1578,1580,1609]],[[64929,64929],"mapped",[1578,1582,1610]],[[64930,64930],"mapped",[1578,1582,1609]],[[64931,64931],"mapped",[1578,1605,1610]],[[64932,64932],"mapped",[1578,1605,1609]],[[64933,64933],"mapped",[1580,1605,1610]],[[64934,64934],"mapped",[1580,1581,1609]],[[64935,64935],"mapped",[1580,1605,1609]],[[64936,64936],"mapped",[1587,1582,1609]],[[64937,64937],"mapped",[1589,1581,1610]],[[64938,64938],"mapped",[1588,1581,1610]],[[64939,64939],"mapped",[1590,1581,1610]],[[64940,64940],"mapped",[1604,1580,1610]],[[64941,64941],"mapped",[1604,1605,1610]],[[64942,64942],"mapped",[1610,1581,1610]],[[64943,64943],"mapped",[1610,1580,1610]],[[64944,64944],"mapped",[1610,1605,1610]],[[64945,64945],"mapped",[1605,1605,1610]],[[64946,64946],"mapped",[1602,1605,1610]],[[64947,64947],"mapped",[1606,1581,1610]],[[64948,64948],"mapped",[1602,1605,1581]],[[64949,64949],"mapped",[1604,1581,1605]],[[64950,64950],"mapped",[1593,1605,1610]],[[64951,64951],"mapped",[1603,1605,1610]],[[64952,64952],"mapped",[1606,1580,1581]],[[64953,64953],"mapped",[1605,1582,1610]],[[64954,64954],"mapped",[1604,1580,1605]],[[64955,64955],"mapped",[1603,1605,1605]],[[64956,64956],"mapped",[1604,1580,1605]],[[64957,64957],"mapped",[1606,1580,1581]],[[64958,64958],"mapped",[1580,1581,1610]],[[64959,64959],"mapped",[1581,1580,1610]],[[64960,64960],"mapped",[1605,1580,1610]],[[64961,64961],"mapped",[1601,1605,1610]],[[64962,64962],"mapped",[1576,1581,1610]],[[64963,64963],"mapped",[1603,1605,1605]],[[64964,64964],"mapped",[1593,1580,1605]],[[64965,64965],"mapped",[1589,1605,1605]],[[64966,64966],"mapped",[1587,1582,1610]],[[64967,64967],"mapped",[1606,1580,1610]],[[64968,64975],"disallowed"],[[64976,65007],"disallowed"],[[65008,65008],"mapped",[1589,1604,1746]],[[65009,65009],"mapped",[1602,1604,1746]],[[65010,65010],"mapped",[1575,1604,1604,1607]],[[65011,65011],"mapped",[1575,1603,1576,1585]],[[65012,65012],"mapped",[1605,1581,1605,1583]],[[65013,65013],"mapped",[1589,1604,1593,1605]],[[65014,65014],"mapped",[1585,1587,1608,1604]],[[65015,65015],"mapped",[1593,1604,1610,1607]],[[65016,65016],"mapped",[1608,1587,1604,1605]],[[65017,65017],"mapped",[1589,1604,1609]],[[65018,65018],"disallowed_STD3_mapped",[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605]],[[65019,65019],"disallowed_STD3_mapped",[1580,1604,32,1580,1604,1575,1604,1607]],[[65020,65020],"mapped",[1585,1740,1575,1604]],[[65021,65021],"valid",[],"NV8"],[[65022,65023],"disallowed"],[[65024,65039],"ignored"],[[65040,65040],"disallowed_STD3_mapped",[44]],[[65041,65041],"mapped",[12289]],[[65042,65042],"disallowed"],[[65043,65043],"disallowed_STD3_mapped",[58]],[[65044,65044],"disallowed_STD3_mapped",[59]],[[65045,65045],"disallowed_STD3_mapped",[33]],[[65046,65046],"disallowed_STD3_mapped",[63]],[[65047,65047],"mapped",[12310]],[[65048,65048],"mapped",[12311]],[[65049,65049],"disallowed"],[[65050,65055],"disallowed"],[[65056,65059],"valid"],[[65060,65062],"valid"],[[65063,65069],"valid"],[[65070,65071],"valid"],[[65072,65072],"disallowed"],[[65073,65073],"mapped",[8212]],[[65074,65074],"mapped",[8211]],[[65075,65076],"disallowed_STD3_mapped",[95]],[[65077,65077],"disallowed_STD3_mapped",[40]],[[65078,65078],"disallowed_STD3_mapped",[41]],[[65079,65079],"disallowed_STD3_mapped",[123]],[[65080,65080],"disallowed_STD3_mapped",[125]],[[65081,65081],"mapped",[12308]],[[65082,65082],"mapped",[12309]],[[65083,65083],"mapped",[12304]],[[65084,65084],"mapped",[12305]],[[65085,65085],"mapped",[12298]],[[65086,65086],"mapped",[12299]],[[65087,65087],"mapped",[12296]],[[65088,65088],"mapped",[12297]],[[65089,65089],"mapped",[12300]],[[65090,65090],"mapped",[12301]],[[65091,65091],"mapped",[12302]],[[65092,65092],"mapped",[12303]],[[65093,65094],"valid",[],"NV8"],[[65095,65095],"disallowed_STD3_mapped",[91]],[[65096,65096],"disallowed_STD3_mapped",[93]],[[65097,65100],"disallowed_STD3_mapped",[32,773]],[[65101,65103],"disallowed_STD3_mapped",[95]],[[65104,65104],"disallowed_STD3_mapped",[44]],[[65105,65105],"mapped",[12289]],[[65106,65106],"disallowed"],[[65107,65107],"disallowed"],[[65108,65108],"disallowed_STD3_mapped",[59]],[[65109,65109],"disallowed_STD3_mapped",[58]],[[65110,65110],"disallowed_STD3_mapped",[63]],[[65111,65111],"disallowed_STD3_mapped",[33]],[[65112,65112],"mapped",[8212]],[[65113,65113],"disallowed_STD3_mapped",[40]],[[65114,65114],"disallowed_STD3_mapped",[41]],[[65115,65115],"disallowed_STD3_mapped",[123]],[[65116,65116],"disallowed_STD3_mapped",[125]],[[65117,65117],"mapped",[12308]],[[65118,65118],"mapped",[12309]],[[65119,65119],"disallowed_STD3_mapped",[35]],[[65120,65120],"disallowed_STD3_mapped",[38]],[[65121,65121],"disallowed_STD3_mapped",[42]],[[65122,65122],"disallowed_STD3_mapped",[43]],[[65123,65123],"mapped",[45]],[[65124,65124],"disallowed_STD3_mapped",[60]],[[65125,65125],"disallowed_STD3_mapped",[62]],[[65126,65126],"disallowed_STD3_mapped",[61]],[[65127,65127],"disallowed"],[[65128,65128],"disallowed_STD3_mapped",[92]],[[65129,65129],"disallowed_STD3_mapped",[36]],[[65130,65130],"disallowed_STD3_mapped",[37]],[[65131,65131],"disallowed_STD3_mapped",[64]],[[65132,65135],"disallowed"],[[65136,65136],"disallowed_STD3_mapped",[32,1611]],[[65137,65137],"mapped",[1600,1611]],[[65138,65138],"disallowed_STD3_mapped",[32,1612]],[[65139,65139],"valid"],[[65140,65140],"disallowed_STD3_mapped",[32,1613]],[[65141,65141],"disallowed"],[[65142,65142],"disallowed_STD3_mapped",[32,1614]],[[65143,65143],"mapped",[1600,1614]],[[65144,65144],"disallowed_STD3_mapped",[32,1615]],[[65145,65145],"mapped",[1600,1615]],[[65146,65146],"disallowed_STD3_mapped",[32,1616]],[[65147,65147],"mapped",[1600,1616]],[[65148,65148],"disallowed_STD3_mapped",[32,1617]],[[65149,65149],"mapped",[1600,1617]],[[65150,65150],"disallowed_STD3_mapped",[32,1618]],[[65151,65151],"mapped",[1600,1618]],[[65152,65152],"mapped",[1569]],[[65153,65154],"mapped",[1570]],[[65155,65156],"mapped",[1571]],[[65157,65158],"mapped",[1572]],[[65159,65160],"mapped",[1573]],[[65161,65164],"mapped",[1574]],[[65165,65166],"mapped",[1575]],[[65167,65170],"mapped",[1576]],[[65171,65172],"mapped",[1577]],[[65173,65176],"mapped",[1578]],[[65177,65180],"mapped",[1579]],[[65181,65184],"mapped",[1580]],[[65185,65188],"mapped",[1581]],[[65189,65192],"mapped",[1582]],[[65193,65194],"mapped",[1583]],[[65195,65196],"mapped",[1584]],[[65197,65198],"mapped",[1585]],[[65199,65200],"mapped",[1586]],[[65201,65204],"mapped",[1587]],[[65205,65208],"mapped",[1588]],[[65209,65212],"mapped",[1589]],[[65213,65216],"mapped",[1590]],[[65217,65220],"mapped",[1591]],[[65221,65224],"mapped",[1592]],[[65225,65228],"mapped",[1593]],[[65229,65232],"mapped",[1594]],[[65233,65236],"mapped",[1601]],[[65237,65240],"mapped",[1602]],[[65241,65244],"mapped",[1603]],[[65245,65248],"mapped",[1604]],[[65249,65252],"mapped",[1605]],[[65253,65256],"mapped",[1606]],[[65257,65260],"mapped",[1607]],[[65261,65262],"mapped",[1608]],[[65263,65264],"mapped",[1609]],[[65265,65268],"mapped",[1610]],[[65269,65270],"mapped",[1604,1570]],[[65271,65272],"mapped",[1604,1571]],[[65273,65274],"mapped",[1604,1573]],[[65275,65276],"mapped",[1604,1575]],[[65277,65278],"disallowed"],[[65279,65279],"ignored"],[[65280,65280],"disallowed"],[[65281,65281],"disallowed_STD3_mapped",[33]],[[65282,65282],"disallowed_STD3_mapped",[34]],[[65283,65283],"disallowed_STD3_mapped",[35]],[[65284,65284],"disallowed_STD3_mapped",[36]],[[65285,65285],"disallowed_STD3_mapped",[37]],[[65286,65286],"disallowed_STD3_mapped",[38]],[[65287,65287],"disallowed_STD3_mapped",[39]],[[65288,65288],"disallowed_STD3_mapped",[40]],[[65289,65289],"disallowed_STD3_mapped",[41]],[[65290,65290],"disallowed_STD3_mapped",[42]],[[65291,65291],"disallowed_STD3_mapped",[43]],[[65292,65292],"disallowed_STD3_mapped",[44]],[[65293,65293],"mapped",[45]],[[65294,65294],"mapped",[46]],[[65295,65295],"disallowed_STD3_mapped",[47]],[[65296,65296],"mapped",[48]],[[65297,65297],"mapped",[49]],[[65298,65298],"mapped",[50]],[[65299,65299],"mapped",[51]],[[65300,65300],"mapped",[52]],[[65301,65301],"mapped",[53]],[[65302,65302],"mapped",[54]],[[65303,65303],"mapped",[55]],[[65304,65304],"mapped",[56]],[[65305,65305],"mapped",[57]],[[65306,65306],"disallowed_STD3_mapped",[58]],[[65307,65307],"disallowed_STD3_mapped",[59]],[[65308,65308],"disallowed_STD3_mapped",[60]],[[65309,65309],"disallowed_STD3_mapped",[61]],[[65310,65310],"disallowed_STD3_mapped",[62]],[[65311,65311],"disallowed_STD3_mapped",[63]],[[65312,65312],"disallowed_STD3_mapped",[64]],[[65313,65313],"mapped",[97]],[[65314,65314],"mapped",[98]],[[65315,65315],"mapped",[99]],[[65316,65316],"mapped",[100]],[[65317,65317],"mapped",[101]],[[65318,65318],"mapped",[102]],[[65319,65319],"mapped",[103]],[[65320,65320],"mapped",[104]],[[65321,65321],"mapped",[105]],[[65322,65322],"mapped",[106]],[[65323,65323],"mapped",[107]],[[65324,65324],"mapped",[108]],[[65325,65325],"mapped",[109]],[[65326,65326],"mapped",[110]],[[65327,65327],"mapped",[111]],[[65328,65328],"mapped",[112]],[[65329,65329],"mapped",[113]],[[65330,65330],"mapped",[114]],[[65331,65331],"mapped",[115]],[[65332,65332],"mapped",[116]],[[65333,65333],"mapped",[117]],[[65334,65334],"mapped",[118]],[[65335,65335],"mapped",[119]],[[65336,65336],"mapped",[120]],[[65337,65337],"mapped",[121]],[[65338,65338],"mapped",[122]],[[65339,65339],"disallowed_STD3_mapped",[91]],[[65340,65340],"disallowed_STD3_mapped",[92]],[[65341,65341],"disallowed_STD3_mapped",[93]],[[65342,65342],"disallowed_STD3_mapped",[94]],[[65343,65343],"disallowed_STD3_mapped",[95]],[[65344,65344],"disallowed_STD3_mapped",[96]],[[65345,65345],"mapped",[97]],[[65346,65346],"mapped",[98]],[[65347,65347],"mapped",[99]],[[65348,65348],"mapped",[100]],[[65349,65349],"mapped",[101]],[[65350,65350],"mapped",[102]],[[65351,65351],"mapped",[103]],[[65352,65352],"mapped",[104]],[[65353,65353],"mapped",[105]],[[65354,65354],"mapped",[106]],[[65355,65355],"mapped",[107]],[[65356,65356],"mapped",[108]],[[65357,65357],"mapped",[109]],[[65358,65358],"mapped",[110]],[[65359,65359],"mapped",[111]],[[65360,65360],"mapped",[112]],[[65361,65361],"mapped",[113]],[[65362,65362],"mapped",[114]],[[65363,65363],"mapped",[115]],[[65364,65364],"mapped",[116]],[[65365,65365],"mapped",[117]],[[65366,65366],"mapped",[118]],[[65367,65367],"mapped",[119]],[[65368,65368],"mapped",[120]],[[65369,65369],"mapped",[121]],[[65370,65370],"mapped",[122]],[[65371,65371],"disallowed_STD3_mapped",[123]],[[65372,65372],"disallowed_STD3_mapped",[124]],[[65373,65373],"disallowed_STD3_mapped",[125]],[[65374,65374],"disallowed_STD3_mapped",[126]],[[65375,65375],"mapped",[10629]],[[65376,65376],"mapped",[10630]],[[65377,65377],"mapped",[46]],[[65378,65378],"mapped",[12300]],[[65379,65379],"mapped",[12301]],[[65380,65380],"mapped",[12289]],[[65381,65381],"mapped",[12539]],[[65382,65382],"mapped",[12530]],[[65383,65383],"mapped",[12449]],[[65384,65384],"mapped",[12451]],[[65385,65385],"mapped",[12453]],[[65386,65386],"mapped",[12455]],[[65387,65387],"mapped",[12457]],[[65388,65388],"mapped",[12515]],[[65389,65389],"mapped",[12517]],[[65390,65390],"mapped",[12519]],[[65391,65391],"mapped",[12483]],[[65392,65392],"mapped",[12540]],[[65393,65393],"mapped",[12450]],[[65394,65394],"mapped",[12452]],[[65395,65395],"mapped",[12454]],[[65396,65396],"mapped",[12456]],[[65397,65397],"mapped",[12458]],[[65398,65398],"mapped",[12459]],[[65399,65399],"mapped",[12461]],[[65400,65400],"mapped",[12463]],[[65401,65401],"mapped",[12465]],[[65402,65402],"mapped",[12467]],[[65403,65403],"mapped",[12469]],[[65404,65404],"mapped",[12471]],[[65405,65405],"mapped",[12473]],[[65406,65406],"mapped",[12475]],[[65407,65407],"mapped",[12477]],[[65408,65408],"mapped",[12479]],[[65409,65409],"mapped",[12481]],[[65410,65410],"mapped",[12484]],[[65411,65411],"mapped",[12486]],[[65412,65412],"mapped",[12488]],[[65413,65413],"mapped",[12490]],[[65414,65414],"mapped",[12491]],[[65415,65415],"mapped",[12492]],[[65416,65416],"mapped",[12493]],[[65417,65417],"mapped",[12494]],[[65418,65418],"mapped",[12495]],[[65419,65419],"mapped",[12498]],[[65420,65420],"mapped",[12501]],[[65421,65421],"mapped",[12504]],[[65422,65422],"mapped",[12507]],[[65423,65423],"mapped",[12510]],[[65424,65424],"mapped",[12511]],[[65425,65425],"mapped",[12512]],[[65426,65426],"mapped",[12513]],[[65427,65427],"mapped",[12514]],[[65428,65428],"mapped",[12516]],[[65429,65429],"mapped",[12518]],[[65430,65430],"mapped",[12520]],[[65431,65431],"mapped",[12521]],[[65432,65432],"mapped",[12522]],[[65433,65433],"mapped",[12523]],[[65434,65434],"mapped",[12524]],[[65435,65435],"mapped",[12525]],[[65436,65436],"mapped",[12527]],[[65437,65437],"mapped",[12531]],[[65438,65438],"mapped",[12441]],[[65439,65439],"mapped",[12442]],[[65440,65440],"disallowed"],[[65441,65441],"mapped",[4352]],[[65442,65442],"mapped",[4353]],[[65443,65443],"mapped",[4522]],[[65444,65444],"mapped",[4354]],[[65445,65445],"mapped",[4524]],[[65446,65446],"mapped",[4525]],[[65447,65447],"mapped",[4355]],[[65448,65448],"mapped",[4356]],[[65449,65449],"mapped",[4357]],[[65450,65450],"mapped",[4528]],[[65451,65451],"mapped",[4529]],[[65452,65452],"mapped",[4530]],[[65453,65453],"mapped",[4531]],[[65454,65454],"mapped",[4532]],[[65455,65455],"mapped",[4533]],[[65456,65456],"mapped",[4378]],[[65457,65457],"mapped",[4358]],[[65458,65458],"mapped",[4359]],[[65459,65459],"mapped",[4360]],[[65460,65460],"mapped",[4385]],[[65461,65461],"mapped",[4361]],[[65462,65462],"mapped",[4362]],[[65463,65463],"mapped",[4363]],[[65464,65464],"mapped",[4364]],[[65465,65465],"mapped",[4365]],[[65466,65466],"mapped",[4366]],[[65467,65467],"mapped",[4367]],[[65468,65468],"mapped",[4368]],[[65469,65469],"mapped",[4369]],[[65470,65470],"mapped",[4370]],[[65471,65473],"disallowed"],[[65474,65474],"mapped",[4449]],[[65475,65475],"mapped",[4450]],[[65476,65476],"mapped",[4451]],[[65477,65477],"mapped",[4452]],[[65478,65478],"mapped",[4453]],[[65479,65479],"mapped",[4454]],[[65480,65481],"disallowed"],[[65482,65482],"mapped",[4455]],[[65483,65483],"mapped",[4456]],[[65484,65484],"mapped",[4457]],[[65485,65485],"mapped",[4458]],[[65486,65486],"mapped",[4459]],[[65487,65487],"mapped",[4460]],[[65488,65489],"disallowed"],[[65490,65490],"mapped",[4461]],[[65491,65491],"mapped",[4462]],[[65492,65492],"mapped",[4463]],[[65493,65493],"mapped",[4464]],[[65494,65494],"mapped",[4465]],[[65495,65495],"mapped",[4466]],[[65496,65497],"disallowed"],[[65498,65498],"mapped",[4467]],[[65499,65499],"mapped",[4468]],[[65500,65500],"mapped",[4469]],[[65501,65503],"disallowed"],[[65504,65504],"mapped",[162]],[[65505,65505],"mapped",[163]],[[65506,65506],"mapped",[172]],[[65507,65507],"disallowed_STD3_mapped",[32,772]],[[65508,65508],"mapped",[166]],[[65509,65509],"mapped",[165]],[[65510,65510],"mapped",[8361]],[[65511,65511],"disallowed"],[[65512,65512],"mapped",[9474]],[[65513,65513],"mapped",[8592]],[[65514,65514],"mapped",[8593]],[[65515,65515],"mapped",[8594]],[[65516,65516],"mapped",[8595]],[[65517,65517],"mapped",[9632]],[[65518,65518],"mapped",[9675]],[[65519,65528],"disallowed"],[[65529,65531],"disallowed"],[[65532,65532],"disallowed"],[[65533,65533],"disallowed"],[[65534,65535],"disallowed"],[[65536,65547],"valid"],[[65548,65548],"disallowed"],[[65549,65574],"valid"],[[65575,65575],"disallowed"],[[65576,65594],"valid"],[[65595,65595],"disallowed"],[[65596,65597],"valid"],[[65598,65598],"disallowed"],[[65599,65613],"valid"],[[65614,65615],"disallowed"],[[65616,65629],"valid"],[[65630,65663],"disallowed"],[[65664,65786],"valid"],[[65787,65791],"disallowed"],[[65792,65794],"valid",[],"NV8"],[[65795,65798],"disallowed"],[[65799,65843],"valid",[],"NV8"],[[65844,65846],"disallowed"],[[65847,65855],"valid",[],"NV8"],[[65856,65930],"valid",[],"NV8"],[[65931,65932],"valid",[],"NV8"],[[65933,65935],"disallowed"],[[65936,65947],"valid",[],"NV8"],[[65948,65951],"disallowed"],[[65952,65952],"valid",[],"NV8"],[[65953,65999],"disallowed"],[[66000,66044],"valid",[],"NV8"],[[66045,66045],"valid"],[[66046,66175],"disallowed"],[[66176,66204],"valid"],[[66205,66207],"disallowed"],[[66208,66256],"valid"],[[66257,66271],"disallowed"],[[66272,66272],"valid"],[[66273,66299],"valid",[],"NV8"],[[66300,66303],"disallowed"],[[66304,66334],"valid"],[[66335,66335],"valid"],[[66336,66339],"valid",[],"NV8"],[[66340,66351],"disallowed"],[[66352,66368],"valid"],[[66369,66369],"valid",[],"NV8"],[[66370,66377],"valid"],[[66378,66378],"valid",[],"NV8"],[[66379,66383],"disallowed"],[[66384,66426],"valid"],[[66427,66431],"disallowed"],[[66432,66461],"valid"],[[66462,66462],"disallowed"],[[66463,66463],"valid",[],"NV8"],[[66464,66499],"valid"],[[66500,66503],"disallowed"],[[66504,66511],"valid"],[[66512,66517],"valid",[],"NV8"],[[66518,66559],"disallowed"],[[66560,66560],"mapped",[66600]],[[66561,66561],"mapped",[66601]],[[66562,66562],"mapped",[66602]],[[66563,66563],"mapped",[66603]],[[66564,66564],"mapped",[66604]],[[66565,66565],"mapped",[66605]],[[66566,66566],"mapped",[66606]],[[66567,66567],"mapped",[66607]],[[66568,66568],"mapped",[66608]],[[66569,66569],"mapped",[66609]],[[66570,66570],"mapped",[66610]],[[66571,66571],"mapped",[66611]],[[66572,66572],"mapped",[66612]],[[66573,66573],"mapped",[66613]],[[66574,66574],"mapped",[66614]],[[66575,66575],"mapped",[66615]],[[66576,66576],"mapped",[66616]],[[66577,66577],"mapped",[66617]],[[66578,66578],"mapped",[66618]],[[66579,66579],"mapped",[66619]],[[66580,66580],"mapped",[66620]],[[66581,66581],"mapped",[66621]],[[66582,66582],"mapped",[66622]],[[66583,66583],"mapped",[66623]],[[66584,66584],"mapped",[66624]],[[66585,66585],"mapped",[66625]],[[66586,66586],"mapped",[66626]],[[66587,66587],"mapped",[66627]],[[66588,66588],"mapped",[66628]],[[66589,66589],"mapped",[66629]],[[66590,66590],"mapped",[66630]],[[66591,66591],"mapped",[66631]],[[66592,66592],"mapped",[66632]],[[66593,66593],"mapped",[66633]],[[66594,66594],"mapped",[66634]],[[66595,66595],"mapped",[66635]],[[66596,66596],"mapped",[66636]],[[66597,66597],"mapped",[66637]],[[66598,66598],"mapped",[66638]],[[66599,66599],"mapped",[66639]],[[66600,66637],"valid"],[[66638,66717],"valid"],[[66718,66719],"disallowed"],[[66720,66729],"valid"],[[66730,66815],"disallowed"],[[66816,66855],"valid"],[[66856,66863],"disallowed"],[[66864,66915],"valid"],[[66916,66926],"disallowed"],[[66927,66927],"valid",[],"NV8"],[[66928,67071],"disallowed"],[[67072,67382],"valid"],[[67383,67391],"disallowed"],[[67392,67413],"valid"],[[67414,67423],"disallowed"],[[67424,67431],"valid"],[[67432,67583],"disallowed"],[[67584,67589],"valid"],[[67590,67591],"disallowed"],[[67592,67592],"valid"],[[67593,67593],"disallowed"],[[67594,67637],"valid"],[[67638,67638],"disallowed"],[[67639,67640],"valid"],[[67641,67643],"disallowed"],[[67644,67644],"valid"],[[67645,67646],"disallowed"],[[67647,67647],"valid"],[[67648,67669],"valid"],[[67670,67670],"disallowed"],[[67671,67679],"valid",[],"NV8"],[[67680,67702],"valid"],[[67703,67711],"valid",[],"NV8"],[[67712,67742],"valid"],[[67743,67750],"disallowed"],[[67751,67759],"valid",[],"NV8"],[[67760,67807],"disallowed"],[[67808,67826],"valid"],[[67827,67827],"disallowed"],[[67828,67829],"valid"],[[67830,67834],"disallowed"],[[67835,67839],"valid",[],"NV8"],[[67840,67861],"valid"],[[67862,67865],"valid",[],"NV8"],[[67866,67867],"valid",[],"NV8"],[[67868,67870],"disallowed"],[[67871,67871],"valid",[],"NV8"],[[67872,67897],"valid"],[[67898,67902],"disallowed"],[[67903,67903],"valid",[],"NV8"],[[67904,67967],"disallowed"],[[67968,68023],"valid"],[[68024,68027],"disallowed"],[[68028,68029],"valid",[],"NV8"],[[68030,68031],"valid"],[[68032,68047],"valid",[],"NV8"],[[68048,68049],"disallowed"],[[68050,68095],"valid",[],"NV8"],[[68096,68099],"valid"],[[68100,68100],"disallowed"],[[68101,68102],"valid"],[[68103,68107],"disallowed"],[[68108,68115],"valid"],[[68116,68116],"disallowed"],[[68117,68119],"valid"],[[68120,68120],"disallowed"],[[68121,68147],"valid"],[[68148,68151],"disallowed"],[[68152,68154],"valid"],[[68155,68158],"disallowed"],[[68159,68159],"valid"],[[68160,68167],"valid",[],"NV8"],[[68168,68175],"disallowed"],[[68176,68184],"valid",[],"NV8"],[[68185,68191],"disallowed"],[[68192,68220],"valid"],[[68221,68223],"valid",[],"NV8"],[[68224,68252],"valid"],[[68253,68255],"valid",[],"NV8"],[[68256,68287],"disallowed"],[[68288,68295],"valid"],[[68296,68296],"valid",[],"NV8"],[[68297,68326],"valid"],[[68327,68330],"disallowed"],[[68331,68342],"valid",[],"NV8"],[[68343,68351],"disallowed"],[[68352,68405],"valid"],[[68406,68408],"disallowed"],[[68409,68415],"valid",[],"NV8"],[[68416,68437],"valid"],[[68438,68439],"disallowed"],[[68440,68447],"valid",[],"NV8"],[[68448,68466],"valid"],[[68467,68471],"disallowed"],[[68472,68479],"valid",[],"NV8"],[[68480,68497],"valid"],[[68498,68504],"disallowed"],[[68505,68508],"valid",[],"NV8"],[[68509,68520],"disallowed"],[[68521,68527],"valid",[],"NV8"],[[68528,68607],"disallowed"],[[68608,68680],"valid"],[[68681,68735],"disallowed"],[[68736,68736],"mapped",[68800]],[[68737,68737],"mapped",[68801]],[[68738,68738],"mapped",[68802]],[[68739,68739],"mapped",[68803]],[[68740,68740],"mapped",[68804]],[[68741,68741],"mapped",[68805]],[[68742,68742],"mapped",[68806]],[[68743,68743],"mapped",[68807]],[[68744,68744],"mapped",[68808]],[[68745,68745],"mapped",[68809]],[[68746,68746],"mapped",[68810]],[[68747,68747],"mapped",[68811]],[[68748,68748],"mapped",[68812]],[[68749,68749],"mapped",[68813]],[[68750,68750],"mapped",[68814]],[[68751,68751],"mapped",[68815]],[[68752,68752],"mapped",[68816]],[[68753,68753],"mapped",[68817]],[[68754,68754],"mapped",[68818]],[[68755,68755],"mapped",[68819]],[[68756,68756],"mapped",[68820]],[[68757,68757],"mapped",[68821]],[[68758,68758],"mapped",[68822]],[[68759,68759],"mapped",[68823]],[[68760,68760],"mapped",[68824]],[[68761,68761],"mapped",[68825]],[[68762,68762],"mapped",[68826]],[[68763,68763],"mapped",[68827]],[[68764,68764],"mapped",[68828]],[[68765,68765],"mapped",[68829]],[[68766,68766],"mapped",[68830]],[[68767,68767],"mapped",[68831]],[[68768,68768],"mapped",[68832]],[[68769,68769],"mapped",[68833]],[[68770,68770],"mapped",[68834]],[[68771,68771],"mapped",[68835]],[[68772,68772],"mapped",[68836]],[[68773,68773],"mapped",[68837]],[[68774,68774],"mapped",[68838]],[[68775,68775],"mapped",[68839]],[[68776,68776],"mapped",[68840]],[[68777,68777],"mapped",[68841]],[[68778,68778],"mapped",[68842]],[[68779,68779],"mapped",[68843]],[[68780,68780],"mapped",[68844]],[[68781,68781],"mapped",[68845]],[[68782,68782],"mapped",[68846]],[[68783,68783],"mapped",[68847]],[[68784,68784],"mapped",[68848]],[[68785,68785],"mapped",[68849]],[[68786,68786],"mapped",[68850]],[[68787,68799],"disallowed"],[[68800,68850],"valid"],[[68851,68857],"disallowed"],[[68858,68863],"valid",[],"NV8"],[[68864,69215],"disallowed"],[[69216,69246],"valid",[],"NV8"],[[69247,69631],"disallowed"],[[69632,69702],"valid"],[[69703,69709],"valid",[],"NV8"],[[69710,69713],"disallowed"],[[69714,69733],"valid",[],"NV8"],[[69734,69743],"valid"],[[69744,69758],"disallowed"],[[69759,69759],"valid"],[[69760,69818],"valid"],[[69819,69820],"valid",[],"NV8"],[[69821,69821],"disallowed"],[[69822,69825],"valid",[],"NV8"],[[69826,69839],"disallowed"],[[69840,69864],"valid"],[[69865,69871],"disallowed"],[[69872,69881],"valid"],[[69882,69887],"disallowed"],[[69888,69940],"valid"],[[69941,69941],"disallowed"],[[69942,69951],"valid"],[[69952,69955],"valid",[],"NV8"],[[69956,69967],"disallowed"],[[69968,70003],"valid"],[[70004,70005],"valid",[],"NV8"],[[70006,70006],"valid"],[[70007,70015],"disallowed"],[[70016,70084],"valid"],[[70085,70088],"valid",[],"NV8"],[[70089,70089],"valid",[],"NV8"],[[70090,70092],"valid"],[[70093,70093],"valid",[],"NV8"],[[70094,70095],"disallowed"],[[70096,70105],"valid"],[[70106,70106],"valid"],[[70107,70107],"valid",[],"NV8"],[[70108,70108],"valid"],[[70109,70111],"valid",[],"NV8"],[[70112,70112],"disallowed"],[[70113,70132],"valid",[],"NV8"],[[70133,70143],"disallowed"],[[70144,70161],"valid"],[[70162,70162],"disallowed"],[[70163,70199],"valid"],[[70200,70205],"valid",[],"NV8"],[[70206,70271],"disallowed"],[[70272,70278],"valid"],[[70279,70279],"disallowed"],[[70280,70280],"valid"],[[70281,70281],"disallowed"],[[70282,70285],"valid"],[[70286,70286],"disallowed"],[[70287,70301],"valid"],[[70302,70302],"disallowed"],[[70303,70312],"valid"],[[70313,70313],"valid",[],"NV8"],[[70314,70319],"disallowed"],[[70320,70378],"valid"],[[70379,70383],"disallowed"],[[70384,70393],"valid"],[[70394,70399],"disallowed"],[[70400,70400],"valid"],[[70401,70403],"valid"],[[70404,70404],"disallowed"],[[70405,70412],"valid"],[[70413,70414],"disallowed"],[[70415,70416],"valid"],[[70417,70418],"disallowed"],[[70419,70440],"valid"],[[70441,70441],"disallowed"],[[70442,70448],"valid"],[[70449,70449],"disallowed"],[[70450,70451],"valid"],[[70452,70452],"disallowed"],[[70453,70457],"valid"],[[70458,70459],"disallowed"],[[70460,70468],"valid"],[[70469,70470],"disallowed"],[[70471,70472],"valid"],[[70473,70474],"disallowed"],[[70475,70477],"valid"],[[70478,70479],"disallowed"],[[70480,70480],"valid"],[[70481,70486],"disallowed"],[[70487,70487],"valid"],[[70488,70492],"disallowed"],[[70493,70499],"valid"],[[70500,70501],"disallowed"],[[70502,70508],"valid"],[[70509,70511],"disallowed"],[[70512,70516],"valid"],[[70517,70783],"disallowed"],[[70784,70853],"valid"],[[70854,70854],"valid",[],"NV8"],[[70855,70855],"valid"],[[70856,70863],"disallowed"],[[70864,70873],"valid"],[[70874,71039],"disallowed"],[[71040,71093],"valid"],[[71094,71095],"disallowed"],[[71096,71104],"valid"],[[71105,71113],"valid",[],"NV8"],[[71114,71127],"valid",[],"NV8"],[[71128,71133],"valid"],[[71134,71167],"disallowed"],[[71168,71232],"valid"],[[71233,71235],"valid",[],"NV8"],[[71236,71236],"valid"],[[71237,71247],"disallowed"],[[71248,71257],"valid"],[[71258,71295],"disallowed"],[[71296,71351],"valid"],[[71352,71359],"disallowed"],[[71360,71369],"valid"],[[71370,71423],"disallowed"],[[71424,71449],"valid"],[[71450,71452],"disallowed"],[[71453,71467],"valid"],[[71468,71471],"disallowed"],[[71472,71481],"valid"],[[71482,71487],"valid",[],"NV8"],[[71488,71839],"disallowed"],[[71840,71840],"mapped",[71872]],[[71841,71841],"mapped",[71873]],[[71842,71842],"mapped",[71874]],[[71843,71843],"mapped",[71875]],[[71844,71844],"mapped",[71876]],[[71845,71845],"mapped",[71877]],[[71846,71846],"mapped",[71878]],[[71847,71847],"mapped",[71879]],[[71848,71848],"mapped",[71880]],[[71849,71849],"mapped",[71881]],[[71850,71850],"mapped",[71882]],[[71851,71851],"mapped",[71883]],[[71852,71852],"mapped",[71884]],[[71853,71853],"mapped",[71885]],[[71854,71854],"mapped",[71886]],[[71855,71855],"mapped",[71887]],[[71856,71856],"mapped",[71888]],[[71857,71857],"mapped",[71889]],[[71858,71858],"mapped",[71890]],[[71859,71859],"mapped",[71891]],[[71860,71860],"mapped",[71892]],[[71861,71861],"mapped",[71893]],[[71862,71862],"mapped",[71894]],[[71863,71863],"mapped",[71895]],[[71864,71864],"mapped",[71896]],[[71865,71865],"mapped",[71897]],[[71866,71866],"mapped",[71898]],[[71867,71867],"mapped",[71899]],[[71868,71868],"mapped",[71900]],[[71869,71869],"mapped",[71901]],[[71870,71870],"mapped",[71902]],[[71871,71871],"mapped",[71903]],[[71872,71913],"valid"],[[71914,71922],"valid",[],"NV8"],[[71923,71934],"disallowed"],[[71935,71935],"valid"],[[71936,72383],"disallowed"],[[72384,72440],"valid"],[[72441,73727],"disallowed"],[[73728,74606],"valid"],[[74607,74648],"valid"],[[74649,74649],"valid"],[[74650,74751],"disallowed"],[[74752,74850],"valid",[],"NV8"],[[74851,74862],"valid",[],"NV8"],[[74863,74863],"disallowed"],[[74864,74867],"valid",[],"NV8"],[[74868,74868],"valid",[],"NV8"],[[74869,74879],"disallowed"],[[74880,75075],"valid"],[[75076,77823],"disallowed"],[[77824,78894],"valid"],[[78895,82943],"disallowed"],[[82944,83526],"valid"],[[83527,92159],"disallowed"],[[92160,92728],"valid"],[[92729,92735],"disallowed"],[[92736,92766],"valid"],[[92767,92767],"disallowed"],[[92768,92777],"valid"],[[92778,92781],"disallowed"],[[92782,92783],"valid",[],"NV8"],[[92784,92879],"disallowed"],[[92880,92909],"valid"],[[92910,92911],"disallowed"],[[92912,92916],"valid"],[[92917,92917],"valid",[],"NV8"],[[92918,92927],"disallowed"],[[92928,92982],"valid"],[[92983,92991],"valid",[],"NV8"],[[92992,92995],"valid"],[[92996,92997],"valid",[],"NV8"],[[92998,93007],"disallowed"],[[93008,93017],"valid"],[[93018,93018],"disallowed"],[[93019,93025],"valid",[],"NV8"],[[93026,93026],"disallowed"],[[93027,93047],"valid"],[[93048,93052],"disallowed"],[[93053,93071],"valid"],[[93072,93951],"disallowed"],[[93952,94020],"valid"],[[94021,94031],"disallowed"],[[94032,94078],"valid"],[[94079,94094],"disallowed"],[[94095,94111],"valid"],[[94112,110591],"disallowed"],[[110592,110593],"valid"],[[110594,113663],"disallowed"],[[113664,113770],"valid"],[[113771,113775],"disallowed"],[[113776,113788],"valid"],[[113789,113791],"disallowed"],[[113792,113800],"valid"],[[113801,113807],"disallowed"],[[113808,113817],"valid"],[[113818,113819],"disallowed"],[[113820,113820],"valid",[],"NV8"],[[113821,113822],"valid"],[[113823,113823],"valid",[],"NV8"],[[113824,113827],"ignored"],[[113828,118783],"disallowed"],[[118784,119029],"valid",[],"NV8"],[[119030,119039],"disallowed"],[[119040,119078],"valid",[],"NV8"],[[119079,119080],"disallowed"],[[119081,119081],"valid",[],"NV8"],[[119082,119133],"valid",[],"NV8"],[[119134,119134],"mapped",[119127,119141]],[[119135,119135],"mapped",[119128,119141]],[[119136,119136],"mapped",[119128,119141,119150]],[[119137,119137],"mapped",[119128,119141,119151]],[[119138,119138],"mapped",[119128,119141,119152]],[[119139,119139],"mapped",[119128,119141,119153]],[[119140,119140],"mapped",[119128,119141,119154]],[[119141,119154],"valid",[],"NV8"],[[119155,119162],"disallowed"],[[119163,119226],"valid",[],"NV8"],[[119227,119227],"mapped",[119225,119141]],[[119228,119228],"mapped",[119226,119141]],[[119229,119229],"mapped",[119225,119141,119150]],[[119230,119230],"mapped",[119226,119141,119150]],[[119231,119231],"mapped",[119225,119141,119151]],[[119232,119232],"mapped",[119226,119141,119151]],[[119233,119261],"valid",[],"NV8"],[[119262,119272],"valid",[],"NV8"],[[119273,119295],"disallowed"],[[119296,119365],"valid",[],"NV8"],[[119366,119551],"disallowed"],[[119552,119638],"valid",[],"NV8"],[[119639,119647],"disallowed"],[[119648,119665],"valid",[],"NV8"],[[119666,119807],"disallowed"],[[119808,119808],"mapped",[97]],[[119809,119809],"mapped",[98]],[[119810,119810],"mapped",[99]],[[119811,119811],"mapped",[100]],[[119812,119812],"mapped",[101]],[[119813,119813],"mapped",[102]],[[119814,119814],"mapped",[103]],[[119815,119815],"mapped",[104]],[[119816,119816],"mapped",[105]],[[119817,119817],"mapped",[106]],[[119818,119818],"mapped",[107]],[[119819,119819],"mapped",[108]],[[119820,119820],"mapped",[109]],[[119821,119821],"mapped",[110]],[[119822,119822],"mapped",[111]],[[119823,119823],"mapped",[112]],[[119824,119824],"mapped",[113]],[[119825,119825],"mapped",[114]],[[119826,119826],"mapped",[115]],[[119827,119827],"mapped",[116]],[[119828,119828],"mapped",[117]],[[119829,119829],"mapped",[118]],[[119830,119830],"mapped",[119]],[[119831,119831],"mapped",[120]],[[119832,119832],"mapped",[121]],[[119833,119833],"mapped",[122]],[[119834,119834],"mapped",[97]],[[119835,119835],"mapped",[98]],[[119836,119836],"mapped",[99]],[[119837,119837],"mapped",[100]],[[119838,119838],"mapped",[101]],[[119839,119839],"mapped",[102]],[[119840,119840],"mapped",[103]],[[119841,119841],"mapped",[104]],[[119842,119842],"mapped",[105]],[[119843,119843],"mapped",[106]],[[119844,119844],"mapped",[107]],[[119845,119845],"mapped",[108]],[[119846,119846],"mapped",[109]],[[119847,119847],"mapped",[110]],[[119848,119848],"mapped",[111]],[[119849,119849],"mapped",[112]],[[119850,119850],"mapped",[113]],[[119851,119851],"mapped",[114]],[[119852,119852],"mapped",[115]],[[119853,119853],"mapped",[116]],[[119854,119854],"mapped",[117]],[[119855,119855],"mapped",[118]],[[119856,119856],"mapped",[119]],[[119857,119857],"mapped",[120]],[[119858,119858],"mapped",[121]],[[119859,119859],"mapped",[122]],[[119860,119860],"mapped",[97]],[[119861,119861],"mapped",[98]],[[119862,119862],"mapped",[99]],[[119863,119863],"mapped",[100]],[[119864,119864],"mapped",[101]],[[119865,119865],"mapped",[102]],[[119866,119866],"mapped",[103]],[[119867,119867],"mapped",[104]],[[119868,119868],"mapped",[105]],[[119869,119869],"mapped",[106]],[[119870,119870],"mapped",[107]],[[119871,119871],"mapped",[108]],[[119872,119872],"mapped",[109]],[[119873,119873],"mapped",[110]],[[119874,119874],"mapped",[111]],[[119875,119875],"mapped",[112]],[[119876,119876],"mapped",[113]],[[119877,119877],"mapped",[114]],[[119878,119878],"mapped",[115]],[[119879,119879],"mapped",[116]],[[119880,119880],"mapped",[117]],[[119881,119881],"mapped",[118]],[[119882,119882],"mapped",[119]],[[119883,119883],"mapped",[120]],[[119884,119884],"mapped",[121]],[[119885,119885],"mapped",[122]],[[119886,119886],"mapped",[97]],[[119887,119887],"mapped",[98]],[[119888,119888],"mapped",[99]],[[119889,119889],"mapped",[100]],[[119890,119890],"mapped",[101]],[[119891,119891],"mapped",[102]],[[119892,119892],"mapped",[103]],[[119893,119893],"disallowed"],[[119894,119894],"mapped",[105]],[[119895,119895],"mapped",[106]],[[119896,119896],"mapped",[107]],[[119897,119897],"mapped",[108]],[[119898,119898],"mapped",[109]],[[119899,119899],"mapped",[110]],[[119900,119900],"mapped",[111]],[[119901,119901],"mapped",[112]],[[119902,119902],"mapped",[113]],[[119903,119903],"mapped",[114]],[[119904,119904],"mapped",[115]],[[119905,119905],"mapped",[116]],[[119906,119906],"mapped",[117]],[[119907,119907],"mapped",[118]],[[119908,119908],"mapped",[119]],[[119909,119909],"mapped",[120]],[[119910,119910],"mapped",[121]],[[119911,119911],"mapped",[122]],[[119912,119912],"mapped",[97]],[[119913,119913],"mapped",[98]],[[119914,119914],"mapped",[99]],[[119915,119915],"mapped",[100]],[[119916,119916],"mapped",[101]],[[119917,119917],"mapped",[102]],[[119918,119918],"mapped",[103]],[[119919,119919],"mapped",[104]],[[119920,119920],"mapped",[105]],[[119921,119921],"mapped",[106]],[[119922,119922],"mapped",[107]],[[119923,119923],"mapped",[108]],[[119924,119924],"mapped",[109]],[[119925,119925],"mapped",[110]],[[119926,119926],"mapped",[111]],[[119927,119927],"mapped",[112]],[[119928,119928],"mapped",[113]],[[119929,119929],"mapped",[114]],[[119930,119930],"mapped",[115]],[[119931,119931],"mapped",[116]],[[119932,119932],"mapped",[117]],[[119933,119933],"mapped",[118]],[[119934,119934],"mapped",[119]],[[119935,119935],"mapped",[120]],[[119936,119936],"mapped",[121]],[[119937,119937],"mapped",[122]],[[119938,119938],"mapped",[97]],[[119939,119939],"mapped",[98]],[[119940,119940],"mapped",[99]],[[119941,119941],"mapped",[100]],[[119942,119942],"mapped",[101]],[[119943,119943],"mapped",[102]],[[119944,119944],"mapped",[103]],[[119945,119945],"mapped",[104]],[[119946,119946],"mapped",[105]],[[119947,119947],"mapped",[106]],[[119948,119948],"mapped",[107]],[[119949,119949],"mapped",[108]],[[119950,119950],"mapped",[109]],[[119951,119951],"mapped",[110]],[[119952,119952],"mapped",[111]],[[119953,119953],"mapped",[112]],[[119954,119954],"mapped",[113]],[[119955,119955],"mapped",[114]],[[119956,119956],"mapped",[115]],[[119957,119957],"mapped",[116]],[[119958,119958],"mapped",[117]],[[119959,119959],"mapped",[118]],[[119960,119960],"mapped",[119]],[[119961,119961],"mapped",[120]],[[119962,119962],"mapped",[121]],[[119963,119963],"mapped",[122]],[[119964,119964],"mapped",[97]],[[119965,119965],"disallowed"],[[119966,119966],"mapped",[99]],[[119967,119967],"mapped",[100]],[[119968,119969],"disallowed"],[[119970,119970],"mapped",[103]],[[119971,119972],"disallowed"],[[119973,119973],"mapped",[106]],[[119974,119974],"mapped",[107]],[[119975,119976],"disallowed"],[[119977,119977],"mapped",[110]],[[119978,119978],"mapped",[111]],[[119979,119979],"mapped",[112]],[[119980,119980],"mapped",[113]],[[119981,119981],"disallowed"],[[119982,119982],"mapped",[115]],[[119983,119983],"mapped",[116]],[[119984,119984],"mapped",[117]],[[119985,119985],"mapped",[118]],[[119986,119986],"mapped",[119]],[[119987,119987],"mapped",[120]],[[119988,119988],"mapped",[121]],[[119989,119989],"mapped",[122]],[[119990,119990],"mapped",[97]],[[119991,119991],"mapped",[98]],[[119992,119992],"mapped",[99]],[[119993,119993],"mapped",[100]],[[119994,119994],"disallowed"],[[119995,119995],"mapped",[102]],[[119996,119996],"disallowed"],[[119997,119997],"mapped",[104]],[[119998,119998],"mapped",[105]],[[119999,119999],"mapped",[106]],[[120000,120000],"mapped",[107]],[[120001,120001],"mapped",[108]],[[120002,120002],"mapped",[109]],[[120003,120003],"mapped",[110]],[[120004,120004],"disallowed"],[[120005,120005],"mapped",[112]],[[120006,120006],"mapped",[113]],[[120007,120007],"mapped",[114]],[[120008,120008],"mapped",[115]],[[120009,120009],"mapped",[116]],[[120010,120010],"mapped",[117]],[[120011,120011],"mapped",[118]],[[120012,120012],"mapped",[119]],[[120013,120013],"mapped",[120]],[[120014,120014],"mapped",[121]],[[120015,120015],"mapped",[122]],[[120016,120016],"mapped",[97]],[[120017,120017],"mapped",[98]],[[120018,120018],"mapped",[99]],[[120019,120019],"mapped",[100]],[[120020,120020],"mapped",[101]],[[120021,120021],"mapped",[102]],[[120022,120022],"mapped",[103]],[[120023,120023],"mapped",[104]],[[120024,120024],"mapped",[105]],[[120025,120025],"mapped",[106]],[[120026,120026],"mapped",[107]],[[120027,120027],"mapped",[108]],[[120028,120028],"mapped",[109]],[[120029,120029],"mapped",[110]],[[120030,120030],"mapped",[111]],[[120031,120031],"mapped",[112]],[[120032,120032],"mapped",[113]],[[120033,120033],"mapped",[114]],[[120034,120034],"mapped",[115]],[[120035,120035],"mapped",[116]],[[120036,120036],"mapped",[117]],[[120037,120037],"mapped",[118]],[[120038,120038],"mapped",[119]],[[120039,120039],"mapped",[120]],[[120040,120040],"mapped",[121]],[[120041,120041],"mapped",[122]],[[120042,120042],"mapped",[97]],[[120043,120043],"mapped",[98]],[[120044,120044],"mapped",[99]],[[120045,120045],"mapped",[100]],[[120046,120046],"mapped",[101]],[[120047,120047],"mapped",[102]],[[120048,120048],"mapped",[103]],[[120049,120049],"mapped",[104]],[[120050,120050],"mapped",[105]],[[120051,120051],"mapped",[106]],[[120052,120052],"mapped",[107]],[[120053,120053],"mapped",[108]],[[120054,120054],"mapped",[109]],[[120055,120055],"mapped",[110]],[[120056,120056],"mapped",[111]],[[120057,120057],"mapped",[112]],[[120058,120058],"mapped",[113]],[[120059,120059],"mapped",[114]],[[120060,120060],"mapped",[115]],[[120061,120061],"mapped",[116]],[[120062,120062],"mapped",[117]],[[120063,120063],"mapped",[118]],[[120064,120064],"mapped",[119]],[[120065,120065],"mapped",[120]],[[120066,120066],"mapped",[121]],[[120067,120067],"mapped",[122]],[[120068,120068],"mapped",[97]],[[120069,120069],"mapped",[98]],[[120070,120070],"disallowed"],[[120071,120071],"mapped",[100]],[[120072,120072],"mapped",[101]],[[120073,120073],"mapped",[102]],[[120074,120074],"mapped",[103]],[[120075,120076],"disallowed"],[[120077,120077],"mapped",[106]],[[120078,120078],"mapped",[107]],[[120079,120079],"mapped",[108]],[[120080,120080],"mapped",[109]],[[120081,120081],"mapped",[110]],[[120082,120082],"mapped",[111]],[[120083,120083],"mapped",[112]],[[120084,120084],"mapped",[113]],[[120085,120085],"disallowed"],[[120086,120086],"mapped",[115]],[[120087,120087],"mapped",[116]],[[120088,120088],"mapped",[117]],[[120089,120089],"mapped",[118]],[[120090,120090],"mapped",[119]],[[120091,120091],"mapped",[120]],[[120092,120092],"mapped",[121]],[[120093,120093],"disallowed"],[[120094,120094],"mapped",[97]],[[120095,120095],"mapped",[98]],[[120096,120096],"mapped",[99]],[[120097,120097],"mapped",[100]],[[120098,120098],"mapped",[101]],[[120099,120099],"mapped",[102]],[[120100,120100],"mapped",[103]],[[120101,120101],"mapped",[104]],[[120102,120102],"mapped",[105]],[[120103,120103],"mapped",[106]],[[120104,120104],"mapped",[107]],[[120105,120105],"mapped",[108]],[[120106,120106],"mapped",[109]],[[120107,120107],"mapped",[110]],[[120108,120108],"mapped",[111]],[[120109,120109],"mapped",[112]],[[120110,120110],"mapped",[113]],[[120111,120111],"mapped",[114]],[[120112,120112],"mapped",[115]],[[120113,120113],"mapped",[116]],[[120114,120114],"mapped",[117]],[[120115,120115],"mapped",[118]],[[120116,120116],"mapped",[119]],[[120117,120117],"mapped",[120]],[[120118,120118],"mapped",[121]],[[120119,120119],"mapped",[122]],[[120120,120120],"mapped",[97]],[[120121,120121],"mapped",[98]],[[120122,120122],"disallowed"],[[120123,120123],"mapped",[100]],[[120124,120124],"mapped",[101]],[[120125,120125],"mapped",[102]],[[120126,120126],"mapped",[103]],[[120127,120127],"disallowed"],[[120128,120128],"mapped",[105]],[[120129,120129],"mapped",[106]],[[120130,120130],"mapped",[107]],[[120131,120131],"mapped",[108]],[[120132,120132],"mapped",[109]],[[120133,120133],"disallowed"],[[120134,120134],"mapped",[111]],[[120135,120137],"disallowed"],[[120138,120138],"mapped",[115]],[[120139,120139],"mapped",[116]],[[120140,120140],"mapped",[117]],[[120141,120141],"mapped",[118]],[[120142,120142],"mapped",[119]],[[120143,120143],"mapped",[120]],[[120144,120144],"mapped",[121]],[[120145,120145],"disallowed"],[[120146,120146],"mapped",[97]],[[120147,120147],"mapped",[98]],[[120148,120148],"mapped",[99]],[[120149,120149],"mapped",[100]],[[120150,120150],"mapped",[101]],[[120151,120151],"mapped",[102]],[[120152,120152],"mapped",[103]],[[120153,120153],"mapped",[104]],[[120154,120154],"mapped",[105]],[[120155,120155],"mapped",[106]],[[120156,120156],"mapped",[107]],[[120157,120157],"mapped",[108]],[[120158,120158],"mapped",[109]],[[120159,120159],"mapped",[110]],[[120160,120160],"mapped",[111]],[[120161,120161],"mapped",[112]],[[120162,120162],"mapped",[113]],[[120163,120163],"mapped",[114]],[[120164,120164],"mapped",[115]],[[120165,120165],"mapped",[116]],[[120166,120166],"mapped",[117]],[[120167,120167],"mapped",[118]],[[120168,120168],"mapped",[119]],[[120169,120169],"mapped",[120]],[[120170,120170],"mapped",[121]],[[120171,120171],"mapped",[122]],[[120172,120172],"mapped",[97]],[[120173,120173],"mapped",[98]],[[120174,120174],"mapped",[99]],[[120175,120175],"mapped",[100]],[[120176,120176],"mapped",[101]],[[120177,120177],"mapped",[102]],[[120178,120178],"mapped",[103]],[[120179,120179],"mapped",[104]],[[120180,120180],"mapped",[105]],[[120181,120181],"mapped",[106]],[[120182,120182],"mapped",[107]],[[120183,120183],"mapped",[108]],[[120184,120184],"mapped",[109]],[[120185,120185],"mapped",[110]],[[120186,120186],"mapped",[111]],[[120187,120187],"mapped",[112]],[[120188,120188],"mapped",[113]],[[120189,120189],"mapped",[114]],[[120190,120190],"mapped",[115]],[[120191,120191],"mapped",[116]],[[120192,120192],"mapped",[117]],[[120193,120193],"mapped",[118]],[[120194,120194],"mapped",[119]],[[120195,120195],"mapped",[120]],[[120196,120196],"mapped",[121]],[[120197,120197],"mapped",[122]],[[120198,120198],"mapped",[97]],[[120199,120199],"mapped",[98]],[[120200,120200],"mapped",[99]],[[120201,120201],"mapped",[100]],[[120202,120202],"mapped",[101]],[[120203,120203],"mapped",[102]],[[120204,120204],"mapped",[103]],[[120205,120205],"mapped",[104]],[[120206,120206],"mapped",[105]],[[120207,120207],"mapped",[106]],[[120208,120208],"mapped",[107]],[[120209,120209],"mapped",[108]],[[120210,120210],"mapped",[109]],[[120211,120211],"mapped",[110]],[[120212,120212],"mapped",[111]],[[120213,120213],"mapped",[112]],[[120214,120214],"mapped",[113]],[[120215,120215],"mapped",[114]],[[120216,120216],"mapped",[115]],[[120217,120217],"mapped",[116]],[[120218,120218],"mapped",[117]],[[120219,120219],"mapped",[118]],[[120220,120220],"mapped",[119]],[[120221,120221],"mapped",[120]],[[120222,120222],"mapped",[121]],[[120223,120223],"mapped",[122]],[[120224,120224],"mapped",[97]],[[120225,120225],"mapped",[98]],[[120226,120226],"mapped",[99]],[[120227,120227],"mapped",[100]],[[120228,120228],"mapped",[101]],[[120229,120229],"mapped",[102]],[[120230,120230],"mapped",[103]],[[120231,120231],"mapped",[104]],[[120232,120232],"mapped",[105]],[[120233,120233],"mapped",[106]],[[120234,120234],"mapped",[107]],[[120235,120235],"mapped",[108]],[[120236,120236],"mapped",[109]],[[120237,120237],"mapped",[110]],[[120238,120238],"mapped",[111]],[[120239,120239],"mapped",[112]],[[120240,120240],"mapped",[113]],[[120241,120241],"mapped",[114]],[[120242,120242],"mapped",[115]],[[120243,120243],"mapped",[116]],[[120244,120244],"mapped",[117]],[[120245,120245],"mapped",[118]],[[120246,120246],"mapped",[119]],[[120247,120247],"mapped",[120]],[[120248,120248],"mapped",[121]],[[120249,120249],"mapped",[122]],[[120250,120250],"mapped",[97]],[[120251,120251],"mapped",[98]],[[120252,120252],"mapped",[99]],[[120253,120253],"mapped",[100]],[[120254,120254],"mapped",[101]],[[120255,120255],"mapped",[102]],[[120256,120256],"mapped",[103]],[[120257,120257],"mapped",[104]],[[120258,120258],"mapped",[105]],[[120259,120259],"mapped",[106]],[[120260,120260],"mapped",[107]],[[120261,120261],"mapped",[108]],[[120262,120262],"mapped",[109]],[[120263,120263],"mapped",[110]],[[120264,120264],"mapped",[111]],[[120265,120265],"mapped",[112]],[[120266,120266],"mapped",[113]],[[120267,120267],"mapped",[114]],[[120268,120268],"mapped",[115]],[[120269,120269],"mapped",[116]],[[120270,120270],"mapped",[117]],[[120271,120271],"mapped",[118]],[[120272,120272],"mapped",[119]],[[120273,120273],"mapped",[120]],[[120274,120274],"mapped",[121]],[[120275,120275],"mapped",[122]],[[120276,120276],"mapped",[97]],[[120277,120277],"mapped",[98]],[[120278,120278],"mapped",[99]],[[120279,120279],"mapped",[100]],[[120280,120280],"mapped",[101]],[[120281,120281],"mapped",[102]],[[120282,120282],"mapped",[103]],[[120283,120283],"mapped",[104]],[[120284,120284],"mapped",[105]],[[120285,120285],"mapped",[106]],[[120286,120286],"mapped",[107]],[[120287,120287],"mapped",[108]],[[120288,120288],"mapped",[109]],[[120289,120289],"mapped",[110]],[[120290,120290],"mapped",[111]],[[120291,120291],"mapped",[112]],[[120292,120292],"mapped",[113]],[[120293,120293],"mapped",[114]],[[120294,120294],"mapped",[115]],[[120295,120295],"mapped",[116]],[[120296,120296],"mapped",[117]],[[120297,120297],"mapped",[118]],[[120298,120298],"mapped",[119]],[[120299,120299],"mapped",[120]],[[120300,120300],"mapped",[121]],[[120301,120301],"mapped",[122]],[[120302,120302],"mapped",[97]],[[120303,120303],"mapped",[98]],[[120304,120304],"mapped",[99]],[[120305,120305],"mapped",[100]],[[120306,120306],"mapped",[101]],[[120307,120307],"mapped",[102]],[[120308,120308],"mapped",[103]],[[120309,120309],"mapped",[104]],[[120310,120310],"mapped",[105]],[[120311,120311],"mapped",[106]],[[120312,120312],"mapped",[107]],[[120313,120313],"mapped",[108]],[[120314,120314],"mapped",[109]],[[120315,120315],"mapped",[110]],[[120316,120316],"mapped",[111]],[[120317,120317],"mapped",[112]],[[120318,120318],"mapped",[113]],[[120319,120319],"mapped",[114]],[[120320,120320],"mapped",[115]],[[120321,120321],"mapped",[116]],[[120322,120322],"mapped",[117]],[[120323,120323],"mapped",[118]],[[120324,120324],"mapped",[119]],[[120325,120325],"mapped",[120]],[[120326,120326],"mapped",[121]],[[120327,120327],"mapped",[122]],[[120328,120328],"mapped",[97]],[[120329,120329],"mapped",[98]],[[120330,120330],"mapped",[99]],[[120331,120331],"mapped",[100]],[[120332,120332],"mapped",[101]],[[120333,120333],"mapped",[102]],[[120334,120334],"mapped",[103]],[[120335,120335],"mapped",[104]],[[120336,120336],"mapped",[105]],[[120337,120337],"mapped",[106]],[[120338,120338],"mapped",[107]],[[120339,120339],"mapped",[108]],[[120340,120340],"mapped",[109]],[[120341,120341],"mapped",[110]],[[120342,120342],"mapped",[111]],[[120343,120343],"mapped",[112]],[[120344,120344],"mapped",[113]],[[120345,120345],"mapped",[114]],[[120346,120346],"mapped",[115]],[[120347,120347],"mapped",[116]],[[120348,120348],"mapped",[117]],[[120349,120349],"mapped",[118]],[[120350,120350],"mapped",[119]],[[120351,120351],"mapped",[120]],[[120352,120352],"mapped",[121]],[[120353,120353],"mapped",[122]],[[120354,120354],"mapped",[97]],[[120355,120355],"mapped",[98]],[[120356,120356],"mapped",[99]],[[120357,120357],"mapped",[100]],[[120358,120358],"mapped",[101]],[[120359,120359],"mapped",[102]],[[120360,120360],"mapped",[103]],[[120361,120361],"mapped",[104]],[[120362,120362],"mapped",[105]],[[120363,120363],"mapped",[106]],[[120364,120364],"mapped",[107]],[[120365,120365],"mapped",[108]],[[120366,120366],"mapped",[109]],[[120367,120367],"mapped",[110]],[[120368,120368],"mapped",[111]],[[120369,120369],"mapped",[112]],[[120370,120370],"mapped",[113]],[[120371,120371],"mapped",[114]],[[120372,120372],"mapped",[115]],[[120373,120373],"mapped",[116]],[[120374,120374],"mapped",[117]],[[120375,120375],"mapped",[118]],[[120376,120376],"mapped",[119]],[[120377,120377],"mapped",[120]],[[120378,120378],"mapped",[121]],[[120379,120379],"mapped",[122]],[[120380,120380],"mapped",[97]],[[120381,120381],"mapped",[98]],[[120382,120382],"mapped",[99]],[[120383,120383],"mapped",[100]],[[120384,120384],"mapped",[101]],[[120385,120385],"mapped",[102]],[[120386,120386],"mapped",[103]],[[120387,120387],"mapped",[104]],[[120388,120388],"mapped",[105]],[[120389,120389],"mapped",[106]],[[120390,120390],"mapped",[107]],[[120391,120391],"mapped",[108]],[[120392,120392],"mapped",[109]],[[120393,120393],"mapped",[110]],[[120394,120394],"mapped",[111]],[[120395,120395],"mapped",[112]],[[120396,120396],"mapped",[113]],[[120397,120397],"mapped",[114]],[[120398,120398],"mapped",[115]],[[120399,120399],"mapped",[116]],[[120400,120400],"mapped",[117]],[[120401,120401],"mapped",[118]],[[120402,120402],"mapped",[119]],[[120403,120403],"mapped",[120]],[[120404,120404],"mapped",[121]],[[120405,120405],"mapped",[122]],[[120406,120406],"mapped",[97]],[[120407,120407],"mapped",[98]],[[120408,120408],"mapped",[99]],[[120409,120409],"mapped",[100]],[[120410,120410],"mapped",[101]],[[120411,120411],"mapped",[102]],[[120412,120412],"mapped",[103]],[[120413,120413],"mapped",[104]],[[120414,120414],"mapped",[105]],[[120415,120415],"mapped",[106]],[[120416,120416],"mapped",[107]],[[120417,120417],"mapped",[108]],[[120418,120418],"mapped",[109]],[[120419,120419],"mapped",[110]],[[120420,120420],"mapped",[111]],[[120421,120421],"mapped",[112]],[[120422,120422],"mapped",[113]],[[120423,120423],"mapped",[114]],[[120424,120424],"mapped",[115]],[[120425,120425],"mapped",[116]],[[120426,120426],"mapped",[117]],[[120427,120427],"mapped",[118]],[[120428,120428],"mapped",[119]],[[120429,120429],"mapped",[120]],[[120430,120430],"mapped",[121]],[[120431,120431],"mapped",[122]],[[120432,120432],"mapped",[97]],[[120433,120433],"mapped",[98]],[[120434,120434],"mapped",[99]],[[120435,120435],"mapped",[100]],[[120436,120436],"mapped",[101]],[[120437,120437],"mapped",[102]],[[120438,120438],"mapped",[103]],[[120439,120439],"mapped",[104]],[[120440,120440],"mapped",[105]],[[120441,120441],"mapped",[106]],[[120442,120442],"mapped",[107]],[[120443,120443],"mapped",[108]],[[120444,120444],"mapped",[109]],[[120445,120445],"mapped",[110]],[[120446,120446],"mapped",[111]],[[120447,120447],"mapped",[112]],[[120448,120448],"mapped",[113]],[[120449,120449],"mapped",[114]],[[120450,120450],"mapped",[115]],[[120451,120451],"mapped",[116]],[[120452,120452],"mapped",[117]],[[120453,120453],"mapped",[118]],[[120454,120454],"mapped",[119]],[[120455,120455],"mapped",[120]],[[120456,120456],"mapped",[121]],[[120457,120457],"mapped",[122]],[[120458,120458],"mapped",[97]],[[120459,120459],"mapped",[98]],[[120460,120460],"mapped",[99]],[[120461,120461],"mapped",[100]],[[120462,120462],"mapped",[101]],[[120463,120463],"mapped",[102]],[[120464,120464],"mapped",[103]],[[120465,120465],"mapped",[104]],[[120466,120466],"mapped",[105]],[[120467,120467],"mapped",[106]],[[120468,120468],"mapped",[107]],[[120469,120469],"mapped",[108]],[[120470,120470],"mapped",[109]],[[120471,120471],"mapped",[110]],[[120472,120472],"mapped",[111]],[[120473,120473],"mapped",[112]],[[120474,120474],"mapped",[113]],[[120475,120475],"mapped",[114]],[[120476,120476],"mapped",[115]],[[120477,120477],"mapped",[116]],[[120478,120478],"mapped",[117]],[[120479,120479],"mapped",[118]],[[120480,120480],"mapped",[119]],[[120481,120481],"mapped",[120]],[[120482,120482],"mapped",[121]],[[120483,120483],"mapped",[122]],[[120484,120484],"mapped",[305]],[[120485,120485],"mapped",[567]],[[120486,120487],"disallowed"],[[120488,120488],"mapped",[945]],[[120489,120489],"mapped",[946]],[[120490,120490],"mapped",[947]],[[120491,120491],"mapped",[948]],[[120492,120492],"mapped",[949]],[[120493,120493],"mapped",[950]],[[120494,120494],"mapped",[951]],[[120495,120495],"mapped",[952]],[[120496,120496],"mapped",[953]],[[120497,120497],"mapped",[954]],[[120498,120498],"mapped",[955]],[[120499,120499],"mapped",[956]],[[120500,120500],"mapped",[957]],[[120501,120501],"mapped",[958]],[[120502,120502],"mapped",[959]],[[120503,120503],"mapped",[960]],[[120504,120504],"mapped",[961]],[[120505,120505],"mapped",[952]],[[120506,120506],"mapped",[963]],[[120507,120507],"mapped",[964]],[[120508,120508],"mapped",[965]],[[120509,120509],"mapped",[966]],[[120510,120510],"mapped",[967]],[[120511,120511],"mapped",[968]],[[120512,120512],"mapped",[969]],[[120513,120513],"mapped",[8711]],[[120514,120514],"mapped",[945]],[[120515,120515],"mapped",[946]],[[120516,120516],"mapped",[947]],[[120517,120517],"mapped",[948]],[[120518,120518],"mapped",[949]],[[120519,120519],"mapped",[950]],[[120520,120520],"mapped",[951]],[[120521,120521],"mapped",[952]],[[120522,120522],"mapped",[953]],[[120523,120523],"mapped",[954]],[[120524,120524],"mapped",[955]],[[120525,120525],"mapped",[956]],[[120526,120526],"mapped",[957]],[[120527,120527],"mapped",[958]],[[120528,120528],"mapped",[959]],[[120529,120529],"mapped",[960]],[[120530,120530],"mapped",[961]],[[120531,120532],"mapped",[963]],[[120533,120533],"mapped",[964]],[[120534,120534],"mapped",[965]],[[120535,120535],"mapped",[966]],[[120536,120536],"mapped",[967]],[[120537,120537],"mapped",[968]],[[120538,120538],"mapped",[969]],[[120539,120539],"mapped",[8706]],[[120540,120540],"mapped",[949]],[[120541,120541],"mapped",[952]],[[120542,120542],"mapped",[954]],[[120543,120543],"mapped",[966]],[[120544,120544],"mapped",[961]],[[120545,120545],"mapped",[960]],[[120546,120546],"mapped",[945]],[[120547,120547],"mapped",[946]],[[120548,120548],"mapped",[947]],[[120549,120549],"mapped",[948]],[[120550,120550],"mapped",[949]],[[120551,120551],"mapped",[950]],[[120552,120552],"mapped",[951]],[[120553,120553],"mapped",[952]],[[120554,120554],"mapped",[953]],[[120555,120555],"mapped",[954]],[[120556,120556],"mapped",[955]],[[120557,120557],"mapped",[956]],[[120558,120558],"mapped",[957]],[[120559,120559],"mapped",[958]],[[120560,120560],"mapped",[959]],[[120561,120561],"mapped",[960]],[[120562,120562],"mapped",[961]],[[120563,120563],"mapped",[952]],[[120564,120564],"mapped",[963]],[[120565,120565],"mapped",[964]],[[120566,120566],"mapped",[965]],[[120567,120567],"mapped",[966]],[[120568,120568],"mapped",[967]],[[120569,120569],"mapped",[968]],[[120570,120570],"mapped",[969]],[[120571,120571],"mapped",[8711]],[[120572,120572],"mapped",[945]],[[120573,120573],"mapped",[946]],[[120574,120574],"mapped",[947]],[[120575,120575],"mapped",[948]],[[120576,120576],"mapped",[949]],[[120577,120577],"mapped",[950]],[[120578,120578],"mapped",[951]],[[120579,120579],"mapped",[952]],[[120580,120580],"mapped",[953]],[[120581,120581],"mapped",[954]],[[120582,120582],"mapped",[955]],[[120583,120583],"mapped",[956]],[[120584,120584],"mapped",[957]],[[120585,120585],"mapped",[958]],[[120586,120586],"mapped",[959]],[[120587,120587],"mapped",[960]],[[120588,120588],"mapped",[961]],[[120589,120590],"mapped",[963]],[[120591,120591],"mapped",[964]],[[120592,120592],"mapped",[965]],[[120593,120593],"mapped",[966]],[[120594,120594],"mapped",[967]],[[120595,120595],"mapped",[968]],[[120596,120596],"mapped",[969]],[[120597,120597],"mapped",[8706]],[[120598,120598],"mapped",[949]],[[120599,120599],"mapped",[952]],[[120600,120600],"mapped",[954]],[[120601,120601],"mapped",[966]],[[120602,120602],"mapped",[961]],[[120603,120603],"mapped",[960]],[[120604,120604],"mapped",[945]],[[120605,120605],"mapped",[946]],[[120606,120606],"mapped",[947]],[[120607,120607],"mapped",[948]],[[120608,120608],"mapped",[949]],[[120609,120609],"mapped",[950]],[[120610,120610],"mapped",[951]],[[120611,120611],"mapped",[952]],[[120612,120612],"mapped",[953]],[[120613,120613],"mapped",[954]],[[120614,120614],"mapped",[955]],[[120615,120615],"mapped",[956]],[[120616,120616],"mapped",[957]],[[120617,120617],"mapped",[958]],[[120618,120618],"mapped",[959]],[[120619,120619],"mapped",[960]],[[120620,120620],"mapped",[961]],[[120621,120621],"mapped",[952]],[[120622,120622],"mapped",[963]],[[120623,120623],"mapped",[964]],[[120624,120624],"mapped",[965]],[[120625,120625],"mapped",[966]],[[120626,120626],"mapped",[967]],[[120627,120627],"mapped",[968]],[[120628,120628],"mapped",[969]],[[120629,120629],"mapped",[8711]],[[120630,120630],"mapped",[945]],[[120631,120631],"mapped",[946]],[[120632,120632],"mapped",[947]],[[120633,120633],"mapped",[948]],[[120634,120634],"mapped",[949]],[[120635,120635],"mapped",[950]],[[120636,120636],"mapped",[951]],[[120637,120637],"mapped",[952]],[[120638,120638],"mapped",[953]],[[120639,120639],"mapped",[954]],[[120640,120640],"mapped",[955]],[[120641,120641],"mapped",[956]],[[120642,120642],"mapped",[957]],[[120643,120643],"mapped",[958]],[[120644,120644],"mapped",[959]],[[120645,120645],"mapped",[960]],[[120646,120646],"mapped",[961]],[[120647,120648],"mapped",[963]],[[120649,120649],"mapped",[964]],[[120650,120650],"mapped",[965]],[[120651,120651],"mapped",[966]],[[120652,120652],"mapped",[967]],[[120653,120653],"mapped",[968]],[[120654,120654],"mapped",[969]],[[120655,120655],"mapped",[8706]],[[120656,120656],"mapped",[949]],[[120657,120657],"mapped",[952]],[[120658,120658],"mapped",[954]],[[120659,120659],"mapped",[966]],[[120660,120660],"mapped",[961]],[[120661,120661],"mapped",[960]],[[120662,120662],"mapped",[945]],[[120663,120663],"mapped",[946]],[[120664,120664],"mapped",[947]],[[120665,120665],"mapped",[948]],[[120666,120666],"mapped",[949]],[[120667,120667],"mapped",[950]],[[120668,120668],"mapped",[951]],[[120669,120669],"mapped",[952]],[[120670,120670],"mapped",[953]],[[120671,120671],"mapped",[954]],[[120672,120672],"mapped",[955]],[[120673,120673],"mapped",[956]],[[120674,120674],"mapped",[957]],[[120675,120675],"mapped",[958]],[[120676,120676],"mapped",[959]],[[120677,120677],"mapped",[960]],[[120678,120678],"mapped",[961]],[[120679,120679],"mapped",[952]],[[120680,120680],"mapped",[963]],[[120681,120681],"mapped",[964]],[[120682,120682],"mapped",[965]],[[120683,120683],"mapped",[966]],[[120684,120684],"mapped",[967]],[[120685,120685],"mapped",[968]],[[120686,120686],"mapped",[969]],[[120687,120687],"mapped",[8711]],[[120688,120688],"mapped",[945]],[[120689,120689],"mapped",[946]],[[120690,120690],"mapped",[947]],[[120691,120691],"mapped",[948]],[[120692,120692],"mapped",[949]],[[120693,120693],"mapped",[950]],[[120694,120694],"mapped",[951]],[[120695,120695],"mapped",[952]],[[120696,120696],"mapped",[953]],[[120697,120697],"mapped",[954]],[[120698,120698],"mapped",[955]],[[120699,120699],"mapped",[956]],[[120700,120700],"mapped",[957]],[[120701,120701],"mapped",[958]],[[120702,120702],"mapped",[959]],[[120703,120703],"mapped",[960]],[[120704,120704],"mapped",[961]],[[120705,120706],"mapped",[963]],[[120707,120707],"mapped",[964]],[[120708,120708],"mapped",[965]],[[120709,120709],"mapped",[966]],[[120710,120710],"mapped",[967]],[[120711,120711],"mapped",[968]],[[120712,120712],"mapped",[969]],[[120713,120713],"mapped",[8706]],[[120714,120714],"mapped",[949]],[[120715,120715],"mapped",[952]],[[120716,120716],"mapped",[954]],[[120717,120717],"mapped",[966]],[[120718,120718],"mapped",[961]],[[120719,120719],"mapped",[960]],[[120720,120720],"mapped",[945]],[[120721,120721],"mapped",[946]],[[120722,120722],"mapped",[947]],[[120723,120723],"mapped",[948]],[[120724,120724],"mapped",[949]],[[120725,120725],"mapped",[950]],[[120726,120726],"mapped",[951]],[[120727,120727],"mapped",[952]],[[120728,120728],"mapped",[953]],[[120729,120729],"mapped",[954]],[[120730,120730],"mapped",[955]],[[120731,120731],"mapped",[956]],[[120732,120732],"mapped",[957]],[[120733,120733],"mapped",[958]],[[120734,120734],"mapped",[959]],[[120735,120735],"mapped",[960]],[[120736,120736],"mapped",[961]],[[120737,120737],"mapped",[952]],[[120738,120738],"mapped",[963]],[[120739,120739],"mapped",[964]],[[120740,120740],"mapped",[965]],[[120741,120741],"mapped",[966]],[[120742,120742],"mapped",[967]],[[120743,120743],"mapped",[968]],[[120744,120744],"mapped",[969]],[[120745,120745],"mapped",[8711]],[[120746,120746],"mapped",[945]],[[120747,120747],"mapped",[946]],[[120748,120748],"mapped",[947]],[[120749,120749],"mapped",[948]],[[120750,120750],"mapped",[949]],[[120751,120751],"mapped",[950]],[[120752,120752],"mapped",[951]],[[120753,120753],"mapped",[952]],[[120754,120754],"mapped",[953]],[[120755,120755],"mapped",[954]],[[120756,120756],"mapped",[955]],[[120757,120757],"mapped",[956]],[[120758,120758],"mapped",[957]],[[120759,120759],"mapped",[958]],[[120760,120760],"mapped",[959]],[[120761,120761],"mapped",[960]],[[120762,120762],"mapped",[961]],[[120763,120764],"mapped",[963]],[[120765,120765],"mapped",[964]],[[120766,120766],"mapped",[965]],[[120767,120767],"mapped",[966]],[[120768,120768],"mapped",[967]],[[120769,120769],"mapped",[968]],[[120770,120770],"mapped",[969]],[[120771,120771],"mapped",[8706]],[[120772,120772],"mapped",[949]],[[120773,120773],"mapped",[952]],[[120774,120774],"mapped",[954]],[[120775,120775],"mapped",[966]],[[120776,120776],"mapped",[961]],[[120777,120777],"mapped",[960]],[[120778,120779],"mapped",[989]],[[120780,120781],"disallowed"],[[120782,120782],"mapped",[48]],[[120783,120783],"mapped",[49]],[[120784,120784],"mapped",[50]],[[120785,120785],"mapped",[51]],[[120786,120786],"mapped",[52]],[[120787,120787],"mapped",[53]],[[120788,120788],"mapped",[54]],[[120789,120789],"mapped",[55]],[[120790,120790],"mapped",[56]],[[120791,120791],"mapped",[57]],[[120792,120792],"mapped",[48]],[[120793,120793],"mapped",[49]],[[120794,120794],"mapped",[50]],[[120795,120795],"mapped",[51]],[[120796,120796],"mapped",[52]],[[120797,120797],"mapped",[53]],[[120798,120798],"mapped",[54]],[[120799,120799],"mapped",[55]],[[120800,120800],"mapped",[56]],[[120801,120801],"mapped",[57]],[[120802,120802],"mapped",[48]],[[120803,120803],"mapped",[49]],[[120804,120804],"mapped",[50]],[[120805,120805],"mapped",[51]],[[120806,120806],"mapped",[52]],[[120807,120807],"mapped",[53]],[[120808,120808],"mapped",[54]],[[120809,120809],"mapped",[55]],[[120810,120810],"mapped",[56]],[[120811,120811],"mapped",[57]],[[120812,120812],"mapped",[48]],[[120813,120813],"mapped",[49]],[[120814,120814],"mapped",[50]],[[120815,120815],"mapped",[51]],[[120816,120816],"mapped",[52]],[[120817,120817],"mapped",[53]],[[120818,120818],"mapped",[54]],[[120819,120819],"mapped",[55]],[[120820,120820],"mapped",[56]],[[120821,120821],"mapped",[57]],[[120822,120822],"mapped",[48]],[[120823,120823],"mapped",[49]],[[120824,120824],"mapped",[50]],[[120825,120825],"mapped",[51]],[[120826,120826],"mapped",[52]],[[120827,120827],"mapped",[53]],[[120828,120828],"mapped",[54]],[[120829,120829],"mapped",[55]],[[120830,120830],"mapped",[56]],[[120831,120831],"mapped",[57]],[[120832,121343],"valid",[],"NV8"],[[121344,121398],"valid"],[[121399,121402],"valid",[],"NV8"],[[121403,121452],"valid"],[[121453,121460],"valid",[],"NV8"],[[121461,121461],"valid"],[[121462,121475],"valid",[],"NV8"],[[121476,121476],"valid"],[[121477,121483],"valid",[],"NV8"],[[121484,121498],"disallowed"],[[121499,121503],"valid"],[[121504,121504],"disallowed"],[[121505,121519],"valid"],[[121520,124927],"disallowed"],[[124928,125124],"valid"],[[125125,125126],"disallowed"],[[125127,125135],"valid",[],"NV8"],[[125136,125142],"valid"],[[125143,126463],"disallowed"],[[126464,126464],"mapped",[1575]],[[126465,126465],"mapped",[1576]],[[126466,126466],"mapped",[1580]],[[126467,126467],"mapped",[1583]],[[126468,126468],"disallowed"],[[126469,126469],"mapped",[1608]],[[126470,126470],"mapped",[1586]],[[126471,126471],"mapped",[1581]],[[126472,126472],"mapped",[1591]],[[126473,126473],"mapped",[1610]],[[126474,126474],"mapped",[1603]],[[126475,126475],"mapped",[1604]],[[126476,126476],"mapped",[1605]],[[126477,126477],"mapped",[1606]],[[126478,126478],"mapped",[1587]],[[126479,126479],"mapped",[1593]],[[126480,126480],"mapped",[1601]],[[126481,126481],"mapped",[1589]],[[126482,126482],"mapped",[1602]],[[126483,126483],"mapped",[1585]],[[126484,126484],"mapped",[1588]],[[126485,126485],"mapped",[1578]],[[126486,126486],"mapped",[1579]],[[126487,126487],"mapped",[1582]],[[126488,126488],"mapped",[1584]],[[126489,126489],"mapped",[1590]],[[126490,126490],"mapped",[1592]],[[126491,126491],"mapped",[1594]],[[126492,126492],"mapped",[1646]],[[126493,126493],"mapped",[1722]],[[126494,126494],"mapped",[1697]],[[126495,126495],"mapped",[1647]],[[126496,126496],"disallowed"],[[126497,126497],"mapped",[1576]],[[126498,126498],"mapped",[1580]],[[126499,126499],"disallowed"],[[126500,126500],"mapped",[1607]],[[126501,126502],"disallowed"],[[126503,126503],"mapped",[1581]],[[126504,126504],"disallowed"],[[126505,126505],"mapped",[1610]],[[126506,126506],"mapped",[1603]],[[126507,126507],"mapped",[1604]],[[126508,126508],"mapped",[1605]],[[126509,126509],"mapped",[1606]],[[126510,126510],"mapped",[1587]],[[126511,126511],"mapped",[1593]],[[126512,126512],"mapped",[1601]],[[126513,126513],"mapped",[1589]],[[126514,126514],"mapped",[1602]],[[126515,126515],"disallowed"],[[126516,126516],"mapped",[1588]],[[126517,126517],"mapped",[1578]],[[126518,126518],"mapped",[1579]],[[126519,126519],"mapped",[1582]],[[126520,126520],"disallowed"],[[126521,126521],"mapped",[1590]],[[126522,126522],"disallowed"],[[126523,126523],"mapped",[1594]],[[126524,126529],"disallowed"],[[126530,126530],"mapped",[1580]],[[126531,126534],"disallowed"],[[126535,126535],"mapped",[1581]],[[126536,126536],"disallowed"],[[126537,126537],"mapped",[1610]],[[126538,126538],"disallowed"],[[126539,126539],"mapped",[1604]],[[126540,126540],"disallowed"],[[126541,126541],"mapped",[1606]],[[126542,126542],"mapped",[1587]],[[126543,126543],"mapped",[1593]],[[126544,126544],"disallowed"],[[126545,126545],"mapped",[1589]],[[126546,126546],"mapped",[1602]],[[126547,126547],"disallowed"],[[126548,126548],"mapped",[1588]],[[126549,126550],"disallowed"],[[126551,126551],"mapped",[1582]],[[126552,126552],"disallowed"],[[126553,126553],"mapped",[1590]],[[126554,126554],"disallowed"],[[126555,126555],"mapped",[1594]],[[126556,126556],"disallowed"],[[126557,126557],"mapped",[1722]],[[126558,126558],"disallowed"],[[126559,126559],"mapped",[1647]],[[126560,126560],"disallowed"],[[126561,126561],"mapped",[1576]],[[126562,126562],"mapped",[1580]],[[126563,126563],"disallowed"],[[126564,126564],"mapped",[1607]],[[126565,126566],"disallowed"],[[126567,126567],"mapped",[1581]],[[126568,126568],"mapped",[1591]],[[126569,126569],"mapped",[1610]],[[126570,126570],"mapped",[1603]],[[126571,126571],"disallowed"],[[126572,126572],"mapped",[1605]],[[126573,126573],"mapped",[1606]],[[126574,126574],"mapped",[1587]],[[126575,126575],"mapped",[1593]],[[126576,126576],"mapped",[1601]],[[126577,126577],"mapped",[1589]],[[126578,126578],"mapped",[1602]],[[126579,126579],"disallowed"],[[126580,126580],"mapped",[1588]],[[126581,126581],"mapped",[1578]],[[126582,126582],"mapped",[1579]],[[126583,126583],"mapped",[1582]],[[126584,126584],"disallowed"],[[126585,126585],"mapped",[1590]],[[126586,126586],"mapped",[1592]],[[126587,126587],"mapped",[1594]],[[126588,126588],"mapped",[1646]],[[126589,126589],"disallowed"],[[126590,126590],"mapped",[1697]],[[126591,126591],"disallowed"],[[126592,126592],"mapped",[1575]],[[126593,126593],"mapped",[1576]],[[126594,126594],"mapped",[1580]],[[126595,126595],"mapped",[1583]],[[126596,126596],"mapped",[1607]],[[126597,126597],"mapped",[1608]],[[126598,126598],"mapped",[1586]],[[126599,126599],"mapped",[1581]],[[126600,126600],"mapped",[1591]],[[126601,126601],"mapped",[1610]],[[126602,126602],"disallowed"],[[126603,126603],"mapped",[1604]],[[126604,126604],"mapped",[1605]],[[126605,126605],"mapped",[1606]],[[126606,126606],"mapped",[1587]],[[126607,126607],"mapped",[1593]],[[126608,126608],"mapped",[1601]],[[126609,126609],"mapped",[1589]],[[126610,126610],"mapped",[1602]],[[126611,126611],"mapped",[1585]],[[126612,126612],"mapped",[1588]],[[126613,126613],"mapped",[1578]],[[126614,126614],"mapped",[1579]],[[126615,126615],"mapped",[1582]],[[126616,126616],"mapped",[1584]],[[126617,126617],"mapped",[1590]],[[126618,126618],"mapped",[1592]],[[126619,126619],"mapped",[1594]],[[126620,126624],"disallowed"],[[126625,126625],"mapped",[1576]],[[126626,126626],"mapped",[1580]],[[126627,126627],"mapped",[1583]],[[126628,126628],"disallowed"],[[126629,126629],"mapped",[1608]],[[126630,126630],"mapped",[1586]],[[126631,126631],"mapped",[1581]],[[126632,126632],"mapped",[1591]],[[126633,126633],"mapped",[1610]],[[126634,126634],"disallowed"],[[126635,126635],"mapped",[1604]],[[126636,126636],"mapped",[1605]],[[126637,126637],"mapped",[1606]],[[126638,126638],"mapped",[1587]],[[126639,126639],"mapped",[1593]],[[126640,126640],"mapped",[1601]],[[126641,126641],"mapped",[1589]],[[126642,126642],"mapped",[1602]],[[126643,126643],"mapped",[1585]],[[126644,126644],"mapped",[1588]],[[126645,126645],"mapped",[1578]],[[126646,126646],"mapped",[1579]],[[126647,126647],"mapped",[1582]],[[126648,126648],"mapped",[1584]],[[126649,126649],"mapped",[1590]],[[126650,126650],"mapped",[1592]],[[126651,126651],"mapped",[1594]],[[126652,126703],"disallowed"],[[126704,126705],"valid",[],"NV8"],[[126706,126975],"disallowed"],[[126976,127019],"valid",[],"NV8"],[[127020,127023],"disallowed"],[[127024,127123],"valid",[],"NV8"],[[127124,127135],"disallowed"],[[127136,127150],"valid",[],"NV8"],[[127151,127152],"disallowed"],[[127153,127166],"valid",[],"NV8"],[[127167,127167],"valid",[],"NV8"],[[127168,127168],"disallowed"],[[127169,127183],"valid",[],"NV8"],[[127184,127184],"disallowed"],[[127185,127199],"valid",[],"NV8"],[[127200,127221],"valid",[],"NV8"],[[127222,127231],"disallowed"],[[127232,127232],"disallowed"],[[127233,127233],"disallowed_STD3_mapped",[48,44]],[[127234,127234],"disallowed_STD3_mapped",[49,44]],[[127235,127235],"disallowed_STD3_mapped",[50,44]],[[127236,127236],"disallowed_STD3_mapped",[51,44]],[[127237,127237],"disallowed_STD3_mapped",[52,44]],[[127238,127238],"disallowed_STD3_mapped",[53,44]],[[127239,127239],"disallowed_STD3_mapped",[54,44]],[[127240,127240],"disallowed_STD3_mapped",[55,44]],[[127241,127241],"disallowed_STD3_mapped",[56,44]],[[127242,127242],"disallowed_STD3_mapped",[57,44]],[[127243,127244],"valid",[],"NV8"],[[127245,127247],"disallowed"],[[127248,127248],"disallowed_STD3_mapped",[40,97,41]],[[127249,127249],"disallowed_STD3_mapped",[40,98,41]],[[127250,127250],"disallowed_STD3_mapped",[40,99,41]],[[127251,127251],"disallowed_STD3_mapped",[40,100,41]],[[127252,127252],"disallowed_STD3_mapped",[40,101,41]],[[127253,127253],"disallowed_STD3_mapped",[40,102,41]],[[127254,127254],"disallowed_STD3_mapped",[40,103,41]],[[127255,127255],"disallowed_STD3_mapped",[40,104,41]],[[127256,127256],"disallowed_STD3_mapped",[40,105,41]],[[127257,127257],"disallowed_STD3_mapped",[40,106,41]],[[127258,127258],"disallowed_STD3_mapped",[40,107,41]],[[127259,127259],"disallowed_STD3_mapped",[40,108,41]],[[127260,127260],"disallowed_STD3_mapped",[40,109,41]],[[127261,127261],"disallowed_STD3_mapped",[40,110,41]],[[127262,127262],"disallowed_STD3_mapped",[40,111,41]],[[127263,127263],"disallowed_STD3_mapped",[40,112,41]],[[127264,127264],"disallowed_STD3_mapped",[40,113,41]],[[127265,127265],"disallowed_STD3_mapped",[40,114,41]],[[127266,127266],"disallowed_STD3_mapped",[40,115,41]],[[127267,127267],"disallowed_STD3_mapped",[40,116,41]],[[127268,127268],"disallowed_STD3_mapped",[40,117,41]],[[127269,127269],"disallowed_STD3_mapped",[40,118,41]],[[127270,127270],"disallowed_STD3_mapped",[40,119,41]],[[127271,127271],"disallowed_STD3_mapped",[40,120,41]],[[127272,127272],"disallowed_STD3_mapped",[40,121,41]],[[127273,127273],"disallowed_STD3_mapped",[40,122,41]],[[127274,127274],"mapped",[12308,115,12309]],[[127275,127275],"mapped",[99]],[[127276,127276],"mapped",[114]],[[127277,127277],"mapped",[99,100]],[[127278,127278],"mapped",[119,122]],[[127279,127279],"disallowed"],[[127280,127280],"mapped",[97]],[[127281,127281],"mapped",[98]],[[127282,127282],"mapped",[99]],[[127283,127283],"mapped",[100]],[[127284,127284],"mapped",[101]],[[127285,127285],"mapped",[102]],[[127286,127286],"mapped",[103]],[[127287,127287],"mapped",[104]],[[127288,127288],"mapped",[105]],[[127289,127289],"mapped",[106]],[[127290,127290],"mapped",[107]],[[127291,127291],"mapped",[108]],[[127292,127292],"mapped",[109]],[[127293,127293],"mapped",[110]],[[127294,127294],"mapped",[111]],[[127295,127295],"mapped",[112]],[[127296,127296],"mapped",[113]],[[127297,127297],"mapped",[114]],[[127298,127298],"mapped",[115]],[[127299,127299],"mapped",[116]],[[127300,127300],"mapped",[117]],[[127301,127301],"mapped",[118]],[[127302,127302],"mapped",[119]],[[127303,127303],"mapped",[120]],[[127304,127304],"mapped",[121]],[[127305,127305],"mapped",[122]],[[127306,127306],"mapped",[104,118]],[[127307,127307],"mapped",[109,118]],[[127308,127308],"mapped",[115,100]],[[127309,127309],"mapped",[115,115]],[[127310,127310],"mapped",[112,112,118]],[[127311,127311],"mapped",[119,99]],[[127312,127318],"valid",[],"NV8"],[[127319,127319],"valid",[],"NV8"],[[127320,127326],"valid",[],"NV8"],[[127327,127327],"valid",[],"NV8"],[[127328,127337],"valid",[],"NV8"],[[127338,127338],"mapped",[109,99]],[[127339,127339],"mapped",[109,100]],[[127340,127343],"disallowed"],[[127344,127352],"valid",[],"NV8"],[[127353,127353],"valid",[],"NV8"],[[127354,127354],"valid",[],"NV8"],[[127355,127356],"valid",[],"NV8"],[[127357,127358],"valid",[],"NV8"],[[127359,127359],"valid",[],"NV8"],[[127360,127369],"valid",[],"NV8"],[[127370,127373],"valid",[],"NV8"],[[127374,127375],"valid",[],"NV8"],[[127376,127376],"mapped",[100,106]],[[127377,127386],"valid",[],"NV8"],[[127387,127461],"disallowed"],[[127462,127487],"valid",[],"NV8"],[[127488,127488],"mapped",[12411,12363]],[[127489,127489],"mapped",[12467,12467]],[[127490,127490],"mapped",[12469]],[[127491,127503],"disallowed"],[[127504,127504],"mapped",[25163]],[[127505,127505],"mapped",[23383]],[[127506,127506],"mapped",[21452]],[[127507,127507],"mapped",[12487]],[[127508,127508],"mapped",[20108]],[[127509,127509],"mapped",[22810]],[[127510,127510],"mapped",[35299]],[[127511,127511],"mapped",[22825]],[[127512,127512],"mapped",[20132]],[[127513,127513],"mapped",[26144]],[[127514,127514],"mapped",[28961]],[[127515,127515],"mapped",[26009]],[[127516,127516],"mapped",[21069]],[[127517,127517],"mapped",[24460]],[[127518,127518],"mapped",[20877]],[[127519,127519],"mapped",[26032]],[[127520,127520],"mapped",[21021]],[[127521,127521],"mapped",[32066]],[[127522,127522],"mapped",[29983]],[[127523,127523],"mapped",[36009]],[[127524,127524],"mapped",[22768]],[[127525,127525],"mapped",[21561]],[[127526,127526],"mapped",[28436]],[[127527,127527],"mapped",[25237]],[[127528,127528],"mapped",[25429]],[[127529,127529],"mapped",[19968]],[[127530,127530],"mapped",[19977]],[[127531,127531],"mapped",[36938]],[[127532,127532],"mapped",[24038]],[[127533,127533],"mapped",[20013]],[[127534,127534],"mapped",[21491]],[[127535,127535],"mapped",[25351]],[[127536,127536],"mapped",[36208]],[[127537,127537],"mapped",[25171]],[[127538,127538],"mapped",[31105]],[[127539,127539],"mapped",[31354]],[[127540,127540],"mapped",[21512]],[[127541,127541],"mapped",[28288]],[[127542,127542],"mapped",[26377]],[[127543,127543],"mapped",[26376]],[[127544,127544],"mapped",[30003]],[[127545,127545],"mapped",[21106]],[[127546,127546],"mapped",[21942]],[[127547,127551],"disallowed"],[[127552,127552],"mapped",[12308,26412,12309]],[[127553,127553],"mapped",[12308,19977,12309]],[[127554,127554],"mapped",[12308,20108,12309]],[[127555,127555],"mapped",[12308,23433,12309]],[[127556,127556],"mapped",[12308,28857,12309]],[[127557,127557],"mapped",[12308,25171,12309]],[[127558,127558],"mapped",[12308,30423,12309]],[[127559,127559],"mapped",[12308,21213,12309]],[[127560,127560],"mapped",[12308,25943,12309]],[[127561,127567],"disallowed"],[[127568,127568],"mapped",[24471]],[[127569,127569],"mapped",[21487]],[[127570,127743],"disallowed"],[[127744,127776],"valid",[],"NV8"],[[127777,127788],"valid",[],"NV8"],[[127789,127791],"valid",[],"NV8"],[[127792,127797],"valid",[],"NV8"],[[127798,127798],"valid",[],"NV8"],[[127799,127868],"valid",[],"NV8"],[[127869,127869],"valid",[],"NV8"],[[127870,127871],"valid",[],"NV8"],[[127872,127891],"valid",[],"NV8"],[[127892,127903],"valid",[],"NV8"],[[127904,127940],"valid",[],"NV8"],[[127941,127941],"valid",[],"NV8"],[[127942,127946],"valid",[],"NV8"],[[127947,127950],"valid",[],"NV8"],[[127951,127955],"valid",[],"NV8"],[[127956,127967],"valid",[],"NV8"],[[127968,127984],"valid",[],"NV8"],[[127985,127991],"valid",[],"NV8"],[[127992,127999],"valid",[],"NV8"],[[128000,128062],"valid",[],"NV8"],[[128063,128063],"valid",[],"NV8"],[[128064,128064],"valid",[],"NV8"],[[128065,128065],"valid",[],"NV8"],[[128066,128247],"valid",[],"NV8"],[[128248,128248],"valid",[],"NV8"],[[128249,128252],"valid",[],"NV8"],[[128253,128254],"valid",[],"NV8"],[[128255,128255],"valid",[],"NV8"],[[128256,128317],"valid",[],"NV8"],[[128318,128319],"valid",[],"NV8"],[[128320,128323],"valid",[],"NV8"],[[128324,128330],"valid",[],"NV8"],[[128331,128335],"valid",[],"NV8"],[[128336,128359],"valid",[],"NV8"],[[128360,128377],"valid",[],"NV8"],[[128378,128378],"disallowed"],[[128379,128419],"valid",[],"NV8"],[[128420,128420],"disallowed"],[[128421,128506],"valid",[],"NV8"],[[128507,128511],"valid",[],"NV8"],[[128512,128512],"valid",[],"NV8"],[[128513,128528],"valid",[],"NV8"],[[128529,128529],"valid",[],"NV8"],[[128530,128532],"valid",[],"NV8"],[[128533,128533],"valid",[],"NV8"],[[128534,128534],"valid",[],"NV8"],[[128535,128535],"valid",[],"NV8"],[[128536,128536],"valid",[],"NV8"],[[128537,128537],"valid",[],"NV8"],[[128538,128538],"valid",[],"NV8"],[[128539,128539],"valid",[],"NV8"],[[128540,128542],"valid",[],"NV8"],[[128543,128543],"valid",[],"NV8"],[[128544,128549],"valid",[],"NV8"],[[128550,128551],"valid",[],"NV8"],[[128552,128555],"valid",[],"NV8"],[[128556,128556],"valid",[],"NV8"],[[128557,128557],"valid",[],"NV8"],[[128558,128559],"valid",[],"NV8"],[[128560,128563],"valid",[],"NV8"],[[128564,128564],"valid",[],"NV8"],[[128565,128576],"valid",[],"NV8"],[[128577,128578],"valid",[],"NV8"],[[128579,128580],"valid",[],"NV8"],[[128581,128591],"valid",[],"NV8"],[[128592,128639],"valid",[],"NV8"],[[128640,128709],"valid",[],"NV8"],[[128710,128719],"valid",[],"NV8"],[[128720,128720],"valid",[],"NV8"],[[128721,128735],"disallowed"],[[128736,128748],"valid",[],"NV8"],[[128749,128751],"disallowed"],[[128752,128755],"valid",[],"NV8"],[[128756,128767],"disallowed"],[[128768,128883],"valid",[],"NV8"],[[128884,128895],"disallowed"],[[128896,128980],"valid",[],"NV8"],[[128981,129023],"disallowed"],[[129024,129035],"valid",[],"NV8"],[[129036,129039],"disallowed"],[[129040,129095],"valid",[],"NV8"],[[129096,129103],"disallowed"],[[129104,129113],"valid",[],"NV8"],[[129114,129119],"disallowed"],[[129120,129159],"valid",[],"NV8"],[[129160,129167],"disallowed"],[[129168,129197],"valid",[],"NV8"],[[129198,129295],"disallowed"],[[129296,129304],"valid",[],"NV8"],[[129305,129407],"disallowed"],[[129408,129412],"valid",[],"NV8"],[[129413,129471],"disallowed"],[[129472,129472],"valid",[],"NV8"],[[129473,131069],"disallowed"],[[131070,131071],"disallowed"],[[131072,173782],"valid"],[[173783,173823],"disallowed"],[[173824,177972],"valid"],[[177973,177983],"disallowed"],[[177984,178205],"valid"],[[178206,178207],"disallowed"],[[178208,183969],"valid"],[[183970,194559],"disallowed"],[[194560,194560],"mapped",[20029]],[[194561,194561],"mapped",[20024]],[[194562,194562],"mapped",[20033]],[[194563,194563],"mapped",[131362]],[[194564,194564],"mapped",[20320]],[[194565,194565],"mapped",[20398]],[[194566,194566],"mapped",[20411]],[[194567,194567],"mapped",[20482]],[[194568,194568],"mapped",[20602]],[[194569,194569],"mapped",[20633]],[[194570,194570],"mapped",[20711]],[[194571,194571],"mapped",[20687]],[[194572,194572],"mapped",[13470]],[[194573,194573],"mapped",[132666]],[[194574,194574],"mapped",[20813]],[[194575,194575],"mapped",[20820]],[[194576,194576],"mapped",[20836]],[[194577,194577],"mapped",[20855]],[[194578,194578],"mapped",[132380]],[[194579,194579],"mapped",[13497]],[[194580,194580],"mapped",[20839]],[[194581,194581],"mapped",[20877]],[[194582,194582],"mapped",[132427]],[[194583,194583],"mapped",[20887]],[[194584,194584],"mapped",[20900]],[[194585,194585],"mapped",[20172]],[[194586,194586],"mapped",[20908]],[[194587,194587],"mapped",[20917]],[[194588,194588],"mapped",[168415]],[[194589,194589],"mapped",[20981]],[[194590,194590],"mapped",[20995]],[[194591,194591],"mapped",[13535]],[[194592,194592],"mapped",[21051]],[[194593,194593],"mapped",[21062]],[[194594,194594],"mapped",[21106]],[[194595,194595],"mapped",[21111]],[[194596,194596],"mapped",[13589]],[[194597,194597],"mapped",[21191]],[[194598,194598],"mapped",[21193]],[[194599,194599],"mapped",[21220]],[[194600,194600],"mapped",[21242]],[[194601,194601],"mapped",[21253]],[[194602,194602],"mapped",[21254]],[[194603,194603],"mapped",[21271]],[[194604,194604],"mapped",[21321]],[[194605,194605],"mapped",[21329]],[[194606,194606],"mapped",[21338]],[[194607,194607],"mapped",[21363]],[[194608,194608],"mapped",[21373]],[[194609,194611],"mapped",[21375]],[[194612,194612],"mapped",[133676]],[[194613,194613],"mapped",[28784]],[[194614,194614],"mapped",[21450]],[[194615,194615],"mapped",[21471]],[[194616,194616],"mapped",[133987]],[[194617,194617],"mapped",[21483]],[[194618,194618],"mapped",[21489]],[[194619,194619],"mapped",[21510]],[[194620,194620],"mapped",[21662]],[[194621,194621],"mapped",[21560]],[[194622,194622],"mapped",[21576]],[[194623,194623],"mapped",[21608]],[[194624,194624],"mapped",[21666]],[[194625,194625],"mapped",[21750]],[[194626,194626],"mapped",[21776]],[[194627,194627],"mapped",[21843]],[[194628,194628],"mapped",[21859]],[[194629,194630],"mapped",[21892]],[[194631,194631],"mapped",[21913]],[[194632,194632],"mapped",[21931]],[[194633,194633],"mapped",[21939]],[[194634,194634],"mapped",[21954]],[[194635,194635],"mapped",[22294]],[[194636,194636],"mapped",[22022]],[[194637,194637],"mapped",[22295]],[[194638,194638],"mapped",[22097]],[[194639,194639],"mapped",[22132]],[[194640,194640],"mapped",[20999]],[[194641,194641],"mapped",[22766]],[[194642,194642],"mapped",[22478]],[[194643,194643],"mapped",[22516]],[[194644,194644],"mapped",[22541]],[[194645,194645],"mapped",[22411]],[[194646,194646],"mapped",[22578]],[[194647,194647],"mapped",[22577]],[[194648,194648],"mapped",[22700]],[[194649,194649],"mapped",[136420]],[[194650,194650],"mapped",[22770]],[[194651,194651],"mapped",[22775]],[[194652,194652],"mapped",[22790]],[[194653,194653],"mapped",[22810]],[[194654,194654],"mapped",[22818]],[[194655,194655],"mapped",[22882]],[[194656,194656],"mapped",[136872]],[[194657,194657],"mapped",[136938]],[[194658,194658],"mapped",[23020]],[[194659,194659],"mapped",[23067]],[[194660,194660],"mapped",[23079]],[[194661,194661],"mapped",[23000]],[[194662,194662],"mapped",[23142]],[[194663,194663],"mapped",[14062]],[[194664,194664],"disallowed"],[[194665,194665],"mapped",[23304]],[[194666,194667],"mapped",[23358]],[[194668,194668],"mapped",[137672]],[[194669,194669],"mapped",[23491]],[[194670,194670],"mapped",[23512]],[[194671,194671],"mapped",[23527]],[[194672,194672],"mapped",[23539]],[[194673,194673],"mapped",[138008]],[[194674,194674],"mapped",[23551]],[[194675,194675],"mapped",[23558]],[[194676,194676],"disallowed"],[[194677,194677],"mapped",[23586]],[[194678,194678],"mapped",[14209]],[[194679,194679],"mapped",[23648]],[[194680,194680],"mapped",[23662]],[[194681,194681],"mapped",[23744]],[[194682,194682],"mapped",[23693]],[[194683,194683],"mapped",[138724]],[[194684,194684],"mapped",[23875]],[[194685,194685],"mapped",[138726]],[[194686,194686],"mapped",[23918]],[[194687,194687],"mapped",[23915]],[[194688,194688],"mapped",[23932]],[[194689,194689],"mapped",[24033]],[[194690,194690],"mapped",[24034]],[[194691,194691],"mapped",[14383]],[[194692,194692],"mapped",[24061]],[[194693,194693],"mapped",[24104]],[[194694,194694],"mapped",[24125]],[[194695,194695],"mapped",[24169]],[[194696,194696],"mapped",[14434]],[[194697,194697],"mapped",[139651]],[[194698,194698],"mapped",[14460]],[[194699,194699],"mapped",[24240]],[[194700,194700],"mapped",[24243]],[[194701,194701],"mapped",[24246]],[[194702,194702],"mapped",[24266]],[[194703,194703],"mapped",[172946]],[[194704,194704],"mapped",[24318]],[[194705,194706],"mapped",[140081]],[[194707,194707],"mapped",[33281]],[[194708,194709],"mapped",[24354]],[[194710,194710],"mapped",[14535]],[[194711,194711],"mapped",[144056]],[[194712,194712],"mapped",[156122]],[[194713,194713],"mapped",[24418]],[[194714,194714],"mapped",[24427]],[[194715,194715],"mapped",[14563]],[[194716,194716],"mapped",[24474]],[[194717,194717],"mapped",[24525]],[[194718,194718],"mapped",[24535]],[[194719,194719],"mapped",[24569]],[[194720,194720],"mapped",[24705]],[[194721,194721],"mapped",[14650]],[[194722,194722],"mapped",[14620]],[[194723,194723],"mapped",[24724]],[[194724,194724],"mapped",[141012]],[[194725,194725],"mapped",[24775]],[[194726,194726],"mapped",[24904]],[[194727,194727],"mapped",[24908]],[[194728,194728],"mapped",[24910]],[[194729,194729],"mapped",[24908]],[[194730,194730],"mapped",[24954]],[[194731,194731],"mapped",[24974]],[[194732,194732],"mapped",[25010]],[[194733,194733],"mapped",[24996]],[[194734,194734],"mapped",[25007]],[[194735,194735],"mapped",[25054]],[[194736,194736],"mapped",[25074]],[[194737,194737],"mapped",[25078]],[[194738,194738],"mapped",[25104]],[[194739,194739],"mapped",[25115]],[[194740,194740],"mapped",[25181]],[[194741,194741],"mapped",[25265]],[[194742,194742],"mapped",[25300]],[[194743,194743],"mapped",[25424]],[[194744,194744],"mapped",[142092]],[[194745,194745],"mapped",[25405]],[[194746,194746],"mapped",[25340]],[[194747,194747],"mapped",[25448]],[[194748,194748],"mapped",[25475]],[[194749,194749],"mapped",[25572]],[[194750,194750],"mapped",[142321]],[[194751,194751],"mapped",[25634]],[[194752,194752],"mapped",[25541]],[[194753,194753],"mapped",[25513]],[[194754,194754],"mapped",[14894]],[[194755,194755],"mapped",[25705]],[[194756,194756],"mapped",[25726]],[[194757,194757],"mapped",[25757]],[[194758,194758],"mapped",[25719]],[[194759,194759],"mapped",[14956]],[[194760,194760],"mapped",[25935]],[[194761,194761],"mapped",[25964]],[[194762,194762],"mapped",[143370]],[[194763,194763],"mapped",[26083]],[[194764,194764],"mapped",[26360]],[[194765,194765],"mapped",[26185]],[[194766,194766],"mapped",[15129]],[[194767,194767],"mapped",[26257]],[[194768,194768],"mapped",[15112]],[[194769,194769],"mapped",[15076]],[[194770,194770],"mapped",[20882]],[[194771,194771],"mapped",[20885]],[[194772,194772],"mapped",[26368]],[[194773,194773],"mapped",[26268]],[[194774,194774],"mapped",[32941]],[[194775,194775],"mapped",[17369]],[[194776,194776],"mapped",[26391]],[[194777,194777],"mapped",[26395]],[[194778,194778],"mapped",[26401]],[[194779,194779],"mapped",[26462]],[[194780,194780],"mapped",[26451]],[[194781,194781],"mapped",[144323]],[[194782,194782],"mapped",[15177]],[[194783,194783],"mapped",[26618]],[[194784,194784],"mapped",[26501]],[[194785,194785],"mapped",[26706]],[[194786,194786],"mapped",[26757]],[[194787,194787],"mapped",[144493]],[[194788,194788],"mapped",[26766]],[[194789,194789],"mapped",[26655]],[[194790,194790],"mapped",[26900]],[[194791,194791],"mapped",[15261]],[[194792,194792],"mapped",[26946]],[[194793,194793],"mapped",[27043]],[[194794,194794],"mapped",[27114]],[[194795,194795],"mapped",[27304]],[[194796,194796],"mapped",[145059]],[[194797,194797],"mapped",[27355]],[[194798,194798],"mapped",[15384]],[[194799,194799],"mapped",[27425]],[[194800,194800],"mapped",[145575]],[[194801,194801],"mapped",[27476]],[[194802,194802],"mapped",[15438]],[[194803,194803],"mapped",[27506]],[[194804,194804],"mapped",[27551]],[[194805,194805],"mapped",[27578]],[[194806,194806],"mapped",[27579]],[[194807,194807],"mapped",[146061]],[[194808,194808],"mapped",[138507]],[[194809,194809],"mapped",[146170]],[[194810,194810],"mapped",[27726]],[[194811,194811],"mapped",[146620]],[[194812,194812],"mapped",[27839]],[[194813,194813],"mapped",[27853]],[[194814,194814],"mapped",[27751]],[[194815,194815],"mapped",[27926]],[[194816,194816],"mapped",[27966]],[[194817,194817],"mapped",[28023]],[[194818,194818],"mapped",[27969]],[[194819,194819],"mapped",[28009]],[[194820,194820],"mapped",[28024]],[[194821,194821],"mapped",[28037]],[[194822,194822],"mapped",[146718]],[[194823,194823],"mapped",[27956]],[[194824,194824],"mapped",[28207]],[[194825,194825],"mapped",[28270]],[[194826,194826],"mapped",[15667]],[[194827,194827],"mapped",[28363]],[[194828,194828],"mapped",[28359]],[[194829,194829],"mapped",[147153]],[[194830,194830],"mapped",[28153]],[[194831,194831],"mapped",[28526]],[[194832,194832],"mapped",[147294]],[[194833,194833],"mapped",[147342]],[[194834,194834],"mapped",[28614]],[[194835,194835],"mapped",[28729]],[[194836,194836],"mapped",[28702]],[[194837,194837],"mapped",[28699]],[[194838,194838],"mapped",[15766]],[[194839,194839],"mapped",[28746]],[[194840,194840],"mapped",[28797]],[[194841,194841],"mapped",[28791]],[[194842,194842],"mapped",[28845]],[[194843,194843],"mapped",[132389]],[[194844,194844],"mapped",[28997]],[[194845,194845],"mapped",[148067]],[[194846,194846],"mapped",[29084]],[[194847,194847],"disallowed"],[[194848,194848],"mapped",[29224]],[[194849,194849],"mapped",[29237]],[[194850,194850],"mapped",[29264]],[[194851,194851],"mapped",[149000]],[[194852,194852],"mapped",[29312]],[[194853,194853],"mapped",[29333]],[[194854,194854],"mapped",[149301]],[[194855,194855],"mapped",[149524]],[[194856,194856],"mapped",[29562]],[[194857,194857],"mapped",[29579]],[[194858,194858],"mapped",[16044]],[[194859,194859],"mapped",[29605]],[[194860,194861],"mapped",[16056]],[[194862,194862],"mapped",[29767]],[[194863,194863],"mapped",[29788]],[[194864,194864],"mapped",[29809]],[[194865,194865],"mapped",[29829]],[[194866,194866],"mapped",[29898]],[[194867,194867],"mapped",[16155]],[[194868,194868],"mapped",[29988]],[[194869,194869],"mapped",[150582]],[[194870,194870],"mapped",[30014]],[[194871,194871],"mapped",[150674]],[[194872,194872],"mapped",[30064]],[[194873,194873],"mapped",[139679]],[[194874,194874],"mapped",[30224]],[[194875,194875],"mapped",[151457]],[[194876,194876],"mapped",[151480]],[[194877,194877],"mapped",[151620]],[[194878,194878],"mapped",[16380]],[[194879,194879],"mapped",[16392]],[[194880,194880],"mapped",[30452]],[[194881,194881],"mapped",[151795]],[[194882,194882],"mapped",[151794]],[[194883,194883],"mapped",[151833]],[[194884,194884],"mapped",[151859]],[[194885,194885],"mapped",[30494]],[[194886,194887],"mapped",[30495]],[[194888,194888],"mapped",[30538]],[[194889,194889],"mapped",[16441]],[[194890,194890],"mapped",[30603]],[[194891,194891],"mapped",[16454]],[[194892,194892],"mapped",[16534]],[[194893,194893],"mapped",[152605]],[[194894,194894],"mapped",[30798]],[[194895,194895],"mapped",[30860]],[[194896,194896],"mapped",[30924]],[[194897,194897],"mapped",[16611]],[[194898,194898],"mapped",[153126]],[[194899,194899],"mapped",[31062]],[[194900,194900],"mapped",[153242]],[[194901,194901],"mapped",[153285]],[[194902,194902],"mapped",[31119]],[[194903,194903],"mapped",[31211]],[[194904,194904],"mapped",[16687]],[[194905,194905],"mapped",[31296]],[[194906,194906],"mapped",[31306]],[[194907,194907],"mapped",[31311]],[[194908,194908],"mapped",[153980]],[[194909,194910],"mapped",[154279]],[[194911,194911],"disallowed"],[[194912,194912],"mapped",[16898]],[[194913,194913],"mapped",[154539]],[[194914,194914],"mapped",[31686]],[[194915,194915],"mapped",[31689]],[[194916,194916],"mapped",[16935]],[[194917,194917],"mapped",[154752]],[[194918,194918],"mapped",[31954]],[[194919,194919],"mapped",[17056]],[[194920,194920],"mapped",[31976]],[[194921,194921],"mapped",[31971]],[[194922,194922],"mapped",[32000]],[[194923,194923],"mapped",[155526]],[[194924,194924],"mapped",[32099]],[[194925,194925],"mapped",[17153]],[[194926,194926],"mapped",[32199]],[[194927,194927],"mapped",[32258]],[[194928,194928],"mapped",[32325]],[[194929,194929],"mapped",[17204]],[[194930,194930],"mapped",[156200]],[[194931,194931],"mapped",[156231]],[[194932,194932],"mapped",[17241]],[[194933,194933],"mapped",[156377]],[[194934,194934],"mapped",[32634]],[[194935,194935],"mapped",[156478]],[[194936,194936],"mapped",[32661]],[[194937,194937],"mapped",[32762]],[[194938,194938],"mapped",[32773]],[[194939,194939],"mapped",[156890]],[[194940,194940],"mapped",[156963]],[[194941,194941],"mapped",[32864]],[[194942,194942],"mapped",[157096]],[[194943,194943],"mapped",[32880]],[[194944,194944],"mapped",[144223]],[[194945,194945],"mapped",[17365]],[[194946,194946],"mapped",[32946]],[[194947,194947],"mapped",[33027]],[[194948,194948],"mapped",[17419]],[[194949,194949],"mapped",[33086]],[[194950,194950],"mapped",[23221]],[[194951,194951],"mapped",[157607]],[[194952,194952],"mapped",[157621]],[[194953,194953],"mapped",[144275]],[[194954,194954],"mapped",[144284]],[[194955,194955],"mapped",[33281]],[[194956,194956],"mapped",[33284]],[[194957,194957],"mapped",[36766]],[[194958,194958],"mapped",[17515]],[[194959,194959],"mapped",[33425]],[[194960,194960],"mapped",[33419]],[[194961,194961],"mapped",[33437]],[[194962,194962],"mapped",[21171]],[[194963,194963],"mapped",[33457]],[[194964,194964],"mapped",[33459]],[[194965,194965],"mapped",[33469]],[[194966,194966],"mapped",[33510]],[[194967,194967],"mapped",[158524]],[[194968,194968],"mapped",[33509]],[[194969,194969],"mapped",[33565]],[[194970,194970],"mapped",[33635]],[[194971,194971],"mapped",[33709]],[[194972,194972],"mapped",[33571]],[[194973,194973],"mapped",[33725]],[[194974,194974],"mapped",[33767]],[[194975,194975],"mapped",[33879]],[[194976,194976],"mapped",[33619]],[[194977,194977],"mapped",[33738]],[[194978,194978],"mapped",[33740]],[[194979,194979],"mapped",[33756]],[[194980,194980],"mapped",[158774]],[[194981,194981],"mapped",[159083]],[[194982,194982],"mapped",[158933]],[[194983,194983],"mapped",[17707]],[[194984,194984],"mapped",[34033]],[[194985,194985],"mapped",[34035]],[[194986,194986],"mapped",[34070]],[[194987,194987],"mapped",[160714]],[[194988,194988],"mapped",[34148]],[[194989,194989],"mapped",[159532]],[[194990,194990],"mapped",[17757]],[[194991,194991],"mapped",[17761]],[[194992,194992],"mapped",[159665]],[[194993,194993],"mapped",[159954]],[[194994,194994],"mapped",[17771]],[[194995,194995],"mapped",[34384]],[[194996,194996],"mapped",[34396]],[[194997,194997],"mapped",[34407]],[[194998,194998],"mapped",[34409]],[[194999,194999],"mapped",[34473]],[[195000,195000],"mapped",[34440]],[[195001,195001],"mapped",[34574]],[[195002,195002],"mapped",[34530]],[[195003,195003],"mapped",[34681]],[[195004,195004],"mapped",[34600]],[[195005,195005],"mapped",[34667]],[[195006,195006],"mapped",[34694]],[[195007,195007],"disallowed"],[[195008,195008],"mapped",[34785]],[[195009,195009],"mapped",[34817]],[[195010,195010],"mapped",[17913]],[[195011,195011],"mapped",[34912]],[[195012,195012],"mapped",[34915]],[[195013,195013],"mapped",[161383]],[[195014,195014],"mapped",[35031]],[[195015,195015],"mapped",[35038]],[[195016,195016],"mapped",[17973]],[[195017,195017],"mapped",[35066]],[[195018,195018],"mapped",[13499]],[[195019,195019],"mapped",[161966]],[[195020,195020],"mapped",[162150]],[[195021,195021],"mapped",[18110]],[[195022,195022],"mapped",[18119]],[[195023,195023],"mapped",[35488]],[[195024,195024],"mapped",[35565]],[[195025,195025],"mapped",[35722]],[[195026,195026],"mapped",[35925]],[[195027,195027],"mapped",[162984]],[[195028,195028],"mapped",[36011]],[[195029,195029],"mapped",[36033]],[[195030,195030],"mapped",[36123]],[[195031,195031],"mapped",[36215]],[[195032,195032],"mapped",[163631]],[[195033,195033],"mapped",[133124]],[[195034,195034],"mapped",[36299]],[[195035,195035],"mapped",[36284]],[[195036,195036],"mapped",[36336]],[[195037,195037],"mapped",[133342]],[[195038,195038],"mapped",[36564]],[[195039,195039],"mapped",[36664]],[[195040,195040],"mapped",[165330]],[[195041,195041],"mapped",[165357]],[[195042,195042],"mapped",[37012]],[[195043,195043],"mapped",[37105]],[[195044,195044],"mapped",[37137]],[[195045,195045],"mapped",[165678]],[[195046,195046],"mapped",[37147]],[[195047,195047],"mapped",[37432]],[[195048,195048],"mapped",[37591]],[[195049,195049],"mapped",[37592]],[[195050,195050],"mapped",[37500]],[[195051,195051],"mapped",[37881]],[[195052,195052],"mapped",[37909]],[[195053,195053],"mapped",[166906]],[[195054,195054],"mapped",[38283]],[[195055,195055],"mapped",[18837]],[[195056,195056],"mapped",[38327]],[[195057,195057],"mapped",[167287]],[[195058,195058],"mapped",[18918]],[[195059,195059],"mapped",[38595]],[[195060,195060],"mapped",[23986]],[[195061,195061],"mapped",[38691]],[[195062,195062],"mapped",[168261]],[[195063,195063],"mapped",[168474]],[[195064,195064],"mapped",[19054]],[[195065,195065],"mapped",[19062]],[[195066,195066],"mapped",[38880]],[[195067,195067],"mapped",[168970]],[[195068,195068],"mapped",[19122]],[[195069,195069],"mapped",[169110]],[[195070,195071],"mapped",[38923]],[[195072,195072],"mapped",[38953]],[[195073,195073],"mapped",[169398]],[[195074,195074],"mapped",[39138]],[[195075,195075],"mapped",[19251]],[[195076,195076],"mapped",[39209]],[[195077,195077],"mapped",[39335]],[[195078,195078],"mapped",[39362]],[[195079,195079],"mapped",[39422]],[[195080,195080],"mapped",[19406]],[[195081,195081],"mapped",[170800]],[[195082,195082],"mapped",[39698]],[[195083,195083],"mapped",[40000]],[[195084,195084],"mapped",[40189]],[[195085,195085],"mapped",[19662]],[[195086,195086],"mapped",[19693]],[[195087,195087],"mapped",[40295]],[[195088,195088],"mapped",[172238]],[[195089,195089],"mapped",[19704]],[[195090,195090],"mapped",[172293]],[[195091,195091],"mapped",[172558]],[[195092,195092],"mapped",[172689]],[[195093,195093],"mapped",[40635]],[[195094,195094],"mapped",[19798]],[[195095,195095],"mapped",[40697]],[[195096,195096],"mapped",[40702]],[[195097,195097],"mapped",[40709]],[[195098,195098],"mapped",[40719]],[[195099,195099],"mapped",[40726]],[[195100,195100],"mapped",[40763]],[[195101,195101],"mapped",[173568]],[[195102,196605],"disallowed"],[[196606,196607],"disallowed"],[[196608,262141],"disallowed"],[[262142,262143],"disallowed"],[[262144,327677],"disallowed"],[[327678,327679],"disallowed"],[[327680,393213],"disallowed"],[[393214,393215],"disallowed"],[[393216,458749],"disallowed"],[[458750,458751],"disallowed"],[[458752,524285],"disallowed"],[[524286,524287],"disallowed"],[[524288,589821],"disallowed"],[[589822,589823],"disallowed"],[[589824,655357],"disallowed"],[[655358,655359],"disallowed"],[[655360,720893],"disallowed"],[[720894,720895],"disallowed"],[[720896,786429],"disallowed"],[[786430,786431],"disallowed"],[[786432,851965],"disallowed"],[[851966,851967],"disallowed"],[[851968,917501],"disallowed"],[[917502,917503],"disallowed"],[[917504,917504],"disallowed"],[[917505,917505],"disallowed"],[[917506,917535],"disallowed"],[[917536,917631],"disallowed"],[[917632,917759],"disallowed"],[[917760,917999],"ignored"],[[918000,983037],"disallowed"],[[983038,983039],"disallowed"],[[983040,1048573],"disallowed"],[[1048574,1048575],"disallowed"],[[1048576,1114109],"disallowed"],[[1114110,1114111],"disallowed"]]')}};var __webpack_module_cache__={};function __nccwpck_require__(r){var i=__webpack_module_cache__[r];if(i!==undefined){return i.exports}var a=__webpack_module_cache__[r]={exports:{}};var s=true;try{__webpack_modules__[r].call(a.exports,a,a.exports,__nccwpck_require__);s=false}finally{if(s)delete __webpack_module_cache__[r]}return a.exports}(()=>{__nccwpck_require__.n=r=>{var i=r&&r.__esModule?()=>r["default"]:()=>r;__nccwpck_require__.d(i,{a:i});return i}})();(()=>{__nccwpck_require__.d=(r,i)=>{for(var a in i){if(__nccwpck_require__.o(i,a)&&!__nccwpck_require__.o(r,a)){Object.defineProperty(r,a,{enumerable:true,get:i[a]})}}}})();(()=>{__nccwpck_require__.o=(r,i)=>Object.prototype.hasOwnProperty.call(r,i)})();(()=>{__nccwpck_require__.r=r=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(r,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var r=__nccwpck_require__(44079);var i=__nccwpck_require__.n(r);var a=__nccwpck_require__(92481);var s=__nccwpck_require__.n(a);var l=__nccwpck_require__(38453);var c=__nccwpck_require__.n(l);var p=__nccwpck_require__(3448);var d=__nccwpck_require__.n(p);var u=undefined&&undefined.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,l){function fulfilled(r){try{step(s.next(r))}catch(r){l(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){l(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};const A={darwin:{updater:{bundle:"macos",bundleExt:"app",archiveExt:"tar.gz"},standalone:[{ext:"dmg",bundle:"dmg"}]},windows:{updater:{bundle:"msi",bundleExt:"msi",archiveExt:"zip"},standalone:[{ext:"msi",bundle:"msi"}]},linux:{updater:{bundle:"appimage",bundleExt:"AppImage",archiveExt:"tar.gz"},standalone:[{ext:"deb",bundle:"deb"},{ext:"AppImage",bundle:"appimage"}]}};const h=a.getInput("os");const g=a.getInput("arch");const y=a.getInput("target");const E=a.getInput("profile");const b=`target/${y}/${E}/bundle`;const C=".artifacts";const v=`Spacedrive-${h}-${g}`;const B=`Spacedrive-Updater-${h}-${g}`;function globFiles(r){return u(this,void 0,void 0,(function*(){const i=yield l.create(r);return yield i.glob()}))}function uploadUpdater({bundle:r,bundleExt:a,archiveExt:s}){return u(this,void 0,void 0,(function*(){const l=`${a}.${s}`;const c=yield globFiles(`${b}/${r}/*.${l}*`);const d=c.find((r=>r.endsWith(l)));if(!d)return console.error(`Updater path not found. Files: ${c}`);const u=`${C}/${B}.${s}`;yield p.cp(d,u);yield p.cp(`${d}.sig`,`${u}.sig`);yield i().uploadArtifact(B,[u,`${u}.sig`],C)}))}function uploadStandalone({bundle:r,ext:a}){return u(this,void 0,void 0,(function*(){const s=yield globFiles(`${b}/${r}/*.${a}*`);const l=s.find((r=>r.endsWith(a)));if(!l)return console.error(`Standalone path not found. Files: ${s}`);const c=`${v}.${a}`;const d=`${C}/${c}`;yield p.cp(l,d,{recursive:true});yield i().uploadArtifact(c,[d],C)}))}function run(){return u(this,void 0,void 0,(function*(){yield p.mkdirP(C);const{updater:r,standalone:i}=A[h];yield uploadUpdater(r);for(const r of i){yield uploadStandalone(r)}}))}run()})();module.exports=__webpack_exports__})(); \ No newline at end of file +var a=s(73837).inherits;var l=s(91374).ZipArchiveOutputStream;var c=s(91374).ZipArchiveEntry;var d=s(78443);var p=r.exports=function(r){if(!(this instanceof p)){return new p(r)}r=this.options=r||{};r.zlib=r.zlib||{};l.call(this,r);if(typeof r.level==="number"&&r.level>=0){r.zlib.level=r.level;delete r.level}if(!r.forceZip64&&typeof r.zlib.level==="number"&&r.zlib.level===0){r.store=true}r.namePrependSlash=r.namePrependSlash||false;if(r.comment&&r.comment.length>0){this.setComment(r.comment)}};a(p,l);p.prototype._normalizeFileData=function(r){r=d.defaults(r,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var i=r.type==="directory";var s=r.type==="symlink";if(r.name){r.name=d.sanitizePath(r.name);if(!s&&r.name.slice(-1)==="/"){i=true;r.type="directory"}else if(i){r.name+="/"}}if(i||s){r.store=true}r.date=d.dateify(r.date);return r};p.prototype.entry=function(r,i,s){if(typeof s!=="function"){s=this._emitErrorCallback.bind(this)}i=this._normalizeFileData(i);if(i.type!=="file"&&i.type!=="directory"&&i.type!=="symlink"){s(new Error(i.type+" entries not currently supported"));return}if(typeof i.name!=="string"||i.name.length===0){s(new Error("entry name must be a non-empty string value"));return}if(i.type==="symlink"&&typeof i.linkname!=="string"){s(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var a=new c(i.name);a.setTime(i.date,this.options.forceLocalTime);if(i.namePrependSlash){a.setName(i.name,true)}if(i.store){a.setMethod(0)}if(i.comment.length>0){a.setComment(i.comment)}if(i.type==="symlink"&&typeof i.mode!=="number"){i.mode=40960}if(typeof i.mode==="number"){if(i.type==="symlink"){i.mode|=40960}a.setUnixMode(i.mode)}if(i.type==="symlink"&&typeof i.linkname==="string"){r=Buffer.from(i.linkname)}return l.prototype.entry.call(this,a,r,s)};p.prototype.finalize=function(){this.finish()}},88721:module=>{module.exports=eval("require")("encoding")},39491:r=>{"use strict";r.exports=require("assert")},50852:r=>{"use strict";r.exports=require("async_hooks")},14300:r=>{"use strict";r.exports=require("buffer")},96206:r=>{"use strict";r.exports=require("console")},22057:r=>{"use strict";r.exports=require("constants")},6113:r=>{"use strict";r.exports=require("crypto")},67643:r=>{"use strict";r.exports=require("diagnostics_channel")},82361:r=>{"use strict";r.exports=require("events")},57147:r=>{"use strict";r.exports=require("fs")},73292:r=>{"use strict";r.exports=require("fs/promises")},13685:r=>{"use strict";r.exports=require("http")},85158:r=>{"use strict";r.exports=require("http2")},95687:r=>{"use strict";r.exports=require("https")},41808:r=>{"use strict";r.exports=require("net")},15673:r=>{"use strict";r.exports=require("node:events")},70612:r=>{"use strict";r.exports=require("node:os")},97742:r=>{"use strict";r.exports=require("node:process")},84492:r=>{"use strict";r.exports=require("node:stream")},47261:r=>{"use strict";r.exports=require("node:util")},22037:r=>{"use strict";r.exports=require("os")},71017:r=>{"use strict";r.exports=require("path")},4074:r=>{"use strict";r.exports=require("perf_hooks")},85477:r=>{"use strict";r.exports=require("punycode")},63477:r=>{"use strict";r.exports=require("querystring")},12781:r=>{"use strict";r.exports=require("stream")},35356:r=>{"use strict";r.exports=require("stream/web")},71576:r=>{"use strict";r.exports=require("string_decoder")},39512:r=>{"use strict";r.exports=require("timers")},24404:r=>{"use strict";r.exports=require("tls")},57310:r=>{"use strict";r.exports=require("url")},73837:r=>{"use strict";r.exports=require("util")},29830:r=>{"use strict";r.exports=require("util/types")},71267:r=>{"use strict";r.exports=require("worker_threads")},59796:r=>{"use strict";r.exports=require("zlib")},73951:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.AzureKeyCredential=void 0;class AzureKeyCredential{_key;get key(){return this._key}constructor(r){if(!r){throw new Error("key must be a non-empty string")}this._key=r}update(r){this._key=r}}i.AzureKeyCredential=AzureKeyCredential},95585:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isNamedKeyCredential=i.AzureNamedKeyCredential=void 0;const a=s(76672);class AzureNamedKeyCredential{_key;_name;get key(){return this._key}get name(){return this._name}constructor(r,i){if(!r||!i){throw new TypeError("name and key must be non-empty strings")}this._name=r;this._key=i}update(r,i){if(!r||!i){throw new TypeError("newName and newKey must be non-empty strings")}this._name=r;this._key=i}}i.AzureNamedKeyCredential=AzureNamedKeyCredential;function isNamedKeyCredential(r){return(0,a.isObjectWithProperties)(r,["name","key"])&&typeof r.key==="string"&&typeof r.name==="string"}i.isNamedKeyCredential=isNamedKeyCredential},84020:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isSASCredential=i.AzureSASCredential=void 0;const a=s(76672);class AzureSASCredential{_signature;get signature(){return this._signature}constructor(r){if(!r){throw new Error("shared access signature must be a non-empty string")}this._signature=r}update(r){if(!r){throw new Error("shared access signature must be a non-empty string")}this._signature=r}}i.AzureSASCredential=AzureSASCredential;function isSASCredential(r){return(0,a.isObjectWithProperties)(r,["signature"])&&typeof r.signature==="string"}i.isSASCredential=isSASCredential},2729:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isTokenCredential=i.isSASCredential=i.AzureSASCredential=i.isNamedKeyCredential=i.AzureNamedKeyCredential=i.isKeyCredential=i.AzureKeyCredential=void 0;var a=s(73951);Object.defineProperty(i,"AzureKeyCredential",{enumerable:true,get:function(){return a.AzureKeyCredential}});var l=s(826);Object.defineProperty(i,"isKeyCredential",{enumerable:true,get:function(){return l.isKeyCredential}});var c=s(95585);Object.defineProperty(i,"AzureNamedKeyCredential",{enumerable:true,get:function(){return c.AzureNamedKeyCredential}});Object.defineProperty(i,"isNamedKeyCredential",{enumerable:true,get:function(){return c.isNamedKeyCredential}});var d=s(84020);Object.defineProperty(i,"AzureSASCredential",{enumerable:true,get:function(){return d.AzureSASCredential}});Object.defineProperty(i,"isSASCredential",{enumerable:true,get:function(){return d.isSASCredential}});var p=s(80407);Object.defineProperty(i,"isTokenCredential",{enumerable:true,get:function(){return p.isTokenCredential}})},826:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isKeyCredential=void 0;const a=s(76672);function isKeyCredential(r){return(0,a.isObjectWithProperties)(r,["key"])&&typeof r.key==="string"}i.isKeyCredential=isKeyCredential},80407:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isTokenCredential=void 0;function isTokenCredential(r){const i=r;return i&&typeof i.getToken==="function"&&(i.signRequest===undefined||i.getToken.length>0)}i.isTokenCredential=isTokenCredential},21208:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.pollHttpOperation=i.isOperationError=i.getResourceLocation=i.getOperationStatus=i.getOperationLocation=i.initHttpOperation=i.getStatusFromInitialResponse=i.getErrorFromResponse=i.parseRetryAfter=i.inferLroMode=void 0;const a=s(98772);const l=s(79463);function getOperationLocationPollingUrl(r){const{azureAsyncOperation:i,operationLocation:s}=r;return s??i}function getLocationHeader(r){return r.headers["location"]}function getOperationLocationHeader(r){return r.headers["operation-location"]}function getAzureAsyncOperationHeader(r){return r.headers["azure-asyncoperation"]}function findResourceLocation(r){const{location:i,requestMethod:s,requestPath:a,resourceLocationConfig:l}=r;switch(s){case"PUT":{return a}case"DELETE":{return undefined}case"PATCH":{return getDefault()??a}default:{return getDefault()}}function getDefault(){switch(l){case"azure-async-operation":{return undefined}case"original-uri":{return a}case"location":default:{return i}}}}function inferLroMode(r){const{rawResponse:i,requestMethod:s,requestPath:a,resourceLocationConfig:l}=r;const c=getOperationLocationHeader(i);const d=getAzureAsyncOperationHeader(i);const p=getOperationLocationPollingUrl({operationLocation:c,azureAsyncOperation:d});const u=getLocationHeader(i);const A=s?.toLocaleUpperCase();if(p!==undefined){return{mode:"OperationLocation",operationLocation:p,resourceLocation:findResourceLocation({requestMethod:A,location:u,requestPath:a,resourceLocationConfig:l})}}else if(u!==undefined){return{mode:"ResourceLocation",operationLocation:u}}else if(A==="PUT"&&a){return{mode:"Body",operationLocation:a}}else{return undefined}}i.inferLroMode=inferLroMode;function transformStatus(r){const{status:i,statusCode:s}=r;if(typeof i!=="string"&&i!==undefined){throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${i}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`)}switch(i?.toLocaleLowerCase()){case undefined:return toOperationStatus(s);case"succeeded":return"succeeded";case"failed":return"failed";case"running":case"accepted":case"started":case"canceling":case"cancelling":return"running";case"canceled":case"cancelled":return"canceled";default:{l.logger.verbose(`LRO: unrecognized operation status: ${i}`);return i}}}function getStatus(r){const{status:i}=r.body??{};return transformStatus({status:i,statusCode:r.statusCode})}function getProvisioningState(r){const{properties:i,provisioningState:s}=r.body??{};const a=i?.provisioningState??s;return transformStatus({status:a,statusCode:r.statusCode})}function toOperationStatus(r){if(r===202){return"running"}else if(r<300){return"succeeded"}else{return"failed"}}function parseRetryAfter({rawResponse:r}){const i=r.headers["retry-after"];if(i!==undefined){const r=parseInt(i);return isNaN(r)?calculatePollingIntervalFromDate(new Date(i)):r*1e3}return undefined}i.parseRetryAfter=parseRetryAfter;function getErrorFromResponse(r){const i=accessBodyProperty(r,"error");if(!i){l.logger.warning(`The long-running operation failed but there is no error property in the response's body`);return}if(!i.code||!i.message){l.logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);return}return i}i.getErrorFromResponse=getErrorFromResponse;function calculatePollingIntervalFromDate(r){const i=Math.floor((new Date).getTime());const s=r.getTime();if(i{const r=await c.sendInitialRequest();const i=inferLroMode({rawResponse:r.rawResponse,requestPath:c.requestPath,requestMethod:c.requestMethod,resourceLocationConfig:s});return{response:r,operationLocation:i?.operationLocation,resourceLocation:i?.resourceLocation,...i?.mode?{metadata:{mode:i.mode}}:{}}},stateProxy:i,processResult:l?({flatResponse:r},i)=>l(r,i):({flatResponse:r})=>r,getOperationStatus:getStatusFromInitialResponse,setErrorAsResult:d})}i.initHttpOperation=initHttpOperation;function getOperationLocation({rawResponse:r},i){const s=i.config.metadata?.["mode"];switch(s){case"OperationLocation":{return getOperationLocationPollingUrl({operationLocation:getOperationLocationHeader(r),azureAsyncOperation:getAzureAsyncOperationHeader(r)})}case"ResourceLocation":{return getLocationHeader(r)}case"Body":default:{return undefined}}}i.getOperationLocation=getOperationLocation;function getOperationStatus({rawResponse:r},i){const s=i.config.metadata?.["mode"];switch(s){case"OperationLocation":{return getStatus(r)}case"ResourceLocation":{return toOperationStatus(r.statusCode)}case"Body":{return getProvisioningState(r)}default:throw new Error(`Internal error: Unexpected operation mode: ${s}`)}}i.getOperationStatus=getOperationStatus;function accessBodyProperty({flatResponse:r,rawResponse:i},s){return r?.[s]??i.body?.[s]}function getResourceLocation(r,i){const s=accessBodyProperty(r,"resourceLocation");if(s&&typeof s==="string"){i.config.resourceLocation=s}return i.config.resourceLocation}i.getResourceLocation=getResourceLocation;function isOperationError(r){return r.name==="RestError"}i.isOperationError=isOperationError;async function pollHttpOperation(r){const{lro:i,stateProxy:s,options:l,processResult:c,updateState:d,setDelay:p,state:u,setErrorAsResult:A}=r;return(0,a.pollOperation)({state:u,stateProxy:s,setDelay:p,processResult:c?({flatResponse:r},i)=>c(r,i):({flatResponse:r})=>r,getError:getErrorFromResponse,updateState:d,getPollingInterval:parseRetryAfter,getOperationLocation:getOperationLocation,getOperationStatus:getOperationStatus,isOperationError:isOperationError,getResourceLocation:getResourceLocation,options:l,poll:async(r,s)=>i.sendPollRequest(r,s),setErrorAsResult:A})}i.pollHttpOperation=pollHttpOperation},72353:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createHttpPoller=void 0;const a=s(21208);const l=s(91454);async function createHttpPoller(r,i){const{resourceLocationConfig:s,intervalInMs:c,processResult:d,restoreFrom:p,updateState:u,withOperationLocation:A,resolveOnUnsuccessful:h=false}=i||{};return(0,l.buildCreatePoller)({getStatusFromInitialResponse:a.getStatusFromInitialResponse,getStatusFromPollResponse:a.getOperationStatus,isOperationError:a.isOperationError,getOperationLocation:a.getOperationLocation,getResourceLocation:a.getResourceLocation,getPollingInterval:a.parseRetryAfter,getError:a.getErrorFromResponse,resolveOnUnsuccessful:h})({init:async()=>{const i=await r.sendInitialRequest();const l=(0,a.inferLroMode)({rawResponse:i.rawResponse,requestPath:r.requestPath,requestMethod:r.requestMethod,resourceLocationConfig:s});return{response:i,operationLocation:l?.operationLocation,resourceLocation:l?.resourceLocation,...l?.mode?{metadata:{mode:l.mode}}:{}}},poll:r.sendPollRequest},{intervalInMs:c,withOperationLocation:A,restoreFrom:p,updateState:u,processResult:d?({flatResponse:r},i)=>d(r,i):({flatResponse:r})=>r})}i.createHttpPoller=createHttpPoller},40823:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createHttpPoller=void 0;const a=s(56728);var l=s(72353);Object.defineProperty(i,"createHttpPoller",{enumerable:true,get:function(){return l.createHttpPoller}});a.__exportStar(s(12579),i);a.__exportStar(s(57094),i);a.__exportStar(s(54691),i)},12579:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.LroEngine=void 0;var a=s(46209);Object.defineProperty(i,"LroEngine",{enumerable:true,get:function(){return a.LroEngine}})},46209:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.LroEngine=void 0;const a=s(8984);const l=s(39574);const c=s(57094);const d=s(98772);class LroEngine extends c.Poller{config;constructor(r,i){const{intervalInMs:s=l.POLL_INTERVAL_IN_MS,resumeFrom:c,resolveOnUnsuccessful:p=false,isDone:u,lroResourceLocationConfig:A,processResult:h,updateState:g}=i||{};const y=c?(0,d.deserializeState)(c):{};const b=new a.GenericPollOperation(y,r,!p,A,h,g,u);super(b);this.resolveOnUnsuccessful=p;this.config={intervalInMs:s};b.setPollerConfig(this.config)}delay(){return new Promise((r=>setTimeout((()=>r()),this.config.intervalInMs)))}}i.LroEngine=LroEngine},8984:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.GenericPollOperation=void 0;const a=s(21208);const l=s(79463);const createStateProxy=()=>({initState:r=>({config:r,isStarted:true}),setCanceled:r=>r.isCancelled=true,setError:(r,i)=>r.error=i,setResult:(r,i)=>r.result=i,setRunning:r=>r.isStarted=true,setSucceeded:r=>r.isCompleted=true,setFailed:()=>{},getError:r=>r.error,getResult:r=>r.result,isCanceled:r=>!!r.isCancelled,isFailed:r=>!!r.error,isRunning:r=>!!r.isStarted,isSucceeded:r=>Boolean(r.isCompleted&&!r.isCancelled&&!r.error)});class GenericPollOperation{state;lro;setErrorAsResult;lroResourceLocationConfig;processResult;updateState;isDone;pollerConfig;constructor(r,i,s,a,l,c,d){this.state=r;this.lro=i;this.setErrorAsResult=s;this.lroResourceLocationConfig=a;this.processResult=l;this.updateState=c;this.isDone=d}setPollerConfig(r){this.pollerConfig=r}async update(r){const i=createStateProxy();if(!this.state.isStarted){this.state={...this.state,...await(0,a.initHttpOperation)({lro:this.lro,stateProxy:i,resourceLocationConfig:this.lroResourceLocationConfig,processResult:this.processResult,setErrorAsResult:this.setErrorAsResult})}}const s=this.updateState;const l=this.isDone;if(!this.state.isCompleted&&this.state.error===undefined){await(0,a.pollHttpOperation)({lro:this.lro,state:this.state,stateProxy:i,processResult:this.processResult,updateState:s?(r,{rawResponse:i})=>s(r,i):undefined,isDone:l?({flatResponse:r},i)=>l(r,i):undefined,options:r,setDelay:r=>{this.pollerConfig.intervalInMs=r},setErrorAsResult:this.setErrorAsResult})}r?.fireProgress?.(this.state);return this}async cancel(){l.logger.error("`cancelOperation` is deprecated because it wasn't implemented");return this}toString(){return JSON.stringify({state:this.state})}}i.GenericPollOperation=GenericPollOperation},54691:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true})},57094:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Poller=i.PollerCancelledError=i.PollerStoppedError=void 0;class PollerStoppedError extends Error{constructor(r){super(r);this.name="PollerStoppedError";Object.setPrototypeOf(this,PollerStoppedError.prototype)}}i.PollerStoppedError=PollerStoppedError;class PollerCancelledError extends Error{constructor(r){super(r);this.name="PollerCancelledError";Object.setPrototypeOf(this,PollerCancelledError.prototype)}}i.PollerCancelledError=PollerCancelledError;class Poller{resolveOnUnsuccessful=false;stopped=true;resolve;reject;pollOncePromise;cancelPromise;promise;pollProgressCallbacks=[];operation;constructor(r){this.operation=r;this.promise=new Promise(((r,i)=>{this.resolve=r;this.reject=i}));this.promise.catch((()=>{}))}async startPolling(r={}){if(this.stopped){this.stopped=false}while(!this.isStopped()&&!this.isDone()){await this.poll(r);await this.delay()}}async pollOnce(r={}){if(!this.isDone()){this.operation=await this.operation.update({abortSignal:r.abortSignal,fireProgress:this.fireProgress.bind(this)})}this.processUpdatedState()}fireProgress(r){for(const i of this.pollProgressCallbacks){i(r)}}async cancelOnce(r={}){this.operation=await this.operation.cancel(r)}poll(r={}){if(!this.pollOncePromise){this.pollOncePromise=this.pollOnce(r);const clearPollOncePromise=()=>{this.pollOncePromise=undefined};this.pollOncePromise.then(clearPollOncePromise,clearPollOncePromise).catch(this.reject)}return this.pollOncePromise}processUpdatedState(){if(this.operation.state.error){this.stopped=true;if(!this.resolveOnUnsuccessful){this.reject(this.operation.state.error);throw this.operation.state.error}}if(this.operation.state.isCancelled){this.stopped=true;if(!this.resolveOnUnsuccessful){const r=new PollerCancelledError("Operation was canceled");this.reject(r);throw r}}if(this.isDone()&&this.resolve){this.resolve(this.getResult())}}async pollUntilDone(r={}){if(this.stopped){this.startPolling(r).catch(this.reject)}this.processUpdatedState();return this.promise}onProgress(r){this.pollProgressCallbacks.push(r);return()=>{this.pollProgressCallbacks=this.pollProgressCallbacks.filter((i=>i!==r))}}isDone(){const r=this.operation.state;return Boolean(r.isCompleted||r.isCancelled||r.error)}stopPolling(){if(!this.stopped){this.stopped=true;if(this.reject){this.reject(new PollerStoppedError("This poller is already stopped"))}}}isStopped(){return this.stopped}cancelOperation(r={}){if(!this.cancelPromise){this.cancelPromise=this.cancelOnce(r)}else if(r.abortSignal){throw new Error("A cancel request is currently pending")}return this.cancelPromise}getOperationState(){return this.operation.state}getResult(){const r=this.operation.state;return r.result}toString(){return this.operation.toString()}}i.Poller=Poller},79463:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.logger=void 0;const a=s(91878);i.logger=(0,a.createClientLogger)("core-lro")},39574:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.terminalStates=i.POLL_INTERVAL_IN_MS=void 0;i.POLL_INTERVAL_IN_MS=2e3;i.terminalStates=["succeeded","canceled","failed"]},98772:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.pollOperation=i.initOperation=i.deserializeState=void 0;const a=s(79463);const l=s(39574);function deserializeState(r){try{return JSON.parse(r).state}catch(i){throw new Error(`Unable to deserialize input state: ${r}`)}}i.deserializeState=deserializeState;function setStateError(r){const{state:i,stateProxy:s,isOperationError:a}=r;return r=>{if(a(r)){s.setError(i,r);s.setFailed(i)}throw r}}function appendReadableErrorMessage(r,i){let s=r;if(s.slice(-1)!=="."){s=s+"."}return s+" "+i}function simplifyError(r){let i=r.message;let s=r.code;let a=r;while(a.innererror){a=a.innererror;s=a.code;i=appendReadableErrorMessage(i,a.message)}return{code:s,message:i}}function processOperationStatus(r){const{state:i,stateProxy:s,status:l,isDone:c,processResult:d,getError:p,response:u,setErrorAsResult:A}=r;switch(l){case"succeeded":{s.setSucceeded(i);break}case"failed":{const r=p?.(u);let l="";if(r){const{code:i,message:s}=simplifyError(r);l=`. ${i}. ${s}`}const c=`The long-running operation has failed${l}`;s.setError(i,new Error(c));s.setFailed(i);a.logger.warning(c);break}case"canceled":{s.setCanceled(i);break}}if(c?.(u,i)||c===undefined&&["succeeded","canceled"].concat(A?[]:["failed"]).includes(l)){s.setResult(i,buildResult({response:u,state:i,processResult:d}))}}function buildResult(r){const{processResult:i,response:s,state:a}=r;return i?i(s,a):s}async function initOperation(r){const{init:i,stateProxy:s,processResult:l,getOperationStatus:c,withOperationLocation:d,setErrorAsResult:p}=r;const{operationLocation:u,resourceLocation:A,metadata:h,response:g}=await i();if(u)d?.(u,false);const y={metadata:h,operationLocation:u,resourceLocation:A};a.logger.verbose(`LRO: Operation description:`,y);const b=s.initState(y);const w=c({response:g,state:b,operationLocation:u});processOperationStatus({state:b,status:w,stateProxy:s,response:g,setErrorAsResult:p,processResult:l});return b}i.initOperation=initOperation;async function pollOperationHelper(r){const{poll:i,state:s,stateProxy:c,operationLocation:d,getOperationStatus:p,getResourceLocation:u,isOperationError:A,options:h}=r;const g=await i(d,h).catch(setStateError({state:s,stateProxy:c,isOperationError:A}));const y=p(g,s);a.logger.verbose(`LRO: Status:\n\tPolling from: ${s.config.operationLocation}\n\tOperation status: ${y}\n\tPolling status: ${l.terminalStates.includes(y)?"Stopped":"Running"}`);if(y==="succeeded"){const r=u(g,s);if(r!==undefined){return{response:await i(r).catch(setStateError({state:s,stateProxy:c,isOperationError:A})),status:y}}}return{response:g,status:y}}async function pollOperation(r){const{poll:i,state:s,stateProxy:a,options:c,getOperationStatus:d,getResourceLocation:p,getOperationLocation:u,isOperationError:A,withOperationLocation:h,getPollingInterval:g,processResult:y,getError:b,updateState:w,setDelay:C,isDone:v,setErrorAsResult:I}=r;const{operationLocation:B}=s.config;if(B!==undefined){const{response:r,status:S}=await pollOperationHelper({poll:i,getOperationStatus:d,state:s,stateProxy:a,operationLocation:B,getResourceLocation:p,isOperationError:A,options:c});processOperationStatus({status:S,response:r,state:s,stateProxy:a,isDone:v,processResult:y,getError:b,setErrorAsResult:I});if(!l.terminalStates.includes(S)){const i=g?.(r);if(i)C(i);const a=u?.(r,s);if(a!==undefined){const r=B!==a;s.config.operationLocation=a;h?.(a,r)}else h?.(B,false)}w?.(s,r)}}i.pollOperation=pollOperation},91454:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.buildCreatePoller=void 0;const a=s(98772);const l=s(39574);const c=s(76672);const createStateProxy=()=>({initState:r=>({status:"running",config:r}),setCanceled:r=>r.status="canceled",setError:(r,i)=>r.error=i,setResult:(r,i)=>r.result=i,setRunning:r=>r.status="running",setSucceeded:r=>r.status="succeeded",setFailed:r=>r.status="failed",getError:r=>r.error,getResult:r=>r.result,isCanceled:r=>r.status==="canceled",isFailed:r=>r.status==="failed",isRunning:r=>r.status==="running",isSucceeded:r=>r.status==="succeeded"});function buildCreatePoller(r){const{getOperationLocation:i,getStatusFromInitialResponse:s,getStatusFromPollResponse:d,isOperationError:p,getResourceLocation:u,getPollingInterval:A,getError:h,resolveOnUnsuccessful:g}=r;return async({init:r,poll:y},b)=>{const{processResult:w,updateState:C,withOperationLocation:v,intervalInMs:I=l.POLL_INTERVAL_IN_MS,restoreFrom:B}=b||{};const S=createStateProxy();const x=v?(()=>{let r=false;return(i,s)=>{if(s)v(i);else if(!r)v(i);r=true}})():undefined;const R=B?(0,a.deserializeState)(B):await(0,a.initOperation)({init:r,stateProxy:S,processResult:w,getOperationStatus:s,withOperationLocation:x,setErrorAsResult:!g});let Q;const _=new AbortController;const N=new Map;const handleProgressEvents=async()=>N.forEach((r=>r(R)));const T="Operation was canceled";let k=I;const D={getOperationState:()=>R,getResult:()=>R.result,isDone:()=>["succeeded","failed","canceled"].includes(R.status),isStopped:()=>Q===undefined,stopPolling:()=>{_.abort()},toString:()=>JSON.stringify({state:R}),onProgress:r=>{const i=Symbol();N.set(i,r);return()=>N.delete(i)},pollUntilDone:r=>Q??=(async()=>{const{abortSignal:i}=r||{};function abortListener(){_.abort()}const s=_.signal;if(i?.aborted){_.abort()}else if(!s.aborted){i?.addEventListener("abort",abortListener,{once:true})}try{if(!D.isDone()){await D.poll({abortSignal:s});while(!D.isDone()){await(0,c.delay)(k,{abortSignal:s});await D.poll({abortSignal:s})}}}finally{i?.removeEventListener("abort",abortListener)}if(g){return D.getResult()}else{switch(R.status){case"succeeded":return D.getResult();case"canceled":throw new Error(T);case"failed":throw R.error;case"notStarted":case"running":throw new Error(`Polling completed without succeeding or failing`)}}})().finally((()=>{Q=undefined})),async poll(r){if(g){if(D.isDone())return}else{switch(R.status){case"succeeded":return;case"canceled":throw new Error(T);case"failed":throw R.error}}await(0,a.pollOperation)({poll:y,state:R,stateProxy:S,getOperationLocation:i,isOperationError:p,withOperationLocation:x,getPollingInterval:A,getOperationStatus:d,getResourceLocation:u,processResult:w,getError:h,updateState:C,options:r,setDelay:r=>{k=r},setErrorAsResult:!g});await handleProgressEvents();if(!g){switch(R.status){case"canceled":throw new Error(T);case"failed":throw R.error}}}};return D}}i.buildCreatePoller=buildCreatePoller},61957:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getPagedAsyncIterator=void 0;function getPagedAsyncIterator(r){const i=getItemAsyncIterator(r);return{next(){return i.next()},[Symbol.asyncIterator](){return this},byPage:r?.byPage??(i=>{const{continuationToken:s,maxPageSize:a}=i??{};return getPageAsyncIterator(r,{pageLink:s,maxPageSize:a})})}}i.getPagedAsyncIterator=getPagedAsyncIterator;async function*getItemAsyncIterator(r){const i=getPageAsyncIterator(r);const s=await i.next();if(!Array.isArray(s.value)){const{toElements:a}=r;if(a){yield*a(s.value);for await(const r of i){yield*a(r)}}else{yield s.value;yield*i}}else{yield*s.value;for await(const r of i){yield*r}}}async function*getPageAsyncIterator(r,i={}){const{pageLink:s,maxPageSize:a}=i;let l=await r.getPage(s??r.firstPageLink,a);if(!l){return}yield l.page;while(l.nextPageLink){l=await r.getPage(l.nextPageLink,a);if(!l){return}yield l.page}}},73590:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=s(56728);a.__exportStar(s(58914),i);a.__exportStar(s(61957),i)},58914:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true})},87477:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.cancelablePromiseRace=void 0;async function cancelablePromiseRace(r,i){const s=new AbortController;function abortHandler(){s.abort()}i?.abortSignal?.addEventListener("abort",abortHandler);try{return await Promise.race(r.map((r=>r({abortSignal:s.signal}))))}finally{s.abort();i?.abortSignal?.removeEventListener("abort",abortHandler)}}i.cancelablePromiseRace=cancelablePromiseRace},28023:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.stringToUint8Array=i.uint8ArrayToString=void 0;function uint8ArrayToString(r,i){return Buffer.from(r).toString(i)}i.uint8ArrayToString=uint8ArrayToString;function stringToUint8Array(r,i){return Buffer.from(r,i)}i.stringToUint8Array=stringToUint8Array},23344:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isReactNative=i.isNode=i.isBun=i.isDeno=i.isWebWorker=i.isBrowser=void 0;i.isBrowser=typeof window!=="undefined"&&typeof window.document!=="undefined";i.isWebWorker=typeof self==="object"&&typeof self?.importScripts==="function"&&(self.constructor?.name==="DedicatedWorkerGlobalScope"||self.constructor?.name==="ServiceWorkerGlobalScope"||self.constructor?.name==="SharedWorkerGlobalScope");i.isDeno=typeof Deno!=="undefined"&&typeof Deno.version!=="undefined"&&typeof Deno.version.deno!=="undefined";i.isBun=typeof Bun!=="undefined"&&typeof Bun.version!=="undefined";i.isNode=typeof globalThis.process!=="undefined"&&Boolean(globalThis.process.version)&&Boolean(globalThis.process.versions?.node)&&!i.isDeno&&!i.isBun;i.isReactNative=typeof navigator!=="undefined"&&navigator?.product==="ReactNative"},35395:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createAbortablePromise=void 0;const a=s(70642);function createAbortablePromise(r,i){const{cleanupBeforeAbort:s,abortSignal:l,abortErrorMsg:c}=i??{};return new Promise(((i,d)=>{function rejectOnAbort(){d(new a.AbortError(c??"The operation was aborted."))}function removeListeners(){l?.removeEventListener("abort",onAbort)}function onAbort(){s?.();removeListeners();rejectOnAbort()}if(l?.aborted){return rejectOnAbort()}try{r((r=>{removeListeners();i(r)}),(r=>{removeListeners();d(r)}))}catch(r){d(r)}l?.addEventListener("abort",onAbort)}))}i.createAbortablePromise=createAbortablePromise},45567:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.delay=void 0;const a=s(35395);const l="The delay was aborted.";function delay(r,i){let s;const{abortSignal:c,abortErrorMsg:d}=i??{};return(0,a.createAbortablePromise)((i=>{s=setTimeout(i,r)}),{cleanupBeforeAbort:()=>clearTimeout(s),abortSignal:c,abortErrorMsg:d??l})}i.delay=delay},56033:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getErrorMessage=i.isError=void 0;const a=s(2047);function isError(r){if((0,a.isObject)(r)){const i=typeof r.name==="string";const s=typeof r.message==="string";return i&&s}return false}i.isError=isError;function getErrorMessage(r){if(isError(r)){return r.message}else{let i;try{if(typeof r==="object"&&r){i=JSON.stringify(r)}else{i=String(r)}}catch(r){i="[unable to stringify input]"}return`Unknown error ${i}`}}i.getErrorMessage=getErrorMessage},76672:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.stringToUint8Array=i.uint8ArrayToString=i.isWebWorker=i.isReactNative=i.isDeno=i.isNode=i.isBun=i.isBrowser=i.randomUUID=i.objectHasProperty=i.isObjectWithProperties=i.isDefined=i.computeSha256Hmac=i.computeSha256Hash=i.getErrorMessage=i.isError=i.isObject=i.getRandomIntegerInclusive=i.createAbortablePromise=i.cancelablePromiseRace=i.delay=void 0;var a=s(45567);Object.defineProperty(i,"delay",{enumerable:true,get:function(){return a.delay}});var l=s(87477);Object.defineProperty(i,"cancelablePromiseRace",{enumerable:true,get:function(){return l.cancelablePromiseRace}});var c=s(35395);Object.defineProperty(i,"createAbortablePromise",{enumerable:true,get:function(){return c.createAbortablePromise}});var d=s(18386);Object.defineProperty(i,"getRandomIntegerInclusive",{enumerable:true,get:function(){return d.getRandomIntegerInclusive}});var p=s(2047);Object.defineProperty(i,"isObject",{enumerable:true,get:function(){return p.isObject}});var u=s(56033);Object.defineProperty(i,"isError",{enumerable:true,get:function(){return u.isError}});Object.defineProperty(i,"getErrorMessage",{enumerable:true,get:function(){return u.getErrorMessage}});var A=s(79427);Object.defineProperty(i,"computeSha256Hash",{enumerable:true,get:function(){return A.computeSha256Hash}});Object.defineProperty(i,"computeSha256Hmac",{enumerable:true,get:function(){return A.computeSha256Hmac}});var h=s(17001);Object.defineProperty(i,"isDefined",{enumerable:true,get:function(){return h.isDefined}});Object.defineProperty(i,"isObjectWithProperties",{enumerable:true,get:function(){return h.isObjectWithProperties}});Object.defineProperty(i,"objectHasProperty",{enumerable:true,get:function(){return h.objectHasProperty}});var g=s(92283);Object.defineProperty(i,"randomUUID",{enumerable:true,get:function(){return g.randomUUID}});var y=s(23344);Object.defineProperty(i,"isBrowser",{enumerable:true,get:function(){return y.isBrowser}});Object.defineProperty(i,"isBun",{enumerable:true,get:function(){return y.isBun}});Object.defineProperty(i,"isNode",{enumerable:true,get:function(){return y.isNode}});Object.defineProperty(i,"isDeno",{enumerable:true,get:function(){return y.isDeno}});Object.defineProperty(i,"isReactNative",{enumerable:true,get:function(){return y.isReactNative}});Object.defineProperty(i,"isWebWorker",{enumerable:true,get:function(){return y.isWebWorker}});var b=s(28023);Object.defineProperty(i,"uint8ArrayToString",{enumerable:true,get:function(){return b.uint8ArrayToString}});Object.defineProperty(i,"stringToUint8Array",{enumerable:true,get:function(){return b.stringToUint8Array}})},2047:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.isObject=void 0;function isObject(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}i.isObject=isObject},18386:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.getRandomIntegerInclusive=void 0;function getRandomIntegerInclusive(r,i){r=Math.ceil(r);i=Math.floor(i);const s=Math.floor(Math.random()*(i-r+1));return s+r}i.getRandomIntegerInclusive=getRandomIntegerInclusive},79427:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.computeSha256Hash=i.computeSha256Hmac=void 0;const a=s(6113);async function computeSha256Hmac(r,i,s){const l=Buffer.from(r,"base64");return(0,a.createHmac)("sha256",l).update(i).digest(s)}i.computeSha256Hmac=computeSha256Hmac;async function computeSha256Hash(r,i){return(0,a.createHash)("sha256").update(r).digest(i)}i.computeSha256Hash=computeSha256Hash},17001:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.objectHasProperty=i.isObjectWithProperties=i.isDefined=void 0;function isDefined(r){return typeof r!=="undefined"&&r!==null}i.isDefined=isDefined;function isObjectWithProperties(r,i){if(!isDefined(r)||typeof r!=="object"){return false}for(const s of i){if(!objectHasProperty(r,s)){return false}}return true}i.isObjectWithProperties=isObjectWithProperties;function objectHasProperty(r,i){return isDefined(r)&&typeof r==="object"&&i in r}i.objectHasProperty=objectHasProperty},92283:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.randomUUID=void 0;const a=s(6113);const l=typeof globalThis?.crypto?.randomUUID==="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):a.randomUUID;function randomUUID(){return l()}i.randomUUID=randomUUID},64452:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.AbortError=void 0;class AbortError extends Error{constructor(r){super(r);this.name="AbortError"}}i.AbortError=AbortError},70642:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.AbortError=void 0;var a=s(64452);Object.defineProperty(i,"AbortError",{enumerable:true,get:function(){return a.AbortError}})},11515:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=s(93710);const l=typeof process!=="undefined"&&process.env&&process.env.DEBUG||undefined;let c;let d=[];let p=[];const u=[];if(l){enable(l)}const A=Object.assign((r=>createDebugger(r)),{enable:enable,enabled:enabled,disable:disable,log:a.log});function enable(r){c=r;d=[];p=[];const i=/\*/g;const s=r.split(",").map((r=>r.trim().replace(i,".*?")));for(const r of s){if(r.startsWith("-")){p.push(new RegExp(`^${r.substr(1)}$`))}else{d.push(new RegExp(`^${r}$`))}}for(const r of u){r.enabled=enabled(r.namespace)}}function enabled(r){if(r.endsWith("*")){return true}for(const i of p){if(i.test(r)){return false}}for(const i of d){if(i.test(r)){return true}}return false}function disable(){const r=c||"";enable("");return r}function createDebugger(r){const i=Object.assign(debug,{enabled:enabled(r),destroy:destroy,log:A.log,namespace:r,extend:extend});function debug(...s){if(!i.enabled){return}if(s.length>0){s[0]=`${r} ${s[0]}`}i.log(...s)}u.push(i);return i}function destroy(){const r=u.indexOf(this);if(r>=0){u.splice(r,1);return true}return false}function extend(r){const i=createDebugger(`${this.namespace}:${r}`);i.log=this.log;return i}i["default"]=A},91878:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createClientLogger=i.getLogLevel=i.setLogLevel=i.AzureLogger=void 0;const a=s(56728);const l=a.__importDefault(s(11515));const c=new Set;const d=typeof process!=="undefined"&&process.env&&process.env.AZURE_LOG_LEVEL||undefined;let p;i.AzureLogger=(0,l.default)("azure");i.AzureLogger.log=(...r)=>{l.default.log(...r)};const u=["verbose","info","warning","error"];if(d){if(isAzureLogLevel(d)){setLogLevel(d)}else{console.error(`AZURE_LOG_LEVEL set to unknown log level '${d}'; logging is not enabled. Acceptable values: ${u.join(", ")}.`)}}function setLogLevel(r){if(r&&!isAzureLogLevel(r)){throw new Error(`Unknown log level '${r}'. Acceptable values: ${u.join(",")}`)}p=r;const i=[];for(const r of c){if(shouldEnable(r)){i.push(r.namespace)}}l.default.enable(i.join(","))}i.setLogLevel=setLogLevel;function getLogLevel(){return p}i.getLogLevel=getLogLevel;const A={verbose:400,info:300,warning:200,error:100};function createClientLogger(r){const s=i.AzureLogger.extend(r);patchLogMethod(i.AzureLogger,s);return{error:createLogger(s,"error"),warning:createLogger(s,"warning"),info:createLogger(s,"info"),verbose:createLogger(s,"verbose")}}i.createClientLogger=createClientLogger;function patchLogMethod(r,i){i.log=(...i)=>{r.log(...i)}}function createLogger(r,i){const s=Object.assign(r.extend(i),{level:i});patchLogMethod(r,s);if(shouldEnable(s)){const r=l.default.disable();l.default.enable(r+","+s.namespace)}c.add(s);return s}function shouldEnable(r){return Boolean(p&&A[r.level]<=A[p])}function isAzureLogLevel(r){return u.includes(r)}},93710:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.log=void 0;const a=s(56728);const l=s(70612);const c=a.__importDefault(s(47261));const d=a.__importStar(s(97742));function log(r,...i){d.stderr.write(`${c.default.format(r,...i)}${l.EOL}`)}i.log=log},32966:(r,i,s)=>{"use strict";const a=s(84492).Writable;const l=s(47261).inherits;const c=s(19965);const d=s(70588);const p=s(48330);const u=45;const A=Buffer.from("-");const h=Buffer.from("\r\n");const EMPTY_FN=function(){};function Dicer(r){if(!(this instanceof Dicer)){return new Dicer(r)}a.call(this,r);if(!r||!r.headerFirst&&typeof r.boundary!=="string"){throw new TypeError("Boundary required")}if(typeof r.boundary==="string"){this.setBoundary(r.boundary)}else{this._bparser=undefined}this._headerFirst=r.headerFirst;this._dashes=0;this._parts=0;this._finished=false;this._realFinish=false;this._isPreamble=true;this._justMatched=false;this._firstWrite=true;this._inHeader=true;this._part=undefined;this._cb=undefined;this._ignoreData=false;this._partOpts={highWaterMark:r.partHwm};this._pause=false;const i=this;this._hparser=new p(r);this._hparser.on("header",(function(r){i._inHeader=false;i._part.emit("header",r)}))}l(Dicer,a);Dicer.prototype.emit=function(r){if(r==="finish"&&!this._realFinish){if(!this._finished){const r=this;process.nextTick((function(){r.emit("error",new Error("Unexpected end of multipart data"));if(r._part&&!r._ignoreData){const i=r._isPreamble?"Preamble":"Part";r._part.emit("error",new Error(i+" terminated early due to unexpected end of multipart data"));r._part.push(null);process.nextTick((function(){r._realFinish=true;r.emit("finish");r._realFinish=false}));return}r._realFinish=true;r.emit("finish");r._realFinish=false}))}}else{a.prototype.emit.apply(this,arguments)}};Dicer.prototype._write=function(r,i,s){if(!this._hparser&&!this._bparser){return s()}if(this._headerFirst&&this._isPreamble){if(!this._part){this._part=new d(this._partOpts);if(this.listenerCount("preamble")!==0){this.emit("preamble",this._part)}else{this._ignore()}}const i=this._hparser.push(r);if(!this._inHeader&&i!==undefined&&i{"use strict";const a=s(15673).EventEmitter;const l=s(47261).inherits;const c=s(95691);const d=s(19965);const p=Buffer.from("\r\n\r\n");const u=/\r\n/g;const A=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function HeaderParser(r){a.call(this);r=r||{};const i=this;this.nread=0;this.maxed=false;this.npairs=0;this.maxHeaderPairs=c(r,"maxHeaderPairs",2e3);this.maxHeaderSize=c(r,"maxHeaderSize",80*1024);this.buffer="";this.header={};this.finished=false;this.ss=new d(p);this.ss.on("info",(function(r,s,a,l){if(s&&!i.maxed){if(i.nread+l-a>=i.maxHeaderSize){l=i.maxHeaderSize-i.nread+a;i.nread=i.maxHeaderSize;i.maxed=true}else{i.nread+=l-a}i.buffer+=s.toString("binary",a,l)}if(r){i._finish()}}))}l(HeaderParser,a);HeaderParser.prototype.push=function(r){const i=this.ss.push(r);if(this.finished){return i}};HeaderParser.prototype.reset=function(){this.finished=false;this.buffer="";this.header={};this.ss.reset()};HeaderParser.prototype._finish=function(){if(this.buffer){this._parseHeader()}this.ss.matches=this.ss.maxMatches;const r=this.header;this.header={};this.buffer="";this.finished=true;this.nread=this.npairs=0;this.maxed=false;this.emit("header",r)};HeaderParser.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs){return}const r=this.buffer.split(u);const i=r.length;let s,a;for(var l=0;l{"use strict";const a=s(47261).inherits;const l=s(84492).Readable;function PartStream(r){l.call(this,r)}a(PartStream,l);PartStream.prototype._read=function(r){};r.exports=PartStream},19965:(r,i,s)=>{"use strict";const a=s(15673).EventEmitter;const l=s(47261).inherits;function SBMH(r){if(typeof r==="string"){r=Buffer.from(r)}if(!Buffer.isBuffer(r)){throw new TypeError("The needle has to be a String or a Buffer.")}const i=r.length;if(i===0){throw new Error("The needle cannot be an empty String/Buffer.")}if(i>256){throw new Error("The needle cannot have a length bigger than 256.")}this.maxMatches=Infinity;this.matches=0;this._occ=new Array(256).fill(i);this._lookbehind_size=0;this._needle=r;this._bufpos=0;this._lookbehind=Buffer.alloc(i);for(var s=0;s=0){this.emit("info",false,this._lookbehind,0,this._lookbehind_size);this._lookbehind_size=0}else{const s=this._lookbehind_size+c;if(s>0){this.emit("info",false,this._lookbehind,0,s)}this._lookbehind.copy(this._lookbehind,0,s,this._lookbehind_size-s);this._lookbehind_size-=s;r.copy(this._lookbehind,this._lookbehind_size);this._lookbehind_size+=i;this._bufpos=i;return i}}c+=(c>=0)*this._bufpos;if(r.indexOf(s,c)!==-1){c=r.indexOf(s,c);++this.matches;if(c>0){this.emit("info",true,r,this._bufpos,c)}else{this.emit("info",true)}return this._bufpos=c+a}else{c=i-a}while(c0){this.emit("info",false,r,this._bufpos,c{"use strict";const a=s(84492).Writable;const{inherits:l}=s(47261);const c=s(32966);const d=s(64367);const p=s(9760);const u=s(11161);function Busboy(r){if(!(this instanceof Busboy)){return new Busboy(r)}if(typeof r!=="object"){throw new TypeError("Busboy expected an options-Object.")}if(typeof r.headers!=="object"){throw new TypeError("Busboy expected an options-Object with headers-attribute.")}if(typeof r.headers["content-type"]!=="string"){throw new TypeError("Missing Content-Type-header.")}const{headers:i,...s}=r;this.opts={autoDestroy:false,...s};a.call(this,this.opts);this._done=false;this._parser=this.getParserByHeaders(i);this._finished=false}l(Busboy,a);Busboy.prototype.emit=function(r){if(r==="finish"){if(!this._done){this._parser?.end();return}else if(this._finished){return}this._finished=true}a.prototype.emit.apply(this,arguments)};Busboy.prototype.getParserByHeaders=function(r){const i=u(r["content-type"]);const s={defCharset:this.opts.defCharset,fileHwm:this.opts.fileHwm,headers:r,highWaterMark:this.opts.highWaterMark,isPartAFile:this.opts.isPartAFile,limits:this.opts.limits,parsedConType:i,preservePath:this.opts.preservePath};if(d.detect.test(i[0])){return new d(this,s)}if(p.detect.test(i[0])){return new p(this,s)}throw new Error("Unsupported Content-Type.")};Busboy.prototype._write=function(r,i,s){this._parser.write(r,s)};r.exports=Busboy;r.exports["default"]=Busboy;r.exports.Busboy=Busboy;r.exports.Dicer=c},64367:(r,i,s)=>{"use strict";const{Readable:a}=s(84492);const{inherits:l}=s(47261);const c=s(32966);const d=s(11161);const p=s(43828);const u=s(10669);const A=s(95691);const h=/^boundary$/i;const g=/^form-data$/i;const y=/^charset$/i;const b=/^filename$/i;const w=/^name$/i;Multipart.detect=/^multipart\/form-data/i;function Multipart(r,i){let s;let a;const l=this;let C;const v=i.limits;const I=i.isPartAFile||((r,i,s)=>i==="application/octet-stream"||s!==undefined);const B=i.parsedConType||[];const S=i.defCharset||"utf8";const x=i.preservePath;const R={highWaterMark:i.fileHwm};for(s=0,a=B.length;sk){l.parser.removeListener("part",onPart);l.parser.on("part",skipPart);r.hitPartsLimit=true;r.emit("partsLimit");return skipPart(i)}if(j){const r=j;r.emit("end");r.removeAllListeners("end")}i.on("header",(function(c){let A;let h;let C;let v;let B;let k;let D=0;if(c["content-type"]){C=d(c["content-type"][0]);if(C[0]){A=C[0].toLowerCase();for(s=0,a=C.length;s_){const a=_-D+r.length;if(a>0){s.push(r.slice(0,a))}s.truncated=true;s.bytesRead=_;i.removeAllListeners("data");s.emit("limit");return}else if(!s.push(r)){l._pause=true}s.bytesRead=D};H=function(){U=undefined;s.push(null)}}else{if(L===T){if(!r.hitFieldsLimit){r.hitFieldsLimit=true;r.emit("fieldsLimit")}return skipPart(i)}++L;++M;let s="";let a=false;j=i;P=function(r){if((D+=r.length)>Q){const l=Q-(D-r.length);s+=r.toString("binary",0,l);a=true;i.removeAllListeners("data")}else{s+=r.toString("binary")}};H=function(){j=undefined;if(s.length){s=p(s,"binary",v)}r.emit("field",h,s,false,a,B,A);--M;checkFinished()}}i._readableState.sync=false;i.on("data",P);i.on("end",H)})).on("error",(function(r){if(U){U.emit("error",r)}}))})).on("error",(function(i){r.emit("error",i)})).on("finish",(function(){H=true;checkFinished()}))}Multipart.prototype.write=function(r,i){const s=this.parser.write(r);if(s&&!this._pause){i()}else{this._needDrain=!s;this._cb=i}};Multipart.prototype.end=function(){const r=this;if(r.parser.writable){r.parser.end()}else if(!r._boy._done){process.nextTick((function(){r._boy._done=true;r._boy.emit("finish")}))}};function skipPart(r){r.resume()}function FileStream(r){a.call(this,r);this.bytesRead=0;this.truncated=false}l(FileStream,a);FileStream.prototype._read=function(r){};r.exports=Multipart},9760:(r,i,s)=>{"use strict";const a=s(15816);const l=s(43828);const c=s(95691);const d=/^charset$/i;UrlEncoded.detect=/^application\/x-www-form-urlencoded/i;function UrlEncoded(r,i){const s=i.limits;const l=i.parsedConType;this.boy=r;this.fieldSizeLimit=c(s,"fieldSize",1*1024*1024);this.fieldNameSizeLimit=c(s,"fieldNameSize",100);this.fieldsLimit=c(s,"fields",Infinity);let p;for(var u=0,A=l.length;ud){this._key+=this.decoder.write(r.toString("binary",d,s))}this._state="val";this._hitLimit=false;this._checkingBytes=true;this._val="";this._bytesVal=0;this._valTrunc=false;this.decoder.reset();d=s+1}else if(a!==undefined){++this._fields;let s;const c=this._keyTrunc;if(a>d){s=this._key+=this.decoder.write(r.toString("binary",d,a))}else{s=this._key}this._hitLimit=false;this._checkingBytes=true;this._key="";this._bytesKey=0;this._keyTrunc=false;this.decoder.reset();if(s.length){this.boy.emit("field",l(s,"binary",this.charset),"",c,false)}d=a+1;if(this._fields===this.fieldsLimit){return i()}}else if(this._hitLimit){if(c>d){this._key+=this.decoder.write(r.toString("binary",d,c))}d=c;if((this._bytesKey=this._key.length)===this.fieldNameSizeLimit){this._checkingBytes=false;this._keyTrunc=true}}else{if(dd){this._val+=this.decoder.write(r.toString("binary",d,a))}this.boy.emit("field",l(this._key,"binary",this.charset),l(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc);this._state="key";this._hitLimit=false;this._checkingBytes=true;this._key="";this._bytesKey=0;this._keyTrunc=false;this.decoder.reset();d=a+1;if(this._fields===this.fieldsLimit){return i()}}else if(this._hitLimit){if(c>d){this._val+=this.decoder.write(r.toString("binary",d,c))}d=c;if(this._val===""&&this.fieldSizeLimit===0||(this._bytesVal=this._val.length)===this.fieldSizeLimit){this._checkingBytes=false;this._valTrunc=true}}else{if(d0){this.boy.emit("field",l(this._key,"binary",this.charset),"",this._keyTrunc,false)}else if(this._state==="val"){this.boy.emit("field",l(this._key,"binary",this.charset),l(this._val,"binary",this.charset),this._keyTrunc,this._valTrunc)}this.boy._done=true;this.boy.emit("finish")};r.exports=UrlEncoded},15816:r=>{"use strict";const i=/\+/g;const s=[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,0,0,0,0,0,0,0,1,1,1,1,1,1,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,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];function Decoder(){this.buffer=undefined}Decoder.prototype.write=function(r){r=r.replace(i," ");let a="";let l=0;let c=0;const d=r.length;for(;lc){a+=r.substring(c,l);c=l}this.buffer="";++c}}if(c{"use strict";r.exports=function basename(r){if(typeof r!=="string"){return""}for(var i=r.length-1;i>=0;--i){switch(r.charCodeAt(i)){case 47:case 92:r=r.slice(i+1);return r===".."||r==="."?"":r}}return r===".."||r==="."?"":r}},43828:function(r){"use strict";const i=new TextDecoder("utf-8");const s=new Map([["utf-8",i],["utf8",i]]);function getDecoder(r){let i;while(true){switch(r){case"utf-8":case"utf8":return a.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return a.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return a.utf16le;case"base64":return a.base64;default:if(i===undefined){i=true;r=r.toLowerCase();continue}return a.other.bind(r)}}}const a={utf8:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}return r.utf8Slice(0,r.length)},latin1:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){return r}return r.latin1Slice(0,r.length)},utf16le:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}return r.ucs2Slice(0,r.length)},base64:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}return r.base64Slice(0,r.length)},other:(r,i)=>{if(r.length===0){return""}if(typeof r==="string"){r=Buffer.from(r,i)}if(s.has(this.toString())){try{return s.get(this).decode(r)}catch{}}return typeof r==="string"?r:r.toString()}};function decodeText(r,i,s){if(r){return getDecoder(s)(r,i)}return r}r.exports=decodeText},95691:r=>{"use strict";r.exports=function getLimit(r,i,s){if(!r||r[i]===undefined||r[i]===null){return s}if(typeof r[i]!=="number"||isNaN(r[i])){throw new TypeError("Limit "+i+" is not a valid number")}return r[i]}},11161:(r,i,s)=>{"use strict";const a=s(43828);const l=/%[a-fA-F0-9][a-fA-F0-9]/g;const c={"%00":"\0","%01":"","%02":"","%03":"","%04":"","%05":"","%06":"","%07":"","%08":"\b","%09":"\t","%0a":"\n","%0A":"\n","%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"","%1B":"","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"","%7F":"","%80":"€","%81":"","%82":"‚","%83":"ƒ","%84":"„","%85":"…","%86":"†","%87":"‡","%88":"ˆ","%89":"‰","%8a":"Š","%8A":"Š","%8b":"‹","%8B":"‹","%8c":"Œ","%8C":"Œ","%8d":"","%8D":"","%8e":"Ž","%8E":"Ž","%8f":"","%8F":"","%90":"","%91":"‘","%92":"’","%93":"“","%94":"”","%95":"•","%96":"–","%97":"—","%98":"˜","%99":"™","%9a":"š","%9A":"š","%9b":"›","%9B":"›","%9c":"œ","%9C":"œ","%9d":"","%9D":"","%9e":"ž","%9E":"ž","%9f":"Ÿ","%9F":"Ÿ","%a0":" ","%A0":" ","%a1":"¡","%A1":"¡","%a2":"¢","%A2":"¢","%a3":"£","%A3":"£","%a4":"¤","%A4":"¤","%a5":"¥","%A5":"¥","%a6":"¦","%A6":"¦","%a7":"§","%A7":"§","%a8":"¨","%A8":"¨","%a9":"©","%A9":"©","%aa":"ª","%Aa":"ª","%aA":"ª","%AA":"ª","%ab":"«","%Ab":"«","%aB":"«","%AB":"«","%ac":"¬","%Ac":"¬","%aC":"¬","%AC":"¬","%ad":"­","%Ad":"­","%aD":"­","%AD":"­","%ae":"®","%Ae":"®","%aE":"®","%AE":"®","%af":"¯","%Af":"¯","%aF":"¯","%AF":"¯","%b0":"°","%B0":"°","%b1":"±","%B1":"±","%b2":"²","%B2":"²","%b3":"³","%B3":"³","%b4":"´","%B4":"´","%b5":"µ","%B5":"µ","%b6":"¶","%B6":"¶","%b7":"·","%B7":"·","%b8":"¸","%B8":"¸","%b9":"¹","%B9":"¹","%ba":"º","%Ba":"º","%bA":"º","%BA":"º","%bb":"»","%Bb":"»","%bB":"»","%BB":"»","%bc":"¼","%Bc":"¼","%bC":"¼","%BC":"¼","%bd":"½","%Bd":"½","%bD":"½","%BD":"½","%be":"¾","%Be":"¾","%bE":"¾","%BE":"¾","%bf":"¿","%Bf":"¿","%bF":"¿","%BF":"¿","%c0":"À","%C0":"À","%c1":"Á","%C1":"Á","%c2":"Â","%C2":"Â","%c3":"Ã","%C3":"Ã","%c4":"Ä","%C4":"Ä","%c5":"Å","%C5":"Å","%c6":"Æ","%C6":"Æ","%c7":"Ç","%C7":"Ç","%c8":"È","%C8":"È","%c9":"É","%C9":"É","%ca":"Ê","%Ca":"Ê","%cA":"Ê","%CA":"Ê","%cb":"Ë","%Cb":"Ë","%cB":"Ë","%CB":"Ë","%cc":"Ì","%Cc":"Ì","%cC":"Ì","%CC":"Ì","%cd":"Í","%Cd":"Í","%cD":"Í","%CD":"Í","%ce":"Î","%Ce":"Î","%cE":"Î","%CE":"Î","%cf":"Ï","%Cf":"Ï","%cF":"Ï","%CF":"Ï","%d0":"Ð","%D0":"Ð","%d1":"Ñ","%D1":"Ñ","%d2":"Ò","%D2":"Ò","%d3":"Ó","%D3":"Ó","%d4":"Ô","%D4":"Ô","%d5":"Õ","%D5":"Õ","%d6":"Ö","%D6":"Ö","%d7":"×","%D7":"×","%d8":"Ø","%D8":"Ø","%d9":"Ù","%D9":"Ù","%da":"Ú","%Da":"Ú","%dA":"Ú","%DA":"Ú","%db":"Û","%Db":"Û","%dB":"Û","%DB":"Û","%dc":"Ü","%Dc":"Ü","%dC":"Ü","%DC":"Ü","%dd":"Ý","%Dd":"Ý","%dD":"Ý","%DD":"Ý","%de":"Þ","%De":"Þ","%dE":"Þ","%DE":"Þ","%df":"ß","%Df":"ß","%dF":"ß","%DF":"ß","%e0":"à","%E0":"à","%e1":"á","%E1":"á","%e2":"â","%E2":"â","%e3":"ã","%E3":"ã","%e4":"ä","%E4":"ä","%e5":"å","%E5":"å","%e6":"æ","%E6":"æ","%e7":"ç","%E7":"ç","%e8":"è","%E8":"è","%e9":"é","%E9":"é","%ea":"ê","%Ea":"ê","%eA":"ê","%EA":"ê","%eb":"ë","%Eb":"ë","%eB":"ë","%EB":"ë","%ec":"ì","%Ec":"ì","%eC":"ì","%EC":"ì","%ed":"í","%Ed":"í","%eD":"í","%ED":"í","%ee":"î","%Ee":"î","%eE":"î","%EE":"î","%ef":"ï","%Ef":"ï","%eF":"ï","%EF":"ï","%f0":"ð","%F0":"ð","%f1":"ñ","%F1":"ñ","%f2":"ò","%F2":"ò","%f3":"ó","%F3":"ó","%f4":"ô","%F4":"ô","%f5":"õ","%F5":"õ","%f6":"ö","%F6":"ö","%f7":"÷","%F7":"÷","%f8":"ø","%F8":"ø","%f9":"ù","%F9":"ù","%fa":"ú","%Fa":"ú","%fA":"ú","%FA":"ú","%fb":"û","%Fb":"û","%fB":"û","%FB":"û","%fc":"ü","%Fc":"ü","%fC":"ü","%FC":"ü","%fd":"ý","%Fd":"ý","%fD":"ý","%FD":"ý","%fe":"þ","%Fe":"þ","%fE":"þ","%FE":"þ","%ff":"ÿ","%Ff":"ÿ","%fF":"ÿ","%FF":"ÿ"};function encodedReplacer(r){return c[r]}const d=0;const p=1;const u=2;const A=3;function parseParams(r){const i=[];let s=d;let c="";let h=false;let g=false;let y=0;let b="";const w=r.length;for(var C=0;C{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Glob=void 0;const a=s(40797);const l=s(63081);const c=s(57310);const d=s(83662);const p=s(21005);const u=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;opts;patterns;constructor(r,i){if(!i)throw new TypeError("glob options required");this.withFileTypes=!!i.withFileTypes;this.signal=i.signal;this.follow=!!i.follow;this.dot=!!i.dot;this.dotRelative=!!i.dotRelative;this.nodir=!!i.nodir;this.mark=!!i.mark;if(!i.cwd){this.cwd=""}else if(i.cwd instanceof URL||i.cwd.startsWith("file://")){i.cwd=(0,c.fileURLToPath)(i.cwd)}this.cwd=i.cwd||"";this.root=i.root;this.magicalBraces=!!i.magicalBraces;this.nobrace=!!i.nobrace;this.noext=!!i.noext;this.realpath=!!i.realpath;this.absolute=i.absolute;this.noglobstar=!!i.noglobstar;this.matchBase=!!i.matchBase;this.maxDepth=typeof i.maxDepth==="number"?i.maxDepth:Infinity;this.stat=!!i.stat;this.ignore=i.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof r==="string"){r=[r]}this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){r=r.map((r=>r.replace(/\\/g,"/")))}if(this.matchBase){if(i.noglobstar){throw new TypeError("base matching requires globstar")}r=r.map((r=>r.includes("/")?r:`./**/${r}`))}this.pattern=r;this.platform=i.platform||u;this.opts={...i,platform:this.platform};if(i.scurry){this.scurry=i.scurry;if(i.nocase!==undefined&&i.nocase!==i.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const r=i.platform==="win32"?l.PathScurryWin32:i.platform==="darwin"?l.PathScurryDarwin:i.platform?l.PathScurryPosix:l.PathScurry;this.scurry=new r(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;const s=this.platform==="darwin"||this.platform==="win32";const p={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const A=this.pattern.map((r=>new a.Minimatch(r,p)));const[h,g]=A.reduce(((r,i)=>{r[0].push(...i.set);r[1].push(...i.globParts);return r}),[[],[]]);this.patterns=h.map(((r,i)=>{const s=g[i];if(!s)throw new Error("invalid pattern object");return new d.Pattern(r,s,0,this.platform)}))}async walk(){return[...await new p.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase}).walk()]}walkSync(){return[...new p.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase}).walkSync()]}stream(){return new p.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase}).stream()}streamSync(){return new p.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}i.Glob=Glob},5003:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.hasMagic=void 0;const a=s(40797);const hasMagic=(r,i={})=>{if(!Array.isArray(r)){r=[r]}for(const s of r){if(new a.Minimatch(s,i).hasMagic())return true}return false};i.hasMagic=hasMagic},56210:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Ignore=void 0;const a=s(40797);const l=s(83662);const c=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;constructor(r,{nobrace:i,nocase:s,noext:d,noglobstar:p,platform:u=c}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];const A={dot:true,nobrace:i,nocase:s,noext:d,noglobstar:p,optimizationLevel:2,platform:u,nocomment:true,nonegate:true};for(const i of r){const r=new a.Minimatch(i,A);for(let i=0;i{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.glob=i.hasMagic=i.Glob=i.unescape=i.escape=i.sync=i.iterate=i.iterateSync=i.stream=i.streamSync=i.globIterate=i.globIterateSync=i.globSync=i.globStream=i.globStreamSync=void 0;const a=s(40797);const l=s(36008);const c=s(5003);function globStreamSync(r,i={}){return new l.Glob(r,i).streamSync()}i.globStreamSync=globStreamSync;function globStream(r,i={}){return new l.Glob(r,i).stream()}i.globStream=globStream;function globSync(r,i={}){return new l.Glob(r,i).walkSync()}i.globSync=globSync;async function glob_(r,i={}){return new l.Glob(r,i).walk()}function globIterateSync(r,i={}){return new l.Glob(r,i).iterateSync()}i.globIterateSync=globIterateSync;function globIterate(r,i={}){return new l.Glob(r,i).iterate()}i.globIterate=globIterate;i.streamSync=globStreamSync;i.stream=Object.assign(globStream,{sync:globStreamSync});i.iterateSync=globIterateSync;i.iterate=Object.assign(globIterate,{sync:globIterateSync});i.sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});var d=s(40797);Object.defineProperty(i,"escape",{enumerable:true,get:function(){return d.escape}});Object.defineProperty(i,"unescape",{enumerable:true,get:function(){return d.unescape}});var p=s(36008);Object.defineProperty(i,"Glob",{enumerable:true,get:function(){return p.Glob}});var u=s(5003);Object.defineProperty(i,"hasMagic",{enumerable:true,get:function(){return u.hasMagic}});i.glob=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:i.sync,globStream:globStream,stream:i.stream,globStreamSync:globStreamSync,streamSync:i.streamSync,globIterate:globIterate,iterate:i.iterate,globIterateSync:globIterateSync,iterateSync:i.iterateSync,Glob:l.Glob,hasMagic:c.hasMagic,escape:a.escape,unescape:a.unescape});i.glob.glob=i.glob},83662:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Pattern=void 0;const a=s(40797);const isPatternList=r=>r.length>=1;const isGlobList=r=>r.length>=1;class Pattern{#h;#g;#y;length;#b;#E;#w;#C;#v;#I;#B=true;constructor(r,i,s,a){if(!isPatternList(r)){throw new TypeError("empty pattern list")}if(!isGlobList(i)){throw new TypeError("empty glob list")}if(i.length!==r.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=r.length;if(s<0||s>=this.length){throw new TypeError("index out of range")}this.#h=r;this.#g=i;this.#y=s;this.#b=a;if(this.#y===0){if(this.isUNC()){const[r,i,s,a,...l]=this.#h;const[c,d,p,u,...A]=this.#g;if(l[0]===""){l.shift();A.shift()}const h=[r,i,s,a,""].join("/");const g=[c,d,p,u,""].join("/");this.#h=[h,...l];this.#g=[g,...A];this.length=this.#h.length}else if(this.isDrive()||this.isAbsolute()){const[r,...i]=this.#h;const[s,...a]=this.#g;if(i[0]===""){i.shift();a.shift()}const l=r+"/";const c=s+"/";this.#h=[l,...i];this.#g=[c,...a];this.length=this.#h.length}}}pattern(){return this.#h[this.#y]}isString(){return typeof this.#h[this.#y]==="string"}isGlobstar(){return this.#h[this.#y]===a.GLOBSTAR}isRegExp(){return this.#h[this.#y]instanceof RegExp}globString(){return this.#w=this.#w||(this.#y===0?this.isAbsolute()?this.#g[0]+this.#g.slice(1).join("/"):this.#g.join("/"):this.#g.slice(this.#y).join("/"))}hasMore(){return this.length>this.#y+1}rest(){if(this.#E!==undefined)return this.#E;if(!this.hasMore())return this.#E=null;this.#E=new Pattern(this.#h,this.#g,this.#y+1,this.#b);this.#E.#I=this.#I;this.#E.#v=this.#v;this.#E.#C=this.#C;return this.#E}isUNC(){const r=this.#h;return this.#v!==undefined?this.#v:this.#v=this.#b==="win32"&&this.#y===0&&r[0]===""&&r[1]===""&&typeof r[2]==="string"&&!!r[2]&&typeof r[3]==="string"&&!!r[3]}isDrive(){const r=this.#h;return this.#C!==undefined?this.#C:this.#C=this.#b==="win32"&&this.#y===0&&this.length>1&&typeof r[0]==="string"&&/^[a-z]:$/i.test(r[0])}isAbsolute(){const r=this.#h;return this.#I!==undefined?this.#I:this.#I=r[0]===""&&r.length>1||this.isDrive()||this.isUNC()}root(){const r=this.#h[0];return typeof r==="string"&&this.isAbsolute()&&this.#y===0?r:""}checkFollowGlobstar(){return!(this.#y===0||!this.isGlobstar()||!this.#B)}markFollowGlobstar(){if(this.#y===0||!this.isGlobstar()||!this.#B)return false;this.#B=false;return true}}i.Pattern=Pattern},18011:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Processor=i.SubWalks=i.MatchRecord=i.HasWalkedCache=void 0;const a=s(40797);class HasWalkedCache{store;constructor(r=new Map){this.store=r}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(r,i){return this.store.get(r.fullpath())?.has(i.globString())}storeWalked(r,i){const s=r.fullpath();const a=this.store.get(s);if(a)a.add(i.globString());else this.store.set(s,new Set([i.globString()]))}}i.HasWalkedCache=HasWalkedCache;class MatchRecord{store=new Map;add(r,i,s){const a=(i?2:0)|(s?1:0);const l=this.store.get(r);this.store.set(r,l===undefined?a:a&l)}entries(){return[...this.store.entries()].map((([r,i])=>[r,!!(i&2),!!(i&1)]))}}i.MatchRecord=MatchRecord;class SubWalks{store=new Map;add(r,i){if(!r.canReaddir()){return}const s=this.store.get(r);if(s){if(!s.find((r=>r.globString()===i.globString()))){s.push(i)}}else this.store.set(r,[i])}get(r){const i=this.store.get(r);if(!i){throw new Error("attempting to walk unknown path")}return i}entries(){return this.keys().map((r=>[r,this.store.get(r)]))}keys(){return[...this.store.keys()].filter((r=>r.canReaddir()))}}i.SubWalks=SubWalks;class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(r,i){this.opts=r;this.follow=!!r.follow;this.dot=!!r.dot;this.hasWalkedCache=i?i.copy():new HasWalkedCache}processPatterns(r,i){this.patterns=i;const s=i.map((i=>[r,i]));for(let[r,i]of s){this.hasWalkedCache.storeWalked(r,i);const s=i.root();const l=i.isAbsolute()&&this.opts.absolute!==false;if(s){r=r.resolve(s==="/"&&this.opts.root!==undefined?this.opts.root:s);const a=i.rest();if(!a){this.matches.add(r,true,false);continue}else{i=a}}if(r.isENOENT())continue;let c;let d;let p=false;while(typeof(c=i.pattern())==="string"&&(d=i.rest())){const s=r.resolve(c);r=s;i=d;p=true}c=i.pattern();d=i.rest();if(p){if(this.hasWalkedCache.hasWalked(r,i))continue;this.hasWalkedCache.storeWalked(r,i)}if(typeof c==="string"){const i=c===".."||c===""||c===".";this.matches.add(r.resolve(c),l,i);continue}else if(c===a.GLOBSTAR){if(!r.isSymbolicLink()||this.follow||i.checkFollowGlobstar()){this.subwalks.add(r,i)}const s=d?.pattern();const a=d?.rest();if(!d||(s===""||s===".")&&!a){this.matches.add(r,l,s===""||s===".")}else{if(s===".."){const i=r.parent||r;if(!a)this.matches.add(i,l,true);else if(!this.hasWalkedCache.hasWalked(i,a)){this.subwalks.add(i,a)}}}}else if(c instanceof RegExp){this.subwalks.add(r,i)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(r,i){const s=this.subwalks.get(r);const l=this.child();for(const r of i){for(const i of s){const s=i.isAbsolute();const c=i.pattern();const d=i.rest();if(c===a.GLOBSTAR){l.testGlobstar(r,i,d,s)}else if(c instanceof RegExp){l.testRegExp(r,c,d,s)}else{l.testString(r,c,d,s)}}}return l}testGlobstar(r,i,s,a){if(this.dot||!r.name.startsWith(".")){if(!i.hasMore()){this.matches.add(r,a,false)}if(r.canReaddir()){if(this.follow||!r.isSymbolicLink()){this.subwalks.add(r,i)}else if(r.isSymbolicLink()){if(s&&i.checkFollowGlobstar()){this.subwalks.add(r,s)}else if(i.markFollowGlobstar()){this.subwalks.add(r,i)}}}}if(s){const i=s.pattern();if(typeof i==="string"&&i!==".."&&i!==""&&i!=="."){this.testString(r,i,s.rest(),a)}else if(i===".."){const i=r.parent||r;this.subwalks.add(i,s)}else if(i instanceof RegExp){this.testRegExp(r,i,s.rest(),a)}}}testRegExp(r,i,s,a){if(!i.test(r.name))return;if(!s){this.matches.add(r,a,false)}else{this.subwalks.add(r,s)}}testString(r,i,s,a){if(!r.isNamed(i))return;if(!s){this.matches.add(r,a,false)}else{this.subwalks.add(r,s)}}}i.Processor=Processor},21005:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.GlobStream=i.GlobWalker=i.GlobUtil=void 0;const a=s(87038);const l=s(56210);const c=s(18011);const makeIgnore=(r,i)=>typeof r==="string"?new l.Ignore([r],i):Array.isArray(r)?new l.Ignore(r,i):r;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#S=[];#x;#R;signal;maxDepth;constructor(r,i,s){this.patterns=r;this.path=i;this.opts=s;this.#R=!s.posix&&s.platform==="win32"?"\\":"/";if(s.ignore){this.#x=makeIgnore(s.ignore,s)}this.maxDepth=s.maxDepth||Infinity;if(s.signal){this.signal=s.signal;this.signal.addEventListener("abort",(()=>{this.#S.length=0}))}}#Q(r){return this.seen.has(r)||!!this.#x?.ignored?.(r)}#_(r){return!!this.#x?.childrenIgnored?.(r)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let r=undefined;while(!this.paused&&(r=this.#S.shift())){r()}}onResume(r){if(this.signal?.aborted)return;if(!this.paused){r()}else{this.#S.push(r)}}async matchCheck(r,i){if(i&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=r.realpathCached()||await r.realpath();if(!s)return undefined;r=s}const a=r.isUnknown()||this.opts.stat;return this.matchCheckTest(a?await r.lstat():r,i)}matchCheckTest(r,i){return r&&(this.maxDepth===Infinity||r.depth()<=this.maxDepth)&&(!i||r.canReaddir())&&(!this.opts.nodir||!r.isDirectory())&&!this.#Q(r)?r:undefined}matchCheckSync(r,i){if(i&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=r.realpathCached()||r.realpathSync();if(!s)return undefined;r=s}const a=r.isUnknown()||this.opts.stat;return this.matchCheckTest(a?r.lstatSync():r,i)}matchFinish(r,i){if(this.#Q(r))return;const s=this.opts.absolute===undefined?i:this.opts.absolute;this.seen.add(r);const a=this.opts.mark&&r.isDirectory()?this.#R:"";if(this.opts.withFileTypes){this.matchEmit(r)}else if(s){const i=this.opts.posix?r.fullpathPosix():r.fullpath();this.matchEmit(i+a)}else{const i=this.opts.posix?r.relativePosix():r.relative();const s=this.opts.dotRelative&&!i.startsWith(".."+this.#R)?"."+this.#R:"";this.matchEmit(!i?"."+a:s+i+a)}}async match(r,i,s){const a=await this.matchCheck(r,s);if(a)this.matchFinish(a,i)}matchSync(r,i,s){const a=this.matchCheckSync(r,s);if(a)this.matchFinish(a,i)}walkCB(r,i,s){if(this.signal?.aborted)s();this.walkCB2(r,i,new c.Processor(this.opts),s)}walkCB2(r,i,s,a){if(this.#_(r))return a();if(this.signal?.aborted)a();if(this.paused){this.onResume((()=>this.walkCB2(r,i,s,a)));return}s.processPatterns(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of s.matches.entries()){if(this.#Q(r))continue;l++;this.match(r,i,a).then((()=>next()))}for(const r of s.subwalkTargets()){if(this.maxDepth!==Infinity&&r.depth()>=this.maxDepth){continue}l++;const i=r.readdirCached();if(r.calledReaddir())this.walkCB3(r,i,s,next);else{r.readdirCB(((i,a)=>this.walkCB3(r,a,s,next)),true)}}next()}walkCB3(r,i,s,a){s=s.filterEntries(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of s.matches.entries()){if(this.#Q(r))continue;l++;this.match(r,i,a).then((()=>next()))}for(const[r,i]of s.subwalks.entries()){l++;this.walkCB2(r,i,s.child(),next)}next()}walkCBSync(r,i,s){if(this.signal?.aborted)s();this.walkCB2Sync(r,i,new c.Processor(this.opts),s)}walkCB2Sync(r,i,s,a){if(this.#_(r))return a();if(this.signal?.aborted)a();if(this.paused){this.onResume((()=>this.walkCB2Sync(r,i,s,a)));return}s.processPatterns(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of s.matches.entries()){if(this.#Q(r))continue;this.matchSync(r,i,a)}for(const r of s.subwalkTargets()){if(this.maxDepth!==Infinity&&r.depth()>=this.maxDepth){continue}l++;const i=r.readdirSync();this.walkCB3Sync(r,i,s,next)}next()}walkCB3Sync(r,i,s,a){s=s.filterEntries(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of s.matches.entries()){if(this.#Q(r))continue;this.matchSync(r,i,a)}for(const[r,i]of s.subwalks.entries()){l++;this.walkCB2Sync(r,i,s.child(),next)}next()}}i.GlobUtil=GlobUtil;class GlobWalker extends GlobUtil{matches;constructor(r,i,s){super(r,i,s);this.matches=new Set}matchEmit(r){this.matches.add(r)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((r,i)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){i(this.signal.reason)}else{r(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}i.GlobWalker=GlobWalker;class GlobStream extends GlobUtil{results;constructor(r,i,s){super(r,i,s);this.results=new a.Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(r){this.results.write(r);if(!this.results.flowing)this.pause()}stream(){const r=this.path;if(r.isUnknown()){r.lstat().then((()=>{this.walkCB(r,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(r,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}i.GlobStream=GlobStream},98966:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.assertValidPattern=void 0;const s=1024*64;const assertValidPattern=r=>{if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>s){throw new TypeError("pattern is too long")}};i.assertValidPattern=assertValidPattern},37213:(r,i,s)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.AST=void 0;const a=s(41263);const l=s(51445);const c=new Set(["!","?","+","*","@"]);const isExtglobType=r=>c.has(r);const d="(?!(?:^|/)\\.\\.?(?:$|/))";const p="(?!\\.)";const u=new Set(["[","."]);const A=new Set(["..","."]);const h=new Set("().*{}+?[]^$\\!");const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const g="[^/]";const y=g+"*?";const b=g+"+?";class AST{type;#N;#T;#k=false;#D=[];#P;#O;#L;#M=false;#F;#U;#j=false;constructor(r,i,s={}){this.type=r;if(r)this.#T=true;this.#P=i;this.#N=this.#P?this.#P.#N:this;this.#F=this.#N===this?s:this.#N.#F;this.#L=this.#N===this?[]:this.#N.#L;if(r==="!"&&!this.#N.#M)this.#L.push(this);this.#O=this.#P?this.#P.#D.length:0}get hasMagic(){if(this.#T!==undefined)return this.#T;for(const r of this.#D){if(typeof r==="string")continue;if(r.type||r.hasMagic)return this.#T=true}return this.#T}toString(){if(this.#U!==undefined)return this.#U;if(!this.type){return this.#U=this.#D.map((r=>String(r))).join("")}else{return this.#U=this.type+"("+this.#D.map((r=>String(r))).join("|")+")"}}#H(){if(this!==this.#N)throw new Error("should only call on root");if(this.#M)return this;this.toString();this.#M=true;let r;while(r=this.#L.pop()){if(r.type!=="!")continue;let i=r;let s=i.#P;while(s){for(let a=i.#O+1;!s.type&&atypeof r==="string"?r:r.toJSON())):[this.type,...this.#D.map((r=>r.toJSON()))];if(this.isStart()&&!this.type)r.unshift([]);if(this.isEnd()&&(this===this.#N||this.#N.#M&&this.#P?.type==="!")){r.push({})}return r}isStart(){if(this.#N===this)return true;if(!this.#P?.isStart())return false;if(this.#O===0)return true;const r=this.#P;for(let i=0;i{const[a,l,c,d]=typeof i==="string"?AST.#G(i,this.#T,s):i.toRegExpSource(r);this.#T=this.#T||c;this.#k=this.#k||d;return a})).join("");let c="";if(this.isStart()){if(typeof this.#D[0]==="string"){const s=this.#D.length===1&&A.has(this.#D[0]);if(!s){const s=u;const l=i&&s.has(a.charAt(0))||a.startsWith("\\.")&&s.has(a.charAt(2))||a.startsWith("\\.\\.")&&s.has(a.charAt(4));const A=!i&&!r&&s.has(a.charAt(0));c=l?d:A?p:""}}}let h="";if(this.isEnd()&&this.#N.#M&&this.#P?.type==="!"){h="(?:$|\\/)"}const g=c+a+h;return[g,(0,l.unescape)(a),this.#T=!!this.#T,this.#k]}const s=this.type==="*"||this.type==="+";const a=this.type==="!"?"(?:(?!(?:":"(?:";let c=this.#z(i);if(this.isStart()&&this.isEnd()&&!c&&this.type!=="!"){const r=this.toString();this.#D=[r];this.type=null;this.#T=undefined;return[r,(0,l.unescape)(this.toString()),false,false]}let h=!s||r||i||!p?"":this.#z(true);if(h===c){h=""}if(h){c=`(?:${c})(?:${h})*?`}let g="";if(this.type==="!"&&this.#j){g=(this.isStart()&&!i?p:"")+b}else{const s=this.type==="!"?"))"+(this.isStart()&&!i&&!r?p:"")+y+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&h?")":this.type==="*"&&h?`)?`:`)${this.type}`;g=a+c+s}return[g,(0,l.unescape)(c),this.#T=!!this.#T,this.#k]}#z(r){return this.#D.map((i=>{if(typeof i==="string"){throw new Error("string type in extglob ast??")}const[s,a,l,c]=i.toRegExpSource(r);this.#k=this.#k||c;return s})).filter((r=>!(this.isStart()&&this.isEnd())||!!r)).join("|")}static#G(r,i,s=false){let c=false;let d="";let p=false;for(let l=0;l{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.parseClass=void 0;const s={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=r=>r.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=r=>r.join("");const parseClass=(r,i)=>{const a=i;if(r.charAt(a)!=="["){throw new Error("not in a brace expression")}const l=[];const c=[];let d=a+1;let p=false;let u=false;let A=false;let h=false;let g=a;let y="";e:while(dy){l.push(braceEscape(y)+"-"+braceEscape(i))}else if(i===y){l.push(braceEscape(i))}y="";d++;continue}if(r.startsWith("-]",d+1)){l.push(braceEscape(i+"-"));d+=2;continue}if(r.startsWith("-",d+1)){y=i;d+=2;continue}l.push(braceEscape(i));d++}if(g{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.escape=void 0;const escape=(r,{windowsPathsNoEscape:i=false}={})=>i?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");i.escape=escape},40797:function(r,i,s){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.unescape=i.escape=i.AST=i.Minimatch=i.match=i.makeRe=i.braceExpand=i.defaults=i.filter=i.GLOBSTAR=i.sep=i.minimatch=void 0;const l=a(s(11469));const c=s(98966);const d=s(37213);const p=s(68645);const u=s(51445);const minimatch=(r,i,s={})=>{(0,c.assertValidPattern)(i);if(!s.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,s).match(r)};i.minimatch=minimatch;const A=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=r=>i=>!i.startsWith(".")&&i.endsWith(r);const starDotExtTestDot=r=>i=>i.endsWith(r);const starDotExtTestNocase=r=>{r=r.toLowerCase();return i=>!i.startsWith(".")&&i.toLowerCase().endsWith(r)};const starDotExtTestNocaseDot=r=>{r=r.toLowerCase();return i=>i.toLowerCase().endsWith(r)};const h=/^\*+\.\*+$/;const starDotStarTest=r=>!r.startsWith(".")&&r.includes(".");const starDotStarTestDot=r=>r!=="."&&r!==".."&&r.includes(".");const g=/^\.\*+$/;const dotStarTest=r=>r!=="."&&r!==".."&&r.startsWith(".");const y=/^\*+$/;const starTest=r=>r.length!==0&&!r.startsWith(".");const starTestDot=r=>r.length!==0&&r!=="."&&r!=="..";const b=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([r,i=""])=>{const s=qmarksTestNoExt([r]);if(!i)return s;i=i.toLowerCase();return r=>s(r)&&r.toLowerCase().endsWith(i)};const qmarksTestNocaseDot=([r,i=""])=>{const s=qmarksTestNoExtDot([r]);if(!i)return s;i=i.toLowerCase();return r=>s(r)&&r.toLowerCase().endsWith(i)};const qmarksTestDot=([r,i=""])=>{const s=qmarksTestNoExtDot([r]);return!i?s:r=>s(r)&&r.endsWith(i)};const qmarksTest=([r,i=""])=>{const s=qmarksTestNoExt([r]);return!i?s:r=>s(r)&&r.endsWith(i)};const qmarksTestNoExt=([r])=>{const i=r.length;return r=>r.length===i&&!r.startsWith(".")};const qmarksTestNoExtDot=([r])=>{const i=r.length;return r=>r.length===i&&r!=="."&&r!==".."};const w=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const C={win32:{sep:"\\"},posix:{sep:"/"}};i.sep=w==="win32"?C.win32.sep:C.posix.sep;i.minimatch.sep=i.sep;i.GLOBSTAR=Symbol("globstar **");i.minimatch.GLOBSTAR=i.GLOBSTAR;const v="[^/]";const I=v+"*?";const B="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const S="(?:(?!(?:\\/|^)\\.).)*?";const filter=(r,s={})=>a=>(0,i.minimatch)(a,r,s);i.filter=filter;i.minimatch.filter=i.filter;const ext=(r,i={})=>Object.assign({},r,i);const defaults=r=>{if(!r||typeof r!=="object"||!Object.keys(r).length){return i.minimatch}const s=i.minimatch;const m=(i,a,l={})=>s(i,a,ext(r,l));return Object.assign(m,{Minimatch:class Minimatch extends s.Minimatch{constructor(i,s={}){super(i,ext(r,s))}static defaults(i){return s.defaults(ext(r,i)).Minimatch}},AST:class AST extends s.AST{constructor(i,s,a={}){super(i,s,ext(r,a))}static fromGlob(i,a={}){return s.AST.fromGlob(i,ext(r,a))}},unescape:(i,a={})=>s.unescape(i,ext(r,a)),escape:(i,a={})=>s.escape(i,ext(r,a)),filter:(i,a={})=>s.filter(i,ext(r,a)),defaults:i=>s.defaults(ext(r,i)),makeRe:(i,a={})=>s.makeRe(i,ext(r,a)),braceExpand:(i,a={})=>s.braceExpand(i,ext(r,a)),match:(i,a,l={})=>s.match(i,a,ext(r,l)),sep:s.sep,GLOBSTAR:i.GLOBSTAR})};i.defaults=defaults;i.minimatch.defaults=i.defaults;const braceExpand=(r,i={})=>{(0,c.assertValidPattern)(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return(0,l.default)(r)};i.braceExpand=braceExpand;i.minimatch.braceExpand=i.braceExpand;const makeRe=(r,i={})=>new Minimatch(r,i).makeRe();i.makeRe=makeRe;i.minimatch.makeRe=i.makeRe;const match=(r,i,s={})=>{const a=new Minimatch(i,s);r=r.filter((r=>a.match(r)));if(a.options.nonull&&!r.length){r.push(i)}return r};i.match=match;i.minimatch.match=i.match;const x=/[?*]|[+@!]\(.*?\)|\[|\]/;const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(r,i={}){(0,c.assertValidPattern)(r);i=i||{};this.options=i;this.pattern=r;this.platform=i.platform||w;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!i.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!i.nonegate;this.comment=false;this.empty=false;this.partial=!!i.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=i.windowsNoMagicRoot!==undefined?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const r of this.set){for(const i of r){if(typeof i!=="string")return true}}return false}debug(...r){}make(){const r=this.pattern;const i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(i.debug){this.debug=(...r)=>console.error(...r)}this.debug(this.pattern,this.globSet);const s=this.globSet.map((r=>this.slashSplit(r)));this.globParts=this.preprocess(s);this.debug(this.pattern,this.globParts);let a=this.globParts.map(((r,i,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){const i=r[0]===""&&r[1]===""&&(r[2]==="?"||!x.test(r[2]))&&!x.test(r[3]);const s=/^[a-z]:/i.test(r[0]);if(i){return[...r.slice(0,4),...r.slice(4).map((r=>this.parse(r)))]}else if(s){return[r[0],...r.slice(1).map((r=>this.parse(r)))]}}return r.map((r=>this.parse(r)))}));this.debug(this.pattern,a);this.set=a.filter((r=>r.indexOf(false)===-1));if(this.isWindows){for(let r=0;r=2){r=this.firstPhasePreProcess(r);r=this.secondPhasePreProcess(r)}else if(i>=1){r=this.levelOneOptimize(r)}else{r=this.adjascentGlobstarOptimize(r)}return r}adjascentGlobstarOptimize(r){return r.map((r=>{let i=-1;while(-1!==(i=r.indexOf("**",i+1))){let s=i;while(r[s+1]==="**"){s++}if(s!==i){r.splice(i,s-i)}}return r}))}levelOneOptimize(r){return r.map((r=>{r=r.reduce(((r,i)=>{const s=r[r.length-1];if(i==="**"&&s==="**"){return r}if(i===".."){if(s&&s!==".."&&s!=="."&&s!=="**"){r.pop();return r}}r.push(i);return r}),[]);return r.length===0?[""]:r}))}levelTwoFileOptimize(r){if(!Array.isArray(r)){r=this.slashSplit(r)}let i=false;do{i=false;if(!this.preserveMultipleSlashes){for(let s=1;sa){s.splice(a+1,l-a)}let c=s[a+1];const d=s[a+2];const p=s[a+3];if(c!=="..")continue;if(!d||d==="."||d===".."||!p||p==="."||p===".."){continue}i=true;s.splice(a,1);const u=s.slice(0);u[a]="**";r.push(u);a--}if(!this.preserveMultipleSlashes){for(let r=1;rr.length))}partsMatch(r,i,s=false){let a=0;let l=0;let c=[];let d="";while(ad){s=s.slice(p)}else if(d>p){r=r.slice(d)}}}}const{optimizationLevel:c=1}=this.options;if(c>=2){r=this.levelTwoFileOptimize(r)}this.debug("matchOne",this,{file:r,pattern:s});this.debug("matchOne",r.length,s.length);for(var d=0,p=0,u=r.length,A=s.length;d>> no match, partial?",r,y,s,b);if(y===u){return true}}return false}let c;if(typeof h==="string"){c=g===h;this.debug("string match",h,g,c)}else{c=h.test(g);this.debug("pattern match",h,g,c)}if(!c)return false}if(d===u&&p===A){return true}else if(d===u){return a}else if(p===A){return d===u-1&&r[d]===""}else{throw new Error("wtf?")}}braceExpand(){return(0,i.braceExpand)(this.pattern,this.options)}parse(r){(0,c.assertValidPattern)(r);const s=this.options;if(r==="**")return i.GLOBSTAR;if(r==="")return"";let a;let l=null;if(a=r.match(y)){l=s.dot?starTestDot:starTest}else if(a=r.match(A)){l=(s.nocase?s.dot?starDotExtTestNocaseDot:starDotExtTestNocase:s.dot?starDotExtTestDot:starDotExtTest)(a[1])}else if(a=r.match(b)){l=(s.nocase?s.dot?qmarksTestNocaseDot:qmarksTestNocase:s.dot?qmarksTestDot:qmarksTest)(a)}else if(a=r.match(h)){l=s.dot?starDotStarTestDot:starDotStarTest}else if(a=r.match(g)){l=dotStarTest}const p=d.AST.fromGlob(r,this.options).toMMPattern();return l?Object.assign(p,{test:l}):p}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const r=this.set;if(!r.length){this.regexp=false;return this.regexp}const s=this.options;const a=s.noglobstar?I:s.dot?B:S;const l=new Set(s.nocase?["i"]:[]);let c=r.map((r=>{const s=r.map((r=>{if(r instanceof RegExp){for(const i of r.flags.split(""))l.add(i)}return typeof r==="string"?regExpEscape(r):r===i.GLOBSTAR?i.GLOBSTAR:r._src}));s.forEach(((r,l)=>{const c=s[l+1];const d=s[l-1];if(r!==i.GLOBSTAR||d===i.GLOBSTAR){return}if(d===undefined){if(c!==undefined&&c!==i.GLOBSTAR){s[l+1]="(?:\\/|"+a+"\\/)?"+c}else{s[l]=a}}else if(c===undefined){s[l-1]=d+"(?:\\/|"+a+")?"}else if(c!==i.GLOBSTAR){s[l-1]=d+"(?:\\/|\\/"+a+"\\/)"+c;s[l+1]=i.GLOBSTAR}}));return s.filter((r=>r!==i.GLOBSTAR)).join("/")})).join("|");const[d,p]=r.length>1?["(?:",")"]:["",""];c="^"+d+c+p+"$";if(this.negate)c="^(?!"+c+").+$";try{this.regexp=new RegExp(c,[...l].join(""))}catch(r){this.regexp=false}return this.regexp}slashSplit(r){if(this.preserveMultipleSlashes){return r.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(r)){return["",...r.split(/\/+/)]}else{return r.split(/\/+/)}}match(r,i=this.partial){this.debug("match",r,this.pattern);if(this.comment){return false}if(this.empty){return r===""}if(r==="/"&&i){return true}const s=this.options;if(this.isWindows){r=r.split("\\").join("/")}const a=this.slashSplit(r);this.debug(this.pattern,"split",a);const l=this.set;this.debug(this.pattern,"set",l);let c=a[a.length-1];if(!c){for(let r=a.length-2;!c&&r>=0;r--){c=a[r]}}for(let r=0;r{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.unescape=void 0;const unescape=(r,{windowsPathsNoEscape:i=false}={})=>i?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");i.unescape=unescape},87038:function(r,i,s){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Minipass=i.isWritable=i.isReadable=i.isStream=void 0;const l=typeof process==="object"&&process?process:{stdout:null,stderr:null};const c=s(82361);const d=a(s(12781));const p=s(71576);const isStream=r=>!!r&&typeof r==="object"&&(r instanceof Minipass||r instanceof d.default||(0,i.isReadable)(r)||(0,i.isWritable)(r));i.isStream=isStream;const isReadable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.pipe==="function"&&r.pipe!==d.default.Writable.prototype.pipe;i.isReadable=isReadable;const isWritable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.write==="function"&&typeof r.end==="function";i.isWritable=isWritable;const u=Symbol("EOF");const A=Symbol("maybeEmitEnd");const h=Symbol("emittedEnd");const g=Symbol("emittingEnd");const y=Symbol("emittedError");const b=Symbol("closed");const w=Symbol("read");const C=Symbol("flush");const v=Symbol("flushChunk");const I=Symbol("encoding");const B=Symbol("decoder");const S=Symbol("flowing");const x=Symbol("paused");const R=Symbol("resume");const Q=Symbol("buffer");const _=Symbol("pipes");const N=Symbol("bufferLength");const T=Symbol("bufferPush");const k=Symbol("bufferShift");const D=Symbol("objectMode");const P=Symbol("destroyed");const O=Symbol("error");const L=Symbol("emitData");const M=Symbol("emitEnd");const U=Symbol("emitEnd2");const j=Symbol("async");const H=Symbol("abort");const q=Symbol("aborted");const G=Symbol("signal");const z=Symbol("dataListeners");const V=Symbol("discarded");const defer=r=>Promise.resolve().then(r);const nodefer=r=>r();const isEndish=r=>r==="end"||r==="finish"||r==="prefinish";const isArrayBufferLike=r=>r instanceof ArrayBuffer||!!r&&typeof r==="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0;const isArrayBufferView=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);class Pipe{src;dest;opts;ondrain;constructor(r,i,s){this.src=r;this.dest=i;this.opts=s;this.ondrain=()=>r[R]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(r){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(r,i,s){super(r,i,s);this.proxyErrors=r=>i.emit("error",r);r.on("error",this.proxyErrors)}}const isObjectModeOptions=r=>!!r.objectMode;const isEncodingOptions=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer";class Minipass extends c.EventEmitter{[S]=false;[x]=false;[_]=[];[Q]=[];[D];[I];[j];[B];[u]=false;[h]=false;[g]=false;[b]=false;[y]=null;[N]=0;[P]=false;[G];[q]=false;[z]=0;[V]=false;writable=true;readable=true;constructor(...r){const i=r[0]||{};super();if(i.objectMode&&typeof i.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(i)){this[D]=true;this[I]=null}else if(isEncodingOptions(i)){this[I]=i.encoding;this[D]=false}else{this[D]=false;this[I]=null}this[j]=!!i.async;this[B]=this[I]?new p.StringDecoder(this[I]):null;if(i&&i.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[Q]})}if(i&&i.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[_]})}const{signal:s}=i;if(s){this[G]=s;if(s.aborted){this[H]()}else{s.addEventListener("abort",(()=>this[H]()))}}}get bufferLength(){return this[N]}get encoding(){return this[I]}set encoding(r){throw new Error("Encoding must be set at instantiation time")}setEncoding(r){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D]}set objectMode(r){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[j]}set["async"](r){this[j]=this[j]||!!r}[H](){this[q]=true;this.emit("abort",this[G]?.reason);this.destroy(this[G]?.reason)}get aborted(){return this[q]}set aborted(r){}write(r,i,s){if(this[q])return false;if(this[u])throw new Error("write after end");if(this[P]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof i==="function"){s=i;i="utf8"}if(!i)i="utf8";const a=this[j]?defer:nodefer;if(!this[D]&&!Buffer.isBuffer(r)){if(isArrayBufferView(r)){r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(isArrayBufferLike(r)){r=Buffer.from(r)}else if(typeof r!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[D]){if(this[S]&&this[N]!==0)this[C](true);if(this[S])this.emit("data",r);else this[T](r);if(this[N]!==0)this.emit("readable");if(s)a(s);return this[S]}if(!r.length){if(this[N]!==0)this.emit("readable");if(s)a(s);return this[S]}if(typeof r==="string"&&!(i===this[I]&&!this[B]?.lastNeed)){r=Buffer.from(r,i)}if(Buffer.isBuffer(r)&&this[I]){r=this[B].write(r)}if(this[S]&&this[N]!==0)this[C](true);if(this[S])this.emit("data",r);else this[T](r);if(this[N]!==0)this.emit("readable");if(s)a(s);return this[S]}read(r){if(this[P])return null;this[V]=false;if(this[N]===0||r===0||r&&r>this[N]){this[A]();return null}if(this[D])r=null;if(this[Q].length>1&&!this[D]){this[Q]=[this[I]?this[Q].join(""):Buffer.concat(this[Q],this[N])]}const i=this[w](r||null,this[Q][0]);this[A]();return i}[w](r,i){if(this[D])this[k]();else{const s=i;if(r===s.length||r===null)this[k]();else if(typeof s==="string"){this[Q][0]=s.slice(r);i=s.slice(0,r);this[N]-=r}else{this[Q][0]=s.subarray(r);i=s.subarray(0,r);this[N]-=r}}this.emit("data",i);if(!this[Q].length&&!this[u])this.emit("drain");return i}end(r,i,s){if(typeof r==="function"){s=r;r=undefined}if(typeof i==="function"){s=i;i="utf8"}if(r!==undefined)this.write(r,i);if(s)this.once("end",s);this[u]=true;this.writable=false;if(this[S]||!this[x])this[A]();return this}[R](){if(this[P])return;if(!this[z]&&!this[_].length){this[V]=true}this[x]=false;this[S]=true;this.emit("resume");if(this[Q].length)this[C]();else if(this[u])this[A]();else this.emit("drain")}resume(){return this[R]()}pause(){this[S]=false;this[x]=true;this[V]=false}get destroyed(){return this[P]}get flowing(){return this[S]}get paused(){return this[x]}[T](r){if(this[D])this[N]+=1;else this[N]+=r.length;this[Q].push(r)}[k](){if(this[D])this[N]-=1;else this[N]-=this[Q][0].length;return this[Q].shift()}[C](r=false){do{}while(this[v](this[k]())&&this[Q].length);if(!r&&!this[Q].length&&!this[u])this.emit("drain")}[v](r){this.emit("data",r);return this[S]}pipe(r,i){if(this[P])return r;this[V]=false;const s=this[h];i=i||{};if(r===l.stdout||r===l.stderr)i.end=false;else i.end=i.end!==false;i.proxyErrors=!!i.proxyErrors;if(s){if(i.end)r.end()}else{this[_].push(!i.proxyErrors?new Pipe(this,r,i):new PipeProxyErrors(this,r,i));if(this[j])defer((()=>this[R]()));else this[R]()}return r}unpipe(r){const i=this[_].find((i=>i.dest===r));if(i){if(this[_].length===1){if(this[S]&&this[z]===0){this[S]=false}this[_]=[]}else this[_].splice(this[_].indexOf(i),1);i.unpipe()}}addListener(r,i){return this.on(r,i)}on(r,i){const s=super.on(r,i);if(r==="data"){this[V]=false;this[z]++;if(!this[_].length&&!this[S]){this[R]()}}else if(r==="readable"&&this[N]!==0){super.emit("readable")}else if(isEndish(r)&&this[h]){super.emit(r);this.removeAllListeners(r)}else if(r==="error"&&this[y]){const r=i;if(this[j])defer((()=>r.call(this,this[y])));else r.call(this,this[y])}return s}removeListener(r,i){return this.off(r,i)}off(r,i){const s=super.off(r,i);if(r==="data"){this[z]=this.listeners("data").length;if(this[z]===0&&!this[V]&&!this[_].length){this[S]=false}}return s}removeAllListeners(r){const i=super.removeAllListeners(r);if(r==="data"||r===undefined){this[z]=0;if(!this[V]&&!this[_].length){this[S]=false}}return i}get emittedEnd(){return this[h]}[A](){if(!this[g]&&!this[h]&&!this[P]&&this[Q].length===0&&this[u]){this[g]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[b])this.emit("close");this[g]=false}}emit(r,...i){const s=i[0];if(r!=="error"&&r!=="close"&&r!==P&&this[P]){return false}else if(r==="data"){return!this[D]&&!s?false:this[j]?(defer((()=>this[L](s))),true):this[L](s)}else if(r==="end"){return this[M]()}else if(r==="close"){this[b]=true;if(!this[h]&&!this[P])return false;const r=super.emit("close");this.removeAllListeners("close");return r}else if(r==="error"){this[y]=s;super.emit(O,s);const r=!this[G]||this.listeners("error").length?super.emit("error",s):false;this[A]();return r}else if(r==="resume"){const r=super.emit("resume");this[A]();return r}else if(r==="finish"||r==="prefinish"){const i=super.emit(r);this.removeAllListeners(r);return i}const a=super.emit(r,...i);this[A]();return a}[L](r){for(const i of this[_]){if(i.dest.write(r)===false)this.pause()}const i=this[V]?false:super.emit("data",r);this[A]();return i}[M](){if(this[h])return false;this[h]=true;this.readable=false;return this[j]?(defer((()=>this[U]())),true):this[U]()}[U](){if(this[B]){const r=this[B].end();if(r){for(const i of this[_]){i.dest.write(r)}if(!this[V])super.emit("data",r)}}for(const r of this[_]){r.end()}const r=super.emit("end");this.removeAllListeners("end");return r}async collect(){const r=Object.assign([],{dataLength:0});if(!this[D])r.dataLength=0;const i=this.promise();this.on("data",(i=>{r.push(i);if(!this[D])r.dataLength+=i.length}));await i;return r}async concat(){if(this[D]){throw new Error("cannot concat in objectMode")}const r=await this.collect();return this[I]?r.join(""):Buffer.concat(r,r.dataLength)}async promise(){return new Promise(((r,i)=>{this.on(P,(()=>i(new Error("stream destroyed"))));this.on("error",(r=>i(r)));this.on("end",(()=>r()))}))}[Symbol.asyncIterator](){this[V]=false;let r=false;const stop=async()=>{this.pause();r=true;return{value:undefined,done:true}};const next=()=>{if(r)return stop();const i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[u])return stop();let s;let a;const onerr=r=>{this.off("data",ondata);this.off("end",onend);this.off(P,ondestroy);stop();a(r)};const ondata=r=>{this.off("error",onerr);this.off("end",onend);this.off(P,ondestroy);this.pause();s({value:r,done:!!this[u]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(P,ondestroy);stop();s({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((r,i)=>{a=i;s=r;this.once(P,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[V]=false;let r=false;const stop=()=>{this.pause();this.off(O,stop);this.off(P,stop);this.off("end",stop);r=true;return{done:true,value:undefined}};const next=()=>{if(r)return stop();const i=this.read();return i===null?stop():{done:false,value:i}};this.once("end",stop);this.once(O,stop);this.once(P,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(r){if(this[P]){if(r)this.emit("error",r);else this.emit(P);return this}this[P]=true;this[V]=true;this[Q].length=0;this[N]=0;const i=this;if(typeof i.close==="function"&&!this[b])i.close();if(r)this.emit("error",r);else this.emit(P);return this}static get isStream(){return i.isStream}}i.Minipass=Minipass},63081:function(r,i,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,s,a){if(a===undefined)a=s;var l=Object.getOwnPropertyDescriptor(i,s);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[s]}}}Object.defineProperty(r,a,l)}:function(r,i,s,a){if(a===undefined)a=s;r[a]=i[s]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)if(s!=="default"&&Object.prototype.hasOwnProperty.call(r,s))a(i,r,s);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.PathScurry=i.Path=i.PathScurryDarwin=i.PathScurryPosix=i.PathScurryWin32=i.PathScurryBase=i.PathPosix=i.PathWin32=i.PathBase=i.ChildrenCache=i.ResolveCache=void 0;const d=s(87637);const p=s(71017);const u=s(57310);const A=c(s(57147));const h=s(57147);const g=h.realpathSync.native;const y=s(73292);const b=s(57005);const w={lstatSync:h.lstatSync,readdir:h.readdir,readdirSync:h.readdirSync,readlinkSync:h.readlinkSync,realpathSync:g,promises:{lstat:y.lstat,readdir:y.readdir,readlink:y.readlink,realpath:y.realpath}};const fsFromOption=r=>!r||r===w||r===A?w:{...w,...r,promises:{...w.promises,...r.promises||{}}};const C=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=r=>r.replace(/\//g,"\\").replace(C,"$1\\");const v=/[\\\/]/;const I=0;const B=1;const S=2;const x=4;const R=6;const Q=8;const _=10;const N=12;const T=15;const k=~T;const D=16;const P=32;const O=64;const L=128;const M=256;const U=512;const j=O|L|U;const H=1023;const entToType=r=>r.isFile()?Q:r.isDirectory()?x:r.isSymbolicLink()?_:r.isCharacterDevice()?S:r.isBlockDevice()?R:r.isSocket()?N:r.isFIFO()?B:I;const q=new Map;const normalize=r=>{const i=q.get(r);if(i)return i;const s=r.normalize("NFKD");q.set(r,s);return s};const G=new Map;const normalizeNocase=r=>{const i=G.get(r);if(i)return i;const s=normalize(r.toLowerCase());G.set(r,s);return s};class ResolveCache extends d.LRUCache{constructor(){super({max:256})}}i.ResolveCache=ResolveCache;class ChildrenCache extends d.LRUCache{constructor(r=16*1024){super({maxSize:r,sizeCalculation:r=>r.length+1})}}i.ChildrenCache=ChildrenCache;const z=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;#V;#W;get dev(){return this.#W}#Y;get mode(){return this.#Y}#J;get nlink(){return this.#J}#$;get uid(){return this.#$}#X;get gid(){return this.#X}#K;get rdev(){return this.#K}#Z;get blksize(){return this.#Z}#ee;get ino(){return this.#ee}#te;get size(){return this.#te}#re;get blocks(){return this.#re}#ne;get atimeMs(){return this.#ne}#ie;get mtimeMs(){return this.#ie}#se;get ctimeMs(){return this.#se}#ae;get birthtimeMs(){return this.#ae}#oe;get atime(){return this.#oe}#le;get mtime(){return this.#le}#ce;get ctime(){return this.#ce}#de;get birthtime(){return this.#de}#pe;#ue;#Ae;#fe;#me;#he;#ge;#ye;#be;#Ee;get path(){return(this.parent||this).fullpath()}constructor(r,i=I,s,a,l,c,d){this.name=r;this.#pe=l?normalizeNocase(r):normalize(r);this.#ge=i&H;this.nocase=l;this.roots=a;this.root=s||this;this.#ye=c;this.#Ae=d.fullpath;this.#me=d.relative;this.#he=d.relativePosix;this.parent=d.parent;if(this.parent){this.#V=this.parent.#V}else{this.#V=fsFromOption(d.fs)}}depth(){if(this.#ue!==undefined)return this.#ue;if(!this.parent)return this.#ue=0;return this.#ue=this.parent.depth()+1}childrenCache(){return this.#ye}resolve(r){if(!r){return this}const i=this.getRootString(r);const s=r.substring(i.length);const a=s.split(this.splitSep);const l=i?this.getRoot(i).#we(a):this.#we(a);return l}#we(r){let i=this;for(const s of r){i=i.child(s)}return i}children(){const r=this.#ye.get(this);if(r){return r}const i=Object.assign([],{provisional:0});this.#ye.set(this,i);this.#ge&=~D;return i}child(r,i){if(r===""||r==="."){return this}if(r===".."){return this.parent||this}const s=this.children();const a=this.nocase?normalizeNocase(r):normalize(r);for(const r of s){if(r.#pe===a){return r}}const l=this.parent?this.sep:"";const c=this.#Ae?this.#Ae+l+r:undefined;const d=this.newChild(r,I,{...i,parent:this,fullpath:c});if(!this.canReaddir()){d.#ge|=L}s.push(d);return d}relative(){if(this.#me!==undefined){return this.#me}const r=this.name;const i=this.parent;if(!i){return this.#me=this.name}const s=i.relative();return s+(!s||!i.parent?"":this.sep)+r}relativePosix(){if(this.sep==="/")return this.relative();if(this.#he!==undefined)return this.#he;const r=this.name;const i=this.parent;if(!i){return this.#he=this.fullpathPosix()}const s=i.relativePosix();return s+(!s||!i.parent?"":"/")+r}fullpath(){if(this.#Ae!==undefined){return this.#Ae}const r=this.name;const i=this.parent;if(!i){return this.#Ae=this.name}const s=i.fullpath();const a=s+(!i.parent?"":this.sep)+r;return this.#Ae=a}fullpathPosix(){if(this.#fe!==undefined)return this.#fe;if(this.sep==="/")return this.#fe=this.fullpath();if(!this.parent){const r=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(r)){return this.#fe=`//?/${r}`}else{return this.#fe=r}}const r=this.parent;const i=r.fullpathPosix();const s=i+(!i||!r.parent?"":"/")+this.name;return this.#fe=s}isUnknown(){return(this.#ge&T)===I}isType(r){return this[`is${r}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#ge&T)===Q}isDirectory(){return(this.#ge&T)===x}isCharacterDevice(){return(this.#ge&T)===S}isBlockDevice(){return(this.#ge&T)===R}isFIFO(){return(this.#ge&T)===B}isSocket(){return(this.#ge&T)===N}isSymbolicLink(){return(this.#ge&_)===_}lstatCached(){return this.#ge&P?this:undefined}readlinkCached(){return this.#be}realpathCached(){return this.#Ee}readdirCached(){const r=this.children();return r.slice(0,r.provisional)}canReadlink(){if(this.#be)return true;if(!this.parent)return false;const r=this.#ge&T;return!(r!==I&&r!==_||this.#ge&M||this.#ge&L)}calledReaddir(){return!!(this.#ge&D)}isENOENT(){return!!(this.#ge&L)}isNamed(r){return!this.nocase?this.#pe===normalize(r):this.#pe===normalizeNocase(r)}async readlink(){const r=this.#be;if(r){return r}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const r=await this.#V.promises.readlink(this.fullpath());const i=this.parent.resolve(r);if(i){return this.#be=i}}catch(r){this.#Ce(r.code);return undefined}}readlinkSync(){const r=this.#be;if(r){return r}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const r=this.#V.readlinkSync(this.fullpath());const i=this.parent.resolve(r);if(i){return this.#be=i}}catch(r){this.#Ce(r.code);return undefined}}#ve(r){this.#ge|=D;for(let i=r.provisional;ii(null,r)))}readdirCB(r,i=false){if(!this.canReaddir()){if(i)r(null,[]);else queueMicrotask((()=>r(null,[])));return}const s=this.children();if(this.calledReaddir()){const a=s.slice(0,s.provisional);if(i)r(null,a);else queueMicrotask((()=>r(null,a)));return}this.#Pe.push(r);if(this.#Oe){return}this.#Oe=true;const a=this.fullpath();this.#V.readdir(a,{withFileTypes:true},((r,i)=>{if(r){this.#Re(r.code);s.provisional=0}else{for(const r of i){this.#_e(r,s)}this.#ve(s)}this.#Le(s.slice(0,s.provisional));return}))}#Me;async readdir(){if(!this.canReaddir()){return[]}const r=this.children();if(this.calledReaddir()){return r.slice(0,r.provisional)}const i=this.fullpath();if(this.#Me){await this.#Me}else{let resolve=()=>{};this.#Me=new Promise((r=>resolve=r));try{for(const s of await this.#V.promises.readdir(i,{withFileTypes:true})){this.#_e(s,r)}this.#ve(r)}catch(i){this.#Re(i.code);r.provisional=0}this.#Me=undefined;resolve()}return r.slice(0,r.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const r=this.children();if(this.calledReaddir()){return r.slice(0,r.provisional)}const i=this.fullpath();try{for(const s of this.#V.readdirSync(i,{withFileTypes:true})){this.#_e(s,r)}this.#ve(r)}catch(i){this.#Re(i.code);r.provisional=0}return r.slice(0,r.provisional)}canReaddir(){if(this.#ge&j)return false;const r=T&this.#ge;if(!(r===I||r===x||r===_)){return false}return true}shouldWalk(r,i){return(this.#ge&x)===x&&!(this.#ge&j)&&!r.has(this)&&(!i||i(this))}async realpath(){if(this.#Ee)return this.#Ee;if((U|M|L)&this.#ge)return undefined;try{const r=await this.#V.promises.realpath(this.fullpath());return this.#Ee=this.resolve(r)}catch(r){this.#Se()}}realpathSync(){if(this.#Ee)return this.#Ee;if((U|M|L)&this.#ge)return undefined;try{const r=this.#V.realpathSync(this.fullpath());return this.#Ee=this.resolve(r)}catch(r){this.#Se()}}[z](r){if(r===this)return;const i=new Set([]);let s=[];let a=this;while(a&&a.parent){i.add(a);a.#me=s.join(this.sep);a.#he=s.join("/");a=a.parent;s.push("..")}a=r;while(a&&a.parent&&!i.has(a)){a.#me=undefined;a.#he=undefined;a=a.parent}}}i.PathBase=PathBase;class PathWin32 extends PathBase{sep="\\";splitSep=v;constructor(r,i=I,s,a,l,c,d){super(r,i,s,a,l,c,d)}newChild(r,i=I,s={}){return new PathWin32(r,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(r){return p.win32.parse(r).root}getRoot(r){r=uncToDrive(r.toUpperCase());if(r===this.root.name){return this.root}for(const[i,s]of Object.entries(this.roots)){if(this.sameRoot(r,i)){return this.roots[r]=s}}return this.roots[r]=new PathScurryWin32(r,this).root}sameRoot(r,i=this.root.name){r=r.toUpperCase().replace(/\//g,"\\").replace(C,"$1\\");return r===i}}i.PathWin32=PathWin32;class PathPosix extends PathBase{splitSep="/";sep="/";constructor(r,i=I,s,a,l,c,d){super(r,i,s,a,l,c,d)}getRootString(r){return r.startsWith("/")?"/":""}getRoot(r){return this.root}newChild(r,i=I,s={}){return new PathPosix(r,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}}i.PathPosix=PathPosix;class PathScurryBase{root;rootPath;roots;cwd;#Fe;#Ue;#ye;nocase;#V;constructor(r=process.cwd(),i,s,{nocase:a,childrenCacheSize:l=16*1024,fs:c=w}={}){this.#V=fsFromOption(c);if(r instanceof URL||r.startsWith("file://")){r=(0,u.fileURLToPath)(r)}const d=i.resolve(r);this.roots=Object.create(null);this.rootPath=this.parseRootPath(d);this.#Fe=new ResolveCache;this.#Ue=new ResolveCache;this.#ye=new ChildrenCache(l);const p=d.substring(this.rootPath.length).split(s);if(p.length===1&&!p[0]){p.pop()}if(a===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=a;this.root=this.newRoot(this.#V);this.roots[this.rootPath]=this.root;let A=this.root;let h=p.length-1;const g=i.sep;let y=this.rootPath;let b=false;for(const r of p){const i=h--;A=A.child(r,{relative:new Array(i).fill("..").join(g),relativePosix:new Array(i).fill("..").join("/"),fullpath:y+=(b?"":g)+r});b=true}this.cwd=A}depth(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.depth()}childrenCache(){return this.#ye}resolve(...r){let i="";for(let s=r.length-1;s>=0;s--){const a=r[s];if(!a||a===".")continue;i=i?`${a}/${i}`:a;if(this.isAbsolute(a)){break}}const s=this.#Fe.get(i);if(s!==undefined){return s}const a=this.cwd.resolve(i).fullpath();this.#Fe.set(i,a);return a}resolvePosix(...r){let i="";for(let s=r.length-1;s>=0;s--){const a=r[s];if(!a||a===".")continue;i=i?`${a}/${i}`:a;if(this.isAbsolute(a)){break}}const s=this.#Ue.get(i);if(s!==undefined){return s}const a=this.cwd.resolve(i).fullpathPosix();this.#Ue.set(i,a);return a}relative(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.relative()}relativePosix(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.relativePosix()}basename(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.name}dirname(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return(r.parent||r).fullpath()}async readdir(r=this.cwd,i={withFileTypes:true}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s}=i;if(!r.canReaddir()){return[]}else{const i=await r.readdir();return s?i:i.map((r=>r.name))}}readdirSync(r=this.cwd,i={withFileTypes:true}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s=true}=i;if(!r.canReaddir()){return[]}else if(s){return r.readdirSync()}else{return r.readdirSync().map((r=>r.name))}}async lstat(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.lstat()}lstatSync(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.lstatSync()}async readlink(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const s=await r.readlink();return i?s:s?.fullpath()}readlinkSync(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const s=r.readlinkSync();return i?s:s?.fullpath()}async realpath(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const s=await r.realpath();return i?s:s?.fullpath()}realpathSync(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const s=r.realpathSync();return i?s:s?.fullpath()}async walk(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s=true,follow:a=false,filter:l,walkFilter:c}=i;const d=[];if(!l||l(r)){d.push(s?r:r.fullpath())}const p=new Set;const walk=(r,i)=>{p.add(r);r.readdirCB(((r,u)=>{if(r){return i(r)}let A=u.length;if(!A)return i();const next=()=>{if(--A===0){i()}};for(const r of u){if(!l||l(r)){d.push(s?r:r.fullpath())}if(a&&r.isSymbolicLink()){r.realpath().then((r=>r?.isUnknown()?r.lstat():r)).then((r=>r?.shouldWalk(p,c)?walk(r,next):next()))}else{if(r.shouldWalk(p,c)){walk(r,next)}else{next()}}}}),true)};const u=r;return new Promise(((r,i)=>{walk(u,(s=>{if(s)return i(s);r(d)}))}))}walkSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s=true,follow:a=false,filter:l,walkFilter:c}=i;const d=[];if(!l||l(r)){d.push(s?r:r.fullpath())}const p=new Set([r]);for(const r of p){const i=r.readdirSync();for(const r of i){if(!l||l(r)){d.push(s?r:r.fullpath())}let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(p,c)){p.add(i)}}}return d}[Symbol.asyncIterator](){return this.iterate()}iterate(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}return this.stream(r,i)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s=true,follow:a=false,filter:l,walkFilter:c}=i;if(!l||l(r)){yield s?r:r.fullpath()}const d=new Set([r]);for(const r of d){const i=r.readdirSync();for(const r of i){if(!l||l(r)){yield s?r:r.fullpath()}let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(d,c)){d.add(i)}}}}stream(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s=true,follow:a=false,filter:l,walkFilter:c}=i;const d=new b.Minipass({objectMode:true});if(!l||l(r)){d.write(s?r:r.fullpath())}const p=new Set;const u=[r];let A=0;const process=()=>{let r=false;while(!r){const i=u.shift();if(!i){if(A===0)d.end();return}A++;p.add(i);const onReaddir=(i,g,y=false)=>{if(i)return d.emit("error",i);if(a&&!y){const r=[];for(const i of g){if(i.isSymbolicLink()){r.push(i.realpath().then((r=>r?.isUnknown()?r.lstat():r)))}}if(r.length){Promise.all(r).then((()=>onReaddir(null,g,true)));return}}for(const i of g){if(i&&(!l||l(i))){if(!d.write(s?i:i.fullpath())){r=true}}}A--;for(const r of g){const i=r.realpathCached()||r;if(i.shouldWalk(p,c)){u.push(i)}}if(r&&!d.flowing){d.once("drain",process)}else if(!h){process()}};let h=true;i.readdirCB(onReaddir,true);h=false}};process();return d}streamSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:s=true,follow:a=false,filter:l,walkFilter:c}=i;const d=new b.Minipass({objectMode:true});const p=new Set;if(!l||l(r)){d.write(s?r:r.fullpath())}const u=[r];let A=0;const process=()=>{let r=false;while(!r){const i=u.shift();if(!i){if(A===0)d.end();return}A++;p.add(i);const h=i.readdirSync();for(const i of h){if(!l||l(i)){if(!d.write(s?i:i.fullpath())){r=true}}}A--;for(const r of h){let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(p,c)){u.push(i)}}}if(r&&!d.flowing)d.once("drain",process)};process();return d}chdir(r=this.cwd){const i=this.cwd;this.cwd=typeof r==="string"?this.cwd.resolve(r):r;this.cwd[z](i)}}i.PathScurryBase=PathScurryBase;class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(r=process.cwd(),i={}){const{nocase:s=true}=i;super(r,p.win32,"\\",{...i,nocase:s});this.nocase=s;for(let r=this.cwd;r;r=r.parent){r.nocase=this.nocase}}parseRootPath(r){return p.win32.parse(r).root.toUpperCase()}newRoot(r){return new PathWin32(this.rootPath,x,undefined,this.roots,this.nocase,this.childrenCache(),{fs:r})}isAbsolute(r){return r.startsWith("/")||r.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(r)}}i.PathScurryWin32=PathScurryWin32;class PathScurryPosix extends PathScurryBase{sep="/";constructor(r=process.cwd(),i={}){const{nocase:s=false}=i;super(r,p.posix,"/",{...i,nocase:s});this.nocase=s}parseRootPath(r){return"/"}newRoot(r){return new PathPosix(this.rootPath,x,undefined,this.roots,this.nocase,this.childrenCache(),{fs:r})}isAbsolute(r){return r.startsWith("/")}}i.PathScurryPosix=PathScurryPosix;class PathScurryDarwin extends PathScurryPosix{constructor(r=process.cwd(),i={}){const{nocase:s=true}=i;super(r,{...i,nocase:s})}}i.PathScurryDarwin=PathScurryDarwin;i.Path=process.platform==="win32"?PathWin32:PathPosix;i.PathScurry=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix},87637:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.LRUCache=void 0;const s=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const a=new Set;const l=typeof process==="object"&&!!process?process:{};const emitWarning=(r,i,s,a)=>{typeof l.emitWarning==="function"?l.emitWarning(r,i,s,a):console.error(`[${s}] ${i}: ${r}`)};let c=globalThis.AbortController;let d=globalThis.AbortSignal;if(typeof c==="undefined"){d=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(r,i){this._onabort.push(i)}};c=class AbortController{constructor(){warnACPolyfill()}signal=new d;abort(r){if(this.signal.aborted)return;this.signal.reason=r;this.signal.aborted=true;for(const i of this.signal._onabort){i(r)}this.signal.onabort?.(r)}};let r=l.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!r)return;r=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=r=>!a.has(r);const p=Symbol("type");const isPosInt=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r);const getUintArray=r=>!isPosInt(r)?null:r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(r){super(r);this.fill(0)}}class Stack{heap;length;static#je=false;static create(r){const i=getUintArray(r);if(!i)return[];Stack.#je=true;const s=new Stack(r,i);Stack.#je=false;return s}constructor(r,i){if(!Stack.#je){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new i(r);this.length=0}push(r){this.heap[this.length++]=r}pop(){return this.heap[--this.length]}}class LRUCache{#He;#qe;#Ge;#ze;#Ve;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#te;#We;#Ye;#Je;#$e;#Xe;#Ke;#Ze;#et;#tt;#rt;#nt;#it;#st;#at;#ot;#lt;static unsafeExposeInternals(r){return{starts:r.#it,ttls:r.#st,sizes:r.#nt,keyMap:r.#Ye,keyList:r.#Je,valList:r.#$e,next:r.#Xe,prev:r.#Ke,get head(){return r.#Ze},get tail(){return r.#et},free:r.#tt,isBackgroundFetch:i=>r.#ct(i),backgroundFetch:(i,s,a,l)=>r.#dt(i,s,a,l),moveToTail:i=>r.#pt(i),indexes:i=>r.#ut(i),rindexes:i=>r.#At(i),isStale:i=>r.#ft(i)}}get max(){return this.#He}get maxSize(){return this.#qe}get calculatedSize(){return this.#We}get size(){return this.#te}get fetchMethod(){return this.#Ve}get dispose(){return this.#Ge}get disposeAfter(){return this.#ze}constructor(r){const{max:i=0,ttl:s,ttlResolution:l=1,ttlAutopurge:c,updateAgeOnGet:d,updateAgeOnHas:p,allowStale:u,dispose:A,disposeAfter:h,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:C,fetchMethod:v,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:B,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:x,ignoreFetchAbort:R}=r;if(i!==0&&!isPosInt(i)){throw new TypeError("max option must be a nonnegative integer")}const Q=i?getUintArray(i):Array;if(!Q){throw new Error("invalid max value: "+i)}this.#He=i;this.#qe=b;this.maxEntrySize=w||this.#qe;this.sizeCalculation=C;if(this.sizeCalculation){if(!this.#qe&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(v!==undefined&&typeof v!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#Ve=v;this.#ot=!!v;this.#Ye=new Map;this.#Je=new Array(i).fill(undefined);this.#$e=new Array(i).fill(undefined);this.#Xe=new Q(i);this.#Ke=new Q(i);this.#Ze=0;this.#et=0;this.#tt=Stack.create(i);this.#te=0;this.#We=0;if(typeof A==="function"){this.#Ge=A}if(typeof h==="function"){this.#ze=h;this.#rt=[]}else{this.#ze=undefined;this.#rt=undefined}this.#at=!!this.#Ge;this.#lt=!!this.#ze;this.noDisposeOnSet=!!g;this.noUpdateTTL=!!y;this.noDeleteOnFetchRejection=!!I;this.allowStaleOnFetchRejection=!!S;this.allowStaleOnFetchAbort=!!x;this.ignoreFetchAbort=!!R;if(this.maxEntrySize!==0){if(this.#qe!==0){if(!isPosInt(this.#qe)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#mt()}this.allowStale=!!u;this.noDeleteOnStaleGet=!!B;this.updateAgeOnGet=!!d;this.updateAgeOnHas=!!p;this.ttlResolution=isPosInt(l)||l===0?l:1;this.ttlAutopurge=!!c;this.ttl=s||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#ht()}if(this.#He===0&&this.ttl===0&&this.#qe===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#He&&!this.#qe){const r="LRU_CACHE_UNBOUNDED";if(shouldWarn(r)){a.add(r);const i="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(i,"UnboundedCacheWarning",r,LRUCache)}}}getRemainingTTL(r){return this.#Ye.has(r)?Infinity:0}#ht(){const r=new ZeroArray(this.#He);const i=new ZeroArray(this.#He);this.#st=r;this.#it=i;this.#gt=(a,l,c=s.now())=>{i[a]=l!==0?c:0;r[a]=l;if(l!==0&&this.ttlAutopurge){const r=setTimeout((()=>{if(this.#ft(a)){this.delete(this.#Je[a])}}),l+1);if(r.unref){r.unref()}}};this.#yt=a=>{i[a]=r[a]!==0?s.now():0};this.#bt=(s,l)=>{if(r[l]){const c=r[l];const d=i[l];if(!c||!d)return;s.ttl=c;s.start=d;s.now=a||getNow();const p=s.now-d;s.remainingTTL=c-p}};let a=0;const getNow=()=>{const r=s.now();if(this.ttlResolution>0){a=r;const i=setTimeout((()=>a=0),this.ttlResolution);if(i.unref){i.unref()}}return r};this.getRemainingTTL=s=>{const l=this.#Ye.get(s);if(l===undefined){return 0}const c=r[l];const d=i[l];if(!c||!d){return Infinity}const p=(a||getNow())-d;return c-p};this.#ft=s=>{const l=i[s];const c=r[s];return!!c&&!!l&&(a||getNow())-l>c}}#yt=()=>{};#bt=()=>{};#gt=()=>{};#ft=()=>false;#mt(){const r=new ZeroArray(this.#He);this.#We=0;this.#nt=r;this.#Et=i=>{this.#We-=r[i];r[i]=0};this.#wt=(r,i,s,a)=>{if(this.#ct(i)){return 0}if(!isPosInt(s)){if(a){if(typeof a!=="function"){throw new TypeError("sizeCalculation must be a function")}s=a(i,r);if(!isPosInt(s)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return s};this.#Ct=(i,s,a)=>{r[i]=s;if(this.#qe){const s=this.#qe-r[i];while(this.#We>s){this.#vt(true)}}this.#We+=r[i];if(a){a.entrySize=s;a.totalCalculatedSize=this.#We}}}#Et=r=>{};#Ct=(r,i,s)=>{};#wt=(r,i,s,a)=>{if(s||a){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#ut({allowStale:r=this.allowStale}={}){if(this.#te){for(let i=this.#et;true;){if(!this.#It(i)){break}if(r||!this.#ft(i)){yield i}if(i===this.#Ze){break}else{i=this.#Ke[i]}}}}*#At({allowStale:r=this.allowStale}={}){if(this.#te){for(let i=this.#Ze;true;){if(!this.#It(i)){break}if(r||!this.#ft(i)){yield i}if(i===this.#et){break}else{i=this.#Xe[i]}}}}#It(r){return r!==undefined&&this.#Ye.get(this.#Je[r])===r}*entries(){for(const r of this.#ut()){if(this.#$e[r]!==undefined&&this.#Je[r]!==undefined&&!this.#ct(this.#$e[r])){yield[this.#Je[r],this.#$e[r]]}}}*rentries(){for(const r of this.#At()){if(this.#$e[r]!==undefined&&this.#Je[r]!==undefined&&!this.#ct(this.#$e[r])){yield[this.#Je[r],this.#$e[r]]}}}*keys(){for(const r of this.#ut()){const i=this.#Je[r];if(i!==undefined&&!this.#ct(this.#$e[r])){yield i}}}*rkeys(){for(const r of this.#At()){const i=this.#Je[r];if(i!==undefined&&!this.#ct(this.#$e[r])){yield i}}}*values(){for(const r of this.#ut()){const i=this.#$e[r];if(i!==undefined&&!this.#ct(this.#$e[r])){yield this.#$e[r]}}}*rvalues(){for(const r of this.#At()){const i=this.#$e[r];if(i!==undefined&&!this.#ct(this.#$e[r])){yield this.#$e[r]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(r,i={}){for(const s of this.#ut()){const a=this.#$e[s];const l=this.#ct(a)?a.__staleWhileFetching:a;if(l===undefined)continue;if(r(l,this.#Je[s],this)){return this.get(this.#Je[s],i)}}}forEach(r,i=this){for(const s of this.#ut()){const a=this.#$e[s];const l=this.#ct(a)?a.__staleWhileFetching:a;if(l===undefined)continue;r.call(i,l,this.#Je[s],this)}}rforEach(r,i=this){for(const s of this.#At()){const a=this.#$e[s];const l=this.#ct(a)?a.__staleWhileFetching:a;if(l===undefined)continue;r.call(i,l,this.#Je[s],this)}}purgeStale(){let r=false;for(const i of this.#At({allowStale:true})){if(this.#ft(i)){this.delete(this.#Je[i]);r=true}}return r}info(r){const i=this.#Ye.get(r);if(i===undefined)return undefined;const a=this.#$e[i];const l=this.#ct(a)?a.__staleWhileFetching:a;if(l===undefined)return undefined;const c={value:l};if(this.#st&&this.#it){const r=this.#st[i];const a=this.#it[i];if(r&&a){const i=r-(s.now()-a);c.ttl=i;c.start=Date.now()}}if(this.#nt){c.size=this.#nt[i]}return c}dump(){const r=[];for(const i of this.#ut({allowStale:true})){const a=this.#Je[i];const l=this.#$e[i];const c=this.#ct(l)?l.__staleWhileFetching:l;if(c===undefined||a===undefined)continue;const d={value:c};if(this.#st&&this.#it){d.ttl=this.#st[i];const r=s.now()-this.#it[i];d.start=Math.floor(Date.now()-r)}if(this.#nt){d.size=this.#nt[i]}r.unshift([a,d])}return r}load(r){this.clear();for(const[i,a]of r){if(a.start){const r=Date.now()-a.start;a.start=s.now()-r}this.set(i,a.value,a)}}set(r,i,s={}){if(i===undefined){this.delete(r);return this}const{ttl:a=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=s;let{noUpdateTTL:u=this.noUpdateTTL}=s;const A=this.#wt(r,i,s.size||0,d);if(this.maxEntrySize&&A>this.maxEntrySize){if(p){p.set="miss";p.maxEntrySizeExceeded=true}this.delete(r);return this}let h=this.#te===0?undefined:this.#Ye.get(r);if(h===undefined){h=this.#te===0?this.#et:this.#tt.length!==0?this.#tt.pop():this.#te===this.#He?this.#vt(false):this.#te;this.#Je[h]=r;this.#$e[h]=i;this.#Ye.set(r,h);this.#Xe[this.#et]=h;this.#Ke[h]=this.#et;this.#et=h;this.#te++;this.#Ct(h,A,p);if(p)p.set="add";u=false}else{this.#pt(h);const s=this.#$e[h];if(i!==s){if(this.#ot&&this.#ct(s)){s.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:i}=s;if(i!==undefined&&!c){if(this.#at){this.#Ge?.(i,r,"set")}if(this.#lt){this.#rt?.push([i,r,"set"])}}}else if(!c){if(this.#at){this.#Ge?.(s,r,"set")}if(this.#lt){this.#rt?.push([s,r,"set"])}}this.#Et(h);this.#Ct(h,A,p);this.#$e[h]=i;if(p){p.set="replace";const r=s&&this.#ct(s)?s.__staleWhileFetching:s;if(r!==undefined)p.oldValue=r}}else if(p){p.set="update"}}if(a!==0&&!this.#st){this.#ht()}if(this.#st){if(!u){this.#gt(h,a,l)}if(p)this.#bt(p,h)}if(!c&&this.#lt&&this.#rt){const r=this.#rt;let i;while(i=r?.shift()){this.#ze?.(...i)}}return this}pop(){try{while(this.#te){const r=this.#$e[this.#Ze];this.#vt(true);if(this.#ct(r)){if(r.__staleWhileFetching){return r.__staleWhileFetching}}else if(r!==undefined){return r}}}finally{if(this.#lt&&this.#rt){const r=this.#rt;let i;while(i=r?.shift()){this.#ze?.(...i)}}}}#vt(r){const i=this.#Ze;const s=this.#Je[i];const a=this.#$e[i];if(this.#ot&&this.#ct(a)){a.__abortController.abort(new Error("evicted"))}else if(this.#at||this.#lt){if(this.#at){this.#Ge?.(a,s,"evict")}if(this.#lt){this.#rt?.push([a,s,"evict"])}}this.#Et(i);if(r){this.#Je[i]=undefined;this.#$e[i]=undefined;this.#tt.push(i)}if(this.#te===1){this.#Ze=this.#et=0;this.#tt.length=0}else{this.#Ze=this.#Xe[i]}this.#Ye.delete(s);this.#te--;return i}has(r,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=i;const l=this.#Ye.get(r);if(l!==undefined){const r=this.#$e[l];if(this.#ct(r)&&r.__staleWhileFetching===undefined){return false}if(!this.#ft(l)){if(s){this.#yt(l)}if(a){a.has="hit";this.#bt(a,l)}return true}else if(a){a.has="stale";this.#bt(a,l)}}else if(a){a.has="miss"}return false}peek(r,i={}){const{allowStale:s=this.allowStale}=i;const a=this.#Ye.get(r);if(a===undefined||!s&&this.#ft(a)){return}const l=this.#$e[a];return this.#ct(l)?l.__staleWhileFetching:l}#dt(r,i,s,a){const l=i===undefined?undefined:this.#$e[i];if(this.#ct(l)){return l}const d=new c;const{signal:p}=s;p?.addEventListener("abort",(()=>d.abort(p.reason)),{signal:d.signal});const u={signal:d.signal,options:s,context:a};const cb=(a,l=false)=>{const{aborted:c}=d.signal;const p=s.ignoreFetchAbort&&a!==undefined;if(s.status){if(c&&!l){s.status.fetchAborted=true;s.status.fetchError=d.signal.reason;if(p)s.status.fetchAbortIgnored=true}else{s.status.fetchResolved=true}}if(c&&!p&&!l){return fetchFail(d.signal.reason)}const h=A;if(this.#$e[i]===A){if(a===undefined){if(h.__staleWhileFetching){this.#$e[i]=h.__staleWhileFetching}else{this.delete(r)}}else{if(s.status)s.status.fetchUpdated=true;this.set(r,a,u.options)}}return a};const eb=r=>{if(s.status){s.status.fetchRejected=true;s.status.fetchError=r}return fetchFail(r)};const fetchFail=a=>{const{aborted:l}=d.signal;const c=l&&s.allowStaleOnFetchAbort;const p=c||s.allowStaleOnFetchRejection;const u=p||s.noDeleteOnFetchRejection;const h=A;if(this.#$e[i]===A){const s=!u||h.__staleWhileFetching===undefined;if(s){this.delete(r)}else if(!c){this.#$e[i]=h.__staleWhileFetching}}if(p){if(s.status&&h.__staleWhileFetching!==undefined){s.status.returnedStale=true}return h.__staleWhileFetching}else if(h.__returned===h){throw a}};const pcall=(i,a)=>{const c=this.#Ve?.(r,l,u);if(c&&c instanceof Promise){c.then((r=>i(r===undefined?undefined:r)),a)}d.signal.addEventListener("abort",(()=>{if(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort){i(undefined);if(s.allowStaleOnFetchAbort){i=r=>cb(r,true)}}}))};if(s.status)s.status.fetchDispatched=true;const A=new Promise(pcall).then(cb,eb);const h=Object.assign(A,{__abortController:d,__staleWhileFetching:l,__returned:undefined});if(i===undefined){this.set(r,h,{...u.options,status:undefined});i=this.#Ye.get(r)}else{this.#$e[i]=h}return h}#ct(r){if(!this.#ot)return false;const i=r;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof c}async fetch(r,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:A=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:w,forceRefresh:C=false,status:v,signal:I}=i;if(!this.#ot){if(v)v.fetch="get";return this.get(r,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:l,status:v})}const B={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:u,noUpdateTTL:A,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:b,ignoreFetchAbort:y,status:v,signal:I};let S=this.#Ye.get(r);if(S===undefined){if(v)v.fetch="miss";const i=this.#dt(r,S,B,w);return i.__returned=i}else{const i=this.#$e[S];if(this.#ct(i)){const r=s&&i.__staleWhileFetching!==undefined;if(v){v.fetch="inflight";if(r)v.returnedStale=true}return r?i.__staleWhileFetching:i.__returned=i}const l=this.#ft(S);if(!C&&!l){if(v)v.fetch="hit";this.#pt(S);if(a){this.#yt(S)}if(v)this.#bt(v,S);return i}const c=this.#dt(r,S,B,w);const d=c.__staleWhileFetching!==undefined;const p=d&&s;if(v){v.fetch=l?"stale":"refresh";if(p&&l)v.returnedStale=true}return p?c.__staleWhileFetching:c.__returned=c}}get(r,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=i;const d=this.#Ye.get(r);if(d!==undefined){const i=this.#$e[d];const p=this.#ct(i);if(c)this.#bt(c,d);if(this.#ft(d)){if(c)c.get="stale";if(!p){if(!l){this.delete(r)}if(c&&s)c.returnedStale=true;return s?i:undefined}else{if(c&&s&&i.__staleWhileFetching!==undefined){c.returnedStale=true}return s?i.__staleWhileFetching:undefined}}else{if(c)c.get="hit";if(p){return i.__staleWhileFetching}this.#pt(d);if(a){this.#yt(d)}return i}}else if(c){c.get="miss"}}#Bt(r,i){this.#Ke[i]=r;this.#Xe[r]=i}#pt(r){if(r!==this.#et){if(r===this.#Ze){this.#Ze=this.#Xe[r]}else{this.#Bt(this.#Ke[r],this.#Xe[r])}this.#Bt(this.#et,r);this.#et=r}}delete(r){let i=false;if(this.#te!==0){const s=this.#Ye.get(r);if(s!==undefined){i=true;if(this.#te===1){this.clear()}else{this.#Et(s);const i=this.#$e[s];if(this.#ct(i)){i.__abortController.abort(new Error("deleted"))}else if(this.#at||this.#lt){if(this.#at){this.#Ge?.(i,r,"delete")}if(this.#lt){this.#rt?.push([i,r,"delete"])}}this.#Ye.delete(r);this.#Je[s]=undefined;this.#$e[s]=undefined;if(s===this.#et){this.#et=this.#Ke[s]}else if(s===this.#Ze){this.#Ze=this.#Xe[s]}else{const r=this.#Ke[s];this.#Xe[r]=this.#Xe[s];const i=this.#Xe[s];this.#Ke[i]=this.#Ke[s]}this.#te--;this.#tt.push(s)}}}if(this.#lt&&this.#rt?.length){const r=this.#rt;let i;while(i=r?.shift()){this.#ze?.(...i)}}return i}clear(){for(const r of this.#At({allowStale:true})){const i=this.#$e[r];if(this.#ct(i)){i.__abortController.abort(new Error("deleted"))}else{const s=this.#Je[r];if(this.#at){this.#Ge?.(i,s,"delete")}if(this.#lt){this.#rt?.push([i,s,"delete"])}}}this.#Ye.clear();this.#$e.fill(undefined);this.#Je.fill(undefined);if(this.#st&&this.#it){this.#st.fill(0);this.#it.fill(0)}if(this.#nt){this.#nt.fill(0)}this.#Ze=0;this.#et=0;this.#tt.length=0;this.#We=0;this.#te=0;if(this.#lt&&this.#rt){const r=this.#rt;let i;while(i=r?.shift()){this.#ze?.(...i)}}}}i.LRUCache=LRUCache},57005:function(r,i,s){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Minipass=i.isWritable=i.isReadable=i.isStream=void 0;const l=typeof process==="object"&&process?process:{stdout:null,stderr:null};const c=s(82361);const d=a(s(12781));const p=s(71576);const isStream=r=>!!r&&typeof r==="object"&&(r instanceof Minipass||r instanceof d.default||(0,i.isReadable)(r)||(0,i.isWritable)(r));i.isStream=isStream;const isReadable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.pipe==="function"&&r.pipe!==d.default.Writable.prototype.pipe;i.isReadable=isReadable;const isWritable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.write==="function"&&typeof r.end==="function";i.isWritable=isWritable;const u=Symbol("EOF");const A=Symbol("maybeEmitEnd");const h=Symbol("emittedEnd");const g=Symbol("emittingEnd");const y=Symbol("emittedError");const b=Symbol("closed");const w=Symbol("read");const C=Symbol("flush");const v=Symbol("flushChunk");const I=Symbol("encoding");const B=Symbol("decoder");const S=Symbol("flowing");const x=Symbol("paused");const R=Symbol("resume");const Q=Symbol("buffer");const _=Symbol("pipes");const N=Symbol("bufferLength");const T=Symbol("bufferPush");const k=Symbol("bufferShift");const D=Symbol("objectMode");const P=Symbol("destroyed");const O=Symbol("error");const L=Symbol("emitData");const M=Symbol("emitEnd");const U=Symbol("emitEnd2");const j=Symbol("async");const H=Symbol("abort");const q=Symbol("aborted");const G=Symbol("signal");const z=Symbol("dataListeners");const V=Symbol("discarded");const defer=r=>Promise.resolve().then(r);const nodefer=r=>r();const isEndish=r=>r==="end"||r==="finish"||r==="prefinish";const isArrayBufferLike=r=>r instanceof ArrayBuffer||!!r&&typeof r==="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0;const isArrayBufferView=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);class Pipe{src;dest;opts;ondrain;constructor(r,i,s){this.src=r;this.dest=i;this.opts=s;this.ondrain=()=>r[R]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(r){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(r,i,s){super(r,i,s);this.proxyErrors=r=>i.emit("error",r);r.on("error",this.proxyErrors)}}const isObjectModeOptions=r=>!!r.objectMode;const isEncodingOptions=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer";class Minipass extends c.EventEmitter{[S]=false;[x]=false;[_]=[];[Q]=[];[D];[I];[j];[B];[u]=false;[h]=false;[g]=false;[b]=false;[y]=null;[N]=0;[P]=false;[G];[q]=false;[z]=0;[V]=false;writable=true;readable=true;constructor(...r){const i=r[0]||{};super();if(i.objectMode&&typeof i.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(i)){this[D]=true;this[I]=null}else if(isEncodingOptions(i)){this[I]=i.encoding;this[D]=false}else{this[D]=false;this[I]=null}this[j]=!!i.async;this[B]=this[I]?new p.StringDecoder(this[I]):null;if(i&&i.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[Q]})}if(i&&i.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[_]})}const{signal:s}=i;if(s){this[G]=s;if(s.aborted){this[H]()}else{s.addEventListener("abort",(()=>this[H]()))}}}get bufferLength(){return this[N]}get encoding(){return this[I]}set encoding(r){throw new Error("Encoding must be set at instantiation time")}setEncoding(r){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[D]}set objectMode(r){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[j]}set["async"](r){this[j]=this[j]||!!r}[H](){this[q]=true;this.emit("abort",this[G]?.reason);this.destroy(this[G]?.reason)}get aborted(){return this[q]}set aborted(r){}write(r,i,s){if(this[q])return false;if(this[u])throw new Error("write after end");if(this[P]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof i==="function"){s=i;i="utf8"}if(!i)i="utf8";const a=this[j]?defer:nodefer;if(!this[D]&&!Buffer.isBuffer(r)){if(isArrayBufferView(r)){r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(isArrayBufferLike(r)){r=Buffer.from(r)}else if(typeof r!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[D]){if(this[S]&&this[N]!==0)this[C](true);if(this[S])this.emit("data",r);else this[T](r);if(this[N]!==0)this.emit("readable");if(s)a(s);return this[S]}if(!r.length){if(this[N]!==0)this.emit("readable");if(s)a(s);return this[S]}if(typeof r==="string"&&!(i===this[I]&&!this[B]?.lastNeed)){r=Buffer.from(r,i)}if(Buffer.isBuffer(r)&&this[I]){r=this[B].write(r)}if(this[S]&&this[N]!==0)this[C](true);if(this[S])this.emit("data",r);else this[T](r);if(this[N]!==0)this.emit("readable");if(s)a(s);return this[S]}read(r){if(this[P])return null;this[V]=false;if(this[N]===0||r===0||r&&r>this[N]){this[A]();return null}if(this[D])r=null;if(this[Q].length>1&&!this[D]){this[Q]=[this[I]?this[Q].join(""):Buffer.concat(this[Q],this[N])]}const i=this[w](r||null,this[Q][0]);this[A]();return i}[w](r,i){if(this[D])this[k]();else{const s=i;if(r===s.length||r===null)this[k]();else if(typeof s==="string"){this[Q][0]=s.slice(r);i=s.slice(0,r);this[N]-=r}else{this[Q][0]=s.subarray(r);i=s.subarray(0,r);this[N]-=r}}this.emit("data",i);if(!this[Q].length&&!this[u])this.emit("drain");return i}end(r,i,s){if(typeof r==="function"){s=r;r=undefined}if(typeof i==="function"){s=i;i="utf8"}if(r!==undefined)this.write(r,i);if(s)this.once("end",s);this[u]=true;this.writable=false;if(this[S]||!this[x])this[A]();return this}[R](){if(this[P])return;if(!this[z]&&!this[_].length){this[V]=true}this[x]=false;this[S]=true;this.emit("resume");if(this[Q].length)this[C]();else if(this[u])this[A]();else this.emit("drain")}resume(){return this[R]()}pause(){this[S]=false;this[x]=true;this[V]=false}get destroyed(){return this[P]}get flowing(){return this[S]}get paused(){return this[x]}[T](r){if(this[D])this[N]+=1;else this[N]+=r.length;this[Q].push(r)}[k](){if(this[D])this[N]-=1;else this[N]-=this[Q][0].length;return this[Q].shift()}[C](r=false){do{}while(this[v](this[k]())&&this[Q].length);if(!r&&!this[Q].length&&!this[u])this.emit("drain")}[v](r){this.emit("data",r);return this[S]}pipe(r,i){if(this[P])return r;this[V]=false;const s=this[h];i=i||{};if(r===l.stdout||r===l.stderr)i.end=false;else i.end=i.end!==false;i.proxyErrors=!!i.proxyErrors;if(s){if(i.end)r.end()}else{this[_].push(!i.proxyErrors?new Pipe(this,r,i):new PipeProxyErrors(this,r,i));if(this[j])defer((()=>this[R]()));else this[R]()}return r}unpipe(r){const i=this[_].find((i=>i.dest===r));if(i){if(this[_].length===1){if(this[S]&&this[z]===0){this[S]=false}this[_]=[]}else this[_].splice(this[_].indexOf(i),1);i.unpipe()}}addListener(r,i){return this.on(r,i)}on(r,i){const s=super.on(r,i);if(r==="data"){this[V]=false;this[z]++;if(!this[_].length&&!this[S]){this[R]()}}else if(r==="readable"&&this[N]!==0){super.emit("readable")}else if(isEndish(r)&&this[h]){super.emit(r);this.removeAllListeners(r)}else if(r==="error"&&this[y]){const r=i;if(this[j])defer((()=>r.call(this,this[y])));else r.call(this,this[y])}return s}removeListener(r,i){return this.off(r,i)}off(r,i){const s=super.off(r,i);if(r==="data"){this[z]=this.listeners("data").length;if(this[z]===0&&!this[V]&&!this[_].length){this[S]=false}}return s}removeAllListeners(r){const i=super.removeAllListeners(r);if(r==="data"||r===undefined){this[z]=0;if(!this[V]&&!this[_].length){this[S]=false}}return i}get emittedEnd(){return this[h]}[A](){if(!this[g]&&!this[h]&&!this[P]&&this[Q].length===0&&this[u]){this[g]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[b])this.emit("close");this[g]=false}}emit(r,...i){const s=i[0];if(r!=="error"&&r!=="close"&&r!==P&&this[P]){return false}else if(r==="data"){return!this[D]&&!s?false:this[j]?(defer((()=>this[L](s))),true):this[L](s)}else if(r==="end"){return this[M]()}else if(r==="close"){this[b]=true;if(!this[h]&&!this[P])return false;const r=super.emit("close");this.removeAllListeners("close");return r}else if(r==="error"){this[y]=s;super.emit(O,s);const r=!this[G]||this.listeners("error").length?super.emit("error",s):false;this[A]();return r}else if(r==="resume"){const r=super.emit("resume");this[A]();return r}else if(r==="finish"||r==="prefinish"){const i=super.emit(r);this.removeAllListeners(r);return i}const a=super.emit(r,...i);this[A]();return a}[L](r){for(const i of this[_]){if(i.dest.write(r)===false)this.pause()}const i=this[V]?false:super.emit("data",r);this[A]();return i}[M](){if(this[h])return false;this[h]=true;this.readable=false;return this[j]?(defer((()=>this[U]())),true):this[U]()}[U](){if(this[B]){const r=this[B].end();if(r){for(const i of this[_]){i.dest.write(r)}if(!this[V])super.emit("data",r)}}for(const r of this[_]){r.end()}const r=super.emit("end");this.removeAllListeners("end");return r}async collect(){const r=Object.assign([],{dataLength:0});if(!this[D])r.dataLength=0;const i=this.promise();this.on("data",(i=>{r.push(i);if(!this[D])r.dataLength+=i.length}));await i;return r}async concat(){if(this[D]){throw new Error("cannot concat in objectMode")}const r=await this.collect();return this[I]?r.join(""):Buffer.concat(r,r.dataLength)}async promise(){return new Promise(((r,i)=>{this.on(P,(()=>i(new Error("stream destroyed"))));this.on("error",(r=>i(r)));this.on("end",(()=>r()))}))}[Symbol.asyncIterator](){this[V]=false;let r=false;const stop=async()=>{this.pause();r=true;return{value:undefined,done:true}};const next=()=>{if(r)return stop();const i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[u])return stop();let s;let a;const onerr=r=>{this.off("data",ondata);this.off("end",onend);this.off(P,ondestroy);stop();a(r)};const ondata=r=>{this.off("error",onerr);this.off("end",onend);this.off(P,ondestroy);this.pause();s({value:r,done:!!this[u]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(P,ondestroy);stop();s({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((r,i)=>{a=i;s=r;this.once(P,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[V]=false;let r=false;const stop=()=>{this.pause();this.off(O,stop);this.off(P,stop);this.off("end",stop);r=true;return{done:true,value:undefined}};const next=()=>{if(r)return stop();const i=this.read();return i===null?stop():{done:false,value:i}};this.once("end",stop);this.once(O,stop);this.once(P,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(r){if(this[P]){if(r)this.emit("error",r);else this.emit(P);return this}this[P]=true;this[V]=true;this[Q].length=0;this[N]=0;const i=this;if(typeof i.close==="function"&&!this[b])i.close();if(r)this.emit("error",r);else this.emit(P);return this}static get isStream(){return i.isStream}}i.Minipass=Minipass},23367:r=>{"use strict";function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r["default"]:r}const i=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function ensureBuffer(r){if(Buffer.isBuffer(r)){return r}if(typeof r==="number"){return Buffer.alloc(r)}else if(typeof r==="string"){return Buffer.from(r)}else{throw new Error("input must be buffer, number, or string, received "+typeof r)}}function bufferizeInt(r){const i=ensureBuffer(4);i.writeInt32BE(r,0);return i}function _crc32(r,s){r=ensureBuffer(r);if(Buffer.isBuffer(s)){s=s.readUInt32BE(0)}let a=~~s^-1;for(var l=0;l>>8}return a^-1}function crc32(){return bufferizeInt(_crc32.apply(null,arguments))}crc32.signed=function(){return _crc32.apply(null,arguments)};crc32.unsigned=function(){return _crc32.apply(null,arguments)>>>0};var s=crc32;const a=getDefaultExportFromCjs(s);r.exports=a},85024:r=>{"use strict";r.exports=JSON.parse('{"name":"@actions/artifact","version":"2.1.7","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","main":"lib/artifact.js","types":"lib/artifact.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/artifact"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"cd ../../ && npm run test ./packages/artifact","bootstrap":"cd ../../ && npm run bootstrap","tsc-run":"tsc","tsc":"npm run bootstrap && npm run tsc-run","gen:docs":"typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.10.0","@actions/github":"^5.1.1","@actions/http-client":"^2.1.0","@azure/storage-blob":"^12.15.0","@octokit/core":"^3.5.1","@octokit/plugin-request-log":"^1.0.4","@octokit/plugin-retry":"^3.0.9","@octokit/request-error":"^5.0.0","@protobuf-ts/plugin":"^2.2.3-alpha.1","archiver":"^7.0.1","crypto":"^1.0.1","jwt-decode":"^3.1.2","twirp-ts":"^2.5.0","unzip-stream":"^0.3.1"},"devDependencies":{"@types/archiver":"^5.3.2","@types/unzip-stream":"^0.3.4","typedoc":"^0.25.4","typedoc-plugin-markdown":"^3.17.1","typescript":"^5.2.2"}}')},79857:r=>{"use strict";r.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')},65441:r=>{"use strict";r.exports=JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"],[[47,47],"disallowed_STD3_valid"],[[48,57],"valid"],[[58,64],"disallowed_STD3_valid"],[[65,65],"mapped",[97]],[[66,66],"mapped",[98]],[[67,67],"mapped",[99]],[[68,68],"mapped",[100]],[[69,69],"mapped",[101]],[[70,70],"mapped",[102]],[[71,71],"mapped",[103]],[[72,72],"mapped",[104]],[[73,73],"mapped",[105]],[[74,74],"mapped",[106]],[[75,75],"mapped",[107]],[[76,76],"mapped",[108]],[[77,77],"mapped",[109]],[[78,78],"mapped",[110]],[[79,79],"mapped",[111]],[[80,80],"mapped",[112]],[[81,81],"mapped",[113]],[[82,82],"mapped",[114]],[[83,83],"mapped",[115]],[[84,84],"mapped",[116]],[[85,85],"mapped",[117]],[[86,86],"mapped",[118]],[[87,87],"mapped",[119]],[[88,88],"mapped",[120]],[[89,89],"mapped",[121]],[[90,90],"mapped",[122]],[[91,96],"disallowed_STD3_valid"],[[97,122],"valid"],[[123,127],"disallowed_STD3_valid"],[[128,159],"disallowed"],[[160,160],"disallowed_STD3_mapped",[32]],[[161,167],"valid",[],"NV8"],[[168,168],"disallowed_STD3_mapped",[32,776]],[[169,169],"valid",[],"NV8"],[[170,170],"mapped",[97]],[[171,172],"valid",[],"NV8"],[[173,173],"ignored"],[[174,174],"valid",[],"NV8"],[[175,175],"disallowed_STD3_mapped",[32,772]],[[176,177],"valid",[],"NV8"],[[178,178],"mapped",[50]],[[179,179],"mapped",[51]],[[180,180],"disallowed_STD3_mapped",[32,769]],[[181,181],"mapped",[956]],[[182,182],"valid",[],"NV8"],[[183,183],"valid"],[[184,184],"disallowed_STD3_mapped",[32,807]],[[185,185],"mapped",[49]],[[186,186],"mapped",[111]],[[187,187],"valid",[],"NV8"],[[188,188],"mapped",[49,8260,52]],[[189,189],"mapped",[49,8260,50]],[[190,190],"mapped",[51,8260,52]],[[191,191],"valid",[],"NV8"],[[192,192],"mapped",[224]],[[193,193],"mapped",[225]],[[194,194],"mapped",[226]],[[195,195],"mapped",[227]],[[196,196],"mapped",[228]],[[197,197],"mapped",[229]],[[198,198],"mapped",[230]],[[199,199],"mapped",[231]],[[200,200],"mapped",[232]],[[201,201],"mapped",[233]],[[202,202],"mapped",[234]],[[203,203],"mapped",[235]],[[204,204],"mapped",[236]],[[205,205],"mapped",[237]],[[206,206],"mapped",[238]],[[207,207],"mapped",[239]],[[208,208],"mapped",[240]],[[209,209],"mapped",[241]],[[210,210],"mapped",[242]],[[211,211],"mapped",[243]],[[212,212],"mapped",[244]],[[213,213],"mapped",[245]],[[214,214],"mapped",[246]],[[215,215],"valid",[],"NV8"],[[216,216],"mapped",[248]],[[217,217],"mapped",[249]],[[218,218],"mapped",[250]],[[219,219],"mapped",[251]],[[220,220],"mapped",[252]],[[221,221],"mapped",[253]],[[222,222],"mapped",[254]],[[223,223],"deviation",[115,115]],[[224,246],"valid"],[[247,247],"valid",[],"NV8"],[[248,255],"valid"],[[256,256],"mapped",[257]],[[257,257],"valid"],[[258,258],"mapped",[259]],[[259,259],"valid"],[[260,260],"mapped",[261]],[[261,261],"valid"],[[262,262],"mapped",[263]],[[263,263],"valid"],[[264,264],"mapped",[265]],[[265,265],"valid"],[[266,266],"mapped",[267]],[[267,267],"valid"],[[268,268],"mapped",[269]],[[269,269],"valid"],[[270,270],"mapped",[271]],[[271,271],"valid"],[[272,272],"mapped",[273]],[[273,273],"valid"],[[274,274],"mapped",[275]],[[275,275],"valid"],[[276,276],"mapped",[277]],[[277,277],"valid"],[[278,278],"mapped",[279]],[[279,279],"valid"],[[280,280],"mapped",[281]],[[281,281],"valid"],[[282,282],"mapped",[283]],[[283,283],"valid"],[[284,284],"mapped",[285]],[[285,285],"valid"],[[286,286],"mapped",[287]],[[287,287],"valid"],[[288,288],"mapped",[289]],[[289,289],"valid"],[[290,290],"mapped",[291]],[[291,291],"valid"],[[292,292],"mapped",[293]],[[293,293],"valid"],[[294,294],"mapped",[295]],[[295,295],"valid"],[[296,296],"mapped",[297]],[[297,297],"valid"],[[298,298],"mapped",[299]],[[299,299],"valid"],[[300,300],"mapped",[301]],[[301,301],"valid"],[[302,302],"mapped",[303]],[[303,303],"valid"],[[304,304],"mapped",[105,775]],[[305,305],"valid"],[[306,307],"mapped",[105,106]],[[308,308],"mapped",[309]],[[309,309],"valid"],[[310,310],"mapped",[311]],[[311,312],"valid"],[[313,313],"mapped",[314]],[[314,314],"valid"],[[315,315],"mapped",[316]],[[316,316],"valid"],[[317,317],"mapped",[318]],[[318,318],"valid"],[[319,320],"mapped",[108,183]],[[321,321],"mapped",[322]],[[322,322],"valid"],[[323,323],"mapped",[324]],[[324,324],"valid"],[[325,325],"mapped",[326]],[[326,326],"valid"],[[327,327],"mapped",[328]],[[328,328],"valid"],[[329,329],"mapped",[700,110]],[[330,330],"mapped",[331]],[[331,331],"valid"],[[332,332],"mapped",[333]],[[333,333],"valid"],[[334,334],"mapped",[335]],[[335,335],"valid"],[[336,336],"mapped",[337]],[[337,337],"valid"],[[338,338],"mapped",[339]],[[339,339],"valid"],[[340,340],"mapped",[341]],[[341,341],"valid"],[[342,342],"mapped",[343]],[[343,343],"valid"],[[344,344],"mapped",[345]],[[345,345],"valid"],[[346,346],"mapped",[347]],[[347,347],"valid"],[[348,348],"mapped",[349]],[[349,349],"valid"],[[350,350],"mapped",[351]],[[351,351],"valid"],[[352,352],"mapped",[353]],[[353,353],"valid"],[[354,354],"mapped",[355]],[[355,355],"valid"],[[356,356],"mapped",[357]],[[357,357],"valid"],[[358,358],"mapped",[359]],[[359,359],"valid"],[[360,360],"mapped",[361]],[[361,361],"valid"],[[362,362],"mapped",[363]],[[363,363],"valid"],[[364,364],"mapped",[365]],[[365,365],"valid"],[[366,366],"mapped",[367]],[[367,367],"valid"],[[368,368],"mapped",[369]],[[369,369],"valid"],[[370,370],"mapped",[371]],[[371,371],"valid"],[[372,372],"mapped",[373]],[[373,373],"valid"],[[374,374],"mapped",[375]],[[375,375],"valid"],[[376,376],"mapped",[255]],[[377,377],"mapped",[378]],[[378,378],"valid"],[[379,379],"mapped",[380]],[[380,380],"valid"],[[381,381],"mapped",[382]],[[382,382],"valid"],[[383,383],"mapped",[115]],[[384,384],"valid"],[[385,385],"mapped",[595]],[[386,386],"mapped",[387]],[[387,387],"valid"],[[388,388],"mapped",[389]],[[389,389],"valid"],[[390,390],"mapped",[596]],[[391,391],"mapped",[392]],[[392,392],"valid"],[[393,393],"mapped",[598]],[[394,394],"mapped",[599]],[[395,395],"mapped",[396]],[[396,397],"valid"],[[398,398],"mapped",[477]],[[399,399],"mapped",[601]],[[400,400],"mapped",[603]],[[401,401],"mapped",[402]],[[402,402],"valid"],[[403,403],"mapped",[608]],[[404,404],"mapped",[611]],[[405,405],"valid"],[[406,406],"mapped",[617]],[[407,407],"mapped",[616]],[[408,408],"mapped",[409]],[[409,411],"valid"],[[412,412],"mapped",[623]],[[413,413],"mapped",[626]],[[414,414],"valid"],[[415,415],"mapped",[629]],[[416,416],"mapped",[417]],[[417,417],"valid"],[[418,418],"mapped",[419]],[[419,419],"valid"],[[420,420],"mapped",[421]],[[421,421],"valid"],[[422,422],"mapped",[640]],[[423,423],"mapped",[424]],[[424,424],"valid"],[[425,425],"mapped",[643]],[[426,427],"valid"],[[428,428],"mapped",[429]],[[429,429],"valid"],[[430,430],"mapped",[648]],[[431,431],"mapped",[432]],[[432,432],"valid"],[[433,433],"mapped",[650]],[[434,434],"mapped",[651]],[[435,435],"mapped",[436]],[[436,436],"valid"],[[437,437],"mapped",[438]],[[438,438],"valid"],[[439,439],"mapped",[658]],[[440,440],"mapped",[441]],[[441,443],"valid"],[[444,444],"mapped",[445]],[[445,451],"valid"],[[452,454],"mapped",[100,382]],[[455,457],"mapped",[108,106]],[[458,460],"mapped",[110,106]],[[461,461],"mapped",[462]],[[462,462],"valid"],[[463,463],"mapped",[464]],[[464,464],"valid"],[[465,465],"mapped",[466]],[[466,466],"valid"],[[467,467],"mapped",[468]],[[468,468],"valid"],[[469,469],"mapped",[470]],[[470,470],"valid"],[[471,471],"mapped",[472]],[[472,472],"valid"],[[473,473],"mapped",[474]],[[474,474],"valid"],[[475,475],"mapped",[476]],[[476,477],"valid"],[[478,478],"mapped",[479]],[[479,479],"valid"],[[480,480],"mapped",[481]],[[481,481],"valid"],[[482,482],"mapped",[483]],[[483,483],"valid"],[[484,484],"mapped",[485]],[[485,485],"valid"],[[486,486],"mapped",[487]],[[487,487],"valid"],[[488,488],"mapped",[489]],[[489,489],"valid"],[[490,490],"mapped",[491]],[[491,491],"valid"],[[492,492],"mapped",[493]],[[493,493],"valid"],[[494,494],"mapped",[495]],[[495,496],"valid"],[[497,499],"mapped",[100,122]],[[500,500],"mapped",[501]],[[501,501],"valid"],[[502,502],"mapped",[405]],[[503,503],"mapped",[447]],[[504,504],"mapped",[505]],[[505,505],"valid"],[[506,506],"mapped",[507]],[[507,507],"valid"],[[508,508],"mapped",[509]],[[509,509],"valid"],[[510,510],"mapped",[511]],[[511,511],"valid"],[[512,512],"mapped",[513]],[[513,513],"valid"],[[514,514],"mapped",[515]],[[515,515],"valid"],[[516,516],"mapped",[517]],[[517,517],"valid"],[[518,518],"mapped",[519]],[[519,519],"valid"],[[520,520],"mapped",[521]],[[521,521],"valid"],[[522,522],"mapped",[523]],[[523,523],"valid"],[[524,524],"mapped",[525]],[[525,525],"valid"],[[526,526],"mapped",[527]],[[527,527],"valid"],[[528,528],"mapped",[529]],[[529,529],"valid"],[[530,530],"mapped",[531]],[[531,531],"valid"],[[532,532],"mapped",[533]],[[533,533],"valid"],[[534,534],"mapped",[535]],[[535,535],"valid"],[[536,536],"mapped",[537]],[[537,537],"valid"],[[538,538],"mapped",[539]],[[539,539],"valid"],[[540,540],"mapped",[541]],[[541,541],"valid"],[[542,542],"mapped",[543]],[[543,543],"valid"],[[544,544],"mapped",[414]],[[545,545],"valid"],[[546,546],"mapped",[547]],[[547,547],"valid"],[[548,548],"mapped",[549]],[[549,549],"valid"],[[550,550],"mapped",[551]],[[551,551],"valid"],[[552,552],"mapped",[553]],[[553,553],"valid"],[[554,554],"mapped",[555]],[[555,555],"valid"],[[556,556],"mapped",[557]],[[557,557],"valid"],[[558,558],"mapped",[559]],[[559,559],"valid"],[[560,560],"mapped",[561]],[[561,561],"valid"],[[562,562],"mapped",[563]],[[563,563],"valid"],[[564,566],"valid"],[[567,569],"valid"],[[570,570],"mapped",[11365]],[[571,571],"mapped",[572]],[[572,572],"valid"],[[573,573],"mapped",[410]],[[574,574],"mapped",[11366]],[[575,576],"valid"],[[577,577],"mapped",[578]],[[578,578],"valid"],[[579,579],"mapped",[384]],[[580,580],"mapped",[649]],[[581,581],"mapped",[652]],[[582,582],"mapped",[583]],[[583,583],"valid"],[[584,584],"mapped",[585]],[[585,585],"valid"],[[586,586],"mapped",[587]],[[587,587],"valid"],[[588,588],"mapped",[589]],[[589,589],"valid"],[[590,590],"mapped",[591]],[[591,591],"valid"],[[592,680],"valid"],[[681,685],"valid"],[[686,687],"valid"],[[688,688],"mapped",[104]],[[689,689],"mapped",[614]],[[690,690],"mapped",[106]],[[691,691],"mapped",[114]],[[692,692],"mapped",[633]],[[693,693],"mapped",[635]],[[694,694],"mapped",[641]],[[695,695],"mapped",[119]],[[696,696],"mapped",[121]],[[697,705],"valid"],[[706,709],"valid",[],"NV8"],[[710,721],"valid"],[[722,727],"valid",[],"NV8"],[[728,728],"disallowed_STD3_mapped",[32,774]],[[729,729],"disallowed_STD3_mapped",[32,775]],[[730,730],"disallowed_STD3_mapped",[32,778]],[[731,731],"disallowed_STD3_mapped",[32,808]],[[732,732],"disallowed_STD3_mapped",[32,771]],[[733,733],"disallowed_STD3_mapped",[32,779]],[[734,734],"valid",[],"NV8"],[[735,735],"valid",[],"NV8"],[[736,736],"mapped",[611]],[[737,737],"mapped",[108]],[[738,738],"mapped",[115]],[[739,739],"mapped",[120]],[[740,740],"mapped",[661]],[[741,745],"valid",[],"NV8"],[[746,747],"valid",[],"NV8"],[[748,748],"valid"],[[749,749],"valid",[],"NV8"],[[750,750],"valid"],[[751,767],"valid",[],"NV8"],[[768,831],"valid"],[[832,832],"mapped",[768]],[[833,833],"mapped",[769]],[[834,834],"valid"],[[835,835],"mapped",[787]],[[836,836],"mapped",[776,769]],[[837,837],"mapped",[953]],[[838,846],"valid"],[[847,847],"ignored"],[[848,855],"valid"],[[856,860],"valid"],[[861,863],"valid"],[[864,865],"valid"],[[866,866],"valid"],[[867,879],"valid"],[[880,880],"mapped",[881]],[[881,881],"valid"],[[882,882],"mapped",[883]],[[883,883],"valid"],[[884,884],"mapped",[697]],[[885,885],"valid"],[[886,886],"mapped",[887]],[[887,887],"valid"],[[888,889],"disallowed"],[[890,890],"disallowed_STD3_mapped",[32,953]],[[891,893],"valid"],[[894,894],"disallowed_STD3_mapped",[59]],[[895,895],"mapped",[1011]],[[896,899],"disallowed"],[[900,900],"disallowed_STD3_mapped",[32,769]],[[901,901],"disallowed_STD3_mapped",[32,776,769]],[[902,902],"mapped",[940]],[[903,903],"mapped",[183]],[[904,904],"mapped",[941]],[[905,905],"mapped",[942]],[[906,906],"mapped",[943]],[[907,907],"disallowed"],[[908,908],"mapped",[972]],[[909,909],"disallowed"],[[910,910],"mapped",[973]],[[911,911],"mapped",[974]],[[912,912],"valid"],[[913,913],"mapped",[945]],[[914,914],"mapped",[946]],[[915,915],"mapped",[947]],[[916,916],"mapped",[948]],[[917,917],"mapped",[949]],[[918,918],"mapped",[950]],[[919,919],"mapped",[951]],[[920,920],"mapped",[952]],[[921,921],"mapped",[953]],[[922,922],"mapped",[954]],[[923,923],"mapped",[955]],[[924,924],"mapped",[956]],[[925,925],"mapped",[957]],[[926,926],"mapped",[958]],[[927,927],"mapped",[959]],[[928,928],"mapped",[960]],[[929,929],"mapped",[961]],[[930,930],"disallowed"],[[931,931],"mapped",[963]],[[932,932],"mapped",[964]],[[933,933],"mapped",[965]],[[934,934],"mapped",[966]],[[935,935],"mapped",[967]],[[936,936],"mapped",[968]],[[937,937],"mapped",[969]],[[938,938],"mapped",[970]],[[939,939],"mapped",[971]],[[940,961],"valid"],[[962,962],"deviation",[963]],[[963,974],"valid"],[[975,975],"mapped",[983]],[[976,976],"mapped",[946]],[[977,977],"mapped",[952]],[[978,978],"mapped",[965]],[[979,979],"mapped",[973]],[[980,980],"mapped",[971]],[[981,981],"mapped",[966]],[[982,982],"mapped",[960]],[[983,983],"valid"],[[984,984],"mapped",[985]],[[985,985],"valid"],[[986,986],"mapped",[987]],[[987,987],"valid"],[[988,988],"mapped",[989]],[[989,989],"valid"],[[990,990],"mapped",[991]],[[991,991],"valid"],[[992,992],"mapped",[993]],[[993,993],"valid"],[[994,994],"mapped",[995]],[[995,995],"valid"],[[996,996],"mapped",[997]],[[997,997],"valid"],[[998,998],"mapped",[999]],[[999,999],"valid"],[[1000,1000],"mapped",[1001]],[[1001,1001],"valid"],[[1002,1002],"mapped",[1003]],[[1003,1003],"valid"],[[1004,1004],"mapped",[1005]],[[1005,1005],"valid"],[[1006,1006],"mapped",[1007]],[[1007,1007],"valid"],[[1008,1008],"mapped",[954]],[[1009,1009],"mapped",[961]],[[1010,1010],"mapped",[963]],[[1011,1011],"valid"],[[1012,1012],"mapped",[952]],[[1013,1013],"mapped",[949]],[[1014,1014],"valid",[],"NV8"],[[1015,1015],"mapped",[1016]],[[1016,1016],"valid"],[[1017,1017],"mapped",[963]],[[1018,1018],"mapped",[1019]],[[1019,1019],"valid"],[[1020,1020],"valid"],[[1021,1021],"mapped",[891]],[[1022,1022],"mapped",[892]],[[1023,1023],"mapped",[893]],[[1024,1024],"mapped",[1104]],[[1025,1025],"mapped",[1105]],[[1026,1026],"mapped",[1106]],[[1027,1027],"mapped",[1107]],[[1028,1028],"mapped",[1108]],[[1029,1029],"mapped",[1109]],[[1030,1030],"mapped",[1110]],[[1031,1031],"mapped",[1111]],[[1032,1032],"mapped",[1112]],[[1033,1033],"mapped",[1113]],[[1034,1034],"mapped",[1114]],[[1035,1035],"mapped",[1115]],[[1036,1036],"mapped",[1116]],[[1037,1037],"mapped",[1117]],[[1038,1038],"mapped",[1118]],[[1039,1039],"mapped",[1119]],[[1040,1040],"mapped",[1072]],[[1041,1041],"mapped",[1073]],[[1042,1042],"mapped",[1074]],[[1043,1043],"mapped",[1075]],[[1044,1044],"mapped",[1076]],[[1045,1045],"mapped",[1077]],[[1046,1046],"mapped",[1078]],[[1047,1047],"mapped",[1079]],[[1048,1048],"mapped",[1080]],[[1049,1049],"mapped",[1081]],[[1050,1050],"mapped",[1082]],[[1051,1051],"mapped",[1083]],[[1052,1052],"mapped",[1084]],[[1053,1053],"mapped",[1085]],[[1054,1054],"mapped",[1086]],[[1055,1055],"mapped",[1087]],[[1056,1056],"mapped",[1088]],[[1057,1057],"mapped",[1089]],[[1058,1058],"mapped",[1090]],[[1059,1059],"mapped",[1091]],[[1060,1060],"mapped",[1092]],[[1061,1061],"mapped",[1093]],[[1062,1062],"mapped",[1094]],[[1063,1063],"mapped",[1095]],[[1064,1064],"mapped",[1096]],[[1065,1065],"mapped",[1097]],[[1066,1066],"mapped",[1098]],[[1067,1067],"mapped",[1099]],[[1068,1068],"mapped",[1100]],[[1069,1069],"mapped",[1101]],[[1070,1070],"mapped",[1102]],[[1071,1071],"mapped",[1103]],[[1072,1103],"valid"],[[1104,1104],"valid"],[[1105,1116],"valid"],[[1117,1117],"valid"],[[1118,1119],"valid"],[[1120,1120],"mapped",[1121]],[[1121,1121],"valid"],[[1122,1122],"mapped",[1123]],[[1123,1123],"valid"],[[1124,1124],"mapped",[1125]],[[1125,1125],"valid"],[[1126,1126],"mapped",[1127]],[[1127,1127],"valid"],[[1128,1128],"mapped",[1129]],[[1129,1129],"valid"],[[1130,1130],"mapped",[1131]],[[1131,1131],"valid"],[[1132,1132],"mapped",[1133]],[[1133,1133],"valid"],[[1134,1134],"mapped",[1135]],[[1135,1135],"valid"],[[1136,1136],"mapped",[1137]],[[1137,1137],"valid"],[[1138,1138],"mapped",[1139]],[[1139,1139],"valid"],[[1140,1140],"mapped",[1141]],[[1141,1141],"valid"],[[1142,1142],"mapped",[1143]],[[1143,1143],"valid"],[[1144,1144],"mapped",[1145]],[[1145,1145],"valid"],[[1146,1146],"mapped",[1147]],[[1147,1147],"valid"],[[1148,1148],"mapped",[1149]],[[1149,1149],"valid"],[[1150,1150],"mapped",[1151]],[[1151,1151],"valid"],[[1152,1152],"mapped",[1153]],[[1153,1153],"valid"],[[1154,1154],"valid",[],"NV8"],[[1155,1158],"valid"],[[1159,1159],"valid"],[[1160,1161],"valid",[],"NV8"],[[1162,1162],"mapped",[1163]],[[1163,1163],"valid"],[[1164,1164],"mapped",[1165]],[[1165,1165],"valid"],[[1166,1166],"mapped",[1167]],[[1167,1167],"valid"],[[1168,1168],"mapped",[1169]],[[1169,1169],"valid"],[[1170,1170],"mapped",[1171]],[[1171,1171],"valid"],[[1172,1172],"mapped",[1173]],[[1173,1173],"valid"],[[1174,1174],"mapped",[1175]],[[1175,1175],"valid"],[[1176,1176],"mapped",[1177]],[[1177,1177],"valid"],[[1178,1178],"mapped",[1179]],[[1179,1179],"valid"],[[1180,1180],"mapped",[1181]],[[1181,1181],"valid"],[[1182,1182],"mapped",[1183]],[[1183,1183],"valid"],[[1184,1184],"mapped",[1185]],[[1185,1185],"valid"],[[1186,1186],"mapped",[1187]],[[1187,1187],"valid"],[[1188,1188],"mapped",[1189]],[[1189,1189],"valid"],[[1190,1190],"mapped",[1191]],[[1191,1191],"valid"],[[1192,1192],"mapped",[1193]],[[1193,1193],"valid"],[[1194,1194],"mapped",[1195]],[[1195,1195],"valid"],[[1196,1196],"mapped",[1197]],[[1197,1197],"valid"],[[1198,1198],"mapped",[1199]],[[1199,1199],"valid"],[[1200,1200],"mapped",[1201]],[[1201,1201],"valid"],[[1202,1202],"mapped",[1203]],[[1203,1203],"valid"],[[1204,1204],"mapped",[1205]],[[1205,1205],"valid"],[[1206,1206],"mapped",[1207]],[[1207,1207],"valid"],[[1208,1208],"mapped",[1209]],[[1209,1209],"valid"],[[1210,1210],"mapped",[1211]],[[1211,1211],"valid"],[[1212,1212],"mapped",[1213]],[[1213,1213],"valid"],[[1214,1214],"mapped",[1215]],[[1215,1215],"valid"],[[1216,1216],"disallowed"],[[1217,1217],"mapped",[1218]],[[1218,1218],"valid"],[[1219,1219],"mapped",[1220]],[[1220,1220],"valid"],[[1221,1221],"mapped",[1222]],[[1222,1222],"valid"],[[1223,1223],"mapped",[1224]],[[1224,1224],"valid"],[[1225,1225],"mapped",[1226]],[[1226,1226],"valid"],[[1227,1227],"mapped",[1228]],[[1228,1228],"valid"],[[1229,1229],"mapped",[1230]],[[1230,1230],"valid"],[[1231,1231],"valid"],[[1232,1232],"mapped",[1233]],[[1233,1233],"valid"],[[1234,1234],"mapped",[1235]],[[1235,1235],"valid"],[[1236,1236],"mapped",[1237]],[[1237,1237],"valid"],[[1238,1238],"mapped",[1239]],[[1239,1239],"valid"],[[1240,1240],"mapped",[1241]],[[1241,1241],"valid"],[[1242,1242],"mapped",[1243]],[[1243,1243],"valid"],[[1244,1244],"mapped",[1245]],[[1245,1245],"valid"],[[1246,1246],"mapped",[1247]],[[1247,1247],"valid"],[[1248,1248],"mapped",[1249]],[[1249,1249],"valid"],[[1250,1250],"mapped",[1251]],[[1251,1251],"valid"],[[1252,1252],"mapped",[1253]],[[1253,1253],"valid"],[[1254,1254],"mapped",[1255]],[[1255,1255],"valid"],[[1256,1256],"mapped",[1257]],[[1257,1257],"valid"],[[1258,1258],"mapped",[1259]],[[1259,1259],"valid"],[[1260,1260],"mapped",[1261]],[[1261,1261],"valid"],[[1262,1262],"mapped",[1263]],[[1263,1263],"valid"],[[1264,1264],"mapped",[1265]],[[1265,1265],"valid"],[[1266,1266],"mapped",[1267]],[[1267,1267],"valid"],[[1268,1268],"mapped",[1269]],[[1269,1269],"valid"],[[1270,1270],"mapped",[1271]],[[1271,1271],"valid"],[[1272,1272],"mapped",[1273]],[[1273,1273],"valid"],[[1274,1274],"mapped",[1275]],[[1275,1275],"valid"],[[1276,1276],"mapped",[1277]],[[1277,1277],"valid"],[[1278,1278],"mapped",[1279]],[[1279,1279],"valid"],[[1280,1280],"mapped",[1281]],[[1281,1281],"valid"],[[1282,1282],"mapped",[1283]],[[1283,1283],"valid"],[[1284,1284],"mapped",[1285]],[[1285,1285],"valid"],[[1286,1286],"mapped",[1287]],[[1287,1287],"valid"],[[1288,1288],"mapped",[1289]],[[1289,1289],"valid"],[[1290,1290],"mapped",[1291]],[[1291,1291],"valid"],[[1292,1292],"mapped",[1293]],[[1293,1293],"valid"],[[1294,1294],"mapped",[1295]],[[1295,1295],"valid"],[[1296,1296],"mapped",[1297]],[[1297,1297],"valid"],[[1298,1298],"mapped",[1299]],[[1299,1299],"valid"],[[1300,1300],"mapped",[1301]],[[1301,1301],"valid"],[[1302,1302],"mapped",[1303]],[[1303,1303],"valid"],[[1304,1304],"mapped",[1305]],[[1305,1305],"valid"],[[1306,1306],"mapped",[1307]],[[1307,1307],"valid"],[[1308,1308],"mapped",[1309]],[[1309,1309],"valid"],[[1310,1310],"mapped",[1311]],[[1311,1311],"valid"],[[1312,1312],"mapped",[1313]],[[1313,1313],"valid"],[[1314,1314],"mapped",[1315]],[[1315,1315],"valid"],[[1316,1316],"mapped",[1317]],[[1317,1317],"valid"],[[1318,1318],"mapped",[1319]],[[1319,1319],"valid"],[[1320,1320],"mapped",[1321]],[[1321,1321],"valid"],[[1322,1322],"mapped",[1323]],[[1323,1323],"valid"],[[1324,1324],"mapped",[1325]],[[1325,1325],"valid"],[[1326,1326],"mapped",[1327]],[[1327,1327],"valid"],[[1328,1328],"disallowed"],[[1329,1329],"mapped",[1377]],[[1330,1330],"mapped",[1378]],[[1331,1331],"mapped",[1379]],[[1332,1332],"mapped",[1380]],[[1333,1333],"mapped",[1381]],[[1334,1334],"mapped",[1382]],[[1335,1335],"mapped",[1383]],[[1336,1336],"mapped",[1384]],[[1337,1337],"mapped",[1385]],[[1338,1338],"mapped",[1386]],[[1339,1339],"mapped",[1387]],[[1340,1340],"mapped",[1388]],[[1341,1341],"mapped",[1389]],[[1342,1342],"mapped",[1390]],[[1343,1343],"mapped",[1391]],[[1344,1344],"mapped",[1392]],[[1345,1345],"mapped",[1393]],[[1346,1346],"mapped",[1394]],[[1347,1347],"mapped",[1395]],[[1348,1348],"mapped",[1396]],[[1349,1349],"mapped",[1397]],[[1350,1350],"mapped",[1398]],[[1351,1351],"mapped",[1399]],[[1352,1352],"mapped",[1400]],[[1353,1353],"mapped",[1401]],[[1354,1354],"mapped",[1402]],[[1355,1355],"mapped",[1403]],[[1356,1356],"mapped",[1404]],[[1357,1357],"mapped",[1405]],[[1358,1358],"mapped",[1406]],[[1359,1359],"mapped",[1407]],[[1360,1360],"mapped",[1408]],[[1361,1361],"mapped",[1409]],[[1362,1362],"mapped",[1410]],[[1363,1363],"mapped",[1411]],[[1364,1364],"mapped",[1412]],[[1365,1365],"mapped",[1413]],[[1366,1366],"mapped",[1414]],[[1367,1368],"disallowed"],[[1369,1369],"valid"],[[1370,1375],"valid",[],"NV8"],[[1376,1376],"disallowed"],[[1377,1414],"valid"],[[1415,1415],"mapped",[1381,1410]],[[1416,1416],"disallowed"],[[1417,1417],"valid",[],"NV8"],[[1418,1418],"valid",[],"NV8"],[[1419,1420],"disallowed"],[[1421,1422],"valid",[],"NV8"],[[1423,1423],"valid",[],"NV8"],[[1424,1424],"disallowed"],[[1425,1441],"valid"],[[1442,1442],"valid"],[[1443,1455],"valid"],[[1456,1465],"valid"],[[1466,1466],"valid"],[[1467,1469],"valid"],[[1470,1470],"valid",[],"NV8"],[[1471,1471],"valid"],[[1472,1472],"valid",[],"NV8"],[[1473,1474],"valid"],[[1475,1475],"valid",[],"NV8"],[[1476,1476],"valid"],[[1477,1477],"valid"],[[1478,1478],"valid",[],"NV8"],[[1479,1479],"valid"],[[1480,1487],"disallowed"],[[1488,1514],"valid"],[[1515,1519],"disallowed"],[[1520,1524],"valid"],[[1525,1535],"disallowed"],[[1536,1539],"disallowed"],[[1540,1540],"disallowed"],[[1541,1541],"disallowed"],[[1542,1546],"valid",[],"NV8"],[[1547,1547],"valid",[],"NV8"],[[1548,1548],"valid",[],"NV8"],[[1549,1551],"valid",[],"NV8"],[[1552,1557],"valid"],[[1558,1562],"valid"],[[1563,1563],"valid",[],"NV8"],[[1564,1564],"disallowed"],[[1565,1565],"disallowed"],[[1566,1566],"valid",[],"NV8"],[[1567,1567],"valid",[],"NV8"],[[1568,1568],"valid"],[[1569,1594],"valid"],[[1595,1599],"valid"],[[1600,1600],"valid",[],"NV8"],[[1601,1618],"valid"],[[1619,1621],"valid"],[[1622,1624],"valid"],[[1625,1630],"valid"],[[1631,1631],"valid"],[[1632,1641],"valid"],[[1642,1645],"valid",[],"NV8"],[[1646,1647],"valid"],[[1648,1652],"valid"],[[1653,1653],"mapped",[1575,1652]],[[1654,1654],"mapped",[1608,1652]],[[1655,1655],"mapped",[1735,1652]],[[1656,1656],"mapped",[1610,1652]],[[1657,1719],"valid"],[[1720,1721],"valid"],[[1722,1726],"valid"],[[1727,1727],"valid"],[[1728,1742],"valid"],[[1743,1743],"valid"],[[1744,1747],"valid"],[[1748,1748],"valid",[],"NV8"],[[1749,1756],"valid"],[[1757,1757],"disallowed"],[[1758,1758],"valid",[],"NV8"],[[1759,1768],"valid"],[[1769,1769],"valid",[],"NV8"],[[1770,1773],"valid"],[[1774,1775],"valid"],[[1776,1785],"valid"],[[1786,1790],"valid"],[[1791,1791],"valid"],[[1792,1805],"valid",[],"NV8"],[[1806,1806],"disallowed"],[[1807,1807],"disallowed"],[[1808,1836],"valid"],[[1837,1839],"valid"],[[1840,1866],"valid"],[[1867,1868],"disallowed"],[[1869,1871],"valid"],[[1872,1901],"valid"],[[1902,1919],"valid"],[[1920,1968],"valid"],[[1969,1969],"valid"],[[1970,1983],"disallowed"],[[1984,2037],"valid"],[[2038,2042],"valid",[],"NV8"],[[2043,2047],"disallowed"],[[2048,2093],"valid"],[[2094,2095],"disallowed"],[[2096,2110],"valid",[],"NV8"],[[2111,2111],"disallowed"],[[2112,2139],"valid"],[[2140,2141],"disallowed"],[[2142,2142],"valid",[],"NV8"],[[2143,2207],"disallowed"],[[2208,2208],"valid"],[[2209,2209],"valid"],[[2210,2220],"valid"],[[2221,2226],"valid"],[[2227,2228],"valid"],[[2229,2274],"disallowed"],[[2275,2275],"valid"],[[2276,2302],"valid"],[[2303,2303],"valid"],[[2304,2304],"valid"],[[2305,2307],"valid"],[[2308,2308],"valid"],[[2309,2361],"valid"],[[2362,2363],"valid"],[[2364,2381],"valid"],[[2382,2382],"valid"],[[2383,2383],"valid"],[[2384,2388],"valid"],[[2389,2389],"valid"],[[2390,2391],"valid"],[[2392,2392],"mapped",[2325,2364]],[[2393,2393],"mapped",[2326,2364]],[[2394,2394],"mapped",[2327,2364]],[[2395,2395],"mapped",[2332,2364]],[[2396,2396],"mapped",[2337,2364]],[[2397,2397],"mapped",[2338,2364]],[[2398,2398],"mapped",[2347,2364]],[[2399,2399],"mapped",[2351,2364]],[[2400,2403],"valid"],[[2404,2405],"valid",[],"NV8"],[[2406,2415],"valid"],[[2416,2416],"valid",[],"NV8"],[[2417,2418],"valid"],[[2419,2423],"valid"],[[2424,2424],"valid"],[[2425,2426],"valid"],[[2427,2428],"valid"],[[2429,2429],"valid"],[[2430,2431],"valid"],[[2432,2432],"valid"],[[2433,2435],"valid"],[[2436,2436],"disallowed"],[[2437,2444],"valid"],[[2445,2446],"disallowed"],[[2447,2448],"valid"],[[2449,2450],"disallowed"],[[2451,2472],"valid"],[[2473,2473],"disallowed"],[[2474,2480],"valid"],[[2481,2481],"disallowed"],[[2482,2482],"valid"],[[2483,2485],"disallowed"],[[2486,2489],"valid"],[[2490,2491],"disallowed"],[[2492,2492],"valid"],[[2493,2493],"valid"],[[2494,2500],"valid"],[[2501,2502],"disallowed"],[[2503,2504],"valid"],[[2505,2506],"disallowed"],[[2507,2509],"valid"],[[2510,2510],"valid"],[[2511,2518],"disallowed"],[[2519,2519],"valid"],[[2520,2523],"disallowed"],[[2524,2524],"mapped",[2465,2492]],[[2525,2525],"mapped",[2466,2492]],[[2526,2526],"disallowed"],[[2527,2527],"mapped",[2479,2492]],[[2528,2531],"valid"],[[2532,2533],"disallowed"],[[2534,2545],"valid"],[[2546,2554],"valid",[],"NV8"],[[2555,2555],"valid",[],"NV8"],[[2556,2560],"disallowed"],[[2561,2561],"valid"],[[2562,2562],"valid"],[[2563,2563],"valid"],[[2564,2564],"disallowed"],[[2565,2570],"valid"],[[2571,2574],"disallowed"],[[2575,2576],"valid"],[[2577,2578],"disallowed"],[[2579,2600],"valid"],[[2601,2601],"disallowed"],[[2602,2608],"valid"],[[2609,2609],"disallowed"],[[2610,2610],"valid"],[[2611,2611],"mapped",[2610,2620]],[[2612,2612],"disallowed"],[[2613,2613],"valid"],[[2614,2614],"mapped",[2616,2620]],[[2615,2615],"disallowed"],[[2616,2617],"valid"],[[2618,2619],"disallowed"],[[2620,2620],"valid"],[[2621,2621],"disallowed"],[[2622,2626],"valid"],[[2627,2630],"disallowed"],[[2631,2632],"valid"],[[2633,2634],"disallowed"],[[2635,2637],"valid"],[[2638,2640],"disallowed"],[[2641,2641],"valid"],[[2642,2648],"disallowed"],[[2649,2649],"mapped",[2582,2620]],[[2650,2650],"mapped",[2583,2620]],[[2651,2651],"mapped",[2588,2620]],[[2652,2652],"valid"],[[2653,2653],"disallowed"],[[2654,2654],"mapped",[2603,2620]],[[2655,2661],"disallowed"],[[2662,2676],"valid"],[[2677,2677],"valid"],[[2678,2688],"disallowed"],[[2689,2691],"valid"],[[2692,2692],"disallowed"],[[2693,2699],"valid"],[[2700,2700],"valid"],[[2701,2701],"valid"],[[2702,2702],"disallowed"],[[2703,2705],"valid"],[[2706,2706],"disallowed"],[[2707,2728],"valid"],[[2729,2729],"disallowed"],[[2730,2736],"valid"],[[2737,2737],"disallowed"],[[2738,2739],"valid"],[[2740,2740],"disallowed"],[[2741,2745],"valid"],[[2746,2747],"disallowed"],[[2748,2757],"valid"],[[2758,2758],"disallowed"],[[2759,2761],"valid"],[[2762,2762],"disallowed"],[[2763,2765],"valid"],[[2766,2767],"disallowed"],[[2768,2768],"valid"],[[2769,2783],"disallowed"],[[2784,2784],"valid"],[[2785,2787],"valid"],[[2788,2789],"disallowed"],[[2790,2799],"valid"],[[2800,2800],"valid",[],"NV8"],[[2801,2801],"valid",[],"NV8"],[[2802,2808],"disallowed"],[[2809,2809],"valid"],[[2810,2816],"disallowed"],[[2817,2819],"valid"],[[2820,2820],"disallowed"],[[2821,2828],"valid"],[[2829,2830],"disallowed"],[[2831,2832],"valid"],[[2833,2834],"disallowed"],[[2835,2856],"valid"],[[2857,2857],"disallowed"],[[2858,2864],"valid"],[[2865,2865],"disallowed"],[[2866,2867],"valid"],[[2868,2868],"disallowed"],[[2869,2869],"valid"],[[2870,2873],"valid"],[[2874,2875],"disallowed"],[[2876,2883],"valid"],[[2884,2884],"valid"],[[2885,2886],"disallowed"],[[2887,2888],"valid"],[[2889,2890],"disallowed"],[[2891,2893],"valid"],[[2894,2901],"disallowed"],[[2902,2903],"valid"],[[2904,2907],"disallowed"],[[2908,2908],"mapped",[2849,2876]],[[2909,2909],"mapped",[2850,2876]],[[2910,2910],"disallowed"],[[2911,2913],"valid"],[[2914,2915],"valid"],[[2916,2917],"disallowed"],[[2918,2927],"valid"],[[2928,2928],"valid",[],"NV8"],[[2929,2929],"valid"],[[2930,2935],"valid",[],"NV8"],[[2936,2945],"disallowed"],[[2946,2947],"valid"],[[2948,2948],"disallowed"],[[2949,2954],"valid"],[[2955,2957],"disallowed"],[[2958,2960],"valid"],[[2961,2961],"disallowed"],[[2962,2965],"valid"],[[2966,2968],"disallowed"],[[2969,2970],"valid"],[[2971,2971],"disallowed"],[[2972,2972],"valid"],[[2973,2973],"disallowed"],[[2974,2975],"valid"],[[2976,2978],"disallowed"],[[2979,2980],"valid"],[[2981,2983],"disallowed"],[[2984,2986],"valid"],[[2987,2989],"disallowed"],[[2990,2997],"valid"],[[2998,2998],"valid"],[[2999,3001],"valid"],[[3002,3005],"disallowed"],[[3006,3010],"valid"],[[3011,3013],"disallowed"],[[3014,3016],"valid"],[[3017,3017],"disallowed"],[[3018,3021],"valid"],[[3022,3023],"disallowed"],[[3024,3024],"valid"],[[3025,3030],"disallowed"],[[3031,3031],"valid"],[[3032,3045],"disallowed"],[[3046,3046],"valid"],[[3047,3055],"valid"],[[3056,3058],"valid",[],"NV8"],[[3059,3066],"valid",[],"NV8"],[[3067,3071],"disallowed"],[[3072,3072],"valid"],[[3073,3075],"valid"],[[3076,3076],"disallowed"],[[3077,3084],"valid"],[[3085,3085],"disallowed"],[[3086,3088],"valid"],[[3089,3089],"disallowed"],[[3090,3112],"valid"],[[3113,3113],"disallowed"],[[3114,3123],"valid"],[[3124,3124],"valid"],[[3125,3129],"valid"],[[3130,3132],"disallowed"],[[3133,3133],"valid"],[[3134,3140],"valid"],[[3141,3141],"disallowed"],[[3142,3144],"valid"],[[3145,3145],"disallowed"],[[3146,3149],"valid"],[[3150,3156],"disallowed"],[[3157,3158],"valid"],[[3159,3159],"disallowed"],[[3160,3161],"valid"],[[3162,3162],"valid"],[[3163,3167],"disallowed"],[[3168,3169],"valid"],[[3170,3171],"valid"],[[3172,3173],"disallowed"],[[3174,3183],"valid"],[[3184,3191],"disallowed"],[[3192,3199],"valid",[],"NV8"],[[3200,3200],"disallowed"],[[3201,3201],"valid"],[[3202,3203],"valid"],[[3204,3204],"disallowed"],[[3205,3212],"valid"],[[3213,3213],"disallowed"],[[3214,3216],"valid"],[[3217,3217],"disallowed"],[[3218,3240],"valid"],[[3241,3241],"disallowed"],[[3242,3251],"valid"],[[3252,3252],"disallowed"],[[3253,3257],"valid"],[[3258,3259],"disallowed"],[[3260,3261],"valid"],[[3262,3268],"valid"],[[3269,3269],"disallowed"],[[3270,3272],"valid"],[[3273,3273],"disallowed"],[[3274,3277],"valid"],[[3278,3284],"disallowed"],[[3285,3286],"valid"],[[3287,3293],"disallowed"],[[3294,3294],"valid"],[[3295,3295],"disallowed"],[[3296,3297],"valid"],[[3298,3299],"valid"],[[3300,3301],"disallowed"],[[3302,3311],"valid"],[[3312,3312],"disallowed"],[[3313,3314],"valid"],[[3315,3328],"disallowed"],[[3329,3329],"valid"],[[3330,3331],"valid"],[[3332,3332],"disallowed"],[[3333,3340],"valid"],[[3341,3341],"disallowed"],[[3342,3344],"valid"],[[3345,3345],"disallowed"],[[3346,3368],"valid"],[[3369,3369],"valid"],[[3370,3385],"valid"],[[3386,3386],"valid"],[[3387,3388],"disallowed"],[[3389,3389],"valid"],[[3390,3395],"valid"],[[3396,3396],"valid"],[[3397,3397],"disallowed"],[[3398,3400],"valid"],[[3401,3401],"disallowed"],[[3402,3405],"valid"],[[3406,3406],"valid"],[[3407,3414],"disallowed"],[[3415,3415],"valid"],[[3416,3422],"disallowed"],[[3423,3423],"valid"],[[3424,3425],"valid"],[[3426,3427],"valid"],[[3428,3429],"disallowed"],[[3430,3439],"valid"],[[3440,3445],"valid",[],"NV8"],[[3446,3448],"disallowed"],[[3449,3449],"valid",[],"NV8"],[[3450,3455],"valid"],[[3456,3457],"disallowed"],[[3458,3459],"valid"],[[3460,3460],"disallowed"],[[3461,3478],"valid"],[[3479,3481],"disallowed"],[[3482,3505],"valid"],[[3506,3506],"disallowed"],[[3507,3515],"valid"],[[3516,3516],"disallowed"],[[3517,3517],"valid"],[[3518,3519],"disallowed"],[[3520,3526],"valid"],[[3527,3529],"disallowed"],[[3530,3530],"valid"],[[3531,3534],"disallowed"],[[3535,3540],"valid"],[[3541,3541],"disallowed"],[[3542,3542],"valid"],[[3543,3543],"disallowed"],[[3544,3551],"valid"],[[3552,3557],"disallowed"],[[3558,3567],"valid"],[[3568,3569],"disallowed"],[[3570,3571],"valid"],[[3572,3572],"valid",[],"NV8"],[[3573,3584],"disallowed"],[[3585,3634],"valid"],[[3635,3635],"mapped",[3661,3634]],[[3636,3642],"valid"],[[3643,3646],"disallowed"],[[3647,3647],"valid",[],"NV8"],[[3648,3662],"valid"],[[3663,3663],"valid",[],"NV8"],[[3664,3673],"valid"],[[3674,3675],"valid",[],"NV8"],[[3676,3712],"disallowed"],[[3713,3714],"valid"],[[3715,3715],"disallowed"],[[3716,3716],"valid"],[[3717,3718],"disallowed"],[[3719,3720],"valid"],[[3721,3721],"disallowed"],[[3722,3722],"valid"],[[3723,3724],"disallowed"],[[3725,3725],"valid"],[[3726,3731],"disallowed"],[[3732,3735],"valid"],[[3736,3736],"disallowed"],[[3737,3743],"valid"],[[3744,3744],"disallowed"],[[3745,3747],"valid"],[[3748,3748],"disallowed"],[[3749,3749],"valid"],[[3750,3750],"disallowed"],[[3751,3751],"valid"],[[3752,3753],"disallowed"],[[3754,3755],"valid"],[[3756,3756],"disallowed"],[[3757,3762],"valid"],[[3763,3763],"mapped",[3789,3762]],[[3764,3769],"valid"],[[3770,3770],"disallowed"],[[3771,3773],"valid"],[[3774,3775],"disallowed"],[[3776,3780],"valid"],[[3781,3781],"disallowed"],[[3782,3782],"valid"],[[3783,3783],"disallowed"],[[3784,3789],"valid"],[[3790,3791],"disallowed"],[[3792,3801],"valid"],[[3802,3803],"disallowed"],[[3804,3804],"mapped",[3755,3737]],[[3805,3805],"mapped",[3755,3745]],[[3806,3807],"valid"],[[3808,3839],"disallowed"],[[3840,3840],"valid"],[[3841,3850],"valid",[],"NV8"],[[3851,3851],"valid"],[[3852,3852],"mapped",[3851]],[[3853,3863],"valid",[],"NV8"],[[3864,3865],"valid"],[[3866,3871],"valid",[],"NV8"],[[3872,3881],"valid"],[[3882,3892],"valid",[],"NV8"],[[3893,3893],"valid"],[[3894,3894],"valid",[],"NV8"],[[3895,3895],"valid"],[[3896,3896],"valid",[],"NV8"],[[3897,3897],"valid"],[[3898,3901],"valid",[],"NV8"],[[3902,3906],"valid"],[[3907,3907],"mapped",[3906,4023]],[[3908,3911],"valid"],[[3912,3912],"disallowed"],[[3913,3916],"valid"],[[3917,3917],"mapped",[3916,4023]],[[3918,3921],"valid"],[[3922,3922],"mapped",[3921,4023]],[[3923,3926],"valid"],[[3927,3927],"mapped",[3926,4023]],[[3928,3931],"valid"],[[3932,3932],"mapped",[3931,4023]],[[3933,3944],"valid"],[[3945,3945],"mapped",[3904,4021]],[[3946,3946],"valid"],[[3947,3948],"valid"],[[3949,3952],"disallowed"],[[3953,3954],"valid"],[[3955,3955],"mapped",[3953,3954]],[[3956,3956],"valid"],[[3957,3957],"mapped",[3953,3956]],[[3958,3958],"mapped",[4018,3968]],[[3959,3959],"mapped",[4018,3953,3968]],[[3960,3960],"mapped",[4019,3968]],[[3961,3961],"mapped",[4019,3953,3968]],[[3962,3968],"valid"],[[3969,3969],"mapped",[3953,3968]],[[3970,3972],"valid"],[[3973,3973],"valid",[],"NV8"],[[3974,3979],"valid"],[[3980,3983],"valid"],[[3984,3986],"valid"],[[3987,3987],"mapped",[3986,4023]],[[3988,3989],"valid"],[[3990,3990],"valid"],[[3991,3991],"valid"],[[3992,3992],"disallowed"],[[3993,3996],"valid"],[[3997,3997],"mapped",[3996,4023]],[[3998,4001],"valid"],[[4002,4002],"mapped",[4001,4023]],[[4003,4006],"valid"],[[4007,4007],"mapped",[4006,4023]],[[4008,4011],"valid"],[[4012,4012],"mapped",[4011,4023]],[[4013,4013],"valid"],[[4014,4016],"valid"],[[4017,4023],"valid"],[[4024,4024],"valid"],[[4025,4025],"mapped",[3984,4021]],[[4026,4028],"valid"],[[4029,4029],"disallowed"],[[4030,4037],"valid",[],"NV8"],[[4038,4038],"valid"],[[4039,4044],"valid",[],"NV8"],[[4045,4045],"disallowed"],[[4046,4046],"valid",[],"NV8"],[[4047,4047],"valid",[],"NV8"],[[4048,4049],"valid",[],"NV8"],[[4050,4052],"valid",[],"NV8"],[[4053,4056],"valid",[],"NV8"],[[4057,4058],"valid",[],"NV8"],[[4059,4095],"disallowed"],[[4096,4129],"valid"],[[4130,4130],"valid"],[[4131,4135],"valid"],[[4136,4136],"valid"],[[4137,4138],"valid"],[[4139,4139],"valid"],[[4140,4146],"valid"],[[4147,4149],"valid"],[[4150,4153],"valid"],[[4154,4159],"valid"],[[4160,4169],"valid"],[[4170,4175],"valid",[],"NV8"],[[4176,4185],"valid"],[[4186,4249],"valid"],[[4250,4253],"valid"],[[4254,4255],"valid",[],"NV8"],[[4256,4293],"disallowed"],[[4294,4294],"disallowed"],[[4295,4295],"mapped",[11559]],[[4296,4300],"disallowed"],[[4301,4301],"mapped",[11565]],[[4302,4303],"disallowed"],[[4304,4342],"valid"],[[4343,4344],"valid"],[[4345,4346],"valid"],[[4347,4347],"valid",[],"NV8"],[[4348,4348],"mapped",[4316]],[[4349,4351],"valid"],[[4352,4441],"valid",[],"NV8"],[[4442,4446],"valid",[],"NV8"],[[4447,4448],"disallowed"],[[4449,4514],"valid",[],"NV8"],[[4515,4519],"valid",[],"NV8"],[[4520,4601],"valid",[],"NV8"],[[4602,4607],"valid",[],"NV8"],[[4608,4614],"valid"],[[4615,4615],"valid"],[[4616,4678],"valid"],[[4679,4679],"valid"],[[4680,4680],"valid"],[[4681,4681],"disallowed"],[[4682,4685],"valid"],[[4686,4687],"disallowed"],[[4688,4694],"valid"],[[4695,4695],"disallowed"],[[4696,4696],"valid"],[[4697,4697],"disallowed"],[[4698,4701],"valid"],[[4702,4703],"disallowed"],[[4704,4742],"valid"],[[4743,4743],"valid"],[[4744,4744],"valid"],[[4745,4745],"disallowed"],[[4746,4749],"valid"],[[4750,4751],"disallowed"],[[4752,4782],"valid"],[[4783,4783],"valid"],[[4784,4784],"valid"],[[4785,4785],"disallowed"],[[4786,4789],"valid"],[[4790,4791],"disallowed"],[[4792,4798],"valid"],[[4799,4799],"disallowed"],[[4800,4800],"valid"],[[4801,4801],"disallowed"],[[4802,4805],"valid"],[[4806,4807],"disallowed"],[[4808,4814],"valid"],[[4815,4815],"valid"],[[4816,4822],"valid"],[[4823,4823],"disallowed"],[[4824,4846],"valid"],[[4847,4847],"valid"],[[4848,4878],"valid"],[[4879,4879],"valid"],[[4880,4880],"valid"],[[4881,4881],"disallowed"],[[4882,4885],"valid"],[[4886,4887],"disallowed"],[[4888,4894],"valid"],[[4895,4895],"valid"],[[4896,4934],"valid"],[[4935,4935],"valid"],[[4936,4954],"valid"],[[4955,4956],"disallowed"],[[4957,4958],"valid"],[[4959,4959],"valid"],[[4960,4960],"valid",[],"NV8"],[[4961,4988],"valid",[],"NV8"],[[4989,4991],"disallowed"],[[4992,5007],"valid"],[[5008,5017],"valid",[],"NV8"],[[5018,5023],"disallowed"],[[5024,5108],"valid"],[[5109,5109],"valid"],[[5110,5111],"disallowed"],[[5112,5112],"mapped",[5104]],[[5113,5113],"mapped",[5105]],[[5114,5114],"mapped",[5106]],[[5115,5115],"mapped",[5107]],[[5116,5116],"mapped",[5108]],[[5117,5117],"mapped",[5109]],[[5118,5119],"disallowed"],[[5120,5120],"valid",[],"NV8"],[[5121,5740],"valid"],[[5741,5742],"valid",[],"NV8"],[[5743,5750],"valid"],[[5751,5759],"valid"],[[5760,5760],"disallowed"],[[5761,5786],"valid"],[[5787,5788],"valid",[],"NV8"],[[5789,5791],"disallowed"],[[5792,5866],"valid"],[[5867,5872],"valid",[],"NV8"],[[5873,5880],"valid"],[[5881,5887],"disallowed"],[[5888,5900],"valid"],[[5901,5901],"disallowed"],[[5902,5908],"valid"],[[5909,5919],"disallowed"],[[5920,5940],"valid"],[[5941,5942],"valid",[],"NV8"],[[5943,5951],"disallowed"],[[5952,5971],"valid"],[[5972,5983],"disallowed"],[[5984,5996],"valid"],[[5997,5997],"disallowed"],[[5998,6000],"valid"],[[6001,6001],"disallowed"],[[6002,6003],"valid"],[[6004,6015],"disallowed"],[[6016,6067],"valid"],[[6068,6069],"disallowed"],[[6070,6099],"valid"],[[6100,6102],"valid",[],"NV8"],[[6103,6103],"valid"],[[6104,6107],"valid",[],"NV8"],[[6108,6108],"valid"],[[6109,6109],"valid"],[[6110,6111],"disallowed"],[[6112,6121],"valid"],[[6122,6127],"disallowed"],[[6128,6137],"valid",[],"NV8"],[[6138,6143],"disallowed"],[[6144,6149],"valid",[],"NV8"],[[6150,6150],"disallowed"],[[6151,6154],"valid",[],"NV8"],[[6155,6157],"ignored"],[[6158,6158],"disallowed"],[[6159,6159],"disallowed"],[[6160,6169],"valid"],[[6170,6175],"disallowed"],[[6176,6263],"valid"],[[6264,6271],"disallowed"],[[6272,6313],"valid"],[[6314,6314],"valid"],[[6315,6319],"disallowed"],[[6320,6389],"valid"],[[6390,6399],"disallowed"],[[6400,6428],"valid"],[[6429,6430],"valid"],[[6431,6431],"disallowed"],[[6432,6443],"valid"],[[6444,6447],"disallowed"],[[6448,6459],"valid"],[[6460,6463],"disallowed"],[[6464,6464],"valid",[],"NV8"],[[6465,6467],"disallowed"],[[6468,6469],"valid",[],"NV8"],[[6470,6509],"valid"],[[6510,6511],"disallowed"],[[6512,6516],"valid"],[[6517,6527],"disallowed"],[[6528,6569],"valid"],[[6570,6571],"valid"],[[6572,6575],"disallowed"],[[6576,6601],"valid"],[[6602,6607],"disallowed"],[[6608,6617],"valid"],[[6618,6618],"valid",[],"XV8"],[[6619,6621],"disallowed"],[[6622,6623],"valid",[],"NV8"],[[6624,6655],"valid",[],"NV8"],[[6656,6683],"valid"],[[6684,6685],"disallowed"],[[6686,6687],"valid",[],"NV8"],[[6688,6750],"valid"],[[6751,6751],"disallowed"],[[6752,6780],"valid"],[[6781,6782],"disallowed"],[[6783,6793],"valid"],[[6794,6799],"disallowed"],[[6800,6809],"valid"],[[6810,6815],"disallowed"],[[6816,6822],"valid",[],"NV8"],[[6823,6823],"valid"],[[6824,6829],"valid",[],"NV8"],[[6830,6831],"disallowed"],[[6832,6845],"valid"],[[6846,6846],"valid",[],"NV8"],[[6847,6911],"disallowed"],[[6912,6987],"valid"],[[6988,6991],"disallowed"],[[6992,7001],"valid"],[[7002,7018],"valid",[],"NV8"],[[7019,7027],"valid"],[[7028,7036],"valid",[],"NV8"],[[7037,7039],"disallowed"],[[7040,7082],"valid"],[[7083,7085],"valid"],[[7086,7097],"valid"],[[7098,7103],"valid"],[[7104,7155],"valid"],[[7156,7163],"disallowed"],[[7164,7167],"valid",[],"NV8"],[[7168,7223],"valid"],[[7224,7226],"disallowed"],[[7227,7231],"valid",[],"NV8"],[[7232,7241],"valid"],[[7242,7244],"disallowed"],[[7245,7293],"valid"],[[7294,7295],"valid",[],"NV8"],[[7296,7359],"disallowed"],[[7360,7367],"valid",[],"NV8"],[[7368,7375],"disallowed"],[[7376,7378],"valid"],[[7379,7379],"valid",[],"NV8"],[[7380,7410],"valid"],[[7411,7414],"valid"],[[7415,7415],"disallowed"],[[7416,7417],"valid"],[[7418,7423],"disallowed"],[[7424,7467],"valid"],[[7468,7468],"mapped",[97]],[[7469,7469],"mapped",[230]],[[7470,7470],"mapped",[98]],[[7471,7471],"valid"],[[7472,7472],"mapped",[100]],[[7473,7473],"mapped",[101]],[[7474,7474],"mapped",[477]],[[7475,7475],"mapped",[103]],[[7476,7476],"mapped",[104]],[[7477,7477],"mapped",[105]],[[7478,7478],"mapped",[106]],[[7479,7479],"mapped",[107]],[[7480,7480],"mapped",[108]],[[7481,7481],"mapped",[109]],[[7482,7482],"mapped",[110]],[[7483,7483],"valid"],[[7484,7484],"mapped",[111]],[[7485,7485],"mapped",[547]],[[7486,7486],"mapped",[112]],[[7487,7487],"mapped",[114]],[[7488,7488],"mapped",[116]],[[7489,7489],"mapped",[117]],[[7490,7490],"mapped",[119]],[[7491,7491],"mapped",[97]],[[7492,7492],"mapped",[592]],[[7493,7493],"mapped",[593]],[[7494,7494],"mapped",[7426]],[[7495,7495],"mapped",[98]],[[7496,7496],"mapped",[100]],[[7497,7497],"mapped",[101]],[[7498,7498],"mapped",[601]],[[7499,7499],"mapped",[603]],[[7500,7500],"mapped",[604]],[[7501,7501],"mapped",[103]],[[7502,7502],"valid"],[[7503,7503],"mapped",[107]],[[7504,7504],"mapped",[109]],[[7505,7505],"mapped",[331]],[[7506,7506],"mapped",[111]],[[7507,7507],"mapped",[596]],[[7508,7508],"mapped",[7446]],[[7509,7509],"mapped",[7447]],[[7510,7510],"mapped",[112]],[[7511,7511],"mapped",[116]],[[7512,7512],"mapped",[117]],[[7513,7513],"mapped",[7453]],[[7514,7514],"mapped",[623]],[[7515,7515],"mapped",[118]],[[7516,7516],"mapped",[7461]],[[7517,7517],"mapped",[946]],[[7518,7518],"mapped",[947]],[[7519,7519],"mapped",[948]],[[7520,7520],"mapped",[966]],[[7521,7521],"mapped",[967]],[[7522,7522],"mapped",[105]],[[7523,7523],"mapped",[114]],[[7524,7524],"mapped",[117]],[[7525,7525],"mapped",[118]],[[7526,7526],"mapped",[946]],[[7527,7527],"mapped",[947]],[[7528,7528],"mapped",[961]],[[7529,7529],"mapped",[966]],[[7530,7530],"mapped",[967]],[[7531,7531],"valid"],[[7532,7543],"valid"],[[7544,7544],"mapped",[1085]],[[7545,7578],"valid"],[[7579,7579],"mapped",[594]],[[7580,7580],"mapped",[99]],[[7581,7581],"mapped",[597]],[[7582,7582],"mapped",[240]],[[7583,7583],"mapped",[604]],[[7584,7584],"mapped",[102]],[[7585,7585],"mapped",[607]],[[7586,7586],"mapped",[609]],[[7587,7587],"mapped",[613]],[[7588,7588],"mapped",[616]],[[7589,7589],"mapped",[617]],[[7590,7590],"mapped",[618]],[[7591,7591],"mapped",[7547]],[[7592,7592],"mapped",[669]],[[7593,7593],"mapped",[621]],[[7594,7594],"mapped",[7557]],[[7595,7595],"mapped",[671]],[[7596,7596],"mapped",[625]],[[7597,7597],"mapped",[624]],[[7598,7598],"mapped",[626]],[[7599,7599],"mapped",[627]],[[7600,7600],"mapped",[628]],[[7601,7601],"mapped",[629]],[[7602,7602],"mapped",[632]],[[7603,7603],"mapped",[642]],[[7604,7604],"mapped",[643]],[[7605,7605],"mapped",[427]],[[7606,7606],"mapped",[649]],[[7607,7607],"mapped",[650]],[[7608,7608],"mapped",[7452]],[[7609,7609],"mapped",[651]],[[7610,7610],"mapped",[652]],[[7611,7611],"mapped",[122]],[[7612,7612],"mapped",[656]],[[7613,7613],"mapped",[657]],[[7614,7614],"mapped",[658]],[[7615,7615],"mapped",[952]],[[7616,7619],"valid"],[[7620,7626],"valid"],[[7627,7654],"valid"],[[7655,7669],"valid"],[[7670,7675],"disallowed"],[[7676,7676],"valid"],[[7677,7677],"valid"],[[7678,7679],"valid"],[[7680,7680],"mapped",[7681]],[[7681,7681],"valid"],[[7682,7682],"mapped",[7683]],[[7683,7683],"valid"],[[7684,7684],"mapped",[7685]],[[7685,7685],"valid"],[[7686,7686],"mapped",[7687]],[[7687,7687],"valid"],[[7688,7688],"mapped",[7689]],[[7689,7689],"valid"],[[7690,7690],"mapped",[7691]],[[7691,7691],"valid"],[[7692,7692],"mapped",[7693]],[[7693,7693],"valid"],[[7694,7694],"mapped",[7695]],[[7695,7695],"valid"],[[7696,7696],"mapped",[7697]],[[7697,7697],"valid"],[[7698,7698],"mapped",[7699]],[[7699,7699],"valid"],[[7700,7700],"mapped",[7701]],[[7701,7701],"valid"],[[7702,7702],"mapped",[7703]],[[7703,7703],"valid"],[[7704,7704],"mapped",[7705]],[[7705,7705],"valid"],[[7706,7706],"mapped",[7707]],[[7707,7707],"valid"],[[7708,7708],"mapped",[7709]],[[7709,7709],"valid"],[[7710,7710],"mapped",[7711]],[[7711,7711],"valid"],[[7712,7712],"mapped",[7713]],[[7713,7713],"valid"],[[7714,7714],"mapped",[7715]],[[7715,7715],"valid"],[[7716,7716],"mapped",[7717]],[[7717,7717],"valid"],[[7718,7718],"mapped",[7719]],[[7719,7719],"valid"],[[7720,7720],"mapped",[7721]],[[7721,7721],"valid"],[[7722,7722],"mapped",[7723]],[[7723,7723],"valid"],[[7724,7724],"mapped",[7725]],[[7725,7725],"valid"],[[7726,7726],"mapped",[7727]],[[7727,7727],"valid"],[[7728,7728],"mapped",[7729]],[[7729,7729],"valid"],[[7730,7730],"mapped",[7731]],[[7731,7731],"valid"],[[7732,7732],"mapped",[7733]],[[7733,7733],"valid"],[[7734,7734],"mapped",[7735]],[[7735,7735],"valid"],[[7736,7736],"mapped",[7737]],[[7737,7737],"valid"],[[7738,7738],"mapped",[7739]],[[7739,7739],"valid"],[[7740,7740],"mapped",[7741]],[[7741,7741],"valid"],[[7742,7742],"mapped",[7743]],[[7743,7743],"valid"],[[7744,7744],"mapped",[7745]],[[7745,7745],"valid"],[[7746,7746],"mapped",[7747]],[[7747,7747],"valid"],[[7748,7748],"mapped",[7749]],[[7749,7749],"valid"],[[7750,7750],"mapped",[7751]],[[7751,7751],"valid"],[[7752,7752],"mapped",[7753]],[[7753,7753],"valid"],[[7754,7754],"mapped",[7755]],[[7755,7755],"valid"],[[7756,7756],"mapped",[7757]],[[7757,7757],"valid"],[[7758,7758],"mapped",[7759]],[[7759,7759],"valid"],[[7760,7760],"mapped",[7761]],[[7761,7761],"valid"],[[7762,7762],"mapped",[7763]],[[7763,7763],"valid"],[[7764,7764],"mapped",[7765]],[[7765,7765],"valid"],[[7766,7766],"mapped",[7767]],[[7767,7767],"valid"],[[7768,7768],"mapped",[7769]],[[7769,7769],"valid"],[[7770,7770],"mapped",[7771]],[[7771,7771],"valid"],[[7772,7772],"mapped",[7773]],[[7773,7773],"valid"],[[7774,7774],"mapped",[7775]],[[7775,7775],"valid"],[[7776,7776],"mapped",[7777]],[[7777,7777],"valid"],[[7778,7778],"mapped",[7779]],[[7779,7779],"valid"],[[7780,7780],"mapped",[7781]],[[7781,7781],"valid"],[[7782,7782],"mapped",[7783]],[[7783,7783],"valid"],[[7784,7784],"mapped",[7785]],[[7785,7785],"valid"],[[7786,7786],"mapped",[7787]],[[7787,7787],"valid"],[[7788,7788],"mapped",[7789]],[[7789,7789],"valid"],[[7790,7790],"mapped",[7791]],[[7791,7791],"valid"],[[7792,7792],"mapped",[7793]],[[7793,7793],"valid"],[[7794,7794],"mapped",[7795]],[[7795,7795],"valid"],[[7796,7796],"mapped",[7797]],[[7797,7797],"valid"],[[7798,7798],"mapped",[7799]],[[7799,7799],"valid"],[[7800,7800],"mapped",[7801]],[[7801,7801],"valid"],[[7802,7802],"mapped",[7803]],[[7803,7803],"valid"],[[7804,7804],"mapped",[7805]],[[7805,7805],"valid"],[[7806,7806],"mapped",[7807]],[[7807,7807],"valid"],[[7808,7808],"mapped",[7809]],[[7809,7809],"valid"],[[7810,7810],"mapped",[7811]],[[7811,7811],"valid"],[[7812,7812],"mapped",[7813]],[[7813,7813],"valid"],[[7814,7814],"mapped",[7815]],[[7815,7815],"valid"],[[7816,7816],"mapped",[7817]],[[7817,7817],"valid"],[[7818,7818],"mapped",[7819]],[[7819,7819],"valid"],[[7820,7820],"mapped",[7821]],[[7821,7821],"valid"],[[7822,7822],"mapped",[7823]],[[7823,7823],"valid"],[[7824,7824],"mapped",[7825]],[[7825,7825],"valid"],[[7826,7826],"mapped",[7827]],[[7827,7827],"valid"],[[7828,7828],"mapped",[7829]],[[7829,7833],"valid"],[[7834,7834],"mapped",[97,702]],[[7835,7835],"mapped",[7777]],[[7836,7837],"valid"],[[7838,7838],"mapped",[115,115]],[[7839,7839],"valid"],[[7840,7840],"mapped",[7841]],[[7841,7841],"valid"],[[7842,7842],"mapped",[7843]],[[7843,7843],"valid"],[[7844,7844],"mapped",[7845]],[[7845,7845],"valid"],[[7846,7846],"mapped",[7847]],[[7847,7847],"valid"],[[7848,7848],"mapped",[7849]],[[7849,7849],"valid"],[[7850,7850],"mapped",[7851]],[[7851,7851],"valid"],[[7852,7852],"mapped",[7853]],[[7853,7853],"valid"],[[7854,7854],"mapped",[7855]],[[7855,7855],"valid"],[[7856,7856],"mapped",[7857]],[[7857,7857],"valid"],[[7858,7858],"mapped",[7859]],[[7859,7859],"valid"],[[7860,7860],"mapped",[7861]],[[7861,7861],"valid"],[[7862,7862],"mapped",[7863]],[[7863,7863],"valid"],[[7864,7864],"mapped",[7865]],[[7865,7865],"valid"],[[7866,7866],"mapped",[7867]],[[7867,7867],"valid"],[[7868,7868],"mapped",[7869]],[[7869,7869],"valid"],[[7870,7870],"mapped",[7871]],[[7871,7871],"valid"],[[7872,7872],"mapped",[7873]],[[7873,7873],"valid"],[[7874,7874],"mapped",[7875]],[[7875,7875],"valid"],[[7876,7876],"mapped",[7877]],[[7877,7877],"valid"],[[7878,7878],"mapped",[7879]],[[7879,7879],"valid"],[[7880,7880],"mapped",[7881]],[[7881,7881],"valid"],[[7882,7882],"mapped",[7883]],[[7883,7883],"valid"],[[7884,7884],"mapped",[7885]],[[7885,7885],"valid"],[[7886,7886],"mapped",[7887]],[[7887,7887],"valid"],[[7888,7888],"mapped",[7889]],[[7889,7889],"valid"],[[7890,7890],"mapped",[7891]],[[7891,7891],"valid"],[[7892,7892],"mapped",[7893]],[[7893,7893],"valid"],[[7894,7894],"mapped",[7895]],[[7895,7895],"valid"],[[7896,7896],"mapped",[7897]],[[7897,7897],"valid"],[[7898,7898],"mapped",[7899]],[[7899,7899],"valid"],[[7900,7900],"mapped",[7901]],[[7901,7901],"valid"],[[7902,7902],"mapped",[7903]],[[7903,7903],"valid"],[[7904,7904],"mapped",[7905]],[[7905,7905],"valid"],[[7906,7906],"mapped",[7907]],[[7907,7907],"valid"],[[7908,7908],"mapped",[7909]],[[7909,7909],"valid"],[[7910,7910],"mapped",[7911]],[[7911,7911],"valid"],[[7912,7912],"mapped",[7913]],[[7913,7913],"valid"],[[7914,7914],"mapped",[7915]],[[7915,7915],"valid"],[[7916,7916],"mapped",[7917]],[[7917,7917],"valid"],[[7918,7918],"mapped",[7919]],[[7919,7919],"valid"],[[7920,7920],"mapped",[7921]],[[7921,7921],"valid"],[[7922,7922],"mapped",[7923]],[[7923,7923],"valid"],[[7924,7924],"mapped",[7925]],[[7925,7925],"valid"],[[7926,7926],"mapped",[7927]],[[7927,7927],"valid"],[[7928,7928],"mapped",[7929]],[[7929,7929],"valid"],[[7930,7930],"mapped",[7931]],[[7931,7931],"valid"],[[7932,7932],"mapped",[7933]],[[7933,7933],"valid"],[[7934,7934],"mapped",[7935]],[[7935,7935],"valid"],[[7936,7943],"valid"],[[7944,7944],"mapped",[7936]],[[7945,7945],"mapped",[7937]],[[7946,7946],"mapped",[7938]],[[7947,7947],"mapped",[7939]],[[7948,7948],"mapped",[7940]],[[7949,7949],"mapped",[7941]],[[7950,7950],"mapped",[7942]],[[7951,7951],"mapped",[7943]],[[7952,7957],"valid"],[[7958,7959],"disallowed"],[[7960,7960],"mapped",[7952]],[[7961,7961],"mapped",[7953]],[[7962,7962],"mapped",[7954]],[[7963,7963],"mapped",[7955]],[[7964,7964],"mapped",[7956]],[[7965,7965],"mapped",[7957]],[[7966,7967],"disallowed"],[[7968,7975],"valid"],[[7976,7976],"mapped",[7968]],[[7977,7977],"mapped",[7969]],[[7978,7978],"mapped",[7970]],[[7979,7979],"mapped",[7971]],[[7980,7980],"mapped",[7972]],[[7981,7981],"mapped",[7973]],[[7982,7982],"mapped",[7974]],[[7983,7983],"mapped",[7975]],[[7984,7991],"valid"],[[7992,7992],"mapped",[7984]],[[7993,7993],"mapped",[7985]],[[7994,7994],"mapped",[7986]],[[7995,7995],"mapped",[7987]],[[7996,7996],"mapped",[7988]],[[7997,7997],"mapped",[7989]],[[7998,7998],"mapped",[7990]],[[7999,7999],"mapped",[7991]],[[8000,8005],"valid"],[[8006,8007],"disallowed"],[[8008,8008],"mapped",[8000]],[[8009,8009],"mapped",[8001]],[[8010,8010],"mapped",[8002]],[[8011,8011],"mapped",[8003]],[[8012,8012],"mapped",[8004]],[[8013,8013],"mapped",[8005]],[[8014,8015],"disallowed"],[[8016,8023],"valid"],[[8024,8024],"disallowed"],[[8025,8025],"mapped",[8017]],[[8026,8026],"disallowed"],[[8027,8027],"mapped",[8019]],[[8028,8028],"disallowed"],[[8029,8029],"mapped",[8021]],[[8030,8030],"disallowed"],[[8031,8031],"mapped",[8023]],[[8032,8039],"valid"],[[8040,8040],"mapped",[8032]],[[8041,8041],"mapped",[8033]],[[8042,8042],"mapped",[8034]],[[8043,8043],"mapped",[8035]],[[8044,8044],"mapped",[8036]],[[8045,8045],"mapped",[8037]],[[8046,8046],"mapped",[8038]],[[8047,8047],"mapped",[8039]],[[8048,8048],"valid"],[[8049,8049],"mapped",[940]],[[8050,8050],"valid"],[[8051,8051],"mapped",[941]],[[8052,8052],"valid"],[[8053,8053],"mapped",[942]],[[8054,8054],"valid"],[[8055,8055],"mapped",[943]],[[8056,8056],"valid"],[[8057,8057],"mapped",[972]],[[8058,8058],"valid"],[[8059,8059],"mapped",[973]],[[8060,8060],"valid"],[[8061,8061],"mapped",[974]],[[8062,8063],"disallowed"],[[8064,8064],"mapped",[7936,953]],[[8065,8065],"mapped",[7937,953]],[[8066,8066],"mapped",[7938,953]],[[8067,8067],"mapped",[7939,953]],[[8068,8068],"mapped",[7940,953]],[[8069,8069],"mapped",[7941,953]],[[8070,8070],"mapped",[7942,953]],[[8071,8071],"mapped",[7943,953]],[[8072,8072],"mapped",[7936,953]],[[8073,8073],"mapped",[7937,953]],[[8074,8074],"mapped",[7938,953]],[[8075,8075],"mapped",[7939,953]],[[8076,8076],"mapped",[7940,953]],[[8077,8077],"mapped",[7941,953]],[[8078,8078],"mapped",[7942,953]],[[8079,8079],"mapped",[7943,953]],[[8080,8080],"mapped",[7968,953]],[[8081,8081],"mapped",[7969,953]],[[8082,8082],"mapped",[7970,953]],[[8083,8083],"mapped",[7971,953]],[[8084,8084],"mapped",[7972,953]],[[8085,8085],"mapped",[7973,953]],[[8086,8086],"mapped",[7974,953]],[[8087,8087],"mapped",[7975,953]],[[8088,8088],"mapped",[7968,953]],[[8089,8089],"mapped",[7969,953]],[[8090,8090],"mapped",[7970,953]],[[8091,8091],"mapped",[7971,953]],[[8092,8092],"mapped",[7972,953]],[[8093,8093],"mapped",[7973,953]],[[8094,8094],"mapped",[7974,953]],[[8095,8095],"mapped",[7975,953]],[[8096,8096],"mapped",[8032,953]],[[8097,8097],"mapped",[8033,953]],[[8098,8098],"mapped",[8034,953]],[[8099,8099],"mapped",[8035,953]],[[8100,8100],"mapped",[8036,953]],[[8101,8101],"mapped",[8037,953]],[[8102,8102],"mapped",[8038,953]],[[8103,8103],"mapped",[8039,953]],[[8104,8104],"mapped",[8032,953]],[[8105,8105],"mapped",[8033,953]],[[8106,8106],"mapped",[8034,953]],[[8107,8107],"mapped",[8035,953]],[[8108,8108],"mapped",[8036,953]],[[8109,8109],"mapped",[8037,953]],[[8110,8110],"mapped",[8038,953]],[[8111,8111],"mapped",[8039,953]],[[8112,8113],"valid"],[[8114,8114],"mapped",[8048,953]],[[8115,8115],"mapped",[945,953]],[[8116,8116],"mapped",[940,953]],[[8117,8117],"disallowed"],[[8118,8118],"valid"],[[8119,8119],"mapped",[8118,953]],[[8120,8120],"mapped",[8112]],[[8121,8121],"mapped",[8113]],[[8122,8122],"mapped",[8048]],[[8123,8123],"mapped",[940]],[[8124,8124],"mapped",[945,953]],[[8125,8125],"disallowed_STD3_mapped",[32,787]],[[8126,8126],"mapped",[953]],[[8127,8127],"disallowed_STD3_mapped",[32,787]],[[8128,8128],"disallowed_STD3_mapped",[32,834]],[[8129,8129],"disallowed_STD3_mapped",[32,776,834]],[[8130,8130],"mapped",[8052,953]],[[8131,8131],"mapped",[951,953]],[[8132,8132],"mapped",[942,953]],[[8133,8133],"disallowed"],[[8134,8134],"valid"],[[8135,8135],"mapped",[8134,953]],[[8136,8136],"mapped",[8050]],[[8137,8137],"mapped",[941]],[[8138,8138],"mapped",[8052]],[[8139,8139],"mapped",[942]],[[8140,8140],"mapped",[951,953]],[[8141,8141],"disallowed_STD3_mapped",[32,787,768]],[[8142,8142],"disallowed_STD3_mapped",[32,787,769]],[[8143,8143],"disallowed_STD3_mapped",[32,787,834]],[[8144,8146],"valid"],[[8147,8147],"mapped",[912]],[[8148,8149],"disallowed"],[[8150,8151],"valid"],[[8152,8152],"mapped",[8144]],[[8153,8153],"mapped",[8145]],[[8154,8154],"mapped",[8054]],[[8155,8155],"mapped",[943]],[[8156,8156],"disallowed"],[[8157,8157],"disallowed_STD3_mapped",[32,788,768]],[[8158,8158],"disallowed_STD3_mapped",[32,788,769]],[[8159,8159],"disallowed_STD3_mapped",[32,788,834]],[[8160,8162],"valid"],[[8163,8163],"mapped",[944]],[[8164,8167],"valid"],[[8168,8168],"mapped",[8160]],[[8169,8169],"mapped",[8161]],[[8170,8170],"mapped",[8058]],[[8171,8171],"mapped",[973]],[[8172,8172],"mapped",[8165]],[[8173,8173],"disallowed_STD3_mapped",[32,776,768]],[[8174,8174],"disallowed_STD3_mapped",[32,776,769]],[[8175,8175],"disallowed_STD3_mapped",[96]],[[8176,8177],"disallowed"],[[8178,8178],"mapped",[8060,953]],[[8179,8179],"mapped",[969,953]],[[8180,8180],"mapped",[974,953]],[[8181,8181],"disallowed"],[[8182,8182],"valid"],[[8183,8183],"mapped",[8182,953]],[[8184,8184],"mapped",[8056]],[[8185,8185],"mapped",[972]],[[8186,8186],"mapped",[8060]],[[8187,8187],"mapped",[974]],[[8188,8188],"mapped",[969,953]],[[8189,8189],"disallowed_STD3_mapped",[32,769]],[[8190,8190],"disallowed_STD3_mapped",[32,788]],[[8191,8191],"disallowed"],[[8192,8202],"disallowed_STD3_mapped",[32]],[[8203,8203],"ignored"],[[8204,8205],"deviation",[]],[[8206,8207],"disallowed"],[[8208,8208],"valid",[],"NV8"],[[8209,8209],"mapped",[8208]],[[8210,8214],"valid",[],"NV8"],[[8215,8215],"disallowed_STD3_mapped",[32,819]],[[8216,8227],"valid",[],"NV8"],[[8228,8230],"disallowed"],[[8231,8231],"valid",[],"NV8"],[[8232,8238],"disallowed"],[[8239,8239],"disallowed_STD3_mapped",[32]],[[8240,8242],"valid",[],"NV8"],[[8243,8243],"mapped",[8242,8242]],[[8244,8244],"mapped",[8242,8242,8242]],[[8245,8245],"valid",[],"NV8"],[[8246,8246],"mapped",[8245,8245]],[[8247,8247],"mapped",[8245,8245,8245]],[[8248,8251],"valid",[],"NV8"],[[8252,8252],"disallowed_STD3_mapped",[33,33]],[[8253,8253],"valid",[],"NV8"],[[8254,8254],"disallowed_STD3_mapped",[32,773]],[[8255,8262],"valid",[],"NV8"],[[8263,8263],"disallowed_STD3_mapped",[63,63]],[[8264,8264],"disallowed_STD3_mapped",[63,33]],[[8265,8265],"disallowed_STD3_mapped",[33,63]],[[8266,8269],"valid",[],"NV8"],[[8270,8274],"valid",[],"NV8"],[[8275,8276],"valid",[],"NV8"],[[8277,8278],"valid",[],"NV8"],[[8279,8279],"mapped",[8242,8242,8242,8242]],[[8280,8286],"valid",[],"NV8"],[[8287,8287],"disallowed_STD3_mapped",[32]],[[8288,8288],"ignored"],[[8289,8291],"disallowed"],[[8292,8292],"ignored"],[[8293,8293],"disallowed"],[[8294,8297],"disallowed"],[[8298,8303],"disallowed"],[[8304,8304],"mapped",[48]],[[8305,8305],"mapped",[105]],[[8306,8307],"disallowed"],[[8308,8308],"mapped",[52]],[[8309,8309],"mapped",[53]],[[8310,8310],"mapped",[54]],[[8311,8311],"mapped",[55]],[[8312,8312],"mapped",[56]],[[8313,8313],"mapped",[57]],[[8314,8314],"disallowed_STD3_mapped",[43]],[[8315,8315],"mapped",[8722]],[[8316,8316],"disallowed_STD3_mapped",[61]],[[8317,8317],"disallowed_STD3_mapped",[40]],[[8318,8318],"disallowed_STD3_mapped",[41]],[[8319,8319],"mapped",[110]],[[8320,8320],"mapped",[48]],[[8321,8321],"mapped",[49]],[[8322,8322],"mapped",[50]],[[8323,8323],"mapped",[51]],[[8324,8324],"mapped",[52]],[[8325,8325],"mapped",[53]],[[8326,8326],"mapped",[54]],[[8327,8327],"mapped",[55]],[[8328,8328],"mapped",[56]],[[8329,8329],"mapped",[57]],[[8330,8330],"disallowed_STD3_mapped",[43]],[[8331,8331],"mapped",[8722]],[[8332,8332],"disallowed_STD3_mapped",[61]],[[8333,8333],"disallowed_STD3_mapped",[40]],[[8334,8334],"disallowed_STD3_mapped",[41]],[[8335,8335],"disallowed"],[[8336,8336],"mapped",[97]],[[8337,8337],"mapped",[101]],[[8338,8338],"mapped",[111]],[[8339,8339],"mapped",[120]],[[8340,8340],"mapped",[601]],[[8341,8341],"mapped",[104]],[[8342,8342],"mapped",[107]],[[8343,8343],"mapped",[108]],[[8344,8344],"mapped",[109]],[[8345,8345],"mapped",[110]],[[8346,8346],"mapped",[112]],[[8347,8347],"mapped",[115]],[[8348,8348],"mapped",[116]],[[8349,8351],"disallowed"],[[8352,8359],"valid",[],"NV8"],[[8360,8360],"mapped",[114,115]],[[8361,8362],"valid",[],"NV8"],[[8363,8363],"valid",[],"NV8"],[[8364,8364],"valid",[],"NV8"],[[8365,8367],"valid",[],"NV8"],[[8368,8369],"valid",[],"NV8"],[[8370,8373],"valid",[],"NV8"],[[8374,8376],"valid",[],"NV8"],[[8377,8377],"valid",[],"NV8"],[[8378,8378],"valid",[],"NV8"],[[8379,8381],"valid",[],"NV8"],[[8382,8382],"valid",[],"NV8"],[[8383,8399],"disallowed"],[[8400,8417],"valid",[],"NV8"],[[8418,8419],"valid",[],"NV8"],[[8420,8426],"valid",[],"NV8"],[[8427,8427],"valid",[],"NV8"],[[8428,8431],"valid",[],"NV8"],[[8432,8432],"valid",[],"NV8"],[[8433,8447],"disallowed"],[[8448,8448],"disallowed_STD3_mapped",[97,47,99]],[[8449,8449],"disallowed_STD3_mapped",[97,47,115]],[[8450,8450],"mapped",[99]],[[8451,8451],"mapped",[176,99]],[[8452,8452],"valid",[],"NV8"],[[8453,8453],"disallowed_STD3_mapped",[99,47,111]],[[8454,8454],"disallowed_STD3_mapped",[99,47,117]],[[8455,8455],"mapped",[603]],[[8456,8456],"valid",[],"NV8"],[[8457,8457],"mapped",[176,102]],[[8458,8458],"mapped",[103]],[[8459,8462],"mapped",[104]],[[8463,8463],"mapped",[295]],[[8464,8465],"mapped",[105]],[[8466,8467],"mapped",[108]],[[8468,8468],"valid",[],"NV8"],[[8469,8469],"mapped",[110]],[[8470,8470],"mapped",[110,111]],[[8471,8472],"valid",[],"NV8"],[[8473,8473],"mapped",[112]],[[8474,8474],"mapped",[113]],[[8475,8477],"mapped",[114]],[[8478,8479],"valid",[],"NV8"],[[8480,8480],"mapped",[115,109]],[[8481,8481],"mapped",[116,101,108]],[[8482,8482],"mapped",[116,109]],[[8483,8483],"valid",[],"NV8"],[[8484,8484],"mapped",[122]],[[8485,8485],"valid",[],"NV8"],[[8486,8486],"mapped",[969]],[[8487,8487],"valid",[],"NV8"],[[8488,8488],"mapped",[122]],[[8489,8489],"valid",[],"NV8"],[[8490,8490],"mapped",[107]],[[8491,8491],"mapped",[229]],[[8492,8492],"mapped",[98]],[[8493,8493],"mapped",[99]],[[8494,8494],"valid",[],"NV8"],[[8495,8496],"mapped",[101]],[[8497,8497],"mapped",[102]],[[8498,8498],"disallowed"],[[8499,8499],"mapped",[109]],[[8500,8500],"mapped",[111]],[[8501,8501],"mapped",[1488]],[[8502,8502],"mapped",[1489]],[[8503,8503],"mapped",[1490]],[[8504,8504],"mapped",[1491]],[[8505,8505],"mapped",[105]],[[8506,8506],"valid",[],"NV8"],[[8507,8507],"mapped",[102,97,120]],[[8508,8508],"mapped",[960]],[[8509,8510],"mapped",[947]],[[8511,8511],"mapped",[960]],[[8512,8512],"mapped",[8721]],[[8513,8516],"valid",[],"NV8"],[[8517,8518],"mapped",[100]],[[8519,8519],"mapped",[101]],[[8520,8520],"mapped",[105]],[[8521,8521],"mapped",[106]],[[8522,8523],"valid",[],"NV8"],[[8524,8524],"valid",[],"NV8"],[[8525,8525],"valid",[],"NV8"],[[8526,8526],"valid"],[[8527,8527],"valid",[],"NV8"],[[8528,8528],"mapped",[49,8260,55]],[[8529,8529],"mapped",[49,8260,57]],[[8530,8530],"mapped",[49,8260,49,48]],[[8531,8531],"mapped",[49,8260,51]],[[8532,8532],"mapped",[50,8260,51]],[[8533,8533],"mapped",[49,8260,53]],[[8534,8534],"mapped",[50,8260,53]],[[8535,8535],"mapped",[51,8260,53]],[[8536,8536],"mapped",[52,8260,53]],[[8537,8537],"mapped",[49,8260,54]],[[8538,8538],"mapped",[53,8260,54]],[[8539,8539],"mapped",[49,8260,56]],[[8540,8540],"mapped",[51,8260,56]],[[8541,8541],"mapped",[53,8260,56]],[[8542,8542],"mapped",[55,8260,56]],[[8543,8543],"mapped",[49,8260]],[[8544,8544],"mapped",[105]],[[8545,8545],"mapped",[105,105]],[[8546,8546],"mapped",[105,105,105]],[[8547,8547],"mapped",[105,118]],[[8548,8548],"mapped",[118]],[[8549,8549],"mapped",[118,105]],[[8550,8550],"mapped",[118,105,105]],[[8551,8551],"mapped",[118,105,105,105]],[[8552,8552],"mapped",[105,120]],[[8553,8553],"mapped",[120]],[[8554,8554],"mapped",[120,105]],[[8555,8555],"mapped",[120,105,105]],[[8556,8556],"mapped",[108]],[[8557,8557],"mapped",[99]],[[8558,8558],"mapped",[100]],[[8559,8559],"mapped",[109]],[[8560,8560],"mapped",[105]],[[8561,8561],"mapped",[105,105]],[[8562,8562],"mapped",[105,105,105]],[[8563,8563],"mapped",[105,118]],[[8564,8564],"mapped",[118]],[[8565,8565],"mapped",[118,105]],[[8566,8566],"mapped",[118,105,105]],[[8567,8567],"mapped",[118,105,105,105]],[[8568,8568],"mapped",[105,120]],[[8569,8569],"mapped",[120]],[[8570,8570],"mapped",[120,105]],[[8571,8571],"mapped",[120,105,105]],[[8572,8572],"mapped",[108]],[[8573,8573],"mapped",[99]],[[8574,8574],"mapped",[100]],[[8575,8575],"mapped",[109]],[[8576,8578],"valid",[],"NV8"],[[8579,8579],"disallowed"],[[8580,8580],"valid"],[[8581,8584],"valid",[],"NV8"],[[8585,8585],"mapped",[48,8260,51]],[[8586,8587],"valid",[],"NV8"],[[8588,8591],"disallowed"],[[8592,8682],"valid",[],"NV8"],[[8683,8691],"valid",[],"NV8"],[[8692,8703],"valid",[],"NV8"],[[8704,8747],"valid",[],"NV8"],[[8748,8748],"mapped",[8747,8747]],[[8749,8749],"mapped",[8747,8747,8747]],[[8750,8750],"valid",[],"NV8"],[[8751,8751],"mapped",[8750,8750]],[[8752,8752],"mapped",[8750,8750,8750]],[[8753,8799],"valid",[],"NV8"],[[8800,8800],"disallowed_STD3_valid"],[[8801,8813],"valid",[],"NV8"],[[8814,8815],"disallowed_STD3_valid"],[[8816,8945],"valid",[],"NV8"],[[8946,8959],"valid",[],"NV8"],[[8960,8960],"valid",[],"NV8"],[[8961,8961],"valid",[],"NV8"],[[8962,9000],"valid",[],"NV8"],[[9001,9001],"mapped",[12296]],[[9002,9002],"mapped",[12297]],[[9003,9082],"valid",[],"NV8"],[[9083,9083],"valid",[],"NV8"],[[9084,9084],"valid",[],"NV8"],[[9085,9114],"valid",[],"NV8"],[[9115,9166],"valid",[],"NV8"],[[9167,9168],"valid",[],"NV8"],[[9169,9179],"valid",[],"NV8"],[[9180,9191],"valid",[],"NV8"],[[9192,9192],"valid",[],"NV8"],[[9193,9203],"valid",[],"NV8"],[[9204,9210],"valid",[],"NV8"],[[9211,9215],"disallowed"],[[9216,9252],"valid",[],"NV8"],[[9253,9254],"valid",[],"NV8"],[[9255,9279],"disallowed"],[[9280,9290],"valid",[],"NV8"],[[9291,9311],"disallowed"],[[9312,9312],"mapped",[49]],[[9313,9313],"mapped",[50]],[[9314,9314],"mapped",[51]],[[9315,9315],"mapped",[52]],[[9316,9316],"mapped",[53]],[[9317,9317],"mapped",[54]],[[9318,9318],"mapped",[55]],[[9319,9319],"mapped",[56]],[[9320,9320],"mapped",[57]],[[9321,9321],"mapped",[49,48]],[[9322,9322],"mapped",[49,49]],[[9323,9323],"mapped",[49,50]],[[9324,9324],"mapped",[49,51]],[[9325,9325],"mapped",[49,52]],[[9326,9326],"mapped",[49,53]],[[9327,9327],"mapped",[49,54]],[[9328,9328],"mapped",[49,55]],[[9329,9329],"mapped",[49,56]],[[9330,9330],"mapped",[49,57]],[[9331,9331],"mapped",[50,48]],[[9332,9332],"disallowed_STD3_mapped",[40,49,41]],[[9333,9333],"disallowed_STD3_mapped",[40,50,41]],[[9334,9334],"disallowed_STD3_mapped",[40,51,41]],[[9335,9335],"disallowed_STD3_mapped",[40,52,41]],[[9336,9336],"disallowed_STD3_mapped",[40,53,41]],[[9337,9337],"disallowed_STD3_mapped",[40,54,41]],[[9338,9338],"disallowed_STD3_mapped",[40,55,41]],[[9339,9339],"disallowed_STD3_mapped",[40,56,41]],[[9340,9340],"disallowed_STD3_mapped",[40,57,41]],[[9341,9341],"disallowed_STD3_mapped",[40,49,48,41]],[[9342,9342],"disallowed_STD3_mapped",[40,49,49,41]],[[9343,9343],"disallowed_STD3_mapped",[40,49,50,41]],[[9344,9344],"disallowed_STD3_mapped",[40,49,51,41]],[[9345,9345],"disallowed_STD3_mapped",[40,49,52,41]],[[9346,9346],"disallowed_STD3_mapped",[40,49,53,41]],[[9347,9347],"disallowed_STD3_mapped",[40,49,54,41]],[[9348,9348],"disallowed_STD3_mapped",[40,49,55,41]],[[9349,9349],"disallowed_STD3_mapped",[40,49,56,41]],[[9350,9350],"disallowed_STD3_mapped",[40,49,57,41]],[[9351,9351],"disallowed_STD3_mapped",[40,50,48,41]],[[9352,9371],"disallowed"],[[9372,9372],"disallowed_STD3_mapped",[40,97,41]],[[9373,9373],"disallowed_STD3_mapped",[40,98,41]],[[9374,9374],"disallowed_STD3_mapped",[40,99,41]],[[9375,9375],"disallowed_STD3_mapped",[40,100,41]],[[9376,9376],"disallowed_STD3_mapped",[40,101,41]],[[9377,9377],"disallowed_STD3_mapped",[40,102,41]],[[9378,9378],"disallowed_STD3_mapped",[40,103,41]],[[9379,9379],"disallowed_STD3_mapped",[40,104,41]],[[9380,9380],"disallowed_STD3_mapped",[40,105,41]],[[9381,9381],"disallowed_STD3_mapped",[40,106,41]],[[9382,9382],"disallowed_STD3_mapped",[40,107,41]],[[9383,9383],"disallowed_STD3_mapped",[40,108,41]],[[9384,9384],"disallowed_STD3_mapped",[40,109,41]],[[9385,9385],"disallowed_STD3_mapped",[40,110,41]],[[9386,9386],"disallowed_STD3_mapped",[40,111,41]],[[9387,9387],"disallowed_STD3_mapped",[40,112,41]],[[9388,9388],"disallowed_STD3_mapped",[40,113,41]],[[9389,9389],"disallowed_STD3_mapped",[40,114,41]],[[9390,9390],"disallowed_STD3_mapped",[40,115,41]],[[9391,9391],"disallowed_STD3_mapped",[40,116,41]],[[9392,9392],"disallowed_STD3_mapped",[40,117,41]],[[9393,9393],"disallowed_STD3_mapped",[40,118,41]],[[9394,9394],"disallowed_STD3_mapped",[40,119,41]],[[9395,9395],"disallowed_STD3_mapped",[40,120,41]],[[9396,9396],"disallowed_STD3_mapped",[40,121,41]],[[9397,9397],"disallowed_STD3_mapped",[40,122,41]],[[9398,9398],"mapped",[97]],[[9399,9399],"mapped",[98]],[[9400,9400],"mapped",[99]],[[9401,9401],"mapped",[100]],[[9402,9402],"mapped",[101]],[[9403,9403],"mapped",[102]],[[9404,9404],"mapped",[103]],[[9405,9405],"mapped",[104]],[[9406,9406],"mapped",[105]],[[9407,9407],"mapped",[106]],[[9408,9408],"mapped",[107]],[[9409,9409],"mapped",[108]],[[9410,9410],"mapped",[109]],[[9411,9411],"mapped",[110]],[[9412,9412],"mapped",[111]],[[9413,9413],"mapped",[112]],[[9414,9414],"mapped",[113]],[[9415,9415],"mapped",[114]],[[9416,9416],"mapped",[115]],[[9417,9417],"mapped",[116]],[[9418,9418],"mapped",[117]],[[9419,9419],"mapped",[118]],[[9420,9420],"mapped",[119]],[[9421,9421],"mapped",[120]],[[9422,9422],"mapped",[121]],[[9423,9423],"mapped",[122]],[[9424,9424],"mapped",[97]],[[9425,9425],"mapped",[98]],[[9426,9426],"mapped",[99]],[[9427,9427],"mapped",[100]],[[9428,9428],"mapped",[101]],[[9429,9429],"mapped",[102]],[[9430,9430],"mapped",[103]],[[9431,9431],"mapped",[104]],[[9432,9432],"mapped",[105]],[[9433,9433],"mapped",[106]],[[9434,9434],"mapped",[107]],[[9435,9435],"mapped",[108]],[[9436,9436],"mapped",[109]],[[9437,9437],"mapped",[110]],[[9438,9438],"mapped",[111]],[[9439,9439],"mapped",[112]],[[9440,9440],"mapped",[113]],[[9441,9441],"mapped",[114]],[[9442,9442],"mapped",[115]],[[9443,9443],"mapped",[116]],[[9444,9444],"mapped",[117]],[[9445,9445],"mapped",[118]],[[9446,9446],"mapped",[119]],[[9447,9447],"mapped",[120]],[[9448,9448],"mapped",[121]],[[9449,9449],"mapped",[122]],[[9450,9450],"mapped",[48]],[[9451,9470],"valid",[],"NV8"],[[9471,9471],"valid",[],"NV8"],[[9472,9621],"valid",[],"NV8"],[[9622,9631],"valid",[],"NV8"],[[9632,9711],"valid",[],"NV8"],[[9712,9719],"valid",[],"NV8"],[[9720,9727],"valid",[],"NV8"],[[9728,9747],"valid",[],"NV8"],[[9748,9749],"valid",[],"NV8"],[[9750,9751],"valid",[],"NV8"],[[9752,9752],"valid",[],"NV8"],[[9753,9753],"valid",[],"NV8"],[[9754,9839],"valid",[],"NV8"],[[9840,9841],"valid",[],"NV8"],[[9842,9853],"valid",[],"NV8"],[[9854,9855],"valid",[],"NV8"],[[9856,9865],"valid",[],"NV8"],[[9866,9873],"valid",[],"NV8"],[[9874,9884],"valid",[],"NV8"],[[9885,9885],"valid",[],"NV8"],[[9886,9887],"valid",[],"NV8"],[[9888,9889],"valid",[],"NV8"],[[9890,9905],"valid",[],"NV8"],[[9906,9906],"valid",[],"NV8"],[[9907,9916],"valid",[],"NV8"],[[9917,9919],"valid",[],"NV8"],[[9920,9923],"valid",[],"NV8"],[[9924,9933],"valid",[],"NV8"],[[9934,9934],"valid",[],"NV8"],[[9935,9953],"valid",[],"NV8"],[[9954,9954],"valid",[],"NV8"],[[9955,9955],"valid",[],"NV8"],[[9956,9959],"valid",[],"NV8"],[[9960,9983],"valid",[],"NV8"],[[9984,9984],"valid",[],"NV8"],[[9985,9988],"valid",[],"NV8"],[[9989,9989],"valid",[],"NV8"],[[9990,9993],"valid",[],"NV8"],[[9994,9995],"valid",[],"NV8"],[[9996,10023],"valid",[],"NV8"],[[10024,10024],"valid",[],"NV8"],[[10025,10059],"valid",[],"NV8"],[[10060,10060],"valid",[],"NV8"],[[10061,10061],"valid",[],"NV8"],[[10062,10062],"valid",[],"NV8"],[[10063,10066],"valid",[],"NV8"],[[10067,10069],"valid",[],"NV8"],[[10070,10070],"valid",[],"NV8"],[[10071,10071],"valid",[],"NV8"],[[10072,10078],"valid",[],"NV8"],[[10079,10080],"valid",[],"NV8"],[[10081,10087],"valid",[],"NV8"],[[10088,10101],"valid",[],"NV8"],[[10102,10132],"valid",[],"NV8"],[[10133,10135],"valid",[],"NV8"],[[10136,10159],"valid",[],"NV8"],[[10160,10160],"valid",[],"NV8"],[[10161,10174],"valid",[],"NV8"],[[10175,10175],"valid",[],"NV8"],[[10176,10182],"valid",[],"NV8"],[[10183,10186],"valid",[],"NV8"],[[10187,10187],"valid",[],"NV8"],[[10188,10188],"valid",[],"NV8"],[[10189,10189],"valid",[],"NV8"],[[10190,10191],"valid",[],"NV8"],[[10192,10219],"valid",[],"NV8"],[[10220,10223],"valid",[],"NV8"],[[10224,10239],"valid",[],"NV8"],[[10240,10495],"valid",[],"NV8"],[[10496,10763],"valid",[],"NV8"],[[10764,10764],"mapped",[8747,8747,8747,8747]],[[10765,10867],"valid",[],"NV8"],[[10868,10868],"disallowed_STD3_mapped",[58,58,61]],[[10869,10869],"disallowed_STD3_mapped",[61,61]],[[10870,10870],"disallowed_STD3_mapped",[61,61,61]],[[10871,10971],"valid",[],"NV8"],[[10972,10972],"mapped",[10973,824]],[[10973,11007],"valid",[],"NV8"],[[11008,11021],"valid",[],"NV8"],[[11022,11027],"valid",[],"NV8"],[[11028,11034],"valid",[],"NV8"],[[11035,11039],"valid",[],"NV8"],[[11040,11043],"valid",[],"NV8"],[[11044,11084],"valid",[],"NV8"],[[11085,11087],"valid",[],"NV8"],[[11088,11092],"valid",[],"NV8"],[[11093,11097],"valid",[],"NV8"],[[11098,11123],"valid",[],"NV8"],[[11124,11125],"disallowed"],[[11126,11157],"valid",[],"NV8"],[[11158,11159],"disallowed"],[[11160,11193],"valid",[],"NV8"],[[11194,11196],"disallowed"],[[11197,11208],"valid",[],"NV8"],[[11209,11209],"disallowed"],[[11210,11217],"valid",[],"NV8"],[[11218,11243],"disallowed"],[[11244,11247],"valid",[],"NV8"],[[11248,11263],"disallowed"],[[11264,11264],"mapped",[11312]],[[11265,11265],"mapped",[11313]],[[11266,11266],"mapped",[11314]],[[11267,11267],"mapped",[11315]],[[11268,11268],"mapped",[11316]],[[11269,11269],"mapped",[11317]],[[11270,11270],"mapped",[11318]],[[11271,11271],"mapped",[11319]],[[11272,11272],"mapped",[11320]],[[11273,11273],"mapped",[11321]],[[11274,11274],"mapped",[11322]],[[11275,11275],"mapped",[11323]],[[11276,11276],"mapped",[11324]],[[11277,11277],"mapped",[11325]],[[11278,11278],"mapped",[11326]],[[11279,11279],"mapped",[11327]],[[11280,11280],"mapped",[11328]],[[11281,11281],"mapped",[11329]],[[11282,11282],"mapped",[11330]],[[11283,11283],"mapped",[11331]],[[11284,11284],"mapped",[11332]],[[11285,11285],"mapped",[11333]],[[11286,11286],"mapped",[11334]],[[11287,11287],"mapped",[11335]],[[11288,11288],"mapped",[11336]],[[11289,11289],"mapped",[11337]],[[11290,11290],"mapped",[11338]],[[11291,11291],"mapped",[11339]],[[11292,11292],"mapped",[11340]],[[11293,11293],"mapped",[11341]],[[11294,11294],"mapped",[11342]],[[11295,11295],"mapped",[11343]],[[11296,11296],"mapped",[11344]],[[11297,11297],"mapped",[11345]],[[11298,11298],"mapped",[11346]],[[11299,11299],"mapped",[11347]],[[11300,11300],"mapped",[11348]],[[11301,11301],"mapped",[11349]],[[11302,11302],"mapped",[11350]],[[11303,11303],"mapped",[11351]],[[11304,11304],"mapped",[11352]],[[11305,11305],"mapped",[11353]],[[11306,11306],"mapped",[11354]],[[11307,11307],"mapped",[11355]],[[11308,11308],"mapped",[11356]],[[11309,11309],"mapped",[11357]],[[11310,11310],"mapped",[11358]],[[11311,11311],"disallowed"],[[11312,11358],"valid"],[[11359,11359],"disallowed"],[[11360,11360],"mapped",[11361]],[[11361,11361],"valid"],[[11362,11362],"mapped",[619]],[[11363,11363],"mapped",[7549]],[[11364,11364],"mapped",[637]],[[11365,11366],"valid"],[[11367,11367],"mapped",[11368]],[[11368,11368],"valid"],[[11369,11369],"mapped",[11370]],[[11370,11370],"valid"],[[11371,11371],"mapped",[11372]],[[11372,11372],"valid"],[[11373,11373],"mapped",[593]],[[11374,11374],"mapped",[625]],[[11375,11375],"mapped",[592]],[[11376,11376],"mapped",[594]],[[11377,11377],"valid"],[[11378,11378],"mapped",[11379]],[[11379,11379],"valid"],[[11380,11380],"valid"],[[11381,11381],"mapped",[11382]],[[11382,11383],"valid"],[[11384,11387],"valid"],[[11388,11388],"mapped",[106]],[[11389,11389],"mapped",[118]],[[11390,11390],"mapped",[575]],[[11391,11391],"mapped",[576]],[[11392,11392],"mapped",[11393]],[[11393,11393],"valid"],[[11394,11394],"mapped",[11395]],[[11395,11395],"valid"],[[11396,11396],"mapped",[11397]],[[11397,11397],"valid"],[[11398,11398],"mapped",[11399]],[[11399,11399],"valid"],[[11400,11400],"mapped",[11401]],[[11401,11401],"valid"],[[11402,11402],"mapped",[11403]],[[11403,11403],"valid"],[[11404,11404],"mapped",[11405]],[[11405,11405],"valid"],[[11406,11406],"mapped",[11407]],[[11407,11407],"valid"],[[11408,11408],"mapped",[11409]],[[11409,11409],"valid"],[[11410,11410],"mapped",[11411]],[[11411,11411],"valid"],[[11412,11412],"mapped",[11413]],[[11413,11413],"valid"],[[11414,11414],"mapped",[11415]],[[11415,11415],"valid"],[[11416,11416],"mapped",[11417]],[[11417,11417],"valid"],[[11418,11418],"mapped",[11419]],[[11419,11419],"valid"],[[11420,11420],"mapped",[11421]],[[11421,11421],"valid"],[[11422,11422],"mapped",[11423]],[[11423,11423],"valid"],[[11424,11424],"mapped",[11425]],[[11425,11425],"valid"],[[11426,11426],"mapped",[11427]],[[11427,11427],"valid"],[[11428,11428],"mapped",[11429]],[[11429,11429],"valid"],[[11430,11430],"mapped",[11431]],[[11431,11431],"valid"],[[11432,11432],"mapped",[11433]],[[11433,11433],"valid"],[[11434,11434],"mapped",[11435]],[[11435,11435],"valid"],[[11436,11436],"mapped",[11437]],[[11437,11437],"valid"],[[11438,11438],"mapped",[11439]],[[11439,11439],"valid"],[[11440,11440],"mapped",[11441]],[[11441,11441],"valid"],[[11442,11442],"mapped",[11443]],[[11443,11443],"valid"],[[11444,11444],"mapped",[11445]],[[11445,11445],"valid"],[[11446,11446],"mapped",[11447]],[[11447,11447],"valid"],[[11448,11448],"mapped",[11449]],[[11449,11449],"valid"],[[11450,11450],"mapped",[11451]],[[11451,11451],"valid"],[[11452,11452],"mapped",[11453]],[[11453,11453],"valid"],[[11454,11454],"mapped",[11455]],[[11455,11455],"valid"],[[11456,11456],"mapped",[11457]],[[11457,11457],"valid"],[[11458,11458],"mapped",[11459]],[[11459,11459],"valid"],[[11460,11460],"mapped",[11461]],[[11461,11461],"valid"],[[11462,11462],"mapped",[11463]],[[11463,11463],"valid"],[[11464,11464],"mapped",[11465]],[[11465,11465],"valid"],[[11466,11466],"mapped",[11467]],[[11467,11467],"valid"],[[11468,11468],"mapped",[11469]],[[11469,11469],"valid"],[[11470,11470],"mapped",[11471]],[[11471,11471],"valid"],[[11472,11472],"mapped",[11473]],[[11473,11473],"valid"],[[11474,11474],"mapped",[11475]],[[11475,11475],"valid"],[[11476,11476],"mapped",[11477]],[[11477,11477],"valid"],[[11478,11478],"mapped",[11479]],[[11479,11479],"valid"],[[11480,11480],"mapped",[11481]],[[11481,11481],"valid"],[[11482,11482],"mapped",[11483]],[[11483,11483],"valid"],[[11484,11484],"mapped",[11485]],[[11485,11485],"valid"],[[11486,11486],"mapped",[11487]],[[11487,11487],"valid"],[[11488,11488],"mapped",[11489]],[[11489,11489],"valid"],[[11490,11490],"mapped",[11491]],[[11491,11492],"valid"],[[11493,11498],"valid",[],"NV8"],[[11499,11499],"mapped",[11500]],[[11500,11500],"valid"],[[11501,11501],"mapped",[11502]],[[11502,11505],"valid"],[[11506,11506],"mapped",[11507]],[[11507,11507],"valid"],[[11508,11512],"disallowed"],[[11513,11519],"valid",[],"NV8"],[[11520,11557],"valid"],[[11558,11558],"disallowed"],[[11559,11559],"valid"],[[11560,11564],"disallowed"],[[11565,11565],"valid"],[[11566,11567],"disallowed"],[[11568,11621],"valid"],[[11622,11623],"valid"],[[11624,11630],"disallowed"],[[11631,11631],"mapped",[11617]],[[11632,11632],"valid",[],"NV8"],[[11633,11646],"disallowed"],[[11647,11647],"valid"],[[11648,11670],"valid"],[[11671,11679],"disallowed"],[[11680,11686],"valid"],[[11687,11687],"disallowed"],[[11688,11694],"valid"],[[11695,11695],"disallowed"],[[11696,11702],"valid"],[[11703,11703],"disallowed"],[[11704,11710],"valid"],[[11711,11711],"disallowed"],[[11712,11718],"valid"],[[11719,11719],"disallowed"],[[11720,11726],"valid"],[[11727,11727],"disallowed"],[[11728,11734],"valid"],[[11735,11735],"disallowed"],[[11736,11742],"valid"],[[11743,11743],"disallowed"],[[11744,11775],"valid"],[[11776,11799],"valid",[],"NV8"],[[11800,11803],"valid",[],"NV8"],[[11804,11805],"valid",[],"NV8"],[[11806,11822],"valid",[],"NV8"],[[11823,11823],"valid"],[[11824,11824],"valid",[],"NV8"],[[11825,11825],"valid",[],"NV8"],[[11826,11835],"valid",[],"NV8"],[[11836,11842],"valid",[],"NV8"],[[11843,11903],"disallowed"],[[11904,11929],"valid",[],"NV8"],[[11930,11930],"disallowed"],[[11931,11934],"valid",[],"NV8"],[[11935,11935],"mapped",[27597]],[[11936,12018],"valid",[],"NV8"],[[12019,12019],"mapped",[40863]],[[12020,12031],"disallowed"],[[12032,12032],"mapped",[19968]],[[12033,12033],"mapped",[20008]],[[12034,12034],"mapped",[20022]],[[12035,12035],"mapped",[20031]],[[12036,12036],"mapped",[20057]],[[12037,12037],"mapped",[20101]],[[12038,12038],"mapped",[20108]],[[12039,12039],"mapped",[20128]],[[12040,12040],"mapped",[20154]],[[12041,12041],"mapped",[20799]],[[12042,12042],"mapped",[20837]],[[12043,12043],"mapped",[20843]],[[12044,12044],"mapped",[20866]],[[12045,12045],"mapped",[20886]],[[12046,12046],"mapped",[20907]],[[12047,12047],"mapped",[20960]],[[12048,12048],"mapped",[20981]],[[12049,12049],"mapped",[20992]],[[12050,12050],"mapped",[21147]],[[12051,12051],"mapped",[21241]],[[12052,12052],"mapped",[21269]],[[12053,12053],"mapped",[21274]],[[12054,12054],"mapped",[21304]],[[12055,12055],"mapped",[21313]],[[12056,12056],"mapped",[21340]],[[12057,12057],"mapped",[21353]],[[12058,12058],"mapped",[21378]],[[12059,12059],"mapped",[21430]],[[12060,12060],"mapped",[21448]],[[12061,12061],"mapped",[21475]],[[12062,12062],"mapped",[22231]],[[12063,12063],"mapped",[22303]],[[12064,12064],"mapped",[22763]],[[12065,12065],"mapped",[22786]],[[12066,12066],"mapped",[22794]],[[12067,12067],"mapped",[22805]],[[12068,12068],"mapped",[22823]],[[12069,12069],"mapped",[22899]],[[12070,12070],"mapped",[23376]],[[12071,12071],"mapped",[23424]],[[12072,12072],"mapped",[23544]],[[12073,12073],"mapped",[23567]],[[12074,12074],"mapped",[23586]],[[12075,12075],"mapped",[23608]],[[12076,12076],"mapped",[23662]],[[12077,12077],"mapped",[23665]],[[12078,12078],"mapped",[24027]],[[12079,12079],"mapped",[24037]],[[12080,12080],"mapped",[24049]],[[12081,12081],"mapped",[24062]],[[12082,12082],"mapped",[24178]],[[12083,12083],"mapped",[24186]],[[12084,12084],"mapped",[24191]],[[12085,12085],"mapped",[24308]],[[12086,12086],"mapped",[24318]],[[12087,12087],"mapped",[24331]],[[12088,12088],"mapped",[24339]],[[12089,12089],"mapped",[24400]],[[12090,12090],"mapped",[24417]],[[12091,12091],"mapped",[24435]],[[12092,12092],"mapped",[24515]],[[12093,12093],"mapped",[25096]],[[12094,12094],"mapped",[25142]],[[12095,12095],"mapped",[25163]],[[12096,12096],"mapped",[25903]],[[12097,12097],"mapped",[25908]],[[12098,12098],"mapped",[25991]],[[12099,12099],"mapped",[26007]],[[12100,12100],"mapped",[26020]],[[12101,12101],"mapped",[26041]],[[12102,12102],"mapped",[26080]],[[12103,12103],"mapped",[26085]],[[12104,12104],"mapped",[26352]],[[12105,12105],"mapped",[26376]],[[12106,12106],"mapped",[26408]],[[12107,12107],"mapped",[27424]],[[12108,12108],"mapped",[27490]],[[12109,12109],"mapped",[27513]],[[12110,12110],"mapped",[27571]],[[12111,12111],"mapped",[27595]],[[12112,12112],"mapped",[27604]],[[12113,12113],"mapped",[27611]],[[12114,12114],"mapped",[27663]],[[12115,12115],"mapped",[27668]],[[12116,12116],"mapped",[27700]],[[12117,12117],"mapped",[28779]],[[12118,12118],"mapped",[29226]],[[12119,12119],"mapped",[29238]],[[12120,12120],"mapped",[29243]],[[12121,12121],"mapped",[29247]],[[12122,12122],"mapped",[29255]],[[12123,12123],"mapped",[29273]],[[12124,12124],"mapped",[29275]],[[12125,12125],"mapped",[29356]],[[12126,12126],"mapped",[29572]],[[12127,12127],"mapped",[29577]],[[12128,12128],"mapped",[29916]],[[12129,12129],"mapped",[29926]],[[12130,12130],"mapped",[29976]],[[12131,12131],"mapped",[29983]],[[12132,12132],"mapped",[29992]],[[12133,12133],"mapped",[30000]],[[12134,12134],"mapped",[30091]],[[12135,12135],"mapped",[30098]],[[12136,12136],"mapped",[30326]],[[12137,12137],"mapped",[30333]],[[12138,12138],"mapped",[30382]],[[12139,12139],"mapped",[30399]],[[12140,12140],"mapped",[30446]],[[12141,12141],"mapped",[30683]],[[12142,12142],"mapped",[30690]],[[12143,12143],"mapped",[30707]],[[12144,12144],"mapped",[31034]],[[12145,12145],"mapped",[31160]],[[12146,12146],"mapped",[31166]],[[12147,12147],"mapped",[31348]],[[12148,12148],"mapped",[31435]],[[12149,12149],"mapped",[31481]],[[12150,12150],"mapped",[31859]],[[12151,12151],"mapped",[31992]],[[12152,12152],"mapped",[32566]],[[12153,12153],"mapped",[32593]],[[12154,12154],"mapped",[32650]],[[12155,12155],"mapped",[32701]],[[12156,12156],"mapped",[32769]],[[12157,12157],"mapped",[32780]],[[12158,12158],"mapped",[32786]],[[12159,12159],"mapped",[32819]],[[12160,12160],"mapped",[32895]],[[12161,12161],"mapped",[32905]],[[12162,12162],"mapped",[33251]],[[12163,12163],"mapped",[33258]],[[12164,12164],"mapped",[33267]],[[12165,12165],"mapped",[33276]],[[12166,12166],"mapped",[33292]],[[12167,12167],"mapped",[33307]],[[12168,12168],"mapped",[33311]],[[12169,12169],"mapped",[33390]],[[12170,12170],"mapped",[33394]],[[12171,12171],"mapped",[33400]],[[12172,12172],"mapped",[34381]],[[12173,12173],"mapped",[34411]],[[12174,12174],"mapped",[34880]],[[12175,12175],"mapped",[34892]],[[12176,12176],"mapped",[34915]],[[12177,12177],"mapped",[35198]],[[12178,12178],"mapped",[35211]],[[12179,12179],"mapped",[35282]],[[12180,12180],"mapped",[35328]],[[12181,12181],"mapped",[35895]],[[12182,12182],"mapped",[35910]],[[12183,12183],"mapped",[35925]],[[12184,12184],"mapped",[35960]],[[12185,12185],"mapped",[35997]],[[12186,12186],"mapped",[36196]],[[12187,12187],"mapped",[36208]],[[12188,12188],"mapped",[36275]],[[12189,12189],"mapped",[36523]],[[12190,12190],"mapped",[36554]],[[12191,12191],"mapped",[36763]],[[12192,12192],"mapped",[36784]],[[12193,12193],"mapped",[36789]],[[12194,12194],"mapped",[37009]],[[12195,12195],"mapped",[37193]],[[12196,12196],"mapped",[37318]],[[12197,12197],"mapped",[37324]],[[12198,12198],"mapped",[37329]],[[12199,12199],"mapped",[38263]],[[12200,12200],"mapped",[38272]],[[12201,12201],"mapped",[38428]],[[12202,12202],"mapped",[38582]],[[12203,12203],"mapped",[38585]],[[12204,12204],"mapped",[38632]],[[12205,12205],"mapped",[38737]],[[12206,12206],"mapped",[38750]],[[12207,12207],"mapped",[38754]],[[12208,12208],"mapped",[38761]],[[12209,12209],"mapped",[38859]],[[12210,12210],"mapped",[38893]],[[12211,12211],"mapped",[38899]],[[12212,12212],"mapped",[38913]],[[12213,12213],"mapped",[39080]],[[12214,12214],"mapped",[39131]],[[12215,12215],"mapped",[39135]],[[12216,12216],"mapped",[39318]],[[12217,12217],"mapped",[39321]],[[12218,12218],"mapped",[39340]],[[12219,12219],"mapped",[39592]],[[12220,12220],"mapped",[39640]],[[12221,12221],"mapped",[39647]],[[12222,12222],"mapped",[39717]],[[12223,12223],"mapped",[39727]],[[12224,12224],"mapped",[39730]],[[12225,12225],"mapped",[39740]],[[12226,12226],"mapped",[39770]],[[12227,12227],"mapped",[40165]],[[12228,12228],"mapped",[40565]],[[12229,12229],"mapped",[40575]],[[12230,12230],"mapped",[40613]],[[12231,12231],"mapped",[40635]],[[12232,12232],"mapped",[40643]],[[12233,12233],"mapped",[40653]],[[12234,12234],"mapped",[40657]],[[12235,12235],"mapped",[40697]],[[12236,12236],"mapped",[40701]],[[12237,12237],"mapped",[40718]],[[12238,12238],"mapped",[40723]],[[12239,12239],"mapped",[40736]],[[12240,12240],"mapped",[40763]],[[12241,12241],"mapped",[40778]],[[12242,12242],"mapped",[40786]],[[12243,12243],"mapped",[40845]],[[12244,12244],"mapped",[40860]],[[12245,12245],"mapped",[40864]],[[12246,12271],"disallowed"],[[12272,12283],"disallowed"],[[12284,12287],"disallowed"],[[12288,12288],"disallowed_STD3_mapped",[32]],[[12289,12289],"valid",[],"NV8"],[[12290,12290],"mapped",[46]],[[12291,12292],"valid",[],"NV8"],[[12293,12295],"valid"],[[12296,12329],"valid",[],"NV8"],[[12330,12333],"valid"],[[12334,12341],"valid",[],"NV8"],[[12342,12342],"mapped",[12306]],[[12343,12343],"valid",[],"NV8"],[[12344,12344],"mapped",[21313]],[[12345,12345],"mapped",[21316]],[[12346,12346],"mapped",[21317]],[[12347,12347],"valid",[],"NV8"],[[12348,12348],"valid"],[[12349,12349],"valid",[],"NV8"],[[12350,12350],"valid",[],"NV8"],[[12351,12351],"valid",[],"NV8"],[[12352,12352],"disallowed"],[[12353,12436],"valid"],[[12437,12438],"valid"],[[12439,12440],"disallowed"],[[12441,12442],"valid"],[[12443,12443],"disallowed_STD3_mapped",[32,12441]],[[12444,12444],"disallowed_STD3_mapped",[32,12442]],[[12445,12446],"valid"],[[12447,12447],"mapped",[12424,12426]],[[12448,12448],"valid",[],"NV8"],[[12449,12542],"valid"],[[12543,12543],"mapped",[12467,12488]],[[12544,12548],"disallowed"],[[12549,12588],"valid"],[[12589,12589],"valid"],[[12590,12592],"disallowed"],[[12593,12593],"mapped",[4352]],[[12594,12594],"mapped",[4353]],[[12595,12595],"mapped",[4522]],[[12596,12596],"mapped",[4354]],[[12597,12597],"mapped",[4524]],[[12598,12598],"mapped",[4525]],[[12599,12599],"mapped",[4355]],[[12600,12600],"mapped",[4356]],[[12601,12601],"mapped",[4357]],[[12602,12602],"mapped",[4528]],[[12603,12603],"mapped",[4529]],[[12604,12604],"mapped",[4530]],[[12605,12605],"mapped",[4531]],[[12606,12606],"mapped",[4532]],[[12607,12607],"mapped",[4533]],[[12608,12608],"mapped",[4378]],[[12609,12609],"mapped",[4358]],[[12610,12610],"mapped",[4359]],[[12611,12611],"mapped",[4360]],[[12612,12612],"mapped",[4385]],[[12613,12613],"mapped",[4361]],[[12614,12614],"mapped",[4362]],[[12615,12615],"mapped",[4363]],[[12616,12616],"mapped",[4364]],[[12617,12617],"mapped",[4365]],[[12618,12618],"mapped",[4366]],[[12619,12619],"mapped",[4367]],[[12620,12620],"mapped",[4368]],[[12621,12621],"mapped",[4369]],[[12622,12622],"mapped",[4370]],[[12623,12623],"mapped",[4449]],[[12624,12624],"mapped",[4450]],[[12625,12625],"mapped",[4451]],[[12626,12626],"mapped",[4452]],[[12627,12627],"mapped",[4453]],[[12628,12628],"mapped",[4454]],[[12629,12629],"mapped",[4455]],[[12630,12630],"mapped",[4456]],[[12631,12631],"mapped",[4457]],[[12632,12632],"mapped",[4458]],[[12633,12633],"mapped",[4459]],[[12634,12634],"mapped",[4460]],[[12635,12635],"mapped",[4461]],[[12636,12636],"mapped",[4462]],[[12637,12637],"mapped",[4463]],[[12638,12638],"mapped",[4464]],[[12639,12639],"mapped",[4465]],[[12640,12640],"mapped",[4466]],[[12641,12641],"mapped",[4467]],[[12642,12642],"mapped",[4468]],[[12643,12643],"mapped",[4469]],[[12644,12644],"disallowed"],[[12645,12645],"mapped",[4372]],[[12646,12646],"mapped",[4373]],[[12647,12647],"mapped",[4551]],[[12648,12648],"mapped",[4552]],[[12649,12649],"mapped",[4556]],[[12650,12650],"mapped",[4558]],[[12651,12651],"mapped",[4563]],[[12652,12652],"mapped",[4567]],[[12653,12653],"mapped",[4569]],[[12654,12654],"mapped",[4380]],[[12655,12655],"mapped",[4573]],[[12656,12656],"mapped",[4575]],[[12657,12657],"mapped",[4381]],[[12658,12658],"mapped",[4382]],[[12659,12659],"mapped",[4384]],[[12660,12660],"mapped",[4386]],[[12661,12661],"mapped",[4387]],[[12662,12662],"mapped",[4391]],[[12663,12663],"mapped",[4393]],[[12664,12664],"mapped",[4395]],[[12665,12665],"mapped",[4396]],[[12666,12666],"mapped",[4397]],[[12667,12667],"mapped",[4398]],[[12668,12668],"mapped",[4399]],[[12669,12669],"mapped",[4402]],[[12670,12670],"mapped",[4406]],[[12671,12671],"mapped",[4416]],[[12672,12672],"mapped",[4423]],[[12673,12673],"mapped",[4428]],[[12674,12674],"mapped",[4593]],[[12675,12675],"mapped",[4594]],[[12676,12676],"mapped",[4439]],[[12677,12677],"mapped",[4440]],[[12678,12678],"mapped",[4441]],[[12679,12679],"mapped",[4484]],[[12680,12680],"mapped",[4485]],[[12681,12681],"mapped",[4488]],[[12682,12682],"mapped",[4497]],[[12683,12683],"mapped",[4498]],[[12684,12684],"mapped",[4500]],[[12685,12685],"mapped",[4510]],[[12686,12686],"mapped",[4513]],[[12687,12687],"disallowed"],[[12688,12689],"valid",[],"NV8"],[[12690,12690],"mapped",[19968]],[[12691,12691],"mapped",[20108]],[[12692,12692],"mapped",[19977]],[[12693,12693],"mapped",[22235]],[[12694,12694],"mapped",[19978]],[[12695,12695],"mapped",[20013]],[[12696,12696],"mapped",[19979]],[[12697,12697],"mapped",[30002]],[[12698,12698],"mapped",[20057]],[[12699,12699],"mapped",[19993]],[[12700,12700],"mapped",[19969]],[[12701,12701],"mapped",[22825]],[[12702,12702],"mapped",[22320]],[[12703,12703],"mapped",[20154]],[[12704,12727],"valid"],[[12728,12730],"valid"],[[12731,12735],"disallowed"],[[12736,12751],"valid",[],"NV8"],[[12752,12771],"valid",[],"NV8"],[[12772,12783],"disallowed"],[[12784,12799],"valid"],[[12800,12800],"disallowed_STD3_mapped",[40,4352,41]],[[12801,12801],"disallowed_STD3_mapped",[40,4354,41]],[[12802,12802],"disallowed_STD3_mapped",[40,4355,41]],[[12803,12803],"disallowed_STD3_mapped",[40,4357,41]],[[12804,12804],"disallowed_STD3_mapped",[40,4358,41]],[[12805,12805],"disallowed_STD3_mapped",[40,4359,41]],[[12806,12806],"disallowed_STD3_mapped",[40,4361,41]],[[12807,12807],"disallowed_STD3_mapped",[40,4363,41]],[[12808,12808],"disallowed_STD3_mapped",[40,4364,41]],[[12809,12809],"disallowed_STD3_mapped",[40,4366,41]],[[12810,12810],"disallowed_STD3_mapped",[40,4367,41]],[[12811,12811],"disallowed_STD3_mapped",[40,4368,41]],[[12812,12812],"disallowed_STD3_mapped",[40,4369,41]],[[12813,12813],"disallowed_STD3_mapped",[40,4370,41]],[[12814,12814],"disallowed_STD3_mapped",[40,44032,41]],[[12815,12815],"disallowed_STD3_mapped",[40,45208,41]],[[12816,12816],"disallowed_STD3_mapped",[40,45796,41]],[[12817,12817],"disallowed_STD3_mapped",[40,46972,41]],[[12818,12818],"disallowed_STD3_mapped",[40,47560,41]],[[12819,12819],"disallowed_STD3_mapped",[40,48148,41]],[[12820,12820],"disallowed_STD3_mapped",[40,49324,41]],[[12821,12821],"disallowed_STD3_mapped",[40,50500,41]],[[12822,12822],"disallowed_STD3_mapped",[40,51088,41]],[[12823,12823],"disallowed_STD3_mapped",[40,52264,41]],[[12824,12824],"disallowed_STD3_mapped",[40,52852,41]],[[12825,12825],"disallowed_STD3_mapped",[40,53440,41]],[[12826,12826],"disallowed_STD3_mapped",[40,54028,41]],[[12827,12827],"disallowed_STD3_mapped",[40,54616,41]],[[12828,12828],"disallowed_STD3_mapped",[40,51452,41]],[[12829,12829],"disallowed_STD3_mapped",[40,50724,51204,41]],[[12830,12830],"disallowed_STD3_mapped",[40,50724,54980,41]],[[12831,12831],"disallowed"],[[12832,12832],"disallowed_STD3_mapped",[40,19968,41]],[[12833,12833],"disallowed_STD3_mapped",[40,20108,41]],[[12834,12834],"disallowed_STD3_mapped",[40,19977,41]],[[12835,12835],"disallowed_STD3_mapped",[40,22235,41]],[[12836,12836],"disallowed_STD3_mapped",[40,20116,41]],[[12837,12837],"disallowed_STD3_mapped",[40,20845,41]],[[12838,12838],"disallowed_STD3_mapped",[40,19971,41]],[[12839,12839],"disallowed_STD3_mapped",[40,20843,41]],[[12840,12840],"disallowed_STD3_mapped",[40,20061,41]],[[12841,12841],"disallowed_STD3_mapped",[40,21313,41]],[[12842,12842],"disallowed_STD3_mapped",[40,26376,41]],[[12843,12843],"disallowed_STD3_mapped",[40,28779,41]],[[12844,12844],"disallowed_STD3_mapped",[40,27700,41]],[[12845,12845],"disallowed_STD3_mapped",[40,26408,41]],[[12846,12846],"disallowed_STD3_mapped",[40,37329,41]],[[12847,12847],"disallowed_STD3_mapped",[40,22303,41]],[[12848,12848],"disallowed_STD3_mapped",[40,26085,41]],[[12849,12849],"disallowed_STD3_mapped",[40,26666,41]],[[12850,12850],"disallowed_STD3_mapped",[40,26377,41]],[[12851,12851],"disallowed_STD3_mapped",[40,31038,41]],[[12852,12852],"disallowed_STD3_mapped",[40,21517,41]],[[12853,12853],"disallowed_STD3_mapped",[40,29305,41]],[[12854,12854],"disallowed_STD3_mapped",[40,36001,41]],[[12855,12855],"disallowed_STD3_mapped",[40,31069,41]],[[12856,12856],"disallowed_STD3_mapped",[40,21172,41]],[[12857,12857],"disallowed_STD3_mapped",[40,20195,41]],[[12858,12858],"disallowed_STD3_mapped",[40,21628,41]],[[12859,12859],"disallowed_STD3_mapped",[40,23398,41]],[[12860,12860],"disallowed_STD3_mapped",[40,30435,41]],[[12861,12861],"disallowed_STD3_mapped",[40,20225,41]],[[12862,12862],"disallowed_STD3_mapped",[40,36039,41]],[[12863,12863],"disallowed_STD3_mapped",[40,21332,41]],[[12864,12864],"disallowed_STD3_mapped",[40,31085,41]],[[12865,12865],"disallowed_STD3_mapped",[40,20241,41]],[[12866,12866],"disallowed_STD3_mapped",[40,33258,41]],[[12867,12867],"disallowed_STD3_mapped",[40,33267,41]],[[12868,12868],"mapped",[21839]],[[12869,12869],"mapped",[24188]],[[12870,12870],"mapped",[25991]],[[12871,12871],"mapped",[31631]],[[12872,12879],"valid",[],"NV8"],[[12880,12880],"mapped",[112,116,101]],[[12881,12881],"mapped",[50,49]],[[12882,12882],"mapped",[50,50]],[[12883,12883],"mapped",[50,51]],[[12884,12884],"mapped",[50,52]],[[12885,12885],"mapped",[50,53]],[[12886,12886],"mapped",[50,54]],[[12887,12887],"mapped",[50,55]],[[12888,12888],"mapped",[50,56]],[[12889,12889],"mapped",[50,57]],[[12890,12890],"mapped",[51,48]],[[12891,12891],"mapped",[51,49]],[[12892,12892],"mapped",[51,50]],[[12893,12893],"mapped",[51,51]],[[12894,12894],"mapped",[51,52]],[[12895,12895],"mapped",[51,53]],[[12896,12896],"mapped",[4352]],[[12897,12897],"mapped",[4354]],[[12898,12898],"mapped",[4355]],[[12899,12899],"mapped",[4357]],[[12900,12900],"mapped",[4358]],[[12901,12901],"mapped",[4359]],[[12902,12902],"mapped",[4361]],[[12903,12903],"mapped",[4363]],[[12904,12904],"mapped",[4364]],[[12905,12905],"mapped",[4366]],[[12906,12906],"mapped",[4367]],[[12907,12907],"mapped",[4368]],[[12908,12908],"mapped",[4369]],[[12909,12909],"mapped",[4370]],[[12910,12910],"mapped",[44032]],[[12911,12911],"mapped",[45208]],[[12912,12912],"mapped",[45796]],[[12913,12913],"mapped",[46972]],[[12914,12914],"mapped",[47560]],[[12915,12915],"mapped",[48148]],[[12916,12916],"mapped",[49324]],[[12917,12917],"mapped",[50500]],[[12918,12918],"mapped",[51088]],[[12919,12919],"mapped",[52264]],[[12920,12920],"mapped",[52852]],[[12921,12921],"mapped",[53440]],[[12922,12922],"mapped",[54028]],[[12923,12923],"mapped",[54616]],[[12924,12924],"mapped",[52280,44256]],[[12925,12925],"mapped",[51452,51032]],[[12926,12926],"mapped",[50864]],[[12927,12927],"valid",[],"NV8"],[[12928,12928],"mapped",[19968]],[[12929,12929],"mapped",[20108]],[[12930,12930],"mapped",[19977]],[[12931,12931],"mapped",[22235]],[[12932,12932],"mapped",[20116]],[[12933,12933],"mapped",[20845]],[[12934,12934],"mapped",[19971]],[[12935,12935],"mapped",[20843]],[[12936,12936],"mapped",[20061]],[[12937,12937],"mapped",[21313]],[[12938,12938],"mapped",[26376]],[[12939,12939],"mapped",[28779]],[[12940,12940],"mapped",[27700]],[[12941,12941],"mapped",[26408]],[[12942,12942],"mapped",[37329]],[[12943,12943],"mapped",[22303]],[[12944,12944],"mapped",[26085]],[[12945,12945],"mapped",[26666]],[[12946,12946],"mapped",[26377]],[[12947,12947],"mapped",[31038]],[[12948,12948],"mapped",[21517]],[[12949,12949],"mapped",[29305]],[[12950,12950],"mapped",[36001]],[[12951,12951],"mapped",[31069]],[[12952,12952],"mapped",[21172]],[[12953,12953],"mapped",[31192]],[[12954,12954],"mapped",[30007]],[[12955,12955],"mapped",[22899]],[[12956,12956],"mapped",[36969]],[[12957,12957],"mapped",[20778]],[[12958,12958],"mapped",[21360]],[[12959,12959],"mapped",[27880]],[[12960,12960],"mapped",[38917]],[[12961,12961],"mapped",[20241]],[[12962,12962],"mapped",[20889]],[[12963,12963],"mapped",[27491]],[[12964,12964],"mapped",[19978]],[[12965,12965],"mapped",[20013]],[[12966,12966],"mapped",[19979]],[[12967,12967],"mapped",[24038]],[[12968,12968],"mapped",[21491]],[[12969,12969],"mapped",[21307]],[[12970,12970],"mapped",[23447]],[[12971,12971],"mapped",[23398]],[[12972,12972],"mapped",[30435]],[[12973,12973],"mapped",[20225]],[[12974,12974],"mapped",[36039]],[[12975,12975],"mapped",[21332]],[[12976,12976],"mapped",[22812]],[[12977,12977],"mapped",[51,54]],[[12978,12978],"mapped",[51,55]],[[12979,12979],"mapped",[51,56]],[[12980,12980],"mapped",[51,57]],[[12981,12981],"mapped",[52,48]],[[12982,12982],"mapped",[52,49]],[[12983,12983],"mapped",[52,50]],[[12984,12984],"mapped",[52,51]],[[12985,12985],"mapped",[52,52]],[[12986,12986],"mapped",[52,53]],[[12987,12987],"mapped",[52,54]],[[12988,12988],"mapped",[52,55]],[[12989,12989],"mapped",[52,56]],[[12990,12990],"mapped",[52,57]],[[12991,12991],"mapped",[53,48]],[[12992,12992],"mapped",[49,26376]],[[12993,12993],"mapped",[50,26376]],[[12994,12994],"mapped",[51,26376]],[[12995,12995],"mapped",[52,26376]],[[12996,12996],"mapped",[53,26376]],[[12997,12997],"mapped",[54,26376]],[[12998,12998],"mapped",[55,26376]],[[12999,12999],"mapped",[56,26376]],[[13000,13000],"mapped",[57,26376]],[[13001,13001],"mapped",[49,48,26376]],[[13002,13002],"mapped",[49,49,26376]],[[13003,13003],"mapped",[49,50,26376]],[[13004,13004],"mapped",[104,103]],[[13005,13005],"mapped",[101,114,103]],[[13006,13006],"mapped",[101,118]],[[13007,13007],"mapped",[108,116,100]],[[13008,13008],"mapped",[12450]],[[13009,13009],"mapped",[12452]],[[13010,13010],"mapped",[12454]],[[13011,13011],"mapped",[12456]],[[13012,13012],"mapped",[12458]],[[13013,13013],"mapped",[12459]],[[13014,13014],"mapped",[12461]],[[13015,13015],"mapped",[12463]],[[13016,13016],"mapped",[12465]],[[13017,13017],"mapped",[12467]],[[13018,13018],"mapped",[12469]],[[13019,13019],"mapped",[12471]],[[13020,13020],"mapped",[12473]],[[13021,13021],"mapped",[12475]],[[13022,13022],"mapped",[12477]],[[13023,13023],"mapped",[12479]],[[13024,13024],"mapped",[12481]],[[13025,13025],"mapped",[12484]],[[13026,13026],"mapped",[12486]],[[13027,13027],"mapped",[12488]],[[13028,13028],"mapped",[12490]],[[13029,13029],"mapped",[12491]],[[13030,13030],"mapped",[12492]],[[13031,13031],"mapped",[12493]],[[13032,13032],"mapped",[12494]],[[13033,13033],"mapped",[12495]],[[13034,13034],"mapped",[12498]],[[13035,13035],"mapped",[12501]],[[13036,13036],"mapped",[12504]],[[13037,13037],"mapped",[12507]],[[13038,13038],"mapped",[12510]],[[13039,13039],"mapped",[12511]],[[13040,13040],"mapped",[12512]],[[13041,13041],"mapped",[12513]],[[13042,13042],"mapped",[12514]],[[13043,13043],"mapped",[12516]],[[13044,13044],"mapped",[12518]],[[13045,13045],"mapped",[12520]],[[13046,13046],"mapped",[12521]],[[13047,13047],"mapped",[12522]],[[13048,13048],"mapped",[12523]],[[13049,13049],"mapped",[12524]],[[13050,13050],"mapped",[12525]],[[13051,13051],"mapped",[12527]],[[13052,13052],"mapped",[12528]],[[13053,13053],"mapped",[12529]],[[13054,13054],"mapped",[12530]],[[13055,13055],"disallowed"],[[13056,13056],"mapped",[12450,12497,12540,12488]],[[13057,13057],"mapped",[12450,12523,12501,12449]],[[13058,13058],"mapped",[12450,12531,12506,12450]],[[13059,13059],"mapped",[12450,12540,12523]],[[13060,13060],"mapped",[12452,12491,12531,12464]],[[13061,13061],"mapped",[12452,12531,12481]],[[13062,13062],"mapped",[12454,12457,12531]],[[13063,13063],"mapped",[12456,12473,12463,12540,12489]],[[13064,13064],"mapped",[12456,12540,12459,12540]],[[13065,13065],"mapped",[12458,12531,12473]],[[13066,13066],"mapped",[12458,12540,12512]],[[13067,13067],"mapped",[12459,12452,12522]],[[13068,13068],"mapped",[12459,12521,12483,12488]],[[13069,13069],"mapped",[12459,12525,12522,12540]],[[13070,13070],"mapped",[12460,12525,12531]],[[13071,13071],"mapped",[12460,12531,12510]],[[13072,13072],"mapped",[12462,12460]],[[13073,13073],"mapped",[12462,12491,12540]],[[13074,13074],"mapped",[12461,12517,12522,12540]],[[13075,13075],"mapped",[12462,12523,12480,12540]],[[13076,13076],"mapped",[12461,12525]],[[13077,13077],"mapped",[12461,12525,12464,12521,12512]],[[13078,13078],"mapped",[12461,12525,12513,12540,12488,12523]],[[13079,13079],"mapped",[12461,12525,12527,12483,12488]],[[13080,13080],"mapped",[12464,12521,12512]],[[13081,13081],"mapped",[12464,12521,12512,12488,12531]],[[13082,13082],"mapped",[12463,12523,12476,12452,12525]],[[13083,13083],"mapped",[12463,12525,12540,12493]],[[13084,13084],"mapped",[12465,12540,12473]],[[13085,13085],"mapped",[12467,12523,12490]],[[13086,13086],"mapped",[12467,12540,12509]],[[13087,13087],"mapped",[12469,12452,12463,12523]],[[13088,13088],"mapped",[12469,12531,12481,12540,12512]],[[13089,13089],"mapped",[12471,12522,12531,12464]],[[13090,13090],"mapped",[12475,12531,12481]],[[13091,13091],"mapped",[12475,12531,12488]],[[13092,13092],"mapped",[12480,12540,12473]],[[13093,13093],"mapped",[12487,12471]],[[13094,13094],"mapped",[12489,12523]],[[13095,13095],"mapped",[12488,12531]],[[13096,13096],"mapped",[12490,12494]],[[13097,13097],"mapped",[12494,12483,12488]],[[13098,13098],"mapped",[12495,12452,12484]],[[13099,13099],"mapped",[12497,12540,12475,12531,12488]],[[13100,13100],"mapped",[12497,12540,12484]],[[13101,13101],"mapped",[12496,12540,12524,12523]],[[13102,13102],"mapped",[12500,12450,12473,12488,12523]],[[13103,13103],"mapped",[12500,12463,12523]],[[13104,13104],"mapped",[12500,12467]],[[13105,13105],"mapped",[12499,12523]],[[13106,13106],"mapped",[12501,12449,12521,12483,12489]],[[13107,13107],"mapped",[12501,12451,12540,12488]],[[13108,13108],"mapped",[12502,12483,12471,12455,12523]],[[13109,13109],"mapped",[12501,12521,12531]],[[13110,13110],"mapped",[12504,12463,12479,12540,12523]],[[13111,13111],"mapped",[12506,12477]],[[13112,13112],"mapped",[12506,12491,12498]],[[13113,13113],"mapped",[12504,12523,12484]],[[13114,13114],"mapped",[12506,12531,12473]],[[13115,13115],"mapped",[12506,12540,12472]],[[13116,13116],"mapped",[12505,12540,12479]],[[13117,13117],"mapped",[12509,12452,12531,12488]],[[13118,13118],"mapped",[12508,12523,12488]],[[13119,13119],"mapped",[12507,12531]],[[13120,13120],"mapped",[12509,12531,12489]],[[13121,13121],"mapped",[12507,12540,12523]],[[13122,13122],"mapped",[12507,12540,12531]],[[13123,13123],"mapped",[12510,12452,12463,12525]],[[13124,13124],"mapped",[12510,12452,12523]],[[13125,13125],"mapped",[12510,12483,12495]],[[13126,13126],"mapped",[12510,12523,12463]],[[13127,13127],"mapped",[12510,12531,12471,12519,12531]],[[13128,13128],"mapped",[12511,12463,12525,12531]],[[13129,13129],"mapped",[12511,12522]],[[13130,13130],"mapped",[12511,12522,12496,12540,12523]],[[13131,13131],"mapped",[12513,12460]],[[13132,13132],"mapped",[12513,12460,12488,12531]],[[13133,13133],"mapped",[12513,12540,12488,12523]],[[13134,13134],"mapped",[12516,12540,12489]],[[13135,13135],"mapped",[12516,12540,12523]],[[13136,13136],"mapped",[12518,12450,12531]],[[13137,13137],"mapped",[12522,12483,12488,12523]],[[13138,13138],"mapped",[12522,12521]],[[13139,13139],"mapped",[12523,12500,12540]],[[13140,13140],"mapped",[12523,12540,12502,12523]],[[13141,13141],"mapped",[12524,12512]],[[13142,13142],"mapped",[12524,12531,12488,12466,12531]],[[13143,13143],"mapped",[12527,12483,12488]],[[13144,13144],"mapped",[48,28857]],[[13145,13145],"mapped",[49,28857]],[[13146,13146],"mapped",[50,28857]],[[13147,13147],"mapped",[51,28857]],[[13148,13148],"mapped",[52,28857]],[[13149,13149],"mapped",[53,28857]],[[13150,13150],"mapped",[54,28857]],[[13151,13151],"mapped",[55,28857]],[[13152,13152],"mapped",[56,28857]],[[13153,13153],"mapped",[57,28857]],[[13154,13154],"mapped",[49,48,28857]],[[13155,13155],"mapped",[49,49,28857]],[[13156,13156],"mapped",[49,50,28857]],[[13157,13157],"mapped",[49,51,28857]],[[13158,13158],"mapped",[49,52,28857]],[[13159,13159],"mapped",[49,53,28857]],[[13160,13160],"mapped",[49,54,28857]],[[13161,13161],"mapped",[49,55,28857]],[[13162,13162],"mapped",[49,56,28857]],[[13163,13163],"mapped",[49,57,28857]],[[13164,13164],"mapped",[50,48,28857]],[[13165,13165],"mapped",[50,49,28857]],[[13166,13166],"mapped",[50,50,28857]],[[13167,13167],"mapped",[50,51,28857]],[[13168,13168],"mapped",[50,52,28857]],[[13169,13169],"mapped",[104,112,97]],[[13170,13170],"mapped",[100,97]],[[13171,13171],"mapped",[97,117]],[[13172,13172],"mapped",[98,97,114]],[[13173,13173],"mapped",[111,118]],[[13174,13174],"mapped",[112,99]],[[13175,13175],"mapped",[100,109]],[[13176,13176],"mapped",[100,109,50]],[[13177,13177],"mapped",[100,109,51]],[[13178,13178],"mapped",[105,117]],[[13179,13179],"mapped",[24179,25104]],[[13180,13180],"mapped",[26157,21644]],[[13181,13181],"mapped",[22823,27491]],[[13182,13182],"mapped",[26126,27835]],[[13183,13183],"mapped",[26666,24335,20250,31038]],[[13184,13184],"mapped",[112,97]],[[13185,13185],"mapped",[110,97]],[[13186,13186],"mapped",[956,97]],[[13187,13187],"mapped",[109,97]],[[13188,13188],"mapped",[107,97]],[[13189,13189],"mapped",[107,98]],[[13190,13190],"mapped",[109,98]],[[13191,13191],"mapped",[103,98]],[[13192,13192],"mapped",[99,97,108]],[[13193,13193],"mapped",[107,99,97,108]],[[13194,13194],"mapped",[112,102]],[[13195,13195],"mapped",[110,102]],[[13196,13196],"mapped",[956,102]],[[13197,13197],"mapped",[956,103]],[[13198,13198],"mapped",[109,103]],[[13199,13199],"mapped",[107,103]],[[13200,13200],"mapped",[104,122]],[[13201,13201],"mapped",[107,104,122]],[[13202,13202],"mapped",[109,104,122]],[[13203,13203],"mapped",[103,104,122]],[[13204,13204],"mapped",[116,104,122]],[[13205,13205],"mapped",[956,108]],[[13206,13206],"mapped",[109,108]],[[13207,13207],"mapped",[100,108]],[[13208,13208],"mapped",[107,108]],[[13209,13209],"mapped",[102,109]],[[13210,13210],"mapped",[110,109]],[[13211,13211],"mapped",[956,109]],[[13212,13212],"mapped",[109,109]],[[13213,13213],"mapped",[99,109]],[[13214,13214],"mapped",[107,109]],[[13215,13215],"mapped",[109,109,50]],[[13216,13216],"mapped",[99,109,50]],[[13217,13217],"mapped",[109,50]],[[13218,13218],"mapped",[107,109,50]],[[13219,13219],"mapped",[109,109,51]],[[13220,13220],"mapped",[99,109,51]],[[13221,13221],"mapped",[109,51]],[[13222,13222],"mapped",[107,109,51]],[[13223,13223],"mapped",[109,8725,115]],[[13224,13224],"mapped",[109,8725,115,50]],[[13225,13225],"mapped",[112,97]],[[13226,13226],"mapped",[107,112,97]],[[13227,13227],"mapped",[109,112,97]],[[13228,13228],"mapped",[103,112,97]],[[13229,13229],"mapped",[114,97,100]],[[13230,13230],"mapped",[114,97,100,8725,115]],[[13231,13231],"mapped",[114,97,100,8725,115,50]],[[13232,13232],"mapped",[112,115]],[[13233,13233],"mapped",[110,115]],[[13234,13234],"mapped",[956,115]],[[13235,13235],"mapped",[109,115]],[[13236,13236],"mapped",[112,118]],[[13237,13237],"mapped",[110,118]],[[13238,13238],"mapped",[956,118]],[[13239,13239],"mapped",[109,118]],[[13240,13240],"mapped",[107,118]],[[13241,13241],"mapped",[109,118]],[[13242,13242],"mapped",[112,119]],[[13243,13243],"mapped",[110,119]],[[13244,13244],"mapped",[956,119]],[[13245,13245],"mapped",[109,119]],[[13246,13246],"mapped",[107,119]],[[13247,13247],"mapped",[109,119]],[[13248,13248],"mapped",[107,969]],[[13249,13249],"mapped",[109,969]],[[13250,13250],"disallowed"],[[13251,13251],"mapped",[98,113]],[[13252,13252],"mapped",[99,99]],[[13253,13253],"mapped",[99,100]],[[13254,13254],"mapped",[99,8725,107,103]],[[13255,13255],"disallowed"],[[13256,13256],"mapped",[100,98]],[[13257,13257],"mapped",[103,121]],[[13258,13258],"mapped",[104,97]],[[13259,13259],"mapped",[104,112]],[[13260,13260],"mapped",[105,110]],[[13261,13261],"mapped",[107,107]],[[13262,13262],"mapped",[107,109]],[[13263,13263],"mapped",[107,116]],[[13264,13264],"mapped",[108,109]],[[13265,13265],"mapped",[108,110]],[[13266,13266],"mapped",[108,111,103]],[[13267,13267],"mapped",[108,120]],[[13268,13268],"mapped",[109,98]],[[13269,13269],"mapped",[109,105,108]],[[13270,13270],"mapped",[109,111,108]],[[13271,13271],"mapped",[112,104]],[[13272,13272],"disallowed"],[[13273,13273],"mapped",[112,112,109]],[[13274,13274],"mapped",[112,114]],[[13275,13275],"mapped",[115,114]],[[13276,13276],"mapped",[115,118]],[[13277,13277],"mapped",[119,98]],[[13278,13278],"mapped",[118,8725,109]],[[13279,13279],"mapped",[97,8725,109]],[[13280,13280],"mapped",[49,26085]],[[13281,13281],"mapped",[50,26085]],[[13282,13282],"mapped",[51,26085]],[[13283,13283],"mapped",[52,26085]],[[13284,13284],"mapped",[53,26085]],[[13285,13285],"mapped",[54,26085]],[[13286,13286],"mapped",[55,26085]],[[13287,13287],"mapped",[56,26085]],[[13288,13288],"mapped",[57,26085]],[[13289,13289],"mapped",[49,48,26085]],[[13290,13290],"mapped",[49,49,26085]],[[13291,13291],"mapped",[49,50,26085]],[[13292,13292],"mapped",[49,51,26085]],[[13293,13293],"mapped",[49,52,26085]],[[13294,13294],"mapped",[49,53,26085]],[[13295,13295],"mapped",[49,54,26085]],[[13296,13296],"mapped",[49,55,26085]],[[13297,13297],"mapped",[49,56,26085]],[[13298,13298],"mapped",[49,57,26085]],[[13299,13299],"mapped",[50,48,26085]],[[13300,13300],"mapped",[50,49,26085]],[[13301,13301],"mapped",[50,50,26085]],[[13302,13302],"mapped",[50,51,26085]],[[13303,13303],"mapped",[50,52,26085]],[[13304,13304],"mapped",[50,53,26085]],[[13305,13305],"mapped",[50,54,26085]],[[13306,13306],"mapped",[50,55,26085]],[[13307,13307],"mapped",[50,56,26085]],[[13308,13308],"mapped",[50,57,26085]],[[13309,13309],"mapped",[51,48,26085]],[[13310,13310],"mapped",[51,49,26085]],[[13311,13311],"mapped",[103,97,108]],[[13312,19893],"valid"],[[19894,19903],"disallowed"],[[19904,19967],"valid",[],"NV8"],[[19968,40869],"valid"],[[40870,40891],"valid"],[[40892,40899],"valid"],[[40900,40907],"valid"],[[40908,40908],"valid"],[[40909,40917],"valid"],[[40918,40959],"disallowed"],[[40960,42124],"valid"],[[42125,42127],"disallowed"],[[42128,42145],"valid",[],"NV8"],[[42146,42147],"valid",[],"NV8"],[[42148,42163],"valid",[],"NV8"],[[42164,42164],"valid",[],"NV8"],[[42165,42176],"valid",[],"NV8"],[[42177,42177],"valid",[],"NV8"],[[42178,42180],"valid",[],"NV8"],[[42181,42181],"valid",[],"NV8"],[[42182,42182],"valid",[],"NV8"],[[42183,42191],"disallowed"],[[42192,42237],"valid"],[[42238,42239],"valid",[],"NV8"],[[42240,42508],"valid"],[[42509,42511],"valid",[],"NV8"],[[42512,42539],"valid"],[[42540,42559],"disallowed"],[[42560,42560],"mapped",[42561]],[[42561,42561],"valid"],[[42562,42562],"mapped",[42563]],[[42563,42563],"valid"],[[42564,42564],"mapped",[42565]],[[42565,42565],"valid"],[[42566,42566],"mapped",[42567]],[[42567,42567],"valid"],[[42568,42568],"mapped",[42569]],[[42569,42569],"valid"],[[42570,42570],"mapped",[42571]],[[42571,42571],"valid"],[[42572,42572],"mapped",[42573]],[[42573,42573],"valid"],[[42574,42574],"mapped",[42575]],[[42575,42575],"valid"],[[42576,42576],"mapped",[42577]],[[42577,42577],"valid"],[[42578,42578],"mapped",[42579]],[[42579,42579],"valid"],[[42580,42580],"mapped",[42581]],[[42581,42581],"valid"],[[42582,42582],"mapped",[42583]],[[42583,42583],"valid"],[[42584,42584],"mapped",[42585]],[[42585,42585],"valid"],[[42586,42586],"mapped",[42587]],[[42587,42587],"valid"],[[42588,42588],"mapped",[42589]],[[42589,42589],"valid"],[[42590,42590],"mapped",[42591]],[[42591,42591],"valid"],[[42592,42592],"mapped",[42593]],[[42593,42593],"valid"],[[42594,42594],"mapped",[42595]],[[42595,42595],"valid"],[[42596,42596],"mapped",[42597]],[[42597,42597],"valid"],[[42598,42598],"mapped",[42599]],[[42599,42599],"valid"],[[42600,42600],"mapped",[42601]],[[42601,42601],"valid"],[[42602,42602],"mapped",[42603]],[[42603,42603],"valid"],[[42604,42604],"mapped",[42605]],[[42605,42607],"valid"],[[42608,42611],"valid",[],"NV8"],[[42612,42619],"valid"],[[42620,42621],"valid"],[[42622,42622],"valid",[],"NV8"],[[42623,42623],"valid"],[[42624,42624],"mapped",[42625]],[[42625,42625],"valid"],[[42626,42626],"mapped",[42627]],[[42627,42627],"valid"],[[42628,42628],"mapped",[42629]],[[42629,42629],"valid"],[[42630,42630],"mapped",[42631]],[[42631,42631],"valid"],[[42632,42632],"mapped",[42633]],[[42633,42633],"valid"],[[42634,42634],"mapped",[42635]],[[42635,42635],"valid"],[[42636,42636],"mapped",[42637]],[[42637,42637],"valid"],[[42638,42638],"mapped",[42639]],[[42639,42639],"valid"],[[42640,42640],"mapped",[42641]],[[42641,42641],"valid"],[[42642,42642],"mapped",[42643]],[[42643,42643],"valid"],[[42644,42644],"mapped",[42645]],[[42645,42645],"valid"],[[42646,42646],"mapped",[42647]],[[42647,42647],"valid"],[[42648,42648],"mapped",[42649]],[[42649,42649],"valid"],[[42650,42650],"mapped",[42651]],[[42651,42651],"valid"],[[42652,42652],"mapped",[1098]],[[42653,42653],"mapped",[1100]],[[42654,42654],"valid"],[[42655,42655],"valid"],[[42656,42725],"valid"],[[42726,42735],"valid",[],"NV8"],[[42736,42737],"valid"],[[42738,42743],"valid",[],"NV8"],[[42744,42751],"disallowed"],[[42752,42774],"valid",[],"NV8"],[[42775,42778],"valid"],[[42779,42783],"valid"],[[42784,42785],"valid",[],"NV8"],[[42786,42786],"mapped",[42787]],[[42787,42787],"valid"],[[42788,42788],"mapped",[42789]],[[42789,42789],"valid"],[[42790,42790],"mapped",[42791]],[[42791,42791],"valid"],[[42792,42792],"mapped",[42793]],[[42793,42793],"valid"],[[42794,42794],"mapped",[42795]],[[42795,42795],"valid"],[[42796,42796],"mapped",[42797]],[[42797,42797],"valid"],[[42798,42798],"mapped",[42799]],[[42799,42801],"valid"],[[42802,42802],"mapped",[42803]],[[42803,42803],"valid"],[[42804,42804],"mapped",[42805]],[[42805,42805],"valid"],[[42806,42806],"mapped",[42807]],[[42807,42807],"valid"],[[42808,42808],"mapped",[42809]],[[42809,42809],"valid"],[[42810,42810],"mapped",[42811]],[[42811,42811],"valid"],[[42812,42812],"mapped",[42813]],[[42813,42813],"valid"],[[42814,42814],"mapped",[42815]],[[42815,42815],"valid"],[[42816,42816],"mapped",[42817]],[[42817,42817],"valid"],[[42818,42818],"mapped",[42819]],[[42819,42819],"valid"],[[42820,42820],"mapped",[42821]],[[42821,42821],"valid"],[[42822,42822],"mapped",[42823]],[[42823,42823],"valid"],[[42824,42824],"mapped",[42825]],[[42825,42825],"valid"],[[42826,42826],"mapped",[42827]],[[42827,42827],"valid"],[[42828,42828],"mapped",[42829]],[[42829,42829],"valid"],[[42830,42830],"mapped",[42831]],[[42831,42831],"valid"],[[42832,42832],"mapped",[42833]],[[42833,42833],"valid"],[[42834,42834],"mapped",[42835]],[[42835,42835],"valid"],[[42836,42836],"mapped",[42837]],[[42837,42837],"valid"],[[42838,42838],"mapped",[42839]],[[42839,42839],"valid"],[[42840,42840],"mapped",[42841]],[[42841,42841],"valid"],[[42842,42842],"mapped",[42843]],[[42843,42843],"valid"],[[42844,42844],"mapped",[42845]],[[42845,42845],"valid"],[[42846,42846],"mapped",[42847]],[[42847,42847],"valid"],[[42848,42848],"mapped",[42849]],[[42849,42849],"valid"],[[42850,42850],"mapped",[42851]],[[42851,42851],"valid"],[[42852,42852],"mapped",[42853]],[[42853,42853],"valid"],[[42854,42854],"mapped",[42855]],[[42855,42855],"valid"],[[42856,42856],"mapped",[42857]],[[42857,42857],"valid"],[[42858,42858],"mapped",[42859]],[[42859,42859],"valid"],[[42860,42860],"mapped",[42861]],[[42861,42861],"valid"],[[42862,42862],"mapped",[42863]],[[42863,42863],"valid"],[[42864,42864],"mapped",[42863]],[[42865,42872],"valid"],[[42873,42873],"mapped",[42874]],[[42874,42874],"valid"],[[42875,42875],"mapped",[42876]],[[42876,42876],"valid"],[[42877,42877],"mapped",[7545]],[[42878,42878],"mapped",[42879]],[[42879,42879],"valid"],[[42880,42880],"mapped",[42881]],[[42881,42881],"valid"],[[42882,42882],"mapped",[42883]],[[42883,42883],"valid"],[[42884,42884],"mapped",[42885]],[[42885,42885],"valid"],[[42886,42886],"mapped",[42887]],[[42887,42888],"valid"],[[42889,42890],"valid",[],"NV8"],[[42891,42891],"mapped",[42892]],[[42892,42892],"valid"],[[42893,42893],"mapped",[613]],[[42894,42894],"valid"],[[42895,42895],"valid"],[[42896,42896],"mapped",[42897]],[[42897,42897],"valid"],[[42898,42898],"mapped",[42899]],[[42899,42899],"valid"],[[42900,42901],"valid"],[[42902,42902],"mapped",[42903]],[[42903,42903],"valid"],[[42904,42904],"mapped",[42905]],[[42905,42905],"valid"],[[42906,42906],"mapped",[42907]],[[42907,42907],"valid"],[[42908,42908],"mapped",[42909]],[[42909,42909],"valid"],[[42910,42910],"mapped",[42911]],[[42911,42911],"valid"],[[42912,42912],"mapped",[42913]],[[42913,42913],"valid"],[[42914,42914],"mapped",[42915]],[[42915,42915],"valid"],[[42916,42916],"mapped",[42917]],[[42917,42917],"valid"],[[42918,42918],"mapped",[42919]],[[42919,42919],"valid"],[[42920,42920],"mapped",[42921]],[[42921,42921],"valid"],[[42922,42922],"mapped",[614]],[[42923,42923],"mapped",[604]],[[42924,42924],"mapped",[609]],[[42925,42925],"mapped",[620]],[[42926,42927],"disallowed"],[[42928,42928],"mapped",[670]],[[42929,42929],"mapped",[647]],[[42930,42930],"mapped",[669]],[[42931,42931],"mapped",[43859]],[[42932,42932],"mapped",[42933]],[[42933,42933],"valid"],[[42934,42934],"mapped",[42935]],[[42935,42935],"valid"],[[42936,42998],"disallowed"],[[42999,42999],"valid"],[[43000,43000],"mapped",[295]],[[43001,43001],"mapped",[339]],[[43002,43002],"valid"],[[43003,43007],"valid"],[[43008,43047],"valid"],[[43048,43051],"valid",[],"NV8"],[[43052,43055],"disallowed"],[[43056,43065],"valid",[],"NV8"],[[43066,43071],"disallowed"],[[43072,43123],"valid"],[[43124,43127],"valid",[],"NV8"],[[43128,43135],"disallowed"],[[43136,43204],"valid"],[[43205,43213],"disallowed"],[[43214,43215],"valid",[],"NV8"],[[43216,43225],"valid"],[[43226,43231],"disallowed"],[[43232,43255],"valid"],[[43256,43258],"valid",[],"NV8"],[[43259,43259],"valid"],[[43260,43260],"valid",[],"NV8"],[[43261,43261],"valid"],[[43262,43263],"disallowed"],[[43264,43309],"valid"],[[43310,43311],"valid",[],"NV8"],[[43312,43347],"valid"],[[43348,43358],"disallowed"],[[43359,43359],"valid",[],"NV8"],[[43360,43388],"valid",[],"NV8"],[[43389,43391],"disallowed"],[[43392,43456],"valid"],[[43457,43469],"valid",[],"NV8"],[[43470,43470],"disallowed"],[[43471,43481],"valid"],[[43482,43485],"disallowed"],[[43486,43487],"valid",[],"NV8"],[[43488,43518],"valid"],[[43519,43519],"disallowed"],[[43520,43574],"valid"],[[43575,43583],"disallowed"],[[43584,43597],"valid"],[[43598,43599],"disallowed"],[[43600,43609],"valid"],[[43610,43611],"disallowed"],[[43612,43615],"valid",[],"NV8"],[[43616,43638],"valid"],[[43639,43641],"valid",[],"NV8"],[[43642,43643],"valid"],[[43644,43647],"valid"],[[43648,43714],"valid"],[[43715,43738],"disallowed"],[[43739,43741],"valid"],[[43742,43743],"valid",[],"NV8"],[[43744,43759],"valid"],[[43760,43761],"valid",[],"NV8"],[[43762,43766],"valid"],[[43767,43776],"disallowed"],[[43777,43782],"valid"],[[43783,43784],"disallowed"],[[43785,43790],"valid"],[[43791,43792],"disallowed"],[[43793,43798],"valid"],[[43799,43807],"disallowed"],[[43808,43814],"valid"],[[43815,43815],"disallowed"],[[43816,43822],"valid"],[[43823,43823],"disallowed"],[[43824,43866],"valid"],[[43867,43867],"valid",[],"NV8"],[[43868,43868],"mapped",[42791]],[[43869,43869],"mapped",[43831]],[[43870,43870],"mapped",[619]],[[43871,43871],"mapped",[43858]],[[43872,43875],"valid"],[[43876,43877],"valid"],[[43878,43887],"disallowed"],[[43888,43888],"mapped",[5024]],[[43889,43889],"mapped",[5025]],[[43890,43890],"mapped",[5026]],[[43891,43891],"mapped",[5027]],[[43892,43892],"mapped",[5028]],[[43893,43893],"mapped",[5029]],[[43894,43894],"mapped",[5030]],[[43895,43895],"mapped",[5031]],[[43896,43896],"mapped",[5032]],[[43897,43897],"mapped",[5033]],[[43898,43898],"mapped",[5034]],[[43899,43899],"mapped",[5035]],[[43900,43900],"mapped",[5036]],[[43901,43901],"mapped",[5037]],[[43902,43902],"mapped",[5038]],[[43903,43903],"mapped",[5039]],[[43904,43904],"mapped",[5040]],[[43905,43905],"mapped",[5041]],[[43906,43906],"mapped",[5042]],[[43907,43907],"mapped",[5043]],[[43908,43908],"mapped",[5044]],[[43909,43909],"mapped",[5045]],[[43910,43910],"mapped",[5046]],[[43911,43911],"mapped",[5047]],[[43912,43912],"mapped",[5048]],[[43913,43913],"mapped",[5049]],[[43914,43914],"mapped",[5050]],[[43915,43915],"mapped",[5051]],[[43916,43916],"mapped",[5052]],[[43917,43917],"mapped",[5053]],[[43918,43918],"mapped",[5054]],[[43919,43919],"mapped",[5055]],[[43920,43920],"mapped",[5056]],[[43921,43921],"mapped",[5057]],[[43922,43922],"mapped",[5058]],[[43923,43923],"mapped",[5059]],[[43924,43924],"mapped",[5060]],[[43925,43925],"mapped",[5061]],[[43926,43926],"mapped",[5062]],[[43927,43927],"mapped",[5063]],[[43928,43928],"mapped",[5064]],[[43929,43929],"mapped",[5065]],[[43930,43930],"mapped",[5066]],[[43931,43931],"mapped",[5067]],[[43932,43932],"mapped",[5068]],[[43933,43933],"mapped",[5069]],[[43934,43934],"mapped",[5070]],[[43935,43935],"mapped",[5071]],[[43936,43936],"mapped",[5072]],[[43937,43937],"mapped",[5073]],[[43938,43938],"mapped",[5074]],[[43939,43939],"mapped",[5075]],[[43940,43940],"mapped",[5076]],[[43941,43941],"mapped",[5077]],[[43942,43942],"mapped",[5078]],[[43943,43943],"mapped",[5079]],[[43944,43944],"mapped",[5080]],[[43945,43945],"mapped",[5081]],[[43946,43946],"mapped",[5082]],[[43947,43947],"mapped",[5083]],[[43948,43948],"mapped",[5084]],[[43949,43949],"mapped",[5085]],[[43950,43950],"mapped",[5086]],[[43951,43951],"mapped",[5087]],[[43952,43952],"mapped",[5088]],[[43953,43953],"mapped",[5089]],[[43954,43954],"mapped",[5090]],[[43955,43955],"mapped",[5091]],[[43956,43956],"mapped",[5092]],[[43957,43957],"mapped",[5093]],[[43958,43958],"mapped",[5094]],[[43959,43959],"mapped",[5095]],[[43960,43960],"mapped",[5096]],[[43961,43961],"mapped",[5097]],[[43962,43962],"mapped",[5098]],[[43963,43963],"mapped",[5099]],[[43964,43964],"mapped",[5100]],[[43965,43965],"mapped",[5101]],[[43966,43966],"mapped",[5102]],[[43967,43967],"mapped",[5103]],[[43968,44010],"valid"],[[44011,44011],"valid",[],"NV8"],[[44012,44013],"valid"],[[44014,44015],"disallowed"],[[44016,44025],"valid"],[[44026,44031],"disallowed"],[[44032,55203],"valid"],[[55204,55215],"disallowed"],[[55216,55238],"valid",[],"NV8"],[[55239,55242],"disallowed"],[[55243,55291],"valid",[],"NV8"],[[55292,55295],"disallowed"],[[55296,57343],"disallowed"],[[57344,63743],"disallowed"],[[63744,63744],"mapped",[35912]],[[63745,63745],"mapped",[26356]],[[63746,63746],"mapped",[36554]],[[63747,63747],"mapped",[36040]],[[63748,63748],"mapped",[28369]],[[63749,63749],"mapped",[20018]],[[63750,63750],"mapped",[21477]],[[63751,63752],"mapped",[40860]],[[63753,63753],"mapped",[22865]],[[63754,63754],"mapped",[37329]],[[63755,63755],"mapped",[21895]],[[63756,63756],"mapped",[22856]],[[63757,63757],"mapped",[25078]],[[63758,63758],"mapped",[30313]],[[63759,63759],"mapped",[32645]],[[63760,63760],"mapped",[34367]],[[63761,63761],"mapped",[34746]],[[63762,63762],"mapped",[35064]],[[63763,63763],"mapped",[37007]],[[63764,63764],"mapped",[27138]],[[63765,63765],"mapped",[27931]],[[63766,63766],"mapped",[28889]],[[63767,63767],"mapped",[29662]],[[63768,63768],"mapped",[33853]],[[63769,63769],"mapped",[37226]],[[63770,63770],"mapped",[39409]],[[63771,63771],"mapped",[20098]],[[63772,63772],"mapped",[21365]],[[63773,63773],"mapped",[27396]],[[63774,63774],"mapped",[29211]],[[63775,63775],"mapped",[34349]],[[63776,63776],"mapped",[40478]],[[63777,63777],"mapped",[23888]],[[63778,63778],"mapped",[28651]],[[63779,63779],"mapped",[34253]],[[63780,63780],"mapped",[35172]],[[63781,63781],"mapped",[25289]],[[63782,63782],"mapped",[33240]],[[63783,63783],"mapped",[34847]],[[63784,63784],"mapped",[24266]],[[63785,63785],"mapped",[26391]],[[63786,63786],"mapped",[28010]],[[63787,63787],"mapped",[29436]],[[63788,63788],"mapped",[37070]],[[63789,63789],"mapped",[20358]],[[63790,63790],"mapped",[20919]],[[63791,63791],"mapped",[21214]],[[63792,63792],"mapped",[25796]],[[63793,63793],"mapped",[27347]],[[63794,63794],"mapped",[29200]],[[63795,63795],"mapped",[30439]],[[63796,63796],"mapped",[32769]],[[63797,63797],"mapped",[34310]],[[63798,63798],"mapped",[34396]],[[63799,63799],"mapped",[36335]],[[63800,63800],"mapped",[38706]],[[63801,63801],"mapped",[39791]],[[63802,63802],"mapped",[40442]],[[63803,63803],"mapped",[30860]],[[63804,63804],"mapped",[31103]],[[63805,63805],"mapped",[32160]],[[63806,63806],"mapped",[33737]],[[63807,63807],"mapped",[37636]],[[63808,63808],"mapped",[40575]],[[63809,63809],"mapped",[35542]],[[63810,63810],"mapped",[22751]],[[63811,63811],"mapped",[24324]],[[63812,63812],"mapped",[31840]],[[63813,63813],"mapped",[32894]],[[63814,63814],"mapped",[29282]],[[63815,63815],"mapped",[30922]],[[63816,63816],"mapped",[36034]],[[63817,63817],"mapped",[38647]],[[63818,63818],"mapped",[22744]],[[63819,63819],"mapped",[23650]],[[63820,63820],"mapped",[27155]],[[63821,63821],"mapped",[28122]],[[63822,63822],"mapped",[28431]],[[63823,63823],"mapped",[32047]],[[63824,63824],"mapped",[32311]],[[63825,63825],"mapped",[38475]],[[63826,63826],"mapped",[21202]],[[63827,63827],"mapped",[32907]],[[63828,63828],"mapped",[20956]],[[63829,63829],"mapped",[20940]],[[63830,63830],"mapped",[31260]],[[63831,63831],"mapped",[32190]],[[63832,63832],"mapped",[33777]],[[63833,63833],"mapped",[38517]],[[63834,63834],"mapped",[35712]],[[63835,63835],"mapped",[25295]],[[63836,63836],"mapped",[27138]],[[63837,63837],"mapped",[35582]],[[63838,63838],"mapped",[20025]],[[63839,63839],"mapped",[23527]],[[63840,63840],"mapped",[24594]],[[63841,63841],"mapped",[29575]],[[63842,63842],"mapped",[30064]],[[63843,63843],"mapped",[21271]],[[63844,63844],"mapped",[30971]],[[63845,63845],"mapped",[20415]],[[63846,63846],"mapped",[24489]],[[63847,63847],"mapped",[19981]],[[63848,63848],"mapped",[27852]],[[63849,63849],"mapped",[25976]],[[63850,63850],"mapped",[32034]],[[63851,63851],"mapped",[21443]],[[63852,63852],"mapped",[22622]],[[63853,63853],"mapped",[30465]],[[63854,63854],"mapped",[33865]],[[63855,63855],"mapped",[35498]],[[63856,63856],"mapped",[27578]],[[63857,63857],"mapped",[36784]],[[63858,63858],"mapped",[27784]],[[63859,63859],"mapped",[25342]],[[63860,63860],"mapped",[33509]],[[63861,63861],"mapped",[25504]],[[63862,63862],"mapped",[30053]],[[63863,63863],"mapped",[20142]],[[63864,63864],"mapped",[20841]],[[63865,63865],"mapped",[20937]],[[63866,63866],"mapped",[26753]],[[63867,63867],"mapped",[31975]],[[63868,63868],"mapped",[33391]],[[63869,63869],"mapped",[35538]],[[63870,63870],"mapped",[37327]],[[63871,63871],"mapped",[21237]],[[63872,63872],"mapped",[21570]],[[63873,63873],"mapped",[22899]],[[63874,63874],"mapped",[24300]],[[63875,63875],"mapped",[26053]],[[63876,63876],"mapped",[28670]],[[63877,63877],"mapped",[31018]],[[63878,63878],"mapped",[38317]],[[63879,63879],"mapped",[39530]],[[63880,63880],"mapped",[40599]],[[63881,63881],"mapped",[40654]],[[63882,63882],"mapped",[21147]],[[63883,63883],"mapped",[26310]],[[63884,63884],"mapped",[27511]],[[63885,63885],"mapped",[36706]],[[63886,63886],"mapped",[24180]],[[63887,63887],"mapped",[24976]],[[63888,63888],"mapped",[25088]],[[63889,63889],"mapped",[25754]],[[63890,63890],"mapped",[28451]],[[63891,63891],"mapped",[29001]],[[63892,63892],"mapped",[29833]],[[63893,63893],"mapped",[31178]],[[63894,63894],"mapped",[32244]],[[63895,63895],"mapped",[32879]],[[63896,63896],"mapped",[36646]],[[63897,63897],"mapped",[34030]],[[63898,63898],"mapped",[36899]],[[63899,63899],"mapped",[37706]],[[63900,63900],"mapped",[21015]],[[63901,63901],"mapped",[21155]],[[63902,63902],"mapped",[21693]],[[63903,63903],"mapped",[28872]],[[63904,63904],"mapped",[35010]],[[63905,63905],"mapped",[35498]],[[63906,63906],"mapped",[24265]],[[63907,63907],"mapped",[24565]],[[63908,63908],"mapped",[25467]],[[63909,63909],"mapped",[27566]],[[63910,63910],"mapped",[31806]],[[63911,63911],"mapped",[29557]],[[63912,63912],"mapped",[20196]],[[63913,63913],"mapped",[22265]],[[63914,63914],"mapped",[23527]],[[63915,63915],"mapped",[23994]],[[63916,63916],"mapped",[24604]],[[63917,63917],"mapped",[29618]],[[63918,63918],"mapped",[29801]],[[63919,63919],"mapped",[32666]],[[63920,63920],"mapped",[32838]],[[63921,63921],"mapped",[37428]],[[63922,63922],"mapped",[38646]],[[63923,63923],"mapped",[38728]],[[63924,63924],"mapped",[38936]],[[63925,63925],"mapped",[20363]],[[63926,63926],"mapped",[31150]],[[63927,63927],"mapped",[37300]],[[63928,63928],"mapped",[38584]],[[63929,63929],"mapped",[24801]],[[63930,63930],"mapped",[20102]],[[63931,63931],"mapped",[20698]],[[63932,63932],"mapped",[23534]],[[63933,63933],"mapped",[23615]],[[63934,63934],"mapped",[26009]],[[63935,63935],"mapped",[27138]],[[63936,63936],"mapped",[29134]],[[63937,63937],"mapped",[30274]],[[63938,63938],"mapped",[34044]],[[63939,63939],"mapped",[36988]],[[63940,63940],"mapped",[40845]],[[63941,63941],"mapped",[26248]],[[63942,63942],"mapped",[38446]],[[63943,63943],"mapped",[21129]],[[63944,63944],"mapped",[26491]],[[63945,63945],"mapped",[26611]],[[63946,63946],"mapped",[27969]],[[63947,63947],"mapped",[28316]],[[63948,63948],"mapped",[29705]],[[63949,63949],"mapped",[30041]],[[63950,63950],"mapped",[30827]],[[63951,63951],"mapped",[32016]],[[63952,63952],"mapped",[39006]],[[63953,63953],"mapped",[20845]],[[63954,63954],"mapped",[25134]],[[63955,63955],"mapped",[38520]],[[63956,63956],"mapped",[20523]],[[63957,63957],"mapped",[23833]],[[63958,63958],"mapped",[28138]],[[63959,63959],"mapped",[36650]],[[63960,63960],"mapped",[24459]],[[63961,63961],"mapped",[24900]],[[63962,63962],"mapped",[26647]],[[63963,63963],"mapped",[29575]],[[63964,63964],"mapped",[38534]],[[63965,63965],"mapped",[21033]],[[63966,63966],"mapped",[21519]],[[63967,63967],"mapped",[23653]],[[63968,63968],"mapped",[26131]],[[63969,63969],"mapped",[26446]],[[63970,63970],"mapped",[26792]],[[63971,63971],"mapped",[27877]],[[63972,63972],"mapped",[29702]],[[63973,63973],"mapped",[30178]],[[63974,63974],"mapped",[32633]],[[63975,63975],"mapped",[35023]],[[63976,63976],"mapped",[35041]],[[63977,63977],"mapped",[37324]],[[63978,63978],"mapped",[38626]],[[63979,63979],"mapped",[21311]],[[63980,63980],"mapped",[28346]],[[63981,63981],"mapped",[21533]],[[63982,63982],"mapped",[29136]],[[63983,63983],"mapped",[29848]],[[63984,63984],"mapped",[34298]],[[63985,63985],"mapped",[38563]],[[63986,63986],"mapped",[40023]],[[63987,63987],"mapped",[40607]],[[63988,63988],"mapped",[26519]],[[63989,63989],"mapped",[28107]],[[63990,63990],"mapped",[33256]],[[63991,63991],"mapped",[31435]],[[63992,63992],"mapped",[31520]],[[63993,63993],"mapped",[31890]],[[63994,63994],"mapped",[29376]],[[63995,63995],"mapped",[28825]],[[63996,63996],"mapped",[35672]],[[63997,63997],"mapped",[20160]],[[63998,63998],"mapped",[33590]],[[63999,63999],"mapped",[21050]],[[64000,64000],"mapped",[20999]],[[64001,64001],"mapped",[24230]],[[64002,64002],"mapped",[25299]],[[64003,64003],"mapped",[31958]],[[64004,64004],"mapped",[23429]],[[64005,64005],"mapped",[27934]],[[64006,64006],"mapped",[26292]],[[64007,64007],"mapped",[36667]],[[64008,64008],"mapped",[34892]],[[64009,64009],"mapped",[38477]],[[64010,64010],"mapped",[35211]],[[64011,64011],"mapped",[24275]],[[64012,64012],"mapped",[20800]],[[64013,64013],"mapped",[21952]],[[64014,64015],"valid"],[[64016,64016],"mapped",[22618]],[[64017,64017],"valid"],[[64018,64018],"mapped",[26228]],[[64019,64020],"valid"],[[64021,64021],"mapped",[20958]],[[64022,64022],"mapped",[29482]],[[64023,64023],"mapped",[30410]],[[64024,64024],"mapped",[31036]],[[64025,64025],"mapped",[31070]],[[64026,64026],"mapped",[31077]],[[64027,64027],"mapped",[31119]],[[64028,64028],"mapped",[38742]],[[64029,64029],"mapped",[31934]],[[64030,64030],"mapped",[32701]],[[64031,64031],"valid"],[[64032,64032],"mapped",[34322]],[[64033,64033],"valid"],[[64034,64034],"mapped",[35576]],[[64035,64036],"valid"],[[64037,64037],"mapped",[36920]],[[64038,64038],"mapped",[37117]],[[64039,64041],"valid"],[[64042,64042],"mapped",[39151]],[[64043,64043],"mapped",[39164]],[[64044,64044],"mapped",[39208]],[[64045,64045],"mapped",[40372]],[[64046,64046],"mapped",[37086]],[[64047,64047],"mapped",[38583]],[[64048,64048],"mapped",[20398]],[[64049,64049],"mapped",[20711]],[[64050,64050],"mapped",[20813]],[[64051,64051],"mapped",[21193]],[[64052,64052],"mapped",[21220]],[[64053,64053],"mapped",[21329]],[[64054,64054],"mapped",[21917]],[[64055,64055],"mapped",[22022]],[[64056,64056],"mapped",[22120]],[[64057,64057],"mapped",[22592]],[[64058,64058],"mapped",[22696]],[[64059,64059],"mapped",[23652]],[[64060,64060],"mapped",[23662]],[[64061,64061],"mapped",[24724]],[[64062,64062],"mapped",[24936]],[[64063,64063],"mapped",[24974]],[[64064,64064],"mapped",[25074]],[[64065,64065],"mapped",[25935]],[[64066,64066],"mapped",[26082]],[[64067,64067],"mapped",[26257]],[[64068,64068],"mapped",[26757]],[[64069,64069],"mapped",[28023]],[[64070,64070],"mapped",[28186]],[[64071,64071],"mapped",[28450]],[[64072,64072],"mapped",[29038]],[[64073,64073],"mapped",[29227]],[[64074,64074],"mapped",[29730]],[[64075,64075],"mapped",[30865]],[[64076,64076],"mapped",[31038]],[[64077,64077],"mapped",[31049]],[[64078,64078],"mapped",[31048]],[[64079,64079],"mapped",[31056]],[[64080,64080],"mapped",[31062]],[[64081,64081],"mapped",[31069]],[[64082,64082],"mapped",[31117]],[[64083,64083],"mapped",[31118]],[[64084,64084],"mapped",[31296]],[[64085,64085],"mapped",[31361]],[[64086,64086],"mapped",[31680]],[[64087,64087],"mapped",[32244]],[[64088,64088],"mapped",[32265]],[[64089,64089],"mapped",[32321]],[[64090,64090],"mapped",[32626]],[[64091,64091],"mapped",[32773]],[[64092,64092],"mapped",[33261]],[[64093,64094],"mapped",[33401]],[[64095,64095],"mapped",[33879]],[[64096,64096],"mapped",[35088]],[[64097,64097],"mapped",[35222]],[[64098,64098],"mapped",[35585]],[[64099,64099],"mapped",[35641]],[[64100,64100],"mapped",[36051]],[[64101,64101],"mapped",[36104]],[[64102,64102],"mapped",[36790]],[[64103,64103],"mapped",[36920]],[[64104,64104],"mapped",[38627]],[[64105,64105],"mapped",[38911]],[[64106,64106],"mapped",[38971]],[[64107,64107],"mapped",[24693]],[[64108,64108],"mapped",[148206]],[[64109,64109],"mapped",[33304]],[[64110,64111],"disallowed"],[[64112,64112],"mapped",[20006]],[[64113,64113],"mapped",[20917]],[[64114,64114],"mapped",[20840]],[[64115,64115],"mapped",[20352]],[[64116,64116],"mapped",[20805]],[[64117,64117],"mapped",[20864]],[[64118,64118],"mapped",[21191]],[[64119,64119],"mapped",[21242]],[[64120,64120],"mapped",[21917]],[[64121,64121],"mapped",[21845]],[[64122,64122],"mapped",[21913]],[[64123,64123],"mapped",[21986]],[[64124,64124],"mapped",[22618]],[[64125,64125],"mapped",[22707]],[[64126,64126],"mapped",[22852]],[[64127,64127],"mapped",[22868]],[[64128,64128],"mapped",[23138]],[[64129,64129],"mapped",[23336]],[[64130,64130],"mapped",[24274]],[[64131,64131],"mapped",[24281]],[[64132,64132],"mapped",[24425]],[[64133,64133],"mapped",[24493]],[[64134,64134],"mapped",[24792]],[[64135,64135],"mapped",[24910]],[[64136,64136],"mapped",[24840]],[[64137,64137],"mapped",[24974]],[[64138,64138],"mapped",[24928]],[[64139,64139],"mapped",[25074]],[[64140,64140],"mapped",[25140]],[[64141,64141],"mapped",[25540]],[[64142,64142],"mapped",[25628]],[[64143,64143],"mapped",[25682]],[[64144,64144],"mapped",[25942]],[[64145,64145],"mapped",[26228]],[[64146,64146],"mapped",[26391]],[[64147,64147],"mapped",[26395]],[[64148,64148],"mapped",[26454]],[[64149,64149],"mapped",[27513]],[[64150,64150],"mapped",[27578]],[[64151,64151],"mapped",[27969]],[[64152,64152],"mapped",[28379]],[[64153,64153],"mapped",[28363]],[[64154,64154],"mapped",[28450]],[[64155,64155],"mapped",[28702]],[[64156,64156],"mapped",[29038]],[[64157,64157],"mapped",[30631]],[[64158,64158],"mapped",[29237]],[[64159,64159],"mapped",[29359]],[[64160,64160],"mapped",[29482]],[[64161,64161],"mapped",[29809]],[[64162,64162],"mapped",[29958]],[[64163,64163],"mapped",[30011]],[[64164,64164],"mapped",[30237]],[[64165,64165],"mapped",[30239]],[[64166,64166],"mapped",[30410]],[[64167,64167],"mapped",[30427]],[[64168,64168],"mapped",[30452]],[[64169,64169],"mapped",[30538]],[[64170,64170],"mapped",[30528]],[[64171,64171],"mapped",[30924]],[[64172,64172],"mapped",[31409]],[[64173,64173],"mapped",[31680]],[[64174,64174],"mapped",[31867]],[[64175,64175],"mapped",[32091]],[[64176,64176],"mapped",[32244]],[[64177,64177],"mapped",[32574]],[[64178,64178],"mapped",[32773]],[[64179,64179],"mapped",[33618]],[[64180,64180],"mapped",[33775]],[[64181,64181],"mapped",[34681]],[[64182,64182],"mapped",[35137]],[[64183,64183],"mapped",[35206]],[[64184,64184],"mapped",[35222]],[[64185,64185],"mapped",[35519]],[[64186,64186],"mapped",[35576]],[[64187,64187],"mapped",[35531]],[[64188,64188],"mapped",[35585]],[[64189,64189],"mapped",[35582]],[[64190,64190],"mapped",[35565]],[[64191,64191],"mapped",[35641]],[[64192,64192],"mapped",[35722]],[[64193,64193],"mapped",[36104]],[[64194,64194],"mapped",[36664]],[[64195,64195],"mapped",[36978]],[[64196,64196],"mapped",[37273]],[[64197,64197],"mapped",[37494]],[[64198,64198],"mapped",[38524]],[[64199,64199],"mapped",[38627]],[[64200,64200],"mapped",[38742]],[[64201,64201],"mapped",[38875]],[[64202,64202],"mapped",[38911]],[[64203,64203],"mapped",[38923]],[[64204,64204],"mapped",[38971]],[[64205,64205],"mapped",[39698]],[[64206,64206],"mapped",[40860]],[[64207,64207],"mapped",[141386]],[[64208,64208],"mapped",[141380]],[[64209,64209],"mapped",[144341]],[[64210,64210],"mapped",[15261]],[[64211,64211],"mapped",[16408]],[[64212,64212],"mapped",[16441]],[[64213,64213],"mapped",[152137]],[[64214,64214],"mapped",[154832]],[[64215,64215],"mapped",[163539]],[[64216,64216],"mapped",[40771]],[[64217,64217],"mapped",[40846]],[[64218,64255],"disallowed"],[[64256,64256],"mapped",[102,102]],[[64257,64257],"mapped",[102,105]],[[64258,64258],"mapped",[102,108]],[[64259,64259],"mapped",[102,102,105]],[[64260,64260],"mapped",[102,102,108]],[[64261,64262],"mapped",[115,116]],[[64263,64274],"disallowed"],[[64275,64275],"mapped",[1396,1398]],[[64276,64276],"mapped",[1396,1381]],[[64277,64277],"mapped",[1396,1387]],[[64278,64278],"mapped",[1406,1398]],[[64279,64279],"mapped",[1396,1389]],[[64280,64284],"disallowed"],[[64285,64285],"mapped",[1497,1460]],[[64286,64286],"valid"],[[64287,64287],"mapped",[1522,1463]],[[64288,64288],"mapped",[1506]],[[64289,64289],"mapped",[1488]],[[64290,64290],"mapped",[1491]],[[64291,64291],"mapped",[1492]],[[64292,64292],"mapped",[1499]],[[64293,64293],"mapped",[1500]],[[64294,64294],"mapped",[1501]],[[64295,64295],"mapped",[1512]],[[64296,64296],"mapped",[1514]],[[64297,64297],"disallowed_STD3_mapped",[43]],[[64298,64298],"mapped",[1513,1473]],[[64299,64299],"mapped",[1513,1474]],[[64300,64300],"mapped",[1513,1468,1473]],[[64301,64301],"mapped",[1513,1468,1474]],[[64302,64302],"mapped",[1488,1463]],[[64303,64303],"mapped",[1488,1464]],[[64304,64304],"mapped",[1488,1468]],[[64305,64305],"mapped",[1489,1468]],[[64306,64306],"mapped",[1490,1468]],[[64307,64307],"mapped",[1491,1468]],[[64308,64308],"mapped",[1492,1468]],[[64309,64309],"mapped",[1493,1468]],[[64310,64310],"mapped",[1494,1468]],[[64311,64311],"disallowed"],[[64312,64312],"mapped",[1496,1468]],[[64313,64313],"mapped",[1497,1468]],[[64314,64314],"mapped",[1498,1468]],[[64315,64315],"mapped",[1499,1468]],[[64316,64316],"mapped",[1500,1468]],[[64317,64317],"disallowed"],[[64318,64318],"mapped",[1502,1468]],[[64319,64319],"disallowed"],[[64320,64320],"mapped",[1504,1468]],[[64321,64321],"mapped",[1505,1468]],[[64322,64322],"disallowed"],[[64323,64323],"mapped",[1507,1468]],[[64324,64324],"mapped",[1508,1468]],[[64325,64325],"disallowed"],[[64326,64326],"mapped",[1510,1468]],[[64327,64327],"mapped",[1511,1468]],[[64328,64328],"mapped",[1512,1468]],[[64329,64329],"mapped",[1513,1468]],[[64330,64330],"mapped",[1514,1468]],[[64331,64331],"mapped",[1493,1465]],[[64332,64332],"mapped",[1489,1471]],[[64333,64333],"mapped",[1499,1471]],[[64334,64334],"mapped",[1508,1471]],[[64335,64335],"mapped",[1488,1500]],[[64336,64337],"mapped",[1649]],[[64338,64341],"mapped",[1659]],[[64342,64345],"mapped",[1662]],[[64346,64349],"mapped",[1664]],[[64350,64353],"mapped",[1658]],[[64354,64357],"mapped",[1663]],[[64358,64361],"mapped",[1657]],[[64362,64365],"mapped",[1700]],[[64366,64369],"mapped",[1702]],[[64370,64373],"mapped",[1668]],[[64374,64377],"mapped",[1667]],[[64378,64381],"mapped",[1670]],[[64382,64385],"mapped",[1671]],[[64386,64387],"mapped",[1677]],[[64388,64389],"mapped",[1676]],[[64390,64391],"mapped",[1678]],[[64392,64393],"mapped",[1672]],[[64394,64395],"mapped",[1688]],[[64396,64397],"mapped",[1681]],[[64398,64401],"mapped",[1705]],[[64402,64405],"mapped",[1711]],[[64406,64409],"mapped",[1715]],[[64410,64413],"mapped",[1713]],[[64414,64415],"mapped",[1722]],[[64416,64419],"mapped",[1723]],[[64420,64421],"mapped",[1728]],[[64422,64425],"mapped",[1729]],[[64426,64429],"mapped",[1726]],[[64430,64431],"mapped",[1746]],[[64432,64433],"mapped",[1747]],[[64434,64449],"valid",[],"NV8"],[[64450,64466],"disallowed"],[[64467,64470],"mapped",[1709]],[[64471,64472],"mapped",[1735]],[[64473,64474],"mapped",[1734]],[[64475,64476],"mapped",[1736]],[[64477,64477],"mapped",[1735,1652]],[[64478,64479],"mapped",[1739]],[[64480,64481],"mapped",[1733]],[[64482,64483],"mapped",[1737]],[[64484,64487],"mapped",[1744]],[[64488,64489],"mapped",[1609]],[[64490,64491],"mapped",[1574,1575]],[[64492,64493],"mapped",[1574,1749]],[[64494,64495],"mapped",[1574,1608]],[[64496,64497],"mapped",[1574,1735]],[[64498,64499],"mapped",[1574,1734]],[[64500,64501],"mapped",[1574,1736]],[[64502,64504],"mapped",[1574,1744]],[[64505,64507],"mapped",[1574,1609]],[[64508,64511],"mapped",[1740]],[[64512,64512],"mapped",[1574,1580]],[[64513,64513],"mapped",[1574,1581]],[[64514,64514],"mapped",[1574,1605]],[[64515,64515],"mapped",[1574,1609]],[[64516,64516],"mapped",[1574,1610]],[[64517,64517],"mapped",[1576,1580]],[[64518,64518],"mapped",[1576,1581]],[[64519,64519],"mapped",[1576,1582]],[[64520,64520],"mapped",[1576,1605]],[[64521,64521],"mapped",[1576,1609]],[[64522,64522],"mapped",[1576,1610]],[[64523,64523],"mapped",[1578,1580]],[[64524,64524],"mapped",[1578,1581]],[[64525,64525],"mapped",[1578,1582]],[[64526,64526],"mapped",[1578,1605]],[[64527,64527],"mapped",[1578,1609]],[[64528,64528],"mapped",[1578,1610]],[[64529,64529],"mapped",[1579,1580]],[[64530,64530],"mapped",[1579,1605]],[[64531,64531],"mapped",[1579,1609]],[[64532,64532],"mapped",[1579,1610]],[[64533,64533],"mapped",[1580,1581]],[[64534,64534],"mapped",[1580,1605]],[[64535,64535],"mapped",[1581,1580]],[[64536,64536],"mapped",[1581,1605]],[[64537,64537],"mapped",[1582,1580]],[[64538,64538],"mapped",[1582,1581]],[[64539,64539],"mapped",[1582,1605]],[[64540,64540],"mapped",[1587,1580]],[[64541,64541],"mapped",[1587,1581]],[[64542,64542],"mapped",[1587,1582]],[[64543,64543],"mapped",[1587,1605]],[[64544,64544],"mapped",[1589,1581]],[[64545,64545],"mapped",[1589,1605]],[[64546,64546],"mapped",[1590,1580]],[[64547,64547],"mapped",[1590,1581]],[[64548,64548],"mapped",[1590,1582]],[[64549,64549],"mapped",[1590,1605]],[[64550,64550],"mapped",[1591,1581]],[[64551,64551],"mapped",[1591,1605]],[[64552,64552],"mapped",[1592,1605]],[[64553,64553],"mapped",[1593,1580]],[[64554,64554],"mapped",[1593,1605]],[[64555,64555],"mapped",[1594,1580]],[[64556,64556],"mapped",[1594,1605]],[[64557,64557],"mapped",[1601,1580]],[[64558,64558],"mapped",[1601,1581]],[[64559,64559],"mapped",[1601,1582]],[[64560,64560],"mapped",[1601,1605]],[[64561,64561],"mapped",[1601,1609]],[[64562,64562],"mapped",[1601,1610]],[[64563,64563],"mapped",[1602,1581]],[[64564,64564],"mapped",[1602,1605]],[[64565,64565],"mapped",[1602,1609]],[[64566,64566],"mapped",[1602,1610]],[[64567,64567],"mapped",[1603,1575]],[[64568,64568],"mapped",[1603,1580]],[[64569,64569],"mapped",[1603,1581]],[[64570,64570],"mapped",[1603,1582]],[[64571,64571],"mapped",[1603,1604]],[[64572,64572],"mapped",[1603,1605]],[[64573,64573],"mapped",[1603,1609]],[[64574,64574],"mapped",[1603,1610]],[[64575,64575],"mapped",[1604,1580]],[[64576,64576],"mapped",[1604,1581]],[[64577,64577],"mapped",[1604,1582]],[[64578,64578],"mapped",[1604,1605]],[[64579,64579],"mapped",[1604,1609]],[[64580,64580],"mapped",[1604,1610]],[[64581,64581],"mapped",[1605,1580]],[[64582,64582],"mapped",[1605,1581]],[[64583,64583],"mapped",[1605,1582]],[[64584,64584],"mapped",[1605,1605]],[[64585,64585],"mapped",[1605,1609]],[[64586,64586],"mapped",[1605,1610]],[[64587,64587],"mapped",[1606,1580]],[[64588,64588],"mapped",[1606,1581]],[[64589,64589],"mapped",[1606,1582]],[[64590,64590],"mapped",[1606,1605]],[[64591,64591],"mapped",[1606,1609]],[[64592,64592],"mapped",[1606,1610]],[[64593,64593],"mapped",[1607,1580]],[[64594,64594],"mapped",[1607,1605]],[[64595,64595],"mapped",[1607,1609]],[[64596,64596],"mapped",[1607,1610]],[[64597,64597],"mapped",[1610,1580]],[[64598,64598],"mapped",[1610,1581]],[[64599,64599],"mapped",[1610,1582]],[[64600,64600],"mapped",[1610,1605]],[[64601,64601],"mapped",[1610,1609]],[[64602,64602],"mapped",[1610,1610]],[[64603,64603],"mapped",[1584,1648]],[[64604,64604],"mapped",[1585,1648]],[[64605,64605],"mapped",[1609,1648]],[[64606,64606],"disallowed_STD3_mapped",[32,1612,1617]],[[64607,64607],"disallowed_STD3_mapped",[32,1613,1617]],[[64608,64608],"disallowed_STD3_mapped",[32,1614,1617]],[[64609,64609],"disallowed_STD3_mapped",[32,1615,1617]],[[64610,64610],"disallowed_STD3_mapped",[32,1616,1617]],[[64611,64611],"disallowed_STD3_mapped",[32,1617,1648]],[[64612,64612],"mapped",[1574,1585]],[[64613,64613],"mapped",[1574,1586]],[[64614,64614],"mapped",[1574,1605]],[[64615,64615],"mapped",[1574,1606]],[[64616,64616],"mapped",[1574,1609]],[[64617,64617],"mapped",[1574,1610]],[[64618,64618],"mapped",[1576,1585]],[[64619,64619],"mapped",[1576,1586]],[[64620,64620],"mapped",[1576,1605]],[[64621,64621],"mapped",[1576,1606]],[[64622,64622],"mapped",[1576,1609]],[[64623,64623],"mapped",[1576,1610]],[[64624,64624],"mapped",[1578,1585]],[[64625,64625],"mapped",[1578,1586]],[[64626,64626],"mapped",[1578,1605]],[[64627,64627],"mapped",[1578,1606]],[[64628,64628],"mapped",[1578,1609]],[[64629,64629],"mapped",[1578,1610]],[[64630,64630],"mapped",[1579,1585]],[[64631,64631],"mapped",[1579,1586]],[[64632,64632],"mapped",[1579,1605]],[[64633,64633],"mapped",[1579,1606]],[[64634,64634],"mapped",[1579,1609]],[[64635,64635],"mapped",[1579,1610]],[[64636,64636],"mapped",[1601,1609]],[[64637,64637],"mapped",[1601,1610]],[[64638,64638],"mapped",[1602,1609]],[[64639,64639],"mapped",[1602,1610]],[[64640,64640],"mapped",[1603,1575]],[[64641,64641],"mapped",[1603,1604]],[[64642,64642],"mapped",[1603,1605]],[[64643,64643],"mapped",[1603,1609]],[[64644,64644],"mapped",[1603,1610]],[[64645,64645],"mapped",[1604,1605]],[[64646,64646],"mapped",[1604,1609]],[[64647,64647],"mapped",[1604,1610]],[[64648,64648],"mapped",[1605,1575]],[[64649,64649],"mapped",[1605,1605]],[[64650,64650],"mapped",[1606,1585]],[[64651,64651],"mapped",[1606,1586]],[[64652,64652],"mapped",[1606,1605]],[[64653,64653],"mapped",[1606,1606]],[[64654,64654],"mapped",[1606,1609]],[[64655,64655],"mapped",[1606,1610]],[[64656,64656],"mapped",[1609,1648]],[[64657,64657],"mapped",[1610,1585]],[[64658,64658],"mapped",[1610,1586]],[[64659,64659],"mapped",[1610,1605]],[[64660,64660],"mapped",[1610,1606]],[[64661,64661],"mapped",[1610,1609]],[[64662,64662],"mapped",[1610,1610]],[[64663,64663],"mapped",[1574,1580]],[[64664,64664],"mapped",[1574,1581]],[[64665,64665],"mapped",[1574,1582]],[[64666,64666],"mapped",[1574,1605]],[[64667,64667],"mapped",[1574,1607]],[[64668,64668],"mapped",[1576,1580]],[[64669,64669],"mapped",[1576,1581]],[[64670,64670],"mapped",[1576,1582]],[[64671,64671],"mapped",[1576,1605]],[[64672,64672],"mapped",[1576,1607]],[[64673,64673],"mapped",[1578,1580]],[[64674,64674],"mapped",[1578,1581]],[[64675,64675],"mapped",[1578,1582]],[[64676,64676],"mapped",[1578,1605]],[[64677,64677],"mapped",[1578,1607]],[[64678,64678],"mapped",[1579,1605]],[[64679,64679],"mapped",[1580,1581]],[[64680,64680],"mapped",[1580,1605]],[[64681,64681],"mapped",[1581,1580]],[[64682,64682],"mapped",[1581,1605]],[[64683,64683],"mapped",[1582,1580]],[[64684,64684],"mapped",[1582,1605]],[[64685,64685],"mapped",[1587,1580]],[[64686,64686],"mapped",[1587,1581]],[[64687,64687],"mapped",[1587,1582]],[[64688,64688],"mapped",[1587,1605]],[[64689,64689],"mapped",[1589,1581]],[[64690,64690],"mapped",[1589,1582]],[[64691,64691],"mapped",[1589,1605]],[[64692,64692],"mapped",[1590,1580]],[[64693,64693],"mapped",[1590,1581]],[[64694,64694],"mapped",[1590,1582]],[[64695,64695],"mapped",[1590,1605]],[[64696,64696],"mapped",[1591,1581]],[[64697,64697],"mapped",[1592,1605]],[[64698,64698],"mapped",[1593,1580]],[[64699,64699],"mapped",[1593,1605]],[[64700,64700],"mapped",[1594,1580]],[[64701,64701],"mapped",[1594,1605]],[[64702,64702],"mapped",[1601,1580]],[[64703,64703],"mapped",[1601,1581]],[[64704,64704],"mapped",[1601,1582]],[[64705,64705],"mapped",[1601,1605]],[[64706,64706],"mapped",[1602,1581]],[[64707,64707],"mapped",[1602,1605]],[[64708,64708],"mapped",[1603,1580]],[[64709,64709],"mapped",[1603,1581]],[[64710,64710],"mapped",[1603,1582]],[[64711,64711],"mapped",[1603,1604]],[[64712,64712],"mapped",[1603,1605]],[[64713,64713],"mapped",[1604,1580]],[[64714,64714],"mapped",[1604,1581]],[[64715,64715],"mapped",[1604,1582]],[[64716,64716],"mapped",[1604,1605]],[[64717,64717],"mapped",[1604,1607]],[[64718,64718],"mapped",[1605,1580]],[[64719,64719],"mapped",[1605,1581]],[[64720,64720],"mapped",[1605,1582]],[[64721,64721],"mapped",[1605,1605]],[[64722,64722],"mapped",[1606,1580]],[[64723,64723],"mapped",[1606,1581]],[[64724,64724],"mapped",[1606,1582]],[[64725,64725],"mapped",[1606,1605]],[[64726,64726],"mapped",[1606,1607]],[[64727,64727],"mapped",[1607,1580]],[[64728,64728],"mapped",[1607,1605]],[[64729,64729],"mapped",[1607,1648]],[[64730,64730],"mapped",[1610,1580]],[[64731,64731],"mapped",[1610,1581]],[[64732,64732],"mapped",[1610,1582]],[[64733,64733],"mapped",[1610,1605]],[[64734,64734],"mapped",[1610,1607]],[[64735,64735],"mapped",[1574,1605]],[[64736,64736],"mapped",[1574,1607]],[[64737,64737],"mapped",[1576,1605]],[[64738,64738],"mapped",[1576,1607]],[[64739,64739],"mapped",[1578,1605]],[[64740,64740],"mapped",[1578,1607]],[[64741,64741],"mapped",[1579,1605]],[[64742,64742],"mapped",[1579,1607]],[[64743,64743],"mapped",[1587,1605]],[[64744,64744],"mapped",[1587,1607]],[[64745,64745],"mapped",[1588,1605]],[[64746,64746],"mapped",[1588,1607]],[[64747,64747],"mapped",[1603,1604]],[[64748,64748],"mapped",[1603,1605]],[[64749,64749],"mapped",[1604,1605]],[[64750,64750],"mapped",[1606,1605]],[[64751,64751],"mapped",[1606,1607]],[[64752,64752],"mapped",[1610,1605]],[[64753,64753],"mapped",[1610,1607]],[[64754,64754],"mapped",[1600,1614,1617]],[[64755,64755],"mapped",[1600,1615,1617]],[[64756,64756],"mapped",[1600,1616,1617]],[[64757,64757],"mapped",[1591,1609]],[[64758,64758],"mapped",[1591,1610]],[[64759,64759],"mapped",[1593,1609]],[[64760,64760],"mapped",[1593,1610]],[[64761,64761],"mapped",[1594,1609]],[[64762,64762],"mapped",[1594,1610]],[[64763,64763],"mapped",[1587,1609]],[[64764,64764],"mapped",[1587,1610]],[[64765,64765],"mapped",[1588,1609]],[[64766,64766],"mapped",[1588,1610]],[[64767,64767],"mapped",[1581,1609]],[[64768,64768],"mapped",[1581,1610]],[[64769,64769],"mapped",[1580,1609]],[[64770,64770],"mapped",[1580,1610]],[[64771,64771],"mapped",[1582,1609]],[[64772,64772],"mapped",[1582,1610]],[[64773,64773],"mapped",[1589,1609]],[[64774,64774],"mapped",[1589,1610]],[[64775,64775],"mapped",[1590,1609]],[[64776,64776],"mapped",[1590,1610]],[[64777,64777],"mapped",[1588,1580]],[[64778,64778],"mapped",[1588,1581]],[[64779,64779],"mapped",[1588,1582]],[[64780,64780],"mapped",[1588,1605]],[[64781,64781],"mapped",[1588,1585]],[[64782,64782],"mapped",[1587,1585]],[[64783,64783],"mapped",[1589,1585]],[[64784,64784],"mapped",[1590,1585]],[[64785,64785],"mapped",[1591,1609]],[[64786,64786],"mapped",[1591,1610]],[[64787,64787],"mapped",[1593,1609]],[[64788,64788],"mapped",[1593,1610]],[[64789,64789],"mapped",[1594,1609]],[[64790,64790],"mapped",[1594,1610]],[[64791,64791],"mapped",[1587,1609]],[[64792,64792],"mapped",[1587,1610]],[[64793,64793],"mapped",[1588,1609]],[[64794,64794],"mapped",[1588,1610]],[[64795,64795],"mapped",[1581,1609]],[[64796,64796],"mapped",[1581,1610]],[[64797,64797],"mapped",[1580,1609]],[[64798,64798],"mapped",[1580,1610]],[[64799,64799],"mapped",[1582,1609]],[[64800,64800],"mapped",[1582,1610]],[[64801,64801],"mapped",[1589,1609]],[[64802,64802],"mapped",[1589,1610]],[[64803,64803],"mapped",[1590,1609]],[[64804,64804],"mapped",[1590,1610]],[[64805,64805],"mapped",[1588,1580]],[[64806,64806],"mapped",[1588,1581]],[[64807,64807],"mapped",[1588,1582]],[[64808,64808],"mapped",[1588,1605]],[[64809,64809],"mapped",[1588,1585]],[[64810,64810],"mapped",[1587,1585]],[[64811,64811],"mapped",[1589,1585]],[[64812,64812],"mapped",[1590,1585]],[[64813,64813],"mapped",[1588,1580]],[[64814,64814],"mapped",[1588,1581]],[[64815,64815],"mapped",[1588,1582]],[[64816,64816],"mapped",[1588,1605]],[[64817,64817],"mapped",[1587,1607]],[[64818,64818],"mapped",[1588,1607]],[[64819,64819],"mapped",[1591,1605]],[[64820,64820],"mapped",[1587,1580]],[[64821,64821],"mapped",[1587,1581]],[[64822,64822],"mapped",[1587,1582]],[[64823,64823],"mapped",[1588,1580]],[[64824,64824],"mapped",[1588,1581]],[[64825,64825],"mapped",[1588,1582]],[[64826,64826],"mapped",[1591,1605]],[[64827,64827],"mapped",[1592,1605]],[[64828,64829],"mapped",[1575,1611]],[[64830,64831],"valid",[],"NV8"],[[64832,64847],"disallowed"],[[64848,64848],"mapped",[1578,1580,1605]],[[64849,64850],"mapped",[1578,1581,1580]],[[64851,64851],"mapped",[1578,1581,1605]],[[64852,64852],"mapped",[1578,1582,1605]],[[64853,64853],"mapped",[1578,1605,1580]],[[64854,64854],"mapped",[1578,1605,1581]],[[64855,64855],"mapped",[1578,1605,1582]],[[64856,64857],"mapped",[1580,1605,1581]],[[64858,64858],"mapped",[1581,1605,1610]],[[64859,64859],"mapped",[1581,1605,1609]],[[64860,64860],"mapped",[1587,1581,1580]],[[64861,64861],"mapped",[1587,1580,1581]],[[64862,64862],"mapped",[1587,1580,1609]],[[64863,64864],"mapped",[1587,1605,1581]],[[64865,64865],"mapped",[1587,1605,1580]],[[64866,64867],"mapped",[1587,1605,1605]],[[64868,64869],"mapped",[1589,1581,1581]],[[64870,64870],"mapped",[1589,1605,1605]],[[64871,64872],"mapped",[1588,1581,1605]],[[64873,64873],"mapped",[1588,1580,1610]],[[64874,64875],"mapped",[1588,1605,1582]],[[64876,64877],"mapped",[1588,1605,1605]],[[64878,64878],"mapped",[1590,1581,1609]],[[64879,64880],"mapped",[1590,1582,1605]],[[64881,64882],"mapped",[1591,1605,1581]],[[64883,64883],"mapped",[1591,1605,1605]],[[64884,64884],"mapped",[1591,1605,1610]],[[64885,64885],"mapped",[1593,1580,1605]],[[64886,64887],"mapped",[1593,1605,1605]],[[64888,64888],"mapped",[1593,1605,1609]],[[64889,64889],"mapped",[1594,1605,1605]],[[64890,64890],"mapped",[1594,1605,1610]],[[64891,64891],"mapped",[1594,1605,1609]],[[64892,64893],"mapped",[1601,1582,1605]],[[64894,64894],"mapped",[1602,1605,1581]],[[64895,64895],"mapped",[1602,1605,1605]],[[64896,64896],"mapped",[1604,1581,1605]],[[64897,64897],"mapped",[1604,1581,1610]],[[64898,64898],"mapped",[1604,1581,1609]],[[64899,64900],"mapped",[1604,1580,1580]],[[64901,64902],"mapped",[1604,1582,1605]],[[64903,64904],"mapped",[1604,1605,1581]],[[64905,64905],"mapped",[1605,1581,1580]],[[64906,64906],"mapped",[1605,1581,1605]],[[64907,64907],"mapped",[1605,1581,1610]],[[64908,64908],"mapped",[1605,1580,1581]],[[64909,64909],"mapped",[1605,1580,1605]],[[64910,64910],"mapped",[1605,1582,1580]],[[64911,64911],"mapped",[1605,1582,1605]],[[64912,64913],"disallowed"],[[64914,64914],"mapped",[1605,1580,1582]],[[64915,64915],"mapped",[1607,1605,1580]],[[64916,64916],"mapped",[1607,1605,1605]],[[64917,64917],"mapped",[1606,1581,1605]],[[64918,64918],"mapped",[1606,1581,1609]],[[64919,64920],"mapped",[1606,1580,1605]],[[64921,64921],"mapped",[1606,1580,1609]],[[64922,64922],"mapped",[1606,1605,1610]],[[64923,64923],"mapped",[1606,1605,1609]],[[64924,64925],"mapped",[1610,1605,1605]],[[64926,64926],"mapped",[1576,1582,1610]],[[64927,64927],"mapped",[1578,1580,1610]],[[64928,64928],"mapped",[1578,1580,1609]],[[64929,64929],"mapped",[1578,1582,1610]],[[64930,64930],"mapped",[1578,1582,1609]],[[64931,64931],"mapped",[1578,1605,1610]],[[64932,64932],"mapped",[1578,1605,1609]],[[64933,64933],"mapped",[1580,1605,1610]],[[64934,64934],"mapped",[1580,1581,1609]],[[64935,64935],"mapped",[1580,1605,1609]],[[64936,64936],"mapped",[1587,1582,1609]],[[64937,64937],"mapped",[1589,1581,1610]],[[64938,64938],"mapped",[1588,1581,1610]],[[64939,64939],"mapped",[1590,1581,1610]],[[64940,64940],"mapped",[1604,1580,1610]],[[64941,64941],"mapped",[1604,1605,1610]],[[64942,64942],"mapped",[1610,1581,1610]],[[64943,64943],"mapped",[1610,1580,1610]],[[64944,64944],"mapped",[1610,1605,1610]],[[64945,64945],"mapped",[1605,1605,1610]],[[64946,64946],"mapped",[1602,1605,1610]],[[64947,64947],"mapped",[1606,1581,1610]],[[64948,64948],"mapped",[1602,1605,1581]],[[64949,64949],"mapped",[1604,1581,1605]],[[64950,64950],"mapped",[1593,1605,1610]],[[64951,64951],"mapped",[1603,1605,1610]],[[64952,64952],"mapped",[1606,1580,1581]],[[64953,64953],"mapped",[1605,1582,1610]],[[64954,64954],"mapped",[1604,1580,1605]],[[64955,64955],"mapped",[1603,1605,1605]],[[64956,64956],"mapped",[1604,1580,1605]],[[64957,64957],"mapped",[1606,1580,1581]],[[64958,64958],"mapped",[1580,1581,1610]],[[64959,64959],"mapped",[1581,1580,1610]],[[64960,64960],"mapped",[1605,1580,1610]],[[64961,64961],"mapped",[1601,1605,1610]],[[64962,64962],"mapped",[1576,1581,1610]],[[64963,64963],"mapped",[1603,1605,1605]],[[64964,64964],"mapped",[1593,1580,1605]],[[64965,64965],"mapped",[1589,1605,1605]],[[64966,64966],"mapped",[1587,1582,1610]],[[64967,64967],"mapped",[1606,1580,1610]],[[64968,64975],"disallowed"],[[64976,65007],"disallowed"],[[65008,65008],"mapped",[1589,1604,1746]],[[65009,65009],"mapped",[1602,1604,1746]],[[65010,65010],"mapped",[1575,1604,1604,1607]],[[65011,65011],"mapped",[1575,1603,1576,1585]],[[65012,65012],"mapped",[1605,1581,1605,1583]],[[65013,65013],"mapped",[1589,1604,1593,1605]],[[65014,65014],"mapped",[1585,1587,1608,1604]],[[65015,65015],"mapped",[1593,1604,1610,1607]],[[65016,65016],"mapped",[1608,1587,1604,1605]],[[65017,65017],"mapped",[1589,1604,1609]],[[65018,65018],"disallowed_STD3_mapped",[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605]],[[65019,65019],"disallowed_STD3_mapped",[1580,1604,32,1580,1604,1575,1604,1607]],[[65020,65020],"mapped",[1585,1740,1575,1604]],[[65021,65021],"valid",[],"NV8"],[[65022,65023],"disallowed"],[[65024,65039],"ignored"],[[65040,65040],"disallowed_STD3_mapped",[44]],[[65041,65041],"mapped",[12289]],[[65042,65042],"disallowed"],[[65043,65043],"disallowed_STD3_mapped",[58]],[[65044,65044],"disallowed_STD3_mapped",[59]],[[65045,65045],"disallowed_STD3_mapped",[33]],[[65046,65046],"disallowed_STD3_mapped",[63]],[[65047,65047],"mapped",[12310]],[[65048,65048],"mapped",[12311]],[[65049,65049],"disallowed"],[[65050,65055],"disallowed"],[[65056,65059],"valid"],[[65060,65062],"valid"],[[65063,65069],"valid"],[[65070,65071],"valid"],[[65072,65072],"disallowed"],[[65073,65073],"mapped",[8212]],[[65074,65074],"mapped",[8211]],[[65075,65076],"disallowed_STD3_mapped",[95]],[[65077,65077],"disallowed_STD3_mapped",[40]],[[65078,65078],"disallowed_STD3_mapped",[41]],[[65079,65079],"disallowed_STD3_mapped",[123]],[[65080,65080],"disallowed_STD3_mapped",[125]],[[65081,65081],"mapped",[12308]],[[65082,65082],"mapped",[12309]],[[65083,65083],"mapped",[12304]],[[65084,65084],"mapped",[12305]],[[65085,65085],"mapped",[12298]],[[65086,65086],"mapped",[12299]],[[65087,65087],"mapped",[12296]],[[65088,65088],"mapped",[12297]],[[65089,65089],"mapped",[12300]],[[65090,65090],"mapped",[12301]],[[65091,65091],"mapped",[12302]],[[65092,65092],"mapped",[12303]],[[65093,65094],"valid",[],"NV8"],[[65095,65095],"disallowed_STD3_mapped",[91]],[[65096,65096],"disallowed_STD3_mapped",[93]],[[65097,65100],"disallowed_STD3_mapped",[32,773]],[[65101,65103],"disallowed_STD3_mapped",[95]],[[65104,65104],"disallowed_STD3_mapped",[44]],[[65105,65105],"mapped",[12289]],[[65106,65106],"disallowed"],[[65107,65107],"disallowed"],[[65108,65108],"disallowed_STD3_mapped",[59]],[[65109,65109],"disallowed_STD3_mapped",[58]],[[65110,65110],"disallowed_STD3_mapped",[63]],[[65111,65111],"disallowed_STD3_mapped",[33]],[[65112,65112],"mapped",[8212]],[[65113,65113],"disallowed_STD3_mapped",[40]],[[65114,65114],"disallowed_STD3_mapped",[41]],[[65115,65115],"disallowed_STD3_mapped",[123]],[[65116,65116],"disallowed_STD3_mapped",[125]],[[65117,65117],"mapped",[12308]],[[65118,65118],"mapped",[12309]],[[65119,65119],"disallowed_STD3_mapped",[35]],[[65120,65120],"disallowed_STD3_mapped",[38]],[[65121,65121],"disallowed_STD3_mapped",[42]],[[65122,65122],"disallowed_STD3_mapped",[43]],[[65123,65123],"mapped",[45]],[[65124,65124],"disallowed_STD3_mapped",[60]],[[65125,65125],"disallowed_STD3_mapped",[62]],[[65126,65126],"disallowed_STD3_mapped",[61]],[[65127,65127],"disallowed"],[[65128,65128],"disallowed_STD3_mapped",[92]],[[65129,65129],"disallowed_STD3_mapped",[36]],[[65130,65130],"disallowed_STD3_mapped",[37]],[[65131,65131],"disallowed_STD3_mapped",[64]],[[65132,65135],"disallowed"],[[65136,65136],"disallowed_STD3_mapped",[32,1611]],[[65137,65137],"mapped",[1600,1611]],[[65138,65138],"disallowed_STD3_mapped",[32,1612]],[[65139,65139],"valid"],[[65140,65140],"disallowed_STD3_mapped",[32,1613]],[[65141,65141],"disallowed"],[[65142,65142],"disallowed_STD3_mapped",[32,1614]],[[65143,65143],"mapped",[1600,1614]],[[65144,65144],"disallowed_STD3_mapped",[32,1615]],[[65145,65145],"mapped",[1600,1615]],[[65146,65146],"disallowed_STD3_mapped",[32,1616]],[[65147,65147],"mapped",[1600,1616]],[[65148,65148],"disallowed_STD3_mapped",[32,1617]],[[65149,65149],"mapped",[1600,1617]],[[65150,65150],"disallowed_STD3_mapped",[32,1618]],[[65151,65151],"mapped",[1600,1618]],[[65152,65152],"mapped",[1569]],[[65153,65154],"mapped",[1570]],[[65155,65156],"mapped",[1571]],[[65157,65158],"mapped",[1572]],[[65159,65160],"mapped",[1573]],[[65161,65164],"mapped",[1574]],[[65165,65166],"mapped",[1575]],[[65167,65170],"mapped",[1576]],[[65171,65172],"mapped",[1577]],[[65173,65176],"mapped",[1578]],[[65177,65180],"mapped",[1579]],[[65181,65184],"mapped",[1580]],[[65185,65188],"mapped",[1581]],[[65189,65192],"mapped",[1582]],[[65193,65194],"mapped",[1583]],[[65195,65196],"mapped",[1584]],[[65197,65198],"mapped",[1585]],[[65199,65200],"mapped",[1586]],[[65201,65204],"mapped",[1587]],[[65205,65208],"mapped",[1588]],[[65209,65212],"mapped",[1589]],[[65213,65216],"mapped",[1590]],[[65217,65220],"mapped",[1591]],[[65221,65224],"mapped",[1592]],[[65225,65228],"mapped",[1593]],[[65229,65232],"mapped",[1594]],[[65233,65236],"mapped",[1601]],[[65237,65240],"mapped",[1602]],[[65241,65244],"mapped",[1603]],[[65245,65248],"mapped",[1604]],[[65249,65252],"mapped",[1605]],[[65253,65256],"mapped",[1606]],[[65257,65260],"mapped",[1607]],[[65261,65262],"mapped",[1608]],[[65263,65264],"mapped",[1609]],[[65265,65268],"mapped",[1610]],[[65269,65270],"mapped",[1604,1570]],[[65271,65272],"mapped",[1604,1571]],[[65273,65274],"mapped",[1604,1573]],[[65275,65276],"mapped",[1604,1575]],[[65277,65278],"disallowed"],[[65279,65279],"ignored"],[[65280,65280],"disallowed"],[[65281,65281],"disallowed_STD3_mapped",[33]],[[65282,65282],"disallowed_STD3_mapped",[34]],[[65283,65283],"disallowed_STD3_mapped",[35]],[[65284,65284],"disallowed_STD3_mapped",[36]],[[65285,65285],"disallowed_STD3_mapped",[37]],[[65286,65286],"disallowed_STD3_mapped",[38]],[[65287,65287],"disallowed_STD3_mapped",[39]],[[65288,65288],"disallowed_STD3_mapped",[40]],[[65289,65289],"disallowed_STD3_mapped",[41]],[[65290,65290],"disallowed_STD3_mapped",[42]],[[65291,65291],"disallowed_STD3_mapped",[43]],[[65292,65292],"disallowed_STD3_mapped",[44]],[[65293,65293],"mapped",[45]],[[65294,65294],"mapped",[46]],[[65295,65295],"disallowed_STD3_mapped",[47]],[[65296,65296],"mapped",[48]],[[65297,65297],"mapped",[49]],[[65298,65298],"mapped",[50]],[[65299,65299],"mapped",[51]],[[65300,65300],"mapped",[52]],[[65301,65301],"mapped",[53]],[[65302,65302],"mapped",[54]],[[65303,65303],"mapped",[55]],[[65304,65304],"mapped",[56]],[[65305,65305],"mapped",[57]],[[65306,65306],"disallowed_STD3_mapped",[58]],[[65307,65307],"disallowed_STD3_mapped",[59]],[[65308,65308],"disallowed_STD3_mapped",[60]],[[65309,65309],"disallowed_STD3_mapped",[61]],[[65310,65310],"disallowed_STD3_mapped",[62]],[[65311,65311],"disallowed_STD3_mapped",[63]],[[65312,65312],"disallowed_STD3_mapped",[64]],[[65313,65313],"mapped",[97]],[[65314,65314],"mapped",[98]],[[65315,65315],"mapped",[99]],[[65316,65316],"mapped",[100]],[[65317,65317],"mapped",[101]],[[65318,65318],"mapped",[102]],[[65319,65319],"mapped",[103]],[[65320,65320],"mapped",[104]],[[65321,65321],"mapped",[105]],[[65322,65322],"mapped",[106]],[[65323,65323],"mapped",[107]],[[65324,65324],"mapped",[108]],[[65325,65325],"mapped",[109]],[[65326,65326],"mapped",[110]],[[65327,65327],"mapped",[111]],[[65328,65328],"mapped",[112]],[[65329,65329],"mapped",[113]],[[65330,65330],"mapped",[114]],[[65331,65331],"mapped",[115]],[[65332,65332],"mapped",[116]],[[65333,65333],"mapped",[117]],[[65334,65334],"mapped",[118]],[[65335,65335],"mapped",[119]],[[65336,65336],"mapped",[120]],[[65337,65337],"mapped",[121]],[[65338,65338],"mapped",[122]],[[65339,65339],"disallowed_STD3_mapped",[91]],[[65340,65340],"disallowed_STD3_mapped",[92]],[[65341,65341],"disallowed_STD3_mapped",[93]],[[65342,65342],"disallowed_STD3_mapped",[94]],[[65343,65343],"disallowed_STD3_mapped",[95]],[[65344,65344],"disallowed_STD3_mapped",[96]],[[65345,65345],"mapped",[97]],[[65346,65346],"mapped",[98]],[[65347,65347],"mapped",[99]],[[65348,65348],"mapped",[100]],[[65349,65349],"mapped",[101]],[[65350,65350],"mapped",[102]],[[65351,65351],"mapped",[103]],[[65352,65352],"mapped",[104]],[[65353,65353],"mapped",[105]],[[65354,65354],"mapped",[106]],[[65355,65355],"mapped",[107]],[[65356,65356],"mapped",[108]],[[65357,65357],"mapped",[109]],[[65358,65358],"mapped",[110]],[[65359,65359],"mapped",[111]],[[65360,65360],"mapped",[112]],[[65361,65361],"mapped",[113]],[[65362,65362],"mapped",[114]],[[65363,65363],"mapped",[115]],[[65364,65364],"mapped",[116]],[[65365,65365],"mapped",[117]],[[65366,65366],"mapped",[118]],[[65367,65367],"mapped",[119]],[[65368,65368],"mapped",[120]],[[65369,65369],"mapped",[121]],[[65370,65370],"mapped",[122]],[[65371,65371],"disallowed_STD3_mapped",[123]],[[65372,65372],"disallowed_STD3_mapped",[124]],[[65373,65373],"disallowed_STD3_mapped",[125]],[[65374,65374],"disallowed_STD3_mapped",[126]],[[65375,65375],"mapped",[10629]],[[65376,65376],"mapped",[10630]],[[65377,65377],"mapped",[46]],[[65378,65378],"mapped",[12300]],[[65379,65379],"mapped",[12301]],[[65380,65380],"mapped",[12289]],[[65381,65381],"mapped",[12539]],[[65382,65382],"mapped",[12530]],[[65383,65383],"mapped",[12449]],[[65384,65384],"mapped",[12451]],[[65385,65385],"mapped",[12453]],[[65386,65386],"mapped",[12455]],[[65387,65387],"mapped",[12457]],[[65388,65388],"mapped",[12515]],[[65389,65389],"mapped",[12517]],[[65390,65390],"mapped",[12519]],[[65391,65391],"mapped",[12483]],[[65392,65392],"mapped",[12540]],[[65393,65393],"mapped",[12450]],[[65394,65394],"mapped",[12452]],[[65395,65395],"mapped",[12454]],[[65396,65396],"mapped",[12456]],[[65397,65397],"mapped",[12458]],[[65398,65398],"mapped",[12459]],[[65399,65399],"mapped",[12461]],[[65400,65400],"mapped",[12463]],[[65401,65401],"mapped",[12465]],[[65402,65402],"mapped",[12467]],[[65403,65403],"mapped",[12469]],[[65404,65404],"mapped",[12471]],[[65405,65405],"mapped",[12473]],[[65406,65406],"mapped",[12475]],[[65407,65407],"mapped",[12477]],[[65408,65408],"mapped",[12479]],[[65409,65409],"mapped",[12481]],[[65410,65410],"mapped",[12484]],[[65411,65411],"mapped",[12486]],[[65412,65412],"mapped",[12488]],[[65413,65413],"mapped",[12490]],[[65414,65414],"mapped",[12491]],[[65415,65415],"mapped",[12492]],[[65416,65416],"mapped",[12493]],[[65417,65417],"mapped",[12494]],[[65418,65418],"mapped",[12495]],[[65419,65419],"mapped",[12498]],[[65420,65420],"mapped",[12501]],[[65421,65421],"mapped",[12504]],[[65422,65422],"mapped",[12507]],[[65423,65423],"mapped",[12510]],[[65424,65424],"mapped",[12511]],[[65425,65425],"mapped",[12512]],[[65426,65426],"mapped",[12513]],[[65427,65427],"mapped",[12514]],[[65428,65428],"mapped",[12516]],[[65429,65429],"mapped",[12518]],[[65430,65430],"mapped",[12520]],[[65431,65431],"mapped",[12521]],[[65432,65432],"mapped",[12522]],[[65433,65433],"mapped",[12523]],[[65434,65434],"mapped",[12524]],[[65435,65435],"mapped",[12525]],[[65436,65436],"mapped",[12527]],[[65437,65437],"mapped",[12531]],[[65438,65438],"mapped",[12441]],[[65439,65439],"mapped",[12442]],[[65440,65440],"disallowed"],[[65441,65441],"mapped",[4352]],[[65442,65442],"mapped",[4353]],[[65443,65443],"mapped",[4522]],[[65444,65444],"mapped",[4354]],[[65445,65445],"mapped",[4524]],[[65446,65446],"mapped",[4525]],[[65447,65447],"mapped",[4355]],[[65448,65448],"mapped",[4356]],[[65449,65449],"mapped",[4357]],[[65450,65450],"mapped",[4528]],[[65451,65451],"mapped",[4529]],[[65452,65452],"mapped",[4530]],[[65453,65453],"mapped",[4531]],[[65454,65454],"mapped",[4532]],[[65455,65455],"mapped",[4533]],[[65456,65456],"mapped",[4378]],[[65457,65457],"mapped",[4358]],[[65458,65458],"mapped",[4359]],[[65459,65459],"mapped",[4360]],[[65460,65460],"mapped",[4385]],[[65461,65461],"mapped",[4361]],[[65462,65462],"mapped",[4362]],[[65463,65463],"mapped",[4363]],[[65464,65464],"mapped",[4364]],[[65465,65465],"mapped",[4365]],[[65466,65466],"mapped",[4366]],[[65467,65467],"mapped",[4367]],[[65468,65468],"mapped",[4368]],[[65469,65469],"mapped",[4369]],[[65470,65470],"mapped",[4370]],[[65471,65473],"disallowed"],[[65474,65474],"mapped",[4449]],[[65475,65475],"mapped",[4450]],[[65476,65476],"mapped",[4451]],[[65477,65477],"mapped",[4452]],[[65478,65478],"mapped",[4453]],[[65479,65479],"mapped",[4454]],[[65480,65481],"disallowed"],[[65482,65482],"mapped",[4455]],[[65483,65483],"mapped",[4456]],[[65484,65484],"mapped",[4457]],[[65485,65485],"mapped",[4458]],[[65486,65486],"mapped",[4459]],[[65487,65487],"mapped",[4460]],[[65488,65489],"disallowed"],[[65490,65490],"mapped",[4461]],[[65491,65491],"mapped",[4462]],[[65492,65492],"mapped",[4463]],[[65493,65493],"mapped",[4464]],[[65494,65494],"mapped",[4465]],[[65495,65495],"mapped",[4466]],[[65496,65497],"disallowed"],[[65498,65498],"mapped",[4467]],[[65499,65499],"mapped",[4468]],[[65500,65500],"mapped",[4469]],[[65501,65503],"disallowed"],[[65504,65504],"mapped",[162]],[[65505,65505],"mapped",[163]],[[65506,65506],"mapped",[172]],[[65507,65507],"disallowed_STD3_mapped",[32,772]],[[65508,65508],"mapped",[166]],[[65509,65509],"mapped",[165]],[[65510,65510],"mapped",[8361]],[[65511,65511],"disallowed"],[[65512,65512],"mapped",[9474]],[[65513,65513],"mapped",[8592]],[[65514,65514],"mapped",[8593]],[[65515,65515],"mapped",[8594]],[[65516,65516],"mapped",[8595]],[[65517,65517],"mapped",[9632]],[[65518,65518],"mapped",[9675]],[[65519,65528],"disallowed"],[[65529,65531],"disallowed"],[[65532,65532],"disallowed"],[[65533,65533],"disallowed"],[[65534,65535],"disallowed"],[[65536,65547],"valid"],[[65548,65548],"disallowed"],[[65549,65574],"valid"],[[65575,65575],"disallowed"],[[65576,65594],"valid"],[[65595,65595],"disallowed"],[[65596,65597],"valid"],[[65598,65598],"disallowed"],[[65599,65613],"valid"],[[65614,65615],"disallowed"],[[65616,65629],"valid"],[[65630,65663],"disallowed"],[[65664,65786],"valid"],[[65787,65791],"disallowed"],[[65792,65794],"valid",[],"NV8"],[[65795,65798],"disallowed"],[[65799,65843],"valid",[],"NV8"],[[65844,65846],"disallowed"],[[65847,65855],"valid",[],"NV8"],[[65856,65930],"valid",[],"NV8"],[[65931,65932],"valid",[],"NV8"],[[65933,65935],"disallowed"],[[65936,65947],"valid",[],"NV8"],[[65948,65951],"disallowed"],[[65952,65952],"valid",[],"NV8"],[[65953,65999],"disallowed"],[[66000,66044],"valid",[],"NV8"],[[66045,66045],"valid"],[[66046,66175],"disallowed"],[[66176,66204],"valid"],[[66205,66207],"disallowed"],[[66208,66256],"valid"],[[66257,66271],"disallowed"],[[66272,66272],"valid"],[[66273,66299],"valid",[],"NV8"],[[66300,66303],"disallowed"],[[66304,66334],"valid"],[[66335,66335],"valid"],[[66336,66339],"valid",[],"NV8"],[[66340,66351],"disallowed"],[[66352,66368],"valid"],[[66369,66369],"valid",[],"NV8"],[[66370,66377],"valid"],[[66378,66378],"valid",[],"NV8"],[[66379,66383],"disallowed"],[[66384,66426],"valid"],[[66427,66431],"disallowed"],[[66432,66461],"valid"],[[66462,66462],"disallowed"],[[66463,66463],"valid",[],"NV8"],[[66464,66499],"valid"],[[66500,66503],"disallowed"],[[66504,66511],"valid"],[[66512,66517],"valid",[],"NV8"],[[66518,66559],"disallowed"],[[66560,66560],"mapped",[66600]],[[66561,66561],"mapped",[66601]],[[66562,66562],"mapped",[66602]],[[66563,66563],"mapped",[66603]],[[66564,66564],"mapped",[66604]],[[66565,66565],"mapped",[66605]],[[66566,66566],"mapped",[66606]],[[66567,66567],"mapped",[66607]],[[66568,66568],"mapped",[66608]],[[66569,66569],"mapped",[66609]],[[66570,66570],"mapped",[66610]],[[66571,66571],"mapped",[66611]],[[66572,66572],"mapped",[66612]],[[66573,66573],"mapped",[66613]],[[66574,66574],"mapped",[66614]],[[66575,66575],"mapped",[66615]],[[66576,66576],"mapped",[66616]],[[66577,66577],"mapped",[66617]],[[66578,66578],"mapped",[66618]],[[66579,66579],"mapped",[66619]],[[66580,66580],"mapped",[66620]],[[66581,66581],"mapped",[66621]],[[66582,66582],"mapped",[66622]],[[66583,66583],"mapped",[66623]],[[66584,66584],"mapped",[66624]],[[66585,66585],"mapped",[66625]],[[66586,66586],"mapped",[66626]],[[66587,66587],"mapped",[66627]],[[66588,66588],"mapped",[66628]],[[66589,66589],"mapped",[66629]],[[66590,66590],"mapped",[66630]],[[66591,66591],"mapped",[66631]],[[66592,66592],"mapped",[66632]],[[66593,66593],"mapped",[66633]],[[66594,66594],"mapped",[66634]],[[66595,66595],"mapped",[66635]],[[66596,66596],"mapped",[66636]],[[66597,66597],"mapped",[66637]],[[66598,66598],"mapped",[66638]],[[66599,66599],"mapped",[66639]],[[66600,66637],"valid"],[[66638,66717],"valid"],[[66718,66719],"disallowed"],[[66720,66729],"valid"],[[66730,66815],"disallowed"],[[66816,66855],"valid"],[[66856,66863],"disallowed"],[[66864,66915],"valid"],[[66916,66926],"disallowed"],[[66927,66927],"valid",[],"NV8"],[[66928,67071],"disallowed"],[[67072,67382],"valid"],[[67383,67391],"disallowed"],[[67392,67413],"valid"],[[67414,67423],"disallowed"],[[67424,67431],"valid"],[[67432,67583],"disallowed"],[[67584,67589],"valid"],[[67590,67591],"disallowed"],[[67592,67592],"valid"],[[67593,67593],"disallowed"],[[67594,67637],"valid"],[[67638,67638],"disallowed"],[[67639,67640],"valid"],[[67641,67643],"disallowed"],[[67644,67644],"valid"],[[67645,67646],"disallowed"],[[67647,67647],"valid"],[[67648,67669],"valid"],[[67670,67670],"disallowed"],[[67671,67679],"valid",[],"NV8"],[[67680,67702],"valid"],[[67703,67711],"valid",[],"NV8"],[[67712,67742],"valid"],[[67743,67750],"disallowed"],[[67751,67759],"valid",[],"NV8"],[[67760,67807],"disallowed"],[[67808,67826],"valid"],[[67827,67827],"disallowed"],[[67828,67829],"valid"],[[67830,67834],"disallowed"],[[67835,67839],"valid",[],"NV8"],[[67840,67861],"valid"],[[67862,67865],"valid",[],"NV8"],[[67866,67867],"valid",[],"NV8"],[[67868,67870],"disallowed"],[[67871,67871],"valid",[],"NV8"],[[67872,67897],"valid"],[[67898,67902],"disallowed"],[[67903,67903],"valid",[],"NV8"],[[67904,67967],"disallowed"],[[67968,68023],"valid"],[[68024,68027],"disallowed"],[[68028,68029],"valid",[],"NV8"],[[68030,68031],"valid"],[[68032,68047],"valid",[],"NV8"],[[68048,68049],"disallowed"],[[68050,68095],"valid",[],"NV8"],[[68096,68099],"valid"],[[68100,68100],"disallowed"],[[68101,68102],"valid"],[[68103,68107],"disallowed"],[[68108,68115],"valid"],[[68116,68116],"disallowed"],[[68117,68119],"valid"],[[68120,68120],"disallowed"],[[68121,68147],"valid"],[[68148,68151],"disallowed"],[[68152,68154],"valid"],[[68155,68158],"disallowed"],[[68159,68159],"valid"],[[68160,68167],"valid",[],"NV8"],[[68168,68175],"disallowed"],[[68176,68184],"valid",[],"NV8"],[[68185,68191],"disallowed"],[[68192,68220],"valid"],[[68221,68223],"valid",[],"NV8"],[[68224,68252],"valid"],[[68253,68255],"valid",[],"NV8"],[[68256,68287],"disallowed"],[[68288,68295],"valid"],[[68296,68296],"valid",[],"NV8"],[[68297,68326],"valid"],[[68327,68330],"disallowed"],[[68331,68342],"valid",[],"NV8"],[[68343,68351],"disallowed"],[[68352,68405],"valid"],[[68406,68408],"disallowed"],[[68409,68415],"valid",[],"NV8"],[[68416,68437],"valid"],[[68438,68439],"disallowed"],[[68440,68447],"valid",[],"NV8"],[[68448,68466],"valid"],[[68467,68471],"disallowed"],[[68472,68479],"valid",[],"NV8"],[[68480,68497],"valid"],[[68498,68504],"disallowed"],[[68505,68508],"valid",[],"NV8"],[[68509,68520],"disallowed"],[[68521,68527],"valid",[],"NV8"],[[68528,68607],"disallowed"],[[68608,68680],"valid"],[[68681,68735],"disallowed"],[[68736,68736],"mapped",[68800]],[[68737,68737],"mapped",[68801]],[[68738,68738],"mapped",[68802]],[[68739,68739],"mapped",[68803]],[[68740,68740],"mapped",[68804]],[[68741,68741],"mapped",[68805]],[[68742,68742],"mapped",[68806]],[[68743,68743],"mapped",[68807]],[[68744,68744],"mapped",[68808]],[[68745,68745],"mapped",[68809]],[[68746,68746],"mapped",[68810]],[[68747,68747],"mapped",[68811]],[[68748,68748],"mapped",[68812]],[[68749,68749],"mapped",[68813]],[[68750,68750],"mapped",[68814]],[[68751,68751],"mapped",[68815]],[[68752,68752],"mapped",[68816]],[[68753,68753],"mapped",[68817]],[[68754,68754],"mapped",[68818]],[[68755,68755],"mapped",[68819]],[[68756,68756],"mapped",[68820]],[[68757,68757],"mapped",[68821]],[[68758,68758],"mapped",[68822]],[[68759,68759],"mapped",[68823]],[[68760,68760],"mapped",[68824]],[[68761,68761],"mapped",[68825]],[[68762,68762],"mapped",[68826]],[[68763,68763],"mapped",[68827]],[[68764,68764],"mapped",[68828]],[[68765,68765],"mapped",[68829]],[[68766,68766],"mapped",[68830]],[[68767,68767],"mapped",[68831]],[[68768,68768],"mapped",[68832]],[[68769,68769],"mapped",[68833]],[[68770,68770],"mapped",[68834]],[[68771,68771],"mapped",[68835]],[[68772,68772],"mapped",[68836]],[[68773,68773],"mapped",[68837]],[[68774,68774],"mapped",[68838]],[[68775,68775],"mapped",[68839]],[[68776,68776],"mapped",[68840]],[[68777,68777],"mapped",[68841]],[[68778,68778],"mapped",[68842]],[[68779,68779],"mapped",[68843]],[[68780,68780],"mapped",[68844]],[[68781,68781],"mapped",[68845]],[[68782,68782],"mapped",[68846]],[[68783,68783],"mapped",[68847]],[[68784,68784],"mapped",[68848]],[[68785,68785],"mapped",[68849]],[[68786,68786],"mapped",[68850]],[[68787,68799],"disallowed"],[[68800,68850],"valid"],[[68851,68857],"disallowed"],[[68858,68863],"valid",[],"NV8"],[[68864,69215],"disallowed"],[[69216,69246],"valid",[],"NV8"],[[69247,69631],"disallowed"],[[69632,69702],"valid"],[[69703,69709],"valid",[],"NV8"],[[69710,69713],"disallowed"],[[69714,69733],"valid",[],"NV8"],[[69734,69743],"valid"],[[69744,69758],"disallowed"],[[69759,69759],"valid"],[[69760,69818],"valid"],[[69819,69820],"valid",[],"NV8"],[[69821,69821],"disallowed"],[[69822,69825],"valid",[],"NV8"],[[69826,69839],"disallowed"],[[69840,69864],"valid"],[[69865,69871],"disallowed"],[[69872,69881],"valid"],[[69882,69887],"disallowed"],[[69888,69940],"valid"],[[69941,69941],"disallowed"],[[69942,69951],"valid"],[[69952,69955],"valid",[],"NV8"],[[69956,69967],"disallowed"],[[69968,70003],"valid"],[[70004,70005],"valid",[],"NV8"],[[70006,70006],"valid"],[[70007,70015],"disallowed"],[[70016,70084],"valid"],[[70085,70088],"valid",[],"NV8"],[[70089,70089],"valid",[],"NV8"],[[70090,70092],"valid"],[[70093,70093],"valid",[],"NV8"],[[70094,70095],"disallowed"],[[70096,70105],"valid"],[[70106,70106],"valid"],[[70107,70107],"valid",[],"NV8"],[[70108,70108],"valid"],[[70109,70111],"valid",[],"NV8"],[[70112,70112],"disallowed"],[[70113,70132],"valid",[],"NV8"],[[70133,70143],"disallowed"],[[70144,70161],"valid"],[[70162,70162],"disallowed"],[[70163,70199],"valid"],[[70200,70205],"valid",[],"NV8"],[[70206,70271],"disallowed"],[[70272,70278],"valid"],[[70279,70279],"disallowed"],[[70280,70280],"valid"],[[70281,70281],"disallowed"],[[70282,70285],"valid"],[[70286,70286],"disallowed"],[[70287,70301],"valid"],[[70302,70302],"disallowed"],[[70303,70312],"valid"],[[70313,70313],"valid",[],"NV8"],[[70314,70319],"disallowed"],[[70320,70378],"valid"],[[70379,70383],"disallowed"],[[70384,70393],"valid"],[[70394,70399],"disallowed"],[[70400,70400],"valid"],[[70401,70403],"valid"],[[70404,70404],"disallowed"],[[70405,70412],"valid"],[[70413,70414],"disallowed"],[[70415,70416],"valid"],[[70417,70418],"disallowed"],[[70419,70440],"valid"],[[70441,70441],"disallowed"],[[70442,70448],"valid"],[[70449,70449],"disallowed"],[[70450,70451],"valid"],[[70452,70452],"disallowed"],[[70453,70457],"valid"],[[70458,70459],"disallowed"],[[70460,70468],"valid"],[[70469,70470],"disallowed"],[[70471,70472],"valid"],[[70473,70474],"disallowed"],[[70475,70477],"valid"],[[70478,70479],"disallowed"],[[70480,70480],"valid"],[[70481,70486],"disallowed"],[[70487,70487],"valid"],[[70488,70492],"disallowed"],[[70493,70499],"valid"],[[70500,70501],"disallowed"],[[70502,70508],"valid"],[[70509,70511],"disallowed"],[[70512,70516],"valid"],[[70517,70783],"disallowed"],[[70784,70853],"valid"],[[70854,70854],"valid",[],"NV8"],[[70855,70855],"valid"],[[70856,70863],"disallowed"],[[70864,70873],"valid"],[[70874,71039],"disallowed"],[[71040,71093],"valid"],[[71094,71095],"disallowed"],[[71096,71104],"valid"],[[71105,71113],"valid",[],"NV8"],[[71114,71127],"valid",[],"NV8"],[[71128,71133],"valid"],[[71134,71167],"disallowed"],[[71168,71232],"valid"],[[71233,71235],"valid",[],"NV8"],[[71236,71236],"valid"],[[71237,71247],"disallowed"],[[71248,71257],"valid"],[[71258,71295],"disallowed"],[[71296,71351],"valid"],[[71352,71359],"disallowed"],[[71360,71369],"valid"],[[71370,71423],"disallowed"],[[71424,71449],"valid"],[[71450,71452],"disallowed"],[[71453,71467],"valid"],[[71468,71471],"disallowed"],[[71472,71481],"valid"],[[71482,71487],"valid",[],"NV8"],[[71488,71839],"disallowed"],[[71840,71840],"mapped",[71872]],[[71841,71841],"mapped",[71873]],[[71842,71842],"mapped",[71874]],[[71843,71843],"mapped",[71875]],[[71844,71844],"mapped",[71876]],[[71845,71845],"mapped",[71877]],[[71846,71846],"mapped",[71878]],[[71847,71847],"mapped",[71879]],[[71848,71848],"mapped",[71880]],[[71849,71849],"mapped",[71881]],[[71850,71850],"mapped",[71882]],[[71851,71851],"mapped",[71883]],[[71852,71852],"mapped",[71884]],[[71853,71853],"mapped",[71885]],[[71854,71854],"mapped",[71886]],[[71855,71855],"mapped",[71887]],[[71856,71856],"mapped",[71888]],[[71857,71857],"mapped",[71889]],[[71858,71858],"mapped",[71890]],[[71859,71859],"mapped",[71891]],[[71860,71860],"mapped",[71892]],[[71861,71861],"mapped",[71893]],[[71862,71862],"mapped",[71894]],[[71863,71863],"mapped",[71895]],[[71864,71864],"mapped",[71896]],[[71865,71865],"mapped",[71897]],[[71866,71866],"mapped",[71898]],[[71867,71867],"mapped",[71899]],[[71868,71868],"mapped",[71900]],[[71869,71869],"mapped",[71901]],[[71870,71870],"mapped",[71902]],[[71871,71871],"mapped",[71903]],[[71872,71913],"valid"],[[71914,71922],"valid",[],"NV8"],[[71923,71934],"disallowed"],[[71935,71935],"valid"],[[71936,72383],"disallowed"],[[72384,72440],"valid"],[[72441,73727],"disallowed"],[[73728,74606],"valid"],[[74607,74648],"valid"],[[74649,74649],"valid"],[[74650,74751],"disallowed"],[[74752,74850],"valid",[],"NV8"],[[74851,74862],"valid",[],"NV8"],[[74863,74863],"disallowed"],[[74864,74867],"valid",[],"NV8"],[[74868,74868],"valid",[],"NV8"],[[74869,74879],"disallowed"],[[74880,75075],"valid"],[[75076,77823],"disallowed"],[[77824,78894],"valid"],[[78895,82943],"disallowed"],[[82944,83526],"valid"],[[83527,92159],"disallowed"],[[92160,92728],"valid"],[[92729,92735],"disallowed"],[[92736,92766],"valid"],[[92767,92767],"disallowed"],[[92768,92777],"valid"],[[92778,92781],"disallowed"],[[92782,92783],"valid",[],"NV8"],[[92784,92879],"disallowed"],[[92880,92909],"valid"],[[92910,92911],"disallowed"],[[92912,92916],"valid"],[[92917,92917],"valid",[],"NV8"],[[92918,92927],"disallowed"],[[92928,92982],"valid"],[[92983,92991],"valid",[],"NV8"],[[92992,92995],"valid"],[[92996,92997],"valid",[],"NV8"],[[92998,93007],"disallowed"],[[93008,93017],"valid"],[[93018,93018],"disallowed"],[[93019,93025],"valid",[],"NV8"],[[93026,93026],"disallowed"],[[93027,93047],"valid"],[[93048,93052],"disallowed"],[[93053,93071],"valid"],[[93072,93951],"disallowed"],[[93952,94020],"valid"],[[94021,94031],"disallowed"],[[94032,94078],"valid"],[[94079,94094],"disallowed"],[[94095,94111],"valid"],[[94112,110591],"disallowed"],[[110592,110593],"valid"],[[110594,113663],"disallowed"],[[113664,113770],"valid"],[[113771,113775],"disallowed"],[[113776,113788],"valid"],[[113789,113791],"disallowed"],[[113792,113800],"valid"],[[113801,113807],"disallowed"],[[113808,113817],"valid"],[[113818,113819],"disallowed"],[[113820,113820],"valid",[],"NV8"],[[113821,113822],"valid"],[[113823,113823],"valid",[],"NV8"],[[113824,113827],"ignored"],[[113828,118783],"disallowed"],[[118784,119029],"valid",[],"NV8"],[[119030,119039],"disallowed"],[[119040,119078],"valid",[],"NV8"],[[119079,119080],"disallowed"],[[119081,119081],"valid",[],"NV8"],[[119082,119133],"valid",[],"NV8"],[[119134,119134],"mapped",[119127,119141]],[[119135,119135],"mapped",[119128,119141]],[[119136,119136],"mapped",[119128,119141,119150]],[[119137,119137],"mapped",[119128,119141,119151]],[[119138,119138],"mapped",[119128,119141,119152]],[[119139,119139],"mapped",[119128,119141,119153]],[[119140,119140],"mapped",[119128,119141,119154]],[[119141,119154],"valid",[],"NV8"],[[119155,119162],"disallowed"],[[119163,119226],"valid",[],"NV8"],[[119227,119227],"mapped",[119225,119141]],[[119228,119228],"mapped",[119226,119141]],[[119229,119229],"mapped",[119225,119141,119150]],[[119230,119230],"mapped",[119226,119141,119150]],[[119231,119231],"mapped",[119225,119141,119151]],[[119232,119232],"mapped",[119226,119141,119151]],[[119233,119261],"valid",[],"NV8"],[[119262,119272],"valid",[],"NV8"],[[119273,119295],"disallowed"],[[119296,119365],"valid",[],"NV8"],[[119366,119551],"disallowed"],[[119552,119638],"valid",[],"NV8"],[[119639,119647],"disallowed"],[[119648,119665],"valid",[],"NV8"],[[119666,119807],"disallowed"],[[119808,119808],"mapped",[97]],[[119809,119809],"mapped",[98]],[[119810,119810],"mapped",[99]],[[119811,119811],"mapped",[100]],[[119812,119812],"mapped",[101]],[[119813,119813],"mapped",[102]],[[119814,119814],"mapped",[103]],[[119815,119815],"mapped",[104]],[[119816,119816],"mapped",[105]],[[119817,119817],"mapped",[106]],[[119818,119818],"mapped",[107]],[[119819,119819],"mapped",[108]],[[119820,119820],"mapped",[109]],[[119821,119821],"mapped",[110]],[[119822,119822],"mapped",[111]],[[119823,119823],"mapped",[112]],[[119824,119824],"mapped",[113]],[[119825,119825],"mapped",[114]],[[119826,119826],"mapped",[115]],[[119827,119827],"mapped",[116]],[[119828,119828],"mapped",[117]],[[119829,119829],"mapped",[118]],[[119830,119830],"mapped",[119]],[[119831,119831],"mapped",[120]],[[119832,119832],"mapped",[121]],[[119833,119833],"mapped",[122]],[[119834,119834],"mapped",[97]],[[119835,119835],"mapped",[98]],[[119836,119836],"mapped",[99]],[[119837,119837],"mapped",[100]],[[119838,119838],"mapped",[101]],[[119839,119839],"mapped",[102]],[[119840,119840],"mapped",[103]],[[119841,119841],"mapped",[104]],[[119842,119842],"mapped",[105]],[[119843,119843],"mapped",[106]],[[119844,119844],"mapped",[107]],[[119845,119845],"mapped",[108]],[[119846,119846],"mapped",[109]],[[119847,119847],"mapped",[110]],[[119848,119848],"mapped",[111]],[[119849,119849],"mapped",[112]],[[119850,119850],"mapped",[113]],[[119851,119851],"mapped",[114]],[[119852,119852],"mapped",[115]],[[119853,119853],"mapped",[116]],[[119854,119854],"mapped",[117]],[[119855,119855],"mapped",[118]],[[119856,119856],"mapped",[119]],[[119857,119857],"mapped",[120]],[[119858,119858],"mapped",[121]],[[119859,119859],"mapped",[122]],[[119860,119860],"mapped",[97]],[[119861,119861],"mapped",[98]],[[119862,119862],"mapped",[99]],[[119863,119863],"mapped",[100]],[[119864,119864],"mapped",[101]],[[119865,119865],"mapped",[102]],[[119866,119866],"mapped",[103]],[[119867,119867],"mapped",[104]],[[119868,119868],"mapped",[105]],[[119869,119869],"mapped",[106]],[[119870,119870],"mapped",[107]],[[119871,119871],"mapped",[108]],[[119872,119872],"mapped",[109]],[[119873,119873],"mapped",[110]],[[119874,119874],"mapped",[111]],[[119875,119875],"mapped",[112]],[[119876,119876],"mapped",[113]],[[119877,119877],"mapped",[114]],[[119878,119878],"mapped",[115]],[[119879,119879],"mapped",[116]],[[119880,119880],"mapped",[117]],[[119881,119881],"mapped",[118]],[[119882,119882],"mapped",[119]],[[119883,119883],"mapped",[120]],[[119884,119884],"mapped",[121]],[[119885,119885],"mapped",[122]],[[119886,119886],"mapped",[97]],[[119887,119887],"mapped",[98]],[[119888,119888],"mapped",[99]],[[119889,119889],"mapped",[100]],[[119890,119890],"mapped",[101]],[[119891,119891],"mapped",[102]],[[119892,119892],"mapped",[103]],[[119893,119893],"disallowed"],[[119894,119894],"mapped",[105]],[[119895,119895],"mapped",[106]],[[119896,119896],"mapped",[107]],[[119897,119897],"mapped",[108]],[[119898,119898],"mapped",[109]],[[119899,119899],"mapped",[110]],[[119900,119900],"mapped",[111]],[[119901,119901],"mapped",[112]],[[119902,119902],"mapped",[113]],[[119903,119903],"mapped",[114]],[[119904,119904],"mapped",[115]],[[119905,119905],"mapped",[116]],[[119906,119906],"mapped",[117]],[[119907,119907],"mapped",[118]],[[119908,119908],"mapped",[119]],[[119909,119909],"mapped",[120]],[[119910,119910],"mapped",[121]],[[119911,119911],"mapped",[122]],[[119912,119912],"mapped",[97]],[[119913,119913],"mapped",[98]],[[119914,119914],"mapped",[99]],[[119915,119915],"mapped",[100]],[[119916,119916],"mapped",[101]],[[119917,119917],"mapped",[102]],[[119918,119918],"mapped",[103]],[[119919,119919],"mapped",[104]],[[119920,119920],"mapped",[105]],[[119921,119921],"mapped",[106]],[[119922,119922],"mapped",[107]],[[119923,119923],"mapped",[108]],[[119924,119924],"mapped",[109]],[[119925,119925],"mapped",[110]],[[119926,119926],"mapped",[111]],[[119927,119927],"mapped",[112]],[[119928,119928],"mapped",[113]],[[119929,119929],"mapped",[114]],[[119930,119930],"mapped",[115]],[[119931,119931],"mapped",[116]],[[119932,119932],"mapped",[117]],[[119933,119933],"mapped",[118]],[[119934,119934],"mapped",[119]],[[119935,119935],"mapped",[120]],[[119936,119936],"mapped",[121]],[[119937,119937],"mapped",[122]],[[119938,119938],"mapped",[97]],[[119939,119939],"mapped",[98]],[[119940,119940],"mapped",[99]],[[119941,119941],"mapped",[100]],[[119942,119942],"mapped",[101]],[[119943,119943],"mapped",[102]],[[119944,119944],"mapped",[103]],[[119945,119945],"mapped",[104]],[[119946,119946],"mapped",[105]],[[119947,119947],"mapped",[106]],[[119948,119948],"mapped",[107]],[[119949,119949],"mapped",[108]],[[119950,119950],"mapped",[109]],[[119951,119951],"mapped",[110]],[[119952,119952],"mapped",[111]],[[119953,119953],"mapped",[112]],[[119954,119954],"mapped",[113]],[[119955,119955],"mapped",[114]],[[119956,119956],"mapped",[115]],[[119957,119957],"mapped",[116]],[[119958,119958],"mapped",[117]],[[119959,119959],"mapped",[118]],[[119960,119960],"mapped",[119]],[[119961,119961],"mapped",[120]],[[119962,119962],"mapped",[121]],[[119963,119963],"mapped",[122]],[[119964,119964],"mapped",[97]],[[119965,119965],"disallowed"],[[119966,119966],"mapped",[99]],[[119967,119967],"mapped",[100]],[[119968,119969],"disallowed"],[[119970,119970],"mapped",[103]],[[119971,119972],"disallowed"],[[119973,119973],"mapped",[106]],[[119974,119974],"mapped",[107]],[[119975,119976],"disallowed"],[[119977,119977],"mapped",[110]],[[119978,119978],"mapped",[111]],[[119979,119979],"mapped",[112]],[[119980,119980],"mapped",[113]],[[119981,119981],"disallowed"],[[119982,119982],"mapped",[115]],[[119983,119983],"mapped",[116]],[[119984,119984],"mapped",[117]],[[119985,119985],"mapped",[118]],[[119986,119986],"mapped",[119]],[[119987,119987],"mapped",[120]],[[119988,119988],"mapped",[121]],[[119989,119989],"mapped",[122]],[[119990,119990],"mapped",[97]],[[119991,119991],"mapped",[98]],[[119992,119992],"mapped",[99]],[[119993,119993],"mapped",[100]],[[119994,119994],"disallowed"],[[119995,119995],"mapped",[102]],[[119996,119996],"disallowed"],[[119997,119997],"mapped",[104]],[[119998,119998],"mapped",[105]],[[119999,119999],"mapped",[106]],[[120000,120000],"mapped",[107]],[[120001,120001],"mapped",[108]],[[120002,120002],"mapped",[109]],[[120003,120003],"mapped",[110]],[[120004,120004],"disallowed"],[[120005,120005],"mapped",[112]],[[120006,120006],"mapped",[113]],[[120007,120007],"mapped",[114]],[[120008,120008],"mapped",[115]],[[120009,120009],"mapped",[116]],[[120010,120010],"mapped",[117]],[[120011,120011],"mapped",[118]],[[120012,120012],"mapped",[119]],[[120013,120013],"mapped",[120]],[[120014,120014],"mapped",[121]],[[120015,120015],"mapped",[122]],[[120016,120016],"mapped",[97]],[[120017,120017],"mapped",[98]],[[120018,120018],"mapped",[99]],[[120019,120019],"mapped",[100]],[[120020,120020],"mapped",[101]],[[120021,120021],"mapped",[102]],[[120022,120022],"mapped",[103]],[[120023,120023],"mapped",[104]],[[120024,120024],"mapped",[105]],[[120025,120025],"mapped",[106]],[[120026,120026],"mapped",[107]],[[120027,120027],"mapped",[108]],[[120028,120028],"mapped",[109]],[[120029,120029],"mapped",[110]],[[120030,120030],"mapped",[111]],[[120031,120031],"mapped",[112]],[[120032,120032],"mapped",[113]],[[120033,120033],"mapped",[114]],[[120034,120034],"mapped",[115]],[[120035,120035],"mapped",[116]],[[120036,120036],"mapped",[117]],[[120037,120037],"mapped",[118]],[[120038,120038],"mapped",[119]],[[120039,120039],"mapped",[120]],[[120040,120040],"mapped",[121]],[[120041,120041],"mapped",[122]],[[120042,120042],"mapped",[97]],[[120043,120043],"mapped",[98]],[[120044,120044],"mapped",[99]],[[120045,120045],"mapped",[100]],[[120046,120046],"mapped",[101]],[[120047,120047],"mapped",[102]],[[120048,120048],"mapped",[103]],[[120049,120049],"mapped",[104]],[[120050,120050],"mapped",[105]],[[120051,120051],"mapped",[106]],[[120052,120052],"mapped",[107]],[[120053,120053],"mapped",[108]],[[120054,120054],"mapped",[109]],[[120055,120055],"mapped",[110]],[[120056,120056],"mapped",[111]],[[120057,120057],"mapped",[112]],[[120058,120058],"mapped",[113]],[[120059,120059],"mapped",[114]],[[120060,120060],"mapped",[115]],[[120061,120061],"mapped",[116]],[[120062,120062],"mapped",[117]],[[120063,120063],"mapped",[118]],[[120064,120064],"mapped",[119]],[[120065,120065],"mapped",[120]],[[120066,120066],"mapped",[121]],[[120067,120067],"mapped",[122]],[[120068,120068],"mapped",[97]],[[120069,120069],"mapped",[98]],[[120070,120070],"disallowed"],[[120071,120071],"mapped",[100]],[[120072,120072],"mapped",[101]],[[120073,120073],"mapped",[102]],[[120074,120074],"mapped",[103]],[[120075,120076],"disallowed"],[[120077,120077],"mapped",[106]],[[120078,120078],"mapped",[107]],[[120079,120079],"mapped",[108]],[[120080,120080],"mapped",[109]],[[120081,120081],"mapped",[110]],[[120082,120082],"mapped",[111]],[[120083,120083],"mapped",[112]],[[120084,120084],"mapped",[113]],[[120085,120085],"disallowed"],[[120086,120086],"mapped",[115]],[[120087,120087],"mapped",[116]],[[120088,120088],"mapped",[117]],[[120089,120089],"mapped",[118]],[[120090,120090],"mapped",[119]],[[120091,120091],"mapped",[120]],[[120092,120092],"mapped",[121]],[[120093,120093],"disallowed"],[[120094,120094],"mapped",[97]],[[120095,120095],"mapped",[98]],[[120096,120096],"mapped",[99]],[[120097,120097],"mapped",[100]],[[120098,120098],"mapped",[101]],[[120099,120099],"mapped",[102]],[[120100,120100],"mapped",[103]],[[120101,120101],"mapped",[104]],[[120102,120102],"mapped",[105]],[[120103,120103],"mapped",[106]],[[120104,120104],"mapped",[107]],[[120105,120105],"mapped",[108]],[[120106,120106],"mapped",[109]],[[120107,120107],"mapped",[110]],[[120108,120108],"mapped",[111]],[[120109,120109],"mapped",[112]],[[120110,120110],"mapped",[113]],[[120111,120111],"mapped",[114]],[[120112,120112],"mapped",[115]],[[120113,120113],"mapped",[116]],[[120114,120114],"mapped",[117]],[[120115,120115],"mapped",[118]],[[120116,120116],"mapped",[119]],[[120117,120117],"mapped",[120]],[[120118,120118],"mapped",[121]],[[120119,120119],"mapped",[122]],[[120120,120120],"mapped",[97]],[[120121,120121],"mapped",[98]],[[120122,120122],"disallowed"],[[120123,120123],"mapped",[100]],[[120124,120124],"mapped",[101]],[[120125,120125],"mapped",[102]],[[120126,120126],"mapped",[103]],[[120127,120127],"disallowed"],[[120128,120128],"mapped",[105]],[[120129,120129],"mapped",[106]],[[120130,120130],"mapped",[107]],[[120131,120131],"mapped",[108]],[[120132,120132],"mapped",[109]],[[120133,120133],"disallowed"],[[120134,120134],"mapped",[111]],[[120135,120137],"disallowed"],[[120138,120138],"mapped",[115]],[[120139,120139],"mapped",[116]],[[120140,120140],"mapped",[117]],[[120141,120141],"mapped",[118]],[[120142,120142],"mapped",[119]],[[120143,120143],"mapped",[120]],[[120144,120144],"mapped",[121]],[[120145,120145],"disallowed"],[[120146,120146],"mapped",[97]],[[120147,120147],"mapped",[98]],[[120148,120148],"mapped",[99]],[[120149,120149],"mapped",[100]],[[120150,120150],"mapped",[101]],[[120151,120151],"mapped",[102]],[[120152,120152],"mapped",[103]],[[120153,120153],"mapped",[104]],[[120154,120154],"mapped",[105]],[[120155,120155],"mapped",[106]],[[120156,120156],"mapped",[107]],[[120157,120157],"mapped",[108]],[[120158,120158],"mapped",[109]],[[120159,120159],"mapped",[110]],[[120160,120160],"mapped",[111]],[[120161,120161],"mapped",[112]],[[120162,120162],"mapped",[113]],[[120163,120163],"mapped",[114]],[[120164,120164],"mapped",[115]],[[120165,120165],"mapped",[116]],[[120166,120166],"mapped",[117]],[[120167,120167],"mapped",[118]],[[120168,120168],"mapped",[119]],[[120169,120169],"mapped",[120]],[[120170,120170],"mapped",[121]],[[120171,120171],"mapped",[122]],[[120172,120172],"mapped",[97]],[[120173,120173],"mapped",[98]],[[120174,120174],"mapped",[99]],[[120175,120175],"mapped",[100]],[[120176,120176],"mapped",[101]],[[120177,120177],"mapped",[102]],[[120178,120178],"mapped",[103]],[[120179,120179],"mapped",[104]],[[120180,120180],"mapped",[105]],[[120181,120181],"mapped",[106]],[[120182,120182],"mapped",[107]],[[120183,120183],"mapped",[108]],[[120184,120184],"mapped",[109]],[[120185,120185],"mapped",[110]],[[120186,120186],"mapped",[111]],[[120187,120187],"mapped",[112]],[[120188,120188],"mapped",[113]],[[120189,120189],"mapped",[114]],[[120190,120190],"mapped",[115]],[[120191,120191],"mapped",[116]],[[120192,120192],"mapped",[117]],[[120193,120193],"mapped",[118]],[[120194,120194],"mapped",[119]],[[120195,120195],"mapped",[120]],[[120196,120196],"mapped",[121]],[[120197,120197],"mapped",[122]],[[120198,120198],"mapped",[97]],[[120199,120199],"mapped",[98]],[[120200,120200],"mapped",[99]],[[120201,120201],"mapped",[100]],[[120202,120202],"mapped",[101]],[[120203,120203],"mapped",[102]],[[120204,120204],"mapped",[103]],[[120205,120205],"mapped",[104]],[[120206,120206],"mapped",[105]],[[120207,120207],"mapped",[106]],[[120208,120208],"mapped",[107]],[[120209,120209],"mapped",[108]],[[120210,120210],"mapped",[109]],[[120211,120211],"mapped",[110]],[[120212,120212],"mapped",[111]],[[120213,120213],"mapped",[112]],[[120214,120214],"mapped",[113]],[[120215,120215],"mapped",[114]],[[120216,120216],"mapped",[115]],[[120217,120217],"mapped",[116]],[[120218,120218],"mapped",[117]],[[120219,120219],"mapped",[118]],[[120220,120220],"mapped",[119]],[[120221,120221],"mapped",[120]],[[120222,120222],"mapped",[121]],[[120223,120223],"mapped",[122]],[[120224,120224],"mapped",[97]],[[120225,120225],"mapped",[98]],[[120226,120226],"mapped",[99]],[[120227,120227],"mapped",[100]],[[120228,120228],"mapped",[101]],[[120229,120229],"mapped",[102]],[[120230,120230],"mapped",[103]],[[120231,120231],"mapped",[104]],[[120232,120232],"mapped",[105]],[[120233,120233],"mapped",[106]],[[120234,120234],"mapped",[107]],[[120235,120235],"mapped",[108]],[[120236,120236],"mapped",[109]],[[120237,120237],"mapped",[110]],[[120238,120238],"mapped",[111]],[[120239,120239],"mapped",[112]],[[120240,120240],"mapped",[113]],[[120241,120241],"mapped",[114]],[[120242,120242],"mapped",[115]],[[120243,120243],"mapped",[116]],[[120244,120244],"mapped",[117]],[[120245,120245],"mapped",[118]],[[120246,120246],"mapped",[119]],[[120247,120247],"mapped",[120]],[[120248,120248],"mapped",[121]],[[120249,120249],"mapped",[122]],[[120250,120250],"mapped",[97]],[[120251,120251],"mapped",[98]],[[120252,120252],"mapped",[99]],[[120253,120253],"mapped",[100]],[[120254,120254],"mapped",[101]],[[120255,120255],"mapped",[102]],[[120256,120256],"mapped",[103]],[[120257,120257],"mapped",[104]],[[120258,120258],"mapped",[105]],[[120259,120259],"mapped",[106]],[[120260,120260],"mapped",[107]],[[120261,120261],"mapped",[108]],[[120262,120262],"mapped",[109]],[[120263,120263],"mapped",[110]],[[120264,120264],"mapped",[111]],[[120265,120265],"mapped",[112]],[[120266,120266],"mapped",[113]],[[120267,120267],"mapped",[114]],[[120268,120268],"mapped",[115]],[[120269,120269],"mapped",[116]],[[120270,120270],"mapped",[117]],[[120271,120271],"mapped",[118]],[[120272,120272],"mapped",[119]],[[120273,120273],"mapped",[120]],[[120274,120274],"mapped",[121]],[[120275,120275],"mapped",[122]],[[120276,120276],"mapped",[97]],[[120277,120277],"mapped",[98]],[[120278,120278],"mapped",[99]],[[120279,120279],"mapped",[100]],[[120280,120280],"mapped",[101]],[[120281,120281],"mapped",[102]],[[120282,120282],"mapped",[103]],[[120283,120283],"mapped",[104]],[[120284,120284],"mapped",[105]],[[120285,120285],"mapped",[106]],[[120286,120286],"mapped",[107]],[[120287,120287],"mapped",[108]],[[120288,120288],"mapped",[109]],[[120289,120289],"mapped",[110]],[[120290,120290],"mapped",[111]],[[120291,120291],"mapped",[112]],[[120292,120292],"mapped",[113]],[[120293,120293],"mapped",[114]],[[120294,120294],"mapped",[115]],[[120295,120295],"mapped",[116]],[[120296,120296],"mapped",[117]],[[120297,120297],"mapped",[118]],[[120298,120298],"mapped",[119]],[[120299,120299],"mapped",[120]],[[120300,120300],"mapped",[121]],[[120301,120301],"mapped",[122]],[[120302,120302],"mapped",[97]],[[120303,120303],"mapped",[98]],[[120304,120304],"mapped",[99]],[[120305,120305],"mapped",[100]],[[120306,120306],"mapped",[101]],[[120307,120307],"mapped",[102]],[[120308,120308],"mapped",[103]],[[120309,120309],"mapped",[104]],[[120310,120310],"mapped",[105]],[[120311,120311],"mapped",[106]],[[120312,120312],"mapped",[107]],[[120313,120313],"mapped",[108]],[[120314,120314],"mapped",[109]],[[120315,120315],"mapped",[110]],[[120316,120316],"mapped",[111]],[[120317,120317],"mapped",[112]],[[120318,120318],"mapped",[113]],[[120319,120319],"mapped",[114]],[[120320,120320],"mapped",[115]],[[120321,120321],"mapped",[116]],[[120322,120322],"mapped",[117]],[[120323,120323],"mapped",[118]],[[120324,120324],"mapped",[119]],[[120325,120325],"mapped",[120]],[[120326,120326],"mapped",[121]],[[120327,120327],"mapped",[122]],[[120328,120328],"mapped",[97]],[[120329,120329],"mapped",[98]],[[120330,120330],"mapped",[99]],[[120331,120331],"mapped",[100]],[[120332,120332],"mapped",[101]],[[120333,120333],"mapped",[102]],[[120334,120334],"mapped",[103]],[[120335,120335],"mapped",[104]],[[120336,120336],"mapped",[105]],[[120337,120337],"mapped",[106]],[[120338,120338],"mapped",[107]],[[120339,120339],"mapped",[108]],[[120340,120340],"mapped",[109]],[[120341,120341],"mapped",[110]],[[120342,120342],"mapped",[111]],[[120343,120343],"mapped",[112]],[[120344,120344],"mapped",[113]],[[120345,120345],"mapped",[114]],[[120346,120346],"mapped",[115]],[[120347,120347],"mapped",[116]],[[120348,120348],"mapped",[117]],[[120349,120349],"mapped",[118]],[[120350,120350],"mapped",[119]],[[120351,120351],"mapped",[120]],[[120352,120352],"mapped",[121]],[[120353,120353],"mapped",[122]],[[120354,120354],"mapped",[97]],[[120355,120355],"mapped",[98]],[[120356,120356],"mapped",[99]],[[120357,120357],"mapped",[100]],[[120358,120358],"mapped",[101]],[[120359,120359],"mapped",[102]],[[120360,120360],"mapped",[103]],[[120361,120361],"mapped",[104]],[[120362,120362],"mapped",[105]],[[120363,120363],"mapped",[106]],[[120364,120364],"mapped",[107]],[[120365,120365],"mapped",[108]],[[120366,120366],"mapped",[109]],[[120367,120367],"mapped",[110]],[[120368,120368],"mapped",[111]],[[120369,120369],"mapped",[112]],[[120370,120370],"mapped",[113]],[[120371,120371],"mapped",[114]],[[120372,120372],"mapped",[115]],[[120373,120373],"mapped",[116]],[[120374,120374],"mapped",[117]],[[120375,120375],"mapped",[118]],[[120376,120376],"mapped",[119]],[[120377,120377],"mapped",[120]],[[120378,120378],"mapped",[121]],[[120379,120379],"mapped",[122]],[[120380,120380],"mapped",[97]],[[120381,120381],"mapped",[98]],[[120382,120382],"mapped",[99]],[[120383,120383],"mapped",[100]],[[120384,120384],"mapped",[101]],[[120385,120385],"mapped",[102]],[[120386,120386],"mapped",[103]],[[120387,120387],"mapped",[104]],[[120388,120388],"mapped",[105]],[[120389,120389],"mapped",[106]],[[120390,120390],"mapped",[107]],[[120391,120391],"mapped",[108]],[[120392,120392],"mapped",[109]],[[120393,120393],"mapped",[110]],[[120394,120394],"mapped",[111]],[[120395,120395],"mapped",[112]],[[120396,120396],"mapped",[113]],[[120397,120397],"mapped",[114]],[[120398,120398],"mapped",[115]],[[120399,120399],"mapped",[116]],[[120400,120400],"mapped",[117]],[[120401,120401],"mapped",[118]],[[120402,120402],"mapped",[119]],[[120403,120403],"mapped",[120]],[[120404,120404],"mapped",[121]],[[120405,120405],"mapped",[122]],[[120406,120406],"mapped",[97]],[[120407,120407],"mapped",[98]],[[120408,120408],"mapped",[99]],[[120409,120409],"mapped",[100]],[[120410,120410],"mapped",[101]],[[120411,120411],"mapped",[102]],[[120412,120412],"mapped",[103]],[[120413,120413],"mapped",[104]],[[120414,120414],"mapped",[105]],[[120415,120415],"mapped",[106]],[[120416,120416],"mapped",[107]],[[120417,120417],"mapped",[108]],[[120418,120418],"mapped",[109]],[[120419,120419],"mapped",[110]],[[120420,120420],"mapped",[111]],[[120421,120421],"mapped",[112]],[[120422,120422],"mapped",[113]],[[120423,120423],"mapped",[114]],[[120424,120424],"mapped",[115]],[[120425,120425],"mapped",[116]],[[120426,120426],"mapped",[117]],[[120427,120427],"mapped",[118]],[[120428,120428],"mapped",[119]],[[120429,120429],"mapped",[120]],[[120430,120430],"mapped",[121]],[[120431,120431],"mapped",[122]],[[120432,120432],"mapped",[97]],[[120433,120433],"mapped",[98]],[[120434,120434],"mapped",[99]],[[120435,120435],"mapped",[100]],[[120436,120436],"mapped",[101]],[[120437,120437],"mapped",[102]],[[120438,120438],"mapped",[103]],[[120439,120439],"mapped",[104]],[[120440,120440],"mapped",[105]],[[120441,120441],"mapped",[106]],[[120442,120442],"mapped",[107]],[[120443,120443],"mapped",[108]],[[120444,120444],"mapped",[109]],[[120445,120445],"mapped",[110]],[[120446,120446],"mapped",[111]],[[120447,120447],"mapped",[112]],[[120448,120448],"mapped",[113]],[[120449,120449],"mapped",[114]],[[120450,120450],"mapped",[115]],[[120451,120451],"mapped",[116]],[[120452,120452],"mapped",[117]],[[120453,120453],"mapped",[118]],[[120454,120454],"mapped",[119]],[[120455,120455],"mapped",[120]],[[120456,120456],"mapped",[121]],[[120457,120457],"mapped",[122]],[[120458,120458],"mapped",[97]],[[120459,120459],"mapped",[98]],[[120460,120460],"mapped",[99]],[[120461,120461],"mapped",[100]],[[120462,120462],"mapped",[101]],[[120463,120463],"mapped",[102]],[[120464,120464],"mapped",[103]],[[120465,120465],"mapped",[104]],[[120466,120466],"mapped",[105]],[[120467,120467],"mapped",[106]],[[120468,120468],"mapped",[107]],[[120469,120469],"mapped",[108]],[[120470,120470],"mapped",[109]],[[120471,120471],"mapped",[110]],[[120472,120472],"mapped",[111]],[[120473,120473],"mapped",[112]],[[120474,120474],"mapped",[113]],[[120475,120475],"mapped",[114]],[[120476,120476],"mapped",[115]],[[120477,120477],"mapped",[116]],[[120478,120478],"mapped",[117]],[[120479,120479],"mapped",[118]],[[120480,120480],"mapped",[119]],[[120481,120481],"mapped",[120]],[[120482,120482],"mapped",[121]],[[120483,120483],"mapped",[122]],[[120484,120484],"mapped",[305]],[[120485,120485],"mapped",[567]],[[120486,120487],"disallowed"],[[120488,120488],"mapped",[945]],[[120489,120489],"mapped",[946]],[[120490,120490],"mapped",[947]],[[120491,120491],"mapped",[948]],[[120492,120492],"mapped",[949]],[[120493,120493],"mapped",[950]],[[120494,120494],"mapped",[951]],[[120495,120495],"mapped",[952]],[[120496,120496],"mapped",[953]],[[120497,120497],"mapped",[954]],[[120498,120498],"mapped",[955]],[[120499,120499],"mapped",[956]],[[120500,120500],"mapped",[957]],[[120501,120501],"mapped",[958]],[[120502,120502],"mapped",[959]],[[120503,120503],"mapped",[960]],[[120504,120504],"mapped",[961]],[[120505,120505],"mapped",[952]],[[120506,120506],"mapped",[963]],[[120507,120507],"mapped",[964]],[[120508,120508],"mapped",[965]],[[120509,120509],"mapped",[966]],[[120510,120510],"mapped",[967]],[[120511,120511],"mapped",[968]],[[120512,120512],"mapped",[969]],[[120513,120513],"mapped",[8711]],[[120514,120514],"mapped",[945]],[[120515,120515],"mapped",[946]],[[120516,120516],"mapped",[947]],[[120517,120517],"mapped",[948]],[[120518,120518],"mapped",[949]],[[120519,120519],"mapped",[950]],[[120520,120520],"mapped",[951]],[[120521,120521],"mapped",[952]],[[120522,120522],"mapped",[953]],[[120523,120523],"mapped",[954]],[[120524,120524],"mapped",[955]],[[120525,120525],"mapped",[956]],[[120526,120526],"mapped",[957]],[[120527,120527],"mapped",[958]],[[120528,120528],"mapped",[959]],[[120529,120529],"mapped",[960]],[[120530,120530],"mapped",[961]],[[120531,120532],"mapped",[963]],[[120533,120533],"mapped",[964]],[[120534,120534],"mapped",[965]],[[120535,120535],"mapped",[966]],[[120536,120536],"mapped",[967]],[[120537,120537],"mapped",[968]],[[120538,120538],"mapped",[969]],[[120539,120539],"mapped",[8706]],[[120540,120540],"mapped",[949]],[[120541,120541],"mapped",[952]],[[120542,120542],"mapped",[954]],[[120543,120543],"mapped",[966]],[[120544,120544],"mapped",[961]],[[120545,120545],"mapped",[960]],[[120546,120546],"mapped",[945]],[[120547,120547],"mapped",[946]],[[120548,120548],"mapped",[947]],[[120549,120549],"mapped",[948]],[[120550,120550],"mapped",[949]],[[120551,120551],"mapped",[950]],[[120552,120552],"mapped",[951]],[[120553,120553],"mapped",[952]],[[120554,120554],"mapped",[953]],[[120555,120555],"mapped",[954]],[[120556,120556],"mapped",[955]],[[120557,120557],"mapped",[956]],[[120558,120558],"mapped",[957]],[[120559,120559],"mapped",[958]],[[120560,120560],"mapped",[959]],[[120561,120561],"mapped",[960]],[[120562,120562],"mapped",[961]],[[120563,120563],"mapped",[952]],[[120564,120564],"mapped",[963]],[[120565,120565],"mapped",[964]],[[120566,120566],"mapped",[965]],[[120567,120567],"mapped",[966]],[[120568,120568],"mapped",[967]],[[120569,120569],"mapped",[968]],[[120570,120570],"mapped",[969]],[[120571,120571],"mapped",[8711]],[[120572,120572],"mapped",[945]],[[120573,120573],"mapped",[946]],[[120574,120574],"mapped",[947]],[[120575,120575],"mapped",[948]],[[120576,120576],"mapped",[949]],[[120577,120577],"mapped",[950]],[[120578,120578],"mapped",[951]],[[120579,120579],"mapped",[952]],[[120580,120580],"mapped",[953]],[[120581,120581],"mapped",[954]],[[120582,120582],"mapped",[955]],[[120583,120583],"mapped",[956]],[[120584,120584],"mapped",[957]],[[120585,120585],"mapped",[958]],[[120586,120586],"mapped",[959]],[[120587,120587],"mapped",[960]],[[120588,120588],"mapped",[961]],[[120589,120590],"mapped",[963]],[[120591,120591],"mapped",[964]],[[120592,120592],"mapped",[965]],[[120593,120593],"mapped",[966]],[[120594,120594],"mapped",[967]],[[120595,120595],"mapped",[968]],[[120596,120596],"mapped",[969]],[[120597,120597],"mapped",[8706]],[[120598,120598],"mapped",[949]],[[120599,120599],"mapped",[952]],[[120600,120600],"mapped",[954]],[[120601,120601],"mapped",[966]],[[120602,120602],"mapped",[961]],[[120603,120603],"mapped",[960]],[[120604,120604],"mapped",[945]],[[120605,120605],"mapped",[946]],[[120606,120606],"mapped",[947]],[[120607,120607],"mapped",[948]],[[120608,120608],"mapped",[949]],[[120609,120609],"mapped",[950]],[[120610,120610],"mapped",[951]],[[120611,120611],"mapped",[952]],[[120612,120612],"mapped",[953]],[[120613,120613],"mapped",[954]],[[120614,120614],"mapped",[955]],[[120615,120615],"mapped",[956]],[[120616,120616],"mapped",[957]],[[120617,120617],"mapped",[958]],[[120618,120618],"mapped",[959]],[[120619,120619],"mapped",[960]],[[120620,120620],"mapped",[961]],[[120621,120621],"mapped",[952]],[[120622,120622],"mapped",[963]],[[120623,120623],"mapped",[964]],[[120624,120624],"mapped",[965]],[[120625,120625],"mapped",[966]],[[120626,120626],"mapped",[967]],[[120627,120627],"mapped",[968]],[[120628,120628],"mapped",[969]],[[120629,120629],"mapped",[8711]],[[120630,120630],"mapped",[945]],[[120631,120631],"mapped",[946]],[[120632,120632],"mapped",[947]],[[120633,120633],"mapped",[948]],[[120634,120634],"mapped",[949]],[[120635,120635],"mapped",[950]],[[120636,120636],"mapped",[951]],[[120637,120637],"mapped",[952]],[[120638,120638],"mapped",[953]],[[120639,120639],"mapped",[954]],[[120640,120640],"mapped",[955]],[[120641,120641],"mapped",[956]],[[120642,120642],"mapped",[957]],[[120643,120643],"mapped",[958]],[[120644,120644],"mapped",[959]],[[120645,120645],"mapped",[960]],[[120646,120646],"mapped",[961]],[[120647,120648],"mapped",[963]],[[120649,120649],"mapped",[964]],[[120650,120650],"mapped",[965]],[[120651,120651],"mapped",[966]],[[120652,120652],"mapped",[967]],[[120653,120653],"mapped",[968]],[[120654,120654],"mapped",[969]],[[120655,120655],"mapped",[8706]],[[120656,120656],"mapped",[949]],[[120657,120657],"mapped",[952]],[[120658,120658],"mapped",[954]],[[120659,120659],"mapped",[966]],[[120660,120660],"mapped",[961]],[[120661,120661],"mapped",[960]],[[120662,120662],"mapped",[945]],[[120663,120663],"mapped",[946]],[[120664,120664],"mapped",[947]],[[120665,120665],"mapped",[948]],[[120666,120666],"mapped",[949]],[[120667,120667],"mapped",[950]],[[120668,120668],"mapped",[951]],[[120669,120669],"mapped",[952]],[[120670,120670],"mapped",[953]],[[120671,120671],"mapped",[954]],[[120672,120672],"mapped",[955]],[[120673,120673],"mapped",[956]],[[120674,120674],"mapped",[957]],[[120675,120675],"mapped",[958]],[[120676,120676],"mapped",[959]],[[120677,120677],"mapped",[960]],[[120678,120678],"mapped",[961]],[[120679,120679],"mapped",[952]],[[120680,120680],"mapped",[963]],[[120681,120681],"mapped",[964]],[[120682,120682],"mapped",[965]],[[120683,120683],"mapped",[966]],[[120684,120684],"mapped",[967]],[[120685,120685],"mapped",[968]],[[120686,120686],"mapped",[969]],[[120687,120687],"mapped",[8711]],[[120688,120688],"mapped",[945]],[[120689,120689],"mapped",[946]],[[120690,120690],"mapped",[947]],[[120691,120691],"mapped",[948]],[[120692,120692],"mapped",[949]],[[120693,120693],"mapped",[950]],[[120694,120694],"mapped",[951]],[[120695,120695],"mapped",[952]],[[120696,120696],"mapped",[953]],[[120697,120697],"mapped",[954]],[[120698,120698],"mapped",[955]],[[120699,120699],"mapped",[956]],[[120700,120700],"mapped",[957]],[[120701,120701],"mapped",[958]],[[120702,120702],"mapped",[959]],[[120703,120703],"mapped",[960]],[[120704,120704],"mapped",[961]],[[120705,120706],"mapped",[963]],[[120707,120707],"mapped",[964]],[[120708,120708],"mapped",[965]],[[120709,120709],"mapped",[966]],[[120710,120710],"mapped",[967]],[[120711,120711],"mapped",[968]],[[120712,120712],"mapped",[969]],[[120713,120713],"mapped",[8706]],[[120714,120714],"mapped",[949]],[[120715,120715],"mapped",[952]],[[120716,120716],"mapped",[954]],[[120717,120717],"mapped",[966]],[[120718,120718],"mapped",[961]],[[120719,120719],"mapped",[960]],[[120720,120720],"mapped",[945]],[[120721,120721],"mapped",[946]],[[120722,120722],"mapped",[947]],[[120723,120723],"mapped",[948]],[[120724,120724],"mapped",[949]],[[120725,120725],"mapped",[950]],[[120726,120726],"mapped",[951]],[[120727,120727],"mapped",[952]],[[120728,120728],"mapped",[953]],[[120729,120729],"mapped",[954]],[[120730,120730],"mapped",[955]],[[120731,120731],"mapped",[956]],[[120732,120732],"mapped",[957]],[[120733,120733],"mapped",[958]],[[120734,120734],"mapped",[959]],[[120735,120735],"mapped",[960]],[[120736,120736],"mapped",[961]],[[120737,120737],"mapped",[952]],[[120738,120738],"mapped",[963]],[[120739,120739],"mapped",[964]],[[120740,120740],"mapped",[965]],[[120741,120741],"mapped",[966]],[[120742,120742],"mapped",[967]],[[120743,120743],"mapped",[968]],[[120744,120744],"mapped",[969]],[[120745,120745],"mapped",[8711]],[[120746,120746],"mapped",[945]],[[120747,120747],"mapped",[946]],[[120748,120748],"mapped",[947]],[[120749,120749],"mapped",[948]],[[120750,120750],"mapped",[949]],[[120751,120751],"mapped",[950]],[[120752,120752],"mapped",[951]],[[120753,120753],"mapped",[952]],[[120754,120754],"mapped",[953]],[[120755,120755],"mapped",[954]],[[120756,120756],"mapped",[955]],[[120757,120757],"mapped",[956]],[[120758,120758],"mapped",[957]],[[120759,120759],"mapped",[958]],[[120760,120760],"mapped",[959]],[[120761,120761],"mapped",[960]],[[120762,120762],"mapped",[961]],[[120763,120764],"mapped",[963]],[[120765,120765],"mapped",[964]],[[120766,120766],"mapped",[965]],[[120767,120767],"mapped",[966]],[[120768,120768],"mapped",[967]],[[120769,120769],"mapped",[968]],[[120770,120770],"mapped",[969]],[[120771,120771],"mapped",[8706]],[[120772,120772],"mapped",[949]],[[120773,120773],"mapped",[952]],[[120774,120774],"mapped",[954]],[[120775,120775],"mapped",[966]],[[120776,120776],"mapped",[961]],[[120777,120777],"mapped",[960]],[[120778,120779],"mapped",[989]],[[120780,120781],"disallowed"],[[120782,120782],"mapped",[48]],[[120783,120783],"mapped",[49]],[[120784,120784],"mapped",[50]],[[120785,120785],"mapped",[51]],[[120786,120786],"mapped",[52]],[[120787,120787],"mapped",[53]],[[120788,120788],"mapped",[54]],[[120789,120789],"mapped",[55]],[[120790,120790],"mapped",[56]],[[120791,120791],"mapped",[57]],[[120792,120792],"mapped",[48]],[[120793,120793],"mapped",[49]],[[120794,120794],"mapped",[50]],[[120795,120795],"mapped",[51]],[[120796,120796],"mapped",[52]],[[120797,120797],"mapped",[53]],[[120798,120798],"mapped",[54]],[[120799,120799],"mapped",[55]],[[120800,120800],"mapped",[56]],[[120801,120801],"mapped",[57]],[[120802,120802],"mapped",[48]],[[120803,120803],"mapped",[49]],[[120804,120804],"mapped",[50]],[[120805,120805],"mapped",[51]],[[120806,120806],"mapped",[52]],[[120807,120807],"mapped",[53]],[[120808,120808],"mapped",[54]],[[120809,120809],"mapped",[55]],[[120810,120810],"mapped",[56]],[[120811,120811],"mapped",[57]],[[120812,120812],"mapped",[48]],[[120813,120813],"mapped",[49]],[[120814,120814],"mapped",[50]],[[120815,120815],"mapped",[51]],[[120816,120816],"mapped",[52]],[[120817,120817],"mapped",[53]],[[120818,120818],"mapped",[54]],[[120819,120819],"mapped",[55]],[[120820,120820],"mapped",[56]],[[120821,120821],"mapped",[57]],[[120822,120822],"mapped",[48]],[[120823,120823],"mapped",[49]],[[120824,120824],"mapped",[50]],[[120825,120825],"mapped",[51]],[[120826,120826],"mapped",[52]],[[120827,120827],"mapped",[53]],[[120828,120828],"mapped",[54]],[[120829,120829],"mapped",[55]],[[120830,120830],"mapped",[56]],[[120831,120831],"mapped",[57]],[[120832,121343],"valid",[],"NV8"],[[121344,121398],"valid"],[[121399,121402],"valid",[],"NV8"],[[121403,121452],"valid"],[[121453,121460],"valid",[],"NV8"],[[121461,121461],"valid"],[[121462,121475],"valid",[],"NV8"],[[121476,121476],"valid"],[[121477,121483],"valid",[],"NV8"],[[121484,121498],"disallowed"],[[121499,121503],"valid"],[[121504,121504],"disallowed"],[[121505,121519],"valid"],[[121520,124927],"disallowed"],[[124928,125124],"valid"],[[125125,125126],"disallowed"],[[125127,125135],"valid",[],"NV8"],[[125136,125142],"valid"],[[125143,126463],"disallowed"],[[126464,126464],"mapped",[1575]],[[126465,126465],"mapped",[1576]],[[126466,126466],"mapped",[1580]],[[126467,126467],"mapped",[1583]],[[126468,126468],"disallowed"],[[126469,126469],"mapped",[1608]],[[126470,126470],"mapped",[1586]],[[126471,126471],"mapped",[1581]],[[126472,126472],"mapped",[1591]],[[126473,126473],"mapped",[1610]],[[126474,126474],"mapped",[1603]],[[126475,126475],"mapped",[1604]],[[126476,126476],"mapped",[1605]],[[126477,126477],"mapped",[1606]],[[126478,126478],"mapped",[1587]],[[126479,126479],"mapped",[1593]],[[126480,126480],"mapped",[1601]],[[126481,126481],"mapped",[1589]],[[126482,126482],"mapped",[1602]],[[126483,126483],"mapped",[1585]],[[126484,126484],"mapped",[1588]],[[126485,126485],"mapped",[1578]],[[126486,126486],"mapped",[1579]],[[126487,126487],"mapped",[1582]],[[126488,126488],"mapped",[1584]],[[126489,126489],"mapped",[1590]],[[126490,126490],"mapped",[1592]],[[126491,126491],"mapped",[1594]],[[126492,126492],"mapped",[1646]],[[126493,126493],"mapped",[1722]],[[126494,126494],"mapped",[1697]],[[126495,126495],"mapped",[1647]],[[126496,126496],"disallowed"],[[126497,126497],"mapped",[1576]],[[126498,126498],"mapped",[1580]],[[126499,126499],"disallowed"],[[126500,126500],"mapped",[1607]],[[126501,126502],"disallowed"],[[126503,126503],"mapped",[1581]],[[126504,126504],"disallowed"],[[126505,126505],"mapped",[1610]],[[126506,126506],"mapped",[1603]],[[126507,126507],"mapped",[1604]],[[126508,126508],"mapped",[1605]],[[126509,126509],"mapped",[1606]],[[126510,126510],"mapped",[1587]],[[126511,126511],"mapped",[1593]],[[126512,126512],"mapped",[1601]],[[126513,126513],"mapped",[1589]],[[126514,126514],"mapped",[1602]],[[126515,126515],"disallowed"],[[126516,126516],"mapped",[1588]],[[126517,126517],"mapped",[1578]],[[126518,126518],"mapped",[1579]],[[126519,126519],"mapped",[1582]],[[126520,126520],"disallowed"],[[126521,126521],"mapped",[1590]],[[126522,126522],"disallowed"],[[126523,126523],"mapped",[1594]],[[126524,126529],"disallowed"],[[126530,126530],"mapped",[1580]],[[126531,126534],"disallowed"],[[126535,126535],"mapped",[1581]],[[126536,126536],"disallowed"],[[126537,126537],"mapped",[1610]],[[126538,126538],"disallowed"],[[126539,126539],"mapped",[1604]],[[126540,126540],"disallowed"],[[126541,126541],"mapped",[1606]],[[126542,126542],"mapped",[1587]],[[126543,126543],"mapped",[1593]],[[126544,126544],"disallowed"],[[126545,126545],"mapped",[1589]],[[126546,126546],"mapped",[1602]],[[126547,126547],"disallowed"],[[126548,126548],"mapped",[1588]],[[126549,126550],"disallowed"],[[126551,126551],"mapped",[1582]],[[126552,126552],"disallowed"],[[126553,126553],"mapped",[1590]],[[126554,126554],"disallowed"],[[126555,126555],"mapped",[1594]],[[126556,126556],"disallowed"],[[126557,126557],"mapped",[1722]],[[126558,126558],"disallowed"],[[126559,126559],"mapped",[1647]],[[126560,126560],"disallowed"],[[126561,126561],"mapped",[1576]],[[126562,126562],"mapped",[1580]],[[126563,126563],"disallowed"],[[126564,126564],"mapped",[1607]],[[126565,126566],"disallowed"],[[126567,126567],"mapped",[1581]],[[126568,126568],"mapped",[1591]],[[126569,126569],"mapped",[1610]],[[126570,126570],"mapped",[1603]],[[126571,126571],"disallowed"],[[126572,126572],"mapped",[1605]],[[126573,126573],"mapped",[1606]],[[126574,126574],"mapped",[1587]],[[126575,126575],"mapped",[1593]],[[126576,126576],"mapped",[1601]],[[126577,126577],"mapped",[1589]],[[126578,126578],"mapped",[1602]],[[126579,126579],"disallowed"],[[126580,126580],"mapped",[1588]],[[126581,126581],"mapped",[1578]],[[126582,126582],"mapped",[1579]],[[126583,126583],"mapped",[1582]],[[126584,126584],"disallowed"],[[126585,126585],"mapped",[1590]],[[126586,126586],"mapped",[1592]],[[126587,126587],"mapped",[1594]],[[126588,126588],"mapped",[1646]],[[126589,126589],"disallowed"],[[126590,126590],"mapped",[1697]],[[126591,126591],"disallowed"],[[126592,126592],"mapped",[1575]],[[126593,126593],"mapped",[1576]],[[126594,126594],"mapped",[1580]],[[126595,126595],"mapped",[1583]],[[126596,126596],"mapped",[1607]],[[126597,126597],"mapped",[1608]],[[126598,126598],"mapped",[1586]],[[126599,126599],"mapped",[1581]],[[126600,126600],"mapped",[1591]],[[126601,126601],"mapped",[1610]],[[126602,126602],"disallowed"],[[126603,126603],"mapped",[1604]],[[126604,126604],"mapped",[1605]],[[126605,126605],"mapped",[1606]],[[126606,126606],"mapped",[1587]],[[126607,126607],"mapped",[1593]],[[126608,126608],"mapped",[1601]],[[126609,126609],"mapped",[1589]],[[126610,126610],"mapped",[1602]],[[126611,126611],"mapped",[1585]],[[126612,126612],"mapped",[1588]],[[126613,126613],"mapped",[1578]],[[126614,126614],"mapped",[1579]],[[126615,126615],"mapped",[1582]],[[126616,126616],"mapped",[1584]],[[126617,126617],"mapped",[1590]],[[126618,126618],"mapped",[1592]],[[126619,126619],"mapped",[1594]],[[126620,126624],"disallowed"],[[126625,126625],"mapped",[1576]],[[126626,126626],"mapped",[1580]],[[126627,126627],"mapped",[1583]],[[126628,126628],"disallowed"],[[126629,126629],"mapped",[1608]],[[126630,126630],"mapped",[1586]],[[126631,126631],"mapped",[1581]],[[126632,126632],"mapped",[1591]],[[126633,126633],"mapped",[1610]],[[126634,126634],"disallowed"],[[126635,126635],"mapped",[1604]],[[126636,126636],"mapped",[1605]],[[126637,126637],"mapped",[1606]],[[126638,126638],"mapped",[1587]],[[126639,126639],"mapped",[1593]],[[126640,126640],"mapped",[1601]],[[126641,126641],"mapped",[1589]],[[126642,126642],"mapped",[1602]],[[126643,126643],"mapped",[1585]],[[126644,126644],"mapped",[1588]],[[126645,126645],"mapped",[1578]],[[126646,126646],"mapped",[1579]],[[126647,126647],"mapped",[1582]],[[126648,126648],"mapped",[1584]],[[126649,126649],"mapped",[1590]],[[126650,126650],"mapped",[1592]],[[126651,126651],"mapped",[1594]],[[126652,126703],"disallowed"],[[126704,126705],"valid",[],"NV8"],[[126706,126975],"disallowed"],[[126976,127019],"valid",[],"NV8"],[[127020,127023],"disallowed"],[[127024,127123],"valid",[],"NV8"],[[127124,127135],"disallowed"],[[127136,127150],"valid",[],"NV8"],[[127151,127152],"disallowed"],[[127153,127166],"valid",[],"NV8"],[[127167,127167],"valid",[],"NV8"],[[127168,127168],"disallowed"],[[127169,127183],"valid",[],"NV8"],[[127184,127184],"disallowed"],[[127185,127199],"valid",[],"NV8"],[[127200,127221],"valid",[],"NV8"],[[127222,127231],"disallowed"],[[127232,127232],"disallowed"],[[127233,127233],"disallowed_STD3_mapped",[48,44]],[[127234,127234],"disallowed_STD3_mapped",[49,44]],[[127235,127235],"disallowed_STD3_mapped",[50,44]],[[127236,127236],"disallowed_STD3_mapped",[51,44]],[[127237,127237],"disallowed_STD3_mapped",[52,44]],[[127238,127238],"disallowed_STD3_mapped",[53,44]],[[127239,127239],"disallowed_STD3_mapped",[54,44]],[[127240,127240],"disallowed_STD3_mapped",[55,44]],[[127241,127241],"disallowed_STD3_mapped",[56,44]],[[127242,127242],"disallowed_STD3_mapped",[57,44]],[[127243,127244],"valid",[],"NV8"],[[127245,127247],"disallowed"],[[127248,127248],"disallowed_STD3_mapped",[40,97,41]],[[127249,127249],"disallowed_STD3_mapped",[40,98,41]],[[127250,127250],"disallowed_STD3_mapped",[40,99,41]],[[127251,127251],"disallowed_STD3_mapped",[40,100,41]],[[127252,127252],"disallowed_STD3_mapped",[40,101,41]],[[127253,127253],"disallowed_STD3_mapped",[40,102,41]],[[127254,127254],"disallowed_STD3_mapped",[40,103,41]],[[127255,127255],"disallowed_STD3_mapped",[40,104,41]],[[127256,127256],"disallowed_STD3_mapped",[40,105,41]],[[127257,127257],"disallowed_STD3_mapped",[40,106,41]],[[127258,127258],"disallowed_STD3_mapped",[40,107,41]],[[127259,127259],"disallowed_STD3_mapped",[40,108,41]],[[127260,127260],"disallowed_STD3_mapped",[40,109,41]],[[127261,127261],"disallowed_STD3_mapped",[40,110,41]],[[127262,127262],"disallowed_STD3_mapped",[40,111,41]],[[127263,127263],"disallowed_STD3_mapped",[40,112,41]],[[127264,127264],"disallowed_STD3_mapped",[40,113,41]],[[127265,127265],"disallowed_STD3_mapped",[40,114,41]],[[127266,127266],"disallowed_STD3_mapped",[40,115,41]],[[127267,127267],"disallowed_STD3_mapped",[40,116,41]],[[127268,127268],"disallowed_STD3_mapped",[40,117,41]],[[127269,127269],"disallowed_STD3_mapped",[40,118,41]],[[127270,127270],"disallowed_STD3_mapped",[40,119,41]],[[127271,127271],"disallowed_STD3_mapped",[40,120,41]],[[127272,127272],"disallowed_STD3_mapped",[40,121,41]],[[127273,127273],"disallowed_STD3_mapped",[40,122,41]],[[127274,127274],"mapped",[12308,115,12309]],[[127275,127275],"mapped",[99]],[[127276,127276],"mapped",[114]],[[127277,127277],"mapped",[99,100]],[[127278,127278],"mapped",[119,122]],[[127279,127279],"disallowed"],[[127280,127280],"mapped",[97]],[[127281,127281],"mapped",[98]],[[127282,127282],"mapped",[99]],[[127283,127283],"mapped",[100]],[[127284,127284],"mapped",[101]],[[127285,127285],"mapped",[102]],[[127286,127286],"mapped",[103]],[[127287,127287],"mapped",[104]],[[127288,127288],"mapped",[105]],[[127289,127289],"mapped",[106]],[[127290,127290],"mapped",[107]],[[127291,127291],"mapped",[108]],[[127292,127292],"mapped",[109]],[[127293,127293],"mapped",[110]],[[127294,127294],"mapped",[111]],[[127295,127295],"mapped",[112]],[[127296,127296],"mapped",[113]],[[127297,127297],"mapped",[114]],[[127298,127298],"mapped",[115]],[[127299,127299],"mapped",[116]],[[127300,127300],"mapped",[117]],[[127301,127301],"mapped",[118]],[[127302,127302],"mapped",[119]],[[127303,127303],"mapped",[120]],[[127304,127304],"mapped",[121]],[[127305,127305],"mapped",[122]],[[127306,127306],"mapped",[104,118]],[[127307,127307],"mapped",[109,118]],[[127308,127308],"mapped",[115,100]],[[127309,127309],"mapped",[115,115]],[[127310,127310],"mapped",[112,112,118]],[[127311,127311],"mapped",[119,99]],[[127312,127318],"valid",[],"NV8"],[[127319,127319],"valid",[],"NV8"],[[127320,127326],"valid",[],"NV8"],[[127327,127327],"valid",[],"NV8"],[[127328,127337],"valid",[],"NV8"],[[127338,127338],"mapped",[109,99]],[[127339,127339],"mapped",[109,100]],[[127340,127343],"disallowed"],[[127344,127352],"valid",[],"NV8"],[[127353,127353],"valid",[],"NV8"],[[127354,127354],"valid",[],"NV8"],[[127355,127356],"valid",[],"NV8"],[[127357,127358],"valid",[],"NV8"],[[127359,127359],"valid",[],"NV8"],[[127360,127369],"valid",[],"NV8"],[[127370,127373],"valid",[],"NV8"],[[127374,127375],"valid",[],"NV8"],[[127376,127376],"mapped",[100,106]],[[127377,127386],"valid",[],"NV8"],[[127387,127461],"disallowed"],[[127462,127487],"valid",[],"NV8"],[[127488,127488],"mapped",[12411,12363]],[[127489,127489],"mapped",[12467,12467]],[[127490,127490],"mapped",[12469]],[[127491,127503],"disallowed"],[[127504,127504],"mapped",[25163]],[[127505,127505],"mapped",[23383]],[[127506,127506],"mapped",[21452]],[[127507,127507],"mapped",[12487]],[[127508,127508],"mapped",[20108]],[[127509,127509],"mapped",[22810]],[[127510,127510],"mapped",[35299]],[[127511,127511],"mapped",[22825]],[[127512,127512],"mapped",[20132]],[[127513,127513],"mapped",[26144]],[[127514,127514],"mapped",[28961]],[[127515,127515],"mapped",[26009]],[[127516,127516],"mapped",[21069]],[[127517,127517],"mapped",[24460]],[[127518,127518],"mapped",[20877]],[[127519,127519],"mapped",[26032]],[[127520,127520],"mapped",[21021]],[[127521,127521],"mapped",[32066]],[[127522,127522],"mapped",[29983]],[[127523,127523],"mapped",[36009]],[[127524,127524],"mapped",[22768]],[[127525,127525],"mapped",[21561]],[[127526,127526],"mapped",[28436]],[[127527,127527],"mapped",[25237]],[[127528,127528],"mapped",[25429]],[[127529,127529],"mapped",[19968]],[[127530,127530],"mapped",[19977]],[[127531,127531],"mapped",[36938]],[[127532,127532],"mapped",[24038]],[[127533,127533],"mapped",[20013]],[[127534,127534],"mapped",[21491]],[[127535,127535],"mapped",[25351]],[[127536,127536],"mapped",[36208]],[[127537,127537],"mapped",[25171]],[[127538,127538],"mapped",[31105]],[[127539,127539],"mapped",[31354]],[[127540,127540],"mapped",[21512]],[[127541,127541],"mapped",[28288]],[[127542,127542],"mapped",[26377]],[[127543,127543],"mapped",[26376]],[[127544,127544],"mapped",[30003]],[[127545,127545],"mapped",[21106]],[[127546,127546],"mapped",[21942]],[[127547,127551],"disallowed"],[[127552,127552],"mapped",[12308,26412,12309]],[[127553,127553],"mapped",[12308,19977,12309]],[[127554,127554],"mapped",[12308,20108,12309]],[[127555,127555],"mapped",[12308,23433,12309]],[[127556,127556],"mapped",[12308,28857,12309]],[[127557,127557],"mapped",[12308,25171,12309]],[[127558,127558],"mapped",[12308,30423,12309]],[[127559,127559],"mapped",[12308,21213,12309]],[[127560,127560],"mapped",[12308,25943,12309]],[[127561,127567],"disallowed"],[[127568,127568],"mapped",[24471]],[[127569,127569],"mapped",[21487]],[[127570,127743],"disallowed"],[[127744,127776],"valid",[],"NV8"],[[127777,127788],"valid",[],"NV8"],[[127789,127791],"valid",[],"NV8"],[[127792,127797],"valid",[],"NV8"],[[127798,127798],"valid",[],"NV8"],[[127799,127868],"valid",[],"NV8"],[[127869,127869],"valid",[],"NV8"],[[127870,127871],"valid",[],"NV8"],[[127872,127891],"valid",[],"NV8"],[[127892,127903],"valid",[],"NV8"],[[127904,127940],"valid",[],"NV8"],[[127941,127941],"valid",[],"NV8"],[[127942,127946],"valid",[],"NV8"],[[127947,127950],"valid",[],"NV8"],[[127951,127955],"valid",[],"NV8"],[[127956,127967],"valid",[],"NV8"],[[127968,127984],"valid",[],"NV8"],[[127985,127991],"valid",[],"NV8"],[[127992,127999],"valid",[],"NV8"],[[128000,128062],"valid",[],"NV8"],[[128063,128063],"valid",[],"NV8"],[[128064,128064],"valid",[],"NV8"],[[128065,128065],"valid",[],"NV8"],[[128066,128247],"valid",[],"NV8"],[[128248,128248],"valid",[],"NV8"],[[128249,128252],"valid",[],"NV8"],[[128253,128254],"valid",[],"NV8"],[[128255,128255],"valid",[],"NV8"],[[128256,128317],"valid",[],"NV8"],[[128318,128319],"valid",[],"NV8"],[[128320,128323],"valid",[],"NV8"],[[128324,128330],"valid",[],"NV8"],[[128331,128335],"valid",[],"NV8"],[[128336,128359],"valid",[],"NV8"],[[128360,128377],"valid",[],"NV8"],[[128378,128378],"disallowed"],[[128379,128419],"valid",[],"NV8"],[[128420,128420],"disallowed"],[[128421,128506],"valid",[],"NV8"],[[128507,128511],"valid",[],"NV8"],[[128512,128512],"valid",[],"NV8"],[[128513,128528],"valid",[],"NV8"],[[128529,128529],"valid",[],"NV8"],[[128530,128532],"valid",[],"NV8"],[[128533,128533],"valid",[],"NV8"],[[128534,128534],"valid",[],"NV8"],[[128535,128535],"valid",[],"NV8"],[[128536,128536],"valid",[],"NV8"],[[128537,128537],"valid",[],"NV8"],[[128538,128538],"valid",[],"NV8"],[[128539,128539],"valid",[],"NV8"],[[128540,128542],"valid",[],"NV8"],[[128543,128543],"valid",[],"NV8"],[[128544,128549],"valid",[],"NV8"],[[128550,128551],"valid",[],"NV8"],[[128552,128555],"valid",[],"NV8"],[[128556,128556],"valid",[],"NV8"],[[128557,128557],"valid",[],"NV8"],[[128558,128559],"valid",[],"NV8"],[[128560,128563],"valid",[],"NV8"],[[128564,128564],"valid",[],"NV8"],[[128565,128576],"valid",[],"NV8"],[[128577,128578],"valid",[],"NV8"],[[128579,128580],"valid",[],"NV8"],[[128581,128591],"valid",[],"NV8"],[[128592,128639],"valid",[],"NV8"],[[128640,128709],"valid",[],"NV8"],[[128710,128719],"valid",[],"NV8"],[[128720,128720],"valid",[],"NV8"],[[128721,128735],"disallowed"],[[128736,128748],"valid",[],"NV8"],[[128749,128751],"disallowed"],[[128752,128755],"valid",[],"NV8"],[[128756,128767],"disallowed"],[[128768,128883],"valid",[],"NV8"],[[128884,128895],"disallowed"],[[128896,128980],"valid",[],"NV8"],[[128981,129023],"disallowed"],[[129024,129035],"valid",[],"NV8"],[[129036,129039],"disallowed"],[[129040,129095],"valid",[],"NV8"],[[129096,129103],"disallowed"],[[129104,129113],"valid",[],"NV8"],[[129114,129119],"disallowed"],[[129120,129159],"valid",[],"NV8"],[[129160,129167],"disallowed"],[[129168,129197],"valid",[],"NV8"],[[129198,129295],"disallowed"],[[129296,129304],"valid",[],"NV8"],[[129305,129407],"disallowed"],[[129408,129412],"valid",[],"NV8"],[[129413,129471],"disallowed"],[[129472,129472],"valid",[],"NV8"],[[129473,131069],"disallowed"],[[131070,131071],"disallowed"],[[131072,173782],"valid"],[[173783,173823],"disallowed"],[[173824,177972],"valid"],[[177973,177983],"disallowed"],[[177984,178205],"valid"],[[178206,178207],"disallowed"],[[178208,183969],"valid"],[[183970,194559],"disallowed"],[[194560,194560],"mapped",[20029]],[[194561,194561],"mapped",[20024]],[[194562,194562],"mapped",[20033]],[[194563,194563],"mapped",[131362]],[[194564,194564],"mapped",[20320]],[[194565,194565],"mapped",[20398]],[[194566,194566],"mapped",[20411]],[[194567,194567],"mapped",[20482]],[[194568,194568],"mapped",[20602]],[[194569,194569],"mapped",[20633]],[[194570,194570],"mapped",[20711]],[[194571,194571],"mapped",[20687]],[[194572,194572],"mapped",[13470]],[[194573,194573],"mapped",[132666]],[[194574,194574],"mapped",[20813]],[[194575,194575],"mapped",[20820]],[[194576,194576],"mapped",[20836]],[[194577,194577],"mapped",[20855]],[[194578,194578],"mapped",[132380]],[[194579,194579],"mapped",[13497]],[[194580,194580],"mapped",[20839]],[[194581,194581],"mapped",[20877]],[[194582,194582],"mapped",[132427]],[[194583,194583],"mapped",[20887]],[[194584,194584],"mapped",[20900]],[[194585,194585],"mapped",[20172]],[[194586,194586],"mapped",[20908]],[[194587,194587],"mapped",[20917]],[[194588,194588],"mapped",[168415]],[[194589,194589],"mapped",[20981]],[[194590,194590],"mapped",[20995]],[[194591,194591],"mapped",[13535]],[[194592,194592],"mapped",[21051]],[[194593,194593],"mapped",[21062]],[[194594,194594],"mapped",[21106]],[[194595,194595],"mapped",[21111]],[[194596,194596],"mapped",[13589]],[[194597,194597],"mapped",[21191]],[[194598,194598],"mapped",[21193]],[[194599,194599],"mapped",[21220]],[[194600,194600],"mapped",[21242]],[[194601,194601],"mapped",[21253]],[[194602,194602],"mapped",[21254]],[[194603,194603],"mapped",[21271]],[[194604,194604],"mapped",[21321]],[[194605,194605],"mapped",[21329]],[[194606,194606],"mapped",[21338]],[[194607,194607],"mapped",[21363]],[[194608,194608],"mapped",[21373]],[[194609,194611],"mapped",[21375]],[[194612,194612],"mapped",[133676]],[[194613,194613],"mapped",[28784]],[[194614,194614],"mapped",[21450]],[[194615,194615],"mapped",[21471]],[[194616,194616],"mapped",[133987]],[[194617,194617],"mapped",[21483]],[[194618,194618],"mapped",[21489]],[[194619,194619],"mapped",[21510]],[[194620,194620],"mapped",[21662]],[[194621,194621],"mapped",[21560]],[[194622,194622],"mapped",[21576]],[[194623,194623],"mapped",[21608]],[[194624,194624],"mapped",[21666]],[[194625,194625],"mapped",[21750]],[[194626,194626],"mapped",[21776]],[[194627,194627],"mapped",[21843]],[[194628,194628],"mapped",[21859]],[[194629,194630],"mapped",[21892]],[[194631,194631],"mapped",[21913]],[[194632,194632],"mapped",[21931]],[[194633,194633],"mapped",[21939]],[[194634,194634],"mapped",[21954]],[[194635,194635],"mapped",[22294]],[[194636,194636],"mapped",[22022]],[[194637,194637],"mapped",[22295]],[[194638,194638],"mapped",[22097]],[[194639,194639],"mapped",[22132]],[[194640,194640],"mapped",[20999]],[[194641,194641],"mapped",[22766]],[[194642,194642],"mapped",[22478]],[[194643,194643],"mapped",[22516]],[[194644,194644],"mapped",[22541]],[[194645,194645],"mapped",[22411]],[[194646,194646],"mapped",[22578]],[[194647,194647],"mapped",[22577]],[[194648,194648],"mapped",[22700]],[[194649,194649],"mapped",[136420]],[[194650,194650],"mapped",[22770]],[[194651,194651],"mapped",[22775]],[[194652,194652],"mapped",[22790]],[[194653,194653],"mapped",[22810]],[[194654,194654],"mapped",[22818]],[[194655,194655],"mapped",[22882]],[[194656,194656],"mapped",[136872]],[[194657,194657],"mapped",[136938]],[[194658,194658],"mapped",[23020]],[[194659,194659],"mapped",[23067]],[[194660,194660],"mapped",[23079]],[[194661,194661],"mapped",[23000]],[[194662,194662],"mapped",[23142]],[[194663,194663],"mapped",[14062]],[[194664,194664],"disallowed"],[[194665,194665],"mapped",[23304]],[[194666,194667],"mapped",[23358]],[[194668,194668],"mapped",[137672]],[[194669,194669],"mapped",[23491]],[[194670,194670],"mapped",[23512]],[[194671,194671],"mapped",[23527]],[[194672,194672],"mapped",[23539]],[[194673,194673],"mapped",[138008]],[[194674,194674],"mapped",[23551]],[[194675,194675],"mapped",[23558]],[[194676,194676],"disallowed"],[[194677,194677],"mapped",[23586]],[[194678,194678],"mapped",[14209]],[[194679,194679],"mapped",[23648]],[[194680,194680],"mapped",[23662]],[[194681,194681],"mapped",[23744]],[[194682,194682],"mapped",[23693]],[[194683,194683],"mapped",[138724]],[[194684,194684],"mapped",[23875]],[[194685,194685],"mapped",[138726]],[[194686,194686],"mapped",[23918]],[[194687,194687],"mapped",[23915]],[[194688,194688],"mapped",[23932]],[[194689,194689],"mapped",[24033]],[[194690,194690],"mapped",[24034]],[[194691,194691],"mapped",[14383]],[[194692,194692],"mapped",[24061]],[[194693,194693],"mapped",[24104]],[[194694,194694],"mapped",[24125]],[[194695,194695],"mapped",[24169]],[[194696,194696],"mapped",[14434]],[[194697,194697],"mapped",[139651]],[[194698,194698],"mapped",[14460]],[[194699,194699],"mapped",[24240]],[[194700,194700],"mapped",[24243]],[[194701,194701],"mapped",[24246]],[[194702,194702],"mapped",[24266]],[[194703,194703],"mapped",[172946]],[[194704,194704],"mapped",[24318]],[[194705,194706],"mapped",[140081]],[[194707,194707],"mapped",[33281]],[[194708,194709],"mapped",[24354]],[[194710,194710],"mapped",[14535]],[[194711,194711],"mapped",[144056]],[[194712,194712],"mapped",[156122]],[[194713,194713],"mapped",[24418]],[[194714,194714],"mapped",[24427]],[[194715,194715],"mapped",[14563]],[[194716,194716],"mapped",[24474]],[[194717,194717],"mapped",[24525]],[[194718,194718],"mapped",[24535]],[[194719,194719],"mapped",[24569]],[[194720,194720],"mapped",[24705]],[[194721,194721],"mapped",[14650]],[[194722,194722],"mapped",[14620]],[[194723,194723],"mapped",[24724]],[[194724,194724],"mapped",[141012]],[[194725,194725],"mapped",[24775]],[[194726,194726],"mapped",[24904]],[[194727,194727],"mapped",[24908]],[[194728,194728],"mapped",[24910]],[[194729,194729],"mapped",[24908]],[[194730,194730],"mapped",[24954]],[[194731,194731],"mapped",[24974]],[[194732,194732],"mapped",[25010]],[[194733,194733],"mapped",[24996]],[[194734,194734],"mapped",[25007]],[[194735,194735],"mapped",[25054]],[[194736,194736],"mapped",[25074]],[[194737,194737],"mapped",[25078]],[[194738,194738],"mapped",[25104]],[[194739,194739],"mapped",[25115]],[[194740,194740],"mapped",[25181]],[[194741,194741],"mapped",[25265]],[[194742,194742],"mapped",[25300]],[[194743,194743],"mapped",[25424]],[[194744,194744],"mapped",[142092]],[[194745,194745],"mapped",[25405]],[[194746,194746],"mapped",[25340]],[[194747,194747],"mapped",[25448]],[[194748,194748],"mapped",[25475]],[[194749,194749],"mapped",[25572]],[[194750,194750],"mapped",[142321]],[[194751,194751],"mapped",[25634]],[[194752,194752],"mapped",[25541]],[[194753,194753],"mapped",[25513]],[[194754,194754],"mapped",[14894]],[[194755,194755],"mapped",[25705]],[[194756,194756],"mapped",[25726]],[[194757,194757],"mapped",[25757]],[[194758,194758],"mapped",[25719]],[[194759,194759],"mapped",[14956]],[[194760,194760],"mapped",[25935]],[[194761,194761],"mapped",[25964]],[[194762,194762],"mapped",[143370]],[[194763,194763],"mapped",[26083]],[[194764,194764],"mapped",[26360]],[[194765,194765],"mapped",[26185]],[[194766,194766],"mapped",[15129]],[[194767,194767],"mapped",[26257]],[[194768,194768],"mapped",[15112]],[[194769,194769],"mapped",[15076]],[[194770,194770],"mapped",[20882]],[[194771,194771],"mapped",[20885]],[[194772,194772],"mapped",[26368]],[[194773,194773],"mapped",[26268]],[[194774,194774],"mapped",[32941]],[[194775,194775],"mapped",[17369]],[[194776,194776],"mapped",[26391]],[[194777,194777],"mapped",[26395]],[[194778,194778],"mapped",[26401]],[[194779,194779],"mapped",[26462]],[[194780,194780],"mapped",[26451]],[[194781,194781],"mapped",[144323]],[[194782,194782],"mapped",[15177]],[[194783,194783],"mapped",[26618]],[[194784,194784],"mapped",[26501]],[[194785,194785],"mapped",[26706]],[[194786,194786],"mapped",[26757]],[[194787,194787],"mapped",[144493]],[[194788,194788],"mapped",[26766]],[[194789,194789],"mapped",[26655]],[[194790,194790],"mapped",[26900]],[[194791,194791],"mapped",[15261]],[[194792,194792],"mapped",[26946]],[[194793,194793],"mapped",[27043]],[[194794,194794],"mapped",[27114]],[[194795,194795],"mapped",[27304]],[[194796,194796],"mapped",[145059]],[[194797,194797],"mapped",[27355]],[[194798,194798],"mapped",[15384]],[[194799,194799],"mapped",[27425]],[[194800,194800],"mapped",[145575]],[[194801,194801],"mapped",[27476]],[[194802,194802],"mapped",[15438]],[[194803,194803],"mapped",[27506]],[[194804,194804],"mapped",[27551]],[[194805,194805],"mapped",[27578]],[[194806,194806],"mapped",[27579]],[[194807,194807],"mapped",[146061]],[[194808,194808],"mapped",[138507]],[[194809,194809],"mapped",[146170]],[[194810,194810],"mapped",[27726]],[[194811,194811],"mapped",[146620]],[[194812,194812],"mapped",[27839]],[[194813,194813],"mapped",[27853]],[[194814,194814],"mapped",[27751]],[[194815,194815],"mapped",[27926]],[[194816,194816],"mapped",[27966]],[[194817,194817],"mapped",[28023]],[[194818,194818],"mapped",[27969]],[[194819,194819],"mapped",[28009]],[[194820,194820],"mapped",[28024]],[[194821,194821],"mapped",[28037]],[[194822,194822],"mapped",[146718]],[[194823,194823],"mapped",[27956]],[[194824,194824],"mapped",[28207]],[[194825,194825],"mapped",[28270]],[[194826,194826],"mapped",[15667]],[[194827,194827],"mapped",[28363]],[[194828,194828],"mapped",[28359]],[[194829,194829],"mapped",[147153]],[[194830,194830],"mapped",[28153]],[[194831,194831],"mapped",[28526]],[[194832,194832],"mapped",[147294]],[[194833,194833],"mapped",[147342]],[[194834,194834],"mapped",[28614]],[[194835,194835],"mapped",[28729]],[[194836,194836],"mapped",[28702]],[[194837,194837],"mapped",[28699]],[[194838,194838],"mapped",[15766]],[[194839,194839],"mapped",[28746]],[[194840,194840],"mapped",[28797]],[[194841,194841],"mapped",[28791]],[[194842,194842],"mapped",[28845]],[[194843,194843],"mapped",[132389]],[[194844,194844],"mapped",[28997]],[[194845,194845],"mapped",[148067]],[[194846,194846],"mapped",[29084]],[[194847,194847],"disallowed"],[[194848,194848],"mapped",[29224]],[[194849,194849],"mapped",[29237]],[[194850,194850],"mapped",[29264]],[[194851,194851],"mapped",[149000]],[[194852,194852],"mapped",[29312]],[[194853,194853],"mapped",[29333]],[[194854,194854],"mapped",[149301]],[[194855,194855],"mapped",[149524]],[[194856,194856],"mapped",[29562]],[[194857,194857],"mapped",[29579]],[[194858,194858],"mapped",[16044]],[[194859,194859],"mapped",[29605]],[[194860,194861],"mapped",[16056]],[[194862,194862],"mapped",[29767]],[[194863,194863],"mapped",[29788]],[[194864,194864],"mapped",[29809]],[[194865,194865],"mapped",[29829]],[[194866,194866],"mapped",[29898]],[[194867,194867],"mapped",[16155]],[[194868,194868],"mapped",[29988]],[[194869,194869],"mapped",[150582]],[[194870,194870],"mapped",[30014]],[[194871,194871],"mapped",[150674]],[[194872,194872],"mapped",[30064]],[[194873,194873],"mapped",[139679]],[[194874,194874],"mapped",[30224]],[[194875,194875],"mapped",[151457]],[[194876,194876],"mapped",[151480]],[[194877,194877],"mapped",[151620]],[[194878,194878],"mapped",[16380]],[[194879,194879],"mapped",[16392]],[[194880,194880],"mapped",[30452]],[[194881,194881],"mapped",[151795]],[[194882,194882],"mapped",[151794]],[[194883,194883],"mapped",[151833]],[[194884,194884],"mapped",[151859]],[[194885,194885],"mapped",[30494]],[[194886,194887],"mapped",[30495]],[[194888,194888],"mapped",[30538]],[[194889,194889],"mapped",[16441]],[[194890,194890],"mapped",[30603]],[[194891,194891],"mapped",[16454]],[[194892,194892],"mapped",[16534]],[[194893,194893],"mapped",[152605]],[[194894,194894],"mapped",[30798]],[[194895,194895],"mapped",[30860]],[[194896,194896],"mapped",[30924]],[[194897,194897],"mapped",[16611]],[[194898,194898],"mapped",[153126]],[[194899,194899],"mapped",[31062]],[[194900,194900],"mapped",[153242]],[[194901,194901],"mapped",[153285]],[[194902,194902],"mapped",[31119]],[[194903,194903],"mapped",[31211]],[[194904,194904],"mapped",[16687]],[[194905,194905],"mapped",[31296]],[[194906,194906],"mapped",[31306]],[[194907,194907],"mapped",[31311]],[[194908,194908],"mapped",[153980]],[[194909,194910],"mapped",[154279]],[[194911,194911],"disallowed"],[[194912,194912],"mapped",[16898]],[[194913,194913],"mapped",[154539]],[[194914,194914],"mapped",[31686]],[[194915,194915],"mapped",[31689]],[[194916,194916],"mapped",[16935]],[[194917,194917],"mapped",[154752]],[[194918,194918],"mapped",[31954]],[[194919,194919],"mapped",[17056]],[[194920,194920],"mapped",[31976]],[[194921,194921],"mapped",[31971]],[[194922,194922],"mapped",[32000]],[[194923,194923],"mapped",[155526]],[[194924,194924],"mapped",[32099]],[[194925,194925],"mapped",[17153]],[[194926,194926],"mapped",[32199]],[[194927,194927],"mapped",[32258]],[[194928,194928],"mapped",[32325]],[[194929,194929],"mapped",[17204]],[[194930,194930],"mapped",[156200]],[[194931,194931],"mapped",[156231]],[[194932,194932],"mapped",[17241]],[[194933,194933],"mapped",[156377]],[[194934,194934],"mapped",[32634]],[[194935,194935],"mapped",[156478]],[[194936,194936],"mapped",[32661]],[[194937,194937],"mapped",[32762]],[[194938,194938],"mapped",[32773]],[[194939,194939],"mapped",[156890]],[[194940,194940],"mapped",[156963]],[[194941,194941],"mapped",[32864]],[[194942,194942],"mapped",[157096]],[[194943,194943],"mapped",[32880]],[[194944,194944],"mapped",[144223]],[[194945,194945],"mapped",[17365]],[[194946,194946],"mapped",[32946]],[[194947,194947],"mapped",[33027]],[[194948,194948],"mapped",[17419]],[[194949,194949],"mapped",[33086]],[[194950,194950],"mapped",[23221]],[[194951,194951],"mapped",[157607]],[[194952,194952],"mapped",[157621]],[[194953,194953],"mapped",[144275]],[[194954,194954],"mapped",[144284]],[[194955,194955],"mapped",[33281]],[[194956,194956],"mapped",[33284]],[[194957,194957],"mapped",[36766]],[[194958,194958],"mapped",[17515]],[[194959,194959],"mapped",[33425]],[[194960,194960],"mapped",[33419]],[[194961,194961],"mapped",[33437]],[[194962,194962],"mapped",[21171]],[[194963,194963],"mapped",[33457]],[[194964,194964],"mapped",[33459]],[[194965,194965],"mapped",[33469]],[[194966,194966],"mapped",[33510]],[[194967,194967],"mapped",[158524]],[[194968,194968],"mapped",[33509]],[[194969,194969],"mapped",[33565]],[[194970,194970],"mapped",[33635]],[[194971,194971],"mapped",[33709]],[[194972,194972],"mapped",[33571]],[[194973,194973],"mapped",[33725]],[[194974,194974],"mapped",[33767]],[[194975,194975],"mapped",[33879]],[[194976,194976],"mapped",[33619]],[[194977,194977],"mapped",[33738]],[[194978,194978],"mapped",[33740]],[[194979,194979],"mapped",[33756]],[[194980,194980],"mapped",[158774]],[[194981,194981],"mapped",[159083]],[[194982,194982],"mapped",[158933]],[[194983,194983],"mapped",[17707]],[[194984,194984],"mapped",[34033]],[[194985,194985],"mapped",[34035]],[[194986,194986],"mapped",[34070]],[[194987,194987],"mapped",[160714]],[[194988,194988],"mapped",[34148]],[[194989,194989],"mapped",[159532]],[[194990,194990],"mapped",[17757]],[[194991,194991],"mapped",[17761]],[[194992,194992],"mapped",[159665]],[[194993,194993],"mapped",[159954]],[[194994,194994],"mapped",[17771]],[[194995,194995],"mapped",[34384]],[[194996,194996],"mapped",[34396]],[[194997,194997],"mapped",[34407]],[[194998,194998],"mapped",[34409]],[[194999,194999],"mapped",[34473]],[[195000,195000],"mapped",[34440]],[[195001,195001],"mapped",[34574]],[[195002,195002],"mapped",[34530]],[[195003,195003],"mapped",[34681]],[[195004,195004],"mapped",[34600]],[[195005,195005],"mapped",[34667]],[[195006,195006],"mapped",[34694]],[[195007,195007],"disallowed"],[[195008,195008],"mapped",[34785]],[[195009,195009],"mapped",[34817]],[[195010,195010],"mapped",[17913]],[[195011,195011],"mapped",[34912]],[[195012,195012],"mapped",[34915]],[[195013,195013],"mapped",[161383]],[[195014,195014],"mapped",[35031]],[[195015,195015],"mapped",[35038]],[[195016,195016],"mapped",[17973]],[[195017,195017],"mapped",[35066]],[[195018,195018],"mapped",[13499]],[[195019,195019],"mapped",[161966]],[[195020,195020],"mapped",[162150]],[[195021,195021],"mapped",[18110]],[[195022,195022],"mapped",[18119]],[[195023,195023],"mapped",[35488]],[[195024,195024],"mapped",[35565]],[[195025,195025],"mapped",[35722]],[[195026,195026],"mapped",[35925]],[[195027,195027],"mapped",[162984]],[[195028,195028],"mapped",[36011]],[[195029,195029],"mapped",[36033]],[[195030,195030],"mapped",[36123]],[[195031,195031],"mapped",[36215]],[[195032,195032],"mapped",[163631]],[[195033,195033],"mapped",[133124]],[[195034,195034],"mapped",[36299]],[[195035,195035],"mapped",[36284]],[[195036,195036],"mapped",[36336]],[[195037,195037],"mapped",[133342]],[[195038,195038],"mapped",[36564]],[[195039,195039],"mapped",[36664]],[[195040,195040],"mapped",[165330]],[[195041,195041],"mapped",[165357]],[[195042,195042],"mapped",[37012]],[[195043,195043],"mapped",[37105]],[[195044,195044],"mapped",[37137]],[[195045,195045],"mapped",[165678]],[[195046,195046],"mapped",[37147]],[[195047,195047],"mapped",[37432]],[[195048,195048],"mapped",[37591]],[[195049,195049],"mapped",[37592]],[[195050,195050],"mapped",[37500]],[[195051,195051],"mapped",[37881]],[[195052,195052],"mapped",[37909]],[[195053,195053],"mapped",[166906]],[[195054,195054],"mapped",[38283]],[[195055,195055],"mapped",[18837]],[[195056,195056],"mapped",[38327]],[[195057,195057],"mapped",[167287]],[[195058,195058],"mapped",[18918]],[[195059,195059],"mapped",[38595]],[[195060,195060],"mapped",[23986]],[[195061,195061],"mapped",[38691]],[[195062,195062],"mapped",[168261]],[[195063,195063],"mapped",[168474]],[[195064,195064],"mapped",[19054]],[[195065,195065],"mapped",[19062]],[[195066,195066],"mapped",[38880]],[[195067,195067],"mapped",[168970]],[[195068,195068],"mapped",[19122]],[[195069,195069],"mapped",[169110]],[[195070,195071],"mapped",[38923]],[[195072,195072],"mapped",[38953]],[[195073,195073],"mapped",[169398]],[[195074,195074],"mapped",[39138]],[[195075,195075],"mapped",[19251]],[[195076,195076],"mapped",[39209]],[[195077,195077],"mapped",[39335]],[[195078,195078],"mapped",[39362]],[[195079,195079],"mapped",[39422]],[[195080,195080],"mapped",[19406]],[[195081,195081],"mapped",[170800]],[[195082,195082],"mapped",[39698]],[[195083,195083],"mapped",[40000]],[[195084,195084],"mapped",[40189]],[[195085,195085],"mapped",[19662]],[[195086,195086],"mapped",[19693]],[[195087,195087],"mapped",[40295]],[[195088,195088],"mapped",[172238]],[[195089,195089],"mapped",[19704]],[[195090,195090],"mapped",[172293]],[[195091,195091],"mapped",[172558]],[[195092,195092],"mapped",[172689]],[[195093,195093],"mapped",[40635]],[[195094,195094],"mapped",[19798]],[[195095,195095],"mapped",[40697]],[[195096,195096],"mapped",[40702]],[[195097,195097],"mapped",[40709]],[[195098,195098],"mapped",[40719]],[[195099,195099],"mapped",[40726]],[[195100,195100],"mapped",[40763]],[[195101,195101],"mapped",[173568]],[[195102,196605],"disallowed"],[[196606,196607],"disallowed"],[[196608,262141],"disallowed"],[[262142,262143],"disallowed"],[[262144,327677],"disallowed"],[[327678,327679],"disallowed"],[[327680,393213],"disallowed"],[[393214,393215],"disallowed"],[[393216,458749],"disallowed"],[[458750,458751],"disallowed"],[[458752,524285],"disallowed"],[[524286,524287],"disallowed"],[[524288,589821],"disallowed"],[[589822,589823],"disallowed"],[[589824,655357],"disallowed"],[[655358,655359],"disallowed"],[[655360,720893],"disallowed"],[[720894,720895],"disallowed"],[[720896,786429],"disallowed"],[[786430,786431],"disallowed"],[[786432,851965],"disallowed"],[[851966,851967],"disallowed"],[[851968,917501],"disallowed"],[[917502,917503],"disallowed"],[[917504,917504],"disallowed"],[[917505,917505],"disallowed"],[[917506,917535],"disallowed"],[[917536,917631],"disallowed"],[[917632,917759],"disallowed"],[[917760,917999],"ignored"],[[918000,983037],"disallowed"],[[983038,983039],"disallowed"],[[983040,1048573],"disallowed"],[[1048574,1048575],"disallowed"],[[1048576,1114109],"disallowed"],[[1114110,1114111],"disallowed"]]')}};var __webpack_module_cache__={};function __nccwpck_require__(r){var i=__webpack_module_cache__[r];if(i!==undefined){return i.exports}var s=__webpack_module_cache__[r]={id:r,loaded:false,exports:{}};var a=true;try{__webpack_modules__[r].call(s.exports,s,s.exports,__nccwpck_require__);a=false}finally{if(a)delete __webpack_module_cache__[r]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.n=r=>{var i=r&&r.__esModule?()=>r["default"]:()=>r;__nccwpck_require__.d(i,{a:i});return i}})();(()=>{__nccwpck_require__.d=(r,i)=>{for(var s in i){if(__nccwpck_require__.o(i,s)&&!__nccwpck_require__.o(r,s)){Object.defineProperty(r,s,{enumerable:true,get:i[s]})}}}})();(()=>{__nccwpck_require__.o=(r,i)=>Object.prototype.hasOwnProperty.call(r,i)})();(()=>{__nccwpck_require__.r=r=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(r,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=r=>{r.paths=[];if(!r.children)r.children=[];return r}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var r=__nccwpck_require__(44079);var i=__nccwpck_require__.n(r);var s=__nccwpck_require__(92481);var a=__nccwpck_require__.n(s);var l=__nccwpck_require__(38453);var c=__nccwpck_require__.n(l);var d=__nccwpck_require__(3448);var p=__nccwpck_require__.n(d);var u=__nccwpck_require__(18619);var A=__nccwpck_require__.n(u);var h=undefined&&undefined.__awaiter||function(r,i,s,a){function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}return new(s||(s=Promise))((function(s,l){function fulfilled(r){try{step(a.next(r))}catch(r){l(r)}}function rejected(r){try{step(a["throw"](r))}catch(r){l(r)}}function step(r){r.done?s(r.value):adopt(r.value).then(fulfilled,rejected)}step((a=a.apply(r,i||[])).next())}))};const g={darwin:{updater:{bundle:"macos",bundleExt:"app",archiveExt:"tar.gz"},standalone:[{ext:"dmg",bundle:"dmg"}]},windows:{updater:{bundle:"msi",bundleExt:"msi",archiveExt:"zip"},standalone:[{ext:"msi",bundle:"msi"}]},linux:{updater:false,standalone:[{ext:"deb",bundle:"deb"}]}};const y=s.getInput("os");const b=s.getInput("arch");const w=s.getInput("target");const C=s.getInput("profile");const v=`target/${w}/${C}/bundle`;const I=".artifacts";const B=`Spacedrive-${y}-${b}`;const S="apps/desktop/dist.tar.xz";const x=`Spacedrive-Updater-${y}-${b}`;const R=`Spacedrive-frontend-${y}-${b}`;function globFiles(r){return h(this,void 0,void 0,(function*(){const i=yield l.create(r);return yield i.glob()}))}function uploadFrontend(){return h(this,void 0,void 0,(function*(){if(!(yield(0,u.exists)(S))){console.error(`Frontend archive not found`);return}yield i().uploadArtifact(R,[S],"apps/desktop")}))}function uploadUpdater(r){return h(this,void 0,void 0,(function*(){if(!r)return;const{bundle:s,bundleExt:a,archiveExt:l}=r;const c=`${a}.${l}`;const p=yield globFiles(`${v}/${s}/*.${c}*`);const u=p.find((r=>r.endsWith(c)));if(!u)throw new Error(`Updater path not found. Files: ${p}`);const A=`${I}/${x}.${l}`;yield d.cp(u,A);yield d.cp(`${u}.sig`,`${A}.sig`);yield i().uploadArtifact(x,[A,`${A}.sig`],I)}))}function uploadStandalone(r){return h(this,arguments,void 0,(function*({bundle:r,ext:s}){const a=yield globFiles(`${v}/${r}/*.${s}*`);const l=a.find((r=>r.endsWith(s)));if(!l)throw new Error(`Standalone path not found. Files: ${a}`);const c=`${B}.${s}`;const p=`${I}/${c}`;yield d.cp(l,p,{recursive:true});yield i().uploadArtifact(c,[p],I)}))}function run(){return h(this,void 0,void 0,(function*(){yield d.mkdirP(I);const{updater:r,standalone:i}=g[y];yield Promise.all([uploadUpdater(r),uploadFrontend(),...i.map((r=>uploadStandalone(r)))])}))}run()})();module.exports=__webpack_exports__})(); \ No newline at end of file diff --git a/.github/actions/publish-artifacts/index.ts b/.github/actions/publish-artifacts/index.ts index 72bc9f991..1896f8247 100644 --- a/.github/actions/publish-artifacts/index.ts +++ b/.github/actions/publish-artifacts/index.ts @@ -2,12 +2,13 @@ import client from '@actions/artifact'; import * as core from '@actions/core'; import * as glob from '@actions/glob'; import * as io from '@actions/io'; +import { exists } from '@actions/io/lib/io-util'; type OS = 'darwin' | 'windows' | 'linux'; type Arch = 'x64' | 'arm64'; type TargetConfig = { bundle: string; ext: string }; type BuildTarget = { - updater: { bundle: string; bundleExt: string; archiveExt: string }; + updater: false | { bundle: string; bundleExt: string; archiveExt: string }; standalone: Array; }; @@ -29,15 +30,8 @@ const OS_TARGETS = { standalone: [{ ext: 'msi', bundle: 'msi' }] }, linux: { - updater: { - bundle: 'appimage', - bundleExt: 'AppImage', - archiveExt: 'tar.gz' - }, - standalone: [ - { ext: 'deb', bundle: 'deb' }, - { ext: 'AppImage', bundle: 'appimage' } - ] + updater: false, + standalone: [{ ext: 'deb', bundle: 'deb' }] } } satisfies Record; @@ -50,19 +44,32 @@ const PROFILE = core.getInput('profile'); const BUNDLE_DIR = `target/${TARGET}/${PROFILE}/bundle`; const ARTIFACTS_DIR = '.artifacts'; const ARTIFACT_BASE = `Spacedrive-${OS}-${ARCH}`; +const FRONT_END_BUNDLE = 'apps/desktop/dist.tar.xz'; const UPDATER_ARTIFACT_NAME = `Spacedrive-Updater-${OS}-${ARCH}`; +const FRONTEND_ARCHIVE_NAME = `Spacedrive-frontend-${OS}-${ARCH}`; async function globFiles(pattern: string) { const globber = await glob.create(pattern); return await globber.glob(); } -async function uploadUpdater({ bundle, bundleExt, archiveExt }: BuildTarget['updater']) { +async function uploadFrontend() { + if (!(await exists(FRONT_END_BUNDLE))) { + console.error(`Frontend archive not found`); + return; + } + + await client.uploadArtifact(FRONTEND_ARCHIVE_NAME, [FRONT_END_BUNDLE], 'apps/desktop'); +} + +async function uploadUpdater(updater: BuildTarget['updater']) { + if (!updater) return; + const { bundle, bundleExt, archiveExt } = updater; const fullExt = `${bundleExt}.${archiveExt}`; const files = await globFiles(`${BUNDLE_DIR}/${bundle}/*.${fullExt}*`); const updaterPath = files.find((file) => file.endsWith(fullExt)); - if (!updaterPath) return console.error(`Updater path not found. Files: ${files}`); + if (!updaterPath) throw new Error(`Updater path not found. Files: ${files}`); const artifactPath = `${ARTIFACTS_DIR}/${UPDATER_ARTIFACT_NAME}.${archiveExt}`; @@ -81,7 +88,7 @@ async function uploadStandalone({ bundle, ext }: TargetConfig) { const files = await globFiles(`${BUNDLE_DIR}/${bundle}/*.${ext}*`); const standalonePath = files.find((file) => file.endsWith(ext)); - if (!standalonePath) return console.error(`Standalone path not found. Files: ${files}`); + if (!standalonePath) throw new Error(`Standalone path not found. Files: ${files}`); const artifactName = `${ARTIFACT_BASE}.${ext}`; const artifactPath = `${ARTIFACTS_DIR}/${artifactName}`; @@ -95,10 +102,10 @@ async function run() { const { updater, standalone } = OS_TARGETS[OS]; - await uploadUpdater(updater); - - for (const config of standalone) { - await uploadStandalone(config); - } + await Promise.all([ + uploadUpdater(updater), + uploadFrontend(), + ...standalone.map((config) => uploadStandalone(config)) + ]); } run(); diff --git a/.github/actions/publish-artifacts/package.json b/.github/actions/publish-artifacts/package.json index cbfb85c8b..124890dd7 100644 --- a/.github/actions/publish-artifacts/package.json +++ b/.github/actions/publish-artifacts/package.json @@ -7,7 +7,7 @@ "lint": "eslint . --cache" }, "dependencies": { - "@actions/artifact": "^2.1.3", + "@actions/artifact": "^2.1.7", "@actions/core": "^1.10.1", "@actions/glob": "^0.4.0", "@actions/io": "^1.1.3" diff --git a/.github/actions/setup-pnpm/action.yml b/.github/actions/setup-pnpm/action.yml index d2a7ce373..89cda1ffc 100644 --- a/.github/actions/setup-pnpm/action.yml +++ b/.github/actions/setup-pnpm/action.yml @@ -8,14 +8,10 @@ inputs: runs: using: 'composite' steps: - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - name: Install pnpm uses: pnpm/action-setup@v3 with: - version: 8.x.x + version: 9.0.6 - name: Install Node.js uses: actions/setup-node@v4 diff --git a/.github/actions/setup-rust/action.yaml b/.github/actions/setup-rust/action.yaml index a4aa92a09..844ebe49f 100644 --- a/.github/actions/setup-rust/action.yaml +++ b/.github/actions/setup-rust/action.yaml @@ -17,10 +17,9 @@ runs: steps: - name: Install Rust id: toolchain - uses: dtolnay/rust-toolchain@stable + uses: IronCoreLabs/rust-toolchain@v1 with: target: ${{ inputs.target }} - toolchain: '1.75' components: clippy, rustfmt - name: Cache Rust Dependencies @@ -35,27 +34,6 @@ runs: shell: bash run: echo '{}' | npx -y mustache - .cargo/config.toml.mustache .cargo/config.toml - - name: Turn Off Debuginfo and bump opt-level - shell: bash - if: ${{ runner.os != 'Windows' }} - run: | - sed '/\[profile.dev]/a\ - debug = 0 - ' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml - - sed '/\[profile.dev]/a\ - opt-level=1 - ' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml - - - name: Turn Off Debuginfo and bump opt-level - if: ${{ runner.os == 'Windows' }} - shell: powershell - run: | - (Get-Content Cargo.toml) -replace '\[profile.dev\]', '[profile.dev] - debug = 0' | Set-Content Cargo.toml - (Get-Content Cargo.toml) -replace '\[profile.dev\]', '[profile.dev] - opt-level=1' | Set-Content Cargo.toml - - name: Restore cached Prisma codegen id: cache-prisma-restore uses: actions/cache/restore@v4 diff --git a/.github/actions/setup-system/action.yml b/.github/actions/setup-system/action.yml index fba10941e..d6287844f 100644 --- a/.github/actions/setup-system/action.yml +++ b/.github/actions/setup-system/action.yml @@ -62,12 +62,14 @@ runs: shell: bash if: ${{ runner.os == 'Linux' }} run: | - dpkg -l | grep i386 - sudo apt-get purge --allow-remove-essential libc6-i386 ".*:i386" - sudo dpkg --remove-architecture i386 + set -eux + if dpkg -l | grep i386; then + sudo apt-get purge --allow-remove-essential libc6-i386 ".*:i386" || true + sudo dpkg --remove-architecture i386 || true + fi # https://github.com/actions/runner-images/issues/9546#issuecomment-2014940361 - sudo apt-get remove libunwind-* + sudo apt-get remove libunwind-* || true - name: Setup Rust and Dependencies uses: ./.github/actions/setup-rust diff --git a/.github/workflows/cache-factory.yaml b/.github/workflows/cache-factory.yaml index 0aebf089a..9a0e7a6ba 100644 --- a/.github/workflows/cache-factory.yaml +++ b/.github/workflows/cache-factory.yaml @@ -40,18 +40,21 @@ jobs: target: x86_64-pc-windows-msvc # - host: windows-latest # target: aarch64-pc-windows-msvc - - host: ubuntu-20.04 + - host: ubuntu-22.04 target: x86_64-unknown-linux-gnu - # - host: ubuntu-20.04 + # - host: ubuntu-22.04 # target: x86_64-unknown-linux-musl - # - host: ubuntu-20.04 + # - host: uubuntu-22.04 # target: aarch64-unknown-linux-gnu - # - host: ubuntu-20.04 + # - host: ubuntu-22.04 # target: aarch64-unknown-linux-musl - # - host: ubuntu-20.04 + # - host: ubuntu-22.04 # target: armv7-unknown-linux-gnueabihf name: 'Make Cache' runs-on: ${{ matrix.settings.host }} + if: github.repository == 'spacedriveapp/spacedrive' + permissions: {} + timeout-minutes: 150 # 2.5 hours steps: - name: Maximize build space if: ${{ runner.os == 'Linux' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f6e408c4..689c7202f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,10 @@ concurrency: jobs: typescript: - name: TypeScript - runs-on: ubuntu-latest + name: Type and style check + runs-on: ubuntu-22.04 + timeout-minutes: 7 + permissions: {} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -34,9 +36,20 @@ jobs: - name: Perform typechecks run: pnpm typecheck + - name: Perform style check + run: |- + set -eux + pnpm autoformat only-frontend + if [ -n "$(git diff --name-only --cached)" ]; then + echo "Some files are not correctly formatted. Please run 'pnpm autoformat' and commit the changes." >&2 + exit 1 + fi + eslint: name: ESLint - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + permissions: {} + timeout-minutes: 5 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -52,6 +65,8 @@ jobs: cypress: name: Cypress runs-on: macos-14 + timeout-minutes: 45 + permissions: {} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -67,6 +82,13 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} + - name: Install Cypress + run: | + set -euxo pipefail + pnpm exec cypress install + rm -rf /Users/runner/.cache/Cypress + ln -sf /Users/runner/Library/Caches/Cypress /Users/runner/.cache/Cypress + - name: Setup Cypress uses: cypress-io/github-action@v6 with: @@ -84,14 +106,16 @@ jobs: command: env CI=true pnpm test:e2e working-directory: apps/web - - uses: actions/upload-artifact@v4 + - name: Upload cypress screenshots + uses: actions/upload-artifact@v4 if: always() with: name: cypress-screenshots path: apps/web/cypress/screenshots if-no-files-found: ignore - - uses: actions/upload-artifact@v4 + - name: Upload cypress video's + uses: actions/upload-artifact@v4 if: always() with: name: cypress-videos @@ -100,7 +124,10 @@ jobs: rustfmt: name: Rust Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + timeout-minutes: 10 + permissions: + contents: read steps: - name: Maximize build space if: ${{ runner.os == 'Linux' }} @@ -118,12 +145,17 @@ jobs: shell: powershell run: | New-Item -ItemType Directory -Force -Path C:\spacedrive_target + - name: Symlink target to C:\ + if: ${{ runner.os == 'Windows' }} + shell: powershell + run: | New-Item -Path target -ItemType Junction -Value C:\spacedrive_target - name: Checkout repository uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 + - name: Check if files have changed + uses: dorny/paths-filter@v3 continue-on-error: true id: filter with: @@ -151,11 +183,23 @@ jobs: run: cargo fmt --all -- --check clippy: - name: Clippy (${{ matrix.platform }}) - runs-on: ${{ matrix.platform }} strategy: + fail-fast: true matrix: - platform: [ubuntu-20.04, macos-14, windows-latest] + settings: + - host: macos-13 + target: x86_64-apple-darwin + - host: macos-14 + target: aarch64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + - host: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + name: Clippy (${{ matrix.settings.host }}) + runs-on: ${{ matrix.settings.host }} + permissions: + contents: read + timeout-minutes: 45 steps: - name: Maximize build space if: ${{ runner.os == 'Linux' }} @@ -178,7 +222,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 + - name: Find files that have changed + uses: dorny/paths-filter@v3 continue-on-error: true id: filter with: @@ -196,6 +241,7 @@ jobs: - 'extensions/*/**' - 'Cargo.toml' - 'Cargo.lock' + - '.github/workflows/ci.yml' - name: Setup System and Rust if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true' @@ -205,22 +251,15 @@ jobs: - name: Run Clippy if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true' - uses: actions-rs-plus/clippy-check@v2 + uses: giraffate/clippy-action@v1 with: - args: --workspace --all-features --locked + reporter: github-pr-review + tool_name: 'Clippy (${{ matrix.settings.host }})' + filter_mode: diff_context + github_token: ${{ secrets.GITHUB_TOKEN }} + clippy_flags: --workspace --all-features --locked + fail_on_error: true - # test: - # name: Test (${{ matrix.platform }}) - # runs-on: ${{ matrix.platform }} - # strategy: - # matrix: - # platform: [ubuntu-20.04, macos-latest, windows-latest] - # steps: - # - name: Checkout repository - # uses: actions/checkout@v4 - # - # - name: Setup - # uses: ./.github/actions/setup - # - # - name: Test - # run: cargo test --workspace --all-features + # - name: Run tests + # if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true' + # run: cargo test --workspace --all-features --locked --target ${{ matrix.settings.target }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47b20eb9d..0b91ca579 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,10 @@ name: Release on: + pull_request: + paths: + - '.github/workflows/release.yml' workflow_dispatch: -# NOTE: For Linux builds, we can only build with Ubuntu. It should be the oldest base system we intend to support. See PR-759 & https://tauri.app/v1/guides/building/linux for reference. # From: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/release.yaml#L13-L21 env: @@ -32,17 +34,17 @@ jobs: arch: x86_64 # - host: windows-latest # target: aarch64-pc-windows-msvc - - host: ubuntu-20.04 + - host: ubuntu-22.04 target: x86_64-unknown-linux-gnu bundles: deb os: linux arch: x86_64 - # - host: ubuntu-20.04 + # - host: ubuntu-22.04 # target: x86_64-unknown-linux-musl - # - host: ubuntu-20.04 + # - host: ubuntu-22.04 # target: aarch64-unknown-linux-gnu # bundles: deb - # - host: ubuntu-20.04 + # - host: ubuntu-22.04 # target: aarch64-unknown-linux-musl name: Desktop - Main ${{ matrix.settings.target }} runs-on: ${{ matrix.settings.host }} @@ -101,8 +103,8 @@ jobs: run: | pnpm tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }},updater env: - TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} @@ -112,15 +114,11 @@ jobs: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: Build AppImage in Docker - if: ${{ runner.os == 'Linux' && ( matrix.settings.target == 'x86_64-unknown-linux-gnu' || matrix.settings.target == 'aarch64-unknown-linux-gnu' ) }} + - name: Package frontend + if: ${{ runner.os == 'Linux' }} run: | - set -euxo pipefail - docker run --rm -v $(pwd):/srv -e 'CI=true' -e 'TARGET=${{ matrix.settings.target }}' -w /srv debian:bookworm scripts/appimage/build_appimage.sh - cd 'target/${{ matrix.settings.target }}/release/bundle/appimage' - sudo chown "$(id -u):$(id -g)" -R . - tar -czf Updater.AppImage.tar.gz *.AppImage - pnpm tauri signer sign -k '${{ secrets.TAURI_PRIVATE_KEY }}' -p '${{ secrets.TAURI_KEY_PASSWORD }}' "$(pwd)/Updater.AppImage.tar.gz" + set -eux + XZ_OPT='-T0 -7' tar -cJf apps/desktop/dist.tar.xz -C apps/desktop/dist . - name: Publish Artifacts uses: ./.github/actions/publish-artifacts diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 335095898..7279d97e2 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -3,6 +3,10 @@ name: Server release on: release: types: [published] + pull_request: + paths: + - '.github/workflows/server.yml' + - 'apps/server/docker/*' workflow_dispatch: jobs: @@ -27,16 +31,56 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + + - name: Update Podman & crun + run: | + sudo apt-get remove crun podman + brew install crun podman + - name: Update buildah shell: bash run: | + set -euxo pipefail wget -O- 'https://github.com/HeavenVolkoff/buildah-static/releases/latest/download/buildah-amd64.tar.gz' \ | sudo tar -xzf- -C /usr/local/bin + - name: Install netavark + shell: bash + run: | + set -euxo pipefail + sudo mkdir -p /usr/local/lib/podman + sudo wget -O- 'https://github.com/containers/netavark/releases/latest/download/netavark.gz' \ + | gunzip | sudo dd status=none of=/usr/local/lib/podman/netavark + sudo chmod +x /usr/local/lib/podman/netavark + + - name: Install passt + shell: bash + working-directory: /tmp + run: | + set -euxo pipefail + + deb="$( + curl -SsL https://passt.top/builds/latest/x86_64 \ + | grep -oP 'passt[^\.<>'\''"]+\.deb' | sort -u | head -n1 + )" + + curl -SsJLO "https://passt.top/builds/latest/x86_64/${deb}" + sudo dpkg -i "${deb}" + + - name: Basic sanity check + run: | + crun --version + podman version + buildah --version + - name: Determine image name & tag id: image_info shell: bash run: | + set -euxo pipefail if [ "$GITHUB_EVENT_NAME" == "release" ]; then IMAGE_TAG="${GITHUB_REF##*/}" else @@ -52,10 +96,14 @@ jobs: echo "repo=${GITHUB_REPOSITORY}" >> "$GITHUB_OUTPUT" echo "repo_ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT" + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: 'arm64' + - name: Build image id: build-image - # TODO: Change to stable version when available - uses: redhat-actions/buildah-build@c79846fb306beeba490e89fb75d2d1af95831e79 + uses: redhat-actions/buildah-build@v2 with: tags: ${{ steps.image_info.outputs.tag }} ${{ github.event_name == 'release' && 'latest' || 'staging' }} archs: amd64 @@ -69,9 +117,7 @@ jobs: ./apps/server/docker/Dockerfile - name: Push image to ghcr.io - # TODO: Restore redhat-actions/push-to-registry after PR is merged: - # https://github.com/redhat-actions/push-to-registry/pull/93 - uses: Eusebiotrigo/push-to-registry@5acfa470857b62a053884f7214581d55ffeb54ac + uses: redhat-actions/push-to-registry@v2 with: tags: ${{ steps.build-image.outputs.tags }} image: ${{ steps.build-image.outputs.image }} diff --git a/.npmrc b/.npmrc index 7bad4d0fe..b40bf051f 100644 --- a/.npmrc +++ b/.npmrc @@ -1,10 +1,9 @@ ; make all engine requirements (e.g. node version) strictly kept engine-strict=true -; tempfix for pnpm#5909: https://github.com/pnpm/pnpm/issues/5909#issuecomment-1397758156 -prefer-symlinked-executables=false ; necessary for metro + mobile strict-peer-dependencies=false node-linker=hoisted auto-install-peers=true max-old-space-size=4096 enable-pre-post-scripts=true +package-manager-strict=false diff --git a/.vscode/i18n-ally-reviews.yml b/.vscode/i18n-ally-reviews.yml new file mode 100644 index 000000000..6295c3a91 --- /dev/null +++ b/.vscode/i18n-ally-reviews.yml @@ -0,0 +1,115 @@ +# Review comments generated by i18n-ally. Please commit this file. + +reviews: + about_vision_text: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: OS2GadFYJi0w8WbQ1KpUe + type: approve + comment: 疑似翻译腔。这个地方不太好译。 + time: '2024-04-16T02:03:55.931Z' + all_jobs_have_been_cleared: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: hwThsx7VP-THpRXov2MB6 + type: comment + comment: 要不要把“清除”改为“完成”? + time: '2024-04-16T10:56:22.929Z' + archive_info: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: pW79_SMSNiOyRj94kdSZO + type: comment + comment: 不太通顺。“位置”是否要加定语修饰? + time: '2024-04-16T11:03:10.218Z' + changelog_page_description: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: JN3YruMypxX5wuaMjD8Hu + type: comment + comment: 口语化显得更自然些。 + time: '2024-04-16T11:05:27.478Z' + clouds: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: ebAW-cnfA4llVgee6CRmF + type: comment + comment: 一个字太少。 + time: '2024-04-16T11:06:06.594Z' + coordinates: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: HJLIcCmrHV1ZwCsAJOSiS + type: comment + comment: 有可能应该改成“地理坐标”。 + time: '2024-04-16T11:07:21.331Z' + create_library_description: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: N01f9vhjfYidHDnkhVV4o + type: comment + comment: >- + “libraries are + databases”这一句并不容易翻译,这里把英文原文放上去的方式我觉得并不妥当,但是我想不到更好的译法了。定语往后放到谓语的位置。同时添加必要的助词。 + time: '2024-04-16T11:13:48.568Z' + create_new_library_description: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: Wb89DhKwsCB9vGBDUIgsj + type: comment + comment: 见“create_library_description”。 + time: '2024-04-16T11:14:21.837Z' + creating_your_library: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: 6q9xmFoeVizgSTBbBey9O + type: comment + comment: “您的库”是典型的翻译腔。 + time: '2024-04-16T11:15:52.949Z' + delete_warning: + locales: + zh-CN: + comments: + - user: + name: Heavysnowjakarta + email: heavysnowjakarta@gmail.com + id: 5oa5lvp8PkJDRceIenfne + type: comment + comment: 我不确定 `{{type}}` 是中文还是英文。如果是英文,前面应该加空格。 + time: '2024-04-16T11:24:52.250Z' diff --git a/.vscode/launch.json b/.vscode/launch.json index 6ae503123..df88b7c03 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,9 +11,9 @@ "cargo": { "args": [ "build", + "--profile=dev-debug", "--manifest-path=./apps/desktop/src-tauri/Cargo.toml", - "--no-default-features", - "--features=ai-models" + "--no-default-features" ], "problemMatcher": "$rustc" }, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2a7510da5..a81b441ce 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -56,8 +56,7 @@ "command": "run", "args": [ "--manifest-path=./apps/desktop/src-tauri/Cargo.toml", - "--no-default-features", - "--features=ai-models" + "--no-default-features" ], "env": { "RUST_BACKTRACE": "short" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0acb68468..5f18dec67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,14 +89,16 @@ To run the landing page: If you encounter any issues, ensure that you are using the following versions of Rust, Node and Pnpm: -- Rust version: **1.75** +- Rust version: **1.78** - Node version: **18.18** -- Pnpm version: **8.15** +- Pnpm version: **9.1.1** After cleaning out your build artifacts using `pnpm clean`, `git clean`, or `cargo clean`, it is necessary to re-run the `setup-system` script. Make sure to read the [guidelines](https://spacedrive.com/docs/developers/prerequisites/guidelines) to ensure that your code follows a similar style to ours. +After you finish making your changes and committed them to your branch, make sure to execute `pnpm autoformat` to fix any style inconsistency in your code. + ##### Mobile App To run the mobile app: @@ -120,10 +122,6 @@ To run the mobile app: - `xcrun simctl launch --console booted com.spacedrive.app` allows you to view the console output of the iOS app from `tracing`. However, the application must be built in `debug` mode for this. - `pnpm mobile start` (runs the metro bundler only) -##### AppImage - -Specific instructions on how to build an AppImage release are located [here](scripts/appimage/README.md) - ### Pull Request Once you have finished making your changes, create a pull request (PR) to submit them. @@ -169,27 +167,9 @@ Once that has completed, run `xcode-select --install` in the terminal to install Also ensure that Rosetta is installed, as a few of our dependencies require it. You can install Rosetta with `softwareupdate --install-rosetta --agree-to-license`. -#### `ModuleNotFoundError: No module named 'distutils'` +### Translations -If you run into this issue, or some other error involving `node-gyp`: - -``` -File "pnpm@8.15.6/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py", line 42, in - import gyp # noqa: E402 - ^^^^^^^^^^ -File "pnpm@8.15.6/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in - import gyp.input -File "pnpm@8.15.6/node_modules/pnpm/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in - from distutils.version import StrictVersion -``` - -Some pnpm dependencies require compilation steps that depend on Python to execute. -However, a recent change in Python version 3.12 broke the utility used to bridge these compilation steps to node/npm/pnpm. - -Currently, there is no definitive solution to this issue due to it being fairly new. But there are two workarounds: - -1. Downgrade your system Python version to 3.11 or lower. -2. Update pnpm to version v9.0.0-rc.0 (Release Candidate, not fully stable yet). +Check out the [i18n README](interface/locales/README.md) for more information on how to contribute to translations. ### Credits diff --git a/Cargo.lock b/Cargo.lock index 6f1c61d30..c72a64fb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -29,30 +29,18 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ - "crypto-common 0.1.6", + "crypto-common", "generic-array 0.14.7", ] [[package]] name = "aes" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug", -] - -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] @@ -63,49 +51,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", - "aes 0.8.3", - "cipher 0.4.4", + "aes", + "cipher", "ctr", "ghash", "subtle", ] -[[package]] -name = "aes-gcm-siv" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" -dependencies = [ - "aead", - "aes 0.8.3", - "cipher 0.4.4", - "ctr", - "polyval", - "subtle", - "zeroize", -] - [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.32", + "zerocopy", ] [[package]] @@ -119,13 +92,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -143,9 +122,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -162,55 +141,50 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -218,31 +192,25 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.76" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] -name = "aovec" -version = "1.1.0" +name = "arbitrary" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6cfde8df73bd42d9bcbfd8fa4578d4d2a37512efe0436351739e025ab791cd9" -dependencies = [ - "parking_lot 0.4.8", - "smallvec 0.4.5", -] +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] -name = "argon2" -version = "0.6.0-pre.0" +name = "arg_enum_proc_macro" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c799111f751be3d73409b0b9e4160b0c69389216a66c463797eee5b243f7ef" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ - "base64ct", - "blake2 0.11.0-pre.3", - "cpufeatures", - "password-hash", - "zeroize", + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -256,9 +224,6 @@ name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -dependencies = [ - "zeroize", -] [[package]] name = "ascii" @@ -266,6 +231,32 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" +[[package]] +name = "ash" +version = "0.37.3+1.3.251" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +dependencies = [ + "libloading 0.7.4", +] + +[[package]] +name = "ashpd" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd884d7c72877a94102c3715f3b1cd09ff4fac28221add3e57cfbe25c236d093" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "rand 0.8.5", + "serde", + "serde_repr", + "tokio", + "url", + "zbus", +] + [[package]] name = "asn1-rs" version = "0.5.2" @@ -291,7 +282,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -307,22 +298,23 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.5.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ - "event-listener 2.5.3", + "event-listener", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-channel" -version = "2.1.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 4.0.1", "event-listener-strategy", "futures-core", "pin-project-lite", @@ -330,38 +322,18 @@ dependencies = [ [[package]] name = "async-io" -version = "1.13.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" -dependencies = [ - "async-lock 3.3.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "parking", - "polling 3.3.2", - "rustix 0.38.31", + "polling 3.7.1", + "rustix", "slab", "tracing", "windows-sys 0.52.0", @@ -369,68 +341,62 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.8.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-process" -version = "1.8.1" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", + "async-channel", + "async-io", + "async-lock", "async-signal", + "async-task", "blocking", "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.31", - "windows-sys 0.48.0", + "event-listener", + "futures-lite 2.3.0", + "rustix", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "async-recursion" -version = "1.0.5" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" dependencies = [ - "async-io 2.3.0", - "async-lock 2.8.0", + "async-io", + "async-lock", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.31", + "rustix", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -452,24 +418,24 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -501,26 +467,25 @@ dependencies = [ [[package]] name = "atk" -version = "0.15.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" dependencies = [ "atk-sys", - "bitflags 1.3.2", "glib", "libc", ] [[package]] name = "atk-sys" -version = "0.15.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps", ] [[package]] @@ -544,25 +509,47 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" dependencies = [ - "http", + "http 0.2.12", "log", "url", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" +dependencies = [ + "arrayvec", +] [[package]] name = "aws-config" -version = "1.0.3" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004dc45f6b869e6a70725df448004a720b7f52f6607d55d8815cbd5448f86def" +checksum = "2ac9889352d632214df943e26740c46a0f3da6e329fbd28164fe7ae1b061da7b" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-sdk-sso", "aws-sdk-ssooidc", @@ -575,22 +562,23 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.0.1", + "fastrand 2.1.0", "hex", - "http", - "hyper", - "ring 0.17.7", + "http 0.2.12", + "hyper 0.14.29", + "ring 0.17.8", "time", "tokio", "tracing", + "url", "zeroize", ] [[package]] name = "aws-credential-types" -version = "1.0.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa51c87f10211f37cd78e6d01d6f18b3f96a086906ed361d11e04ac53e29508" +checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -598,30 +586,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "aws-http" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361c4310fdce94328cc2d1ca0c8a48c13f43009c61d3367585685a50ca8c66b6" -dependencies = [ - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "http-body", - "pin-project-lite", - "tracing", -] - [[package]] name = "aws-runtime" -version = "1.0.3" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0953f7fc1c4428511345e28ea3e98c8b59c9e91eafae30bf76d71d70642693" +checksum = "75588e7ee5e8496eed939adac2035a6dbab9f7eb2acdd9ab2d31856dab6f3955" dependencies = [ "aws-credential-types", - "aws-http", "aws-sigv4", "aws-smithy-async", "aws-smithy-eventstream", @@ -629,21 +600,24 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", - "fastrand 2.0.1", - "http", + "bytes", + "fastrand 2.1.0", + "http 0.2.12", + "http-body 0.4.6", "percent-encoding", + "pin-project-lite", "tracing", "uuid", ] [[package]] name = "aws-sdk-s3" -version = "1.5.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "959a7325827d882819a2ac77e27e26626b9713b9cfec44686785e0db6e73388f" +checksum = "724119d8fd2d2638b9979673f3b5c2979fa388c9ca27815e3cb5ad6234fac3f5" dependencies = [ + "ahash 0.8.11", "aws-credential-types", - "aws-http", "aws-runtime", "aws-sigv4", "aws-smithy-async", @@ -657,23 +631,27 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", - "http", - "http-body", + "fastrand 2.1.0", + "hex", + "hmac", + "http 0.2.12", + "http-body 0.4.6", + "lru 0.12.3", "once_cell", "percent-encoding", - "regex", + "regex-lite", + "sha2 0.10.8", "tracing", "url", ] [[package]] name = "aws-sdk-sso" -version = "1.4.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e0b81eaef9eb951061b5a58f660815430e3f04eacaa4b2318e7474b0b7cbf17" +checksum = "da75cf91cbb46686a27436d639a720a3a198b148efa76dc2467b7e5374a67fc0" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-smithy-async", "aws-smithy-http", @@ -683,19 +661,19 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http", - "regex", + "http 0.2.12", + "once_cell", + "regex-lite", "tracing", ] [[package]] name = "aws-sdk-ssooidc" -version = "1.4.0" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e322a916694038a7972a3bb12181151c1645914443a2c3be6379b27533bbb99" +checksum = "cf2ec8a6687299685ed0a4a3137c129cdb132b5235bc3aa3443f6cffe468b9ff" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-smithy-async", "aws-smithy-http", @@ -705,19 +683,19 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http", - "regex", + "http 0.2.12", + "once_cell", + "regex-lite", "tracing", ] [[package]] name = "aws-sdk-sts" -version = "1.4.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbee86e8d9b1be709bd0f38b9ab3f196e39b0b6f3262a0a919a9d30f25debd94" +checksum = "458f1031e094b1411b59b49b19e4118f069e1fe13a9c5b8888e933daaf7ffdd6" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-smithy-async", "aws-smithy-http", @@ -728,16 +706,17 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "http", - "regex", + "http 0.2.12", + "once_cell", + "regex-lite", "tracing", ] [[package]] name = "aws-sigv4" -version = "1.0.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bcbad6e0f130232b22e4b4e28834348ce5b79c23b5059b387c08fd0dc8f876" +checksum = "58b56f1cbe6fd4d0c2573df72868f20ab1c125ca9c9dbce17927a463433a2e57" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -749,12 +728,12 @@ dependencies = [ "form_urlencoded", "hex", "hmac", - "http", + "http 0.2.12", + "http 1.1.0", "once_cell", "p256", "percent-encoding", - "regex", - "ring 0.17.7", + "ring 0.17.8", "sha2 0.10.8", "subtle", "time", @@ -764,9 +743,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.0.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573441a5a0219e436e86a7f9a20b0f2505c5ae6fe7fe3eba6e3950991c9ad914" +checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" dependencies = [ "futures-util", "pin-project-lite", @@ -775,9 +754,9 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.0" +version = "0.60.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a373ec01aede3dd066ec018c1bc4e8f5dd11b2c11c59c8eef1a5c68101f397" +checksum = "6242d6a54d3b4b83458f4abd7057ba93c4419dc71e8217e9acd3a748d656d99e" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -785,8 +764,8 @@ dependencies = [ "crc32c", "crc32fast", "hex", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "md-5", "pin-project-lite", "sha1", @@ -796,9 +775,9 @@ dependencies = [ [[package]] name = "aws-smithy-eventstream" -version = "0.60.0" +version = "0.60.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c669e1e5fc0d79561bf7a122b118bd50c898758354fe2c53eb8f2d31507cbc3" +checksum = "e6363078f927f612b970edf9d1903ef5cef9a64d1e8423525ebb1f0a1633c858" dependencies = [ "aws-smithy-types", "bytes", @@ -807,9 +786,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.0" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1de8aee22f67de467b2e3d0dd0fb30859dc53f579a63bd5381766b987db644" +checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -817,8 +796,8 @@ dependencies = [ "bytes", "bytes-utils", "futures-core", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "once_cell", "percent-encoding", "pin-project-lite", @@ -828,18 +807,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.60.0" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a46dd338dc9576d6a6a5b5a19bd678dcad018ececee11cf28ecd7588bd1a55c" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.60.0" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5b8c7a86d4b6399169670723b7e6f21a39fc833a30f5c5a2f997608178129" +checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" dependencies = [ "aws-smithy-types", "urlencoding", @@ -847,39 +826,42 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.0.3" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c628feae802ab1589936e2aaef6f8ab2b8fc1ee1f947c276dd8a7c3cda1904" +checksum = "8508de54f34b8feca6638466c2bd2de9d1df5bf79c578de9a649b72d644006b3" dependencies = [ "aws-smithy-async", "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.0.1", + "fastrand 2.1.0", "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", + "http 0.2.12", + "http-body 0.4.6", + "http-body 1.0.0", + "httparse", + "hyper 0.14.29", + "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", "pin-utils", - "rustls", + "rustls 0.21.12", "tokio", "tracing", ] [[package]] name = "aws-smithy-runtime-api" -version = "1.0.3" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7460e5cc8e6eb0749608535854352f6e121433960ba05daf4dbde0e42c1199a5" +checksum = "aa6dbabc7629fab4e4467f95f119c2e1a9b00b44c893affa98e23b040a0e2567" dependencies = [ "aws-smithy-async", "aws-smithy-types", "bytes", - "http", + "http 0.2.12", + "http 1.1.0", "pin-project-lite", "tokio", "tracing", @@ -888,17 +870,20 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.0.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba838f43d0d72d76918895a93c3ad647f75a058541a60e85beefb6bb0a9bd40" +checksum = "cfe321a6b21f5d8eabd0ade9c55d3d0335f3c3157fc2b3e87f05f34b539e4df5" dependencies = [ "base64-simd", "bytes", "bytes-utils", "futures-core", - "http", - "http-body", - "itoa 1.0.10", + "http 0.2.12", + "http 1.1.0", + "http-body 0.4.6", + "http-body 1.0.0", + "http-body-util", + "itoa 1.0.11", "num-integer", "pin-project-lite", "pin-utils", @@ -911,24 +896,24 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.0" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec40d74a67fd395bc3f6b4ccbdf1543672622d905ef3f979689aea5b730cb95" +checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.0.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa59f6f26a3472ca2ce7e7802d037a0a9a7ac23de5761eadd9b68f31ac4fd21" +checksum = "6f734808d43702a67e57d478a12e227d4d038d0b90c9005a78c87890d3805922" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "http", + "http 0.2.12", "rustc_version", "tracing", ] @@ -946,10 +931,10 @@ dependencies = [ "bytes", "futures-util", "headers", - "http", - "http-body", - "hyper", - "itoa 1.0.10", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.29", + "itoa 1.0.11", "matchit", "memchr", "mime", @@ -978,31 +963,19 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", "tower-service", ] -[[package]] -name = "backon" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c491fa80d69c03084223a4e73c378dd9f9a1e612eb54051213f88b2d5249b458" -dependencies = [ - "fastrand 2.0.1", - "futures-core", - "pin-project", - "tokio", -] - [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -1013,18 +986,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "balloon-hash" -version = "0.5.0-pre.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "371b91193f54f345ec55fe913dc63ca4f8d2f948f4e8a8e189591b76a2dda718" -dependencies = [ - "crypto-bigint 0.6.0-pre.12", - "digest 0.11.0-pre.8", - "password-hash", - "zeroize", -] - [[package]] name = "base-x" version = "0.2.11" @@ -1037,12 +998,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - [[package]] name = "base36" version = "0.0.1" @@ -1071,6 +1026,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64-simd" version = "0.8.0" @@ -1102,20 +1063,20 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", - "serde", ] [[package]] name = "bigdecimal" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06619be423ea5bb86c95f087d5707942791a08a85530df0db2209a3ecfb8bc9" +checksum = "9324c8014cd04590682b34f1e9448d38f0674d0f7b2dc553331016ef0e4e9ebc" dependencies = [ "autocfg", "libm", "num-bigint", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1139,47 +1100,42 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 1.0.109", -] - -[[package]] -name = "bindgen" -version = "0.69.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" -dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "cexpr", "clang-sys", + "itertools 0.12.1", "lazy_static", "lazycell", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.66", "which", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bit_field" version = "0.10.2" @@ -1194,9 +1150,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] + +[[package]] +name = "bitstream-io" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c12d1856e42f0d817a835fe55853957c85c8c8a470114029143d3f12671446e" [[package]] name = "bitvec" @@ -1219,30 +1184,19 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "blake2" -version = "0.11.0-pre.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb6b33ba68af672bcef0f6d1cceeeaf36e4143cd1456cafafda5d7f12d91f14" -dependencies = [ - "digest 0.11.0-pre.8", -] - [[package]] name = "blake3" version = "1.5.0" -source = "git+https://github.com/brxken128/blake3?rev=d3aab416c12a75c2bfabce33bcd594e428a79069#d3aab416c12a75c2bfabce33bcd594e428a79069" +source = "git+https://github.com/spacedriveapp/blake3.git?rev=d3aab416c12a75c2bfabce33bcd594e428a79069#d3aab416c12a75c2bfabce33bcd594e428a79069" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", - "constant_time_eq", - "digest 0.11.0-pre.8", + "constant_time_eq 0.3.0", "generic-array 1.0.0", "hybrid-array", "typenum", - "zeroize", ] [[package]] @@ -1269,40 +1223,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-buffer" -version = "0.11.0-pre.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ded684142010808eb980d9974ef794da2bcf97d13396143b1515e9f0fb4a10e" -dependencies = [ - "crypto-common 0.2.0-pre.5", -] - -[[package]] -name = "block-modes" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb03d1bed155d89dce0f845b7899b18a9a163e148fd004e1c28421a783e2d8e" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.3.0", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "block-padding" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "block-sys" version = "0.2.1" @@ -1323,26 +1243,38 @@ dependencies = [ ] [[package]] -name = "blocking" -version = "1.5.1" +name = "block2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "async-channel", - "async-lock 3.3.0", - "async-task", - "fastrand 2.0.1", - "futures-io", - "futures-lite 2.2.0", - "piper", - "tracing", + "objc2", ] [[package]] -name = "brotli" -version = "3.4.0" +name = "blocking" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite 2.3.0", + "piper", +] + +[[package]] +name = "boxcar" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510a90332002c1af3317ef6b712f0dab697f30bbe809b86965eac2923c0bca8e" + +[[package]] +name = "brotli" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1361,28 +1293,34 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "tinyvec", ] [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.7", "serde", ] +[[package]] +name = "built" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6a6c0b39c38fd754ac338b00a88066436389c0f029da5d37d1e01091d9b7c17" + [[package]] name = "builtin-psl-connectors" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "connection-string", "either", @@ -1396,21 +1334,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytecount" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -1419,10 +1357,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "bytes" -version = "1.5.0" +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -1438,43 +1382,65 @@ dependencies = [ ] [[package]] -name = "cairo-rs" -version = "0.15.12" +name = "bzip2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" dependencies = [ - "bitflags 1.3.2", + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.5.0", "cairo-sys-rs", "glib", "libc", + "once_cell", "thiserror", ] [[package]] name = "cairo-sys-rs" -version = "0.15.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ "glib-sys", "libc", - "system-deps 6.2.0", + "system-deps", ] [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -1508,20 +1474,14 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.15.3" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" dependencies = [ "serde", - "toml 0.7.8", + "toml 0.8.2", ] -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "castaway" version = "0.2.2" @@ -1531,23 +1491,15 @@ dependencies = [ "rustversion", ] -[[package]] -name = "cbc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" -dependencies = [ - "cipher 0.4.4", -] - [[package]] name = "cc" -version = "1.0.83" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1578,20 +1530,11 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.9.1" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ - "smallvec 1.13.1", -] - -[[package]] -name = "cfg-expr" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" -dependencies = [ - "smallvec 1.13.1", + "smallvec", "target-lexicon", ] @@ -1601,6 +1544,18 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha20" version = "0.9.1" @@ -1608,7 +1563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] @@ -1620,16 +1575,16 @@ checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", "chacha20", - "cipher 0.4.4", + "cipher", "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1637,43 +1592,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.7", + "windows-targets 0.52.5", ] [[package]] @@ -1682,27 +1601,27 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "crypto-common 0.1.6", + "crypto-common", "inout", "zeroize", ] [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading 0.8.3", ] [[package]] name = "clap" -version = "4.4.11" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -1710,9 +1629,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -1722,40 +1641,34 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" - -[[package]] -name = "cmov" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1dc960ba75d543267db9254da8ec1cb318a037beb3f8d2497520e410096fab" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "cocoa" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -1774,6 +1687,16 @@ dependencies = [ "objc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -1782,9 +1705,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "colored" @@ -1796,6 +1719,37 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "com" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "combine" version = "3.8.1" @@ -1811,9 +1765,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -1827,16 +1781,16 @@ checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" dependencies = [ "castaway", "cfg-if", - "itoa 1.0.10", + "itoa 1.0.11", "ryu", "static_assertions", ] [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1874,24 +1828,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] -name = "const-random" -version = "0.1.18" +name = "constant_time_eq" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" -dependencies = [ - "const-random-macro", -] - -[[package]] -name = "const-random-macro" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom 0.2.12", - "once_cell", - "tiny-keccak", -] +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" @@ -1949,14 +1889,14 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -1991,99 +1931,55 @@ dependencies = [ [[package]] name = "crc32c" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" +checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" dependencies = [ "rustc_version", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - [[package]] name = "crossbeam-channel" -version = "0.5.9" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -2113,17 +2009,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "crypto-bigint" -version = "0.6.0-pre.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1943d7beadd9ce2b25f3bae73b9e9336fccc1edf38bdec1ed58d3aa183989e11" -dependencies = [ - "hybrid-array", - "num-traits", - "subtle", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -2135,15 +2020,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-common" -version = "0.2.0-pre.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7aa2ec04f5120b830272a481e8d9d8ba4dda140d2cda59b0f1110d5eb93c38e" -dependencies = [ - "hybrid-array", -] - [[package]] name = "cssparser" version = "0.27.2" @@ -2157,7 +2033,7 @@ dependencies = [ "phf 0.8.0", "proc-macro2", "quote", - "smallvec 1.13.1", + "smallvec", "syn 1.0.109", ] @@ -2168,17 +2044,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "ctor" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2187,7 +2063,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] @@ -2199,7 +2075,7 @@ dependencies = [ "base36", "cuid-util", "cuid2", - "hostname", + "hostname 0.3.1", "num", "once_cell", "rand 0.8.5", @@ -2248,14 +2124,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "darling" -version = "0.20.3" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -2263,27 +2139,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2293,23 +2169,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2317,9 +2193,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2334,7 +2210,7 @@ checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" [[package]] name = "datamodel-renderer" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "base64 0.13.1", "once_cell", @@ -2365,12 +2241,11 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", - "pem-rfc7468", "zeroize", ] @@ -2390,9 +2265,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -2425,7 +2300,7 @@ dependencies = [ [[package]] name = "diagnostics" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "colored", "indoc", @@ -2448,19 +2323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid", - "crypto-common 0.1.6", - "subtle", -] - -[[package]] -name = "digest" -version = "0.11.0-pre.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065d93ead7c220b85d5b4be4795d8398eac4ff68b5ee63895de0a3c1fb6edf25" -dependencies = [ - "block-buffer 0.11.0-pre.5", - "crypto-common 0.2.0-pre.5", + "crypto-common", "subtle", ] @@ -2540,22 +2403,45 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] -name = "dlv-list" +name = "dlib" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "const-random", + "libloading 0.8.3", +] + +[[package]] +name = "dlopen2" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] name = "dmmf" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "bigdecimal 0.3.1", "indexmap 1.9.3", @@ -2567,16 +2453,46 @@ dependencies = [ ] [[package]] -name = "dotenv" -version = "0.15.0" +name = "dns-lookup" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +checksum = "e5766087c2235fec47fafa4cfecc81e494ee679d0fd4a59887ea0919bfb0e4fc" +dependencies = [ + "cfg-if", + "libc", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" +dependencies = [ + "serde", +] [[package]] name = "dtoa" @@ -2586,9 +2502,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dtoa-short" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" dependencies = [ "dtoa", ] @@ -2599,6 +2515,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ecdsa" version = "0.14.8" @@ -2638,9 +2560,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -2648,7 +2570,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct 0.1.1", + "base16ct", "crypto-bigint 0.4.9", "der 0.6.1", "digest 0.10.7", @@ -2664,15 +2586,16 @@ dependencies = [ [[package]] name = "embed-resource" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" dependencies = [ "cc", + "memchr", "rustc_version", - "toml 0.8.8", + "toml 0.8.2", "vswhom", - "winreg 0.51.0", + "winreg 0.52.0", ] [[package]] @@ -2683,13 +2606,19 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "endian-type" version = "0.1.2" @@ -2705,14 +2634,14 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "enumflags2" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -2720,24 +2649,24 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "enumn" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" +checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2748,9 +2677,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2767,26 +2696,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -2795,27 +2707,27 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.1", + "event-listener", "pin-project-lite", ] [[package]] name = "exr" -version = "1.6.4" +version = "1.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279d3efcc55e19917fff7ab3ddd6c14afb6a90881a0078465196fe2f99d08c56" +checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" dependencies = [ "bit_field", - "flume 0.10.14", + "flume", "half", "lebe", "miniz_oxide", "rayon-core", - "smallvec 1.13.1", + "smallvec", "zune-inflate", ] @@ -2838,7 +2750,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -2853,6 +2765,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" +[[package]] +name = "faster-hex" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" + [[package]] name = "fastrand" version = "1.9.0" @@ -2864,15 +2782,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] @@ -2889,11 +2807,11 @@ dependencies = [ [[package]] name = "ffmpeg-sys-next" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2529ad916d08c3562c754c21bc9b17a26c7882c0f5706cc2cd69472175f1620" +checksum = "972a460dd8e901b737ce0482bf71a837e1751e3dd7c8f8b0a4ead808e7f174a5" dependencies = [ - "bindgen 0.64.0", + "bindgen", "cc", "libc", "num_cpus", @@ -2903,9 +2821,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "field-offset" @@ -2913,7 +2831,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.0", + "memoffset", "rustc_version", ] @@ -2935,17 +2853,11 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -[[package]] -name = "flagset" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb3aa5e95cf9aabc17f060cfa0ced7b83f042390760ca53bf09df9968acaa1" - [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -2957,19 +2869,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -[[package]] -name = "flume" -version = "0.10.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", - "spin 0.9.8", -] - [[package]] name = "flume" version = "0.11.0" @@ -2990,18 +2889,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fontconfig-parser" -version = "0.5.3" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "674e258f4b5d2dcd63888c01c68413c51f565e8af99d2f7701c7b81d79ef41c4" +checksum = "6a595cb550439a117696039dfc69830492058211b771a2a165379f2a1a53d84d" dependencies = [ - "roxmltree 0.18.1", + "roxmltree 0.19.0", ] [[package]] name = "fontdb" -version = "0.16.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" +checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" dependencies = [ "fontconfig-parser", "log", @@ -3017,7 +2916,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -3026,6 +2946,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -3050,12 +2976,6 @@ dependencies = [ "libc", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "funty" version = "2.0.0" @@ -3096,6 +3016,17 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-buffered" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02dcae03ee5afa5ea17b1aebc793806b8ddfc6dc500e0b8e8e1eb30b9dad22c0" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -3108,15 +3039,17 @@ dependencies = [ [[package]] name = "futures-concurrency" -version = "7.4.3" +version = "7.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6712e11cdeed5c8cf21ea0b90fec40fbe64afc9bbf2339356197eeca829fc3" +checksum = "4b14ac911e85d57c5ea6eef76d7b4d4a3177ecd15f4bea2e61927e9e3823e19f" dependencies = [ "bitvec", + "futures-buffered", "futures-core", + "futures-lite 1.13.0", "pin-project", "slab", - "smallvec 1.13.1", + "smallvec", ] [[package]] @@ -3160,11 +3093,14 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ + "fastrand 2.1.0", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] @@ -3187,7 +3123,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3197,7 +3133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls", + "rustls 0.21.12", ] [[package]] @@ -3225,9 +3161,9 @@ dependencies = [ [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -3258,11 +3194,10 @@ dependencies = [ [[package]] name = "gdk" -version = "0.15.4" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" dependencies = [ - "bitflags 1.3.2", "cairo-rs", "gdk-pixbuf", "gdk-sys", @@ -3274,35 +3209,35 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.15.11" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" dependencies = [ - "bitflags 1.3.2", "gdk-pixbuf-sys", "gio", "glib", "libc", + "once_cell", ] [[package]] name = "gdk-pixbuf-sys" -version = "0.15.10" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps", ] [[package]] name = "gdk-sys" -version = "0.15.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -3312,19 +3247,47 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.2.0", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90fbf5c033c65d93792192a49a8efb5bb1e640c419682a58bb96f5ae77f3d4a" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2ea8a4909d530f79921290389cbd7c34cb9d623bfe970eaae65ca5f9cd9cce" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", ] [[package]] name = "gdkx11-sys" -version = "0.15.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +checksum = "fee8f00f4ee46cad2939b8990f5c70c94ff882c3028f3cc5abf950fa4ab53043" dependencies = [ "gdk-sys", "glib-sys", "libc", - "system-deps 6.2.0", + "system-deps", "x11", ] @@ -3360,6 +3323,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -3373,9 +3346,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -3386,9 +3359,9 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug", "polyval", @@ -3396,9 +3369,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" dependencies = [ "color_quant", "weezl", @@ -3406,83 +3379,165 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gio" -version = "0.15.12" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" dependencies = [ - "bitflags 1.3.2", "futures-channel", "futures-core", "futures-io", + "futures-util", "gio-sys", "glib", "libc", "once_cell", + "pin-project-lite", + "smallvec", "thiserror", ] [[package]] name = "gio-sys" -version = "0.15.10" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps", "winapi", ] [[package]] -name = "glib" -version = "0.15.12" +name = "gix-features" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" dependencies = [ - "bitflags 1.3.2", + "gix-hash", + "gix-trace", + "libc", +] + +[[package]] +name = "gix-glob" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a29ad0990cf02c48a7aac76ed0dbddeb5a0d070034b83675cc3bbf937eace4" +dependencies = [ + "bitflags 2.5.0", + "bstr", + "gix-features", + "gix-path", + "serde", +] + +[[package]] +name = "gix-hash" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d7df7366121b5018f947a04d37f034717e113dcf9ccd85c34b58e57a74d5e" +dependencies = [ + "faster-hex", + "thiserror", +] + +[[package]] +name = "gix-ignore" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "640dbeb4f5829f9fc14d31f654a34a0350e43a24e32d551ad130d99bf01f63f1" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "gix-trace", + "serde", + "unicode-bom", +] + +[[package]] +name = "gix-path" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23623cf0f475691a6d943f898c4d0b89f5c1a2a64d0f92bce0e0322ee6528783" +dependencies = [ + "bstr", + "gix-trace", + "home", + "once_cell", + "thiserror", +] + +[[package]] +name = "gix-trace" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.5.0", "futures-channel", "futures-core", "futures-executor", "futures-task", + "futures-util", + "gio-sys", "glib-macros", "glib-sys", "gobject-sys", "libc", + "memchr", "once_cell", - "smallvec 1.13.1", + "smallvec", "thiserror", ] [[package]] name = "glib-macros" -version = "0.15.13" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ - "anyhow", "heck 0.4.1", - "proc-macro-crate", + "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "glib-sys" -version = "0.15.10" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", - "system-deps 6.2.0", + "system-deps", ] [[package]] @@ -3497,23 +3552,96 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ - "aho-corasick 1.1.2", + "aho-corasick 1.1.3", "bstr", "log", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", "serde", ] [[package]] -name = "gobject-sys" -version = "0.15.10" +name = "glow" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ "glib-sys", "libc", - "system-deps 6.2.0", + "system-deps", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.5.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" +dependencies = [ + "log", + "presser", + "thiserror", + "winapi", + "windows 0.52.0", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" +dependencies = [ + "bitflags 2.5.0", + "gpu-descriptor-types", + "hashbrown 0.14.5", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.5.0", ] [[package]] @@ -3539,12 +3667,11 @@ dependencies = [ [[package]] name = "gtk" -version = "0.15.5" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" dependencies = [ "atk", - "bitflags 1.3.2", "cairo-rs", "field-offset", "futures-channel", @@ -3555,16 +3682,15 @@ dependencies = [ "gtk-sys", "gtk3-macros", "libc", - "once_cell", "pango", "pkg-config", ] [[package]] name = "gtk-sys" -version = "0.15.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -3575,36 +3701,35 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps 6.2.0", + "system-deps", ] [[package]] name = "gtk3-macros" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d" +checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" dependencies = [ - "anyhow", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "h2" -version = "0.3.22" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 2.2.1", + "http 0.2.12", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -3613,9 +3738,9 @@ dependencies = [ [[package]] name = "half" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", @@ -3634,7 +3759,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -3643,26 +3768,41 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "allocator-api2", ] [[package]] name = "hashlink" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.14.5", +] + +[[package]] +name = "hassle-rs" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" +dependencies = [ + "bitflags 2.5.0", + "com", + "libc", + "libloading 0.8.3", + "thiserror", + "widestring", + "winapi", ] [[package]] @@ -3674,7 +3814,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -3686,7 +3826,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.12", ] [[package]] @@ -3705,10 +3845,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hermit-abi" -version = "0.3.3" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -3724,9 +3870,9 @@ checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" [[package]] name = "hickory-proto" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ "async-trait", "cfg-if", @@ -3739,7 +3885,7 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "socket2 0.5.5", + "socket2", "thiserror", "tinyvec", "tokio", @@ -3749,9 +3895,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ "cfg-if", "futures-util", @@ -3759,10 +3905,10 @@ dependencies = [ "ipconfig", "lru-cache", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "resolv-conf", - "smallvec 1.13.1", + "smallvec", "thiserror", "tokio", "tracing", @@ -3806,6 +3952,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "hostname" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +dependencies = [ + "cfg-if", + "libc", + "windows 0.52.0", +] + [[package]] name = "html5ever" version = "0.26.0" @@ -3822,13 +3979,24 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", - "itoa 1.0.10", + "itoa 1.0.11", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.11", ] [[package]] @@ -3838,7 +4006,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", "pin-project-lite", ] @@ -3863,7 +4054,7 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "httpz" version = "0.0.6" -source = "git+https://github.com/spacedriveapp/rspc.git?rev=f3347e2e8bfe3f37bfacc437ca329fe71cdcb048#f3347e2e8bfe3f37bfacc437ca329fe71cdcb048" +source = "git+https://github.com/spacedriveapp/rspc.git?rev=ab12964b140991e0730c3423693533fba71efb03#ab12964b140991e0730c3423693533fba71efb03" dependencies = [ "async-tungstenite", "axum", @@ -3871,8 +4062,8 @@ dependencies = [ "cookie", "form_urlencoded", "futures", - "http", - "hyper", + "http 0.2.12", + "hyper 0.14.29", "sha1", "thiserror", "tokio", @@ -3886,37 +4077,56 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hybrid-array" -version = "0.2.0-rc.7" +version = "0.2.0-rc.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c2311a0adecbffff284aabcf1249b1485193b16e685f9ef171b1ba82979cff" +checksum = "53668f5da5a41d9eaf4bf7064be46d1ebe6a4e1ceed817f387587b18f2b51047" dependencies = [ "typenum", ] [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", - "itoa 1.0.10", + "itoa 1.0.11", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "itoa 1.0.11", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -3924,13 +4134,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", + "http 0.2.12", + "hyper 0.14.29", "log", - "rustls", + "rustls 0.21.12", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "rustls 0.22.4", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tower-service", ] [[package]] @@ -3940,24 +4167,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.29", "native-tls", "tokio", "tokio-native-tls", ] [[package]] -name = "iana-time-zone" -version = "0.1.58" +name = "hyper-util" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -3981,14 +4228,132 @@ dependencies = [ [[package]] name = "icrate" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e286f4b975ac6c054971a0600a9b76438b332edace54bff79c71c9d3adfc9772" +checksum = "3fb69199826926eb864697bddd27f73d9fddcffc004f5733131e15b465e30642" dependencies = [ - "block2", + "block2 0.4.0", "objc2", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -4007,12 +4372,14 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -4028,9 +4395,9 @@ dependencies = [ [[package]] name = "if-watch" version = "3.2.0" -source = "git+https://github.com/oscartbeaumont/if-watch.git?rev=a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3#a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3" +source = "git+https://github.com/spacedriveapp/if-watch.git?rev=a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3#a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3" dependencies = [ - "async-io 2.3.0", + "async-io", "core-foundation", "fnv", "futures", @@ -4053,8 +4420,8 @@ dependencies = [ "attohttpc", "bytes", "futures", - "http", - "hyper", + "http 0.2.12", + "hyper 0.14.29", "log", "rand 0.8.5", "tokio", @@ -4062,39 +4429,37 @@ dependencies = [ "xmltree", ] -[[package]] -name = "ignore" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata 0.4.5", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "image" -version = "0.24.7" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" dependencies = [ "bytemuck", "byteorder", "color_quant", "exr", "gif", - "jpeg-decoder", - "num-rational", + "image-webp", "num-traits", "png", "qoi", + "ravif", + "rayon", + "rgb", "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d730b085583c4d789dfd07fdcf185be59501666a90c97c40162b37e4fdad272d" +dependencies = [ + "byteorder-lite", + "thiserror", ] [[package]] @@ -4103,6 +4468,12 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +[[package]] +name = "imgref" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" + [[package]] name = "include_dir" version = "0.7.3" @@ -4135,26 +4506,26 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] [[package]] name = "indoc" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "infer" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" dependencies = [ "cfb", ] @@ -4185,15 +4556,14 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "block-padding 0.3.3", "generic-array 0.14.7", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -4213,21 +4583,21 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df1f2f068675add1a3fc77f5f5ab2e29290c841ee34d151abc007bce902e5d34" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "interpolate_name" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -4236,7 +4606,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.5", + "socket2", "widestring", "windows-sys 0.48.0", "winreg 0.50.0", @@ -4249,23 +4619,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "is-terminal" -version = "0.4.12" +name = "is-docker" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "once_cell", ] [[package]] -name = "iter_tools" -version = "0.1.4" +name = "is-wsl" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531cafdc99b3b3252bb32f5620e61d56b19415efc19900b12d1b2e7483854897" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" dependencies = [ - "itertools 0.10.5", + "is-docker", + "once_cell", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "iter_tools" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f85582248e8796b1d7146eabe9f70c5b9de4db16bf934ca893581d33c66403b6" +dependencies = [ + "itertools 0.11.0", ] [[package]] @@ -4279,9 +4663,27 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -4294,15 +4696,15 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "javascriptcore-rs" -version = "0.16.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" dependencies = [ "bitflags 1.3.2", "glib", @@ -4311,28 +4713,14 @@ dependencies = [ [[package]] name = "javascriptcore-rs-sys" -version = "0.4.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 5.0.0", -] - -[[package]] -name = "jni" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" -dependencies = [ - "cesu8", - "combine 4.6.6", - "jni-sys", - "log", - "thiserror", - "walkdir", + "system-deps", ] [[package]] @@ -4343,7 +4731,7 @@ checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", "cfg-if", - "combine 4.6.6", + "combine 4.6.7", "jni-sys", "log", "thiserror", @@ -4359,47 +4747,43 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "jpeg-decoder" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" -dependencies = [ - "rayon", -] +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "json-patch" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" dependencies = [ "serde", "serde_json", "thiserror", - "treediff", ] [[package]] name = "json-rpc-api-build" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "backtrace", "heck 0.3.3", @@ -4422,21 +4806,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonwebtoken" -version = "9.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" -dependencies = [ - "base64 0.21.7", - "js-sys", - "pem", - "ring 0.17.7", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "kamadak-exif" version = "0.5.5" @@ -4448,13 +4817,41 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.5.0", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading 0.8.3", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kqueue" version = "1.0.8" @@ -4490,21 +4887,12 @@ dependencies = [ [[package]] name = "kurbo" -version = "0.9.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +checksum = "6e5aa9f0f96a938266bdb12928a67169e8d22c6a786fda8ed984b85e6ba93c3c" dependencies = [ "arrayvec", -] - -[[package]] -name = "kurbo" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440" -dependencies = [ - "arrayvec", - "smallvec 1.13.1", + "smallvec", ] [[package]] @@ -4512,9 +4900,6 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] [[package]] name = "lazycell" @@ -4539,10 +4924,34 @@ dependencies = [ ] [[package]] -name = "libc" -version = "0.2.153" +name = "libappindicator" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading 0.7.4", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libdbus-sys" @@ -4550,15 +4959,25 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" dependencies = [ - "cc", "pkg-config", ] [[package]] -name = "libheif-rs" -version = "0.22.0" +name = "libfuzzer-sys" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f644fa9c774f17b545fb3c09f8f1a29cc09385a5504c03c6a158878e9522acd" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] + +[[package]] +name = "libheif-rs" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c32c0a0c970782707070f11c8612bced800b916af4ddaf6229161dc3ceb907" dependencies = [ "enumn", "four-cc", @@ -4568,9 +4987,9 @@ dependencies = [ [[package]] name = "libheif-sys" -version = "2.1.0+1.17.4" +version = "2.1.1+1.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b9d5bf9cf5c3d24fd875f09817810cd33b7dd1e13d6c52a0148f221224cd22" +checksum = "f60b29be1ef3ab2aba61344f09a18c3edf552bf4f9fbec9bd68b9ea6f98e71f8" dependencies = [ "libc", "pkg-config", @@ -4590,12 +5009,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.5", ] [[package]] @@ -4613,7 +5032,7 @@ dependencies = [ "either", "futures", "futures-timer", - "getrandom 0.2.12", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-autonat", @@ -4696,13 +5115,13 @@ dependencies = [ "multihash", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand 0.8.5", "rw-stream-sink", "serde", - "smallvec 1.13.1", + "smallvec", "thiserror", "tracing", "unsigned-varint 0.8.0", @@ -4723,7 +5142,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "lru 0.12.2", + "lru 0.12.3", "quick-protobuf", "quick-protobuf-codec", "thiserror", @@ -4741,8 +5160,8 @@ dependencies = [ "hickory-resolver", "libp2p-core", "libp2p-identity", - "parking_lot 0.12.1", - "smallvec 1.13.1", + "parking_lot 0.12.3", + "smallvec", "tracing", ] @@ -4759,7 +5178,7 @@ dependencies = [ "fnv", "futures", "futures-ticker", - "getrandom 0.2.12", + "getrandom 0.2.15", "hex_fmt", "instant", "libp2p-core", @@ -4772,7 +5191,7 @@ dependencies = [ "regex", "serde", "sha2 0.10.8", - "smallvec 1.13.1", + "smallvec", "tracing", "void", ] @@ -4818,7 +5237,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.10.8", - "smallvec 1.13.1", + "smallvec", "thiserror", "tracing", "uint", @@ -4838,8 +5257,8 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", - "smallvec 1.13.1", - "socket2 0.5.5", + "smallvec", + "socket2", "tokio", "tracing", "void", @@ -4898,12 +5317,12 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-tls", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "quinn", "rand 0.8.5", "ring 0.16.20", - "rustls", - "socket2 0.5.5", + "rustls 0.21.12", + "socket2", "thiserror", "tokio", "tracing", @@ -4947,7 +5366,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", - "smallvec 1.13.1", + "smallvec", "tracing", "void", ] @@ -4979,11 +5398,11 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "lru 0.12.2", + "lru 0.12.3", "multistream-select", "once_cell", "rand 0.8.5", - "smallvec 1.13.1", + "smallvec", "tokio", "tracing", "void", @@ -4997,7 +5416,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -5011,7 +5430,7 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "socket2 0.5.5", + "socket2", "tokio", "tracing", ] @@ -5027,8 +5446,8 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls", - "rustls-webpki", + "rustls 0.21.12", + "rustls-webpki 0.101.7", "thiserror", "x509-parser", "yasna", @@ -5060,25 +5479,24 @@ dependencies = [ "thiserror", "tracing", "yamux 0.12.1", - "yamux 0.13.1", + "yamux 0.13.3", ] [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "libc", - "redox_syscall 0.4.1", ] [[package]] name = "libsqlite3-sys" -version = "0.22.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" dependencies = [ "cc", "pkg-config", @@ -5087,23 +5505,39 @@ dependencies = [ [[package]] name = "libwebp-sys" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0df0a0f9444d52aee6335cd724d21a2ee3285f646291799a72be518ec8ee3c" +checksum = "829b6b604f31ed6d2bccbac841fe0788de93dbd87e4eb1ba2c4adfe8c012a838" dependencies = [ "cc", "glob", ] [[package]] -name = "line-wrap" -version = "0.1.1" +name = "libxdo" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +checksum = "00333b8756a3d28e78def82067a377de7fa61b24909000aeaa2b446a948d14db" dependencies = [ - "safemem", + "libxdo-sys", ] +[[package]] +name = "libxdo-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23b9e7e2b7831bbd8aac0bbeeeb7b68cbebc162b227e7052e8e55829a09212" +dependencies = [ + "libc", + "x11", +] + +[[package]] +name = "line-wrap" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -5111,32 +5545,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] -name = "linux-keyutils" -version = "0.2.4" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "761e49ec5fd8a5a463f9b84e877c373d888935b71c6be78f3767fe2ae6bed18e" -dependencies = [ - "bitflags 2.4.1", - "libc", -] +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "linux-raw-sys" -version = "0.3.8" +name = "litemap" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] -name = "linux-raw-sys" -version = "0.4.12" +name = "litrs" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -5144,9 +5574,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "loom" @@ -5163,6 +5593,15 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "lru" version = "0.7.8" @@ -5174,11 +5613,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -5301,10 +5740,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] -name = "maybe-uninit" -version = "2.0.0" +name = "maybe-rayon" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] [[package]] name = "md-5" @@ -5318,22 +5761,22 @@ dependencies = [ [[package]] name = "mdns-sd" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c460fa7decb7ea827682546b0584736acb45bcb2ced0d0dd6030c6d529e012e" +checksum = "807457e493076539ff8f202806f9dc2eaa9f13f69701da7ed38eec7a9afd1616" dependencies = [ - "flume 0.11.0", + "flume", "if-addrs", "log", "polling 2.8.0", - "socket2 0.4.10", + "socket2", ] [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -5346,20 +5789,26 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.7.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] -name = "memoffset" -version = "0.9.0" +name = "metal" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "5637e166ea14be6063a3f8ba5ccb9a4159df7d8f6d61c02fc3d480b1f90dcfcb" dependencies = [ - "autocfg", + "bitflags 2.5.0", + "block", + "core-graphics-types", + "foreign-types 0.5.0", + "log", + "objc", + "paste", ] [[package]] @@ -5368,7 +5817,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e52eb6380b6d2a10eb3434aec0885374490f5b82c8aaf5cd487a183c98be834" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "metrics-macros", ] @@ -5378,23 +5827,33 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "142c53885123b68d94108295a09d4afe1a1388ed95b54d5dacd9a454753030f2" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", "metrics-macros", ] +[[package]] +name = "metrics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" +dependencies = [ + "ahash 0.8.11", + "portable-atomic", +] + [[package]] name = "metrics-exporter-prometheus" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953cbbb6f9ba4b9304f4df79b98cdc9d14071ed93065a9fca11c00c5d9181b66" dependencies = [ - "hyper", + "hyper 0.14.29", "indexmap 1.9.3", "ipnet", "metrics 0.19.0", "metrics-util 0.13.0", "parking_lot 0.11.2", - "quanta 0.9.3", + "quanta", "thiserror", "tokio", "tracing", @@ -5427,7 +5886,7 @@ dependencies = [ "num_cpus", "ordered-float", "parking_lot 0.11.2", - "quanta 0.9.3", + "quanta", "radix_trie", "sketches-ddsketch", ] @@ -5445,7 +5904,7 @@ dependencies = [ "metrics 0.19.0", "num_cpus", "parking_lot 0.11.2", - "quanta 0.9.3", + "quanta", "sketches-ddsketch", ] @@ -5467,15 +5926,15 @@ dependencies = [ [[package]] name = "mini-moka" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e0b72e7c9042467008b10279fc732326bd605459ae03bda88825909dd19b56" +checksum = "c325dfab65f261f386debee8b0969da215b3fa0037e74c8a1234db7ba986d803" dependencies = [ "crossbeam-channel", "crossbeam-utils", "dashmap", "skeptic", - "smallvec 1.13.1", + "smallvec", "tagptr", "triomphe", ] @@ -5494,9 +5953,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", "simd-adler32", @@ -5504,9 +5963,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -5516,9 +5975,9 @@ dependencies = [ [[package]] name = "mobc" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90eb49dc5d193287ff80e72a86f34cfb27aae562299d22fea215e06ea1059dd3" +checksum = "d8d3681f0b299413df040f53c6950de82e48a8e1a9f79d442ed1ad3694d660b9" dependencies = [ "async-trait", "futures-channel", @@ -5526,7 +5985,7 @@ dependencies = [ "futures-timer", "futures-util", "log", - "metrics 0.18.1", + "metrics 0.22.3", "thiserror", "tokio", "tracing", @@ -5534,27 +5993,23 @@ dependencies = [ ] [[package]] -name = "moka" -version = "0.12.5" +name = "muda" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" +checksum = "86b959f97c97044e4c96e32e1db292a7d594449546a3c6b77ae613dc3a5b5145" dependencies = [ - "async-lock 2.8.0", - "async-trait", + "cocoa", "crossbeam-channel", - "crossbeam-epoch", - "crossbeam-utils", - "futures-util", + "dpi", + "gtk", + "keyboard-types", + "libxdo", + "objc", "once_cell", - "parking_lot 0.12.1", - "quanta 0.12.3", - "rustc_version", - "skeptic", - "smallvec 1.13.1", - "tagptr", + "png", + "serde", "thiserror", - "triomphe", - "uuid", + "windows-sys 0.52.0", ] [[package]] @@ -5606,7 +6061,7 @@ dependencies = [ "bytes", "futures", "pin-project", - "smallvec 1.13.1", + "smallvec", "tracing", "unsigned-varint 0.8.0", ] @@ -5617,6 +6072,25 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" +[[package]] +name = "naga" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e536ae46fcab0876853bd4a632ede5df4b1c2527a58f6c5a4150fe86be858231" +dependencies = [ + "arrayvec", + "bit-set", + "bitflags 2.5.0", + "codespan-reporting", + "indexmap 2.2.6", + "log", + "num-traits", + "rustc-hash", + "spirv", + "termcolor", + "thiserror", +] + [[package]] name = "nanoid" version = "0.4.0" @@ -5632,16 +6106,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -5668,14 +6141,15 @@ dependencies = [ [[package]] name = "ndk" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "num_enum", + "raw-window-handle 0.5.2", "thiserror", ] @@ -5687,9 +6161,18 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-sys" -version = "0.3.0" +version = "0.4.1+23.1.7779620" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ "jni-sys", ] @@ -5749,9 +6232,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ "bytes", "futures", @@ -5762,9 +6245,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nibble_vec" @@ -5772,7 +6255,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" dependencies = [ - "smallvec 1.13.1", + "smallvec", ] [[package]] @@ -5788,14 +6271,14 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "cfg-if", "libc", - "memoffset 0.7.1", + "memoffset", ] [[package]] @@ -5827,12 +6310,18 @@ dependencies = [ ] [[package]] -name = "normpath" -version = "1.1.1" +name = "noop_proc_macro" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "normpath" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5840,7 +6329,7 @@ name = "notify" version = "6.1.1" source = "git+https://github.com/notify-rs/notify.git?rev=c3929ed114fbb0bc7457a9a498260461596b00ca#c3929ed114fbb0bc7457a9a498260461596b00ca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "filetime", "fsevent-sys", "inotify", @@ -5894,9 +6383,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ "num-bigint", "num-complex", @@ -5908,56 +6397,54 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "smallvec 1.13.1", - "zeroize", -] - [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -5966,11 +6453,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -5978,9 +6464,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -6011,7 +6497,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -6040,25 +6526,102 @@ dependencies = [ [[package]] name = "objc-sys" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" [[package]] name = "objc2" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9c7f0d511a4ce26b078183179dca908171cfc69f88986fe36c5138e1834476" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ "objc-sys", "objc2-encode", ] [[package]] -name = "objc2-encode" -version = "4.0.0" +name = "objc2-app-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff06a6505cde0766484f38d8479ac8e6d31c66fbc2d5492f65ca8c091456379" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2", + "objc2-foundation", + "objc2-metal", +] [[package]] name = "objc_exception" @@ -6080,9 +6643,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -6102,81 +6665,45 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "3.2.0" +version = "5.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8" +checksum = "b5ca541f22b1c46d4bb9801014f234758ab4297e7870b904b6a8415b980a7388" dependencies = [ + "is-wsl", + "libc", "pathdiff", - "windows-sys 0.42.0", -] - -[[package]] -name = "opendal" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c17c077f23fa2d2c25d9d22af98baa43b8bbe2ef0de80cf66339aa70401467" -dependencies = [ - "anyhow", - "async-trait", - "backon", - "base64 0.21.7", - "bytes", - "chrono", - "flagset", - "futures", - "getrandom 0.2.12", - "http", - "log", - "md-5", - "moka", - "once_cell", - "percent-encoding", - "quick-xml", - "reqsign", - "reqwest", - "serde", - "serde_json", - "sha2 0.10.8", - "tokio", - "uuid", ] [[package]] name = "opener" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788" +checksum = "f8df34be653210fbe9ffaff41d3b92721c56ce82dfee58ee684f9afb5e3a90c0" dependencies = [ "bstr", "dbus", "normpath", "url", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "openssl" -version = "0.10.61" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -6191,7 +6718,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -6202,18 +6729,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.2.1+3.2.0" +version = "300.3.1+3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fe476c29791a5ca0d1273c697e96085bbabbbea2ef7afd5617e78a4b40332d3" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.97" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -6259,16 +6786,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "ordered-multimap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" -dependencies = [ - "dlv-list", - "hashbrown 0.14.3", -] - [[package]] name = "ordered-stream" version = "0.2.0" @@ -6293,7 +6810,7 @@ checksum = "f8e5caf4eb2ead4bc137c3ff4e347940e3e556ceb11a4180627f04b63d7342dd" dependencies = [ "compact_str", "half", - "libloading 0.8.1", + "libloading 0.8.3", "ndarray", "ort-sys", "thiserror", @@ -6302,9 +6819,9 @@ dependencies = [ [[package]] name = "ort-sys" -version = "2.0.0-rc.0" +version = "2.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48b5623df2187e0db543ecb2032a6a999081086b7ffddd318000c00b23ace46" +checksum = "b3d9c1373fc813d3f024d394f621f4c6dde0734c79b1c17113c3bb5bf0084bbe" dependencies = [ "flate2", "sha2 0.10.8", @@ -6314,23 +6831,23 @@ dependencies = [ [[package]] name = "os_info" -version = "3.7.0" +version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ "log", "serde", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "os_pipe" -version = "1.1.4" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6345,15 +6862,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "owning_ref" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "p256" version = "0.11.1" @@ -6367,11 +6875,11 @@ dependencies = [ [[package]] name = "pango" -version = "0.15.10" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ - "bitflags 1.3.2", + "gio", "glib", "libc", "once_cell", @@ -6380,14 +6888,14 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.15.10" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps", ] [[package]] @@ -6396,16 +6904,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" -[[package]] -name = "parking_lot" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" -dependencies = [ - "owning_ref", - "parking_lot_core 0.2.14", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -6419,24 +6917,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" -dependencies = [ - "libc", - "rand 0.4.6", - "smallvec 0.6.14", - "winapi", + "parking_lot_core 0.9.10", ] [[package]] @@ -6449,40 +6935,41 @@ dependencies = [ "instant", "libc", "redox_syscall 0.2.16", - "smallvec 1.13.1", + "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "smallvec 1.13.1", - "windows-targets 0.48.5", + "redox_syscall 0.5.1", + "smallvec", + "windows-targets 0.52.5", ] [[package]] name = "parser-database" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "diagnostics", "either", "enumflags2", "indexmap 1.9.3", + "rustc-hash", "schema-ast", ] [[package]] name = "password-hash" -version = "0.5.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.4", @@ -6491,9 +6978,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" @@ -6503,22 +6990,23 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pbkdf2" -version = "0.12.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", "hmac", + "password-hash", + "sha2 0.10.8", ] [[package]] name = "pdfium-render" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b19ea0c0c7816b6a29fae48f4c5dece59814394e272a7e80ea8f8e8eb37a6e" +version = "0.8.21" +source = "git+https://github.com/fogodev/pdfium-render.git?rev=e7aa1111f441c49e857cebda15b4e51b24356aaa#e7aa1111f441c49e857cebda15b4e51b24356aaa" dependencies = [ - "bindgen 0.69.1", - "bitflags 2.4.1", + "bindgen", + "bitflags 2.5.0", "bytemuck", "bytes", "chrono", @@ -6527,7 +7015,7 @@ dependencies = [ "image", "iter_tools", "js-sys", - "libloading 0.8.1", + "libloading 0.8.3", "log", "maybe-owned", "once_cell", @@ -6538,31 +7026,16 @@ dependencies = [ "web-sys", ] -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pem" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "serde", ] -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -6571,9 +7044,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -6582,9 +7055,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -6592,22 +7065,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -6744,7 +7217,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -6753,7 +7226,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" dependencies = [ - "siphasher", + "siphasher 0.3.11", ] [[package]] @@ -6762,7 +7235,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "siphasher", + "siphasher 0.3.11", ] [[package]] @@ -6771,7 +7244,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ - "siphasher", + "siphasher 0.3.11", ] [[package]] @@ -6782,29 +7255,29 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -6814,12 +7287,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-io", ] @@ -6829,32 +7302,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad78bf43dcf80e8f950c92b84f938a0fc7590b7f6866fbcbeca781609c115590" -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der 0.7.8", - "pkcs8 0.10.2", - "spki 0.7.3", -] - -[[package]] -name = "pkcs5" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e847e2c91a18bfa887dd028ec33f2fe6f25db77db3619024764914affe8b69a6" -dependencies = [ - "aes 0.8.3", - "cbc", - "der 0.7.8", - "pbkdf2", - "scrypt", - "sha2 0.10.8", - "spki 0.7.3", -] - [[package]] name = "pkcs8" version = "0.9.0" @@ -6871,71 +7318,41 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", - "pkcs5", - "rand_core 0.6.4", + "der 0.7.9", "spki 0.7.3", ] [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "plist" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" +checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" dependencies = [ "base64 0.21.7", - "indexmap 2.2.1", + "indexmap 2.2.6", "line-wrap", "quick-xml", "serde", "time", ] -[[package]] -name = "plotters" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" - -[[package]] -name = "plotters-svg" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" -dependencies = [ - "plotters-backend", -] - [[package]] name = "png" -version = "0.17.10" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -6962,14 +7379,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.2" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" +checksum = "5e6a007746f34ed64099e88783b0ae369eaa3da6392868ba262e2af9b8fbaea1" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", - "rustix 0.38.31", + "rustix", "tracing", "windows-sys 0.52.0", ] @@ -6987,9 +7405,9 @@ dependencies = [ [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", @@ -6997,6 +7415,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -7016,13 +7440,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] -name = "prettyplease" -version = "0.2.15" +name = "presser" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -7036,18 +7466,19 @@ dependencies = [ [[package]] name = "prisma-client-rust" version = "0.6.8" -source = "git+https://github.com/spacedriveapp/prisma-client-rust?rev=f99d6f5566570f3ab1edecb7a172ad25b03d95af#f99d6f5566570f3ab1edecb7a172ad25b03d95af" +source = "git+https://github.com/brendonovich/prisma-client-rust?rev=4f9ef9d38ca732162accff72b2eb684d2f120bab#4f9ef9d38ca732162accff72b2eb684d2f120bab" dependencies = [ "base64 0.13.1", "bigdecimal 0.3.1", + "bigdecimal 0.4.3", "chrono", "diagnostics", - "dotenv", + "dotenvy", "futures", "include_dir", "indexmap 1.9.3", "paste", - "prisma-client-rust-macros", + "prisma-client-rust-generator-macros", "prisma-models", "psl", "query-core", @@ -7058,7 +7489,7 @@ dependencies = [ "serde-value", "serde_json", "specta", - "tempdir", + "tempfile", "thiserror", "tokio", "tracing", @@ -7069,16 +7500,16 @@ dependencies = [ [[package]] name = "prisma-client-rust-cli" version = "0.6.8" -source = "git+https://github.com/spacedriveapp/prisma-client-rust?rev=f99d6f5566570f3ab1edecb7a172ad25b03d95af#f99d6f5566570f3ab1edecb7a172ad25b03d95af" +source = "git+https://github.com/brendonovich/prisma-client-rust?rev=4f9ef9d38ca732162accff72b2eb684d2f120bab#4f9ef9d38ca732162accff72b2eb684d2f120bab" dependencies = [ "directories 4.0.1", "flate2", - "http", + "http 0.2.12", "prisma-client-rust-generator", "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "serde_path_to_error", @@ -7089,16 +7520,17 @@ dependencies = [ [[package]] name = "prisma-client-rust-generator" version = "0.6.8" -source = "git+https://github.com/spacedriveapp/prisma-client-rust?rev=f99d6f5566570f3ab1edecb7a172ad25b03d95af#f99d6f5566570f3ab1edecb7a172ad25b03d95af" +source = "git+https://github.com/brendonovich/prisma-client-rust?rev=4f9ef9d38ca732162accff72b2eb684d2f120bab#4f9ef9d38ca732162accff72b2eb684d2f120bab" dependencies = [ "directories 4.0.1", "flate2", - "http", + "http 0.2.12", + "prisma-client-rust-generator-shared", "prisma-client-rust-sdk", "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "serde_path_to_error", @@ -7107,21 +7539,33 @@ dependencies = [ ] [[package]] -name = "prisma-client-rust-macros" +name = "prisma-client-rust-generator-macros" version = "0.6.8" -source = "git+https://github.com/spacedriveapp/prisma-client-rust?rev=f99d6f5566570f3ab1edecb7a172ad25b03d95af#f99d6f5566570f3ab1edecb7a172ad25b03d95af" +source = "git+https://github.com/brendonovich/prisma-client-rust?rev=4f9ef9d38ca732162accff72b2eb684d2f120bab#4f9ef9d38ca732162accff72b2eb684d2f120bab" dependencies = [ "convert_case 0.6.0", + "prisma-client-rust-generator-shared", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prisma-client-rust-generator-shared" +version = "0.1.0" +source = "git+https://github.com/brendonovich/prisma-client-rust?rev=4f9ef9d38ca732162accff72b2eb684d2f120bab#4f9ef9d38ca732162accff72b2eb684d2f120bab" +dependencies = [ + "convert_case 0.6.0", + "prisma-client-rust-sdk", "proc-macro2", "quote", - "specta", "syn 1.0.109", ] [[package]] name = "prisma-client-rust-sdk" version = "0.6.8" -source = "git+https://github.com/spacedriveapp/prisma-client-rust?rev=f99d6f5566570f3ab1edecb7a172ad25b03d95af#f99d6f5566570f3ab1edecb7a172ad25b03d95af" +source = "git+https://github.com/brendonovich/prisma-client-rust?rev=4f9ef9d38ca732162accff72b2eb684d2f120bab#4f9ef9d38ca732162accff72b2eb684d2f120bab" dependencies = [ "convert_case 0.5.0", "dmmf", @@ -7141,7 +7585,7 @@ dependencies = [ [[package]] name = "prisma-models" version = "0.0.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "bigdecimal 0.3.1", "chrono", @@ -7157,7 +7601,7 @@ dependencies = [ [[package]] name = "prisma-value" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "base64 0.13.1", "bigdecimal 0.3.1", @@ -7179,6 +7623,16 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -7211,22 +7665,41 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] [[package]] -name = "prometheus-client" -version = "0.22.1" +name = "profiling" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f87c10af16e0af74010d2a123d202e8363c04db5acfa91d8747f64a8524da3a" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +dependencies = [ + "quote", + "syn 2.0.66", +] + +[[package]] +name = "prometheus-client" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" dependencies = [ "dtoa", - "itoa 1.0.10", - "parking_lot 0.12.1", + "itoa 1.0.11", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -7238,13 +7711,13 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "psl" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "builtin-psl-connectors", "psl-core", @@ -7253,7 +7726,7 @@ dependencies = [ [[package]] name = "psl-core" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "bigdecimal 0.3.1", "chrono", @@ -7274,11 +7747,11 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "memchr", "unicase", ] @@ -7295,7 +7768,7 @@ dependencies = [ [[package]] name = "quaint" version = "0.2.0-alpha.13" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "async-trait", "base64 0.12.3", @@ -7304,7 +7777,6 @@ dependencies = [ "connection-string", "futures", "hex", - "libsqlite3-sys", "metrics 0.18.1", "mobc", "num_cpus", @@ -7330,31 +7802,16 @@ dependencies = [ "libc", "mach", "once_cell", - "raw-cpuid 10.7.0", + "raw-cpuid", "wasi 0.10.2+wasi-snapshot-preview1", "web-sys", "winapi", ] -[[package]] -name = "quanta" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid 11.0.1", - "wasi 0.11.0+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - [[package]] name = "query-connector" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "anyhow", "async-trait", @@ -7374,7 +7831,7 @@ dependencies = [ [[package]] name = "query-core" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "async-trait", "bigdecimal 0.3.1", @@ -7410,13 +7867,13 @@ dependencies = [ [[package]] name = "query-engine-metrics" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "metrics 0.18.1", "metrics-exporter-prometheus", "metrics-util 0.12.1", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "serde", "serde_json", "tracing", @@ -7430,6 +7887,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-protobuf" version = "0.8.1" @@ -7458,7 +7921,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", - "serde", ] [[package]] @@ -7473,7 +7935,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls", + "rustls 0.21.12", "thiserror", "tokio", "tracing", @@ -7489,7 +7951,7 @@ dependencies = [ "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls", + "rustls 0.21.12", "slab", "thiserror", "tinyvec", @@ -7504,16 +7966,16 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.5", + "socket2", "tracing", "windows-sys 0.48.0", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -7534,19 +7996,6 @@ dependencies = [ "nibble_vec", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - [[package]] name = "rand" version = "0.7.3" @@ -7572,18 +8021,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand" -version = "0.9.0-alpha.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807b7862b9cbece02dbbb9465356885df299fcc8b19d27a4570903eaf6a4062e" -dependencies = [ - "libc", - "rand_chacha 0.9.0-alpha.0", - "rand_core 0.9.0-alpha.0", - "zerocopy 0.8.0-alpha.5", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -7604,31 +8041,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.9.0-alpha.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5c41723acb3ac225e48e77a0921e0c69b36b670d857e0914fc8d574efa7df8" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.0-alpha.0", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" @@ -7644,17 +8056,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", -] - -[[package]] -name = "rand_core" -version = "0.9.0-alpha.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b962254c1392bbfc8571c17acb5d0e52116bbefd704e965e92e6c60fadc096e" -dependencies = [ - "getrandom 0.2.12", - "zerocopy 0.8.0-alpha.5", + "getrandom 0.2.15", ] [[package]] @@ -7675,6 +8077,56 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand 0.8.5", + "rand_chacha 0.3.1", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc13288f5ab39e6d7c9d501759712e6969fcc9734220846fc9ed26cae2cc4234" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error 2.0.1", + "rav1e", + "rayon", + "rgb", +] + [[package]] name = "raw-cpuid" version = "10.7.0" @@ -7684,21 +8136,18 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "raw-cpuid" -version = "11.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" -dependencies = [ - "bitflags 2.4.1", -] - [[package]] name = "raw-window-handle" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + [[package]] name = "rawpointer" version = "0.2.1" @@ -7707,9 +8156,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -7717,9 +8166,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -7737,24 +8186,6 @@ dependencies = [ "yasna", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "redb" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72623e6275cd430215b741f41ebda34db93a13ebde253f908b70871c46afc5ba" -dependencies = [ - "libc", -] - [[package]] name = "redox_syscall" version = "0.2.16" @@ -7774,26 +8205,35 @@ dependencies = [ ] [[package]] -name = "redox_users" -version = "0.4.4" +name = "redox_syscall" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "getrandom 0.2.12", + "bitflags 2.5.0", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ - "aho-corasick 1.1.2", + "aho-corasick 1.1.3", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -7807,15 +8247,21 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ - "aho-corasick 1.1.2", + "aho-corasick 1.1.3", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] +[[package]] +name = "regex-lite" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -7824,54 +8270,20 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "renderdoc-sys" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "reqsign" -version = "0.14.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e319d9de9ff4d941abf4ac718897118b0fe04577ea3f8e0f5788971784eef5" -dependencies = [ - "anyhow", - "async-trait", - "base64 0.21.7", - "chrono", - "form_urlencoded", - "getrandom 0.2.12", - "hex", - "hmac", - "home", - "http", - "jsonwebtoken", - "log", - "once_cell", - "percent-encoding", - "quick-xml", - "rand 0.8.5", - "reqwest", - "rsa", - "rust-ini", - "serde", - "serde_json", - "sha1", - "sha2 0.10.8", -] +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "request-handlers" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "bigdecimal 0.3.1", "connection-string", @@ -7880,6 +8292,7 @@ dependencies = [ "graphql-parser", "indexmap 1.9.3", "itertools 0.10.5", + "once_cell", "prisma-models", "psl", "query-core", @@ -7894,9 +8307,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -7904,10 +8317,9 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.29", "hyper-tls", "ipnet", "js-sys", @@ -7917,16 +8329,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", "tokio-util", "tower-service", "url", @@ -7937,27 +8347,69 @@ dependencies = [ "winreg 0.50.0", ] +[[package]] +name = "reqwest" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-rustls 0.26.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.22.4", + "rustls-pemfile 2.1.2", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "tokio", + "tokio-rustls 0.25.0", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", + "winreg 0.52.0", +] + [[package]] name = "resolv-conf" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "hostname", - "quick-error", + "hostname 0.3.1", + "quick-error 1.2.3", ] [[package]] name = "resvg" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "024e40e1ba7313fc315b1720298988c0cd6f8bfe3754b52838aafecebd11355a" +checksum = "944d052815156ac8fa77eaac055220e95ba0b01fa8887108ca710c03805d9051" dependencies = [ "gif", "jpeg-decoder", "log", "pico-args", - "png", "rgb", "svgtypes", "tiny-skia", @@ -7977,26 +8429,26 @@ dependencies = [ [[package]] name = "rfd" -version = "0.10.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea" +checksum = "25a73a7337fc24366edfca76ec521f51877b114e42dab584008209cca6719251" dependencies = [ + "ashpd", "block", "dispatch", "glib-sys", "gobject-sys", "gtk-sys", "js-sys", - "lazy_static", "log", "objc", "objc-foundation", "objc_id", - "raw-window-handle", + "raw-window-handle 0.6.2", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "windows 0.37.0", + "windows-sys 0.48.0", ] [[package]] @@ -8025,23 +8477,24 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "getrandom 0.2.12", + "cfg-if", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rmp" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" dependencies = [ "byteorder", "num-traits", @@ -8050,9 +8503,9 @@ dependencies = [ [[package]] name = "rmp-serde" -version = "1.1.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" dependencies = [ "byteorder", "rmp", @@ -8061,9 +8514,9 @@ dependencies = [ [[package]] name = "rmpv" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0e0214a4a2b444ecce41a4025792fc31f77c7bb89c46d253953ea8c65701ec" +checksum = "58450723cd9ee93273ce44a20b6ec4efe17f8ed2e3631474387bfdecf18bb2a9" dependencies = [ "num-traits", "rmp", @@ -8071,15 +8524,6 @@ dependencies = [ "serde_bytes", ] -[[package]] -name = "roxmltree" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" -dependencies = [ - "xmlparser", -] - [[package]] name = "roxmltree" version = "0.19.0" @@ -8087,30 +8531,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" [[package]] -name = "rsa" -version = "0.9.6" +name = "roxmltree" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" -dependencies = [ - "const-oid", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8 0.10.2", - "rand_core 0.6.4", - "sha2 0.10.8", - "signature 2.2.0", - "spki 0.7.3", - "subtle", - "zeroize", -] +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rspc" version = "0.1.4" -source = "git+https://github.com/spacedriveapp/rspc.git?rev=f3347e2e8bfe3f37bfacc437ca329fe71cdcb048#f3347e2e8bfe3f37bfacc437ca329fe71cdcb048" +source = "git+https://github.com/spacedriveapp/rspc.git?rev=ab12964b140991e0730c3423693533fba71efb03#ab12964b140991e0730c3423693533fba71efb03" dependencies = [ "futures", "futures-channel", @@ -8144,35 +8573,24 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.25.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4b1eaf239b47034fb450ee9cdedd7d0226571689d8823030c4b6c2cb407152" +checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "chrono", "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", - "memchr", - "smallvec 1.13.1", -] - -[[package]] -name = "rust-ini" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" -dependencies = [ - "cfg-if", - "ordered-multimap", + "smallvec", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -8200,43 +8618,43 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.27" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.7", - "rustls-webpki", + "ring 0.17.8", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -8244,7 +8662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -8258,31 +8676,58 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rustybuzz" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c" +checksum = "7730060ad401b0d1807c904ea56735288af101430aa0d2ab8358b789f5f37002" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "bytemuck", - "smallvec 1.13.1", + "smallvec", "ttf-parser", "unicode-bidi-mirroring", "unicode-ccc", @@ -8302,24 +8747,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher 0.4.4", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -8332,17 +8762,17 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "schema" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "once_cell", "prisma-models", @@ -8353,7 +8783,7 @@ dependencies = [ [[package]] name = "schema-ast" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "diagnostics", "pest", @@ -8363,7 +8793,7 @@ dependencies = [ [[package]] name = "schema-connector" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "chrono", "enumflags2", @@ -8380,7 +8810,7 @@ dependencies = [ [[package]] name = "schema-core" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "async-trait", "chrono", @@ -8400,6 +8830,32 @@ dependencies = [ "user-facing-errors", ] +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.66", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -8412,24 +8868,13 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scrypt" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" -dependencies = [ - "pbkdf2", - "salsa20", - "sha2 0.10.8", -] - [[package]] name = "sct" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -8455,7 +8900,7 @@ dependencies = [ "once_cell", "ort", "prisma-client-rust", - "reqwest", + "reqwest 0.11.27", "rmp-serde", "rmpv", "sd-core-file-path-helper", @@ -8474,33 +8919,12 @@ dependencies = [ "uuid", ] -[[package]] -name = "sd-cache" -version = "0.0.0" -dependencies = [ - "serde", - "serde_json", - "specta", -] - -[[package]] -name = "sd-cli" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "hex", - "indoc", - "sd-crypto", - "tokio", -] - [[package]] name = "sd-cloud-api" version = "0.1.0" dependencies = [ - "base64 0.21.7", - "reqwest", + "base64 0.22.1", + "reqwest 0.11.27", "rmpv", "rspc", "sd-p2p", @@ -8514,9 +8938,8 @@ dependencies = [ [[package]] name = "sd-core" -version = "0.2.11" +version = "0.3.2" dependencies = [ - "aovec", "async-channel", "async-recursion", "async-stream", @@ -8525,9 +8948,10 @@ dependencies = [ "aws-credential-types", "aws-sdk-s3", "axum", - "base64 0.21.7", + "base64 0.22.1", "base91", "blake3", + "boxcar", "bytes", "chrono", "ctor", @@ -8535,46 +8959,43 @@ dependencies = [ "flate2", "futures", "futures-concurrency", + "gix-ignore", "globset", - "hostname", - "http-body", + "hostname 0.4.0", + "http-body 0.4.6", "http-range", - "hyper", + "hyper 0.14.29", "icrate", "image", "int-enum", - "itertools 0.12.0", + "itertools 0.13.0", "libc", "mini-moka", "normpath", "notify", "once_cell", - "opendal", "openssl", "openssl-sys", "pin-project-lite", "plist", "prisma-client-rust", "regex", - "reqwest", + "reqwest 0.11.27", "rmp", "rmp-serde", "rmpv", "rspc", "sd-actors", "sd-ai", - "sd-cache", "sd-cloud-api", "sd-core-file-path-helper", "sd-core-heavy-lifting", "sd-core-indexer-rules", "sd-core-prisma-helpers", "sd-core-sync", - "sd-crypto", "sd-ffmpeg", "sd-file-ext", "sd-images", - "sd-indexer", "sd-media-metadata", "sd-p2p", "sd-p2p-block", @@ -8582,6 +9003,7 @@ dependencies = [ "sd-p2p-tunnel", "sd-prisma", "sd-sync", + "sd-task-system", "sd-utils", "serde", "serde-hashkey", @@ -8593,7 +9015,6 @@ dependencies = [ "static_assertions", "strum", "strum_macros", - "sync_wrapper 1.0.1", "sysinfo", "tar", "tempfile", @@ -8634,12 +9055,15 @@ version = "0.1.0" dependencies = [ "async-channel", "async-trait", + "blake3", "chrono", "futures", "futures-concurrency", "globset", - "itertools 0.12.0", + "image", + "itertools 0.13.0", "lending-stream", + "once_cell", "prisma-client-rust", "rmp-serde", "rmpv", @@ -8648,6 +9072,10 @@ dependencies = [ "sd-core-indexer-rules", "sd-core-prisma-helpers", "sd-core-sync", + "sd-ffmpeg", + "sd-file-ext", + "sd-images", + "sd-media-metadata", "sd-prisma", "sd-sync", "sd-task-system", @@ -8655,6 +9083,7 @@ dependencies = [ "serde", "serde_json", "specta", + "static_assertions", "strum", "tempfile", "thiserror", @@ -8663,6 +9092,7 @@ dependencies = [ "tracing", "tracing-test", "uuid", + "webp", ] [[package]] @@ -8671,7 +9101,9 @@ version = "0.1.0" dependencies = [ "chrono", "futures-concurrency", + "gix-ignore", "globset", + "once_cell", "prisma-client-rust", "rmp-serde", "rspc", @@ -8691,9 +9123,11 @@ name = "sd-core-prisma-helpers" version = "0.1.0" dependencies = [ "prisma-client-rust", - "sd-cache", "sd-prisma", + "sd-utils", "serde", + "specta", + "uuid", ] [[package]] @@ -8703,6 +9137,7 @@ dependencies = [ "prisma-client-rust", "rmp-serde", "rmpv", + "sd-actors", "sd-prisma", "sd-sync", "sd-utils", @@ -8710,45 +9145,10 @@ dependencies = [ "serde_json", "tokio", "tracing", - "uhlc 0.5.2", + "uhlc", "uuid", ] -[[package]] -name = "sd-crypto" -version = "0.0.0" -dependencies = [ - "aead", - "aes-gcm-siv", - "argon2", - "balloon-hash", - "bincode", - "blake3", - "chacha20poly1305", - "cmov", - "criterion", - "hex", - "linux-keyutils", - "paste", - "rand 0.9.0-alpha.0", - "rand_chacha 0.9.0-alpha.0", - "rand_core 0.9.0-alpha.0", - "redb", - "secret-service", - "security-framework", - "serde", - "serde-big-array", - "serde_json", - "serdect", - "specta", - "tempfile", - "thiserror", - "tokio", - "uuid", - "zbus", - "zeroize", -] - [[package]] name = "sd-deps-generator" version = "0.0.0" @@ -8756,20 +9156,21 @@ dependencies = [ "anyhow", "cargo_metadata 0.18.1", "clap", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", ] [[package]] name = "sd-desktop" -version = "0.2.11" +version = "0.3.2" dependencies = [ "axum", + "dbus", "directories 5.0.1", "futures", - "http", - "hyper", + "http 0.2.12", + "hyper 0.14.29", "opener", "prisma-client-rust", "rand 0.8.5", @@ -8781,16 +9182,23 @@ dependencies = [ "sd-fda", "sd-prisma", "serde", + "serde_json", "specta", + "strum", "tauri", "tauri-build", + "tauri-plugin-dialog", + "tauri-plugin-os", + "tauri-plugin-shell", + "tauri-plugin-updater", + "tauri-runtime", "tauri-specta", + "tauri-utils", "thiserror", "tokio", "tracing", "uuid", "webkit2gtk", - "webview2-com", ] [[package]] @@ -8800,6 +9208,7 @@ dependencies = [ "gtk", "libc", "tokio", + "wgpu", ] [[package]] @@ -8816,7 +9225,7 @@ dependencies = [ "libc", "normpath", "thiserror", - "windows 0.51.1", + "windows 0.57.0", ] [[package]] @@ -8830,7 +9239,11 @@ dependencies = [ name = "sd-ffmpeg" version = "0.1.0" dependencies = [ + "chrono", "ffmpeg-sys-next", + "image", + "libc", + "sd-utils", "tempfile", "thiserror", "tokio", @@ -8852,7 +9265,7 @@ dependencies = [ [[package]] name = "sd-images" -version = "0.0.0" +version = "0.1.0" dependencies = [ "bincode", "image", @@ -8868,50 +9281,28 @@ dependencies = [ "tracing", ] -[[package]] -name = "sd-indexer" -version = "0.0.1" -dependencies = [ - "chrono", - "futures-util", - "globset", - "normpath", - "opendal", - "rmp-serde", - "rspc", - "sd-core-file-path-helper", - "sd-core-indexer-rules", - "sd-file-ext", - "sd-prisma", - "sd-utils", - "serde", - "specta", - "tempfile", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "sd-media-metadata" -version = "0.0.0" +version = "0.1.0" dependencies = [ "chrono", "image", "kamadak-exif", "rand 0.8.5", - "rand_chacha 0.3.1", + "sd-ffmpeg", + "sd-utils", "serde", "serde_json", "specta", "thiserror", + "tokio", ] [[package]] name = "sd-mobile-android" version = "0.1.0" dependencies = [ - "jni 0.21.1", + "jni", "sd-mobile-core", "tracing", ] @@ -8942,10 +9333,12 @@ dependencies = [ name = "sd-p2p" version = "0.2.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "base91", + "dns-lookup", "ed25519-dalek", - "flume 0.11.0", + "flume", + "futures", "futures-core", "hash_map_diff", "if-watch", @@ -8954,13 +9347,14 @@ dependencies = [ "mdns-sd", "pin-project-lite", "rand_core 0.6.4", - "reqwest", + "reqwest 0.11.27", + "rmp-serde", "serde", "sha256", "specta", "stable-vec", "streamunordered", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "thiserror", "tokio", "tokio-stream", @@ -8993,27 +9387,15 @@ dependencies = [ "uuid", ] -[[package]] -name = "sd-p2p-relay" -version = "0.0.1" -dependencies = [ - "hex", - "libp2p", - "reqwest", - "serde", - "serde_json", - "tokio", - "tracing", - "tracing-subscriber", - "uuid", -] - [[package]] name = "sd-p2p-tunnel" version = "0.1.0" dependencies = [ "sd-p2p", + "sd-p2p-proto", + "thiserror", "tokio", + "uuid", ] [[package]] @@ -9023,7 +9405,6 @@ dependencies = [ "prisma-client-rust", "rmp-serde", "rmpv", - "sd-cache", "sd-sync", "serde", "serde_json", @@ -9035,8 +9416,8 @@ name = "sd-server" version = "0.1.0" dependencies = [ "axum", - "base64 0.21.7", - "http", + "base64 0.22.1", + "http 0.2.12", "include_dir", "mime_guess", "rspc", @@ -9058,7 +9439,7 @@ dependencies = [ "serde", "serde_json", "specta", - "uhlc 0.5.2", + "uhlc", "uuid", ] @@ -9091,6 +9472,7 @@ dependencies = [ "tokio", "tokio-stream", "tracing", + "tracing-subscriber", "tracing-test", "uuid", ] @@ -9112,7 +9494,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct 0.1.1", + "base16ct", "der 0.6.1", "generic-array 0.14.7", "pkcs8 0.9.0", @@ -9120,25 +9502,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "secret-service" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da1a5ad4d28c03536f82f77d9f36603f5e37d8869ac98f0a750d5b5686d8d95" -dependencies = [ - "aes 0.7.5", - "block-modes", - "futures-util", - "generic-array 0.14.7", - "hkdf", - "num", - "once_cell", - "rand 0.8.5", - "serde", - "sha2 0.10.8", - "zbus", -] - [[package]] name = "secstr" version = "0.5.1" @@ -9150,11 +9513,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -9163,9 +9526,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -9187,37 +9550,28 @@ dependencies = [ "phf_codegen 0.8.0", "precomputed-hash", "servo_arc", - "smallvec 1.13.1", + "smallvec", "thin-slice", ] [[package]] name = "semver" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - [[package]] name = "serde-hashkey" version = "0.4.5" @@ -9248,53 +9602,64 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ - "indexmap 2.2.1", - "itoa 1.0.10", + "indexmap 2.2.6", + "itoa 1.0.11", "ryu", "serde", ] [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ - "itoa 1.0.10", + "itoa 1.0.11", "serde", ] [[package]] name = "serde_repr" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -9306,23 +9671,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.10", + "itoa 1.0.11", "ryu", "serde", ] [[package]] name = "serde_with" -version = "3.4.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.1", + "indexmap 2.2.6", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -9330,24 +9696,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "serdect" -version = "0.3.0-pre.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791ef964bfaba6be28a5c3f0c56836e17cb711ac009ca1074b9c735a3ebf240a" -dependencies = [ - "base16ct 0.2.0", - "serde", + "syn 2.0.66", ] [[package]] @@ -9461,15 +9817,15 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -9490,7 +9846,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", "rand_core 0.6.4", ] @@ -9501,15 +9856,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] -name = "simple_asn1" -version = "0.6.2" +name = "simd_helpers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", + "quote", ] [[package]] @@ -9527,6 +9879,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "skeptic" version = "0.13.7" @@ -9568,24 +9926,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "0.4.5" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90c5e5fe535e48807ab94fc611d323935f39d4660c52b26b96446a7b33aef10" - -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snow" @@ -9594,11 +9937,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ "aes-gcm", - "blake2 0.10.6", + "blake2", "chacha20poly1305", "curve25519-dalek", "rand_core 0.6.4", - "ring 0.17.7", + "ring 0.17.8", "rustc_version", "sha2 0.10.8", "subtle", @@ -9606,78 +9949,89 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] -name = "socket2" -version = "0.5.5" +name = "softbuffer" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "d09e57a5a6b300bf917329da0ff30a58737d83abb7b14f99a419c23e83007cb8" dependencies = [ - "libc", - "windows-sys 0.48.0", + "bytemuck", + "cfg_aliases 0.2.1", + "core-graphics", + "foreign-types 0.5.0", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle 0.6.2", + "redox_syscall 0.5.1", + "wasm-bindgen", + "wayland-sys", + "web-sys", + "windows-sys 0.52.0", ] [[package]] -name = "soup2" -version = "0.2.1" +name = "soup3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" dependencies = [ - "bitflags 1.3.2", + "futures-channel", "gio", "glib", "libc", - "once_cell", - "soup2-sys", + "soup3-sys", ] [[package]] -name = "soup2-sys" -version = "0.2.0" +name = "soup3-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" dependencies = [ - "bitflags 1.3.2", "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps 5.0.0", + "system-deps", ] [[package]] name = "specta" -version = "2.0.0-rc.7" +version = "2.0.0-rc.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18938fc0c7c0e8b7c8f4702e8cb53c218d4442f5b7420dd8b3d9640ca9a46712" +checksum = "1ed13baa3131e5b627ca78dca1097aa84dd83509b18ac9f876a0db5e70413636" dependencies = [ - "bigdecimal 0.4.2", + "bigdecimal 0.4.3", "chrono", - "indexmap 2.2.1", + "indexmap 2.2.6", "once_cell", "paste", "serde", "serde_json", "specta-macros", - "tauri", "thiserror", "tokio", - "uhlc 0.6.3", + "uhlc", "uuid", ] [[package]] name = "specta-macros" -version = "2.0.0-rc.7" +version = "2.0.0-rc.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05080358d47cc706229b854d51c6477208de2b022ec0e16f1572c8cdc5263c8e" +checksum = "ef33e9678ae36993fcbfc46aa29568ef10d32fd54428808759c6a450998c43ec" dependencies = [ "Inflector", "proc-macro2", @@ -9700,6 +10054,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "spki" version = "0.6.0" @@ -9717,18 +10080,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.8", + "der 0.7.9", ] [[package]] name = "sql-ddl" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" [[package]] name = "sql-query-connector" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "anyhow", "async-trait", @@ -9759,7 +10122,7 @@ dependencies = [ [[package]] name = "sql-schema-connector" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "chrono", "connection-string", @@ -9790,7 +10153,7 @@ dependencies = [ [[package]] name = "sql-schema-describer" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "async-trait", "bigdecimal 0.3.1", @@ -9815,7 +10178,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ - "itertools 0.12.0", + "itertools 0.12.1", "nom", "unicode_categories", ] @@ -9831,9 +10194,9 @@ dependencies = [ [[package]] name = "stable-vec" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80dfb7bb28f3d2fa50566793349d633b33f938543154be8071610ea9f590d8ca" +checksum = "d1dff32a2ce087283bec878419027cebd888760d8760b2941ad0843531dc9ec8" dependencies = [ "no-std-compat", ] @@ -9846,9 +10209,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "state" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" dependencies = [ "loom", ] @@ -9888,7 +10251,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "phf_shared 0.10.0", "precomputed-hash", "serde", @@ -9908,15 +10271,15 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ "phf 0.10.1", "strum_macros", @@ -9924,15 +10287,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -9943,12 +10306,12 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "svgtypes" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d7618f12b51be8171a7cfdda1e7a93f79cbc57c4e7adf89a749cf671125241" +checksum = "fae3064df9b89391c9a76a0425a69d124aee9c5c28455204709e72c39868a43c" dependencies = [ - "kurbo 0.10.4", - "siphasher", + "kurbo", + "siphasher 1.0.1", ] [[package]] @@ -9975,9 +10338,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -9995,9 +10358,6 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -dependencies = [ - "futures-core", -] [[package]] name = "synstructure" @@ -10012,16 +10372,23 @@ dependencies = [ ] [[package]] -name = "sys-locale" -version = "0.2.4" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sys-locale" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" dependencies = [ - "js-sys", "libc", - "wasm-bindgen", - "web-sys", - "windows-sys 0.45.0", ] [[package]] @@ -10062,28 +10429,15 @@ dependencies = [ [[package]] name = "system-deps" -version = "5.0.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ - "cfg-expr 0.9.1", - "heck 0.3.3", + "cfg-expr", + "heck 0.5.0", "pkg-config", - "toml 0.5.11", - "version-compare 0.0.11", -] - -[[package]] -name = "system-deps" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" -dependencies = [ - "cfg-expr 0.15.5", - "heck 0.4.1", - "pkg-config", - "toml 0.8.8", - "version-compare 0.1.1", + "toml 0.8.2", + "version-compare", ] [[package]] @@ -10094,53 +10448,48 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tao" -version = "0.16.5" -source = "git+https://github.com/spacedriveapp/tao?rev=7880adbc090402c44fbcf006669458fa82623403#7880adbc090402c44fbcf006669458fa82623403" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92bcf8885e147b56d6e26751263b45876284f32ca404703f6d3b8f80d16ff4dd" dependencies = [ - "bitflags 1.3.2", - "cairo-rs", - "cc", + "bitflags 2.5.0", "cocoa", "core-foundation", "core-graphics", "crossbeam-channel", "dispatch", - "gdk", - "gdk-pixbuf", - "gdk-sys", + "dlopen2", + "dpi", + "gdkwayland-sys", "gdkx11-sys", - "gio", - "glib", - "glib-sys", "gtk", - "image", "instant", - "jni 0.20.0", + "jni", "lazy_static", "libc", "log", "ndk", "ndk-context", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "objc", "once_cell", - "parking_lot 0.12.1", - "png", - "raw-window-handle", + "parking_lot 0.12.3", + "raw-window-handle 0.6.2", "scopeguard", - "serde", "tao-macros", "unicode-segmentation", - "uuid", - "windows 0.39.0", - "windows-implement", + "url", + "windows 0.56.0", + "windows-core 0.56.0", + "windows-version", "x11-dl", ] [[package]] name = "tao-macros" -version = "0.1.0" -source = "git+https://github.com/spacedriveapp/tao?rev=7880adbc090402c44fbcf006669458fa82623403#7880adbc090402c44fbcf006669458fa82623403" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec114582505d158b669b136e6851f85840c109819d77c42bb7c0709f727d18c2" dependencies = [ "proc-macro2", "quote", @@ -10155,9 +10504,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -10166,93 +10515,89 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "1.5.3" -source = "git+https://github.com/spacedriveapp/tauri.git?rev=8409af71a83d631ff9d1cd876c441a57511a1cbd#8409af71a83d631ff9d1cd876c441a57511a1cbd" +version = "2.0.0-beta.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fedd5490eddf117253945f0baedafded43474c971cba546a818f527d5c26266" dependencies = [ "anyhow", - "base64 0.21.7", "bytes", "cocoa", "dirs-next", + "dunce", "embed_plist", - "encoding_rs", - "flate2", "futures-util", - "glib", + "getrandom 0.2.15", "glob", "gtk", - "heck 0.4.1", - "http", - "ignore", - "minisign-verify", + "heck 0.5.0", + "http 1.1.0", + "jni", + "libc", + "log", + "mime", + "muda", "objc", - "once_cell", - "open", - "os_info", - "os_pipe", "percent-encoding", - "rand 0.8.5", - "raw-window-handle", - "regex", - "reqwest", - "rfd", - "semver", + "raw-window-handle 0.6.2", + "reqwest 0.12.4", "serde", "serde_json", "serde_repr", "serialize-to-javascript", - "shared_child", + "specta", "state", - "sys-locale", - "tar", + "swift-rs", + "tauri-build", "tauri-macros", "tauri-runtime", "tauri-runtime-wry", - "tauri-utils 1.5.1", - "tempfile", + "tauri-utils", "thiserror", - "time", "tokio", - "tracing", + "tray-icon", "url", - "uuid", + "urlpattern", "webkit2gtk", "webview2-com", - "windows 0.39.0", - "zip", + "window-vibrancy", + "windows 0.56.0", ] [[package]] name = "tauri-build" -version = "1.5.1" +version = "2.0.0-beta.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9914a4715e0b75d9f387a285c7e26b5bbfeb1249ad9f842675a82481565c532" +checksum = "1a6829341dde141cd48caabd4f57463444fb1127e7e20e758088be12e866bd77" dependencies = [ "anyhow", "cargo_toml", "dirs-next", - "heck 0.4.1", + "glob", + "heck 0.5.0", "json-patch", + "schemars", "semver", "serde", "serde_json", - "tauri-utils 1.5.2", + "tauri-utils", "tauri-winres", + "toml 0.8.2", "walkdir", ] [[package]] name = "tauri-codegen" -version = "1.4.1" -source = "git+https://github.com/spacedriveapp/tauri.git?rev=8409af71a83d631ff9d1cd876c441a57511a1cbd#8409af71a83d631ff9d1cd876c441a57511a1cbd" +version = "2.0.0-beta.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de94afa2ee0cc6a7ba99c1300b80a9ede416c54a6a68a0ad38c3ebe1d6fe547c" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "brotli", "ico", "json-patch", @@ -10260,78 +10605,205 @@ dependencies = [ "png", "proc-macro2", "quote", - "regex", "semver", "serde", "serde_json", "sha2 0.10.8", - "tauri-utils 1.5.1", + "syn 2.0.66", + "tauri-utils", "thiserror", "time", + "url", "uuid", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.4.2" -source = "git+https://github.com/spacedriveapp/tauri.git?rev=8409af71a83d631ff9d1cd876c441a57511a1cbd#8409af71a83d631ff9d1cd876c441a57511a1cbd" +version = "2.0.0-beta.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305a13d6164bd76f9b407cd1b95031deb1c1a0804c686f5e332a99ee62710ac2" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", "tauri-codegen", - "tauri-utils 1.5.1", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "2.0.0-beta.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f511a86bb648b8d6ea5841719d12966491f472734915b0d510e6eeb299f4371" +dependencies = [ + "anyhow", + "glob", + "plist", + "schemars", + "serde", + "serde_json", + "tauri-utils", + "toml 0.8.2", + "walkdir", +] + +[[package]] +name = "tauri-plugin-dialog" +version = "2.0.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4563f62939a475273e7b75eb4a862f0108969a54db813ef250092d470eff84dc" +dependencies = [ + "dunce", + "log", + "raw-window-handle 0.6.2", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.0.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35377195c6923beda5f29482a16b492d431de964389fca9aaf81a0f7e908023f" +dependencies = [ + "anyhow", + "glob", + "schemars", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "thiserror", + "url", + "uuid", +] + +[[package]] +name = "tauri-plugin-os" +version = "2.0.0-beta.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653c0dbf5f954c7614a5e93f5b548bbe4417b3e1aa553b31ed0b6a2656949459" +dependencies = [ + "gethostname", + "log", + "os_info", + "serde", + "serde_json", + "serialize-to-javascript", + "sys-locale", + "tauri", + "tauri-plugin", + "thiserror", +] + +[[package]] +name = "tauri-plugin-shell" +version = "2.0.0-beta.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca4973141725f74983f6e89b9ce9c69a18bc0ec0fba23cc4d022986e0325b92b" +dependencies = [ + "encoding_rs", + "log", + "open", + "os_pipe", + "regex", + "schemars", + "serde", + "serde_json", + "shared_child", + "tauri", + "tauri-plugin", + "thiserror", + "tokio", +] + +[[package]] +name = "tauri-plugin-updater" +version = "2.0.0-beta.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d1a632f5b0cc00911c3f379b0b69a4ccf5fd22eb10d022010dfb02717d5b6bc" +dependencies = [ + "base64 0.22.1", + "dirs-next", + "flate2", + "futures-util", + "http 1.1.0", + "infer", + "minisign-verify", + "reqwest 0.12.4", + "semver", + "serde", + "serde_json", + "tar", + "tauri", + "tauri-plugin", + "tempfile", + "thiserror", + "time", + "tokio", + "url", + "windows-sys 0.52.0", + "zip", ] [[package]] name = "tauri-runtime" -version = "0.14.1" -source = "git+https://github.com/spacedriveapp/tauri.git?rev=8409af71a83d631ff9d1cd876c441a57511a1cbd#8409af71a83d631ff9d1cd876c441a57511a1cbd" +version = "2.0.0-beta.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9316d393ecb73f9390c57637c169c6b7d06f287924fa275f59cdbcf484eb4580" dependencies = [ + "dpi", "gtk", - "http", - "http-range", - "rand 0.8.5", - "raw-window-handle", + "http 1.1.0", + "jni", + "raw-window-handle 0.6.2", "serde", "serde_json", - "tauri-utils 1.5.1", + "tauri-utils", "thiserror", "url", - "uuid", - "webview2-com", - "windows 0.39.0", + "windows 0.56.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.14.2" -source = "git+https://github.com/spacedriveapp/tauri.git?rev=8409af71a83d631ff9d1cd876c441a57511a1cbd#8409af71a83d631ff9d1cd876c441a57511a1cbd" +version = "2.0.0-beta.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6df23173f0df85d05184f397ba7129c3e5f2efd2f213cf8db43694143b3a2f29" dependencies = [ "cocoa", "gtk", + "http 1.1.0", + "jni", + "log", "percent-encoding", - "rand 0.8.5", - "raw-window-handle", + "raw-window-handle 0.6.2", + "softbuffer", + "tao", "tauri-runtime", - "tauri-utils 1.5.1", - "tracing", - "uuid", + "tauri-utils", + "url", "webkit2gtk", "webview2-com", - "windows 0.39.0", + "windows 0.56.0", "wry", ] [[package]] name = "tauri-specta" -version = "2.0.0-rc.4" +version = "2.0.0-rc.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9c8e4e35bb01f7b53df4bd7f747626e45c67f41bf40b51a648c953ec779b5c" +checksum = "54fd66a6cdf8ca36aa44f9044510b449678e043056d84b551b4ff6ecb957364b" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "indoc", "serde", "serde_json", @@ -10343,26 +10815,28 @@ dependencies = [ [[package]] name = "tauri-specta-macros" -version = "2.0.0-rc.4" +version = "2.0.0-rc.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2098cb9333e5ae46629ef74ce89b2fce3978bdcaf9dea6dd0fcb1aca85934ddd" +checksum = "e6f9e90bf2012877e2c4029a1bf756277183e9c7c77b850ef965711553998012" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "tauri-utils" -version = "1.5.1" -source = "git+https://github.com/spacedriveapp/tauri.git?rev=8409af71a83d631ff9d1cd876c441a57511a1cbd#8409af71a83d631ff9d1cd876c441a57511a1cbd" +version = "2.0.0-beta.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199edb0e8969f53decfb683971faa50eb8b421f9034bfa95121286e1e93beaef" dependencies = [ "brotli", + "cargo_metadata 0.18.1", "ctor", "dunce", "glob", - "heck 0.4.1", + "heck 0.5.0", "html5ever", "infer", "json-patch", @@ -10372,43 +10846,18 @@ dependencies = [ "phf 0.11.2", "proc-macro2", "quote", + "regex", + "schemars", "semver", "serde", "serde_json", "serde_with", + "swift-rs", "thiserror", + "toml 0.8.2", "url", + "urlpattern", "walkdir", - "windows-version", -] - -[[package]] -name = "tauri-utils" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece74810b1d3d44f29f732a7ae09a63183d63949bbdd59c61f8ed2a1b70150db" -dependencies = [ - "ctor", - "dunce", - "glob", - "heck 0.4.1", - "html5ever", - "infer", - "json-patch", - "kuchikiki", - "log", - "memchr", - "phf 0.11.2", - "proc-macro2", - "quote", - "semver", - "serde", - "serde_json", - "serde_with", - "thiserror", - "url", - "walkdir", - "windows-version", ] [[package]] @@ -10421,16 +10870,6 @@ dependencies = [ "toml 0.7.8", ] -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - [[package]] name = "tempfile" version = "3.10.1" @@ -10438,8 +10877,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "rustix 0.38.31", + "fastrand 2.1.0", + "rustix", "windows-sys 0.52.0", ] @@ -10454,6 +10893,15 @@ dependencies = [ "utf-8", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thin-slice" version = "0.1.1" @@ -10462,29 +10910,29 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -10492,9 +10940,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" dependencies = [ "flate2", "jpeg-decoder", @@ -10503,12 +10951,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa 1.0.10", + "itoa 1.0.11", + "num-conv", "powerfmt", "serde", "time-core", @@ -10523,22 +10972,14 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tiny-skia" version = "0.11.4" @@ -10566,13 +11007,13 @@ dependencies = [ ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "serde", - "serde_json", + "displaydoc", + "zerovec", ] [[package]] @@ -10592,19 +11033,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -10612,13 +11053,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -10637,15 +11078,26 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -10667,9 +11119,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -10677,7 +11129,6 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -10703,21 +11154,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -10728,7 +11179,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -10737,11 +11188,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -10808,7 +11259,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -10888,7 +11339,7 @@ dependencies = [ "once_cell", "regex", "sharded-slab", - "smallvec 1.13.1", + "smallvec", "thread_local", "tracing", "tracing-core", @@ -10897,11 +11348,10 @@ dependencies = [ [[package]] name = "tracing-test" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a2c0ff408fe918a94c428a3f2ad04e4afd5c95bbc08fcf868eff750c15728a4" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" dependencies = [ - "lazy_static", "tracing-core", "tracing-subscriber", "tracing-test-macro", @@ -10909,20 +11359,19 @@ dependencies = [ [[package]] name = "tracing-test-macro" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bc1c4f8e2e73a977812ab339d503e6feeb92700f6d07a6de4d321522d5c08" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ - "lazy_static", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "trash" -version = "4.1.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a1a7a9a17d3b004898be42be29a4c18d5a4cf008b5cdf72d69b1945dfcb158a" +checksum = "c254b119cf49bdde3dfef21b1dc492dc8026b75566ca24aa77993eccd7cbc1b5" dependencies = [ "chrono", "libc", @@ -10931,23 +11380,34 @@ dependencies = [ "once_cell", "scopeguard", "url", - "windows 0.44.0", + "windows 0.56.0", ] [[package]] -name = "treediff" -version = "4.0.2" +name = "tray-icon" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +checksum = "39240037d755a1832e752d64f99078c3b0b21c09a71c12405070c75ef4e7cd3c" dependencies = [ - "serde_json", + "cocoa", + "core-graphics", + "crossbeam-channel", + "dirs-next", + "libappindicator", + "muda", + "objc", + "once_cell", + "png", + "serde", + "thiserror", + "windows-sys 0.52.0", ] [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" [[package]] name = "try-lock" @@ -10957,9 +11417,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "ttf-parser" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" [[package]] name = "tungstenite" @@ -10970,7 +11430,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.12", "httparse", "log", "rand 0.8.5", @@ -10998,32 +11458,20 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.0", + "memoffset", "tempfile", "winapi", ] -[[package]] -name = "uhlc" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d291a7454d390b753ef68df8145da18367e32883ec2fa863959f0aefb915cdb" -dependencies = [ - "hex", - "humantime", - "lazy_static", - "log", - "serde", - "spin 0.9.8", - "uuid", -] - [[package]] name = "uhlc" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1eadef1fa26cbbae1276c46781e8f4d888bdda434779c18ae6c2a0e69991885" dependencies = [ + "humantime", + "lazy_static", + "log", "rand 0.8.5", "serde", "spin 0.9.8", @@ -11041,6 +11489,47 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-ident" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + [[package]] name = "unicase" version = "2.7.0" @@ -11052,21 +11541,27 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-bidi-mirroring" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" + +[[package]] +name = "unicode-bom" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ccc" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" +checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" [[package]] name = "unicode-ident" @@ -11076,30 +11571,30 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f91c8b21fbbaa18853c3d0801c78f4fc94cdb976699bb03e832e75f7fd22f0" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" [[package]] name = "unicode-script" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" +checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-vo" @@ -11107,6 +11602,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -11125,7 +11626,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "crypto-common 0.1.6", + "crypto-common", "subtle", ] @@ -11164,27 +11665,28 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.1" +version = "2.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" +checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "log", "once_cell", - "rustls", - "rustls-webpki", + "rustls 0.22.4", + "rustls-pki-types", + "rustls-webpki 0.102.4", "url", "webpki-roots", ] [[package]] name = "url" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.0", "percent-encoding", "serde", ] @@ -11195,10 +11697,23 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "urlpattern" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9bd5ff03aea02fa45b13a7980151fe45009af1980ba69f651ec367121a31609" +dependencies = [ + "derive_more", + "regex", + "serde", + "unic-ucd-ident", + "url", +] + [[package]] name = "user-facing-error-macros" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "proc-macro2", "quote", @@ -11208,7 +11723,7 @@ dependencies = [ [[package]] name = "user-facing-errors" version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +source = "git+https://github.com/Brendonovich/prisma-engines?branch=5.1.0-patched#75852858f43e426c423b263f7e1473f49044f788" dependencies = [ "backtrace", "indoc", @@ -11222,22 +11737,22 @@ dependencies = [ [[package]] name = "usvg" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c04150a94f0bfc3b2c15d4e151524d14cd06765fc6641d8b1c59a248360d4474" +checksum = "b84ea542ae85c715f07b082438a4231c3760539d902e11d093847a0b22963032" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "data-url", "flate2", "fontdb", "imagesize", - "kurbo 0.9.5", + "kurbo", "log", "pico-args", - "roxmltree 0.19.0", + "roxmltree 0.20.0", "rustybuzz", "simplecss", - "siphasher", + "siphasher 1.0.1", "strict-num", "svgtypes", "tiny-skia-path", @@ -11253,6 +11768,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf16string" version = "0.2.0" @@ -11263,21 +11784,38 @@ dependencies = [ ] [[package]] -name = "utf8parse" -version = "0.2.1" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "serde", ] +[[package]] +name = "v_frame" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "valuable" version = "0.1.0" @@ -11301,15 +11839,9 @@ dependencies = [ [[package]] name = "version-compare" -version = "0.0.11" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" - -[[package]] -name = "version-compare" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" @@ -11357,15 +11889,15 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -11400,9 +11932,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -11410,24 +11942,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -11437,9 +11969,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -11447,28 +11979,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -11478,10 +12010,31 @@ dependencies = [ ] [[package]] -name = "web-sys" -version = "0.3.66" +name = "wayland-sys" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "105b1842da6554f91526c14a2a2172897b7f745a805d62af4ce698706be79c12" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -11489,9 +12042,9 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "0.18.2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -11507,20 +12060,18 @@ dependencies = [ "javascriptcore-rs", "libc", "once_cell", - "soup2", + "soup3", "webkit2gtk-sys", ] [[package]] name = "webkit2gtk-sys" -version = "0.18.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" dependencies = [ - "atk-sys", "bitflags 1.3.2", "cairo-sys-rs", - "gdk-pixbuf-sys", "gdk-sys", "gio-sys", "glib-sys", @@ -11528,17 +12079,16 @@ dependencies = [ "gtk-sys", "javascriptcore-rs-sys", "libc", - "pango-sys", "pkg-config", - "soup2-sys", - "system-deps 6.2.0", + "soup3-sys", + "system-deps", ] [[package]] name = "webp" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb5d8e7814e92297b0e1c773ce43d290bef6c17452dafd9fc49e5edb5beba71" +checksum = "8f53152f51fb5af0c08484c33d16cca96175881d1f3dec068c23b31a158c2d99" dependencies = [ "image", "libwebp-sys", @@ -11546,53 +12096,158 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "webview2-com" -version = "0.19.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +checksum = "5c914dd492a52f0377bef56fd1b6e74a79090f9ee631d625d5b505a00e4538b6" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.39.0", - "windows-implement", + "windows 0.56.0", + "windows-core 0.56.0", + "windows-implement 0.56.0", + "windows-interface 0.56.0", ] [[package]] name = "webview2-com-macros" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "webview2-com-sys" -version = "0.19.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +checksum = "2a46bcf03482ec28eeb764ca788f67998cde4213adfbbfa90462622058530f5e" dependencies = [ - "regex", - "serde", - "serde_json", "thiserror", - "windows 0.39.0", - "windows-bindgen", - "windows-metadata", + "windows 0.56.0", + "windows-core 0.56.0", ] [[package]] name = "weezl" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "wgpu" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ff1bfee408e1028e2e3acbf6d32d98b08a5a059ccbf5f33305534453ba5d3e" +dependencies = [ + "arrayvec", + "cfg-if", + "cfg_aliases 0.1.1", + "document-features", + "js-sys", + "log", + "parking_lot 0.12.3", + "profiling", + "raw-window-handle 0.6.2", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac6a86eaa5e763e59c73cf9e97d55fffd4dfda69fd8bda19589fcf851ddfef1f" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.5.0", + "cfg_aliases 0.1.1", + "codespan-reporting", + "document-features", + "indexmap 2.2.6", + "log", + "naga", + "once_cell", + "parking_lot 0.12.3", + "profiling", + "raw-window-handle 0.6.2", + "rustc-hash", + "smallvec", + "thiserror", + "web-sys", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d71c8ae05170583049b65ee562fd839fdc0b3e9ddb84f4e40c9d5f8ea0d4c8c" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bitflags 2.5.0", + "cfg_aliases 0.1.1", + "core-graphics-types", + "glow", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hassle-rs", + "js-sys", + "khronos-egl", + "libc", + "libloading 0.8.3", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "parking_lot 0.12.3", + "profiling", + "raw-window-handle 0.6.2", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1353d9a46bff7f955a680577f34c69122628cc2076e1d6f3a9be6ef00ae793ef" +dependencies = [ + "bitflags 2.5.0", + "js-sys", + "web-sys", +] [[package]] name = "which" @@ -11603,14 +12258,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.31", + "rustix", ] [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -11630,11 +12285,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -11644,39 +12299,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.37.0" +name = "window-vibrancy" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" +checksum = "33082acd404763b315866e14a0d5193f3422c81086657583937a750cdd3ec340" dependencies = [ - "windows_aarch64_msvc 0.37.0", - "windows_i686_gnu 0.37.0", - "windows_i686_msvc 0.37.0", - "windows_x86_64_gnu 0.37.0", - "windows_x86_64_msvc 0.37.0", -] - -[[package]] -name = "windows" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" -dependencies = [ - "windows-implement", - "windows_aarch64_msvc 0.39.0", - "windows_i686_gnu 0.39.0", - "windows_i686_msvc 0.39.0", - "windows_x86_64_gnu 0.39.0", - "windows_x86_64_msvc 0.39.0", -] - -[[package]] -name = "windows" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" -dependencies = [ - "windows-targets 0.42.2", + "cocoa", + "objc", + "raw-window-handle 0.6.2", + "windows-sys 0.52.0", + "windows-version", ] [[package]] @@ -11694,18 +12326,38 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", + "windows-core 0.51.1", "windows-targets 0.48.5", ] [[package]] -name = "windows-bindgen" -version = "0.39.0" +name = "windows" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-metadata", - "windows-tokens", + "windows-core 0.52.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.5", ] [[package]] @@ -11718,34 +12370,89 @@ dependencies = [ ] [[package]] -name = "windows-implement" -version = "0.39.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "syn 1.0.109", - "windows-tokens", + "windows-targets 0.52.5", ] [[package]] -name = "windows-metadata" -version = "0.39.0" +name = "windows-core" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result", + "windows-targets 0.52.5", +] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-core" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.5", ] [[package]] @@ -11772,7 +12479,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -11807,32 +12514,27 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] -[[package]] -name = "windows-tokens" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" - [[package]] name = "windows-version" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" +checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -11849,21 +12551,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -11879,21 +12569,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" - -[[package]] -name = "windows_i686_gnu" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -11909,21 +12587,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] -name = "windows_i686_msvc" -version = "0.37.0" +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" - -[[package]] -name = "windows_i686_msvc" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -11939,21 +12611,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -11969,9 +12629,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -11987,21 +12647,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -12017,15 +12665,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.30" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -12042,51 +12690,66 @@ dependencies = [ [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", ] [[package]] -name = "wry" -version = "0.24.7" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad85d0e067359e409fcb88903c3eac817c392e5d638258abfb3da5ad8ba6fc4" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "wry" +version = "0.39.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7172fc76376d55d089c627a31a5b604b4ac372793fb5378d1c7ddf008703008" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", "block", "cocoa", "core-graphics", "crossbeam-channel", + "dpi", "dunce", - "gdk", - "gio", - "glib", + "gdkx11", "gtk", "html5ever", - "http", + "http 1.1.0", + "javascriptcore-rs", + "jni", "kuchikiki", "libc", - "log", + "ndk", + "ndk-context", + "ndk-sys 0.4.1+23.1.7779620", "objc", "objc_id", "once_cell", - "serde", - "serde_json", + "percent-encoding", + "raw-window-handle 0.6.2", "sha2 0.10.8", - "soup2", - "tao", + "soup3", + "tao-macros", "thiserror", - "tracing", - "url", "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.39.0", - "windows-implement", + "windows 0.56.0", + "windows-core 0.56.0", + "windows-version", + "x11-dl", ] [[package]] @@ -12150,30 +12813,30 @@ dependencies = [ [[package]] name = "xattr" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.12", - "rustix 0.38.31", + "linux-raw-sys", + "rustix", ] [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "xmlparser" @@ -12205,7 +12868,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", "static_assertions", @@ -12213,18 +12876,18 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1d0148b89300047e72994bee99ecdabd15a9166a7b70c8b8c37c314dcc9002" +checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" dependencies = [ "futures", - "instant", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", "static_assertions", + "web-time", ] [[package]] @@ -12237,26 +12900,47 @@ dependencies = [ ] [[package]] -name = "zbus" -version = "3.15.2" +name = "yoke" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure 0.13.1", +] + +[[package]] +name = "zbus" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b8e3d6ae3342792a6cc2340e4394334c7402f3d793b390d2c5494a4032b3030" dependencies = [ "async-broadcast", "async-process", "async-recursion", "async-trait", - "blocking", - "byteorder", "derivative", "enumflags2", - "event-listener 2.5.3", + "event-listener", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.26.4", - "once_cell", + "nix 0.27.1", "ordered-stream", "rand 0.8.5", "serde", @@ -12266,7 +12950,7 @@ dependencies = [ "tokio", "tracing", "uds_windows", - "winapi", + "windows-sys 0.52.0", "xdg-home", "zbus_macros", "zbus_names", @@ -12275,11 +12959,11 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.2" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" +checksum = "b7a3e850ff1e7217a3b7a07eba90d37fe9bb9e89a310f718afcde5885ca9b6d7" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "regex", @@ -12289,9 +12973,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.6.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" dependencies = [ "serde", "static_assertions", @@ -12300,49 +12984,50 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ - "zerocopy-derive 0.7.32", -] - -[[package]] -name = "zerocopy" -version = "0.8.0-alpha.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd4a4b5a6b38e736bca19abe211abf0ba2552462555fc960d763fbbaff2b191" -dependencies = [ - "zerocopy-derive 0.8.0-alpha.5", + "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] -name = "zerocopy-derive" -version = "0.8.0-alpha.5" +name = "zerofrom" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157bd6b2f5a6f8e2b1b1e5b427aec8d2c085f9ab99c92eaa0ca79b9b84c11254" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", + "synstructure 0.13.1", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -12355,7 +13040,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", +] + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -12364,11 +13071,55 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ + "aes", "byteorder", + "bzip2", + "constant_time_eq 0.1.5", "crc32fast", "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd", ] +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -12379,26 +13130,35 @@ dependencies = [ ] [[package]] -name = "zvariant" -version = "3.15.2" +name = "zune-jpeg" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" +checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" dependencies = [ - "byteorder", + "zune-core", +] + +[[package]] +name = "zvariant" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e09e8be97d44eeab994d752f341e67b3b0d80512a8b315a0671d47232ef1b65" +dependencies = [ + "endi", "enumflags2", - "libc", "serde", "static_assertions", + "url", "zvariant_derive", ] [[package]] name = "zvariant_derive" -version = "3.15.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" +checksum = "72a5857e2856435331636a9fbb415b09243df4521a267c5bedcd5289b4d5799e" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -12407,9 +13167,9 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 437a2dbf2..349d571ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,18 +1,18 @@ [workspace] resolver = "2" members = [ - "core", - "core/crates/*", - "crates/*", - "apps/cli", - "apps/p2p-relay", - "apps/desktop/src-tauri", - "apps/desktop/crates/*", - "apps/mobile/modules/sd-core/core", - "apps/mobile/modules/sd-core/android/crate", - "apps/mobile/modules/sd-core/ios/crate", - "apps/server", + "core", + "core/crates/*", + "crates/*", + "apps/deps-generator", + "apps/desktop/src-tauri", + "apps/desktop/crates/*", + "apps/mobile/modules/sd-core/core", + "apps/mobile/modules/sd-core/android/crate", + "apps/mobile/modules/sd-core/ios/crate", + "apps/server", ] +exclude = ["crates/crypto"] [workspace.package] license = "AGPL-3.0-only" @@ -20,86 +20,78 @@ edition = "2021" repository = "https://github.com/spacedriveapp/spacedrive" [workspace.dependencies] -# First party dependencies -prisma-client-rust = { git = "https://github.com/spacedriveapp/prisma-client-rust", rev = "f99d6f5566570f3ab1edecb7a172ad25b03d95af", features = [ - "specta", - "sqlite-create-many", - "migrations", - "sqlite", -], default-features = false } -prisma-client-rust-cli = { git = "https://github.com/spacedriveapp/prisma-client-rust", rev = "f99d6f5566570f3ab1edecb7a172ad25b03d95af", features = [ - "specta", - "sqlite-create-many", - "migrations", - "sqlite", -], default-features = false } -prisma-client-rust-sdk = { git = "https://github.com/spacedriveapp/prisma-client-rust", rev = "f99d6f5566570f3ab1edecb7a172ad25b03d95af", features = [ - "sqlite", -], default-features = false } - -tracing = "0.1.40" -tracing-subscriber = "0.3.18" -tracing-appender = "0.2.3" - -rspc = { version = "0.1.4" } -specta = { version = "=2.0.0-rc.7" } -tauri-specta = { version = "=2.0.0-rc.4" } - -swift-rs = { version = "1.0.6" } - - # Third party dependencies used by one or more of our crates -anyhow = "1.0.75" -async-channel = "2.0.0" -async-trait = "0.1.77" -axum = "=0.6.20" -base64 = "0.21.5" -blake3 = "1.5.0" -chrono = "0.4.31" -clap = "4.4.7" +async-channel = "2.3" +async-trait = "0.1.80" +axum = "0.6.20" # Update blocked by hyper +base64 = "0.22.1" +base91 = "0.1.0" +blake3 = "1.5.0" # Update blocked by custom patch below +chrono = "0.4.38" +directories = "5.0" +ed25519-dalek = "2.1.1" futures = "0.3.30" -futures-concurrency = "7.4.3" -globset = "^0.4.13" -hex = "0.4.3" -http = "0.2.9" -image = "0.24.7" -itertools = "0.12.0" -lending-stream = "1.0.0" -normpath = "1.1.1" -once_cell = "1.18.0" -pin-project-lite = "0.2.13" +futures-concurrency = "7.6" +gix-ignore = "0.11.2" +globset = "0.4.14" +http = "0.2" # Update blocked by axum +hyper = "0.14" # Update blocked due to API breaking changes +image = "0.25.1" +itertools = "0.13.0" +lending-stream = "1.0" +libc = "0.2" +normpath = "1.2" +once_cell = "1.19" +pin-project-lite = "0.2.14" rand = "0.8.5" -rand_chacha = "0.3.1" -regex = "1.10.2" -reqwest = "0.11.22" -rmp-serde = "1.1.2" -rmpv = { version = "^1.0.1", features = ["with-serde"] } +regex = "1.10" +reqwest = "0.11" # Update blocked by hyper +rmp = "0.8.14" +rmp-serde = "1.3.0" +rmpv = { version = "1.3", features = ["with-serde"] } +rspc = "0.1.4" serde = "1.0" serde_json = "1.0" -strum = "0.25" -strum_macros = "0.25" -tempfile = "3.8.1" -thiserror = "1.0.50" -tokio = "1.36.0" -tokio-stream = "0.1.14" -tokio-util = "0.7.10" -uhlc = "=0.5.2" -uuid = "1.5.0" -webp = "0.2.6" +specta = "=2.0.0-rc.11" +static_assertions = "1.1" +strum = "0.26" +strum_macros = "0.26" +tempfile = "3.10" +thiserror = "1.0" +tokio = "1.38" +tokio-stream = "0.1.15" +tokio-util = "0.7.11" +tracing = "0.1.40" +tracing-subscriber = "0.3.18" +tracing-test = "0.2.5" +uhlc = "0.6.0" # Must follow version used by specta +uuid = "1.8" +webp = "0.3.0" -[workspace.dev-dependencies] -tracing-test = { version = "^0.2.4" } +[workspace.dependencies.prisma-client-rust] +git = "https://github.com/brendonovich/prisma-client-rust" +rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab" +features = ["migrations", "specta", "sqlite", "sqlite-create-many"] +default-features = false + +[workspace.dependencies.prisma-client-rust-cli] +git = "https://github.com/brendonovich/prisma-client-rust" +rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab" +features = ["migrations", "specta", "sqlite", "sqlite-create-many"] +default-features = false + +[workspace.dependencies.prisma-client-rust-sdk] +git = "https://github.com/brendonovich/prisma-client-rust" +rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab" +features = ["sqlite"] +default-features = false [patch.crates-io] # Proper IOS Support -if-watch = { git = "https://github.com/oscartbeaumont/if-watch.git", rev = "a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3" } +if-watch = { git = "https://github.com/spacedriveapp/if-watch.git", rev = "a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3" } # We hack it to the high heavens -rspc = { git = "https://github.com/spacedriveapp/rspc.git", rev = "f3347e2e8bfe3f37bfacc437ca329fe71cdcb048" } - -# `cursor_position` method -tauri = { git = "https://github.com/spacedriveapp/tauri.git", rev = "8409af71a83d631ff9d1cd876c441a57511a1cbd" } -tao = { git = "https://github.com/spacedriveapp/tao", rev = "7880adbc090402c44fbcf006669458fa82623403" } +rspc = { git = "https://github.com/spacedriveapp/rspc.git", rev = "ab12964b140991e0730c3423693533fba71efb03" } # Add `Control::open_stream_with_addrs` libp2p = { git = "https://github.com/spacedriveapp/rust-libp2p.git", rev = "a005656df7e82059a0eb2e333ebada4731d23f8c" } @@ -107,13 +99,31 @@ libp2p-core = { git = "https://github.com/spacedriveapp/rust-libp2p.git", rev = libp2p-swarm = { git = "https://github.com/spacedriveapp/rust-libp2p.git", rev = "a005656df7e82059a0eb2e333ebada4731d23f8c" } libp2p-stream = { git = "https://github.com/spacedriveapp/rust-libp2p.git", rev = "a005656df7e82059a0eb2e333ebada4731d23f8c" } -# aes = { git = "https://github.com/RustCrypto/block-ciphers", rev = "5837233f86419dbe75b8e3824349e30f6bc40b22" } +blake3 = { git = "https://github.com/spacedriveapp/blake3.git", rev = "d3aab416c12a75c2bfabce33bcd594e428a79069" } -blake3 = { git = "https://github.com/brxken128/blake3", rev = "d3aab416c12a75c2bfabce33bcd594e428a79069" } +# Due to image crate version bump +pdfium-render = { git = "https://github.com/fogodev/pdfium-render.git", rev = "e7aa1111f441c49e857cebda15b4e51b24356aaa" } [profile.dev] # Make compilation faster on macOS split-debuginfo = "unpacked" +opt-level = 0 +debug = 0 +strip = "none" +lto = false +codegen-units = 256 +incremental = true + +[profile.dev-debug] +inherits = "dev" +# Enables debugger +split-debuginfo = "none" +opt-level = 0 +debug = "full" +strip = "none" +lto = "off" +codegen-units = 256 +incremental = true # Set the settings for build scripts and proc-macros. [profile.dev.build-override] @@ -123,3 +133,18 @@ opt-level = 3 [profile.dev.package."*"] opt-level = 3 incremental = false + +# Set the default for dependencies, except workspace members. +[profile.dev-debug.package."*"] +inherits = "dev" +opt-level = 3 +debug = "full" +incremental = false + +# Optimize release builds +[profile.release] +panic = "abort" # Strip expensive panic clean-up logic +codegen-units = 1 # Compile crates one after another so the compiler can optimize better +lto = true # Enables link to optimizations +opt-level = "s" # Optimize for binary size +strip = true # Remove debug symbols diff --git a/apps/cli/Cargo.toml b/apps/cli/Cargo.toml deleted file mode 100644 index 1b436601f..000000000 --- a/apps/cli/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "sd-cli" -version = "0.1.0" -license = { workspace = true } -repository = { workspace = true } -edition = { workspace = true } - -[dependencies] -# Spacedrive Sub-crates -sd-crypto = { path = "../../crates/crypto" } - -anyhow = { workspace = true } -clap = { workspace = true, features = ["derive"] } -hex = { workspace = true } -tokio = { workspace = true, features = ["io-util", "rt-multi-thread"] } - -indoc = "2.0.4" diff --git a/apps/cli/README.md b/apps/cli/README.md deleted file mode 100644 index cb5156840..000000000 --- a/apps/cli/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# CLI - -Basic CLI for interacting with encrypted files. -Will be expanded to a general Spacedrive CLI in the future. diff --git a/apps/cli/src/main.rs b/apps/cli/src/main.rs deleted file mode 100644 index ca0ee0590..000000000 --- a/apps/cli/src/main.rs +++ /dev/null @@ -1,85 +0,0 @@ -use anyhow::Result; -// use clap::Parser; -// use indoc::printdoc; -// use sd_crypto::header::file::FileHeader; -// use std::path::PathBuf; -// use tokio::fs::File; - -// #[derive(Parser)] -// struct Args { -// #[arg(help = "the file path to get details for")] -// path: PathBuf, -// } - -#[tokio::main] -async fn main() -> Result<()> { - // let args = Args::parse(); - - // let mut reader = File::open(args.path).await.context("unable to open file")?; - // let (header, aad) = FileHeader::from_reader(&mut reader).await?; - // print_crypto_details(&header, &aad); - - Ok(()) -} - -// fn print_crypto_details(header: &FileHeader, aad: &[u8]) { -// printdoc! {" -// Header version: {version} -// Encryption algorithm: {algorithm} -// AAD (hex): {hex} -// ", -// version = header.version, -// algorithm = header.algorithm, -// hex = hex::encode(aad) -// }; - -// header.keyslots.iter().enumerate().for_each(|(i, k)| { -// printdoc! {" -// Keyslot {index}: -// Version: {version} -// Algorithm: {algorithm} -// Hashing algorithm: {hashing_algorithm} -// Salt (hex): {salt} -// Master Key (hex, encrypted): {master} -// Master key nonce (hex): {nonce} -// ", -// index = i + i, -// version = k.version, -// algorithm = k.algorithm, -// hashing_algorithm = k.hashing_algorithm, -// salt = hex::encode(&*k.salt), -// master = hex::encode(&*k.master_key), -// nonce = hex::encode(k.nonce) -// }; -// }); - -// header.metadata.iter().for_each(|m| { -// printdoc! {" -// Metadata: -// Version: {version} -// Algorithm: {algorithm} -// Encrypted size: {size} -// Nonce (hex): {nonce} -// ", -// version = m.version, -// algorithm = m.algorithm, -// size = m.metadata.len(), -// nonce = hex::encode(m.metadata_nonce) -// } -// }); - -// header.preview_media.iter().for_each(|p| { -// printdoc! {" -// Preview Media: -// Version: {version} -// Algorithm: {algorithm} -// Encrypted size: {size} -// Nonce (hex): {nonce} -// ", -// version = p.version, -// algorithm = p.algorithm, -// size = p.media.len(), -// nonce = hex::encode(p.media_nonce) -// }; -// }); -// } diff --git a/crates/deps-generator/Cargo.toml b/apps/deps-generator/Cargo.toml similarity index 66% rename from crates/deps-generator/Cargo.toml rename to apps/deps-generator/Cargo.toml index 2c58af519..03d4b0938 100644 --- a/crates/deps-generator/Cargo.toml +++ b/apps/deps-generator/Cargo.toml @@ -8,10 +8,12 @@ repository = { workspace = true } edition = { workspace = true } [dependencies] -anyhow = { workspace = true } -clap = { workspace = true, features = ["derive"] } -reqwest = { workspace = true, features = ["blocking"] } +# Workspace dependencies +reqwest = { workspace = true, features = ["blocking", "native-tls-vendored"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } +# Specific Deps Generator dependencies +anyhow = "1.0" +clap = { version = "4.5", features = ["derive"] } cargo_metadata = "0.18.1" diff --git a/crates/deps-generator/src/main.rs b/apps/deps-generator/src/main.rs similarity index 100% rename from crates/deps-generator/src/main.rs rename to apps/deps-generator/src/main.rs diff --git a/crates/deps-generator/src/types/backend.rs b/apps/deps-generator/src/types/backend.rs similarity index 100% rename from crates/deps-generator/src/types/backend.rs rename to apps/deps-generator/src/types/backend.rs diff --git a/crates/deps-generator/src/types/cli.rs b/apps/deps-generator/src/types/cli.rs similarity index 100% rename from crates/deps-generator/src/types/cli.rs rename to apps/deps-generator/src/types/cli.rs diff --git a/crates/deps-generator/src/types/frontend.rs b/apps/deps-generator/src/types/frontend.rs similarity index 100% rename from crates/deps-generator/src/types/frontend.rs rename to apps/deps-generator/src/types/frontend.rs diff --git a/crates/deps-generator/src/types/mod.rs b/apps/deps-generator/src/types/mod.rs similarity index 100% rename from crates/deps-generator/src/types/mod.rs rename to apps/deps-generator/src/types/mod.rs diff --git a/apps/desktop/app-icon.png b/apps/desktop/app-icon.png index cff51fb22..9f5d1d44d 100644 Binary files a/apps/desktop/app-icon.png and b/apps/desktop/app-icon.png differ diff --git a/apps/desktop/crates/linux/Cargo.toml b/apps/desktop/crates/linux/Cargo.toml index d551fa03d..c7761d633 100644 --- a/apps/desktop/crates/linux/Cargo.toml +++ b/apps/desktop/crates/linux/Cargo.toml @@ -6,10 +6,11 @@ repository = { workspace = true } edition = { workspace = true } [dependencies] +libc = { workspace = true } tokio = { workspace = true, features = ["fs"] } -libc = "0.2" [target.'cfg(target_os = "linux")'.dependencies] +wgpu = { version = "0.20.0", default-features = false } # WARNING: gtk should follow the same version used by tauri -# https://github.com/tauri-apps/tauri/blob/441eb4f4a5f9af206752c2e287975eb8d5ccfd01/core/tauri/Cargo.toml#L95 -gtk = { version = "0.15", features = [ "v3_20" ] } +# https://github.com/tauri-apps/tauri/blob/tauri-v2.0.0-beta.17/core/tauri/Cargo.toml#L85C1-L85C51 +gtk = { version = "0.18", features = ["v3_24"] } diff --git a/apps/desktop/crates/linux/src/app_info.rs b/apps/desktop/crates/linux/src/app_info.rs index 39834b95a..5b2767670 100644 --- a/apps/desktop/crates/linux/src/app_info.rs +++ b/apps/desktop/crates/linux/src/app_info.rs @@ -1,32 +1,15 @@ -use std::path::{Path, PathBuf}; +use std::path::Path; use gtk::{ gio::{ - content_type_guess, - prelude::AppInfoExt, - prelude::{AppLaunchContextExt, FileExt}, - AppInfo, AppLaunchContext, DesktopAppInfo, File as GioFile, ResourceError, + content_type_guess, prelude::AppInfoExt, prelude::FileExt, AppInfo, AppLaunchContext, + DesktopAppInfo, File as GioFile, ResourceError, }, glib::error::Error as GlibError, - prelude::IsA, }; use tokio::fs::File; use tokio::io::AsyncReadExt; -use crate::env::remove_prefix_from_pathlist; - -fn remove_prefix_from_env_in_ctx( - ctx: &impl IsA, - env_name: &str, - prefix: &impl AsRef, -) { - if let Some(value) = remove_prefix_from_pathlist(env_name, prefix) { - ctx.setenv(env_name, value); - } else { - ctx.unsetenv(env_name); - } -} - thread_local! { static LAUNCH_CTX: AppLaunchContext = { // TODO: Display supports requires GDK, which can only run on the main thread @@ -36,33 +19,8 @@ thread_local! { // "This is an Glib type conversion, it should never fail because GDKAppLaunchContext is a subclass of AppLaunchContext" // )).unwrap_or_default(); - let ctx = AppLaunchContext::default(); - if let Some(appdir) = std::env::var_os("APPDIR").map(PathBuf::from) { - // Remove AppImage paths from environment variables to avoid external applications attempting to use the AppImage's libraries - // https://github.com/AppImage/AppImageKit/blob/701b711f42250584b65a88f6427006b1d160164d/src/AppRun.c#L168-L194 - ctx.unsetenv("PYTHONHOME"); - ctx.unsetenv("GTK_DATA_PREFIX"); - ctx.unsetenv("GTK_THEME"); - ctx.unsetenv("GDK_BACKEND"); - ctx.unsetenv("GTK_EXE_PREFIX"); - ctx.unsetenv("GTK_IM_MODULE_FILE"); - ctx.unsetenv("GDK_PIXBUF_MODULE_FILE"); - - remove_prefix_from_env_in_ctx(&ctx, "PATH", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "LD_LIBRARY_PATH", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "PYTHONPATH", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "XDG_DATA_DIRS", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "PERLLIB", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "GSETTINGS_SCHEMA_DIR", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "QT_PLUGIN_PATH", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "GST_PLUGIN_SYSTEM_PATH", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "GST_PLUGIN_SYSTEM_PATH_1_0", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "GTK_PATH", &appdir); - remove_prefix_from_env_in_ctx(&ctx, "GIO_EXTRA_MODULES", &appdir); - } - - ctx + AppLaunchContext::default() } } diff --git a/apps/desktop/crates/linux/src/env.rs b/apps/desktop/crates/linux/src/env.rs index 9f03592ff..e639c7964 100644 --- a/apps/desktop/crates/linux/src/env.rs +++ b/apps/desktop/crates/linux/src/env.rs @@ -1,29 +1,13 @@ use std::{ collections::HashSet, env, - ffi::{CStr, OsStr, OsString}, - io, mem, + ffi::{CStr, OsStr}, + mem, os::unix::ffi::OsStrExt, - path::{Path, PathBuf}, + path::PathBuf, ptr, }; -fn version(version_str: &str) -> i32 { - let mut version_parts: Vec = version_str - .split('.') - .take(4) // Take up to 4 components - .map(|part| part.parse().unwrap_or(0)) - .collect(); - - // Pad with zeros if needed - version_parts.resize_with(4, Default::default); - - (version_parts[0] * 1_000_000_000) - + (version_parts[1] * 1_000_000) - + (version_parts[2] * 1_000) - + version_parts[3] -} - pub fn get_current_user_home() -> Option { use libc::{getpwuid_r, getuid, passwd, ERANGE}; @@ -192,74 +176,12 @@ pub fn normalize_environment() { ) .expect("PATH must be successfully normalized"); - if let Ok(appdir) = get_appdir() { - println!("Running from APPIMAGE"); - - // Workaround for https://github.com/AppImageCrafters/appimage-builder/issues/175 - env::set_current_dir(appdir.join({ - let appimage_libc_version = version( - std::env::var("APPDIR_LIBC_VERSION") - .expect("AppImage Libc version must be set") - .as_str(), - ); - - let system_lic_version = version({ - #[cfg(target_env = "gnu")] - { - use libc::gnu_get_libc_version; - - let ptr = unsafe { gnu_get_libc_version() }; - if ptr.is_null() { - panic!("Couldn't read glic version"); - } - - unsafe { CStr::from_ptr(ptr) } - .to_str() - .expect("Couldn't read glic version") - } - #[cfg(not(target_env = "gnu"))] - { - // Use the same version as gcompat - // https://git.adelielinux.org/adelie/gcompat/-/blob/current/libgcompat/version.c - std::env::var("GLIBC_FAKE_VERSION").unwrap_or_else(|_| "2.8".to_string()) - } - }); - - if system_lic_version < appimage_libc_version { - "runtime/compat" - } else { - "runtime/default" - } - })) - .expect("Failed to set current directory to $APPDIR"); - - // Bubblewrap does not work from inside appimage - env::set_var("WEBKIT_FORCE_SANDBOX", "0"); - env::set_var("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS", "1"); - - // FIX-ME: This is required because appimage-builder generates a broken GstRegistry, which breaks video playback - env::remove_var("GST_REGISTRY"); - env::remove_var("GST_REGISTRY_UPDATE"); + if has_nvidia() { + // Workaround for: https://github.com/tauri-apps/tauri/issues/9304 + env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1"); } } -pub(crate) fn remove_prefix_from_pathlist( - env_name: &str, - prefix: &impl AsRef, -) -> Option { - env::var_os(env_name).and_then(|value| { - let mut dirs = env::split_paths(&value) - .filter(|dir| !(dir.as_os_str().is_empty() || dir.starts_with(prefix))) - .peekable(); - - if dirs.peek().is_none() { - None - } else { - Some(env::join_paths(dirs).expect("Should not fail because we are only filtering a pathlist retrieved from the environmnet")) - } - }) -} - // Check if snap by looking if SNAP is set and not empty and that the SNAP directory exists pub fn is_snap() -> bool { if let Some(snap) = std::env::var_os("SNAP") { @@ -271,21 +193,6 @@ pub fn is_snap() -> bool { false } -fn get_appdir() -> io::Result { - if let Some(appdir) = std::env::var_os("APPDIR").map(PathBuf::from) { - if appdir.is_absolute() && appdir.is_dir() { - return Ok(appdir); - } - } - - Err(io::Error::new(io::ErrorKind::NotFound, "AppDir not found")) -} - -// Check if appimage by looking if APPDIR is set and is a valid directory -pub fn is_appimage() -> bool { - get_appdir().is_ok() -} - // Check if flatpak by looking if FLATPAK_ID is set and not empty and that the .flatpak-info file exists pub fn is_flatpak() -> bool { if let Some(flatpak_id) = std::env::var_os("FLATPAK_ID") { @@ -296,3 +203,31 @@ pub fn is_flatpak() -> bool { false } + +fn has_nvidia() -> bool { + use wgpu::{ + Backends, DeviceType, Dx12Compiler, Gles3MinorVersion, Instance, InstanceDescriptor, + InstanceFlags, + }; + + let instance = Instance::new(InstanceDescriptor { + flags: InstanceFlags::empty(), + backends: Backends::VULKAN | Backends::GL, + gles_minor_version: Gles3MinorVersion::Automatic, + dx12_shader_compiler: Dx12Compiler::default(), + }); + for adapter in instance.enumerate_adapters(Backends::all()) { + let info = adapter.get_info(); + match info.device_type { + DeviceType::DiscreteGpu | DeviceType::IntegratedGpu | DeviceType::VirtualGpu => { + // Nvidia PCI id + if info.vendor == 0x10de { + return true; + } + } + _ => {} + } + } + + false +} diff --git a/apps/desktop/crates/linux/src/lib.rs b/apps/desktop/crates/linux/src/lib.rs index 65a5e70d8..06200473c 100644 --- a/apps/desktop/crates/linux/src/lib.rs +++ b/apps/desktop/crates/linux/src/lib.rs @@ -4,4 +4,4 @@ mod app_info; mod env; pub use app_info::{list_apps_associated_with_ext, open_file_path, open_files_path_with}; -pub use env::{get_current_user_home, is_appimage, is_flatpak, is_snap, normalize_environment}; +pub use env::{get_current_user_home, is_flatpak, is_snap, normalize_environment}; diff --git a/apps/desktop/crates/macos/Cargo.toml b/apps/desktop/crates/macos/Cargo.toml index 0dd2158b1..72faca5e4 100644 --- a/apps/desktop/crates/macos/Cargo.toml +++ b/apps/desktop/crates/macos/Cargo.toml @@ -5,10 +5,8 @@ license = { workspace = true } repository = { workspace = true } edition = { workspace = true } -[dependencies] - [target.'cfg(target_os = "macos")'.dependencies] -swift-rs = { workspace = true, features = ["serde"] } +swift-rs = { version = "1.0.6", features = ["serde"] } [target.'cfg(target_os = "macos")'.build-dependencies] -swift-rs = { workspace = true, features = ["build"] } +swift-rs = { version = "1.0.6", features = ["build"] } diff --git a/apps/desktop/crates/macos/src-swift/window.swift b/apps/desktop/crates/macos/src-swift/window.swift index 3a8523ebb..e5f50f871 100644 --- a/apps/desktop/crates/macos/src-swift/window.swift +++ b/apps/desktop/crates/macos/src-swift/window.swift @@ -1,4 +1,5 @@ import AppKit +import SwiftRs @objc public enum AppThemeType: Int { @@ -7,6 +8,34 @@ public enum AppThemeType: Int { case dark = 1 } +var activity: NSObjectProtocol? + +@_cdecl("disable_app_nap") +public func disableAppNap(reason: SRString) -> Bool { + // Check if App Nap is already disabled + guard activity == nil else { + return false + } + + activity = ProcessInfo.processInfo.beginActivity( + options: .userInitiatedAllowingIdleSystemSleep, + reason: reason.toString() + ) + return true +} + +@_cdecl("enable_app_nap") +public func enableAppNap() -> Bool { + // Check if App Nap is already enabled + guard let pinfo = activity else { + return false + } + + ProcessInfo.processInfo.endActivity(pinfo) + activity = nil + return true +} + @_cdecl("lock_app_theme") public func lockAppTheme(themeType: AppThemeType) { var theme: NSAppearance? @@ -30,20 +59,6 @@ public func lockAppTheme(themeType: AppThemeType) { } } -@_cdecl("blur_window_background") -public func blurWindowBackground(window: NSWindow) { - let windowContent = window.contentView! - let blurryView = NSVisualEffectView() - - blurryView.material = .sidebar - blurryView.state = .followsWindowActiveState - blurryView.blendingMode = .behindWindow - blurryView.wantsLayer = true - - window.contentView = blurryView - blurryView.addSubview(windowContent) -} - @_cdecl("set_titlebar_style") public func setTitlebarStyle(window: NSWindow, fullScreen: Bool) { // this results in far less visual artifacts if we just manage it ourselves (the native taskbar re-appears when fullscreening/un-fullscreening) diff --git a/apps/desktop/crates/macos/src/lib.rs b/apps/desktop/crates/macos/src/lib.rs index 77fec31da..9a1e07d92 100644 --- a/apps/desktop/crates/macos/src/lib.rs +++ b/apps/desktop/crates/macos/src/lib.rs @@ -9,11 +9,10 @@ pub enum AppThemeType { Dark = 1 as Int, } +swift!(pub fn disable_app_nap(reason: &SRString) -> Bool); +swift!(pub fn enable_app_nap() -> Bool); swift!(pub fn lock_app_theme(theme_type: Int)); -swift!(pub fn blur_window_background(window: &NSObject)); swift!(pub fn set_titlebar_style(window: &NSObject, is_fullscreen: Bool)); -// swift!(pub fn setup_disk_watcher(window: &NSObject, transparent: Bool, large: Bool)); -// swift!(pub fn disk_event_callback(mounted: Bool, path: &SRString)); swift!(pub fn reload_webview(webview: &NSObject)); #[repr(C)] @@ -31,20 +30,3 @@ pub fn open_file_paths_with(file_urls: &[String], with_url: &str) { let file_url = file_urls.join("\0"); unsafe { open_file_path_with(&file_url.as_str().into(), &with_url.into()) } } - -// main!(|_| { -// unsafe { setup_disk_watcher() }; -// print!("Waiting for disk events... "); -// Ok(()) -// }); - -// #[no_mangle] -// pub extern "C" fn disk_event_callback(mounted: Bool, path: *const SRString) { -// let mounted_str = if mounted { "mounted" } else { "unmounted" }; - -// // Convert the raw pointer to a reference -// let path_ref = unsafe { &*path }; -// let path_str = path_ref.to_string(); // Assuming SRString has a to_string method - -// println!("Disk at path {} was {}", path_str, mounted_str); -// } diff --git a/apps/desktop/crates/windows/Cargo.toml b/apps/desktop/crates/windows/Cargo.toml index f9a4ba616..a41ca4bff 100644 --- a/apps/desktop/crates/windows/Cargo.toml +++ b/apps/desktop/crates/windows/Cargo.toml @@ -6,10 +6,10 @@ repository = { workspace = true } edition = { workspace = true } [dependencies] +libc = { workspace = true } normpath = { workspace = true } thiserror = { workspace = true } -libc = "0.2" [target.'cfg(target_os = "windows")'.dependencies.windows] -version = "0.51" +version = "0.57" features = ["Win32_UI_Shell", "Win32_Foundation", "Win32_System_Com"] diff --git a/apps/desktop/crates/windows/src/lib.rs b/apps/desktop/crates/windows/src/lib.rs index 22dee47e6..63951a109 100644 --- a/apps/desktop/crates/windows/src/lib.rs +++ b/apps/desktop/crates/windows/src/lib.rs @@ -10,6 +10,7 @@ use normpath::PathExt; use windows::{ core::{HSTRING, PCWSTR}, Win32::{ + Foundation::E_FAIL, System::Com::{ CoInitializeEx, CoUninitialize, IDataObject, COINIT_APARTMENTTHREADED, COINIT_DISABLE_OLE1DDE, @@ -97,11 +98,15 @@ pub fn open_file_path_with(path: impl AsRef, url: &str) -> Result<()> { ensure_com_initialized(); let path = path.as_ref(); - let ext = path.extension().ok_or(Error::OK)?; + let ext = path + .extension() + .ok_or(Error::new(E_FAIL, "No file extension"))?; for handler in list_apps_associated_with_ext(ext)?.iter() { let name = unsafe { handler.GetName()?.to_string()? }; if name == url { - let path = path.normalize_virtually().map_err(|_| Error::OK)?; + let path = path + .normalize_virtually() + .map_err(|e| Error::new(E_FAIL, e.to_string()))?; let wide_path = path .as_os_str() .encode_wide() @@ -116,5 +121,8 @@ pub fn open_file_path_with(path: impl AsRef, url: &str) -> Result<()> { } } - Err(Error::OK) + Err(Error::new( + E_FAIL, + "No available handler for the given path", + )) } diff --git a/apps/desktop/package.json b/apps/desktop/package.json index d815a0594..11de83202 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -20,7 +20,10 @@ "@sd/ui": "workspace:*", "@t3-oss/env-core": "^0.7.1", "@tanstack/react-query": "^4.36.1", - "@tauri-apps/api": "1.5.1", + "@tauri-apps/api": "next", + "@tauri-apps/plugin-dialog": "2.0.0-beta.3", + "@tauri-apps/plugin-os": "2.0.0-beta.3", + "@tauri-apps/plugin-shell": "2.0.0-beta.3", "consistent-hash": "^1.2.2", "immer": "^10.0.3", "react": "^18.2.0", @@ -31,7 +34,7 @@ "devDependencies": { "@sd/config": "workspace:*", "@sentry/vite-plugin": "^2.16.0", - "@tauri-apps/cli": "^1.5.11", + "@tauri-apps/cli": "next", "@types/react": "^18.2.67", "@types/react-dom": "^18.2.22", "sass": "^1.72.0", diff --git a/apps/desktop/src-tauri/.gitignore b/apps/desktop/src-tauri/.gitignore index 1edb8fac3..742fd18b6 100644 --- a/apps/desktop/src-tauri/.gitignore +++ b/apps/desktop/src-tauri/.gitignore @@ -1,6 +1,7 @@ # Generated by Cargo # will have compiled files and executables /target/ +gen/ WixTools *.dll *.dll.* diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 73b053dc0..4d3910fd0 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sd-desktop" -version = "0.2.11" +version = "0.3.2" description = "The universal file manager." authors = ["Spacedrive Technology Inc "] default-run = "sd-desktop" @@ -10,59 +10,68 @@ edition = { workspace = true } [dependencies] # Spacedrive Sub-crates -sd-core = { path = "../../../core", features = [ - "ffmpeg", - "heif", -] } +sd-core = { path = "../../../core", features = ["ffmpeg", "heif"] } sd-fda = { path = "../../../crates/fda" } sd-prisma = { path = "../../../crates/prisma" } +# Workspace dependencies axum = { workspace = true, features = ["headers", "query"] } -hyper = "0.14.28" +directories = { workspace = true } futures = { workspace = true } +hyper = { workspace = true } http = { workspace = true } prisma-client-rust = { workspace = true } rand = { workspace = true } rspc = { workspace = true, features = ["tauri", "tracing"] } serde = { workspace = true } +serde_json = { workspace = true } specta = { workspace = true } +strum = { workspace = true, features = ["derive"] } tokio = { workspace = true, features = ["sync"] } tracing = { workspace = true } -tauri-specta = { workspace = true, features = ["typescript"] } +thiserror = { workspace = true } uuid = { workspace = true, features = ["serde"] } -thiserror.workspace = true -opener = { version = "0.6.1", features = ["reveal"] } -tauri = { version = "=1.5.3", features = [ - "macos-private-api", - "path-all", - "protocol-all", - "os-all", - "shell-all", - "dialog-all", - "linux-protocol-headers", - "updater", - "window-all", - "native-tls-vendored", - "tracing", -] } -directories = "5.0.1" +# Specific Desktop dependencies +# WARNING: Do NOT enable default features, as that vendors dbus (see below) +opener = { version = "0.7.1", features = ["reveal"], default-features = false } +tauri = { version = "=2.0.0-beta.17", features = [ + "macos-private-api", + "unstable", + "linux-libxdo", +] } # Update blocked by rspc +tauri-plugin-updater = "2.0.0-beta" +tauri-plugin-dialog = "2.0.0-beta" +tauri-plugin-os = "2.0.0-beta" +tauri-plugin-shell = "2.0.0-beta" +tauri-runtime = { version = "=2.0.0-beta.15" } # Update blocked by tauri +tauri-specta = { version = "=2.0.0-rc.8", features = ["typescript"] } +tauri-utils = { version = "=2.0.0-beta.16" } # Update blocked by tauri [target.'cfg(target_os = "linux")'.dependencies] +# Spacedrive Sub-crates sd-desktop-linux = { path = "../crates/linux" } -webkit2gtk = { version = "0.18.2", features = ["v2_2"] } + +# Specific Desktop dependencies +# WARNING: dbus must NOT be vendored, as that breaks the app on Linux,X11,Nvidia +dbus = { version = "0.9.7", features = ["stdfd"] } +# https://github.com/tauri-apps/tauri/blob/tauri-v2.0.0-beta.17/core/tauri/Cargo.toml#L86 +webkit2gtk = { version = "=2.0.1", features = ["v2_38"] } [target.'cfg(target_os = "macos")'.dependencies] +# Spacedrive Sub-crates sd-desktop-macos = { path = "../crates/macos" } [target.'cfg(target_os = "windows")'.dependencies] +# Spacedrive Sub-crates sd-desktop-windows = { path = "../crates/windows" } -webview2-com = "0.19.1" [build-dependencies] -tauri-build = "1.5.0" +# Specific Desktop dependencies +tauri-build = "2.0.0-beta" [features] default = ["custom-protocol"] +devtools = ["tauri/devtools"] ai-models = ["sd-core/ai"] custom-protocol = ["tauri/custom-protocol"] diff --git a/apps/desktop/src-tauri/capabilities/default.json b/apps/desktop/src-tauri/capabilities/default.json new file mode 100644 index 000000000..90cc19ebd --- /dev/null +++ b/apps/desktop/src-tauri/capabilities/default.json @@ -0,0 +1,30 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Capability for the main window", + "windows": ["main"], + "permissions": [ + "app:default", + "event:default", + "image:default", + "menu:default", + "path:default", + "resources:default", + "window:default", + "tray:default", + "webview:default", + "window:default", + "shell:allow-open", + "dialog:allow-open", + "dialog:allow-save", + "dialog:allow-confirm", + "os:allow-os-type", + "window:allow-close", + "window:allow-create", + "window:allow-maximize", + "window:allow-minimize", + "window:allow-toggle-maximize", + "window:allow-start-dragging", + "webview:allow-internal-toggle-devtools" + ] +} diff --git a/apps/desktop/src-tauri/dmg-background.png b/apps/desktop/src-tauri/dmg-background.png index 5b252941b..4e022ad98 100644 Binary files a/apps/desktop/src-tauri/dmg-background.png and b/apps/desktop/src-tauri/dmg-background.png differ diff --git a/apps/desktop/src-tauri/icons/128x128.png b/apps/desktop/src-tauri/icons/128x128.png index 561d1d022..a31ad0b48 100644 Binary files a/apps/desktop/src-tauri/icons/128x128.png and b/apps/desktop/src-tauri/icons/128x128.png differ diff --git a/apps/desktop/src-tauri/icons/128x128@2x.png b/apps/desktop/src-tauri/icons/128x128@2x.png index 7ae119f99..fb5559627 100644 Binary files a/apps/desktop/src-tauri/icons/128x128@2x.png and b/apps/desktop/src-tauri/icons/128x128@2x.png differ diff --git a/apps/desktop/src-tauri/icons/Square107x107Logo.png b/apps/desktop/src-tauri/icons/Square107x107Logo.png index 33725fc7b..1ca6f8ff0 100644 Binary files a/apps/desktop/src-tauri/icons/Square107x107Logo.png and b/apps/desktop/src-tauri/icons/Square107x107Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square142x142Logo.png b/apps/desktop/src-tauri/icons/Square142x142Logo.png index ea580c00b..f6fa533e5 100644 Binary files a/apps/desktop/src-tauri/icons/Square142x142Logo.png and b/apps/desktop/src-tauri/icons/Square142x142Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square150x150Logo.png b/apps/desktop/src-tauri/icons/Square150x150Logo.png index 2cb12bde1..ce1c7a5bc 100644 Binary files a/apps/desktop/src-tauri/icons/Square150x150Logo.png and b/apps/desktop/src-tauri/icons/Square150x150Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square284x284Logo.png b/apps/desktop/src-tauri/icons/Square284x284Logo.png index 4b581d42d..0eb8a9d06 100644 Binary files a/apps/desktop/src-tauri/icons/Square284x284Logo.png and b/apps/desktop/src-tauri/icons/Square284x284Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square310x310Logo.png b/apps/desktop/src-tauri/icons/Square310x310Logo.png index 5da7e1be5..1b58e126c 100644 Binary files a/apps/desktop/src-tauri/icons/Square310x310Logo.png and b/apps/desktop/src-tauri/icons/Square310x310Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square44x44Logo.png b/apps/desktop/src-tauri/icons/Square44x44Logo.png index 283e7523b..b58dbad49 100644 Binary files a/apps/desktop/src-tauri/icons/Square44x44Logo.png and b/apps/desktop/src-tauri/icons/Square44x44Logo.png differ diff --git a/apps/desktop/src-tauri/icons/Square89x89Logo.png b/apps/desktop/src-tauri/icons/Square89x89Logo.png index bfb6c1741..8641a8140 100644 Binary files a/apps/desktop/src-tauri/icons/Square89x89Logo.png and b/apps/desktop/src-tauri/icons/Square89x89Logo.png differ diff --git a/apps/desktop/src-tauri/icons/StoreLogo.png b/apps/desktop/src-tauri/icons/StoreLogo.png index f865b8b02..708a13a0c 100644 Binary files a/apps/desktop/src-tauri/icons/StoreLogo.png and b/apps/desktop/src-tauri/icons/StoreLogo.png differ diff --git a/apps/desktop/src-tauri/icons/icon.png b/apps/desktop/src-tauri/icons/icon.png index 8746e89d0..9f5d1d44d 100644 Binary files a/apps/desktop/src-tauri/icons/icon.png and b/apps/desktop/src-tauri/icons/icon.png differ diff --git a/apps/desktop/src-tauri/src/file.rs b/apps/desktop/src-tauri/src/file.rs index 4a2f3525d..882be7e0a 100644 --- a/apps/desktop/src-tauri/src/file.rs +++ b/apps/desktop/src-tauri/src/file.rs @@ -373,21 +373,6 @@ pub async fn open_ephemeral_file_with(paths_and_urls: Vec) -> Result fn inner_reveal_paths(paths: impl Iterator) { for path in paths { - #[cfg(target_os = "linux")] - if sd_desktop_linux::is_appimage() { - // This is a workaround for the app, when package inside an AppImage, crashing when using opener::reveal. - if let Err(e) = sd_desktop_linux::open_file_path(if path.is_file() { - path.parent().unwrap_or(&path) - } else { - &path - }) { - error!("Failed to open logs dir: {e:#?}"); - } - } else if let Err(e) = opener::reveal(path) { - error!("Failed to open logs dir: {e:#?}"); - } - - #[cfg(not(target_os = "linux"))] if let Err(e) = opener::reveal(path) { error!("Failed to open logs dir: {e:#?}"); } diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index c925b7d95..3b8d617ae 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -3,24 +3,17 @@ windows_subsystem = "windows" )] -use std::{ - collections::HashMap, - fs, - path::PathBuf, - sync::{Arc, Mutex, PoisonError}, - time::Duration, -}; +use std::{fs, path::PathBuf, process::Command, sync::Arc, time::Duration}; +use menu::{set_enabled, MenuEvent}; use sd_core::{Node, NodeError}; use sd_fda::DiskAccess; use serde::{Deserialize, Serialize}; -use tauri::{ - api::path, ipc::RemoteDomainAccessScope, window::PlatformWebview, AppHandle, FileDropEvent, - Manager, Window, WindowEvent, -}; +use tauri::{async_runtime::block_on, webview::PlatformWebview, AppHandle, Manager, WindowEvent}; use tauri_plugins::{sd_error_plugin, sd_server_plugin}; -use tauri_specta::{collect_events, ts, Event}; +use tauri_specta::{collect_events, ts}; +use tokio::task::block_in_place; use tokio::time::sleep; use tracing::error; @@ -33,35 +26,32 @@ mod updater; #[tauri::command(async)] #[specta::specta] async fn app_ready(app_handle: AppHandle) { - let window = app_handle.get_window("main").unwrap(); + let window = app_handle.get_webview_window("main").unwrap(); window.show().unwrap(); } #[tauri::command(async)] #[specta::specta] -// If this erorrs, we don't have FDA and we need to re-prompt for it +// If this errors, we don't have FDA and we need to re-prompt for it async fn request_fda_macos() { DiskAccess::request_fda().expect("Unable to request full disk access"); } #[tauri::command(async)] #[specta::specta] -async fn set_menu_bar_item_state(_window: tauri::Window, _id: String, _enabled: bool) { - #[cfg(target_os = "macos")] - { - _window - .menu_handle() - .get_item(&_id) - .set_enabled(_enabled) - .expect("Unable to modify menu item"); - } +async fn set_menu_bar_item_state(window: tauri::Window, event: MenuEvent, enabled: bool) { + let menu = window + .menu() + .expect("unable to get menu for current window"); + + set_enabled(&menu, event, enabled); } #[tauri::command(async)] #[specta::specta] async fn reload_webview(app_handle: AppHandle) { app_handle - .get_window("main") + .get_webview_window("main") .expect("Error getting window handle") .with_webview(reload_webview_inner) .expect("Error while reloading webview"); @@ -76,7 +66,7 @@ fn reload_webview_inner(webview: PlatformWebview) { } #[cfg(target_os = "linux")] { - use webkit2gtk::traits::WebViewExt; + use webkit2gtk::WebViewExt; webview.inner().reload(); } @@ -94,8 +84,10 @@ fn reload_webview_inner(webview: PlatformWebview) { #[tauri::command(async)] #[specta::specta] async fn reset_spacedrive(app_handle: AppHandle) { - let data_dir = path::data_dir() - .unwrap_or_else(|| PathBuf::from("./")) + let data_dir = app_handle + .path() + .data_dir() + .unwrap_or_else(|_| PathBuf::from("./")) .join("spacedrive"); #[cfg(debug_assertions)] @@ -111,25 +103,9 @@ async fn reset_spacedrive(app_handle: AppHandle) { #[tauri::command(async)] #[specta::specta] -async fn refresh_menu_bar( - _node: tauri::State<'_, Arc>, - _app_handle: AppHandle, -) -> Result<(), ()> { - #[cfg(target_os = "macos")] - { - let menu_handles: Vec = _app_handle - .windows() - .iter() - .map(|x| x.1.menu_handle()) - .collect(); - - let has_library = !_node.libraries.get_all().await.is_empty(); - - for menu in menu_handles { - menu::set_library_locked_menu_items_enabled(menu, has_library); - } - } - +async fn refresh_menu_bar(node: tauri::State<'_, Arc>, app: AppHandle) -> Result<(), ()> { + let has_library = !node.libraries.get_all().await.is_empty(); + menu::refresh_menu_bar(&app, has_library); Ok(()) } @@ -149,6 +125,47 @@ async fn open_logs_dir(node: tauri::State<'_, Arc>) -> Result<(), ()> { }) } +#[tauri::command(async)] +#[specta::specta] +async fn open_trash_in_os_explorer() -> Result<(), ()> { + #[cfg(target_os = "macos")] + { + let full_path = format!("{}/.Trash/", std::env::var("HOME").unwrap()); + + Command::new("open") + .arg(full_path) + .spawn() + .map_err(|err| error!("Error opening trash: {err:#?}"))? + .wait() + .map_err(|err| error!("Error opening trash: {err:#?}"))?; + + Ok(()) + } + + #[cfg(target_os = "windows")] + { + Command::new("explorer") + .arg("shell:RecycleBinFolder") + .spawn() + .map_err(|err| error!("Error opening trash: {err:#?}"))? + .wait() + .map_err(|err| error!("Error opening trash: {err:#?}"))?; + return Ok(()); + } + + #[cfg(target_os = "linux")] + { + Command::new("xdg-open") + .arg("trash://") + .spawn() + .map_err(|err| error!("Error opening trash: {err:#?}"))? + .wait() + .map_err(|err| error!("Error opening trash: {err:#?}"))?; + + Ok(()) + } +} + #[derive(Debug, Clone, Serialize, Deserialize, specta::Type, tauri_specta::Event)] #[serde(tag = "type")] pub enum DragAndDropEvent { @@ -157,11 +174,6 @@ pub enum DragAndDropEvent { Cancelled, } -#[derive(Default)] -pub struct DragAndDropState { - windows: HashMap>, -} - const CLIENT_ID: &str = "2abb241e-40b8-4517-a3e3-5594375c8fbb"; #[tokio::main] @@ -169,46 +181,8 @@ async fn main() -> tauri::Result<()> { #[cfg(target_os = "linux")] sd_desktop_linux::normalize_environment(); - let data_dir = path::data_dir() - .unwrap_or_else(|| PathBuf::from("./")) - .join("spacedrive"); - - #[cfg(debug_assertions)] - let data_dir = data_dir.join("dev"); - - // The `_guard` must be assigned to variable for flushing remaining logs on main exit through Drop - let (_guard, result) = match Node::init_logger(&data_dir) { - Ok(guard) => ( - Some(guard), - Node::new(data_dir, sd_core::Env::new(CLIENT_ID)).await, - ), - Err(err) => (None, Err(NodeError::Logger(err))), - }; - - let app = tauri::Builder::default(); - - let (node_router, app) = match result { - Ok((node, router)) => (Some((node, router)), app), - Err(err) => { - error!("Error starting up the node: {err:#?}"); - (None, app.plugin(sd_error_plugin(err))) - } - }; - - let (node, router) = node_router.expect("Unable to get the node or router"); - - let should_clear_localstorage = node.libraries.get_all().await.is_empty(); - - let app = app - .plugin(rspc::integrations::tauri::plugin(router, { - let node = node.clone(); - move || node.clone() - })) - .plugin(sd_server_plugin(node.clone()).await.unwrap()) // TODO: Handle `unwrap` - .manage(node.clone()); - - let specta_builder = { - let specta_builder = ts::builder() + let (invoke_handler, register_events) = { + let builder = ts::builder() .events(collect_events![DragAndDropEvent]) .commands(tauri_specta::collect_commands![ app_ready, @@ -218,6 +192,7 @@ async fn main() -> tauri::Result<()> { reload_webview, set_menu_bar_item_state, request_fda_macos, + open_trash_in_os_explorer, file::open_file_paths, file::open_ephemeral_files, file::get_file_path_open_with_apps, @@ -226,224 +201,148 @@ async fn main() -> tauri::Result<()> { file::open_ephemeral_file_with, file::reveal_items, theme::lock_app_theme, - // TODO: move to plugin w/tauri-specta updater::check_for_update, updater::install_update ]) .config(specta::ts::ExportConfig::default().formatter(specta::ts::formatter::prettier)); #[cfg(debug_assertions)] - let specta_builder = specta_builder.path("../src/commands.ts"); + let builder = builder.path("../src/commands.ts"); - specta_builder.into_plugin() + builder.build().unwrap() }; - let file_drop_status = Arc::new(Mutex::new(DragAndDropState::default())); - let app = app - .plugin(updater::plugin()) - // .plugin(tauri_plugin_window_state::Builder::default().build()) - .plugin(specta_builder) + tauri::Builder::default() + .invoke_handler(invoke_handler) .setup(move |app| { - let app = app.handle(); + // We need a the app handle to determine the data directory now. + // This means all the setup code has to be within `setup`, however it doesn't support async so we `block_on`. + block_in_place(|| { + block_on(async move { + register_events(app); - println!("setup"); + let data_dir = app + .path() + .data_dir() + .unwrap_or_else(|_| PathBuf::from("./")) + .join("spacedrive"); - app.windows().iter().for_each(|(_, window)| { - if should_clear_localstorage { - println!("bruh?"); - window.eval("localStorage.clear();").ok(); - } + #[cfg(debug_assertions)] + let data_dir = data_dir.join("dev"); - tokio::spawn({ - let window = window.clone(); - async move { - sleep(Duration::from_secs(3)).await; - if !window.is_visible().unwrap_or(true) { - // This happens if the JS bundle crashes and hence doesn't send ready event. - println!( - "Window did not emit `app_ready` event fast enough. Showing window..." - ); - window.show().expect("Main window should show"); + // The `_guard` must be assigned to variable for flushing remaining logs on main exit through Drop + let (_guard, result) = match Node::init_logger(&data_dir) { + Ok(guard) => ( + Some(guard), + Node::new(data_dir, sd_core::Env::new(CLIENT_ID)).await, + ), + Err(err) => (None, Err(NodeError::Logger(err))), + }; + + let handle = app.handle(); + let (node, router) = match result { + Ok(r) => r, + Err(err) => { + error!("Error starting up the node: {err:#?}"); + handle.plugin(sd_error_plugin(err))?; + return Ok(()); } - } - }); + }; - #[cfg(target_os = "windows")] - window.set_decorations(true).unwrap(); + let should_clear_localstorage = node.libraries.get_all().await.is_empty(); - #[cfg(target_os = "macos")] - { - use sd_desktop_macos::{blur_window_background, set_titlebar_style}; + handle.plugin(rspc::integrations::tauri::plugin(router, { + let node = node.clone(); + move || node.clone() + }))?; + handle.plugin(sd_server_plugin(node.clone()).await.unwrap())?; // TODO: Handle `unwrap` + handle.manage(node.clone()); - let nswindow = window.ns_window().unwrap(); - - unsafe { set_titlebar_style(&nswindow, false) }; - unsafe { blur_window_background(&nswindow) }; - - tokio::spawn({ - let libraries = node.libraries.clone(); - let menu_handle = window.menu_handle(); - async move { - if libraries.get_all().await.is_empty() { - menu::set_library_locked_menu_items_enabled(menu_handle, false); + handle.windows().iter().for_each(|(_, window)| { + if should_clear_localstorage { + println!("cleaning localStorage"); + for webview in window.webviews() { + webview.eval("localStorage.clear();").ok(); } } + + tokio::spawn({ + let window = window.clone(); + async move { + sleep(Duration::from_secs(3)).await; + if !window.is_visible().unwrap_or(true) { + // This happens if the JS bundle crashes and hence doesn't send ready event. + println!( + "Window did not emit `app_ready` event fast enough. Showing window..." + ); + window.show().expect("Main window should show"); + } + } + }); + + #[cfg(target_os = "windows")] + window.set_decorations(false).unwrap(); + + #[cfg(target_os = "macos")] + { + unsafe { + sd_desktop_macos::set_titlebar_style( + &window.ns_window().expect("NSWindows must exist on macOS"), + false, + ); + sd_desktop_macos::disable_app_nap( + &"File indexer needs to run unimpeded".into(), + ); + }; + } }); - } - }); - // Configure IPC for custom protocol - app.ipc_scope().configure_remote_access( - RemoteDomainAccessScope::new("localhost") - .allow_on_scheme("spacedrive") - .add_window("main"), - ); - - Ok(()) + Ok(()) + }) + }) }) - .on_menu_event(menu::handle_menu_event) - .on_window_event(move |event| match event.event() { + .on_window_event(move |window, event| match event { // macOS expected behavior is for the app to not exit when the main window is closed. // Instead, the window is hidden and the dock icon remains so that on user click it should show the window again. #[cfg(target_os = "macos")] WindowEvent::CloseRequested { api, .. } => { // TODO: make this multi-window compatible in the future - event - .window() + window .app_handle() .hide() .expect("Window should hide on macOS"); api.prevent_close(); } - WindowEvent::FileDrop(drop) => { - let window = event.window(); - let mut file_drop_status = file_drop_status - .lock() - .unwrap_or_else(PoisonError::into_inner); - - match drop { - FileDropEvent::Hovered(paths) => { - // Look this shouldn't happen but let's be sure we don't leak threads. - if file_drop_status.windows.contains_key(window) { - return; - } - - // We setup a thread to keep emitting the updated position of the cursor - // It will be killed when the `FileDropEvent` is finished or cancelled. - let paths = paths.clone(); - file_drop_status.windows.insert(window.clone(), { - let window = window.clone(); - tokio::spawn(async move { - let (mut last_x, mut last_y) = (0.0, 0.0); - loop { - let (x, y) = mouse_position(&window); - - let x_diff = difference(x, last_x); - let y_diff = difference(y, last_y); - - // If the mouse hasn't moved much we will "debounce" the event - if x_diff > 28.0 || y_diff > 28.0 { - last_x = x; - last_y = y; - - DragAndDropEvent::Hovered { - paths: paths - .iter() - .filter_map(|x| x.to_str().map(|x| x.to_string())) - .collect(), - x, - y, - } - .emit(&window) - .ok(); - } - - sleep(Duration::from_millis(125)).await; - } - }) - }); - } - FileDropEvent::Dropped(paths) => { - if let Some(handle) = file_drop_status.windows.remove(window) { - handle.abort(); - } - - let (x, y) = mouse_position(window); - DragAndDropEvent::Dropped { - paths: paths - .iter() - .filter_map(|x| x.to_str().map(|x| x.to_string())) - .collect(), - x, - y, - } - .emit(window) - .ok(); - } - FileDropEvent::Cancelled => { - if let Some(handle) = file_drop_status.windows.remove(window) { - handle.abort(); - } - - DragAndDropEvent::Cancelled.emit(window).ok(); - } - _ => unreachable!(), - } - } WindowEvent::Resized(_) => { - let (_state, command) = if event - .window() - .is_fullscreen() - .expect("Can't get fullscreen state") - { - (true, "window_fullscreened") - } else { - (false, "window_not_fullscreened") - }; + let (_state, command) = + if window.is_fullscreen().expect("Can't get fullscreen state") { + (true, "window_fullscreened") + } else { + (false, "window_not_fullscreened") + }; - event - .window() + window .emit("keybind", command) .expect("Unable to emit window event"); #[cfg(target_os = "macos")] { - let nswindow = event.window().ns_window().unwrap(); + let nswindow = window.ns_window().unwrap(); unsafe { sd_desktop_macos::set_titlebar_style(&nswindow, _state) }; } } _ => {} }) - .menu(menu::get_menu()) + .menu(menu::setup_menu) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_os::init()) + .plugin(tauri_plugin_shell::init()) + // TODO: Bring back Tauri Plugin Window State - it was buggy so we removed it. + .plugin(tauri_plugin_updater::Builder::new().build()) + .plugin(updater::plugin()) .manage(updater::State::default()) - .build(tauri::generate_context!())?; + .build(tauri::generate_context!())? + .run(|_, _| {}); - app.run(|_, _| {}); Ok(()) } - -// Get the mouse position relative to the window -fn mouse_position(window: &Window) -> (f64, f64) { - // We apply the OS scaling factor. - // Tauri/Webkit *should* be responsible for this but it would seem it is bugged on the current webkit/tauri/wry/tao version. - // Using newer Webkit did fix this automatically but I can't for the life of me work out how to get the right glibc versions in CI so we can't ship it. - let scale_factor = window.scale_factor().unwrap(); - - let window_pos = window.outer_position().unwrap(); - let cursor_pos = window.cursor_position().unwrap(); - - ( - (cursor_pos.x - window_pos.x as f64) / scale_factor, - (cursor_pos.y - window_pos.y as f64) / scale_factor, - ) -} - -// The distance between two numbers as a positive integer. -fn difference(a: f64, b: f64) -> f64 { - let x = a - b; - if x < 0.0 { - x * -1.0 - } else { - x - } -} diff --git a/apps/desktop/src-tauri/src/menu.rs b/apps/desktop/src-tauri/src/menu.rs index 3f4e35ae1..90cec4af4 100644 --- a/apps/desktop/src-tauri/src/menu.rs +++ b/apps/desktop/src-tauri/src/menu.rs @@ -1,191 +1,271 @@ -use tauri::{Manager, Menu, WindowMenuEvent, Wry}; +use std::str::FromStr; -#[cfg(target_os = "macos")] -use tauri::{AboutMetadata, CustomMenuItem, MenuItem, Submenu}; +use serde::Deserialize; +use specta::Type; +use tauri::{ + menu::{Menu, MenuItemKind}, + AppHandle, Manager, Wry, +}; +use tracing::error; -pub fn get_menu() -> Menu { - #[cfg(target_os = "macos")] - { - custom_menu_bar() - } - #[cfg(not(target_os = "macos"))] - { - Menu::new() - } +#[derive( + Debug, Clone, Copy, Type, Deserialize, strum::EnumString, strum::AsRefStr, strum::Display, +)] +pub enum MenuEvent { + NewLibrary, + NewFile, + NewDirectory, + AddLocation, + OpenOverview, + OpenSearch, + OpenSettings, + ReloadExplorer, + SetLayoutGrid, + SetLayoutList, + SetLayoutMedia, + ToggleDeveloperTools, + NewWindow, + ReloadWebview, } -// update this whenever you add something which requires a valid library to use -#[cfg(target_os = "macos")] -const LIBRARY_LOCKED_MENU_IDS: [&str; 12] = [ - "new_window", - "open_overview", - "open_search", - "open_settings", - "reload_explorer", - "layout_grid", - "layout_list", - "layout_media", - "new_file", - "new_directory", - "new_library", // disabled because the first one should at least be done via onboarding - "add_location", +/// Menu items which require a library to be open to use. +/// They will be disabled/enabled automatically. +const LIBRARY_LOCKED_MENU_IDS: &[MenuEvent] = &[ + MenuEvent::NewWindow, + MenuEvent::OpenOverview, + MenuEvent::OpenSearch, + MenuEvent::OpenSettings, + MenuEvent::ReloadExplorer, + MenuEvent::SetLayoutGrid, + MenuEvent::SetLayoutList, + MenuEvent::SetLayoutMedia, + MenuEvent::NewFile, + MenuEvent::NewDirectory, + MenuEvent::NewLibrary, + MenuEvent::AddLocation, ]; -#[cfg(target_os = "macos")] -fn custom_menu_bar() -> Menu { - let app_menu = Menu::new() - .add_native_item(MenuItem::About( - "Spacedrive".to_string(), - AboutMetadata::new() - .authors(vec!["Spacedrive Technology Inc.".to_string()]) - .license("AGPL-3.0-only") - .version(env!("CARGO_PKG_VERSION")) - .website("https://spacedrive.com/") - .website_label("Spacedrive.com"), - )) - .add_native_item(MenuItem::Separator) - .add_item(CustomMenuItem::new("new_library", "New Library").disabled()) // TODO(brxken128): add keybind handling here - .add_submenu(Submenu::new( - "Library", - Menu::new() - .add_item(CustomMenuItem::new("library_", "Library 1").disabled()) - .add_item(CustomMenuItem::new("library_", "Library 2").disabled()), // TODO: enumerate libraries and make this a library selector - )) - .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::Hide) - .add_native_item(MenuItem::HideOthers) - .add_native_item(MenuItem::ShowAll) - .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::Quit); +pub fn setup_menu(app: &AppHandle) -> tauri::Result> { + app.on_menu_event(move |app, event| { + if let Ok(event) = MenuEvent::from_str(&event.id().0) { + handle_menu_event(event, app); + } else { + println!("Unknown menu event: {}", event.id().0); + } + }); - let file_menu = Menu::new() - .add_item( - CustomMenuItem::new("new_file", "New File") - .accelerator("CmdOrCtrl+N") - .disabled(), // TODO(brxken128): add keybind handling here - ) - .add_item( - CustomMenuItem::new("new_directory", "New Directory") - .accelerator("CmdOrCtrl+D") - .disabled(), // TODO(brxken128): add keybind handling here - ) - .add_item(CustomMenuItem::new("add_location", "Add Location").disabled()); // TODO(brxken128): add keybind handling here; + #[cfg(not(target_os = "macos"))] + { + Menu::new(app) + } + #[cfg(target_os = "macos")] + { + use tauri::menu::{AboutMetadataBuilder, MenuBuilder, MenuItemBuilder, SubmenuBuilder}; - let edit_menu = Menu::new() - .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::Copy) - .add_native_item(MenuItem::Cut) - .add_native_item(MenuItem::Paste) - .add_native_item(MenuItem::Redo) - .add_native_item(MenuItem::Undo) - .add_native_item(MenuItem::SelectAll); + let app_menu = SubmenuBuilder::new(app, "Spacedrive") + .about(Some( + AboutMetadataBuilder::new() + .authors(Some(vec!["Spacedrive Technology Inc.".to_string()])) + .license(Some(env!("CARGO_PKG_VERSION"))) + .version(Some(env!("CARGO_PKG_VERSION"))) + .website(Some("https://spacedrive.com/")) + .website_label(Some("Spacedrive.com")) + .build(), + )) + .separator() + .item( + &MenuItemBuilder::with_id(MenuEvent::NewLibrary, "New Library") + .accelerator("Cmd+Shift+T") + .build(app)?, + ) + // .item( + // &SubmenuBuilder::new(app, "Libraries") + // // TODO: Implement this + // .items(&[]) + // .build()?, + // ) + .separator() + .hide() + .hide_others() + .show_all() + .separator() + .quit() + .build()?; - let view_menu = Menu::new() - .add_item(CustomMenuItem::new("open_overview", "Overview").accelerator("CmdOrCtrl+.")) - .add_item(CustomMenuItem::new("open_search", "Search").accelerator("CmdOrCtrl+F")) - .add_item(CustomMenuItem::new("open_settings", "Settings").accelerator("CmdOrCtrl+Comma")) - .add_item( - CustomMenuItem::new("reload_explorer", "Reload explorer").accelerator("CmdOrCtrl+R"), - ) - .add_submenu(Submenu::new( - "Layout", - Menu::new() - .add_item(CustomMenuItem::new("layout_grid", "Grid (Default)").disabled()) - .add_item(CustomMenuItem::new("layout_list", "List").disabled()) - .add_item(CustomMenuItem::new("layout_media", "Media").disabled()), - )); - // .add_item( - // CustomMenuItem::new("command_pallete", "Command Pallete") - // .accelerator("CmdOrCtrl+P"), - // ) + let file_menu = SubmenuBuilder::new(app, "File") + .item( + &MenuItemBuilder::with_id(MenuEvent::NewFile, "New File") + .accelerator("CmdOrCtrl+N") + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::NewDirectory, "New Directory") + .accelerator("CmdOrCtrl+D") + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::AddLocation, "Add Location") + // .accelerator("") // TODO + .build(app)?, + ) + .build()?; - #[cfg(debug_assertions)] - let view_menu = view_menu.add_native_item(MenuItem::Separator).add_item( - CustomMenuItem::new("toggle_devtools", "Toggle Developer Tools") - .accelerator("CmdOrCtrl+Shift+Alt+I"), - ); + let edit_menu = SubmenuBuilder::new(app, "Edit") + .copy() + .cut() + .paste() + .redo() + .undo() + .select_all() + .build()?; - let window_menu = Menu::new() - .add_native_item(MenuItem::Minimize) - .add_native_item(MenuItem::Zoom) - .add_item( - CustomMenuItem::new("new_window", "New Window") - .accelerator("CmdOrCtrl+Shift+N") - .disabled(), - ) - .add_item(CustomMenuItem::new("close_window", "Close Window").accelerator("CmdOrCtrl+W")) - .add_native_item(MenuItem::EnterFullScreen) - .add_native_item(MenuItem::Separator) - .add_item( - CustomMenuItem::new("reload_app", "Reload Webview").accelerator("CmdOrCtrl+Shift+R"), + let view_menu = SubmenuBuilder::new(app, "View") + .item( + &MenuItemBuilder::with_id(MenuEvent::OpenOverview, "Open Overview") + .accelerator("CmdOrCtrl+.") + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::OpenSearch, "Search") + .accelerator("CmdOrCtrl+F") + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::OpenSettings, "Settings") + .accelerator("CmdOrCtrl+Comma") + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::ReloadExplorer, "Open Explorer") + .accelerator("CmdOrCtrl+R") + .build(app)?, + ) + .item( + &SubmenuBuilder::new(app, "Layout") + .item( + &MenuItemBuilder::with_id(MenuEvent::SetLayoutGrid, "Grid (Default)") + // .accelerator("") // TODO + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::SetLayoutList, "List") + // .accelerator("") // TODO + .build(app)?, + ) + .item( + &MenuItemBuilder::with_id(MenuEvent::SetLayoutMedia, "Media") + // .accelerator("") // TODO + .build(app)?, + ) + .build()?, + ); + + #[cfg(debug_assertions)] + let view_menu = view_menu.separator().item( + &MenuItemBuilder::with_id(MenuEvent::ToggleDeveloperTools, "Toggle Developer Tools") + .accelerator("CmdOrCtrl+Shift+Alt+I") + .build(app)?, ); - Menu::new() - .add_submenu(Submenu::new("Spacedrive", app_menu)) - .add_submenu(Submenu::new("File", file_menu)) - .add_submenu(Submenu::new("Edit", edit_menu)) - .add_submenu(Submenu::new("View", view_menu)) - .add_submenu(Submenu::new("Window", window_menu)) + let view_menu = view_menu.build()?; + + let window_menu = SubmenuBuilder::new(app, "Window") + .minimize() + .item( + &MenuItemBuilder::with_id(MenuEvent::NewWindow, "New Window") + .accelerator("CmdOrCtrl+Shift+N") + .build(app)?, + ) + .close_window() + .fullscreen() + .item( + &MenuItemBuilder::with_id(MenuEvent::ReloadWebview, "Reload Webview") + .accelerator("CmdOrCtrl+Shift+R") + .build(app)?, + ) + .build()?; + + let menu = MenuBuilder::new(app) + .item(&app_menu) + .item(&file_menu) + .item(&edit_menu) + .item(&view_menu) + .item(&window_menu) + .build()?; + + for event in LIBRARY_LOCKED_MENU_IDS { + set_enabled(&menu, *event, false); + } + + Ok(menu) + } } -pub fn handle_menu_event(event: WindowMenuEvent) { - match event.menu_item_id() { - "quit" => { - let app = event.window().app_handle(); - app.exit(0); - } - "reload_explorer" => event.window().emit("keybind", "reload_explorer").unwrap(), - "open_settings" => event.window().emit("keybind", "open_settings").unwrap(), - "open_overview" => event.window().emit("keybind", "open_overview").unwrap(), - "close_window" => { - #[cfg(target_os = "macos")] - tauri::AppHandle::hide(&event.window().app_handle()).unwrap(); +pub fn handle_menu_event(event: MenuEvent, app: &AppHandle) { + let webview = app + .get_webview_window("main") + .expect("unable to find window"); - #[cfg(not(target_os = "macos"))] - { - let window = event.window(); - - #[cfg(debug_assertions)] - if window.is_devtools_open() { - window.close_devtools(); - } else { - window.close().unwrap(); - } - - #[cfg(not(debug_assertions))] - window.close().unwrap(); + match event { + // TODO: Use Tauri Specta with frontend instead of this + MenuEvent::NewLibrary => webview.emit("keybind", "new_library").unwrap(), + MenuEvent::NewFile => webview.emit("keybind", "new_file").unwrap(), + MenuEvent::NewDirectory => webview.emit("keybind", "new_directory").unwrap(), + MenuEvent::AddLocation => webview.emit("keybind", "add_location").unwrap(), + MenuEvent::OpenOverview => webview.emit("keybind", "open_overview").unwrap(), + MenuEvent::OpenSearch => webview.emit("keybind", "open_search".to_string()).unwrap(), + MenuEvent::OpenSettings => webview.emit("keybind", "open_settings").unwrap(), + MenuEvent::ReloadExplorer => webview.emit("keybind", "reload_explorer").unwrap(), + MenuEvent::SetLayoutGrid => webview.emit("keybind", "set_layout_grid").unwrap(), + MenuEvent::SetLayoutList => webview.emit("keybind", "set_layout_list").unwrap(), + MenuEvent::SetLayoutMedia => webview.emit("keybind", "set_layout_media").unwrap(), + MenuEvent::ToggleDeveloperTools => + { + #[cfg(feature = "devtools")] + if webview.is_devtools_open() { + webview.close_devtools(); + } else { + webview.open_devtools(); } } - "open_search" => event - .window() - .emit("keybind", "open_search".to_string()) - .unwrap(), - "reload_app" => { - event - .window() + MenuEvent::NewWindow => { + // TODO: Implement this + } + MenuEvent::ReloadWebview => { + webview .with_webview(crate::reload_webview_inner) .expect("Error while reloading webview"); } - #[cfg(debug_assertions)] - "toggle_devtools" => { - let window = event.window(); - - if window.is_devtools_open() { - window.close_devtools(); - } else { - window.open_devtools(); - } - } - _ => {} } } -/// If any are explicitly marked with `.disabled()` in the `custom_menu_bar()` function, this won't have an effect. -/// We include them in the locked menu IDs anyway for future-proofing, in-case someone forgets. -#[cfg(target_os = "macos")] -pub fn set_library_locked_menu_items_enabled(handle: tauri::window::MenuHandle, enabled: bool) { - LIBRARY_LOCKED_MENU_IDS - .iter() - .try_for_each(|id| handle.get_item(id).set_enabled(enabled)) - .expect("Unable to disable menu items (there are no libraries present, so certain options should be hidden)"); +// Enable/disable all items in `LIBRARY_LOCKED_MENU_IDS` +pub fn refresh_menu_bar(app: &AppHandle, enabled: bool) { + let menu = app + .get_window("main") + .expect("unable to find window") + .menu() + .expect("unable to get menu for current window"); + + for event in LIBRARY_LOCKED_MENU_IDS { + set_enabled(&menu, *event, enabled); + } +} + +pub fn set_enabled(menu: &Menu, event: MenuEvent, enabled: bool) { + let result = match menu.get(event.as_ref()) { + Some(MenuItemKind::MenuItem(i)) => i.set_enabled(enabled), + Some(MenuItemKind::Submenu(i)) => i.set_enabled(enabled), + Some(MenuItemKind::Predefined(_)) => return, + Some(MenuItemKind::Check(i)) => i.set_enabled(enabled), + Some(MenuItemKind::Icon(i)) => i.set_enabled(enabled), + None => { + error!("Unable to get menu item: {event:?}"); + return; + } + }; + + if let Err(e) = result { + error!("Error setting menu item state: {e:#?}"); + } } diff --git a/apps/desktop/src-tauri/src/tauri_plugins.rs b/apps/desktop/src-tauri/src/tauri_plugins.rs index 6ec861ce7..79fd1f665 100644 --- a/apps/desktop/src-tauri/src/tauri_plugins.rs +++ b/apps/desktop/src-tauri/src/tauri_plugins.rs @@ -95,15 +95,22 @@ pub async fn sd_server_plugin( .expect("Error with HTTP server!"); // TODO: Panic handling }); + let script = format!( + r#"window.__SD_CUSTOM_SERVER_AUTH_TOKEN__ = "{auth_token}"; window.__SD_CUSTOM_URI_SERVER__ = [{}];"#, + [listen_addra, listen_addrb, listen_addrc, listen_addrd] + .iter() + .map(|addr| format!("'http://{addr}'")) + .collect::>() + .join(","), + ); + Ok(tauri::plugin::Builder::new("sd-server") - .js_init_script(format!( - r#"window.__SD_CUSTOM_SERVER_AUTH_TOKEN__ = "{auth_token}"; window.__SD_CUSTOM_URI_SERVER__ = [{}];"#, - [listen_addra, listen_addrb, listen_addrc, listen_addrd] - .iter() - .map(|addr| format!("'http://{addr}'")) - .collect::>() - .join(","), - )) + .js_init_script(script.to_owned()) + .on_page_load(move |webview, _payload| { + webview + .eval(&script) + .expect("Spacedrive server URL must be injected") + }) .on_event(move |_app, e| { if let RunEvent::Exit { .. } = e { block_in_place(|| { diff --git a/apps/desktop/src-tauri/src/updater.rs b/apps/desktop/src-tauri/src/updater.rs index 0e039e752..c595b158f 100644 --- a/apps/desktop/src-tauri/src/updater.rs +++ b/apps/desktop/src-tauri/src/updater.rs @@ -1,17 +1,16 @@ use tauri::{plugin::TauriPlugin, Manager, Runtime}; +use tauri_plugin_updater::{Update as TauriPluginUpdate, UpdaterExt}; use tokio::sync::Mutex; #[derive(Debug, Clone, specta::Type, serde::Serialize)] pub struct Update { pub version: String, - pub body: Option, } impl Update { - fn new(update: &tauri::updater::UpdateResponse) -> Self { + fn new(update: &TauriPluginUpdate) -> Self { Self { - version: update.latest_version().to_string(), - body: update.body().map(ToString::to_string), + version: update.version.clone(), } } } @@ -21,12 +20,12 @@ pub struct State { install_lock: Mutex<()>, } -async fn get_update( - app: tauri::AppHandle, -) -> Result, String> { - tauri::updater::builder(app) +async fn get_update(app: tauri::AppHandle) -> Result, String> { + app.updater_builder() .header("X-Spacedrive-Version", "stable") .map_err(|e| e.to_string())? + .build() + .map_err(|e| e.to_string())? .check() .await .map_err(|e| e.to_string()) @@ -45,19 +44,19 @@ pub enum UpdateEvent { #[tauri::command] #[specta::specta] pub async fn check_for_update(app: tauri::AppHandle) -> Result, String> { - app.emit_all("updater", UpdateEvent::Loading).ok(); + app.emit("updater", UpdateEvent::Loading).ok(); let update = match get_update(app.clone()).await { Ok(update) => update, Err(e) => { - app.emit_all("updater", UpdateEvent::Error(e.clone())).ok(); + app.emit("updater", UpdateEvent::Error(e.clone())).ok(); return Err(e); } }; - let update = update.is_update_available().then(|| Update::new(&update)); + let update = update.map(|update| Update::new(&update)); - app.emit_all( + app.emit( "updater", update .clone() @@ -81,11 +80,12 @@ pub async fn install_update( Err(_) => return Err("Update already installing".into()), }; - app.emit_all("updater", UpdateEvent::Installing).ok(); + app.emit("updater", UpdateEvent::Installing).ok(); get_update(app.clone()) .await? - .download_and_install() + .ok_or_else(|| "No update required".to_string())? + .download_and_install(|_, _| {}, || {}) .await .map_err(|e| e.to_string())?; @@ -98,11 +98,8 @@ pub fn plugin() -> TauriPlugin { tauri::plugin::Builder::new("sd-updater") .on_page_load(|window, _| { #[cfg(target_os = "linux")] - let updater_available = { - let env = window.env(); + let updater_available = false; - env.appimage.is_some() - }; #[cfg(not(target_os = "linux"))] let updater_available = true; diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index a4743ebe7..f6334dc17 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,86 +1,16 @@ { - "package": { - "productName": "Spacedrive" - }, + "$schema": "https://github.com/tauri-apps/tauri/raw/tauri-v2.0.0-beta.17/core/tauri-config-schema/schema.json", + "productName": "Spacedrive", + "identifier": "com.spacedrive.desktop", "build": { - "distDir": "../dist", - "devPath": "http://localhost:8001", "beforeDevCommand": "pnpm dev", - "beforeBuildCommand": "pnpm turbo run build --filter=@sd/desktop..." + "devUrl": "http://localhost:8001", + "beforeBuildCommand": "pnpm turbo run build --filter=@sd/desktop...", + "frontendDist": "../dist" }, - "tauri": { + "app": { + "withGlobalTauri": true, "macOSPrivateApi": true, - "bundle": { - "active": true, - "targets": ["deb", "msi", "dmg", "updater"], - "identifier": "com.spacedrive.desktop", - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ], - "resources": {}, - "externalBin": [], - "copyright": "Spacedrive Technology Inc.", - "shortDescription": "File explorer from the future.", - "longDescription": "Cross-platform universal file explorer, powered by an open-source virtual distributed filesystem.", - "deb": { - "files": { - "/usr/share/spacedrive/models/yolov8s.onnx": "../../.deps/models/yolov8s.onnx" - }, - "depends": ["libc6"] - }, - "macOS": { - "minimumSystemVersion": "10.15", - "exceptionDomain": null, - "entitlements": null, - "frameworks": ["../../.deps/Spacedrive.framework"] - }, - "windows": { - "certificateThumbprint": null, - "webviewInstallMode": { "type": "embedBootstrapper", "silent": true }, - "digestAlgorithm": "sha256", - "timestampUrl": "", - "wix": { - "dialogImagePath": "icons/WindowsDialogImage.bmp", - "bannerPath": "icons/WindowsBanner.bmp" - } - } - }, - "updater": { - "active": true, - "dialog": false, - "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEZBMURCMkU5NEU3NDAyOEMKUldTTUFuUk82YklkK296dlkxUGkrTXhCT3ZMNFFVOWROcXNaS0RqWU1kMUdRV2tDdFdIS0Y3YUsK", - "endpoints": [ - "https://spacedrive.com/api/releases/tauri/{{version}}/{{target}}/{{arch}}" - ] - }, - "allowlist": { - "all": false, - "window": { - "all": true - }, - "path": { - "all": true - }, - "shell": { - "all": true - }, - "protocol": { - "all": true, - "assetScope": ["*"] - }, - "os": { - "all": true - }, - "dialog": { - "all": true, - "open": true, - "save": true - } - }, "windows": [ { "title": "Spacedrive", @@ -94,14 +24,70 @@ "alwaysOnTop": false, "focus": false, "visible": false, - "fileDropEnabled": true, + "dragDropEnabled": true, "decorations": true, "transparent": true, - "center": true + "center": true, + "windowEffects": { + "effects": ["sidebar"], + "state": "followsWindowActiveState", + "radius": 9 + } } ], "security": { - "csp": "default-src spacedrive: webkit-pdfjs-viewer: asset: https://asset.localhost blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" + "csp": "default-src webkit-pdfjs-viewer: asset: https://asset.localhost blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" + } + }, + "bundle": { + "active": true, + "targets": ["deb", "msi", "dmg", "updater"], + "publisher": "Spacedrive Technology Inc.", + "copyright": "Spacedrive Technology Inc.", + "category": "Productivity", + "shortDescription": "Spacedrive", + "longDescription": "Cross-platform universal file explorer, powered by an open-source virtual distributed filesystem.", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "linux": { + "deb": { + "files": { + "/usr/share/spacedrive/models/yolov8s.onnx": "../../.deps/models/yolov8s.onnx" + }, + "depends": ["libc6", "libxdo3", "dbus"] + } + }, + + "macOS": { + "minimumSystemVersion": "10.15", + "exceptionDomain": null, + "entitlements": null, + "frameworks": ["../../.deps/Spacedrive.framework"] + }, + "windows": { + "certificateThumbprint": null, + "webviewInstallMode": { "type": "embedBootstrapper", "silent": true }, + "digestAlgorithm": "sha256", + "timestampUrl": "", + "wix": { + "dialogImagePath": "icons/WindowsDialogImage.bmp", + "bannerPath": "icons/WindowsBanner.bmp" + } + } + }, + "plugins": { + "updater": { + "active": true, + "dialog": false, + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEZBMURCMkU5NEU3NDAyOEMKUldTTUFuUk82YklkK296dlkxUGkrTXhCT3ZMNFFVOWROcXNaS0RqWU1kMUdRV2tDdFdIS0Y3YUsK", + "endpoints": [ + "https://spacedrive.com/api/releases/tauri/{{version}}/{{target}}/{{arch}}" + ] } } } diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx index eb2f39b73..b8309a53a 100644 --- a/apps/desktop/src/App.tsx +++ b/apps/desktop/src/App.tsx @@ -3,7 +3,7 @@ import { QueryClientProvider } from '@tanstack/react-query'; import { listen } from '@tauri-apps/api/event'; import { PropsWithChildren, startTransition, useEffect, useMemo, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; -import { CacheProvider, createCache, RspcProvider } from '@sd/client'; +import { RspcProvider } from '@sd/client'; import { createRoutes, ErrorPage, @@ -56,16 +56,14 @@ export default function App() { return ( - - {startupError ? ( - - ) : ( - - )} - + {startupError ? ( + + ) : ( + + )} ); @@ -74,9 +72,7 @@ export default function App() { // we have a minimum delay between creating new tabs as react router can't handle creating tabs super fast const TAB_CREATE_DELAY = 150; -const cache = createCache(); - -const routes = createRoutes(platform, cache); +const routes = createRoutes(platform); type redirect = { pathname: string; search: string | undefined }; diff --git a/apps/desktop/src/commands.ts b/apps/desktop/src/commands.ts index 662011a6a..e228fffea 100644 --- a/apps/desktop/src/commands.ts +++ b/apps/desktop/src/commands.ts @@ -1,79 +1,65 @@ /** tauri-specta globals **/ -import { invoke as TAURI_INVOKE } from '@tauri-apps/api'; +import { invoke as TAURI_INVOKE } from '@tauri-apps/api/core'; import * as TAURI_API_EVENT from '@tauri-apps/api/event'; -import { type WebviewWindowHandle as __WebviewWindowHandle__ } from '@tauri-apps/api/window'; +import { type WebviewWindow as __WebviewWindow__ } from '@tauri-apps/api/webviewWindow'; // This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually. export const commands = { - async appReady(): Promise { - return await TAURI_INVOKE('plugin:tauri-specta|app_ready'); + async appReady(): Promise { + await TAURI_INVOKE('app_ready'); }, - async resetSpacedrive(): Promise { - return await TAURI_INVOKE('plugin:tauri-specta|reset_spacedrive'); + async resetSpacedrive(): Promise { + await TAURI_INVOKE('reset_spacedrive'); }, - async openLogsDir(): Promise<__Result__> { + async openLogsDir(): Promise> { try { - return { status: 'ok', data: await TAURI_INVOKE('plugin:tauri-specta|open_logs_dir') }; + return { status: 'ok', data: await TAURI_INVOKE('open_logs_dir') }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async refreshMenuBar(): Promise<__Result__> { + async refreshMenuBar(): Promise> { try { - return { - status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|refresh_menu_bar') - }; + return { status: 'ok', data: await TAURI_INVOKE('refresh_menu_bar') }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async reloadWebview(): Promise { - return await TAURI_INVOKE('plugin:tauri-specta|reload_webview'); + async reloadWebview(): Promise { + await TAURI_INVOKE('reload_webview'); }, - async setMenuBarItemState(id: string, enabled: boolean): Promise { - return await TAURI_INVOKE('plugin:tauri-specta|set_menu_bar_item_state', { id, enabled }); + async setMenuBarItemState(event: MenuEvent, enabled: boolean): Promise { + await TAURI_INVOKE('set_menu_bar_item_state', { event, enabled }); }, - async requestFdaMacos(): Promise { - return await TAURI_INVOKE('plugin:tauri-specta|request_fda_macos'); + async requestFdaMacos(): Promise { + await TAURI_INVOKE('request_fda_macos'); + }, + async openTrashInOsExplorer(): Promise> { + try { + return { status: 'ok', data: await TAURI_INVOKE('open_trash_in_os_explorer') }; + } catch (e) { + if (e instanceof Error) throw e; + else return { status: 'error', error: e as any }; + } }, async openFilePaths( library: string, ids: number[] - ): Promise< - __Result__< - ( - | { t: 'NoLibrary' } - | { t: 'NoFile'; c: number } - | { t: 'OpenError'; c: [number, string] } - | { t: 'AllGood'; c: number } - | { t: 'Internal'; c: string } - )[], - null - > - > { + ): Promise> { try { - return { - status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|open_file_paths', { library, ids }) - }; + return { status: 'ok', data: await TAURI_INVOKE('open_file_paths', { library, ids }) }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async openEphemeralFiles( - paths: string[] - ): Promise<__Result__<({ t: 'Ok'; c: string } | { t: 'Err'; c: string })[], null>> { + async openEphemeralFiles(paths: string[]): Promise> { try { - return { - status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|open_ephemeral_files', { paths }) - }; + return { status: 'ok', data: await TAURI_INVOKE('open_ephemeral_files', { paths }) }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; @@ -82,14 +68,11 @@ export const commands = { async getFilePathOpenWithApps( library: string, ids: number[] - ): Promise<__Result__<{ url: string; name: string }[], null>> { + ): Promise> { try { return { status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|get_file_path_open_with_apps', { - library, - ids - }) + data: await TAURI_INVOKE('get_file_path_open_with_apps', { library, ids }) }; } catch (e) { if (e instanceof Error) throw e; @@ -98,13 +81,11 @@ export const commands = { }, async getEphemeralFilesOpenWithApps( paths: string[] - ): Promise<__Result__<{ url: string; name: string }[], null>> { + ): Promise> { try { return { status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|get_ephemeral_files_open_with_apps', { - paths - }) + data: await TAURI_INVOKE('get_ephemeral_files_open_with_apps', { paths }) }; } catch (e) { if (e instanceof Error) throw e; @@ -114,63 +95,50 @@ export const commands = { async openFilePathWith( library: string, fileIdsAndUrls: [number, string][] - ): Promise<__Result__> { + ): Promise> { try { return { status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|open_file_path_with', { - library, - fileIdsAndUrls - }) + data: await TAURI_INVOKE('open_file_path_with', { library, fileIdsAndUrls }) }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async openEphemeralFileWith(pathsAndUrls: [string, string][]): Promise<__Result__> { + async openEphemeralFileWith(pathsAndUrls: [string, string][]): Promise> { try { return { status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|open_ephemeral_file_with', { - pathsAndUrls - }) + data: await TAURI_INVOKE('open_ephemeral_file_with', { pathsAndUrls }) }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async revealItems(library: string, items: RevealItem[]): Promise<__Result__> { + async revealItems(library: string, items: RevealItem[]): Promise> { try { - return { - status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|reveal_items', { library, items }) - }; + return { status: 'ok', data: await TAURI_INVOKE('reveal_items', { library, items }) }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async lockAppTheme(themeType: AppThemeType): Promise { - return await TAURI_INVOKE('plugin:tauri-specta|lock_app_theme', { themeType }); + async lockAppTheme(themeType: AppThemeType): Promise { + await TAURI_INVOKE('lock_app_theme', { themeType }); }, - async checkForUpdate(): Promise< - __Result__<{ version: string; body: string | null } | null, string> - > { + async checkForUpdate(): Promise> { try { - return { - status: 'ok', - data: await TAURI_INVOKE('plugin:tauri-specta|check_for_update') - }; + return { status: 'ok', data: await TAURI_INVOKE('check_for_update') }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; } }, - async installUpdate(): Promise<__Result__> { + async installUpdate(): Promise> { try { - return { status: 'ok', data: await TAURI_INVOKE('plugin:tauri-specta|install_update') }; + return { status: 'ok', data: await TAURI_INVOKE('install_update') }; } catch (e) { if (e instanceof Error) throw e; else return { status: 'error', error: e as any }; @@ -181,7 +149,7 @@ export const commands = { export const events = __makeEvents__<{ dragAndDropEvent: DragAndDropEvent; }>({ - dragAndDropEvent: 'plugin:tauri-specta:drag-and-drop-event' + dragAndDropEvent: 'drag-and-drop-event' }); /** user-defined types **/ @@ -191,10 +159,34 @@ export type DragAndDropEvent = | { type: 'Hovered'; paths: string[]; x: number; y: number } | { type: 'Dropped'; paths: string[]; x: number; y: number } | { type: 'Cancelled' }; +export type EphemeralFileOpenResult = { t: 'Ok'; c: string } | { t: 'Err'; c: string }; +export type MenuEvent = + | 'NewLibrary' + | 'NewFile' + | 'NewDirectory' + | 'AddLocation' + | 'OpenOverview' + | 'OpenSearch' + | 'OpenSettings' + | 'ReloadExplorer' + | 'SetLayoutGrid' + | 'SetLayoutList' + | 'SetLayoutMedia' + | 'ToggleDeveloperTools' + | 'NewWindow' + | 'ReloadWebview'; +export type OpenFilePathResult = + | { t: 'NoLibrary' } + | { t: 'NoFile'; c: number } + | { t: 'OpenError'; c: [number, string] } + | { t: 'AllGood'; c: number } + | { t: 'Internal'; c: string }; +export type OpenWithApplication = { url: string; name: string }; export type RevealItem = | { Location: { id: number } } | { FilePath: { id: number } } | { Ephemeral: { path: string } }; +export type Update = { version: string }; type __EventObj__ = { listen: (cb: TAURI_API_EVENT.EventCallback) => ReturnType>; @@ -204,13 +196,13 @@ type __EventObj__ = { : (payload: T) => ReturnType; }; -type __Result__ = { status: 'ok'; data: T } | { status: 'error'; error: E }; +export type Result = { status: 'ok'; data: T } | { status: 'error'; error: E }; function __makeEvents__>(mappings: Record) { return new Proxy( {} as unknown as { [K in keyof T]: __EventObj__ & { - (handle: __WebviewWindowHandle__): __EventObj__; + (handle: __WebviewWindow__): __EventObj__; }; }, { @@ -218,7 +210,7 @@ function __makeEvents__>(mappings: Record {}) as any, { - apply: (_, __, [window]: [__WebviewWindowHandle__]) => ({ + apply: (_, __, [window]: [__WebviewWindow__]) => ({ listen: (arg: any) => window.listen(name, arg), once: (arg: any) => window.once(name, arg), emit: (arg: any) => window.emit(name, arg) diff --git a/apps/desktop/src/platform.ts b/apps/desktop/src/platform.ts index 5338f7908..288e887df 100644 --- a/apps/desktop/src/platform.ts +++ b/apps/desktop/src/platform.ts @@ -1,14 +1,14 @@ -import { dialog, invoke, os, shell } from '@tauri-apps/api'; -import { confirm } from '@tauri-apps/api/dialog'; +import { invoke } from '@tauri-apps/api/core'; import { homeDir } from '@tauri-apps/api/path'; -import { open } from '@tauri-apps/api/shell'; +import { confirm, open as dialogOpen, save as dialogSave } from '@tauri-apps/plugin-dialog'; +import { type } from '@tauri-apps/plugin-os'; +import { open as shellOpen } from '@tauri-apps/plugin-shell'; // @ts-expect-error: Doesn't have a types package. import ConsistentHash from 'consistent-hash'; import { OperatingSystem, Platform } from '@sd/interface'; import { commands, events } from './commands'; import { env } from './env'; -import { createUpdater } from './updater'; const customUriAuthToken = (window as any).__SD_CUSTOM_SERVER_AUTH_TOKEN__ as string | undefined; const customUriServerUrl = (window as any).__SD_CUSTOM_URI_SERVER__ as string[] | undefined; @@ -16,12 +16,12 @@ const customUriServerUrl = (window as any).__SD_CUSTOM_URI_SERVER__ as string[] const queryParams = customUriAuthToken ? `?token=${encodeURIComponent(customUriAuthToken)}` : ''; async function getOs(): Promise { - switch (await os.type()) { - case 'Linux': + switch (await type()) { + case 'linux': return 'linux'; - case 'Windows_NT': + case 'windows': return 'windows'; - case 'Darwin': + case 'macos': return 'macOS'; default: return 'unknown'; @@ -45,9 +45,11 @@ function constructServerUrl(urlSuffix: string) { export const platform = { platform: 'tauri', - getThumbnailUrlByThumbKey: (keyParts) => + getThumbnailUrlByThumbKey: (thumbKey) => constructServerUrl( - `/thumbnail/${keyParts.map((i) => encodeURIComponent(i)).join('/')}.webp` + `/thumbnail/${encodeURIComponent( + thumbKey.base_directory_str + )}/${encodeURIComponent(thumbKey.shard_hex)}/${encodeURIComponent(thumbKey.cas_id)}.webp` ), getFileUrl: (libraryId, locationLocalId, filePathId) => constructServerUrl(`/file/${libraryId}/${locationLocalId}/${filePathId}`), @@ -64,15 +66,18 @@ export const platform = { constructServerUrl( `/remote/${encodeURIComponent(remote_identity)}/uri/${path}?token=${customUriAuthToken}` ), - openLink: shell.open, + openLink: shellOpen, getOs, openDirectoryPickerDialog: (opts) => { - const result = dialog.open({ directory: true, ...opts }); + const result = dialogOpen({ directory: true, ...opts }); if (opts?.multiple) return result as any; // Tauri don't properly type narrow on `multiple` argument return result; }, - openFilePickerDialog: () => dialog.open(), - saveFilePickerDialog: (opts) => dialog.save(opts), + openFilePickerDialog: () => + dialogOpen({ + multiple: true + }).then((result) => result?.map((r) => r.path) ?? null), + saveFilePickerDialog: (opts) => dialogSave(opts), showDevtools: () => invoke('show_devtools'), confirm: (msg, cb) => confirm(msg).then(cb), subscribeToDragAndDropEvents: (cb) => @@ -82,7 +87,7 @@ export const platform = { userHomeDir: homeDir, auth: { start(url) { - open(url); + return shellOpen(url); } }, ...commands, diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.ts index ed4884870..f80274e06 100644 --- a/apps/desktop/vite.config.ts +++ b/apps/desktop/vite.config.ts @@ -25,6 +25,15 @@ export default defineConfig(({ mode }) => { server: { port: 8001 }, + build: { + rollupOptions: { + treeshake: 'recommended', + external: [ + // Don't bundle Fda video for non-macOS platforms + process.platform !== 'darwin' && /^@sd\/assets\/videos\/Fda.mp4$/ + ].filter(Boolean) + } + }, plugins: [ devtoolsPlugin, process.env.SENTRY_AUTH_TOKEN && diff --git a/apps/landing/public/apple-touch-icon.png b/apps/landing/public/apple-touch-icon.png index e2b96e95c..33072947a 100644 Binary files a/apps/landing/public/apple-touch-icon.png and b/apps/landing/public/apple-touch-icon.png differ diff --git a/apps/landing/public/favicon-16x16.png b/apps/landing/public/favicon-16x16.png index f95ee90e5..72ad3510b 100644 Binary files a/apps/landing/public/favicon-16x16.png and b/apps/landing/public/favicon-16x16.png differ diff --git a/apps/landing/public/favicon-32x32.png b/apps/landing/public/favicon-32x32.png index a193a2283..204ddad22 100644 Binary files a/apps/landing/public/favicon-32x32.png and b/apps/landing/public/favicon-32x32.png differ diff --git a/apps/landing/public/images/agent.webp b/apps/landing/public/images/agent.webp new file mode 100644 index 000000000..90d0c4c53 Binary files /dev/null and b/apps/landing/public/images/agent.webp differ diff --git a/apps/landing/public/images/app/gradient-overlay.png b/apps/landing/public/images/app/gradient-overlay.png index 98469b3b1..d510ab9d8 100644 Binary files a/apps/landing/public/images/app/gradient-overlay.png and b/apps/landing/public/images/app/gradient-overlay.png differ diff --git a/apps/landing/public/images/contextmenu.png b/apps/landing/public/images/contextmenu.png index c19dbd798..0c98e37db 100644 Binary files a/apps/landing/public/images/contextmenu.png and b/apps/landing/public/images/contextmenu.png differ diff --git a/apps/landing/public/images/explorer.png b/apps/landing/public/images/explorer.png index f38f1b89b..907abb5a6 100644 Binary files a/apps/landing/public/images/explorer.png and b/apps/landing/public/images/explorer.png differ diff --git a/apps/landing/public/images/icons/image.png b/apps/landing/public/images/icons/image.png index 4d1ceda55..a41d6d7bf 100644 Binary files a/apps/landing/public/images/icons/image.png and b/apps/landing/public/images/icons/image.png differ diff --git a/apps/landing/public/images/icons/texturedmesh.png b/apps/landing/public/images/icons/texturedmesh.png index 24a9915df..105fd8a28 100644 Binary files a/apps/landing/public/images/icons/texturedmesh.png and b/apps/landing/public/images/icons/texturedmesh.png differ diff --git a/apps/landing/public/images/june-23-alpha-release.png b/apps/landing/public/images/june-23-alpha-release.png index d3e4fe17d..c75cfb764 100644 Binary files a/apps/landing/public/images/june-23-alpha-release.png and b/apps/landing/public/images/june-23-alpha-release.png differ diff --git a/apps/landing/public/images/logo-192x192.png b/apps/landing/public/images/logo-192x192.png index 74e728884..d89b9908e 100644 Binary files a/apps/landing/public/images/logo-192x192.png and b/apps/landing/public/images/logo-192x192.png differ diff --git a/apps/landing/public/images/logo-512x512.png b/apps/landing/public/images/logo-512x512.png index 1afba9570..929ce4e3d 100644 Binary files a/apps/landing/public/images/logo-512x512.png and b/apps/landing/public/images/logo-512x512.png differ diff --git a/apps/landing/public/images/misc/blueplanet.png b/apps/landing/public/images/misc/blueplanet.png index de91fadaa..6a8caf4fb 100644 Binary files a/apps/landing/public/images/misc/blueplanet.png and b/apps/landing/public/images/misc/blueplanet.png differ diff --git a/apps/landing/public/images/misc/icongrid.png b/apps/landing/public/images/misc/icongrid.png index 1afe9fe3e..fcf2cd835 100644 Binary files a/apps/landing/public/images/misc/icongrid.png and b/apps/landing/public/images/misc/icongrid.png differ diff --git a/apps/landing/public/images/october-23-alpha-release.png b/apps/landing/public/images/october-23-alpha-release.png index f0eb2d60c..addb21588 100644 Binary files a/apps/landing/public/images/october-23-alpha-release.png and b/apps/landing/public/images/october-23-alpha-release.png differ diff --git a/apps/landing/public/images/quickpreview.png b/apps/landing/public/images/quickpreview.png index 7ea01c048..e0ca86032 100644 Binary files a/apps/landing/public/images/quickpreview.png and b/apps/landing/public/images/quickpreview.png differ diff --git a/apps/landing/public/images/spacedrive-feb-2024-release.png b/apps/landing/public/images/spacedrive-feb-2024-release.png index 1d7ed5451..83b42b7f6 100644 Binary files a/apps/landing/public/images/spacedrive-feb-2024-release.png and b/apps/landing/public/images/spacedrive-feb-2024-release.png differ diff --git a/apps/landing/public/images/spacedrive-funding-announcement-img.png b/apps/landing/public/images/spacedrive-funding-announcement-img.png index 56fc02e36..1ef42892e 100644 Binary files a/apps/landing/public/images/spacedrive-funding-announcement-img.png and b/apps/landing/public/images/spacedrive-funding-announcement-img.png differ diff --git a/apps/landing/public/images/tags.webp b/apps/landing/public/images/tags.webp new file mode 100644 index 000000000..d1ed488ca Binary files /dev/null and b/apps/landing/public/images/tags.webp differ diff --git a/apps/landing/public/library_switcher.webp b/apps/landing/public/library_switcher.webp new file mode 100644 index 000000000..b9b1b5d79 Binary files /dev/null and b/apps/landing/public/library_switcher.webp differ diff --git a/apps/landing/public/logo.png b/apps/landing/public/logo.png index d84e109ee..a10fffd52 100644 Binary files a/apps/landing/public/logo.png and b/apps/landing/public/logo.png differ diff --git a/apps/landing/public/videos/Spacedrive_QuickPreview.webm b/apps/landing/public/videos/Spacedrive_QuickPreview.webm new file mode 100644 index 000000000..bf1f7af19 Binary files /dev/null and b/apps/landing/public/videos/Spacedrive_QuickPreview.webm differ diff --git a/apps/landing/src/app/Downloads/Platform.tsx b/apps/landing/src/app/Downloads/Platform.tsx index 127d63caa..69d7473e2 100644 --- a/apps/landing/src/app/Downloads/Platform.tsx +++ b/apps/landing/src/app/Downloads/Platform.tsx @@ -12,6 +12,7 @@ export type Platform = { version?: string; links?: Array<{ name: string; arch: string }>; disabled?: boolean; + note?: string; }; export const platforms = { @@ -36,8 +37,9 @@ export const platforms = { name: 'Linux', os: 'linux', icon: LinuxLogo, - version: 'AppImage', - links: [{ name: 'x86_64', arch: 'x86_64' }] + version: 'deb', + links: [{ name: 'x86_64', arch: 'x86_64' }], + note: 'Supports Ubuntu 22.04+, Debian Bookworm+, Linux Mint 21+, PopOS 22.04+' }, docker: { name: 'Docker', icon: Docker }, android: { name: 'Android', icon: AndroidLogo, version: '10+', disabled: true }, diff --git a/apps/landing/src/app/Downloads/index.tsx b/apps/landing/src/app/Downloads/index.tsx index e76c64399..711024067 100644 --- a/apps/landing/src/app/Downloads/index.tsx +++ b/apps/landing/src/app/Downloads/index.tsx @@ -22,13 +22,17 @@ export function Downloads({ latestVersion }: Props) { const plausible = usePlausible(); - const formattedVersion = (() => { + const [formattedVersion, note] = (() => { const platform = selectedPlatform ?? currentPlatform; - - if (!platform?.version) return; - if (platform.name === 'Linux') return platform.version; - - return `${platform.name} ${platform.version}`; + return platform + ? [ + platform.version && + (platform.name === 'Linux' + ? platform.version + : `${platform.name} ${platform.version}`), + platform.note + ] + : []; })(); return ( @@ -95,6 +99,12 @@ export function Downloads({ latestVersion }: Props) { {formattedVersion} )} + {note && ( + <> + | + {note} + + )}

{/* Platform icons */}
diff --git a/apps/landing/src/app/api/releases/desktop/[version]/[target]/[arch]/route.ts b/apps/landing/src/app/api/releases/desktop/[version]/[target]/[arch]/route.ts index 60fbc61d0..dbe8a07a7 100644 --- a/apps/landing/src/app/api/releases/desktop/[version]/[target]/[arch]/route.ts +++ b/apps/landing/src/app/api/releases/desktop/[version]/[target]/[arch]/route.ts @@ -7,7 +7,7 @@ const tauriTarget = z.union([z.literal('linux'), z.literal('windows'), z.literal const tauriArch = z.union([z.literal('x86_64'), z.literal('aarch64')]); const extensions = { - linux: 'AppImage', + linux: 'deb', windows: 'msi', darwin: 'dmg' } as const satisfies Record, string>; diff --git a/apps/landing/src/app/api/slack/webhook/createRelease.ts b/apps/landing/src/app/api/slack/webhook/createRelease.ts index c447071b6..c394e49d3 100644 --- a/apps/landing/src/app/api/slack/webhook/createRelease.ts +++ b/apps/landing/src/app/api/slack/webhook/createRelease.ts @@ -1,8 +1,8 @@ -import { z } from 'zod'; +import { object, z } from 'zod'; import { env } from '~/env'; import * as github from './github'; -import { createSlashCommand, createViewSubmission, USER_REF } from './utils'; +import { createBlockActions, createSlashCommand, createViewSubmission, USER_REF } from './utils'; export const callbackId = 'createReleaseModal' as const; export const fields = { @@ -17,7 +17,7 @@ export const fields = { } as const; export const COMMAND_NAME = '/release' as const; -export const EVENT_SCHEMAS = [createSlashCommand(COMMAND_NAME), createViewSubmission()] as const; +export const EVENT_SCHEMAS = [createSlashCommand(COMMAND_NAME), createViewSubmission(), createBlockActions()] as const; export async function createModal( trigger_id: string, @@ -63,7 +63,7 @@ export async function createModal( type: 'plain_text', text: 'View Commit' }, - url: `${github.REPO_API}/commit/${commit}` + url: `${github.REPO_API}/commits/${commit}` }, text: { type: 'mrkdwn', @@ -185,7 +185,18 @@ export async function handleSubmission( const { tag, commit, responseUrl } = JSON.parse(privateMetadata); - await fetch(`${github.REPO_API}/git/refs`, { + const createTag = await fetch(`${github.REPO_API}/git/tags`, { + method: 'POST', + body: JSON.stringify({ + tag, + message: tagline, + object: commit, + type: 'commit' + }), + headers: github.HEADERS + }).then((r) => r.json()); + + const getRef = await fetch(`${github.REPO_API}/git/refs`, { method: 'POST', body: JSON.stringify({ ref: `refs/tags/${tag}`, @@ -222,6 +233,7 @@ export async function handleSubmission( headers: github.HEADERS } ); + const [release] = await Promise.all([createRelease, dispatchWorkflowRun]); await fetch(responseUrl, { @@ -267,7 +279,7 @@ export async function handleSubmission( type: 'plain_text', text: 'View Commit' }, - url: `https://github.com/${env.GITHUB_ORG}/${env.GITHUB_REPO}/commit/${commit}` + url: `https://github.com/${env.GITHUB_ORG}/${env.GITHUB_REPO}/commits/${commit}` } ] } diff --git a/apps/landing/src/app/api/slack/webhook/route.ts b/apps/landing/src/app/api/slack/webhook/route.ts index 55a926cd7..509ba3d50 100644 --- a/apps/landing/src/app/api/slack/webhook/route.ts +++ b/apps/landing/src/app/api/slack/webhook/route.ts @@ -16,6 +16,7 @@ export async function POST(req: Request) { if (!isValid.valid) return new Response(isValid.error, { status: 400 }); const parsedBody = BODY.safeParse(Object.fromEntries([...new URLSearchParams(body)])); + if (!parsedBody.success) { console.log(parsedBody.error); return new Response('Unexpected request', { status: 400 }); diff --git a/apps/landing/src/app/api/slack/webhook/utils.ts b/apps/landing/src/app/api/slack/webhook/utils.ts index 5cfbc478e..9be732291 100644 --- a/apps/landing/src/app/api/slack/webhook/utils.ts +++ b/apps/landing/src/app/api/slack/webhook/utils.ts @@ -42,11 +42,91 @@ export function createViewSubmission() { export function createSlashCommand(command: T) { return z.object({ - command: z.literal(command), + token: z.string(), + team_id: z.string(), + team_domain: z.string(), channel_id: z.string(), - text: z.string().transform((s) => s.split(' ')), + channel_name: z.string(), user_id: z.string(), - trigger_id: z.string(), - response_url: z.string() + user_name: z.string(), + command: z.literal(command), + text: z.string().transform((s) => s.split(' ')), + api_app_id: z.string(), + is_enterprise_install: z.union([z.literal('false'), z.literal('true')]).transform((v) => v === 'true'), + response_url: z.string(), + trigger_id: z.string() }); } + +const BLOCK_ACTIONS_INNER = z.object({ + api_app_id: z.string(), + token: z.string(), + container: z.object({ + type: z.string(), + message_ts: z.string(), + channel_id: z.string(), + is_ephemeral: z.boolean() + }), + trigger_id: z.string(), + team: z.object({ + id: z.string(), + domain: z.string() + }), + enterprise: z.any().nullable(), + is_enterprise_install: z.boolean(), + channel: z.object({ + id: z.string(), + name: z.string() + }), + message: z.object({ + subtype: z.string(), + text: z.string(), + type: z.string(), + ts: z.string(), + bot_id: z.string(), + blocks: z.array( + z.object({ + type: z.string(), + block_id: z.string(), + text: z.object({ + type: z.string(), + text: z.string(), + verbatim: z.boolean() + }).optional(), + elements: z.array( + z.object({ + type: z.string(), + action_id: z.string(), + text: z.object({ + type: z.string(), + text: z.string(), + emoji: z.boolean() + }), + url: z.string().optional() + }) + ).optional() + }) + ) + }), + state: z.object({ + values: z.record(z.record(z.any())) + }), + response_url: z.string(), + actions: z.array( + z.object({ + action_id: z.string(), + block_id: z.string(), + text: z.object({ + type: z.string(), + text: z.string(), + emoji: z.boolean() + }), + type: z.string(), + action_ts: z.string() + }) + ) +}); + +export function createBlockActions() { + return createInteraction('block_actions', BLOCK_ACTIONS_INNER); +} diff --git a/apps/landing/src/app/logo.png b/apps/landing/src/app/logo.png index d84e109ee..a10fffd52 100644 Binary files a/apps/landing/src/app/logo.png and b/apps/landing/src/app/logo.png differ diff --git a/apps/landing/src/app/opengraph-image.png b/apps/landing/src/app/opengraph-image.png index db8bb2c11..9132b6cd9 100644 Binary files a/apps/landing/src/app/opengraph-image.png and b/apps/landing/src/app/opengraph-image.png differ diff --git a/apps/landing/src/app/roadmap/items.ts b/apps/landing/src/app/roadmap/items.ts index 2c472573b..cd4211aff 100644 --- a/apps/landing/src/app/roadmap/items.ts +++ b/apps/landing/src/app/roadmap/items.ts @@ -110,20 +110,23 @@ export const items = [ }, { when: '0.3 Alpha', - subtext: 'April 2024', - title: 'Connect devices & Library sync', + subtext: 'May 2024', + title: 'Connect devices & sync', description: 'Automatically synchronized libraries across all your devices.' }, + { + title: 'Mobile app TestFlight & Play Store Beta', + description: 'Access your library on the go, with a mobile app for iOS and Android.' + }, + { + title: 'Spacedrive in every language, i18n', + description: 'Spacedrive will be available in every language.' + }, { title: 'Key manager', description: 'View, mount, unmount and hide keys. Mounted keys can be used to instantly encrypt and decrypt any files on your node.' }, - { - title: 'Mobile app TestFlight', - description: - 'Access your library on the go, with a mobile app for iOS and Android in alpha via TestFlight and Play Store.' - }, { title: 'Advanced media analysis', description: 'Transcribe audio, identify faces, video scenes and more.' @@ -140,7 +143,7 @@ export const items = [ }, { when: '0.4 Alpha', - subtext: 'May 2024', + subtext: 'June 2024', title: 'AI search', description: 'Search the contents of your files, including images, audio and video with a deep understanding of context and content.' @@ -156,6 +159,11 @@ export const items = [ description: 'Backup and sync from anywhere with a Spacedrive Cloud account. Paid plans for additional storage and cloud features.' }, + { + title: 'CLI', + description: + 'Access Spacedrive from the command line, with a rich set of commands to manage your library and devices.' + }, { title: 'Web portal', description: @@ -177,7 +185,7 @@ export const items = [ }, { when: '0.5 Beta', - subtext: 'June 2024', + subtext: 'August 2024', title: 'Encrypted vault(s)', description: 'Effortlessly manage & encrypt sensitive files. Encrypt individual files or create flexible-size vaults.' @@ -185,7 +193,7 @@ export const items = [ { title: 'Extensions', description: - 'Build tools on top of Spacedrive, extend functionality and integrate third party services. Extension directory on spacedrive.com/extensions.' + 'Build tools on top of Spacedrive, extend functionality and integrate third party services.' }, { when: '1.0 Release', diff --git a/apps/landing/src/app/team/people.tsx b/apps/landing/src/app/team/people.tsx index b08809593..3b4f6a9f8 100644 --- a/apps/landing/src/app/team/people.tsx +++ b/apps/landing/src/app/team/people.tsx @@ -31,39 +31,6 @@ export const teamMembers: Array = [ github: 'https://github.com/fogodev' } }, - - { - name: 'Nik Elšnik', - location: 'Slovenia', - role: 'TypeScript Engineer - Lead Interface', - imageUrl: '/images/team/nikec.jpg', - socials: { - github: 'https://github.com/niikeec', - twitter: 'https://x.com/nikec_' - } - }, - { - name: 'Brendan Allan', - location: 'Western Australia', - role: 'Rust Engineer - Database & Sync', - imageUrl: '/images/team/brendan.jpg', - socials: { - twitter: 'https://x.com/brendonovichdev', - twitch: 'https://twitch.tv/brendonovich', - github: 'https://github.com/brendonovich' - } - }, - { - name: 'Oscar Beaumont', - location: 'Western Australia', - role: 'Rust Engineer - P2P & Networking', - imageUrl: '/images/team/oscar.jpg', - socials: { - twitter: 'https://x.com/oscartbeaumont', - twitch: 'https://twitch.tv/oscartbeaumont', - github: 'https://github.com/oscartbeaumont' - } - }, { name: 'Mihail Dounaev', location: 'Finland', @@ -74,15 +41,6 @@ export const teamMembers: Array = [ dribbble: 'https://dribbble.com/mmmint' } }, - { - name: 'Jake Robinson', - location: 'United Kingdom', - role: 'Rust Engineer - Cryptographer', - imageUrl: '/images/team/jake.jpg', - socials: { - github: 'https://github.com/brxken128' - } - }, { name: 'Ameer Al Ashhab', location: 'Jordan', diff --git a/apps/landing/src/components/AppImage.tsx b/apps/landing/src/components/AppImage.tsx deleted file mode 100644 index bbe2fce8c..000000000 --- a/apps/landing/src/components/AppImage.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import Image from 'next/image'; -import { tw } from '@sd/ui'; - -const AppFrameOuter = tw.div`relative m-auto flex w-full max-w-7xl rounded-lg transition-opacity px-4`; -const AppFrameInner = tw.div`z-30 flex w-full rounded-lg border-t border-app-line/50 backdrop-blur`; - -const AppImage = () => { - return ( -
-
-
-
-
-
-
- - - spacedrive - - -
-
- ); -}; - -export default AppImage; diff --git a/apps/mobile/assets/icon.png b/apps/mobile/assets/icon.png index 0ece0a8ae..9601baea2 100644 Binary files a/apps/mobile/assets/icon.png and b/apps/mobile/assets/icon.png differ diff --git a/apps/mobile/assets/splash.png b/apps/mobile/assets/splash.png index 25f18c68c..aa1256d46 100644 Binary files a/apps/mobile/assets/splash.png and b/apps/mobile/assets/splash.png differ diff --git a/apps/mobile/modules/sd-core/android/crate/Cargo.toml b/apps/mobile/modules/sd-core/android/crate/Cargo.toml index 31a6cfb93..afdf90d3f 100644 --- a/apps/mobile/modules/sd-core/android/crate/Cargo.toml +++ b/apps/mobile/modules/sd-core/android/crate/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sd-mobile-android" version = "0.1.0" -rust-version = "1.64.0" +rust-version = "1.64" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } @@ -14,8 +14,8 @@ crate-type = ["cdylib"] # Spacedrive Sub-crates sd-mobile-core = { path = "../../core" } -# FFI -jni = "0.21.1" - -# Other +# Workspace dependencies tracing = { workspace = true } + +# Specific Mobile Android dependencies +jni = "0.21.1" diff --git a/apps/mobile/modules/sd-core/core/Cargo.toml b/apps/mobile/modules/sd-core/core/Cargo.toml index 25685d0f0..d4f011dee 100644 --- a/apps/mobile/modules/sd-core/core/Cargo.toml +++ b/apps/mobile/modules/sd-core/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sd-mobile-core" version = "0.1.0" -rust-version = "1.64.0" +rust-version = "1.64" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } @@ -12,6 +12,7 @@ sd-core = { path = "../../../../../core", features = [ "mobile", ], default-features = false } +# Workspace dependencies futures = { workspace = true } once_cell = { workspace = true } rspc = { workspace = true } @@ -19,5 +20,6 @@ serde_json = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } -futures-channel = "0.3.29" +# Specific Mobile Core dependencies +futures-channel = "0.3.30" futures-locks = "0.7.1" diff --git a/apps/mobile/modules/sd-core/core/src/lib.rs b/apps/mobile/modules/sd-core/core/src/lib.rs index 0f5851bb4..575447ca4 100644 --- a/apps/mobile/modules/sd-core/core/src/lib.rs +++ b/apps/mobile/modules/sd-core/core/src/lib.rs @@ -76,8 +76,8 @@ pub fn handle_core_msg( let new_node = match Node::new(data_dir, sd_core::Env::new(CLIENT_ID)).await { Ok(node) => node, - Err(err) => { - error!("failed to initialise node: {}", err); + Err(e) => { + error!(?e, "Failed to initialize node;"); callback(Err(query)); return; } @@ -94,8 +94,8 @@ pub fn handle_core_msg( false => from_value::(v).map(|v| vec![v]), }) { Ok(v) => v, - Err(err) => { - error!("failed to decode JSON-RPC request: {}", err); // Don't use tracing here because it's before the `Node` is initialised which sets that config! + Err(e) => { + error!(?e, "Failed to decode JSON-RPC request;"); callback(Err(query)); return; } @@ -133,8 +133,8 @@ pub fn spawn_core_event_listener(callback: impl Fn(String) + Send + 'static) { while let Some(event) = rx.next().await { let data = match to_string(&event) { Ok(json) => json, - Err(err) => { - error!("Failed to serialize event: {err}"); + Err(e) => { + error!(?e, "Failed to serialize event;"); continue; } }; diff --git a/apps/mobile/modules/sd-core/ios/crate/Cargo.toml b/apps/mobile/modules/sd-core/ios/crate/Cargo.toml index 11ec5734c..693263f3d 100644 --- a/apps/mobile/modules/sd-core/ios/crate/Cargo.toml +++ b/apps/mobile/modules/sd-core/ios/crate/Cargo.toml @@ -1,12 +1,11 @@ [package] name = "sd-mobile-ios" version = "0.1.0" -rust-version = "1.64.0" +rust-version = "1.64" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } - [lib] # iOS requires static linking # Makes sense considering this lib needs to link against call_resolve and get_data_directory, diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 9dc4a7008..fdd639fb7 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -41,6 +41,7 @@ "expo-av": "^13.10.5", "expo-blur": "^12.9.2", "expo-build-properties": "~0.11.1", + "expo-haptics": "~12.8.1", "expo-image": "^1.10.6", "expo-linking": "~6.2.2", "expo-media-library": "~15.9.1", diff --git a/apps/mobile/src/App.tsx b/apps/mobile/src/App.tsx index 93e24dbf2..54e45cb5d 100644 --- a/apps/mobile/src/App.tsx +++ b/apps/mobile/src/App.tsx @@ -4,6 +4,19 @@ import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; +import { + ClientContextProvider, + LibraryContextProvider, + P2PContextProvider, + RspcProvider, + initPlausible, + useBridgeQuery, + useClientContext, + useInvalidateQuery, + usePlausibleEvent, + usePlausiblePageViewMonitor, + usePlausiblePingMonitor +} from '@sd/client'; import { QueryClient } from '@tanstack/react-query'; import dayjs from 'dayjs'; import advancedFormat from 'dayjs/plugin/advancedFormat'; @@ -17,21 +30,6 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { MenuProvider } from 'react-native-popup-menu'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import { useSnapshot } from 'valtio'; -import { - CacheProvider, - ClientContextProvider, - createCache, - initPlausible, - LibraryContextProvider, - P2PContextProvider, - RspcProvider, - useBridgeQuery, - useClientContext, - useInvalidateQuery, - usePlausibleEvent, - usePlausiblePageViewMonitor, - usePlausiblePingMonitor -} from '@sd/client'; import { GlobalModals } from './components/modal/GlobalModals'; import { Toast, toastConfig } from './components/primitive/Toast'; @@ -57,13 +55,17 @@ function AppNavigation() { const plausibleEvent = usePlausibleEvent(); const buildInfo = useBridgeQuery(['buildInfo']); - initPlausible({ platformType: 'mobile', buildInfo: buildInfo?.data }); - const navRef = useNavigationContainerRef(); const routeNameRef = useRef(); const [currentPath, setCurrentPath] = useState('/'); + useEffect(() => { + if (buildInfo?.data) { + initPlausible({ platformType: 'mobile', buildInfo: buildInfo.data }); + } + }, [buildInfo]); + usePlausiblePageViewMonitor({ currentPath }); usePlausiblePingMonitor({ currentPath }); @@ -75,9 +77,11 @@ function AppNavigation() { return () => clearInterval(interval); }, [plausibleEvent]); - if (library === null && libraries.data) { - currentLibraryStore.id = libraries.data[0]?.uuid ?? null; - } + useEffect(() => { + if (library === null && libraries.data) { + currentLibraryStore.id = libraries.data[0]?.uuid ?? null; + } + }, [library, libraries]); return ( { @@ -155,9 +158,7 @@ export default function App() { return ( - - - + ); } diff --git a/apps/mobile/src/components/browse/BrowseCategories.tsx b/apps/mobile/src/components/browse/BrowseCategories.tsx index 39ab1a7bb..81138bb13 100644 --- a/apps/mobile/src/components/browse/BrowseCategories.tsx +++ b/apps/mobile/src/components/browse/BrowseCategories.tsx @@ -3,11 +3,10 @@ import { ArchiveBox, Briefcase, Clock, - DotsThreeOutline, + DotsThree, Heart, Images, MapPin, - Tag, UserFocus } from 'phosphor-react-native'; import { Text, View } from 'react-native'; @@ -18,7 +17,7 @@ import { Button } from '../primitive/Button'; import LibraryItem from './LibraryItem'; const iconStyle = tw`text-ink-faint`; -const iconSize = 28; +const iconSize = 24; export const CATEGORIES_LIST = [ { name: 'Albums', icon: }, { name: 'Places', icon: }, @@ -32,17 +31,17 @@ export const CATEGORIES_LIST = [ const BrowseCategories = () => { const navigation = useNavigation['navigation']>(); return ( - + Library diff --git a/apps/mobile/src/components/browse/BrowseLocations.tsx b/apps/mobile/src/components/browse/BrowseLocations.tsx index 6ceadd16c..991404cab 100644 --- a/apps/mobile/src/components/browse/BrowseLocations.tsx +++ b/apps/mobile/src/components/browse/BrowseLocations.tsx @@ -1,14 +1,15 @@ import { useNavigation } from '@react-navigation/native'; -import { DotsThreeOutline, Plus } from 'phosphor-react-native'; -import { useRef } from 'react'; -import { Text, View } from 'react-native'; -import { useCache, useLibraryQuery, useNodes } from '@sd/client'; +import { useLibraryQuery } from '@sd/client'; +import { useRef, useState } from 'react'; +import { FlatList, Text, View } from 'react-native'; import { ModalRef } from '~/components/layout/Modal'; -import { tw } from '~/lib/tailwind'; +import { tw, twStyle } from '~/lib/tailwind'; import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; import { SettingsStackScreenProps } from '~/navigation/tabs/SettingsStack'; +import { Plus } from 'phosphor-react-native'; import Empty from '../layout/Empty'; +import Fade from '../layout/Fade'; import { LocationItem } from '../locations/LocationItem'; import ImportModal from '../modal/ImportModal'; import { Button } from '../primitive/Button'; @@ -20,55 +21,64 @@ const BrowseLocations = () => { >(); const modalRef = useRef(null); - + const [showAll, setShowAll] = useState(false); const result = useLibraryQuery(['locations.list'], { keepPreviousData: true }); - useNodes(result.data?.nodes); - const locations = useCache(result.data?.items); + const locations = result.data; return ( - - + + Locations - - {locations?.length === 0 ? ( - - ) : ( - <> - {locations?.slice(0, 3).map((location) => ( + + + } + numColumns={showAll ? 3 : 1} + horizontal={showAll ? false : true} + contentContainerStyle={twStyle(locations?.length === 0 && 'w-full','px-5')} + key={showAll ? '_locations' : 'alllocationcols'} + keyExtractor={(item) => item.id.toString()} + scrollEnabled={showAll ? false : true} + showsHorizontalScrollIndicator={false} + renderItem={({ item }) => { + return ( navigation.navigate('SettingsStack', { screen: 'EditLocationSettings', - params: { id: location.id }, + params: { id: item.id }, initial: false }) } - onPress={() => navigation.navigate('Location', { id: location.id })} - /> - ))} - - )} + onPress={() => navigation.navigate('Location', { id: item.id })} + /> + )} + } + /> + diff --git a/apps/mobile/src/components/browse/BrowseTags.tsx b/apps/mobile/src/components/browse/BrowseTags.tsx index fa74e98d8..a1360362d 100644 --- a/apps/mobile/src/components/browse/BrowseTags.tsx +++ b/apps/mobile/src/components/browse/BrowseTags.tsx @@ -1,13 +1,14 @@ import { useNavigation } from '@react-navigation/native'; -import { DotsThreeOutline, Plus } from 'phosphor-react-native'; -import React, { useRef } from 'react'; -import { Text, View } from 'react-native'; -import { useCache, useLibraryQuery, useNodes } from '@sd/client'; +import { useLibraryQuery } from '@sd/client'; +import { Plus } from 'phosphor-react-native'; +import React, { useRef, useState } from 'react'; +import { FlatList, Text, View } from 'react-native'; import { ModalRef } from '~/components/layout/Modal'; -import { tw } from '~/lib/tailwind'; +import { tw, twStyle } from '~/lib/tailwind'; import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; import Empty from '../layout/Empty'; +import Fade from '../layout/Fade'; import CreateTagModal from '../modal/tag/CreateTagModal'; import { Button } from '../primitive/Button'; import { TagItem } from '../tags/TagItem'; @@ -16,52 +17,61 @@ const BrowseTags = () => { const navigation = useNavigation['navigation']>(); const tags = useLibraryQuery(['tags.list']); - - useNodes(tags.data?.nodes); - const tagData = useCache(tags.data?.items); + const tagData = tags.data; const modalRef = useRef(null); + const [showAll, setShowAll] = useState(false); return ( - - + + Tags - - {tagData?.length === 0 ? ( - - ) : ( - tagData - ?.slice(0, 3) - .map((tag) => ( + + + } + numColumns={showAll ? 3 : 1} + contentContainerStyle={twStyle(tagData?.length === 0 && 'w-full','px-5')} + horizontal={showAll ? false : true} + key={showAll ? '_tags' : 'alltagcols'} + keyExtractor={(item) => item.id.toString()} + scrollEnabled={showAll ? false : true} + showsHorizontalScrollIndicator={false} + renderItem={({ item }) => ( - navigation.navigate('Tag', { id: tag.id, color: tag.color! }) - } - /> - )) - )} + style={twStyle(showAll && 'max-w-[31%] flex-1')} + key={item.id} + tag={item} + onPress={() => + navigation.navigate('Tag', { id: item.id, color: item.color! }) + } + /> + )} + /> + diff --git a/apps/mobile/src/components/browse/Jobs.tsx b/apps/mobile/src/components/browse/Jobs.tsx index d599fd8c8..86b58185f 100644 --- a/apps/mobile/src/components/browse/Jobs.tsx +++ b/apps/mobile/src/components/browse/Jobs.tsx @@ -12,7 +12,7 @@ const Jobs = () => { return ( - Jobs + Active Jobs diff --git a/apps/mobile/src/components/browse/ListLibraryItem.tsx b/apps/mobile/src/components/browse/ListLibraryItem.tsx index 22db21b1e..f937c9a16 100644 --- a/apps/mobile/src/components/browse/ListLibraryItem.tsx +++ b/apps/mobile/src/components/browse/ListLibraryItem.tsx @@ -12,9 +12,9 @@ interface CategoryProps { const ListLibraryItem = ({ name, icon }: CategoryProps) => { return ( - + {icon} - {name} + {name} { const submitPlausibleEvent = usePlausibleEvent(); const queryClient = useQueryClient(); - const cache = useNormalisedCache(); const createLibrary = useBridgeMutation('library.create', { - onSuccess: (libRaw) => { - cache.withNodes(libRaw.nodes); - const lib = cache.withCache(libRaw.item); - + onSuccess: (lib) => { // We do this instead of invalidating the query because it triggers a full app re-render?? insertLibrary(queryClient, lib); } @@ -90,15 +85,13 @@ const useFormState = () => { try { // show creation screen for a bit for smoothness - const [libraryRaw] = await Promise.all([ + const [library] = await Promise.all([ createLibrary.mutateAsync({ name: data.NewLibrary.name, default_locations: null }), new Promise((res) => setTimeout(res, 500)) ]); - cache.withNodes(libraryRaw.nodes); - const library = cache.withCache(libraryRaw.item); if (telemetryState.shareFullTelemetry) { submitPlausibleEvent({ event: { type: 'libraryCreate' } }); @@ -109,7 +102,7 @@ const useFormState = () => { // Switch to the new library currentLibraryStore.id = library.uuid; } catch (e) { - toast({ type: 'error', text: 'Failed to create library' }); + toast.error('Failed to create library'); resetOnboardingStore(); navigation.navigate('GetStarted'); } diff --git a/apps/mobile/src/components/drawer/DrawerContent.tsx b/apps/mobile/src/components/drawer/DrawerContent.tsx index 02817e080..b46099351 100644 --- a/apps/mobile/src/components/drawer/DrawerContent.tsx +++ b/apps/mobile/src/components/drawer/DrawerContent.tsx @@ -1,11 +1,11 @@ import { DrawerContentScrollView } from '@react-navigation/drawer'; import { DrawerContentComponentProps } from '@react-navigation/drawer/lib/typescript/src/types'; import { AppLogo } from '@sd/assets/images'; +import { JobManagerContextProvider, useLibraryQuery } from '@sd/client'; import { Image } from 'expo-image'; import { CheckCircle } from 'phosphor-react-native'; import { useRef } from 'react'; import { Platform, Pressable, Text, View } from 'react-native'; -import { JobManagerContextProvider, useLibraryQuery } from '@sd/client'; import Layout from '~/constants/Layout'; import { tw, twStyle } from '~/lib/tailwind'; diff --git a/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx b/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx index 15e05ff1d..112de0b9d 100644 --- a/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx +++ b/apps/mobile/src/components/drawer/DrawerLibraryManager.tsx @@ -1,16 +1,17 @@ import { useDrawerStatus } from '@react-navigation/drawer'; import { useNavigation } from '@react-navigation/native'; +import { useClientContext } from '@sd/client'; import { MotiView } from 'moti'; -import { CaretRight, Gear, Lock, Plus } from 'phosphor-react-native'; +import { CaretRight, CloudArrowDown, Gear, Lock, Plus } from 'phosphor-react-native'; import { useEffect, useRef, useState } from 'react'; import { Alert, Pressable, Text, View } from 'react-native'; -import { useClientContext } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; import { currentLibraryStore } from '~/utils/nav'; import { AnimatedHeight } from '../animation/layout'; import { ModalRef } from '../layout/Modal'; import CreateLibraryModal from '../modal/CreateLibraryModal'; +import ImportModalLibrary from '../modal/ImportLibraryModal'; import { Divider } from '../primitive/Divider'; const DrawerLibraryManager = () => { @@ -23,10 +24,10 @@ const DrawerLibraryManager = () => { }, [isDrawerOpen]); const { library: currentLibrary, libraries } = useClientContext(); - const navigation = useNavigation(); const modalRef = useRef(null); + const modalRef_import = useRef(null); return ( @@ -56,7 +57,6 @@ const DrawerLibraryManager = () => { > {/* Libraries */} {libraries.data?.map((library) => { - // console.log('library', library); return ( { New Library + modalRef_import.current?.present()} + > + + Import Library + + {/* Manage Library */} { diff --git a/apps/mobile/src/components/drawer/DrawerLocations.tsx b/apps/mobile/src/components/drawer/DrawerLocations.tsx index 6ab9a2c5d..7dde34e90 100644 --- a/apps/mobile/src/components/drawer/DrawerLocations.tsx +++ b/apps/mobile/src/components/drawer/DrawerLocations.tsx @@ -1,16 +1,14 @@ import { DrawerNavigationHelpers } from '@react-navigation/drawer/lib/typescript/src/types'; import { useNavigation } from '@react-navigation/native'; -import { useRef } from 'react'; -import { Pressable, Text, View } from 'react-native'; import { - arraysEqual, - byteSize, Location, - useCache, + arraysEqual, + humanizeSize, useLibraryQuery, - useNodes, useOnlineLocations } from '@sd/client'; +import { useRef } from 'react'; +import { Pressable, Text, View } from 'react-native'; import { ModalRef } from '~/components/layout/Modal'; import { tw, twStyle } from '~/lib/tailwind'; @@ -47,13 +45,13 @@ const DrawerLocationItem: React.FC = ({ )} /> - + {location.name ?? ''} - - - {`${byteSize(location.size_in_bytes)}`} + + + {`${humanizeSize(location.size_in_bytes)}`} @@ -67,8 +65,7 @@ const DrawerLocations = () => { const modalRef = useRef(null); const result = useLibraryQuery(['locations.list'], { keepPreviousData: true }); - useNodes(result.data?.nodes); - const locations = useCache(result.data?.items); + const locations = result.data || []; return ( <> diff --git a/apps/mobile/src/components/drawer/DrawerTags.tsx b/apps/mobile/src/components/drawer/DrawerTags.tsx index d36916176..69ed080e8 100644 --- a/apps/mobile/src/components/drawer/DrawerTags.tsx +++ b/apps/mobile/src/components/drawer/DrawerTags.tsx @@ -1,8 +1,8 @@ import { DrawerNavigationHelpers } from '@react-navigation/drawer/lib/typescript/src/types'; import { useNavigation } from '@react-navigation/native'; +import { Tag, useLibraryQuery } from '@sd/client'; import { useRef } from 'react'; import { ColorValue, Pressable, Text, View } from 'react-native'; -import { Tag, useCache, useLibraryQuery, useNodes } from '@sd/client'; import { ModalRef } from '~/components/layout/Modal'; import { tw, twStyle } from '~/lib/tailwind'; @@ -19,11 +19,9 @@ type DrawerTagItemProps = { const DrawerTagItem: React.FC = (props) => { const { tagName, tagColor, onPress } = props; return ( - + @@ -38,8 +36,7 @@ const DrawerTags = () => { const tags = useLibraryQuery(['tags.list']); const navigation = useNavigation(); - useNodes(tags.data?.nodes); - const tagData = useCache(tags.data?.items); + const tagData = tags.data || []; const modalRef = useRef(null); @@ -51,7 +48,7 @@ const DrawerTags = () => { > - + {tagData?.length > 2 && } {/* Add Tag */} @@ -93,15 +90,18 @@ interface TagColumnProps { const TagColumn = ({ tags, dataAmount }: TagColumnProps) => { const navigation = useNavigation(); return ( - - {tags?.slice(dataAmount[0], dataAmount[1]).map((tag: any) => ( + 2 ? 'w-[49%] flex-col' : 'flex-1 flex-row' + )}> + {tags?.slice(dataAmount[0], dataAmount[1]).map((tag: Tag) => ( navigation.navigate('BrowseStack', { screen: 'Tag', - params: { id: tag.id, color: tag.color } + params: { id: tag.id, color: tag.color }, + initial: false }) } tagColor={tag.color as ColorValue} diff --git a/apps/mobile/src/components/explorer/Explorer.tsx b/apps/mobile/src/components/explorer/Explorer.tsx index 7ac69fa76..a7339c23d 100644 --- a/apps/mobile/src/components/explorer/Explorer.tsx +++ b/apps/mobile/src/components/explorer/Explorer.tsx @@ -1,20 +1,19 @@ import { useNavigation } from '@react-navigation/native'; +import { SearchData, isPath, type ExplorerItem } from '@sd/client'; import { FlashList } from '@shopify/flash-list'; import { UseInfiniteQueryResult } from '@tanstack/react-query'; -import { AnimatePresence, MotiView } from 'moti'; -import { useState } from 'react'; import { ActivityIndicator, Pressable } from 'react-native'; -import { isPath, SearchData, type ExplorerItem } from '@sd/client'; import Layout from '~/constants/Layout'; -import { tw } from '~/lib/tailwind'; import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; -import { ExplorerLayoutMode, getExplorerStore, useExplorerStore } from '~/stores/explorerStore'; +import { useExplorerStore } from '~/stores/explorerStore'; import { useActionsModalStore } from '~/stores/modalStore'; +import * as Haptics from 'expo-haptics'; +import { tw } from '~/lib/tailwind'; import ScreenContainer from '../layout/ScreenContainer'; import FileItem from './FileItem'; import FileRow from './FileRow'; -import Menu from './Menu'; +import Menu from './menu/Menu'; type ExplorerProps = { tabHeight?: boolean; @@ -23,98 +22,86 @@ type ExplorerProps = { loadMore: () => void; query: UseInfiniteQueryResult>; count?: number; -}; + empty?: never; + isEmpty?: never; +} -const Explorer = (props: ExplorerProps) => { +type Props = | +ExplorerProps +| ({ + // isEmpty and empty are mutually exclusive + emptyComponent: React.ReactElement; // component to show when FlashList has no data + isEmpty: boolean; // if true - show empty component +} & Omit); + +const Explorer = (props: Props) => { const navigation = useNavigation['navigation']>(); - const explorerStore = useExplorerStore(); - const [layoutMode, setLayoutMode] = useState(getExplorerStore().layoutMode); - - function changeLayoutMode(kind: ExplorerLayoutMode) { - // We need to keep layoutMode as a state to make sure flash-list re-renders. - setLayoutMode(kind); - getExplorerStore().layoutMode = kind; - } - + const store = useExplorerStore(); const { modalRef, setData } = useActionsModalStore(); function handlePress(data: ExplorerItem) { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); if (isPath(data) && data.item.is_dir && data.item.location_id !== null) { - navigation.push('Location', { - id: data.item.location_id, - path: `${data.item.materialized_path}${data.item.name}/` - }); + navigation.push('Location', { + id: data.item.location_id, + path: `${data.item.materialized_path}${data.item.name}/` + }); } else { setData(data); modalRef.current?.present(); } } + function handleLongPress(data: ExplorerItem) { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); + setData(data); + modalRef.current?.present(); + } + return ( - {/* Header */} - {/* Sort By */} - {/* */} - - {explorerStore.toggleMenu && ( - - { - changeLayoutMode(kind); - }} - layoutMode={layoutMode} - /> - - )} - - {/* Layout (Grid/List) */} - {/* {layoutMode === 'grid' ? ( - changeLayoutMode('list')}> - - - ) : ( - changeLayoutMode('grid')}> - - - )} */} + + {/* Flashlist not supporting empty centering: https://github.com/Shopify/flash-list/discussions/517 + So needs to be done this way */} {/* Items */} - - item.type === 'NonIndexedPath' - ? item.item.path - : item.type === 'SpacedropPeer' - ? item.item.name - : item.item.id.toString() - } - renderItem={({ item }) => ( - handlePress(item)}> - {layoutMode === 'grid' ? : } - - )} - contentContainerStyle={tw`px-2 py-5`} - extraData={layoutMode} - estimatedItemSize={ - layoutMode === 'grid' - ? Layout.window.width / getExplorerStore().gridNumColumns - : getExplorerStore().listItemSize - } - onEndReached={() => props.loadMore?.()} - onEndReachedThreshold={0.6} - ListFooterComponent={props.query.isFetchingNextPage ? : null} - /> + {props.isEmpty ? ( + props.emptyComponent + ) : + + item.type === 'NonIndexedPath' + ? item.item.path + : item.type === 'SpacedropPeer' + ? item.item.name + : item.item.id.toString() + } + renderItem={({ item }) => ( + handlePress(item)} + onLongPress={() => handleLongPress(item)} + > + {store.layoutMode === 'grid' ? ( + + ) : ( + + )} + + )} + contentContainerStyle={tw`px-2 py-5`} + extraData={store.layoutMode} + estimatedItemSize={ + store.layoutMode === 'grid' + ? Layout.window.width / store.gridNumColumns + : store.listItemSize + } + onEndReached={() => props.loadMore?.()} + onEndReachedThreshold={0.6} + ListFooterComponent={props.query.isFetchingNextPage ? : null} + /> + } ); }; diff --git a/apps/mobile/src/components/explorer/FileItem.tsx b/apps/mobile/src/components/explorer/FileItem.tsx index c583a36c3..62d30d29d 100644 --- a/apps/mobile/src/components/explorer/FileItem.tsx +++ b/apps/mobile/src/components/explorer/FileItem.tsx @@ -1,9 +1,10 @@ +import { ExplorerItem, Tag, getItemFilePath, getItemObject } from '@sd/client'; import { Text, View } from 'react-native'; -import { ExplorerItem, getItemFilePath } from '@sd/client'; import Layout from '~/constants/Layout'; import { tw, twStyle } from '~/lib/tailwind'; import { getExplorerStore } from '~/stores/explorerStore'; +import { useMemo } from 'react'; import FileThumb from './FileThumb'; type FileItemProps = { @@ -14,6 +15,13 @@ const FileItem = ({ data }: FileItemProps) => { const gridItemSize = Layout.window.width / getExplorerStore().gridNumColumns; const filePath = getItemFilePath(data); + const object = getItemObject(data); + + const maxTags = 3; + const tags = useMemo(() => { + if (!object) return []; + return 'tags' in object ? object.tags.slice(0, maxTags) : []; + }, [object]); return ( { {filePath?.extension && `.${filePath.extension}`} + + {tags.map(({tag}: {tag: Tag}, idx: number) => { + return ( + + ) + })} + ); }; diff --git a/apps/mobile/src/components/explorer/FileRow.tsx b/apps/mobile/src/components/explorer/FileRow.tsx index 8853ea77b..25ac79a5f 100644 --- a/apps/mobile/src/components/explorer/FileRow.tsx +++ b/apps/mobile/src/components/explorer/FileRow.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import { ExplorerItem, Tag, getItemFilePath, getItemObject } from '@sd/client'; +import React, { useMemo } from 'react'; import { Text, View } from 'react-native'; -import { ExplorerItem, getItemFilePath } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; import { getExplorerStore } from '~/stores/explorerStore'; @@ -12,21 +12,47 @@ type FileRowProps = { const FileRow = ({ data }: FileRowProps) => { const filePath = getItemFilePath(data); + const object = getItemObject(data); + + const maxTags = 3; + const tags = useMemo(() => { + if (!object) return []; + return 'tags' in object ? object.tags.slice(0, maxTags) : []; + }, [object]); return ( + <> - - - + + + + {filePath?.name} {filePath?.extension && `.${filePath.extension}`} + + {tags.map(({tag}: {tag: Tag}, idx: number) => { + return ( + + ) + })} + + + ); }; diff --git a/apps/mobile/src/components/explorer/FileThumb.tsx b/apps/mobile/src/components/explorer/FileThumb.tsx index 0ee343e7a..ffc51417a 100644 --- a/apps/mobile/src/components/explorer/FileThumb.tsx +++ b/apps/mobile/src/components/explorer/FileThumb.tsx @@ -1,24 +1,24 @@ import { DocumentDirectoryPath } from '@dr.pogodin/react-native-fs'; import { getIcon } from '@sd/assets/util'; -import { Image } from 'expo-image'; -import { useEffect, useLayoutEffect, useMemo, useState, type PropsWithChildren } from 'react'; -import { View } from 'react-native'; import { + ThumbKey, getExplorerItemData, - getItemFilePath, getItemLocation, isDarkTheme, type ExplorerItem } from '@sd/client'; +import { Image } from 'expo-image'; +import { useEffect, useLayoutEffect, useMemo, useState, type PropsWithChildren } from 'react'; +import { View } from 'react-native'; import { flattenThumbnailKey, useExplorerStore } from '~/stores/explorerStore'; import { tw } from '../../lib/tailwind'; // NOTE: `file://` is required for Android to load local files! -export const getThumbnailUrlByThumbKey = (thumbKey: string[]) => { - return `file://${DocumentDirectoryPath}/thumbnails/${thumbKey - .map((i) => encodeURIComponent(i)) - .join('/')}.webp`; +export const getThumbnailUrlByThumbKey = (thumbKey: ThumbKey) => { + return `file://${DocumentDirectoryPath}/thumbnails/${encodeURIComponent( + thumbKey.base_directory_str + )}/${encodeURIComponent(thumbKey.shard_hex)}/${encodeURIComponent(thumbKey.cas_id)}.webp`; }; const FileThumbWrapper = ({ children, size = 1 }: PropsWithChildren<{ size: number }>) => ( @@ -70,7 +70,6 @@ type FileThumbProps = { export default function FileThumb({ size = 1, ...props }: FileThumbProps) { const itemData = useExplorerItemData(props.data); const locationData = getItemLocation(props.data); - const filePath = getItemFilePath(props.data); const [src, setSrc] = useState(null); const [thumbType, setThumbType] = useState(ThumbType.Icon); @@ -131,7 +130,6 @@ export default function FileThumb({ size = 1, ...props }: FileThumbProps) { break; } }, [itemData, thumbType]); - return ( {(() => { diff --git a/apps/mobile/src/components/explorer/Menu.tsx b/apps/mobile/src/components/explorer/Menu.tsx deleted file mode 100644 index a6e2082f8..000000000 --- a/apps/mobile/src/components/explorer/Menu.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { MonitorPlay, Rows, SlidersHorizontal, SquaresFour } from 'phosphor-react-native'; -import { Pressable, View } from 'react-native'; -import { tw } from '~/lib/tailwind'; -import { ExplorerLayoutMode } from '~/stores/explorerStore'; - -interface MenuProps { - layoutMode: ExplorerLayoutMode; - changeLayoutMode: (kind: ExplorerLayoutMode) => void; -} - -const Menu = ({ layoutMode, changeLayoutMode }: MenuProps) => { - return ( - - - changeLayoutMode('grid')}> - - - changeLayoutMode('list')}> - - - changeLayoutMode('media')}> - - - - - - ); -}; - -export default Menu; diff --git a/apps/mobile/src/components/explorer/menu/Menu.tsx b/apps/mobile/src/components/explorer/menu/Menu.tsx new file mode 100644 index 000000000..0d73bb8e1 --- /dev/null +++ b/apps/mobile/src/components/explorer/menu/Menu.tsx @@ -0,0 +1,67 @@ +import { AnimatePresence, MotiView } from 'moti'; +import { Rows, SquaresFour } from 'phosphor-react-native'; +import { Pressable, View } from 'react-native'; +import { tw } from '~/lib/tailwind'; +import { getExplorerStore, useExplorerStore } from '~/stores/explorerStore'; + +import SortByMenu from './SortByMenu'; + +const Menu = () => { + const store = useExplorerStore(); + + return ( + + {store.toggleMenu && ( + + + + {store.layoutMode === 'grid' ? ( + (getExplorerStore().layoutMode = 'list')}> + + + ) : ( + (getExplorerStore().layoutMode = 'grid')}> + + + )} + {/* toast.error('Media view is not available yet...')} + // onPress={() => (getExplorerStore().layoutMode = 'media')} + > + + */} + + + )} + + ); +}; +export default Menu; diff --git a/apps/mobile/src/components/explorer/menu/SortByMenu.tsx b/apps/mobile/src/components/explorer/menu/SortByMenu.tsx new file mode 100644 index 000000000..8abd4322d --- /dev/null +++ b/apps/mobile/src/components/explorer/menu/SortByMenu.tsx @@ -0,0 +1,80 @@ +import { ArrowDown, ArrowUp, CaretDown, Check } from 'phosphor-react-native'; +import { Text, View } from 'react-native'; +import { Menu, MenuItem } from '~/components/primitive/Menu'; +import { tw } from '~/lib/tailwind'; +import { SortOptionsType, getSearchStore, useSearchStore } from '~/stores/searchStore'; + +const sortOptions = { + none: 'None', + name: 'Name', + sizeInBytes: 'Size', + dateIndexed: 'Date Indexed', + dateCreated: 'Date Created', + dateModified: 'Date Modified', + dateAccessed: 'Date Accessed', + dateTaken: 'Date Taken', +} satisfies Record; + +const sortOrder = ['Asc', 'Desc'] as SortOptionsType['direction'][]; + +const ArrowUpIcon = ; +const ArrowDownIcon = ; + +const SortByMenu = () => { + const searchStore = useSearchStore(); + return ( + + } + + > + {(Object.entries(sortOptions) as [[SortOptionsType['by'], string]]).map(([value, text], idx) => ( + + getSearchStore().sort.by = value} + /> + {idx !== Object.keys(sortOptions).length - 1 && } + + ))} + + + } + > + {sortOrder.map((value, idx) => ( + + getSearchStore().sort.direction = value} + /> + {idx !== 1 && } + + ))} + + + ); +}; + +interface Props { + activeOption: string; + triggerIcon?: React.ReactNode; +} + +const Trigger = ({activeOption, triggerIcon}: Props) => { + return ( + + {activeOption} + {triggerIcon ? triggerIcon : } + + ) +} + +export default SortByMenu; diff --git a/apps/mobile/src/components/explorer/sections/FavoriteButton.tsx b/apps/mobile/src/components/explorer/sections/FavoriteButton.tsx index 99afcef19..00091020e 100644 --- a/apps/mobile/src/components/explorer/sections/FavoriteButton.tsx +++ b/apps/mobile/src/components/explorer/sections/FavoriteButton.tsx @@ -1,8 +1,8 @@ -import { useQueryClient } from '@tanstack/react-query'; +import { Object as SDObject, useLibraryMutation } from '@sd/client'; +import * as Haptics from 'expo-haptics'; import { Heart } from 'phosphor-react-native'; import { useState } from 'react'; import { Pressable, PressableProps } from 'react-native'; -import { Object as SDObject, useLibraryMutation } from '@sd/client'; type Props = { data: SDObject; @@ -10,13 +10,13 @@ type Props = { }; const FavoriteButton = (props: Props) => { - const queryClient = useQueryClient(); const [favorite, setFavorite] = useState(props.data.favorite); const { mutate: toggleFavorite, isLoading } = useLibraryMutation('files.setFavorite', { onSuccess: () => { // TODO: Invalidate search queries setFavorite(!favorite); + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); } }); diff --git a/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx b/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx index f5355ab0d..a8782d7c5 100644 --- a/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx +++ b/apps/mobile/src/components/explorer/sections/InfoTagPills.tsx @@ -1,56 +1,105 @@ -import React from 'react'; -import { Alert, Pressable, View, ViewStyle } from 'react-native'; import { ExplorerItem, getExplorerItemData, getItemFilePath, getItemObject, isPath, - useCache, - useLibraryQuery, - useNodes + useLibraryQuery } from '@sd/client'; +import React, { useRef, useState } from 'react'; +import { FlatList, NativeScrollEvent, Pressable, View, ViewStyle } from 'react-native'; +import Fade from '~/components/layout/Fade'; +import { ModalRef } from '~/components/layout/Modal'; +import AddTagModal from '~/components/modal/AddTagModal'; import { InfoPill, PlaceholderPill } from '~/components/primitive/InfoPill'; import { tw, twStyle } from '~/lib/tailwind'; type Props = { data: ExplorerItem; style?: ViewStyle; + contentContainerStyle?: ViewStyle; + columnCount?: number; }; -const InfoTagPills = ({ data, style }: Props) => { +const InfoTagPills = ({ data, style, contentContainerStyle, columnCount = 3 }: Props) => { + const objectData = getItemObject(data); const filePath = getItemFilePath(data); + const [startedScrolling, setStartedScrolling] = useState(false); + const [reachedBottom, setReachedBottom] = useState(true); // needs to be set to true for initial rendering fade to be correct const tagsQuery = useLibraryQuery(['tags.getForObject', objectData?.id ?? -1], { - enabled: objectData != null + enabled: objectData != null, }); - useNodes(tagsQuery.data?.nodes); - const items = useCache(tagsQuery.data?.items); + const ref = useRef(null); + const tags = tagsQuery.data; const isDir = data && isPath(data) ? data.item.is_dir : false; + // Fade the tag pills when scrolling + const fadeScroll = ({ layoutMeasurement, contentOffset, contentSize }: NativeScrollEvent) => { + const isScrolling = contentOffset.y > 0; + setStartedScrolling(isScrolling); + + const hasReachedBottom = layoutMeasurement.height + contentOffset.y >= contentSize.height; + setReachedBottom(hasReachedBottom); + } + return ( - - {/* Kind */} - + <> + + + ref.current?.present()}> + + + {/* Kind */} + {/* Extension */} {filePath?.extension && ( - + )} - {/* TODO: What happens if I have too many? */} - {items?.map((tag) => ( - - ))} - Alert.alert('TODO')}> - - + + { + if (e.nativeEvent.layout.height >= 80) { + setReachedBottom(false); + } else { + setReachedBottom(true); + } + }} style={twStyle(`relative flex-row flex-wrap gap-1 overflow-hidden`)}> + + fadeScroll(e.nativeEvent)} + style={tw`max-h-20 w-full grow-0`} + data={tags} + scrollEventThrottle={1} + showsVerticalScrollIndicator={false} + numColumns={columnCount} + contentContainerStyle={twStyle(`gap-1`, contentContainerStyle)} + columnWrapperStyle={tags && twStyle(tags.length > 0 && `flex-wrap gap-1`)} + key={tags?.length} + keyExtractor={(item) => item.id.toString() + Math.floor(Math.random() * 10)} + renderItem={({ item }) => ( + + )}/> + + + + ); }; diff --git a/apps/mobile/src/components/header/DynamicHeader.tsx b/apps/mobile/src/components/header/DynamicHeader.tsx new file mode 100644 index 000000000..2c27fdea4 --- /dev/null +++ b/apps/mobile/src/components/header/DynamicHeader.tsx @@ -0,0 +1,134 @@ +import { DrawerNavigationHelpers } from '@react-navigation/drawer/lib/typescript/src/types'; +import { RouteProp, useNavigation } from '@react-navigation/native'; +import { NativeStackHeaderProps } from '@react-navigation/native-stack'; +import { ArrowLeft, DotsThree, MagnifyingGlass } from 'phosphor-react-native'; +import { Platform, Pressable, Text, View } from 'react-native'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import { tw, twStyle } from '~/lib/tailwind'; +import { getExplorerStore, useExplorerStore } from '~/stores/explorerStore'; + +import { FilterItem, TagItem, useSearchStore } from '~/stores/searchStore'; +import { Icon } from '../icons/Icon'; + +type Props = { + headerRoute?: NativeStackHeaderProps; //supporting title from the options object of navigation + optionsRoute?: RouteProp; //supporting params passed + kind: 'tags' | 'locations'; //the kind of icon to display + explorerMenu?: boolean; //whether to show the explorer menu +}; + +export default function DynamicHeader({ + headerRoute, + optionsRoute, + kind, + explorerMenu = true +}: Props) { + const navigation = useNavigation(); + const headerHeight = useSafeAreaInsets().top; + const isAndroid = Platform.OS === 'android'; + const explorerStore = useExplorerStore(); + const searchStore = useSearchStore(); + const params = headerRoute?.route.params as { + id: number; + color: string; + name: string; + } + + //pressing the search icon will add a filter + //based on the screen + + const searchHandler = (key: Props['kind']) => { + if (!params) return; + const keys: { + tags: TagItem; + locations: FilterItem; + } = { + tags: {id: params.id, color: params.color}, + locations: {id: params.id, name: params.name}, + } + searchStore.searchFrom(key, keys[key]) + } + + + return ( + + + + + navigation.goBack()}> + + + + + + {headerRoute?.options.title} + + + + + { + searchHandler(kind) + navigation.navigate('SearchStack', { + screen: 'Search' + }); + }} + > + + + {explorerMenu && ( + { + getExplorerStore().toggleMenu = !explorerStore.toggleMenu; + }} + > + + + )} + + + + + ); +} + +interface HeaderIconKindProps { + routeParams?: any; + kind: Props['kind']; +} + +const HeaderIconKind = ({ routeParams, kind }: HeaderIconKindProps) => { + switch (kind) { + case 'locations': + return ; + case 'tags': + return ( + + ); + default: + return null; + } +}; diff --git a/apps/mobile/src/components/header/Header.tsx b/apps/mobile/src/components/header/Header.tsx index 3fca1ef08..e0dc5d089 100644 --- a/apps/mobile/src/components/header/Header.tsx +++ b/apps/mobile/src/components/header/Header.tsx @@ -1,48 +1,20 @@ import { DrawerNavigationHelpers } from '@react-navigation/drawer/lib/typescript/src/types'; -import { useNavigation } from '@react-navigation/native'; -import { NativeStackHeaderProps } from '@react-navigation/native-stack'; -import { ArrowLeft, DotsThreeOutline, List, MagnifyingGlass } from 'phosphor-react-native'; +import { RouteProp, useNavigation } from '@react-navigation/native'; +import { ArrowLeft, List, MagnifyingGlass } from 'phosphor-react-native'; import { Platform, Pressable, Text, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { tw, twStyle } from '~/lib/tailwind'; -import { getExplorerStore, useExplorerStore } from '~/stores/explorerStore'; -import { Icon } from '../icons/Icon'; -import Search from '../search/Search'; - -type HeaderProps = { - title?: string; //title of the page - showSearch?: boolean; //show the search button - showDrawer?: boolean; //show the drawer button - searchType?: 'explorer' | 'location' | 'categories'; //Temporary - navBack?: boolean; //navigate back to the previous screen - headerKind?: 'default' | 'location' | 'tag'; //kind of header - route?: never; - routeTitle?: never; +type Props = { + route?: RouteProp; // supporting title from the options object of navigation + navBack?: boolean; // whether to show the back icon + search?: boolean; // whether to show the search icon + title?: string; // in some cases - we want to override the route title }; -//you can pass in a routeTitle only if route is passed in -type Props = - | HeaderProps - | ({ - route: NativeStackHeaderProps; - routeTitle?: boolean; - } & Omit); - // Default header with search bar and button to open drawer -export default function Header({ - title, - searchType, - navBack, - route, - routeTitle, - headerKind = 'default', - showDrawer = false, - showSearch = true -}: Props) { +export default function Header({ route, navBack, title, search = false }: Props) { const navigation = useNavigation(); - const explorerStore = useExplorerStore(); - const routeParams = route?.route.params as any; const headerHeight = useSafeAreaInsets().top; const isAndroid = Platform.OS === 'android'; @@ -52,111 +24,38 @@ export default function Header({ paddingTop: headerHeight + (isAndroid ? 15 : 0) })} > - + - {navBack && ( - { - navigation.goBack(); - }} - > - - - )} - - - {showDrawer && ( - navigation.openDrawer()}> - - - )} - - {title || (routeTitle && route?.options.title)} - - - - - {showSearch && ( - - { - navigation.navigate('SearchStack', { - screen: 'Search' - }); - }} - > - - - - )} - {(headerKind === 'location' || headerKind === 'tag') && ( - { - getExplorerStore().toggleMenu = !explorerStore.toggleMenu; - }} - > - + {navBack ? ( + navigation.goBack()}> + + + ) : ( + navigation.openDrawer()}> + )} + {title || route?.name} + {search && ( + { + navigation.navigate('SearchStack', { + screen: 'Search' + }); + }} + > + + + )} - {searchType && } ); } - -interface HeaderSearchTypeProps { - searchType: HeaderProps['searchType']; -} - -const HeaderSearchType = ({ searchType }: HeaderSearchTypeProps) => { - switch (searchType) { - case 'explorer': - return 'Explorer'; //TODO - case 'location': - return ; - case 'categories': - return ; - default: - return null; - } -}; - -interface HeaderIconKindProps { - headerKind: HeaderProps['headerKind']; - routeParams?: any; -} - -const HeaderIconKind = ({ headerKind, routeParams }: HeaderIconKindProps) => { - switch (headerKind) { - case 'location': - return ; - case 'tag': - return ( - - ); - default: - return null; - } -}; diff --git a/apps/mobile/src/components/header/SearchHeader.tsx b/apps/mobile/src/components/header/SearchHeader.tsx new file mode 100644 index 000000000..4a76ea278 --- /dev/null +++ b/apps/mobile/src/components/header/SearchHeader.tsx @@ -0,0 +1,46 @@ +import { DrawerNavigationHelpers } from '@react-navigation/drawer/lib/typescript/src/types'; +import { RouteProp, useNavigation } from '@react-navigation/native'; +import { ArrowLeft } from 'phosphor-react-native'; +import { Platform, Pressable, Text, View } from 'react-native'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import { tw, twStyle } from '~/lib/tailwind'; + +import Search from '../search/Search'; + +const searchPlaceholder = { + locations: 'Search location name...', + tags: 'Search tag name...', + categories: 'Search category name...' +}; + +type Props = { + route?: RouteProp; // supporting title from the options object of navigation + kind: keyof typeof searchPlaceholder; // the kind of search we are doing + title?: string; // in some cases - we want to override the route title +}; + +export default function SearchHeader({ route, kind, title }: Props) { + const navigation = useNavigation(); + const headerHeight = useSafeAreaInsets().top; + const isAndroid = Platform.OS === 'android'; + + return ( + + + + + navigation.goBack()}> + + + {title || route?.name} + + + + + + ); +} diff --git a/apps/mobile/src/components/job/Job.tsx b/apps/mobile/src/components/job/Job.tsx index e8f359266..c94f8e623 100644 --- a/apps/mobile/src/components/job/Job.tsx +++ b/apps/mobile/src/components/job/Job.tsx @@ -10,14 +10,14 @@ import { } from 'phosphor-react-native'; import { memo } from 'react'; import { View, ViewStyle } from 'react-native'; -import { JobProgressEvent, JobReport, useJobInfo } from '@sd/client'; -import { tw } from '~/lib/tailwind'; +import { JobProgressEvent, Report, useJobInfo } from '@sd/client'; +import { tw, twStyle } from '~/lib/tailwind'; import { ProgressBar } from '../animation/ProgressBar'; import JobContainer from './JobContainer'; type JobProps = { - job: JobReport; + job: Report; isChild?: boolean; containerStyle?: ViewStyle; progress: JobProgressEvent | null; @@ -33,7 +33,7 @@ const JobIcon: Record = { object_validator: Fingerprint }; -function Job({ job, isChild, progress }: JobProps) { +function Job({ job, isChild, progress, containerStyle }: JobProps) { const jobData = useJobInfo(job, progress); if (job.status === 'CompletedWithErrors') { @@ -42,7 +42,7 @@ function Job({ job, isChild, progress }: JobProps) { //
 		// 		{job.errors_text.map((error, i) => (
 		// 			

// {error.trim()} @@ -70,6 +70,7 @@ function Job({ job, isChild, progress }: JobProps) { return ( {typeof Icon === 'number' ? ( - + ) : ( Icon && ( {filteredItems.map((item, index) => { const Icon = item?.icon; return ( + {Icon && ( )} - {item?.text} - {index < filteredItems.length - 1 && } + {item?.text} + {index < filteredItems.length - 1 && } + ); })} diff --git a/apps/mobile/src/components/job/JobGroup.tsx b/apps/mobile/src/components/job/JobGroup.tsx index 60c6ae893..c0077add4 100644 --- a/apps/mobile/src/components/job/JobGroup.tsx +++ b/apps/mobile/src/components/job/JobGroup.tsx @@ -1,7 +1,7 @@ import { Folder } from '@sd/assets/icons'; import dayjs from 'dayjs'; -import { DotsThreeVertical, Pause, Play, Stop } from 'phosphor-react-native'; -import { useMemo, useState } from 'react'; +import { DotsThreeVertical, Eye, Pause, Play, Stop, Trash } from 'phosphor-react-native'; +import { SetStateAction, useMemo, useState } from 'react'; import { Animated, Pressable, View } from 'react-native'; import { Swipeable } from 'react-native-gesture-handler'; import { @@ -9,15 +9,17 @@ import { getTotalTasks, JobGroup, JobProgressEvent, - JobReport, + Report, useLibraryMutation, + useRspcLibraryContext, useTotalElapsedTimeText } from '@sd/client'; -import { tw } from '~/lib/tailwind'; +import { tw, twStyle } from '~/lib/tailwind'; import { AnimatedHeight } from '../animation/layout'; import { ProgressBar } from '../animation/ProgressBar'; import { Button } from '../primitive/Button'; +import { Menu, MenuItem } from '../primitive/Menu'; import { toast } from '../primitive/Toast'; import Job from './Job'; import JobContainer from './JobContainer'; @@ -58,11 +60,16 @@ export default function ({ group, progress }: JobGroupProps) { return ( - + ); }; @@ -124,14 +131,22 @@ export default function ({ group, progress }: JobGroupProps) { {showChildJobs && ( - - {jobs.map((job) => ( + + {jobs.map((job, i) => ( + + + 1} - key={job.id} job={job} progress={progress[job.id] ?? null} /> + ))} )} @@ -150,25 +165,29 @@ const toastErrorSuccess = ( ) => { return { onError: () => { - errorMessage && - toast({ - type: 'error', - text: errorMessage - }); + errorMessage && toast.error(errorMessage); }, onSuccess: () => { - successMessage && - toast({ - type: 'success', - text: successMessage - }), - successCallBack?.(); + successMessage && toast.success(successMessage), successCallBack?.(); } }; }; -function Options({ activeJob, group }: { activeJob?: JobReport; group: JobGroup }) { - // const queryClient = useQueryClient(); +interface OptionsProps { + activeJob?: Report; + group: JobGroup; + showChildJobs: boolean; + setShowChildJobs: React.Dispatch>; +} + +function Options({ activeJob, group, setShowChildJobs, showChildJobs }: OptionsProps) { + const rspc = useRspcLibraryContext(); + + const clearJob = useLibraryMutation(['jobs.clear'], { + onSuccess: () => { + rspc.queryClient.invalidateQueries(['jobs.reports']); + } + }); const resumeJob = useLibraryMutation( ['jobs.resume'], @@ -188,35 +207,80 @@ function Options({ activeJob, group }: { activeJob?: JobReport; group: JobGroup [group.jobs] ); - // const clearJob = useLibraryMutation( - // ['jobs.clear'], - // toastErrorSuccess('failed_to_remove_job', undefined, () => { - // queryClient.invalidateQueries(['jobs.reports']); - // }) - // ); + const clearJobHandler = () => { + group.jobs.forEach((job) => { + clearJob.mutate(job.id); + //only one toast for all jobs + if (job.id === group.id) toast.success('Job has been removed'); + }); + }; return ( <> {/* Resume */} {(group.status === 'Queued' || group.status === 'Paused' || isJobPaused) && ( - )} {/* TODO: This should remove the job from panel */} - {!activeJob !== undefined ? ( - - ) : ( + {activeJob !== undefined ? ( - - + ) : ( +

+ + + } + > + setShowChildJobs(!showChildJobs)} + text="Expand" + icon={Eye} + /> + + )} ); diff --git a/apps/mobile/src/components/layout/Empty.tsx b/apps/mobile/src/components/layout/Empty.tsx index 00bdde71d..2c7ce7ab4 100644 --- a/apps/mobile/src/components/layout/Empty.tsx +++ b/apps/mobile/src/components/layout/Empty.tsx @@ -2,27 +2,31 @@ import { Text, View } from 'react-native'; import { ClassInput } from 'twrnc'; import { twStyle } from '~/lib/tailwind'; +import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { Icon, IconName } from '../icons/Icon'; interface Props { description: string; //description of empty state - icon: IconName; //Spacedrive icon + icon?: IconName; //Spacedrive icon style?: ClassInput; //Tailwind classes iconSize?: number; //Size of the icon - textSize?: ClassInput; //Size of the text + textStyle?: ClassInput; //Size of the text + includeHeaderHeight?: boolean; //Height of the header } -const Empty = ({ description, icon, style, textSize = 'text-sm', iconSize = 38 }: Props) => { +const Empty = ({ description, icon, style, includeHeaderHeight = false, textStyle, iconSize = 38 }: Props) => { + const headerHeight = useSafeAreaInsets().top; return ( - - + {icon && } + {description} diff --git a/apps/mobile/src/components/layout/Fade.tsx b/apps/mobile/src/components/layout/Fade.tsx index 6eab661d0..17acb3e76 100644 --- a/apps/mobile/src/components/layout/Fade.tsx +++ b/apps/mobile/src/components/layout/Fade.tsx @@ -1,9 +1,7 @@ -import { useRoute } from '@react-navigation/native'; import { DimensionValue, Platform } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import { ClassInput } from 'twrnc'; import { tw, twStyle } from '~/lib/tailwind'; -import { useExplorerStore } from '~/stores/explorerStore'; interface Props { children: React.ReactNode; // children of fade @@ -13,7 +11,6 @@ interface Props { orientation?: 'horizontal' | 'vertical'; // orientation of fade fadeSides?: 'left-right' | 'top-bottom'; // which sides to fade screenFade?: boolean; // if true, the fade will consider the bottom tab bar height - noConditions?: boolean; // if true, the fade will be rendered as is bottomFadeStyle?: ClassInput; // tailwind style for bottom fade topFadeStyle?: ClassInput; // tailwind style for top fade } @@ -25,20 +22,15 @@ const Fade = ({ height, bottomFadeStyle, topFadeStyle, - noConditions = false, screenFade = false, fadeSides = 'left-right', orientation = 'horizontal' }: Props) => { - const route = useRoute(); - const { toggleMenu } = useExplorerStore(); const bottomTabBarHeight = Platform.OS === 'ios' ? 80 : 60; const gradientStartEndMap = { 'left-right': { start: { x: 0, y: 0 }, end: { x: 1, y: 0 } }, 'top-bottom': { start: { x: 0, y: 1 }, end: { x: 0, y: 0 } } }; - const menuHeight = 57; // height of the explorer menu - const routesWithMenu = ['Location', 'Search', 'Tag']; // routes that are associated with the explorer return ( <> - { + if (!scrollToBottomOnChange) return; + ref.current?.scrollToEnd({ animated: true }); + }} + contentContainerStyle={twStyle('justify-between gap-10 py-6', style)} + style={twStyle( + 'bg-black', + tabHeight && { marginBottom: bottomTabBarHeight } + )} > - { - if (!scrollToBottomOnChange) return; - ref.current?.scrollToEnd({ animated: true }); - }} - contentContainerStyle={twStyle('justify-between gap-10 py-6', style)} - style={twStyle( - 'flex-1 bg-black', - tabHeight && { marginBottom: bottomTabBarHeight } - )} - > - {children} - - + {children} + ) : ( - - - {children} - - + {children} + ); }; diff --git a/apps/mobile/src/components/locations/GridLocation.tsx b/apps/mobile/src/components/locations/GridLocation.tsx index 19538ea58..bfc5239ef 100644 --- a/apps/mobile/src/components/locations/GridLocation.tsx +++ b/apps/mobile/src/components/locations/GridLocation.tsx @@ -1,6 +1,6 @@ +import { Location, arraysEqual, humanizeSize, useOnlineLocations } from '@sd/client'; import { DotsThreeOutlineVertical } from 'phosphor-react-native'; import { Pressable, Text, View } from 'react-native'; -import { arraysEqual, byteSize, Location, useOnlineLocations } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; import FolderIcon from '../icons/FolderIcon'; @@ -16,11 +16,11 @@ const GridLocation: React.FC = ({ location, modalRef }: GridL const onlineLocations = useOnlineLocations(); const online = onlineLocations.some((l) => arraysEqual(location.pub_id, l)); return ( - + - + = ({ location, modalRef }: GridL )} /> - modalRef.current?.present()}> + modalRef.current?.present()}> = ({ location, modalRef }: GridL {location.path} - - {`${byteSize(location.size_in_bytes)}`} + + + {`${humanizeSize(location.size_in_bytes)}`} + ); }; diff --git a/apps/mobile/src/components/locations/ListLocation.tsx b/apps/mobile/src/components/locations/ListLocation.tsx index 7565c453f..66b242a18 100644 --- a/apps/mobile/src/components/locations/ListLocation.tsx +++ b/apps/mobile/src/components/locations/ListLocation.tsx @@ -1,9 +1,9 @@ import { useNavigation } from '@react-navigation/native'; -import { DotsThreeOutlineVertical } from 'phosphor-react-native'; +import { Location, arraysEqual, humanizeSize, useOnlineLocations } from '@sd/client'; +import { DotsThreeVertical } from 'phosphor-react-native'; import { useRef } from 'react'; import { Pressable, Text, View } from 'react-native'; import { Swipeable } from 'react-native-gesture-handler'; -import { arraysEqual, byteSize, Location, useOnlineLocations } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; import { SettingsStackScreenProps } from '~/navigation/tabs/SettingsStack'; @@ -25,7 +25,7 @@ const ListLocation = ({ location }: ListLocationProps) => { return ( ( <> @@ -61,23 +61,17 @@ const ListLocation = ({ location }: ListLocationProps) => { - - + + - {`${byteSize(location.size_in_bytes)}`} + {`${humanizeSize(location.size_in_bytes)}`} swipeRef.current?.openRight()}> - + diff --git a/apps/mobile/src/components/locations/LocationItem.tsx b/apps/mobile/src/components/locations/LocationItem.tsx index fae5729db..a9f476724 100644 --- a/apps/mobile/src/components/locations/LocationItem.tsx +++ b/apps/mobile/src/components/locations/LocationItem.tsx @@ -1,8 +1,9 @@ +import { Location } from '@sd/client'; import { useRef } from 'react'; import { Pressable } from 'react-native'; -import { Location } from '@sd/client'; import { twStyle } from '~/lib/tailwind'; +import { ClassInput } from 'twrnc'; import { ModalRef } from '../layout/Modal'; import { LocationModal } from '../modal/location/LocationModal'; import GridLocation from './GridLocation'; @@ -13,19 +14,21 @@ type LocationItemProps = { onPress: () => void; viewStyle?: 'grid' | 'list'; editLocation: () => void; + style?: ClassInput; }; export const LocationItem = ({ location, onPress, editLocation, - viewStyle = 'grid' + viewStyle = 'grid', + style }: LocationItemProps) => { const modalRef = useRef(null); return ( <> {viewStyle === 'grid' ? ( diff --git a/apps/mobile/src/components/menu/SortByMenu.tsx b/apps/mobile/src/components/menu/SortByMenu.tsx deleted file mode 100644 index 5f6d135ad..000000000 --- a/apps/mobile/src/components/menu/SortByMenu.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { ArrowDown, ArrowUp } from 'phosphor-react-native'; -import { useState } from 'react'; -import { Text, View } from 'react-native'; -import { Menu, MenuItem } from '~/components/primitive/Menu'; -import { tw } from '~/lib/tailwind'; - -const sortOptions = { - name: 'Name', - kind: 'Kind', - favorite: 'Favorite', - date_created: 'Date Created', - date_modified: 'Date Modified', - date_last_opened: 'Date Last Opened' -}; - -type SortByType = keyof typeof sortOptions; - -const ArrowUpIcon = () => ; -const ArrowDownIcon = () => ; - -const SortByMenu = () => { - const [sortBy, setSortBy] = useState('name'); - const [sortDirection, setSortDirection] = useState('asc' as 'asc' | 'desc'); - - return ( - - {sortOptions[sortBy]} - {sortDirection === 'asc' ? : } - - } - > - {Object.entries(sortOptions).map(([value, text]) => ( - { - if (value === sortBy) { - setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc'); - return; - } - // Reset sort direction to descending - sortDirection === 'asc' && setSortDirection('desc'); - setSortBy(value as SortByType); - }} - /> - ))} - - ); -}; - -export default SortByMenu; diff --git a/apps/mobile/src/components/modal/AddTagModal.tsx b/apps/mobile/src/components/modal/AddTagModal.tsx new file mode 100644 index 000000000..e45d16502 --- /dev/null +++ b/apps/mobile/src/components/modal/AddTagModal.tsx @@ -0,0 +1,208 @@ +import { Tag, getItemObject, useLibraryMutation, useLibraryQuery, useRspcLibraryContext } from "@sd/client"; +import { CaretLeft, Plus } from "phosphor-react-native"; +import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { FlatList, NativeScrollEvent, Pressable, Text, View } from "react-native"; +import useForwardedRef from "~/hooks/useForwardedRef"; +import { tw, twStyle } from "~/lib/tailwind"; +import { useActionsModalStore } from "~/stores/modalStore"; +import Card from "../layout/Card"; +import Fade from "../layout/Fade"; +import { Modal, ModalRef } from "../layout/Modal"; +import { Button } from "../primitive/Button"; +import CreateTagModal from "./tag/CreateTagModal"; + + +const AddTagModal = forwardRef((_, ref) => { + + const {data} = useActionsModalStore(); + + // Wrapped in memo to ensure that the data is not undefined on initial render + const objectData = data && getItemObject(data); + + const modalRef = useForwardedRef(ref); + const newTagRef = useRef(null); + const [startedScrolling, setStartedScrolling] = useState(false); + const [reachedBottom, setReachedBottom] = useState(true); // needs to be set to true for initial rendering fade to be correct + + const rspc = useRspcLibraryContext(); + const tagsQuery = useLibraryQuery(['tags.list']); + const tagsObjectQuery = useLibraryQuery(['tags.getForObject', objectData?.id ?? -1]); + const mutation = useLibraryMutation(['tags.assign'], { + onSuccess: () => { + // this makes sure that the tags are updated in the UI + rspc.queryClient.invalidateQueries(['tags.getForObject']) + rspc.queryClient.invalidateQueries(['search.paths']) + modalRef.current?.dismiss(); + } + }); + + const tagsData = tagsQuery.data; + const tagsObject = tagsObjectQuery.data; + + const [selectedTags, setSelectedTags] = useState<{ + id: number; + unassign: boolean; + selected: boolean; + }[]>([]); + + // get the tags that are already applied to the object + const appliedTags = useMemo(() => { + if (!tagsObject) return []; + return tagsObject?.map((t) => t.id); + }, [tagsObject]); + + + // set selected tags when tagsOfObject.data is available + useEffect(() => { + if (!tagsObject) return; + //we want to set the selectedTags if there are applied tags + //this deals with an edge case of clearing the tags onDismiss of the Modal + if (selectedTags.length === 0 && appliedTags.length > 0) { + setSelectedTags((tagsObject ?? []).map((tag) => ({ + id: tag.id, + unassign: false, + selected: true + })))} + }, [tagsObject, appliedTags, selectedTags]) + + // check if tag is selected + const isSelected = useCallback((id: number) => { + const findTag = selectedTags.find((t) => t.id === id); + return findTag?.selected ?? false; + }, [selectedTags]); + + const selectTag = useCallback((id: number) => { + //check if tag is already selected + const findTag = selectedTags.find((t) => t.id === id); + if (findTag) { + //if tag is already selected, update its selected value + setSelectedTags((prev) => prev.map((t) => t.id === id ? { ...t, selected: !t.selected, unassign: !t.unassign } : t)); + } else { + //if tag is not selected, select it + setSelectedTags((prev) => [...prev, { id, unassign: false, selected: true }]); + } + }, [selectedTags]); + + const assignHandler = async () => { + const targets = data && 'id' in data.item && (data.type === 'Object' ? { + Object: data.item.id + } : { + FilePath: data.item.id + }); + + // in order to support assigning multiple tags + // we need to make multiple mutation calls + if (targets) await Promise.all([...selectedTags.map(async (tag) => await mutation.mutateAsync({ + targets: [targets], + tag_id: tag.id, + unassign: tag.unassign + })), + ] + ); + } + + // Fade the tags when scrolling + const fadeScroll = ({ layoutMeasurement, contentOffset, contentSize }: NativeScrollEvent) => { + const isScrolling = contentOffset.y > 0; + setStartedScrolling(isScrolling); + + const hasReachedBottom = layoutMeasurement.height + contentOffset.y >= contentSize.height; + setReachedBottom(hasReachedBottom); + } + + return ( + <> + setSelectedTags([])} + enableContentPanningGesture={false} + enablePanDownToClose={false} + snapPoints={['50']} + title="Select Tags" + > + {/* Back Button */} + modalRef.current?.close()} + style={tw`absolute z-10 ml-6 rounded-full bg-app-button p-2`} + > + + + { + if (e.nativeEvent.layout.height >= 80) { + setReachedBottom(false); + } else { + setReachedBottom(true); + } + }} style={twStyle(`relative mt-4 h-[70%]`)}> + + fadeScroll(e.nativeEvent)} + extraData={selectedTags} + key={tagsData ? 'tags' : '_'} + keyExtractor={(item) => item.id.toString()} + contentContainerStyle={tw`mx-auto p-4 pb-6`} + ItemSeparatorComponent={() => } + renderItem={({ item }) => ( + isSelected(item.id)} select={() => selectTag(item.id)} tag={item} /> + )} + /> + + + + + + + + + + ) +}); + +interface Props { + tag: Tag; + select: () => void; + isSelected: () => boolean; +} + +const TagItem = ({tag, select, isSelected}: Props) => { + return ( + + + + {tag?.name} + + + ) +} + +export default AddTagModal; diff --git a/apps/mobile/src/components/modal/CreateLibraryModal.tsx b/apps/mobile/src/components/modal/CreateLibraryModal.tsx index 73a21b93b..346988473 100644 --- a/apps/mobile/src/components/modal/CreateLibraryModal.tsx +++ b/apps/mobile/src/components/modal/CreateLibraryModal.tsx @@ -1,12 +1,7 @@ import { useQueryClient } from '@tanstack/react-query'; import { forwardRef, useState } from 'react'; import { Text, View } from 'react-native'; -import { - insertLibrary, - useBridgeMutation, - useNormalisedCache, - usePlausibleEvent -} from '@sd/client'; +import { insertLibrary, useBridgeMutation, usePlausibleEvent } from '@sd/client'; import { Modal, ModalRef } from '~/components/layout/Modal'; import { Button } from '~/components/primitive/Button'; import { ModalInput } from '~/components/primitive/Input'; @@ -18,7 +13,6 @@ const CreateLibraryModal = forwardRef((_, ref) => { const modalRef = useForwardedRef(ref); const queryClient = useQueryClient(); - const cache = useNormalisedCache(); const [libName, setLibName] = useState(''); const submitPlausibleEvent = usePlausibleEvent(); @@ -26,10 +20,7 @@ const CreateLibraryModal = forwardRef((_, ref) => { const { mutate: createLibrary, isLoading: createLibLoading } = useBridgeMutation( 'library.create', { - onSuccess: (libRaw) => { - cache.withNodes(libRaw.nodes); - const lib = cache.withCache(libRaw.item); - + onSuccess: (lib) => { // Reset form setLibName(''); diff --git a/apps/mobile/src/components/modal/ImportLibraryModal.tsx b/apps/mobile/src/components/modal/ImportLibraryModal.tsx new file mode 100644 index 000000000..29e12367d --- /dev/null +++ b/apps/mobile/src/components/modal/ImportLibraryModal.tsx @@ -0,0 +1,140 @@ +import { BottomSheetFlatList } from '@gorhom/bottom-sheet'; +import { NavigationProp, useNavigation } from '@react-navigation/native'; +import { + CloudLibrary, + useBridgeMutation, + useBridgeQuery, + useClientContext, + useRspcContext +} from '@sd/client'; +import { forwardRef } from 'react'; +import { ActivityIndicator, Text, View } from 'react-native'; +import { Modal, ModalRef } from '~/components/layout/Modal'; +import { Button } from '~/components/primitive/Button'; +import useForwardedRef from '~/hooks/useForwardedRef'; +import { tw } from '~/lib/tailwind'; +import { RootStackParamList } from '~/navigation'; +import { currentLibraryStore } from '~/utils/nav'; + +import Empty from '../layout/Empty'; +import Fade from '../layout/Fade'; + +const ImportModalLibrary = forwardRef((_, ref) => { + const navigation = useNavigation>(); + const modalRef = useForwardedRef(ref); + + const { libraries } = useClientContext(); + + const cloudLibraries = useBridgeQuery(['cloud.library.list']); + const cloudLibrariesData = cloudLibraries.data?.filter( + (cloudLibrary) => !libraries.data?.find((l) => l.uuid === cloudLibrary.uuid) + ); + + return ( + cloudLibraries.refetch()} + > + + {cloudLibraries.isLoading ? ( + + + + ) : ( + + } + ListEmptyComponent={ + + } + keyExtractor={(item) => item.uuid} + showsVerticalScrollIndicator={false} + renderItem={({ item }) => ( + + )} + /> + + )} + + + ); +}); + +interface Props { + data: CloudLibrary; + modalRef: React.RefObject; + navigation: NavigationProp; +} + +const CloudLibraryCard = ({ data, modalRef, navigation }: Props) => { + const rspc = useRspcContext().queryClient; + const joinLibrary = useBridgeMutation(['cloud.library.join']); + return ( + + + {data.name} + + + + ); +}; + +export default ImportModalLibrary; diff --git a/apps/mobile/src/components/modal/ImportModal.tsx b/apps/mobile/src/components/modal/ImportModal.tsx index 70e98a93f..4f14da020 100644 --- a/apps/mobile/src/components/modal/ImportModal.tsx +++ b/apps/mobile/src/components/modal/ImportModal.tsx @@ -1,14 +1,15 @@ import * as RNFS from '@dr.pogodin/react-native-fs'; +import { useLibraryMutation, useRspcLibraryContext } from '@sd/client'; import { forwardRef, useCallback } from 'react'; import { Alert, Platform, Text, View } from 'react-native'; import DocumentPicker from 'react-native-document-picker'; -import { useLibraryMutation, useRspcLibraryContext } from '@sd/client'; import { Modal, ModalRef } from '~/components/layout/Modal'; import { Button } from '~/components/primitive/Button'; import useForwardedRef from '~/hooks/useForwardedRef'; import { tw } from '~/lib/tailwind'; import { Icon } from '../icons/Icon'; +import { toast } from '../primitive/Toast'; // import * as ML from 'expo-media-library'; @@ -22,17 +23,29 @@ const ImportModal = forwardRef((_, ref) => { const createLocation = useLibraryMutation('locations.create', { onError: (error, variables) => { + modalRef.current?.close(); + //custom message handling + if (error.message.startsWith("location already exists")) { + return toast.error('This location has already been added'); + } else if (error.message.startsWith("nested location currently")) { + return toast.error('Nested locations are currently not supported'); + } switch (error.message) { case 'NEED_RELINK': if (!variables.dry_run) relinkLocation.mutate(variables.path); + toast.info('Please relink the location'); break; case 'ADD_LIBRARY': addLocationToLibrary.mutate(variables); break; default: + toast.error(error.message); throw new Error('Unimplemented custom remote error handling'); } }, + onSuccess: () => { + toast.success('Location added successfully'); + }, onSettled: () => { rspc.queryClient.invalidateQueries(['locations.list']); modalRef.current?.close(); diff --git a/apps/mobile/src/components/modal/confirmModals/DeleteLocationModal.tsx b/apps/mobile/src/components/modal/confirmModals/DeleteLocationModal.tsx index 9dc6a59fd..8d221305e 100644 --- a/apps/mobile/src/components/modal/confirmModals/DeleteLocationModal.tsx +++ b/apps/mobile/src/components/modal/confirmModals/DeleteLocationModal.tsx @@ -1,6 +1,7 @@ -import { useRef } from 'react'; import { useLibraryMutation, usePlausibleEvent, useRspcLibraryContext } from '@sd/client'; +import { useRef } from 'react'; import { ConfirmModal, ModalRef } from '~/components/layout/Modal'; +import { toast } from '~/components/primitive/Toast'; type Props = { locationId: number; @@ -20,6 +21,10 @@ const DeleteLocationModal = ({ trigger, onSubmit, locationId, triggerStyle }: Pr onSuccess: () => { submitPlausibleEvent({ event: { type: 'locationDelete' } }); onSubmit?.(); + toast.success('Location deleted successfully'); + }, + onError: (error) => { + toast.error(error.message); }, onSettled: () => { modalRef.current?.close(); diff --git a/apps/mobile/src/components/modal/confirmModals/DeleteTagModal.tsx b/apps/mobile/src/components/modal/confirmModals/DeleteTagModal.tsx index 54eb5e8cf..8d68272cc 100644 --- a/apps/mobile/src/components/modal/confirmModals/DeleteTagModal.tsx +++ b/apps/mobile/src/components/modal/confirmModals/DeleteTagModal.tsx @@ -1,6 +1,7 @@ -import { useRef } from 'react'; import { useLibraryMutation, usePlausibleEvent, useRspcLibraryContext } from '@sd/client'; +import { useRef } from 'react'; import { ConfirmModal, ModalRef } from '~/components/layout/Modal'; +import { toast } from '~/components/primitive/Toast'; type Props = { tagId: number; @@ -19,6 +20,7 @@ const DeleteTagModal = ({ trigger, onSubmit, tagId, triggerStyle }: Props) => { submitPlausibleEvent({ event: { type: 'tagDelete' } }); onSubmit?.(); rspc.queryClient.invalidateQueries(['tags.list']); + toast.success('Tag deleted successfully'); }, onSettled: () => { modalRef.current?.close(); diff --git a/apps/mobile/src/components/modal/inspector/ActionsModal.tsx b/apps/mobile/src/components/modal/inspector/ActionsModal.tsx index d9e106bc8..3872dad9a 100644 --- a/apps/mobile/src/components/modal/inspector/ActionsModal.tsx +++ b/apps/mobile/src/components/modal/inspector/ActionsModal.tsx @@ -1,3 +1,11 @@ +import { + getIndexedItemFilePath, + getItemObject, + humanizeSize, + useLibraryMutation, + useLibraryQuery, + useRspcContext +} from '@sd/client'; import dayjs from 'dayjs'; import { Copy, @@ -13,13 +21,6 @@ import { import { PropsWithChildren, useRef } from 'react'; import { Pressable, Text, View, ViewStyle } from 'react-native'; import FileViewer from 'react-native-file-viewer'; -import { - byteSize, - getIndexedItemFilePath, - getItemObject, - useLibraryMutation, - useLibraryQuery -} from '@sd/client'; import FileThumb from '~/components/explorer/FileThumb'; import FavoriteButton from '~/components/explorer/sections/FavoriteButton'; import InfoTagPills from '~/components/explorer/sections/InfoTagPills'; @@ -27,14 +28,16 @@ import { Modal, ModalRef } from '~/components/layout/Modal'; import { tw, twStyle } from '~/lib/tailwind'; import { useActionsModalStore } from '~/stores/modalStore'; +import { toast } from '~/components/primitive/Toast'; import FileInfoModal from './FileInfoModal'; +import RenameModal from './RenameModal'; type ActionsContainerProps = PropsWithChildren<{ style?: ViewStyle; }>; const ActionsContainer = ({ children, style }: ActionsContainerProps) => ( - {children} + {children} ); type ActionsItemProps = { @@ -61,23 +64,35 @@ const ActionsItem = ({ icon, onPress, title, isDanger = false }: ActionsItemProp ); }; -const ActionDivider = () => ; +const ActionDivider = () => ; export const ActionsModal = () => { const fileInfoRef = useRef(null); + const renameRef = useRef(null); const { modalRef, data } = useActionsModalStore(); + const rspc = useRspcContext(); const objectData = data && getItemObject(data); const filePath = data && getIndexedItemFilePath(data); // Open - - const updateAccessTime = useLibraryMutation('files.updateAccessTime'); + const updateAccessTime = useLibraryMutation('files.updateAccessTime', { + onSuccess: () => { + rspc.queryClient.invalidateQueries(['search.paths']); + } + }); const queriedFullPath = useLibraryQuery(['files.getPath', filePath?.id ?? -1], { enabled: filePath != null }); + const deleteFile = useLibraryMutation('files.deleteFiles', { + onSuccess: () => { + rspc.queryClient.invalidateQueries(['search.paths']) + modalRef.current?.dismiss(); + } + }); + async function handleOpen() { const absolutePath = queriedFullPath.data; if (!absolutePath) return; @@ -89,9 +104,9 @@ export const ActionsModal = () => { }); filePath && filePath.object_id && - updateAccessTime.mutateAsync([filePath.object_id]).catch(console.error); + await updateAccessTime.mutateAsync([filePath.object_id]).catch(console.error); } catch (error) { - // TODO: Handle Error & toast message + toast.error("Error opening object") } } @@ -100,7 +115,7 @@ export const ActionsModal = () => { {data && ( - + {/* Thumbnail/Icon */} { {/* Name + Extension */} {filePath?.name} @@ -119,7 +134,7 @@ export const ActionsModal = () => { - {`${byteSize(filePath?.size_in_bytes_bytes)}`}, + {`${humanizeSize(filePath?.size_in_bytes_bytes)}`}, {' '} @@ -128,9 +143,9 @@ export const ActionsModal = () => { - {objectData && } + {objectData && } - + {/* Actions */} @@ -142,7 +157,9 @@ export const ActionsModal = () => { /> - + { + renameRef.current?.present(); + }} icon={Pencil} title="Rename" /> @@ -155,11 +172,19 @@ export const ActionsModal = () => { - + { + if (filePath && filePath.location_id) { + await deleteFile.mutateAsync({ + location_id: filePath.location_id, + file_path_ids: [filePath.id] + }); + } + }} /> )} + ); diff --git a/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx b/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx index 9df463d73..89a9457fd 100644 --- a/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx +++ b/apps/mobile/src/components/modal/inspector/FileInfoModal.tsx @@ -1,11 +1,12 @@ +import { getItemFilePath, getItemObject, humanizeSize, type ExplorerItem } from '@sd/client'; import dayjs from 'dayjs'; -import { Barcode, CaretLeft, Clock, Cube, Icon, SealCheck, Snowflake } from 'phosphor-react-native'; +import { Barcode, CaretLeft, Clock, Cube, FolderOpen, Icon, SealCheck, Snowflake } from 'phosphor-react-native'; import { forwardRef } from 'react'; import { Pressable, Text, View } from 'react-native'; -import { byteSize, getItemFilePath, getItemObject, type ExplorerItem } from '@sd/client'; import FileThumb from '~/components/explorer/FileThumb'; import InfoTagPills from '~/components/explorer/sections/InfoTagPills'; import { Modal, ModalScrollView, type ModalRef } from '~/components/layout/Modal'; +import VirtualizedListWrapper from '~/components/layout/VirtualizedListWrapper'; import { Divider } from '~/components/primitive/Divider'; import useForwardedRef from '~/hooks/useForwardedRef'; import { tw } from '~/lib/tailwind'; @@ -39,18 +40,9 @@ type FileInfoModalProps = { const FileInfoModal = forwardRef((props, ref) => { const { data } = props; - const modalRef = useForwardedRef(ref); - - const item = data?.item; - - const objectData = data && getItemObject(data); const filePathData = data && getItemFilePath(data); - - // const fullObjectData = useLibraryQuery(['files.get', objectData?.id || -1], { - // enabled: objectData?.id !== undefined - // }); - + const objectData = data && getItemObject(data); return ( ((props, ref) => { enablePanDownToClose={false} snapPoints={['70']} > + {data && ( - + {/* Back Button */} modalRef.current?.close()} - style={tw`absolute z-10 ml-4`} + style={tw`absolute left-2 z-10 rounded-full bg-app-button p-2`} > - + - {/* File Icon / Name */} + {/* File Icon / Name */} - + {filePathData?.name} - + {/* Details */} - + <> {/* Size */} - {/* Duration */} - {/* {fullObjectData.data?.media_data?.duration && ( - - )} */} {/* Created */} {data.type !== 'SpacedropPeer' && ( ((props, ref) => { /> )} + {/* Accessed */} + + + {/* Modified */} + {filePathData && 'cas_id' in filePathData && ( <> {/* Indexed */} @@ -130,6 +124,7 @@ const FileInfoModal = forwardRef((props, ref) => { )} + ); }); diff --git a/apps/mobile/src/components/modal/inspector/RenameModal.tsx b/apps/mobile/src/components/modal/inspector/RenameModal.tsx new file mode 100644 index 000000000..03a4f7741 --- /dev/null +++ b/apps/mobile/src/components/modal/inspector/RenameModal.tsx @@ -0,0 +1,91 @@ +import { getIndexedItemFilePath, useLibraryMutation, useRspcLibraryContext } from '@sd/client'; +import React, { forwardRef, useEffect, useRef, useState } from 'react'; +import { Text, View } from 'react-native'; +import { TextInput } from 'react-native-gesture-handler'; +import { Modal, ModalRef } from '~/components/layout/Modal'; +import { Button } from '~/components/primitive/Button'; +import { ModalInput } from '~/components/primitive/Input'; +import { toast } from '~/components/primitive/Toast'; +import useForwardedRef from '~/hooks/useForwardedRef'; +import { tw } from '~/lib/tailwind'; +import { useActionsModalStore } from '~/stores/modalStore'; + + +const RenameModal = forwardRef((_, ref) => { + const modalRef = useForwardedRef(ref); + const [newName, setNewName] = useState(''); + const rspc = useRspcLibraryContext(); + const { data } = useActionsModalStore(); + const inputRef = useRef(null); + + const filePathData = data && getIndexedItemFilePath(data); + const fileName = filePathData?.name ?? ''; + const fileExtension = filePathData?.extension ?? ''; + const combined = `${fileName}${fileExtension ? `.${fileExtension}` : ''}`; + + const renameFile = useLibraryMutation(['files.renameFile'], { + onSuccess: () => { + modalRef.current?.dismiss(); + rspc.queryClient.invalidateQueries(['search.paths']); + }, + onError: () => { + toast.error('Failed to rename object'); + } + }); + + // set input value to object name on initial render + useEffect(() => { + if (!fileName) return; + setNewName(combined); + }, [fileName, combined]); + + const textRenameHandler = async () => { + switch (data?.type) { + case 'Path': + case 'Object': { + if (!filePathData) throw new Error('Failed to get file path object'); + + const { id, location_id } = filePathData; + + if (!location_id) throw new Error('Missing location id'); + + await renameFile.mutateAsync({ + location_id: location_id, + kind: { + One: { + from_file_path_id: id, + to: newName + } + } + }); + break; + } + } + }; + + return ( + setNewName(combined)} + enableContentPanningGesture={false} + enablePanDownToClose={false} + snapPoints={['20']} + > + + inputRef.current?.setSelection(0, fileName.length)} + value={newName} + onChangeText={(t) => setNewName(t)} + /> + + + + ); +}); + +export default RenameModal; diff --git a/apps/mobile/src/components/modal/job/JobManagerModal.tsx b/apps/mobile/src/components/modal/job/JobManagerModal.tsx index 7d996b313..2c759e2a1 100644 --- a/apps/mobile/src/components/modal/job/JobManagerModal.tsx +++ b/apps/mobile/src/components/modal/job/JobManagerModal.tsx @@ -1,40 +1,51 @@ -import { forwardRef } from 'react'; -import { FlatList, Text, View } from 'react-native'; +import { BottomSheetFlatList } from '@gorhom/bottom-sheet'; import { useJobProgress, useLibraryQuery } from '@sd/client'; +import { forwardRef, useEffect } from 'react'; import JobGroup from '~/components/job/JobGroup'; +import Empty from '~/components/layout/Empty'; import { Modal, ModalRef } from '~/components/layout/Modal'; +import useForwardedRef from '~/hooks/useForwardedRef'; import { tw } from '~/lib/tailwind'; -// TODO: -// - When there is no job, make modal height smaller -// - Add clear all jobs button +//TODO: Handle data fetching better when modal is opened export const JobManagerModal = forwardRef((_, ref) => { - // const queryClient = useQueryClient(); - + // const rspc = useRspcLibraryContext(); const jobGroups = useLibraryQuery(['jobs.reports']); const progress = useJobProgress(jobGroups.data); + const modalRef = useForwardedRef(ref); + + //TODO: Add clear all jobs button // const clearAllJobs = useLibraryMutation(['jobs.clearAll'], { // onError: () => { - // // TODO: Show error toast + // toast.error('Failed to clear all jobs.'); // }, // onSuccess: () => { // queryClient.invalidateQueries(['jobs.reports ']); // } // }); + useEffect(() => { + if (jobGroups.data?.length === 0) { + modalRef.current?.snapToPosition('20'); + } + }, [jobGroups, modalRef]); + return ( - - + i.id} contentContainerStyle={tw`mt-4`} renderItem={({ item }) => } ListEmptyComponent={ - - No jobs. - + } /> diff --git a/apps/mobile/src/components/modal/search/SaveSearchModal.tsx b/apps/mobile/src/components/modal/search/SaveSearchModal.tsx new file mode 100644 index 000000000..a3f622fc7 --- /dev/null +++ b/apps/mobile/src/components/modal/search/SaveSearchModal.tsx @@ -0,0 +1,56 @@ +import { useNavigation } from '@react-navigation/native'; +import { useLibraryMutation } from '@sd/client'; +import { forwardRef, useState } from 'react'; +import { Text, View } from 'react-native'; +import { Modal, ModalRef } from '~/components/layout/Modal'; +import { Button } from '~/components/primitive/Button'; +import { ModalInput } from '~/components/primitive/Input'; +import { tw } from '~/lib/tailwind'; +import { useSearchStore } from '~/stores/searchStore'; + +const SaveSearchModal = forwardRef((_, ref) => { + const [searchName, setSearchName] = useState(''); + const navigation = useNavigation(); + const searchStore = useSearchStore(); + const saveSearch = useLibraryMutation('search.saved.create', { + onSuccess: () => { + searchStore.applyFilters(); + navigation.navigate('SearchStack', { + screen: 'Search' + }); + } + }); + return ( + + + setSearchName(text)} + placeholder="Search Name..." + /> + + + + ); +}); + +export default SaveSearchModal; diff --git a/apps/mobile/src/components/modal/tag/CreateTagModal.tsx b/apps/mobile/src/components/modal/tag/CreateTagModal.tsx index d92fc40cf..ff4f9fdd0 100644 --- a/apps/mobile/src/components/modal/tag/CreateTagModal.tsx +++ b/apps/mobile/src/components/modal/tag/CreateTagModal.tsx @@ -1,16 +1,17 @@ -import { forwardRef, useEffect, useState } from 'react'; -import { Pressable, Text, View } from 'react-native'; -import ColorPicker from 'react-native-wheel-color-picker'; import { ToastDefautlColor, useLibraryMutation, usePlausibleEvent, useRspcLibraryContext } from '@sd/client'; +import { forwardRef, useEffect, useState } from 'react'; +import { Pressable, Text, View } from 'react-native'; +import ColorPicker from 'react-native-wheel-color-picker'; import { FadeInAnimation } from '~/components/animation/layout'; import { Modal, ModalRef } from '~/components/layout/Modal'; import { Button } from '~/components/primitive/Button'; import { ModalInput } from '~/components/primitive/Input'; +import { toast } from '~/components/primitive/Toast'; import useForwardedRef from '~/hooks/useForwardedRef'; import { useKeyboard } from '~/hooks/useKeyboard'; import { tw, twStyle } from '~/lib/tailwind'; @@ -36,8 +37,12 @@ const CreateTagModal = forwardRef((_, ref) => { rspc.queryClient.invalidateQueries(['tags.list']); + toast.success('Tag created successfully'); submitPlausibleEvent({ event: { type: 'tagCreate' } }); }, + onError: (error) => { + toast.error(error.message); + }, onSettled: () => { // Close modal modalRef.current?.dismiss(); @@ -57,7 +62,7 @@ const CreateTagModal = forwardRef((_, ref) => { return ( { // Resets form onDismiss @@ -94,7 +99,7 @@ const CreateTagModal = forwardRef((_, ref) => { {kinds.data?.statistics - ?.sort((a, b) => b.count - a.count) + ?.sort((a, b) => { + const aCount = uint32ArrayToBigInt(a.count); + const bCount = uint32ArrayToBigInt(b.count); + if (aCount === bCount) return 0; + return aCount > bCount ? -1 : 1; + }) .filter((i) => i.kind !== 0) .slice(0, 6) .map((item) => { @@ -49,7 +54,7 @@ export default function CategoriesScreen() { kind={kind} name={name} icon={icon} - items={count} + items={uint32ArrayToBigInt(count)} /> ); })} diff --git a/apps/mobile/src/components/overview/CategoryItem.tsx b/apps/mobile/src/components/overview/CategoryItem.tsx index a7412eab2..8c4409fe6 100644 --- a/apps/mobile/src/components/overview/CategoryItem.tsx +++ b/apps/mobile/src/components/overview/CategoryItem.tsx @@ -1,14 +1,16 @@ +import { useNavigation } from '@react-navigation/native'; import { Pressable, Text, View } from 'react-native'; import { ClassInput } from 'twrnc'; import { formatNumber } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; +import { useSearchStore } from '~/stores/searchStore'; import { Icon, IconName } from '../icons/Icon'; interface CategoryItemProps { kind: number; name: string; - items: number; + items: bigint | number; icon: IconName; selected?: boolean; onClick?: () => void; @@ -16,7 +18,9 @@ interface CategoryItemProps { style?: ClassInput; } -const CategoryItem = ({ name, icon, items, style }: CategoryItemProps) => { +const CategoryItem = ({ name, icon, items, style, kind }: CategoryItemProps) => { + const navigation = useNavigation(); + const searchStore = useSearchStore(); return ( { style )} onPress={() => { - //TODO: implement + searchStore.updateFilters( + 'kind', + { + name, + icon: (icon + '20') as IconName, + id: kind + }, + true + ); + navigation.navigate('SearchStack', { + screen: 'Search' + }); }} > diff --git a/apps/mobile/src/components/overview/Devices.tsx b/apps/mobile/src/components/overview/Devices.tsx index 621622de5..b75e2a4a0 100644 --- a/apps/mobile/src/components/overview/Devices.tsx +++ b/apps/mobile/src/components/overview/Devices.tsx @@ -57,11 +57,11 @@ const Devices = ({ node, stats }: Props) => { const totalSpace = Platform.OS === 'android' ? sizeInfo.totalSpace.toString() - : stats.data?.statistics?.total_bytes_capacity || '0'; + : stats.data?.statistics?.total_local_bytes_capacity || '0'; const freeSpace = Platform.OS === 'android' ? sizeInfo.freeSpace.toString() - : stats.data?.statistics?.total_bytes_free || '0'; + : stats.data?.statistics?.total_local_bytes_free || '0'; useEffect(() => { if (Platform.OS === 'android') { diff --git a/apps/mobile/src/components/overview/Locations.tsx b/apps/mobile/src/components/overview/Locations.tsx index 8a53c4dfc..fb24ca639 100644 --- a/apps/mobile/src/components/overview/Locations.tsx +++ b/apps/mobile/src/components/overview/Locations.tsx @@ -1,8 +1,8 @@ import { useNavigation } from '@react-navigation/native'; +import { useLibraryQuery } from '@sd/client'; import React, { useRef } from 'react'; import { Pressable, Text, View } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; -import { useCache, useLibraryQuery, useNodes } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; import { OverviewStackScreenProps } from '~/navigation/tabs/OverviewStack'; @@ -19,65 +19,62 @@ const Locations = () => { const modalRef = useRef(null); const locationsQuery = useLibraryQuery(['locations.list']); - useNodes(locationsQuery.data?.nodes); - const locations = useCache(locationsQuery.data?.items); + const locations = locationsQuery.data; return ( <> - - location.id.toString()} - ItemSeparatorComponent={() => } - ListEmptyComponent={() => { - return ( - ( - - )} - /> - ); - }} - showsVerticalScrollIndicator={false} - renderItem={({ item }) => ( - - navigation.jumpTo('BrowseStack', { - initial: false, - screen: 'Location', - params: { id: item.id } - }) - } - > - - - )} - /> - + + location.id.toString()} + ItemSeparatorComponent={() => } + ListEmptyComponent={() => { + return ( + ( + + )} + /> + ); + }} + showsVerticalScrollIndicator={false} + renderItem={({ item }) => ( + + navigation.jumpTo('BrowseStack', { + initial: false, + screen: 'Location', + params: { id: item.id } + }) + } + > + + + )} + /> + diff --git a/apps/mobile/src/components/overview/OverviewStats.tsx b/apps/mobile/src/components/overview/OverviewStats.tsx index a8babb418..d72eba4e7 100644 --- a/apps/mobile/src/components/overview/OverviewStats.tsx +++ b/apps/mobile/src/components/overview/OverviewStats.tsx @@ -1,21 +1,22 @@ import * as RNFS from '@dr.pogodin/react-native-fs'; import { AlphaRSPCError } from '@oscartbeaumont-sd/rspc-client/v2'; +import { Statistics, StatisticsResponse, humanizeSize, useLibraryContext } from '@sd/client'; import { UseQueryResult } from '@tanstack/react-query'; import { useEffect, useState } from 'react'; import { Platform, Text, View } from 'react-native'; import { ClassInput } from 'twrnc/dist/esm/types'; -import { byteSize, Statistics, StatisticsResponse, useLibraryContext } from '@sd/client'; import useCounter from '~/hooks/useCounter'; import { tw, twStyle } from '~/lib/tailwind'; import Card from '../layout/Card'; const StatItemNames: Partial> = { - total_bytes_capacity: 'Total capacity', - preview_media_bytes: 'Preview media', + total_local_bytes_capacity: 'Total capacity', + total_library_preview_media_bytes: 'Preview media', + total_library_bytes: 'Total library size', library_db_size: 'Index size', - total_bytes_free: 'Free space', - total_bytes_used: 'Total used space' + total_local_bytes_free: 'Free space', + total_local_bytes_used: 'Total used space' }; interface StatItemProps { @@ -26,7 +27,7 @@ interface StatItemProps { } const StatItem = ({ title, bytes, isLoading, style }: StatItemProps) => { - const { value, unit } = byteSize(bytes); + const { value, unit } = humanizeSize(bytes); const count = useCounter({ name: title, end: value }); @@ -36,7 +37,7 @@ const StatItem = ({ title, bytes, isLoading, style }: StatItemProps) => { hidden: isLoading })} > - {title} + {title} {count} {unit} @@ -76,19 +77,18 @@ const OverviewStats = ({ stats }: Props) => { }, []); const renderStatItems = (isTotalStat = true) => { + const keysToFilter = ['total_local_bytes_capacity', 'total_local_bytes_used', 'total_library_bytes']; if (!stats.data?.statistics) return null; return Object.entries(stats.data.statistics).map(([key, bytesRaw]) => { if (!displayableStatItems.includes(key)) return null; - if (isTotalStat && !['total_bytes_capacity', 'total_bytes_used'].includes(key)) - return null; - if (!isTotalStat && ['total_bytes_capacity', 'total_bytes_used'].includes(key)) - return null; let bytes = BigInt(bytesRaw ?? 0); - if (key === 'total_bytes_free') { + if (isTotalStat && !keysToFilter.includes(key)) return null; + if (!isTotalStat && keysToFilter.includes(key)) return null; + if (key === 'total_local_bytes_free') { bytes = BigInt(sizeInfo.freeSpace); - } else if (key === 'total_bytes_capacity') { + } else if (key === 'total_local_bytes_capacity') { bytes = BigInt(sizeInfo.totalSpace); - } else if (key === 'total_bytes_used' && Platform.OS === 'android') { + } else if (key === 'total_local_bytes_used' && Platform.OS === 'android') { bytes = BigInt(sizeInfo.totalSpace - sizeInfo.freeSpace); } return ( @@ -97,20 +97,20 @@ const OverviewStats = ({ stats }: Props) => { title={StatItemNames[key as keyof Statistics]!} bytes={bytes} isLoading={stats.isLoading} - style={twStyle(isTotalStat && 'h-[101px]', 'w-full flex-1')} + style={tw`w-full`} /> ); }); }; return ( - + Statistics - - + + {renderStatItems()} - + {renderStatItems(false)} diff --git a/apps/mobile/src/components/overview/StatCard.tsx b/apps/mobile/src/components/overview/StatCard.tsx index 8dc98e969..b2712594c 100644 --- a/apps/mobile/src/components/overview/StatCard.tsx +++ b/apps/mobile/src/components/overview/StatCard.tsx @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from 'react'; import { Text, View } from 'react-native'; import { AnimatedCircularProgress } from 'react-native-circular-progress'; -import { byteSize } from '@sd/client'; +import { humanizeSize } from '@sd/client'; import { tw } from '~/lib/tailwind'; import { Icon, IconName } from '../icons/Icon'; @@ -20,12 +20,12 @@ const StatCard = ({ icon, name, connectionType, ...stats }: StatCardProps) => { const [mounted, setMounted] = useState(false); const { totalSpace, freeSpace, usedSpaceSpace } = useMemo(() => { - const totalSpace = byteSize(stats.totalSpace); - const freeSpace = stats.freeSpace == null ? totalSpace : byteSize(stats.freeSpace); + const totalSpace = humanizeSize(stats.totalSpace); + const freeSpace = stats.freeSpace == null ? totalSpace : humanizeSize(stats.freeSpace); return { totalSpace, freeSpace, - usedSpaceSpace: byteSize(totalSpace.original - freeSpace.original) + usedSpaceSpace: humanizeSize(totalSpace.bytes - freeSpace.bytes) }; }, [stats]); @@ -34,7 +34,7 @@ const StatCard = ({ icon, name, connectionType, ...stats }: StatCardProps) => { }, []); const progress = useMemo(() => { - if (!mounted || totalSpace.original === 0n) return 0; + if (!mounted || totalSpace.bytes === 0n) return 0; return Math.floor((usedSpaceSpace.value / totalSpace.value) * 100); }, [mounted, totalSpace, usedSpaceSpace]); diff --git a/apps/mobile/src/components/primitive/Button.tsx b/apps/mobile/src/components/primitive/Button.tsx index 37eabd611..7e0cbd893 100644 --- a/apps/mobile/src/components/primitive/Button.tsx +++ b/apps/mobile/src/components/primitive/Button.tsx @@ -8,11 +8,11 @@ const button = cva(['items-center justify-center rounded-md border shadow-sm'], variants: { variant: { danger: ['border-red-800 bg-red-600 shadow-none'], - gray: ['border-app-lightborder bg-app-button shadow-none'], + gray: ['border-app-box bg-app shadow-none'], darkgray: ['border-app-box bg-app shadow-none'], accent: ['border-accent-deep bg-accent shadow-md shadow-app-shade/10'], - outline: ['border-sidebar-line/60 bg-black shadow-none'], - transparent: ['border-0 bg-black shadow-none'], + outline: ['border border-app-inputborder bg-transparent shadow-none'], + transparent: ['border-0 bg-transparent shadow-none'], dashed: ['border border-dashed border-app-line bg-transparent shadow-none'] }, size: { diff --git a/apps/mobile/src/components/primitive/InfoPill.tsx b/apps/mobile/src/components/primitive/InfoPill.tsx index 865b283cd..bd01f4bb2 100644 --- a/apps/mobile/src/components/primitive/InfoPill.tsx +++ b/apps/mobile/src/components/primitive/InfoPill.tsx @@ -1,4 +1,5 @@ -import React from 'react'; +import { IconProps } from 'phosphor-react-native'; +import React, { ReactElement } from 'react'; import { Text, TextStyle, View, ViewStyle } from 'react-native'; import { twStyle } from '~/lib/tailwind'; @@ -6,13 +7,14 @@ type Props = { text: string; containerStyle?: ViewStyle; textStyle?: TextStyle; + icon?: ReactElement }; export const InfoPill = (props: Props) => { return ( @@ -27,11 +29,12 @@ export function PlaceholderPill(props: Props) { return ( - + {props.icon && props.icon} + {props.text} diff --git a/apps/mobile/src/components/primitive/Input.tsx b/apps/mobile/src/components/primitive/Input.tsx index 023b5c21b..abe5b453f 100644 --- a/apps/mobile/src/components/primitive/Input.tsx +++ b/apps/mobile/src/components/primitive/Input.tsx @@ -1,7 +1,7 @@ import { BottomSheetTextInput } from '@gorhom/bottom-sheet'; import { cva, VariantProps } from 'class-variance-authority'; import { Eye, EyeSlash } from 'phosphor-react-native'; -import { useState } from 'react'; +import { forwardRef, useState } from 'react'; import { Pressable, TextInputProps as RNTextInputProps, TextInput, View } from 'react-native'; import { tw, twStyle } from '~/lib/tailwind'; @@ -23,28 +23,32 @@ const input = cva(['rounded-md border text-sm leading-tight shadow-sm'], { type InputProps = VariantProps & RNTextInputProps; -export const Input = ({ variant, size, ...props }: InputProps) => { - const { style, ...otherProps } = props; +export const Input = forwardRef((props, ref) => { + const { style, variant, size, ...otherProps } = props; return ( ); -}; +}) // To use in modals (for keyboard handling) -export const ModalInput = ({ variant, size, ...props }: InputProps) => { - const { style, ...otherProps } = props; +export const ModalInput = forwardRef((props, ref) => { + const { style, variant, size, ...otherProps } = props; return ( ); -}; +}) // Same as Input but configured with password props & show/hide password button diff --git a/apps/mobile/src/components/primitive/Menu.tsx b/apps/mobile/src/components/primitive/Menu.tsx index e74c5889b..7f16d870a 100644 --- a/apps/mobile/src/components/primitive/Menu.tsx +++ b/apps/mobile/src/components/primitive/Menu.tsx @@ -5,48 +5,49 @@ import { MenuOptionProps, MenuOptions, MenuTrigger, - Menu as PMenu, - renderers + Menu as PMenu } from 'react-native-popup-menu'; -import { tw } from '~/lib/tailwind'; +import { ClassInput } from 'twrnc'; +import { tw, twStyle } from '~/lib/tailwind'; type MenuProps = { trigger: React.ReactNode; children: React.ReactNode[] | React.ReactNode; + triggerStyle?: ClassInput; + containerStyle?: ClassInput; }; // TODO: Still looks a bit off... export const Menu = (props: MenuProps) => ( - - + {props.trigger} - + {props.children} - ); type MenuItemProps = { icon?: Icon; + textStyle?: ClassInput; + iconStyle?: ClassInput; + style?: ClassInput; } & MenuOptionProps; -export const MenuItem = ({ icon, ...props }: MenuItemProps) => { +export const MenuItem = ({ icon, textStyle, iconStyle, style, ...props }: MenuItemProps) => { const Icon = icon; return ( - + {Icon && ( - - - + )} ); diff --git a/apps/mobile/src/components/primitive/Toast.tsx b/apps/mobile/src/components/primitive/Toast.tsx index ab2cc2355..d0da33b3c 100644 --- a/apps/mobile/src/components/primitive/Toast.tsx +++ b/apps/mobile/src/components/primitive/Toast.tsx @@ -1,36 +1,65 @@ /* eslint-disable no-restricted-imports */ +import { CheckCircle, Info, WarningCircle } from 'phosphor-react-native'; import { Text, View } from 'react-native'; import Toast, { ToastConfig } from 'react-native-toast-message'; import { tw } from '~/lib/tailwind'; -// TODO: -// - Expand toast on press to show full message if it's too long -// - Add a onPress option -// - Add leading icon & trailing icon +const baseStyles = 'max-w-[340px] flex-row gap-1 items-center justify-center overflow-hidden rounded-md border p-3 shadow-lg bg-app-input border-app-inputborder'; +const containerStyle = 'flex-row items-start gap-1.5' const toastConfig: ToastConfig = { success: ({ text1, ...rest }) => ( - - + + + + {text1} + ), error: ({ text1, ...rest }) => ( - - + + + + {text1} + + + ), + info: ({ text1, ...rest }) => ( + + + + + {text1} + + ) }; -function toast({ text, type }: { type: 'success' | 'error' | 'info'; text: string }) { - Toast.show({ type, text1: text, visibilityTime: 3000, topOffset: 60 }); +function showToast({ text, type }: { type: 'success' | 'error' | 'info'; text: string }) { + const visibilityTime = 3000; + const topOffset = 60; + Toast.show({ type, text1: text, visibilityTime, topOffset }); } +const toast: { + success: (text: string) => void; + error: (text: string) => void; + info: (text: string) => void; +} = { + success: function (text: string): void { + showToast({ text, type: 'success' }); + }, + error: function (text: string): void { + showToast({ text, type: 'error' }); + }, + info: function (text: string): void { + showToast({ text, type: 'info' }); + } +}; + export { Toast, toast, toastConfig }; diff --git a/apps/mobile/src/components/search/Search.tsx b/apps/mobile/src/components/search/Search.tsx index 3b70fc2c8..8446da573 100644 --- a/apps/mobile/src/components/search/Search.tsx +++ b/apps/mobile/src/components/search/Search.tsx @@ -5,7 +5,7 @@ import { tw } from '~/lib/tailwind'; import { getSearchStore } from '~/stores/searchStore'; interface Props { - placeholder: string; + placeholder?: string; } export default function Search({ placeholder }: Props) { @@ -18,7 +18,7 @@ export default function Search({ placeholder }: Props) { }, [searchStore]); return ( searchStore.setSearch(text)} diff --git a/apps/mobile/src/components/search/filters/FiltersBar.tsx b/apps/mobile/src/components/search/filters/FiltersBar.tsx index bf019f3e0..5e4de2104 100644 --- a/apps/mobile/src/components/search/filters/FiltersBar.tsx +++ b/apps/mobile/src/components/search/filters/FiltersBar.tsx @@ -20,20 +20,22 @@ import { KindItem, SearchFilters, TagItem, + getSearchStore, useSearchStore } from '~/stores/searchStore'; const FiltersBar = () => { - const { filters, appliedFilters } = useSearchStore(); + const searchStore = useSearchStore(); const navigation = useNavigation['navigation']>(); const flatListRef = useRef(null); + const appliedFiltersLength = Object.keys(searchStore.appliedFilters).length; - // Scroll to start when there are less than 2 filters. useEffect(() => { - if (Object.entries(appliedFilters).length < 2) { - flatListRef.current?.scrollToOffset({ animated: true, offset: 0 }); + // If there are applied filters, update the searchStore filters + if (appliedFiltersLength > 0) { + Object.assign(getSearchStore().filters, searchStore.appliedFilters); } - }, [appliedFilters]); + }, [appliedFiltersLength, searchStore.appliedFilters]); return ( { - + { + if (flatListRef.current && appliedFiltersLength < 2) { + flatListRef.current.scrollToOffset({ animated: true, offset: 0 }); + } + }} + data={Object.entries(searchStore.appliedFilters)} + extraData={searchStore.filters} keyExtractor={(item) => item[0]} renderItem={({ item }) => ( @@ -75,6 +82,10 @@ const FilterItem = ({ filter, value }: FilterItemProps) => { const boxStyle = tw`w-auto flex-row items-center gap-1.5 border border-app-cardborder bg-app-card p-2`; const filterCapital = filter.charAt(0).toUpperCase() + filter.slice(1); const searchStore = useSearchStore(); + + // if the filter value is false or empty, return null i.e "Hidden" + if (!value) return null; + return ( @@ -168,16 +179,16 @@ const ExtensionView = ({ extensions }: { extensions: string[] }) => ( ); const TagView = ({ tags }: { tags: TagItem[] }) => ( - <> + {tags.map((tag) => ( ))} - + ); const LocationView = ({ locations }: { locations: FilterItemType[] }) => ( diff --git a/apps/mobile/src/components/search/filters/FiltersList.tsx b/apps/mobile/src/components/search/filters/FiltersList.tsx index abbf5ba0e..cc58b151b 100644 --- a/apps/mobile/src/components/search/filters/FiltersList.tsx +++ b/apps/mobile/src/components/search/filters/FiltersList.tsx @@ -1,4 +1,4 @@ -import { AnimatePresence } from 'moti'; +import { AnimatePresence, MotiView } from 'moti'; import { MotiPressable } from 'moti/interactions'; import { CircleDashed, @@ -13,7 +13,7 @@ import { Text, View } from 'react-native'; import Card from '~/components/layout/Card'; import SectionTitle from '~/components/layout/SectionTitle'; import { tw, twStyle } from '~/lib/tailwind'; -import { getSearchStore, SearchFilters, useSearchStore } from '~/stores/searchStore'; +import { SearchFilters, getSearchStore, useSearchStore } from '~/stores/searchStore'; import Extension from './Extension'; import Kind from './Kind'; @@ -51,12 +51,15 @@ const FiltersList = () => { const [selectedOptions, setSelectedOptions] = useState( Object.keys(searchStore.appliedFilters) as SearchFilters[] ); + const appliedFiltersLength = Object.keys(searchStore.appliedFilters).length; + - // If any filters are applied - we need to update the store - // so the UI can reflect the applied filters useEffect(() => { - Object.assign(getSearchStore().filters, getSearchStore().appliedFilters); - }, []); + //if there are selected filters but not applied reset them + if (appliedFiltersLength === 0) { + getSearchStore().resetFilters(); + } + }, [appliedFiltersLength]); const selectedHandler = useCallback( (option: Capitalize) => { @@ -80,13 +83,16 @@ const FiltersList = () => { searchStore.resetFilter(searchFiltersLowercase); } }, - [selectedOptions, searchStore] - ); + [selectedOptions, searchStore]) return ( - + { ))} - + {/* conditionally render the selected options - this approach makes sure the animation is right by not relying on the index position of the object */} diff --git a/apps/mobile/src/components/search/filters/Kind.tsx b/apps/mobile/src/components/search/filters/Kind.tsx index 17b666253..a951270b2 100644 --- a/apps/mobile/src/components/search/filters/Kind.tsx +++ b/apps/mobile/src/components/search/filters/Kind.tsx @@ -1,12 +1,11 @@ import { IconTypes } from '@sd/assets/util'; +import { ObjectKind } from '@sd/client'; import { MotiView } from 'moti'; import { memo, useCallback, useMemo } from 'react'; import { FlatList, Pressable, Text, View } from 'react-native'; import { LinearTransition } from 'react-native-reanimated'; -import { ObjectKind } from '@sd/client'; import { Icon } from '~/components/icons/Icon'; import Card from '~/components/layout/Card'; -import Fade from '~/components/layout/Fade'; import SectionTitle from '~/components/layout/SectionTitle'; import VirtualizedListWrapper from '~/components/layout/VirtualizedListWrapper'; import { tw, twStyle } from '~/lib/tailwind'; @@ -40,12 +39,11 @@ const Kind = () => { sub="What kind of objects should be searched?" /> - } - contentContainerStyle={tw`pl-6`} + contentContainerStyle={tw`px-6`} numColumns={kinds && Math.ceil(Number(kinds.length) / 2)} key={kinds ? 'kindsSearch' : '_'} scrollEnabled={false} @@ -56,7 +54,6 @@ const Kind = () => { style={tw`flex-row`} /> - ); diff --git a/apps/mobile/src/components/search/filters/Locations.tsx b/apps/mobile/src/components/search/filters/Locations.tsx index 44336fb3d..8d812803a 100644 --- a/apps/mobile/src/components/search/filters/Locations.tsx +++ b/apps/mobile/src/components/search/filters/Locations.tsx @@ -1,8 +1,8 @@ +import { Location, useLibraryQuery } from '@sd/client'; import { MotiView } from 'moti'; import { memo, useCallback, useMemo } from 'react'; import { FlatList, Pressable, Text, View } from 'react-native'; import { LinearTransition } from 'react-native-reanimated'; -import { Location, useCache, useLibraryQuery, useNodes } from '@sd/client'; import { Icon } from '~/components/icons/Icon'; import Card from '~/components/layout/Card'; import Empty from '~/components/layout/Empty'; @@ -14,8 +14,7 @@ import { useSearchStore } from '~/stores/searchStore'; const Locations = () => { const locationsQuery = useLibraryQuery(['locations.list']); - useNodes(locationsQuery.data?.nodes); - const locations = useCache(locationsQuery.data?.items); + const locations = locationsQuery.data; const searchStore = useSearchStore(); return ( @@ -33,14 +32,13 @@ const Locations = () => { /> - + } numColumns={ locations ? Math.max(Math.ceil(locations.length / 2), 2) : 1 } - contentContainerStyle={tw`w-full`} ListEmptyComponent={ { name: data.name as string }); }, [data.id, data.name, searchStore]); + return ( { const searchStore = useSearchStore(); const navigation = useNavigation['navigation']>(); + const modalRef = useRef(null); + const filtersApplied = Object.keys(searchStore.appliedFilters).length > 0; const buttonDisable = !filtersApplied && searchStore.disableActionButtons; const isAndroid = Platform.OS === 'android'; @@ -38,6 +42,7 @@ const SaveAdd = () => { opacity: buttonDisable ? 0.5 : 1 })} variant="dashed" + onPress={() => modalRef.current?.present()} > Save search @@ -58,6 +63,7 @@ const SaveAdd = () => { {filtersApplied ? 'Update filters' : 'Add filters'} + ); }; diff --git a/apps/mobile/src/components/search/filters/SavedSearches.tsx b/apps/mobile/src/components/search/filters/SavedSearches.tsx index c27719871..2d5dd4900 100644 --- a/apps/mobile/src/components/search/filters/SavedSearches.tsx +++ b/apps/mobile/src/components/search/filters/SavedSearches.tsx @@ -1,15 +1,27 @@ +import { useNavigation } from '@react-navigation/native'; +import { + SavedSearch as ISavedSearch, + useLibraryMutation, + useLibraryQuery, + useRspcLibraryContext +} from '@sd/client'; import { MotiView } from 'moti'; import { MotiPressable } from 'moti/interactions'; -import { FlatList, Text, View } from 'react-native'; +import { X } from 'phosphor-react-native'; +import { FlatList, Pressable, Text, View } from 'react-native'; import { Icon } from '~/components/icons/Icon'; import Card from '~/components/layout/Card'; +import Empty from '~/components/layout/Empty'; import Fade from '~/components/layout/Fade'; import SectionTitle from '~/components/layout/SectionTitle'; import VirtualizedListWrapper from '~/components/layout/VirtualizedListWrapper'; import DottedDivider from '~/components/primitive/DottedDivider'; +import { useSavedSearch } from '~/hooks/useSavedSearch'; import { tw } from '~/lib/tailwind'; +import { getSearchStore } from '~/stores/searchStore'; const SavedSearches = () => { + const { data: savedSearches } = useLibraryQuery(['search.saved.list']); return ( { title="Saved searches" sub="Tap a saved search for searching quickly" /> - + } + data={savedSearches} + ListEmptyComponent={() => { + return ( + + ); + }} + renderItem={({ item }) => } keyExtractor={(_, index) => index.toString()} numColumns={Math.ceil(6 / 2)} scrollEnabled={false} @@ -41,16 +59,37 @@ const SavedSearches = () => { ); }; -const SavedSearch = () => { +interface Props { + search: ISavedSearch; +} + +const SavedSearch = ({ search }: Props) => { + const navigation = useNavigation(); + const dataForSearch = useSavedSearch(search); + const rspc = useRspcLibraryContext(); + const deleteSearch = useLibraryMutation('search.saved.delete', { + onSuccess: () => rspc.queryClient.invalidateQueries(['search.saved.list']) + }); return ( { + getSearchStore().appliedFilters = dataForSearch; + navigation.navigate('SearchStack', { + screen: 'Search' + }); + }} > - + + await deleteSearch.mutateAsync(search.id)} + > + + - Saved search + {search.name} ); diff --git a/apps/mobile/src/components/search/filters/Tags.tsx b/apps/mobile/src/components/search/filters/Tags.tsx index 7507de2b5..37b4ae315 100644 --- a/apps/mobile/src/components/search/filters/Tags.tsx +++ b/apps/mobile/src/components/search/filters/Tags.tsx @@ -1,9 +1,9 @@ +import { Tag, useLibraryQuery } from '@sd/client'; import { MotiView } from 'moti'; import { memo, useCallback, useMemo } from 'react'; import { Pressable, Text, View } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; import { LinearTransition } from 'react-native-reanimated'; -import { Tag, useCache, useLibraryQuery, useNodes } from '@sd/client'; import Card from '~/components/layout/Card'; import Empty from '~/components/layout/Empty'; import Fade from '~/components/layout/Fade'; @@ -14,8 +14,7 @@ import { useSearchStore } from '~/stores/searchStore'; const Tags = () => { const tags = useLibraryQuery(['tags.list']); - useNodes(tags.data?.nodes); - const tagsData = useCache(tags.data?.items); + const tagsData = tags.data; const searchStore = useSearchStore(); return ( @@ -31,20 +30,16 @@ const Tags = () => { title="Tags" sub="What tags would you like to filter by?" /> - - + } extraData={searchStore.filters.tags} + alwaysBounceVertical={false} numColumns={tagsData ? Math.max(Math.ceil(tagsData.length / 2), 2) : 1} key={tagsData ? 'tagsSearch' : '_'} - contentContainerStyle={tw`w-full`} - ListEmptyComponent={ - - } - scrollEnabled={false} + ListEmptyComponent={} ItemSeparatorComponent={() => } keyExtractor={(item) => item.id.toString()} showsHorizontalScrollIndicator={false} @@ -52,7 +47,6 @@ const Tags = () => { /> - ); }; @@ -64,10 +58,7 @@ interface Props { const TagFilter = memo(({ tag }: Props) => { const searchStore = useSearchStore(); const isSelected = useMemo( - () => - searchStore.filters.tags.some( - (filter) => filter.id === tag.id && filter.color === tag.color - ), + () => searchStore.filters.tags.some((filter) => filter.id === tag.id), [searchStore.filters.tags, tag] ); const onPress = useCallback(() => { @@ -75,7 +66,8 @@ const TagFilter = memo(({ tag }: Props) => { id: tag.id, color: tag.color! }); - }, [searchStore, tag.id, tag.color]); + }, [searchStore, tag]); + return ( { })} > diff --git a/apps/mobile/src/components/tags/GridTag.tsx b/apps/mobile/src/components/tags/GridTag.tsx index 723831526..a2598126d 100644 --- a/apps/mobile/src/components/tags/GridTag.tsx +++ b/apps/mobile/src/components/tags/GridTag.tsx @@ -1,6 +1,6 @@ +import { Tag } from '@sd/client'; import { DotsThreeOutlineVertical } from 'phosphor-react-native'; import { Pressable, Text, View } from 'react-native'; -import { Tag } from '@sd/client'; import { tw, twStyle } from '~/lib/tailwind'; import Card from '../layout/Card'; @@ -16,11 +16,11 @@ const GridTag = ({ tag, modalRef }: GridTagProps) => { - modalRef.current?.present()}> + modalRef.current?.present()}> { return ( ( - <> - - + )} > - + @@ -41,12 +39,12 @@ const ListTag = ({ tag, tagStyle }: ListTagProps) => { {tag.name} - swipeRef.current?.openRight()}> - + swipeRef.current?.openRight()}> + diff --git a/apps/mobile/src/components/tags/TagItem.tsx b/apps/mobile/src/components/tags/TagItem.tsx index e131fe501..7aba00a01 100644 --- a/apps/mobile/src/components/tags/TagItem.tsx +++ b/apps/mobile/src/components/tags/TagItem.tsx @@ -1,8 +1,9 @@ +import { Tag } from '@sd/client'; import { useRef } from 'react'; import { Pressable } from 'react-native'; -import { Tag } from '@sd/client'; import { twStyle } from '~/lib/tailwind'; +import { ClassInput } from 'twrnc'; import { ModalRef } from '../layout/Modal'; import { TagModal } from '../modal/tag/TagModal'; import GridTag from './GridTag'; @@ -12,14 +13,15 @@ type TagItemProps = { tag: Tag; onPress: () => void; viewStyle?: 'grid' | 'list'; + style?: ClassInput; }; -export const TagItem = ({ tag, onPress, viewStyle = 'grid' }: TagItemProps) => { +export const TagItem = ({ tag, onPress, style, viewStyle = 'grid' }: TagItemProps) => { const modalRef = useRef(null); return ( <> diff --git a/apps/mobile/src/constants/style/Colors.js b/apps/mobile/src/constants/style/Colors.js index ae080949b..715b96f56 100644 --- a/apps/mobile/src/constants/style/Colors.js +++ b/apps/mobile/src/constants/style/Colors.js @@ -79,7 +79,7 @@ module.exports = { // shadow shade: `hsla(${DARK_HUE}, 15%, 0%, ${ALPHA})`, // menu - menu: `hsla(${DARK_HUE}, 25%, 5%, ${ALPHA})` + menu: `hsla(${DARK_HUE}, 10%, 5%, ${ALPHA})` }, sidebar: { box: `hsla(${DARK_HUE}, 15%, 16%, ${ALPHA})`, diff --git a/apps/mobile/src/hooks/useFiltersSearch.ts b/apps/mobile/src/hooks/useFiltersSearch.ts new file mode 100644 index 000000000..4c953df85 --- /dev/null +++ b/apps/mobile/src/hooks/useFiltersSearch.ts @@ -0,0 +1,104 @@ +import { SearchFilterArgs, useLibraryQuery } from '@sd/client'; +import { useEffect, useMemo } from 'react'; +import { Filters, SearchFilters, getSearchStore, useSearchStore } from '~/stores/searchStore'; + +/** + * This hook merges the selected filters from Filters page in order + * to make query calls for saved searches and setups filters for the search + * the data structure has been designed to match the desktop app + * @param search - search input string value + */ + + +export function useFiltersSearch(search: string) { + + const [name, ext] = useMemo(() => search.split('.'), [search]); + const searchStore = useSearchStore(); + + const locations = useLibraryQuery(['locations.list'], { + keepPreviousData: true, + }); + + const filterFactory = (key: SearchFilters, value: Filters[keyof Filters]) => { + + //hidden is the only boolean filter - so we can return it directly + //Rest of the filters are arrays, so we map them to the correct format + const filterValue = Array.isArray(value) ? value.map((v: any) => { + return v.id ? v.id : v; + }) : value; + + //switch case for each filter + //This makes it easier to add new filters in the future and setup + //the correct object of each filter accordingly and easily + + switch (key) { + case 'locations': + return { filePath: { locations: { in: filterValue } } }; + case 'name': + return Array.isArray(filterValue) && filterValue.map((v: string) => { + return { filePath: { [key]: { contains: v } } }; + }) + case 'hidden': + return { filePath: { hidden: filterValue } }; + case 'extension': + return Array.isArray(filterValue) && filterValue.map((v: string) => { + return { filePath: { [key]: { in: [v] } } }; + }) + case 'tags': + return { object: { tags: { in: filterValue } } }; + case 'kind': + return { object: { kind: { in: filterValue } } }; + default: + return {}; + } + } + + + const mergedFilters = useMemo(() => { + + const filters = [] as SearchFilterArgs[]; + + //It's a global search if no locations have been selected + if (searchStore.filters.locations.length === 0) { + const locationIds = locations.data?.map((l) => l.id); + if (locationIds) filters.push({ filePath: { locations: { in: locationIds } } }); + } + + //handle search input + if (name) filters.push({ filePath: { name: { contains: name } } }); + if (ext) filters.push({ filePath: { extension: { in: [ext] } } }); + + // handle selected filters + for (const key in searchStore.filters) { + + const filterKey = key as SearchFilters; + //due to an issue with Valtio and Hermes Engine - need to do getSearchStore() + //https://github.com/pmndrs/valtio/issues/765 + const filterValue = getSearchStore().filters[filterKey]; + + // no need to add empty filters + if (Array.isArray(filterValue)) { + const realValues = filterValue.filter((v) => v !== ''); + if (realValues.length === 0) { + continue; + } + } + + // create the filter object + const filter = filterFactory(filterKey, filterValue); + + // add the filter to the mergedFilters + filters.push(filter as SearchFilterArgs); + + } + + // makes sure the array is not 2D + return filters.flat(); + + }, [searchStore.filters, search]); + + + useEffect(() => { + getSearchStore().mergedFilters = mergedFilters; + }, [searchStore.filters, search]); +}; diff --git a/apps/mobile/src/hooks/useSavedSearch.ts b/apps/mobile/src/hooks/useSavedSearch.ts new file mode 100644 index 000000000..3434621e7 --- /dev/null +++ b/apps/mobile/src/hooks/useSavedSearch.ts @@ -0,0 +1,134 @@ +import { SavedSearch, SearchFilterArgs, useLibraryQuery } from '@sd/client'; +import { useCallback, useMemo } from 'react'; +import { kinds } from '~/components/search/filters/Kind'; +import { Filters, SearchFilters } from '~/stores/searchStore'; + +/** + * This hook takes in the JSON of a Saved Search + * and returns the data of its filters for rendering in the UI + */ + +export function useSavedSearch(search: SavedSearch) { + const parseFilters = JSON.parse(search.filters as string); + + // returns an array of keys of the filters being used in the Saved Search + //i.e locations, tags, kind, etc... + const filterKeys: SearchFilters[] = parseFilters.reduce((acc: SearchFilters[], curr: keyof SearchFilterArgs) => { + const objectOrFilePath = Object.keys(curr)[0] as 'filePath' | 'object'; + const key = Object.keys(curr[objectOrFilePath])[0] as SearchFilters; + if (!acc.includes(key)) { + acc.push(key as SearchFilters); + } + return acc; + }, []); + + // this util function extracts the data of a filter from the Saved Search + const extractDataFromSavedSearch = (key: SearchFilters, filterTag: 'contains' | 'in', type: 'filePath' | 'object') => { + // Iterate through each item in the data array + for (const item of parseFilters) { + // Check if 'filePath' | 'object' exists and contains a the key + if (item[type] && key in item[type]) { + // Return the data of the filters + return item.filePath[key][filterTag]; + } + } + return null; + } + + const locations = useLibraryQuery(['locations.list'], { + keepPreviousData: true, + enabled: filterKeys.includes('locations'), + }); + const tags = useLibraryQuery(['tags.list'], { + keepPreviousData: true, + enabled: filterKeys.includes('tags'), + }); + + // Filters like locations, tags, and kind require data to be rendered as a Filter + // We prepare the data in the same format as the "filters" object in the "SearchStore" + // it is then 'matched' with the data from the "Saved Search" + + const prepFilters = useCallback(() => { + const data = {} as Record; + filterKeys.forEach((key: SearchFilters) => { + switch (key) { + case 'locations': + data.locations = locations.data?.map((location) => { + return { + id: location.id, + name: location.name + }; + }); + break; + case 'tags': + data.tags = tags.data?.map((tag) => { + return { + id: tag.id, + color: tag.color + }; + }); + break; + case 'kind': + data.kind = kinds.map((kind) => { + return { + name: kind.name, + id: kind.value, + icon: kind.icon + }; + }); + break; + case 'name': + data.name = extractDataFromSavedSearch(key, 'contains', 'filePath'); + break; + case 'extension': + data.extension = extractDataFromSavedSearch(key, 'contains', 'filePath'); + break; + } + }); + return data; + }, [locations, tags]); + + const filters: Partial = useMemo(() => { + return parseFilters.reduce((acc: Record, curr: keyof SearchFilterArgs) => { + + const objectOrFilePath = Object.keys(curr)[0] as 'filePath' | 'object'; + const key = Object.keys(curr[objectOrFilePath])[0] as SearchFilters; //locations, tags, kind, etc... + + // this function extracts the data from the result of the "filters" object in the Saved Search + // and matches it with the values of the filters + const extractData = (key: SearchFilters) => { + const values: { + contains?: string; + in?: number[]; + } = curr[objectOrFilePath][key]; + const type = Object.keys(values)[0]; + + switch (type) { + case 'contains': + // some filters have a name property and some are just strings + return prepFilters()[key].filter((item: any) => { + return item.name ? item.name === values[type] : + item + }); + case 'in': + return prepFilters()[key].filter((item: any) => values[type]?.includes(item.id)); + default: + return values; + } + }; + + // the data being setup for the filters so it can be rendered + if (!acc[key]) { + acc[key] = extractData(key); + //don't include false values i.e if the "Hidden" filter is false + if (acc[key] === false) { + delete acc[key]; + } + } + return acc; + }, {}); + + }, [parseFilters]); + + return filters; +} diff --git a/apps/mobile/src/hooks/useSortBy.ts b/apps/mobile/src/hooks/useSortBy.ts new file mode 100644 index 000000000..a896dd455 --- /dev/null +++ b/apps/mobile/src/hooks/useSortBy.ts @@ -0,0 +1,30 @@ +import { FilePathOrder } from "@sd/client"; +import { SortOptionsType, useSearchStore } from "~/stores/searchStore"; + +/** + * This hook provides a sorting order object based on user preferences + * for constructing the order query. + */ + +export const useSortBy = (): FilePathOrder | null => { + const searchStore = useSearchStore(); + const { by, direction } = searchStore.sort; + + // if no sort by field is selected, return null + if (by === 'none') return null; + + // some sort by fields have common keys + const common = { field: by, value: direction }; + + const fields: Record,any> = { + name: common, + sizeInBytes: common, + dateIndexed: common, + dateCreated: common, + dateModified: common, + dateAccessed: { field: "object", value: { field: "dateAccessed", value: direction} }, + dateTaken: { field: "object", value: {field: 'mediaData', value: { field: "epochTime", value: direction}} } + }; + + return fields[by]; +}; diff --git a/apps/mobile/src/navigation/BackfillWaitingStack.tsx b/apps/mobile/src/navigation/BackfillWaitingStack.tsx new file mode 100644 index 000000000..dcf772f23 --- /dev/null +++ b/apps/mobile/src/navigation/BackfillWaitingStack.tsx @@ -0,0 +1,26 @@ +import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; +import React from 'react'; +import BackfillWaiting from '~/screens/BackfillWaiting'; + +const Stack = createNativeStackNavigator(); + +export default function BackfillWaitingStack() { + return ( + + + + ); +} + +export type BackfillWaitingStackParamList = { + BackfillWaiting: undefined; +}; + +export type BackfillWaitingStackScreenProps = + NativeStackScreenProps; diff --git a/apps/mobile/src/navigation/SearchStack.tsx b/apps/mobile/src/navigation/SearchStack.tsx index 60ec90aa1..84139f37d 100644 --- a/apps/mobile/src/navigation/SearchStack.tsx +++ b/apps/mobile/src/navigation/SearchStack.tsx @@ -1,6 +1,8 @@ import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; import React from 'react'; +import DynamicHeader from '~/components/header/DynamicHeader'; import Header from '~/components/header/Header'; +import LocationScreen from '~/screens/browse/Location'; import FiltersScreen from '~/screens/search/Filters'; import SearchScreen from '~/screens/search/Search'; @@ -21,10 +23,18 @@ export default function SearchStack() { component={FiltersScreen} options={{ header: () => { - return
; + return
; } }} /> + {/** This screen is already in BrowseStack - but added here as it offers the UX needed */} + ({ + header: (route) => + })} + /> ); } @@ -32,6 +42,7 @@ export default function SearchStack() { export type SearchStackParamList = { Search: undefined; Filters: undefined; + Location: { id: number; path: string }; }; export type SearchStackScreenProps = diff --git a/apps/mobile/src/navigation/TabNavigator.tsx b/apps/mobile/src/navigation/TabNavigator.tsx index 2465ddd7c..ade069de2 100644 --- a/apps/mobile/src/navigation/TabNavigator.tsx +++ b/apps/mobile/src/navigation/TabNavigator.tsx @@ -9,6 +9,7 @@ import Rive, { RiveRef } from 'rive-react-native'; import { Style } from 'twrnc/dist/esm/types'; import { tw } from '~/lib/tailwind'; +import * as Haptics from 'expo-haptics'; import { RootStackParamList } from '.'; import BrowseStack, { BrowseStackParamList } from './tabs/BrowseStack'; import NetworkStack, { NetworkStackParamList } from './tabs/NetworkStack'; @@ -145,8 +146,9 @@ export default function TabNavigator() { })} listeners={() => ({ focus: () => { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); setActiveIndex(index); - } + }, })} /> ))} diff --git a/apps/mobile/src/navigation/index.tsx b/apps/mobile/src/navigation/index.tsx index 68bbb2630..39e9d190a 100644 --- a/apps/mobile/src/navigation/index.tsx +++ b/apps/mobile/src/navigation/index.tsx @@ -4,6 +4,7 @@ import NotFoundScreen from '~/screens/NotFound'; import DrawerNavigator, { DrawerNavParamList } from './DrawerNavigator'; import SearchStack, { SearchStackParamList } from './SearchStack'; +import BackfillWaitingStack, { BackfillWaitingStackParamList } from './BackfillWaitingStack'; const Stack = createNativeStackNavigator(); // This is the main navigator we nest everything under. @@ -20,6 +21,11 @@ export default function RootNavigator() { component={SearchStack} options={{ headerShown: false }} /> + ); @@ -28,6 +34,7 @@ export default function RootNavigator() { export type RootStackParamList = { Root: NavigatorScreenParams; SearchStack: NavigatorScreenParams; + BackfillWaitingStack: NavigatorScreenParams; NotFound: undefined; }; diff --git a/apps/mobile/src/navigation/tabs/BrowseStack.tsx b/apps/mobile/src/navigation/tabs/BrowseStack.tsx index 6c5091013..50ca85a84 100644 --- a/apps/mobile/src/navigation/tabs/BrowseStack.tsx +++ b/apps/mobile/src/navigation/tabs/BrowseStack.tsx @@ -1,6 +1,8 @@ import { CompositeScreenProps } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; +import DynamicHeader from '~/components/header/DynamicHeader'; import Header from '~/components/header/Header'; +import SearchHeader from '~/components/header/SearchHeader'; import BrowseScreen from '~/screens/browse/Browse'; import LibraryScreen from '~/screens/browse/Library'; import LocationScreen from '~/screens/browse/Location'; @@ -14,48 +16,58 @@ const Stack = createNativeStackNavigator(); export default function BrowseStack() { return ( - +
}} + options={({ route }) => ({ + header: () =>
+ })} /> ({ header: (route) => ( -
+ ) - }} + })} />
- }} + options={({ route }) => ({ + header: () => + })} />
- }} + options={({ route }) => ({ + header: () => + })} />
- }} + options={({ route: optionsRoute }) => ({ + header: (route) => ( + + ) + })} />
- }} + options={({ route }) => ({ + header: () =>
+ })} /> ); @@ -63,7 +75,7 @@ export default function BrowseStack() { export type BrowseStackParamList = { Browse: undefined; - Location: { id: number; path?: string }; + Location: { id: number; path?: string, name?: string }; Locations: undefined; Tag: { id: number; color: string }; Tags: undefined; diff --git a/apps/mobile/src/navigation/tabs/NetworkStack.tsx b/apps/mobile/src/navigation/tabs/NetworkStack.tsx index 6ef75cfd3..5bf8489d6 100644 --- a/apps/mobile/src/navigation/tabs/NetworkStack.tsx +++ b/apps/mobile/src/navigation/tabs/NetworkStack.tsx @@ -13,7 +13,9 @@ export default function NetworkStack() {
}} + options={({ route }) => ({ + header: () =>
+ })} /> ); diff --git a/apps/mobile/src/navigation/tabs/OverviewStack.tsx b/apps/mobile/src/navigation/tabs/OverviewStack.tsx index 3837d8e32..d5826a25c 100644 --- a/apps/mobile/src/navigation/tabs/OverviewStack.tsx +++ b/apps/mobile/src/navigation/tabs/OverviewStack.tsx @@ -1,6 +1,7 @@ import { CompositeScreenProps } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; import Header from '~/components/header/Header'; +import SearchHeader from '~/components/header/SearchHeader'; import CategoriesScreen from '~/screens/overview/Categories'; import OverviewScreen from '~/screens/overview/Overview'; @@ -14,14 +15,16 @@ export default function OverviewStack() {
}} + options={({ route }) => ({ + header: () =>
+ })} />
- }} + options={({ route }) => ({ + header: () => + })} /> ); diff --git a/apps/mobile/src/navigation/tabs/SettingsStack.tsx b/apps/mobile/src/navigation/tabs/SettingsStack.tsx index 7655a0764..8fb152147 100644 --- a/apps/mobile/src/navigation/tabs/SettingsStack.tsx +++ b/apps/mobile/src/navigation/tabs/SettingsStack.tsx @@ -3,6 +3,7 @@ import { CompositeScreenProps } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; import Header from '~/components/header/Header'; +import SearchHeader from '~/components/header/SearchHeader'; import AppearanceSettingsScreen from '~/screens/settings/client/AppearanceSettings'; import ExtensionsSettingsScreen from '~/screens/settings/client/ExtensionsSettings'; import GeneralSettingsScreen from '~/screens/settings/client/GeneralSettings'; @@ -11,10 +12,12 @@ import PrivacySettingsScreen from '~/screens/settings/client/PrivacySettings'; import AboutScreen from '~/screens/settings/info/About'; import DebugScreen from '~/screens/settings/info/Debug'; import SupportScreen from '~/screens/settings/info/Support'; +import CloudSettings from '~/screens/settings/library/CloudSettings/CloudSettings'; import EditLocationSettingsScreen from '~/screens/settings/library/EditLocationSettings'; import LibraryGeneralSettingsScreen from '~/screens/settings/library/LibraryGeneralSettings'; import LocationSettingsScreen from '~/screens/settings/library/LocationSettings'; import NodesSettingsScreen from '~/screens/settings/library/NodesSettings'; +import SyncSettingsScreen from '~/screens/settings/library/SyncSettings'; import TagsSettingsScreen from '~/screens/settings/library/TagsSettings'; import SettingsScreen from '~/screens/settings/Settings'; @@ -28,7 +31,9 @@ export default function SettingsStack() {
}} + options={({ route }) => ({ + header: () =>
+ })} /> {/* Client */}
- }} + options={() => ({ + header: () => + })} />
}} /> +
}} + /> +
}} + /> {/* { + const animation = useSharedValue(0); + const navigation = useNavigation(); + + useEffect(() => { + animation.value = withRepeat( + withTiming(1, { duration: 5000, easing: Easing.inOut(Easing.ease) }), + -1, + true + ); + }, [animation]); + + const animatedStyle = useAnimatedStyle(() => { + return { + opacity: animation.value + }; + }); + + const enableSync = useLibraryMutation(['sync.backfill'], { + onSuccess: () => { + syncEnabled.refetch(); + navigation.navigate('Root', { + screen: 'Home', + params: { + screen: 'SettingsStack', + params: { + screen: 'SyncSettings' + } + } + }); + } + }); + + const syncEnabled = useLibraryQuery(['sync.enabled']); + + useEffect(() => { + (async () => { + await enableSync.mutateAsync(null); + })(); + }, []); + + return ( + + + + + + + + + + + + + + + Library is being backfilled right now for Sync! + Please hold + while this process takes place. + + + ); +}; + +export default BackfillWaiting; diff --git a/apps/mobile/src/screens/browse/Browse.tsx b/apps/mobile/src/screens/browse/Browse.tsx index c970414a4..23b867f43 100644 --- a/apps/mobile/src/screens/browse/Browse.tsx +++ b/apps/mobile/src/screens/browse/Browse.tsx @@ -1,30 +1,13 @@ -import { CheckCircle } from 'phosphor-react-native'; -import React from 'react'; -import { useLibraryQuery } from '@sd/client'; -import { PulseAnimation } from '~/components/animation/lottie'; -import BrowseCategories from '~/components/browse/BrowseCategories'; import BrowseLocations from '~/components/browse/BrowseLocations'; import BrowseTags from '~/components/browse/BrowseTags'; -import Jobs from '~/components/browse/Jobs'; import ScreenContainer from '~/components/layout/ScreenContainer'; -import { tw } from '~/lib/tailwind'; - -function JobIcon() { - const { data: isActive } = useLibraryQuery(['jobs.isActive']); - return isActive ? ( - - ) : ( - - ); -} export default function BrowseScreen() { return ( - + {/* */} - ); } diff --git a/apps/mobile/src/screens/browse/Location.tsx b/apps/mobile/src/screens/browse/Location.tsx index 8dc0d1da5..e8984552d 100644 --- a/apps/mobile/src/screens/browse/Location.tsx +++ b/apps/mobile/src/screens/browse/Location.tsx @@ -1,6 +1,9 @@ -import { useEffect } from 'react'; -import { useCache, useLibraryQuery, useNodes, usePathsExplorerQuery } from '@sd/client'; +import { useLibraryQuery, useLibrarySubscription, usePathsExplorerQuery } from '@sd/client'; +import { useEffect, useMemo } from 'react'; import Explorer from '~/components/explorer/Explorer'; +import Empty from '~/components/layout/Empty'; +import { useSortBy } from '~/hooks/useSortBy'; +import { tw } from '~/lib/tailwind'; import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; import { getExplorerStore } from '~/stores/explorerStore'; @@ -8,13 +11,25 @@ export default function LocationScreen({ navigation, route }: BrowseStackScreenP const { id, path } = route.params; const location = useLibraryQuery(['locations.get', route.params.id]); - useNodes(location.data?.nodes); - const locationData = useCache(location.data?.item); + const locationData = location.data; + const order = useSortBy(); + const title = useMemo(() => { + return path?.split('/') + .filter((x) => x !== '') + .pop(); + }, [path]) + + // makes sure that the location shows newest/modified objects + // when a location is opened + useLibrarySubscription( + ['locations.quickRescan', { sub_path: path ?? '', location_id: id }], + { onData() {} } + ); const paths = usePathsExplorerQuery({ arg: { filters: [ - // ...search.allFilters, + { filePath: { hidden: false }}, { filePath: { locations: { in: [id] } } }, { filePath: { @@ -22,18 +37,13 @@ export default function LocationScreen({ navigation, route }: BrowseStackScreenP location_id: id, path: path ?? '', include_descendants: false - // include_descendants: - // search.search !== '' || - // search.dynamicFilters.length > 0 || - // (layoutMode === 'media' && mediaViewWithDescendants) } } } - // !showHiddenFiles && { filePath: { hidden: false } } ].filter(Boolean) as any, take: 30 }, - order: null, + order, onSuccess: () => getExplorerStore().resetNewThumbnails() }); @@ -42,22 +52,33 @@ export default function LocationScreen({ navigation, route }: BrowseStackScreenP if (path && path !== '') { // Nested location. navigation.setOptions({ - title: path - .split('/') - .filter((x) => x !== '') - .pop() + title }); } else { navigation.setOptions({ title: locationData?.name ?? 'Location' }); } - }, [locationData?.name, navigation, path]); + // sets params for handling when clicking on search within header + navigation.setParams({ + id: id, + name: locationData?.name ?? 'Location' + }) + }, [id, locationData?.name, navigation, path, title]); useEffect(() => { getExplorerStore().locationId = id; getExplorerStore().path = path ?? ''; }, [id, path]); - return ; + return } + {...paths} /> } diff --git a/apps/mobile/src/screens/browse/Locations.tsx b/apps/mobile/src/screens/browse/Locations.tsx index d90cf3546..7dc4327e2 100644 --- a/apps/mobile/src/screens/browse/Locations.tsx +++ b/apps/mobile/src/screens/browse/Locations.tsx @@ -1,9 +1,9 @@ import { useNavigation } from '@react-navigation/native'; +import { useLibraryQuery } from '@sd/client'; import { Plus } from 'phosphor-react-native'; import { useMemo, useRef } from 'react'; import { FlatList, Pressable, View } from 'react-native'; import { useDebounce } from 'use-debounce'; -import { useCache, useLibraryQuery, useNodes } from '@sd/client'; import Empty from '~/components/layout/Empty'; import { ModalRef } from '~/components/layout/Modal'; import ScreenContainer from '~/components/layout/ScreenContainer'; @@ -20,8 +20,7 @@ interface Props { export default function LocationsScreen({ viewStyle }: Props) { const locationsQuery = useLibraryQuery(['locations.list']); - useNodes(locationsQuery.data?.nodes); - const locations = useCache(locationsQuery.data?.items); + const locations = locationsQuery.data; const { search } = useSearchStore(); const modalRef = useRef(null); const [debouncedSearch] = useDebounce(search, 200); @@ -47,6 +46,7 @@ export default function LocationsScreen({ viewStyle }: Props) { > + @@ -85,6 +84,7 @@ export default function LocationsScreen({ viewStyle }: Props) { /> )} /> + ); diff --git a/apps/mobile/src/screens/browse/Tag.tsx b/apps/mobile/src/screens/browse/Tag.tsx index 6f8374565..0854c8217 100644 --- a/apps/mobile/src/screens/browse/Tag.tsx +++ b/apps/mobile/src/screens/browse/Tag.tsx @@ -1,26 +1,44 @@ +import { useLibraryQuery, usePathsExplorerQuery } from '@sd/client'; import { useEffect } from 'react'; -import { useCache, useLibraryQuery, useNodes, useObjectsExplorerQuery } from '@sd/client'; import Explorer from '~/components/explorer/Explorer'; +import Empty from '~/components/layout/Empty'; +import { tw } from '~/lib/tailwind'; import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; export default function TagScreen({ navigation, route }: BrowseStackScreenProps<'Tag'>) { const { id } = route.params; const tag = useLibraryQuery(['tags.get', id]); - useNodes(tag.data?.nodes); - const tagData = useCache(tag.data?.item); + const tagData = tag.data; - const objects = useObjectsExplorerQuery({ - arg: { filters: [{ object: { tags: { in: [id] } } }], take: 30 }, + const objects = usePathsExplorerQuery({ + arg: { filters: [ + { object: { tags: { in: [id] } } }, + ], take: 30 }, + enabled: typeof id === 'number', order: null }); useEffect(() => { // Set screen title to tag name. - navigation.setOptions({ - title: tagData?.name ?? 'Tag' - }); - }, [tagData?.name, navigation]); + if (tagData) { + navigation.setParams({ + id: tagData.id, + color: tagData.color as string + }) + navigation.setOptions({ + title: tagData.name ?? 'Tag', + }); + } + }, [tagData, id, navigation]); - return ; + return } {...objects} />; } diff --git a/apps/mobile/src/screens/browse/Tags.tsx b/apps/mobile/src/screens/browse/Tags.tsx index 50e694d89..fa89b6d57 100644 --- a/apps/mobile/src/screens/browse/Tags.tsx +++ b/apps/mobile/src/screens/browse/Tags.tsx @@ -1,29 +1,40 @@ import { useNavigation } from '@react-navigation/native'; +import { useLibraryQuery } from '@sd/client'; import { Plus } from 'phosphor-react-native'; -import { useRef } from 'react'; +import { useMemo, useRef } from 'react'; import { Pressable, View } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; -import { useCache, useLibraryQuery, useNodes } from '@sd/client'; +import { useDebounce } from 'use-debounce'; import Empty from '~/components/layout/Empty'; -import Fade from '~/components/layout/Fade'; import { ModalRef } from '~/components/layout/Modal'; import ScreenContainer from '~/components/layout/ScreenContainer'; import CreateTagModal from '~/components/modal/tag/CreateTagModal'; import { TagItem } from '~/components/tags/TagItem'; import { tw, twStyle } from '~/lib/tailwind'; import { BrowseStackScreenProps } from '~/navigation/tabs/BrowseStack'; +import { useSearchStore } from '~/stores/searchStore'; interface Props { viewStyle?: 'grid' | 'list'; } export default function TagsScreen({ viewStyle = 'list' }: Props) { - const tags = useLibraryQuery(['tags.list']); const navigation = useNavigation['navigation']>(); const modalRef = useRef(null); - useNodes(tags.data?.nodes); - const tagData = useCache(tags.data?.items); + const { search } = useSearchStore(); + const tags = useLibraryQuery(['tags.list']); + const tagsData = tags.data; + const [debouncedSearch] = useDebounce(search, 200); + + const filteredTags = useMemo( + () => + tagsData?.filter((location) => + location.name?.toLowerCase().includes(debouncedSearch.toLowerCase()) + ) ?? [], + [debouncedSearch, tagsData] + ); + return ( - - ( - { - navigation.navigate('BrowseStack', { - screen: 'Tag', - params: { id: item.id, color: item.color! } - }); - }} - /> - )} - ListEmptyComponent={ - - } - horizontal={false} - numColumns={viewStyle === 'grid' ? 3 : 1} - keyExtractor={(item) => item.id.toString()} - showsHorizontalScrollIndicator={false} - ItemSeparatorComponent={() => } - contentContainerStyle={twStyle( - `py-6`, - tagData.length === 0 && 'h-full items-center justify-center' - )} - /> - + + ( + { + navigation.navigate('BrowseStack', { + screen: 'Tag', + params: { id: item.id, color: item.color! } + }); + }} + /> + )} + ListEmptyComponent={ + + } + horizontal={false} + numColumns={viewStyle === 'grid' ? 3 : 1} + keyExtractor={(item) => item.id.toString()} + showsHorizontalScrollIndicator={false} + ItemSeparatorComponent={() => } + contentContainerStyle={twStyle( + 'py-6', + tagsData?.length === 0 && 'h-full items-center justify-center' + )} + /> + ); diff --git a/apps/mobile/src/screens/onboarding/GetStarted.tsx b/apps/mobile/src/screens/onboarding/GetStarted.tsx index ab50e9b9c..6b80a08ee 100644 --- a/apps/mobile/src/screens/onboarding/GetStarted.tsx +++ b/apps/mobile/src/screens/onboarding/GetStarted.tsx @@ -1,7 +1,8 @@ import { useNavigation, useRoute } from '@react-navigation/native'; import { AppLogo, BloomOne } from '@sd/assets/images'; -import { SdMobIntro } from '@sd/assets/videos'; +import SdMobIntro from '@sd/assets/videos/SdMobIntro.mp4'; import { ResizeMode, Video } from 'expo-av'; +import * as Haptics from 'expo-haptics'; import { Image } from 'expo-image'; import { MotiView } from 'moti'; import { CaretLeft } from 'phosphor-react-native'; @@ -111,7 +112,13 @@ const GetStartedScreen = ({ navigation }: OnboardingStackScreenProps<'GetStarted {/* Get Started Button */} - navigation.push('NewLibrary')}> + { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); + navigation.push('NewLibrary'); + }} + > Get Started diff --git a/apps/mobile/src/screens/onboarding/NewLibrary.tsx b/apps/mobile/src/screens/onboarding/NewLibrary.tsx index 68f22c1f7..d38cfa985 100644 --- a/apps/mobile/src/screens/onboarding/NewLibrary.tsx +++ b/apps/mobile/src/screens/onboarding/NewLibrary.tsx @@ -1,3 +1,4 @@ +import * as Haptics from 'expo-haptics'; import { Controller } from 'react-hook-form'; import { Alert, Text, View } from 'react-native'; import { useOnboardingContext } from '~/components/context/OnboardingContext'; @@ -12,7 +13,10 @@ import { OnboardingContainer, OnboardingDescription, OnboardingTitle } from './G const NewLibraryScreen = ({ navigation }: OnboardingStackScreenProps<'NewLibrary'>) => { const form = useOnboardingContext().forms.useForm('NewLibrary'); - const handleNewLibrary = form.handleSubmit(() => navigation.navigate('Privacy')); + const handleNewLibrary = form.handleSubmit(() => { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); + navigation.navigate('Privacy'); + }); const handleImport = () => { Alert.alert('TODO'); diff --git a/apps/mobile/src/screens/onboarding/Privacy.tsx b/apps/mobile/src/screens/onboarding/Privacy.tsx index cd9b7c908..de6623d0b 100644 --- a/apps/mobile/src/screens/onboarding/Privacy.tsx +++ b/apps/mobile/src/screens/onboarding/Privacy.tsx @@ -1,3 +1,4 @@ +import * as Haptics from 'expo-haptics'; import { ArrowRight } from 'phosphor-react-native'; import React from 'react'; import { Controller } from 'react-hook-form'; @@ -80,7 +81,15 @@ const PrivacyScreen = () => { )} /> - { return ( b.count - a.count).filter((i) => i.kind !== 0)} + data={filteredKinds + ?.sort((a, b) => { + const aCount = uint32ArrayToBigInt(a.count); + const bCount = uint32ArrayToBigInt(b.count); + if (aCount === bCount) return 0; + return aCount > bCount ? -1 : 1; + }) + .filter((i) => i.kind !== 0)} numColumns={3} contentContainerStyle={tw`py-6`} keyExtractor={(item) => item.name} @@ -46,7 +53,7 @@ const CategoriesScreen = () => { kind={kind} name={name} icon={icon} - items={count} + items={uint32ArrayToBigInt(count)} /> ); }} diff --git a/apps/mobile/src/screens/search/Filters.tsx b/apps/mobile/src/screens/search/Filters.tsx index d7cb48798..1de25e88f 100644 --- a/apps/mobile/src/screens/search/Filters.tsx +++ b/apps/mobile/src/screens/search/Filters.tsx @@ -5,8 +5,8 @@ import SaveAdd from '~/components/search/filters/SaveAdd'; const FiltersScreen = () => { return ( <> - - + + diff --git a/apps/mobile/src/screens/search/Search.tsx b/apps/mobile/src/screens/search/Search.tsx index 56ac99730..ef70a107e 100644 --- a/apps/mobile/src/screens/search/Search.tsx +++ b/apps/mobile/src/screens/search/Search.tsx @@ -1,10 +1,14 @@ -import { ArrowLeft, DotsThreeOutline, FunnelSimple, MagnifyingGlass } from 'phosphor-react-native'; -import { Suspense, useDeferredValue, useMemo, useState } from 'react'; +import { useIsFocused } from '@react-navigation/native'; +import { useLibraryQuery, usePathsExplorerQuery } from '@sd/client'; +import { ArrowLeft, DotsThree, FunnelSimple } from 'phosphor-react-native'; +import { Suspense, useDeferredValue, useState } from 'react'; import { ActivityIndicator, Platform, Pressable, TextInput, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { SearchFilterArgs, useObjectsExplorerQuery } from '@sd/client'; import Explorer from '~/components/explorer/Explorer'; +import Empty from '~/components/layout/Empty'; import FiltersBar from '~/components/search/filters/FiltersBar'; +import { useFiltersSearch } from '~/hooks/useFiltersSearch'; +import { useSortBy } from '~/hooks/useSortBy'; import { tw, twStyle } from '~/lib/tailwind'; import { SearchStackScreenProps } from '~/navigation/SearchStack'; import { getExplorerStore, useExplorerStore } from '~/stores/explorerStore'; @@ -12,48 +16,50 @@ import { useSearchStore } from '~/stores/searchStore'; const SearchScreen = ({ navigation }: SearchStackScreenProps<'Search'>) => { const headerHeight = useSafeAreaInsets().top; - const [loading, setLoading] = useState(false); const searchStore = useSearchStore(); const explorerStore = useExplorerStore(); - const appliedFiltersLength = useMemo( - () => Object.keys(searchStore.appliedFilters).length, - [searchStore.appliedFilters] - ); - const isAndroid = Platform.OS === 'android'; - + const isFocused = useIsFocused(); const [search, setSearch] = useState(''); const deferredSearch = useDeferredValue(search); + const order = useSortBy(); - const filters = useMemo(() => { - const [name, ext] = deferredSearch.split('.'); + const locations = useLibraryQuery(['locations.list']).data ?? []; - const filters: SearchFilterArgs[] = []; - - if (name) filters.push({ filePath: { name: { contains: name } } }); - if (ext) filters.push({ filePath: { extension: { in: [ext] } } }); - - return filters; - }, [deferredSearch]); - - const objects = useObjectsExplorerQuery({ + const objects = usePathsExplorerQuery({ + order, arg: { take: 30, - filters + filters: searchStore.mergedFilters, }, - order: null, + enabled: isFocused && searchStore.mergedFilters.length > 1, // only fetch when screen is focused & filters are applied suspense: true, - enabled: !!deferredSearch, onSuccess: () => getExplorerStore().resetNewThumbnails() }); + useFiltersSearch(deferredSearch); + + const appliedFiltersLength = Object.keys(searchStore.appliedFilters).length; + const isAndroid = Platform.OS === 'android'; + + // Check if there are no objects or no search + const noObjects = objects.items?.length === 0 || !objects.items; + const noSearch = deferredSearch.length === 0 && appliedFiltersLength === 0; + + const searchIcon = + locations.length > 0 && noObjects && noSearch ? 'FolderNoSpace' : + noSearch && noObjects ? 'Search' : 'FolderNoSpace'; + + const searchDescription = locations.length === 0 ? 'You have not added any locations to search' : noObjects + || noSearch ? 'No files found' : 'No results found for this search'; + return ( {/* Header */} - + {/* Search area input container */} {/* Back Button */} @@ -71,17 +77,6 @@ const SearchScreen = ({ navigation }: SearchStackScreenProps<'Search'>) => { style={tw`h-10 w-4/5 flex-wrap rounded-md border border-app-inputborder bg-app-input`} > - - {loading ? ( - - ) : ( - - )} - setSearch(t)} @@ -111,20 +106,34 @@ const SearchScreen = ({ navigation }: SearchStackScreenProps<'Search'>) => { getExplorerStore().toggleMenu = !explorerStore.toggleMenu; }} > - - {appliedFiltersLength > 0 && } + {appliedFiltersLength > 0 && } {/* Content */} }> - + + } + tabHeight={false} /> diff --git a/apps/mobile/src/screens/settings/Settings.tsx b/apps/mobile/src/screens/settings/Settings.tsx index 2579eafa8..0e3357517 100644 --- a/apps/mobile/src/screens/settings/Settings.tsx +++ b/apps/mobile/src/screens/settings/Settings.tsx @@ -1,5 +1,8 @@ +import { DebugState, useDebugState, useDebugStateEnabler } from '@sd/client'; import { + ArrowsClockwise, Books, + Cloud, FlyingSaucer, Gear, GearSix, @@ -14,7 +17,6 @@ import { } from 'phosphor-react-native'; import React from 'react'; import { Platform, SectionList, Text, TouchableWithoutFeedback, View } from 'react-native'; -import { DebugState, useDebugState, useDebugStateEnabler } from '@sd/client'; import ScreenContainer from '~/components/layout/ScreenContainer'; import { SettingsItem } from '~/components/settings/SettingsItem'; import { tw, twStyle } from '~/lib/tailwind'; @@ -86,6 +88,16 @@ const sections: (debugState: DebugState) => SectionType[] = (debugState) => [ icon: TagSimple, navigateTo: 'TagsSettings', title: 'Tags', + }, + { + icon: Cloud, + navigateTo: 'CloudSettings', + title: 'Cloud', + }, + { + icon: ArrowsClockwise, + navigateTo: 'SyncSettings', + title: 'Sync', rounded: 'bottom' } // { @@ -129,7 +141,7 @@ function renderSectionHeader({ section }: { section: { title: string } }) { {section.title} @@ -141,10 +153,10 @@ export default function SettingsScreen({ navigation }: SettingsStackScreenProps< const debugState = useDebugState(); return ( - + ( )} + scrollEnabled={false} renderSectionHeader={renderSectionHeader} ListFooterComponent={} showsVerticalScrollIndicator={false} diff --git a/apps/mobile/src/screens/settings/client/GeneralSettings.tsx b/apps/mobile/src/screens/settings/client/GeneralSettings.tsx index bcfa70823..ca7e6df26 100644 --- a/apps/mobile/src/screens/settings/client/GeneralSettings.tsx +++ b/apps/mobile/src/screens/settings/client/GeneralSettings.tsx @@ -1,5 +1,5 @@ -import { Text, View } from 'react-native'; import { useBridgeQuery, useDebugState } from '@sd/client'; +import { Text, View } from 'react-native'; import Card from '~/components/layout/Card'; import ScreenContainer from '~/components/layout/ScreenContainer'; import { Divider } from '~/components/primitive/Divider'; diff --git a/apps/mobile/src/screens/settings/client/LibrarySettings.tsx b/apps/mobile/src/screens/settings/client/LibrarySettings.tsx index 58dda7faf..99adaa819 100644 --- a/apps/mobile/src/screens/settings/client/LibrarySettings.tsx +++ b/apps/mobile/src/screens/settings/client/LibrarySettings.tsx @@ -1,9 +1,8 @@ +import { LibraryConfigWrapped, useBridgeQuery, useLibraryContext } from '@sd/client'; import { DotsThreeOutlineVertical, Pen, Trash } from 'phosphor-react-native'; import React, { useEffect, useRef } from 'react'; import { Animated, FlatList, Pressable, Text, View } from 'react-native'; import { Swipeable } from 'react-native-gesture-handler'; -import { LibraryConfigWrapped, useBridgeQuery, useCache, useNodes } from '@sd/client'; -import Fade from '~/components/layout/Fade'; import { ModalRef } from '~/components/layout/Modal'; import ScreenContainer from '~/components/layout/ScreenContainer'; import DeleteLibraryModal from '~/components/modal/confirmModals/DeleteLibraryModal'; @@ -14,10 +13,12 @@ import { SettingsStackScreenProps } from '~/navigation/tabs/SettingsStack'; function LibraryItem({ library, index, - navigation + navigation, + current }: { library: LibraryConfigWrapped; index: number; + current: boolean; navigation: SettingsStackScreenProps<'LibrarySettings'>['navigation']; }) { const renderRightActions = ( @@ -63,8 +64,15 @@ function LibraryItem({ > + {library.config.name} - {library.uuid} + {current && ( + + Current + + )} + + {library.uuid} swipeRef.current?.openRight()}> ) => { const libraryList = useBridgeQuery(['library.list']); - useNodes(libraryList.data?.nodes); - const libraries = useCache(libraryList.data?.items); + const libraries = libraryList.data; + const { library } = useLibraryContext(); useEffect(() => { navigation.setOptions({ @@ -102,22 +110,19 @@ const LibrarySettingsScreen = ({ navigation }: SettingsStackScreenProps<'Library return ( - item.uuid} renderItem={({ item, index }) => ( - + )} /> - ); }; diff --git a/apps/mobile/src/screens/settings/info/About.tsx b/apps/mobile/src/screens/settings/info/About.tsx index 71550e2e9..445dfe577 100644 --- a/apps/mobile/src/screens/settings/info/About.tsx +++ b/apps/mobile/src/screens/settings/info/About.tsx @@ -1,8 +1,8 @@ +import { useBridgeQuery } from '@sd/client'; import { Image } from 'expo-image'; import { Globe } from 'phosphor-react-native'; import React from 'react'; import { Linking, Platform, Text, View } from 'react-native'; -import { useBridgeQuery } from '@sd/client'; import { DiscordIcon, GitHubIcon } from '~/components/icons/Brands'; import ScreenContainer from '~/components/layout/ScreenContainer'; import { Button } from '~/components/primitive/Button'; @@ -98,7 +98,7 @@ const AboutScreen = () => { diff --git a/apps/mobile/src/screens/settings/info/Debug.tsx b/apps/mobile/src/screens/settings/info/Debug.tsx index 83a5f5973..994aae7c0 100644 --- a/apps/mobile/src/screens/settings/info/Debug.tsx +++ b/apps/mobile/src/screens/settings/info/Debug.tsx @@ -1,6 +1,14 @@ +import { useQueryClient } from '@tanstack/react-query'; import React from 'react'; import { Text, View } from 'react-native'; -import { toggleFeatureFlag, useDebugState, useFeatureFlags } from '@sd/client'; +import { + auth, + toggleFeatureFlag, + useBridgeMutation, + useBridgeQuery, + useDebugState, + useFeatureFlags +} from '@sd/client'; import Card from '~/components/layout/Card'; import { Button } from '~/components/primitive/Button'; import { tw } from '~/lib/tailwind'; @@ -9,6 +17,10 @@ import { SettingsStackScreenProps } from '~/navigation/tabs/SettingsStack'; const DebugScreen = ({ navigation }: SettingsStackScreenProps<'Debug'>) => { const debugState = useDebugState(); const featureFlags = useFeatureFlags(); + const origin = useBridgeQuery(['cloud.getApiOrigin']); + const setOrigin = useBridgeMutation(['cloud.setApiOrigin']); + + const queryClient = useQueryClient(); return ( @@ -28,6 +40,37 @@ const DebugScreen = ({ navigation }: SettingsStackScreenProps<'Debug'>) => { > Disable Debug Mode + + + ); diff --git a/apps/mobile/src/screens/settings/library/CloudSettings/CloudSettings.tsx b/apps/mobile/src/screens/settings/library/CloudSettings/CloudSettings.tsx new file mode 100644 index 000000000..b904005bd --- /dev/null +++ b/apps/mobile/src/screens/settings/library/CloudSettings/CloudSettings.tsx @@ -0,0 +1,123 @@ +import { useLibraryContext, useLibraryMutation, useLibraryQuery } from '@sd/client'; +import { useMemo } from 'react'; +import { ActivityIndicator, FlatList, Text, View } from 'react-native'; +import Card from '~/components/layout/Card'; +import Empty from '~/components/layout/Empty'; +import ScreenContainer from '~/components/layout/ScreenContainer'; +import VirtualizedListWrapper from '~/components/layout/VirtualizedListWrapper'; +import { Button } from '~/components/primitive/Button'; +import { Divider } from '~/components/primitive/Divider'; +import { styled, tw, twStyle } from '~/lib/tailwind'; +import { useAuthStateSnapshot } from '~/stores/auth'; + +import Instance from './Instance'; +import Library from './Library'; +import Login from './Login'; +import ThisInstance from './ThisInstance'; + +export const InfoBox = styled(View, 'rounded-md border gap-1 border-app bg-transparent p-2'); + +const CloudSettings = () => { + return ( + + + + ); +}; + +const AuthSensitiveChild = () => { + const authState = useAuthStateSnapshot(); + if (authState.status === 'loggedIn') return ; + if (authState.status === 'notLoggedIn' || authState.status === 'loggingIn') return ; + + return null; +}; + +const Authenticated = () => { + const { library } = useLibraryContext(); + const cloudLibrary = useLibraryQuery(['cloud.library.get'], { retry: false }); + const createLibrary = useLibraryMutation(['cloud.library.create']); + + const cloudInstances = useMemo( + () => + cloudLibrary.data?.instances.filter( + (instance) => instance.uuid !== library.instance_id + ), + [cloudLibrary.data, library.instance_id] + ); + + if (cloudLibrary.isLoading) { + return ( + + + + ); + } + + return ( + + {cloudLibrary.data ? ( + + + + + + + + {cloudInstances?.length} + + + Instances + + + + + } + contentContainerStyle={twStyle( + cloudInstances?.length === 0 && 'flex-row' + )} + showsHorizontalScrollIndicator={false} + ItemSeparatorComponent={() => } + renderItem={({ item }) => ( + + )} + keyExtractor={(item) => item.id} + numColumns={1} + /> + + + + ) : ( + + + + )} + + ); +}; + +export default CloudSettings; diff --git a/apps/mobile/src/screens/settings/library/CloudSettings/Instance.tsx b/apps/mobile/src/screens/settings/library/CloudSettings/Instance.tsx new file mode 100644 index 000000000..81538e826 --- /dev/null +++ b/apps/mobile/src/screens/settings/library/CloudSettings/Instance.tsx @@ -0,0 +1,59 @@ +import { CloudInstance, HardwareModel } from '@sd/client'; +import { Text, View } from 'react-native'; +import { tw } from '~/lib/tailwind'; + +import { Icon } from '~/components/icons/Icon'; +import { hardwareModelToIcon } from '~/components/overview/Devices'; +import { InfoBox } from './CloudSettings'; + +interface Props { + data: CloudInstance; +} + +const Instance = ({ data }: Props) => { + return ( + + + + + + {data.metadata.name} + + + Id: + + {data.id} + + + + + + + + UUID: + + {data.uuid} + + + + + + + + Public key: + + {data.identity} + + + + + + ); +}; + +export default Instance; diff --git a/apps/mobile/src/screens/settings/library/CloudSettings/Library.tsx b/apps/mobile/src/screens/settings/library/CloudSettings/Library.tsx new file mode 100644 index 000000000..876007b1f --- /dev/null +++ b/apps/mobile/src/screens/settings/library/CloudSettings/Library.tsx @@ -0,0 +1,66 @@ +import { CloudLibrary, useLibraryContext, useLibraryMutation } from '@sd/client'; +import { CheckCircle, XCircle } from 'phosphor-react-native'; +import { useMemo } from 'react'; +import { Text, View } from 'react-native'; +import Card from '~/components/layout/Card'; +import { Button } from '~/components/primitive/Button'; +import { Divider } from '~/components/primitive/Divider'; +import { SettingsTitle } from '~/components/settings/SettingsContainer'; +import { tw } from '~/lib/tailwind'; +import { logout, useAuthStateSnapshot } from '~/stores/auth'; + +import { InfoBox } from './CloudSettings'; + +interface LibraryProps { + cloudLibrary?: CloudLibrary; +} + +const Library = ({ cloudLibrary }: LibraryProps) => { + const authState = useAuthStateSnapshot(); + const { library } = useLibraryContext(); + const syncLibrary = useLibraryMutation(['cloud.library.sync']); + const thisInstance = useMemo( + () => cloudLibrary?.instances.find((instance) => instance.uuid === library.instance_id), + [cloudLibrary, library.instance_id] + ); + + return ( + + + Library + {authState.status === 'loggedIn' && ( + + )} + + + Name + + {cloudLibrary?.name} + + + + ); +}; + +export default Library; diff --git a/apps/mobile/src/screens/settings/library/CloudSettings/Login.tsx b/apps/mobile/src/screens/settings/library/CloudSettings/Login.tsx new file mode 100644 index 000000000..f993c968f --- /dev/null +++ b/apps/mobile/src/screens/settings/library/CloudSettings/Login.tsx @@ -0,0 +1,40 @@ +import { Text, View } from 'react-native'; +import Card from '~/components/layout/Card'; +import { Button } from '~/components/primitive/Button'; +import { tw } from '~/lib/tailwind'; +import { cancel, login, useAuthStateSnapshot } from '~/stores/auth'; + +const Login = () => { + const authState = useAuthStateSnapshot(); + const buttonText = { + notLoggedIn: 'Login', + loggingIn: 'Cancel' + }; + return ( + + + + To access cloud related features, please login + + {(authState.status === 'notLoggedIn' || authState.status === 'loggingIn') && ( + + )} + + + ); +}; + +export default Login; diff --git a/apps/mobile/src/screens/settings/library/CloudSettings/ThisInstance.tsx b/apps/mobile/src/screens/settings/library/CloudSettings/ThisInstance.tsx new file mode 100644 index 000000000..e17d00f0c --- /dev/null +++ b/apps/mobile/src/screens/settings/library/CloudSettings/ThisInstance.tsx @@ -0,0 +1,70 @@ +import { CloudLibrary, HardwareModel, useLibraryContext } from '@sd/client'; +import { useMemo } from 'react'; +import { Text, View } from 'react-native'; +import Card from '~/components/layout/Card'; +import { Divider } from '~/components/primitive/Divider'; +import { tw } from '~/lib/tailwind'; + +import { Icon } from '~/components/icons/Icon'; +import { hardwareModelToIcon } from '~/components/overview/Devices'; +import { InfoBox } from './CloudSettings'; + +interface ThisInstanceProps { + cloudLibrary?: CloudLibrary; +} + +const ThisInstance = ({ cloudLibrary }: ThisInstanceProps) => { + const { library } = useLibraryContext(); + const thisInstance = useMemo( + () => cloudLibrary?.instances.find((instance) => instance.uuid === library.instance_id), + [cloudLibrary, library.instance_id] + ); + + if (!thisInstance) return null; + + return ( + + + This Instance + + + + + {thisInstance.metadata.name} + + + + + Id: + {thisInstance.id} + + + + + + + UUID: + {thisInstance.uuid} + + + + + + + Publc Key: + + {thisInstance.identity} + + + + + + ); +}; + +export default ThisInstance; diff --git a/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx b/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx index bbe829a3e..10298fc71 100644 --- a/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx +++ b/apps/mobile/src/screens/settings/library/EditLocationSettings.tsx @@ -4,7 +4,7 @@ import { useEffect } from 'react'; import { Controller } from 'react-hook-form'; import { Alert, Text, View } from 'react-native'; import { z } from 'zod'; -import { useLibraryMutation, useLibraryQuery, useNormalisedCache, useZodForm } from '@sd/client'; +import { useLibraryMutation, useLibraryQuery, useZodForm } from '@sd/client'; import ScreenContainer from '~/components/layout/ScreenContainer'; import { AnimatedButton } from '~/components/primitive/Button'; import { Divider } from '~/components/primitive/Divider'; @@ -33,7 +33,6 @@ const EditLocationSettingsScreen = ({ const { id } = route.params; const queryClient = useQueryClient(); - const cache = useNormalisedCache(); const form = useZodForm({ schema }); @@ -42,7 +41,7 @@ const EditLocationSettingsScreen = ({ onSuccess: () => { form.reset(form.getValues()); queryClient.invalidateQueries(['locations.list']); - toast({ type: 'success', text: 'Location updated!' }); + toast.success('Location updated!'); // TODO: navigate back & reset input focus! } }); @@ -92,10 +91,7 @@ const EditLocationSettingsScreen = ({ }, [form, navigation, onSubmit]); useLibraryQuery(['locations.getWithRules', id], { - onSuccess: (dataRaw) => { - cache.withNodes(dataRaw?.nodes); - const data = cache.withCache(dataRaw?.item); - + onSuccess: (data) => { if (data && !form.formState.isDirty) form.reset({ displayName: data.name, diff --git a/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx b/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx index d423426a7..e849d0382 100644 --- a/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx +++ b/apps/mobile/src/screens/settings/library/LibraryGeneralSettings.tsx @@ -34,7 +34,7 @@ const LibraryGeneralSettingsScreen = (_: SettingsStackScreenProps<'LibraryGenera useAutoForm(form, (value) => { editLibrary({ description: value.description, name: value.name, id: library.uuid }); // console.log('Updated', value); - toast({ type: 'success', text: 'Library updated!' }); + toast.success('Library updated!'); }); return ( diff --git a/apps/mobile/src/screens/settings/library/SyncSettings.tsx b/apps/mobile/src/screens/settings/library/SyncSettings.tsx new file mode 100644 index 000000000..079ac57d7 --- /dev/null +++ b/apps/mobile/src/screens/settings/library/SyncSettings.tsx @@ -0,0 +1,133 @@ +import { inferSubscriptionResult } from '@oscartbeaumont-sd/rspc-client'; +import { + Procedures, + useLibraryMutation, + useLibraryQuery, + useLibrarySubscription +} from '@sd/client'; +import { MotiView } from 'moti'; +import { Circle } from 'phosphor-react-native'; +import React, { useEffect, useState } from 'react'; +import { Text, View } from 'react-native'; +import Card from '~/components/layout/Card'; +import ScreenContainer from '~/components/layout/ScreenContainer'; +import { Button } from '~/components/primitive/Button'; +import { tw } from '~/lib/tailwind'; +import { SettingsStackScreenProps } from '~/navigation/tabs/SettingsStack'; + +const SyncSettingsScreen = ({ navigation }: SettingsStackScreenProps<'SyncSettings'>) => { + const syncEnabled = useLibraryQuery(['sync.enabled']); + const [data, setData] = useState>({}); + + const [startBackfill, setStart] = useState(false); + + useLibrarySubscription(['library.actors'], { onData: setData }); + + useEffect(() => { + if (startBackfill === true) { + navigation.navigate('BackfillWaitingStack', { + screen: 'BackfillWaiting' + }); + } + }, [startBackfill, navigation]); + + return ( + + {syncEnabled.data === false ? ( + + + + + + ) : ( + + {Object.keys(data).map((key) => { + return ( + + + + {key} + + {data[key] ? : } + + ); + })} + + )} + + ); +}; + +export default SyncSettingsScreen; + +function OnlineIndicator({ online }: { online: boolean }) { + const size = 6; + return ( + + {online ? ( + + + + + ) : ( + + )} + + ); +} + +function StartButton({ name }: { name: string }) { + const startActor = useLibraryMutation(['library.startActor']); + return ( + + ); +} + +function StopButton({ name }: { name: string }) { + const stopActor = useLibraryMutation(['library.stopActor']); + return ( + + ); +} diff --git a/apps/mobile/src/stores/auth.ts b/apps/mobile/src/stores/auth.ts new file mode 100644 index 000000000..665a5b3d9 --- /dev/null +++ b/apps/mobile/src/stores/auth.ts @@ -0,0 +1,100 @@ +import { RSPCError } from '@oscartbeaumont-sd/rspc-client'; +import { nonLibraryClient, useSolidStore } from '@sd/client'; +import { Linking } from 'react-native'; +import { createMutable } from 'solid-js/store'; + +interface Store { + state: { status: 'loading' | 'notLoggedIn' | 'loggingIn' | 'loggedIn' | 'loggingOut' }; +} + +// inner object so we can overwrite it in one assignment +const store = createMutable({ + state: { + status: 'loading' + } +}); + +export function useAuthStateSnapshot() { + return useSolidStore(store).state; +} + +nonLibraryClient + .query(['auth.me']) + .then(() => (store.state = { status: 'loggedIn' })) + .catch((e) => { + if (e instanceof RSPCError && e.code === 401) { + // TODO: handle error? + console.error("error", e); + } + store.state = { status: 'notLoggedIn' }; + }); + +type CallbackStatus = 'success' | { error: string } | 'cancel'; +const loginCallbacks = new Set<(status: CallbackStatus) => void>(); + +function onError(error: string) { + loginCallbacks.forEach((cb) => cb({ error })); +} + +export function login() { + if (store.state.status !== 'notLoggedIn') return; + + store.state = { status: 'loggingIn' }; + + let authCleanup = nonLibraryClient.addSubscription(['auth.loginSession'], { + onData(data) { + if (data === 'Complete') { + loginCallbacks.forEach((cb) => cb('success')); + } else if ('Error' in data) { + console.error('[auth] error: ', data.Error); + onError(data.Error); + } else { + console.log('[auth] verification url: ', data.Start.verification_url_complete); + Promise.resolve() + .then(() => Linking.openURL(data.Start.verification_url_complete)) + .then( + (res) => { + authCleanup = res; + }, + (e) => onError(e.message) + ); + } + }, + onError(e) { + onError(e.message); + } + }); + + return new Promise((res, rej) => { + const cb = async (status: CallbackStatus) => { + loginCallbacks.delete(cb); + + if (status === 'success') { + store.state = { status: 'loggedIn' }; + nonLibraryClient.query(['auth.me']); + res(); + } else { + store.state = { status: 'notLoggedIn' }; + rej(JSON.stringify(status)); + } + }; + loginCallbacks.add(cb); + }); +} + +export function set_logged_in() { + store.state = { status: 'loggedIn' }; +} + +export function logout() { + store.state = { status: 'loggingOut' }; + nonLibraryClient.mutation(['auth.logout']); + nonLibraryClient.query(['auth.me']); + store.state = { status: 'notLoggedIn' }; +} + +export async function cancel() { + await loginCallbacks.forEach(async (cb) => await cb('cancel')); + await loginCallbacks.clear(); + store.state = { status: 'notLoggedIn' }; +} diff --git a/apps/mobile/src/stores/explorerStore.ts b/apps/mobile/src/stores/explorerStore.ts index 365930946..a5019fb39 100644 --- a/apps/mobile/src/stores/explorerStore.ts +++ b/apps/mobile/src/stores/explorerStore.ts @@ -1,6 +1,6 @@ +import { ThumbKey, resetStore } from '@sd/client'; import { proxy, useSnapshot } from 'valtio'; import { proxySet } from 'valtio/utils'; -import { resetStore } from '@sd/client'; export type ExplorerLayoutMode = 'list' | 'grid' | 'media'; @@ -17,31 +17,33 @@ const state = { toggleMenu: false as boolean, // Using gridNumColumns instead of fixed size. We dynamically calculate the item size. gridNumColumns: 3, - listItemSize: 65, - newThumbnails: proxySet() as Set + listItemSize: 60, + newThumbnails: proxySet() as Set, + // sorting + // we will display different sorting options based on the kind of explorer we are in + sortType: 'filePath' as 'filePath' | 'object' | 'ephemeral', + orderKey: 'name', + orderDirection: 'Asc' as 'Asc' | 'Desc' }; -export function flattenThumbnailKey(thumbKey: string[]) { - return thumbKey.join('/'); +export function flattenThumbnailKey(thumbKey: ThumbKey) { + return `${thumbKey.base_directory_str}/${thumbKey.shard_hex}/${thumbKey.cas_id}`; } -const explorerStore = proxy({ +const store = proxy({ ...state, - reset: () => resetStore(explorerStore, state), - addNewThumbnail: (thumbKey: string[]) => { - explorerStore.newThumbnails.add(flattenThumbnailKey(thumbKey)); + reset: () => resetStore(store, state), + addNewThumbnail: (thumbKey: ThumbKey) => { + store.newThumbnails.add(flattenThumbnailKey(thumbKey)); }, // this should be done when the explorer query is refreshed // prevents memory leak resetNewThumbnails: () => { - explorerStore.newThumbnails.clear(); + store.newThumbnails.clear(); } }); -export function useExplorerStore() { - return useSnapshot(explorerStore); -} - -export function getExplorerStore() { - return explorerStore; -} +/** for reading */ +export const useExplorerStore = () => useSnapshot(store); +/** for writing */ +export const getExplorerStore = () => store; diff --git a/apps/mobile/src/stores/modalStore.ts b/apps/mobile/src/stores/modalStore.ts index c3e332e59..dcd87151b 100644 --- a/apps/mobile/src/stores/modalStore.ts +++ b/apps/mobile/src/stores/modalStore.ts @@ -1,16 +1,17 @@ +import { ExplorerItem } from '@sd/client'; import { createRef } from 'react'; import { proxy, ref, useSnapshot } from 'valtio'; -import { ExplorerItem } from '@sd/client'; import { ModalRef } from '~/components/layout/Modal'; -export const actionsModalStore = proxy({ +const store = proxy({ modalRef: ref(createRef()), data: null as ExplorerItem | null, setData: (data: ExplorerItem) => { - actionsModalStore.data = data; + store.data = data; } }); -export function useActionsModalStore() { - return useSnapshot(actionsModalStore); -} +/** for reading */ +export const useActionsModalStore = () => useSnapshot(store); +/** for writing */ +export const getActionsModalStore = () => store; diff --git a/apps/mobile/src/stores/searchStore.ts b/apps/mobile/src/stores/searchStore.ts index cffa96f60..1ae39ec20 100644 --- a/apps/mobile/src/stores/searchStore.ts +++ b/apps/mobile/src/stores/searchStore.ts @@ -1,7 +1,20 @@ +import { SearchFilterArgs } from '@sd/client'; import { proxy, useSnapshot } from 'valtio'; import { IconName } from '~/components/icons/Icon'; export type SearchFilters = 'locations' | 'tags' | 'name' | 'extension' | 'hidden' | 'kind'; +export type SortOptionsType = { + by: + | 'none' + | 'name' + | 'sizeInBytes' + | 'dateIndexed' + | 'dateCreated' + | 'dateModified' + | 'dateAccessed' + | 'dateTaken'; + direction: 'Asc' | 'Desc'; +}; export interface FilterItem { id: number; @@ -19,29 +32,21 @@ export interface KindItem { icon: IconName; } +export interface Filters { + locations: FilterItem[]; + tags: TagItem[]; + name: string[]; + extension: string[]; + hidden: boolean; + kind: KindItem[]; +} + interface State { search: string; - filters: { - locations: FilterItem[]; - tags: TagItem[]; - name: string[]; - extension: string[]; - hidden: boolean; - kind: KindItem[]; - }; - appliedFilters: Partial< - Record< - SearchFilters, - { - locations: FilterItem[]; - tags: TagItem[]; - name: string[]; - extension: string[]; - hidden: boolean; - kind: KindItem[]; - } - > - >; + filters: Filters; + sort: SortOptionsType; + appliedFilters: Partial; + mergedFilters: SearchFilterArgs[]; disableActionButtons: boolean; } @@ -55,7 +60,12 @@ const initialState: State = { hidden: false, kind: [] }, + sort: { + by: 'none', + direction: 'Asc' + }, appliedFilters: {}, + mergedFilters: [], disableActionButtons: true }; @@ -64,7 +74,7 @@ function updateArrayOrObject( array: T[], item: any, filterByKey: string = 'id', - isObject: boolean = false + isObject: boolean = false, ): T[] { if (isObject) { const index = (array as any).findIndex((i: any) => i.id === item[filterByKey]); @@ -83,11 +93,15 @@ const searchStore = proxy< State & { updateFilters: ( filter: K, - value: State['filters'][K] extends Array ? U : State['filters'][K] + value: State['filters'][K] extends Array ? U : State['filters'][K], + apply?: boolean, + keepSame?: boolean ) => void; + searchFrom: (filter: 'tags' | 'locations', value: TagItem | FilterItem) => void; applyFilters: () => void; setSearch: (search: string) => void; resetFilter: (filter: K, apply?: boolean) => void; + resetFilters: () => void; setInput: (index: number, value: string, key: 'name' | 'extension') => void; addInput: (key: 'name' | 'extension') => void; removeInput: (index: number, key: 'name' | 'extension') => void; @@ -95,14 +109,16 @@ const searchStore = proxy< >({ ...initialState, //for updating the filters upon value selection - updateFilters: (filter, value) => { + updateFilters: (filter, value, apply = false) => { + const currentFilter = searchStore.filters[filter]; + const arrayCheck = Array.isArray(currentFilter); + if (filter === 'hidden') { // Directly assign boolean values without an array operation searchStore.filters['hidden'] = value as boolean; } else { // Handle array-based filters with more specific type handling - const currentFilter = searchStore.filters[filter]; - if (Array.isArray(currentFilter)) { + if (arrayCheck) { // Cast to the correct type based on the filter being updated const updatedFilter = updateArrayOrObject( currentFilter, @@ -113,6 +129,24 @@ const searchStore = proxy< searchStore.filters[filter] = updatedFilter; } } + //instead of a useEffect or subscription - we can call applyFilters directly + // useful when you want to apply the filters from another screen + if (apply) searchStore.applyFilters(); + }, + searchFrom: (filter, value) => { + //reset state first + searchStore.resetFilters(); + //update the filter with the value + switch (filter) { + case 'locations': + searchStore.filters[filter] = [value] as FilterItem[] + break; + case 'tags': + searchStore.filters[filter] = [value] as TagItem[] + break; + } + //apply the filters so it shows in the UI + searchStore.applyFilters(); }, //for clicking add filters and applying the selection applyFilters: () => { @@ -120,8 +154,9 @@ const searchStore = proxy< searchStore.appliedFilters = Object.entries(searchStore.filters).reduce( (acc, [key, value]) => { if (Array.isArray(value)) { - if (value.length > 0 && value[0] !== '') { - acc[key as SearchFilters] = value.filter((v) => v !== ''); // Remove empty values i.e empty inputs + const realValues = value.filter((v) => v !== ''); + if (realValues.length > 0) { + acc[key as SearchFilters] = realValues; } } else if (typeof value === 'boolean') { // Only apply the hidden filter if it's true @@ -144,7 +179,9 @@ const searchStore = proxy< //instead of a useEffect or subscription - we can call applyFilters directly if (apply) searchStore.applyFilters(); }, - + resetFilters: () => { + searchStore.filters = { ...initialState.filters }; + }, setInput: (index, value, key) => { const newValues = [...searchStore.filters[key]]; newValues[index] = value; @@ -161,10 +198,7 @@ const searchStore = proxy< } }); -export function useSearchStore() { - return useSnapshot(searchStore); -} - -export function getSearchStore() { - return searchStore; -} +/** for reading */ +export const useSearchStore = () => useSnapshot(searchStore); +/** for writing */ +export const getSearchStore = () => searchStore; diff --git a/apps/mobile/tests/add-tag.yml b/apps/mobile/tests/add-tag.yml index 893545b0e..9eb1236f6 100644 --- a/apps/mobile/tests/add-tag.yml +++ b/apps/mobile/tests/add-tag.yml @@ -5,10 +5,10 @@ appId: com.spacedrive.app id: 'browse-tab' - waitForAnimationToEnd - tapOn: - id: 'navigate-tags-screen' -- tapOn: - id: 'create-tag-modal' + id: 'create-tag-button' - inputText: 'MyTag' - tapOn: text: 'Create' +- tapOn: + id: 'show-all-tags-button' - assertVisible: 'MyTag' diff --git a/apps/p2p-relay/Cargo.toml b/apps/p2p-relay/Cargo.toml index d79d7bed9..9585b7bb7 100644 --- a/apps/p2p-relay/Cargo.toml +++ b/apps/p2p-relay/Cargo.toml @@ -7,7 +7,7 @@ edition.workspace = true repository.workspace = true [dependencies] -hex.workspace = true +# Workspace dependencies libp2p = { version = "0.53.2", features = [ "tokio", "quic", @@ -15,10 +15,13 @@ libp2p = { version = "0.53.2", features = [ "autonat", "macros", ] } -reqwest = { workspace = true, features = ["json"] } +reqwest = { workspace = true, features = ["json", "native-tls-vendored"] } serde = { workspace = true, features = ["derive"] } -serde_json.workspace = true +serde_json = { workspace = true } tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } -tracing.workspace = true -tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true, features = ["env-filter"] } uuid = { workspace = true, features = ["serde", "v4"] } + +# Specific P2P Relay dependencies +hex = "0.4.3" diff --git a/apps/p2p-relay/deploy.sh b/apps/p2p-relay/deploy.sh index 096394879..78dd7b558 100755 --- a/apps/p2p-relay/deploy.sh +++ b/apps/p2p-relay/deploy.sh @@ -3,10 +3,13 @@ set -e -SERVER="54.176.132.155" +SERVER="" TARGET_DIR=$(cargo metadata | jq -r .target_directory) cargo zigbuild --target aarch64-unknown-linux-musl --release -echo "$TARGET_DIR/aarch64-unknown-linux-musl/release/sd-p2p-relay" - scp "$TARGET_DIR/aarch64-unknown-linux-musl/release/sd-p2p-relay" ec2-user@$SERVER:/home/ec2-user/sd-p2p-relay + +# ssh ec2-user@$SERVER +# ./sd-p2p-relay init +# Enter the `P2P_SECRET` secret env var from Vercel +# ./sd-p2p-relay diff --git a/apps/server/Cargo.toml b/apps/server/Cargo.toml index 654fcc0fc..9c98729fe 100644 --- a/apps/server/Cargo.toml +++ b/apps/server/Cargo.toml @@ -14,15 +14,16 @@ ai-models = ["sd-core/ai"] # Spacedrive Sub-crates sd-core = { path = "../../core", features = ["ffmpeg", "heif"] } +# Workspace dependencies axum = { workspace = true, features = ["headers"] } +base64 = { workspace = true } http = { workspace = true } rspc = { workspace = true, features = ["axum"] } +tempfile = { workspace = true } tokio = { workspace = true, features = ["sync", "rt-multi-thread", "signal"] } tracing = { workspace = true } -base64 = { workspace = true } - -tempfile = "3.10.1" +# Specific Desktop dependencies include_dir = "0.7.3" -mime_guess = "2.0.4" +mime_guess = "2.0" secstr = "0.5.1" diff --git a/apps/server/docker/Dockerfile b/apps/server/docker/Dockerfile index c19c2ecff..3c2d7393a 100644 --- a/apps/server/docker/Dockerfile +++ b/apps/server/docker/Dockerfile @@ -21,7 +21,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/ FROM base as build-base RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \ - apt-get install build-essential git sudo unzip wget curl + apt-get install build-essential git sudo unzip wget curl python3 python-is-python3 RUN wget -qO- https://get.pnpm.io/install.sh | env SHELL=bash PNPM_HOME=/usr/share/pnpm sh - @@ -29,7 +29,7 @@ ENV PNPM_HOME="/usr/share/pnpm" \ PATH="/usr/share/pnpm:$PATH" RUN pnpm env use --global latest -RUN pnpm add -g pnpm@latest-8 +RUN pnpm add -g pnpm@latest-9 WORKDIR /srv @@ -111,9 +111,15 @@ ADD --chmod=755 --checksum=sha256:1d127c69218f2cd14964036f2b057c4b2652cda3996c69 COPY --chmod=755 entrypoint.sh /usr/bin/ +# P2P config +ENV SD_DOCKER=true + # Expose webserver EXPOSE 8080 +# Expose P2P +EXPOSE 7373 + # Create the data directory to store the database VOLUME [ "/data" ] diff --git a/apps/server/src/main.rs b/apps/server/src/main.rs index 0c96b46d0..f1df4dab7 100644 --- a/apps/server/src/main.rs +++ b/apps/server/src/main.rs @@ -4,7 +4,7 @@ use axum::{ extract::{FromRequestParts, State}, headers::{authorization::Basic, Authorization}, http::Request, - middleware::{self, Next}, + middleware::Next, response::{IntoResponse, Response}, routing::get, TypedHeader, @@ -24,12 +24,13 @@ pub struct AppState { auth: HashMap, } +#[allow(unused)] async fn basic_auth( State(state): State, request: Request, next: Next, ) -> Response { - let request = if state.auth.len() != 0 { + let request = if !state.auth.is_empty() { let (mut parts, body) = request.into_parts(); let Ok(TypedHeader(Authorization(hdr))) = @@ -46,7 +47,7 @@ async fn basic_auth( if state .auth .get(hdr.username()) - .and_then(|pass| Some(*pass == SecStr::from(hdr.password()))) + .map(|pass| *pass == SecStr::from(hdr.password())) != Some(true) { return Response::builder() @@ -110,7 +111,7 @@ async fn main() { .into_iter() .enumerate() .filter_map(|(i, s)| { - if s.len() == 0 { + if s.is_empty() { return None; } @@ -133,7 +134,7 @@ async fn main() { }; // We require credentials in production builds (unless explicitly disabled) - if auth.len() == 0 && !disabled { + if auth.is_empty() && !disabled { #[cfg(not(debug_assertions))] { warn!("The 'SD_AUTH' environment variable is not set!"); @@ -143,6 +144,7 @@ async fn main() { } } + #[cfg(not(feature = "assets"))] let state = AppState { auth }; let (node, router) = match Node::new( @@ -243,7 +245,7 @@ async fn main() { let app = app .route("/", get(|| async { "Spacedrive Server!" })) .fallback(|| async { "404 Not Found: We're past the event horizon..." }) - .layer(middleware::from_fn_with_state(state, basic_auth)); + .layer(axum::middleware::from_fn_with_state(state, basic_auth)); let mut addr = "[::]:8080".parse::().unwrap(); // This listens on IPv6 and IPv4 addr.set_port(port); diff --git a/apps/web/cypress/e2e/1-onboarding.spec.cy.ts b/apps/web/cypress/e2e/1-onboarding.spec.cy.ts index 09c7dca25..8066ba81e 100644 --- a/apps/web/cypress/e2e/1-onboarding.spec.cy.ts +++ b/apps/web/cypress/e2e/1-onboarding.spec.cy.ts @@ -1,4 +1,4 @@ -import { discordUrl, libraryName, privacyUrl } from '../fixtures/onboarding.json'; +import { libraryName, privacyUrl } from '../fixtures/onboarding.json'; import { libraryRegex, newLibraryRegex, @@ -39,7 +39,7 @@ describe('Onboarding', () => { // Check Join Discord button exists and point to a valid discord invite cy.get('button').contains('Join Discord').click(); - cy.get('@winOpen').should('be.calledWith', discordUrl); + cy.get('@winOpen').should('be.calledWithMatch', /https:\/\/discord.gg\/.+/); // Check we have a button to continue to the Library creation cy.get('a') diff --git a/apps/web/cypress/fixtures/onboarding.json b/apps/web/cypress/fixtures/onboarding.json index 5d95d4a5e..0d2d6bb25 100644 --- a/apps/web/cypress/fixtures/onboarding.json +++ b/apps/web/cypress/fixtures/onboarding.json @@ -1,5 +1,4 @@ { - "discordUrl": "https://discord.gg/ukRnWSnAbG", "privacyUrl": "https://www.spacedrive.com/docs/product/resources/privacy", "libraryName": "Test Library" } diff --git a/apps/web/public/logo-192x192.png b/apps/web/public/logo-192x192.png index 74e728884..d89b9908e 100644 Binary files a/apps/web/public/logo-192x192.png and b/apps/web/public/logo-192x192.png differ diff --git a/apps/web/public/logo-512x512.png b/apps/web/public/logo-512x512.png index 1afba9570..929ce4e3d 100644 Binary files a/apps/web/public/logo-512x512.png and b/apps/web/public/logo-512x512.png differ diff --git a/apps/web/screenshots/overview-dark.png b/apps/web/screenshots/overview-dark.png index 91b0a3b20..f3cee7e00 100644 Binary files a/apps/web/screenshots/overview-dark.png and b/apps/web/screenshots/overview-dark.png differ diff --git a/apps/web/screenshots/overview-light.png b/apps/web/screenshots/overview-light.png index 4d3f6c5db..1a5215e5e 100644 Binary files a/apps/web/screenshots/overview-light.png and b/apps/web/screenshots/overview-light.png differ diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 5e669c424..6da60257d 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -1,7 +1,7 @@ import { hydrate, QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { useEffect, useRef, useState } from 'react'; import { createBrowserRouter } from 'react-router-dom'; -import { CacheProvider, createCache, RspcProvider } from '@sd/client'; +import { RspcProvider } from '@sd/client'; import { createRoutes, Platform, @@ -42,8 +42,10 @@ const spacedriveURL = (() => { const platform: Platform = { platform: 'web', - getThumbnailUrlByThumbKey: (keyParts) => - `${spacedriveURL}/thumbnail/${keyParts.map((i) => encodeURIComponent(i)).join('/')}.webp`, + getThumbnailUrlByThumbKey: (thumbKey) => + `${spacedriveURL}/thumbnail/${encodeURIComponent( + thumbKey.base_directory_str + )}/${encodeURIComponent(thumbKey.shard_hex)}/${encodeURIComponent(thumbKey.cas_id)}.webp`, getFileUrl: (libraryId, locationLocalId, filePathId) => `${spacedriveURL}/file/${encodeURIComponent(libraryId)}/${encodeURIComponent( locationLocalId @@ -88,9 +90,7 @@ const queryClient = new QueryClient({ } }); -const cache = createCache(); - -const routes = createRoutes(platform, cache); +const routes = createRoutes(platform); function App() { const router = useRouter(); @@ -114,18 +114,16 @@ function App() { - - - - - + + + diff --git a/core/Cargo.toml b/core/Cargo.toml index e6c75fcfd..7f325049f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "sd-core" -version = "0.2.11" +version = "0.3.2" description = "Virtual distributed filesystem engine that powers Spacedrive." -authors = ["Spacedrive Technology Inc."] -rust-version = "1.75.0" +authors = ["Spacedrive Technology Inc "] +rust-version = "1.78" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } @@ -13,10 +13,13 @@ default = [] # This feature allows features to be disabled when the Core is running on mobile. mobile = [] # This feature controls whether the Spacedrive Core contains functionality which requires FFmpeg. -ffmpeg = ["dep:sd-ffmpeg"] +ffmpeg = [ + "dep:sd-ffmpeg", + "sd-core-heavy-lifting/ffmpeg", + "sd-media-metadata/ffmpeg", +] heif = ["sd-images/heif"] ai = ["dep:sd-ai"] -crypto = ["dep:sd-crypto"] [dependencies] # Inner Core Sub-crates @@ -27,14 +30,9 @@ sd-core-prisma-helpers = { path = "./crates/prisma-helpers" } sd-core-sync = { path = "./crates/sync" } # Spacedrive Sub-crates -sd-actors = { version = "0.1.0", path = "../crates/actors" } +sd-actors = { path = "../crates/actors" } sd-ai = { path = "../crates/ai", optional = true } -sd-cache = { path = "../crates/cache" } -sd-cloud-api = { version = "0.1.0", path = "../crates/cloud-api" } -sd-crypto = { path = "../crates/crypto", features = [ - "sys", - "tokio", -], optional = true } +sd-cloud-api = { path = "../crates/cloud-api" } sd-ffmpeg = { path = "../crates/ffmpeg", optional = true } sd-file-ext = { path = "../crates/file-ext" } sd-images = { path = "../crates/images", features = [ @@ -44,31 +42,37 @@ sd-images = { path = "../crates/images", features = [ ] } sd-media-metadata = { path = "../crates/media-metadata" } sd-p2p = { path = "../crates/p2p", features = ["specta"] } -sd-p2p-block = { path = "../crates/p2p-block" } -sd-p2p-proto = { path = "../crates/p2p-proto" } -sd-p2p-tunnel = { path = "../crates/p2p-tunnel" } +sd-p2p-block = { path = "../crates/p2p/crates/block" } +sd-p2p-proto = { path = "../crates/p2p/crates/proto" } +sd-p2p-tunnel = { path = "../crates/p2p/crates/tunnel" } sd-prisma = { path = "../crates/prisma" } sd-sync = { path = "../crates/sync" } +sd-task-system = { path = "../crates/task-system" } sd-utils = { path = "../crates/utils" } -sd-indexer = { path = "../crates/sd-indexer" } # Workspace dependencies async-channel = { workspace = true } async-trait = { workspace = true } axum = { workspace = true, features = ["ws"] } base64 = { workspace = true } +base91 = { workspace = true } blake3 = { workspace = true } chrono = { workspace = true, features = ["serde"] } +directories = { workspace = true } futures = { workspace = true } futures-concurrency = { workspace = true } +gix-ignore = { workspace = true } +hyper = { workspace = true, features = ["http1", "server", "client"] } image = { workspace = true } itertools = { workspace = true } +libc = { workspace = true } normpath = { workspace = true, features = ["localization"] } once_cell = { workspace = true } pin-project-lite = { workspace = true } prisma-client-rust = { workspace = true, features = ["rspc"] } regex = { workspace = true } reqwest = { workspace = true, features = ["json", "native-tls-vendored"] } +rmp = { workspace = true } rmp-serde = { workspace = true } rmpv = { workspace = true } rspc = { workspace = true, features = [ @@ -82,6 +86,7 @@ rspc = { workspace = true, features = [ serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } specta = { workspace = true } +static_assertions = { workspace = true } strum = { workspace = true, features = ["derive"] } strum_macros = { workspace = true } tempfile = { workspace = true } @@ -97,69 +102,57 @@ tokio = { workspace = true, features = [ tokio-stream = { workspace = true, features = ["fs"] } tokio-util = { workspace = true, features = ["io"] } tracing = { workspace = true } -tracing-appender = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } uuid = { workspace = true, features = ["v4", "serde"] } webp = { workspace = true } # Specific Core dependencies -async-recursion = "1.0.5" +async-recursion = "1.1" async-stream = "0.3.5" -aws-sdk-s3 = { version = "1.5.0", features = ["behavior-version-latest"] } -aws-config = "1.0.3" -aws-credential-types = "1.0.3" -base91 = "0.1.0" -bytes = "1.5.0" -ctor = "0.2.5" -directories = "5.0.1" -flate2 = "1.0.28" -hostname = "0.3.1" -http-body = "0.4.5" +aws-sdk-s3 = { version = "1.34", features = ["behavior-version-latest"] } +aws-config = "1.5" +aws-credential-types = "1.2" +bytes = "1.6" +ctor = "0.2.8" +flate2 = "1.0" +hostname = "0.4.0" +http-body = "0.4.6" # Update blocked by http http-range = "0.1.5" -hyper = { version = "=0.14.28", features = ["http1", "server", "client"] } -int-enum = "0.5.0" -libc = "0.2.153" -mini-moka = "0.10.2" +int-enum = "0.5" # Update blocked due to API breaking changes +mini-moka = "0.10.3" notify = { git = "https://github.com/notify-rs/notify.git", rev = "c3929ed114fbb0bc7457a9a498260461596b00ca", default-features = false, features = [ "macos_fsevent", ] } -rmp = "0.8.12" serde-hashkey = "0.4.5" -serde_repr = "0.1" -serde_with = "3.4.0" -slotmap = "1.0.6" -static_assertions = "1.1.0" -sysinfo = "0.29.10" -tar = "0.4.40" +serde_repr = "0.1.19" +serde_with = "3.8" +slotmap = "1.0" +sysinfo = "0.29.11" # Update blocked due to API breaking changes +tar = "0.4.41" tower-service = "0.3.2" -opendal = { version = "0.45.1", features = [ - "services-gdrive", - "services-s3", - "services-fs", -] } -sync_wrapper = { version = "1.0.1", features = ["futures"] } +tracing-appender = "0.2.3" # Override features of transitive dependencies [dependencies.openssl] -version = "=0.10.61" +version = "=0.10.64" features = ["vendored"] [dependencies.openssl-sys] -version = "=0.9.97" +version = "=0.9.102" features = ["vendored"] # Platform-specific dependencies [target.'cfg(target_os = "macos")'.dependencies] -plist = "1" -trash = "4.1.0" +plist = "1.6" +trash = "4.1" [target.'cfg(target_os = "linux")'.dependencies] -trash = "4.1.0" +trash = "4.1" [target.'cfg(target_os = "windows")'.dependencies] -trash = "4.1.0" +trash = "4.1" [target.'cfg(target_os = "ios")'.dependencies] -icrate = { version = "0.1.0", features = [ +icrate = { version = "0.1.2", features = [ "Foundation", "Foundation_NSFileManager", "Foundation_NSString", @@ -167,6 +160,9 @@ icrate = { version = "0.1.0", features = [ ] } [dev-dependencies] -tracing-test = { workspace.dev-dependencies = true } -aovec = "1.1.0" +# Workspace dependencies globset = { workspace = true } +tracing-test = { workspace = true } + +# Specific Core dependencies +boxcar = "0.2.5" diff --git a/core/crates/file-path-helper/Cargo.toml b/core/crates/file-path-helper/Cargo.toml index aceebb563..d89deddea 100644 --- a/core/crates/file-path-helper/Cargo.toml +++ b/core/crates/file-path-helper/Cargo.toml @@ -3,7 +3,7 @@ name = "sd-core-file-path-helper" version = "0.1.0" authors = ["Ericson Soares "] readme = "README.md" -rust-version = "1.75.0" +rust-version = "1.75" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } @@ -16,6 +16,7 @@ sd-core-prisma-helpers = { path = "../prisma-helpers" } sd-prisma = { path = "../../../crates/prisma" } sd-utils = { path = "../../../crates/utils" } +# Workspace dependencies chrono = { workspace = true, features = ["serde"] } prisma-client-rust = { workspace = true } regex = { workspace = true } @@ -24,5 +25,5 @@ thiserror = { workspace = true } tokio = { workspace = true, features = ["fs"] } tracing = { workspace = true } -[target.'cfg(windows)'.dependencies.winapi-util] -version = "0.1.6" +[target.'cfg(windows)'.dependencies] +winapi-util = "0.1.8" diff --git a/core/crates/file-path-helper/src/isolated_file_path_data.rs b/core/crates/file-path-helper/src/isolated_file_path_data.rs index 21852fe18..ba321dbbc 100644 --- a/core/crates/file-path-helper/src/isolated_file_path_data.rs +++ b/core/crates/file-path-helper/src/isolated_file_path_data.rs @@ -100,6 +100,18 @@ impl<'a> IsolatedFilePathData<'a> { self.extension.as_ref() } + #[must_use] + pub fn to_owned(self) -> IsolatedFilePathData<'static> { + IsolatedFilePathData { + location_id: self.location_id, + materialized_path: Cow::Owned(self.materialized_path.to_string()), + is_dir: self.is_dir, + name: Cow::Owned(self.name.to_string()), + extension: Cow::Owned(self.extension.to_string()), + relative_path: Cow::Owned(self.relative_path.to_string()), + } + } + #[must_use] pub const fn is_dir(&self) -> bool { self.is_dir diff --git a/core/crates/file-path-helper/src/lib.rs b/core/crates/file-path-helper/src/lib.rs index ae6a3bbde..39992b322 100644 --- a/core/crates/file-path-helper/src/lib.rs +++ b/core/crates/file-path-helper/src/lib.rs @@ -198,7 +198,6 @@ pub fn filter_existing_file_path_params( /// With this function we try to do a loose filtering of file paths, to avoid having to do check /// twice for directories and for files. This is because directories have a trailing `/` or `\` in /// the materialized path -#[allow(unused)] pub fn loose_find_existing_file_path_params( location_id: location::id::Type, location_path: impl AsRef, diff --git a/core/crates/heavy-lifting/Cargo.toml b/core/crates/heavy-lifting/Cargo.toml index a1bd037e1..6729096d9 100644 --- a/core/crates/heavy-lifting/Cargo.toml +++ b/core/crates/heavy-lifting/Cargo.toml @@ -6,7 +6,10 @@ license = { workspace = true } repository = { workspace = true } edition = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = [] +# This feature controls whether the Spacedrive Heavy Lifting contains functionality which requires FFmpeg. +ffmpeg = ["dep:sd-ffmpeg"] [dependencies] # Inner Core Sub-crates @@ -15,36 +18,44 @@ sd-core-indexer-rules = { path = "../indexer-rules" } sd-core-prisma-helpers = { path = "../prisma-helpers" } sd-core-sync = { path = "../sync" } -# Sub-crates +# Spacedrive Sub-crates +sd-ffmpeg = { path = "../../../crates/ffmpeg", optional = true } +sd-file-ext = { path = "../../../crates/file-ext" } +sd-images = { path = "../../../crates/images" } +sd-media-metadata = { path = "../../../crates/media-metadata" } sd-prisma = { path = "../../../crates/prisma" } sd-sync = { path = "../../../crates/sync" } sd-task-system = { path = "../../../crates/task-system" } sd-utils = { path = "../../../crates/utils" } - +# Workspace dependencies async-channel = { workspace = true } async-trait = { workspace = true } +blake3 = { workspace = true } chrono = { workspace = true, features = ["serde"] } futures = { workspace = true } futures-concurrency = { workspace = true } globset = { workspace = true } +image = { workspace = true } itertools = { workspace = true } lending-stream = { workspace = true } +once_cell = { workspace = true } prisma-client-rust = { workspace = true } -rmp-serde = { workspace = true } rmpv = { workspace = true } +rmp-serde = { workspace = true } rspc = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } specta = { workspace = true } +static_assertions = { workspace = true } strum = { workspace = true, features = ["derive", "phf"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["fs", "sync", "parking_lot"] } tokio-stream = { workspace = true, features = ["fs"] } tracing = { workspace = true } uuid = { workspace = true, features = ["v4", "serde"] } - +webp = { workspace = true } [dev-dependencies] tempfile = { workspace = true } -tracing-test = { workspace.dev-dependencies = true } +tracing-test = { workspace = true } diff --git a/core/src/object/cas.rs b/core/crates/heavy-lifting/src/file_identifier/cas_id.rs similarity index 73% rename from core/src/object/cas.rs rename to core/crates/heavy-lifting/src/file_identifier/cas_id.rs index 43a1be0f4..7240c3483 100644 --- a/core/src/object/cas.rs +++ b/core/crates/heavy-lifting/src/file_identifier/cas_id.rs @@ -1,3 +1,5 @@ +use sd_core_prisma_helpers::CasId; + use std::path::Path; use blake3::Hasher; @@ -6,6 +8,7 @@ use tokio::{ fs::{self, File}, io::{self, AsyncReadExt, AsyncSeekExt, SeekFrom}, }; +use tracing::{instrument, trace, Level}; const SAMPLE_COUNT: u64 = 4; const SAMPLE_SIZE: u64 = 1024 * 10; @@ -20,14 +23,29 @@ const_assert!((HEADER_OR_FOOTER_SIZE * 2 + SAMPLE_COUNT * SAMPLE_SIZE) < MINIMUM // Asserting that the sample size is larger than header/footer size, as the same buffer is used for both const_assert!(SAMPLE_SIZE > HEADER_OR_FOOTER_SIZE); -pub async fn generate_cas_id(path: impl AsRef, size: u64) -> Result { +#[instrument( + skip(path), + ret(level = Level::TRACE), + err, + fields(path = %path.as_ref().display() +))] +// SAFETY: Casts here are safe, they're hardcoded values we have some const assertions above to make sure they're correct +#[allow(clippy::cast_possible_truncation)] +#[allow(clippy::cast_possible_wrap)] +pub async fn generate_cas_id( + path: impl AsRef + Send, + size: u64, +) -> Result, io::Error> { let mut hasher = Hasher::new(); hasher.update(&size.to_le_bytes()); if size <= MINIMUM_FILE_SIZE { + trace!("File is small, hashing the whole file"); // For small files, we hash the whole file hasher.update(&fs::read(path).await?); } else { + trace!("File bigger than threshold, hashing samples"); + let mut file = File::open(path).await?; let mut buf = vec![0; SAMPLE_SIZE as usize].into_boxed_slice(); @@ -58,5 +76,5 @@ pub async fn generate_cas_id(path: impl AsRef, size: u64) -> Result Self { + Self::SearchingOrphansWithPriority + } +} + +impl fmt::Display for Phase { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::SearchingOrphans | Self::SearchingOrphansWithPriority => { + write!(f, "searching_orphans") + } + Self::IdentifyingFiles => write!(f, "identifying_files"), + Self::ProcessingObjects => write!(f, "processing_objects"), + } + } +} + +impl From for String { + fn from(phase: Phase) -> Self { + phase.to_string() + } +} + +#[derive(Debug)] +pub struct FileIdentifier { + // Received arguments + location: Arc, + location_path: Arc, + sub_path: Option, + + // Inner state + file_paths_accumulator: HashMap, Vec>, + file_paths_ids_with_priority: HashSet, + last_orphan_file_path_id: Option, + + // Job control + phase: Phase, + + // Run data + metadata: Metadata, + errors: Vec, + + // On shutdown data + pending_tasks_on_resume: Vec>, + tasks_for_shutdown: Vec>>, +} + +impl Hash for FileIdentifier { + fn hash(&self, state: &mut H) { + self.location.id.hash(state); + if let Some(ref sub_path) = self.sub_path { + sub_path.hash(state); + } + } +} + +impl Job for FileIdentifier { + const NAME: JobName = JobName::FileIdentifier; + + async fn resume_tasks( + &mut self, + dispatcher: &JobTaskDispatcher, + ctx: &impl JobContext, + SerializedTasks(serialized_tasks): SerializedTasks, + ) -> Result<(), Error> { + if let Ok(tasks) = dispatcher + .dispatch_many_boxed( + rmp_serde::from_slice::)>>(&serialized_tasks) + .map_err(file_identifier::Error::from)? + .into_iter() + .map(|(task_kind, task_bytes)| async move { + match task_kind { + TaskKind::Identifier => tasks::Identifier::deserialize( + &task_bytes, + (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), + ) + .await + .map(IntoTask::into_task), + + TaskKind::ObjectProcessor => tasks::ObjectProcessor::deserialize( + &task_bytes, + (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), + ) + .await + .map(IntoTask::into_task), + } + }) + .collect::>() + .try_join() + .await + .map_err(file_identifier::Error::from)?, + ) + .await + { + self.pending_tasks_on_resume = tasks; + } else { + warn!("Failed to dispatch tasks to resume as job was already canceled"); + } + + Ok(()) + } + + #[instrument( + skip_all, + fields( + location_id = self.location.id, + location_path = %self.location_path.display(), + sub_path = ?self.sub_path.as_ref().map(|path| path.display()), + ), + ret(level = Level::TRACE), + err, + )] + async fn run( + mut self, + dispatcher: JobTaskDispatcher, + ctx: impl JobContext, + ) -> Result { + let mut pending_running_tasks = FuturesUnordered::new(); + + match self + .init_or_resume(&mut pending_running_tasks, &ctx, &dispatcher) + .await + { + Ok(()) => { /* Everything is awesome! */ } + Err(JobErrorOrDispatcherError::JobError(e)) => { + return Err(e.into()); + } + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(_))) => { + return Ok(self.cancel_job(&mut pending_running_tasks).await); + } + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown(tasks))) => { + self.tasks_for_shutdown.extend(tasks); + + if pending_running_tasks.is_empty() { + // If no task managed to be dispatched, we can just shutdown + // otherwise we have to process handles below and wait for them to be shutdown too + return Ok(ReturnStatus::Shutdown( + SerializableJob::::serialize(self).await, + )); + } + } + } + + while let Some(task) = pending_running_tasks.next().await { + match task { + Ok(TaskStatus::Done((task_id, TaskOutput::Out(out)))) => { + match self + .process_task_output(task_id, out, &ctx, &dispatcher) + .await + { + Ok(tasks) => pending_running_tasks.extend(tasks), + Err(DispatcherError::JobCanceled(_)) => { + return Ok(self.cancel_job(&mut pending_running_tasks).await); + } + Err(DispatcherError::Shutdown(tasks)) => { + self.tasks_for_shutdown.extend(tasks); + } + } + } + + Ok(TaskStatus::Done((task_id, TaskOutput::Empty))) => { + warn!(%task_id, "Task returned an empty output"); + } + + Ok(TaskStatus::Shutdown(task)) => { + self.tasks_for_shutdown.push(task); + } + + Ok(TaskStatus::Error(e)) => { + cancel_pending_tasks(&mut pending_running_tasks).await; + + return Err(e); + } + + Ok(TaskStatus::Canceled | TaskStatus::ForcedAbortion) => { + return Ok(self.cancel_job(&mut pending_running_tasks).await); + } + + Err(e) => { + cancel_pending_tasks(&mut pending_running_tasks).await; + + return Err(e.into()); + } + } + } + + if !self.tasks_for_shutdown.is_empty() { + return Ok(ReturnStatus::Shutdown( + SerializableJob::::serialize(self).await, + )); + } + + // From this point onward, we are done with the job and it can't be interrupted anymore + let Self { + location, + metadata, + errors, + .. + } = self; + + ctx.db() + .location() + .update( + location::id::equals(location.id), + vec![location::scan_state::set( + LocationScanState::FilesIdentified as i32, + )], + ) + .exec() + .await + .map_err(file_identifier::Error::from)?; + + Ok(ReturnStatus::Completed( + JobReturn::builder() + .with_metadata(metadata) + .with_non_critical_errors(errors) + .build(), + )) + } +} + +impl FileIdentifier { + pub fn new( + location: location::Data, + sub_path: Option, + ) -> Result { + Ok(Self { + location_path: maybe_missing(&location.path, "location.path") + .map(PathBuf::from) + .map(Arc::new)?, + location: Arc::new(location), + sub_path, + file_paths_accumulator: HashMap::new(), + file_paths_ids_with_priority: HashSet::new(), + last_orphan_file_path_id: None, + phase: Phase::default(), + metadata: Metadata::default(), + errors: Vec::new(), + pending_tasks_on_resume: Vec::new(), + tasks_for_shutdown: Vec::new(), + }) + } + + #[allow(clippy::too_many_lines)] + async fn init_or_resume( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + ) -> Result<(), JobErrorOrDispatcherError> { + // if we don't have any pending task, then this is a fresh job + let db = ctx.db(); + let maybe_sub_iso_file_path = + maybe_get_iso_file_path_from_sub_path::( + self.location.id, + self.sub_path.as_ref(), + &*self.location_path, + db, + ) + .await?; + + let start = Instant::now(); + + let location_root_iso_file_path = IsolatedFilePathData::new( + self.location.id, + &*self.location_path, + &*self.location_path, + true, + ) + .map_err(file_identifier::Error::from)?; + + if self.pending_tasks_on_resume.is_empty() { + ctx.progress([ProgressUpdate::phase(self.phase)]).await; + + // First we dispatch some shallow priority tasks to quickly identify orphans in the location + // root directory or in the desired sub-path + self.dispatch_priority_identifier_tasks( + maybe_sub_iso_file_path + .as_ref() + .unwrap_or(&location_root_iso_file_path), + ctx, + dispatcher, + pending_running_tasks, + ) + .await?; + + self.phase = Phase::SearchingOrphans; + // Resetting the last orphan file path id for deep search + self.last_orphan_file_path_id = None; + + self.dispatch_deep_identifier_tasks( + &maybe_sub_iso_file_path, + ctx, + dispatcher, + pending_running_tasks, + ) + .await?; + + self.last_orphan_file_path_id = None; + self.phase = Phase::IdentifyingFiles; + + ctx.progress(vec![ + ProgressUpdate::TaskCount(u64::from(self.metadata.total_identifier_tasks)), + ProgressUpdate::phase(self.phase), + ProgressUpdate::Message(format!( + "{} files to be identified", + self.metadata.total_found_orphans + )), + ]) + .await; + + self.metadata.seeking_orphans_time = start.elapsed(); + } else { + pending_running_tasks.extend(mem::take(&mut self.pending_tasks_on_resume)); + + // For these 2 phases, we need to keep dispatching tasks until we have no more orphans to identify + // as we could have receive a shutdown command before being able to run through all orphans + match self.phase { + Phase::SearchingOrphansWithPriority => { + self.dispatch_priority_identifier_tasks( + maybe_sub_iso_file_path + .as_ref() + .unwrap_or(&location_root_iso_file_path), + ctx, + dispatcher, + pending_running_tasks, + ) + .await?; + + self.phase = Phase::SearchingOrphans; + // Resetting the last orphan file path id for deep search + self.last_orphan_file_path_id = None; + + self.dispatch_deep_identifier_tasks( + &maybe_sub_iso_file_path, + ctx, + dispatcher, + pending_running_tasks, + ) + .await?; + + self.last_orphan_file_path_id = None; + self.phase = Phase::IdentifyingFiles; + } + + Phase::SearchingOrphans => { + self.dispatch_deep_identifier_tasks( + &maybe_sub_iso_file_path, + ctx, + dispatcher, + pending_running_tasks, + ) + .await?; + + self.last_orphan_file_path_id = None; + self.phase = Phase::IdentifyingFiles; + } + + _ => {} + } + + ctx.progress(vec![ + ProgressUpdate::TaskCount(if matches!(self.phase, Phase::IdentifyingFiles) { + u64::from(self.metadata.total_identifier_tasks) + } else { + u64::from(self.metadata.total_object_processor_tasks) + }), + ProgressUpdate::phase(self.phase), + ProgressUpdate::Message(format!( + "{} files to be identified", + self.metadata.total_found_orphans + )), + ]) + .await; + debug!( + resuming_tasks_count = self.pending_tasks_on_resume.len(), + "Resuming tasks for FileIdentifier job;", + ); + } + + Ok(()) + } + + /// Process output of tasks, according to the downcasted output type + /// + /// # Panics + /// Will panic if another task type is added in the job, but this function wasn't updated to handle it + /// + async fn process_task_output( + &mut self, + task_id: TaskId, + any_task_output: Box, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + ) -> Result>, DispatcherError> { + if any_task_output.is::() { + return self + .process_identifier_output( + task_id, + *any_task_output + .downcast::() + .expect("just checked"), + ctx, + dispatcher, + ) + .await; + } else if any_task_output.is::() { + self.process_object_processor_output( + task_id, + *any_task_output + .downcast::() + .expect("just checked"), + ctx, + ) + .await; + } else { + unreachable!("Unexpected task output type: "); + } + + Ok(vec![]) + } + + #[instrument( + skip_all, + fields( + %task_id, + ?extract_metadata_time, + ?save_db_time, + created_objects_count, + total_identified_files, + errors_count = errors.len() + ) + )] + async fn process_identifier_output( + &mut self, + task_id: TaskId, + identifier::Output { + file_path_ids_with_new_object, + file_paths_by_cas_id, + extract_metadata_time, + save_db_time, + created_objects_count, + total_identified_files, + errors, + }: identifier::Output, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + ) -> Result>, DispatcherError> { + self.metadata.mean_extract_metadata_time += extract_metadata_time; + self.metadata.mean_save_db_time_on_identifier_tasks += save_db_time; + self.metadata.total_identified_files += total_identified_files; + self.metadata.created_objects_count += created_objects_count; + + let file_paths_with_new_object_to_report = file_path_ids_with_new_object + .into_iter() + .filter_map(|id| self.file_paths_ids_with_priority.take(&id)) + .collect::>(); + + if !file_paths_with_new_object_to_report.is_empty() { + ctx.report_update(UpdateEvent::NewIdentifiedObjects { + file_path_ids: file_paths_with_new_object_to_report, + }); + } + + if !errors.is_empty() { + warn!(?errors, "Non critical errors while extracting metadata;"); + self.errors.extend(errors); + } + + accumulate_file_paths_by_cas_id(file_paths_by_cas_id, &mut self.file_paths_accumulator); + + self.metadata.completed_identifier_tasks += 1; + + ctx.progress(vec![ + ProgressUpdate::CompletedTaskCount(u64::from(self.metadata.completed_identifier_tasks)), + ProgressUpdate::Message(format!( + "Identified {} of {} files", + self.metadata.total_identified_files, self.metadata.total_found_orphans + )), + ]) + .await; + + debug!( + "Processed ({}/{}) identifier tasks, took: {extract_metadata_time:?};", + self.metadata.completed_identifier_tasks, self.metadata.total_identifier_tasks, + ); + + // If we completed all identifier tasks, then we dispatch the object processor tasks + if self.metadata.completed_identifier_tasks == self.metadata.total_identifier_tasks { + self.phase = Phase::ProcessingObjects; + let (tasks_count, res) = match dispatch_object_processor_tasks( + self.file_paths_accumulator.drain(), + ctx, + dispatcher, + false, + ) + .await + { + Ok(task_handles) => (task_handles.len(), Ok(task_handles)), + Err(DispatcherError::Shutdown(tasks)) => { + (tasks.len(), Err(DispatcherError::Shutdown(tasks))) + } + Err(e) => return Err(e), + }; + + #[allow(clippy::cast_possible_truncation)] + { + // SAFETY: we know that `tasks.len()` is a valid u32 as we wouldn't dispatch more than `u32::MAX` tasks + self.metadata.total_object_processor_tasks = tasks_count as u32; + } + + ctx.progress(vec![ + ProgressUpdate::TaskCount(u64::from(self.metadata.total_object_processor_tasks)), + ProgressUpdate::CompletedTaskCount(0), + ProgressUpdate::phase(self.phase), + ]) + .await; + + res + } else { + Ok(vec![]) + } + } + + #[instrument(skip(self, file_path_ids_with_new_object, ctx))] + async fn process_object_processor_output( + &mut self, + task_id: TaskId, + object_processor::Output { + file_path_ids_with_new_object, + fetch_existing_objects_time, + assign_to_existing_object_time, + create_object_time, + created_objects_count, + linked_objects_count, + }: object_processor::Output, + ctx: &impl JobContext, + ) { + self.metadata.mean_fetch_existing_objects_time += fetch_existing_objects_time; + self.metadata.mean_assign_to_existing_object_time += assign_to_existing_object_time; + self.metadata.mean_create_object_time += create_object_time; + self.metadata.created_objects_count += created_objects_count; + self.metadata.linked_objects_count += linked_objects_count; + + self.metadata.completed_object_processor_tasks += 1; + + ctx.progress(vec![ + ProgressUpdate::CompletedTaskCount(u64::from( + self.metadata.completed_object_processor_tasks, + )), + ProgressUpdate::Message(format!( + "Processed {} of {} objects", + self.metadata.created_objects_count + self.metadata.linked_objects_count, + self.metadata.total_found_orphans + )), + ]) + .await; + + let file_paths_with_new_object_to_report = file_path_ids_with_new_object + .into_iter() + .filter_map(|id| self.file_paths_ids_with_priority.take(&id)) + .collect::>(); + + if !file_paths_with_new_object_to_report.is_empty() { + ctx.report_update(UpdateEvent::NewIdentifiedObjects { + file_path_ids: file_paths_with_new_object_to_report, + }); + } + + debug!( + "Processed ({}/{}) object processor tasks, took: {:?};", + self.metadata.completed_object_processor_tasks, + self.metadata.total_object_processor_tasks, + fetch_existing_objects_time + assign_to_existing_object_time + create_object_time, + ); + } + + async fn dispatch_priority_identifier_tasks( + &mut self, + sub_iso_file_path: &IsolatedFilePathData<'static>, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + pending_running_tasks: &FuturesUnordered>, + ) -> Result<(), JobErrorOrDispatcherError> { + let db = ctx.db(); + + loop { + let start = Instant::now(); + + #[allow(clippy::cast_possible_wrap)] + // SAFETY: we know that CHUNK_SIZE is a valid i64 + let orphan_paths = db + .file_path() + .find_many(orphan_path_filters_shallow( + self.location.id, + self.last_orphan_file_path_id, + sub_iso_file_path, + )) + .order_by(file_path::id::order(SortOrder::Asc)) + .take(CHUNK_SIZE as i64) + .select(file_path_for_file_identifier::select()) + .exec() + .await + .map_err(file_identifier::Error::from)?; + + trace!(orphans_count = orphan_paths.len(), "Found orphan paths;"); + + if orphan_paths.is_empty() { + break; + } + + self.file_paths_ids_with_priority.extend( + orphan_paths + .iter() + .map(|file_path_for_file_identifier::Data { id, .. }| *id), + ); + + self.metadata.total_found_orphans += orphan_paths.len() as u64; + self.last_orphan_file_path_id = + Some(orphan_paths.last().expect("orphan_paths is not empty").id); + + self.metadata.total_identifier_tasks += 1; + + ctx.progress(vec![ + ProgressUpdate::TaskCount(u64::from(self.metadata.total_identifier_tasks)), + ProgressUpdate::Message(format!( + "Found {} orphan paths", + self.metadata.total_found_orphans + )), + ]) + .await; + + debug!( + "Dispatched ({}/{}) identifier tasks, took: {:?};", + self.metadata.completed_identifier_tasks, + self.metadata.total_identifier_tasks, + start.elapsed(), + ); + + pending_running_tasks.push( + dispatcher + .dispatch(tasks::Identifier::new( + Arc::clone(&self.location), + Arc::clone(&self.location_path), + orphan_paths, + true, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + )) + .await?, + ); + } + + Ok(()) + } + + async fn dispatch_deep_identifier_tasks( + &mut self, + maybe_sub_iso_file_path: &Option>, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + pending_running_tasks: &FuturesUnordered>, + ) -> Result<(), JobErrorOrDispatcherError> { + let db = ctx.db(); + + loop { + let start = Instant::now(); + + #[allow(clippy::cast_possible_wrap)] + // SAFETY: we know that CHUNK_SIZE is a valid i64 + let mut orphan_paths = db + .file_path() + .find_many(orphan_path_filters_deep( + self.location.id, + self.last_orphan_file_path_id, + maybe_sub_iso_file_path, + )) + .order_by(file_path::id::order(SortOrder::Asc)) + .take(CHUNK_SIZE as i64) + .select(file_path_for_file_identifier::select()) + .exec() + .await + .map_err(file_identifier::Error::from)?; + + // No other orphans to identify, we can break the loop + if orphan_paths.is_empty() { + break; + } + + // We grab the last id to use as a starting point for the next iteration, in case we skip this one + self.last_orphan_file_path_id = + Some(orphan_paths.last().expect("orphan_paths is not empty").id); + + orphan_paths.retain(|file_path_for_file_identifier::Data { id, .. }| { + !self.file_paths_ids_with_priority.contains(id) + }); + + // If we don't have any new orphan paths after filtering out, we can skip this iteration + if orphan_paths.is_empty() { + continue; + } + + self.metadata.total_found_orphans += orphan_paths.len() as u64; + + self.metadata.total_identifier_tasks += 1; + + ctx.progress(vec![ + ProgressUpdate::TaskCount(u64::from(self.metadata.total_identifier_tasks)), + ProgressUpdate::Message(format!( + "Found {} orphan paths", + self.metadata.total_found_orphans + )), + ]) + .await; + + debug!( + "Dispatched ({}/{}) identifier tasks, took: {:?};", + self.metadata.completed_identifier_tasks, + self.metadata.total_identifier_tasks, + start.elapsed(), + ); + + pending_running_tasks.push( + dispatcher + .dispatch(tasks::Identifier::new( + Arc::clone(&self.location), + Arc::clone(&self.location_path), + orphan_paths, + false, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + )) + .await?, + ); + } + + Ok(()) + } + + async fn cancel_job( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + ) -> ReturnStatus { + cancel_pending_tasks(pending_running_tasks).await; + + ReturnStatus::Canceled( + JobReturn::builder() + .with_metadata(mem::take(&mut self.metadata)) + .with_non_critical_errors(mem::take(&mut self.errors)) + .build(), + ) + } +} + +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] +enum TaskKind { + Identifier, + ObjectProcessor, +} + +#[derive(Serialize, Deserialize)] +struct SaveState { + location: Arc, + location_path: Arc, + sub_path: Option, + + file_paths_accumulator: HashMap, Vec>, + file_paths_ids_with_priority: HashSet, + last_orphan_file_path_id: Option, + + phase: Phase, + metadata: Metadata, + + errors: Vec, + + tasks_for_shutdown_bytes: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct Metadata { + mean_extract_metadata_time: Duration, + mean_save_db_time_on_identifier_tasks: Duration, + mean_fetch_existing_objects_time: Duration, + mean_assign_to_existing_object_time: Duration, + mean_create_object_time: Duration, + seeking_orphans_time: Duration, + total_found_orphans: u64, + total_identified_files: u64, + created_objects_count: u64, + linked_objects_count: u64, + total_identifier_tasks: u32, + completed_identifier_tasks: u32, + total_object_processor_tasks: u32, + completed_object_processor_tasks: u32, +} + +impl From for Vec { + fn from( + Metadata { + mut mean_extract_metadata_time, + mut mean_save_db_time_on_identifier_tasks, + mut mean_fetch_existing_objects_time, + mut mean_assign_to_existing_object_time, + mut mean_create_object_time, + seeking_orphans_time, + total_found_orphans, + total_identified_files, + created_objects_count, + linked_objects_count, + total_identifier_tasks, + completed_identifier_tasks, + total_object_processor_tasks, + completed_object_processor_tasks, + }: Metadata, + ) -> Self { + // To avoid division by zero + mean_extract_metadata_time /= u32::max(total_identifier_tasks, 1); + mean_save_db_time_on_identifier_tasks /= u32::max(total_identifier_tasks, 1); + + mean_fetch_existing_objects_time /= u32::max(total_object_processor_tasks, 1); + mean_assign_to_existing_object_time /= u32::max(total_object_processor_tasks, 1); + mean_create_object_time /= u32::max(total_object_processor_tasks, 1); + + vec![ + ReportOutputMetadata::FileIdentifier { + total_orphan_paths: u64_to_frontend(total_found_orphans), + total_objects_created: u64_to_frontend(created_objects_count), + total_objects_linked: u64_to_frontend(linked_objects_count), + }, + ReportOutputMetadata::Metrics(HashMap::from([ + ( + "mean_extract_metadata_time".into(), + json!(mean_extract_metadata_time), + ), + ( + "mean_save_db_time_on_identifier_tasks".into(), + json!(mean_save_db_time_on_identifier_tasks), + ), + ( + "mean_fetch_existing_objects_time".into(), + json!(mean_fetch_existing_objects_time), + ), + ( + "mean_assign_to_existing_object_time".into(), + json!(mean_assign_to_existing_object_time), + ), + ( + "mean_create_object_time".into(), + json!(mean_create_object_time), + ), + ("seeking_orphans_time".into(), json!(seeking_orphans_time)), + ("total_found_orphans".into(), json!(total_found_orphans)), + ( + "total_identified_files".into(), + json!(total_identified_files), + ), + ("created_objects_count".into(), json!(created_objects_count)), + ("linked_objects_count".into(), json!(linked_objects_count)), + ( + "total_identifier_tasks".into(), + json!(total_identifier_tasks), + ), + ( + "completed_identifier_tasks".into(), + json!(completed_identifier_tasks), + ), + ( + "total_object_processor_tasks".into(), + json!(total_object_processor_tasks), + ), + ( + "completed_object_processor_tasks".into(), + json!(completed_object_processor_tasks), + ), + ])), + ] + } +} + +impl SerializableJob for FileIdentifier { + async fn serialize(self) -> Result>, rmp_serde::encode::Error> { + let Self { + location, + location_path, + sub_path, + file_paths_accumulator, + file_paths_ids_with_priority, + last_orphan_file_path_id, + phase, + metadata, + errors, + tasks_for_shutdown, + .. + } = self; + + let serialized_tasks = tasks_for_shutdown + .into_iter() + .map(|task| async move { + if task.is::() { + SerializableTask::serialize( + *task.downcast::().expect("just checked"), + ) + .await + .map(|bytes| (TaskKind::Identifier, bytes)) + } else if task.is::() { + task.downcast::() + .expect("just checked") + .serialize() + .await + .map(|bytes| (TaskKind::ObjectProcessor, bytes)) + } else { + unreachable!("Unexpected task type") + } + }) + .collect::>() + .try_join() + .await?; + + let tasks_for_shutdown_bytes = if serialized_tasks.is_empty() { + None + } else { + Some(SerializedTasks(rmp_serde::to_vec_named(&serialized_tasks)?)) + }; + + rmp_serde::to_vec_named(&SaveState { + location, + location_path, + sub_path, + file_paths_accumulator, + file_paths_ids_with_priority, + last_orphan_file_path_id, + phase, + metadata, + errors, + tasks_for_shutdown_bytes, + }) + .map(Some) + } + + async fn deserialize( + serialized_job: &[u8], + _: &OuterCtx, + ) -> Result)>, rmp_serde::decode::Error> { + let SaveState { + location, + location_path, + sub_path, + file_paths_accumulator, + file_paths_ids_with_priority, + last_orphan_file_path_id, + phase, + metadata, + errors, + tasks_for_shutdown_bytes, + } = rmp_serde::from_slice::(serialized_job)?; + + Ok(Some(( + Self { + location, + location_path, + sub_path, + file_paths_accumulator, + file_paths_ids_with_priority, + last_orphan_file_path_id, + phase, + metadata, + errors, + pending_tasks_on_resume: Vec::new(), + tasks_for_shutdown: Vec::new(), + }, + tasks_for_shutdown_bytes, + ))) + } +} diff --git a/core/crates/heavy-lifting/src/file_identifier/mod.rs b/core/crates/heavy-lifting/src/file_identifier/mod.rs new file mode 100644 index 000000000..e27d560b7 --- /dev/null +++ b/core/crates/heavy-lifting/src/file_identifier/mod.rs @@ -0,0 +1,279 @@ +use crate::{utils::sub_path, OuterContext}; + +use sd_core_file_path_helper::{FilePathError, IsolatedFilePathData}; +use sd_core_prisma_helpers::CasId; + +use sd_file_ext::{extensions::Extension, kind::ObjectKind}; +use sd_prisma::prisma::{file_path, location}; +use sd_task_system::{TaskDispatcher, TaskHandle}; +use sd_utils::{db::MissingFieldError, error::FileIOError}; + +use std::{ + collections::{hash_map::Entry, HashMap}, + fs::Metadata, + mem, + path::Path, + sync::Arc, +}; + +use prisma_client_rust::{or, QueryError}; +use rspc::ErrorCode; +use serde::{Deserialize, Serialize}; +use specta::Type; +use tokio::fs; +use tracing::trace; + +mod cas_id; +pub mod job; +mod shallow; +mod tasks; + +pub use cas_id::generate_cas_id; + +pub use job::FileIdentifier; +pub use shallow::shallow; + +use tasks::FilePathToCreateOrLinkObject; + +// we break these tasks into chunks of 100 to improve performance +const CHUNK_SIZE: usize = 100; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("missing field on database: {0}")] + MissingField(#[from] MissingFieldError), + #[error("failed to deserialized stored tasks for job resume: {0}")] + DeserializeTasks(#[from] rmp_serde::decode::Error), + #[error("database error: {0}")] + Database(#[from] QueryError), + + #[error(transparent)] + FilePathError(#[from] FilePathError), + #[error(transparent)] + SubPath(#[from] sub_path::Error), +} + +impl From for rspc::Error { + fn from(e: Error) -> Self { + match e { + Error::SubPath(sub_path_err) => sub_path_err.into(), + + _ => Self::with_cause(ErrorCode::InternalServerError, e.to_string(), e), + } + } +} + +#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] +pub enum NonCriticalFileIdentifierError { + #[error("failed to extract file metadata: {0}")] + FailedToExtractFileMetadata(String), + #[cfg(target_os = "windows")] + #[error("failed to extract metadata from on-demand file: {0}")] + FailedToExtractMetadataFromOnDemandFile(String), + #[error("failed to extract isolated file path data: {0}")] + FailedToExtractIsolatedFilePathData(String), +} + +#[derive(Debug, Clone)] +pub struct FileMetadata { + pub cas_id: Option>, + pub kind: ObjectKind, + pub fs_metadata: Metadata, +} + +impl FileMetadata { + /// Fetch metadata from the file system and generate a cas id for the file + /// if it's not empty. + /// + /// # Panics + /// Will panic if the file is a directory. + pub async fn new( + location_path: impl AsRef + Send, + iso_file_path: &IsolatedFilePathData<'_>, + ) -> Result { + let path = location_path.as_ref().join(iso_file_path); + + let fs_metadata = fs::metadata(&path) + .await + .map_err(|e| FileIOError::from((&path, e)))?; + + if fs_metadata.is_dir() { + trace!(path = %path.display(), "Skipping directory;"); + return Ok(Self { + cas_id: None, + kind: ObjectKind::Folder, + fs_metadata, + }); + } + + // derive Object kind + let kind = Extension::resolve_conflicting(&path, false) + .await + .map_or(ObjectKind::Unknown, Into::into); + + let cas_id = if fs_metadata.len() != 0 { + generate_cas_id(&path, fs_metadata.len()) + .await + .map(Some) + .map_err(|e| FileIOError::from((&path, e)))? + } else { + // We can't do shit with empty files + None + }; + + trace!( + path = %path.display(), + ?cas_id, + %kind, + "Analyzed file;", + ); + + Ok(Self { + cas_id, + kind, + fs_metadata, + }) + } +} + +fn orphan_path_filters_shallow( + location_id: location::id::Type, + file_path_id: Option, + sub_iso_file_path: &IsolatedFilePathData<'_>, +) -> Vec { + sd_utils::chain_optional_iter( + [ + or!( + file_path::object_id::equals(None), + file_path::cas_id::equals(None) + ), + file_path::is_dir::equals(Some(false)), + file_path::location_id::equals(Some(location_id)), + file_path::materialized_path::equals(Some( + sub_iso_file_path + .materialized_path_for_children() + .expect("sub path for shallow identifier must be a directory"), + )), + file_path::size_in_bytes_bytes::not(Some(0u64.to_be_bytes().to_vec())), + ], + [file_path_id.map(file_path::id::gt)], + ) +} + +fn orphan_path_filters_deep( + location_id: location::id::Type, + file_path_id: Option, + maybe_sub_iso_file_path: &Option>, +) -> Vec { + sd_utils::chain_optional_iter( + [ + or!( + file_path::object_id::equals(None), + file_path::cas_id::equals(None) + ), + file_path::is_dir::equals(Some(false)), + file_path::location_id::equals(Some(location_id)), + file_path::size_in_bytes_bytes::not(Some(0u64.to_be_bytes().to_vec())), + ], + [ + // this is a workaround for the cursor not working properly + file_path_id.map(file_path::id::gt), + maybe_sub_iso_file_path.as_ref().map(|sub_iso_file_path| { + file_path::materialized_path::starts_with( + sub_iso_file_path + .materialized_path_for_children() + .expect("sub path iso_file_path must be a directory"), + ) + }), + ], + ) +} + +async fn dispatch_object_processor_tasks( + file_paths_by_cas_id: Iter, + ctx: &impl OuterContext, + dispatcher: &Dispatcher, + with_priority: bool, +) -> Result>, Dispatcher::DispatchError> +where + Iter: IntoIterator, Vec)> + Send, + Iter::IntoIter: Send, + Dispatcher: TaskDispatcher, +{ + let mut current_batch = HashMap::<_, Vec<_>>::new(); + let mut tasks = vec![]; + + let mut current_batch_size = 0; + + for (cas_id, objects_to_create_or_link) in file_paths_by_cas_id { + if objects_to_create_or_link.len() >= CHUNK_SIZE { + tasks.push( + dispatcher + .dispatch(tasks::ObjectProcessor::new( + HashMap::from([(cas_id, objects_to_create_or_link)]), + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + with_priority, + )) + .await?, + ); + } else { + current_batch_size += objects_to_create_or_link.len(); + match current_batch.entry(cas_id) { + Entry::Occupied(entry) => { + entry.into_mut().extend(objects_to_create_or_link); + } + Entry::Vacant(entry) => { + entry.insert(objects_to_create_or_link); + } + } + + if current_batch_size >= CHUNK_SIZE { + tasks.push( + dispatcher + .dispatch(tasks::ObjectProcessor::new( + mem::take(&mut current_batch), + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + with_priority, + )) + .await?, + ); + + current_batch_size = 0; + } + } + } + + if !current_batch.is_empty() { + tasks.push( + dispatcher + .dispatch(tasks::ObjectProcessor::new( + current_batch, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + with_priority, + )) + .await?, + ); + } + + Ok(tasks) +} + +fn accumulate_file_paths_by_cas_id( + input: HashMap, Vec>, + accumulator: &mut HashMap, Vec>, +) { + for (cas_id, file_paths) in input { + match accumulator.entry(cas_id) { + Entry::<_, Vec<_>>::Occupied(entry) => { + entry.into_mut().extend(file_paths); + } + Entry::Vacant(entry) => { + entry.insert(file_paths); + } + } + } +} diff --git a/core/crates/heavy-lifting/src/file_identifier/shallow.rs b/core/crates/heavy-lifting/src/file_identifier/shallow.rs new file mode 100644 index 000000000..cd165867d --- /dev/null +++ b/core/crates/heavy-lifting/src/file_identifier/shallow.rs @@ -0,0 +1,222 @@ +use crate::{ + file_identifier, utils::sub_path::maybe_get_iso_file_path_from_sub_path, Error, + NonCriticalError, OuterContext, UpdateEvent, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_prisma_helpers::file_path_for_file_identifier; + +use sd_prisma::prisma::{file_path, location, SortOrder}; +use sd_task_system::{ + BaseTaskDispatcher, CancelTaskOnDrop, TaskDispatcher, TaskHandle, TaskOutput, TaskStatus, +}; +use sd_utils::db::maybe_missing; + +use std::{ + collections::HashMap, + path::{Path, PathBuf}, + sync::Arc, +}; + +use futures::{stream::FuturesUnordered, StreamExt}; +use tracing::{debug, instrument, trace, warn}; + +use super::{ + accumulate_file_paths_by_cas_id, dispatch_object_processor_tasks, orphan_path_filters_shallow, + tasks::{self, identifier, object_processor}, + CHUNK_SIZE, +}; + +#[instrument( + skip_all, + fields( + location_id = location.id, + location_path = ?location.path, + sub_path = %sub_path.as_ref().display() + ) + err, +)] +pub async fn shallow( + location: location::Data, + sub_path: impl AsRef + Send, + dispatcher: &BaseTaskDispatcher, + ctx: &impl OuterContext, +) -> Result, Error> { + let db = ctx.db(); + + let location_path = maybe_missing(&location.path, "location.path") + .map(PathBuf::from) + .map(Arc::new) + .map_err(file_identifier::Error::from)?; + + let location = Arc::new(location); + + let sub_iso_file_path = maybe_get_iso_file_path_from_sub_path::( + location.id, + Some(sub_path.as_ref()), + &*location_path, + db, + ) + .await? + .map_or_else( + || { + IsolatedFilePathData::new(location.id, &*location_path, &*location_path, true) + .map_err(file_identifier::Error::from) + }, + Ok, + )?; + + let mut orphans_count = 0; + let mut last_orphan_file_path_id = None; + + let mut identifier_tasks = vec![]; + + loop { + #[allow(clippy::cast_possible_wrap)] + // SAFETY: we know that CHUNK_SIZE is a valid i64 + let orphan_paths = db + .file_path() + .find_many(orphan_path_filters_shallow( + location.id, + last_orphan_file_path_id, + &sub_iso_file_path, + )) + .order_by(file_path::id::order(SortOrder::Asc)) + .take(CHUNK_SIZE as i64) + .select(file_path_for_file_identifier::select()) + .exec() + .await + .map_err(file_identifier::Error::from)?; + + let Some(last_orphan) = orphan_paths.last() else { + // No orphans here! + break; + }; + + orphans_count += orphan_paths.len() as u64; + last_orphan_file_path_id = Some(last_orphan.id); + + let Ok(tasks) = dispatcher + .dispatch(tasks::Identifier::new( + Arc::clone(&location), + Arc::clone(&location_path), + orphan_paths, + true, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + )) + .await + else { + debug!("Task system is shutting down while a shallow file identifier was in progress"); + return Ok(vec![]); + }; + + identifier_tasks.push(tasks); + } + + if orphans_count == 0 { + trace!("No orphans found"); + return Ok(vec![]); + } + + process_tasks(identifier_tasks, dispatcher, ctx).await +} + +async fn process_tasks( + identifier_tasks: Vec>, + dispatcher: &BaseTaskDispatcher, + ctx: &impl OuterContext, +) -> Result, Error> { + let total_identifier_tasks = identifier_tasks.len(); + + let mut pending_running_tasks = identifier_tasks + .into_iter() + .map(CancelTaskOnDrop::new) + .collect::>(); + + let mut errors = vec![]; + let mut completed_identifier_tasks = 0; + let mut file_paths_accumulator = HashMap::new(); + + while let Some(task_result) = pending_running_tasks.next().await { + match task_result { + Ok(TaskStatus::Done((_, TaskOutput::Out(any_task_output)))) => { + // We only care about ExtractFileMetadataTaskOutput because we need to dispatch further tasks + // and the ObjectProcessorTask only gives back some metrics not much important for + // shallow file identifier + if any_task_output.is::() { + let identifier::Output { + file_path_ids_with_new_object, + file_paths_by_cas_id, + errors: more_errors, + .. + } = *any_task_output.downcast().expect("just checked"); + + completed_identifier_tasks += 1; + + ctx.report_update(UpdateEvent::NewIdentifiedObjects { + file_path_ids: file_path_ids_with_new_object, + }); + + accumulate_file_paths_by_cas_id( + file_paths_by_cas_id, + &mut file_paths_accumulator, + ); + + errors.extend(more_errors); + + if total_identifier_tasks == completed_identifier_tasks { + let Ok(tasks) = dispatch_object_processor_tasks( + file_paths_accumulator.drain(), + ctx, + dispatcher, + true, + ) + .await + else { + debug!("Task system is shutting down while a shallow file identifier was in progress"); + continue; + }; + + pending_running_tasks.extend(tasks.into_iter().map(CancelTaskOnDrop::new)); + } + } else { + let object_processor::Output { + file_path_ids_with_new_object, + .. + } = *any_task_output.downcast().expect("just checked"); + + ctx.report_update(UpdateEvent::NewIdentifiedObjects { + file_path_ids: file_path_ids_with_new_object, + }); + } + } + + Ok(TaskStatus::Done((task_id, TaskOutput::Empty))) => { + warn!(%task_id, "Task returned an empty output"); + } + + Ok(TaskStatus::Shutdown(_)) => { + debug!( + "Spacedrive is shutting down while a shallow file identifier was in progress" + ); + continue; + } + + Ok(TaskStatus::Error(e)) => { + return Err(e); + } + + Ok(TaskStatus::Canceled | TaskStatus::ForcedAbortion) => { + warn!("Task was cancelled or aborted on shallow file identifier"); + return Ok(errors); + } + + Err(e) => { + return Err(e.into()); + } + } + } + + Ok(errors) +} diff --git a/core/crates/heavy-lifting/src/file_identifier/tasks/identifier.rs b/core/crates/heavy-lifting/src/file_identifier/tasks/identifier.rs new file mode 100644 index 000000000..74785d9c4 --- /dev/null +++ b/core/crates/heavy-lifting/src/file_identifier/tasks/identifier.rs @@ -0,0 +1,508 @@ +use crate::{ + file_identifier::{self, FileMetadata}, + Error, NonCriticalError, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_prisma_helpers::{file_path_for_file_identifier, CasId, FilePathPubId}; +use sd_core_sync::Manager as SyncManager; + +use sd_file_ext::kind::ObjectKind; +use sd_prisma::{ + prisma::{file_path, location, PrismaClient}, + prisma_sync, +}; +use sd_sync::OperationFactory; +use sd_task_system::{ + ExecStatus, Interrupter, InterruptionKind, IntoAnyTaskOutput, SerializableTask, Task, TaskId, +}; +use sd_utils::{error::FileIOError, msgpack}; + +use std::{ + collections::HashMap, future::IntoFuture, mem, path::PathBuf, pin::pin, sync::Arc, + time::Duration, +}; + +use futures::stream::{self, FuturesUnordered, StreamExt}; +use futures_concurrency::{future::TryJoin, stream::Merge}; +use serde::{Deserialize, Serialize}; +use tokio::time::Instant; +use tracing::{error, instrument, trace, Level}; + +use super::{create_objects_and_update_file_paths, FilePathToCreateOrLinkObject}; + +#[derive(Debug, Serialize, Deserialize)] +struct IdentifiedFile { + file_path: file_path_for_file_identifier::Data, + cas_id: CasId<'static>, + kind: ObjectKind, +} + +impl IdentifiedFile { + pub fn new( + file_path: file_path_for_file_identifier::Data, + cas_id: impl Into>, + kind: ObjectKind, + ) -> Self { + Self { + file_path, + cas_id: cas_id.into(), + kind, + } + } +} + +#[derive(Debug)] +pub struct Identifier { + // Task control + id: TaskId, + with_priority: bool, + + // Received input args + location: Arc, + location_path: Arc, + file_paths_by_id: HashMap, + + // Inner state + identified_files: HashMap, + file_paths_without_cas_id: Vec, + + // Out collector + output: Output, + + // Dependencies + db: Arc, + sync: Arc, +} + +/// Output from the `[Identifier]` task +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct Output { + /// To send to frontend for priority reporting of new objects + pub file_path_ids_with_new_object: Vec, + + /// Files that need to be aggregate between many identifier tasks to be processed by the + /// object processor tasks + pub file_paths_by_cas_id: HashMap, Vec>, + + /// Collected metric about time elapsed extracting metadata from file system + pub extract_metadata_time: Duration, + + /// Collected metric about time spent saving objects on disk + pub save_db_time: Duration, + + /// Total number of objects already created as they didn't have `cas_id`, like directories or empty files + pub created_objects_count: u64, + + /// Total number of files that we were able to identify + pub total_identified_files: u64, + + /// Non critical errors that happened during the task execution + pub errors: Vec, +} + +#[async_trait::async_trait] +impl Task for Identifier { + fn id(&self) -> TaskId { + self.id + } + + fn with_priority(&self) -> bool { + self.with_priority + } + + #[instrument( + skip(self, interrupter), + fields( + task_id = %self.id, + location_id = %self.location.id, + location_path = %self.location_path.display(), + files_count = %self.file_paths_by_id.len(), + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above + async fn run(&mut self, interrupter: &Interrupter) -> Result { + // `Processed` is larger than `Interrupt`, but it's much more common + // so we ignore the size difference to optimize for usage + #[allow(clippy::large_enum_variant)] + enum StreamMessage { + Processed(FilePathPubId, Result), + Interrupt(InterruptionKind), + } + + let Self { + location, + location_path, + file_paths_by_id, + file_paths_without_cas_id, + identified_files, + output, + .. + } = self; + + if !file_paths_by_id.is_empty() { + let start_time = Instant::now(); + + let extraction_futures = file_paths_by_id + .iter() + .filter_map(|(file_path_id, file_path)| { + try_iso_file_path_extraction( + location.id, + file_path_id.clone(), + file_path, + Arc::clone(location_path), + &mut output.errors, + ) + }) + .map(|(file_path_id, iso_file_path, location_path)| async move { + StreamMessage::Processed( + file_path_id, + FileMetadata::new(&*location_path, &iso_file_path).await, + ) + }) + .collect::>(); + + let mut msg_stream = pin!(( + extraction_futures, + stream::once(interrupter.into_future()).map(StreamMessage::Interrupt) + ) + .merge()); + + while let Some(msg) = msg_stream.next().await { + match msg { + StreamMessage::Processed(file_path_pub_id, res) => { + let file_path = file_paths_by_id + .remove(&file_path_pub_id) + .expect("file_path must be here"); + + trace!( + files_remaining = file_paths_by_id.len(), + %file_path_pub_id, + "Processed file;", + ); + + match res { + Ok(FileMetadata { + cas_id: Some(cas_id), + kind, + .. + }) => { + identified_files.insert( + file_path_pub_id, + IdentifiedFile::new(file_path, cas_id, kind), + ); + } + Ok(FileMetadata { + cas_id: None, kind, .. + }) => { + let file_path_for_file_identifier::Data { + id, + pub_id, + date_created, + .. + } = file_path; + file_paths_without_cas_id.push(FilePathToCreateOrLinkObject { + id, + file_path_pub_id: pub_id.into(), + kind, + created_at: date_created, + }); + } + Err(e) => { + handle_non_critical_errors( + file_path_pub_id, + &e, + &mut output.errors, + ); + } + } + + if file_paths_by_id.is_empty() { + trace!("All files have been processed"); + // All files have been processed so we can end this merged stream + // and don't keep waiting an interrupt signal + break; + } + } + + StreamMessage::Interrupt(kind) => { + trace!(?kind, "Interrupted;"); + output.extract_metadata_time += start_time.elapsed(); + return Ok(match kind { + InterruptionKind::Pause => ExecStatus::Paused, + InterruptionKind::Cancel => ExecStatus::Canceled, + }); + } + } + } + + output.extract_metadata_time = start_time.elapsed(); + + output.total_identified_files = + identified_files.len() as u64 + file_paths_without_cas_id.len() as u64; + + trace!( + identified_files_count = identified_files.len(), + "All files have been processed, saving cas_ids to db...;" + ); + let start_time = Instant::now(); + // Assign cas_id to each file path + let ((), file_path_ids_with_new_object) = ( + assign_cas_id_to_file_paths(identified_files, &self.db, &self.sync), + create_objects_and_update_file_paths( + file_paths_without_cas_id.drain(..), + &self.db, + &self.sync, + ), + ) + .try_join() + .await?; + + output.save_db_time = start_time.elapsed(); + output.created_objects_count = file_path_ids_with_new_object.len() as u64; + output.file_path_ids_with_new_object = + file_path_ids_with_new_object.into_keys().collect(); + + output.file_paths_by_cas_id = identified_files.drain().fold( + HashMap::new(), + |mut map, + ( + file_path_pub_id, + IdentifiedFile { + cas_id, + kind, + file_path: + file_path_for_file_identifier::Data { + id, date_created, .. + }, + }, + )| { + map.entry(cas_id) + .or_insert_with(|| Vec::with_capacity(1)) + .push(FilePathToCreateOrLinkObject { + id, + file_path_pub_id, + kind, + created_at: date_created, + }); + + map + }, + ); + + trace!(save_db_time = ?output.save_db_time, "Cas_ids saved to db;"); + } + + Ok(ExecStatus::Done(mem::take(output).into_output())) + } +} + +impl Identifier { + #[must_use] + pub fn new( + location: Arc, + location_path: Arc, + file_paths: Vec, + with_priority: bool, + db: Arc, + sync: Arc, + ) -> Self { + Self { + id: TaskId::new_v4(), + location, + location_path, + identified_files: HashMap::with_capacity(file_paths.len()), + file_paths_without_cas_id: Vec::with_capacity(file_paths.len()), + file_paths_by_id: file_paths + .into_iter() + .map(|file_path| (file_path.pub_id.as_slice().into(), file_path)) + .collect(), + output: Output::default(), + with_priority, + db, + sync, + } + } +} + +#[instrument(skip_all, err, fields(identified_files_count = identified_files.len()))] +async fn assign_cas_id_to_file_paths( + identified_files: &HashMap, + db: &PrismaClient, + sync: &SyncManager, +) -> Result<(), file_identifier::Error> { + // Assign cas_id to each file path + sync.write_ops( + db, + identified_files + .iter() + .map(|(pub_id, IdentifiedFile { cas_id, .. })| { + ( + sync.shared_update( + prisma_sync::file_path::SyncId { + pub_id: pub_id.to_db(), + }, + file_path::cas_id::NAME, + msgpack!(cas_id), + ), + db.file_path() + .update( + file_path::pub_id::equals(pub_id.to_db()), + vec![file_path::cas_id::set(cas_id.into())], + ) + // We don't need any data here, just the id avoids receiving the entire object + // as we can't pass an empty select macro call + .select(file_path::select!({ id })), + ) + }) + .unzip::<_, _, _, Vec<_>>(), + ) + .await?; + + Ok(()) +} + +#[instrument(skip(errors))] +fn handle_non_critical_errors( + file_path_pub_id: FilePathPubId, + e: &FileIOError, + errors: &mut Vec, +) { + let formatted_error = format!(""); + + #[cfg(target_os = "windows")] + { + // Handle case where file is on-demand (NTFS only) + if e.source.raw_os_error().map_or(false, |code| code == 362) { + errors.push( + file_identifier::NonCriticalFileIdentifierError::FailedToExtractMetadataFromOnDemandFile( + formatted_error, + ) + .into(), + ); + } else { + errors.push( + file_identifier::NonCriticalFileIdentifierError::FailedToExtractFileMetadata( + formatted_error, + ) + .into(), + ); + } + } + + #[cfg(not(target_os = "windows"))] + { + errors.push( + file_identifier::NonCriticalFileIdentifierError::FailedToExtractFileMetadata( + formatted_error, + ) + .into(), + ); + } +} + +#[instrument( + skip(location_id, file_path, location_path, errors), + fields( + file_path_id = file_path.id, + materialized_path = ?file_path.materialized_path, + name = ?file_path.name, + extension = ?file_path.extension, + ) +)] +fn try_iso_file_path_extraction( + location_id: location::id::Type, + file_path_pub_id: FilePathPubId, + file_path: &file_path_for_file_identifier::Data, + location_path: Arc, + errors: &mut Vec, +) -> Option<(FilePathPubId, IsolatedFilePathData<'static>, Arc)> { + IsolatedFilePathData::try_from((location_id, file_path)) + .map(IsolatedFilePathData::to_owned) + .map_err(|e| { + error!(?e, "Failed to extract isolated file path data;"); + errors.push( + file_identifier::NonCriticalFileIdentifierError::FailedToExtractIsolatedFilePathData(format!( + "" + )) + .into(), + ); + }) + .map(|iso_file_path| (file_path_pub_id, iso_file_path, location_path)) + .ok() +} + +#[derive(Serialize, Deserialize)] +struct SaveState { + id: TaskId, + location: Arc, + location_path: Arc, + file_paths_by_id: HashMap, + identified_files: HashMap, + file_paths_without_cas_id: Vec, + output: Output, + with_priority: bool, +} + +impl SerializableTask for Identifier { + type SerializeError = rmp_serde::encode::Error; + + type DeserializeError = rmp_serde::decode::Error; + + type DeserializeCtx = (Arc, Arc); + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + location, + location_path, + file_paths_by_id, + identified_files, + file_paths_without_cas_id, + output, + with_priority, + .. + } = self; + rmp_serde::to_vec_named(&SaveState { + id, + location, + location_path, + file_paths_by_id, + identified_files, + file_paths_without_cas_id, + output, + with_priority, + }) + } + + async fn deserialize( + data: &[u8], + (db, sync): Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice::(data).map( + |SaveState { + id, + location, + location_path, + file_paths_by_id, + identified_files, + file_paths_without_cas_id, + output, + with_priority, + }| Self { + id, + with_priority, + location, + location_path, + file_paths_by_id, + identified_files, + file_paths_without_cas_id, + output, + db, + sync, + }, + ) + } +} diff --git a/core/crates/heavy-lifting/src/file_identifier/tasks/mod.rs b/core/crates/heavy-lifting/src/file_identifier/tasks/mod.rs new file mode 100644 index 000000000..f74a03b4a --- /dev/null +++ b/core/crates/heavy-lifting/src/file_identifier/tasks/mod.rs @@ -0,0 +1,171 @@ +use crate::file_identifier; + +use sd_core_prisma_helpers::{file_path_id, FilePathPubId, ObjectPubId}; +use sd_core_sync::Manager as SyncManager; + +use sd_file_ext::kind::ObjectKind; +use sd_prisma::{ + prisma::{file_path, object, PrismaClient}, + prisma_sync, +}; +use sd_sync::{CRDTOperation, OperationFactory}; +use sd_utils::msgpack; + +use std::collections::{HashMap, HashSet}; + +use chrono::{DateTime, FixedOffset}; +use prisma_client_rust::Select; +use serde::{Deserialize, Serialize}; +use tracing::{instrument, trace, Level}; + +pub mod identifier; +pub mod object_processor; + +pub use identifier::Identifier; +pub use object_processor::ObjectProcessor; + +/// This object has all needed data to create a new `object` for a `file_path` or link an existing one. +#[derive(Debug, Serialize, Deserialize)] +pub(super) struct FilePathToCreateOrLinkObject { + id: file_path::id::Type, + file_path_pub_id: FilePathPubId, + kind: ObjectKind, + created_at: Option>, +} + +#[instrument(skip(sync, db))] +fn connect_file_path_to_object<'db>( + file_path_pub_id: &FilePathPubId, + object_pub_id: &ObjectPubId, + db: &'db PrismaClient, + sync: &SyncManager, +) -> (CRDTOperation, Select<'db, file_path_id::Data>) { + trace!("Connecting"); + + ( + sync.shared_update( + prisma_sync::file_path::SyncId { + pub_id: file_path_pub_id.to_db(), + }, + file_path::object::NAME, + msgpack!(prisma_sync::object::SyncId { + pub_id: object_pub_id.to_db(), + }), + ), + db.file_path() + .update( + file_path::pub_id::equals(file_path_pub_id.to_db()), + vec![file_path::object::connect(object::pub_id::equals( + object_pub_id.to_db(), + ))], + ) + // selecting just id to avoid fetching the whole object + .select(file_path_id::select()), + ) +} + +#[instrument(skip_all, ret(level = Level::TRACE), err)] +async fn create_objects_and_update_file_paths( + files_and_kinds: impl IntoIterator + Send, + db: &PrismaClient, + sync: &SyncManager, +) -> Result, file_identifier::Error> { + trace!("Preparing objects"); + let (object_create_args, file_path_args) = files_and_kinds + .into_iter() + .map( + |FilePathToCreateOrLinkObject { + id, + file_path_pub_id, + kind, + created_at, + }| { + let object_pub_id = ObjectPubId::new(); + + let kind = kind as i32; + + let (sync_params, db_params) = [ + ( + (object::date_created::NAME, msgpack!(created_at)), + object::date_created::set(created_at), + ), + ( + (object::kind::NAME, msgpack!(kind)), + object::kind::set(Some(kind)), + ), + ] + .into_iter() + .unzip::<_, _, Vec<_>, Vec<_>>(); + + ( + ( + sync.shared_create( + prisma_sync::object::SyncId { + pub_id: object_pub_id.to_db(), + }, + sync_params, + ), + object::create_unchecked(object_pub_id.to_db(), db_params), + ), + ( + (id, object_pub_id.clone()), + connect_file_path_to_object(&file_path_pub_id, &object_pub_id, db, sync), + ), + ) + }, + ) + .unzip::<_, _, Vec<_>, Vec<_>>(); + + let (mut object_pub_id_by_file_path_id, file_path_update_args) = file_path_args + .into_iter() + .unzip::<_, _, HashMap<_, _>, Vec<_>>( + ); + + trace!( + new_objects_count = object_create_args.len(), + "Creating new Objects!;", + ); + + // create new object records with assembled values + let created_objects_count = sync + .write_ops(db, { + let (sync, db_params) = object_create_args + .into_iter() + .unzip::<_, _, Vec<_>, Vec<_>>(); + + ( + sync.into_iter().flatten().collect(), + db.object().create_many(db_params), + ) + }) + .await?; + + trace!(%created_objects_count, "Created new Objects;"); + + if created_objects_count > 0 { + trace!("Updating file paths with created objects"); + + let updated_file_path_ids = sync + .write_ops( + db, + file_path_update_args + .into_iter() + .unzip::<_, _, Vec<_>, Vec<_>>(), + ) + .await + .map(|file_paths| { + file_paths + .into_iter() + .map(|file_path_id::Data { id }| id) + .collect::>() + })?; + + object_pub_id_by_file_path_id + .retain(|file_path_id, _| updated_file_path_ids.contains(file_path_id)); + + Ok(object_pub_id_by_file_path_id) + } else { + trace!("No objects created, skipping file path updates"); + Ok(HashMap::new()) + } +} diff --git a/core/crates/heavy-lifting/src/file_identifier/tasks/object_processor.rs b/core/crates/heavy-lifting/src/file_identifier/tasks/object_processor.rs new file mode 100644 index 000000000..458cb5654 --- /dev/null +++ b/core/crates/heavy-lifting/src/file_identifier/tasks/object_processor.rs @@ -0,0 +1,420 @@ +use crate::{file_identifier, Error}; + +use sd_core_prisma_helpers::{file_path_id, object_for_file_identifier, CasId, ObjectPubId}; +use sd_core_sync::Manager as SyncManager; + +use sd_prisma::prisma::{file_path, object, PrismaClient}; +use sd_task_system::{ + check_interruption, ExecStatus, Interrupter, IntoAnyTaskOutput, SerializableTask, Task, TaskId, +}; + +use std::{collections::HashMap, mem, sync::Arc, time::Duration}; + +use serde::{Deserialize, Serialize}; +use tokio::time::Instant; +use tracing::{instrument, trace, Level}; + +use super::{ + connect_file_path_to_object, create_objects_and_update_file_paths, FilePathToCreateOrLinkObject, +}; + +#[derive(Debug)] +pub struct ObjectProcessor { + // Task control + id: TaskId, + with_priority: bool, + + // Received input args + file_paths_by_cas_id: HashMap, Vec>, + + // Inner state + stage: Stage, + + // Out collector + output: Output, + + // Dependencies + db: Arc, + sync: Arc, +} + +#[derive(Debug, Serialize, Deserialize)] +enum Stage { + Starting, + AssignFilePathsToExistingObjects { + existing_objects_by_cas_id: HashMap, ObjectPubId>, + }, + CreateObjects, +} + +/// Output from the `[ObjectProcessor]` task +#[derive(Debug, Serialize, Deserialize, Default)] +pub struct Output { + /// To send to frontend for priority reporting of new objects + pub file_path_ids_with_new_object: Vec, + + /// Time elapsed fetching existing `objects` from db to be linked to `file_paths` + pub fetch_existing_objects_time: Duration, + + /// Time spent linking `file_paths` to already existing `objects` + pub assign_to_existing_object_time: Duration, + + /// Time spent creating new `objects` + pub create_object_time: Duration, + + /// Number of new `objects` created + pub created_objects_count: u64, + + /// Number of `objects` that were linked to `file_paths` + pub linked_objects_count: u64, +} + +#[async_trait::async_trait] +impl Task for ObjectProcessor { + fn id(&self) -> TaskId { + self.id + } + + fn with_priority(&self) -> bool { + self.with_priority + } + + #[instrument( + skip(self, interrupter), + fields( + task_id = %self.id, + cas_ids_count = %self.file_paths_by_cas_id.len(), + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above + async fn run(&mut self, interrupter: &Interrupter) -> Result { + let Self { + db, + sync, + file_paths_by_cas_id, + stage, + output: + Output { + file_path_ids_with_new_object, + fetch_existing_objects_time, + assign_to_existing_object_time, + create_object_time, + created_objects_count, + linked_objects_count, + }, + .. + } = self; + + loop { + match stage { + Stage::Starting => { + trace!("Starting object processor task"); + let start = Instant::now(); + let existing_objects_by_cas_id = + fetch_existing_objects_by_cas_id(file_paths_by_cas_id.keys(), db).await?; + *fetch_existing_objects_time = start.elapsed(); + + trace!( + elapsed_time = ?fetch_existing_objects_time, + existing_objects_count = existing_objects_by_cas_id.len(), + "Fetched existing Objects;", + ); + *stage = Stage::AssignFilePathsToExistingObjects { + existing_objects_by_cas_id, + }; + } + + Stage::AssignFilePathsToExistingObjects { + existing_objects_by_cas_id, + } => { + trace!( + existing_objects_to_link = existing_objects_by_cas_id.len(), + "Assigning file paths to existing Objects;", + ); + let start = Instant::now(); + let more_file_path_ids_with_new_object = assign_existing_objects_to_file_paths( + file_paths_by_cas_id, + existing_objects_by_cas_id, + db, + sync, + ) + .await?; + *assign_to_existing_object_time = start.elapsed(); + file_path_ids_with_new_object.extend(more_file_path_ids_with_new_object); + *linked_objects_count += file_path_ids_with_new_object.len() as u64; + + trace!( + existing_objects_to_link = existing_objects_by_cas_id.len(), + %linked_objects_count, + "Found existing Objects, linked file paths to them;", + ); + + *stage = Stage::CreateObjects; + + if file_paths_by_cas_id.is_empty() { + trace!("No more objects to be created, finishing task"); + // No objects to be created, we're good to finish already + break; + } + } + + Stage::CreateObjects => { + trace!( + creating_count = file_paths_by_cas_id.len(), + "Creating new Objects;" + ); + let start = Instant::now(); + let (more_file_paths_with_new_object, more_linked_objects_count) = + assign_objects_to_duplicated_orphans(file_paths_by_cas_id, db, sync) + .await?; + *create_object_time = start.elapsed(); + file_path_ids_with_new_object.extend(more_file_paths_with_new_object); + *linked_objects_count += more_linked_objects_count; + + *created_objects_count = file_path_ids_with_new_object.len() as u64; + + trace!(%created_objects_count, ?create_object_time, "Created new Objects;"); + + break; + } + } + + check_interruption!(interrupter); + } + + Ok(ExecStatus::Done(mem::take(&mut self.output).into_output())) + } +} + +impl ObjectProcessor { + #[must_use] + pub fn new( + file_paths_by_cas_id: HashMap, Vec>, + db: Arc, + sync: Arc, + with_priority: bool, + ) -> Self { + Self { + id: TaskId::new_v4(), + db, + sync, + file_paths_by_cas_id, + stage: Stage::Starting, + output: Output::default(), + with_priority, + } + } +} + +/// Retrieves objects that are already connected to file paths with the same cas_id +#[instrument(skip_all, err)] +async fn fetch_existing_objects_by_cas_id<'cas_id, Iter>( + cas_ids: Iter, + db: &PrismaClient, +) -> Result, ObjectPubId>, file_identifier::Error> +where + Iter: IntoIterator> + Send, + Iter::IntoIter: Send, +{ + async fn inner( + stringed_cas_ids: Vec, + db: &PrismaClient, + ) -> Result, ObjectPubId>, file_identifier::Error> { + db.object() + .find_many(vec![object::file_paths::some(vec![ + file_path::cas_id::in_vec(stringed_cas_ids), + file_path::object_id::not(None), + ])]) + .select(object_for_file_identifier::select()) + .exec() + .await + .map_err(Into::into) + .map(|objects| { + objects + .into_iter() + .filter_map(|object_for_file_identifier::Data { pub_id, file_paths }| { + file_paths + .first() + .and_then(|file_path| { + file_path + .cas_id + .as_ref() + .map(CasId::from) + .map(CasId::into_owned) + }) + .map(|cas_id| (cas_id, pub_id.into())) + }) + .collect() + }) + } + + let stringed_cas_ids = cas_ids.into_iter().map(Into::into).collect::>(); + + trace!( + cas_ids_count = stringed_cas_ids.len(), + "Fetching existing objects by cas_ids;", + ); + + inner(stringed_cas_ids, db).await +} + +/// Attempt to associate each file path with an object that has been +/// connected to file paths with the same cas_id +#[instrument(skip_all, err, fields(identified_files_count = file_paths_by_cas_id.len()))] +async fn assign_existing_objects_to_file_paths( + file_paths_by_cas_id: &mut HashMap, Vec>, + objects_by_cas_id: &HashMap, ObjectPubId>, + db: &PrismaClient, + sync: &SyncManager, +) -> Result, file_identifier::Error> { + sync.write_ops( + db, + objects_by_cas_id + .iter() + .flat_map(|(cas_id, object_pub_id)| { + file_paths_by_cas_id + .remove(cas_id) + .map(|file_paths| { + file_paths.into_iter().map( + |FilePathToCreateOrLinkObject { + file_path_pub_id, .. + }| { + connect_file_path_to_object( + &file_path_pub_id, + object_pub_id, + db, + sync, + ) + }, + ) + }) + .expect("must be here") + }) + .unzip::<_, _, Vec<_>, Vec<_>>(), + ) + .await + .map(|file_paths| { + file_paths + .into_iter() + .map(|file_path_id::Data { id }| id) + .collect() + }) + .map_err(Into::into) +} + +async fn assign_objects_to_duplicated_orphans( + file_paths_by_cas_id: &mut HashMap, Vec>, + db: &PrismaClient, + sync: &SyncManager, +) -> Result<(Vec, u64), file_identifier::Error> { + // at least 1 file path per cas_id + let mut selected_file_paths = Vec::with_capacity(file_paths_by_cas_id.len()); + let mut cas_ids_by_file_path_id = HashMap::with_capacity(file_paths_by_cas_id.len()); + + file_paths_by_cas_id.retain(|cas_id, file_paths| { + let file_path = file_paths.pop().expect("file_paths can't be empty"); + let has_more_file_paths = !file_paths.is_empty(); + + if has_more_file_paths { + cas_ids_by_file_path_id.insert(file_path.id, cas_id.clone()); + } + selected_file_paths.push(file_path); + + has_more_file_paths + }); + + let (mut file_paths_with_new_object, objects_by_cas_id) = + create_objects_and_update_file_paths(selected_file_paths, db, sync) + .await? + .into_iter() + .map(|(file_path_id, object_pub_id)| { + ( + file_path_id, + cas_ids_by_file_path_id + .remove(&file_path_id) + .map(|cas_id| (cas_id, object_pub_id)), + ) + }) + .unzip::<_, _, Vec<_>, Vec<_>>(); + + let more_file_paths_ids_with_new_object = assign_existing_objects_to_file_paths( + file_paths_by_cas_id, + &objects_by_cas_id.into_iter().flatten().collect(), + db, + sync, + ) + .await?; + + // Sanity check + assert!( + file_paths_by_cas_id.is_empty(), + "We MUST have processed all pending `file_paths` by now" + ); + + let linked_objects_count = more_file_paths_ids_with_new_object.len() as u64; + + file_paths_with_new_object.extend(more_file_paths_ids_with_new_object); + + Ok((file_paths_with_new_object, linked_objects_count)) +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct SaveState { + id: TaskId, + file_paths_by_cas_id: HashMap, Vec>, + stage: Stage, + output: Output, + with_priority: bool, +} + +impl SerializableTask for ObjectProcessor { + type SerializeError = rmp_serde::encode::Error; + + type DeserializeError = rmp_serde::decode::Error; + + type DeserializeCtx = (Arc, Arc); + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + file_paths_by_cas_id, + stage, + output, + with_priority, + .. + } = self; + + rmp_serde::to_vec_named(&SaveState { + id, + file_paths_by_cas_id, + stage, + output, + with_priority, + }) + } + + async fn deserialize( + data: &[u8], + (db, sync): Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice(data).map( + |SaveState { + id, + file_paths_by_cas_id, + stage, + output, + with_priority, + }| Self { + id, + with_priority, + file_paths_by_cas_id, + stage, + output, + db, + sync, + }, + ) + } +} diff --git a/core/crates/heavy-lifting/src/indexer/job.rs b/core/crates/heavy-lifting/src/indexer/job.rs index d85f2fd32..22546950e 100644 --- a/core/crates/heavy-lifting/src/indexer/job.rs +++ b/core/crates/heavy-lifting/src/indexer/job.rs @@ -1,28 +1,30 @@ use crate::{ - indexer::BATCH_SIZE, + indexer, job_system::{ job::{ Job, JobContext, JobName, JobReturn, JobTaskDispatcher, ProgressUpdate, ReturnStatus, }, report::ReportOutputMetadata, utils::cancel_pending_tasks, - SerializableJob, SerializedTasks, + DispatcherError, JobErrorOrDispatcherError, SerializableJob, SerializedTasks, }, - Error, NonCriticalJobError, + utils::sub_path::get_full_path_from_sub_path, + Error, LocationScanState, NonCriticalError, OuterContext, }; use sd_core_file_path_helper::IsolatedFilePathData; use sd_core_indexer_rules::{IndexerRule, IndexerRuler}; use sd_core_prisma_helpers::location_with_indexer_rules; +use sd_prisma::prisma::location; use sd_task_system::{ AnyTaskOutput, IntoTask, SerializableTask, Task, TaskDispatcher, TaskHandle, TaskId, TaskOutput, TaskStatus, }; -use sd_utils::db::maybe_missing; +use sd_utils::{db::maybe_missing, u64_to_frontend}; use std::{ - collections::{HashMap, HashSet}, + collections::{HashMap, HashSet, VecDeque}, hash::{Hash, Hasher}, mem, path::PathBuf, @@ -36,49 +38,157 @@ use itertools::Itertools; use serde::{Deserialize, Serialize}; use serde_json::json; use tokio::time::Instant; -use tracing::warn; +use tracing::{debug, instrument, trace, warn, Level}; use super::{ - determine_initial_walk_path, remove_non_existing_file_paths, reverse_update_directories_sizes, + remove_non_existing_file_paths, reverse_update_directories_sizes, tasks::{ - saver::{SaveTask, SaveTaskOutput}, - updater::{UpdateTask, UpdateTaskOutput}, - walker::{WalkDirTask, WalkTaskOutput, WalkedEntry}, + self, saver, updater, + walker::{self, WalkedEntry}, }, - update_directory_sizes, update_location_size, IndexerError, IsoFilePathFactory, WalkerDBProxy, + update_directory_sizes, update_location_size, IsoFilePathFactory, WalkerDBProxy, BATCH_SIZE, }; #[derive(Debug)] -pub struct IndexerJob { +pub struct Indexer { + // Received arguments location: location_with_indexer_rules::Data, sub_path: Option, - metadata: Metadata, + // Derived from received arguments iso_file_path_factory: IsoFilePathFactory, indexer_ruler: IndexerRuler, walker_root_path: Option>, + + // Inner state ancestors_needing_indexing: HashSet, ancestors_already_indexed: HashSet>, iso_paths_and_sizes: HashMap, u64>, - errors: Vec, + // Optimizations + processing_first_directory: bool, + to_create_buffer: VecDeque, + to_update_buffer: VecDeque, + // Run data + metadata: Metadata, + errors: Vec, + + // On shutdown data pending_tasks_on_resume: Vec>, tasks_for_shutdown: Vec>>, } -impl Job for IndexerJob { +impl Job for Indexer { const NAME: JobName = JobName::Indexer; - async fn run( + async fn resume_tasks( + &mut self, + dispatcher: &JobTaskDispatcher, + ctx: &impl JobContext, + SerializedTasks(serialized_tasks): SerializedTasks, + ) -> Result<(), Error> { + let location_id = self.location.id; + + if let Ok(tasks) = dispatcher + .dispatch_many_boxed( + rmp_serde::from_slice::)>>(&serialized_tasks) + .map_err(indexer::Error::from)? + .into_iter() + .map(|(task_kind, task_bytes)| { + let indexer_ruler = self.indexer_ruler.clone(); + let iso_file_path_factory = self.iso_file_path_factory.clone(); + async move { + match task_kind { + TaskKind::Walk => tasks::Walker::deserialize( + &task_bytes, + ( + indexer_ruler.clone(), + WalkerDBProxy { + location_id, + db: Arc::clone(ctx.db()), + }, + iso_file_path_factory.clone(), + ), + ) + .await + .map(IntoTask::into_task), + + TaskKind::Save => tasks::Saver::deserialize( + &task_bytes, + (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), + ) + .await + .map(IntoTask::into_task), + TaskKind::Update => tasks::Updater::deserialize( + &task_bytes, + (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), + ) + .await + .map(IntoTask::into_task), + } + } + }) + .collect::>() + .try_join() + .await + .map_err(indexer::Error::from)?, + ) + .await + { + self.pending_tasks_on_resume = tasks; + } else { + warn!("Failed to dispatch tasks to resume as job was already canceled"); + } + + Ok(()) + } + + #[instrument( + skip_all, + fields( + location_id = self.location.id, + location_path = ?self.location.path, + sub_path = ?self.sub_path.as_ref().map(|path| path.display()), + ), + ret(level = Level::TRACE), + err, + )] + async fn run( mut self, dispatcher: JobTaskDispatcher, - ctx: impl JobContext, + ctx: impl JobContext, ) -> Result { let mut pending_running_tasks = FuturesUnordered::new(); - self.init_or_resume(&mut pending_running_tasks, &ctx, &dispatcher) - .await?; + match self + .init_or_resume(&mut pending_running_tasks, &ctx, &dispatcher) + .await + { + Ok(()) => { /* Everything is awesome! */ } + Err(JobErrorOrDispatcherError::JobError(e)) => { + return Err(e.into()); + } + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(_))) => { + return Ok(self.cancel_job(&mut pending_running_tasks).await); + } + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown(tasks))) => { + self.tasks_for_shutdown.extend(tasks); + + if pending_running_tasks.is_empty() { + assert_eq!( + self.tasks_for_shutdown.len() as u64, + self.metadata.total_tasks - self.metadata.completed_tasks, + "Shutting down a job without collecting all pending tasks" + ); + // If no task managed to be dispatched, we can just shutdown + // otherwise we have to process handles below and wait for them to be shutdown too + return Ok(ReturnStatus::Shutdown( + SerializableJob::::serialize(self).await, + )); + } + } + } if let Some(res) = self .process_handles(&mut pending_running_tasks, &ctx, &dispatcher) @@ -87,43 +197,29 @@ impl Job for IndexerJob { return res; } - if !self.tasks_for_shutdown.is_empty() { - return Ok(ReturnStatus::Shutdown(self.serialize().await)); + if let Some(res) = self + .dispatch_last_save_and_update_tasks(&mut pending_running_tasks, &ctx, &dispatcher) + .await + { + return res; } - if !self.ancestors_needing_indexing.is_empty() { - let save_tasks = self - .ancestors_needing_indexing - .drain() - .chunks(BATCH_SIZE) - .into_iter() - .map(|chunk| { - let chunked_saves = chunk.collect::>(); - self.metadata.total_paths += chunked_saves.len() as u64; - self.metadata.total_save_steps += 1; + if let Some(res) = self + .index_pending_ancestors(&mut pending_running_tasks, &ctx, &dispatcher) + .await + { + return res; + } - SaveTask::new( - self.location.id, - self.location.pub_id.clone(), - chunked_saves, - Arc::clone(ctx.db()), - Arc::clone(ctx.sync()), - ) - }) - .collect::>(); - - pending_running_tasks.extend(dispatcher.dispatch_many(save_tasks).await); - - if let Some(res) = self - .process_handles(&mut pending_running_tasks, &ctx, &dispatcher) - .await - { - return res; - } - - if !self.tasks_for_shutdown.is_empty() { - return Ok(ReturnStatus::Shutdown(self.serialize().await)); - } + if !self.tasks_for_shutdown.is_empty() { + assert_eq!( + self.tasks_for_shutdown.len() as u64, + self.metadata.total_tasks - self.metadata.completed_tasks, + "Shutting down a job without collecting all pending tasks" + ); + return Ok(ReturnStatus::Shutdown( + SerializableJob::::serialize(self).await, + )); } // From here onward, job will not be interrupted anymore @@ -157,9 +253,13 @@ impl Job for IndexerJob { .await?; } - update_location_size(location.id, ctx.db(), &ctx.query_invalidator()).await?; + update_location_size(location.id, ctx.db(), &ctx).await?; - metadata.db_write_time += start_size_update_time.elapsed(); + metadata.mean_db_write_time += start_size_update_time.elapsed(); + } + + if metadata.removed_count > 0 { + // TODO: Dispatch a task to remove orphan objects } if metadata.indexed_count > 0 || metadata.removed_count > 0 { @@ -171,6 +271,16 @@ impl Job for IndexerJob { "all tasks must be completed here" ); + ctx.db() + .location() + .update( + location::id::equals(location.id), + vec![location::scan_state::set(LocationScanState::Indexed as i32)], + ) + .exec() + .await + .map_err(indexer::Error::from)?; + Ok(ReturnStatus::Completed( JobReturn::builder() .with_metadata(metadata) @@ -178,71 +288,13 @@ impl Job for IndexerJob { .build(), )) } - - async fn resume_tasks( - &mut self, - dispatcher: &JobTaskDispatcher, - ctx: &impl JobContext, - SerializedTasks(serialized_tasks): SerializedTasks, - ) -> Result<(), Error> { - let location_id = self.location.id; - - self.pending_tasks_on_resume = dispatcher - .dispatch_many_boxed( - rmp_serde::from_slice::)>>(&serialized_tasks) - .map_err(IndexerError::from)? - .into_iter() - .map(|(task_kind, task_bytes)| { - let indexer_ruler = self.indexer_ruler.clone(); - let iso_file_path_factory = self.iso_file_path_factory.clone(); - async move { - match task_kind { - TaskKind::Walk => WalkDirTask::deserialize( - &task_bytes, - ( - indexer_ruler.clone(), - WalkerDBProxy { - location_id, - db: Arc::clone(ctx.db()), - }, - iso_file_path_factory.clone(), - dispatcher.clone(), - ), - ) - .await - .map(IntoTask::into_task), - - TaskKind::Save => SaveTask::deserialize( - &task_bytes, - (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), - ) - .await - .map(IntoTask::into_task), - TaskKind::Update => UpdateTask::deserialize( - &task_bytes, - (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), - ) - .await - .map(IntoTask::into_task), - } - } - }) - .collect::>() - .try_join() - .await - .map_err(IndexerError::from)?, - ) - .await; - - Ok(()) - } } -impl IndexerJob { +impl Indexer { pub fn new( location: location_with_indexer_rules::Data, sub_path: Option, - ) -> Result { + ) -> Result { Ok(Self { indexer_ruler: location .indexer_rules @@ -263,6 +315,12 @@ impl IndexerJob { location, sub_path, metadata: Metadata::default(), + + processing_first_directory: true, + + to_create_buffer: VecDeque::new(), + to_update_buffer: VecDeque::new(), + errors: Vec::new(), pending_tasks_on_resume: Vec::new(), @@ -275,53 +333,64 @@ impl IndexerJob { /// # Panics /// Will panic if another task type is added in the job, but this function wasn't updated to handle it /// - async fn process_task_output( + async fn process_task_output( &mut self, task_id: TaskId, any_task_output: Box, - job_ctx: &impl JobContext, + ctx: &impl JobContext, dispatcher: &JobTaskDispatcher, - ) -> Result>, IndexerError> { - if any_task_output.is::() { + ) -> Result>, JobErrorOrDispatcherError> { + self.metadata.completed_tasks += 1; + + if any_task_output.is::>() { return self .process_walk_output( *any_task_output - .downcast::() + .downcast::>() .expect("just checked"), - job_ctx, + ctx, dispatcher, ) .await; - } else if any_task_output.is::() { + } else if any_task_output.is::() { self.process_save_output( *any_task_output - .downcast::() + .downcast::() .expect("just checked"), - job_ctx, - ); - } else if any_task_output.is::() { + ctx, + ) + .await; + } else if any_task_output.is::() { self.process_update_output( *any_task_output - .downcast::() + .downcast::() .expect("just checked"), - job_ctx, - ); + ctx, + ) + .await; } else { unreachable!("Unexpected task output type: "); } - self.metadata.completed_tasks += 1; - - job_ctx.progress(vec![ProgressUpdate::CompletedTaskCount( - self.metadata.completed_tasks, - )]); - Ok(Vec::new()) } - async fn process_walk_output( + #[instrument( + skip_all, + fields( + to_create_count = to_create.len(), + to_update_count = to_update.len(), + to_remove_count = to_remove.len(), + accepted_ancestors_count = accepted_ancestors.len(), + directory_iso_file_path = %directory_iso_file_path.as_ref().display(), + more_walker_tasks_count = keep_walking_tasks.len(), + %total_size, + ?scan_time, + ) + )] + async fn process_walk_output( &mut self, - WalkTaskOutput { + walker::Output { to_create, to_update, to_remove, @@ -329,13 +398,19 @@ impl IndexerJob { errors, directory_iso_file_path, total_size, - mut handles, + keep_walking_tasks, scan_time, - }: WalkTaskOutput, - job_ctx: &impl JobContext, + .. + }: walker::Output, + ctx: &impl JobContext, dispatcher: &JobTaskDispatcher, - ) -> Result>, IndexerError> { - self.metadata.scan_read_time += scan_time; + ) -> Result>, JobErrorOrDispatcherError> { + self.metadata.mean_scan_read_time += scan_time; + #[allow(clippy::cast_possible_truncation)] + // SAFETY: we know that `keep_walking_tasks.len()` is a valid u32 as we wouldn't dispatch more than `u32::MAX` tasks + { + self.metadata.total_walk_tasks += keep_walking_tasks.len() as u32; + } let (to_create_count, to_update_count) = (to_create.len(), to_update.len()); @@ -378,138 +453,148 @@ impl IndexerJob { .map(|WalkedEntry { iso_file_path, .. }| iso_file_path.clone()), ); - self.errors.extend(errors); + if !errors.is_empty() { + warn!(?errors, "Non critical errors while indexing;"); + self.errors.extend(errors); + } - let db_delete_time = Instant::now(); - self.metadata.removed_count += - remove_non_existing_file_paths(to_remove, job_ctx.db(), job_ctx.sync()).await?; - self.metadata.db_write_time += db_delete_time.elapsed(); + if !to_remove.is_empty() { + let db_delete_time = Instant::now(); + self.metadata.removed_count += + remove_non_existing_file_paths(to_remove, ctx.db(), ctx.sync()).await?; + self.metadata.mean_db_write_time += db_delete_time.elapsed(); + } + let (save_tasks, update_tasks) = + self.prepare_save_and_update_tasks(to_create, to_update, ctx); - let save_tasks = to_create - .into_iter() - .chunks(BATCH_SIZE) - .into_iter() - .map(|chunk| { - let chunked_saves = chunk.collect::>(); - self.metadata.total_paths += chunked_saves.len() as u64; - self.metadata.total_save_steps += 1; - - SaveTask::new( - self.location.id, - self.location.pub_id.clone(), - chunked_saves, - Arc::clone(job_ctx.db()), - Arc::clone(job_ctx.sync()), - ) - }) - .collect::>(); - - let update_tasks = to_update - .into_iter() - .chunks(BATCH_SIZE) - .into_iter() - .map(|chunk| { - let chunked_updates = chunk.collect::>(); - self.metadata.total_updated_paths += chunked_updates.len() as u64; - self.metadata.total_update_steps += 1; - - UpdateTask::new( - chunked_updates, - Arc::clone(job_ctx.db()), - Arc::clone(job_ctx.sync()), - ) - }) - .collect::>(); - - handles.extend(dispatcher.dispatch_many(save_tasks).await); - handles.extend(dispatcher.dispatch_many(update_tasks).await); - - self.metadata.total_tasks += handles.len() as u64; - - job_ctx.progress(vec![ - ProgressUpdate::TaskCount(handles.len() as u64), + ctx.progress(vec![ + ProgressUpdate::TaskCount(self.metadata.total_tasks), + ProgressUpdate::CompletedTaskCount(self.metadata.completed_tasks), ProgressUpdate::message(format!( "Found {to_create_count} new files and {to_update_count} to update" )), - ]); + ]) + .await; - Ok(handles) + self.metadata.total_tasks += + (keep_walking_tasks.len() + save_tasks.len() + update_tasks.len()) as u64; + + debug!( + "Dispatching more ({}W/{}S/{}U) tasks, completed ({}/{});", + keep_walking_tasks.len(), + save_tasks.len(), + update_tasks.len(), + self.metadata.completed_tasks, + self.metadata.total_tasks + ); + + dispatcher + .dispatch_many_boxed( + keep_walking_tasks + .into_iter() + .map(IntoTask::into_task) + .chain(save_tasks.into_iter().map(IntoTask::into_task)) + .chain(update_tasks.into_iter().map(IntoTask::into_task)), + ) + .await + .map_err(Into::into) } - fn process_save_output( + #[instrument(skip(self, ctx))] + async fn process_save_output( &mut self, - SaveTaskOutput { + saver::Output { saved_count, save_duration, - }: SaveTaskOutput, - job_ctx: &impl JobContext, + }: saver::Output, + ctx: &impl JobContext, ) { self.metadata.indexed_count += saved_count; - self.metadata.db_write_time += save_duration; + self.metadata.mean_db_write_time += save_duration; - job_ctx.progress_msg(format!("Saved {saved_count} files")); + ctx.progress(vec![ + ProgressUpdate::CompletedTaskCount(self.metadata.completed_tasks), + ProgressUpdate::message(format!("Saved {} files", self.metadata.indexed_count)), + ]) + .await; + + debug!( + "Processed save task in the indexer ({}/{});", + self.metadata.completed_tasks, self.metadata.total_tasks + ); } - fn process_update_output( + #[instrument(skip(self, ctx))] + async fn process_update_output( &mut self, - UpdateTaskOutput { + updater::Output { updated_count, update_duration, - }: UpdateTaskOutput, - job_ctx: &impl JobContext, + }: updater::Output, + ctx: &impl JobContext, ) { self.metadata.updated_count += updated_count; - self.metadata.db_write_time += update_duration; + self.metadata.mean_db_write_time += update_duration; - job_ctx.progress_msg(format!("Updated {updated_count} files")); + ctx.progress(vec![ + ProgressUpdate::CompletedTaskCount(self.metadata.completed_tasks), + ProgressUpdate::message(format!("Updated {} files", self.metadata.updated_count)), + ]) + .await; + + debug!( + "Processed update task in the indexer ({}/{});", + self.metadata.completed_tasks, self.metadata.total_tasks + ); } - async fn process_handles( + async fn process_handles( &mut self, pending_running_tasks: &mut FuturesUnordered>, - job_ctx: &impl JobContext, + ctx: &impl JobContext, dispatcher: &JobTaskDispatcher, ) -> Option> { while let Some(task) = pending_running_tasks.next().await { match task { Ok(TaskStatus::Done((task_id, TaskOutput::Out(out)))) => { - let more_handles = match self - .process_task_output(task_id, out, job_ctx, dispatcher) + match self + .process_task_output(task_id, out, ctx, dispatcher) .await { - Ok(more_handles) => more_handles, - Err(e) => { - cancel_pending_tasks(&*pending_running_tasks).await; + Ok(more_handles) => pending_running_tasks.extend(more_handles), + Err(JobErrorOrDispatcherError::JobError(e)) => { + cancel_pending_tasks(pending_running_tasks).await; return Some(Err(e.into())); } - }; + Err(JobErrorOrDispatcherError::Dispatcher( + DispatcherError::JobCanceled(_), + )) => return Some(Ok(self.cancel_job(pending_running_tasks).await)), - pending_running_tasks.extend(more_handles); + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown( + tasks, + ))) => self.tasks_for_shutdown.extend(tasks), + }; } Ok(TaskStatus::Done((task_id, TaskOutput::Empty))) => { - warn!("Task returned an empty output"); + warn!(%task_id, "Task returned an empty output"); } - Ok(TaskStatus::Shutdown(task)) => { - self.tasks_for_shutdown.push(task); - } + Ok(TaskStatus::Shutdown(task)) => self.tasks_for_shutdown.push(task), Ok(TaskStatus::Error(e)) => { - cancel_pending_tasks(&*pending_running_tasks).await; + cancel_pending_tasks(pending_running_tasks).await; return Some(Err(e)); } Ok(TaskStatus::Canceled | TaskStatus::ForcedAbortion) => { - cancel_pending_tasks(&*pending_running_tasks).await; - - return Some(Ok(ReturnStatus::Canceled)); + return Some(Ok(self.cancel_job(pending_running_tasks).await)); } Err(e) => { - cancel_pending_tasks(&*pending_running_tasks).await; + cancel_pending_tasks(pending_running_tasks).await; return Some(Err(e.into())); } @@ -519,81 +604,363 @@ impl IndexerJob { None } - async fn init_or_resume( + async fn init_or_resume( &mut self, pending_running_tasks: &mut FuturesUnordered>, - job_ctx: &impl JobContext, + ctx: &impl JobContext, dispatcher: &JobTaskDispatcher, - ) -> Result<(), IndexerError> { + ) -> Result<(), JobErrorOrDispatcherError> { // if we don't have any pending task, then this is a fresh job - if self.pending_tasks_on_resume.is_empty() { + let updates = if self.pending_tasks_on_resume.is_empty() { let walker_root_path = Arc::new( - determine_initial_walk_path( + get_full_path_from_sub_path::( self.location.id, - &self.sub_path, + self.sub_path.as_ref(), &*self.iso_file_path_factory.location_path, - job_ctx.db(), + ctx.db(), ) .await?, ); pending_running_tasks.push( dispatcher - .dispatch(WalkDirTask::new( + .dispatch(tasks::Walker::new_deep( walker_root_path.as_ref(), Arc::clone(&walker_root_path), self.indexer_ruler.clone(), self.iso_file_path_factory.clone(), WalkerDBProxy { location_id: self.location.id, - db: Arc::clone(job_ctx.db()), + db: Arc::clone(ctx.db()), }, - Some(dispatcher.clone()), )?) - .await, + .await?, ); + self.metadata.total_tasks = 1; + self.metadata.total_walk_tasks = 1; + + let updates = vec![ + ProgressUpdate::TaskCount(self.metadata.total_tasks), + ProgressUpdate::Message(format!("Indexing {}", walker_root_path.display())), + ]; + self.walker_root_path = Some(walker_root_path); + + updates } else { pending_running_tasks.extend(mem::take(&mut self.pending_tasks_on_resume)); - } + + vec![ + ProgressUpdate::TaskCount(self.metadata.total_tasks), + ProgressUpdate::Message("Resuming tasks".to_string()), + ] + }; + + ctx.progress(updates).await; Ok(()) } + + async fn dispatch_last_save_and_update_tasks( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + ) -> Option> { + if !self.to_create_buffer.is_empty() || !self.to_update_buffer.is_empty() { + let mut tasks = Vec::with_capacity(2); + + if !self.to_create_buffer.is_empty() { + assert!( + self.to_create_buffer.len() <= BATCH_SIZE, + "last save task must be less than BATCH_SIZE paths" + ); + + self.metadata.total_tasks += 1; + self.metadata.total_paths += self.to_create_buffer.len() as u64; + self.metadata.total_save_tasks += 1; + + tasks.push( + tasks::Saver::new_deep( + self.location.id, + self.location.pub_id.clone(), + self.to_create_buffer.drain(..).collect(), + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + ) + .into_task(), + ); + } + + if !self.to_update_buffer.is_empty() { + assert!( + self.to_update_buffer.len() <= BATCH_SIZE, + "last update task must be less than BATCH_SIZE paths" + ); + + self.metadata.total_tasks += 1; + self.metadata.total_updated_paths += self.to_update_buffer.len() as u64; + self.metadata.total_update_tasks += 1; + + tasks.push( + tasks::Updater::new_deep( + self.to_update_buffer.drain(..).collect(), + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + ) + .into_task(), + ); + } + + ctx.progress(vec![ProgressUpdate::TaskCount(self.metadata.total_tasks)]) + .await; + + match dispatcher.dispatch_many_boxed(tasks).await { + Ok(task_handles) => pending_running_tasks.extend(task_handles), + Err(DispatcherError::JobCanceled(_)) => { + return Some(Ok(self.cancel_job(pending_running_tasks).await)); + } + Err(DispatcherError::Shutdown(tasks)) => { + self.tasks_for_shutdown.extend(tasks); + } + } + + self.process_handles(pending_running_tasks, ctx, dispatcher) + .await + } else { + None + } + } + + async fn index_pending_ancestors( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + ) -> Option> { + if self.ancestors_needing_indexing.is_empty() { + return None; + } + + let save_tasks = self + .ancestors_needing_indexing + .drain() + .chunks(BATCH_SIZE) + .into_iter() + .map(|chunk| { + let chunked_saves = chunk.collect::>(); + + self.metadata.total_paths += chunked_saves.len() as u64; + self.metadata.total_save_tasks += 1; + + tasks::Saver::new_deep( + self.location.id, + self.location.pub_id.clone(), + chunked_saves, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + ) + }) + .collect::>(); + + self.metadata.total_tasks += save_tasks.len() as u64; + + match dispatcher.dispatch_many(save_tasks).await { + Ok(task_handles) => pending_running_tasks.extend(task_handles), + Err(DispatcherError::JobCanceled(_)) => { + return Some(Ok(self.cancel_job(pending_running_tasks).await)); + } + Err(DispatcherError::Shutdown(tasks)) => { + self.tasks_for_shutdown.extend(tasks); + } + } + + self.process_handles(pending_running_tasks, ctx, dispatcher) + .await + } + + fn prepare_save_and_update_tasks( + &mut self, + to_create: Vec, + to_update: Vec, + ctx: &impl JobContext, + ) -> (Vec, Vec) { + if self.processing_first_directory { + // If we are processing the first directory, we dispatch shallow tasks with higher priority + // this way we provide a faster feedback loop to the user + self.processing_first_directory = false; + + let save_tasks = to_create + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(|chunk| { + let chunked_saves = chunk.collect::>(); + + self.metadata.total_paths += chunked_saves.len() as u64; + self.metadata.total_save_tasks += 1; + + tasks::Saver::new_shallow( + self.location.id, + self.location.pub_id.clone(), + chunked_saves, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + ) + }) + .collect::>(); + + let update_tasks = to_update + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(|chunk| { + let chunked_updates = chunk.collect::>(); + + self.metadata.total_updated_paths += chunked_updates.len() as u64; + self.metadata.total_update_tasks += 1; + + tasks::Updater::new_shallow( + chunked_updates, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + ) + }) + .collect::>(); + + (save_tasks, update_tasks) + } else { + self.to_create_buffer.extend(to_create); + + let save_tasks = if self.to_create_buffer.len() > BATCH_SIZE { + let chunks_count = self.to_create_buffer.len() / BATCH_SIZE; + let mut save_tasks = Vec::with_capacity(chunks_count); + + for _ in 0..chunks_count { + let chunked_saves = self + .to_create_buffer + .drain(..BATCH_SIZE) + .collect::>(); + + self.metadata.total_paths += chunked_saves.len() as u64; + self.metadata.total_save_tasks += 1; + + save_tasks.push(tasks::Saver::new_deep( + self.location.id, + self.location.pub_id.clone(), + chunked_saves, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + )); + } + save_tasks + } else { + trace!("Not enough entries to dispatch a new saver task;"); + vec![] + }; + + self.to_update_buffer.extend(to_update); + + let update_tasks = if self.to_update_buffer.len() > BATCH_SIZE { + let chunks_count = self.to_update_buffer.len() / BATCH_SIZE; + let mut update_tasks = Vec::with_capacity(chunks_count); + + for _ in 0..chunks_count { + let chunked_updates = self + .to_update_buffer + .drain(..BATCH_SIZE) + .collect::>(); + + self.metadata.total_updated_paths += chunked_updates.len() as u64; + self.metadata.total_update_tasks += 1; + + update_tasks.push(tasks::Updater::new_deep( + chunked_updates, + Arc::clone(ctx.db()), + Arc::clone(ctx.sync()), + )); + } + update_tasks + } else { + trace!("Not enough entries to dispatch a new updater task;"); + vec![] + }; + + (save_tasks, update_tasks) + } + } + + async fn cancel_job( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + ) -> ReturnStatus { + cancel_pending_tasks(pending_running_tasks).await; + + ReturnStatus::Canceled( + JobReturn::builder() + .with_metadata(mem::take(&mut self.metadata)) + .with_non_critical_errors(mem::take(&mut self.errors)) + .build(), + ) + } } #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct Metadata { - db_write_time: Duration, - scan_read_time: Duration, + mean_db_write_time: Duration, + mean_scan_read_time: Duration, total_tasks: u64, completed_tasks: u64, total_paths: u64, total_updated_paths: u64, - total_save_steps: u64, - total_update_steps: u64, + total_walk_tasks: u32, + total_save_tasks: u32, + total_update_tasks: u32, indexed_count: u64, updated_count: u64, removed_count: u64, } -impl From for ReportOutputMetadata { - fn from(value: Metadata) -> Self { - Self::Metrics(HashMap::from([ - ("db_write_time".into(), json!(value.db_write_time)), - ("scan_read_time".into(), json!(value.scan_read_time)), - ("total_tasks".into(), json!(value.total_tasks)), - ("total_paths".into(), json!(value.total_paths)), - ( - "total_updated_paths".into(), - json!(value.total_updated_paths), - ), - ("total_save_steps".into(), json!(value.total_save_steps)), - ("total_update_steps".into(), json!(value.total_update_steps)), - ("indexed_count".into(), json!(value.indexed_count)), - ("updated_count".into(), json!(value.updated_count)), - ("removed_count".into(), json!(value.removed_count)), - ])) +impl From for Vec { + fn from( + Metadata { + mut mean_db_write_time, + mut mean_scan_read_time, + total_tasks, + completed_tasks, + total_paths, + total_updated_paths, + total_walk_tasks, + total_save_tasks, + total_update_tasks, + indexed_count, + updated_count, + removed_count, + }: Metadata, + ) -> Self { + mean_scan_read_time /= u32::max(total_walk_tasks, 1); // To avoid division by zero + mean_db_write_time /= total_save_tasks + total_update_tasks + 1; // +1 to update directories sizes + + vec![ + ReportOutputMetadata::Indexer { + total_paths: u64_to_frontend(total_paths), + }, + ReportOutputMetadata::Metrics(HashMap::from([ + ("mean_scan_read_time".into(), json!(mean_scan_read_time)), + ("mean_db_write_time".into(), json!(mean_db_write_time)), + ("total_tasks".into(), json!(total_tasks)), + ("completed_tasks".into(), json!(completed_tasks)), + ("total_paths".into(), json!(total_paths)), + ("total_updated_paths".into(), json!(total_updated_paths)), + ("total_walk_tasks".into(), json!(total_walk_tasks)), + ("total_save_tasks".into(), json!(total_save_tasks)), + ("total_update_tasks".into(), json!(total_update_tasks)), + ("indexed_count".into(), json!(indexed_count)), + ("updated_count".into(), json!(updated_count)), + ("removed_count".into(), json!(removed_count)), + ])), + ] } } @@ -608,21 +975,26 @@ enum TaskKind { struct SaveState { location: location_with_indexer_rules::Data, sub_path: Option, - metadata: Metadata, iso_file_path_factory: IsoFilePathFactory, - indexer_ruler_bytes: Vec, + indexer_ruler: IndexerRuler, walker_root_path: Option>, + ancestors_needing_indexing: HashSet, ancestors_already_indexed: HashSet>, - paths_and_sizes: HashMap, u64>, + iso_paths_and_sizes: HashMap, u64>, - errors: Vec, + processing_first_directory: bool, + to_create_buffer: VecDeque, + to_update_buffer: VecDeque, + + metadata: Metadata, + errors: Vec, tasks_for_shutdown_bytes: Option, } -impl SerializableJob for IndexerJob { +impl SerializableJob for Indexer { async fn serialize(self) -> Result>, rmp_serde::encode::Error> { let Self { location, @@ -633,81 +1005,90 @@ impl SerializableJob for IndexerJob { walker_root_path, ancestors_needing_indexing, ancestors_already_indexed, - iso_paths_and_sizes: paths_and_sizes, + iso_paths_and_sizes, + processing_first_directory, + to_create_buffer, + to_update_buffer, errors, tasks_for_shutdown, .. } = self; + let serialized_tasks = tasks_for_shutdown + .into_iter() + .map(|task| async move { + if task.is::>() { + task.downcast::>() + .expect("just checked") + .serialize() + .await + .map(|bytes| (TaskKind::Walk, bytes)) + } else if task.is::() { + task.downcast::() + .expect("just checked") + .serialize() + .await + .map(|bytes| (TaskKind::Save, bytes)) + } else if task.is::() { + task.downcast::() + .expect("just checked") + .serialize() + .await + .map(|bytes| (TaskKind::Update, bytes)) + } else { + unreachable!("Unexpected task type") + } + }) + .collect::>() + .try_join() + .await?; + + let tasks_for_shutdown_bytes = if serialized_tasks.is_empty() { + None + } else { + Some(SerializedTasks(rmp_serde::to_vec_named(&serialized_tasks)?)) + }; + rmp_serde::to_vec_named(&SaveState { location, sub_path, - metadata, iso_file_path_factory, - indexer_ruler_bytes: indexer_ruler.serialize().await?, + indexer_ruler, walker_root_path, ancestors_needing_indexing, ancestors_already_indexed, - paths_and_sizes, - tasks_for_shutdown_bytes: Some(SerializedTasks(rmp_serde::to_vec_named( - &tasks_for_shutdown - .into_iter() - .map(|task| async move { - if task - .is::>( - ) { - task - .downcast::>( - ) - .expect("just checked") - .serialize() - .await - .map(|bytes| (TaskKind::Walk, bytes)) - } else if task.is::() { - task.downcast::() - .expect("just checked") - .serialize() - .await - .map(|bytes| (TaskKind::Save, bytes)) - } else if task.is::() { - task.downcast::() - .expect("just checked") - .serialize() - .await - .map(|bytes| (TaskKind::Update, bytes)) - } else { - unreachable!("Unexpected task type") - } - }) - .collect::>() - .try_join() - .await?, - )?)), + iso_paths_and_sizes, + processing_first_directory, + to_create_buffer, + to_update_buffer, + metadata, errors, + tasks_for_shutdown_bytes, }) .map(Some) } async fn deserialize( serialized_job: &[u8], - _: &impl JobContext, + _: &OuterCtx, ) -> Result)>, rmp_serde::decode::Error> { let SaveState { location, sub_path, - metadata, iso_file_path_factory, - indexer_ruler_bytes, + indexer_ruler, walker_root_path, ancestors_needing_indexing, ancestors_already_indexed, - paths_and_sizes, + iso_paths_and_sizes, + processing_first_directory, + to_create_buffer, + to_update_buffer, + metadata, errors, tasks_for_shutdown_bytes, } = rmp_serde::from_slice::(serialized_job)?; - let indexer_ruler = IndexerRuler::deserialize(&indexer_ruler_bytes)?; - Ok(Some(( Self { location, @@ -718,7 +1099,10 @@ impl SerializableJob for IndexerJob { walker_root_path, ancestors_needing_indexing, ancestors_already_indexed, - iso_paths_and_sizes: paths_and_sizes, + iso_paths_and_sizes, + processing_first_directory, + to_create_buffer, + to_update_buffer, errors, pending_tasks_on_resume: Vec::new(), tasks_for_shutdown: Vec::new(), @@ -728,7 +1112,7 @@ impl SerializableJob for IndexerJob { } } -impl Hash for IndexerJob { +impl Hash for Indexer { fn hash(&self, state: &mut H) { self.location.id.hash(state); if let Some(ref sub_path) = self.sub_path { diff --git a/core/crates/heavy-lifting/src/indexer/mod.rs b/core/crates/heavy-lifting/src/indexer/mod.rs index 12d27b337..3d7ad5eda 100644 --- a/core/crates/heavy-lifting/src/indexer/mod.rs +++ b/core/crates/heavy-lifting/src/indexer/mod.rs @@ -1,17 +1,13 @@ -use crate::NonCriticalJobError; +use crate::{utils::sub_path, OuterContext}; -use sd_core_file_path_helper::{ - ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - FilePathError, IsolatedFilePathData, -}; -use sd_core_indexer_rules::IndexerRuleError; +use sd_core_file_path_helper::{FilePathError, IsolatedFilePathData}; use sd_core_prisma_helpers::{ file_path_pub_and_cas_ids, file_path_to_isolate_with_pub_id, file_path_walker, }; use sd_core_sync::Manager as SyncManager; use sd_prisma::{ - prisma::{file_path, location, PrismaClient, SortOrder}, + prisma::{file_path, indexer_rule, location, PrismaClient, SortOrder}, prisma_sync, }; use sd_sync::OperationFactory; @@ -30,17 +26,16 @@ use std::{ }; use itertools::Itertools; -use prisma_client_rust::{operator::or, Select}; +use prisma_client_rust::{operator::or, QueryError, Select}; use rspc::ErrorCode; use serde::{Deserialize, Serialize}; use specta::Type; -use tracing::warn; +use tracing::{instrument, warn}; -mod job; +pub mod job; mod shallow; mod tasks; -pub use job::IndexerJob; pub use shallow::shallow; use tasks::walker; @@ -49,16 +44,16 @@ use tasks::walker; const BATCH_SIZE: usize = 1000; #[derive(thiserror::Error, Debug)] -pub enum IndexerError { +pub enum Error { // Not Found errors #[error("indexer rule not found: ")] - IndexerRuleNotFound(i32), - #[error("received sub path not in database: ", .0.display())] - SubPathNotFound(Box), + IndexerRuleNotFound(indexer_rule::id::Type), + #[error(transparent)] + SubPath(#[from] sub_path::Error), // Internal Errors - #[error("database Error: {0}")] - Database(#[from] prisma_client_rust::QueryError), + #[error("database error: {0}")] + Database(#[from] QueryError), #[error(transparent)] FileIO(#[from] FileIOError), #[error(transparent)] @@ -72,24 +67,27 @@ pub enum IndexerError { // Mixed errors #[error(transparent)] - Rules(#[from] IndexerRuleError), + Rules(#[from] sd_core_indexer_rules::Error), } -impl From for rspc::Error { - fn from(err: IndexerError) -> Self { - match err { - IndexerError::IndexerRuleNotFound(_) | IndexerError::SubPathNotFound(_) => { - Self::with_cause(ErrorCode::NotFound, err.to_string(), err) +impl From for rspc::Error { + fn from(e: Error) -> Self { + match e { + Error::IndexerRuleNotFound(_) => { + Self::with_cause(ErrorCode::NotFound, e.to_string(), e) } - IndexerError::Rules(rule_err) => rule_err.into(), + Error::SubPath(sub_path_err) => sub_path_err.into(), - _ => Self::with_cause(ErrorCode::InternalServerError, err.to_string(), err), + Error::Rules(rule_err) => rule_err.into(), + + _ => Self::with_cause(ErrorCode::InternalServerError, e.to_string(), e), } } } -#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type)] +#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] pub enum NonCriticalIndexerError { #[error("failed to read directory entry: {0}")] FailedDirectoryEntry(String), @@ -111,36 +109,6 @@ pub enum NonCriticalIndexerError { MissingFilePathData(String), } -async fn determine_initial_walk_path( - location_id: location::id::Type, - sub_path: &Option + Send + Sync>, - location_path: impl AsRef + Send, - db: &PrismaClient, -) -> Result { - let location_path = location_path.as_ref(); - - match sub_path { - Some(sub_path) if sub_path.as_ref() != Path::new("") => { - let sub_path = sub_path.as_ref(); - let full_path = ensure_sub_path_is_in_location(location_path, sub_path).await?; - - ensure_sub_path_is_directory(location_path, sub_path).await?; - - ensure_file_path_exists( - sub_path, - &IsolatedFilePathData::new(location_id, location_path, &full_path, true) - .map_err(IndexerError::from)?, - db, - IndexerError::SubPathNotFound, - ) - .await?; - - Ok(full_path) - } - _ => Ok(location_path.to_path_buf()), - } -} - fn chunk_db_queries<'db, 'iso>( iso_file_paths: impl IntoIterator>, db: &'db PrismaClient, @@ -165,7 +133,7 @@ async fn update_directory_sizes( iso_paths_and_sizes: HashMap, u64, impl BuildHasher + Send>, db: &PrismaClient, sync: &SyncManager, -) -> Result<(), IndexerError> { +) -> Result<(), Error> { let to_sync_and_update = db ._batch(chunk_db_queries(iso_paths_and_sizes.keys(), db)) .await? @@ -185,13 +153,15 @@ async fn update_directory_sizes( file_path::size_in_bytes_bytes::NAME, msgpack!(size_bytes), ), - db.file_path().update( - file_path::pub_id::equals(file_path.pub_id), - vec![file_path::size_in_bytes_bytes::set(Some(size_bytes))], - ), + db.file_path() + .update( + file_path::pub_id::equals(file_path.pub_id), + vec![file_path::size_in_bytes_bytes::set(Some(size_bytes))], + ) + .select(file_path::select!({ id })), )) }) - .collect::, IndexerError>>()? + .collect::, Error>>()? .into_iter() .unzip::<_, _, Vec<_>, Vec<_>>(); @@ -200,11 +170,11 @@ async fn update_directory_sizes( Ok(()) } -async fn update_location_size( +async fn update_location_size( location_id: location::id::Type, db: &PrismaClient, - invalidate_query: &InvalidateQuery, -) -> Result<(), IndexerError> { + ctx: &impl OuterContext, +) -> Result<(), Error> { let total_size = db .file_path() .find_many(vec![ @@ -232,8 +202,8 @@ async fn update_location_size( .exec() .await?; - invalidate_query("locations.list"); - invalidate_query("locations.get"); + ctx.invalidate_query("locations.list"); + ctx.invalidate_query("locations.get"); Ok(()) } @@ -242,7 +212,7 @@ async fn remove_non_existing_file_paths( to_remove: Vec, db: &PrismaClient, sync: &sd_core_sync::Manager, -) -> Result { +) -> Result { #[allow(clippy::cast_sign_loss)] let (sync_params, db_params): (Vec<_>, Vec<_>) = to_remove .into_iter() @@ -272,15 +242,23 @@ async fn remove_non_existing_file_paths( .map_err(Into::into) } +#[instrument( + skip(base_path, location_path, db, sync, errors), + fields( + base_path = %base_path.as_ref().display(), + location_path = %location_path.as_ref().display(), + ), + err, +)] #[allow(clippy::missing_panics_doc)] // Can't actually panic as we only deal with directories -async fn reverse_update_directories_sizes( +pub async fn reverse_update_directories_sizes( base_path: impl AsRef + Send, location_id: location::id::Type, location_path: impl AsRef + Send, db: &PrismaClient, sync: &SyncManager, - errors: &mut Vec, -) -> Result<(), IndexerError> { + errors: &mut Vec, +) -> Result<(), Error> { let location_path = location_path.as_ref(); let ancestors = base_path @@ -360,7 +338,7 @@ async fn reverse_update_directories_sizes( ), )) } else { - warn!("Got a missing ancestor for a file_path in the database, maybe we have a corruption"); + warn!("Got a missing ancestor for a file_path in the database, ignoring..."); None } }) @@ -376,9 +354,10 @@ async fn compute_sizes( materialized_paths: Vec, pub_id_by_ancestor_materialized_path: &mut HashMap, db: &PrismaClient, - errors: &mut Vec, -) -> Result<(), IndexerError> { - db.file_path() + errors: &mut Vec, +) -> Result<(), QueryError> { + for file_path in db + .file_path() .find_many(vec![ file_path::location_id::equals(Some(location_id)), file_path::materialized_path::in_vec(materialized_paths), @@ -386,30 +365,29 @@ async fn compute_sizes( .select(file_path::select!({ pub_id materialized_path size_in_bytes_bytes })) .exec() .await? - .into_iter() - .for_each(|file_path| { - if let Some(materialized_path) = file_path.materialized_path { - if let Some((_, size)) = - pub_id_by_ancestor_materialized_path.get_mut(&materialized_path) - { - *size += file_path.size_in_bytes_bytes.map_or_else( - || { - warn!("Got a directory missing its size in bytes"); - 0 - }, - |size_in_bytes_bytes| size_in_bytes_from_db(&size_in_bytes_bytes), - ); - } - } else { - errors.push( - NonCriticalIndexerError::MissingFilePathData(format!( + { + if let Some(materialized_path) = file_path.materialized_path { + if let Some((_, size)) = + pub_id_by_ancestor_materialized_path.get_mut(&materialized_path) + { + *size += file_path.size_in_bytes_bytes.map_or_else( + || { + warn!("Got a directory missing its size in bytes"); + 0 + }, + |size_in_bytes_bytes| size_in_bytes_from_db(&size_in_bytes_bytes), + ); + } + } else { + errors.push( + NonCriticalIndexerError::MissingFilePathData(format!( "Corrupt database possessing a file_path entry without materialized_path: ", from_bytes_to_uuid(&file_path.pub_id) )) - .into(), - ); - } - }); + .into(), + ); + } + } Ok(()) } @@ -440,7 +418,7 @@ impl walker::WalkerDBProxy for WalkerDBProxy { async fn fetch_file_paths( &self, found_paths: Vec, - ) -> Result, IndexerError> { + ) -> Result, Error> { // Each found path is a AND with 4 terms, and SQLite has a expression tree limit of 1000 terms // so we will use chunks of 200 just to be safe self.db @@ -465,54 +443,73 @@ impl walker::WalkerDBProxy for WalkerDBProxy { async fn fetch_file_paths_to_remove( &self, parent_iso_file_path: &IsolatedFilePathData<'_>, + mut existing_inodes: HashSet>, unique_location_id_materialized_path_name_extension_params: Vec, ) -> Result, NonCriticalIndexerError> { // NOTE: This batch size can be increased if we wish to trade memory for more performance const BATCH_SIZE: i64 = 1000; - let founds_ids = self - .db - ._batch( - unique_location_id_materialized_path_name_extension_params - .into_iter() - .chunks(200) - .into_iter() - .map(|unique_params| { - self.db - .file_path() - .find_many(vec![or(unique_params.collect())]) - .select(file_path::select!({ id })) - }) - .collect::>(), - ) - .await - .map(|founds_chunk| { - founds_chunk - .into_iter() - .flat_map(|file_paths| file_paths.into_iter().map(|file_path| file_path.id)) - .collect::>() - }) - .map_err(|e| NonCriticalIndexerError::FetchAlreadyExistingFilePathIds(e.to_string()))?; + let founds_ids = { + let found_chunks = self + .db + ._batch( + unique_location_id_materialized_path_name_extension_params + .into_iter() + .chunks(200) + .into_iter() + .map(|unique_params| { + self.db + .file_path() + .find_many(vec![or(unique_params.collect())]) + .select(file_path::select!({ id inode })) + }) + .collect::>(), + ) + .await + .map_err(|e| { + NonCriticalIndexerError::FetchAlreadyExistingFilePathIds(e.to_string()) + })?; + + found_chunks + .into_iter() + .flatten() + .map(|file_path| { + if let Some(inode) = file_path.inode { + existing_inodes.remove(&inode); + } + file_path.id + }) + .collect::>() + }; let mut to_remove = vec![]; let mut cursor = 1; loop { + let materialized_path_param = file_path::materialized_path::equals(Some( + parent_iso_file_path + .materialized_path_for_children() + .expect("the received isolated file path must be from a directory"), + )); + let found = self .db .file_path() .find_many(vec![ file_path::location_id::equals(Some(self.location_id)), - file_path::materialized_path::equals(Some( - parent_iso_file_path - .materialized_path_for_children() - .expect("the received isolated file path must be from a directory"), - )), + if existing_inodes.is_empty() { + materialized_path_param + } else { + or(vec![ + materialized_path_param, + file_path::inode::in_vec(existing_inodes.iter().cloned().collect()), + ]) + }, ]) .order_by(file_path::id::order(SortOrder::Asc)) .take(BATCH_SIZE) .cursor(file_path::id::equals(cursor)) - .select(file_path_pub_and_cas_ids::select()) + .select(file_path::select!({ id pub_id cas_id inode })) .exec() .await .map_err(|e| NonCriticalIndexerError::FetchFilePathsToRemove(e.to_string()))?; @@ -526,11 +523,17 @@ impl walker::WalkerDBProxy for WalkerDBProxy { break; } - to_remove.extend( - found - .into_iter() - .filter(|file_path| !founds_ids.contains(&file_path.id)), - ); + to_remove.extend(found.into_iter().filter_map(|file_path| { + if let Some(inode) = file_path.inode { + existing_inodes.remove(&inode); + } + + (!founds_ids.contains(&file_path.id)).then_some(file_path_pub_and_cas_ids::Data { + id: file_path.id, + pub_id: file_path.pub_id, + cas_id: file_path.cas_id, + }) + })); if should_stop { break; diff --git a/core/crates/heavy-lifting/src/indexer/shallow.rs b/core/crates/heavy-lifting/src/indexer/shallow.rs index a39d37bbf..c57993840 100644 --- a/core/crates/heavy-lifting/src/indexer/shallow.rs +++ b/core/crates/heavy-lifting/src/indexer/shallow.rs @@ -1,4 +1,6 @@ -use crate::{Error, NonCriticalJobError}; +use crate::{ + indexer, utils::sub_path::get_full_path_from_sub_path, Error, NonCriticalError, OuterContext, +}; use sd_core_indexer_rules::{IndexerRule, IndexerRuler}; use sd_core_prisma_helpers::location_with_indexer_rules; @@ -16,42 +18,55 @@ use std::{ use futures_concurrency::future::TryJoin; use itertools::Itertools; -use tracing::{debug, warn}; +use tracing::{debug, instrument, warn}; use super::{ - determine_initial_walk_path, remove_non_existing_file_paths, reverse_update_directories_sizes, + remove_non_existing_file_paths, reverse_update_directories_sizes, tasks::{ - saver::{SaveTask, SaveTaskOutput}, - updater::{UpdateTask, UpdateTaskOutput}, - walker::{ToWalkEntry, WalkDirTask, WalkTaskOutput, WalkedEntry}, + self, saver, updater, + walker::{self, ToWalkEntry, WalkedEntry}, }, - update_directory_sizes, update_location_size, IndexerError, IsoFilePathFactory, WalkerDBProxy, - BATCH_SIZE, + update_directory_sizes, update_location_size, IsoFilePathFactory, WalkerDBProxy, BATCH_SIZE, }; +#[instrument( + skip_all, + fields( + location_id = location.id, + location_path = ?location.path, + sub_path = %sub_path.as_ref().display() + ) + err, +)] pub async fn shallow( location: location_with_indexer_rules::Data, sub_path: impl AsRef + Send, - dispatcher: BaseTaskDispatcher, - db: Arc, - sync: Arc, - invalidate_query: impl Fn(&'static str) + Send + Sync, -) -> Result, Error> { - let sub_path = sub_path.as_ref(); + dispatcher: &BaseTaskDispatcher, + ctx: &impl OuterContext, +) -> Result, Error> { + let db = ctx.db(); + let sync = ctx.sync(); let location_path = maybe_missing(&location.path, "location.path") .map(PathBuf::from) .map(Arc::new) - .map_err(IndexerError::from)?; + .map_err(indexer::Error::from)?; let to_walk_path = Arc::new( - determine_initial_walk_path(location.id, &Some(sub_path), &*location_path, &db).await?, + get_full_path_from_sub_path::( + location.id, + Some(sub_path.as_ref()), + &*location_path, + db, + ) + .await?, ); - let Some(WalkTaskOutput { + let Some(walker::Output { to_create, to_update, to_remove, + non_indexed_paths, mut errors, directory_iso_file_path, total_size, @@ -60,15 +75,18 @@ pub async fn shallow( &location, Arc::clone(&location_path), Arc::clone(&to_walk_path), - Arc::clone(&db), - &dispatcher, + Arc::clone(db), + dispatcher, ) .await? else { return Ok(vec![]); }; - let removed_count = remove_non_existing_file_paths(to_remove, &db, &sync).await?; + // TODO use non_indexed_paths here in the future, sending it to frontend, showing then alongside the indexed files from db + debug!(non_indexed_paths_count = non_indexed_paths.len()); + + let removed_count = remove_non_existing_file_paths(to_remove, db, sync).await?; let Some(Metadata { indexed_count, @@ -77,9 +95,9 @@ pub async fn shallow( &location, to_create, to_update, - Arc::clone(&db), - Arc::clone(&sync), - &dispatcher, + Arc::clone(db), + Arc::clone(sync), + dispatcher, ) .await? else { @@ -89,8 +107,8 @@ pub async fn shallow( if indexed_count > 0 || removed_count > 0 || updated_count > 0 { update_directory_sizes( HashMap::from([(directory_iso_file_path, total_size)]), - &db, - &sync, + db, + sync, ) .await?; @@ -99,32 +117,36 @@ pub async fn shallow( &*to_walk_path, location.id, &*location_path, - &db, - &sync, + db, + sync, &mut errors, ) .await?; } - update_location_size(location.id, &db, &invalidate_query).await?; + update_location_size(location.id, db, ctx).await?; } if indexed_count > 0 || removed_count > 0 { - invalidate_query("search.paths"); + ctx.invalidate_query("search.paths"); } Ok(errors) } +#[instrument( + skip_all, + fields(to_walk_path = %to_walk_path.display()) +)] async fn walk( location: &location_with_indexer_rules::Data, location_path: Arc, to_walk_path: Arc, db: Arc, dispatcher: &BaseTaskDispatcher, -) -> Result, Error> { - match dispatcher - .dispatch(WalkDirTask::new( +) -> Result>, Error> { + let Ok(task_handle) = dispatcher + .dispatch(tasks::Walker::new_shallow( ToWalkEntry::from(&*to_walk_path), to_walk_path, location @@ -133,7 +155,7 @@ async fn walk( .map(|rule| IndexerRule::try_from(&rule.indexer_rule)) .collect::, _>>() .map(IndexerRuler::new) - .map_err(IndexerError::from)?, + .map_err(indexer::Error::from)?, IsoFilePathFactory { location_id: location.id, location_path, @@ -142,14 +164,17 @@ async fn walk( location_id: location.id, db, }, - None::>, )?) .await - .await? - { + else { + debug!("Task system is shutting down while a shallow indexer was in progress"); + return Ok(None); + }; + + match task_handle.await? { sd_task_system::TaskStatus::Done((_, TaskOutput::Out(data))) => Ok(Some( *data - .downcast::() + .downcast::>() .expect("we just dispatched this task"), )), sd_task_system::TaskStatus::Done((_, TaskOutput::Empty)) => { @@ -186,7 +211,7 @@ async fn save_and_update( .chunks(BATCH_SIZE) .into_iter() .map(|chunk| { - SaveTask::new( + tasks::Saver::new_shallow( location.id, location.pub_id.clone(), chunk.collect::>(), @@ -201,7 +226,7 @@ async fn save_and_update( .chunks(BATCH_SIZE) .into_iter() .map(|chunk| { - UpdateTask::new( + tasks::Updater::new_shallow( chunk.collect::>(), Arc::clone(&db), Arc::clone(&sync), @@ -216,25 +241,28 @@ async fn save_and_update( updated_count: 0, }; - for task_status in dispatcher - .dispatch_many_boxed(save_and_update_tasks) - .await + let Ok(tasks_handles) = dispatcher.dispatch_many_boxed(save_and_update_tasks).await else { + debug!("Task system is shutting down while a shallow indexer was in progress"); + return Ok(None); + }; + + for task_status in tasks_handles .into_iter() - .map(CancelTaskOnDrop) + .map(CancelTaskOnDrop::new) .collect::>() .try_join() .await? { match task_status { sd_task_system::TaskStatus::Done((_, TaskOutput::Out(data))) => { - if data.is::() { + if data.is::() { metadata.indexed_count += data - .downcast::() + .downcast::() .expect("just checked") .saved_count; } else { metadata.updated_count += data - .downcast::() + .downcast::() .expect("just checked") .updated_count; } diff --git a/core/crates/heavy-lifting/src/indexer/tasks/mod.rs b/core/crates/heavy-lifting/src/indexer/tasks/mod.rs index eacba8f11..0d2bf5f18 100644 --- a/core/crates/heavy-lifting/src/indexer/tasks/mod.rs +++ b/core/crates/heavy-lifting/src/indexer/tasks/mod.rs @@ -1,3 +1,7 @@ pub mod saver; pub mod updater; pub mod walker; + +pub use saver::Saver; +pub use updater::Updater; +pub use walker::Walker; diff --git a/core/crates/heavy-lifting/src/indexer/tasks/saver.rs b/core/crates/heavy-lifting/src/indexer/tasks/saver.rs index 2f1f6d433..3bdb113b5 100644 --- a/core/crates/heavy-lifting/src/indexer/tasks/saver.rs +++ b/core/crates/heavy-lifting/src/indexer/tasks/saver.rs @@ -1,4 +1,4 @@ -use crate::{indexer::IndexerError, Error}; +use crate::{indexer, Error}; use sd_core_file_path_helper::IsolatedFilePathDataParts; use sd_core_sync::Manager as SyncManager; @@ -16,105 +16,58 @@ use std::{sync::Arc, time::Duration}; use chrono::Utc; use serde::{Deserialize, Serialize}; use tokio::time::Instant; -use tracing::trace; +use tracing::{instrument, trace, Level}; use super::walker::WalkedEntry; #[derive(Debug)] -pub struct SaveTask { +pub struct Saver { + // Task control id: TaskId, + is_shallow: bool, + + // Received input args location_id: location::id::Type, location_pub_id: location::pub_id::Type, walked_entries: Vec, + + // Dependencies db: Arc, sync: Arc, } -impl SaveTask { - #[must_use] - pub fn new( - location_id: location::id::Type, - location_pub_id: location::pub_id::Type, - walked_entries: Vec, - db: Arc, - sync: Arc, - ) -> Self { - Self { - id: TaskId::new_v4(), - location_id, - location_pub_id, - walked_entries, - db, - sync, - } - } -} - -#[derive(Debug, Serialize, Deserialize)] -struct SaveTaskSaveState { - id: TaskId, - location_id: location::id::Type, - location_pub_id: location::pub_id::Type, - walked_entries: Vec, -} - -impl SerializableTask for SaveTask { - type SerializeError = rmp_serde::encode::Error; - - type DeserializeError = rmp_serde::decode::Error; - - type DeserializeCtx = (Arc, Arc); - - async fn serialize(self) -> Result, Self::SerializeError> { - let Self { - id, - location_id, - location_pub_id, - walked_entries, - .. - } = self; - rmp_serde::to_vec_named(&SaveTaskSaveState { - id, - location_id, - location_pub_id, - walked_entries, - }) - } - - async fn deserialize( - data: &[u8], - (db, sync): Self::DeserializeCtx, - ) -> Result { - rmp_serde::from_slice(data).map( - |SaveTaskSaveState { - id, - location_id, - location_pub_id, - walked_entries, - }| Self { - id, - location_id, - location_pub_id, - walked_entries, - db, - sync, - }, - ) - } -} - +/// [`Save`] Task output #[derive(Debug)] -pub struct SaveTaskOutput { +pub struct Output { + /// Number of records inserted on database pub saved_count: u64, + /// Time spent saving records pub save_duration: Duration, } #[async_trait::async_trait] -impl Task for SaveTask { +impl Task for Saver { fn id(&self) -> TaskId { self.id } + fn with_priority(&self) -> bool { + // If we're running in shallow mode, then we want priority + self.is_shallow + } + + #[instrument( + skip_all, + fields( + task_id = %self.id, + location_id = %self.location_id, + to_save_count = %self.walked_entries.len(), + is_shallow = self.is_shallow, + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above async fn run(&mut self, _: &Interrupter) -> Result { use file_path::{ create_unchecked, date_created, date_indexed, date_modified, extension, hidden, inode, @@ -134,63 +87,65 @@ impl Task for SaveTask { let (sync_stuff, paths): (Vec<_>, Vec<_>) = walked_entries .drain(..) - .map(|entry| { - let IsolatedFilePathDataParts { - materialized_path, - is_dir, - name, - extension, - .. - } = entry.iso_file_path.to_parts(); + .map( + |WalkedEntry { + pub_id, + maybe_object_id, + iso_file_path, + metadata, + }| { + let IsolatedFilePathDataParts { + materialized_path, + is_dir, + name, + extension, + .. + } = iso_file_path.to_parts(); - let pub_id = sd_utils::uuid_to_bytes(entry.pub_id); + assert!( + maybe_object_id.is_none(), + "Object ID must be None as this tasks only created \ + new file_paths and they were not identified yet" + ); - let (sync_params, db_params): (Vec<_>, Vec<_>) = [ - ( + let (sync_params, db_params): (Vec<_>, Vec<_>) = [ ( - location::NAME, - msgpack!(prisma_sync::location::SyncId { - pub_id: location_pub_id.clone() - }), + ( + location::NAME, + msgpack!(prisma_sync::location::SyncId { + pub_id: location_pub_id.clone() + }), + ), + location_id::set(Some(*location_id)), ), - location_id::set(Some(*location_id)), - ), - sync_db_entry!(materialized_path.to_string(), materialized_path), - sync_db_entry!(name.to_string(), name), - sync_db_entry!(is_dir, is_dir), - sync_db_entry!(extension.to_string(), extension), - sync_db_entry!( - entry.metadata.size_in_bytes.to_be_bytes().to_vec(), - size_in_bytes_bytes - ), - sync_db_entry!(inode_to_db(entry.metadata.inode), inode), - { - let v = entry.metadata.created_at.into(); - sync_db_entry!(v, date_created) - }, - { - let v = entry.metadata.modified_at.into(); - sync_db_entry!(v, date_modified) - }, - { - let v = Utc::now().into(); - sync_db_entry!(v, date_indexed) - }, - sync_db_entry!(entry.metadata.hidden, hidden), - ] - .into_iter() - .unzip(); + sync_db_entry!(materialized_path.to_string(), materialized_path), + sync_db_entry!(name.to_string(), name), + sync_db_entry!(is_dir, is_dir), + sync_db_entry!(extension.to_string(), extension), + sync_db_entry!( + metadata.size_in_bytes.to_be_bytes().to_vec(), + size_in_bytes_bytes + ), + sync_db_entry!(inode_to_db(metadata.inode), inode), + sync_db_entry!(metadata.created_at.into(), date_created), + sync_db_entry!(metadata.modified_at.into(), date_modified), + sync_db_entry!(Utc::now().into(), date_indexed), + sync_db_entry!(metadata.hidden, hidden), + ] + .into_iter() + .unzip(); - ( - sync.shared_create( - prisma_sync::file_path::SyncId { - pub_id: sd_utils::uuid_to_bytes(entry.pub_id), - }, - sync_params, - ), - create_unchecked(pub_id, db_params), - ) - }) + ( + sync.shared_create( + prisma_sync::file_path::SyncId { + pub_id: pub_id.to_db(), + }, + sync_params, + ), + create_unchecked(pub_id.into(), db_params), + ) + }, + ) .unzip(); #[allow(clippy::cast_sign_loss)] @@ -203,16 +158,117 @@ impl Task for SaveTask { ), ) .await - .map_err(IndexerError::from)? as u64; + .map_err(indexer::Error::from)? as u64; - trace!("Inserted {saved_count} records"); + let save_duration = start_time.elapsed(); + + trace!(saved_count, "Inserted records;"); Ok(ExecStatus::Done( - SaveTaskOutput { + Output { saved_count, - save_duration: start_time.elapsed(), + save_duration, } .into_output(), )) } } + +impl Saver { + #[must_use] + pub fn new_deep( + location_id: location::id::Type, + location_pub_id: location::pub_id::Type, + walked_entries: Vec, + db: Arc, + sync: Arc, + ) -> Self { + Self { + id: TaskId::new_v4(), + location_id, + location_pub_id, + walked_entries, + db, + sync, + is_shallow: false, + } + } + + #[must_use] + pub fn new_shallow( + location_id: location::id::Type, + location_pub_id: location::pub_id::Type, + walked_entries: Vec, + db: Arc, + sync: Arc, + ) -> Self { + Self { + id: TaskId::new_v4(), + location_id, + location_pub_id, + walked_entries, + db, + sync, + is_shallow: true, + } + } +} + +#[derive(Debug, Serialize, Deserialize)] +struct SaveState { + id: TaskId, + is_shallow: bool, + + location_id: location::id::Type, + location_pub_id: location::pub_id::Type, + walked_entries: Vec, +} + +impl SerializableTask for Saver { + type SerializeError = rmp_serde::encode::Error; + + type DeserializeError = rmp_serde::decode::Error; + + type DeserializeCtx = (Arc, Arc); + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + is_shallow, + location_id, + location_pub_id, + walked_entries, + .. + } = self; + rmp_serde::to_vec_named(&SaveState { + id, + is_shallow, + location_id, + location_pub_id, + walked_entries, + }) + } + + async fn deserialize( + data: &[u8], + (db, sync): Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice(data).map( + |SaveState { + id, + is_shallow, + location_id, + location_pub_id, + walked_entries, + }| Self { + id, + is_shallow, + location_id, + location_pub_id, + walked_entries, + db, + sync, + }, + ) + } +} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/updater.rs b/core/crates/heavy-lifting/src/indexer/tasks/updater.rs index f7e99e800..47c552814 100644 --- a/core/crates/heavy-lifting/src/indexer/tasks/updater.rs +++ b/core/crates/heavy-lifting/src/indexer/tasks/updater.rs @@ -1,4 +1,4 @@ -use crate::{indexer::IndexerError, Error}; +use crate::{indexer, Error}; use sd_core_file_path_helper::IsolatedFilePathDataParts; use sd_core_sync::Manager as SyncManager; @@ -17,90 +17,58 @@ use std::{collections::HashSet, sync::Arc, time::Duration}; use serde::{Deserialize, Serialize}; use tokio::time::Instant; -use tracing::trace; +use tracing::{instrument, trace, Level}; use super::walker::WalkedEntry; #[derive(Debug)] -pub struct UpdateTask { +pub struct Updater { + // Task control id: TaskId, + is_shallow: bool, + + // Received input args walked_entries: Vec, + + // Inner state object_ids_that_should_be_unlinked: HashSet, + + // Dependencies db: Arc, sync: Arc, } -impl UpdateTask { - #[must_use] - pub fn new( - walked_entries: Vec, - db: Arc, - sync: Arc, - ) -> Self { - Self { - id: TaskId::new_v4(), - walked_entries, - db, - sync, - object_ids_that_should_be_unlinked: HashSet::new(), - } - } -} - -#[derive(Debug, Serialize, Deserialize)] -struct UpdateTaskSaveState { - id: TaskId, - walked_entries: Vec, - object_ids_that_should_be_unlinked: HashSet, -} - -impl SerializableTask for UpdateTask { - type SerializeError = rmp_serde::encode::Error; - - type DeserializeError = rmp_serde::decode::Error; - - type DeserializeCtx = (Arc, Arc); - - async fn serialize(self) -> Result, Self::SerializeError> { - rmp_serde::to_vec_named(&UpdateTaskSaveState { - id: self.id, - walked_entries: self.walked_entries, - object_ids_that_should_be_unlinked: self.object_ids_that_should_be_unlinked, - }) - } - - async fn deserialize( - data: &[u8], - (db, sync): Self::DeserializeCtx, - ) -> Result { - rmp_serde::from_slice(data).map( - |UpdateTaskSaveState { - id, - walked_entries, - object_ids_that_should_be_unlinked, - }| Self { - id, - walked_entries, - object_ids_that_should_be_unlinked, - db, - sync, - }, - ) - } -} - +/// [`Update`] Task output #[derive(Debug)] -pub struct UpdateTaskOutput { +pub struct Output { + /// Number of records updated on database pub updated_count: u64, + /// Time spent updating records pub update_duration: Duration, } #[async_trait::async_trait] -impl Task for UpdateTask { +impl Task for Updater { fn id(&self) -> TaskId { self.id } + fn with_priority(&self) -> bool { + // If we're running in shallow mode, then we want priority + self.is_shallow + } + + #[instrument( + skip_all, + fields( + task_id = %self.id, + to_update_count = %self.walked_entries.len(), + is_shallow = self.is_shallow, + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above async fn run(&mut self, interrupter: &Interrupter) -> Result { use file_path::{ cas_id, date_created, date_modified, hidden, inode, is_dir, object, object_id, @@ -123,62 +91,70 @@ impl Task for UpdateTask { let (sync_stuff, paths_to_update) = walked_entries .drain(..) - .map(|entry| { - let IsolatedFilePathDataParts { is_dir, .. } = &entry.iso_file_path.to_parts(); + .map( + |WalkedEntry { + pub_id, + maybe_object_id, + iso_file_path, + metadata, + }| { + let IsolatedFilePathDataParts { is_dir, .. } = &iso_file_path.to_parts(); - let pub_id = sd_utils::uuid_to_bytes(entry.pub_id); + let should_unlink_object = maybe_object_id.map_or(false, |object_id| { + object_ids_that_should_be_unlinked.contains(&object_id) + }); - let should_unlink_object = entry.maybe_object_id.map_or(false, |object_id| { - object_ids_that_should_be_unlinked.contains(&object_id) - }); + let (sync_params, db_params) = chain_optional_iter( + [ + ((cas_id::NAME, msgpack!(nil)), cas_id::set(None)), + sync_db_entry!(*is_dir, is_dir), + sync_db_entry!( + metadata.size_in_bytes.to_be_bytes().to_vec(), + size_in_bytes_bytes + ), + sync_db_entry!(inode_to_db(metadata.inode), inode), + { + let v = metadata.created_at.into(); + sync_db_entry!(v, date_created) + }, + { + let v = metadata.modified_at.into(); + sync_db_entry!(v, date_modified) + }, + sync_db_entry!(metadata.hidden, hidden), + ], + [ + // As this file was updated while Spacedrive was offline, we mark the object_id and cas_id as null + // So this file_path will be updated at file identifier job + should_unlink_object.then_some(( + (object_id::NAME, msgpack!(nil)), + object::disconnect(), + )), + ], + ) + .into_iter() + .unzip::<_, _, Vec<_>, Vec<_>>(); - let (sync_params, db_params) = chain_optional_iter( - [ - ((cas_id::NAME, msgpack!(nil)), cas_id::set(None)), - sync_db_entry!(*is_dir, is_dir), - sync_db_entry!( - entry.metadata.size_in_bytes.to_be_bytes().to_vec(), - size_in_bytes_bytes - ), - sync_db_entry!(inode_to_db(entry.metadata.inode), inode), - { - let v = entry.metadata.created_at.into(); - sync_db_entry!(v, date_created) - }, - { - let v = entry.metadata.modified_at.into(); - sync_db_entry!(v, date_modified) - }, - sync_db_entry!(entry.metadata.hidden, hidden), - ], - [ - // As this file was updated while Spacedrive was offline, we mark the object_id and cas_id as null - // So this file_path will be updated at file identifier job - should_unlink_object - .then_some(((object_id::NAME, msgpack!(nil)), object::disconnect())), - ], - ) - .into_iter() - .unzip::<_, _, Vec<_>, Vec<_>>(); - - ( - sync_params - .into_iter() - .map(|(field, value)| { - sync.shared_update( - prisma_sync::file_path::SyncId { - pub_id: pub_id.clone(), - }, - field, - value, - ) - }) - .collect::>(), - db.file_path() - .update(file_path::pub_id::equals(pub_id), db_params) - .select(file_path::select!({ id })), - ) - }) + ( + sync_params + .into_iter() + .map(|(field, value)| { + sync.shared_update( + prisma_sync::file_path::SyncId { + pub_id: pub_id.to_db(), + }, + field, + value, + ) + }) + .collect::>(), + db.file_path() + .update(file_path::pub_id::equals(pub_id.into()), db_params) + // selecting id to avoid fetching whole object from database + .select(file_path::select!({ id })), + ) + }, + ) .unzip::<_, _, Vec<_>, Vec<_>>(); let updated = sync @@ -187,25 +163,61 @@ impl Task for UpdateTask { (sync_stuff.into_iter().flatten().collect(), paths_to_update), ) .await - .map_err(IndexerError::from)?; + .map_err(indexer::Error::from)?; - trace!("Updated {updated:?} records"); + let update_duration = start_time.elapsed(); + + trace!(?updated, "Updated records;"); Ok(ExecStatus::Done( - UpdateTaskOutput { + Output { updated_count: updated.len() as u64, - update_duration: start_time.elapsed(), + update_duration, } .into_output(), )) } } +impl Updater { + #[must_use] + pub fn new_deep( + walked_entries: Vec, + db: Arc, + sync: Arc, + ) -> Self { + Self { + id: TaskId::new_v4(), + walked_entries, + db, + sync, + object_ids_that_should_be_unlinked: HashSet::new(), + is_shallow: false, + } + } + + #[must_use] + pub fn new_shallow( + walked_entries: Vec, + db: Arc, + sync: Arc, + ) -> Self { + Self { + id: TaskId::new_v4(), + walked_entries, + db, + sync, + object_ids_that_should_be_unlinked: HashSet::new(), + is_shallow: true, + } + } +} + async fn fetch_objects_ids_to_unlink( walked_entries: &[WalkedEntry], object_ids_that_should_be_unlinked: &mut HashSet, db: &PrismaClient, -) -> Result<(), IndexerError> { +) -> Result<(), indexer::Error> { if object_ids_that_should_be_unlinked.is_empty() { // First we consult which file paths we should unlink let object_ids = walked_entries @@ -234,3 +246,59 @@ async fn fetch_objects_ids_to_unlink( Ok(()) } + +#[derive(Debug, Serialize, Deserialize)] +struct SaveState { + id: TaskId, + is_shallow: bool, + + walked_entries: Vec, + + object_ids_that_should_be_unlinked: HashSet, +} + +impl SerializableTask for Updater { + type SerializeError = rmp_serde::encode::Error; + + type DeserializeError = rmp_serde::decode::Error; + + type DeserializeCtx = (Arc, Arc); + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + walked_entries, + object_ids_that_should_be_unlinked, + is_shallow, + .. + } = self; + + rmp_serde::to_vec_named(&SaveState { + id, + is_shallow, + walked_entries, + object_ids_that_should_be_unlinked, + }) + } + + async fn deserialize( + data: &[u8], + (db, sync): Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice(data).map( + |SaveState { + id, + is_shallow, + walked_entries, + object_ids_that_should_be_unlinked, + }| Self { + id, + is_shallow, + walked_entries, + object_ids_that_should_be_unlinked, + db, + sync, + }, + ) + } +} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/walker.rs b/core/crates/heavy-lifting/src/indexer/tasks/walker.rs deleted file mode 100644 index 7b8eefd4d..000000000 --- a/core/crates/heavy-lifting/src/indexer/tasks/walker.rs +++ /dev/null @@ -1,1516 +0,0 @@ -use crate::{ - indexer::{IndexerError, NonCriticalIndexerError}, - Error, NonCriticalJobError, -}; - -use sd_core_file_path_helper::{FilePathError, FilePathMetadata, IsolatedFilePathData}; -use sd_core_indexer_rules::{IndexerRuler, MetadataForIndexerRules, RuleKind}; -use sd_core_prisma_helpers::{file_path_pub_and_cas_ids, file_path_walker}; - -use sd_prisma::prisma::file_path; -use sd_task_system::{ - check_interruption, ExecStatus, Interrupter, IntoAnyTaskOutput, SerializableTask, Task, - TaskDispatcher, TaskHandle, TaskId, -}; -use sd_utils::{db::inode_from_db, error::FileIOError}; - -use std::{ - collections::{hash_map::Entry, HashMap, HashSet}, - fmt, - fs::Metadata, - future::Future, - hash::{Hash, Hasher}, - mem, - path::{Path, PathBuf}, - sync::Arc, - time::Duration, -}; - -use chrono::{DateTime, Duration as ChronoDuration, FixedOffset, Utc}; -use futures_concurrency::future::Join; -use serde::{Deserialize, Serialize}; -use tokio::{fs, time::Instant}; -use tokio_stream::{wrappers::ReadDirStream, StreamExt}; -use tracing::trace; -use uuid::Uuid; - -/// `WalkedEntry` represents a single path in the filesystem -#[derive(Debug, Serialize, Deserialize)] -pub struct WalkedEntry { - pub pub_id: Uuid, - pub maybe_object_id: file_path::object_id::Type, - pub iso_file_path: IsolatedFilePathData<'static>, - pub metadata: FilePathMetadata, -} - -impl PartialEq for WalkedEntry { - fn eq(&self, other: &Self) -> bool { - self.iso_file_path == other.iso_file_path - } -} - -impl Eq for WalkedEntry {} - -impl Hash for WalkedEntry { - fn hash(&self, state: &mut H) { - self.iso_file_path.hash(state); - } -} - -#[derive(Debug, Serialize, Deserialize)] -struct WalkingEntry { - iso_file_path: IsolatedFilePathData<'static>, - metadata: FilePathMetadata, -} - -impl From for WalkedEntry { - fn from( - WalkingEntry { - iso_file_path, - metadata, - }: WalkingEntry, - ) -> Self { - Self { - pub_id: Uuid::new_v4(), - maybe_object_id: None, - iso_file_path, - metadata, - } - } -} - -impl From<(Uuid, file_path::object_id::Type, WalkingEntry)> for WalkedEntry { - fn from( - ( - pub_id, - maybe_object_id, - WalkingEntry { - iso_file_path, - metadata, - }, - ): (Uuid, file_path::object_id::Type, WalkingEntry), - ) -> Self { - Self { - pub_id, - maybe_object_id, - iso_file_path, - metadata, - } - } -} - -pub trait IsoFilePathFactory: Clone + Send + Sync + fmt::Debug + 'static { - fn build( - &self, - path: impl AsRef, - is_dir: bool, - ) -> Result, FilePathError>; -} - -pub trait WalkerDBProxy: Clone + Send + Sync + fmt::Debug + 'static { - fn fetch_file_paths( - &self, - found_paths: Vec, - ) -> impl Future, IndexerError>> + Send; - - fn fetch_file_paths_to_remove( - &self, - parent_iso_file_path: &IsolatedFilePathData<'_>, - unique_location_id_materialized_path_name_extension_params: Vec, - ) -> impl Future, NonCriticalIndexerError>> + Send; -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct ToWalkEntry { - path: PathBuf, - parent_dir_accepted_by_its_children: Option, -} - -impl> From

for ToWalkEntry { - fn from(path: P) -> Self { - Self { - path: path.as_ref().into(), - parent_dir_accepted_by_its_children: None, - } - } -} - -#[derive(Debug)] -pub struct WalkTaskOutput { - pub to_create: Vec, - pub to_update: Vec, - pub to_remove: Vec, - pub accepted_ancestors: HashSet, - pub errors: Vec, - pub directory_iso_file_path: IsolatedFilePathData<'static>, - pub total_size: u64, - pub handles: Vec>, - pub scan_time: Duration, -} - -#[derive(Debug, Serialize, Deserialize)] -struct InnerMetadata { - pub is_dir: bool, - pub is_symlink: bool, - pub inode: u64, - pub size_in_bytes: u64, - pub hidden: bool, - pub created_at: DateTime, - pub modified_at: DateTime, -} - -impl InnerMetadata { - fn new(path: impl AsRef, metadata: &Metadata) -> Result { - let FilePathMetadata { - inode, - size_in_bytes, - created_at, - modified_at, - hidden, - } = FilePathMetadata::from_path(path, metadata) - .map_err(|e| NonCriticalIndexerError::FilePathMetadata(e.to_string()))?; - - Ok(Self { - is_dir: metadata.is_dir(), - is_symlink: metadata.is_symlink(), - inode, - size_in_bytes, - hidden, - created_at, - modified_at, - }) - } -} - -impl MetadataForIndexerRules for InnerMetadata { - fn is_dir(&self) -> bool { - self.is_dir - } -} - -impl From for FilePathMetadata { - fn from(metadata: InnerMetadata) -> Self { - Self { - inode: metadata.inode, - size_in_bytes: metadata.size_in_bytes, - hidden: metadata.hidden, - created_at: metadata.created_at, - modified_at: metadata.modified_at, - } - } -} - -#[derive(Debug)] -enum WalkerStage { - Start, - Walking { - read_dir_stream: ReadDirStream, - found_paths: Vec, - }, - CollectingMetadata { - found_paths: Vec, - }, - CheckingIndexerRules { - paths_and_metadatas: HashMap, - }, - ProcessingRulesResults { - paths_metadatas_and_acceptance: - HashMap>)>, - }, - GatheringFilePathsToRemove { - accepted_paths: HashMap, - maybe_to_keep_walking: Option>, - accepted_ancestors: HashSet, - }, - Finalize { - walking_entries: Vec, - accepted_ancestors: HashSet, - to_remove_entries: Vec, - maybe_to_keep_walking: Option>, - }, -} - -#[derive(Debug, Serialize, Deserialize)] -struct WalkDirSaveState { - id: TaskId, - entry: ToWalkEntry, - root: Arc, - entry_iso_file_path: IsolatedFilePathData<'static>, - stage: WalkerStageSaveState, - errors: Vec, - scan_time: Duration, -} - -#[derive(Debug, Serialize, Deserialize)] -enum WalkerStageSaveState { - Start, - CollectingMetadata { - found_paths: Vec, - }, - CheckingIndexerRules { - paths_and_metadatas: HashMap, - }, - ProcessingRulesResults { - paths_metadatas_and_acceptance: - HashMap>)>, - }, - GatheringFilePathsToRemove { - accepted_paths: HashMap, - maybe_to_keep_walking: Option>, - accepted_ancestors: HashSet, - }, - Finalize { - walking_entries: Vec, - accepted_ancestors: HashSet, - to_remove_entries: Vec, - maybe_to_keep_walking: Option>, - }, -} - -impl From for WalkerStageSaveState { - fn from(stage: WalkerStage) -> Self { - match stage { - // We can't store the current state of `ReadDirStream` so we start again from the beginning - WalkerStage::Start | WalkerStage::Walking { .. } => Self::Start, - WalkerStage::CollectingMetadata { found_paths } => { - Self::CollectingMetadata { found_paths } - } - WalkerStage::CheckingIndexerRules { - paths_and_metadatas, - } => Self::CheckingIndexerRules { - paths_and_metadatas, - }, - WalkerStage::ProcessingRulesResults { - paths_metadatas_and_acceptance, - } => Self::ProcessingRulesResults { - paths_metadatas_and_acceptance, - }, - WalkerStage::GatheringFilePathsToRemove { - accepted_paths, - maybe_to_keep_walking, - accepted_ancestors, - } => Self::GatheringFilePathsToRemove { - accepted_paths, - maybe_to_keep_walking, - accepted_ancestors, - }, - WalkerStage::Finalize { - walking_entries, - accepted_ancestors, - to_remove_entries, - maybe_to_keep_walking, - } => Self::Finalize { - walking_entries, - accepted_ancestors, - to_remove_entries, - maybe_to_keep_walking, - }, - } - } -} - -impl From for WalkerStage { - fn from(value: WalkerStageSaveState) -> Self { - match value { - WalkerStageSaveState::Start => Self::Start, - WalkerStageSaveState::CollectingMetadata { found_paths } => { - Self::CollectingMetadata { found_paths } - } - WalkerStageSaveState::CheckingIndexerRules { - paths_and_metadatas, - } => Self::CheckingIndexerRules { - paths_and_metadatas, - }, - WalkerStageSaveState::ProcessingRulesResults { - paths_metadatas_and_acceptance, - } => Self::ProcessingRulesResults { - paths_metadatas_and_acceptance, - }, - WalkerStageSaveState::GatheringFilePathsToRemove { - accepted_paths, - maybe_to_keep_walking, - accepted_ancestors, - } => Self::GatheringFilePathsToRemove { - accepted_paths, - maybe_to_keep_walking, - accepted_ancestors, - }, - WalkerStageSaveState::Finalize { - walking_entries, - accepted_ancestors, - to_remove_entries, - maybe_to_keep_walking, - } => Self::Finalize { - walking_entries, - accepted_ancestors, - to_remove_entries, - maybe_to_keep_walking, - }, - } - } -} - -#[derive(Debug)] -pub struct WalkDirTask -where - DBProxy: WalkerDBProxy, - IsoPathFactory: IsoFilePathFactory, - Dispatcher: TaskDispatcher, -{ - id: TaskId, - entry: ToWalkEntry, - root: Arc, - entry_iso_file_path: IsolatedFilePathData<'static>, - indexer_ruler: IndexerRuler, - iso_file_path_factory: IsoPathFactory, - db_proxy: DBProxy, - stage: WalkerStage, - maybe_dispatcher: Option, - errors: Vec, - scan_time: Duration, -} - -impl WalkDirTask -where - DBProxy: WalkerDBProxy, - IsoPathFactory: IsoFilePathFactory, - Dispatcher: TaskDispatcher, -{ - pub fn new( - entry: impl Into + Send, - root: Arc, - indexer_ruler: IndexerRuler, - iso_file_path_factory: IsoPathFactory, - db_proxy: DBProxy, - maybe_dispatcher: Option, - ) -> Result { - let entry = entry.into(); - Ok(Self { - id: TaskId::new_v4(), - root, - indexer_ruler, - entry_iso_file_path: iso_file_path_factory.build(&entry.path, true)?, - iso_file_path_factory, - db_proxy, - stage: WalkerStage::Start, - entry, - maybe_dispatcher, - errors: Vec::new(), - scan_time: Duration::ZERO, - }) - } -} - -impl SerializableTask - for WalkDirTask -where - DBProxy: WalkerDBProxy, - IsoPathFactory: IsoFilePathFactory, - Dispatcher: TaskDispatcher, -{ - type SerializeError = rmp_serde::encode::Error; - type DeserializeError = rmp_serde::decode::Error; - type DeserializeCtx = (IndexerRuler, DBProxy, IsoPathFactory, Dispatcher); - - async fn serialize(self) -> Result, Self::SerializeError> { - rmp_serde::to_vec_named(&WalkDirSaveState { - id: self.id, - entry: self.entry, - root: self.root, - entry_iso_file_path: self.entry_iso_file_path, - stage: self.stage.into(), - errors: self.errors, - scan_time: self.scan_time, - }) - } - - async fn deserialize( - data: &[u8], - (indexer_ruler, db_proxy, iso_file_path_factory, dispatcher): Self::DeserializeCtx, - ) -> Result { - rmp_serde::from_slice(data).map( - |WalkDirSaveState { - id, - entry, - root, - entry_iso_file_path, - stage, - errors, - scan_time, - }| Self { - id, - entry, - root, - entry_iso_file_path, - indexer_ruler, - iso_file_path_factory, - db_proxy, - stage: stage.into(), - maybe_dispatcher: Some(dispatcher), - errors, - scan_time, - }, - ) - } -} - -#[async_trait::async_trait] -impl Task - for WalkDirTask -where - DBProxy: WalkerDBProxy, - IsoPathFactory: IsoFilePathFactory, - Dispatcher: TaskDispatcher, -{ - fn id(&self) -> TaskId { - self.id - } - - #[allow(clippy::too_many_lines)] - async fn run(&mut self, interrupter: &Interrupter) -> Result { - let Self { - root, - entry: ToWalkEntry { - path, - parent_dir_accepted_by_its_children, - }, - entry_iso_file_path, - iso_file_path_factory, - indexer_ruler, - db_proxy, - stage, - maybe_dispatcher, - errors, - scan_time, - .. - } = self; - - let start_time = Instant::now(); - - let (to_create, to_update, total_size, to_remove, accepted_ancestors, handles) = loop { - match stage { - WalkerStage::Start => { - *stage = WalkerStage::Walking { - read_dir_stream: ReadDirStream::new(fs::read_dir(&path).await.map_err( - |e| { - IndexerError::FileIO( - (&path, e, "Failed to open directory to read its entries") - .into(), - ) - }, - )?), - found_paths: Vec::new(), - }; - } - - WalkerStage::Walking { - read_dir_stream, - found_paths, - } => { - while let Some(res) = read_dir_stream.next().await { - match res { - Ok(dir_entry) => { - found_paths.push(dir_entry.path()); - } - Err(e) => { - errors.push(NonCriticalJobError::Indexer( - NonCriticalIndexerError::FailedDirectoryEntry( - FileIOError::from((&path, e)).to_string(), - ), - )); - } - } - - check_interruption!(interrupter, start_time, scan_time); - } - - *stage = WalkerStage::CollectingMetadata { - found_paths: mem::take(found_paths), - }; - - check_interruption!(interrupter, start_time, scan_time); - } - - WalkerStage::CollectingMetadata { found_paths } => { - *stage = WalkerStage::CheckingIndexerRules { - paths_and_metadatas: collect_metadata(found_paths, errors).await, - }; - - check_interruption!(interrupter, start_time, scan_time); - } - - WalkerStage::CheckingIndexerRules { - paths_and_metadatas, - } => { - *stage = WalkerStage::ProcessingRulesResults { - paths_metadatas_and_acceptance: apply_indexer_rules( - paths_and_metadatas, - indexer_ruler, - errors, - ) - .await, - }; - - check_interruption!(interrupter, start_time, scan_time); - } - - WalkerStage::ProcessingRulesResults { - paths_metadatas_and_acceptance, - } => { - let mut maybe_to_keep_walking = maybe_dispatcher.is_some().then(Vec::new); - let (accepted_paths, accepted_ancestors) = process_rules_results( - root, - iso_file_path_factory, - *parent_dir_accepted_by_its_children, - paths_metadatas_and_acceptance, - &mut maybe_to_keep_walking, - errors, - ) - .await; - - *stage = WalkerStage::GatheringFilePathsToRemove { - accepted_paths, - maybe_to_keep_walking, - accepted_ancestors, - }; - - check_interruption!(interrupter, start_time, scan_time); - } - - WalkerStage::GatheringFilePathsToRemove { - accepted_paths, - maybe_to_keep_walking, - accepted_ancestors, - } => { - let (walking_entries, to_remove_entries) = gather_file_paths_to_remove( - accepted_paths, - entry_iso_file_path, - iso_file_path_factory, - db_proxy, - errors, - ) - .await; - - *stage = WalkerStage::Finalize { - walking_entries, - to_remove_entries, - maybe_to_keep_walking: mem::take(maybe_to_keep_walking), - accepted_ancestors: mem::take(accepted_ancestors), - }; - - check_interruption!(interrupter, start_time, scan_time); - } - - // From this points onwards, we will not allow to be interrupted anymore - WalkerStage::Finalize { - walking_entries, - to_remove_entries, - maybe_to_keep_walking, - accepted_ancestors, - } => { - let (to_create, to_update, total_size) = - segregate_creates_and_updates(walking_entries, db_proxy).await?; - - let handles = keep_walking( - root, - indexer_ruler, - iso_file_path_factory, - db_proxy, - maybe_to_keep_walking, - maybe_dispatcher, - errors, - ) - .await; - - break ( - to_create, - to_update, - total_size, - mem::take(to_remove_entries), - mem::take(accepted_ancestors), - handles, - ); - } - } - }; - - *scan_time += start_time.elapsed(); - - // Taking out some data as the task is finally complete - Ok(ExecStatus::Done( - WalkTaskOutput { - to_create, - to_update, - to_remove, - accepted_ancestors, - errors: mem::take(errors), - directory_iso_file_path: mem::take(entry_iso_file_path), - total_size, - handles, - scan_time: *scan_time, - } - .into_output(), - )) - } -} - -async fn segregate_creates_and_updates( - walking_entries: &mut Vec, - db_proxy: &impl WalkerDBProxy, -) -> Result<(Vec, Vec, u64), IndexerError> { - if walking_entries.is_empty() { - Ok((vec![], vec![], 0)) - } else { - let iso_paths_already_in_db = db_proxy - .fetch_file_paths( - walking_entries - .iter() - .map(|entry| file_path::WhereParam::from(&entry.iso_file_path)) - .collect(), - ) - .await? - .into_iter() - .flat_map(|file_path| { - IsolatedFilePathData::try_from(file_path.clone()) - .map(|iso_file_path| (iso_file_path, file_path)) - }) - .collect::>(); - - Ok(walking_entries.drain(..).fold( - (Vec::new(), Vec::new(), 0), - |(mut to_create, mut to_update, mut total_size), entry| { - let WalkingEntry{iso_file_path, metadata} = &entry; - - total_size += metadata.size_in_bytes; - - if let Some(file_path) = iso_paths_already_in_db.get(iso_file_path) { - if let (Some(inode), Some(date_modified)) = ( - &file_path.inode, - &file_path.date_modified, - ) { - if ( - inode_from_db(&inode[0..8]) != metadata.inode - // Datetimes stored in DB loses a bit of precision, so we need to check against a delta - // instead of using != operator - || DateTime::::from(metadata.modified_at) - *date_modified - > ChronoDuration::milliseconds(1) || file_path.hidden.is_none() || metadata.hidden != file_path.hidden.unwrap_or_default() - ) - // We ignore the size of directories because it is not reliable, we need to - // calculate it ourselves later - && !( - iso_file_path.to_parts().is_dir - && metadata.size_in_bytes - != file_path - .size_in_bytes_bytes - .as_ref() - .map(|size_in_bytes_bytes| { - u64::from_be_bytes([ - size_in_bytes_bytes[0], - size_in_bytes_bytes[1], - size_in_bytes_bytes[2], - size_in_bytes_bytes[3], - size_in_bytes_bytes[4], - size_in_bytes_bytes[5], - size_in_bytes_bytes[6], - size_in_bytes_bytes[7], - ]) - }) - .unwrap_or_default() - ) { - to_update.push( - WalkedEntry::from((sd_utils::from_bytes_to_uuid(&file_path.pub_id), file_path.object_id, entry)), - ); - } - } - } else { - to_create.push(WalkedEntry::from(entry)); - } - - (to_create, to_update, total_size) - } - )) - } -} - -async fn keep_walking( - root: &Arc, - indexer_ruler: &IndexerRuler, - iso_file_path_factory: &impl IsoFilePathFactory, - db_proxy: &impl WalkerDBProxy, - maybe_to_keep_walking: &mut Option>, - dispatcher: &Option>, - errors: &mut Vec, -) -> Vec> { - if let (Some(dispatcher), Some(to_keep_walking)) = (dispatcher, maybe_to_keep_walking) { - dispatcher - .dispatch_many( - to_keep_walking - .drain(..) - .map(|entry| { - WalkDirTask::new( - entry, - Arc::clone(root), - indexer_ruler.clone(), - iso_file_path_factory.clone(), - db_proxy.clone(), - Some(dispatcher.clone()), - ) - .map_err(|e| NonCriticalIndexerError::DispatchKeepWalking(e.to_string())) - }) - .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()), - ) - .await - } else { - Vec::new() - } -} - -async fn collect_metadata( - found_paths: &mut Vec, - errors: &mut Vec, -) -> HashMap { - found_paths - .drain(..) - .map(|current_path| async move { - fs::metadata(¤t_path) - .await - .map_err(|e| { - NonCriticalIndexerError::Metadata( - FileIOError::from((¤t_path, e)).to_string(), - ) - }) - .and_then(|metadata| { - InnerMetadata::new(¤t_path, &metadata) - .map(|metadata| (current_path, metadata)) - }) - }) - .collect::>() - .join() - .await - .into_iter() - .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) - .collect() -} - -async fn apply_indexer_rules( - paths_and_metadatas: &mut HashMap, - indexer_ruler: &IndexerRuler, - errors: &mut Vec, -) -> HashMap>)> { - paths_and_metadatas - .drain() - // TODO: Hard ignoring symlinks for now, but this should be configurable - .filter(|(_, metadata)| !metadata.is_symlink) - .map(|(current_path, metadata)| async { - indexer_ruler - .apply_all(¤t_path, &metadata) - .await - .map(|acceptance_per_rule_kind| { - (current_path, (metadata, acceptance_per_rule_kind)) - }) - .map_err(|e| NonCriticalIndexerError::IndexerRule(e.to_string())) - }) - .collect::>() - .join() - .await - .into_iter() - .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) - .collect() -} - -async fn process_rules_results( - root: &Arc, - iso_file_path_factory: &impl IsoFilePathFactory, - parent_dir_accepted_by_its_children: Option, - paths_metadatas_and_acceptance: &mut HashMap< - PathBuf, - (InnerMetadata, HashMap>), - >, - maybe_to_keep_walking: &mut Option>, - errors: &mut Vec, -) -> (HashMap, HashSet) { - let root = root.as_ref(); - - let (accepted, accepted_ancestors) = paths_metadatas_and_acceptance.drain().fold( - (HashMap::new(), HashMap::new()), - |(mut accepted, mut accepted_ancestors), - (current_path, (metadata, acceptance_per_rule_kind))| { - // Accept by children has three states, - // None if we don't now yet or if this check doesn't apply - // Some(true) if this check applies and it passes - // Some(false) if this check applies and it was rejected - // and we pass the current parent state to its children - let mut accept_by_children_dir = parent_dir_accepted_by_its_children; - - if rejected_by_reject_glob(&acceptance_per_rule_kind) { - trace!( - "Path {} rejected by `RuleKind::RejectFilesByGlob`", - current_path.display() - ); - - return (accepted, accepted_ancestors); - } - - let is_dir = metadata.is_dir(); - - if is_dir - && process_and_maybe_reject_by_directory_rules( - ¤t_path, - &acceptance_per_rule_kind, - &mut accept_by_children_dir, - maybe_to_keep_walking, - ) { - trace!( - "Path {} rejected by rule `RuleKind::RejectIfChildrenDirectoriesArePresent`", - current_path.display(), - ); - return (accepted, accepted_ancestors); - } - - if rejected_by_accept_glob(&acceptance_per_rule_kind) { - trace!( - "Path {} reject because it didn't passed in any AcceptFilesByGlob rules", - current_path.display() - ); - return (accepted, accepted_ancestors); - } - - if accept_by_children_dir.unwrap_or(true) { - accept_ancestors( - current_path, - metadata, - root, - &mut accepted, - iso_file_path_factory, - &mut accepted_ancestors, - errors, - ); - } - - (accepted, accepted_ancestors) - }, - ); - - ( - accepted, - accepted_ancestors - .into_iter() - .map(|(ancestor_iso_file_path, ancestor_path)| async move { - fs::metadata(&ancestor_path) - .await - .map_err(|e| { - NonCriticalIndexerError::Metadata( - FileIOError::from((&ancestor_path, e)).to_string(), - ) - }) - .and_then(|metadata| { - FilePathMetadata::from_path(&ancestor_path, &metadata) - .map(|metadata| { - WalkingEntry { - iso_file_path: ancestor_iso_file_path, - metadata, - } - .into() - }) - .map_err(|e| NonCriticalIndexerError::FilePathMetadata(e.to_string())) - }) - }) - .collect::>() - .join() - .await - .into_iter() - .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) - .collect(), - ) -} - -fn process_and_maybe_reject_by_directory_rules( - current_path: &Path, - acceptance_per_rule_kind: &HashMap>, - accept_by_children_dir: &mut Option, - maybe_to_keep_walking: &mut Option>, -) -> bool { - // If it is a directory, first we check if we must reject it and its children entirely - if rejected_by_children_directories(acceptance_per_rule_kind) { - return true; - } - - // Then we check if we must accept it and its children - if let Some(accepted_by_children_rules) = - acceptance_per_rule_kind.get(&RuleKind::AcceptIfChildrenDirectoriesArePresent) - { - if accepted_by_children_rules.iter().any(|accept| *accept) { - *accept_by_children_dir = Some(true); - } - - // If it wasn't accepted then we mark as rejected - if accept_by_children_dir.is_none() { - trace!( - "Path {} rejected because it didn't passed in any AcceptIfChildrenDirectoriesArePresent rule", - current_path.display() - ); - *accept_by_children_dir = Some(false); - } - } - - // Then we mark this directory to maybe be walked in too - if let Some(ref mut to_keep_walking) = maybe_to_keep_walking { - to_keep_walking.push(ToWalkEntry { - path: current_path.to_path_buf(), - parent_dir_accepted_by_its_children: *accept_by_children_dir, - }); - } - - false -} - -fn accept_ancestors( - current_path: PathBuf, - metadata: InnerMetadata, - root: &Path, - accepted: &mut HashMap, - iso_file_path_factory: &impl IsoFilePathFactory, - accepted_ancestors: &mut HashMap, PathBuf>, - errors: &mut Vec, -) { - // If the ancestors directories wasn't indexed before, now we do - for ancestor in current_path - .ancestors() - .skip(1) // Skip the current directory as it was already indexed - .take_while(|&ancestor| ancestor != root) - { - if let Ok(iso_file_path) = iso_file_path_factory - .build(ancestor, true) - .map_err(|e| errors.push(NonCriticalIndexerError::IsoFilePath(e.to_string()).into())) - { - match accepted_ancestors.entry(iso_file_path) { - Entry::Occupied(_) => { - // If we already accepted this ancestor, then it will contain - // also all if its ancestors too, so we can stop here - break; - } - Entry::Vacant(entry) => { - trace!("Accepted ancestor {}", ancestor.display()); - entry.insert(ancestor.to_path_buf()); - } - } - } - } - - accepted.insert(current_path, metadata); -} - -fn rejected_by_accept_glob(acceptance_per_rule_kind: &HashMap>) -> bool { - acceptance_per_rule_kind - .get(&RuleKind::AcceptFilesByGlob) - .map_or(false, |accept_rules| { - accept_rules.iter().all(|accept| !accept) - }) -} - -fn rejected_by_children_directories( - acceptance_per_rule_kind: &HashMap>, -) -> bool { - acceptance_per_rule_kind - .get(&RuleKind::RejectIfChildrenDirectoriesArePresent) - .map_or(false, |reject_results| { - reject_results.iter().any(|reject| !reject) - }) -} - -fn rejected_by_reject_glob(acceptance_per_rule_kind: &HashMap>) -> bool { - acceptance_per_rule_kind - .get(&RuleKind::RejectFilesByGlob) - .map_or(false, |reject_results| { - reject_results.iter().any(|reject| !reject) - }) -} - -async fn gather_file_paths_to_remove( - accepted_paths: &mut HashMap, - entry_iso_file_path: &IsolatedFilePathData<'_>, - iso_file_path_factory: &impl IsoFilePathFactory, - db_proxy: &impl WalkerDBProxy, - errors: &mut Vec, -) -> (Vec, Vec) { - let (walking, to_delete_params) = accepted_paths - .drain() - .filter_map(|(path, metadata)| { - iso_file_path_factory - .build(&path, metadata.is_dir()) - .map(|iso_file_path| { - let params = file_path::WhereParam::from(&iso_file_path); - - ( - WalkingEntry { - iso_file_path, - metadata: FilePathMetadata::from(metadata), - }, - params, - ) - }) - .map_err(|e| { - errors.push(NonCriticalIndexerError::IsoFilePath(e.to_string()).into()); - }) - .ok() - }) - .unzip::<_, _, Vec<_>, Vec<_>>(); - - // We continue the function even if we fail to fetch `file_path`s to remove, - // the DB will have old `file_path`s but at least this is better than - // don't adding the newly indexed paths - let to_remove_entries = db_proxy - .fetch_file_paths_to_remove(entry_iso_file_path, to_delete_params) - .await - .map_err(|e| errors.push(e.into())) - .unwrap_or_default(); - - (walking, to_remove_entries) -} - -#[cfg(test)] -mod tests { - use super::*; - - use sd_core_indexer_rules::{IndexerRule, RulePerKind}; - use sd_task_system::{TaskOutput, TaskStatus, TaskSystem}; - - use chrono::Utc; - use futures_concurrency::future::FutureGroup; - use globset::{Glob, GlobSetBuilder}; - use lending_stream::{LendingStream, StreamExt}; - use tempfile::{tempdir, TempDir}; - use tokio::fs; - use tracing::debug; - use tracing_test::traced_test; - - #[derive(Debug, Clone)] - struct DummyIsoPathFactory { - root_path: Arc, - } - - impl IsoFilePathFactory for DummyIsoPathFactory { - fn build( - &self, - path: impl AsRef, - is_dir: bool, - ) -> Result, FilePathError> { - IsolatedFilePathData::new(0, self.root_path.as_ref(), path, is_dir).map_err(Into::into) - } - } - - #[derive(Debug, Clone)] - struct DummyDBProxy; - - impl WalkerDBProxy for DummyDBProxy { - async fn fetch_file_paths( - &self, - _: Vec, - ) -> Result, IndexerError> { - Ok(vec![]) - } - - async fn fetch_file_paths_to_remove( - &self, - _: &IsolatedFilePathData<'_>, - _: Vec, - ) -> Result, NonCriticalIndexerError> { - Ok(vec![]) - } - } - - fn new_indexer_rule( - name: impl Into, - default: bool, - rules: Vec, - ) -> IndexerRule { - IndexerRule { - id: None, - name: name.into(), - default, - rules, - date_created: Utc::now(), - date_modified: Utc::now(), - } - } - - async fn prepare_location() -> TempDir { - // root - // |__ rust_project - // | |__ .git - // | |__ - // | |__ Cargo.toml - // | |__ src - // | | |__ main.rs - // | |__ target - // | |__ debug - // | |__ main - // |__ inner - // | |__ node_project - // | |__ .git - // | |__ - // | |__ package.json - // | |__ src - // | | |__ App.tsx - // | |__ node_modules - // | |__ react - // | |__ package.json - // |__ photos - // |__ photo1.png - // |__ photo2.jpg - // |__ photo3.jpeg - // |__ text.txt - - let root = tempdir().unwrap(); - let root_path = root.path(); - let rust_project = root_path.join("rust_project"); - let inner_project = root_path.join("inner"); - let node_project = inner_project.join("node_project"); - let photos = root_path.join("photos"); - - fs::create_dir(&rust_project).await.unwrap(); - fs::create_dir(&inner_project).await.unwrap(); - fs::create_dir(&node_project).await.unwrap(); - fs::create_dir(&photos).await.unwrap(); - - // Making rust and node projects a git repository - fs::create_dir(rust_project.join(".git")).await.unwrap(); - fs::create_dir(node_project.join(".git")).await.unwrap(); - - // Populating rust project - fs::File::create(rust_project.join("Cargo.toml")) - .await - .unwrap(); - let rust_src_dir = rust_project.join("src"); - fs::create_dir(&rust_src_dir).await.unwrap(); - fs::File::create(rust_src_dir.join("main.rs")) - .await - .unwrap(); - let rust_target_dir = rust_project.join("target"); - fs::create_dir(&rust_target_dir).await.unwrap(); - let rust_build_dir = rust_target_dir.join("debug"); - fs::create_dir(&rust_build_dir).await.unwrap(); - fs::File::create(rust_build_dir.join("main")).await.unwrap(); - - // Populating node project - fs::File::create(node_project.join("package.json")) - .await - .unwrap(); - let node_src_dir = node_project.join("src"); - fs::create_dir(&node_src_dir).await.unwrap(); - fs::File::create(node_src_dir.join("App.tsx")) - .await - .unwrap(); - let node_modules = node_project.join("node_modules"); - fs::create_dir(&node_modules).await.unwrap(); - let node_modules_dep = node_modules.join("react"); - fs::create_dir(&node_modules_dep).await.unwrap(); - fs::File::create(node_modules_dep.join("package.json")) - .await - .unwrap(); - - // Photos directory - for photo in ["photo1.png", "photo2.jpg", "photo3.jpeg", "text.txt"] { - fs::File::create(photos.join(photo)).await.unwrap(); - } - - root - } - - async fn run_test( - root_path: &Path, - indexer_ruler: IndexerRuler, - expected: HashSet, - ) { - let system = TaskSystem::new(); - - let handle = system - .dispatch( - WalkDirTask::new( - root_path.to_path_buf(), - Arc::new(root_path.to_path_buf()), - indexer_ruler, - DummyIsoPathFactory { - root_path: Arc::new(root_path.to_path_buf()), - }, - DummyDBProxy, - Some(system.get_dispatcher()), - ) - .unwrap(), - ) - .await; - - let mut group = FutureGroup::new(); - - group.insert(handle); - - let mut group = group.lend_mut(); - - let mut actual_set = HashSet::new(); - - let mut ancestors = HashSet::new(); - - while let Some((group, task_result)) = group.next().await { - let TaskStatus::Done((_task_id, TaskOutput::Out(output))) = task_result.unwrap() else { - panic!("unexpected task output") - }; - - let WalkTaskOutput { - to_create, - accepted_ancestors, - errors, - handles, - .. - } = *output.downcast::().unwrap(); - - assert!(errors.is_empty(), "errors: {errors:#?}"); - - actual_set.extend(to_create); - ancestors.extend(accepted_ancestors); - - for handle in handles { - group.insert(handle); - } - } - - for actual in &actual_set { - ancestors.remove(actual); - } - - if !ancestors.is_empty() { - debug!("Adding ancestors to actual: {:#?}", ancestors); - actual_set.extend(ancestors); - } - - assert_eq!( - actual_set, - expected, - "Expected \\ Actual: {:#?};\n Actual \\ Expected: {:#?}", - expected.difference(&actual_set), - actual_set.difference(&expected) - ); - } - - #[tokio::test] - #[traced_test] - async fn test_walk_without_rules() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug/main"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo1.png"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo2.jpg"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo3.jpeg"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/text.txt"), false), metadata }, - ] - .into_iter() - .collect::>(); - - run_test(root_path, IndexerRuler::default(), expected).await; - } - - #[tokio::test] - #[traced_test] - async fn test_only_photos() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo1.png"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo2.jpg"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo3.jpeg"), false), metadata }, - ] - .into_iter() - .collect::>(); - - run_test( - root_path, - IndexerRuler::new(vec![new_indexer_rule( - "only photos", - false, - vec![RulePerKind::AcceptFilesByGlob( - vec![], - GlobSetBuilder::new() - .add(Glob::new("{*.png,*.jpg,*.jpeg}").unwrap()) - .build() - .unwrap(), - )], - )]), - expected, - ) - .await; - } - - #[tokio::test] - #[traced_test] - async fn test_git_repos() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug/main"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react/package.json"), false), metadata }, - ] - .into_iter() - .collect::>(); - - run_test( - root_path, - IndexerRuler::new(vec![new_indexer_rule( - "git repos", - false, - vec![RulePerKind::AcceptIfChildrenDirectoriesArePresent( - HashSet::from([".git".to_string()]), - )], - )]), - expected, - ) - .await; - } - - #[tokio::test] - #[traced_test] - async fn git_repos_without_deps_or_build_dirs() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, - ] - .into_iter() - .collect::>(); - - run_test( - root_path, - IndexerRuler::new(vec![ - new_indexer_rule( - "git repos", - false, - vec![RulePerKind::AcceptIfChildrenDirectoriesArePresent( - HashSet::from([".git".into()]), - )], - ), - new_indexer_rule( - "reject node_modules", - false, - vec![RulePerKind::RejectFilesByGlob( - vec![], - GlobSetBuilder::new() - .add(Glob::new("{**/node_modules/*,**/node_modules}").unwrap()) - .build() - .unwrap(), - )], - ), - new_indexer_rule( - "reject rust build dir", - false, - vec![RulePerKind::RejectFilesByGlob( - vec![], - GlobSetBuilder::new() - .add(Glob::new("{**/target/*,**/target}").unwrap()) - .build() - .unwrap(), - )], - ), - ]), - expected, - ) - .await; - } -} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/walker/entry.rs b/core/crates/heavy-lifting/src/indexer/tasks/walker/entry.rs new file mode 100644 index 000000000..4e460f972 --- /dev/null +++ b/core/crates/heavy-lifting/src/indexer/tasks/walker/entry.rs @@ -0,0 +1,93 @@ +use sd_core_file_path_helper::{FilePathMetadata, IsolatedFilePathData}; + +use sd_core_prisma_helpers::FilePathPubId; +use sd_prisma::prisma::file_path; + +use std::{ + hash::{Hash, Hasher}, + path::{Path, PathBuf}, +}; + +use serde::{Deserialize, Serialize}; + +/// `WalkedEntry` represents a single path in the filesystem +#[derive(Debug, Serialize, Deserialize)] +pub struct WalkedEntry { + pub pub_id: FilePathPubId, + pub maybe_object_id: file_path::object_id::Type, + pub iso_file_path: IsolatedFilePathData<'static>, + pub metadata: FilePathMetadata, +} + +impl PartialEq for WalkedEntry { + fn eq(&self, other: &Self) -> bool { + self.iso_file_path == other.iso_file_path + } +} + +impl Eq for WalkedEntry {} + +impl Hash for WalkedEntry { + fn hash(&self, state: &mut H) { + self.iso_file_path.hash(state); + } +} + +#[derive(Debug, Serialize, Deserialize)] +pub(super) struct WalkingEntry { + pub(super) iso_file_path: IsolatedFilePathData<'static>, + pub(super) metadata: FilePathMetadata, +} + +impl From for WalkedEntry { + fn from( + WalkingEntry { + iso_file_path, + metadata, + }: WalkingEntry, + ) -> Self { + Self { + pub_id: FilePathPubId::new(), + maybe_object_id: None, + iso_file_path, + metadata, + } + } +} + +impl> From<(PubId, file_path::object_id::Type, WalkingEntry)> + for WalkedEntry +{ + fn from( + ( + pub_id, + maybe_object_id, + WalkingEntry { + iso_file_path, + metadata, + }, + ): (PubId, file_path::object_id::Type, WalkingEntry), + ) -> Self { + Self { + pub_id: pub_id.into(), + maybe_object_id, + iso_file_path, + metadata, + } + } +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct ToWalkEntry { + pub(super) path: PathBuf, + pub(super) parent_dir_accepted_by_its_children: Option, +} + +impl> From

for ToWalkEntry { + fn from(path: P) -> Self { + Self { + path: path.as_ref().into(), + parent_dir_accepted_by_its_children: None, + } + } +} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/walker/metadata.rs b/core/crates/heavy-lifting/src/indexer/tasks/walker/metadata.rs new file mode 100644 index 000000000..31ad443fc --- /dev/null +++ b/core/crates/heavy-lifting/src/indexer/tasks/walker/metadata.rs @@ -0,0 +1,64 @@ +use crate::indexer; + +use sd_core_file_path_helper::FilePathMetadata; +use sd_core_indexer_rules::MetadataForIndexerRules; + +use std::{fs::Metadata, path::Path}; + +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Serialize, Deserialize)] +pub(super) struct InnerMetadata { + pub is_dir: bool, + pub is_symlink: bool, + pub inode: u64, + pub size_in_bytes: u64, + pub hidden: bool, + pub created_at: DateTime, + pub modified_at: DateTime, +} + +impl InnerMetadata { + pub fn new( + path: impl AsRef, + metadata: &Metadata, + ) -> Result { + let FilePathMetadata { + inode, + size_in_bytes, + created_at, + modified_at, + hidden, + } = FilePathMetadata::from_path(path, metadata) + .map_err(|e| indexer::NonCriticalIndexerError::FilePathMetadata(e.to_string()))?; + + Ok(Self { + is_dir: metadata.is_dir(), + is_symlink: metadata.is_symlink(), + inode, + size_in_bytes, + hidden, + created_at, + modified_at, + }) + } +} + +impl MetadataForIndexerRules for InnerMetadata { + fn is_dir(&self) -> bool { + self.is_dir + } +} + +impl From for FilePathMetadata { + fn from(metadata: InnerMetadata) -> Self { + Self { + inode: metadata.inode, + size_in_bytes: metadata.size_in_bytes, + hidden: metadata.hidden, + created_at: metadata.created_at, + modified_at: metadata.modified_at, + } + } +} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/walker/mod.rs b/core/crates/heavy-lifting/src/indexer/tasks/walker/mod.rs new file mode 100644 index 000000000..5fef9e689 --- /dev/null +++ b/core/crates/heavy-lifting/src/indexer/tasks/walker/mod.rs @@ -0,0 +1,1176 @@ +use crate::{ + indexer::{ + self, + tasks::walker::rules::{apply_indexer_rules, process_rules_results}, + }, + Error, NonCriticalError, +}; + +use sd_core_file_path_helper::{FilePathError, FilePathMetadata, IsolatedFilePathData}; +use sd_core_indexer_rules::{ + seed::{GitIgnoreRules, GITIGNORE}, + IndexerRuler, MetadataForIndexerRules, RuleKind, +}; +use sd_core_prisma_helpers::{file_path_pub_and_cas_ids, file_path_walker}; + +use sd_prisma::prisma::file_path; +use sd_task_system::{ + check_interruption, ExecStatus, Interrupter, IntoAnyTaskOutput, Task, TaskId, +}; +use sd_utils::{ + db::{inode_from_db, inode_to_db}, + error::FileIOError, +}; + +use std::{ + collections::{HashMap, HashSet}, + fmt, + future::Future, + mem, + path::{Path, PathBuf}, + sync::Arc, + time::Duration, +}; + +use chrono::{DateTime, Duration as ChronoDuration, FixedOffset}; +use futures_concurrency::future::Join; +use tokio::{fs, time::Instant}; +use tokio_stream::{wrappers::ReadDirStream, StreamExt}; +use tracing::{instrument, trace, Level}; + +mod entry; +mod metadata; +mod rules; +mod save_state; + +pub use entry::{ToWalkEntry, WalkedEntry}; + +use entry::WalkingEntry; +use metadata::InnerMetadata; + +pub trait IsoFilePathFactory: Clone + Send + Sync + fmt::Debug + 'static { + fn build( + &self, + path: impl AsRef, + is_dir: bool, + ) -> Result, FilePathError>; +} + +pub trait WalkerDBProxy: Clone + Send + Sync + fmt::Debug + 'static { + fn fetch_file_paths( + &self, + found_paths: Vec, + ) -> impl Future, indexer::Error>> + Send; + + fn fetch_file_paths_to_remove( + &self, + parent_iso_file_path: &IsolatedFilePathData<'_>, + existing_inodes: HashSet>, + unique_location_id_materialized_path_name_extension_params: Vec, + ) -> impl Future< + Output = Result, indexer::NonCriticalIndexerError>, + > + Send; +} + +#[derive(Debug)] +pub struct Walker +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + // Task control + id: TaskId, + is_shallow: bool, + + // Received input args + entry: ToWalkEntry, + root: Arc, + entry_iso_file_path: IsolatedFilePathData<'static>, + indexer_ruler: IndexerRuler, + + // Inner state + stage: WalkerStage, + + // Dependencies + iso_file_path_factory: IsoPathFactory, + db_proxy: DBProxy, + + // Non critical errors that happened during the task execution + errors: Vec, + + // Time spent walking through the received directory + scan_time: Duration, +} + +/// [`Walker`] Task output +#[derive(Debug)] +pub struct Output +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + /// Entries found in the file system that need to be created in database + pub to_create: Vec, + /// Entries found in the file system that need to be updated in database + pub to_update: Vec, + /// Entries found in the file system that need to be removed from database + pub to_remove: Vec, + /// Entries found in the file system that will not be indexed + pub non_indexed_paths: Vec, + /// Ancestors of entries that were indexed + pub accepted_ancestors: HashSet, + /// Errors that happened during the task execution + pub errors: Vec, + /// Directory that was indexed + pub directory_iso_file_path: IsolatedFilePathData<'static>, + /// Total size of the directory that was indexed + pub total_size: u64, + /// Task handles that were dispatched to run `WalkDir` tasks for inner directories + pub keep_walking_tasks: Vec>, + /// Time spent walking through the received directory + pub scan_time: Duration, +} + +#[async_trait::async_trait] +impl Task for Walker +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + fn id(&self) -> TaskId { + self.id + } + + fn with_priority(&self) -> bool { + // If we're running in shallow mode, then we want priority + self.is_shallow + } + + #[instrument( + skip_all, + fields( + task_id = %self.id, + walked_entry = %self.entry.path.display(), + is_shallow = self.is_shallow, + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above + async fn run(&mut self, interrupter: &Interrupter) -> Result { + let is_shallow = self.is_shallow; + let Self { + root, + entry: ToWalkEntry { + path, + parent_dir_accepted_by_its_children, + }, + entry_iso_file_path, + iso_file_path_factory, + indexer_ruler, + db_proxy, + stage, + errors, + scan_time, + .. + } = self; + + let start_time = Instant::now(); + + let ( + to_create, + to_update, + to_remove, + non_indexed_paths, + accepted_ancestors, + total_size, + keep_walking_tasks, + ) = loop { + match stage { + WalkerStage::Start => { + trace!("Preparing git indexer rules for walking root"); + if indexer_ruler.has_system(&GITIGNORE) { + if let Some(rules) = + GitIgnoreRules::get_rules_if_in_git_repo(root.as_ref(), path).await + { + trace!("Found gitignore rules to follow"); + indexer_ruler.extend(rules.map(Into::into)); + } + } + + *stage = WalkerStage::Walking { + read_dir_stream: ReadDirStream::new(fs::read_dir(&path).await.map_err( + |e| { + indexer::Error::FileIO( + (&path, e, "Failed to open directory to read its entries") + .into(), + ) + }, + )?), + found_paths: Vec::new(), + }; + trace!("Starting to walk!"); + } + + WalkerStage::Walking { + read_dir_stream, + found_paths, + } => { + trace!("Walking..."); + while let Some(res) = read_dir_stream.next().await { + match res { + Ok(dir_entry) => { + found_paths.push(dir_entry.path()); + trace!( + new_path = %dir_entry.path().display(), + total_paths = found_paths.len(), + "Found path;" + ); + } + Err(e) => { + errors.push(NonCriticalError::Indexer( + indexer::NonCriticalIndexerError::FailedDirectoryEntry( + FileIOError::from((&path, e)).to_string(), + ), + )); + } + } + + check_interruption!(interrupter, start_time, scan_time); + } + + trace!(total_paths = found_paths.len(), "Finished walking!;"); + + *stage = WalkerStage::CollectingMetadata { + found_paths: mem::take(found_paths), + }; + + check_interruption!(interrupter, start_time, scan_time); + } + + WalkerStage::CollectingMetadata { found_paths } => { + trace!("Collecting metadata for found paths"); + *stage = WalkerStage::CheckingIndexerRules { + paths_and_metadatas: collect_metadata(found_paths, errors).await, + }; + trace!("Finished collecting metadata!"); + + check_interruption!(interrupter, start_time, scan_time); + } + + WalkerStage::CheckingIndexerRules { + paths_and_metadatas, + } => { + trace!("Checking indexer rules for found paths"); + *stage = WalkerStage::ProcessingRulesResults { + paths_metadatas_and_acceptance: apply_indexer_rules( + paths_and_metadatas, + indexer_ruler, + errors, + ) + .await, + }; + trace!("Finished checking indexer rules!"); + + check_interruption!(interrupter, start_time, scan_time); + } + + WalkerStage::ProcessingRulesResults { + paths_metadatas_and_acceptance, + } => { + trace!("Processing rules results"); + let mut maybe_to_keep_walking = (!is_shallow).then(Vec::new); + let (accepted_paths, accepted_ancestors, rejected_paths) = + process_rules_results( + root, + iso_file_path_factory, + *parent_dir_accepted_by_its_children, + paths_metadatas_and_acceptance, + &mut maybe_to_keep_walking, + is_shallow, + errors, + ) + .await; + + trace!( + total_accepted_paths = accepted_paths.len(), + total_accepted_ancestors = accepted_ancestors.len(), + collect_rejected_paths = self.is_shallow, + total_rejected_paths = rejected_paths.len(), + "Finished processing rules results!;" + ); + + *stage = WalkerStage::GatheringFilePathsToRemove { + accepted_paths, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths: rejected_paths, + }; + + check_interruption!(interrupter, start_time, scan_time); + } + + WalkerStage::GatheringFilePathsToRemove { + accepted_paths, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths, + } => { + trace!("Gathering file paths to remove"); + let (walking_entries, to_remove_entries) = gather_file_paths_to_remove( + accepted_paths, + entry_iso_file_path, + iso_file_path_factory, + db_proxy, + errors, + ) + .await; + trace!("Finished gathering file paths to remove!"); + + *stage = WalkerStage::Finalize { + walking_entries, + to_remove_entries, + maybe_to_keep_walking: mem::take(maybe_to_keep_walking), + accepted_ancestors: mem::take(accepted_ancestors), + non_indexed_paths: mem::take(non_indexed_paths), + }; + + check_interruption!(interrupter, start_time, scan_time); + } + + // From this points onwards, we will not allow to be interrupted anymore + WalkerStage::Finalize { + walking_entries, + to_remove_entries, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths, + } => { + trace!("Segregating creates and updates"); + let (to_create, to_update, total_size) = + segregate_creates_and_updates(walking_entries, db_proxy).await?; + trace!( + total_to_create = to_create.len(), + total_to_update = to_update.len(), + total_to_remove = to_remove_entries.len(), + total_non_indexed_paths = non_indexed_paths.len(), + total_size, + "Finished segregating creates and updates!;" + ); + + let keep_walking_tasks = keep_walking( + root, + indexer_ruler, + iso_file_path_factory, + db_proxy, + maybe_to_keep_walking.as_mut(), + errors, + ); + + break ( + to_create, + to_update, + mem::take(to_remove_entries), + mem::take(non_indexed_paths), + mem::take(accepted_ancestors), + total_size, + keep_walking_tasks, + ); + } + } + }; + + *scan_time += start_time.elapsed(); + + // Taking out some data as the task is finally complete + Ok(ExecStatus::Done( + Output { + to_create, + to_update, + to_remove, + non_indexed_paths, + accepted_ancestors, + errors: mem::take(errors), + directory_iso_file_path: mem::take(entry_iso_file_path), + total_size, + keep_walking_tasks, + scan_time: *scan_time, + } + .into_output(), + )) + } +} + +#[derive(Debug)] +enum WalkerStage { + Start, + Walking { + read_dir_stream: ReadDirStream, + found_paths: Vec, + }, + CollectingMetadata { + found_paths: Vec, + }, + CheckingIndexerRules { + paths_and_metadatas: HashMap, + }, + ProcessingRulesResults { + paths_metadatas_and_acceptance: + HashMap>)>, + }, + GatheringFilePathsToRemove { + accepted_paths: HashMap, + maybe_to_keep_walking: Option>, + accepted_ancestors: HashSet, + non_indexed_paths: Vec, + }, + Finalize { + walking_entries: Vec, + accepted_ancestors: HashSet, + to_remove_entries: Vec, + maybe_to_keep_walking: Option>, + non_indexed_paths: Vec, + }, +} + +impl Walker +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + pub fn new_deep( + entry: impl Into + Send, + root: Arc, + indexer_ruler: IndexerRuler, + iso_file_path_factory: IsoPathFactory, + db_proxy: DBProxy, + ) -> Result { + let entry = entry.into(); + Ok(Self { + id: TaskId::new_v4(), + root, + indexer_ruler, + entry_iso_file_path: iso_file_path_factory.build(&entry.path, true)?, + iso_file_path_factory, + db_proxy, + stage: WalkerStage::Start, + entry, + is_shallow: false, + errors: Vec::new(), + scan_time: Duration::ZERO, + }) + } +} + +impl Walker +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + pub fn new_shallow( + entry: impl Into + Send, + root: Arc, + indexer_ruler: IndexerRuler, + iso_file_path_factory: IsoPathFactory, + db_proxy: DBProxy, + ) -> Result { + let entry = entry.into(); + Ok(Self { + id: TaskId::new_v4(), + root, + indexer_ruler, + entry_iso_file_path: iso_file_path_factory.build(&entry.path, true)?, + iso_file_path_factory, + db_proxy, + stage: WalkerStage::Start, + entry, + is_shallow: true, + errors: Vec::new(), + scan_time: Duration::ZERO, + }) + } +} + +#[instrument( + skip_all, + fields(entries_count = walking_entries.len()), + err, +)] +async fn segregate_creates_and_updates( + walking_entries: &mut Vec, + db_proxy: &impl WalkerDBProxy, +) -> Result<(Vec, Vec, u64), Error> { + if walking_entries.is_empty() { + Ok((vec![], vec![], 0)) + } else { + let iso_paths_already_in_db = db_proxy + .fetch_file_paths( + walking_entries + .iter() + .map(|entry| file_path::WhereParam::from(&entry.iso_file_path)) + .collect(), + ) + .await? + .into_iter() + .flat_map(|file_path| { + IsolatedFilePathData::try_from(file_path.clone()) + .map(|iso_file_path| (iso_file_path, file_path)) + }) + .collect::>(); + + Ok(walking_entries.drain(..).fold( + (Vec::new(), Vec::new(), 0), + |(mut to_create, mut to_update, mut total_size), entry| { + let WalkingEntry { + iso_file_path, + metadata, + } = &entry; + + total_size += metadata.size_in_bytes; + + if let Some(file_path) = iso_paths_already_in_db.get(iso_file_path) { + if let (Some(inode), Some(date_modified)) = + (&file_path.inode, &file_path.date_modified) + { + if ( + inode_from_db(&inode[0..8]) != metadata.inode + // Datetimes stored in DB loses a bit of precision, + // so we need to check against a delta + // instead of using != operator + || ( + DateTime::::from(metadata.modified_at) - *date_modified + > ChronoDuration::milliseconds(1) + ) + || file_path.hidden.is_none() + || metadata.hidden != file_path.hidden.unwrap_or_default() + ) + // We ignore the size of directories because it is not reliable, we need to + // calculate it ourselves later + && !( + iso_file_path.to_parts().is_dir + && metadata.size_in_bytes + != file_path + .size_in_bytes_bytes + .as_ref() + .map(|size_in_bytes_bytes| { + u64::from_be_bytes([ + size_in_bytes_bytes[0], + size_in_bytes_bytes[1], + size_in_bytes_bytes[2], + size_in_bytes_bytes[3], + size_in_bytes_bytes[4], + size_in_bytes_bytes[5], + size_in_bytes_bytes[6], + size_in_bytes_bytes[7], + ]) + }) + .unwrap_or_default() + ) { + to_update.push(WalkedEntry::from(( + &file_path.pub_id, + file_path.object_id, + entry, + ))); + } + } + } else { + to_create.push(WalkedEntry::from(entry)); + } + + (to_create, to_update, total_size) + }, + )) + } +} + +fn keep_walking( + root: &Arc, + indexer_ruler: &IndexerRuler, + iso_file_path_factory: &IsoPathFactory, + db_proxy: &DBProxy, + maybe_to_keep_walking: Option<&mut Vec>, + errors: &mut Vec, +) -> Vec> +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + maybe_to_keep_walking + .map(|to_keep_walking| { + to_keep_walking + .drain(..) + .map(|entry| { + Walker::new_deep( + entry, + Arc::clone(root), + indexer_ruler.clone(), + iso_file_path_factory.clone(), + db_proxy.clone(), + ) + .map_err(|e| { + indexer::NonCriticalIndexerError::DispatchKeepWalking(e.to_string()) + }) + }) + .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) + .collect() + }) + .unwrap_or_default() +} + +async fn collect_metadata( + found_paths: &mut Vec, + errors: &mut Vec, +) -> HashMap { + found_paths + .drain(..) + .map(|current_path| async move { + fs::metadata(¤t_path) + .await + .map_err(|e| { + indexer::NonCriticalIndexerError::Metadata( + FileIOError::from((¤t_path, e)).to_string(), + ) + }) + .and_then(|metadata| { + InnerMetadata::new(¤t_path, &metadata) + .map(|metadata| (current_path, metadata)) + }) + }) + .collect::>() + .join() + .await + .into_iter() + .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) + .collect() +} + +async fn gather_file_paths_to_remove( + accepted_paths: &mut HashMap, + entry_iso_file_path: &IsolatedFilePathData<'_>, + iso_file_path_factory: &impl IsoFilePathFactory, + db_proxy: &impl WalkerDBProxy, + errors: &mut Vec, +) -> (Vec, Vec) { + let mut existing_inodes = HashSet::new(); + + let (walking, to_delete_params) = accepted_paths + .drain() + .filter_map(|(path, metadata)| { + iso_file_path_factory + .build(&path, metadata.is_dir()) + .map(|iso_file_path| { + let params = file_path::WhereParam::from(&iso_file_path); + existing_inodes.insert(inode_to_db(metadata.inode)); + + ( + WalkingEntry { + iso_file_path, + metadata: FilePathMetadata::from(metadata), + }, + params, + ) + }) + .map_err(|e| { + errors + .push(indexer::NonCriticalIndexerError::IsoFilePath(e.to_string()).into()); + }) + .ok() + }) + .unzip::<_, _, Vec<_>, Vec<_>>(); + + // We continue the function even if we fail to fetch `file_path`s to remove, + // the DB will have old `file_path`s but at least this is better than + // don't adding the newly indexed paths + let to_remove_entries = db_proxy + .fetch_file_paths_to_remove(entry_iso_file_path, existing_inodes, to_delete_params) + .await + .map_err(|e| errors.push(e.into())) + .unwrap_or_default(); + + (walking, to_remove_entries) +} + +#[cfg(test)] +mod tests { + use super::*; + + use sd_core_indexer_rules::{IndexerRule, RulePerKind}; + use sd_core_prisma_helpers::FilePathPubId; + use sd_task_system::{TaskOutput, TaskStatus, TaskSystem}; + + use chrono::Utc; + use futures::stream::FuturesUnordered; + use globset::{Glob, GlobSetBuilder}; + use lending_stream::{LendingStream, StreamExt}; + use tempfile::{tempdir, TempDir}; + use tokio::{fs, io::AsyncWriteExt}; + use tracing::debug; + use tracing_test::traced_test; + + #[derive(Debug, Clone)] + struct DummyIsoPathFactory { + root_path: Arc, + } + + impl IsoFilePathFactory for DummyIsoPathFactory { + fn build( + &self, + path: impl AsRef, + is_dir: bool, + ) -> Result, FilePathError> { + IsolatedFilePathData::new(0, self.root_path.as_ref(), path, is_dir).map_err(Into::into) + } + } + + #[derive(Debug, Clone)] + struct DummyDBProxy; + + impl WalkerDBProxy for DummyDBProxy { + async fn fetch_file_paths( + &self, + _: Vec, + ) -> Result, indexer::Error> { + Ok(vec![]) + } + + async fn fetch_file_paths_to_remove( + &self, + _: &IsolatedFilePathData<'_>, + _: HashSet>, + _: Vec, + ) -> Result, indexer::NonCriticalIndexerError> { + Ok(vec![]) + } + } + + fn new_indexer_rule( + name: impl Into, + default: bool, + rules: Vec, + ) -> IndexerRule { + IndexerRule { + id: None, + name: name.into(), + default, + rules, + date_created: Utc::now(), + date_modified: Utc::now(), + } + } + + #[allow(clippy::cognitive_complexity)] + async fn prepare_location() -> TempDir { + // root + // |__ rust_project + // | |__ .git + // | | |__ + // | |__ .gitignore + // | |__ ignorable.file + // | |__ Cargo.toml + // | |__ src + // | | |__ main.rs + // | |__ target + // | | |__ debug + // | | |__ main + // | |__ partial + // | | |__ ignoreme + // | | |__ readme + // | |__ inner + // | |__ node_project + // | |__ .git + // | | |__ + // | |__ .gitignore + // | |__ ignorable.file + // | |__ package.json + // | |__ src + // | | |__ App.tsx + // | |__ node_modules + // | |__ react + // | |__ package.json + // |__ photos + // |__ photo1.png + // |__ photo2.jpg + // |__ photo3.jpeg + // |__ text.txt + + let root = tempdir().unwrap(); + let root_path = root.path(); + let rust_project = root_path.join("rust_project"); + let inner_project = root_path.join("inner"); + let node_project = inner_project.join("node_project"); + let photos = root_path.join("photos"); + + fs::create_dir(&rust_project).await.unwrap(); + fs::create_dir(&inner_project).await.unwrap(); + fs::create_dir(&node_project).await.unwrap(); + fs::create_dir(&photos).await.unwrap(); + + // Inner directory partially ignored by git + let partial_dir = rust_project.join("partial"); + fs::create_dir(&partial_dir).await.unwrap(); + fs::File::create(partial_dir.join("ignoreme")) + .await + .unwrap(); + fs::File::create(partial_dir.join("readme")).await.unwrap(); + + // Making rust and node projects a git repository + fs::create_dir(rust_project.join(".git")).await.unwrap(); + let gitignore = rust_project.join(".gitignore"); + let mut file = fs::File::create(gitignore).await.unwrap(); + file.write_all(b"*.file\n/target\npartial/ignoreme") + .await + .unwrap(); + fs::create_dir(node_project.join(".git")).await.unwrap(); + let gitignore = node_project.join(".gitignore"); + let mut file = fs::File::create(gitignore).await.unwrap(); + file.write_all(b"ignorable.file").await.unwrap(); + + // Populating rust project + fs::File::create(rust_project.join("Cargo.toml")) + .await + .unwrap(); + fs::File::create(rust_project.join("ignorable.file")) + .await + .unwrap(); + let rust_src_dir = rust_project.join("src"); + fs::create_dir(&rust_src_dir).await.unwrap(); + fs::File::create(rust_src_dir.join("main.rs")) + .await + .unwrap(); + let rust_target_dir = rust_project.join("target"); + fs::create_dir(&rust_target_dir).await.unwrap(); + let rust_build_dir = rust_target_dir.join("debug"); + fs::create_dir(&rust_build_dir).await.unwrap(); + fs::File::create(rust_build_dir.join("main")).await.unwrap(); + + // Populating node project + fs::File::create(node_project.join("package.json")) + .await + .unwrap(); + fs::File::create(node_project.join("ignorable.file")) + .await + .unwrap(); + let node_src_dir = node_project.join("src"); + fs::create_dir(&node_src_dir).await.unwrap(); + fs::File::create(node_src_dir.join("App.tsx")) + .await + .unwrap(); + let node_modules = node_project.join("node_modules"); + fs::create_dir(&node_modules).await.unwrap(); + let node_modules_dep = node_modules.join("react"); + fs::create_dir(&node_modules_dep).await.unwrap(); + fs::File::create(node_modules_dep.join("package.json")) + .await + .unwrap(); + + // Photos directory + for photo in ["photo1.png", "photo2.jpg", "photo3.jpeg", "text.txt"] { + fs::File::create(photos.join(photo)).await.unwrap(); + } + + root + } + + async fn run_test( + root_path: &Path, + indexer_ruler: IndexerRuler, + expected: HashSet, + ) { + let system = TaskSystem::new(); + + let handle = system + .dispatch( + Walker::new_deep( + root_path.to_path_buf(), + Arc::new(root_path.to_path_buf()), + indexer_ruler, + DummyIsoPathFactory { + root_path: Arc::new(root_path.to_path_buf()), + }, + DummyDBProxy, + ) + .unwrap(), + ) + .await + .unwrap(); + + let group = FuturesUnordered::new(); + + group.push(handle); + + let mut group = group.lend_mut(); + + let mut actual_set = HashSet::new(); + + let mut ancestors = HashSet::new(); + + while let Some((group, task_result)) = group.next().await { + let TaskStatus::Done((_task_id, TaskOutput::Out(output))) = task_result.unwrap() else { + panic!("unexpected task output") + }; + + let Output { + to_create, + accepted_ancestors, + errors, + keep_walking_tasks, + .. + } = *output + .downcast::>() + .unwrap(); + + assert!(errors.is_empty(), "errors: {errors:#?}"); + + actual_set.extend(to_create); + ancestors.extend(accepted_ancestors); + + group.extend(system.dispatch_many(keep_walking_tasks).await.unwrap()); + } + + for actual in &actual_set { + ancestors.remove(actual); + } + + if !ancestors.is_empty() { + debug!(?ancestors, "Adding ancestors to actual"); + actual_set.extend(ancestors); + } + + assert_eq!( + actual_set, + expected, + "Expected \\ Actual: {:#?};\n Actual \\ Expected: {:#?}", + expected.difference(&actual_set), + actual_set.difference(&expected) + ); + } + + #[tokio::test] + #[traced_test] + async fn test_walk_without_rules() { + let root = prepare_location().await; + let root_path = root.path(); + + let metadata = FilePathMetadata { + inode: 0, + size_in_bytes: 0, + created_at: Utc::now(), + modified_at: Utc::now(), + hidden: false, + }; + + let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); + let pub_id = FilePathPubId::new(); + let maybe_object_id = None; + + #[rustfmt::skip] + let expected = [ + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/.gitignore"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/partial"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/partial/readme"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.gitignore"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react/package.json"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos/photo1.png"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos/photo2.jpg"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos/photo3.jpeg"), false), metadata }, + WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/text.txt"), false), metadata }, + ] + .into_iter() + .collect::>(); + + run_test(root_path, IndexerRuler::default(), expected).await; + } + + #[tokio::test] + #[traced_test] + async fn test_only_photos() { + let root = prepare_location().await; + let root_path = root.path(); + + let metadata = FilePathMetadata { + inode: 0, + size_in_bytes: 0, + created_at: Utc::now(), + modified_at: Utc::now(), + hidden: false, + }; + + let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); + let pub_id = FilePathPubId::new(); + let maybe_object_id = None; + + #[rustfmt::skip] + let expected = [ + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos/photo1.png"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("photos/photo2.jpg"), false), metadata }, + WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo3.jpeg"), false), metadata }, + ] + .into_iter() + .collect::>(); + + run_test( + root_path, + IndexerRuler::new(vec![new_indexer_rule( + "only photos", + false, + vec![RulePerKind::AcceptFilesByGlob( + vec![], + GlobSetBuilder::new() + .add(Glob::new("{*.png,*.jpg,*.jpeg}").unwrap()) + .build() + .unwrap(), + )], + )]), + expected, + ) + .await; + } + + #[tokio::test] + #[traced_test] + async fn test_git_repos() { + let root = prepare_location().await; + let root_path = root.path(); + + let metadata = FilePathMetadata { + inode: 0, + size_in_bytes: 0, + created_at: Utc::now(), + modified_at: Utc::now(), + hidden: false, + }; + + let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); + let pub_id = FilePathPubId::new(); + let maybe_object_id = None; + + #[rustfmt::skip] + let expected = [ + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/.gitignore"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/partial"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/partial/readme"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.gitignore"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react"), true), metadata }, + WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react/package.json"), false), metadata }, + ] + .into_iter() + .collect::>(); + + run_test( + root_path, + IndexerRuler::new(vec![new_indexer_rule( + "git repos", + false, + vec![RulePerKind::AcceptIfChildrenDirectoriesArePresent( + HashSet::from([".git".to_string()]), + )], + )]), + expected, + ) + .await; + } + + #[tokio::test] + #[traced_test] + async fn git_repos_without_deps_or_build_dirs() { + let root = prepare_location().await; + let root_path = root.path(); + + let metadata = FilePathMetadata { + inode: 0, + size_in_bytes: 0, + created_at: Utc::now(), + modified_at: Utc::now(), + hidden: false, + }; + + let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); + let pub_id = FilePathPubId::new(); + let maybe_object_id = None; + + #[rustfmt::skip] + let expected = [ + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/.gitignore"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/partial"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/partial/readme"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.gitignore"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, + WalkedEntry { pub_id: pub_id.clone(), maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, + WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, + ] + .into_iter() + .collect::>(); + + run_test( + root_path, + IndexerRuler::new(vec![ + new_indexer_rule( + "git repos", + false, + vec![RulePerKind::AcceptIfChildrenDirectoriesArePresent( + HashSet::from([".git".into()]), + )], + ), + new_indexer_rule( + "reject node_modules", + false, + vec![RulePerKind::RejectFilesByGlob( + vec![], + GlobSetBuilder::new() + .add(Glob::new("{**/node_modules/*,**/node_modules}").unwrap()) + .build() + .unwrap(), + )], + ), + new_indexer_rule( + "reject rust build dir", + false, + vec![RulePerKind::RejectFilesByGlob( + vec![], + GlobSetBuilder::new() + .add(Glob::new("{**/target/*,**/target}").unwrap()) + .build() + .unwrap(), + )], + ), + ]), + expected, + ) + .await; + } +} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/walker/rules.rs b/core/crates/heavy-lifting/src/indexer/tasks/walker/rules.rs new file mode 100644 index 000000000..f8f3fd0e1 --- /dev/null +++ b/core/crates/heavy-lifting/src/indexer/tasks/walker/rules.rs @@ -0,0 +1,261 @@ +use crate::{indexer, NonCriticalError}; + +use sd_core_file_path_helper::{FilePathMetadata, IsolatedFilePathData}; +use sd_core_indexer_rules::{IndexerRuler, MetadataForIndexerRules, RuleKind}; + +use sd_utils::error::FileIOError; + +use std::{ + collections::{hash_map::Entry, HashMap, HashSet}, + path::{Path, PathBuf}, + sync::Arc, +}; + +use futures_concurrency::future::Join; +use tokio::fs; +use tracing::{instrument, trace}; + +use super::{ + entry::{ToWalkEntry, WalkingEntry}, + InnerMetadata, IsoFilePathFactory, WalkedEntry, +}; + +pub(super) async fn apply_indexer_rules( + paths_and_metadatas: &mut HashMap, + indexer_ruler: &IndexerRuler, + errors: &mut Vec, +) -> HashMap>)> { + paths_and_metadatas + .drain() + // TODO: Hard ignoring symlinks for now, but this should be configurable + .filter(|(_, metadata)| !metadata.is_symlink) + .map(|(current_path, metadata)| async { + indexer_ruler + .apply_all(¤t_path, &metadata) + .await + .map(|acceptance_per_rule_kind| { + (current_path, (metadata, acceptance_per_rule_kind)) + }) + .map_err(|e| indexer::NonCriticalIndexerError::IndexerRule(e.to_string())) + }) + .collect::>() + .join() + .await + .into_iter() + .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) + .collect() +} + +pub(super) async fn process_rules_results( + root: &Arc, + iso_file_path_factory: &impl IsoFilePathFactory, + parent_dir_accepted_by_its_children: Option, + paths_metadatas_and_acceptance: &mut HashMap< + PathBuf, + (InnerMetadata, HashMap>), + >, + maybe_to_keep_walking: &mut Option>, + collect_rejected_paths: bool, + errors: &mut Vec, +) -> ( + HashMap, + HashSet, + Vec, +) { + let (accepted, accepted_ancestors, rejected) = segregate_paths( + root, + iso_file_path_factory, + paths_metadatas_and_acceptance.drain(), + parent_dir_accepted_by_its_children, + maybe_to_keep_walking, + collect_rejected_paths, + errors, + ); + + ( + accepted, + accepted_ancestors + .into_iter() + .map(|(ancestor_iso_file_path, ancestor_path)| async move { + fs::metadata(&ancestor_path) + .await + .map_err(|e| { + indexer::NonCriticalIndexerError::Metadata( + FileIOError::from((&ancestor_path, e)).to_string(), + ) + }) + .and_then(|metadata| { + FilePathMetadata::from_path(&ancestor_path, &metadata) + .map(|metadata| { + WalkingEntry { + iso_file_path: ancestor_iso_file_path, + metadata, + } + .into() + }) + .map_err(|e| { + indexer::NonCriticalIndexerError::FilePathMetadata(e.to_string()) + }) + }) + }) + .collect::>() + .join() + .await + .into_iter() + .filter_map(|res| res.map_err(|e| errors.push(e.into())).ok()) + .collect(), + rejected, + ) +} + +fn segregate_paths( + root: &Arc, + iso_file_path_factory: &impl IsoFilePathFactory, + paths_metadatas_and_acceptance: impl IntoIterator< + Item = (PathBuf, (InnerMetadata, HashMap>)), + >, + parent_dir_accepted_by_its_children: Option, + maybe_to_keep_walking: &mut Option>, + collect_rejected_paths: bool, + errors: &mut Vec, +) -> ( + HashMap, + HashMap, PathBuf>, + Vec, +) { + let root = root.as_ref(); + + let mut accepted = HashMap::new(); + let mut accepted_ancestors = HashMap::new(); + let mut rejected = Vec::new(); + + for (current_path, (metadata, acceptance_per_rule_kind)) in paths_metadatas_and_acceptance { + // Accept by children has three states, + // None if we don't now yet or if this check doesn't apply + // Some(true) if this check applies and it passes + // Some(false) if this check applies and it was rejected + // and we pass the current parent state to its children + let mut accept_by_children_dir = parent_dir_accepted_by_its_children; + + if !reject_path( + ¤t_path, + &metadata, + &acceptance_per_rule_kind, + &mut accept_by_children_dir, + maybe_to_keep_walking, + ) && accept_by_children_dir.unwrap_or(true) + { + accept_path_and_ancestors( + current_path, + metadata, + root, + &mut accepted, + iso_file_path_factory, + &mut accepted_ancestors, + errors, + ); + + continue; + } + + if collect_rejected_paths { + rejected.push(current_path); + } + } + + (accepted, accepted_ancestors, rejected) +} + +#[instrument(skip_all, fields(current_path = %current_path.display()))] +fn reject_path( + current_path: &Path, + metadata: &InnerMetadata, + acceptance_per_rule_kind: &HashMap>, + accept_by_children_dir: &mut Option, + maybe_to_keep_walking: &mut Option>, +) -> bool { + IndexerRuler::rejected_by_reject_glob(acceptance_per_rule_kind) + || IndexerRuler::rejected_by_git_ignore(acceptance_per_rule_kind) + || (metadata.is_dir() + && process_and_maybe_reject_by_directory_rules( + current_path, + acceptance_per_rule_kind, + accept_by_children_dir, + maybe_to_keep_walking, + )) || IndexerRuler::rejected_by_accept_glob(acceptance_per_rule_kind) +} + +fn process_and_maybe_reject_by_directory_rules( + current_path: &Path, + acceptance_per_rule_kind: &HashMap>, + accept_by_children_dir: &mut Option, + maybe_to_keep_walking: &mut Option>, +) -> bool { + // If it is a directory, first we check if we must reject it and its children entirely + if IndexerRuler::rejected_by_children_directories(acceptance_per_rule_kind) { + return true; + } + + // Then we check if we must accept it and its children + if let Some(accepted_by_children_rules) = + acceptance_per_rule_kind.get(&RuleKind::AcceptIfChildrenDirectoriesArePresent) + { + if accepted_by_children_rules.iter().any(|accept| *accept) { + *accept_by_children_dir = Some(true); + } + + // If it wasn't accepted then we mark as rejected + if accept_by_children_dir.is_none() { + trace!( + "Rejected because it didn't passed in any \ + `RuleKind::AcceptIfChildrenDirectoriesArePresent` rule", + ); + *accept_by_children_dir = Some(false); + } + } + + // Then we mark this directory to maybe be walked in too + if let Some(ref mut to_keep_walking) = maybe_to_keep_walking { + to_keep_walking.push(ToWalkEntry { + path: current_path.to_path_buf(), + parent_dir_accepted_by_its_children: *accept_by_children_dir, + }); + } + + false +} + +fn accept_path_and_ancestors( + current_path: PathBuf, + metadata: InnerMetadata, + root: &Path, + accepted: &mut HashMap, + iso_file_path_factory: &impl IsoFilePathFactory, + accepted_ancestors: &mut HashMap, PathBuf>, + errors: &mut Vec, +) { + // If the ancestors directories wasn't indexed before, now we do + for ancestor in current_path + .ancestors() + .skip(1) // Skip the current directory as it was already indexed + .take_while(|&ancestor| ancestor != root) + { + if let Ok(iso_file_path) = iso_file_path_factory.build(ancestor, true).map_err(|e| { + errors.push(indexer::NonCriticalIndexerError::IsoFilePath(e.to_string()).into()); + }) { + match accepted_ancestors.entry(iso_file_path) { + Entry::Occupied(_) => { + // If we already accepted this ancestor, then it will contain + // also all if its ancestors too, so we can stop here + break; + } + Entry::Vacant(entry) => { + trace!(ancestor = %ancestor.display(), "Accepted ancestor"); + entry.insert(ancestor.to_path_buf()); + } + } + } + } + + accepted.insert(current_path, metadata); +} diff --git a/core/crates/heavy-lifting/src/indexer/tasks/walker/save_state.rs b/core/crates/heavy-lifting/src/indexer/tasks/walker/save_state.rs new file mode 100644 index 000000000..2dd66fc50 --- /dev/null +++ b/core/crates/heavy-lifting/src/indexer/tasks/walker/save_state.rs @@ -0,0 +1,219 @@ +use crate::{Error, NonCriticalError}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_indexer_rules::{IndexerRuler, RuleKind}; +use sd_core_prisma_helpers::file_path_pub_and_cas_ids; + +use std::{ + collections::{HashMap, HashSet}, + path::PathBuf, + sync::Arc, + time::Duration, +}; + +use sd_task_system::{SerializableTask, TaskId}; +use serde::{Deserialize, Serialize}; + +use super::{ + entry::{ToWalkEntry, WalkingEntry}, + metadata::InnerMetadata, + IsoFilePathFactory, WalkedEntry, Walker, WalkerDBProxy, WalkerStage, +}; + +#[derive(Debug, Serialize, Deserialize)] +pub(super) struct WalkDirSaveState { + id: TaskId, + is_shallow: bool, + + entry: ToWalkEntry, + root: Arc, + entry_iso_file_path: IsolatedFilePathData<'static>, + + stage: WalkerStageSaveState, + + errors: Vec, + scan_time: Duration, +} + +#[derive(Debug, Serialize, Deserialize)] +pub(super) enum WalkerStageSaveState { + Start, + CollectingMetadata { + found_paths: Vec, + }, + CheckingIndexerRules { + paths_and_metadatas: HashMap, + }, + ProcessingRulesResults { + paths_metadatas_and_acceptance: + HashMap>)>, + }, + GatheringFilePathsToRemove { + accepted_paths: HashMap, + maybe_to_keep_walking: Option>, + accepted_ancestors: HashSet, + non_indexed_paths: Vec, + }, + Finalize { + walking_entries: Vec, + accepted_ancestors: HashSet, + to_remove_entries: Vec, + maybe_to_keep_walking: Option>, + non_indexed_paths: Vec, + }, +} + +impl From for WalkerStageSaveState { + fn from(stage: WalkerStage) -> Self { + match stage { + // We can't store the current state of `ReadDirStream` so we start again from the beginning + WalkerStage::Start | WalkerStage::Walking { .. } => Self::Start, + WalkerStage::CollectingMetadata { found_paths } => { + Self::CollectingMetadata { found_paths } + } + WalkerStage::CheckingIndexerRules { + paths_and_metadatas, + } => Self::CheckingIndexerRules { + paths_and_metadatas, + }, + WalkerStage::ProcessingRulesResults { + paths_metadatas_and_acceptance, + } => Self::ProcessingRulesResults { + paths_metadatas_and_acceptance, + }, + WalkerStage::GatheringFilePathsToRemove { + accepted_paths, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths, + } => Self::GatheringFilePathsToRemove { + accepted_paths, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths, + }, + WalkerStage::Finalize { + walking_entries, + accepted_ancestors, + to_remove_entries, + maybe_to_keep_walking, + non_indexed_paths, + } => Self::Finalize { + walking_entries, + accepted_ancestors, + to_remove_entries, + maybe_to_keep_walking, + non_indexed_paths, + }, + } + } +} + +impl From for WalkerStage { + fn from(value: WalkerStageSaveState) -> Self { + match value { + WalkerStageSaveState::Start => Self::Start, + WalkerStageSaveState::CollectingMetadata { found_paths } => { + Self::CollectingMetadata { found_paths } + } + WalkerStageSaveState::CheckingIndexerRules { + paths_and_metadatas, + } => Self::CheckingIndexerRules { + paths_and_metadatas, + }, + WalkerStageSaveState::ProcessingRulesResults { + paths_metadatas_and_acceptance, + } => Self::ProcessingRulesResults { + paths_metadatas_and_acceptance, + }, + WalkerStageSaveState::GatheringFilePathsToRemove { + accepted_paths, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths, + } => Self::GatheringFilePathsToRemove { + accepted_paths, + maybe_to_keep_walking, + accepted_ancestors, + non_indexed_paths, + }, + WalkerStageSaveState::Finalize { + walking_entries, + accepted_ancestors, + to_remove_entries, + maybe_to_keep_walking, + non_indexed_paths, + } => Self::Finalize { + walking_entries, + accepted_ancestors, + to_remove_entries, + maybe_to_keep_walking, + non_indexed_paths, + }, + } + } +} + +impl SerializableTask for Walker +where + DBProxy: WalkerDBProxy, + IsoPathFactory: IsoFilePathFactory, +{ + type SerializeError = rmp_serde::encode::Error; + type DeserializeError = rmp_serde::decode::Error; + type DeserializeCtx = (IndexerRuler, DBProxy, IsoPathFactory); + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + entry, + root, + entry_iso_file_path, + stage, + errors, + scan_time, + is_shallow, + .. + } = self; + rmp_serde::to_vec_named(&WalkDirSaveState { + id, + is_shallow, + entry, + root, + entry_iso_file_path, + stage: stage.into(), + errors, + scan_time, + }) + } + + async fn deserialize( + data: &[u8], + (indexer_ruler, db_proxy, iso_file_path_factory): Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice(data).map( + |WalkDirSaveState { + id, + entry, + root, + entry_iso_file_path, + stage, + errors, + scan_time, + is_shallow, + }| Self { + id, + entry, + root, + entry_iso_file_path, + indexer_ruler, + iso_file_path_factory, + db_proxy, + stage: stage.into(), + errors, + scan_time, + is_shallow, + }, + ) + } +} diff --git a/core/crates/heavy-lifting/src/job_system/error.rs b/core/crates/heavy-lifting/src/job_system/error.rs index af212ef4e..98c5b8f8e 100644 --- a/core/crates/heavy-lifting/src/job_system/error.rs +++ b/core/crates/heavy-lifting/src/job_system/error.rs @@ -1,5 +1,4 @@ -use crate::Error; - +use sd_task_system::{DispatcherShutdownError, Task}; use sd_utils::error::FileIOError; use prisma_client_rust::QueryError; @@ -17,9 +16,6 @@ pub enum JobSystemError { already_running_id: JobId, }, - #[error("job canceled: ")] - Canceled(JobId), - #[error("failed to load job reports from database to resume jobs: {0}")] LoadReportsForResume(#[from] QueryError), @@ -34,9 +30,6 @@ pub enum JobSystemError { #[error(transparent)] Report(#[from] ReportError), - - #[error(transparent)] - Processing(#[from] Error), } impl From for rspc::Error { @@ -45,17 +38,36 @@ impl From for rspc::Error { JobSystemError::NotFound(_) => { Self::with_cause(rspc::ErrorCode::NotFound, e.to_string(), e) } + JobSystemError::AlreadyRunning { .. } => { Self::with_cause(rspc::ErrorCode::Conflict, e.to_string(), e) } - JobSystemError::Canceled(_) => { - Self::with_cause(rspc::ErrorCode::ClientClosedRequest, e.to_string(), e) - } - JobSystemError::Processing(e) => e.into(), JobSystemError::Report(e) => e.into(), _ => Self::with_cause(rspc::ErrorCode::InternalServerError, e.to_string(), e), } } } + +#[derive(thiserror::Error, Debug)] +pub enum DispatcherError { + #[error("job canceled: ")] + JobCanceled(JobId), + #[error("system entered on shutdown mode ", .0.len())] + Shutdown(Vec>>), +} + +#[derive(Debug, thiserror::Error)] +pub enum JobErrorOrDispatcherError> { + #[error(transparent)] + JobError(#[from] JobError), + #[error(transparent)] + Dispatcher(#[from] DispatcherError), +} + +impl From> for DispatcherError { + fn from(DispatcherShutdownError(tasks): DispatcherShutdownError) -> Self { + Self::Shutdown(tasks) + } +} diff --git a/core/crates/heavy-lifting/src/job_system/job.rs b/core/crates/heavy-lifting/src/job_system/job.rs index 5dfdddfcb..91b3173b1 100644 --- a/core/crates/heavy-lifting/src/job_system/job.rs +++ b/core/crates/heavy-lifting/src/job_system/job.rs @@ -1,4 +1,4 @@ -use crate::{Error, NonCriticalJobError}; +use crate::{Error, NonCriticalError, UpdateEvent}; use sd_core_sync::Manager as SyncManager; @@ -8,11 +8,15 @@ use sd_task_system::{ }; use std::{ - collections::VecDeque, - hash::{DefaultHasher, Hash, Hasher}, + collections::{hash_map::DefaultHasher, VecDeque}, + fmt, + hash::{Hash, Hasher}, marker::PhantomData, + ops::{Deref, DerefMut}, + path::Path, pin::pin, sync::Arc, + time::Duration, }; use async_channel as chan; @@ -25,11 +29,16 @@ use futures_concurrency::{ use serde::{Deserialize, Serialize}; use specta::Type; use strum::{Display, EnumString}; -use tokio::spawn; -use tracing::{debug, error, info, warn}; +use tokio::{ + spawn, + sync::{oneshot, watch, Mutex}, + time::Instant, +}; +use tracing::{debug, error, instrument, trace, warn, Instrument, Level}; use uuid::Uuid; use super::{ + error::DispatcherError, report::{ Report, ReportBuilder, ReportInputMetadata, ReportMetadata, ReportOutputMetadata, Status, }, @@ -42,13 +51,30 @@ use super::{ #[strum(use_phf, serialize_all = "snake_case")] pub enum JobName { Indexer, + FileIdentifier, + MediaProcessor, // TODO: Add more job names as needed + Copy, + Move, + Delete, + Erase, + FileValidator, } pub enum ReturnStatus { Completed(JobReturn), Shutdown(Result>, rmp_serde::encode::Error>), - Canceled, + Canceled(JobReturn), +} + +impl fmt::Debug for ReturnStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Completed(job_return) => f.debug_tuple("Completed").field(job_return).finish(), + Self::Shutdown(_) => f.write_str("Shutdown()"), + Self::Canceled(job_return) => f.debug_tuple("Canceled").field(job_return).finish(), + } + } } pub enum ProgressUpdate { @@ -68,57 +94,75 @@ impl ProgressUpdate { } } -pub trait JobContext: Send + Sync + Clone + 'static { +pub trait OuterContext: Send + Sync + Clone + 'static { fn id(&self) -> Uuid; fn db(&self) -> &Arc; fn sync(&self) -> &Arc; fn invalidate_query(&self, query: &'static str); fn query_invalidator(&self) -> impl Fn(&'static str) + Send + Sync; - fn progress(&self, updates: Vec); - fn progress_msg(&self, msg: impl Into) { - self.progress(vec![ProgressUpdate::Message(msg.into())]); + fn report_update(&self, update: UpdateEvent); + fn get_data_directory(&self) -> &Path; +} + +pub trait JobContext: OuterContext { + fn new(report: Report, ctx: OuterCtx) -> Self; + fn progress( + &self, + updates: impl IntoIterator + Send, + ) -> impl Future + Send; + fn progress_msg(&self, msg: impl Into) -> impl Future + Send { + let msg = msg.into(); + async move { + self.progress([ProgressUpdate::Message(msg)]).await; + } } + fn report(&self) -> impl Future + Send> + Send; + fn report_mut(&self) -> impl Future + Send> + Send; + fn get_outer_ctx(&self) -> OuterCtx; } pub trait Job: Send + Sync + Hash + 'static { const NAME: JobName; #[allow(unused_variables)] - fn resume_tasks( + fn resume_tasks( &mut self, dispatcher: &JobTaskDispatcher, - ctx: &impl JobContext, + ctx: &impl JobContext, serialized_tasks: SerializedTasks, ) -> impl Future> + Send { async move { Ok(()) } } - fn run( + fn run( self, dispatcher: JobTaskDispatcher, - ctx: impl JobContext, + ctx: impl JobContext, ) -> impl Future> + Send; } -pub trait IntoJob +pub trait IntoJob where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { - fn into_job(self) -> Box>; + fn into_job(self) -> Box>; } -impl IntoJob for J +impl IntoJob for J where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { - fn into_job(self) -> Box> { + fn into_job(self) -> Box> { let id = JobId::new_v4(); Box::new(JobHolder { id, job: self, + run_time: Duration::ZERO, report: ReportBuilder::new(id, J::NAME).build(), next_jobs: VecDeque::new(), _ctx: PhantomData, @@ -126,12 +170,13 @@ where } } -impl IntoJob for JobBuilder +impl IntoJob for JobEnqueuer where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { - fn into_job(self) -> Box> { + fn into_job(self) -> Box> { self.build() } } @@ -139,8 +184,8 @@ where #[derive(Debug)] pub struct JobReturn { data: JobOutputData, - metadata: Option, - non_critical_errors: Vec, + metadata: Vec, + non_critical_errors: Vec, } impl JobReturn { @@ -156,7 +201,7 @@ impl Default for JobReturn { fn default() -> Self { Self { data: JobOutputData::Empty, - metadata: None, + metadata: vec![], non_critical_errors: vec![], } } @@ -175,13 +220,13 @@ impl JobReturnBuilder { } #[must_use] - pub fn with_metadata(mut self, metadata: impl Into) -> Self { - self.job_return.metadata = Some(metadata.into()); + pub fn with_metadata(mut self, metadata: impl Into>) -> Self { + self.job_return.metadata = metadata.into(); self } #[must_use] - pub fn with_non_critical_errors(mut self, errors: Vec) -> Self { + pub fn with_non_critical_errors(mut self, errors: Vec) -> Self { if self.job_return.non_critical_errors.is_empty() { self.job_return.non_critical_errors = errors; } else { @@ -203,10 +248,17 @@ pub struct JobOutput { job_name: JobName, data: JobOutputData, metadata: Vec, - non_critical_errors: Vec, + non_critical_errors: Vec, } impl JobOutput { + #[instrument( + skip_all, + fields( + name = %report.name, + non_critical_errors_count = non_critical_errors.len(), + ) + )] pub fn prepare_output_and_report( JobReturn { data, @@ -217,23 +269,18 @@ impl JobOutput { ) -> Self { if non_critical_errors.is_empty() { report.status = Status::Completed; - debug!("Job completed", report.id, report.name); + debug!("Job completed"); } else { report.status = Status::CompletedWithErrors; - report.non_critical_errors = non_critical_errors - .iter() - .map(ToString::to_string) - .collect(); + report.non_critical_errors.extend(non_critical_errors); warn!( - "Job completed with errors: {non_critical_errors:#?}", - report.id, report.name + non_critical_errors = ?report.non_critical_errors, + "Job completed with errors;", ); } - if let Some(metadata) = metadata { - report.metadata.push(ReportMetadata::Output(metadata)); - } + report.metadata.extend(metadata.into_iter().map(Into::into)); report.completed_at = Some(Utc::now()); @@ -243,7 +290,7 @@ impl JobOutput { job_name: report.name, data, metadata: report.metadata.clone(), - non_critical_errors, + non_critical_errors: report.non_critical_errors.clone(), } } } @@ -251,33 +298,36 @@ impl JobOutput { #[derive(Debug, Serialize, Type)] pub enum JobOutputData { Empty, - // TODO: Add more types + // TODO: Add more types as needed } -pub struct JobBuilder +pub struct JobEnqueuer where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { id: JobId, job: J, report_builder: ReportBuilder, - next_jobs: VecDeque>>, - _ctx: PhantomData, + next_jobs: VecDeque>>, + _ctx: PhantomData, } -impl JobBuilder +impl JobEnqueuer where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { - pub fn build(self) -> Box> { + fn build(self) -> Box> { Box::new(JobHolder { id: self.id, job: self.job, + run_time: Duration::ZERO, report: self.report_builder.build(), - next_jobs: VecDeque::new(), - _ctx: PhantomData, + next_jobs: self.next_jobs, + _ctx: self._ctx, }) } @@ -311,10 +361,10 @@ where } #[must_use] - pub fn enqueue_next(mut self, next: impl Job + SerializableJob) -> Self { + pub fn enqueue_next(mut self, next: impl Job + SerializableJob) -> Self { let next_job_order = self.next_jobs.len() + 1; - let mut child_job_builder = JobBuilder::new(next).with_parent_id(self.id); + let mut child_job_builder = JobEnqueuer::new(next).with_parent_id(self.id); if let Some(parent_action) = &self.report_builder.action { child_job_builder = @@ -327,40 +377,97 @@ where } } -pub struct JobHolder +pub struct JobHolder where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { pub(super) id: JobId, pub(super) job: J, pub(super) report: Report, - pub(super) next_jobs: VecDeque>>, - pub(super) _ctx: PhantomData, + pub(super) run_time: Duration, + pub(super) next_jobs: VecDeque>>, + pub(super) _ctx: PhantomData, } -pub struct JobHandle { - pub(crate) next_jobs: VecDeque>>, - pub(crate) job_ctx: Ctx, - pub(crate) report: Report, - pub(crate) commands_tx: chan::Sender, +pub struct JobHandle> { + pub(crate) id: JobId, + pub(crate) start_time: Instant, + pub(crate) run_time: Duration, + pub(crate) is_running: bool, + pub(crate) next_jobs: VecDeque>>, + pub(crate) ctx: JobCtx, + pub(crate) commands_tx: chan::Sender<(Command, oneshot::Sender<()>)>, } -impl JobHandle { - pub async fn send_command(&mut self, command: Command) -> Result<(), JobSystemError> { - if self.commands_tx.send(command).await.is_err() { - warn!("Tried to send a {command:?} to a job that was already completed"); +impl> JobHandle { + #[instrument(skip(self, outer_ack_tx), fields(job_id = %self.id))] + pub async fn send_command( + &mut self, + command: Command, + outer_ack_tx: oneshot::Sender>, + ) { + trace!("JobHandle sending command"); + + let (ack_tx, ack_rx) = oneshot::channel(); + + let res = if self.commands_tx.send((command, ack_tx)).await.is_err() { + warn!("Tried to send command to a job that was already completed"); Ok(()) } else { - self.command_children(command).await + ack_rx + .await + .expect("inner ack channel closed before sending response to handle a job command"); + + match self.execute_command(command).await { + Ok(()) => self.command_children(command).await, + Err(e) => Err(e), + } + }; + + if res.is_ok() { + match command { + Command::Pause | Command::Cancel | Command::Shutdown => self.is_running = false, + Command::Resume => self.is_running = true, + } } + + outer_ack_tx + .send(res) + .unwrap_or_else(|_| panic!("ack channel closed before sending {command:?} response")); } - pub async fn command_children(&mut self, command: Command) -> Result<(), JobSystemError> { + #[instrument(skip_all, err)] + async fn execute_command(&mut self, command: Command) -> Result<(), JobSystemError> { let (new_status, completed_at) = match command { Command::Pause => (Status::Paused, None), - Command::Resume => return Ok(()), + Command::Resume => (Status::Running, None), + Command::Cancel => (Status::Canceled, Some(Utc::now())), + Command::Shutdown => { + // We don't need to do anything here, we will handle when the job returns its output + return Ok(()); + } + }; + + { + let mut report = self.ctx.report_mut().await; + + report.status = new_status; + report.completed_at = completed_at; + + report.update(self.ctx.db()).await?; + } + + Ok(()) + } + + #[instrument(skip_all, err)] + async fn command_children(&mut self, command: Command) -> Result<(), JobSystemError> { + let (new_status, completed_at) = match command { + Command::Pause | Command::Shutdown => (Status::Paused, None), + Command::Resume => (Status::Queued, None), Command::Cancel => (Status::Canceled, Some(Utc::now())), }; @@ -371,7 +478,12 @@ impl JobHandle { next_job_report.status = new_status; next_job_report.completed_at = completed_at; - next_job_report.update(self.job_ctx.db()).await + trace!( + %next_job_report.id, + "Parent job sent command to children job;", + ); + + next_job_report.update(self.ctx.db()).await }) .collect::>() .try_join() @@ -380,39 +492,54 @@ impl JobHandle { .map_err(Into::into) } + #[instrument( + skip(self), + fields(job_id = %self.id), + ret(level = Level::TRACE), + err, + )] pub async fn register_start( &mut self, start_time: DateTime, ) -> Result<(), JobSystemError> { - let Self { - next_jobs, - report, - job_ctx, - .. - } = self; + trace!("JobHandle registering start of job"); - report.status = Status::Running; - if report.started_at.is_none() { - report.started_at = Some(start_time); - } + let Self { next_jobs, ctx, .. } = self; + let db = ctx.db(); - let db = job_ctx.db(); + let now = Utc::now(); - // If the report doesn't have a created_at date, it's a new report - if report.created_at.is_none() { - report.create(db).await?; - } else { - // Otherwise it can be a job being resumed or a children job that was already been created - report.update(db).await?; + { + let mut report = ctx.report_mut().await; + + report.status = Status::Running; + if report.started_at.is_none() { + report.started_at = Some(start_time); + } + + // If the report doesn't have a created_at date, it's a new report + if report.created_at.is_none() { + report.create(db, now).await?; + } else { + // Otherwise it can be a job being resumed or a children job that was already been created + report.update(db).await?; + } } // Registering children jobs - next_jobs + let res = next_jobs .iter_mut() - .map(|dyn_job| dyn_job.report_mut()) - .map(|next_job_report| async { + .enumerate() + .map(|(idx, dyn_job)| (idx, dyn_job.report_mut())) + .map(|(idx, next_job_report)| async move { + trace!( + %next_job_report.id, + "Parent job registering children;", + ); if next_job_report.created_at.is_none() { - next_job_report.create(db).await + next_job_report + .create(db, now + Duration::from_secs((idx + 1) as u64)) + .await } else { Ok(()) } @@ -421,78 +548,127 @@ impl JobHandle { .try_join() .await .map(|_| ()) - .map_err(Into::into) + .map_err(Into::into); + + ctx.invalidate_query("jobs.isActive"); + ctx.invalidate_query("jobs.reports"); + + res } + #[instrument( + skip_all, + fields( + id = %self.id, + + ), + err + )] pub async fn complete_job( &mut self, job_return: JobReturn, ) -> Result { - let Self { - report, job_ctx, .. - } = self; + let Self { ctx, .. } = self; - let output = JobOutput::prepare_output_and_report(job_return, report); + let mut report = ctx.report_mut().await; - report.update(job_ctx.db()).await?; + trace!("JobHandle completing"); + + let output = JobOutput::prepare_output_and_report(job_return, &mut report); + + report.update(ctx.db()).await?; + + trace!("JobHandle completed"); Ok(output) } + #[instrument( + skip(self), + fields( + id = %self.id, + ), + err + )] pub async fn failed_job(&mut self, e: &Error) -> Result<(), JobSystemError> { - let Self { - report, job_ctx, .. - } = self; - error!( - "Job failed with a critical error: {e:#?};", - report.id, report.name - ); + trace!("JobHandle registering failed job"); - report.status = Status::Failed; - report.critical_error = Some(e.to_string()); - report.completed_at = Some(Utc::now()); + let db = self.ctx.db(); + { + let mut report = self.ctx.report_mut().await; - report.update(job_ctx.db()).await?; + error!( + job_name = %report.name, + "Job failed with a critical error;", + ); + + report.status = Status::Failed; + report.critical_error = Some(e.to_string()); + report.completed_at = Some(Utc::now()); + + report.update(db).await?; + } + + trace!("JobHandle sending cancel command to children due to failure"); self.command_children(Command::Cancel).await } - pub async fn shutdown_pause_job(&mut self) -> Result<(), JobSystemError> { - let Self { - report, job_ctx, .. - } = self; - info!( - "Job paused due to system shutdown, we will pause all children jobs", - report.id, report.name - ); + #[instrument( + skip(self), + fields( + id = %self.id, + ), + err + )] + pub async fn cancel_job( + &mut self, + JobReturn { + data, + metadata, + non_critical_errors, + }: JobReturn, + ) -> Result { + trace!("JobHandle canceling job"); + let db = self.ctx.db(); - report.status = Status::Paused; + let output = { + let mut report = self.ctx.report_mut().await; - report.update(job_ctx.db()).await?; + debug!( + job_name = %report.name, + "Job canceled, we will cancel all children jobs;", + ); - self.command_children(Command::Pause).await - } + report.status = Status::Canceled; + report.non_critical_errors.extend(non_critical_errors); + report.metadata.extend(metadata.into_iter().map(Into::into)); + report.completed_at = Some(Utc::now()); - pub async fn cancel_job(&mut self) -> Result<(), JobSystemError> { - let Self { - report, job_ctx, .. - } = self; - info!( - "Job canceled, we will cancel all children jobs", - report.id, report.name - ); + report.update(db).await?; - report.status = Status::Canceled; - report.completed_at = Some(Utc::now()); + JobOutput { + id: report.id, + status: report.status, + job_name: report.name, + data, + metadata: report.metadata.clone(), + non_critical_errors: report.non_critical_errors.clone(), + } + }; - report.update(job_ctx.db()).await?; + trace!("JobHandle sending cancel command to children"); - self.command_children(Command::Cancel).await + self.command_children(Command::Cancel).await?; + + Ok(output) } } #[async_trait::async_trait] -pub trait DynJob: Send + Sync + 'static { +pub trait DynJob>: + Send + Sync + 'static +{ fn id(&self) -> JobId; fn job_name(&self) -> JobName; @@ -501,33 +677,34 @@ pub trait DynJob: Send + Sync + 'static { fn report_mut(&mut self) -> &mut Report; - fn set_next_jobs(&mut self, next_jobs: VecDeque>>); + fn set_next_jobs(&mut self, next_jobs: VecDeque>>); - fn next_jobs(&self) -> &VecDeque>>; + fn next_jobs(&self) -> &VecDeque>>; async fn serialize(self: Box) -> Result>, rmp_serde::encode::Error>; fn dispatch( self: Box, base_dispatcher: BaseTaskDispatcher, - job_ctx: Ctx, + ctx: OuterCtx, done_tx: chan::Sender<(JobId, Result)>, - ) -> JobHandle; + ) -> JobHandle; fn resume( self: Box, base_dispatcher: BaseTaskDispatcher, - job_ctx: Ctx, + ctx: OuterCtx, serialized_tasks: Option, done_tx: chan::Sender<(JobId, Result)>, - ) -> JobHandle; + ) -> JobHandle; } #[async_trait::async_trait] -impl DynJob for JobHolder +impl DynJob for JobHolder where - J: Job + SerializableJob, - Ctx: JobContext, + J: Job + SerializableJob, + OuterCtx: OuterContext, + JobCtx: JobContext, { fn id(&self) -> JobId { self.id @@ -548,11 +725,11 @@ where &mut self.report } - fn set_next_jobs(&mut self, next_jobs: VecDeque>>) { + fn set_next_jobs(&mut self, next_jobs: VecDeque>>) { self.next_jobs = next_jobs; } - fn next_jobs(&self) -> &VecDeque>> { + fn next_jobs(&self) -> &VecDeque>> { &self.next_jobs } @@ -560,18 +737,23 @@ where self.job.serialize().await } + #[instrument(skip_all, fields(id = %self.id))] fn dispatch( self: Box, base_dispatcher: BaseTaskDispatcher, - job_ctx: Ctx, + ctx: OuterCtx, done_tx: chan::Sender<(JobId, Result)>, - ) -> JobHandle { + ) -> JobHandle { let (commands_tx, commands_rx) = chan::bounded(8); - spawn(to_spawn_job( + let ctx = JobCtx::new(self.report, ctx); + + trace!("Dispatching job"); + + spawn(to_spawn_job::( self.id, self.job, - job_ctx.clone(), + ctx.clone(), None, base_dispatcher, commands_rx, @@ -579,26 +761,40 @@ where )); JobHandle { + id: self.id, + start_time: Instant::now(), + is_running: true, + run_time: Duration::ZERO, next_jobs: self.next_jobs, - job_ctx, - report: self.report, + ctx, commands_tx, } } + #[instrument( + skip_all, + fields( + id = %self.id, + has_serialized_tasks = %serialized_tasks.is_some(), + ) + )] fn resume( self: Box, base_dispatcher: BaseTaskDispatcher, - job_ctx: Ctx, + ctx: OuterCtx, serialized_tasks: Option, done_tx: chan::Sender<(JobId, Result)>, - ) -> JobHandle { + ) -> JobHandle { let (commands_tx, commands_rx) = chan::bounded(8); - spawn(to_spawn_job( + let ctx = JobCtx::new(self.report, ctx); + + trace!("Resuming job"); + + spawn(to_spawn_job::( self.id, self.job, - job_ctx.clone(), + ctx.clone(), serialized_tasks, base_dispatcher, commands_rx, @@ -606,40 +802,48 @@ where )); JobHandle { + id: self.id, + start_time: Instant::now(), + is_running: true, + run_time: self.run_time, next_jobs: self.next_jobs, - job_ctx, - report: self.report, + ctx, commands_tx, } } } -async fn to_spawn_job( - id: JobId, - mut job: impl Job, - job_ctx: Ctx, +#[instrument(name = "job_executor", skip_all, fields(%job_id, name = %J::NAME))] +async fn to_spawn_job( + job_id: JobId, + mut job: J, + ctx: JobCtx, existing_tasks: Option, base_dispatcher: BaseTaskDispatcher, - commands_rx: chan::Receiver, + commands_rx: chan::Receiver<(Command, oneshot::Sender<()>)>, done_tx: chan::Sender<(JobId, Result)>, -) { +) where + OuterCtx: OuterContext, + JobCtx: JobContext, + J: Job, +{ enum StreamMessage { - Commands(Command), + Commands((Command, oneshot::Sender<()>)), NewRemoteController(TaskRemoteController), Done(Result), } let mut remote_controllers = vec![]; - let (dispatcher, remote_controllers_rx) = JobTaskDispatcher::new(base_dispatcher); + let (running_state_tx, running_state_rx) = watch::channel(JobRunningState::Running); + + let (dispatcher, remote_controllers_rx) = + JobTaskDispatcher::new(job_id, base_dispatcher, running_state_rx); if let Some(existing_tasks) = existing_tasks { - if let Err(e) = job - .resume_tasks(&dispatcher, &job_ctx, existing_tasks) - .await - { + if let Err(e) = job.resume_tasks(&dispatcher, &ctx, existing_tasks).await { done_tx - .send((id, Err(e))) + .send((job_id, Err(e))) .await .expect("jobs done tx closed on error at resume_tasks"); @@ -647,23 +851,53 @@ async fn to_spawn_job( } } + let (tx, rx) = chan::bounded(1); + + spawn( + async move { + tx.send(job.run::(dispatcher, ctx).await) + .await + .expect("job run channel closed"); + } + .in_current_span(), + ); + + let commands_rx_to_close = commands_rx.clone(); + let mut msgs_stream = pin!(( commands_rx.map(StreamMessage::Commands), - remote_controllers_rx.map(StreamMessage::NewRemoteController), - stream::once(job.run(dispatcher, job_ctx)).map(StreamMessage::Done), + remote_controllers_rx + .clone() + .map(StreamMessage::NewRemoteController), + stream::once({ + let rx = rx.clone(); + async move { rx.recv().await.expect("job run rx closed") } + }) + .map(StreamMessage::Done), ) .merge()); while let Some(msg) = msgs_stream.next().await { match msg { StreamMessage::NewRemoteController(remote_controller) => { + trace!("new remote controller received"); remote_controllers.push(remote_controller); + trace!("added new remote controller"); } - StreamMessage::Commands(command) => { + StreamMessage::Commands((command, ack_tx)) => { + // Add any possible pending remote controllers to the list + while let Ok(remote_controller) = remote_controllers_rx.try_recv() { + remote_controllers.push(remote_controller); + } + remote_controllers.retain(|controller| !controller.is_done()); match command { Command::Pause => { + trace!("Pausing job"); + running_state_tx.send_modify(|state| *state = JobRunningState::Paused); + trace!(tasks_count = remote_controllers.len(), "pausing tasks;"); + remote_controllers .iter() .map(TaskRemoteController::pause) @@ -675,11 +909,19 @@ async fn to_spawn_job( if let Err(e) = res { assert!(matches!(e, TaskSystemError::TaskNotFound(_))); - warn!("Tried to pause a task that was already completed"); + trace!("Tried to pause a task that was already completed"); } }); + + ack_tx.send(()).expect("ack channel closed"); + trace!("paused job"); } + Command::Resume => { + trace!("Resuming job"); + running_state_tx.send_modify(|state| *state = JobRunningState::Running); + trace!(tasks_count = remote_controllers.len(), "resuming tasks"); + remote_controllers .iter() .map(TaskRemoteController::resume) @@ -691,94 +933,222 @@ async fn to_spawn_job( if let Err(e) = res { assert!(matches!(e, TaskSystemError::TaskNotFound(_))); - warn!("Tried to pause a task that was already completed"); + trace!("Tried to resume a task that was already completed"); } }); + + ack_tx.send(()).expect("ack channel closed"); + trace!("resumed job"); } + Command::Cancel => { + trace!("Canceling job"); + running_state_tx.send_modify(|state| *state = JobRunningState::Canceled); + trace!(tasks_count = remote_controllers.len(), "canceling tasks;"); + remote_controllers .iter() .map(TaskRemoteController::cancel) .collect::>() .join() - .await; - - return done_tx - .send((id, Ok(ReturnStatus::Canceled))) .await - .expect("jobs done tx closed"); + .into_iter() + .for_each(|res| { + if let Err(e) = res { + assert!(matches!(e, TaskSystemError::TaskNotFound(_))); + + trace!("Tried to cancel a task that was already completed"); + } + }); + + trace!("canceled job"); + + commands_rx_to_close.close(); + let res = rx.recv().await.expect("job run rx closed"); + ack_tx.send(()).expect("ack channel closed"); + trace!("Job cancellation done"); + + return finish_job(job_id, res, remote_controllers, done_tx).await; + } + + Command::Shutdown => { + trace!("Shutting down job"); + running_state_tx.send_modify(|state| *state = JobRunningState::Shutdown); + debug!( + tasks_count = remote_controllers.len(), + "shutting down tasks;" + ); + + commands_rx_to_close.close(); + // Just need to wait for the job to finish with the shutdown status + let res = rx.recv().await.expect("job run rx closed"); + ack_tx.send(()).expect("ack channel closed"); + trace!("Job shutdown done"); + + return finish_job(job_id, res, remote_controllers, done_tx).await; } } } StreamMessage::Done(res) => { - #[cfg(debug_assertions)] - { - // Just a sanity check to make sure we don't have any pending tasks left - remote_controllers.retain(|controller| !controller.is_done()); - assert!(remote_controllers.is_empty()); - // Using #[cfg(debug_assertions)] to don't pay this retain cost in release builds - } - - return done_tx.send((id, res)).await.expect("jobs done tx closed"); + trace!("Job done"); + commands_rx_to_close.close(); + return finish_job(job_id, res, remote_controllers, done_tx).await; } } } } +#[instrument(skip(remote_controllers, done_tx))] +async fn finish_job( + job_id: JobId, + job_result: Result, + mut remote_controllers: Vec, + done_tx: chan::Sender<(JobId, Result)>, +) { + trace!("Checking remove controllers"); + #[cfg(debug_assertions)] + { + // Just a sanity check to make sure we don't have any pending tasks left + remote_controllers.retain(|controller| !controller.is_done()); + assert!(remote_controllers.is_empty()); + // Using #[cfg(debug_assertions)] to don't pay this retain cost in release builds + } + + trace!("Sending job done message"); + + done_tx + .send((job_id, job_result)) + .await + .expect("jobs done tx closed"); +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum JobRunningState { + Running, + Paused, + Canceled, + Shutdown, +} + +impl Default for JobRunningState { + fn default() -> Self { + Self::Running + } +} + #[derive(Debug, Clone)] pub struct JobTaskDispatcher { + job_id: JobId, dispatcher: BaseTaskDispatcher, remote_controllers_tx: chan::Sender, + running_state: Arc>>, } impl TaskDispatcher for JobTaskDispatcher { - async fn dispatch_boxed(&self, boxed_task: Box>) -> TaskHandle { - let handle = self.dispatcher.dispatch_boxed(boxed_task).await; + type DispatchError = DispatcherError; - self.remote_controllers_tx - .send(handle.remote_controller()) - .await - .expect("remote controllers tx closed"); + async fn dispatch_boxed( + &self, + boxed_task: Box>, + ) -> Result, Self::DispatchError> { + match self.wait_for_dispatch_approval().await { + DispatchApproval::Canceled => Err(DispatcherError::JobCanceled(self.job_id)), + DispatchApproval::Shutdown => Err(DispatcherError::Shutdown(vec![boxed_task])), + DispatchApproval::Approved => { + let handle = self.dispatcher.dispatch_boxed(boxed_task).await?; - handle + self.remote_controllers_tx + .send(handle.remote_controller()) + .await + .expect("remote controllers tx closed"); + + Ok(handle) + } + } } async fn dispatch_many_boxed( &self, boxed_tasks: impl IntoIterator>> + Send, - ) -> Vec> { - let handles = self.dispatcher.dispatch_many_boxed(boxed_tasks).await; + ) -> Result>, Self::DispatchError> { + match self.wait_for_dispatch_approval().await { + DispatchApproval::Canceled => Err(DispatcherError::JobCanceled(self.job_id)), + DispatchApproval::Shutdown => { + Err(DispatcherError::Shutdown(boxed_tasks.into_iter().collect())) + } + DispatchApproval::Approved => { + let handles = self.dispatcher.dispatch_many_boxed(boxed_tasks).await?; - for handle in &handles { - self.remote_controllers_tx - .send(handle.remote_controller()) - .await - .expect("remote controllers tx closed"); + handles + .iter() + .map(|handle| self.remote_controllers_tx.send(handle.remote_controller())) + .collect::>() + .try_join() + .await + .expect("remote controllers tx closed"); + + Ok(handles) + } } - - handles - .iter() - .map(|handle| self.remote_controllers_tx.send(handle.remote_controller())) - .collect::>() - .try_join() - .await - .expect("remote controllers tx closed"); - - handles } } +enum DispatchApproval { + Approved, + Canceled, + Shutdown, +} + impl JobTaskDispatcher { - fn new(dispatcher: BaseTaskDispatcher) -> (Self, chan::Receiver) { + fn new( + job_id: JobId, + dispatcher: BaseTaskDispatcher, + running_state_rx: watch::Receiver, + ) -> (Self, chan::Receiver) { let (remote_controllers_tx, remote_controllers_rx) = chan::unbounded(); ( Self { + job_id, dispatcher, remote_controllers_tx, + running_state: Arc::new(Mutex::new(running_state_rx)), }, remote_controllers_rx, ) } + + async fn wait_for_dispatch_approval(&self) -> DispatchApproval { + { + let mut running_state_rx = self.running_state.lock().await; + + if running_state_rx + .has_changed() + .expect("job running state watch channel unexpectedly closed") + { + trace!("waiting for job running state to change"); + running_state_rx + .wait_for(|state| { + matches!( + *state, + JobRunningState::Running + | JobRunningState::Canceled | JobRunningState::Shutdown + ) + }) + .await + .expect("job running state watch channel unexpectedly closed"); + + let state = { *running_state_rx.borrow() }; + + match state { + JobRunningState::Shutdown => return DispatchApproval::Shutdown, + JobRunningState::Canceled => return DispatchApproval::Canceled, + _ => {} + } + } + } + + DispatchApproval::Approved + } } diff --git a/core/crates/heavy-lifting/src/job_system/mod.rs b/core/crates/heavy-lifting/src/job_system/mod.rs index 9f8c6c15b..64a315a02 100644 --- a/core/crates/heavy-lifting/src/job_system/mod.rs +++ b/core/crates/heavy-lifting/src/job_system/mod.rs @@ -1,16 +1,22 @@ -use crate::Error; +use crate::{Error, JobContext}; use sd_prisma::prisma::location; use sd_task_system::BaseTaskDispatcher; use sd_utils::error::FileIOError; -use std::{cell::RefCell, collections::hash_map::HashMap, path::Path, sync::Arc}; +use std::{ + cell::RefCell, + collections::hash_map::HashMap, + panic, + path::{Path, PathBuf}, + sync::Arc, +}; use async_channel as chan; use futures::Stream; use futures_concurrency::future::{Join, TryJoin}; use tokio::{fs, spawn, sync::oneshot, task::JoinHandle}; -use tracing::{error, info, trace, warn}; +use tracing::{debug, error, info, instrument, trace, warn}; use uuid::Uuid; mod error; @@ -20,8 +26,9 @@ mod runner; mod store; pub mod utils; -use error::JobSystemError; -use job::{IntoJob, Job, JobContext, JobName, JobOutput}; +pub use error::{DispatcherError, JobErrorOrDispatcherError, JobSystemError}; +use job::{IntoJob, Job, JobName, JobOutput, OuterContext}; +use report::Report; use runner::{run, JobSystemRunner, RunnerMessage}; use store::{load_jobs, StoredJobEntry}; @@ -36,22 +43,23 @@ pub enum Command { Pause, Resume, Cancel, + Shutdown, } -pub struct JobSystem { - msgs_tx: chan::Sender>, - job_outputs_rx: chan::Receiver<(JobId, Result)>, +pub struct JobSystem> { + msgs_tx: chan::Sender>, + job_outputs_rx: chan::Receiver<(JobId, Result)>, + store_jobs_file: Arc, runner_handle: RefCell>>, } -impl JobSystem { - pub async fn new( +impl> JobSystem { + pub fn new( base_dispatcher: BaseTaskDispatcher, - data_directory: impl AsRef + Send, - previously_existing_contexts: &HashMap, - ) -> Result { + data_directory: impl AsRef, + ) -> Self { let (job_outputs_tx, job_outputs_rx) = chan::unbounded(); - let (job_return_status_tx, job_return_status_rx) = chan::bounded(16); + let (job_done_tx, job_done_rx) = chan::bounded(16); let (msgs_tx, msgs_rx) = chan::bounded(8); let store_jobs_file = Arc::new(data_directory.as_ref().join(PENDING_JOBS_FILE)); @@ -63,8 +71,8 @@ impl JobSystem { while let Err(e) = spawn({ let store_jobs_file = Arc::clone(&store_jobs_file); let base_dispatcher = base_dispatcher.clone(); - let job_return_status_tx = job_return_status_tx.clone(); - let job_return_status_rx = job_return_status_rx.clone(); + let job_return_status_tx = job_done_tx.clone(); + let job_done_rx = job_done_rx.clone(); let job_outputs_tx = job_outputs_tx.clone(); let msgs_rx = msgs_rx.clone(); @@ -77,7 +85,7 @@ impl JobSystem { ), store_jobs_file.as_ref(), msgs_rx, - job_return_status_rx, + job_done_rx, ) .await; } @@ -85,7 +93,7 @@ impl JobSystem { .await { if e.is_panic() { - error!("Job system panicked: {e:#?}"); + error!(?e, "Job system panicked;"); } else { trace!("JobSystemRunner received shutdown signal and will exit..."); break; @@ -97,22 +105,47 @@ impl JobSystem { } }))); - load_stored_job_entries( - store_jobs_file.as_ref(), - previously_existing_contexts, - &msgs_tx, - ) - .await?; - - Ok(Self { + Self { msgs_tx, job_outputs_rx, + store_jobs_file, runner_handle, - }) + } + } + + pub async fn init( + &self, + previously_existing_contexts: &HashMap, + ) -> Result<(), JobSystemError> { + load_stored_job_entries( + &*self.store_jobs_file, + previously_existing_contexts, + &self.msgs_tx, + ) + .await + } + + /// Get a map of all active reports with their respective job ids + /// + /// # Panics + /// + /// Panics only happen if internal channels are unexpectedly closed + pub async fn get_active_reports(&self) -> HashMap { + let (ack_tx, ack_rx) = oneshot::channel(); + self.msgs_tx + .send(RunnerMessage::GetActiveReports { ack_tx }) + .await + .expect("runner msgs channel unexpectedly closed on get active reports request"); + + ack_rx + .await + .expect("ack channel closed before receiving get active reports response") } /// Checks if *any* of the desired jobs is running for the desired location + /// /// # Panics + /// /// Panics only happen if internal channels are unexpectedly closed pub async fn check_running_jobs( &self, @@ -122,7 +155,7 @@ impl JobSystem { let (ack_tx, ack_rx) = oneshot::channel(); self.msgs_tx - .send(RunnerMessage::CheckIfJobAreRunning { + .send(RunnerMessage::CheckIfJobsAreRunning { job_names, location_id, ack_tx, @@ -136,7 +169,9 @@ impl JobSystem { } /// Shutdown the job system + /// /// # Panics + /// /// Panics only happen if internal channels are unexpectedly closed pub async fn shutdown(&self) { if let Some(handle) = self @@ -152,7 +187,7 @@ impl JobSystem { if let Err(e) = handle.await { if e.is_panic() { - error!("JobSystem panicked: {e:#?}"); + error!(?e, "JobSystem panicked;"); } } info!("JobSystem gracefully shutdown"); @@ -162,13 +197,15 @@ impl JobSystem { } /// Dispatch a new job to the system + /// /// # Panics + /// /// Panics only happen if internal channels are unexpectedly closed - pub async fn dispatch( - &mut self, - job: impl IntoJob + Send, + pub async fn dispatch>( + &self, + job: impl IntoJob + Send, location_id: location::id::Type, - job_ctx: Ctx, + ctx: OuterCtx, ) -> Result { let dyn_job = job.into_job(); let id = dyn_job.id(); @@ -176,10 +213,10 @@ impl JobSystem { let (ack_tx, ack_rx) = oneshot::channel(); self.msgs_tx .send(RunnerMessage::NewJob { - id, + job_id: id, location_id, dyn_job, - job_ctx, + ctx, ack_tx, }) .await @@ -191,17 +228,35 @@ impl JobSystem { .map(|()| id) } - pub fn receive_job_outputs( - &self, - ) -> impl Stream)> { + /// Check if there are any active jobs for the desired [`OuterContext`] + /// + /// # Panics + /// + /// Panics only happen if internal channels are unexpectedly closed + pub async fn has_active_jobs(&self, ctx: OuterCtx) -> bool { + let ctx_id = ctx.id(); + + let (ack_tx, ack_rx) = oneshot::channel(); + self.msgs_tx + .send(RunnerMessage::HasActiveJobs { ctx_id, ack_tx }) + .await + .expect("runner msgs channel unexpectedly closed on has active jobs request"); + + ack_rx + .await + .expect("ack channel closed before receiving has active jobs response") + } + + pub fn receive_job_outputs(&self) -> impl Stream)> { self.job_outputs_rx.clone() } - async fn send_command(&self, id: JobId, command: Command) -> Result<(), JobSystemError> { + #[instrument(skip(self), err)] + async fn send_command(&self, job_id: JobId, command: Command) -> Result<(), JobSystemError> { let (ack_tx, ack_rx) = oneshot::channel(); self.msgs_tx .send(RunnerMessage::Command { - id, + job_id, command, ack_tx, }) @@ -215,38 +270,48 @@ impl JobSystem { .unwrap_or_else(|_| panic!("ack channel closed before receiving {command:?} response")) } - pub async fn pause(&self, id: JobId) -> Result<(), JobSystemError> { - self.send_command(id, Command::Pause).await + pub async fn pause(&self, job_id: JobId) -> Result<(), JobSystemError> { + self.send_command(job_id, Command::Pause).await } - pub async fn resume(&self, id: JobId) -> Result<(), JobSystemError> { - self.send_command(id, Command::Resume).await + pub async fn resume(&self, job_id: JobId) -> Result<(), JobSystemError> { + self.send_command(job_id, Command::Resume).await } - pub async fn cancel(&self, id: JobId) -> Result<(), JobSystemError> { - self.send_command(id, Command::Cancel).await + pub async fn cancel(&self, job_id: JobId) -> Result<(), JobSystemError> { + self.send_command(job_id, Command::Cancel).await } } /// SAFETY: Due to usage of refcell we lost `Sync` impl, but we only use it to have a shutdown method /// receiving `&self` which is called once, and we also use `try_borrow_mut` so we never panic -unsafe impl Sync for JobSystem {} +unsafe impl> Sync + for JobSystem +{ +} -async fn load_stored_job_entries( +async fn load_stored_job_entries>( store_jobs_file: impl AsRef + Send, - previously_existing_job_contexts: &HashMap, - msgs_tx: &chan::Sender>, + previously_existing_job_contexts: &HashMap, + msgs_tx: &chan::Sender>, ) -> Result<(), JobSystemError> { let store_jobs_file = store_jobs_file.as_ref(); let stores_jobs_by_db = rmp_serde::from_slice::>>( - &fs::read(store_jobs_file).await.map_err(|e| { - JobSystemError::StoredJobs(FileIOError::from(( - store_jobs_file, - e, - "Failed to load jobs from disk", - ))) - })?, + &match fs::read(store_jobs_file).await { + Ok(bytes) => bytes, + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + debug!("No pending jobs found on disk"); + return Ok(()); + } + Err(e) => { + return Err(JobSystemError::StoredJobs(FileIOError::from(( + store_jobs_file, + e, + "Failed to load jobs from disk", + )))) + } + }, )?; stores_jobs_by_db @@ -254,7 +319,7 @@ async fn load_stored_job_entries( .filter_map(|(ctx_id, entries)| { previously_existing_job_contexts.get(&ctx_id).map_or_else( || { - warn!("Found stored jobs for a database that doesn't exist anymore: "); + warn!(%ctx_id, "Found stored jobs for a database that doesn't exist anymore;"); None }, |ctx| Some((entries, ctx.clone())), @@ -270,23 +335,23 @@ async fn load_stored_job_entries( .await .into_iter() .filter_map(|res| { - res.map_err(|e| error!("Failed to load stored jobs: {e:#?}")) + res.map_err(|e| error!(?e, "Failed to load stored jobs;")) .ok() }) - .flat_map(|(stored_jobs, job_ctx)| { + .flat_map(|(stored_jobs, ctx)| { stored_jobs .into_iter() .map(move |(location_id, dyn_job, serialized_tasks)| { - let job_ctx = job_ctx.clone(); + let ctx = ctx.clone(); async move { let (ack_tx, ack_rx) = oneshot::channel(); msgs_tx .send(RunnerMessage::ResumeStoredJob { - id: dyn_job.id(), + job_id: dyn_job.id(), location_id, dyn_job, - job_ctx, + ctx, serialized_tasks, ack_tx, }) diff --git a/core/crates/heavy-lifting/src/job_system/report.rs b/core/crates/heavy-lifting/src/job_system/report.rs index dbb9af221..ff2e11496 100644 --- a/core/crates/heavy-lifting/src/job_system/report.rs +++ b/core/crates/heavy-lifting/src/job_system/report.rs @@ -1,14 +1,15 @@ -use sd_prisma::prisma::{job, PrismaClient}; +use crate::NonCriticalError; + +use sd_prisma::prisma::{file_path, job, location, PrismaClient}; use sd_utils::db::{maybe_missing, MissingFieldError}; -use std::{collections::HashMap, fmt, str::FromStr}; +use std::{collections::HashMap, fmt, path::PathBuf, str::FromStr}; use chrono::{DateTime, Utc}; use prisma_client_rust::QueryError; use serde::{Deserialize, Serialize}; use specta::Type; use strum::ParseError; -use tracing::error; use super::{job::JobName, JobId}; @@ -22,10 +23,8 @@ pub enum ReportError { InvalidJobStatusInt(i32), #[error("job not found in database: ")] MissingReport(JobId), - #[error("serialization error: {0}")] - Serialization(#[from] rmp_serde::encode::Error), - #[error("deserialization error: {0}")] - Deserialization(#[from] rmp_serde::decode::Error), + #[error("json error: {0}")] + Json(#[from] serde_json::Error), #[error(transparent)] MissingField(#[from] MissingFieldError), #[error("failed to parse job name from database: {0}")] @@ -44,10 +43,7 @@ impl From for rspc::Error { ReportError::MissingReport(_) => { Self::with_cause(rspc::ErrorCode::NotFound, e.to_string(), e) } - ReportError::Serialization(_) - | ReportError::Deserialization(_) - | ReportError::MissingField(_) - | ReportError::JobNameParse(_) => { + ReportError::Json(_) | ReportError::MissingField(_) | ReportError::JobNameParse(_) => { Self::with_cause(rspc::ErrorCode::InternalServerError, e.to_string(), e) } } @@ -55,21 +51,78 @@ impl From for rspc::Error { } #[derive(Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] +#[serde(tag = "type", content = "metadata")] pub enum ReportMetadata { Input(ReportInputMetadata), Output(ReportOutputMetadata), } #[derive(Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] +#[serde(tag = "type", content = "data")] pub enum ReportInputMetadata { - Placeholder, - // TODO: Add more types + // TODO: Add more variants as needed + Location(location::Data), + SubPath(PathBuf), } #[derive(Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] +#[serde(tag = "type", content = "data")] pub enum ReportOutputMetadata { Metrics(HashMap), - // TODO: Add more types + Indexer { + total_paths: (u32, u32), + }, + FileIdentifier { + total_orphan_paths: (u32, u32), + total_objects_created: (u32, u32), + total_objects_linked: (u32, u32), + }, + MediaProcessor { + media_data_extracted: (u32, u32), + media_data_skipped: (u32, u32), + thumbnails_generated: (u32, u32), + thumbnails_skipped: (u32, u32), + }, + Copier { + source_location_id: location::id::Type, + target_location_id: location::id::Type, + sources_file_path_ids: Vec, + target_location_relative_directory_path: PathBuf, + }, + Mover { + source_location_id: location::id::Type, + target_location_id: location::id::Type, + sources_file_path_ids: Vec, + target_location_relative_directory_path: PathBuf, + }, + Deleter { + location_id: location::id::Type, + file_path_ids: Vec, + }, + Eraser { + location_id: location::id::Type, + file_path_ids: Vec, + passes: u32, + }, + FileValidator { + location_id: location::id::Type, + sub_path: Option, + }, +} + +impl From for ReportMetadata { + fn from(value: ReportInputMetadata) -> Self { + Self::Input(value) + } +} + +impl From for ReportMetadata { + fn from(value: ReportOutputMetadata) -> Self { + Self::Output(value) + } } #[derive(Debug, Serialize, Type, Clone)] @@ -80,7 +133,7 @@ pub struct Report { pub metadata: Vec, pub critical_error: Option, - pub non_critical_errors: Vec, + pub non_critical_errors: Vec, pub created_at: Option>, pub started_at: Option>, @@ -111,46 +164,53 @@ impl fmt::Display for Report { impl TryFrom for Report { type Error = ReportError; - fn try_from(data: job::Data) -> Result { + fn try_from( + job::Data { + id, + name, + action, + status, + errors_text: _, // Deprecated + critical_error, + non_critical_errors, + data: _, // Deprecated + metadata, + parent_id, + task_count, + completed_task_count, + date_estimated_completion, + date_created, + date_started, + date_completed, + .. + }: job::Data, + ) -> Result { Ok(Self { - id: JobId::from_slice(&data.id).expect("corrupted database"), - name: JobName::from_str(&maybe_missing(data.name, "job.name")?)?, - action: data.action, - - metadata: data - .metadata - .map(|m| { - rmp_serde::from_slice(&m).unwrap_or_else(|e| { - error!("Failed to deserialize job metadata: {e:#?}"); - vec![] - }) - }) - .unwrap_or_default(), - critical_error: data.critical_error, - non_critical_errors: data.non_critical_errors.map_or_else( - Default::default, - |non_critical_errors| { - serde_json::from_slice(&non_critical_errors).unwrap_or_else(|e| { - error!("Failed to deserialize job non-critical errors: {e:#?}"); - vec![] - }) - }, - ), - created_at: data.date_created.map(DateTime::into), - started_at: data.date_started.map(DateTime::into), - completed_at: data.date_completed.map(DateTime::into), - parent_id: data - .parent_id - .map(|id| JobId::from_slice(&id).expect("corrupted database")), - status: Status::try_from(maybe_missing(data.status, "job.status")?) + id: JobId::from_slice(&id).expect("corrupted database"), + name: JobName::from_str(&maybe_missing(name, "job.name")?)?, + action, + metadata: if let Some(metadata) = metadata { + serde_json::from_slice(&metadata)? + } else { + vec![] + }, + critical_error, + non_critical_errors: if let Some(non_critical_errors) = non_critical_errors { + serde_json::from_slice(&non_critical_errors)? + } else { + vec![] + }, + created_at: date_created.map(DateTime::into), + started_at: date_started.map(DateTime::into), + completed_at: date_completed.map(DateTime::into), + parent_id: parent_id.map(|id| JobId::from_slice(&id).expect("corrupted database")), + status: Status::try_from(maybe_missing(status, "job.status")?) .expect("corrupted database"), - task_count: data.task_count.unwrap_or(0), - completed_task_count: data.completed_task_count.unwrap_or(0), + task_count: task_count.unwrap_or(0), + completed_task_count: completed_task_count.unwrap_or(0), phase: String::new(), message: String::new(), - estimated_completion: data - .date_estimated_completion - .map_or_else(Utc::now, DateTime::into), + estimated_completion: date_estimated_completion.map_or_else(Utc::now, DateTime::into), }) } } @@ -178,6 +238,10 @@ impl Report { } } + pub fn push_metadata(&mut self, metadata: ReportOutputMetadata) { + self.metadata.push(metadata.into()); + } + #[must_use] pub fn get_action_name_and_group_key(&self) -> (String, Option) { // actions are formatted like "added_location" or "added_location-1" @@ -197,9 +261,11 @@ impl Report { (action_name, Some(group_key)) } - pub async fn create(&mut self, db: &PrismaClient) -> Result<(), ReportError> { - let now = Utc::now(); - + pub async fn create( + &mut self, + db: &PrismaClient, + created_at: DateTime, + ) -> Result<(), ReportError> { db.job() .create( self.id.as_bytes().to_vec(), @@ -207,11 +273,11 @@ impl Report { [ job::name::set(Some(self.name.to_string())), job::action::set(self.action.clone()), - job::date_created::set(Some(now.into())), - job::metadata::set(Some(rmp_serde::to_vec(&self.metadata)?)), + job::date_created::set(Some(created_at.into())), + job::metadata::set(Some(serde_json::to_vec(&self.metadata)?)), job::status::set(Some(self.status as i32)), job::date_started::set(self.started_at.map(Into::into)), - job::task_count::set(Some(1)), + job::task_count::set(Some(0)), job::completed_task_count::set(Some(0)), ], [self @@ -224,7 +290,7 @@ impl Report { .map_err(ReportError::Create)?; // Only setting created_at after we successfully created the job in DB - self.created_at = Some(now); + self.created_at = Some(created_at); Ok(()) } @@ -236,10 +302,10 @@ impl Report { vec![ job::status::set(Some(self.status as i32)), job::critical_error::set(self.critical_error.clone()), - job::non_critical_errors::set(Some(rmp_serde::to_vec( + job::non_critical_errors::set(Some(serde_json::to_vec( &self.non_critical_errors, )?)), - job::metadata::set(Some(rmp_serde::to_vec(&self.metadata)?)), + job::metadata::set(Some(serde_json::to_vec(&self.metadata)?)), job::task_count::set(Some(self.task_count)), job::completed_task_count::set(Some(self.completed_task_count)), job::date_started::set(self.started_at.map(Into::into)), @@ -347,7 +413,7 @@ impl ReportBuilder { #[must_use] pub fn with_metadata(mut self, metadata: ReportInputMetadata) -> Self { - self.metadata.push(ReportMetadata::Input(metadata)); + self.metadata.push(metadata.into()); self } diff --git a/core/crates/heavy-lifting/src/job_system/runner.rs b/core/crates/heavy-lifting/src/job_system/runner.rs index 0f257f259..ae067fb0b 100644 --- a/core/crates/heavy-lifting/src/job_system/runner.rs +++ b/core/crates/heavy-lifting/src/job_system/runner.rs @@ -1,4 +1,4 @@ -use crate::Error; +use crate::{Error, JobContext}; use sd_prisma::prisma::location; use sd_task_system::BaseTaskDispatcher; @@ -15,19 +15,23 @@ use std::{ use async_channel as chan; use chrono::Utc; use futures::StreamExt; -use futures_concurrency::{future::TryJoin, stream::Merge}; +use futures_concurrency::{ + future::{Join, TryJoin}, + stream::Merge, +}; +use serde_json::json; use tokio::{ fs, sync::oneshot, time::{interval_at, Instant}, }; use tokio_stream::wrappers::IntervalStream; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info, instrument, trace, warn}; use uuid::Uuid; use super::{ - job::{DynJob, JobContext, JobHandle, JobName, JobOutput, ReturnStatus}, - report, + job::{DynJob, JobHandle, JobName, JobOutput, OuterContext, ReturnStatus}, + report::{self, ReportOutputMetadata}, store::{StoredJob, StoredJobEntry}, Command, JobId, JobSystemError, SerializedTasks, }; @@ -35,61 +39,76 @@ use super::{ const JOBS_INITIAL_CAPACITY: usize = 32; const FIVE_MINUTES: Duration = Duration::from_secs(5 * 60); -pub(super) enum RunnerMessage { +pub(super) enum RunnerMessage> { NewJob { - id: JobId, + job_id: JobId, location_id: location::id::Type, - dyn_job: Box>, - job_ctx: Ctx, + dyn_job: Box>, + ctx: OuterCtx, ack_tx: oneshot::Sender>, }, ResumeStoredJob { - id: JobId, + job_id: JobId, location_id: location::id::Type, - dyn_job: Box>, - job_ctx: Ctx, + dyn_job: Box>, + ctx: OuterCtx, serialized_tasks: Option, ack_tx: oneshot::Sender>, }, Command { - id: JobId, + job_id: JobId, command: Command, ack_tx: oneshot::Sender>, }, - CheckIfJobAreRunning { + GetActiveReports { + ack_tx: oneshot::Sender>, + }, + CheckIfJobsAreRunning { job_names: Vec, location_id: location::id::Type, ack_tx: oneshot::Sender, }, Shutdown, + HasActiveJobs { + ctx_id: Uuid, + ack_tx: oneshot::Sender, + }, } -pub(super) struct JobSystemRunner { - base_dispatcher: BaseTaskDispatcher, - handles: HashMap>, +struct JobsWorktables { job_hashes: HashMap, job_hashes_by_id: HashMap, running_jobs_by_job_id: HashMap, running_jobs_set: HashSet<(JobName, location::id::Type)>, jobs_to_store_by_ctx_id: HashMap>, - job_return_status_tx: chan::Sender<(JobId, Result)>, - job_outputs_tx: chan::Sender<(JobId, Result)>, } -impl JobSystemRunner { +pub(super) struct JobSystemRunner> { + on_shutdown_mode: bool, + base_dispatcher: BaseTaskDispatcher, + handles: HashMap>, + worktables: JobsWorktables, + job_return_status_tx: chan::Sender<(JobId, Result)>, + job_outputs_tx: chan::Sender<(JobId, Result)>, +} + +impl> JobSystemRunner { pub(super) fn new( base_dispatcher: BaseTaskDispatcher, job_return_status_tx: chan::Sender<(JobId, Result)>, - job_outputs_tx: chan::Sender<(JobId, Result)>, + job_outputs_tx: chan::Sender<(JobId, Result)>, ) -> Self { Self { + on_shutdown_mode: false, base_dispatcher, handles: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), - job_hashes: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), - job_hashes_by_id: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), - running_jobs_by_job_id: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), - running_jobs_set: HashSet::with_capacity(JOBS_INITIAL_CAPACITY), - jobs_to_store_by_ctx_id: HashMap::new(), + worktables: JobsWorktables { + job_hashes: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), + job_hashes_by_id: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), + running_jobs_by_job_id: HashMap::with_capacity(JOBS_INITIAL_CAPACITY), + running_jobs_set: HashSet::with_capacity(JOBS_INITIAL_CAPACITY), + jobs_to_store_by_ctx_id: HashMap::new(), + }, job_return_status_tx, job_outputs_tx, } @@ -97,226 +116,273 @@ impl JobSystemRunner { async fn new_job( &mut self, - id: JobId, + job_id: JobId, location_id: location::id::Type, - dyn_job: Box>, - job_ctx: Ctx, + dyn_job: Box>, + ctx: OuterCtx, maybe_existing_tasks: Option, ) -> Result<(), JobSystemError> { let Self { base_dispatcher, handles, - job_hashes, - job_hashes_by_id, + worktables: + JobsWorktables { + job_hashes, + job_hashes_by_id, + running_jobs_by_job_id, + running_jobs_set, + .. + }, job_return_status_tx, - running_jobs_by_job_id, - running_jobs_set, .. } = self; - let db = job_ctx.db(); let job_name = dyn_job.job_name(); let job_hash = dyn_job.hash(); if let Some(&already_running_id) = job_hashes.get(&job_hash) { return Err(JobSystemError::AlreadyRunning { - new_id: id, + new_id: job_id, already_running_id, job_name, }); } - running_jobs_by_job_id.insert(id, (job_name, location_id)); + running_jobs_by_job_id.insert(job_id, (job_name, location_id)); running_jobs_set.insert((job_name, location_id)); - job_hashes.insert(job_hash, id); - job_hashes_by_id.insert(id, job_hash); - - let start_time = Utc::now(); + job_hashes.insert(job_hash, job_id); + job_hashes_by_id.insert(job_id, job_hash); let mut handle = if maybe_existing_tasks.is_some() { dyn_job.resume( base_dispatcher.clone(), - job_ctx.clone(), + ctx.clone(), maybe_existing_tasks, job_return_status_tx.clone(), ) } else { dyn_job.dispatch( base_dispatcher.clone(), - job_ctx.clone(), + ctx.clone(), job_return_status_tx.clone(), ) }; - handle.report.status = report::Status::Running; - if handle.report.started_at.is_none() { - handle.report.started_at = Some(start_time); - } + handle.register_start(Utc::now()).await?; - // If the report doesn't have a created_at date, it's a new report - if handle.report.created_at.is_none() { - handle.report.create(db).await?; - } else { - // Otherwise it can be a job being resumed or a children job that was already been created - handle.report.update(db).await?; - } - - // Registering children jobs - handle - .next_jobs - .iter_mut() - .map(|dyn_job| dyn_job.report_mut()) - .map(|next_job_report| async { - if next_job_report.created_at.is_none() { - next_job_report.create(job_ctx.db()).await - } else { - Ok(()) - } - }) - .collect::>() - .try_join() - .await?; - - handles.insert(id, handle); + handles.insert(job_id, handle); Ok(()) } - async fn process_command(&mut self, id: JobId, command: Command) -> Result<(), JobSystemError> { - if let Some(handle) = self.handles.get_mut(&id) { - handle.send_command(command).await?; - Ok(()) + async fn get_active_reports(&self) -> HashMap { + self.handles + .iter() + .map(|(job_id, handle)| async { (*job_id, handle.ctx.report().await.clone()) }) + .collect::>() + .join() + .await + .into_iter() + .collect() + } + + async fn process_command( + &mut self, + job_id: JobId, + command: Command, + ack_tx: oneshot::Sender>, + ) { + if let Some(handle) = self.handles.get_mut(&job_id) { + match (command, handle.is_running) { + (Command::Pause, false) => { + warn!("Tried to pause a job already paused"); + return ack_tx.send(Ok(())).expect( + "ack channel closed before sending response to already paused job", + ); + } + (Command::Resume, true) => { + warn!("Tried to resume a job already running"); + return ack_tx.send(Ok(())).expect( + "ack channel closed before sending response to already running job", + ); + } + _ => {} + } + match command { + Command::Pause | Command::Cancel | Command::Shutdown => { + handle.is_running = false; + } + Command::Resume => { + handle.is_running = true; + } + } + handle.send_command(command, ack_tx).await; + handle.ctx.invalidate_query("jobs.isActive"); + handle.ctx.invalidate_query("jobs.reports"); } else { - Err(JobSystemError::NotFound(id)) + error!("Job not found"); + ack_tx + .send(Err(JobSystemError::NotFound(job_id))) + .unwrap_or_else(|_| { + panic!("ack channel closed before sending {command:?} response") + }); } } fn is_empty(&self) -> bool { - self.handles.is_empty() && self.job_hashes.is_empty() && self.job_hashes_by_id.is_empty() + self.handles.is_empty() + && self.worktables.job_hashes.is_empty() + && self.worktables.job_hashes_by_id.is_empty() } - fn check_if_job_are_running( + fn total_jobs(&self) -> usize { + self.handles.len() + } + + fn check_if_jobs_are_running( &self, job_names: Vec, location_id: location::id::Type, ) -> bool { - job_names - .into_iter() - .any(|job_name| self.running_jobs_set.contains(&(job_name, location_id))) + job_names.into_iter().any(|job_name| { + self.worktables + .running_jobs_set + .contains(&(job_name, location_id)) + }) } - async fn process_return_status(&mut self, job_id: JobId, status: Result) { + #[instrument(skip_all, fields(%job_id))] + async fn process_return_status( + &mut self, + job_id: JobId, + status: Result, + ) -> Result<(), JobSystemError> { let Self { + on_shutdown_mode, handles, - job_hashes, - job_hashes_by_id, + worktables, job_outputs_tx, job_return_status_tx, base_dispatcher, - jobs_to_store_by_ctx_id, - running_jobs_by_job_id, - running_jobs_set, .. } = self; - let job_hash = job_hashes_by_id.remove(&job_id).expect("it must be here"); - let (job_name, location_id) = running_jobs_by_job_id + let job_hash = worktables + .job_hashes_by_id + .remove(&job_id) + .expect("it must be here"); + + let (job_name, location_id) = worktables + .running_jobs_by_job_id .remove(&job_id) .expect("a JobName and location_id must've been inserted in the map with the job id"); - assert!(running_jobs_set.remove(&(job_name, location_id))); - assert!(job_hashes.remove(&job_hash).is_some()); + assert!(worktables.running_jobs_set.remove(&(job_name, location_id))); + assert!(worktables.job_hashes.remove(&job_hash).is_some()); + let mut handle = handles.remove(&job_id).expect("it must be here"); + handle.run_time += handle.start_time.elapsed(); + + handle + .ctx + .report_mut() + .await + .push_metadata(ReportOutputMetadata::Metrics(HashMap::from([( + "job_run_time".into(), + json!(handle.run_time), + )]))); let res = match status { Ok(ReturnStatus::Completed(job_return)) => { try_dispatch_next_job( &mut handle, + location_id, base_dispatcher.clone(), - (job_hashes, job_hashes_by_id), + worktables, handles, job_return_status_tx.clone(), - ); + ) + .await?; - handle.complete_job(job_return).await + handle.complete_job(job_return).await.map_err(Into::into) } - Ok(ReturnStatus::Shutdown(Ok(Some(serialized_job)))) => { - let name = handle.report.name; + Ok(ReturnStatus::Shutdown(res)) => { + match res { + Ok(Some(serialized_job)) => { + let name = { + let db = handle.ctx.db(); + let mut report = handle.ctx.report_mut().await; + if let Err(e) = report.update(db).await { + error!(?e, "Failed to update report on job shutdown;"); + } + report.name + }; - let Ok(next_jobs) = handle - .next_jobs - .into_iter() - .map(|next_job| async move { - let next_id = next_job.id(); - let next_name = next_job.job_name(); - next_job - .serialize() - .await - .map(|maybe_serialized_job| { - maybe_serialized_job.map(|serialized_job| StoredJob { - id: next_id, - name: next_name, + worktables + .jobs_to_store_by_ctx_id + .entry(handle.ctx.id()) + .or_default() + .push(StoredJobEntry { + location_id, + root_job: StoredJob { + id: job_id, + run_time: handle.start_time.elapsed(), + name, serialized_job, - }) - }) - .map_err(|e| { - error!( - "Failed to serialize next job: \ - : {e:#?}" - ); - }) - }) - .collect::>() - .try_join() - .await - else { - return; - }; + }, + next_jobs: serialize_next_jobs_to_shutdown( + job_id, + job_name, + handle.next_jobs, + ) + .await + .unwrap_or_default(), + }); - jobs_to_store_by_ctx_id - .entry(handle.job_ctx.id()) - .or_default() - .push(StoredJobEntry { - location_id, - root_job: StoredJob { - id: job_id, - name, - serialized_job, - }, - next_jobs: next_jobs.into_iter().flatten().collect(), - }); + debug!(%name, "Job was shutdown and serialized;"); + } - return; + Ok(None) => { + debug!( + "Job was shutdown but didn't returned any serialized data, \ + probably it isn't resumable job" + ); + } + + Err(e) => { + error!(?e, "Failed to serialize job;"); + } + } + + if *on_shutdown_mode && handles.is_empty() { + // Job system is empty and in shutdown mode so we close this channel to finish the shutdown process + job_return_status_tx.close(); + } + + return Ok(()); } - Ok(ReturnStatus::Shutdown(Ok(None))) => { - debug!( - "Job was shutdown but didn't returned any serialized data, \ - probably it isn't resumable job: " - ); - return; + Ok(ReturnStatus::Canceled(job_return)) => { + handle.cancel_job(job_return).await.map_err(Into::into) } - - Ok(ReturnStatus::Shutdown(Err(e))) => { - error!("Failed to serialize job: {e:#?}"); - return; - } - - Ok(ReturnStatus::Canceled) => handle - .cancel_job() + Err(e) => handle + .failed_job(&e) .await - .and_then(|()| Err(JobSystemError::Canceled(job_id))), - - Err(e) => handle.failed_job(&e).await.and_then(|()| Err(e.into())), + .map_err(Into::into) + .and_then(|()| Err(e)), }; job_outputs_tx .send((job_id, res)) .await .expect("job outputs channel unexpectedly closed on job completion"); + + handle.ctx.invalidate_query("jobs.isActive"); + handle.ctx.invalidate_query("jobs.reports"); + + Ok(()) } fn clean_memory(&mut self) { @@ -326,28 +392,34 @@ impl JobSystemRunner { self.handles.shrink_to(JOBS_INITIAL_CAPACITY); } - if self.job_hashes.capacity() > JOBS_INITIAL_CAPACITY - && self.job_hashes.len() < JOBS_INITIAL_CAPACITY + if self.worktables.job_hashes.capacity() > JOBS_INITIAL_CAPACITY + && self.worktables.job_hashes.len() < JOBS_INITIAL_CAPACITY { - self.job_hashes.shrink_to(JOBS_INITIAL_CAPACITY); + self.worktables.job_hashes.shrink_to(JOBS_INITIAL_CAPACITY); } - if self.job_hashes_by_id.capacity() > JOBS_INITIAL_CAPACITY - && self.job_hashes_by_id.len() < JOBS_INITIAL_CAPACITY + if self.worktables.job_hashes_by_id.capacity() > JOBS_INITIAL_CAPACITY + && self.worktables.job_hashes_by_id.len() < JOBS_INITIAL_CAPACITY { - self.job_hashes_by_id.shrink_to(JOBS_INITIAL_CAPACITY); + self.worktables + .job_hashes_by_id + .shrink_to(JOBS_INITIAL_CAPACITY); } - if self.running_jobs_by_job_id.capacity() > JOBS_INITIAL_CAPACITY - && self.running_jobs_by_job_id.len() < JOBS_INITIAL_CAPACITY + if self.worktables.running_jobs_by_job_id.capacity() > JOBS_INITIAL_CAPACITY + && self.worktables.running_jobs_by_job_id.len() < JOBS_INITIAL_CAPACITY { - self.running_jobs_by_job_id.shrink_to(JOBS_INITIAL_CAPACITY); + self.worktables + .running_jobs_by_job_id + .shrink_to(JOBS_INITIAL_CAPACITY); } - if self.running_jobs_set.capacity() > JOBS_INITIAL_CAPACITY - && self.running_jobs_set.len() < JOBS_INITIAL_CAPACITY + if self.worktables.running_jobs_set.capacity() > JOBS_INITIAL_CAPACITY + && self.worktables.running_jobs_set.len() < JOBS_INITIAL_CAPACITY { - self.running_jobs_set.shrink_to(JOBS_INITIAL_CAPACITY); + self.worktables + .running_jobs_set + .shrink_to(JOBS_INITIAL_CAPACITY); } } @@ -359,9 +431,13 @@ impl JobSystemRunner { let Self { handles, - job_hashes, - job_hashes_by_id, - jobs_to_store_by_ctx_id, + worktables: + JobsWorktables { + job_hashes, + job_hashes_by_id, + jobs_to_store_by_ctx_id, + .. + }, .. } = self; @@ -382,27 +458,114 @@ impl JobSystemRunner { .await .map_err(|e| JobSystemError::StoredJobs(FileIOError::from((store_jobs_file, e)))) } + + fn has_active_jobs(&self, ctx_id: Uuid) -> bool { + self.handles + .values() + .any(|handle| handle.ctx.id() == ctx_id && handle.is_running) + } + + async fn dispatch_shutdown_command_to_jobs(&mut self) { + self.handles + .values_mut() + .map(|handle| async move { + let (tx, rx) = oneshot::channel(); + + handle.send_command(Command::Shutdown, tx).await; + + rx.await.expect("Worker failed to ack shutdown request") + }) + .collect::>() + .join() + .await + .into_iter() + .for_each(|res| { + if let Err(e) = res { + error!(?e, "Failed to shutdown job;"); + } + }); + } } -fn try_dispatch_next_job( - handle: &mut JobHandle, +#[instrument(skip(next_jobs))] +async fn serialize_next_jobs_to_shutdown>( + parent_job_id: JobId, + parent_job_name: JobName, + next_jobs: impl IntoIterator>> + Send, +) -> Option> { + next_jobs + .into_iter() + .map(|next_job| async move { + let next_id = next_job.id(); + let next_name = next_job.job_name(); + next_job + .serialize() + .await + .map(|maybe_serialized_job| { + maybe_serialized_job.map(|serialized_job| StoredJob { + id: next_id, + run_time: Duration::ZERO, + name: next_name, + serialized_job, + }) + }) + .map_err(|e| { + error!(%next_id, %next_name, ?e, "Failed to serialize next job;"); + }) + }) + .collect::>() + .try_join() + .await + .map(|maybe_serialized_next_jobs| { + maybe_serialized_next_jobs.into_iter().flatten().collect() + }) + .ok() +} + +#[instrument( + skip_all, + fields( + job_id = %handle.id, + next_jobs_count = handle.next_jobs.len(), + location_id = %location_id, + total_running_jobs = handles.len(), + ) +)] +async fn try_dispatch_next_job>( + handle: &mut JobHandle, + location_id: location::id::Type, base_dispatcher: BaseTaskDispatcher, - (job_hashes, job_hashes_by_id): (&mut HashMap, &mut HashMap), - handles: &mut HashMap>, + JobsWorktables { + job_hashes, + job_hashes_by_id, + running_jobs_by_job_id, + running_jobs_set, + .. + }: &mut JobsWorktables, + handles: &mut HashMap>, job_return_status_tx: chan::Sender<(JobId, Result)>, -) { +) -> Result<(), JobSystemError> { if let Some(next) = handle.next_jobs.pop_front() { let next_id = next.id(); let next_hash = next.hash(); + let next_name = next.job_name(); + if let Entry::Vacant(e) = job_hashes.entry(next_hash) { e.insert(next_id); + trace!(%next_id, %next_name, "Dispatching next job;"); + job_hashes_by_id.insert(next_id, next_hash); + running_jobs_by_job_id.insert(next_id, (next_name, location_id)); + running_jobs_set.insert((next_name, location_id)); + let mut next_handle = next.dispatch( base_dispatcher, - handle.job_ctx.clone(), + handle.ctx.get_outer_ctx(), job_return_status_tx, ); + next_handle.register_start(Utc::now()).await?; + assert!( next_handle.next_jobs.is_empty(), "Only the root job will have next jobs, the rest will be empty and \ @@ -413,30 +576,34 @@ fn try_dispatch_next_job( handles.insert(next_id, next_handle); } else { - warn!("Unexpectedly found a job with the same hash as the next job: ", next.job_name()); + warn!(%next_id, %next_name, "Unexpectedly found a job with the same hash as the next job;"); } + } else { + trace!("No next jobs to dispatch"); } + + Ok(()) } -pub(super) async fn run( - mut runner: JobSystemRunner, +pub(super) async fn run>( + mut runner: JobSystemRunner, store_jobs_file: impl AsRef + Send, - msgs_rx: chan::Receiver>, - job_return_status_rx: chan::Receiver<(JobId, Result)>, + msgs_rx: chan::Receiver>, + job_done_rx: chan::Receiver<(JobId, Result)>, ) { - enum StreamMessage { + enum StreamMessage> { ReturnStatus((JobId, Result)), - RunnerMessage(RunnerMessage), + RunnerMessage(RunnerMessage), CleanMemoryTick, } let memory_cleanup_interval = interval_at(Instant::now() + FIVE_MINUTES, FIVE_MINUTES); - let job_return_status_rx_to_shutdown = job_return_status_rx.clone(); + let job_return_status_rx_to_shutdown = job_done_rx.clone(); let mut msg_stream = pin!(( msgs_rx.map(StreamMessage::RunnerMessage), - job_return_status_rx.map(StreamMessage::ReturnStatus), + job_done_rx.map(StreamMessage::ReturnStatus), IntervalStream::new(memory_cleanup_interval).map(|_| StreamMessage::CleanMemoryTick), ) .merge()); @@ -445,91 +612,102 @@ pub(super) async fn run( match msg { // Job return status messages StreamMessage::ReturnStatus((job_id, status)) => { - runner.process_return_status(job_id, status).await; + if let Err(e) = runner.process_return_status(job_id, status).await { + error!(?e, "Failed to process return status;"); + } } // Runner messages StreamMessage::RunnerMessage(RunnerMessage::NewJob { - id, + job_id, location_id, dyn_job, - job_ctx, + ctx, ack_tx, }) => { ack_tx .send( runner - .new_job(id, location_id, dyn_job, job_ctx, None) + .new_job(job_id, location_id, dyn_job, ctx, None) .await, ) .expect("ack channel closed before sending new job response"); } + StreamMessage::RunnerMessage(RunnerMessage::HasActiveJobs { ctx_id, ack_tx }) => { + ack_tx + .send(runner.has_active_jobs(ctx_id)) + .expect("ack channel closed before sending has active jobs response"); + } + + StreamMessage::RunnerMessage(RunnerMessage::GetActiveReports { ack_tx }) => { + ack_tx + .send(runner.get_active_reports().await) + .expect("ack channel closed before sending active reports response"); + } StreamMessage::RunnerMessage(RunnerMessage::ResumeStoredJob { - id, + job_id, location_id, dyn_job, - job_ctx, + ctx, serialized_tasks, ack_tx, }) => { ack_tx .send( runner - .new_job(id, location_id, dyn_job, job_ctx, serialized_tasks) + .new_job(job_id, location_id, dyn_job, ctx, serialized_tasks) .await, ) .expect("ack channel closed before sending resume job response"); } StreamMessage::RunnerMessage(RunnerMessage::Command { - id, + job_id: id, command, ack_tx, - }) => { - ack_tx - .send(runner.process_command(id, command).await) - .unwrap_or_else(|_| { - panic!("ack channel closed before sending {command:?} response") - }); - } + }) => runner.process_command(id, command, ack_tx).await, StreamMessage::RunnerMessage(RunnerMessage::Shutdown) => { + runner.on_shutdown_mode = true; // Consuming all pending return status messages - loop { - while let Ok((job_id, status)) = job_return_status_rx_to_shutdown.try_recv() { - runner.process_return_status(job_id, status).await; + if !runner.is_empty() { + let mut job_return_status_stream = pin!(job_return_status_rx_to_shutdown); + + runner.dispatch_shutdown_command_to_jobs().await; + + debug!( + total_jobs = runner.total_jobs(), + "Waiting for jobs to shutdown before shutting down the job system...;", + ); + + while let Some((job_id, status)) = job_return_status_stream.next().await { + if let Err(e) = runner.process_return_status(job_id, status).await { + error!(?e, "Failed to process return status before shutting down;"); + } } - if runner.is_empty() { - break; + // Now the runner can shutdown + if let Err(e) = runner.save_jobs(store_jobs_file).await { + error!(?e, "Failed to save jobs before shutting down;"); } - - debug!("Waiting for all jobs to complete before shutting down..."); - } - - // Now the runner can shutdown - if let Err(e) = runner.save_jobs(store_jobs_file).await { - error!("Failed to save jobs before shutting down: {e:#?}"); } return; } - StreamMessage::RunnerMessage(RunnerMessage::CheckIfJobAreRunning { + StreamMessage::RunnerMessage(RunnerMessage::CheckIfJobsAreRunning { job_names, location_id, ack_tx, }) => { ack_tx - .send(runner.check_if_job_are_running(job_names, location_id)) + .send(runner.check_if_jobs_are_running(job_names, location_id)) .expect("ack channel closed before sending resume job response"); } // Memory cleanup tick - StreamMessage::CleanMemoryTick => { - runner.clean_memory(); - } + StreamMessage::CleanMemoryTick => runner.clean_memory(), } } } diff --git a/core/crates/heavy-lifting/src/job_system/store.rs b/core/crates/heavy-lifting/src/job_system/store.rs index 93728030c..74058708a 100644 --- a/core/crates/heavy-lifting/src/job_system/store.rs +++ b/core/crates/heavy-lifting/src/job_system/store.rs @@ -1,4 +1,4 @@ -use crate::indexer::IndexerJob; +use crate::{file_identifier, indexer, media_processor, JobContext}; use sd_prisma::prisma::{job, location}; use sd_utils::uuid_to_bytes; @@ -8,21 +8,24 @@ use std::{ future::Future, iter, marker::PhantomData, + time::Duration, }; use futures_concurrency::future::TryJoin; use serde::{Deserialize, Serialize}; use super::{ - job::{DynJob, Job, JobContext, JobHolder, JobName}, + job::{DynJob, Job, JobHolder, JobName, OuterContext}, report::{Report, ReportError}, JobId, JobSystemError, }; #[derive(Debug, Serialize, Deserialize)] +#[repr(transparent)] +#[serde(transparent)] pub struct SerializedTasks(pub Vec); -pub trait SerializableJob: 'static +pub trait SerializableJob: 'static where Self: Sized, { @@ -35,7 +38,7 @@ where #[allow(unused_variables)] fn deserialize( serialized_job: &[u8], - ctx: &impl JobContext, + ctx: &OuterCtx, ) -> impl Future< Output = Result)>, rmp_serde::decode::Error>, > + Send { @@ -47,6 +50,7 @@ where pub struct StoredJob { pub(super) id: JobId, pub(super) name: JobName, + pub(super) run_time: Duration, pub(super) serialized_job: Vec, } @@ -57,18 +61,18 @@ pub struct StoredJobEntry { pub(super) next_jobs: Vec, } -pub async fn load_jobs( +pub async fn load_jobs>( entries: Vec, - job_ctx: &Ctx, + ctx: &OuterCtx, ) -> Result< Vec<( location::id::Type, - Box>, + Box>, Option, )>, JobSystemError, > { - let mut reports = job_ctx + let mut reports = ctx .db() .job() .find_many(vec![job::id::in_vec( @@ -81,7 +85,7 @@ pub async fn load_jobs( .. }| { iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id)) }, ) - .map(uuid_to_bytes) + .map(|job_id| uuid_to_bytes(&job_id)) .collect::>(), )]) .exec() @@ -105,7 +109,7 @@ pub async fn load_jobs( .ok_or(ReportError::MissingReport(root_job.id))?; Ok(async move { - load_job(root_job, report, job_ctx) + load_job(root_job, report, ctx) .await .map(|maybe_loaded_job| { maybe_loaded_job @@ -135,7 +139,7 @@ pub async fn load_jobs( next_jobs_and_reports .into_iter() .map(|(next_job, report)| async move { - load_job(next_job, report, job_ctx) + load_job(next_job, report, ctx) .await .map(|maybe_loaded_next_job| { maybe_loaded_next_job.map(|(next_dyn_job, next_tasks)| { @@ -166,54 +170,63 @@ pub async fn load_jobs( } macro_rules! match_deserialize_job { - ($stored_job:ident, $report:ident, $job_ctx:ident, $ctx_type:ty, [$($job_type:ty),+ $(,)?]) => {{ + ($stored_job:ident, $report:ident, $outer_ctx:ident, $outer_ctx_type:ty, $job_ctx_type:ty, [$($job_type:ty),+ $(,)?]) => {{ let StoredJob { id, name, + run_time, serialized_job, } = $stored_job; match name { - $(<$job_type as Job>::NAME => <$job_type as SerializableJob>::deserialize( + $(<$job_type as Job>::NAME => <$job_type as SerializableJob<$outer_ctx_type>>::deserialize( &serialized_job, - $job_ctx, + $outer_ctx, ).await - .map(|maybe_job| maybe_job.map(|(job, tasks)| -> ( - Box>, + .map(|maybe_job| maybe_job.map(|(job, maybe_tasks)| -> ( + Box>, Option ) { ( Box::new(JobHolder { id, job, + run_time, report: $report, next_jobs: VecDeque::new(), _ctx: PhantomData, }), - tasks, + maybe_tasks.and_then( + |tasks| (!tasks.0.is_empty()).then_some(tasks) + ), ) } )) .map_err(Into::into),)+ + + // TODO(fogodev): this is temporary until we can get rid of the old job system + _ => unimplemented!("Job not implemented"), } }}; } -async fn load_job( +async fn load_job>( stored_job: StoredJob, report: Report, - job_ctx: &Ctx, -) -> Result>, Option)>, JobSystemError> { + ctx: &OuterCtx, +) -> Result>, Option)>, JobSystemError> { match_deserialize_job!( stored_job, report, - job_ctx, - Ctx, + ctx, + OuterCtx, + JobCtx, [ - IndexerJob, + indexer::job::Indexer, + file_identifier::job::FileIdentifier, + media_processor::job::MediaProcessor, // TODO: Add more jobs here - // e.g.: FileIdentifierJob, MediaProcessorJob, etc., ] ) } diff --git a/core/crates/heavy-lifting/src/job_system/utils.rs b/core/crates/heavy-lifting/src/job_system/utils.rs index afa8ce56f..8ac0070c4 100644 --- a/core/crates/heavy-lifting/src/job_system/utils.rs +++ b/core/crates/heavy-lifting/src/job_system/utils.rs @@ -1,16 +1,35 @@ use crate::Error; -use sd_task_system::TaskHandle; +use sd_task_system::{TaskHandle, TaskStatus}; +use futures::{stream::FuturesUnordered, StreamExt}; use futures_concurrency::future::Join; +use tracing::{error, trace}; -pub async fn cancel_pending_tasks( - pending_tasks: impl IntoIterator> + Send, -) { +pub async fn cancel_pending_tasks(pending_tasks: &mut FuturesUnordered>) { pending_tasks - .into_iter() + .iter() .map(TaskHandle::cancel) .collect::>() .join() .await; + + trace!(total_tasks = %pending_tasks.len(), "canceled all pending tasks, now waiting completion"); + + while let Some(task_result) = pending_tasks.next().await { + match task_result { + Ok(TaskStatus::Done((task_id, _))) => trace!( + %task_id, + "tasks cancellation received a completed task;", + ), + + Ok(TaskStatus::Canceled | TaskStatus::ForcedAbortion | TaskStatus::Shutdown(_)) => { + // Job canceled task + } + + Ok(TaskStatus::Error(e)) => error!(%e, "job canceled an errored task;"), + + Err(e) => error!(%e, "task system failed to cancel a task;"), + } + } } diff --git a/core/crates/heavy-lifting/src/lib.rs b/core/crates/heavy-lifting/src/lib.rs index 3675cdedb..c137584e7 100644 --- a/core/crates/heavy-lifting/src/lib.rs +++ b/core/crates/heavy-lifting/src/lib.rs @@ -1,3 +1,4 @@ +#![recursion_limit = "256"] #![warn( clippy::all, clippy::pedantic, @@ -27,45 +28,87 @@ #![forbid(deprecated_in_future)] #![allow(clippy::missing_errors_doc, clippy::module_name_repetitions)] +use sd_prisma::prisma::file_path; use sd_task_system::TaskSystemError; use serde::{Deserialize, Serialize}; use specta::Type; use thiserror::Error; +pub mod file_identifier; pub mod indexer; pub mod job_system; +pub mod media_processor; +pub mod utils; -use indexer::{IndexerError, NonCriticalIndexerError}; +use media_processor::ThumbKey; pub use job_system::{ - job::{IntoJob, JobBuilder, JobContext, JobName, JobOutput, JobOutputData, ProgressUpdate}, - JobId, JobSystem, + job::{ + IntoJob, JobContext, JobEnqueuer, JobName, JobOutput, JobOutputData, OuterContext, + ProgressUpdate, + }, + report::Report, + JobId, JobSystem, JobSystemError, }; #[derive(Error, Debug)] pub enum Error { #[error(transparent)] - Indexer(#[from] IndexerError), + Indexer(#[from] indexer::Error), + #[error(transparent)] + FileIdentifier(#[from] file_identifier::Error), + #[error(transparent)] + MediaProcessor(#[from] media_processor::Error), #[error(transparent)] TaskSystem(#[from] TaskSystemError), + + #[error(transparent)] + JobSystem(#[from] JobSystemError), } impl From for rspc::Error { fn from(e: Error) -> Self { match e { Error::Indexer(e) => e.into(), + Error::FileIdentifier(e) => e.into(), + Error::MediaProcessor(e) => e.into(), Error::TaskSystem(e) => { Self::with_cause(rspc::ErrorCode::InternalServerError, e.to_string(), e) } + Error::JobSystem(e) => e.into(), } } } -#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type)] -pub enum NonCriticalJobError { +#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] +pub enum NonCriticalError { // TODO: Add variants as needed #[error(transparent)] - Indexer(#[from] NonCriticalIndexerError), + Indexer(#[from] indexer::NonCriticalIndexerError), + #[error(transparent)] + FileIdentifier(#[from] file_identifier::NonCriticalFileIdentifierError), + #[error(transparent)] + MediaProcessor(#[from] media_processor::NonCriticalMediaProcessorError), +} + +#[repr(i32)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type, Eq, PartialEq)] +pub enum LocationScanState { + Pending = 0, + Indexed = 1, + FilesIdentified = 2, + Completed = 3, +} + +#[derive(Debug, Serialize, Type)] +pub enum UpdateEvent { + NewThumbnail { + thumb_key: ThumbKey, + }, + NewIdentifiedObjects { + file_path_ids: Vec, + }, } diff --git a/core/crates/heavy-lifting/src/media_processor/helpers/exif_media_data.rs b/core/crates/heavy-lifting/src/media_processor/helpers/exif_media_data.rs new file mode 100644 index 000000000..82b722753 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/helpers/exif_media_data.rs @@ -0,0 +1,165 @@ +use crate::media_processor::{self, media_data_extractor}; + +use sd_core_prisma_helpers::ObjectPubId; +use sd_core_sync::Manager as SyncManager; + +use sd_file_ext::extensions::{Extension, ImageExtension, ALL_IMAGE_EXTENSIONS}; +use sd_media_metadata::ExifMetadata; +use sd_prisma::{ + prisma::{exif_data, object, PrismaClient}, + prisma_sync, +}; +use sd_sync::{option_sync_db_entry, OperationFactory}; +use sd_utils::chain_optional_iter; + +use std::path::Path; + +use futures_concurrency::future::TryJoin; +use once_cell::sync::Lazy; +use prisma_client_rust::QueryError; + +use super::from_slice_option_to_option; + +pub static AVAILABLE_EXTENSIONS: Lazy> = Lazy::new(|| { + ALL_IMAGE_EXTENSIONS + .iter() + .copied() + .filter(|&ext| can_extract(ext)) + .map(Extension::Image) + .collect() +}); + +#[must_use] +pub const fn can_extract(image_extension: ImageExtension) -> bool { + use ImageExtension::{ + Avci, Avcs, Avif, Dng, Heic, Heif, Heifs, Hif, Jpeg, Jpg, Png, Tiff, Webp, + }; + matches!( + image_extension, + Tiff | Dng | Jpeg | Jpg | Heif | Heifs | Heic | Avif | Avcs | Avci | Hif | Png | Webp + ) +} + +#[must_use] +fn to_query( + ExifMetadata { + resolution, + date_taken, + location, + camera_data, + artist, + description, + copyright, + exif_version, + }: ExifMetadata, + object_id: exif_data::object_id::Type, +) -> (Vec<(&'static str, rmpv::Value)>, exif_data::Create) { + let (sync_params, db_params) = chain_optional_iter( + [], + [ + option_sync_db_entry!( + serde_json::to_vec(&camera_data).ok(), + exif_data::camera_data + ), + option_sync_db_entry!(serde_json::to_vec(&date_taken).ok(), exif_data::media_date), + option_sync_db_entry!(serde_json::to_vec(&resolution).ok(), exif_data::resolution), + option_sync_db_entry!( + serde_json::to_vec(&location).ok(), + exif_data::media_location + ), + option_sync_db_entry!(artist, exif_data::artist), + option_sync_db_entry!(description, exif_data::description), + option_sync_db_entry!(copyright, exif_data::copyright), + option_sync_db_entry!(exif_version, exif_data::exif_version), + option_sync_db_entry!( + date_taken.map(|x| x.unix_timestamp()), + exif_data::epoch_time + ), + ], + ) + .into_iter() + .unzip(); + + ( + sync_params, + exif_data::Create { + object: object::id::equals(object_id), + _params: db_params, + }, + ) +} + +pub async fn extract( + path: impl AsRef + Send, +) -> Result, media_processor::NonCriticalMediaProcessorError> { + let path = path.as_ref(); + + ExifMetadata::from_path(&path).await.map_err(|e| { + media_data_extractor::NonCriticalMediaDataExtractorError::FailedToExtractImageMediaData( + path.to_path_buf(), + e.to_string(), + ) + .into() + }) +} + +pub async fn save( + exif_datas: impl IntoIterator + Send, + db: &PrismaClient, + sync: &SyncManager, +) -> Result { + exif_datas + .into_iter() + .map(|(exif_data, object_id, object_pub_id)| async move { + let (sync_params, create) = to_query(exif_data, object_id); + let db_params = create._params.clone(); + + sync.write_ops( + db, + ( + sync.shared_create( + prisma_sync::exif_data::SyncId { + object: prisma_sync::object::SyncId { + pub_id: object_pub_id.into(), + }, + }, + sync_params, + ), + db.exif_data() + .upsert(exif_data::object_id::equals(object_id), create, db_params) + .select(exif_data::select!({ id })), + ), + ) + .await + }) + .collect::>() + .try_join() + .await + .map(|created_vec| created_vec.len() as u64) +} + +#[must_use] +pub fn from_prisma_data( + exif_data::Data { + resolution, + media_date, + media_location, + camera_data, + artist, + description, + copyright, + exif_version, + .. + }: exif_data::Data, +) -> ExifMetadata { + ExifMetadata { + camera_data: from_slice_option_to_option(camera_data).unwrap_or_default(), + date_taken: from_slice_option_to_option(media_date).unwrap_or_default(), + resolution: from_slice_option_to_option(resolution).unwrap_or_default(), + location: from_slice_option_to_option(media_location), + artist, + description, + copyright, + exif_version, + } +} diff --git a/core/crates/heavy-lifting/src/media_processor/helpers/ffmpeg_media_data.rs b/core/crates/heavy-lifting/src/media_processor/helpers/ffmpeg_media_data.rs new file mode 100644 index 000000000..82c932490 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/helpers/ffmpeg_media_data.rs @@ -0,0 +1,784 @@ +use crate::media_processor::{self, media_data_extractor}; + +use sd_core_prisma_helpers::object_with_media_data; + +use sd_file_ext::extensions::{ + AudioExtension, Extension, VideoExtension, ALL_AUDIO_EXTENSIONS, ALL_VIDEO_EXTENSIONS, +}; +use sd_media_metadata::{ + ffmpeg::{ + audio_props::AudioProps, + chapter::Chapter, + codec::{Codec, Props}, + metadata::Metadata, + program::Program, + stream::Stream, + video_props::VideoProps, + }, + FFmpegMetadata, +}; +use sd_prisma::prisma::{ + ffmpeg_data, ffmpeg_media_audio_props, ffmpeg_media_chapter, ffmpeg_media_codec, + ffmpeg_media_program, ffmpeg_media_stream, ffmpeg_media_video_props, object, PrismaClient, +}; +use sd_utils::{ + db::{ffmpeg_data_field_from_db, ffmpeg_data_field_to_db}, + i64_to_frontend, +}; + +use std::{collections::HashMap, path::Path}; + +use futures_concurrency::future::TryJoin; +use once_cell::sync::Lazy; +use prisma_client_rust::QueryError; +use tracing::error; + +use super::from_slice_option_to_option; + +pub static AVAILABLE_EXTENSIONS: Lazy> = Lazy::new(|| { + ALL_AUDIO_EXTENSIONS + .iter() + .copied() + .filter(|&ext| can_extract_for_audio(ext)) + .map(Extension::Audio) + .chain( + ALL_VIDEO_EXTENSIONS + .iter() + .copied() + .filter(|&ext| can_extract_for_video(ext)) + .map(Extension::Video), + ) + .collect() +}); + +#[must_use] +pub const fn can_extract_for_audio(audio_extension: AudioExtension) -> bool { + use AudioExtension::{ + Aac, Adts, Aif, Aiff, Amr, Aptx, Ast, Caf, Flac, Loas, M4a, Mid, Mp2, Mp3, Oga, Ogg, Opus, + Tta, Voc, Wav, Wma, Wv, + }; + + matches!( + audio_extension, + Mp3 | Mp2 + | M4a | Wav | Aiff + | Aif | Flac | Ogg + | Oga | Opus | Wma + | Amr | Aac | Wv + | Voc | Tta | Loas + | Caf | Aptx | Adts + | Ast | Mid + ) +} + +#[must_use] +pub const fn can_extract_for_video(video_extension: VideoExtension) -> bool { + use VideoExtension::{ + Asf, Avi, Avifs, F4v, Flv, Hevc, M2ts, M2v, M4v, Mjpeg, Mkv, Mov, Mp4, Mpe, Mpeg, Mpg, Mxf, + Ogv, Qt, Swf, Vob, Webm, Wm, Wmv, Wtv, _3gp, + }; + + matches!( + video_extension, + Avi | Avifs + | Qt | Mov | Swf + | Mjpeg | Mpeg + | Mxf | M2v | Mpg + | Mpe | M2ts | Flv + | Wm | _3gp | M4v + | Wmv | Asf | Mp4 + | Webm | Mkv | Vob + | Ogv | Wtv | Hevc + | F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension + ) +} + +pub async fn extract( + path: impl AsRef + Send, +) -> Result { + let path = path.as_ref(); + + FFmpegMetadata::from_path(&path).await.map_err(|e| { + media_data_extractor::NonCriticalMediaDataExtractorError::FailedToExtractImageMediaData( + path.to_path_buf(), + e.to_string(), + ) + .into() + }) +} + +pub async fn save( + ffmpeg_datas: impl IntoIterator + Send, + db: &PrismaClient, +) -> Result { + ffmpeg_datas + .into_iter() + .map( + move |( + FFmpegMetadata { + formats, + duration, + start_time, + bit_rate, + chapters, + programs, + metadata, + }, + object_id, + )| { + db._transaction() + .with_timeout(30 * 1000) + .run(move |db| async move { + let data_id = create_ffmpeg_data( + formats, bit_rate, duration, start_time, metadata, object_id, &db, + ) + .await?; + + create_ffmpeg_chapters(data_id, chapters, &db).await?; + + let streams = create_ffmpeg_programs(data_id, programs, &db).await?; + + let codecs = create_ffmpeg_streams(data_id, streams, &db).await?; + + let (audio_props, video_props) = + create_ffmpeg_codecs(data_id, codecs, &db).await?; + + ( + create_ffmpeg_audio_props(audio_props, &db), + create_ffmpeg_video_props(video_props, &db), + ) + .try_join() + .await + .map(|_| ()) + }) + }, + ) + .collect::>() + .try_join() + .await + .map(|created| created.len() as u64) + .map_err(Into::into) +} + +async fn create_ffmpeg_data( + formats: Vec, + (bit_rate_high, bit_rate_low): (i32, u32), + maybe_duration: Option<(i32, u32)>, + maybe_start_time: Option<(i32, u32)>, + metadata: Metadata, + object_id: i32, + db: &PrismaClient, +) -> Result { + db.ffmpeg_data() + .create( + formats.join(","), + ffmpeg_data_field_to_db(i64::from(bit_rate_high) << 32 | i64::from(bit_rate_low)), + object::id::equals(object_id), + vec![ + ffmpeg_data::duration::set(maybe_duration.map(|(duration_high, duration_low)| { + ffmpeg_data_field_to_db( + i64::from(duration_high) << 32 | i64::from(duration_low), + ) + })), + ffmpeg_data::start_time::set(maybe_start_time.map( + |(start_time_high, start_time_low)| { + ffmpeg_data_field_to_db( + i64::from(start_time_high) << 32 | i64::from(start_time_low), + ) + }, + )), + ffmpeg_data::metadata::set( + serde_json::to_vec(&metadata) + .map_err(|e| { + error!(?e, "Error reading FFmpegData metadata;"); + e + }) + .ok(), + ), + ], + ) + .select(ffmpeg_data::select!({ id })) + .exec() + .await + .map(|data| data.id) +} + +async fn create_ffmpeg_chapters( + ffmpeg_data_id: ffmpeg_data::id::Type, + chapters: Vec, + db: &PrismaClient, +) -> Result<(), QueryError> { + db.ffmpeg_media_chapter() + .create_many( + chapters + .into_iter() + .map( + |Chapter { + id: chapter_id, + start: (start_high, start_low), + end: (end_high, end_low), + time_base_den, + time_base_num, + metadata, + }| ffmpeg_media_chapter::CreateUnchecked { + chapter_id, + start: ffmpeg_data_field_to_db( + i64::from(start_high) << 32 | i64::from(start_low), + ), + end: ffmpeg_data_field_to_db( + i64::from(end_high) << 32 | i64::from(end_low), + ), + time_base_den, + time_base_num, + ffmpeg_data_id, + _params: vec![ffmpeg_media_chapter::metadata::set( + serde_json::to_vec(&metadata) + .map_err(|e| { + error!(?e, "Error reading FFmpegMediaChapter metadata;"); + e + }) + .ok(), + )], + }, + ) + .collect(), + ) + .exec() + .await + .map(|_| ()) +} + +async fn create_ffmpeg_programs( + data_id: i32, + programs: Vec, + db: &PrismaClient, +) -> Result)>, QueryError> { + let (creates, streams_by_program_id) = programs + .into_iter() + .map( + |Program { + id: program_id, + name, + metadata, + streams, + }| { + ( + ffmpeg_media_program::CreateUnchecked { + program_id, + ffmpeg_data_id: data_id, + _params: vec![ + ffmpeg_media_program::name::set(name), + ffmpeg_media_program::metadata::set( + serde_json::to_vec(&metadata) + .map_err(|e| { + error!(?e, "Error reading FFmpegMediaProgram metadata;"); + e + }) + .ok(), + ), + ], + }, + (program_id, streams), + ) + }, + ) + .unzip::<_, _, Vec<_>, Vec<_>>(); + + db.ffmpeg_media_program() + .create_many(creates) + .exec() + .await + .map(|_| streams_by_program_id) +} + +async fn create_ffmpeg_streams( + ffmpeg_data_id: ffmpeg_data::id::Type, + streams: Vec<(ffmpeg_media_program::program_id::Type, Vec)>, + db: &PrismaClient, +) -> Result< + Vec<( + ffmpeg_media_program::program_id::Type, + ffmpeg_media_stream::stream_id::Type, + Codec, + )>, + QueryError, +> { + let (creates, maybe_codecs) = streams + .into_iter() + .flat_map(|(program_id, streams)| { + streams.into_iter().map( + move |Stream { + id: stream_id, + name, + codec: maybe_codec, + aspect_ratio_num, + aspect_ratio_den, + frames_per_second_num, + frames_per_second_den, + time_base_real_den, + time_base_real_num, + dispositions, + metadata, + }| { + ( + ffmpeg_media_stream::CreateUnchecked { + stream_id, + aspect_ratio_num, + aspect_ratio_den, + frames_per_second_num, + frames_per_second_den, + time_base_real_den, + time_base_real_num, + program_id, + ffmpeg_data_id, + _params: vec![ + ffmpeg_media_stream::name::set(name), + ffmpeg_media_stream::dispositions::set( + (!dispositions.is_empty()).then_some(dispositions.join(",")), + ), + ffmpeg_media_stream::title::set(metadata.title.clone()), + ffmpeg_media_stream::encoder::set(metadata.encoder.clone()), + ffmpeg_media_stream::language::set(metadata.language.clone()), + ffmpeg_media_stream::metadata::set( + serde_json::to_vec(&metadata) + .map_err(|e| { + error!(?e, "Error reading FFmpegMediaStream metadata;"); + e + }) + .ok(), + ), + ], + }, + maybe_codec.map(|codec| (program_id, stream_id, codec)), + ) + }, + ) + }) + .unzip::<_, _, Vec<_>, Vec<_>>(); + + db.ffmpeg_media_stream() + .create_many(creates) + .exec() + .await + .map(|_| maybe_codecs.into_iter().flatten().collect()) +} + +async fn create_ffmpeg_codecs( + ffmpeg_data_id: ffmpeg_data::id::Type, + codecs: Vec<( + ffmpeg_media_program::program_id::Type, + ffmpeg_media_stream::stream_id::Type, + Codec, + )>, + db: &PrismaClient, +) -> Result< + ( + Vec<(ffmpeg_media_codec::id::Type, AudioProps)>, + Vec<(ffmpeg_media_codec::id::Type, VideoProps)>, + ), + QueryError, +> { + let expected_creates = codecs.len(); + + let (creates, mut audio_props, mut video_props) = codecs.into_iter().enumerate().fold( + ( + Vec::with_capacity(expected_creates), + HashMap::with_capacity(expected_creates), + HashMap::with_capacity(expected_creates), + ), + |(mut creates, mut audio_props, mut video_props), + ( + idx, + ( + program_id, + stream_id, + Codec { + kind, + sub_kind, + tag, + name, + profile, + bit_rate, + props: maybe_props, + }, + ), + )| { + creates.push(ffmpeg_media_codec::CreateUnchecked { + bit_rate, + stream_id, + program_id, + ffmpeg_data_id, + _params: vec![ + ffmpeg_media_codec::kind::set(kind), + ffmpeg_media_codec::sub_kind::set(sub_kind), + ffmpeg_media_codec::tag::set(tag), + ffmpeg_media_codec::name::set(name), + ffmpeg_media_codec::profile::set(profile), + ], + }); + + if let Some(props) = maybe_props { + match props { + Props::Audio(props) => { + audio_props.insert(idx, props); + } + Props::Video(props) => { + video_props.insert(idx, props); + } + Props::Subtitle(_) => { + // We don't care about subtitles props for now :D + } + } + } + + (creates, audio_props, video_props) + }, + ); + + let created_ids = creates + .into_iter() + .map( + |ffmpeg_media_codec::CreateUnchecked { + bit_rate, + stream_id, + program_id, + ffmpeg_data_id, + _params: params, + }| { + db.ffmpeg_media_codec() + .create_unchecked(bit_rate, stream_id, program_id, ffmpeg_data_id, params) + .select(ffmpeg_media_codec::select!({ id })) + .exec() + }, + ) + .collect::>() + .try_join() + .await?; + + assert_eq!( + created_ids.len(), + expected_creates, + "Not all codecs were created and our invariant is broken!" + ); + + debug_assert!( + created_ids + .windows(2) + .all(|window| window[0].id < window[1].id), + "Codecs were created in a different order than we expected, our invariant is broken!" + ); + + Ok(created_ids.into_iter().enumerate().fold( + ( + Vec::with_capacity(audio_props.len()), + Vec::with_capacity(video_props.len()), + ), + |(mut a_props, mut v_props), (idx, codec_data)| { + if let Some(audio_props) = audio_props.remove(&idx) { + a_props.push((codec_data.id, audio_props)); + } else if let Some(video_props) = video_props.remove(&idx) { + v_props.push((codec_data.id, video_props)); + } + + (a_props, v_props) + }, + )) +} + +async fn create_ffmpeg_audio_props( + audio_props: Vec<(ffmpeg_media_codec::id::Type, AudioProps)>, + db: &PrismaClient, +) -> Result<(), QueryError> { + db.ffmpeg_media_audio_props() + .create_many( + audio_props + .into_iter() + .map( + |( + codec_id, + AudioProps { + delay, + padding, + sample_rate, + sample_format, + bit_per_sample, + channel_layout, + }, + )| ffmpeg_media_audio_props::CreateUnchecked { + delay, + padding, + codec_id, + _params: vec![ + ffmpeg_media_audio_props::sample_rate::set(sample_rate), + ffmpeg_media_audio_props::sample_format::set(sample_format), + ffmpeg_media_audio_props::bit_per_sample::set(bit_per_sample), + ffmpeg_media_audio_props::channel_layout::set(channel_layout), + ], + }, + ) + .collect(), + ) + .exec() + .await + .map(|_| ()) +} + +async fn create_ffmpeg_video_props( + video_props: Vec<(ffmpeg_media_codec::id::Type, VideoProps)>, + db: &PrismaClient, +) -> Result<(), QueryError> { + db.ffmpeg_media_video_props() + .create_many( + video_props + .into_iter() + .map( + |( + codec_id, + VideoProps { + pixel_format, + color_range, + bits_per_channel, + color_space, + color_primaries, + color_transfer, + field_order, + chroma_location, + width, + height, + aspect_ratio_num, + aspect_ratio_den, + properties, + }, + )| { + ffmpeg_media_video_props::CreateUnchecked { + width, + height, + codec_id, + _params: vec![ + ffmpeg_media_video_props::pixel_format::set(pixel_format), + ffmpeg_media_video_props::color_range::set(color_range), + ffmpeg_media_video_props::bits_per_channel::set(bits_per_channel), + ffmpeg_media_video_props::color_space::set(color_space), + ffmpeg_media_video_props::color_primaries::set(color_primaries), + ffmpeg_media_video_props::color_transfer::set(color_transfer), + ffmpeg_media_video_props::field_order::set(field_order), + ffmpeg_media_video_props::chroma_location::set(chroma_location), + ffmpeg_media_video_props::aspect_ratio_num::set(aspect_ratio_num), + ffmpeg_media_video_props::aspect_ratio_den::set(aspect_ratio_den), + ffmpeg_media_video_props::properties::set(Some( + properties.join(","), + )), + ], + } + }, + ) + .collect(), + ) + .exec() + .await + .map(|_| ()) +} + +pub fn from_prisma_data( + object_with_media_data::ffmpeg_data::Data { + formats, + duration, + start_time, + bit_rate, + metadata, + chapters, + programs, + .. + }: object_with_media_data::ffmpeg_data::Data, +) -> FFmpegMetadata { + FFmpegMetadata { + formats: formats.split(',').map(String::from).collect::>(), + duration: duration.map(|duration| i64_to_frontend(ffmpeg_data_field_from_db(&duration))), + start_time: start_time + .map(|start_time| i64_to_frontend(ffmpeg_data_field_from_db(&start_time))), + bit_rate: i64_to_frontend(ffmpeg_data_field_from_db(&bit_rate)), + chapters: chapters_from_prisma_data(chapters), + programs: programs_from_prisma_data(programs), + metadata: from_slice_option_to_option(metadata).unwrap_or_default(), + } +} + +#[inline] +fn chapters_from_prisma_data(chapters: Vec) -> Vec { + chapters + .into_iter() + .map( + |ffmpeg_media_chapter::Data { + chapter_id, + start, + end, + time_base_den, + time_base_num, + metadata, + .. + }| Chapter { + id: chapter_id, + start: i64_to_frontend(ffmpeg_data_field_from_db(&start)), + end: i64_to_frontend(ffmpeg_data_field_from_db(&end)), + time_base_den, + time_base_num, + metadata: from_slice_option_to_option(metadata).unwrap_or_default(), + }, + ) + .collect() +} + +#[inline] +fn programs_from_prisma_data( + programs: Vec, +) -> Vec { + programs + .into_iter() + .map( + |object_with_media_data::ffmpeg_data::programs::Data { + program_id, + name, + metadata, + streams, + .. + }| Program { + id: program_id, + name, + streams: streams_from_prisma_data(streams), + metadata: from_slice_option_to_option(metadata).unwrap_or_default(), + }, + ) + .collect() +} + +fn streams_from_prisma_data( + streams: Vec, +) -> Vec { + streams + .into_iter() + .map( + |object_with_media_data::ffmpeg_data::programs::streams::Data { + stream_id, + name, + aspect_ratio_num, + aspect_ratio_den, + frames_per_second_num, + frames_per_second_den, + time_base_real_den, + time_base_real_num, + dispositions, + metadata, + codec, + .. + }| { + Stream { + id: stream_id, + name, + codec: codec_from_prisma_data(codec), + aspect_ratio_num, + aspect_ratio_den, + frames_per_second_num, + frames_per_second_den, + time_base_real_den, + time_base_real_num, + dispositions: dispositions + .map(|dispositions| { + dispositions + .split(',') + .map(String::from) + .collect::>() + }) + .unwrap_or_default(), + metadata: from_slice_option_to_option(metadata).unwrap_or_default(), + } + }, + ) + .collect() +} + +fn codec_from_prisma_data( + codec: Option, +) -> Option { + codec.map( + |object_with_media_data::ffmpeg_data::programs::streams::codec::Data { + kind, + sub_kind, + tag, + name, + profile, + bit_rate, + audio_props, + video_props, + .. + }| Codec { + kind, + sub_kind, + tag, + name, + profile, + bit_rate, + props: match (audio_props, video_props) { + ( + Some(ffmpeg_media_audio_props::Data { + delay, + padding, + sample_rate, + sample_format, + bit_per_sample, + channel_layout, + .. + }), + None, + ) => Some(Props::Audio(AudioProps { + delay, + padding, + sample_rate, + sample_format, + bit_per_sample, + channel_layout, + })), + ( + None, + Some(ffmpeg_media_video_props::Data { + pixel_format, + color_range, + bits_per_channel, + color_space, + color_primaries, + color_transfer, + field_order, + chroma_location, + width, + height, + aspect_ratio_num, + aspect_ratio_den, + properties, + .. + }), + ) => Some(Props::Video(VideoProps { + pixel_format, + color_range, + bits_per_channel, + color_space, + color_primaries, + color_transfer, + field_order, + chroma_location, + width, + height, + aspect_ratio_num, + aspect_ratio_den, + properties: properties + .map(|dispositions| { + dispositions + .split(',') + .map(String::from) + .collect::>() + }) + .unwrap_or_default(), + })), + _ => None, + }, + }, + ) +} diff --git a/core/crates/heavy-lifting/src/media_processor/helpers/mod.rs b/core/crates/heavy-lifting/src/media_processor/helpers/mod.rs new file mode 100644 index 000000000..702981355 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/helpers/mod.rs @@ -0,0 +1,12 @@ +pub mod exif_media_data; +pub mod ffmpeg_media_data; +pub mod thumbnailer; + +#[must_use] +fn from_slice_option_to_option( + value: Option>, +) -> Option { + value + .map(|x| serde_json::from_slice(&x).ok()) + .unwrap_or_default() +} diff --git a/core/crates/heavy-lifting/src/media_processor/helpers/thumbnailer.rs b/core/crates/heavy-lifting/src/media_processor/helpers/thumbnailer.rs new file mode 100644 index 000000000..5f636f606 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/helpers/thumbnailer.rs @@ -0,0 +1,499 @@ +use crate::media_processor::thumbnailer; + +use sd_core_prisma_helpers::CasId; + +use sd_file_ext::extensions::{ + DocumentExtension, Extension, ImageExtension, ALL_DOCUMENT_EXTENSIONS, ALL_IMAGE_EXTENSIONS, +}; +use sd_images::{format_image, scale_dimensions, ConvertibleExtension}; +use sd_media_metadata::exif::Orientation; +use sd_utils::error::FileIOError; + +#[cfg(feature = "ffmpeg")] +use sd_file_ext::extensions::{VideoExtension, ALL_VIDEO_EXTENSIONS}; + +use std::{ + ops::Deref, + path::{Path, PathBuf}, + str::FromStr, + time::Duration, +}; + +use image::{imageops, DynamicImage, GenericImageView}; +use once_cell::sync::Lazy; +use serde::{Deserialize, Serialize}; +use specta::Type; +use tokio::{ + fs, io, + sync::{oneshot, Mutex}, + task::spawn_blocking, + time::{sleep, Instant}, +}; +use tracing::{error, instrument, trace}; +use uuid::Uuid; +use webp::Encoder; + +// Files names constants +pub const THUMBNAIL_CACHE_DIR_NAME: &str = "thumbnails"; +pub const WEBP_EXTENSION: &str = "webp"; +pub const EPHEMERAL_DIR: &str = "ephemeral"; + +/// This is the target pixel count for all thumbnails to be resized to, and it is eventually downscaled +/// to [`TARGET_QUALITY`]. +pub const TARGET_PX: f32 = 1_048_576.0; // 1024x1024 + +/// This is the target quality that we render thumbnails at, it is a float between 0-100 +/// and is treated as a percentage (so 60% in this case, or it's the same as multiplying by `0.6`). +pub const TARGET_QUALITY: f32 = 60.0; + +/// How much time we allow for the thumbnailer task to complete before we give up. +pub const THUMBNAILER_TASK_TIMEOUT: Duration = Duration::from_secs(60 * 5); + +pub fn get_thumbnails_directory(data_directory: impl AsRef) -> PathBuf { + data_directory.as_ref().join(THUMBNAIL_CACHE_DIR_NAME) +} + +#[cfg(feature = "ffmpeg")] +pub static THUMBNAILABLE_VIDEO_EXTENSIONS: Lazy> = Lazy::new(|| { + ALL_VIDEO_EXTENSIONS + .iter() + .copied() + .filter(|&ext| can_generate_thumbnail_for_video(ext)) + .map(Extension::Video) + .collect() +}); + +pub static THUMBNAILABLE_EXTENSIONS: Lazy> = Lazy::new(|| { + ALL_IMAGE_EXTENSIONS + .iter() + .copied() + .filter(|&ext| can_generate_thumbnail_for_image(ext)) + .map(Extension::Image) + .chain( + ALL_DOCUMENT_EXTENSIONS + .iter() + .copied() + .filter(|&ext| can_generate_thumbnail_for_document(ext)) + .map(Extension::Document), + ) + .collect() +}); + +pub static ALL_THUMBNAILABLE_EXTENSIONS: Lazy> = Lazy::new(|| { + #[cfg(feature = "ffmpeg")] + return THUMBNAILABLE_EXTENSIONS + .iter() + .cloned() + .chain(THUMBNAILABLE_VIDEO_EXTENSIONS.iter().cloned()) + .collect(); + + #[cfg(not(feature = "ffmpeg"))] + THUMBNAILABLE_EXTENSIONS.clone() +}); + +/// This type is used to pass the relevant data to the frontend so it can request the thumbnail. +/// Tt supports extending the shard hex to support deeper directory structures in the future +#[derive(Debug, Serialize, Deserialize, Type, Clone)] +pub struct ThumbKey { + pub shard_hex: String, + pub cas_id: CasId<'static>, + pub base_directory_str: String, +} + +impl ThumbKey { + #[must_use] + pub fn new(cas_id: CasId<'static>, kind: &ThumbnailKind) -> Self { + Self { + shard_hex: get_shard_hex(&cas_id).to_string(), + cas_id, + base_directory_str: match kind { + ThumbnailKind::Ephemeral => String::from(EPHEMERAL_DIR), + ThumbnailKind::Indexed(library_id) => library_id.to_string(), + }, + } + } + + #[must_use] + pub fn new_indexed(cas_id: CasId<'static>, library_id: Uuid) -> Self { + Self { + shard_hex: get_shard_hex(&cas_id).to_string(), + cas_id, + base_directory_str: library_id.to_string(), + } + } + + #[must_use] + pub fn new_ephemeral(cas_id: CasId<'static>) -> Self { + Self { + shard_hex: get_shard_hex(&cas_id).to_string(), + cas_id, + base_directory_str: String::from(EPHEMERAL_DIR), + } + } +} + +#[derive(Debug, Serialize, Deserialize, Type, Clone, Copy)] +pub enum ThumbnailKind { + Ephemeral, + Indexed(Uuid), +} + +impl ThumbnailKind { + pub fn compute_path(&self, data_directory: impl AsRef, cas_id: &CasId<'_>) -> PathBuf { + let mut thumb_path = get_thumbnails_directory(data_directory); + match self { + Self::Ephemeral => thumb_path.push(EPHEMERAL_DIR), + Self::Indexed(library_id) => { + thumb_path.push(library_id.to_string()); + } + } + thumb_path.push(get_shard_hex(cas_id)); + thumb_path.push(cas_id.as_str()); + thumb_path.set_extension(WEBP_EXTENSION); + + thumb_path + } +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct GenerateThumbnailArgs<'cas_id> { + pub extension: String, + pub cas_id: CasId<'cas_id>, + pub path: PathBuf, +} + +impl<'cas_id> GenerateThumbnailArgs<'cas_id> { + #[must_use] + pub const fn new(extension: String, cas_id: CasId<'cas_id>, path: PathBuf) -> Self { + Self { + extension, + cas_id, + path, + } + } +} + +/// The practice of dividing files into hex coded folders, often called "sharding," +/// is mainly used to optimize file system performance. File systems can start to slow down +/// as the number of files in a directory increases. Thus, it's often beneficial to split +/// files into multiple directories to avoid this performance degradation. +/// +/// `get_shard_hex` takes a `cas_id` (a hexadecimal hash) as input and returns the first +/// three characters of the hash as the directory name. Because we're using these first +/// three characters of a the hash, this will give us 4096 (16^3) possible directories, +/// named 000 to fff. +#[inline] +#[must_use] +pub fn get_shard_hex<'cas_id>(cas_id: &'cas_id CasId<'cas_id>) -> &'cas_id str { + // Use the first three characters of the hash as the directory name + &cas_id.as_str()[0..3] +} + +#[cfg(feature = "ffmpeg")] +#[must_use] +pub const fn can_generate_thumbnail_for_video(video_extension: VideoExtension) -> bool { + use VideoExtension::{Hevc, M2ts, M2v, Mpg, Mts, Swf, Ts}; + // File extensions that are specifically not supported by the thumbnailer + !matches!(video_extension, Mpg | Swf | M2v | Hevc | M2ts | Mts | Ts) +} + +#[must_use] +pub const fn can_generate_thumbnail_for_image(image_extension: ImageExtension) -> bool { + use ImageExtension::{ + Avif, Bmp, Gif, Heic, Heics, Heif, Heifs, Ico, Jpeg, Jpg, Png, Svg, Webp, + }; + + matches!( + image_extension, + Jpg | Jpeg | Png | Webp | Gif | Svg | Heic | Heics | Heif | Heifs | Avif | Bmp | Ico + ) +} + +#[must_use] +pub const fn can_generate_thumbnail_for_document(document_extension: DocumentExtension) -> bool { + use DocumentExtension::Pdf; + + matches!(document_extension, Pdf) +} + +#[derive(Debug)] +pub enum GenerationStatus { + Generated, + Skipped, +} + +#[instrument(skip(thumbnails_directory, cas_id, should_regenerate, kind))] +pub async fn generate_thumbnail( + thumbnails_directory: &Path, + GenerateThumbnailArgs { + extension, + cas_id, + path, + }: &GenerateThumbnailArgs<'_>, + kind: &ThumbnailKind, + should_regenerate: bool, +) -> ( + Duration, + Result<(ThumbKey, GenerationStatus), thumbnailer::NonCriticalThumbnailerError>, +) { + trace!("Generating thumbnail"); + let start = Instant::now(); + + let mut output_path = match kind { + ThumbnailKind::Ephemeral => thumbnails_directory.join(EPHEMERAL_DIR), + ThumbnailKind::Indexed(library_id) => thumbnails_directory.join(library_id.to_string()), + }; + + output_path.push(get_shard_hex(cas_id)); + output_path.push(cas_id.as_str()); + output_path.set_extension(WEBP_EXTENSION); + + if let Err(e) = fs::metadata(&*output_path).await { + if e.kind() != io::ErrorKind::NotFound { + error!( + ?e, + "Failed to check if thumbnail exists, but we will try to generate it anyway;" + ); + } + // Otherwise we good, thumbnail doesn't exist so we can generate it + } else if !should_regenerate { + trace!("Skipping thumbnail generation because it already exists"); + return ( + start.elapsed(), + Ok(( + ThumbKey::new(cas_id.to_owned(), kind), + GenerationStatus::Skipped, + )), + ); + } + + if let Ok(extension) = ImageExtension::from_str(extension) { + if can_generate_thumbnail_for_image(extension) { + trace!("Generating image thumbnail"); + if let Err(e) = generate_image_thumbnail(&path, &output_path).await { + return (start.elapsed(), Err(e)); + } + trace!("Generated image thumbnail"); + } + } else if let Ok(extension) = DocumentExtension::from_str(extension) { + if can_generate_thumbnail_for_document(extension) { + trace!("Generating document thumbnail"); + if let Err(e) = generate_image_thumbnail(&path, &output_path).await { + return (start.elapsed(), Err(e)); + } + trace!("Generating document thumbnail"); + } + } + + #[cfg(feature = "ffmpeg")] + { + use crate::media_processor::helpers::thumbnailer::can_generate_thumbnail_for_video; + use sd_file_ext::extensions::VideoExtension; + + if let Ok(extension) = VideoExtension::from_str(extension) { + if can_generate_thumbnail_for_video(extension) { + trace!("Generating video thumbnail"); + if let Err(e) = generate_video_thumbnail(&path, &output_path).await { + return (start.elapsed(), Err(e)); + } + trace!("Generated video thumbnail"); + } + } + } + + trace!("Generated thumbnail"); + + ( + start.elapsed(), + Ok(( + ThumbKey::new(cas_id.to_owned(), kind), + GenerationStatus::Generated, + )), + ) +} + +fn inner_generate_image_thumbnail( + file_path: PathBuf, +) -> Result, thumbnailer::NonCriticalThumbnailerError> { + let mut img = format_image(&file_path).map_err(|e| { + thumbnailer::NonCriticalThumbnailerError::FormatImage(file_path.clone(), e.to_string()) + })?; + + let (w, h) = img.dimensions(); + + #[allow(clippy::cast_precision_loss)] + let (w_scaled, h_scaled) = scale_dimensions(w as f32, h as f32, TARGET_PX); + + // Optionally, resize the existing photo and convert back into DynamicImage + if w != w_scaled && h != h_scaled { + img = DynamicImage::ImageRgba8(imageops::resize( + &img, + w_scaled, + h_scaled, + imageops::FilterType::Triangle, + )); + } + + // this corrects the rotation/flip of the image based on the *available* exif data + // not all images have exif data, so we don't error. we also don't rotate HEIF as that's against the spec + if let Some(orientation) = Orientation::from_path(&file_path) { + if ConvertibleExtension::try_from(file_path.as_ref()) + .expect("we already checked if the image was convertible") + .should_rotate() + { + img = orientation.correct_thumbnail(img); + } + } + + // Create the WebP encoder for the above image + let encoder = Encoder::from_image(&img).map_err(|reason| { + thumbnailer::NonCriticalThumbnailerError::WebPEncoding(file_path, reason.to_string()) + })?; + + // Type `WebPMemory` is !Send, which makes the `Future` in this function `!Send`, + // this make us `deref` to have a `&[u8]` and then `to_owned` to make a `Vec` + // which implies on a unwanted clone... + Ok(encoder.encode(TARGET_QUALITY).deref().to_owned()) +} + +#[instrument( + skip_all, + fields( + input_path = %file_path.as_ref().display(), + output_path = %output_path.as_ref().display() + ) +)] +async fn generate_image_thumbnail( + file_path: impl AsRef + Send, + output_path: impl AsRef + Send, +) -> Result<(), thumbnailer::NonCriticalThumbnailerError> { + let file_path = file_path.as_ref().to_path_buf(); + + let (tx, rx) = oneshot::channel(); + + // Using channel instead of waiting the JoinHandle as for some reason + // the JoinHandle can take some extra time to complete + let handle = spawn_blocking({ + let file_path = file_path.clone(); + + move || { + // Handling error on receiver side + let _ = tx.send(inner_generate_image_thumbnail(file_path)); + } + }); + + let webp = if let Ok(res) = rx.await { + res? + } else { + error!("Failed to generate thumbnail"); + return Err( + thumbnailer::NonCriticalThumbnailerError::PanicWhileGeneratingThumbnail( + file_path, + handle + .await + .expect_err("as the channel was closed, then the spawned task panicked") + .to_string(), + ), + ); + }; + + trace!("Generated thumbnail bytes"); + + let output_path = output_path.as_ref(); + + if let Some(shard_dir) = output_path.parent() { + fs::create_dir_all(shard_dir).await.map_err(|e| { + thumbnailer::NonCriticalThumbnailerError::CreateShardDirectory( + FileIOError::from((shard_dir, e)).to_string(), + ) + })?; + } else { + error!("Failed to get parent directory for sharding parent directory"); + } + + trace!("Created shard directory and writing it to disk"); + + let res = fs::write(output_path, &webp).await.map_err(|e| { + thumbnailer::NonCriticalThumbnailerError::SaveThumbnail( + file_path, + FileIOError::from((output_path, e)).to_string(), + ) + }); + + trace!("Wrote thumbnail to disk"); + res +} + +#[instrument( + skip_all, + fields( + input_path = %file_path.as_ref().display(), + output_path = %output_path.as_ref().display() + ) +)] +#[cfg(feature = "ffmpeg")] +async fn generate_video_thumbnail( + file_path: impl AsRef + Send, + output_path: impl AsRef + Send, +) -> Result<(), thumbnailer::NonCriticalThumbnailerError> { + use sd_ffmpeg::{to_thumbnail, ThumbnailSize}; + + let file_path = file_path.as_ref(); + + to_thumbnail( + file_path, + output_path, + ThumbnailSize::Scale(1024), + TARGET_QUALITY, + ) + .await + .map_err(|e| { + thumbnailer::NonCriticalThumbnailerError::VideoThumbnailGenerationFailed( + file_path.to_path_buf(), + e.to_string(), + ) + }) +} + +const HALF_SEC: Duration = Duration::from_millis(500); +static LAST_SINGLE_THUMB_GENERATED_LOCK: Lazy> = + Lazy::new(|| Mutex::new(Instant::now())); + +/// WARNING!!!! DON'T USE THIS FUNCTION IN A LOOP!!!!!!!!!!!!! It will be pretty slow on purpose! +pub async fn generate_single_thumbnail( + thumbnails_directory: impl AsRef + Send, + extension: String, + cas_id: CasId<'static>, + path: impl AsRef + Send, + kind: ThumbnailKind, +) -> Result<(), thumbnailer::NonCriticalThumbnailerError> { + let mut last_single_thumb_generated_guard = LAST_SINGLE_THUMB_GENERATED_LOCK.lock().await; + + let elapsed = Instant::now() - *last_single_thumb_generated_guard; + if elapsed < HALF_SEC { + // This will choke up in case someone try to use this method in a loop, otherwise + // it will consume all the machine resources like a gluton monster from hell + sleep(HALF_SEC - elapsed).await; + } + + let (_duration, res) = generate_thumbnail( + thumbnails_directory.as_ref(), + &GenerateThumbnailArgs { + extension, + cas_id, + path: path.as_ref().to_path_buf(), + }, + &kind, + false, + ) + .await; + + let (_thumb_key, status) = res?; + + if matches!(status, GenerationStatus::Generated) { + *last_single_thumb_generated_guard = Instant::now(); + drop(last_single_thumb_generated_guard); // Clippy was weirdly complaining about not doing an "early" drop here + } + + Ok(()) +} diff --git a/core/crates/heavy-lifting/src/media_processor/job.rs b/core/crates/heavy-lifting/src/media_processor/job.rs new file mode 100644 index 000000000..bab8e506c --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/job.rs @@ -0,0 +1,1084 @@ +use crate::{ + job_system::{ + job::{Job, JobReturn, JobTaskDispatcher, ReturnStatus}, + report::ReportOutputMetadata, + utils::cancel_pending_tasks, + DispatcherError, JobErrorOrDispatcherError, SerializableJob, SerializedTasks, + }, + media_processor::{self, helpers::thumbnailer::THUMBNAIL_CACHE_DIR_NAME}, + utils::sub_path::maybe_get_iso_file_path_from_sub_path, + Error, JobContext, JobName, LocationScanState, OuterContext, ProgressUpdate, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_prisma_helpers::file_path_for_media_processor; + +use sd_file_ext::extensions::Extension; +use sd_prisma::prisma::{location, PrismaClient}; +use sd_task_system::{ + AnyTaskOutput, IntoTask, SerializableTask, Task, TaskDispatcher, TaskHandle, TaskId, + TaskOutput, TaskStatus, TaskSystemError, +}; +use sd_utils::{db::maybe_missing, u64_to_frontend}; + +use std::{ + collections::{HashMap, HashSet}, + fmt, + hash::{Hash, Hasher}, + mem, + path::PathBuf, + sync::Arc, + time::Duration, +}; + +use futures::{stream::FuturesUnordered, StreamExt}; +use futures_concurrency::future::TryJoin; +use itertools::Itertools; +use prisma_client_rust::{raw, PrismaValue}; +use serde::{Deserialize, Serialize}; +use serde_json::json; +use tracing::{debug, error, instrument, trace, warn, Level}; + +use super::{ + get_direct_children_files_by_extensions, helpers, + tasks::{ + self, media_data_extractor, + thumbnailer::{self, NewThumbnailReporter}, + }, + NewThumbnailsReporter, RawFilePathForMediaProcessor, BATCH_SIZE, +}; + +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] +enum TaskKind { + MediaDataExtractor, + Thumbnailer, +} + +#[derive(Debug, Serialize, Deserialize, Clone, Copy)] +enum Phase { + MediaDataExtraction, + ThumbnailGeneration, + // LabelsGeneration, // TODO: Implement labels generation +} + +impl Default for Phase { + fn default() -> Self { + Self::MediaDataExtraction + } +} + +impl fmt::Display for Phase { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::MediaDataExtraction => write!(f, "media_data"), + Self::ThumbnailGeneration => write!(f, "thumbnails"), + // Self::LabelsGeneration => write!(f, "labels"), // TODO: Implement labels generation + } + } +} + +#[derive(Debug)] +pub struct MediaProcessor { + // Received arguments + location: Arc, + location_path: Arc, + sub_path: Option, + regenerate_thumbnails: bool, + + // Job control + total_media_data_extraction_files: u64, + total_media_data_extraction_tasks: u64, + total_thumbnailer_tasks: u64, + total_thumbnailer_files: u64, + phase: Phase, + + // Run data + metadata: Metadata, + errors: Vec, + + // On shutdown data + pending_tasks_on_resume: Vec>, + tasks_for_shutdown: Vec>>, +} + +impl Job for MediaProcessor { + const NAME: JobName = JobName::MediaProcessor; + + async fn resume_tasks( + &mut self, + dispatcher: &JobTaskDispatcher, + ctx: &impl JobContext, + SerializedTasks(serialized_tasks): SerializedTasks, + ) -> Result<(), Error> { + let reporter: Arc = + Arc::new(NewThumbnailsReporter { ctx: ctx.clone() }); + + if let Ok(tasks) = dispatcher + .dispatch_many_boxed( + rmp_serde::from_slice::)>>(&serialized_tasks) + .map_err(media_processor::Error::from)? + .into_iter() + .map(|(task_kind, task_bytes)| { + let reporter = Arc::clone(&reporter); + async move { + match task_kind { + TaskKind::MediaDataExtractor => { + tasks::MediaDataExtractor::deserialize( + &task_bytes, + (Arc::clone(ctx.db()), Arc::clone(ctx.sync())), + ) + .await + .map(IntoTask::into_task) + } + + TaskKind::Thumbnailer => { + tasks::Thumbnailer::deserialize(&task_bytes, reporter) + .await + .map(IntoTask::into_task) + } + } + } + }) + .collect::>() + .try_join() + .await + .map_err(media_processor::Error::from)?, + ) + .await + { + self.pending_tasks_on_resume = tasks; + } else { + warn!("Failed to dispatch tasks to resume as job was already canceled"); + } + + Ok(()) + } + + #[instrument( + skip_all, + fields( + location_id = self.location.id, + location_path = ?self.location.path, + sub_path = ?self.sub_path.as_ref().map(|path| path.display()), + regenerate_thumbnails = self.regenerate_thumbnails, + ), + ret(level = Level::TRACE), + err, + )] + async fn run( + mut self, + dispatcher: JobTaskDispatcher, + ctx: impl JobContext, + ) -> Result { + let mut pending_running_tasks = FuturesUnordered::new(); + + match self + .init_or_resume(&mut pending_running_tasks, &ctx, &dispatcher) + .await + { + Ok(()) => { /* Everything is awesome! */ } + Err(JobErrorOrDispatcherError::JobError(e)) => { + return Err(e.into()); + } + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(_))) => { + return Ok(self.cancel_job(&mut pending_running_tasks).await); + } + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown(tasks))) => { + self.tasks_for_shutdown.extend(tasks); + + if pending_running_tasks.is_empty() { + // If no task managed to be dispatched, we can just shutdown + // otherwise we have to process handles below and wait for them to be shutdown too + return Ok(ReturnStatus::Shutdown( + SerializableJob::::serialize(self).await, + )); + } + } + } + + if let Some(res) = self.process_handles(&mut pending_running_tasks, &ctx).await { + return res; + } + + if !self.tasks_for_shutdown.is_empty() { + return Ok(ReturnStatus::Shutdown( + SerializableJob::::serialize(self).await, + )); + } + + // From this point onward, we are done with the job and it can't be interrupted anymore + let Self { + location, + metadata, + errors, + .. + } = self; + + ctx.db() + .location() + .update( + location::id::equals(location.id), + vec![location::scan_state::set( + LocationScanState::Completed as i32, + )], + ) + .exec() + .await + .map_err(media_processor::Error::from)?; + + Ok(ReturnStatus::Completed( + JobReturn::builder() + .with_metadata(metadata) + .with_non_critical_errors(errors) + .build(), + )) + } +} + +impl MediaProcessor { + pub fn new( + location: location::Data, + sub_path: Option, + regenerate_thumbnails: bool, + ) -> Result { + Ok(Self { + location_path: maybe_missing(&location.path, "location.path") + .map(PathBuf::from) + .map(Arc::new)?, + location: Arc::new(location), + sub_path, + regenerate_thumbnails, + total_media_data_extraction_files: 0, + total_media_data_extraction_tasks: 0, + total_thumbnailer_tasks: 0, + total_thumbnailer_files: 0, + phase: Phase::default(), + metadata: Metadata::default(), + errors: Vec::new(), + pending_tasks_on_resume: Vec::new(), + tasks_for_shutdown: Vec::new(), + }) + } + + #[allow(clippy::too_many_lines)] + async fn init_or_resume( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + job_ctx: &impl JobContext, + dispatcher: &JobTaskDispatcher, + ) -> Result<(), JobErrorOrDispatcherError> { + // if we don't have any pending task, then this is a fresh job + if self.pending_tasks_on_resume.is_empty() { + let location_id = self.location.id; + let location_path = &*self.location_path; + + let iso_file_path = maybe_get_iso_file_path_from_sub_path::( + location_id, + self.sub_path.as_ref(), + &*self.location_path, + job_ctx.db(), + ) + .await? + .map_or_else( + || { + IsolatedFilePathData::new(location_id, location_path, location_path, true) + .map_err(media_processor::Error::from) + }, + Ok, + )?; + + // First we will dispatch all tasks for media data extraction so we have a nice reporting + let media_data_extraction_tasks_res = self + .dispatch_media_data_extractor_tasks(&iso_file_path, dispatcher, job_ctx) + .await; + + // Now we dispatch thumbnailer tasks + let thumbnailer_tasks_res = self + .dispatch_thumbnailer_tasks( + &iso_file_path, + self.regenerate_thumbnails, + dispatcher, + job_ctx, + ) + .await; + + match (media_data_extraction_tasks_res, thumbnailer_tasks_res) { + (Ok(media_data_extraction_task_handles), Ok(thumbnailer_task_handles)) => { + pending_running_tasks.extend( + media_data_extraction_task_handles + .into_iter() + .chain(thumbnailer_task_handles), + ); + } + + ( + Ok(task_handles), + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(e))), + ) + | ( + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(e))), + Ok(task_handles), + ) => { + pending_running_tasks.extend(task_handles); + return Err(JobErrorOrDispatcherError::Dispatcher( + DispatcherError::JobCanceled(e), + )); + } + + ( + Ok(task_handles), + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown(tasks))), + ) + | ( + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown(tasks))), + Ok(task_handles), + ) => { + self.tasks_for_shutdown.extend(tasks); + pending_running_tasks.extend(task_handles); + } + + ( + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown( + media_data_extraction_tasks, + ))), + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::Shutdown( + thumbnailer_tasks, + ))), + ) => { + self.tasks_for_shutdown.extend( + media_data_extraction_tasks + .into_iter() + .chain(thumbnailer_tasks), + ); + } + + ( + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(e))), + _, + ) + | ( + _, + Err(JobErrorOrDispatcherError::Dispatcher(DispatcherError::JobCanceled(e))), + ) => { + return Err(JobErrorOrDispatcherError::Dispatcher( + DispatcherError::JobCanceled(e), + )); + } + + (Err(JobErrorOrDispatcherError::JobError(e)), _) + | (_, Err(JobErrorOrDispatcherError::JobError(e))) => { + return Err(e.into()); + } + } + } else { + let updates = match self.phase { + Phase::MediaDataExtraction => vec![ + ProgressUpdate::TaskCount(self.total_media_data_extraction_files), + ProgressUpdate::CompletedTaskCount( + self.metadata.media_data_metrics.extracted + + self.metadata.media_data_metrics.skipped, + ), + ProgressUpdate::Phase(self.phase.to_string()), + ProgressUpdate::Message(format!( + "Preparing to process {} files in {} chunks", + self.total_media_data_extraction_files, + self.total_media_data_extraction_tasks + )), + ], + Phase::ThumbnailGeneration => vec![ + ProgressUpdate::TaskCount(self.total_thumbnailer_files), + ProgressUpdate::CompletedTaskCount( + self.metadata.thumbnailer_metrics_acc.generated + + self.metadata.thumbnailer_metrics_acc.skipped, + ), + ProgressUpdate::Phase(self.phase.to_string()), + ProgressUpdate::Message(format!( + "Preparing to process {} files in {} chunks", + self.total_thumbnailer_files, self.total_thumbnailer_tasks + )), + ], + }; + + job_ctx.progress(updates).await; + + pending_running_tasks.extend(mem::take(&mut self.pending_tasks_on_resume)); + } + + Ok(()) + } + + async fn process_handles( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + job_ctx: &impl JobContext, + ) -> Option> { + while let Some(task) = pending_running_tasks.next().await { + match task { + Ok(TaskStatus::Done((task_id, TaskOutput::Out(out)))) => { + self.process_task_output(task_id, out, job_ctx).await; + } + + Ok(TaskStatus::Done((task_id, TaskOutput::Empty))) => { + warn!(%task_id, "Task returned an empty output;"); + } + + Ok(TaskStatus::Shutdown(task)) => { + self.tasks_for_shutdown.push(task); + } + + Ok(TaskStatus::Error(e)) => { + cancel_pending_tasks(pending_running_tasks).await; + + return Some(Err(e)); + } + + Ok(TaskStatus::Canceled | TaskStatus::ForcedAbortion) => { + return Some(Ok(self.cancel_job(pending_running_tasks).await)); + } + + Err(TaskSystemError::TaskTimeout(task_id)) => { + warn!( + %task_id, + "Thumbnailer task timed out, we will keep processing the rest of the tasks;", + ); + self.errors.push( + media_processor::NonCriticalMediaProcessorError::Thumbnailer( + media_processor::NonCriticalThumbnailerError::TaskTimeout(task_id), + ) + .into(), + ); + } + + Err(e) => { + error!(?e, "Task System error;"); + cancel_pending_tasks(pending_running_tasks).await; + + return Some(Err(e.into())); + } + } + } + + None + } + + async fn process_task_output( + &mut self, + task_id: TaskId, + any_task_output: Box, + job_ctx: &impl JobContext, + ) { + if any_task_output.is::() { + let media_data_extractor::Output { + extracted, + skipped, + db_read_time, + filtering_time, + extraction_time, + db_write_time, + errors, + } = *any_task_output.downcast().expect("just checked"); + + self.metadata.media_data_metrics.extracted += extracted; + self.metadata.media_data_metrics.skipped += skipped; + self.metadata.media_data_metrics.mean_db_read_time += db_read_time; + self.metadata.media_data_metrics.mean_filtering_time += filtering_time; + self.metadata.media_data_metrics.mean_extraction_time += extraction_time; + self.metadata.media_data_metrics.mean_db_write_time += db_write_time; + self.metadata.media_data_metrics.total_successful_tasks += 1; + + if !errors.is_empty() { + warn!(?errors, "Non critical errors while extracting media data;"); + self.errors.extend(errors); + } + + debug!( + "Processed ({}/{}) media data extraction tasks, took: {:?};", + self.metadata.media_data_metrics.total_successful_tasks, + self.total_media_data_extraction_tasks, + db_read_time + filtering_time + extraction_time + db_write_time, + ); + job_ctx + .progress(vec![ProgressUpdate::CompletedTaskCount( + self.metadata.media_data_metrics.extracted + + self.metadata.media_data_metrics.skipped, + )]) + .await; + + if self.total_media_data_extraction_tasks + == self.metadata.media_data_metrics.total_successful_tasks + { + debug!("All media data extraction tasks have been processed"); + + self.phase = Phase::ThumbnailGeneration; + + job_ctx + .progress(vec![ + ProgressUpdate::TaskCount(self.total_thumbnailer_files), + ProgressUpdate::Phase(self.phase.to_string()), + ProgressUpdate::Message(format!( + "Waiting for processing of {} thumbnails in {} tasks", + self.total_thumbnailer_files, self.total_thumbnailer_tasks + )), + ]) + .await; + } + } else if any_task_output.is::() { + let thumbnailer::Output { + generated, + skipped, + errors, + total_time, + mean_time_acc, + std_dev_acc, + } = *any_task_output.downcast().expect("just checked"); + + self.metadata.thumbnailer_metrics_acc.generated += generated; + self.metadata.thumbnailer_metrics_acc.skipped += skipped; + self.metadata.thumbnailer_metrics_acc.mean_total_time += total_time; + self.metadata.thumbnailer_metrics_acc.mean_time_acc += mean_time_acc; + self.metadata.thumbnailer_metrics_acc.std_dev_acc += std_dev_acc; + self.metadata.thumbnailer_metrics_acc.total_successful_tasks += 1; + + if !errors.is_empty() { + warn!(?errors, "Non critical errors while generating thumbnails;"); + self.errors.extend(errors); + } + + debug!( + "Processed ({}/{}) thumbnailer tasks, took: {total_time:?}", + self.metadata.thumbnailer_metrics_acc.total_successful_tasks, + self.total_thumbnailer_tasks + ); + + if matches!(self.phase, Phase::ThumbnailGeneration) { + job_ctx + .progress(vec![ProgressUpdate::CompletedTaskCount( + self.metadata.thumbnailer_metrics_acc.generated + + self.metadata.thumbnailer_metrics_acc.skipped, + )]) + .await; + } + + // if self.total_thumbnailer_tasks + // == self.metadata.thumbnailer_metrics_acc.total_successful_tasks + // { + // debug!("All thumbnailer tasks have been processed"); + + // self.phase = Phase::LabelsGeneration; + + // ctx.progress(vec![ + // ProgressUpdate::TaskCount(self.total_thumbnailer_files), + // ProgressUpdate::Phase(self.phase.to_string()), + // ProgressUpdate::Message(format!( + // "Waiting for processing of {} labels in {} tasks", + // self.total_labeller_files, self.total_labeller_tasks + // )), + // ]).await; + // } + } else { + unreachable!("Unexpected task output type: "); + } + } + + async fn cancel_job( + &mut self, + pending_running_tasks: &mut FuturesUnordered>, + ) -> ReturnStatus { + cancel_pending_tasks(pending_running_tasks).await; + + ReturnStatus::Canceled( + JobReturn::builder() + .with_metadata(mem::take(&mut self.metadata)) + .with_non_critical_errors(mem::take(&mut self.errors)) + .build(), + ) + } + + #[instrument(skip_all, fields(parent_iso_file_path = %parent_iso_file_path.as_ref().display()))] + async fn dispatch_media_data_extractor_tasks( + &mut self, + parent_iso_file_path: &IsolatedFilePathData<'_>, + dispatcher: &JobTaskDispatcher, + job_ctx: &impl JobContext, + ) -> Result>, JobErrorOrDispatcherError> { + let db = job_ctx.db(); + let sync = job_ctx.sync(); + + let (extract_exif_file_paths, extract_ffmpeg_file_paths) = ( + get_all_children_files_by_extensions( + parent_iso_file_path, + &helpers::exif_media_data::AVAILABLE_EXTENSIONS, + db, + ), + get_all_children_files_by_extensions( + parent_iso_file_path, + &helpers::ffmpeg_media_data::AVAILABLE_EXTENSIONS, + db, + ), + ) + .try_join() + .await?; + + let files_count = (extract_exif_file_paths.len() + extract_ffmpeg_file_paths.len()) as u64; + + let tasks = extract_exif_file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(Iterator::collect::>) + .map(|chunked_file_paths| { + tasks::MediaDataExtractor::new_exif( + &chunked_file_paths, + parent_iso_file_path.location_id(), + Arc::clone(&self.location_path), + Arc::clone(db), + Arc::clone(sync), + ) + }) + .map(IntoTask::into_task) + .chain( + extract_ffmpeg_file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(Iterator::collect::>) + .map(|chunked_file_paths| { + tasks::MediaDataExtractor::new_ffmpeg( + &chunked_file_paths, + parent_iso_file_path.location_id(), + Arc::clone(&self.location_path), + Arc::clone(db), + Arc::clone(sync), + ) + }) + .map(IntoTask::into_task), + ) + .collect::>(); + + trace!( + tasks_count = tasks.len(), + %files_count, + "Dispatching media data extraction tasks;", + ); + + self.total_media_data_extraction_files = files_count; + self.total_media_data_extraction_tasks = tasks.len() as u64; + + job_ctx + .progress(vec![ + ProgressUpdate::TaskCount(self.total_media_data_extraction_files), + ProgressUpdate::Phase(self.phase.to_string()), + ProgressUpdate::Message(format!( + "Preparing to process {} files in {} chunks", + self.total_media_data_extraction_files, self.total_media_data_extraction_tasks + )), + ]) + .await; + + dispatcher + .dispatch_many_boxed(tasks) + .await + .map_err(Into::into) + } + + async fn dispatch_thumbnailer_tasks( + &mut self, + parent_iso_file_path: &IsolatedFilePathData<'_>, + should_regenerate: bool, + dispatcher: &JobTaskDispatcher, + ctx: &impl OuterContext, + ) -> Result>, JobErrorOrDispatcherError> { + let thumbnails_directory_path = + Arc::new(ctx.get_data_directory().join(THUMBNAIL_CACHE_DIR_NAME)); + let location_id = parent_iso_file_path.location_id(); + let library_id = ctx.id(); + let db = ctx.db(); + let reporter: Arc = + Arc::new(NewThumbnailsReporter { ctx: ctx.clone() }); + + let priority_file_paths = get_direct_children_files_by_extensions( + parent_iso_file_path, + &helpers::thumbnailer::ALL_THUMBNAILABLE_EXTENSIONS, + db, + ) + .await?; + + let priority_file_path_ids = priority_file_paths + .iter() + .map(|file_path| file_path.id) + .collect::>(); + + let mut file_paths = get_all_children_files_by_extensions( + parent_iso_file_path, + &helpers::thumbnailer::ALL_THUMBNAILABLE_EXTENSIONS, + db, + ) + .await?; + + file_paths.retain(|file_path| !priority_file_path_ids.contains(&file_path.id)); + + if priority_file_path_ids.is_empty() && file_paths.is_empty() { + return Ok(Vec::new()); + } + + let thumbs_count = (priority_file_paths.len() + file_paths.len()) as u64; + + let priority_tasks = priority_file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(|chunk| { + tasks::Thumbnailer::new_indexed( + Arc::clone(&thumbnails_directory_path), + &chunk.collect::>(), + (location_id, &self.location_path), + library_id, + should_regenerate, + true, + Arc::clone(&reporter), + ) + }) + .map(IntoTask::into_task) + .collect::>(); + + let non_priority_tasks = file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(|chunk| { + tasks::Thumbnailer::new_indexed( + Arc::clone(&thumbnails_directory_path), + &chunk.collect::>(), + (location_id, &self.location_path), + library_id, + should_regenerate, + false, + Arc::clone(&reporter), + ) + }) + .map(IntoTask::into_task) + .collect::>(); + + debug!( + %thumbs_count, + priority_tasks_count = priority_tasks.len(), + non_priority_tasks_count = non_priority_tasks.len(), + "Dispatching thumbnails to be processed;", + ); + + self.total_thumbnailer_tasks = (priority_tasks.len() + non_priority_tasks.len()) as u64; + self.total_thumbnailer_files = thumbs_count; + + dispatcher + .dispatch_many_boxed(priority_tasks.into_iter().chain(non_priority_tasks)) + .await + .map_err(Into::into) + } +} + +#[derive(Debug, Serialize, Deserialize, Default)] +struct Metadata { + media_data_metrics: MediaExtractorMetrics, + thumbnailer_metrics_acc: ThumbnailerMetricsAccumulator, +} + +impl From for Vec { + fn from( + Metadata { + media_data_metrics, + thumbnailer_metrics_acc: thumbnailer_metrics_accumulator, + }: Metadata, + ) -> Self { + let thumbnailer_metrics = ThumbnailerMetrics::from(thumbnailer_metrics_accumulator); + + vec![ + ReportOutputMetadata::MediaProcessor { + media_data_extracted: u64_to_frontend(media_data_metrics.extracted), + media_data_skipped: u64_to_frontend(media_data_metrics.skipped), + thumbnails_generated: u64_to_frontend(thumbnailer_metrics.generated), + thumbnails_skipped: u64_to_frontend(thumbnailer_metrics.skipped), + }, + ReportOutputMetadata::Metrics(HashMap::from([ + // + // Media data extractor + // + ( + "media_data_extraction_metrics".into(), + json!(media_data_metrics), + ), + // + // Thumbnailer + // + ("thumbnailer_metrics".into(), json!(thumbnailer_metrics)), + ])), + ] + } +} + +#[derive(Debug, Serialize, Deserialize, Default)] +struct MediaExtractorMetrics { + extracted: u64, + skipped: u64, + mean_db_read_time: Duration, + mean_filtering_time: Duration, + mean_extraction_time: Duration, + mean_db_write_time: Duration, + total_successful_tasks: u64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +struct ThumbnailerMetricsAccumulator { + generated: u64, + skipped: u64, + mean_total_time: Duration, + mean_time_acc: f64, + std_dev_acc: f64, + total_successful_tasks: u64, +} + +#[derive(Debug, Serialize, Deserialize, Default)] +struct ThumbnailerMetrics { + generated: u64, + skipped: u64, + mean_total_time: Duration, + mean_generation_time: Duration, + std_dev: Duration, + total_successful_tasks: u64, +} + +impl From for ThumbnailerMetrics { + fn from( + ThumbnailerMetricsAccumulator { + generated, + skipped, + mean_total_time, + mean_time_acc: mean_generation_time_acc, + std_dev_acc, + total_successful_tasks, + }: ThumbnailerMetricsAccumulator, + ) -> Self { + if generated + skipped == 0 { + return Self { + generated, + skipped, + mean_total_time, + mean_generation_time: Duration::ZERO, + std_dev: Duration::ZERO, + total_successful_tasks, + }; + } + + #[allow(clippy::cast_precision_loss)] + // SAFETY: we're probably won't have 2^52 thumbnails being generated on a single job for this cast to have + // a precision loss issue + let total = (generated + skipped) as f64; + let mean_generation_time = mean_generation_time_acc / total; + + let std_dev = if generated > 1 { + Duration::from_secs_f64( + (mean_generation_time.mul_add(-mean_generation_time, std_dev_acc / total)).sqrt(), + ) + } else { + Duration::ZERO + }; + + Self { + generated, + skipped, + mean_total_time, + mean_generation_time: Duration::from_secs_f64(if generated > 1 { + mean_generation_time + } else { + mean_generation_time_acc + }), + std_dev, + total_successful_tasks, + } + } +} + +async fn get_all_children_files_by_extensions( + parent_iso_file_path: &IsolatedFilePathData<'_>, + extensions: &[Extension], + db: &PrismaClient, +) -> Result, media_processor::Error> { + // FIXME: Had to use format! macro because PCR doesn't support IN with Vec for SQLite + // We have no data coming from the user, so this is sql injection safe + let unique_by_object_id = db + ._query_raw::(raw!( + &format!( + "SELECT + file_path.id, + file_path.materialized_path, + file_path.is_dir, + file_path.name, + file_path.extension, + file_path.cas_id, + object.id as 'object_id', + object.pub_id as 'object_pub_id' + FROM file_path + INNER JOIN object ON object.id = file_path.object_id + WHERE + file_path.location_id={{}} + AND file_path.cas_id IS NOT NULL + AND LOWER(file_path.extension) IN ({}) + AND file_path.materialized_path LIKE {{}} + ORDER BY materialized_path ASC, name ASC", + // Ordering by materialized_path so we can prioritize processing the first files + // in the above part of the directories tree + extensions + .iter() + .map(|ext| format!("LOWER('{ext}')")) + .collect::>() + .join(",") + ), + PrismaValue::Int(parent_iso_file_path.location_id()), + PrismaValue::String(format!( + "{}%", + parent_iso_file_path + .materialized_path_for_children() + .expect("sub path iso_file_path must be a directory") + )) + )) + .exec() + .await? + .into_iter() + .map(|raw_file_path| (raw_file_path.object_id, raw_file_path)) + .collect::>(); + + Ok(unique_by_object_id.into_values().map(Into::into).collect()) +} + +#[derive(Serialize, Deserialize)] +struct SaveState { + location: Arc, + location_path: Arc, + sub_path: Option, + regenerate_thumbnails: bool, + + total_media_data_extraction_files: u64, + total_media_data_extraction_tasks: u64, + total_thumbnailer_tasks: u64, + total_thumbnailer_files: u64, + + phase: Phase, + + metadata: Metadata, + + errors: Vec, + + tasks_for_shutdown_bytes: Option, +} + +impl SerializableJob for MediaProcessor { + async fn serialize(self) -> Result>, rmp_serde::encode::Error> { + let Self { + location, + location_path, + sub_path, + regenerate_thumbnails, + total_media_data_extraction_files, + total_media_data_extraction_tasks, + total_thumbnailer_tasks, + total_thumbnailer_files, + phase, + metadata, + errors, + tasks_for_shutdown, + .. + } = self; + + let serialized_tasks = tasks_for_shutdown + .into_iter() + .map(|task| async move { + if task.is::() { + task.downcast::() + .expect("just checked") + .serialize() + .await + .map(|bytes| (TaskKind::MediaDataExtractor, bytes)) + } else if task.is::() { + task.downcast::() + .expect("just checked") + .serialize() + .await + .map(|bytes| (TaskKind::Thumbnailer, bytes)) + } else { + unreachable!("Unexpected task type: ") + } + }) + .collect::>() + .try_join() + .await?; + + let tasks_for_shutdown_bytes = if serialized_tasks.is_empty() { + None + } else { + Some(SerializedTasks(rmp_serde::to_vec_named(&serialized_tasks)?)) + }; + + rmp_serde::to_vec_named(&SaveState { + location, + location_path, + sub_path, + regenerate_thumbnails, + total_media_data_extraction_files, + total_media_data_extraction_tasks, + total_thumbnailer_tasks, + total_thumbnailer_files, + phase, + metadata, + errors, + tasks_for_shutdown_bytes, + }) + .map(Some) + } + + async fn deserialize( + serialized_job: &[u8], + _: &OuterCtx, + ) -> Result)>, rmp_serde::decode::Error> { + let SaveState { + location, + location_path, + sub_path, + regenerate_thumbnails, + total_media_data_extraction_files, + total_media_data_extraction_tasks, + total_thumbnailer_tasks, + total_thumbnailer_files, + phase, + metadata, + errors, + tasks_for_shutdown_bytes, + } = rmp_serde::from_slice::(serialized_job)?; + + Ok(Some(( + Self { + location, + location_path, + sub_path, + regenerate_thumbnails, + total_media_data_extraction_files, + total_media_data_extraction_tasks, + total_thumbnailer_tasks, + total_thumbnailer_files, + phase, + metadata, + errors, + pending_tasks_on_resume: Vec::new(), + tasks_for_shutdown: Vec::new(), + }, + tasks_for_shutdown_bytes, + ))) + } +} + +impl Hash for MediaProcessor { + fn hash(&self, state: &mut H) { + self.location.id.hash(state); + if let Some(ref sub_path) = self.sub_path { + sub_path.hash(state); + } + } +} diff --git a/core/crates/heavy-lifting/src/media_processor/mod.rs b/core/crates/heavy-lifting/src/media_processor/mod.rs new file mode 100644 index 000000000..c21c2e3dc --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/mod.rs @@ -0,0 +1,184 @@ +use crate::{utils::sub_path, OuterContext, UpdateEvent}; + +use sd_core_file_path_helper::{FilePathError, IsolatedFilePathData}; +use sd_core_prisma_helpers::file_path_for_media_processor; + +use sd_file_ext::extensions::Extension; +use sd_prisma::prisma::{file_path, object, PrismaClient}; +use sd_utils::db::MissingFieldError; + +use std::{collections::HashMap, fmt}; + +use prisma_client_rust::{raw, PrismaValue}; +use serde::{Deserialize, Serialize}; +use specta::Type; + +mod helpers; +pub mod job; +mod shallow; +mod tasks; + +pub use tasks::{ + media_data_extractor::{self, MediaDataExtractor}, + thumbnailer::{self, Thumbnailer}, +}; + +pub use helpers::{ + exif_media_data, ffmpeg_media_data, + thumbnailer::{ + can_generate_thumbnail_for_document, can_generate_thumbnail_for_image, + generate_single_thumbnail, get_shard_hex, get_thumbnails_directory, GenerateThumbnailArgs, + ThumbKey, ThumbnailKind, WEBP_EXTENSION, + }, +}; + +#[cfg(feature = "ffmpeg")] +pub use helpers::thumbnailer::can_generate_thumbnail_for_video; + +pub use shallow::shallow; + +use media_data_extractor::NonCriticalMediaDataExtractorError; +use thumbnailer::{NewThumbnailReporter, NonCriticalThumbnailerError}; + +const BATCH_SIZE: usize = 10; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("missing field on database: {0}")] + MissingField(#[from] MissingFieldError), + #[error("database error: {0}")] + Database(#[from] prisma_client_rust::QueryError), + #[error("failed to deserialized stored tasks for job resume: {0}")] + DeserializeTasks(#[from] rmp_serde::decode::Error), + + #[error(transparent)] + FilePathError(#[from] FilePathError), + #[error(transparent)] + SubPath(#[from] sub_path::Error), +} + +impl From for rspc::Error { + fn from(e: Error) -> Self { + match e { + Error::SubPath(sub_path_err) => sub_path_err.into(), + + _ => Self::with_cause(rspc::ErrorCode::InternalServerError, e.to_string(), e), + } + } +} + +#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type, Clone)] +#[serde(rename_all = "snake_case")] +pub enum NonCriticalMediaProcessorError { + #[error(transparent)] + MediaDataExtractor(#[from] NonCriticalMediaDataExtractorError), + #[error(transparent)] + Thumbnailer(#[from] NonCriticalThumbnailerError), +} + +#[derive(Clone)] +pub struct NewThumbnailsReporter { + pub ctx: OuterCtx, +} + +impl fmt::Debug for NewThumbnailsReporter { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("NewThumbnailsReporter").finish() + } +} + +impl NewThumbnailReporter for NewThumbnailsReporter { + fn new_thumbnail(&self, thumb_key: ThumbKey) { + self.ctx + .report_update(UpdateEvent::NewThumbnail { thumb_key }); + } +} + +#[derive(Deserialize)] +struct RawFilePathForMediaProcessor { + id: file_path::id::Type, + materialized_path: file_path::materialized_path::Type, + is_dir: file_path::is_dir::Type, + name: file_path::name::Type, + extension: file_path::extension::Type, + cas_id: file_path::cas_id::Type, + object_id: object::id::Type, + object_pub_id: object::pub_id::Type, +} + +impl From for file_path_for_media_processor::Data { + fn from( + RawFilePathForMediaProcessor { + id, + materialized_path, + is_dir, + name, + extension, + cas_id, + object_id, + object_pub_id, + }: RawFilePathForMediaProcessor, + ) -> Self { + Self { + id, + materialized_path, + is_dir, + name, + extension, + cas_id, + object: Some(file_path_for_media_processor::object::Data { + id: object_id, + pub_id: object_pub_id, + }), + } + } +} + +async fn get_direct_children_files_by_extensions( + parent_iso_file_path: &IsolatedFilePathData<'_>, + extensions: &[Extension], + db: &PrismaClient, +) -> Result, Error> { + // FIXME: Had to use format! macro because PCR doesn't support IN with Vec for SQLite + // We have no data coming from the user, so this is sql injection safe + let unique_by_object_id = db + ._query_raw::(raw!( + &format!( + "SELECT + file_path.id, + file_path.materialized_path, + file_path.is_dir, + file_path.name, + file_path.extension, + file_path.cas_id, + object.id as 'object_id', + object.pub_id as 'object_pub_id' + FROM file_path + INNER JOIN object ON object.id = file_path.object_id + WHERE + location_id={{}} + AND cas_id IS NOT NULL + AND LOWER(extension) IN ({}) + AND materialized_path = {{}} + ORDER BY name ASC", + extensions + .iter() + .map(|ext| format!("LOWER('{ext}')")) + .collect::>() + .join(",") + ), + PrismaValue::Int(parent_iso_file_path.location_id()), + PrismaValue::String( + parent_iso_file_path + .materialized_path_for_children() + .expect("sub path iso_file_path must be a directory") + ) + )) + .exec() + .await? + .into_iter() + .map(|raw_file_path| (raw_file_path.object_id, raw_file_path)) + .collect::>(); + + Ok(unique_by_object_id.into_values().map(Into::into).collect()) +} diff --git a/core/crates/heavy-lifting/src/media_processor/shallow.rs b/core/crates/heavy-lifting/src/media_processor/shallow.rs new file mode 100644 index 000000000..b74c8c063 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/shallow.rs @@ -0,0 +1,271 @@ +use crate::{ + media_processor, utils::sub_path::maybe_get_iso_file_path_from_sub_path, Error, + NonCriticalError, OuterContext, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_sync::Manager as SyncManager; + +use sd_prisma::prisma::{location, PrismaClient}; +use sd_task_system::{ + BaseTaskDispatcher, CancelTaskOnDrop, IntoTask, TaskDispatcher, TaskHandle, TaskOutput, + TaskStatus, +}; +use sd_utils::db::maybe_missing; + +use std::{ + path::{Path, PathBuf}, + sync::Arc, +}; + +use futures::{stream::FuturesUnordered, StreamExt}; +use futures_concurrency::future::TryJoin; +use itertools::Itertools; +use tracing::{debug, warn}; + +use super::{ + get_direct_children_files_by_extensions, + helpers::{self, exif_media_data, ffmpeg_media_data, thumbnailer::THUMBNAIL_CACHE_DIR_NAME}, + tasks::{ + self, media_data_extractor, + thumbnailer::{self, NewThumbnailReporter}, + }, + NewThumbnailsReporter, BATCH_SIZE, +}; + +#[allow(clippy::missing_panics_doc)] // SAFETY: It doesn't actually panics +pub async fn shallow( + location: location::Data, + sub_path: impl AsRef + Send, + dispatcher: &BaseTaskDispatcher, + ctx: &impl OuterContext, +) -> Result, Error> { + let sub_path = sub_path.as_ref(); + + let location_path = maybe_missing(&location.path, "location.path") + .map(PathBuf::from) + .map(Arc::new) + .map_err(media_processor::Error::from)?; + + let location = Arc::new(location); + + let sub_iso_file_path = maybe_get_iso_file_path_from_sub_path::( + location.id, + Some(sub_path), + &*location_path, + ctx.db(), + ) + .await? + .map_or_else( + || { + IsolatedFilePathData::new(location.id, &*location_path, &*location_path, true) + .map_err(media_processor::Error::from) + }, + Ok, + )?; + + let mut errors = vec![]; + + let media_data_extraction_tasks = dispatch_media_data_extractor_tasks( + ctx.db(), + ctx.sync(), + &sub_iso_file_path, + &location_path, + dispatcher, + ) + .await?; + + let total_media_data_extraction_tasks = media_data_extraction_tasks.len(); + + let thumbnailer_tasks = + dispatch_thumbnailer_tasks(&sub_iso_file_path, false, &location_path, dispatcher, ctx) + .await?; + + let total_thumbnailer_tasks = thumbnailer_tasks.len(); + + let mut futures = media_data_extraction_tasks + .into_iter() + .chain(thumbnailer_tasks.into_iter()) + .map(CancelTaskOnDrop::new) + .collect::>(); + + let mut completed_media_data_extraction_tasks = 0; + let mut completed_thumbnailer_tasks = 0; + + while let Some(res) = futures.next().await { + match res { + Ok(TaskStatus::Done((_, TaskOutput::Out(out)))) => { + if out.is::() { + let media_data_extractor::Output { + db_read_time, + filtering_time, + extraction_time, + db_write_time, + errors: new_errors, + .. + } = *out + .downcast::() + .expect("just checked"); + + errors.extend(new_errors); + + completed_media_data_extraction_tasks += 1; + + debug!( + "Media data extraction task ({completed_media_data_extraction_tasks}/\ + {total_media_data_extraction_tasks}) completed in {:?};", + db_read_time + filtering_time + extraction_time + db_write_time + ); + } else if out.is::() { + let thumbnailer::Output { + total_time, + errors: new_errors, + .. + } = *out.downcast::().expect("just checked"); + + errors.extend(new_errors); + + completed_thumbnailer_tasks += 1; + + debug!( + "Thumbnailer task ({completed_thumbnailer_tasks}/{total_thumbnailer_tasks}) \ + completed in {total_time:?};", + ); + } else { + unreachable!( + "Task returned unexpected output type on media processor shallow job" + ); + } + } + Ok(TaskStatus::Done((_, TaskOutput::Empty))) => { + warn!("Task returned empty output on media processor shallow job"); + } + Ok(TaskStatus::Canceled | TaskStatus::ForcedAbortion | TaskStatus::Shutdown(_)) => { + return Ok(errors); + } + Ok(TaskStatus::Error(e)) => return Err(e), + + Err(e) => return Err(e.into()), + } + } + + Ok(errors) +} + +async fn dispatch_media_data_extractor_tasks( + db: &Arc, + sync: &Arc, + parent_iso_file_path: &IsolatedFilePathData<'_>, + location_path: &Arc, + dispatcher: &BaseTaskDispatcher, +) -> Result>, Error> { + let (extract_exif_file_paths, extract_ffmpeg_file_paths) = ( + get_direct_children_files_by_extensions( + parent_iso_file_path, + &exif_media_data::AVAILABLE_EXTENSIONS, + db, + ), + get_direct_children_files_by_extensions( + parent_iso_file_path, + &ffmpeg_media_data::AVAILABLE_EXTENSIONS, + db, + ), + ) + .try_join() + .await?; + + let tasks = extract_exif_file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(Iterator::collect::>) + .map(|chunked_file_paths| { + tasks::MediaDataExtractor::new_exif( + &chunked_file_paths, + parent_iso_file_path.location_id(), + Arc::clone(location_path), + Arc::clone(db), + Arc::clone(sync), + ) + }) + .map(IntoTask::into_task) + .chain( + extract_ffmpeg_file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(Iterator::collect::>) + .map(|chunked_file_paths| { + tasks::MediaDataExtractor::new_ffmpeg( + &chunked_file_paths, + parent_iso_file_path.location_id(), + Arc::clone(location_path), + Arc::clone(db), + Arc::clone(sync), + ) + }) + .map(IntoTask::into_task), + ) + .collect::>(); + + dispatcher.dispatch_many_boxed(tasks).await.map_or_else( + |_| { + debug!("Task system is shutting down while a shallow media processor was in progress"); + Ok(vec![]) + }, + Ok, + ) +} + +async fn dispatch_thumbnailer_tasks( + parent_iso_file_path: &IsolatedFilePathData<'_>, + should_regenerate: bool, + location_path: &PathBuf, + dispatcher: &BaseTaskDispatcher, + ctx: &impl OuterContext, +) -> Result>, Error> { + let thumbnails_directory_path = + Arc::new(ctx.get_data_directory().join(THUMBNAIL_CACHE_DIR_NAME)); + let location_id = parent_iso_file_path.location_id(); + let library_id = ctx.id(); + let db = ctx.db(); + let reporter: Arc = + Arc::new(NewThumbnailsReporter { ctx: ctx.clone() }); + + let file_paths = get_direct_children_files_by_extensions( + parent_iso_file_path, + &helpers::thumbnailer::ALL_THUMBNAILABLE_EXTENSIONS, + db, + ) + .await?; + + let thumbs_count = file_paths.len() as u64; + + let tasks = file_paths + .into_iter() + .chunks(BATCH_SIZE) + .into_iter() + .map(|chunk| { + tasks::Thumbnailer::new_indexed( + Arc::clone(&thumbnails_directory_path), + &chunk.collect::>(), + (location_id, location_path), + library_id, + should_regenerate, + true, + Arc::clone(&reporter), + ) + }) + .map(IntoTask::into_task) + .collect::>(); + + debug!(%thumbs_count, priority_tasks_count = tasks.len(), "Dispatching thumbnails to be processed;"); + + dispatcher.dispatch_many_boxed(tasks).await.map_or_else( + |_| { + debug!("Task system is shutting down while a shallow media processor was in progress"); + Ok(vec![]) + }, + Ok, + ) +} diff --git a/core/crates/heavy-lifting/src/media_processor/tasks/media_data_extractor.rs b/core/crates/heavy-lifting/src/media_processor/tasks/media_data_extractor.rs new file mode 100644 index 000000000..30072b1c1 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/tasks/media_data_extractor.rs @@ -0,0 +1,604 @@ +use crate::{ + media_processor::{ + self, + helpers::{exif_media_data, ffmpeg_media_data}, + }, + Error, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_prisma_helpers::{file_path_for_media_processor, ObjectPubId}; +use sd_core_sync::Manager as SyncManager; + +use sd_media_metadata::{ExifMetadata, FFmpegMetadata}; +use sd_prisma::prisma::{exif_data, ffmpeg_data, file_path, location, object, PrismaClient}; +use sd_task_system::{ + check_interruption, ExecStatus, Interrupter, InterruptionKind, IntoAnyTaskOutput, + SerializableTask, Task, TaskId, +}; + +use std::{ + collections::{HashMap, HashSet}, + future::{Future, IntoFuture}, + mem, + path::{Path, PathBuf}, + pin::pin, + sync::Arc, + time::Duration, +}; + +use futures::{stream::FuturesUnordered, FutureExt, StreamExt}; +use futures_concurrency::future::Race; +use serde::{Deserialize, Serialize}; +use specta::Type; +use tokio::time::Instant; +use tracing::{debug, instrument, trace, Level}; + +#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type, Clone)] +pub enum NonCriticalMediaDataExtractorError { + #[error("failed to extract media data from : {1}", .0.display())] + FailedToExtractImageMediaData(PathBuf, String), + #[error("file path missing object id: ")] + FilePathMissingObjectId(file_path::id::Type), + #[error("failed to construct isolated file path data: : {1}")] + FailedToConstructIsolatedFilePathData(file_path::id::Type, String), +} + +#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] +enum Kind { + Exif, + FFmpeg, +} + +#[derive(Debug)] +pub struct MediaDataExtractor { + // Task control + id: TaskId, + kind: Kind, + + // Received input args + file_paths: Vec, + location_id: location::id::Type, + location_path: Arc, + + // Inner state + stage: Stage, + + // Out collector + output: Output, + + // Dependencies + db: Arc, + sync: Arc, +} + +#[derive(Debug, Serialize, Deserialize)] +enum Stage { + Starting, + FetchedObjectsAlreadyWithMediaData(Vec), + ExtractingMediaData { + paths_by_id: HashMap, + exif_media_datas: Vec<(ExifMetadata, object::id::Type, ObjectPubId)>, + ffmpeg_media_datas: Vec<(FFmpegMetadata, object::id::Type)>, + extract_ids_to_remove_from_map: Vec, + }, + SaveMediaData { + exif_media_datas: Vec<(ExifMetadata, object::id::Type, ObjectPubId)>, + ffmpeg_media_datas: Vec<(FFmpegMetadata, object::id::Type)>, + }, +} + +/// [`MediaDataExtractor`] task output +#[derive(Serialize, Deserialize, Default, Debug)] +pub struct Output { + /// How many files were successfully processed + pub extracted: u64, + /// How many files were skipped + pub skipped: u64, + /// Time spent reading data from database + pub db_read_time: Duration, + /// Time spent filtering files to extract media data and files to skip + pub filtering_time: Duration, + /// Time spent extracting media data + pub extraction_time: Duration, + /// Time spent writing media data to database + pub db_write_time: Duration, + /// Errors encountered during the task + pub errors: Vec, +} + +#[async_trait::async_trait] +impl Task for MediaDataExtractor { + fn id(&self) -> TaskId { + self.id + } + + /// MediaDataExtractor never needs priority, as the data it generates are only accessed through + /// the media inspector, so it isn't latency sensitive like other tasks, like FileIdentifier or + /// the Thumbnailer + fn with_priority(&self) -> bool { + false + } + + #[instrument( + skip_all, + fields( + task_id = %self.id, + kind = ?self.kind, + location_id = %self.location_id, + location_path = %self.location_path.display(), + file_paths_count = %self.file_paths.len(), + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above + #[allow(clippy::too_many_lines)] + async fn run(&mut self, interrupter: &Interrupter) -> Result { + loop { + match &mut self.stage { + Stage::Starting => { + let db_read_start = Instant::now(); + let object_ids = fetch_objects_already_with_media_data( + self.kind, + &self.file_paths, + &self.db, + ) + .await?; + self.output.db_read_time = db_read_start.elapsed(); + trace!( + object_ids_count = object_ids.len(), + "Fetched objects already with media data;", + ); + + self.stage = Stage::FetchedObjectsAlreadyWithMediaData(object_ids); + } + + Stage::FetchedObjectsAlreadyWithMediaData(objects_already_with_media_data) => { + if self.file_paths.len() == objects_already_with_media_data.len() { + self.output.skipped = self.file_paths.len() as u64; // Files already have media data, skipping + debug!("Skipped all files as they already have media data"); + break; + } + + let filtering_start = Instant::now(); + let paths_by_id = filter_files_to_extract_media_data( + mem::take(objects_already_with_media_data), + self.location_id, + &self.location_path, + &mut self.file_paths, + &mut self.output, + ); + self.output.filtering_time = filtering_start.elapsed(); + + trace!( + paths_needing_media_data_extraction_count = paths_by_id.len(), + "Filtered files to extract media data;", + ); + + self.stage = Stage::ExtractingMediaData { + extract_ids_to_remove_from_map: Vec::with_capacity(paths_by_id.len()), + exif_media_datas: if self.kind == Kind::Exif { + Vec::with_capacity(paths_by_id.len()) + } else { + Vec::new() + }, + ffmpeg_media_datas: if self.kind == Kind::FFmpeg { + Vec::with_capacity(paths_by_id.len()) + } else { + Vec::new() + }, + paths_by_id, + }; + } + + Stage::ExtractingMediaData { + paths_by_id, + exif_media_datas, + ffmpeg_media_datas, + extract_ids_to_remove_from_map, + } => { + { + // This inner scope is necessary to appease the mighty borrowck + let extraction_start = Instant::now(); + for id in extract_ids_to_remove_from_map.drain(..) { + paths_by_id.remove(&id); + } + + let mut futures = pin!(prepare_extraction_futures( + self.kind, + paths_by_id, + interrupter + )); + + while let Some(race_output) = futures.next().await { + match race_output { + InterruptRace::Processed(out) => { + process_output( + out, + exif_media_datas, + ffmpeg_media_datas, + extract_ids_to_remove_from_map, + &mut self.output, + ); + } + + InterruptRace::Interrupted(kind) => { + self.output.extraction_time += extraction_start.elapsed(); + return Ok(match kind { + InterruptionKind::Pause => ExecStatus::Paused, + InterruptionKind::Cancel => ExecStatus::Canceled, + }); + } + } + } + } + + self.stage = Stage::SaveMediaData { + exif_media_datas: mem::take(exif_media_datas), + ffmpeg_media_datas: mem::take(ffmpeg_media_datas), + }; + } + + Stage::SaveMediaData { + exif_media_datas, + ffmpeg_media_datas, + } => { + let db_write_start = Instant::now(); + self.output.extracted = save( + self.kind, + exif_media_datas, + ffmpeg_media_datas, + &self.db, + &self.sync, + ) + .await?; + self.output.db_write_time = db_write_start.elapsed(); + + self.output.skipped += self.output.errors.len() as u64; + + break; + } + } + + check_interruption!(interrupter); + } + + Ok(ExecStatus::Done(mem::take(&mut self.output).into_output())) + } +} + +impl MediaDataExtractor { + fn new( + kind: Kind, + file_paths: &[file_path_for_media_processor::Data], + location_id: location::id::Type, + location_path: Arc, + db: Arc, + sync: Arc, + ) -> Self { + let mut output = Output::default(); + + Self { + id: TaskId::new_v4(), + kind, + file_paths: file_paths + .iter() + .filter(|file_path| { + if file_path.object.is_some() { + true + } else { + output.errors.push( + media_processor::NonCriticalMediaProcessorError::from( + NonCriticalMediaDataExtractorError::FilePathMissingObjectId( + file_path.id, + ), + ) + .into(), + ); + false + } + }) + .cloned() + .collect(), + location_id, + location_path, + stage: Stage::Starting, + db, + sync, + output, + } + } + + #[must_use] + pub fn new_exif( + file_paths: &[file_path_for_media_processor::Data], + location_id: location::id::Type, + location_path: Arc, + db: Arc, + sync: Arc, + ) -> Self { + Self::new(Kind::Exif, file_paths, location_id, location_path, db, sync) + } + + #[must_use] + pub fn new_ffmpeg( + file_paths: &[file_path_for_media_processor::Data], + location_id: location::id::Type, + location_path: Arc, + db: Arc, + sync: Arc, + ) -> Self { + Self::new( + Kind::FFmpeg, + file_paths, + location_id, + location_path, + db, + sync, + ) + } +} + +#[inline] +async fn fetch_objects_already_with_media_data( + kind: Kind, + file_paths: &[file_path_for_media_processor::Data], + db: &PrismaClient, +) -> Result, media_processor::Error> { + let object_ids = file_paths + .iter() + .filter_map(|file_path| file_path.object.as_ref().map(|object| object.id)) + .collect(); + + match kind { + Kind::Exif => db + .exif_data() + .find_many(vec![exif_data::object_id::in_vec(object_ids)]) + .select(exif_data::select!({ object_id })) + .exec() + .await + .map(|object_ids| object_ids.into_iter().map(|data| data.object_id).collect()) + .map_err(Into::into), + + Kind::FFmpeg => db + .ffmpeg_data() + .find_many(vec![ffmpeg_data::object_id::in_vec(object_ids)]) + .select(ffmpeg_data::select!({ object_id })) + .exec() + .await + .map(|object_ids| object_ids.into_iter().map(|data| data.object_id).collect()) + .map_err(Into::into), + } +} + +#[inline] +fn filter_files_to_extract_media_data( + objects_already_with_media_data: Vec, + location_id: location::id::Type, + location_path: &Path, + file_paths: &mut Vec, + Output { + skipped, errors, .. + }: &mut Output, +) -> HashMap { + let unique_objects_already_with_media_data = objects_already_with_media_data + .into_iter() + .collect::>(); + + *skipped = unique_objects_already_with_media_data.len() as u64; + + file_paths.retain(|file_path| { + !unique_objects_already_with_media_data + .contains(&file_path.object.as_ref().expect("already checked").id) + }); + + file_paths + .iter() + .filter_map(|file_path| { + IsolatedFilePathData::try_from((location_id, file_path)) + .map_err(|e| { + errors.push( + media_processor::NonCriticalMediaProcessorError::from( + NonCriticalMediaDataExtractorError::FailedToConstructIsolatedFilePathData( + file_path.id, + e.to_string(), + ), + ) + .into(), + ); + }) + .map(|iso_file_path| { + let object = file_path.object.as_ref().expect("already checked"); + + ( + file_path.id, + ( + location_path.join(iso_file_path), + object.id, + object.pub_id.as_slice().into(), + ), + ) + }) + .ok() + }) + .collect() +} + +enum ExtractionOutputKind { + Exif(Result, media_processor::NonCriticalMediaProcessorError>), + FFmpeg(Result), +} + +struct ExtractionOutput { + file_path_id: file_path::id::Type, + object_id: object::id::Type, + object_pub_id: ObjectPubId, + kind: ExtractionOutputKind, +} + +#[allow(clippy::large_enum_variant)] +/* + * NOTE(fogodev): Interrupts will be pretty rare, so paying the boxing price for + * the Processed variant isn't worth it to avoid the enum size disparity between variants + */ +enum InterruptRace { + Interrupted(InterruptionKind), + Processed(ExtractionOutput), +} + +#[inline] +fn prepare_extraction_futures<'a>( + kind: Kind, + paths_by_id: &'a HashMap, + interrupter: &'a Interrupter, +) -> FuturesUnordered + 'a> { + paths_by_id + .iter() + .map( + |(file_path_id, (path, object_id, object_pub_id))| async move { + InterruptRace::Processed(ExtractionOutput { + file_path_id: *file_path_id, + object_id: *object_id, + object_pub_id: object_pub_id.clone(), + kind: match kind { + Kind::Exif => { + ExtractionOutputKind::Exif(exif_media_data::extract(path).await) + } + Kind::FFmpeg => { + ExtractionOutputKind::FFmpeg(ffmpeg_media_data::extract(path).await) + } + }, + }) + }, + ) + .map(|fut| { + ( + fut, + interrupter.into_future().map(InterruptRace::Interrupted), + ) + .race() + }) + .collect::>() +} + +#[instrument(skip_all, fields(%file_path_id, %object_id))] +#[inline] +fn process_output( + ExtractionOutput { + file_path_id, + object_id, + object_pub_id, + kind, + }: ExtractionOutput, + exif_media_datas: &mut Vec<(ExifMetadata, object::id::Type, ObjectPubId)>, + ffmpeg_media_datas: &mut Vec<(FFmpegMetadata, object::id::Type)>, + extract_ids_to_remove_from_map: &mut Vec, + output: &mut Output, +) { + trace!("Processing extracted media data"); + + match kind { + ExtractionOutputKind::Exif(Ok(Some(exif_data))) => { + exif_media_datas.push((exif_data, object_id, object_pub_id)); + } + ExtractionOutputKind::Exif(Ok(None)) => { + // No exif media data found + output.skipped += 1; + } + ExtractionOutputKind::FFmpeg(Ok(ffmpeg_data)) => { + ffmpeg_media_datas.push((ffmpeg_data, object_id)); + } + ExtractionOutputKind::Exif(Err(e)) | ExtractionOutputKind::FFmpeg(Err(e)) => { + output.errors.push(e.into()); + } + } + + extract_ids_to_remove_from_map.push(file_path_id); +} + +#[inline] +async fn save( + kind: Kind, + exif_media_datas: &mut Vec<(ExifMetadata, object::id::Type, ObjectPubId)>, + ffmpeg_media_datas: &mut Vec<(FFmpegMetadata, object::id::Type)>, + db: &PrismaClient, + sync: &SyncManager, +) -> Result { + trace!("Saving media data on database"); + + match kind { + Kind::Exif => exif_media_data::save(mem::take(exif_media_datas), db, sync).await, + Kind::FFmpeg => ffmpeg_media_data::save(mem::take(ffmpeg_media_datas), db).await, + } + .map_err(Into::into) +} + +#[derive(Debug, Serialize, Deserialize)] +struct SaveState { + id: TaskId, + kind: Kind, + file_paths: Vec, + location_id: location::id::Type, + location_path: Arc, + stage: Stage, + output: Output, +} + +impl SerializableTask for MediaDataExtractor { + type SerializeError = rmp_serde::encode::Error; + + type DeserializeError = rmp_serde::decode::Error; + + type DeserializeCtx = (Arc, Arc); + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + kind, + file_paths, + location_id, + location_path, + stage, + output, + .. + } = self; + + rmp_serde::to_vec_named(&SaveState { + id, + kind, + file_paths, + location_id, + location_path, + stage, + output, + }) + } + + async fn deserialize( + data: &[u8], + (db, sync): Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice(data).map( + |SaveState { + id, + kind, + file_paths, + location_id, + location_path, + stage, + output, + }| Self { + id, + kind, + file_paths, + location_id, + location_path, + stage, + output, + db, + sync, + }, + ) + } +} diff --git a/core/crates/heavy-lifting/src/media_processor/tasks/mod.rs b/core/crates/heavy-lifting/src/media_processor/tasks/mod.rs new file mode 100644 index 000000000..cb88d09d0 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/tasks/mod.rs @@ -0,0 +1,5 @@ +pub mod media_data_extractor; +pub mod thumbnailer; + +pub use media_data_extractor::MediaDataExtractor; +pub use thumbnailer::Thumbnailer; diff --git a/core/crates/heavy-lifting/src/media_processor/tasks/thumbnailer.rs b/core/crates/heavy-lifting/src/media_processor/tasks/thumbnailer.rs new file mode 100644 index 000000000..0180014a9 --- /dev/null +++ b/core/crates/heavy-lifting/src/media_processor/tasks/thumbnailer.rs @@ -0,0 +1,489 @@ +//! Thumbnails directory have the following structure: +//! thumbnails/ +//! ├── version.txt +//! ├── ephemeral/ # ephemeral ones have it's own directory +//! │ └── <`cas_id`>[0..3]/ # sharding +//! │ └── <`cas_id`>.webp +//! └── <`library_id`>/ # we segregate thumbnails by library +//! └── <`cas_id`>[0..3]/ # sharding +//! └── <`cas_id`>.webp + +use crate::{ + media_processor::{ + self, + helpers::thumbnailer::{ + generate_thumbnail, GenerateThumbnailArgs, GenerationStatus, THUMBNAILER_TASK_TIMEOUT, + }, + ThumbKey, ThumbnailKind, + }, + Error, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_prisma_helpers::{file_path_for_media_processor, CasId}; + +use sd_prisma::prisma::{file_path, location}; +use sd_task_system::{ + ExecStatus, Interrupter, InterruptionKind, IntoAnyTaskOutput, SerializableTask, Task, TaskId, +}; + +use std::{ + collections::HashMap, + fmt, + future::IntoFuture, + mem, + path::{Path, PathBuf}, + pin::pin, + sync::Arc, + time::Duration, +}; + +use futures::{stream::FuturesUnordered, FutureExt, StreamExt}; +use futures_concurrency::future::Race; +use serde::{Deserialize, Serialize}; +use specta::Type; +use tokio::time::Instant; +use tracing::{error, instrument, trace, Level}; +use uuid::Uuid; + +pub type ThumbnailId = u32; + +pub trait NewThumbnailReporter: Send + Sync + fmt::Debug + 'static { + fn new_thumbnail(&self, thumb_key: ThumbKey); +} + +#[derive(Debug)] +pub struct Thumbnailer { + // Task control + id: TaskId, + with_priority: bool, + + // Received input args + thumbs_kind: ThumbnailKind, + thumbnails_directory_path: Arc, + thumbnails_to_generate: HashMap>, + should_regenerate: bool, + + // Inner state + already_processed_ids: Vec, + + // Out collector + output: Output, + + // Dependencies + reporter: Arc, +} + +#[async_trait::async_trait] +impl Task for Thumbnailer { + fn id(&self) -> TaskId { + self.id + } + + fn with_priority(&self) -> bool { + self.with_priority + } + + fn with_timeout(&self) -> Option { + Some(THUMBNAILER_TASK_TIMEOUT) // The entire task must not take more than this constant + } + + #[instrument( + skip_all, + fields( + task_id = %self.id, + thumbs_kind = ?self.thumbs_kind, + should_regenerate = self.should_regenerate, + thumbnails_to_generate_count = self.thumbnails_to_generate.len(), + already_processed_ids_count = self.already_processed_ids.len(), + with_priority = self.with_priority, + ), + ret(level = Level::TRACE), + err, + )] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on `instrument` macro above + async fn run(&mut self, interrupter: &Interrupter) -> Result { + enum InterruptRace { + Interrupted(InterruptionKind), + Processed(ThumbnailGenerationOutput), + } + + let Self { + thumbs_kind, + thumbnails_directory_path, + thumbnails_to_generate, + already_processed_ids, + should_regenerate, + with_priority, + reporter, + output, + .. + } = self; + + // Removing already processed thumbnails from a possible previous run + already_processed_ids.drain(..).for_each(|id| { + thumbnails_to_generate.remove(&id); + }); + + let start = Instant::now(); + + let futures = thumbnails_to_generate + .iter() + .map(|(id, generate_args)| { + generate_thumbnail( + thumbnails_directory_path, + generate_args, + thumbs_kind, + *should_regenerate, + ) + .map(|res| InterruptRace::Processed((*id, res))) + }) + .map(|fut| { + ( + fut, + interrupter.into_future().map(InterruptRace::Interrupted), + ) + .race() + }) + .collect::>(); + + let mut futures = pin!(futures); + + while let Some(race_output) = futures.next().await { + match race_output { + InterruptRace::Processed(out) => process_thumbnail_generation_output( + out, + *with_priority, + reporter.as_ref(), + already_processed_ids, + output, + ), + + InterruptRace::Interrupted(kind) => { + output.total_time += start.elapsed(); + return Ok(match kind { + InterruptionKind::Pause => ExecStatus::Paused, + InterruptionKind::Cancel => ExecStatus::Canceled, + }); + } + } + } + + output.total_time += start.elapsed(); + + if output.generated > 1 { + #[allow(clippy::cast_precision_loss)] + // SAFETY: we're probably won't have 2^52 thumbnails being generated on a single task for this cast to have + // a precision loss issue + let total = (output.generated + output.skipped) as f64; + let mean_generation_time_f64 = output.mean_time_acc / total; + + trace!( + generated = output.generated, + skipped = output.skipped, + "mean generation time: {mean_generation_time:?} ± {generation_time_std_dev:?};", + mean_generation_time = Duration::from_secs_f64(mean_generation_time_f64), + generation_time_std_dev = Duration::from_secs_f64( + (mean_generation_time_f64 + .mul_add(-mean_generation_time_f64, output.std_dev_acc / total)) + .sqrt(), + ) + ); + } + + Ok(ExecStatus::Done(mem::take(output).into_output())) + } +} + +#[derive(Serialize, Deserialize, Default, Debug)] +pub struct Output { + pub generated: u64, + pub skipped: u64, + pub errors: Vec, + pub total_time: Duration, + pub mean_time_acc: f64, + pub std_dev_acc: f64, +} + +#[derive(thiserror::Error, Debug, Serialize, Deserialize, Type, Clone)] +pub enum NonCriticalThumbnailerError { + #[error("file path has no cas_id")] + MissingCasId(file_path::id::Type), + #[error("failed to extract isolated file path data from file path : {1}")] + FailedToExtractIsolatedFilePathData(file_path::id::Type, String), + #[error("failed to generate video file thumbnail : {1}", .0.display())] + VideoThumbnailGenerationFailed(PathBuf, String), + #[error("failed to format image : {1}", .0.display())] + FormatImage(PathBuf, String), + #[error("failed to encode webp image : {1}", .0.display())] + WebPEncoding(PathBuf, String), + #[error("processing thread panicked while generating thumbnail from : {1}", .0.display())] + PanicWhileGeneratingThumbnail(PathBuf, String), + #[error("failed to create shard directory for thumbnail: {0}")] + CreateShardDirectory(String), + #[error("failed to save thumbnail : {1}", .0.display())] + SaveThumbnail(PathBuf, String), + #[error("task timed out: {0}")] + TaskTimeout(TaskId), +} + +impl Thumbnailer { + fn new( + thumbs_kind: ThumbnailKind, + thumbnails_directory_path: Arc, + thumbnails_to_generate: HashMap>, + errors: Vec, + should_regenerate: bool, + with_priority: bool, + reporter: Arc, + ) -> Self { + Self { + id: TaskId::new_v4(), + thumbs_kind, + thumbnails_directory_path, + already_processed_ids: Vec::with_capacity(thumbnails_to_generate.len()), + thumbnails_to_generate, + should_regenerate, + with_priority, + output: Output { + errors, + ..Default::default() + }, + reporter, + } + } + + #[must_use] + pub fn new_ephemeral( + thumbnails_directory_path: Arc, + thumbnails_to_generate: Vec>, + reporter: Arc, + ) -> Self { + Self::new( + ThumbnailKind::Ephemeral, + thumbnails_directory_path, + thumbnails_to_generate + .into_iter() + .enumerate() + .map(|(i, args)| { + #[allow(clippy::cast_possible_truncation)] + { + // SAFETY: it's fine, we will never process more than 4 billion thumbnails + // on a single task LMAO + (i as ThumbnailId, args) + } + }) + .collect(), + Vec::new(), + false, + true, + reporter, + ) + } + + #[must_use] + pub fn new_indexed( + thumbnails_directory_path: Arc, + file_paths: &[file_path_for_media_processor::Data], + (location_id, location_path): (location::id::Type, &Path), + library_id: Uuid, + should_regenerate: bool, + with_priority: bool, + reporter: Arc, + ) -> Self { + let mut errors = Vec::new(); + + Self::new( + ThumbnailKind::Indexed(library_id), + thumbnails_directory_path, + file_paths + .iter() + .filter_map(|file_path| { + if let Some(cas_id) = file_path + .cas_id + .as_ref() + .map(CasId::from) + .map(CasId::into_owned) + { + let file_path_id = file_path.id; + IsolatedFilePathData::try_from((location_id, file_path)) + .map_err(|e| { + errors.push( + media_processor::NonCriticalMediaProcessorError::from( + NonCriticalThumbnailerError::FailedToExtractIsolatedFilePathData( + file_path_id, + e.to_string(), + ), + ) + .into(), + ); + }) + .ok() + .map(|iso_file_path| (file_path_id, cas_id, iso_file_path)) + } else { + errors.push( + media_processor::NonCriticalMediaProcessorError::from( + NonCriticalThumbnailerError::MissingCasId(file_path.id), + ) + .into(), + ); + None + } + }) + .map(|(file_path_id, cas_id, iso_file_path)| { + let full_path = location_path.join(&iso_file_path); + + #[allow(clippy::cast_sign_loss)] + { + ( + // SAFETY: db doesn't have negative indexes + file_path_id as u32, + GenerateThumbnailArgs::new( + iso_file_path.extension().to_string(), + cas_id, + full_path, + ), + ) + } + }) + .collect::>(), + errors, + should_regenerate, + with_priority, + reporter, + ) + } +} + +#[instrument(skip_all, fields(thumb_id = id, %generated, %skipped, ?elapsed_time, ?res))] +fn process_thumbnail_generation_output( + (id, (elapsed_time, res)): ThumbnailGenerationOutput, + with_priority: bool, + reporter: &dyn NewThumbnailReporter, + already_processed_ids: &mut Vec, + Output { + generated, + skipped, + errors, + mean_time_acc: mean_generation_time_accumulator, + std_dev_acc: std_dev_accumulator, + .. + }: &mut Output, +) { + let elapsed_time = elapsed_time.as_secs_f64(); + *mean_generation_time_accumulator += elapsed_time; + *std_dev_accumulator += elapsed_time * elapsed_time; + + match res { + Ok((thumb_key, status)) => { + match status { + GenerationStatus::Generated => { + *generated += 1; + } + GenerationStatus::Skipped => { + *skipped += 1; + } + } + + // This if is REALLY needed, due to the sheer performance of the thumbnailer, + // I restricted to only send events notifying for thumbnails in the current + // opened directory, sending events for the entire location turns into a + // humongous bottleneck in the frontend lol, since it doesn't even knows + // what to do with thumbnails for inner directories lol + // - fogodev + if with_priority { + reporter.new_thumbnail(thumb_key); + } + } + Err(e) => { + errors.push(media_processor::NonCriticalMediaProcessorError::from(e).into()); + *skipped += 1; + } + } + + already_processed_ids.push(id); + + trace!("Thumbnail processed"); +} + +#[derive(Debug, Serialize, Deserialize)] +struct SaveState { + id: TaskId, + thumbs_kind: ThumbnailKind, + thumbnails_directory_path: Arc, + thumbnails_to_generate: HashMap>, + should_regenerate: bool, + with_priority: bool, + output: Output, +} + +impl SerializableTask for Thumbnailer { + type SerializeError = rmp_serde::encode::Error; + + type DeserializeError = rmp_serde::decode::Error; + + type DeserializeCtx = Arc; + + async fn serialize(self) -> Result, Self::SerializeError> { + let Self { + id, + thumbs_kind, + thumbnails_directory_path, + mut thumbnails_to_generate, + already_processed_ids, + should_regenerate, + with_priority, + output, + .. + } = self; + + for id in already_processed_ids { + thumbnails_to_generate.remove(&id); + } + + rmp_serde::to_vec_named(&SaveState { + id, + thumbs_kind, + thumbnails_directory_path, + thumbnails_to_generate, + should_regenerate, + with_priority, + output, + }) + } + + async fn deserialize( + data: &[u8], + reporter: Self::DeserializeCtx, + ) -> Result { + rmp_serde::from_slice(data).map( + |SaveState { + id, + thumbs_kind, + thumbnails_to_generate, + thumbnails_directory_path, + should_regenerate, + with_priority, + output, + }| Self { + id, + reporter, + thumbs_kind, + thumbnails_to_generate, + thumbnails_directory_path, + already_processed_ids: Vec::new(), + should_regenerate, + with_priority, + output, + }, + ) + } +} + +type ThumbnailGenerationOutput = ( + ThumbnailId, + ( + Duration, + Result<(ThumbKey, GenerationStatus), NonCriticalThumbnailerError>, + ), +); diff --git a/core/crates/heavy-lifting/src/utils/mod.rs b/core/crates/heavy-lifting/src/utils/mod.rs new file mode 100644 index 000000000..538257e2c --- /dev/null +++ b/core/crates/heavy-lifting/src/utils/mod.rs @@ -0,0 +1 @@ +pub mod sub_path; diff --git a/core/crates/heavy-lifting/src/utils/sub_path.rs b/core/crates/heavy-lifting/src/utils/sub_path.rs new file mode 100644 index 000000000..ea188e133 --- /dev/null +++ b/core/crates/heavy-lifting/src/utils/sub_path.rs @@ -0,0 +1,113 @@ +use sd_core_file_path_helper::{ + ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, + FilePathError, IsolatedFilePathData, +}; + +use sd_prisma::prisma::{location, PrismaClient}; + +use std::path::{Path, PathBuf}; + +use prisma_client_rust::QueryError; +use rspc::ErrorCode; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error("received sub path not in database: ", .0.display())] + SubPathNotFound(Box), + + #[error("database error: {0}")] + Database(#[from] QueryError), + + #[error(transparent)] + IsoFilePath(#[from] FilePathError), +} + +impl From for rspc::Error { + fn from(e: Error) -> Self { + match e { + Error::SubPathNotFound(_) => Self::with_cause(ErrorCode::NotFound, e.to_string(), e), + + _ => Self::with_cause(ErrorCode::InternalServerError, e.to_string(), e), + } + } +} + +pub async fn get_full_path_from_sub_path>( + location_id: location::id::Type, + sub_path: Option + Send + Sync>, + location_path: impl AsRef + Send, + db: &PrismaClient, +) -> Result { + async fn inner( + location_id: location::id::Type, + sub_path: Option<&Path>, + location_path: &Path, + db: &PrismaClient, + ) -> Result { + match sub_path { + Some(sub_path) if sub_path != Path::new("") => { + let full_path = ensure_sub_path_is_in_location(location_path, sub_path).await?; + + ensure_sub_path_is_directory(location_path, sub_path).await?; + + ensure_file_path_exists( + sub_path, + &IsolatedFilePathData::new(location_id, location_path, &full_path, true)?, + db, + Error::SubPathNotFound, + ) + .await?; + + Ok(full_path) + } + _ => Ok(location_path.to_path_buf()), + } + } + + inner( + location_id, + sub_path.as_ref().map(AsRef::as_ref), + location_path.as_ref(), + db, + ) + .await + .map_err(E::from) +} + +pub async fn maybe_get_iso_file_path_from_sub_path>( + location_id: location::id::Type, + sub_path: Option + Send + Sync>, + location_path: impl AsRef + Send, + db: &PrismaClient, +) -> Result>, E> { + async fn inner( + location_id: location::id::Type, + sub_path: Option<&Path>, + location_path: &Path, + db: &PrismaClient, + ) -> Result>, Error> { + match sub_path { + Some(sub_path) if sub_path != Path::new("") => { + let full_path = ensure_sub_path_is_in_location(location_path, sub_path).await?; + ensure_sub_path_is_directory(location_path, sub_path).await?; + + let sub_iso_file_path = + IsolatedFilePathData::new(location_id, location_path, &full_path, true)?; + + ensure_file_path_exists(sub_path, &sub_iso_file_path, db, Error::SubPathNotFound) + .await + .map(|()| Some(sub_iso_file_path)) + } + _ => Ok(None), + } + } + + inner( + location_id, + sub_path.as_ref().map(AsRef::as_ref), + location_path.as_ref(), + db, + ) + .await + .map_err(E::from) +} diff --git a/core/crates/indexer-rules/Cargo.toml b/core/crates/indexer-rules/Cargo.toml index 5ac05ea8f..10f5f476b 100644 --- a/core/crates/indexer-rules/Cargo.toml +++ b/core/crates/indexer-rules/Cargo.toml @@ -1,21 +1,25 @@ [package] name = "sd-core-indexer-rules" version = "0.1.0" -authors = ["Ericson Soares "] +authors = [ + "Ericson Soares ", + "Vítor Vasconcellos ", +] license = { workspace = true } repository = { workspace = true } edition = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] # Spacedrive Sub-crates sd-prisma = { path = "../../../crates/prisma" } sd-utils = { path = "../../../crates/utils" } +# Workspace dependencies chrono = { workspace = true } futures-concurrency = { workspace = true } +gix-ignore = { workspace = true, features = ["serde"] } globset = { workspace = true, features = ["serde1"] } +once_cell = { workspace = true } prisma-client-rust = { workspace = true } rmp-serde = { workspace = true } rspc = { workspace = true } diff --git a/core/crates/indexer-rules/src/lib.rs b/core/crates/indexer-rules/src/lib.rs index 4e682955f..f239e6a27 100644 --- a/core/crates/indexer-rules/src/lib.rs +++ b/core/crates/indexer-rules/src/lib.rs @@ -32,32 +32,34 @@ use sd_utils::{ db::{maybe_missing, MissingFieldError}, error::{FileIOError, NonUtf8PathError}, }; +use seed::SystemIndexerRule; use serde::{Deserialize, Serialize}; use std::{ collections::{HashMap, HashSet}, fs::Metadata, - path::Path, + path::{Path, PathBuf}, sync::Arc, }; use chrono::{DateTime, Utc}; use futures_concurrency::future::TryJoin; +use gix_ignore::{glob::pattern::Case, Search}; use globset::{Glob, GlobSet, GlobSetBuilder}; use rmp_serde::{decode, encode}; use rspc::ErrorCode; use specta::Type; use thiserror::Error; -use tokio::{fs, sync::RwLock}; -use tracing::debug; +use tokio::fs; +use tracing::{debug, instrument, trace}; use uuid::Uuid; pub mod seed; mod serde_impl; #[derive(Error, Debug)] -pub enum IndexerRuleError { +pub enum Error { // User errors #[error("invalid indexer rule kind integer: {0}")] InvalidRuleKindInt(i32), @@ -81,16 +83,14 @@ pub enum IndexerRuleError { MissingField(#[from] MissingFieldError), } -impl From for rspc::Error { - fn from(err: IndexerRuleError) -> Self { - match err { - IndexerRuleError::InvalidRuleKindInt(_) - | IndexerRuleError::Glob(_) - | IndexerRuleError::NonUtf8Path(_) => { - Self::with_cause(ErrorCode::BadRequest, err.to_string(), err) +impl From for rspc::Error { + fn from(e: Error) -> Self { + match e { + Error::InvalidRuleKindInt(_) | Error::Glob(_) | Error::NonUtf8Path(_) => { + Self::with_cause(ErrorCode::BadRequest, e.to_string(), e) } - _ => Self::with_cause(ErrorCode::InternalServerError, err.to_string(), err), + _ => Self::with_cause(ErrorCode::InternalServerError, e.to_string(), e), } } } @@ -111,21 +111,17 @@ pub struct IndexerRuleCreateArgs { } impl IndexerRuleCreateArgs { - pub async fn create( - self, - db: &PrismaClient, - ) -> Result, IndexerRuleError> { + #[instrument(skip_all, fields(name = %self.name, rules = ?self.rules), err)] + pub async fn create(self, db: &PrismaClient) -> Result, Error> { use indexer_rule::{date_created, date_modified, name, rules_per_kind}; debug!( - "{} a new indexer rule (name = {}, params = {:?})", + "{} a new indexer rule", if self.dry_run { "Dry run: Would create" } else { "Trying to create" }, - self.name, - self.rules ); let rules_data = rmp_serde::to_vec_named( @@ -149,6 +145,9 @@ impl IndexerRuleCreateArgs { parameters.into_iter().collect(), )) } + RuleKind::IgnoredByGit => { + Ok(RulePerKind::IgnoredByGit(PathBuf::new(), Search::default())) + } }) .collect::, _>>()?, )?; @@ -162,7 +161,7 @@ impl IndexerRuleCreateArgs { Ok(Some( db.indexer_rule() .create( - sd_utils::uuid_to_bytes(generate_pub_id()), + sd_utils::uuid_to_bytes(&generate_pub_id()), vec![ name::set(Some(self.name)), rules_per_kind::set(Some(rules_data)), @@ -184,13 +183,14 @@ pub enum RuleKind { RejectFilesByGlob = 1, AcceptIfChildrenDirectoriesArePresent = 2, RejectIfChildrenDirectoriesArePresent = 3, + IgnoredByGit = 4, } impl RuleKind { #[must_use] pub const fn variant_count() -> usize { // TODO: Use https://doc.rust-lang.org/std/mem/fn.variant_count.html if it ever gets stabilized - 4 + 5 } } @@ -202,7 +202,7 @@ impl RuleKind { /// In case of `ParametersPerKind::AcceptIfChildrenDirectoriesArePresent` or /// `ParametersPerKind::RejectIfChildrenDirectoriesArePresent` /// first we change the data structure to a vector, then we serialize it. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum RulePerKind { // TODO: Add an indexer rule that filter files based on their extended attributes // https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants @@ -211,13 +211,14 @@ pub enum RulePerKind { RejectFilesByGlob(Vec, GlobSet), AcceptIfChildrenDirectoriesArePresent(HashSet), RejectIfChildrenDirectoriesArePresent(HashSet), + IgnoredByGit(PathBuf, Search), } impl RulePerKind { fn new_files_by_globs_str_and_kind( globs_str: impl IntoIterator>, kind_fn: impl Fn(Vec, GlobSet) -> Self, - ) -> Result { + ) -> Result { globs_str .into_iter() .map(|s| s.as_ref().parse::()) @@ -238,13 +239,13 @@ impl RulePerKind { pub fn new_accept_files_by_globs_str( globs_str: impl IntoIterator>, - ) -> Result { + ) -> Result { Self::new_files_by_globs_str_and_kind(globs_str, Self::AcceptFilesByGlob) } pub fn new_reject_files_by_globs_str( globs_str: impl IntoIterator>, - ) -> Result { + ) -> Result { Self::new_files_by_globs_str_and_kind(globs_str, Self::RejectFilesByGlob) } } @@ -260,47 +261,19 @@ impl MetadataForIndexerRules for Metadata { } impl RulePerKind { - #[deprecated = "Use `[apply_with_metadata]` instead"] async fn apply( &self, source: impl AsRef + Send, - ) -> Result<(RuleKind, bool), IndexerRuleError> { - match self { - Self::AcceptIfChildrenDirectoriesArePresent(children) => { - accept_dir_for_its_children(source, children) - .await - .map(|accepted| (RuleKind::AcceptIfChildrenDirectoriesArePresent, accepted)) - } - Self::RejectIfChildrenDirectoriesArePresent(children) => { - reject_dir_for_its_children(source, children) - .await - .map(|rejected| (RuleKind::RejectIfChildrenDirectoriesArePresent, rejected)) - } - - Self::AcceptFilesByGlob(_globs, accept_glob_set) => Ok(( - RuleKind::AcceptFilesByGlob, - accept_by_glob(source, accept_glob_set), - )), - Self::RejectFilesByGlob(_globs, reject_glob_set) => Ok(( - RuleKind::RejectFilesByGlob, - reject_by_glob(source, reject_glob_set), - )), - } - } - - async fn apply_with_metadata( - &self, - source: impl AsRef + Send, metadata: &impl MetadataForIndexerRules, - ) -> Result<(RuleKind, bool), IndexerRuleError> { + ) -> Result<(RuleKind, bool), Error> { match self { Self::AcceptIfChildrenDirectoriesArePresent(children) => { - accept_dir_for_its_children_with_metadata(source, metadata, children) + accept_dir_for_its_children(source, metadata, children) .await .map(|accepted| (RuleKind::AcceptIfChildrenDirectoriesArePresent, accepted)) } Self::RejectIfChildrenDirectoriesArePresent(children) => { - reject_dir_for_its_children_with_metadata(source, metadata, children) + reject_dir_for_its_children(source, metadata, children) .await .map(|rejected| (RuleKind::RejectIfChildrenDirectoriesArePresent, rejected)) } @@ -313,11 +286,37 @@ impl RulePerKind { RuleKind::RejectFilesByGlob, reject_by_glob(source, reject_glob_set), )), + Self::IgnoredByGit(base_dir, patterns) => Ok(( + RuleKind::IgnoredByGit, + accept_by_git_pattern(source, base_dir, patterns), + )), } } } -#[derive(Debug, Serialize, Deserialize)] +fn accept_by_git_pattern( + source: impl AsRef, + base_dir: impl AsRef, + search: &Search, +) -> bool { + fn inner(source: &Path, base_dir: &Path, search: &Search) -> bool { + let relative = source + .strip_prefix(base_dir) + .expect("`base_dir` should be our git repo, and `source` should be inside of it"); + + let Some(src) = relative.to_str().map(|s| s.as_bytes().into()) else { + return false; + }; + + search + .pattern_matching_relative_path(src, Some(source.is_dir()), Case::Fold) + .map_or(true, |rule| rule.pattern.is_negative()) + } + + inner(source.as_ref(), base_dir.as_ref(), search) +} + +#[derive(Debug, Serialize, Deserialize, Clone)] pub struct IndexerRule { pub id: Option, pub name: String, @@ -328,32 +327,19 @@ pub struct IndexerRule { } impl IndexerRule { - #[deprecated = "Use `[apply_with_metadata]` instead"] pub async fn apply( &self, source: impl AsRef + Send, - ) -> Result, IndexerRuleError> { - self.rules - .iter() - .map(|rule| rule.apply(source.as_ref())) - .collect::>() - .try_join() - .await - } - - pub async fn apply_with_metadata( - &self, - source: impl AsRef + Send, metadata: &impl MetadataForIndexerRules, - ) -> Result, IndexerRuleError> { + ) -> Result, Error> { async fn inner( rules: &[RulePerKind], source: &Path, metadata: &impl MetadataForIndexerRules, - ) -> Result, IndexerRuleError> { + ) -> Result, Error> { rules .iter() - .map(|rule| rule.apply_with_metadata(source, metadata)) + .map(|rule| rule.apply(source, metadata)) .collect::>() .try_join() .await @@ -361,65 +347,79 @@ impl IndexerRule { inner(&self.rules, source.as_ref(), metadata).await } - - #[deprecated = "Use `[IndexerRuler::apply_all]` instead"] - pub async fn apply_all( - rules: &[Self], - source: impl AsRef + Send, - ) -> Result>, IndexerRuleError> { - rules - .iter() - .map(|rule| rule.apply(source.as_ref())) - .collect::>() - .try_join() - .await - .map(|results| { - results.into_iter().flatten().fold( - HashMap::<_, Vec<_>>::with_capacity(RuleKind::variant_count()), - |mut map, (kind, result)| { - map.entry(kind).or_default().push(result); - map - }, - ) - }) - } } -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum RulerDecision { + Accept, + Reject, +} + +#[derive(Debug, Default, Serialize, Deserialize)] pub struct IndexerRuler { - // TODO(fogodev): Use this RwLock later to acquire new rules while applying rules, like from a .gitignore file - rules: Arc>>, + base: Arc>, + extra: Vec, +} + +impl Clone for IndexerRuler { + fn clone(&self) -> Self { + Self { + base: Arc::clone(&self.base), + // Each instance of IndexerRules MUST have its own extra rules no clones allowed! + extra: Vec::new(), + } + } } impl IndexerRuler { #[must_use] pub fn new(rules: Vec) -> Self { Self { - rules: Arc::new(RwLock::new(rules)), + base: Arc::new(rules), + extra: Vec::new(), } } - pub async fn serialize(&self) -> Result, rmp_serde::encode::Error> { - rmp_serde::to_vec_named(&*self.rules.read().await) - } + pub async fn evaluate_path( + &self, + source: impl AsRef + Send, + metadata: &impl MetadataForIndexerRules, + ) -> Result { + async fn inner( + this: &IndexerRuler, + source: &Path, + metadata: &impl MetadataForIndexerRules, + ) -> Result { + Ok( + if IndexerRuler::reject_path( + source, + metadata.is_dir(), + &this.apply_all(source, metadata).await?, + ) { + RulerDecision::Reject + } else { + RulerDecision::Accept + }, + ) + } - pub fn deserialize(data: &[u8]) -> Result { - rmp_serde::from_slice(data).map(Self::new) + inner(self, source.as_ref(), metadata).await } pub async fn apply_all( &self, source: impl AsRef + Send, metadata: &impl MetadataForIndexerRules, - ) -> Result>, IndexerRuleError> { + ) -> Result>, Error> { async fn inner( - rules: &[IndexerRule], + base: &[IndexerRule], + extra: &[IndexerRule], source: &Path, metadata: &impl MetadataForIndexerRules, - ) -> Result>, IndexerRuleError> { - rules - .iter() - .map(|rule| rule.apply_with_metadata(source, metadata)) + ) -> Result>, Error> { + base.iter() + .chain(extra.iter()) + .map(|rule| rule.apply(source, metadata)) .collect::>() .try_join() .await @@ -434,12 +434,99 @@ impl IndexerRuler { }) } - inner(&self.rules.read().await, source.as_ref(), metadata).await + inner(&self.base, &self.extra, source.as_ref(), metadata).await + } + + /// Extend the indexer rules with the contents from an iterator of rules + pub fn extend(&mut self, iter: impl IntoIterator + Send) { + self.extra.extend(iter); + } + + #[must_use] + pub fn has_system(&self, rule: &SystemIndexerRule) -> bool { + self.base + .iter() + .chain(self.extra.iter()) + .any(|inner_rule| rule == inner_rule) + } + + #[instrument(skip_all, fields(current_path = %current_path.display()))] + fn reject_path( + current_path: &Path, + is_dir: bool, + acceptance_per_rule_kind: &HashMap>, + ) -> bool { + Self::rejected_by_reject_glob(acceptance_per_rule_kind) + || Self::rejected_by_git_ignore(acceptance_per_rule_kind) + || (is_dir && Self::rejected_by_children_directories(acceptance_per_rule_kind)) + || Self::rejected_by_accept_glob(acceptance_per_rule_kind) + } + + pub fn rejected_by_accept_glob( + acceptance_per_rule_kind: &HashMap>, + ) -> bool { + let res = acceptance_per_rule_kind + .get(&RuleKind::AcceptFilesByGlob) + .map_or(false, |accept_rules| { + accept_rules.iter().all(|accept| !accept) + }); + + if res { + trace!("Reject because it didn't passed in any `RuleKind::AcceptFilesByGlob` rules"); + } + + res + } + + pub fn rejected_by_children_directories( + acceptance_per_rule_kind: &HashMap>, + ) -> bool { + let res = acceptance_per_rule_kind + .get(&RuleKind::RejectIfChildrenDirectoriesArePresent) + .map_or(false, |reject_results| { + reject_results.iter().any(|reject| !reject) + }); + + if res { + trace!("Rejected by rule `RuleKind::RejectIfChildrenDirectoriesArePresent`"); + } + + res + } + + pub fn rejected_by_reject_glob( + acceptance_per_rule_kind: &HashMap>, + ) -> bool { + let res = acceptance_per_rule_kind + .get(&RuleKind::RejectFilesByGlob) + .map_or(false, |reject_results| { + reject_results.iter().any(|reject| !reject) + }); + + if res { + trace!("Rejected by `RuleKind::RejectFilesByGlob`"); + } + + res + } + + pub fn rejected_by_git_ignore(acceptance_per_rule_kind: &HashMap>) -> bool { + let res = acceptance_per_rule_kind + .get(&RuleKind::IgnoredByGit) + .map_or(false, |reject_results| { + reject_results.iter().any(|reject| !reject) + }); + + if res { + trace!("Rejected by `RuleKind::IgnoredByGit`"); + } + + res } } impl TryFrom<&indexer_rule::Data> for IndexerRule { - type Error = IndexerRuleError; + type Error = Error; fn try_from(data: &indexer_rule::Data) -> Result { Ok(Self { @@ -457,7 +544,7 @@ impl TryFrom<&indexer_rule::Data> for IndexerRule { } impl TryFrom for IndexerRule { - type Error = IndexerRuleError; + type Error = Error; fn try_from(data: indexer_rule::Data) -> Result { Self::try_from(&data) @@ -472,140 +559,56 @@ fn reject_by_glob(source: impl AsRef, reject_glob_set: &GlobSet) -> bool { !accept_by_glob(source.as_ref(), reject_glob_set) } -#[deprecated = "Use `[accept_dir_for_its_children_with_metadata]` instead"] async fn accept_dir_for_its_children( - source: impl AsRef + Send, - children: &HashSet, -) -> Result { - let source = source.as_ref(); - - // FIXME(fogodev): Just check for io::ErrorKind::NotADirectory error instead (feature = "io_error_more", issue = "86442") - if !fs::metadata(source) - .await - .map_err(|e| IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))? - .is_dir() - { - return Ok(false); - } - - let mut read_dir = fs::read_dir(source) - .await // TODO: Check NotADirectory error here when available - .map_err(|e| IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))?; - while let Some(entry) = read_dir - .next_entry() - .await - .map_err(|e| IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))? - { - let entry_name = entry - .file_name() - .to_str() - .ok_or_else(|| NonUtf8PathError(entry.path().into()))? - .to_string(); - - if entry - .metadata() - .await - .map_err(|e| { - IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))) - })? - .is_dir() && children.contains(&entry_name) - { - return Ok(true); - } - } - - Ok(false) -} - -async fn accept_dir_for_its_children_with_metadata( source: impl AsRef + Send, metadata: &impl MetadataForIndexerRules, children: &HashSet, -) -> Result { - let source = source.as_ref(); - - // FIXME(fogodev): Just check for io::ErrorKind::NotADirectory error instead (feature = "io_error_more", issue = "86442") - if !metadata.is_dir() { - return Ok(false); - } - - let mut read_dir = fs::read_dir(source) - .await // TODO: Check NotADirectory error here when available - .map_err(|e| IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))?; - while let Some(entry) = read_dir - .next_entry() - .await - .map_err(|e| IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))? - { - let entry_name = entry - .file_name() - .to_str() - .ok_or_else(|| NonUtf8PathError(entry.path().into()))? - .to_string(); - - if entry - .metadata() - .await - .map_err(|e| { - IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))) - })? - .is_dir() && children.contains(&entry_name) - { - return Ok(true); - } - } - - Ok(false) -} - -#[deprecated = "Use `[reject_dir_for_its_children_with_metadata]` instead"] -async fn reject_dir_for_its_children( - source: impl AsRef + Send, - children: &HashSet, -) -> Result { - let source = source.as_ref(); - - // FIXME(fogodev): Just check for io::ErrorKind::NotADirectory error instead (feature = "io_error_more", issue = "86442") - if !fs::metadata(source) - .await - .map_err(|e| IndexerRuleError::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))? - .is_dir() - { - return Ok(true); - } - - let mut read_dir = fs::read_dir(source) - .await // TODO: Check NotADirectory error here when available - .map_err(|e| IndexerRuleError::RejectByItsChildrenFileIO(FileIOError::from((source, e))))?; - while let Some(entry) = read_dir - .next_entry() - .await - .map_err(|e| IndexerRuleError::RejectByItsChildrenFileIO(FileIOError::from((source, e))))? - { - if entry - .metadata() - .await - .map_err(|e| { - IndexerRuleError::RejectByItsChildrenFileIO(FileIOError::from((source, e))) - })? - .is_dir() && children.contains( - entry - .file_name() - .to_str() - .ok_or_else(|| NonUtf8PathError(entry.path().into()))?, - ) { +) -> Result { + async fn inner( + source: &Path, + metadata: &impl MetadataForIndexerRules, + children: &HashSet, + ) -> Result { + // FIXME(fogodev): Just check for io::ErrorKind::NotADirectory error instead (feature = "io_error_more", issue = "86442") + if !metadata.is_dir() { return Ok(false); } + + let mut read_dir = fs::read_dir(source) + .await // TODO: Check NotADirectory error here when available + .map_err(|e| Error::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))?; + while let Some(entry) = read_dir + .next_entry() + .await + .map_err(|e| Error::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))? + { + let entry_name = entry + .file_name() + .to_str() + .ok_or_else(|| NonUtf8PathError(entry.path().into()))? + .to_string(); + + if entry + .metadata() + .await + .map_err(|e| Error::AcceptByItsChildrenFileIO(FileIOError::from((source, e))))? + .is_dir() && children.contains(&entry_name) + { + return Ok(true); + } + } + + Ok(false) } - Ok(true) + inner(source.as_ref(), metadata, children).await } -async fn reject_dir_for_its_children_with_metadata( +async fn reject_dir_for_its_children( source: impl AsRef + Send, metadata: &impl MetadataForIndexerRules, children: &HashSet, -) -> Result { +) -> Result { let source = source.as_ref(); // FIXME(fogodev): Just check for io::ErrorKind::NotADirectory error instead (feature = "io_error_more", issue = "86442") @@ -615,18 +618,16 @@ async fn reject_dir_for_its_children_with_metadata( let mut read_dir = fs::read_dir(source) .await // TODO: Check NotADirectory error here when available - .map_err(|e| IndexerRuleError::RejectByItsChildrenFileIO(FileIOError::from((source, e))))?; + .map_err(|e| Error::RejectByItsChildrenFileIO(FileIOError::from((source, e))))?; while let Some(entry) = read_dir .next_entry() .await - .map_err(|e| IndexerRuleError::RejectByItsChildrenFileIO(FileIOError::from((source, e))))? + .map_err(|e| Error::RejectByItsChildrenFileIO(FileIOError::from((source, e))))? { if entry .metadata() .await - .map_err(|e| { - IndexerRuleError::RejectByItsChildrenFileIO(FileIOError::from((source, e))) - })? + .map_err(|e| Error::RejectByItsChildrenFileIO(FileIOError::from((source, e))))? .is_dir() && children.contains( entry .file_name() @@ -670,9 +671,37 @@ mod tests { } } - async fn check_rule(indexer_rule: &IndexerRule, path: impl AsRef + Send) -> bool { + fn check_rule(indexer_rule: &IndexerRule, path: impl AsRef) -> bool { + let path = path.as_ref(); indexer_rule - .apply(path) + .rules + .iter() + .map(|rule| match rule { + RulePerKind::AcceptFilesByGlob(_globs, accept_glob_set) => ( + RuleKind::AcceptFilesByGlob, + accept_by_glob(path, accept_glob_set), + ), + RulePerKind::RejectFilesByGlob(_globs, reject_glob_set) => ( + RuleKind::RejectFilesByGlob, + reject_by_glob(path, reject_glob_set), + ), + RulePerKind::IgnoredByGit(git_repo, patterns) => ( + RuleKind::IgnoredByGit, + accept_by_git_pattern(path, git_repo, patterns), + ), + + _ => unimplemented!("can't use simple `apply` for this rule: {:?}", rule), + }) + .all(|(_kind, res)| res) + } + + async fn check_rule_with_metadata( + indexer_rule: &IndexerRule, + path: impl AsRef + Send, + metadata: &impl MetadataForIndexerRules, + ) -> bool { + indexer_rule + .apply(path.as_ref(), metadata) .await .unwrap() .into_iter() @@ -699,12 +728,12 @@ mod tests { )], ); - assert!(!check_rule(&rule, hidden).await); - assert!(check_rule(&rule, normal).await); - assert!(!check_rule(&rule, hidden_inner_dir).await); - assert!(!check_rule(&rule, hidden_inner_file).await); - assert!(check_rule(&rule, normal_inner_dir).await); - assert!(check_rule(&rule, normal_inner_file).await); + assert!(!check_rule(&rule, hidden)); + assert!(check_rule(&rule, normal)); + assert!(!check_rule(&rule, hidden_inner_dir)); + assert!(!check_rule(&rule, hidden_inner_file)); + assert!(check_rule(&rule, normal_inner_dir)); + assert!(check_rule(&rule, normal_inner_file)); } #[tokio::test] @@ -725,9 +754,9 @@ mod tests { )], ); - assert!(check_rule(&rule, project_file).await); - assert!(!check_rule(&rule, project_build_dir).await); - assert!(!check_rule(&rule, project_build_dir_inner).await); + assert!(check_rule(&rule, project_file)); + assert!(!check_rule(&rule, project_build_dir)); + assert!(!check_rule(&rule, project_build_dir_inner)); } #[tokio::test] @@ -755,16 +784,16 @@ mod tests { )], ); - assert!(!check_rule(&rule, text).await); - assert!(check_rule(&rule, png).await); - assert!(check_rule(&rule, jpg).await); - assert!(check_rule(&rule, jpeg).await); - assert!(!check_rule(&rule, inner_text).await); - assert!(check_rule(&rule, inner_png).await); - assert!(check_rule(&rule, inner_jpg).await); - assert!(check_rule(&rule, inner_jpeg).await); - assert!(!check_rule(&rule, many_inner_dirs_text).await); - assert!(check_rule(&rule, many_inner_dirs_png).await); + assert!(!check_rule(&rule, text)); + assert!(check_rule(&rule, png)); + assert!(check_rule(&rule, jpg)); + assert!(check_rule(&rule, jpeg)); + assert!(!check_rule(&rule, inner_text)); + assert!(check_rule(&rule, inner_png)); + assert!(check_rule(&rule, inner_jpg)); + assert!(check_rule(&rule, inner_jpeg)); + assert!(!check_rule(&rule, many_inner_dirs_text)); + assert!(check_rule(&rule, many_inner_dirs_png)); } #[tokio::test] @@ -793,9 +822,22 @@ mod tests { )], ); - assert!(check_rule(&rule, project1).await); - assert!(check_rule(&rule, project2).await); - assert!(!check_rule(&rule, not_project).await); + assert!( + !check_rule_with_metadata(&rule, &project1, &fs::metadata(&project1).await.unwrap()) + .await + ); + assert!( + !check_rule_with_metadata(&rule, &project2, &fs::metadata(&project2).await.unwrap()) + .await + ); + assert!( + check_rule_with_metadata( + &rule, + ¬_project, + &fs::metadata(¬_project).await.unwrap() + ) + .await + ); } #[tokio::test] @@ -824,9 +866,22 @@ mod tests { )], ); - assert!(!check_rule(&rule, project1).await); - assert!(!check_rule(&rule, project2).await); - assert!(check_rule(&rule, not_project).await); + assert!( + !check_rule_with_metadata(&rule, &project1, &fs::metadata(&project1).await.unwrap()) + .await + ); + assert!( + !check_rule_with_metadata(&rule, &project2, &fs::metadata(&project2).await.unwrap()) + .await + ); + assert!( + check_rule_with_metadata( + &rule, + ¬_project, + &fs::metadata(¬_project).await.unwrap() + ) + .await + ); } impl PartialEq for RulePerKind { diff --git a/core/crates/indexer-rules/src/seed.rs b/core/crates/indexer-rules/src/seed.rs index 4205f1caa..173514630 100644 --- a/core/crates/indexer-rules/src/seed.rs +++ b/core/crates/indexer-rules/src/seed.rs @@ -1,25 +1,145 @@ use sd_prisma::prisma::{indexer_rule, PrismaClient}; +use std::path::{Path, PathBuf}; + use chrono::Utc; -use thiserror::Error; +use futures_concurrency::future::Join; +use gix_ignore::{glob::search::pattern::List, search::Ignore, Search}; +use once_cell::sync::Lazy; +use tokio::fs; use uuid::Uuid; -use super::{IndexerRule, IndexerRuleError, RulePerKind}; +use super::{Error, IndexerRule, RulePerKind}; -#[derive(Error, Debug)] +#[derive(thiserror::Error, Debug)] pub enum SeederError { #[error("Failed to run indexer rules seeder: {0}")] - IndexerRules(#[from] IndexerRuleError), + IndexerRules(#[from] Error), #[error("An error occurred with the database while applying migrations: {0}")] DatabaseError(#[from] prisma_client_rust::QueryError), + #[error("Failed to parse indexer rules based on external system")] + InheritedExternalRules, } +#[derive(Debug)] +pub struct GitIgnoreRules { + rules: RulePerKind, +} + +impl GitIgnoreRules { + pub async fn get_rules_if_in_git_repo( + location_root: &Path, + current: &Path, + ) -> Option> { + let mut git_repo = None; + + let mut ignores = Vec::new(); + + for ancestor in current + .ancestors() + .take_while(|&path| path.starts_with(location_root)) + { + let git_ignore = ancestor.join(".gitignore"); + + // consider any `.gitignore` files that are inside a git repo + if matches!(fs::try_exists(&git_ignore).await, Ok(true)) { + ignores.push(git_ignore); + } + + if Self::is_git_repo(ancestor).await { + git_repo.replace(ancestor); + break; + } + } + + let git_repo = git_repo?; + Some(Self::parse_git_repo(git_repo, ignores).await) + } + + async fn parse_git_repo( + git_repo: &Path, + git_ignores: Vec, + ) -> Result { + let mut search = Search::default(); + + let git_ignores = git_ignores + .into_iter() + .map(Self::parse_git_ignore) + .collect::>() + .join() + .await; + search + .patterns + .extend(git_ignores.into_iter().filter_map(Result::ok)); + + let git_exclude_rules = Self::parse_git_exclude(git_repo.join(".git")).await; + if let Ok(rules) = git_exclude_rules { + search.patterns.extend(rules); + } + + Ok(Self { + rules: RulePerKind::IgnoredByGit(git_repo.to_owned(), search), + }) + } + + async fn parse_git_ignore(gitignore: PathBuf) -> Result, SeederError> { + tokio::task::spawn_blocking(move || { + let mut buf = Vec::with_capacity(30); + if let Ok(Some(patterns)) = List::from_file(gitignore, None, true, &mut buf) { + Ok(patterns) + } else { + Err(SeederError::InheritedExternalRules) + } + }) + .await + .map_err(|_| SeederError::InheritedExternalRules)? + } + + async fn parse_git_exclude(dot_git: PathBuf) -> Result>, SeederError> { + tokio::task::spawn_blocking(move || { + let mut buf = Vec::new(); + Search::from_git_dir(dot_git.as_ref(), None, &mut buf) + .map(|search| search.patterns) + .map_err(|_| SeederError::InheritedExternalRules) + }) + .await + .map_err(|_| SeederError::InheritedExternalRules)? + } + + async fn is_git_repo(path: &Path) -> bool { + let path = path.join(".git"); + tokio::task::spawn_blocking(move || path.is_dir()) + .await + .unwrap_or_default() + } +} + +impl From for IndexerRule { + fn from(git: GitIgnoreRules) -> Self { + Self { + id: None, + name: ".gitignore'd".to_owned(), + default: true, + date_created: Utc::now(), + date_modified: Utc::now(), + rules: vec![git.rules], + } + } +} + +#[derive(Debug)] pub struct SystemIndexerRule { name: &'static str, rules: Vec, default: bool, } +impl PartialEq for SystemIndexerRule { + fn eq(&self, other: &IndexerRule) -> bool { + self.name == other.name + } +} + impl From for IndexerRule { fn from(rule: SystemIndexerRule) -> Self { Self { @@ -33,17 +153,36 @@ impl From for IndexerRule { } } +impl From<&SystemIndexerRule> for IndexerRule { + fn from(rule: &SystemIndexerRule) -> Self { + Self { + id: None, + name: rule.name.to_string(), + default: rule.default, + rules: rule.rules.clone(), + date_created: Utc::now(), + date_modified: Utc::now(), + } + } +} + /// Seeds system indexer rules into a new or existing library, pub async fn new_or_existing_library(db: &PrismaClient) -> Result<(), SeederError> { use indexer_rule::{date_created, date_modified, default, name, rules_per_kind}; // DO NOT REORDER THIS ARRAY! - for (i, rule) in [no_os_protected(), no_hidden(), no_git(), only_images()] - .into_iter() - .enumerate() + for (i, rule) in [ + &NO_SYSTEM_FILES, + &NO_HIDDEN, + &NO_GIT, + &GITIGNORE, + &ONLY_IMAGES, + ] + .into_iter() + .enumerate() { - let pub_id = sd_utils::uuid_to_bytes(Uuid::from_u128(i as u128)); - let rules = rmp_serde::to_vec_named(&rule.rules).map_err(IndexerRuleError::from)?; + let pub_id = sd_utils::uuid_to_bytes(&Uuid::from_u128(i as u128)); + let rules = rmp_serde::to_vec_named(&rule.rules).map_err(Error::from)?; let data = vec![ name::set(Some(rule.name.to_string())), @@ -66,147 +205,140 @@ pub async fn new_or_existing_library(db: &PrismaClient) -> Result<(), SeederErro Ok(()) } -#[must_use] -#[allow(clippy::missing_panics_doc)] -pub fn no_os_protected() -> SystemIndexerRule { +pub static NO_SYSTEM_FILES: Lazy = Lazy::new(|| { SystemIndexerRule { - // TODO: On windows, beside the listed files, any file with the FILE_ATTRIBUTE_SYSTEM should be considered a system file - // https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants#FILE_ATTRIBUTE_SYSTEM - name: "No OS protected", - default: true, - rules: vec![ - RulePerKind::new_reject_files_by_globs_str( - [ - vec![ - "**/.spacedrive", - ], - // Globset, even on Windows, requires the use of / as a separator - // https://github.com/github/gitignore/blob/main/Global/Windows.gitignore - // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file - #[cfg(target_os = "windows")] - vec![ - // Windows thumbnail cache files - "**/{Thumbs.db,Thumbs.db:encryptable,ehthumbs.db,ehthumbs_vista.db}", - // Dump file - "**/*.stackdump", - // Folder config file - "**/[Dd]esktop.ini", - // Recycle Bin used on file shares - "**/$RECYCLE.BIN", - // Chkdsk recovery directory - "**/FOUND.[0-9][0-9][0-9]", - // Reserved names - "**/{CON,PRN,AUX,NUL,COM0,COM1,COM2,COM3,COM4,COM5,COM6,COM7,COM8,COM9,LPT0,LPT1,LPT2,LPT3,LPT4,LPT5,LPT6,LPT7,LPT8,LPT9}", - "**/{CON,PRN,AUX,NUL,COM0,COM1,COM2,COM3,COM4,COM5,COM6,COM7,COM8,COM9,LPT0,LPT1,LPT2,LPT3,LPT4,LPT5,LPT6,LPT7,LPT8,LPT9}.*", - // User special files - "C:/Users/*/NTUSER.DAT*", - "C:/Users/*/ntuser.dat*", - "C:/Users/*/{ntuser.ini,ntuser.dat,NTUSER.DAT}", - // User special folders (most of these the user don't even have permission to access) - "C:/Users/*/{Cookies,AppData,NetHood,Recent,PrintHood,SendTo,Templates,Start Menu,Application Data,Local Settings,My Documents}", - // System special folders - "C:/{$Recycle.Bin,$WinREAgent,Documents and Settings,Program Files,Program Files (x86),ProgramData,Recovery,PerfLogs,Windows,Windows.old}", - // NTFS internal dir, can exists on any drive - "[A-Z]:/System Volume Information", - // System special files - "C:/{config,pagefile,hiberfil}.sys", - // Windows can create a swapfile on any drive - "[A-Z]:/swapfile.sys", - "C:/DumpStack.log.tmp", - ], - // https://github.com/github/gitignore/blob/main/Global/macOS.gitignore - // https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW14 - #[cfg(any(target_os = "ios", target_os = "macos"))] - vec![ - "**/.{DS_Store,AppleDouble,LSOverride}", - // Icon must end with two \r - "**/Icon\r\r", - // Thumbnails - "**/._*", - ], - #[cfg(target_os = "macos")] - vec![ - "/{System,Network,Library,Applications,.PreviousSystemInformation,.com.apple.templatemigration.boot-install}", - "/System/Volumes/Data/{System,Network,Library,Applications,.PreviousSystemInformation,.com.apple.templatemigration.boot-install}", - "/Users/*/{Library,Applications}", - "/System/Volumes/Data/Users/*/{Library,Applications}", - "**/*.photoslibrary/{database,external,private,resources,scope}", - // Files that might appear in the root of a volume - "**/.{DocumentRevisions-V100,fseventsd,Spotlight-V100,TemporaryItems,Trashes,VolumeIcon.icns,com.apple.timemachine.donotpresent}", - // Directories potentially created on remote AFP share - "**/.{AppleDB,AppleDesktop,apdisk}", - "**/{Network Trash Folder,Temporary Items}", - ], - // https://github.com/github/gitignore/blob/main/Global/Linux.gitignore - #[cfg(target_os = "linux")] - vec![ - "**/*~", - // temporary files which can be created if a process still has a handle open of a deleted file - "**/.fuse_hidden*", - // KDE directory preferences - "**/.directory", - // Linux trash folder which might appear on any partition or disk - "**/.Trash-*", - // .nfs files are created when an open file is removed but is still being accessed - "**/.nfs*", - ], - #[cfg(target_os = "android")] - vec![ - "**/.nomedia", - "**/.thumbnails", - ], - // https://en.wikipedia.org/wiki/Unix_filesystem#Conventional_directory_layout - // https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard - #[cfg(target_family = "unix")] - vec![ - // Directories containing unix memory/device mapped files/dirs - "/{dev,sys,proc}", - // Directories containing special files for current running programs - "/{run,var,boot}", - // ext2-4 recovery directory - "**/lost+found", - ], - ] - .into_iter() - .flatten() - ).expect("this is hardcoded and should always work"), - ], - } + // TODO: On windows, beside the listed files, any file with the FILE_ATTRIBUTE_SYSTEM should be considered a system file + // https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants#FILE_ATTRIBUTE_SYSTEM + name: "No System files", + default: true, + rules: vec![ + RulePerKind::new_reject_files_by_globs_str( + [ + vec![ + "**/.spacedrive", + ], + // Globset, even on Windows, requires the use of / as a separator + // https://github.com/github/gitignore/blob/main/Global/Windows.gitignore + // https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file + #[cfg(target_os = "windows")] + vec![ + // Windows thumbnail cache files + "**/{Thumbs.db,Thumbs.db:encryptable,ehthumbs.db,ehthumbs_vista.db}", + // Dump file + "**/*.stackdump", + // Folder config file + "**/[Dd]esktop.ini", + // Recycle Bin used on file shares + "**/$RECYCLE.BIN", + // Chkdsk recovery directory + "**/FOUND.[0-9][0-9][0-9]", + // Reserved names + "**/{CON,PRN,AUX,NUL,COM0,COM1,COM2,COM3,COM4,COM5,COM6,COM7,COM8,COM9,LPT0,LPT1,LPT2,LPT3,LPT4,LPT5,LPT6,LPT7,LPT8,LPT9}", + "**/{CON,PRN,AUX,NUL,COM0,COM1,COM2,COM3,COM4,COM5,COM6,COM7,COM8,COM9,LPT0,LPT1,LPT2,LPT3,LPT4,LPT5,LPT6,LPT7,LPT8,LPT9}.*", + // User special files + "C:/Users/*/NTUSER.DAT*", + "C:/Users/*/ntuser.dat*", + "C:/Users/*/{ntuser.ini,ntuser.dat,NTUSER.DAT}", + // User special folders (most of these the user don't even have permission to access) + "C:/Users/*/{Cookies,AppData,NetHood,Recent,PrintHood,SendTo,Templates,Start Menu,Application Data,Local Settings,My Documents}", + // System special folders + "C:/{$Recycle.Bin,$WinREAgent,Documents and Settings,Program Files,Program Files (x86),ProgramData,Recovery,PerfLogs,Windows,Windows.old}", + // NTFS internal dir, can exists on any drive + "[A-Z]:/System Volume Information", + // System special files + "C:/{config,pagefile,hiberfil}.sys", + // Windows can create a swapfile on any drive + "[A-Z]:/swapfile.sys", + "C:/DumpStack.log.tmp", + ], + // https://github.com/github/gitignore/blob/main/Global/macOS.gitignore + // https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW14 + #[cfg(any(target_os = "ios", target_os = "macos"))] + vec![ + "**/.{DS_Store,AppleDouble,LSOverride}", + // Icon must end with two \r + "**/Icon\r\r", + // Thumbnails + "**/._*", + ], + #[cfg(target_os = "macos")] + vec![ + "/{System,Network,Library,Applications,.PreviousSystemInformation,.com.apple.templatemigration.boot-install}", + "/System/Volumes/Data/{System,Network,Library,Applications,.PreviousSystemInformation,.com.apple.templatemigration.boot-install}", + "/Users/*/{Library,Applications}", + "/System/Volumes/Data/Users/*/{Library,Applications}", + "**/*.photoslibrary/{database,external,private,resources,scope}", + // Files that might appear in the root of a volume + "**/.{DocumentRevisions-V100,fseventsd,Spotlight-V100,TemporaryItems,Trashes,VolumeIcon.icns,com.apple.timemachine.donotpresent}", + // Directories potentially created on remote AFP share + "**/.{AppleDB,AppleDesktop,apdisk}", + "**/{Network Trash Folder,Temporary Items}", + ], + // https://github.com/github/gitignore/blob/main/Global/Linux.gitignore + #[cfg(target_os = "linux")] + vec![ + "**/*~", + // temporary files which can be created if a process still has a handle open of a deleted file + "**/.fuse_hidden*", + // KDE directory preferences + "**/.directory", + // Linux trash folder which might appear on any partition or disk + "**/.Trash-*", + // .nfs files are created when an open file is removed but is still being accessed + "**/.nfs*", + ], + #[cfg(target_os = "android")] + vec![ + "**/.nomedia", + "**/.thumbnails", + ], + // https://en.wikipedia.org/wiki/Unix_filesystem#Conventional_directory_layout + // https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard + #[cfg(target_family = "unix")] + vec![ + // Directories containing unix memory/device mapped files/dirs + "/{dev,sys,proc}", + // Directories containing special files for current running programs + "/{run,var,boot}", + // ext2-4 recovery directory + "**/lost+found", + ], + ] + .into_iter() + .flatten() + ).expect("this is hardcoded and should always work"), + ], } +}); -#[must_use] -#[allow(clippy::missing_panics_doc)] -pub fn no_hidden() -> SystemIndexerRule { - SystemIndexerRule { - name: "No Hidden", - default: false, - rules: vec![RulePerKind::new_reject_files_by_globs_str(["**/.*"]) - .expect("this is hardcoded and should always work")], - } -} - -#[must_use] -#[allow(clippy::missing_panics_doc)] -fn no_git() -> SystemIndexerRule { - SystemIndexerRule { - name: "No Git", - default: false, - rules: vec![RulePerKind::new_reject_files_by_globs_str([ - "**/{.git,.gitignore,.gitattributes,.gitkeep,.gitconfig,.gitmodules}", - ]) +pub static NO_HIDDEN: Lazy = Lazy::new(|| SystemIndexerRule { + name: "No Hidden files", + default: false, + rules: vec![RulePerKind::new_reject_files_by_globs_str(["**/.*"]) .expect("this is hardcoded and should always work")], - } -} +}); -#[must_use] -#[allow(clippy::missing_panics_doc)] -fn only_images() -> SystemIndexerRule { - SystemIndexerRule { - name: "Only Images", - default: false, - rules: vec![RulePerKind::new_accept_files_by_globs_str([ - "*.{avif,bmp,gif,ico,jpeg,jpg,png,svg,tif,tiff,webp}", - ]) - .expect("this is hardcoded and should always work")], - } -} +pub static NO_GIT: Lazy = Lazy::new(|| SystemIndexerRule { + name: "No Git files", + default: true, + rules: vec![RulePerKind::new_reject_files_by_globs_str([ + "**/{.git,.gitignore,.gitattributes,.gitkeep,.gitconfig,.gitmodules}", + ]) + .expect("this is hardcoded and should always work")], +}); + +pub static GITIGNORE: Lazy = Lazy::new(|| SystemIndexerRule { + name: "Gitignore", + default: true, + // Empty rules because this rule is only used to allow frontend to toggle GitIgnoreRules + rules: vec![], +}); + +pub static ONLY_IMAGES: Lazy = Lazy::new(|| SystemIndexerRule { + name: "Only Images", + default: false, + rules: vec![RulePerKind::new_accept_files_by_globs_str([ + "*.{avif,bmp,gif,ico,jpeg,jpg,png,svg,tif,tiff,webp}", + ]) + .expect("this is hardcoded and should always work")], +}); diff --git a/core/crates/indexer-rules/src/serde_impl.rs b/core/crates/indexer-rules/src/serde_impl.rs index 7abe9d87b..a0b24dd23 100644 --- a/core/crates/indexer-rules/src/serde_impl.rs +++ b/core/crates/indexer-rules/src/serde_impl.rs @@ -31,6 +31,9 @@ impl Serialize for RulePerKind { "RejectIfChildrenDirectoriesArePresent", children, ), + Self::IgnoredByGit(_, _) => { + unreachable!("git ignore rules are dynamic and not serialized") + } } } } diff --git a/core/crates/prisma-helpers/Cargo.toml b/core/crates/prisma-helpers/Cargo.toml index f6ec30aab..66d1be763 100644 --- a/core/crates/prisma-helpers/Cargo.toml +++ b/core/crates/prisma-helpers/Cargo.toml @@ -6,12 +6,13 @@ license = { workspace = true } repository = { workspace = true } edition = { workspace = true } -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] # Spacedrive Sub-crates sd-prisma = { path = "../../../crates/prisma" } -sd-cache = { path = "../../../crates/cache" } +sd-utils = { path = "../../../crates/utils" } +# Workspace dependencies prisma-client-rust = { workspace = true } -serde = { workspace = true } +serde = { workspace = true, features = ["derive"] } +specta = { workspace = true } +uuid = { workspace = true, features = ["v4", "serde"] } diff --git a/core/crates/prisma-helpers/src/lib.rs b/core/crates/prisma-helpers/src/lib.rs index 26d67a4bf..958bb7703 100644 --- a/core/crates/prisma-helpers/src/lib.rs +++ b/core/crates/prisma-helpers/src/lib.rs @@ -1,3 +1,4 @@ +#![recursion_limit = "256"] #![warn( clippy::all, clippy::pedantic, @@ -27,9 +28,18 @@ #![forbid(deprecated_in_future)] #![allow(clippy::missing_errors_doc, clippy::module_name_repetitions)] -use sd_prisma::prisma::{self, file_path, job, label, location, object}; +use sd_prisma::prisma::{file_path, job, label, location, object}; +use sd_utils::{from_bytes_to_uuid, uuid_to_bytes}; + +use std::{borrow::Cow, fmt}; + +use serde::{Deserialize, Serialize}; +use specta::Type; +use uuid::Uuid; // File Path selectables! +file_path::select!(file_path_id { id }); +file_path::select!(file_path_pub_id { pub_id }); file_path::select!(file_path_pub_and_cas_ids { id pub_id cas_id }); file_path::select!(file_path_just_pub_id_materialized_path { pub_id @@ -60,7 +70,10 @@ file_path::select!(file_path_for_media_processor { name extension cas_id - object_id + object: select { + id + pub_id + } }); file_path::select!(file_path_to_isolate { location_id @@ -110,6 +123,7 @@ file_path::select!(file_path_to_handle_custom_uri { instance: select { identity remote_identity + node_remote_identity } } }); @@ -134,11 +148,18 @@ file_path::select!(file_path_to_full_path { path } }); +file_path::select!(file_path_to_create_object { + id + pub_id + date_created +}); // File Path includes! -file_path::include!(file_path_with_object { +file_path::include!(file_path_with_object { object }); +file_path::include!(file_path_for_frontend { object: include { - media_data: select { + tags: include { tag } + exif_data: select { resolution media_date media_location @@ -152,6 +173,7 @@ file_path::include!(file_path_with_object { }); // Object selectables! +object::select!(object_ids { id pub_id }); object::select!(object_for_file_identifier { pub_id file_paths: select { pub_id cas_id extension is_dir materialized_path name } @@ -161,7 +183,7 @@ object::select!(object_for_file_identifier { object::include!(object_with_file_paths { file_paths: include { object: include { - media_data: select { + exif_data: select { resolution media_date media_location @@ -171,16 +193,34 @@ object::include!(object_with_file_paths { copyright exif_version } + ffmpeg_data: include { + chapters + programs: include { + streams: include { + codec: include { + audio_props + video_props + } + } + } + } } } }); - -impl sd_cache::Model for object_with_file_paths::file_paths::Data { - fn name() -> &'static str { - // This is okay because it's a superset of the available fields. - prisma::file_path::NAME +object::include!(object_with_media_data { + exif_data + ffmpeg_data: include { + chapters + programs: include { + streams: include { + codec: include { + audio_props + video_props + } + } + } } -} +}); // Job selectables! job::select!(job_without_data { @@ -199,6 +239,14 @@ job::select!(job_without_data { date_estimated_completion }); +// Location selectables! +location::select!(location_ids_and_path { + id + pub_id + instance_id + path +}); + // Location includes! location::include!(location_with_indexer_rules { indexer_rules: select { indexer_rule } @@ -261,3 +309,220 @@ label::include!((take: i64) => label_with_objects { } } }); + +#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Type)] +#[serde(transparent)] +pub struct CasId<'cas_id>(Cow<'cas_id, str>); + +impl Clone for CasId<'_> { + fn clone(&self) -> CasId<'static> { + CasId(Cow::Owned(self.0.clone().into_owned())) + } +} + +impl<'cas_id> CasId<'cas_id> { + #[must_use] + pub fn as_str(&self) -> &str { + self.0.as_ref() + } + + #[must_use] + pub fn to_owned(&self) -> CasId<'static> { + CasId(Cow::Owned(self.0.clone().into_owned())) + } + + #[must_use] + pub fn into_owned(self) -> CasId<'static> { + CasId(Cow::Owned(self.0.clone().into_owned())) + } +} + +impl From<&CasId<'_>> for file_path::cas_id::Type { + fn from(CasId(cas_id): &CasId<'_>) -> Self { + Some(cas_id.clone().into_owned()) + } +} + +impl<'cas_id> From<&'cas_id str> for CasId<'cas_id> { + fn from(cas_id: &'cas_id str) -> Self { + Self(Cow::Borrowed(cas_id)) + } +} + +impl<'cas_id> From<&'cas_id String> for CasId<'cas_id> { + fn from(cas_id: &'cas_id String) -> Self { + Self(Cow::Borrowed(cas_id)) + } +} + +impl From for CasId<'static> { + fn from(cas_id: String) -> Self { + Self(cas_id.into()) + } +} + +impl From> for String { + fn from(CasId(cas_id): CasId<'_>) -> Self { + cas_id.into_owned() + } +} + +impl From<&CasId<'_>> for String { + fn from(CasId(cas_id): &CasId<'_>) -> Self { + cas_id.clone().into_owned() + } +} + +#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone)] +#[serde(transparent)] +#[repr(transparent)] +pub struct FilePathPubId(PubId); + +#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone)] +#[serde(transparent)] +#[repr(transparent)] +pub struct ObjectPubId(PubId); + +#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone)] +enum PubId { + Uuid(Uuid), + Vec(Vec), +} + +impl PubId { + fn new() -> Self { + Self::Uuid(Uuid::new_v4()) + } + + fn to_db(&self) -> Vec { + match self { + Self::Uuid(uuid) => uuid_to_bytes(uuid), + Self::Vec(bytes) => bytes.clone(), + } + } +} + +impl Default for PubId { + fn default() -> Self { + Self::new() + } +} + +impl From for PubId { + fn from(uuid: Uuid) -> Self { + Self::Uuid(uuid) + } +} + +impl From> for PubId { + fn from(bytes: Vec) -> Self { + Self::Vec(bytes) + } +} + +impl From<&Vec> for PubId { + fn from(bytes: &Vec) -> Self { + Self::Vec(bytes.clone()) + } +} + +impl From<&[u8]> for PubId { + fn from(bytes: &[u8]) -> Self { + Self::Vec(bytes.to_vec()) + } +} + +impl From for Vec { + fn from(pub_id: PubId) -> Self { + match pub_id { + PubId::Uuid(uuid) => uuid_to_bytes(&uuid), + PubId::Vec(bytes) => bytes, + } + } +} + +impl From for Uuid { + fn from(pub_id: PubId) -> Self { + match pub_id { + PubId::Uuid(uuid) => uuid, + PubId::Vec(bytes) => from_bytes_to_uuid(&bytes), + } + } +} + +impl fmt::Display for PubId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Uuid(uuid) => write!(f, "{uuid}"), + Self::Vec(bytes) => write!(f, "{}", from_bytes_to_uuid(bytes)), + } + } +} + +macro_rules! delegate_pub_id { + ($($type_name:ty),+ $(,)?) => { + $( + impl From<::uuid::Uuid> for $type_name { + fn from(uuid: ::uuid::Uuid) -> Self { + Self(uuid.into()) + } + } + + impl From> for $type_name { + fn from(bytes: Vec) -> Self { + Self(bytes.into()) + } + } + + impl From<&Vec> for $type_name { + fn from(bytes: &Vec) -> Self { + Self(bytes.into()) + } + } + + impl From<&[u8]> for $type_name { + fn from(bytes: &[u8]) -> Self { + Self(bytes.into()) + } + } + + impl From<$type_name> for Vec { + fn from(pub_id: $type_name) -> Self { + pub_id.0.into() + } + } + + impl From<$type_name> for ::uuid::Uuid { + fn from(pub_id: $type_name) -> Self { + pub_id.0.into() + } + } + + impl ::std::fmt::Display for $type_name { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "{}", self.0) + } + } + + impl $type_name { + #[must_use] + pub fn new() -> Self { + Self(PubId::new()) + } + + #[must_use] + pub fn to_db(&self) -> Vec { + self.0.to_db() + } + } + + impl Default for $type_name { + fn default() -> Self { + Self::new() + } + } + )+ + }; +} + +delegate_pub_id!(FilePathPubId, ObjectPubId); diff --git a/core/crates/sync/Cargo.toml b/core/crates/sync/Cargo.toml index d5796f8e0..e3d37f5ff 100644 --- a/core/crates/sync/Cargo.toml +++ b/core/crates/sync/Cargo.toml @@ -11,13 +11,15 @@ default = [] sd-prisma = { path = "../../../crates/prisma" } sd-sync = { path = "../../../crates/sync" } sd-utils = { path = "../../../crates/utils" } +sd-actors = { path = "../../../crates/actors" } +# Workspace dependencies prisma-client-rust = { workspace = true } +rmpv = { workspace = true } +rmp-serde = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true } -uuid = { workspace = true } -tracing.workspace = true +tracing = { workspace = true } uhlc = { workspace = true } -rmp-serde = "1.1.2" -rmpv = { workspace = true } +uuid = { workspace = true } diff --git a/core/crates/sync/README.md b/core/crates/sync/README.md new file mode 100644 index 000000000..11d8f53da --- /dev/null +++ b/core/crates/sync/README.md @@ -0,0 +1,132 @@ +# `sd-core-sync` + +Spacedrive's sync system. Consumes types and helpers from `sd-sync`. + +### Creating Records + +Prepare a sync id by creating or obtaining its value, +and then wrapping it in the model's `SyncId` struct, +available at `prisma_sync::{model}::SyncId`. + +Next, prepare the sync operations using some varaints of the `sync_entry` macros. +`sync_entry` and `option_sync_entry` take the value first, and then the path to the field's prisma module. +`sync_db_entry` and `option_sync_db_entry` take the same inputs, but additionally produce a prisma operation in a tuple with the sync operation, intended to be put into a `Vec` and unzipped. + +Finally, use `sync.shared/relation_create` depending on if you're creating a standalone record or a relation between two records, and then write it to the database with `write_ops`. + +```rs +let (sync_params, db_params): (Vec<_>, Vec<_>) = [ + sync_db_entry!(self.name, tag::name), + sync_db_entry!(self.color, tag::color), + sync_db_entry!(false, tag::is_hidden), + sync_db_entry!(date_created, tag::date_created), +] +.into_iter() +.unzip(); + +sync.write_ops( + db, + ( + sync.shared_create( + prisma_sync::tag::SyncId { pub_id }, + sync_params, + ), + db.tag().create(pub_id, db_params), + ), +) +``` + +### Updating Records + +This follows a similar process to creation, but with `sync.shared/relation_create`. + +```rs +let (sync_params, db_params): (Vec<_>, Vec<_>) = [ + sync_db_entry!(name, tag::name), + sync_db_entry!(color, tag::color), +] +.into_iter() +.unzip(); + +sync.write_ops( + db, + ( + sync.shared_update(prisma_sync::tag::SyncId { pub_id }, k, v), + db.tag().update(tag::id::equals(id), db_params); + ) +) +``` + +### Deleting Records + +This only requires a sync ID. + +```rs +sync.write_op( + db, + sync.shared_delete(prisma_sync::tag::SyncId { pub_id }), + db.tag().delete(tag::id::equals(id)); +) +``` + +### Relation Records + +Relations require sync IDs for both the item and the group being related together. +Apart from that they're basically the same as shared operations. + +```rs +let (sync_params, db_params): (Vec<_>, Vec<_>) = [ + sync_db_entry!(date_created, tag_on_object::date_created) +] +.into_iter() +.unzip(); + +sync.write_ops( + db, + ( + sync.relation_create( + prisma_sync::tag_on_object::SyncId { + tag: prisma_sync::tag::SyncId { pub_id: tag_pub_id }, + object: prisma_sync::object::SyncId { pub_id: object_pub_id }, + }, + sync_params + ), + db.tag_on_object().create( + object::id::equals(object_id), + tag::id::equals(tag_id), + db_params + ) + ) +) +``` + +### Setting Relation Fields + +Setting relation fields requires providing the Sync ID of the relation. +Setting the relation field's scalar fields instead will not properly sync then relation, +usually because the scalar fields are local and disconnected from the Sync ID. + +```rs +let (sync_params, db_params): (Vec<_>, Vec<_>) = [ + sync_db_entry!( + prisma_sync::object::SyncId { pub_id: object_pub_id }, + file_path::object + ) +].into_iter().unzip(); + +sync.write_ops( + db, + ( + sync.shared_update( + prisma_sync::file_path::SyncId { + pub_id: file_path_pub_id + }, + sync_params + ), + db.file_path().update( + file_path::id::equals(file_path_id), + db_params + ) + ) +) +``` diff --git a/core/crates/sync/src/actor.rs b/core/crates/sync/src/actor.rs index ad264d9c2..f9e626aff 100644 --- a/core/crates/sync/src/actor.rs +++ b/core/crates/sync/src/actor.rs @@ -1,4 +1,6 @@ -use tokio::sync::mpsc; +use std::sync::Arc; + +use tokio::sync::{mpsc, Mutex}; pub trait ActorTypes { type Event; @@ -7,10 +9,19 @@ pub trait ActorTypes { } pub struct ActorIO { - pub event_rx: mpsc::Receiver, + pub event_rx: Arc>>, pub req_tx: mpsc::Sender, } +impl Clone for ActorIO { + fn clone(&self) -> Self { + Self { + event_rx: self.event_rx.clone(), + req_tx: self.req_tx.clone(), + } + } +} + impl ActorIO { pub async fn send(&self, value: T::Request) -> Result<(), mpsc::error::SendError> { self.req_tx.send(value).await @@ -26,6 +37,8 @@ pub fn create_actor_io() -> (ActorIO, HandlerIO) { let (req_tx, req_rx) = mpsc::channel(20); let (event_tx, event_rx) = mpsc::channel(20); + let event_rx = Arc::new(Mutex::new(event_rx)); + (ActorIO { event_rx, req_tx }, HandlerIO { event_tx, req_rx }) } diff --git a/core/crates/sync/src/backfill.rs b/core/crates/sync/src/backfill.rs index 027bb8d0b..0bb6e6a62 100644 --- a/core/crates/sync/src/backfill.rs +++ b/core/crates/sync/src/backfill.rs @@ -2,7 +2,7 @@ use std::future::Future; use sd_prisma::{ prisma::{ - crdt_operation, file_path, label, label_on_object, location, media_data, object, tag, + crdt_operation, exif_data, file_path, label, label_on_object, location, object, tag, tag_on_object, PrismaClient, SortOrder, }, prisma_sync, @@ -15,6 +15,8 @@ use crate::crdt_op_unchecked_db; /// Takes all the syncable data in the database and generates CRDTOperations for it. /// This is a requirement before the library can sync. pub async fn backfill_operations(db: &PrismaClient, sync: &crate::Manager, instance_id: i32) { + let lock = sync.timestamp_lock.acquire().await; + db._transaction() .with_timeout(9999999999) .run(|db| async move { @@ -68,6 +70,12 @@ pub async fn backfill_operations(db: &PrismaClient, sync: &crate::Manager, insta .find_many(vec![location::id::gt(cursor)]) .order_by(location::id::order(SortOrder::Asc)) .take(1000) + .include(location::include!({ + instance: select { + id + pub_id + } + })) .exec() }, |location| location.id, @@ -106,6 +114,14 @@ pub async fn backfill_operations(db: &PrismaClient, sync: &crate::Manager, insta ), option_sync_entry!(l.hidden, hidden), option_sync_entry!(l.date_created, date_created), + option_sync_entry!( + l.instance.map(|i| { + prisma_sync::instance::SyncId { + pub_id: i.pub_id, + } + }), + instance + ), ], ), ) @@ -161,11 +177,11 @@ pub async fn backfill_operations(db: &PrismaClient, sync: &crate::Manager, insta paginate( |cursor| { - db.media_data() - .find_many(vec![media_data::id::gt(cursor)]) - .order_by(media_data::id::order(SortOrder::Asc)) + db.exif_data() + .find_many(vec![exif_data::id::gt(cursor)]) + .order_by(exif_data::id::order(SortOrder::Asc)) .take(1000) - .include(media_data::include!({ + .include(exif_data::include!({ object: select { pub_id } })) .exec() @@ -177,10 +193,10 @@ pub async fn backfill_operations(db: &PrismaClient, sync: &crate::Manager, insta media_datas .into_iter() .flat_map(|md| { - use media_data::*; + use exif_data::*; sync.shared_create( - prisma_sync::media_data::SyncId { + prisma_sync::exif_data::SyncId { object: prisma_sync::object::SyncId { pub_id: md.object.pub_id, }, @@ -412,6 +428,8 @@ pub async fn backfill_operations(db: &PrismaClient, sync: &crate::Manager, insta }) .await .unwrap(); + + drop(lock); } async fn paginate< diff --git a/core/crates/sync/src/db_operation.rs b/core/crates/sync/src/db_operation.rs index 36ff15e63..ce9bb6ab9 100644 --- a/core/crates/sync/src/db_operation.rs +++ b/core/crates/sync/src/db_operation.rs @@ -41,14 +41,17 @@ impl cloud_crdt_include::Data { Uuid::from_slice(&self.instance.pub_id).unwrap() } - pub fn into_operation(self) -> CRDTOperation { - CRDTOperation { - instance: self.instance(), - timestamp: self.timestamp(), - record_id: rmp_serde::from_slice(&self.record_id).unwrap(), - model: self.model as u16, - data: serde_json::from_slice(&self.data).unwrap(), - } + pub fn into_operation(self) -> (i32, CRDTOperation) { + ( + self.id, + CRDTOperation { + instance: self.instance(), + timestamp: self.timestamp(), + record_id: rmp_serde::from_slice(&self.record_id).unwrap(), + model: self.model as u16, + data: serde_json::from_slice(&self.data).unwrap(), + }, + ) } } diff --git a/core/crates/sync/src/ingest.rs b/core/crates/sync/src/ingest.rs index bd065873f..176a004c4 100644 --- a/core/crates/sync/src/ingest.rs +++ b/core/crates/sync/src/ingest.rs @@ -1,4 +1,6 @@ use std::{ + collections::BTreeMap, + num::NonZeroU128, ops::Deref, sync::{atomic::Ordering, Arc}, }; @@ -7,7 +9,10 @@ use sd_prisma::{ prisma::{crdt_operation, SortOrder}, prisma_sync::ModelSyncData, }; -use sd_sync::CRDTOperation; +use sd_sync::{ + CRDTOperation, CRDTOperationData, CompressedCRDTOperation, CompressedCRDTOperations, + OperationKind, +}; use tokio::sync::{mpsc, oneshot, Mutex}; use tracing::debug; use uhlc::{Timestamp, NTP64}; @@ -27,7 +32,7 @@ pub enum Request { timestamps: Vec<(Uuid, NTP64)>, tx: oneshot::Sender<()>, }, - Ingested, + // Ingested, FinishedIngesting, } @@ -67,7 +72,7 @@ impl Actor { self.shared.active.store(false, Ordering::Relaxed); self.shared.active_notify.notify_waiters(); - wait!(self.io.event_rx, Event::Notification); + wait!(self.io.event_rx.lock().await, Event::Notification); self.shared.active.store(true, Ordering::Relaxed); self.shared.active_notify.notify_waiters(); @@ -77,24 +82,25 @@ impl Actor { State::RetrievingMessages => { let (tx, mut rx) = oneshot::channel::<()>(); + let timestamps = self + .timestamps + .read() + .await + .iter() + .map(|(&k, &v)| (k, v)) + .collect(); + self.io - .send(Request::Messages { - timestamps: self - .timestamps - .read() - .await - .iter() - .map(|(&k, &v)| (k, v)) - .collect(), - tx, - }) + .send(Request::Messages { timestamps, tx }) .await .ok(); + let mut event_rx = self.io.event_rx.lock().await; + loop { tokio::select! { biased; - res = self.io.event_rx.recv() => { + res = event_rx.recv() => { if let Some(Event::Messages(event)) = res { break State::Ingesting(event) } } res = &mut rx => { @@ -107,19 +113,27 @@ impl Actor { } } State::Ingesting(event) => { - if !event.messages.is_empty() { - debug!( - "ingesting {} operations: {} to {}", - event.messages.len(), - event.messages.first().unwrap().timestamp.as_u64(), - event.messages.last().unwrap().timestamp.as_u64(), - ); + debug!( + messages_count = event.messages.len(), + first_message = event.messages.first().unwrap().3.timestamp.as_u64(), + last_message = event.messages.last().unwrap().3.timestamp.as_u64(), + "Ingesting operations;", + ); - for op in event.messages { - self.receive_crdt_operation(op).await; + for (instance, data) in event.messages.0 { + for (model, data) in data { + for (record, ops) in data { + self.receive_crdt_operations(instance, model, record, ops) + .await + .expect("sync ingest failed"); + } } } + if let Some(tx) = event.wait_tx { + tx.send(()).ok(); + } + match event.has_more { true => State::RetrievingMessages, false => { @@ -137,23 +151,33 @@ impl Actor { }) } - pub fn spawn(shared: Arc) -> Handler { + pub async fn declare(shared: Arc) -> Handler { let (actor_io, handler_io) = create_actor_io::(); - tokio::spawn(async move { - let mut this = Self { - state: Some(Default::default()), - io: actor_io, - shared, - }; + shared + .actors + .declare( + "Sync Ingest", + { + let shared = shared.clone(); + move || async move { + let mut this = Self { + state: Some(Default::default()), + io: actor_io, + shared, + }; - loop { - this = match this.tick().await { - Some(this) => this, - None => break, - }; - } - }); + loop { + this = match this.tick().await { + Some(this) => this, + None => break, + }; + } + } + }, + true, + ) + .await; Handler { event_tx: handler_io.event_tx, @@ -162,78 +186,252 @@ impl Actor { } // where the magic happens - async fn receive_crdt_operation(&mut self, op: CRDTOperation) { + async fn receive_crdt_operations( + &mut self, + instance: Uuid, + model: u16, + record_id: rmpv::Value, + mut ops: Vec, + ) -> prisma_client_rust::Result<()> { + let db = &self.db; + + ops.sort_by_key(|op| op.timestamp); + + let new_timestamp = ops.last().expect("Empty ops array").timestamp; + // first, we update the HLC's timestamp with the incoming one. // this involves a drift check + sets the last time of the clock self.clock - .update_with_timestamp(&Timestamp::new(op.timestamp, op.instance.into())) + .update_with_timestamp(&Timestamp::new( + new_timestamp, + uhlc::ID::from(NonZeroU128::new(instance.to_u128_le()).expect("Non zero id")), + )) .expect("timestamp has too much drift!"); // read the timestamp for the operation's instance, or insert one if it doesn't exist - let timestamp = self.timestamps.read().await.get(&op.instance).cloned(); + let timestamp = self.timestamps.read().await.get(&instance).cloned(); - // copy some fields bc rust ownership - let op_instance = op.instance; - let op_timestamp = op.timestamp; + // Delete - ignores all other messages + if let Some(delete_op) = ops + .iter() + .rev() + .find(|op| matches!(op.data, sd_sync::CRDTOperationData::Delete)) + { + // deletes are the be all and end all, no need to check anything - if !self.is_operation_old(&op).await { - // actually go and apply the operation in the db - self.apply_op(op).await.ok(); + let op = CRDTOperation { + instance, + model, + record_id, + timestamp: delete_op.timestamp, + data: CRDTOperationData::Delete, + }; - // update the stored timestamp for this instance - will be derived from the crdt operations table on restart - self.timestamps.write().await.insert( - op_instance, - NTP64::max(timestamp.unwrap_or_default(), op_timestamp), - ); + self.db + ._transaction() + .with_timeout(30 * 1000) + .run(|db| async move { + ModelSyncData::from_op(op.clone()) + .unwrap() + .exec(&db) + .await?; + write_crdt_op_to_db(&op, &db).await?; + + Ok(()) + }) + .await?; } - } + // Create + > 0 Update - overwrites the create's data with the updates + else if let Some(timestamp) = ops.iter().rev().find_map(|op| { + if let sd_sync::CRDTOperationData::Create(_) = &op.data { + return Some(op.timestamp); + } - async fn apply_op(&mut self, op: CRDTOperation) -> prisma_client_rust::Result<()> { - self.db - ._transaction() - .with_timeout(30 * 1000) - .run(|db| async move { - // apply the operation to the actual record - let sync_data = ModelSyncData::from_op(op.clone()); - - sync_data.unwrap().exec(&db).await?; - - // write the operation to the operations table - write_crdt_op_to_db(&op, &db).await?; - - Ok(()) - }) - .await?; - - self.io.req_tx.send(Request::Ingested).await.ok(); - - Ok(()) - } - - // determines if an operation is old and shouldn't be applied - async fn is_operation_old(&mut self, op: &CRDTOperation) -> bool { - let db = &self.db; - - let old_timestamp = { - let newer_op = db + None + }) { + // conflict resolution + let delete = db .crdt_operation() .find_first(vec![ - crdt_operation::timestamp::gte(op.timestamp.as_u64() as i64), - crdt_operation::model::equals(op.model as i32), - crdt_operation::record_id::equals(serde_json::to_vec(&op.record_id).unwrap()), - crdt_operation::kind::equals(op.kind().to_string()), + crdt_operation::model::equals(model as i32), + crdt_operation::record_id::equals(rmp_serde::to_vec(&record_id).unwrap()), + crdt_operation::kind::equals(OperationKind::Delete.to_string()), ]) .order_by(crdt_operation::timestamp::order(SortOrder::Desc)) .exec() - .await - .unwrap(); + .await?; - newer_op.map(|newer_op| newer_op.timestamp) - }; + if delete.is_some() { + return Ok(()); + } - old_timestamp - .map(|old| old != op.timestamp.as_u64() as i64) - .unwrap_or_default() + let mut data = BTreeMap::new(); + + let mut applied_ops = vec![]; + + // search for all Updates until a Create is found + for op in ops.iter().rev() { + match &op.data { + CRDTOperationData::Delete => unreachable!("Delete can't exist here!"), + CRDTOperationData::Create(create_data) => { + for (k, v) in create_data { + data.entry(k).or_insert(v); + } + + applied_ops.push(op); + + break; + } + CRDTOperationData::Update { field, value } => { + applied_ops.push(op); + data.insert(field, value); + } + } + } + + self.db + ._transaction() + .with_timeout(30 * 1000) + .run(|db| async move { + // fake a create with a bunch of data rather than individual insert + ModelSyncData::from_op(CRDTOperation { + instance, + model, + record_id: record_id.clone(), + timestamp, + data: CRDTOperationData::Create( + data.into_iter() + .map(|(k, v)| (k.clone(), v.clone())) + .collect(), + ), + }) + .unwrap() + .exec(&db) + .await?; + + for op in applied_ops { + write_crdt_op_to_db( + &CRDTOperation { + instance, + model, + record_id: record_id.clone(), + timestamp: op.timestamp, + data: op.data.clone(), + }, + &db, + ) + .await?; + } + + Ok(()) + }) + .await?; + } + // > 0 Update - batches updates with a fake Create op + else { + let mut data = BTreeMap::new(); + + for op in ops.into_iter().rev() { + let CRDTOperationData::Update { field, value } = op.data else { + unreachable!("Create + Delete should be filtered out!"); + }; + + data.insert(field, (value, op.timestamp)); + } + + // conflict resolution + let (create, updates) = db + ._batch(( + db.crdt_operation() + .find_first(vec![ + crdt_operation::model::equals(model as i32), + crdt_operation::record_id::equals( + rmp_serde::to_vec(&record_id).unwrap(), + ), + crdt_operation::kind::equals(OperationKind::Create.to_string()), + ]) + .order_by(crdt_operation::timestamp::order(SortOrder::Desc)), + data.iter() + .map(|(k, (_, timestamp))| { + db.crdt_operation() + .find_first(vec![ + crdt_operation::timestamp::gt(timestamp.as_u64() as i64), + crdt_operation::model::equals(model as i32), + crdt_operation::record_id::equals( + rmp_serde::to_vec(&record_id).unwrap(), + ), + crdt_operation::kind::equals( + OperationKind::Update(k).to_string(), + ), + ]) + .order_by(crdt_operation::timestamp::order(SortOrder::Desc)) + }) + .collect::>(), + )) + .await?; + + if create.is_none() { + return Ok(()); + } + + // does the same thing as processing ops one-by-one and returning early if a newer op was found + for (update, key) in updates + .into_iter() + .zip(data.keys().cloned().collect::>()) + { + if update.is_some() { + data.remove(&key); + } + } + + self.db + ._transaction() + .with_timeout(30 * 1000) + .run(|db| async move { + // fake operation to batch them all at once + ModelSyncData::from_op(CRDTOperation { + instance, + model, + record_id: record_id.clone(), + timestamp: NTP64(0), + data: CRDTOperationData::Create( + data.iter() + .map(|(k, (data, _))| (k.to_string(), data.clone())) + .collect(), + ), + }) + .unwrap() + .exec(&db) + .await?; + + // need to only apply ops that haven't been filtered out + for (field, (value, timestamp)) in data { + write_crdt_op_to_db( + &CRDTOperation { + instance, + model, + record_id: record_id.clone(), + timestamp, + data: CRDTOperationData::Update { field, value }, + }, + &db, + ) + .await?; + } + + Ok(()) + }) + .await?; + } + + // update the stored timestamp for this instance - will be derived from the crdt operations table on restart + let new_ts = NTP64::max(timestamp.unwrap_or_default(), new_timestamp); + + self.timestamps.write().await.insert(instance, new_ts); + + // self.io.req_tx.send(Request::Ingested).await.ok(); + + Ok(()) } } @@ -253,8 +451,9 @@ pub struct Handler { #[derive(Debug)] pub struct MessagesEvent { pub instance_id: Uuid, - pub messages: Vec, + pub messages: CompressedCRDTOperations, pub has_more: bool, + pub wait_tx: Option>, } impl ActorTypes for Actor { @@ -276,14 +475,19 @@ mod test { let shared = Arc::new(SharedState { db: sd_prisma::test_db().await, instance, - clock: HLCBuilder::new().with_id(instance.into()).build(), + clock: HLCBuilder::new() + .with_id(uhlc::ID::from( + NonZeroU128::new(instance.to_u128_le()).expect("Non zero id"), + )) + .build(), timestamps: Default::default(), emit_messages_flag: Arc::new(AtomicBool::new(true)), active: Default::default(), active_notify: Default::default(), + actors: Default::default(), }); - (Actor::spawn(shared.clone()), shared) + (Actor::declare(shared.clone()).await, shared) } /// If messages tx is dropped, actor should reset and assume no further messages @@ -295,18 +499,12 @@ mod test { for _ in 0..10 { let mut rx = ingest.req_rx.lock().await; - println!("lock acquired"); - ingest.event_tx.send(Event::Notification).await.unwrap(); - println!("notificaton sent"); - let Some(Request::Messages { .. }) = rx.recv().await else { panic!("bruh") }; - println!("message received"); - // without this the test hangs, idk tokio::time::sleep(Duration::from_millis(0)).await; } diff --git a/core/crates/sync/src/lib.rs b/core/crates/sync/src/lib.rs index f2afa081b..4a0a63090 100644 --- a/core/crates/sync/src/lib.rs +++ b/core/crates/sync/src/lib.rs @@ -34,6 +34,7 @@ pub struct SharedState { pub clock: uhlc::HLC, pub active: AtomicBool, pub active_notify: tokio::sync::Notify, + pub actors: Arc, } #[must_use] diff --git a/core/crates/sync/src/manager.rs b/core/crates/sync/src/manager.rs index a25581738..c06029210 100644 --- a/core/crates/sync/src/manager.rs +++ b/core/crates/sync/src/manager.rs @@ -8,6 +8,7 @@ use std::{ cmp::Ordering, collections::HashMap, fmt, + num::NonZeroU128, ops::Deref, sync::{ atomic::{self, AtomicBool}, @@ -24,6 +25,7 @@ pub struct Manager { pub tx: broadcast::Sender, pub ingest: ingest::Handler, pub shared: Arc, + pub timestamp_lock: tokio::sync::Semaphore, } impl fmt::Debug for Manager { @@ -45,15 +47,20 @@ pub struct New { impl Manager { #[allow(clippy::new_ret_no_self)] - pub fn new( + pub async fn new( db: &Arc, instance: Uuid, emit_messages_flag: &Arc, timestamps: HashMap, + actors: &Arc, ) -> New { let (tx, rx) = broadcast::channel(64); - let clock = HLCBuilder::new().with_id(instance.into()).build(); + let clock = HLCBuilder::new() + .with_id(uhlc::ID::from( + NonZeroU128::new(instance.to_u128_le()).expect("Non zero id"), + )) + .build(); let shared = Arc::new(SharedState { db: db.clone(), @@ -63,12 +70,18 @@ impl Manager { emit_messages_flag: emit_messages_flag.clone(), active: Default::default(), active_notify: Default::default(), + actors: actors.clone(), }); - let ingest = ingest::Actor::spawn(shared.clone()); + let ingest = ingest::Actor::declare(shared.clone()).await; New { - manager: Self { tx, ingest, shared }, + manager: Self { + tx, + ingest, + shared, + timestamp_lock: tokio::sync::Semaphore::new(1), + }, rx, } } @@ -80,20 +93,36 @@ impl Manager { pub async fn write_ops<'item, I: prisma_client_rust::BatchItem<'item>>( &self, tx: &PrismaClient, - (_ops, queries): (Vec, I), + (mut ops, queries): (Vec, I), ) -> prisma_client_rust::Result<::ReturnValue> { let ret = if self.emit_messages_flag.load(atomic::Ordering::Relaxed) { + let lock = self.timestamp_lock.acquire().await; + + ops.iter_mut().for_each(|op| { + op.timestamp = *self.get_clock().new_timestamp().get_time(); + }); + let (res, _) = tx ._batch(( queries, - _ops.iter() + ops.iter() .map(|op| crdt_op_db(op).to_query(tx)) .collect::>(), )) .await?; + if let Some(last) = ops.last() { + self.shared + .timestamps + .write() + .await + .insert(self.instance, last.timestamp); + } + self.tx.send(SyncMessage::Created).ok(); + drop(lock); + res } else { tx._batch([queries]).await?.remove(0) @@ -106,19 +135,31 @@ impl Manager { pub async fn write_op<'item, Q: prisma_client_rust::BatchItem<'item>>( &self, tx: &PrismaClient, - op: CRDTOperation, + mut op: CRDTOperation, query: Q, ) -> prisma_client_rust::Result<::ReturnValue> { let ret = if self.emit_messages_flag.load(atomic::Ordering::Relaxed) { + let lock = self.timestamp_lock.acquire().await; + + op.timestamp = *self.get_clock().new_timestamp().get_time(); + let ret = tx._batch((crdt_op_db(&op).to_query(tx), query)).await?.1; self.tx.send(SyncMessage::Created).ok(); + drop(lock); + ret } else { tx._batch(vec![query]).await?.remove(0) }; + self.shared + .timestamps + .write() + .await + .insert(self.instance, op.timestamp); + Ok(ret) } @@ -134,7 +175,7 @@ impl Manager { .crdt_operation() .find_many(vec![ crdt_operation::instance::is(vec![instance::pub_id::equals(uuid_to_bytes( - instance_uuid, + &instance_uuid, ))]), crdt_operation::timestamp::gt(timestamp.as_u64() as i64), ]) @@ -163,7 +204,7 @@ impl Manager { .map(|(instance_id, timestamp)| { prisma_client_rust::and![ $op::instance::is(vec![instance::pub_id::equals(uuid_to_bytes( - *instance_id + instance_id ))]), $op::timestamp::gt(timestamp.as_u64() as i64) ] @@ -175,7 +216,7 @@ impl Manager { .clocks .iter() .map(|(instance_id, _)| { - uuid_to_bytes(*instance_id) + uuid_to_bytes(instance_id) }) .collect() ) @@ -210,7 +251,7 @@ impl Manager { pub async fn get_cloud_ops( &self, args: GetOpsArgs, - ) -> prisma_client_rust::Result> { + ) -> prisma_client_rust::Result> { let db = &self.db; macro_rules! db_args { @@ -222,7 +263,7 @@ impl Manager { .map(|(instance_id, timestamp)| { prisma_client_rust::and![ $op::instance::is(vec![instance::pub_id::equals(uuid_to_bytes( - *instance_id + instance_id ))]), $op::timestamp::gt(timestamp.as_u64() as i64) ] @@ -234,7 +275,7 @@ impl Manager { .clocks .iter() .map(|(instance_id, _)| { - uuid_to_bytes(*instance_id) + uuid_to_bytes(instance_id) }) .collect() ) diff --git a/core/crates/sync/tests/lib.rs b/core/crates/sync/tests/lib.rs index 058b7902d..03555953f 100644 --- a/core/crates/sync/tests/lib.rs +++ b/core/crates/sync/tests/lib.rs @@ -4,13 +4,15 @@ use sd_core_sync::*; use sd_prisma::{prisma, prisma_sync}; use sd_sync::*; -use sd_utils::uuid_to_bytes; +use sd_utils::{msgpack, uuid_to_bytes}; use mock_instance::Instance; use uuid::Uuid; -async fn write_test_location(instance: &Instance) -> Result<(), Box> { - instance +async fn write_test_location( + instance: &Instance, +) -> Result> { + Ok(instance .sync .write_ops(&instance.db, { let id = Uuid::new_v4(); @@ -28,16 +30,14 @@ async fn write_test_location(instance: &Instance) -> Result<(), Box Result<(), Box> Ok(()) } + +#[tokio::test] +async fn no_update_after_delete() -> Result<(), Box> { + let instance1 = Instance::new(Uuid::new_v4()).await; + let instance2 = Instance::new(Uuid::new_v4()).await; + + Instance::pair(&instance1, &instance2).await; + + let location = write_test_location(&instance1).await?; + + assert!(matches!( + instance2.sync_rx.resubscribe().recv().await?, + SyncMessage::Ingested + )); + + instance2 + .sync + .write_op( + &instance2.db, + instance2.sync.shared_delete(prisma_sync::location::SyncId { + pub_id: location.pub_id.clone(), + }), + instance2.db.location().delete_many(vec![]), + ) + .await?; + + assert!(matches!( + instance1.sync_rx.resubscribe().recv().await?, + SyncMessage::Ingested + )); + + instance1 + .sync + .write_op( + &instance1.db, + instance1.sync.shared_update( + prisma_sync::location::SyncId { + pub_id: location.pub_id.clone(), + }, + "name", + msgpack!("New Location"), + ), + instance1.db.location().find_many(vec![]), + ) + .await + .ok(); + + // one spare update operation that actually gets ignored by instance 2 + assert_eq!(instance1.db.crdt_operation().count(vec![]).exec().await?, 5); + assert_eq!(instance2.db.crdt_operation().count(vec![]).exec().await?, 4); + + assert_eq!(instance1.db.location().count(vec![]).exec().await?, 0); + // the whole point of the test - the update (which is ingested as an upsert) should be ignored + assert_eq!(instance2.db.location().count(vec![]).exec().await?, 0); + + instance1.teardown().await; + instance2.teardown().await; + + Ok(()) +} diff --git a/core/crates/sync/tests/mock_instance.rs b/core/crates/sync/tests/mock_instance.rs index e3bf0fe99..5a4408c43 100644 --- a/core/crates/sync/tests/mock_instance.rs +++ b/core/crates/sync/tests/mock_instance.rs @@ -1,5 +1,6 @@ use sd_core_sync::*; -use sd_prisma::prisma; +use sd_prisma::prisma::{self}; +use sd_sync::CompressedCRDTOperations; use sd_utils::uuid_to_bytes; use prisma_client_rust::chrono::Utc; @@ -35,7 +36,7 @@ impl Instance { db.instance() .create( - uuid_to_bytes(id), + uuid_to_bytes(&id), vec![], vec![], Utc::now().into(), @@ -51,7 +52,9 @@ impl Instance { id, &Arc::new(AtomicBool::new(true)), Default::default(), - ); + &Default::default(), + ) + .await; Arc::new(Self { id, @@ -70,7 +73,7 @@ impl Instance { left.db .instance() .create( - uuid_to_bytes(right.id), + uuid_to_bytes(&right.id), vec![], vec![], Utc::now().into(), @@ -122,16 +125,17 @@ impl Instance { ingest .event_tx .send(ingest::Event::Messages(ingest::MessagesEvent { - messages, + messages: CompressedCRDTOperations::new(messages), has_more: false, instance_id: instance1.id, + wait_tx: None, })) .await .unwrap(); } - ingest::Request::Ingested => { - instance2.sync.tx.send(SyncMessage::Ingested).ok(); - } + // ingest::Request::Ingested => { + // instance2.sync.tx.send(SyncMessage::Ingested).ok(); + // } ingest::Request::FinishedIngesting => {} } } diff --git a/core/prisma/migrations/20240409202941_rename_media_data_to_exif_data/migration.sql b/core/prisma/migrations/20240409202941_rename_media_data_to_exif_data/migration.sql new file mode 100644 index 000000000..c9069a8de --- /dev/null +++ b/core/prisma/migrations/20240409202941_rename_media_data_to_exif_data/migration.sql @@ -0,0 +1,52 @@ +-- CreateTable +CREATE TABLE "exif_data" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "resolution" BLOB, + "media_date" BLOB, + "media_location" BLOB, + "camera_data" BLOB, + "artist" TEXT, + "description" TEXT, + "copyright" TEXT, + "exif_version" TEXT, + "epoch_time" BIGINT, + "object_id" INTEGER NOT NULL, + CONSTRAINT "exif_data_object_id_fkey" FOREIGN KEY ("object_id") REFERENCES "object" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CopyData +INSERT INTO "exif_data" ( + "id", + "resolution", + "media_date", + "media_location", + "camera_data", + "artist", + "description", + "copyright", + "exif_version", + "epoch_time", + "object_id" +) +SELECT + "id", + "resolution", + "media_date", + "media_location", + "camera_data", + "artist", + "description", + "copyright", + "exif_version", + "epoch_time", + "object_id" +FROM + "media_data"; + +-- DropTable +PRAGMA foreign_keys=off; +DROP TABLE "media_data"; +PRAGMA foreign_keys=on; + +-- CreateIndex +CREATE UNIQUE INDEX "exif_data_object_id_key" ON "exif_data"("object_id"); diff --git a/core/prisma/migrations/20240508074615_ffmpeg_media_data/migration.sql b/core/prisma/migrations/20240508074615_ffmpeg_media_data/migration.sql new file mode 100644 index 000000000..2bc689a7e --- /dev/null +++ b/core/prisma/migrations/20240508074615_ffmpeg_media_data/migration.sql @@ -0,0 +1,128 @@ +-- CreateTable +CREATE TABLE "ffmpeg_data" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "formats" TEXT NOT NULL, + "bit_rate" BLOB NOT NULL, + "duration" BLOB, + "start_time" BLOB, + "title" TEXT, + "creation_time" DATETIME, + "date" DATETIME, + "album_artist" TEXT, + "disc" TEXT, + "track" TEXT, + "album" TEXT, + "artist" TEXT, + "metadata" BLOB, + "object_id" INTEGER NOT NULL, + CONSTRAINT "ffmpeg_data_object_id_fkey" FOREIGN KEY ("object_id") REFERENCES "object" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "ffmpeg_media_chapter" ( + "chapter_id" INTEGER NOT NULL, + "start" BLOB NOT NULL, + "end" BLOB NOT NULL, + "time_base_den" INTEGER NOT NULL, + "time_base_num" INTEGER NOT NULL, + "title" TEXT, + "metadata" BLOB, + "ffmpeg_data_id" INTEGER NOT NULL, + + PRIMARY KEY ("ffmpeg_data_id", "chapter_id"), + CONSTRAINT "ffmpeg_media_chapter_ffmpeg_data_id_fkey" FOREIGN KEY ("ffmpeg_data_id") REFERENCES "ffmpeg_data" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "ffmpeg_media_program" ( + "program_id" INTEGER NOT NULL, + "name" TEXT, + "metadata" BLOB, + "ffmpeg_data_id" INTEGER NOT NULL, + + PRIMARY KEY ("ffmpeg_data_id", "program_id"), + CONSTRAINT "ffmpeg_media_program_ffmpeg_data_id_fkey" FOREIGN KEY ("ffmpeg_data_id") REFERENCES "ffmpeg_data" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "ffmpeg_media_stream" ( + "stream_id" INTEGER NOT NULL, + "name" TEXT, + "aspect_ratio_num" INTEGER NOT NULL, + "aspect_ratio_den" INTEGER NOT NULL, + "frames_per_second_num" INTEGER NOT NULL, + "frames_per_second_den" INTEGER NOT NULL, + "time_base_real_den" INTEGER NOT NULL, + "time_base_real_num" INTEGER NOT NULL, + "dispositions" TEXT, + "title" TEXT, + "encoder" TEXT, + "language" TEXT, + "duration" BLOB, + "metadata" BLOB, + "program_id" INTEGER NOT NULL, + "ffmpeg_data_id" INTEGER NOT NULL, + + PRIMARY KEY ("ffmpeg_data_id", "program_id", "stream_id"), + CONSTRAINT "ffmpeg_media_stream_ffmpeg_data_id_program_id_fkey" FOREIGN KEY ("ffmpeg_data_id", "program_id") REFERENCES "ffmpeg_media_program" ("ffmpeg_data_id", "program_id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "ffmpeg_media_codec" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "kind" TEXT, + "sub_kind" TEXT, + "tag" TEXT, + "name" TEXT, + "profile" TEXT, + "bit_rate" INTEGER NOT NULL, + "stream_id" INTEGER NOT NULL, + "program_id" INTEGER NOT NULL, + "ffmpeg_data_id" INTEGER NOT NULL, + CONSTRAINT "ffmpeg_media_codec_ffmpeg_data_id_program_id_stream_id_fkey" FOREIGN KEY ("ffmpeg_data_id", "program_id", "stream_id") REFERENCES "ffmpeg_media_stream" ("ffmpeg_data_id", "program_id", "stream_id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "ffmpeg_media_video_props" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "pixel_format" TEXT, + "color_range" TEXT, + "bits_per_channel" INTEGER, + "color_space" TEXT, + "color_primaries" TEXT, + "color_transfer" TEXT, + "field_order" TEXT, + "chroma_location" TEXT, + "width" INTEGER NOT NULL, + "height" INTEGER NOT NULL, + "aspect_ratio_num" INTEGER, + "aspect_ratio_Den" INTEGER, + "properties" TEXT, + "codec_id" INTEGER NOT NULL, + CONSTRAINT "ffmpeg_media_video_props_codec_id_fkey" FOREIGN KEY ("codec_id") REFERENCES "ffmpeg_media_codec" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "ffmpeg_media_audio_props" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "delay" INTEGER NOT NULL, + "padding" INTEGER NOT NULL, + "sample_rate" INTEGER, + "sample_format" TEXT, + "bit_per_sample" INTEGER, + "channel_layout" TEXT, + "codec_id" INTEGER NOT NULL, + CONSTRAINT "ffmpeg_media_audio_props_codec_id_fkey" FOREIGN KEY ("codec_id") REFERENCES "ffmpeg_media_codec" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateIndex +CREATE UNIQUE INDEX "ffmpeg_data_object_id_key" ON "ffmpeg_data"("object_id"); + +-- CreateIndex +CREATE UNIQUE INDEX "ffmpeg_media_codec_ffmpeg_data_id_program_id_stream_id_key" ON "ffmpeg_media_codec"("ffmpeg_data_id", "program_id", "stream_id"); + +-- CreateIndex +CREATE UNIQUE INDEX "ffmpeg_media_video_props_codec_id_key" ON "ffmpeg_media_video_props"("codec_id"); + +-- CreateIndex +CREATE UNIQUE INDEX "ffmpeg_media_audio_props_codec_id_key" ON "ffmpeg_media_audio_props"("codec_id"); diff --git a/core/prisma/migrations/20240512011221_better_statistics/migration.sql b/core/prisma/migrations/20240512011221_better_statistics/migration.sql new file mode 100644 index 000000000..437f9d913 --- /dev/null +++ b/core/prisma/migrations/20240512011221_better_statistics/migration.sql @@ -0,0 +1,29 @@ +/* + Warnings: + + - You are about to drop the column `preview_media_bytes` on the `statistics` table. All the data in the column will be lost. + - You are about to drop the column `total_bytes_capacity` on the `statistics` table. All the data in the column will be lost. + - You are about to drop the column `total_bytes_free` on the `statistics` table. All the data in the column will be lost. + - You are about to drop the column `total_bytes_used` on the `statistics` table. All the data in the column will be lost. + - You are about to drop the column `total_unique_bytes` on the `statistics` table. All the data in the column will be lost. + +*/ +-- RedefineTables +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_statistics" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "date_captured" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "total_object_count" INTEGER NOT NULL DEFAULT 0, + "library_db_size" TEXT NOT NULL DEFAULT '0', + "total_local_bytes_used" TEXT NOT NULL DEFAULT '0', + "total_local_bytes_capacity" TEXT NOT NULL DEFAULT '0', + "total_local_bytes_free" TEXT NOT NULL DEFAULT '0', + "total_library_bytes" TEXT NOT NULL DEFAULT '0', + "total_library_unique_bytes" TEXT NOT NULL DEFAULT '0', + "total_library_preview_media_bytes" TEXT NOT NULL DEFAULT '0' +); +INSERT INTO "new_statistics" ("date_captured", "id", "library_db_size", "total_object_count") SELECT "date_captured", "id", "library_db_size", "total_object_count" FROM "statistics"; +DROP TABLE "statistics"; +ALTER TABLE "new_statistics" RENAME TO "statistics"; +PRAGMA foreign_key_check; +PRAGMA foreign_keys=ON; diff --git a/core/prisma/migrations/20240517045456_change_indexer_rule_name_to_unique/migration.sql b/core/prisma/migrations/20240517045456_change_indexer_rule_name_to_unique/migration.sql new file mode 100644 index 000000000..c938aff04 --- /dev/null +++ b/core/prisma/migrations/20240517045456_change_indexer_rule_name_to_unique/migration.sql @@ -0,0 +1,12 @@ +-- Update duplicate names to make them unique +UPDATE "indexer_rule" +SET "name" = "name" || '_' || "id" +WHERE "name" IN ( + SELECT "name" + FROM "indexer_rule" + GROUP BY "name" + HAVING COUNT(*) > 1 +); + +-- CreateIndex +CREATE UNIQUE INDEX "indexer_rule_name_key" ON "indexer_rule"("name"); diff --git a/core/prisma/migrations/20240531034707_add_node_remote_identity_to_instance/migration.sql b/core/prisma/migrations/20240531034707_add_node_remote_identity_to_instance/migration.sql new file mode 100644 index 000000000..8b2917a32 --- /dev/null +++ b/core/prisma/migrations/20240531034707_add_node_remote_identity_to_instance/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "instance" ADD COLUMN "node_remote_identity" BLOB; diff --git a/core/prisma/schema.prisma b/core/prisma/schema.prisma index 6470d0040..35358a221 100644 --- a/core/prisma/schema.prisma +++ b/core/prisma/schema.prisma @@ -16,6 +16,7 @@ generator sync { client_format = "folder" } +/// @local model CRDTOperation { id Int @id @default(autoincrement()) @@ -33,6 +34,7 @@ model CRDTOperation { @@map("crdt_operation") } +/// @local model CloudCRDTOperation { id Int @id @default(autoincrement()) @@ -51,6 +53,7 @@ model CloudCRDTOperation { } /// @deprecated: This model has to exist solely for backwards compatibility. +/// @local model Node { id Int @id @default(autoincrement()) pub_id Bytes @unique @@ -65,6 +68,7 @@ model Node { // represents a single `.db` file (SQLite DB) that is paired to the current library. // A `LibraryInstance` is always owned by a single `Node` but it's possible for that node to change (or two to be owned by a single node). +/// @local(id: pub_id) model Instance { id Int @id @default(autoincrement()) // This is is NOT globally unique pub_id Bytes @unique // This UUID is meaningless and exists soley cause the `uhlc::ID` must be 16-bit. Really this should be derived from the `identity` field. @@ -73,8 +77,11 @@ model Instance { // Enum: sd_core::node::RemoteIdentity remote_identity Bytes - node_id Bytes - metadata Bytes? // TODO: This should not be optional + // Enum: uuid::Uuid + node_id Bytes + // Enum: sd_core::node::RemoteIdentity + node_remote_identity Bytes? // TODO: This should not be optional + metadata Bytes? // TODO: This should not be optional last_seen DateTime // Time core started for owner, last P2P message for P2P node date_created DateTime @@ -89,16 +96,20 @@ model Instance { @@map("instance") } +/// @local model Statistics { - id Int @id @default(autoincrement()) - date_captured DateTime @default(now()) - total_object_count Int @default(0) - library_db_size String @default("0") - total_bytes_used String @default("0") - total_bytes_capacity String @default("0") - total_unique_bytes String @default("0") - total_bytes_free String @default("0") - preview_media_bytes String @default("0") + id Int @id @default(autoincrement()) + date_captured DateTime @default(now()) + total_object_count Int @default(0) + library_db_size String @default("0") + // local calulations + total_local_bytes_used String @default("0") + total_local_bytes_capacity String @default("0") + total_local_bytes_free String @default("0") + // library calculations + total_library_bytes String @default("0") + total_library_unique_bytes String @default("0") + total_library_preview_media_bytes String @default("0") @@map("statistics") } @@ -137,8 +148,7 @@ model Location { scan_state Int @default(0) // Enum: sd_core::location::ScanState - /// @local - // this is just a client side cache which is annoying but oh well (@brendan) + // this should just be a local-only cache but it's too much effort to broadcast online locations rn (@brendan) instance_id Int? instance Instance? @relation(fields: [instance_id], references: [id], onDelete: SetNull) @@ -226,33 +236,23 @@ model Object { date_created DateTime? date_accessed DateTime? - tags TagOnObject[] - labels LabelOnObject[] - albums ObjectInAlbum[] - spaces ObjectInSpace[] - file_paths FilePath[] + tags TagOnObject[] + labels LabelOnObject[] + albums ObjectInAlbum[] + spaces ObjectInSpace[] + file_paths FilePath[] // comments Comment[] - media_data MediaData? + exif_data ExifData? + ffmpeg_data FfmpegData? // key Key? @relation(fields: [key_id], references: [id]) @@map("object") } -// if there is a conflicting cas_id, the conficting file should be updated to have a larger cas_id as -//the field is unique, however this record is kept to tell the indexer (upon discovering this CAS) that -//there is alternate versions of the file and to check by a full integrity hash to define for which to associate with. -// @brendan: nah this probably won't fly -// model FileConflict { -// original_object_id Int @unique -// detactched_object_id Int @unique - -// @@map("file_conflict") -// } - -// keys allow us to know exactly which files can be decrypted with a given key -// they can be "mounted" to a client, and then used to decrypt files automatically -/// @shared(id: uuid) +// // keys allow us to know exactly which files can be decrypted with a given key +// // they can be "mounted" to a client, and then used to decrypt files automatically +// /// @shared(id: uuid) // model Key { // id Int @id @default(autoincrement()) // // uuid to identify the key @@ -293,7 +293,7 @@ model Object { // } /// @shared(id: object, modelId: 4) -model MediaData { +model ExifData { id Int @id @default(autoincrement()) resolution Bytes? @@ -310,17 +310,164 @@ model MediaData { // (e.g. we can't get `MediaDate::Utc(2023-09-26T22:04:37+01:00)` from `1695758677` as we don't store the TZ) epoch_time BigInt? // time since unix epoch - // video-specific - // duration Int? - // fps Int? - // streams Int? - // video_codec String? // eg: "h264, h265, av1" - // audio_codec String? // eg: "opus" - object_id Int @unique object Object @relation(fields: [object_id], references: [id], onDelete: Cascade) - @@map("media_data") + @@map("exif_data") +} + +model FfmpegData { + id Int @id @default(autoincrement()) + + // Internal FFmpeg properties + formats String + bit_rate Bytes // Actually a i64 in the backend + duration Bytes? // Actually a i64 in the backend + start_time Bytes? // Actually a i64 in the backend + + chapters FfmpegMediaChapter[] + programs FfmpegMediaProgram[] + + // Metadata for search + title String? + creation_time DateTime? + date DateTime? + album_artist String? + disc String? + track String? + album String? + artist String? + metadata Bytes? + + object Object @relation(fields: [object_id], references: [id], onDelete: Cascade) + object_id Int @unique + + @@map("ffmpeg_data") +} + +model FfmpegMediaChapter { + chapter_id Int + + start Bytes // Actually a i64 in the backend + end Bytes // Actually a i64 in the backend + + time_base_den Int + time_base_num Int + + // Metadata for search + title String? + metadata Bytes? + + ffmpeg_data FfmpegData @relation(fields: [ffmpeg_data_id], references: [id], onDelete: Cascade) + ffmpeg_data_id Int + + @@id(name: "likeId", [ffmpeg_data_id, chapter_id]) + @@map("ffmpeg_media_chapter") +} + +model FfmpegMediaProgram { + program_id Int + + streams FfmpegMediaStream[] + + // Metadata for search + name String? + metadata Bytes? + + ffmpeg_data FfmpegData @relation(fields: [ffmpeg_data_id], references: [id], onDelete: Cascade) + ffmpeg_data_id Int + + @@id(name: "likeId", [ffmpeg_data_id, program_id]) + @@map("ffmpeg_media_program") +} + +model FfmpegMediaStream { + stream_id Int + + name String? + codec FfmpegMediaCodec? + aspect_ratio_num Int + aspect_ratio_den Int + frames_per_second_num Int + frames_per_second_den Int + time_base_real_den Int + time_base_real_num Int + dispositions String? + + // Metadata for search + title String? + encoder String? + language String? + duration Bytes? // Actually a i64 in the backend + metadata Bytes? + + program FfmpegMediaProgram @relation(fields: [ffmpeg_data_id, program_id], references: [ffmpeg_data_id, program_id], onDelete: Cascade) + program_id Int + ffmpeg_data_id Int + + @@id(name: "likeId", [ffmpeg_data_id, program_id, stream_id]) + @@map("ffmpeg_media_stream") +} + +model FfmpegMediaCodec { + id Int @id @default(autoincrement()) + + kind String? + sub_kind String? + tag String? + name String? + profile String? + bit_rate Int + + video_props FfmpegMediaVideoProps? + audio_props FfmpegMediaAudioProps? + + stream FfmpegMediaStream @relation(fields: [ffmpeg_data_id, program_id, stream_id], references: [ffmpeg_data_id, program_id, stream_id], onDelete: Cascade) + stream_id Int + program_id Int + ffmpeg_data_id Int + + @@unique([ffmpeg_data_id, program_id, stream_id]) + @@map("ffmpeg_media_codec") +} + +model FfmpegMediaVideoProps { + id Int @id @default(autoincrement()) + + pixel_format String? + color_range String? + bits_per_channel Int? + color_space String? + color_primaries String? + color_transfer String? + field_order String? + chroma_location String? + width Int + height Int + aspect_ratio_num Int? + aspect_ratio_Den Int? + properties String? + + codec FfmpegMediaCodec @relation(fields: [codec_id], references: [id], onDelete: Cascade) + codec_id Int @unique + + @@map("ffmpeg_media_video_props") +} + +model FfmpegMediaAudioProps { + id Int @id @default(autoincrement()) + + delay Int + padding Int + sample_rate Int? + sample_format String? + bit_per_sample Int? + channel_layout String? + + codec FfmpegMediaCodec @relation(fields: [codec_id], references: [id], onDelete: Cascade) + codec_id Int @unique + + @@map("ffmpeg_media_audio_props") } //// Tag //// @@ -473,27 +620,13 @@ model ObjectInAlbum { @@map("object_in_album") } -//// Comment //// - -// model Comment { -// id Int @id @default(autoincrement()) -// pub_id Bytes @unique -// content String -// date_created DateTime @default(now()) -// date_modified DateTime @default(now()) -// object_id Int? -// object Object? @relation(fields: [object_id], references: [id]) - -// @@map("comment") -// } - //// Indexer Rules //// model IndexerRule { id Int @id @default(autoincrement()) pub_id Bytes @unique - name String? + name String? @unique default Boolean? rules_per_kind Bytes? date_created DateTime? diff --git a/core/src/api/auth.rs b/core/src/api/auth.rs index 79a672514..52673323e 100644 --- a/core/src/api/auth.rs +++ b/core/src/api/auth.rs @@ -32,13 +32,21 @@ pub(crate) fn mount() -> AlphaRouter { } async_stream::stream! { + let device_type = if cfg!(target_arch = "wasm32") { + "web".to_string() + } else if cfg!(target_os = "ios") || cfg!(target_os = "android") { + "mobile".to_string() + } else { + "desktop".to_string() + }; + let auth_response = match match node .http .post(&format!( "{}/login/device/code", &node.env.api_url.lock().await )) - .form(&[("client_id", &node.env.client_id)]) + .form(&[("client_id", &node.env.client_id), ("device", &device_type)]) .send() .await .map_err(|e| e.to_string()) diff --git a/core/src/api/backups.rs b/core/src/api/backups.rs index 50db04ad2..de3bb1deb 100644 --- a/core/src/api/backups.rs +++ b/core/src/api/backups.rs @@ -150,15 +150,19 @@ async fn start_backup(node: Arc, library: Arc) -> Uuid { match do_backup(bkp_id, &node, &library).await { Ok(path) => { info!( - "Backup '{bkp_id}' for library '{}' created at '{path:?}'!", - library.id + backup_id = %bkp_id, + library_id = %library.id, + path = %path.display(), + "Backup created!;", ); invalidate_query!(library, "backups.getAll"); } Err(e) => { error!( - "Error with backup '{bkp_id}' for library '{}': {e:?}", - library.id + backup_id = %bkp_id, + library_id = %library.id, + ?e, + "Error with backup for library;", ); // TODO: Alert user something went wrong @@ -282,10 +286,10 @@ async fn do_backup(id: Uuid, node: &Node, library: &Library) -> Result, path: PathBuf) { match restore_backup(&node, &path).await { Ok(Header { id, library_id, .. }) => { - info!("Restored to '{id}' for library '{library_id}'!",); + info!(%id, %library_id, "Restored backup for library!"); } Err(e) => { - error!("Error restoring backup '{}': {e:#?}", path.display()); + error!(path = %path.display(), ?e, "Error restoring backup;"); // TODO: Alert user something went wrong } diff --git a/core/src/api/cloud.rs b/core/src/api/cloud.rs index ec9df0abe..ecffa5fe8 100644 --- a/core/src/api/cloud.rs +++ b/core/src/api/cloud.rs @@ -28,7 +28,7 @@ pub(crate) fn mount() -> AlphaRouter { .procedure("setApiOrigin", { R.mutation(|node, origin: String| async move { let mut origin_env = node.env.api_url.lock().await; - *origin_env = origin.clone(); + origin_env.clone_from(&origin); node.config .write(|c| { @@ -44,6 +44,10 @@ pub(crate) fn mount() -> AlphaRouter { } mod library { + use std::str::FromStr; + + use sd_p2p::RemoteIdentity; + use crate::util::MaybeUndefined; use super::*; @@ -75,6 +79,7 @@ mod library { library.instance_uuid, library.identity.to_remote_identity(), node_config.id, + node_config.identity.to_remote_identity(), &node.p2p.peer_metadata(), ) .await?; @@ -139,6 +144,7 @@ mod library { library.instance_uuid, library.identity.to_remote_identity(), node_config.id, + node_config.identity.to_remote_identity(), node.p2p.peer_metadata(), ) .await?; @@ -149,10 +155,12 @@ mod library { &library.db, &library.sync, &node.libraries, - instance.uuid, + &instance.uuid, instance.identity, - instance.node_id, - node.p2p.peer_metadata(), + &instance.node_id, + RemoteIdentity::from_str(&instance.node_remote_identity) + .expect("malformed remote identity in the DB"), + instance.metadata, ) .await?; } @@ -296,8 +304,8 @@ mod locations { .body(ByteStream::from_body_0_4(Full::from("Hello, world!"))) .send() .await - .map_err(|err| { - tracing::error!("S3 error: {err:?}"); + .map_err(|e| { + tracing::error!(?e, "S3 error;"); rspc::Error::new( rspc::ErrorCode::InternalServerError, "Failed to upload to S3".to_string(), diff --git a/core/src/api/ephemeral_files.rs b/core/src/api/ephemeral_files.rs index c614f4d48..c2cc85a52 100644 --- a/core/src/api/ephemeral_files.rs +++ b/core/src/api/ephemeral_files.rs @@ -1,19 +1,24 @@ use crate::{ - api::{files::create_file, utils::library}, + api::{ + files::{create_file, MediaData}, + utils::library, + }, invalidate_query, library::Library, object::{ fs::{error::FileSystemJobsError, find_available_filename_for_duplicate}, - media::media_data_extractor::{ - can_extract_media_data_for_image, extract_media_data, MediaDataError, - }, + // media::exif_metadata_extractor::{can_extract_exif_data_for_image, extract_exif_data}, }, }; use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_heavy_lifting::media_processor::exif_media_data; -use sd_file_ext::extensions::ImageExtension; -use sd_media_metadata::MediaMetadata; +use sd_file_ext::{ + extensions::{Extension, ImageExtension}, + kind::ObjectKind, +}; +use sd_media_metadata::FFmpegMetadata; use sd_utils::error::FileIOError; use std::{ffi::OsStr, path::PathBuf, str::FromStr}; @@ -50,30 +55,56 @@ pub(crate) fn mount() -> AlphaRouter { R.router() .procedure("getMediaData", { R.query(|_, full_path: PathBuf| async move { - let Some(extension) = full_path.extension().and_then(|ext| ext.to_str()) else { - return Ok(None); - }; + let kind: Option = Extension::resolve_conflicting(&full_path, false) + .await + .map(Into::into); + match kind { + Some(ObjectKind::Image) => { + let Some(extension) = full_path.extension().and_then(|ext| ext.to_str()) + else { + return Ok(None); + }; - // TODO(fogodev): change this when we have media data for audio and videos - let image_extension = ImageExtension::from_str(extension).map_err(|e| { - error!("Failed to parse image extension: {e:#?}"); - rspc::Error::new(ErrorCode::BadRequest, "Invalid image extension".to_string()) - })?; + let image_extension = ImageExtension::from_str(extension).map_err(|e| { + error!(?e, "Failed to parse image extension;"); + rspc::Error::new( + ErrorCode::BadRequest, + "Invalid image extension".to_string(), + ) + })?; - if !can_extract_media_data_for_image(&image_extension) { - return Ok(None); - } + if !exif_media_data::can_extract(image_extension) { + return Ok(None); + } - match extract_media_data(full_path.clone()).await { - Ok(img_media_data) => Ok(Some(MediaMetadata::Image(Box::new(img_media_data)))), - Err(MediaDataError::MediaData(sd_media_metadata::Error::NoExifDataOnPath( - _, - ))) => Ok(None), - Err(e) => Err(rspc::Error::with_cause( - ErrorCode::InternalServerError, - "Failed to extract media data".to_string(), - e, - )), + let exif_data = exif_media_data::extract(full_path) + .await + .map_err(|e| { + rspc::Error::with_cause( + ErrorCode::InternalServerError, + "Failed to extract media data".to_string(), + e, + ) + })? + .map(MediaData::Exif); + + Ok(exif_data) + } + Some(v) if v == ObjectKind::Audio || v == ObjectKind::Video => { + let ffmpeg_data = MediaData::FFmpeg( + FFmpegMetadata::from_path(full_path).await.map_err(|e| { + error!(?e, "Failed to extract ffmpeg metadata;"); + rspc::Error::with_cause( + ErrorCode::InternalServerError, + e.to_string(), + e, + ) + })?, + ); + + Ok(Some(ffmpeg_data)) + } + _ => Ok(None), // No media data } }) }) @@ -165,16 +196,27 @@ pub(crate) fn mount() -> AlphaRouter { match fs::metadata(&path).await { Ok(_) => { #[cfg(not(any(target_os = "ios", target_os = "android")))] - trash::delete(&path).unwrap(); + trash::delete(&path).map_err(|e| { + FileIOError::from(( + path, + match e { + #[cfg(all(unix, not(target_os = "macos")))] + trash::Error::FileSystem { path: _, source: e } => e, + _ => io::Error::other(e), + }, + "Failed to delete file", + )) + })?; - Ok(()) + Ok::<_, rspc::Error>(()) } Err(e) if e.kind() == io::ErrorKind::NotFound => Ok(()), Err(e) => Err(FileIOError::from(( path, e, "Failed to get file metadata for deletion", - ))), + )) + .into()), } }) .collect::>() @@ -345,9 +387,10 @@ pub(crate) fn mount() -> AlphaRouter { fs::rename(&old_path, &new_path).await.map_err(|e| { error!( - "Failed to rename file from: '{}' to: '{}'; Error: {e:#?}", - old_path.display(), - new_path.display() + old_path = %old_path.display(), + new_path = %new_path.display(), + ?e, + "Failed to rename file;", ); let e = FileIOError::from((old_path, e, "Failed to rename file")); rspc::Error::with_cause(ErrorCode::Conflict, e.to_string(), e) @@ -454,7 +497,7 @@ impl EphemeralFileSystemOps { let target = target_dir.join(name); Some((source, target)) } else { - warn!("Skipping file with no name: '{}'", source.display()); + warn!(source = %source.display(), "Skipping file with no name;"); None } }) @@ -576,7 +619,7 @@ impl EphemeralFileSystemOps { let target = target_dir.join(name); Some((source, target)) } else { - warn!("Skipping file with no name: '{}'", source.display()); + warn!(source = %source.display(), "Skipping file with no name;"); None } }) diff --git a/core/src/api/files.rs b/core/src/api/files.rs index 63ede3af3..9a512fddc 100644 --- a/core/src/api/files.rs +++ b/core/src/api/files.rs @@ -9,20 +9,21 @@ use crate::{ old_copy::OldFileCopierJobInit, old_cut::OldFileCutterJobInit, old_delete::OldFileDeleterJobInit, old_erase::OldFileEraserJobInit, }, - media::media_data_image_from_prisma_data, + // media::{exif_media_data_from_prisma_data, ffmpeg_data_from_prisma_data}, }, - old_job::Job, + old_job::OldJob, }; use sd_core_file_path_helper::{FilePathError, IsolatedFilePathData}; +use sd_core_heavy_lifting::media_processor::{exif_media_data, ffmpeg_media_data}; use sd_core_prisma_helpers::{ file_path_to_isolate, file_path_to_isolate_with_id, object_with_file_paths, + object_with_media_data, }; -use sd_cache::{CacheNode, Model, NormalisedResult, Reference}; use sd_file_ext::kind::ObjectKind; use sd_images::ConvertibleExtension; -use sd_media_metadata::MediaMetadata; +use sd_media_metadata::{ExifMetadata, FFmpegMetadata}; use sd_prisma::{ prisma::{file_path, location, object}, prisma_sync, @@ -60,6 +61,12 @@ enum FileCreateContextTypes { Text, } +#[derive(Serialize, Type)] +pub(crate) enum MediaData { + Exif(ExifMetadata), + FFmpeg(FFmpegMetadata), +} + pub(crate) fn mount() -> AlphaRouter { R.router() .procedure("get", { @@ -75,21 +82,12 @@ pub(crate) fn mount() -> AlphaRouter { pub note: Option, pub date_created: Option>, pub date_accessed: Option>, - pub file_paths: Vec>, - } - - impl Model for ObjectWithFilePaths2 { - fn name() -> &'static str { - "Object" // is a duplicate because it's the same entity but with a relation - } + pub file_paths: Vec, } impl ObjectWithFilePaths2 { - pub fn from_db( - nodes: &mut Vec, - item: object_with_file_paths::Data, - ) -> Reference { - let this = Self { + pub fn from_db(item: object_with_file_paths::Data) -> Self { + Self { id: item.id, pub_id: item.pub_id, kind: item.kind, @@ -100,20 +98,8 @@ pub(crate) fn mount() -> AlphaRouter { note: item.note, date_created: item.date_created, date_accessed: item.date_accessed, - file_paths: item - .file_paths - .into_iter() - .map(|i| { - let id = i.id.to_string(); - nodes.push(CacheNode::new(id.clone(), i)); - Reference::new(id) - }) - .collect(), - }; - - let id = this.id.to_string(); - nodes.push(CacheNode::new(id.clone(), this)); - Reference::new(id) + file_paths: item.file_paths, + } } } @@ -126,13 +112,7 @@ pub(crate) fn mount() -> AlphaRouter { .include(object_with_file_paths::include()) .exec() .await? - .map(|item| { - let mut nodes = Vec::new(); - NormalisedResult { - item: ObjectWithFilePaths2::from_db(&mut nodes, item), - nodes, - } - })) + .map(ObjectWithFilePaths2::from_db)) }) }) .procedure("getMediaData", { @@ -142,17 +122,23 @@ pub(crate) fn mount() -> AlphaRouter { .db .object() .find_unique(object::id::equals(args)) - .select(object::select!({ id kind media_data })) + .include(object_with_media_data::include()) .exec() .await? .and_then(|obj| { Some(match obj.kind { - Some(v) if v == ObjectKind::Image as i32 => { - MediaMetadata::Image(Box::new( - media_data_image_from_prisma_data(obj.media_data?).ok()?, + Some(v) if v == ObjectKind::Image as i32 => MediaData::Exif( + exif_media_data::from_prisma_data(obj.exif_data?), + ), + Some(v) + if v == ObjectKind::Audio as i32 + || v == ObjectKind::Video as i32 => + { + MediaData::FFmpeg(ffmpeg_media_data::from_prisma_data( + obj.ffmpeg_data?, )) } - _ => return None, // TODO(brxken128): audio and video + _ => return None, // No media data }) }) .ok_or_else(|| { @@ -491,8 +477,8 @@ pub(crate) fn mount() -> AlphaRouter { Ok(()) => Ok(()), Err(e) if e.kind() == io::ErrorKind::NotFound => { warn!( - "File not found in the file system, will remove from database: {}", - full_path.display() + path = %full_path.display(), + "File not found in the file system, will remove from database;", ); library .db @@ -510,7 +496,7 @@ pub(crate) fn mount() -> AlphaRouter { } } } - _ => Job::new(args) + _ => OldJob::new(args) .spawn(&node, &library) .await .map_err(Into::into), @@ -561,11 +547,21 @@ pub(crate) fn mount() -> AlphaRouter { ); #[cfg(not(any(target_os = "ios", target_os = "android")))] - trash::delete(&full_path).unwrap(); + trash::delete(&full_path).map_err(|e| { + FileIOError::from(( + full_path, + match e { + #[cfg(all(unix, not(target_os = "macos")))] + trash::Error::FileSystem { path: _, source: e } => e, + _ => io::Error::other(e), + }, + "Failed to delete file", + )) + })?; Ok(()) } - _ => Job::new(args) + _ => OldJob::new(args) .spawn(&node, &library) .await .map_err(Into::into), @@ -647,10 +643,11 @@ pub(crate) fn mount() -> AlphaRouter { }) .await .map_err(|e| { - error!("{e:#?}"); - rspc::Error::new( + error!(?e, "Failed to convert image;"); + rspc::Error::with_cause( ErrorCode::InternalServerError, "Had an internal problem converting image".to_string(), + e, ) })??; @@ -711,7 +708,7 @@ pub(crate) fn mount() -> AlphaRouter { .procedure("eraseFiles", { R.with2(library()) .mutation(|(node, library), args: OldFileEraserJobInit| async move { - Job::new(args) + OldJob::new(args) .spawn(&node, &library) .await .map_err(Into::into) @@ -720,7 +717,7 @@ pub(crate) fn mount() -> AlphaRouter { .procedure("copyFiles", { R.with2(library()) .mutation(|(node, library), args: OldFileCopierJobInit| async move { - Job::new(args) + OldJob::new(args) .spawn(&node, &library) .await .map_err(Into::into) @@ -729,7 +726,7 @@ pub(crate) fn mount() -> AlphaRouter { .procedure("cutFiles", { R.with2(library()) .mutation(|(node, library), args: OldFileCutterJobInit| async move { - Job::new(args) + OldJob::new(args) .spawn(&node, &library) .await .map_err(Into::into) @@ -883,10 +880,11 @@ pub(crate) fn mount() -> AlphaRouter { } else { fs::rename(&from, &to).await.map_err(|e| { error!( - "Failed to rename file from: '{}' to: '{}'; Error: {e:#?}", - from.display(), - to.display() - ); + from = %from.display(), + to = %to.display(), + ?e, + "Failed to rename file;", + ); rspc::Error::with_cause( ErrorCode::Conflict, "Failed to rename file".to_string(), diff --git a/core/src/api/jobs.rs b/core/src/api/jobs.rs index 8144b4c12..12a95b6ae 100644 --- a/core/src/api/jobs.rs +++ b/core/src/api/jobs.rs @@ -1,21 +1,22 @@ use crate::{ + context::NodeContext, invalidate_query, location::{find_location, LocationError}, - object::{ - media::OldMediaProcessorJobInit, - old_file_identifier::old_file_identifier_job::OldFileIdentifierJobInit, - validation::old_validator_job::OldObjectValidatorJobInit, - }, - old_job::{Job, JobReport, JobStatus, OldJobs}, + object::validation::old_validator_job::OldObjectValidatorJobInit, + old_job::{JobStatus, OldJob, OldJobReport}, }; -use sd_core_prisma_helpers::job_without_data; +use sd_core_heavy_lifting::{ + file_identifier::FileIdentifier, job_system::report, media_processor::job::MediaProcessor, + JobId, JobSystemError, Report, +}; use sd_prisma::prisma::{job, location, SortOrder}; use std::{ collections::{hash_map::Entry, BTreeMap, HashMap, VecDeque}, path::PathBuf, + sync::Arc, time::Instant, }; @@ -30,6 +31,8 @@ use uuid::Uuid; use super::{utils::library, CoreEvent, Ctx, R}; +const TEN_MINUTES: Duration = Duration::from_secs(60 * 10); + pub(crate) fn mount() -> AlphaRouter { R.router() .procedure("progress", { @@ -41,7 +44,7 @@ pub(crate) fn mount() -> AlphaRouter { .subscription(|(node, _), _: ()| async move { let mut event_bus_rx = node.event_bus.0.subscribe(); // debounce per-job - let mut intervals = BTreeMap::::new(); + let mut intervals = BTreeMap::::new(); async_stream::stream! { loop { @@ -62,6 +65,9 @@ pub(crate) fn mount() -> AlphaRouter { yield progress_event; *instant = Instant::now(); + + // remove stale jobs that didn't receive a progress for more than 10 minutes + intervals.retain(|_, instant| instant.elapsed() < TEN_MINUTES); } } }) @@ -73,44 +79,53 @@ pub(crate) fn mount() -> AlphaRouter { // this is to ensure the client will always get the correct initial state // - jobs are sorted in to groups by their action // - TODO: refactor grouping system to a many-to-many table - #[derive(Debug, Clone, Serialize, Deserialize, Type)] + #[derive(Debug, Clone, Serialize, Type)] pub struct JobGroup { - id: Uuid, + id: JobId, + running_job_id: Option, action: Option, - status: JobStatus, + status: report::Status, created_at: DateTime, - jobs: VecDeque, + jobs: VecDeque, } R.with2(library()) .query(|(node, library), _: ()| async move { let mut groups: HashMap = HashMap::new(); - let job_reports: Vec = library + let job_reports: Vec = library .db .job() .find_many(vec![]) .order_by(job::date_created::order(SortOrder::Desc)) .take(100) - .select(job_without_data::select()) .exec() .await? .into_iter() - .flat_map(JobReport::try_from) + .flat_map(|job| { + if let Ok(report) = Report::try_from(job.clone()) { + Some(report) + } else { + // TODO(fogodev): this is a temporary fix for the old job system + OldJobReport::try_from(job).map(Into::into).ok() + } + }) .collect(); - let active_reports_by_id = node.old_jobs.get_active_reports_with_id().await; + let mut active_reports_by_id = node.job_system.get_active_reports().await; + active_reports_by_id.extend( + node.old_jobs + .get_active_reports_with_id() + .await + .into_iter() + .map(|(id, old_report)| (id, old_report.into())), + ); for job in job_reports { // action name and group key are computed from the job data - let (action_name, group_key) = job.get_meta(); + let (action_name, group_key) = job.get_action_name_and_group_key(); - trace!( - "job {:#?}, action_name {}, group_key {:?}", - job, - action_name, - group_key - ); + trace!(?job, %action_name, ?group_key); // if the job is running, use the in-memory report let report = active_reports_by_id.get(&job.id).unwrap_or(&job); @@ -122,7 +137,10 @@ pub(crate) fn mount() -> AlphaRouter { Entry::Vacant(entry) => { entry.insert(JobGroup { id: job.parent_id.unwrap_or(job.id), - action: Some(action_name.clone()), + running_job_id: (job.status == report::Status::Running + || job.status == report::Status::Paused) + .then_some(job.id), + action: Some(action_name), status: job.status, jobs: [report.clone()].into_iter().collect(), created_at: job.created_at.unwrap_or(Utc::now()), @@ -132,8 +150,10 @@ pub(crate) fn mount() -> AlphaRouter { Entry::Occupied(mut entry) => { let group = entry.get_mut(); - // protect paused status from being overwritten - if report.status != JobStatus::Paused { + if report.status == report::Status::Running + || report.status == report::Status::Paused + { + group.running_job_id = Some(report.id); group.status = report.status; } @@ -146,6 +166,7 @@ pub(crate) fn mount() -> AlphaRouter { job.id.to_string(), JobGroup { id: job.id, + running_job_id: Some(job.id), action: None, status: job.status, jobs: [report.clone()].into_iter().collect(), @@ -164,7 +185,14 @@ pub(crate) fn mount() -> AlphaRouter { .procedure("isActive", { R.with2(library()) .query(|(node, library), _: ()| async move { - Ok(node.old_jobs.has_active_workers(library.id).await) + let library_id = library.id; + Ok(node + .job_system + .has_active_jobs(NodeContext { + node: Arc::clone(&node), + library, + }) + .await || node.old_jobs.has_active_workers(library_id).await) }) }) .procedure("clear", { @@ -204,30 +232,56 @@ pub(crate) fn mount() -> AlphaRouter { // pause job .procedure("pause", { R.with2(library()) - .mutation(|(node, library), id: Uuid| async move { - let ret = OldJobs::pause(&node.old_jobs, id).await.map_err(Into::into); + .mutation(|(node, library), job_id: JobId| async move { + if let Err(e) = node.job_system.pause(job_id).await { + if matches!(e, JobSystemError::NotFound(_)) { + // If the job is not found, it can be a job from the old job system + node.old_jobs.pause(job_id).await?; + } else { + return Err(e.into()); + } + } + + invalidate_query!(library, "jobs.isActive"); invalidate_query!(library, "jobs.reports"); - ret + + Ok(()) }) }) .procedure("resume", { R.with2(library()) - .mutation(|(node, library), id: Uuid| async move { - let ret = OldJobs::resume(&node.old_jobs, id) - .await - .map_err(Into::into); + .mutation(|(node, library), job_id: JobId| async move { + if let Err(e) = node.job_system.resume(job_id).await { + if matches!(e, JobSystemError::NotFound(_)) { + // If the job is not found, it can be a job from the old job system + node.old_jobs.resume(job_id).await?; + } else { + return Err(e.into()); + } + } + + invalidate_query!(library, "jobs.isActive"); invalidate_query!(library, "jobs.reports"); - ret + + Ok(()) }) }) .procedure("cancel", { R.with2(library()) - .mutation(|(node, library), id: Uuid| async move { - let ret = OldJobs::cancel(&node.old_jobs, id) - .await - .map_err(Into::into); + .mutation(|(node, library), job_id: JobId| async move { + if let Err(e) = node.job_system.cancel(job_id).await { + if matches!(e, JobSystemError::NotFound(_)) { + // If the job is not found, it can be a job from the old job system + node.old_jobs.cancel(job_id).await?; + } else { + return Err(e.into()); + } + } + + invalidate_query!(library, "jobs.isActive"); invalidate_query!(library, "jobs.reports"); - ret + + Ok(()) }) }) .procedure("generateThumbsForLocation", { @@ -250,50 +304,50 @@ pub(crate) fn mount() -> AlphaRouter { return Err(LocationError::IdNotFound(id).into()); }; - Job::new(OldMediaProcessorJobInit { - location, - sub_path: Some(path), - regenerate_thumbnails: regenerate, - regenerate_labels: false, - }) - .spawn(&node, &library) - .await - .map_err(Into::into) - }, - ) - }) - .procedure("generateLabelsForLocation", { - #[derive(Type, Deserialize)] - pub struct GenerateLabelsForLocationArgs { - pub id: location::id::Type, - pub path: PathBuf, - #[serde(default)] - pub regenerate: bool, - } - - R.with2(library()).mutation( - |(node, library), - GenerateLabelsForLocationArgs { - id, - path, - regenerate, - }: GenerateLabelsForLocationArgs| async move { - let Some(location) = find_location(&library, id).exec().await? else { - return Err(LocationError::IdNotFound(id).into()); - }; - - Job::new(OldMediaProcessorJobInit { - location, - sub_path: Some(path), - regenerate_thumbnails: false, - regenerate_labels: regenerate, - }) - .spawn(&node, &library) - .await - .map_err(Into::into) + node.job_system + .dispatch( + MediaProcessor::new(location, Some(path), regenerate)?, + id, + NodeContext { + node: Arc::clone(&node), + library, + }, + ) + .await + .map_err(Into::into) }, ) }) + // .procedure("generateLabelsForLocation", { + // #[derive(Type, Deserialize)] + // pub struct GenerateLabelsForLocationArgs { + // pub id: location::id::Type, + // pub path: PathBuf, + // #[serde(default)] + // pub regenerate: bool, + // } + // R.with2(library()).mutation( + // |(node, library), + // GenerateLabelsForLocationArgs { + // id, + // path, + // regenerate, + // }: GenerateLabelsForLocationArgs| async move { + // let Some(location) = find_location(&library, id).exec().await? else { + // return Err(LocationError::IdNotFound(id).into()); + // }; + // OldJob::new(OldMediaProcessorJobInit { + // location, + // sub_path: Some(path), + // regenerate_thumbnails: false, + // regenerate_labels: regenerate, + // }) + // .spawn(&node, &library) + // .await + // .map_err(Into::into) + // }, + // ) + // }) .procedure("objectValidator", { #[derive(Type, Deserialize)] pub struct ObjectValidatorArgs { @@ -307,7 +361,7 @@ pub(crate) fn mount() -> AlphaRouter { return Err(LocationError::IdNotFound(args.id).into()); }; - Job::new(OldObjectValidatorJobInit { + OldJob::new(OldObjectValidatorJobInit { location, sub_path: Some(args.path), }) @@ -324,18 +378,22 @@ pub(crate) fn mount() -> AlphaRouter { } R.with2(library()).mutation( - |(node, library), args: IdentifyUniqueFilesArgs| async move { - let Some(location) = find_location(&library, args.id).exec().await? else { - return Err(LocationError::IdNotFound(args.id).into()); + |(node, library), IdentifyUniqueFilesArgs { id, path }: IdentifyUniqueFilesArgs| async move { + let Some(location) = find_location(&library, id).exec().await? else { + return Err(LocationError::IdNotFound(id).into()); }; - Job::new(OldFileIdentifierJobInit { - location, - sub_path: Some(args.path), - }) - .spawn(&node, &library) - .await - .map_err(Into::into) + node.job_system + .dispatch( + FileIdentifier::new(location, Some(path))?, + id, + NodeContext { + node: Arc::clone(&node), + library, + }, + ) + .await + .map_err(Into::into) }, ) }) @@ -343,7 +401,6 @@ pub(crate) fn mount() -> AlphaRouter { R.with2(library()) .subscription(|(node, _), _: ()| async move { // TODO: Only return event for the library that was subscribed to - let mut event_bus_rx = node.event_bus.0.subscribe(); async_stream::stream! { while let Ok(event) = event_bus_rx.recv().await { @@ -355,4 +412,19 @@ pub(crate) fn mount() -> AlphaRouter { } }) }) + .procedure("newFilePathIdentified", { + R.with2(library()) + .subscription(|(node, _), _: ()| async move { + // TODO: Only return event for the library that was subscribed to + let mut event_bus_rx = node.event_bus.0.subscribe(); + async_stream::stream! { + while let Ok(event) = event_bus_rx.recv().await { + match event { + CoreEvent::NewIdentifiedObjects { file_path_ids } => yield file_path_ids, + _ => {} + } + } + } + }) + }) } diff --git a/core/src/api/labels.rs b/core/src/api/labels.rs index 0e5249c59..9aaaf30e3 100644 --- a/core/src/api/labels.rs +++ b/core/src/api/labels.rs @@ -1,8 +1,7 @@ -use crate::{ - invalidate_query, library::Library, object::media::old_thumbnail::get_indexed_thumb_key, -}; +use crate::{invalidate_query, library::Library}; -use sd_core_prisma_helpers::label_with_objects; +use sd_core_heavy_lifting::media_processor::ThumbKey; +use sd_core_prisma_helpers::{label_with_objects, CasId}; use sd_prisma::{ prisma::{label, label_on_object, object, SortOrder}, @@ -49,7 +48,9 @@ pub(crate) fn mount() -> AlphaRouter { file_path_data .cas_id .as_ref() - .map(|cas_id| get_indexed_thumb_key(cas_id, library.id)) + .map(CasId::from) + .map(CasId::into_owned) + .map(|cas_id| ThumbKey::new_indexed(cas_id, library.id)) }) // Filter out None values and transform each element to Vec> .collect::>(), // Collect into Vec>> }) diff --git a/core/src/api/libraries.rs b/core/src/api/libraries.rs index 0905964d9..26bf2506f 100644 --- a/core/src/api/libraries.rs +++ b/core/src/api/libraries.rs @@ -6,17 +6,15 @@ use crate::{ Node, }; -use futures::StreamExt; -use prisma_client_rust::raw; -use sd_cache::{Model, Normalise, NormalisedResult, NormalisedResults}; +use sd_core_heavy_lifting::JobId; + use sd_file_ext::kind::ObjectKind; use sd_p2p::RemoteIdentity; -use sd_prisma::prisma::{indexer_rule, object, statistics}; -use tokio_stream::wrappers::IntervalStream; -use tracing::{info, warn}; +use sd_prisma::prisma::{file_path, indexer_rule, object, statistics}; +use sd_utils::{db::size_in_bytes_from_db, u64_to_frontend}; use std::{ - collections::{hash_map::Entry, HashMap}, + collections::{hash_map::Entry, BTreeMap, HashMap}, convert::identity, pin::pin, sync::Arc, @@ -25,8 +23,13 @@ use std::{ use async_channel as chan; use directories::UserDirs; -use futures_concurrency::{future::Join, stream::Merge}; +use futures::StreamExt; +use futures_concurrency::{ + future::{Join, TryJoin}, + stream::Merge, +}; use once_cell::sync::Lazy; +use prisma_client_rust::{and, or, raw}; use rspc::{alpha::AlphaRouter, ErrorCode}; use serde::{Deserialize, Serialize}; use specta::Type; @@ -36,7 +39,8 @@ use tokio::{ sync::Mutex, time::{interval, Instant}, }; -use tracing::{debug, error}; +use tokio_stream::wrappers::IntervalStream; +use tracing::{debug, error, info, warn}; use uuid::Uuid; use super::{utils::library, Ctx, R}; @@ -57,12 +61,6 @@ pub struct LibraryConfigWrapped { pub config: LibraryConfig, } -impl Model for LibraryConfigWrapped { - fn name() -> &'static str { - "LibraryConfigWrapped" - } -} - impl LibraryConfigWrapped { pub async fn from_library(library: &Library) -> Self { Self { @@ -78,7 +76,7 @@ pub(crate) fn mount() -> AlphaRouter { R.router() .procedure("list", { R.query(|node, _: ()| async move { - let libraries = node + Ok(node .libraries .get_all() .await @@ -93,11 +91,7 @@ pub(crate) fn mount() -> AlphaRouter { }) .collect::>() .join() - .await; - - let (nodes, items) = libraries.normalise(|i| i.uuid.to_string()); - - Ok(NormalisedResults { nodes, items }) + .await) }) }) .procedure("statistics", { @@ -117,7 +111,7 @@ pub(crate) fn mount() -> AlphaRouter { match STATISTICS_UPDATERS.lock().await.entry(library.id) { Entry::Occupied(entry) => { if entry.get().send(Instant::now()).await.is_err() { - error!("Failed to send statistics update request"); + error!("Failed to send statistics update request;"); } } Entry::Vacant(entry) => { @@ -132,36 +126,125 @@ pub(crate) fn mount() -> AlphaRouter { }) }) .procedure("kindStatistics", { - #[derive(Serialize, Deserialize, Type, Default)] + #[derive(Debug, Serialize, Deserialize, Type, Default)] pub struct KindStatistic { kind: i32, name: String, - count: i32, - total_bytes: String, + count: (u32, u32), + total_bytes: (u32, u32), } - #[derive(Serialize, Deserialize, Type, Default)] + #[derive(Debug, Serialize, Deserialize, Type, Default)] pub struct KindStatistics { statistics: Vec, + total_identified_files: i32, + total_unidentified_files: i32, } + + #[derive(Default)] + struct CountAndSize { + count: u64, + size: u64, + } + R.with2(library()).query(|(_, library), _: ()| async move { - let mut statistics: Vec = vec![]; - for kind in ObjectKind::iter() { - let count = library + let (total_unidentified_files, total_identified_files) = ( + library + .db + .file_path() + .count(vec![ + file_path::is_dir::equals(Some(false)), + file_path::cas_id::equals(None), + file_path::object_id::equals(None), + ]) + .exec(), + library + .db + .file_path() + .count(vec![or!( + file_path::is_dir::equals(Some(true)), + and!( + file_path::cas_id::not(None), + file_path::object_id::not(None), + ), + )]) + .exec(), + ) + .try_join() + .await?; + + let mut statistics_by_kind = BTreeMap::from_iter( + ObjectKind::iter().map(|kind| (kind as i32, CountAndSize::default())), + ); + + let mut last_object_id = 0; + + loop { + let objects = library .db .object() - .count(vec![object::kind::equals(Some(kind as i32))]) + .find_many(vec![object::id::gt(last_object_id)]) + .take(1000) + .select( + object::select!({ id kind file_paths: select { size_in_bytes_bytes } }), + ) .exec() .await?; - statistics.push(KindStatistic { - kind: kind as i32, - name: kind.to_string(), - count: count as i32, - total_bytes: "0".to_string(), - }); + if let Some(last) = objects.last() { + last_object_id = last.id; + } else { + break; // No more objects + } + + for object in objects { + if let Some(kind) = object.kind { + statistics_by_kind.entry(kind).and_modify(|count_and_size| { + count_and_size.count += object.file_paths.len() as u64; + count_and_size.size += object + .file_paths + .into_iter() + .map(|file_path| { + file_path + .size_in_bytes_bytes + .map(|size| size_in_bytes_from_db(&size)) + .unwrap_or(0) + }) + .sum::(); + }); + } + } } - Ok(KindStatistics { statistics }) + // This is a workaround for the fact that we don't assign object to directories yet + if let Some(count_and_size) = + statistics_by_kind.get_mut(&(ObjectKind::Folder as i32)) + { + count_and_size.count = library + .db + .file_path() + .count(vec![file_path::is_dir::equals(Some(true))]) + .exec() + .await? as u64; + } + + Ok(KindStatistics { + statistics: ObjectKind::iter() + .map(|kind| { + let int_kind = kind as i32; + let CountAndSize { count, size } = + statistics_by_kind.get(&int_kind).expect("can't fail"); + + KindStatistic { + kind: int_kind, + name: kind.to_string(), + count: u64_to_frontend(*count), + total_bytes: u64_to_frontend(*size), + } + }) + .collect(), + total_identified_files: total_identified_files as i32, + total_unidentified_files: total_unidentified_files as i32, + }) }) }) .procedure("create", { @@ -192,13 +275,13 @@ pub(crate) fn mount() -> AlphaRouter { }: DefaultLocations, node: Arc, library: Arc, - ) -> Result<(), rspc::Error> { + ) -> Result, rspc::Error> { // If all of them are false, we skip if [!desktop, !documents, !downloads, !pictures, !music, !videos] .into_iter() .all(identity) { - return Ok(()); + return Ok(None); } let Some(default_locations_paths) = UserDirs::new() else { @@ -253,7 +336,7 @@ pub(crate) fn mount() -> AlphaRouter { .await .map_err(rspc::Error::from)? else { - return Ok(()); + return Ok(None); }; let scan_state = ScanState::try_from(location.scan_state)?; @@ -282,7 +365,7 @@ pub(crate) fn mount() -> AlphaRouter { }) .fold(&mut maybe_error, |maybe_error, res| { if let Err(e) = res { - error!("Failed to create default location: {e:#?}"); + error!(?e, "Failed to create default location;"); *maybe_error = Some(e); } maybe_error @@ -294,7 +377,7 @@ pub(crate) fn mount() -> AlphaRouter { debug!("Created default locations"); - Ok(()) + Ok(None) } R.mutation( @@ -307,7 +390,7 @@ pub(crate) fn mount() -> AlphaRouter { let library = node.libraries.create(name, None, &node).await?; - debug!("Created library {}", library.id); + debug!(%library.id, "Created library;"); if let Some(locations) = default_locations { create_default_locations_on_library_creation( @@ -318,10 +401,7 @@ pub(crate) fn mount() -> AlphaRouter { .await?; } - Ok(NormalisedResult::from( - LibraryConfigWrapped::from_library(&library).await, - |l| l.uuid.to_string(), - )) + Ok(LibraryConfigWrapped::from_library(&library).await) }, ) }) @@ -395,16 +475,19 @@ pub(crate) fn mount() -> AlphaRouter { for _ in 0..5 { match library.db._execute_raw(raw!("VACUUM;")).exec().await { Ok(_) => break, - Err(err) => { + Err(e) => { warn!( - "Failed to vacuum DB for library '{}', retrying...: {err:#?}", - library.id + %library.id, + ?e, + "Failed to vacuum DB for library, retrying...;", ); tokio::time::sleep(Duration::from_millis(500)).await; } } } - info!("Successfully vacuumed DB for library '{}'", library.id); + + info!(%library.id, "Successfully vacuumed DB;"); + Ok(()) }), ) @@ -435,7 +518,7 @@ async fn update_statistics_loop( Message::Tick => { if last_received_at.elapsed() < FIVE_MINUTES { if let Err(e) = update_library_statistics(&node, &library).await { - error!("Failed to update library statistics: {e:#?}"); + error!(?e, "Failed to update library statistics;"); } else { invalidate_query!(&library, "library.statistics"); } diff --git a/core/src/api/locations.rs b/core/src/api/locations.rs index cdd30762d..a5d11fa3a 100644 --- a/core/src/api/locations.rs +++ b/core/src/api/locations.rs @@ -1,23 +1,20 @@ use crate::{ invalidate_query, location::{ - delete_location, find_location, indexer::OldIndexerJobInit, light_scan_location, + delete_location, find_location, light_scan_location, non_indexed::NonIndexedPathItem, relink_location, scan_location, scan_location_sub_path, LocationCreateArgs, LocationError, LocationUpdateArgs, ScanState, }, - object::old_file_identifier::old_file_identifier_job::OldFileIdentifierJobInit, - old_job::StatefulJob, p2p::PeerMetadata, util::AbortOnDrop, }; +use sd_core_heavy_lifting::{media_processor::ThumbKey, JobName}; use sd_core_indexer_rules::IndexerRuleCreateArgs; use sd_core_prisma_helpers::{ - file_path_with_object, label_with_objects, location_with_indexer_rules, object_with_file_paths, + file_path_for_frontend, label_with_objects, location_with_indexer_rules, object_with_file_paths, }; -use sd_cache::{CacheNode, Model, Normalise, NormalisedResult, NormalisedResults, Reference}; -use sd_indexer::NonIndexedPathItem; use sd_prisma::prisma::{file_path, indexer_rule, indexer_rules_in_location, location, SortOrder}; use std::path::{Path, PathBuf}; @@ -31,45 +28,39 @@ use tracing::{debug, error}; use super::{utils::library, Ctx, R}; -// it includes the shard hex formatted as ([["f02", "cab34a76fbf3469f"]]) -// Will be None if no thumbnail exists -pub type ThumbnailKey = Vec; - #[derive(Serialize, Type, Debug)] #[serde(tag = "type")] pub enum ExplorerItem { Path { - thumbnail: Option, - item: file_path_with_object::Data, + // provide the frontend with the thumbnail key explicitly + thumbnail: Option, + // this tells the frontend if a thumbnail actually exists or not + has_created_thumbnail: bool, + // we can't actually modify data from PCR types, thats why computed properties are used on ExplorerItem + item: Box, }, Object { - thumbnail: Option, + thumbnail: Option, + has_created_thumbnail: bool, item: object_with_file_paths::Data, }, + NonIndexedPath { + thumbnail: Option, + has_created_thumbnail: bool, + item: NonIndexedPathItem, + }, Location { item: location::Data, }, - NonIndexedPath { - thumbnail: Option, - item: NonIndexedPathItem, - }, SpacedropPeer { item: PeerMetadata, }, Label { - thumbnails: Vec, + thumbnails: Vec, item: label_with_objects::Data, }, } -// TODO: Really this shouldn't be a `Model` but it's easy for now. -// In the future we should store the inner data of the variant on behalf of it's existing model so it works cross queries. -impl Model for ExplorerItem { - fn name() -> &'static str { - "ExplorerItem" - } -} - impl ExplorerItem { pub fn id(&self) -> String { let ty = match self { @@ -117,11 +108,8 @@ impl From for SystemLocations { impl ExplorerItem { pub fn name(&self) -> &str { match self { - ExplorerItem::Path { - item: file_path_with_object::Data { name, .. }, - .. - } - | ExplorerItem::Location { + ExplorerItem::Path { item, .. } => item.name.as_deref().unwrap_or(""), + ExplorerItem::Location { item: location::Data { name, .. }, .. } => name.as_deref().unwrap_or(""), @@ -132,13 +120,8 @@ impl ExplorerItem { pub fn size_in_bytes(&self) -> u64 { match self { - ExplorerItem::Path { - item: file_path_with_object::Data { - size_in_bytes_bytes, - .. - }, - .. - } => size_in_bytes_bytes + ExplorerItem::Path { item, .. } => item + .size_in_bytes_bytes .as_ref() .map(|size| { u64::from_be_bytes([ @@ -169,11 +152,10 @@ impl ExplorerItem { pub fn date_created(&self) -> DateTime { match self { - ExplorerItem::Path { - item: file_path_with_object::Data { date_created, .. }, - .. + ExplorerItem::Path { item, .. } => { + item.date_created.map(Into::into).unwrap_or_default() } - | ExplorerItem::Object { + ExplorerItem::Object { item: object_with_file_paths::Data { date_created, .. }, .. } @@ -202,17 +184,13 @@ pub(crate) fn mount() -> AlphaRouter { R.router() .procedure("list", { R.with2(library()).query(|(_, library), _: ()| async move { - let locations = library + Ok(library .db .location() .find_many(vec![]) .order_by(location::date_created::order(SortOrder::Desc)) .exec() - .await?; - - let (nodes, items) = locations.normalise(|i| i.id.to_string()); - - Ok(NormalisedResults { items, nodes }) + .await?) }) }) .procedure("get", { @@ -223,8 +201,7 @@ pub(crate) fn mount() -> AlphaRouter { .location() .find_unique(location::id::equals(location_id)) .exec() - .await? - .map(|i| NormalisedResult::from(i, |i| i.id.to_string()))) + .await?) }) }) .procedure("getWithRules", { @@ -243,21 +220,12 @@ pub(crate) fn mount() -> AlphaRouter { pub hidden: Option, pub date_created: Option>, pub instance_id: Option, - pub indexer_rules: Vec>, - } - - impl Model for LocationWithIndexerRule { - fn name() -> &'static str { - "Location" // This is a duplicate identifier as `location::Data` but it's fine because because they are the same entity - } + pub indexer_rules: Vec, } impl LocationWithIndexerRule { - pub fn from_db( - nodes: &mut Vec, - value: location_with_indexer_rules::Data, - ) -> Reference { - let this = Self { + pub fn from_db(value: location_with_indexer_rules::Data) -> Self { + Self { id: value.id, pub_id: value.pub_id, name: value.name, @@ -274,18 +242,9 @@ pub(crate) fn mount() -> AlphaRouter { indexer_rules: value .indexer_rules .into_iter() - .map(|i| { - let id = i.indexer_rule.id.to_string(); - - nodes.push(CacheNode::new(id.clone(), i.indexer_rule)); - Reference::new(id) - }) - .collect(), - }; - - let id = this.id.to_string(); - nodes.push(CacheNode::new(id.clone(), this)); - Reference::new(id) + .map(|i| i.indexer_rule) + .collect::>(), + } } } @@ -298,13 +257,7 @@ pub(crate) fn mount() -> AlphaRouter { .include(location_with_indexer_rules::include()) .exec() .await? - .map(|location| { - let mut nodes = Vec::new(); - NormalisedResult { - item: LocationWithIndexerRule::from_db(&mut nodes, location), - nodes, - } - })) + .map(LocationWithIndexerRule::from_db)) }) }) .procedure("create", { @@ -389,7 +342,7 @@ pub(crate) fn mount() -> AlphaRouter { .exec() .await?; - debug!("Disconnected {count} file paths from objects"); + debug!(%count, "Disconnected file paths from objects;"); // library.orphan_remover.invoke().await; } @@ -451,13 +404,15 @@ pub(crate) fn mount() -> AlphaRouter { sub_path, }: LightScanArgs| async move { if node - .old_jobs - .has_job_running(|job_identity| { - job_identity.target_location == location_id - && (job_identity.name == ::NAME - || job_identity.name - == ::NAME) - }) + .job_system + .check_running_jobs( + vec![ + JobName::Indexer, + JobName::FileIdentifier, + JobName::MediaProcessor, + ], + location_id, + ) .await { return Err(rspc::Error::new( @@ -475,7 +430,7 @@ pub(crate) fn mount() -> AlphaRouter { let handle = tokio::spawn(async move { if let Err(e) = light_scan_location(node, library, location, sub_path).await { - error!("light scan error: {e:#?}"); + error!(?e, "Light scan error;"); } }); @@ -582,34 +537,25 @@ fn mount_indexer_rule_routes() -> AlphaRouter { format!("Indexer rule not found"), ) }) - .map(|i| NormalisedResult::from(i, |i| i.id.to_string())) }) }) .procedure("list", { R.with2(library()).query(|(_, library), _: ()| async move { - let rules = library.db.indexer_rule().find_many(vec![]).exec().await?; - - let (nodes, items) = rules.normalise(|i| i.id.to_string()); - - Ok(NormalisedResults { items, nodes }) + Ok(library.db.indexer_rule().find_many(vec![]).exec().await?) }) }) // list indexer rules for location, returning the indexer rule .procedure("listForLocation", { R.with2(library()) .query(|(_, library), location_id: location::id::Type| async move { - let rules = library + Ok(library .db .indexer_rule() .find_many(vec![indexer_rule::locations::some(vec![ indexer_rules_in_location::location_id::equals(location_id), ])]) .exec() - .await?; - - let (nodes, items) = rules.normalise(|i| i.id.to_string()); - - Ok(NormalisedResults { items, nodes }) + .await?) }) }) } diff --git a/core/src/api/mod.rs b/core/src/api/mod.rs index 70836b6fc..7330cbd2b 100644 --- a/core/src/api/mod.rs +++ b/core/src/api/mod.rs @@ -1,16 +1,17 @@ use crate::{ invalidate_query, node::{ - config::{NodeConfig, NodePreferences, P2PDiscoveryState, Port}, + config::{is_in_docker, NodeConfig, NodeConfigP2P, NodePreferences}, get_hardware_model_name, HardwareModel, }, old_job::JobProgressEvent, - p2p::{into_listener2, Listener2}, Node, }; -use sd_cache::patch_typedef; +use sd_core_heavy_lifting::media_processor::ThumbKey; use sd_p2p::RemoteIdentity; +use sd_prisma::prisma::file_path; + use std::sync::{atomic::Ordering, Arc}; use itertools::Itertools; @@ -53,7 +54,12 @@ pub type Router = rspc::Router; /// Represents an internal core event, these are exposed to client via a rspc subscription. #[derive(Debug, Clone, Serialize, Type)] pub enum CoreEvent { - NewThumbnail { thumb_key: Vec }, + NewThumbnail { + thumb_key: ThumbKey, + }, + NewIdentifiedObjects { + file_path_ids: Vec, + }, JobProgress(JobProgressEvent), InvalidateOperation(InvalidateOperationEvent), } @@ -64,16 +70,12 @@ pub enum CoreEvent { #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Type)] #[serde(rename_all = "camelCase")] pub enum BackendFeature { - FilesOverP2P, CloudSync, } impl BackendFeature { pub fn restore(&self, node: &Node) { match self { - BackendFeature::FilesOverP2P => { - node.files_over_p2p_flag.store(true, Ordering::Relaxed); - } BackendFeature::CloudSync => { node.cloud_sync_flag.store(true, Ordering::Relaxed); } @@ -89,9 +91,7 @@ pub struct SanitisedNodeConfig { /// name is the display name of the current node. This is set by the user and is shown in the UI. // TODO: Length validation so it can fit in DNS record pub name: String, pub identity: RemoteIdentity, - pub p2p_ipv4_port: Port, - pub p2p_ipv6_port: Port, - pub p2p_discovery: P2PDiscoveryState, + pub p2p: NodeConfigP2P, pub features: Vec, pub preferences: NodePreferences, pub image_labeler_version: Option, @@ -103,9 +103,7 @@ impl From for SanitisedNodeConfig { id: value.id, name: value.name, identity: value.identity.to_remote_identity(), - p2p_ipv4_port: value.p2p_ipv4_port, - p2p_ipv6_port: value.p2p_ipv6_port, - p2p_discovery: value.p2p_discovery, + p2p: value.p2p, features: value.features, preferences: value.preferences, image_labeler_version: value.image_labeler_version, @@ -118,8 +116,8 @@ struct NodeState { #[serde(flatten)] config: SanitisedNodeConfig, data_path: String, - listeners: Vec, device_model: Option, + is_in_docker: bool, } pub(crate) fn mount() -> Arc { @@ -154,8 +152,8 @@ pub(crate) fn mount() -> Arc { .to_str() .expect("Found non-UTF-8 path") .to_string(), - listeners: into_listener2(&node.p2p.p2p.listeners()), device_model: Some(device_model), + is_in_docker: is_in_docker(), }) }) }) @@ -178,12 +176,9 @@ pub(crate) fn mount() -> Arc { .await .map(|_| true) } - .map_err(|err| rspc::Error::new(ErrorCode::InternalServerError, err.to_string()))?; + .map_err(|e| rspc::Error::new(ErrorCode::InternalServerError, e.to_string()))?; match feature { - BackendFeature::FilesOverP2P => { - node.files_over_p2p_flag.store(enabled, Ordering::Relaxed); - } BackendFeature::CloudSync => { node.cloud_sync_flag.store(enabled, Ordering::Relaxed); } @@ -217,14 +212,12 @@ pub(crate) fn mount() -> Arc { .merge("backups.", backups::mount()) .merge("invalidation.", utils::mount_invalidate()) .sd_patch_types_dangerously(|type_map| { - patch_typedef(type_map); - let def = ::definition_named_data_type( type_map, ); type_map.insert( - ::SID, + ::sid(), def, ); }); diff --git a/core/src/api/nodes.rs b/core/src/api/nodes.rs index b77c71f4b..996f8a502 100644 --- a/core/src/api/nodes.rs +++ b/core/src/api/nodes.rs @@ -1,3 +1,5 @@ +use std::collections::HashSet; + use crate::{ invalidate_query, node::config::{P2PDiscoveryState, Port}, @@ -19,9 +21,13 @@ pub(crate) fn mount() -> AlphaRouter { #[derive(Deserialize, Type)] pub struct ChangeNodeNameArgs { pub name: Option, - pub p2p_ipv4_port: Option, - pub p2p_ipv6_port: Option, + pub p2p_port: Option, + pub p2p_disabled: Option, + pub p2p_ipv6_disabled: Option, + pub p2p_relay_disabled: Option, pub p2p_discovery: Option, + pub p2p_remote_access: Option, + pub p2p_manual_peers: Option>, pub image_labeler_version: Option, } R.mutation(|node, args: ChangeNodeNameArgs| async move { @@ -43,14 +49,26 @@ pub(crate) fn mount() -> AlphaRouter { config.name = name; } - if let Some(port) = args.p2p_ipv4_port { - config.p2p_ipv4_port = port; + if let Some(port) = args.p2p_port { + config.p2p.port = port; }; - if let Some(port) = args.p2p_ipv6_port { - config.p2p_ipv6_port = port; + if let Some(enabled) = args.p2p_disabled { + config.p2p.disabled = enabled; }; - if let Some(v) = args.p2p_discovery { - config.p2p_discovery = v; + if let Some(enabled) = args.p2p_ipv6_disabled { + config.p2p.disable_ipv6 = enabled; + }; + if let Some(enabled) = args.p2p_relay_disabled { + config.p2p.disable_relay = enabled; + }; + if let Some(discovery) = args.p2p_discovery { + config.p2p.discovery = discovery; + }; + if let Some(remote_access) = args.p2p_remote_access { + config.p2p.enable_remote_access = remote_access; + }; + if let Some(manual_peers) = args.p2p_manual_peers { + config.p2p.manual_peers = manual_peers; }; #[cfg(feature = "ai")] @@ -64,8 +82,9 @@ pub(crate) fn mount() -> AlphaRouter { new_model = sd_ai::old_image_labeler::YoloV8::model(Some(&version)) .map_err(|e| { error!( - "Failed to crate image_detection model: '{}'; Error: {e:#?}", - &version, + %version, + ?e, + "Failed to crate image_detection model;", ); }) .ok(); @@ -76,8 +95,8 @@ pub(crate) fn mount() -> AlphaRouter { } }) .await - .map_err(|err| { - error!("Failed to write config: {}", err); + .map_err(|e| { + error!(?e, "Failed to write config;"); rspc::Error::new( ErrorCode::InternalServerError, "error updating config".into(), @@ -168,21 +187,14 @@ pub(crate) fn mount() -> AlphaRouter { pub background_processing_percentage: u8, // 0-100 } R.mutation( - |node, - UpdateThumbnailerPreferences { - background_processing_percentage, - }: UpdateThumbnailerPreferences| async move { + |node, UpdateThumbnailerPreferences { .. }: UpdateThumbnailerPreferences| async move { node.config - .update_preferences(|preferences| { - preferences - .thumbnailer - .set_background_processing_percentage( - background_processing_percentage, - ); + .update_preferences(|_| { + // TODO(fogodev): introduce configurable workers count to task system }) .await .map_err(|e| { - error!("failed to update thumbnailer preferences: {e:#?}"); + error!(?e, "Failed to update thumbnailer preferences;"); rspc::Error::with_cause( ErrorCode::InternalServerError, "Failed to update thumbnailer preferences".to_string(), diff --git a/core/src/api/notifications.rs b/core/src/api/notifications.rs index 738523dfd..ff8b7b076 100644 --- a/core/src/api/notifications.rs +++ b/core/src/api/notifications.rs @@ -56,12 +56,12 @@ pub(crate) fn mount() -> AlphaRouter { .find_many(vec![]) .exec() .await - .map_err(|err| { + .map_err(|e| { rspc::Error::new( ErrorCode::InternalServerError, format!( "Failed to get notifications for library '{}': {}", - library.id, err + library.id, e ), ) })? @@ -69,12 +69,12 @@ pub(crate) fn mount() -> AlphaRouter { .map(|n| { Ok(Notification { id: NotificationId::Library(library.id, n.id as u32), - data: rmp_serde::from_slice(&n.data).map_err(|err| { + data: rmp_serde::from_slice(&n.data).map_err(|e| { rspc::Error::new( ErrorCode::InternalServerError, format!( "Failed to get notifications for library '{}': {}", - library.id, err + library.id, e ), ) })?, @@ -108,8 +108,8 @@ pub(crate) fn mount() -> AlphaRouter { .delete_many(vec![notification::id::equals(id as i32)]) .exec() .await - .map_err(|err| { - rspc::Error::new(ErrorCode::InternalServerError, err.to_string()) + .map_err(|e| { + rspc::Error::new(ErrorCode::InternalServerError, e.to_string()) })?; } NotificationId::Node(id) => { @@ -119,8 +119,8 @@ pub(crate) fn mount() -> AlphaRouter { .retain(|n| n.id != NotificationId::Node(id)); }) .await - .map_err(|err| { - rspc::Error::new(ErrorCode::InternalServerError, err.to_string()) + .map_err(|e| { + rspc::Error::new(ErrorCode::InternalServerError, e.to_string()) })?; } } @@ -135,9 +135,7 @@ pub(crate) fn mount() -> AlphaRouter { cfg.notifications = vec![]; }) .await - .map_err(|err| { - rspc::Error::new(ErrorCode::InternalServerError, err.to_string()) - })?; + .map_err(|e| rspc::Error::new(ErrorCode::InternalServerError, e.to_string()))?; join_all( node.libraries diff --git a/core/src/api/p2p.rs b/core/src/api/p2p.rs index 90082d9fb..472e0e464 100644 --- a/core/src/api/p2p.rs +++ b/core/src/api/p2p.rs @@ -5,7 +5,7 @@ use sd_p2p::{PeerConnectionCandidate, RemoteIdentity}; use rspc::{alpha::AlphaRouter, ErrorCode}; use serde::Deserialize; use specta::Type; -use std::path::PathBuf; +use std::{path::PathBuf, sync::PoisonError}; use tokio::io::AsyncWriteExt; use uuid::Uuid; @@ -26,21 +26,32 @@ pub(crate) fn mount() -> AlphaRouter { }) { queued.push(P2PEvent::PeerChange { identity: peer.identity(), - connection: if peer.is_connected_with_hook(node.p2p.libraries_hook_id) { - ConnectionMethod::Relay - } else if peer.is_connected() { - ConnectionMethod::Local + connection: if peer.is_connected() { + if node.p2p.quic.is_relayed(peer.identity()) { + ConnectionMethod::Relay + } else { + ConnectionMethod::Local + } } else { ConnectionMethod::Disconnected }, - discovery: match peer + discovery: if peer .connection_candidates() - .contains(&PeerConnectionCandidate::Relay) + .iter() + .any(|c| matches!(c, PeerConnectionCandidate::Manual(_))) { - true => DiscoveryMethod::Relay, - false => DiscoveryMethod::Local, + DiscoveryMethod::Manual + } else if peer + .connection_candidates() + .iter() + .all(|c| *c == PeerConnectionCandidate::Relay) + { + DiscoveryMethod::Relay + } else { + DiscoveryMethod::Local }, metadata, + addrs: peer.addrs(), }); } @@ -58,6 +69,16 @@ pub(crate) fn mount() -> AlphaRouter { .procedure("state", { R.query(|node, _: ()| async move { Ok(node.p2p.state().await) }) }) + .procedure("listeners", { + R.query(|node, _: ()| async move { + Ok(node + .p2p + .listeners + .lock() + .unwrap_or_else(PoisonError::into_inner) + .clone()) + }) + }) .procedure("debugConnect", { R.mutation(|node, identity: RemoteIdentity| async move { let peer = { node.p2p.p2p.peers().get(&identity).cloned() }; @@ -68,20 +89,20 @@ pub(crate) fn mount() -> AlphaRouter { ))? .new_stream() .await - .map_err(|err| { + .map_err(|e| { rspc::Error::new( ErrorCode::InternalServerError, - format!("error in peer.new_stream: {:?}", err), + format!("error in peer.new_stream: {:?}", e), ) })?; stream .write_all(&Header::Ping.to_bytes()) .await - .map_err(|err| { + .map_err(|e| { rspc::Error::new( ErrorCode::InternalServerError, - format!("error sending ping header: {:?}", err), + format!("error sending ping header: {:?}", e), ) })?; @@ -105,8 +126,8 @@ pub(crate) fn mount() -> AlphaRouter { .collect::>(), ) .await - .map_err(|_err| { - rspc::Error::new(ErrorCode::InternalServerError, "todo: error".into()) + .map_err(|spacedrop_err| { + rspc::Error::new(ErrorCode::InternalServerError, spacedrop_err.to_string()) }) }) }) diff --git a/core/src/api/search/media_data.rs b/core/src/api/search/exif_data.rs similarity index 71% rename from core/src/api/search/media_data.rs rename to core/src/api/search/exif_data.rs index 52a84b0d4..61b8f6cd8 100644 --- a/core/src/api/search/media_data.rs +++ b/core/src/api/search/exif_data.rs @@ -1,4 +1,4 @@ -use sd_prisma::prisma::{self, media_data}; +use sd_prisma::prisma::{self, exif_data}; use serde::{Deserialize, Serialize}; use specta::Type; @@ -7,11 +7,11 @@ use super::utils::*; #[derive(Serialize, Deserialize, Type, Debug, Clone)] #[serde(rename_all = "camelCase", tag = "field", content = "value")] -pub enum MediaDataOrder { +pub enum ExifDataOrder { EpochTime(SortOrder), } -impl MediaDataOrder { +impl ExifDataOrder { pub fn get_sort_order(&self) -> prisma::SortOrder { (*match self { Self::EpochTime(v) => v, @@ -19,9 +19,9 @@ impl MediaDataOrder { .into() } - pub fn into_param(self) -> media_data::OrderByWithRelationParam { + pub fn into_param(self) -> exif_data::OrderByWithRelationParam { let dir = self.get_sort_order(); - use media_data::*; + use exif_data::*; match self { Self::EpochTime(_) => epoch_time::order(dir), } diff --git a/core/src/api/search/mod.rs b/core/src/api/search/mod.rs index 56f59fa59..90abc8a1d 100644 --- a/core/src/api/search/mod.rs +++ b/core/src/api/search/mod.rs @@ -1,37 +1,26 @@ -use std::{collections::HashMap, path::PathBuf}; - use crate::{ api::{locations::ExplorerItem, utils::library}, library::Library, - location::LocationError, - object::{ - cas::generate_cas_id, - media::old_thumbnail::{ - get_ephemeral_thumb_key, get_indexed_thumb_key, BatchToProcess, GenerateThumbnailArgs, - }, - }, + location::{non_indexed, LocationError}, util::{unsafe_streamed_query, BatchedStream}, }; -use opendal::{services::Fs, Operator}; +use prisma_client_rust::Operator; +use sd_core_heavy_lifting::media_processor::ThumbKey; +use sd_core_prisma_helpers::{file_path_for_frontend, object_with_file_paths, CasId}; +use sd_prisma::prisma::{self, PrismaClient}; -use sd_cache::{CacheNode, Model, Normalise, Reference}; -use sd_core_indexer_rules::seed::{no_hidden, no_os_protected}; -use sd_core_indexer_rules::IndexerRule; -use sd_core_prisma_helpers::{file_path_with_object, object_with_file_paths}; -use sd_file_ext::kind::ObjectKind; -use sd_prisma::prisma::{self, location, PrismaClient}; -use sd_utils::chain_optional_iter; +use std::path::PathBuf; use async_stream::stream; use futures::StreamExt; +use itertools::Either; use rspc::{alpha::AlphaRouter, ErrorCode}; use serde::{Deserialize, Serialize}; use specta::Type; -use tracing::{error, warn}; +pub mod exif_data; pub mod file_path; -pub mod media_data; pub mod object; pub mod saved; mod utils; @@ -43,16 +32,9 @@ use super::{Ctx, R}; const MAX_TAKE: u8 = 100; #[derive(Serialize, Type, Debug)] -struct SearchData { +struct SearchData { cursor: Option>, - items: Vec>, - nodes: Vec, -} - -impl Model for SearchData { - fn name() -> &'static str { - T::name() - } + items: Vec, } #[derive(Serialize, Deserialize, Type, Debug, Clone)] @@ -63,213 +45,111 @@ pub enum SearchFilterArgs { } impl SearchFilterArgs { - async fn into_params( + async fn into_params( self, db: &PrismaClient, - file_path: fn(Vec) -> Vec, - object: fn(Vec) -> Vec, - ) -> Result, rspc::Error> { - Ok(match self { - Self::FilePath(v) => file_path(v.into_params(db).await?), - Self::Object(v) => object(v.into_params()), - }) - } - - async fn into_file_path_params( - self, - db: &PrismaClient, - ) -> Result, rspc::Error> { - self.into_params(db, |v| v, |v| vec![prisma::file_path::object::is(v)]) - .await - } - - async fn into_object_params( - self, - db: &PrismaClient, - ) -> Result, rspc::Error> { - self.into_params(db, |v| vec![prisma::object::file_paths::some(v)], |v| v) - .await + file_path: &mut Vec, + object: &mut Vec, + ) -> Result<(), rspc::Error> { + match self { + Self::FilePath(v) => file_path.extend(v.into_params(db).await?), + Self::Object(v) => object.extend(v.into_params()), + }; + Ok(()) } } pub fn mount() -> AlphaRouter { R.router() .procedure("ephemeralPaths", { - #[derive(Deserialize, Type, Debug, PartialEq, Eq)] - #[serde(rename_all = "camelCase")] - enum PathFrom { - Path, - // TODO: FTP + S3 + GDrive + #[derive(Serialize, Deserialize, Type, Debug, Clone)] + #[serde(rename_all = "camelCase", tag = "field", content = "value")] + enum EphemeralPathOrder { + Name(SortOrder), + SizeInBytes(SortOrder), + DateCreated(SortOrder), + DateModified(SortOrder), } #[derive(Deserialize, Type, Debug)] #[serde(rename_all = "camelCase")] struct EphemeralPathSearchArgs { - from: PathFrom, - path: String, + path: PathBuf, with_hidden_files: bool, + #[specta(optional)] + order: Option, } - #[derive(Serialize, Type, Debug)] struct EphemeralPathsResultItem { - pub entries: Vec>, - pub errors: Vec, - pub nodes: Vec, + pub entries: Vec, + pub errors: Vec, } R.with2(library()).subscription( |(node, library), EphemeralPathSearchArgs { - from, - mut path, + path, with_hidden_files, + order, }| async move { - let service = match from { - PathFrom::Path => { - let mut fs = Fs::default(); - fs.root("/"); - Operator::new(fs) - .map_err(|err| { - rspc::Error::new( - ErrorCode::InternalServerError, - err.to_string(), - ) - })? - .finish() - } - }; + let paths = + non_indexed::walk(path, with_hidden_files, node, library, |entries| { + macro_rules! order_match { + ($order:ident, [$(($variant:ident, |$i:ident| $func:expr)),+]) => {{ + match $order { + $(EphemeralPathOrder::$variant(order) => { + entries.sort_unstable_by(|path1, path2| { + let func = |$i: &non_indexed::Entry| $func; - let rules = chain_optional_iter( - [IndexerRule::from(no_os_protected())], - [(!with_hidden_files).then(|| IndexerRule::from(no_hidden()))], - ); + let one = func(path1); + let two = func(path2); - // OpenDAL is specific about paths (and the rest of Spacedrive is not) - if !path.ends_with('/') { - path.push('/'); - } + match order { + SortOrder::Desc => two.cmp(&one), + SortOrder::Asc => one.cmp(&two), + } + }); + })+ + } + }}; + } - let stream = - sd_indexer::ephemeral(service, rules, &path) - .await - .map_err(|err| { - rspc::Error::new(ErrorCode::InternalServerError, err.to_string()) - })?; + if let Some(order) = order { + order_match!( + order, + [ + (Name, |p| p.name().to_lowercase()), + (SizeInBytes, |p| p.size_in_bytes()), + (DateCreated, |p| p.date_created()), + (DateModified, |p| p.date_modified()) + ] + ) + } + }) + .await?; - let mut stream = BatchedStream::new(stream); + let mut stream = BatchedStream::new(paths); Ok(unsafe_streamed_query(stream! { - let mut to_generate = vec![]; - while let Some(result) = stream.next().await { // We optimize for the case of no errors because it should be way more common. let mut entries = Vec::with_capacity(result.len()); let mut errors = Vec::with_capacity(0); - // For this batch we check if any directories are actually locations, so the UI can link directly to them - let locations = library - .db - .location() - .find_many(vec![location::path::in_vec( - result.iter().filter_map(|e| match e { - Ok(e) if ObjectKind::from_i32(e.kind) == ObjectKind::Folder => Some(e.path.clone()), - _ => None - }).collect::>() - )]) - .exec() - .await - .and_then(|l| { - Ok(l.into_iter() - .filter_map(|item| item.path.clone().map(|l| (l, item))) - .collect::>()) - }) - .map_err(|err| error!("Looking up locations failed: {err:?}")) - .unwrap_or_default(); - for item in result { match item { - Ok(item) => { - let kind = ObjectKind::from_i32(item.kind); - let should_generate_thumbnail = { - #[cfg(feature = "ffmpeg")] - { - matches!( - kind, - ObjectKind::Image | ObjectKind::Video | ObjectKind::Document - ) - } - - #[cfg(not(feature = "ffmpeg"))] - { - matches!(kind, ObjectKind::Image | ObjectKind::Document) - } - }; - - // TODO: This requires all paths to be loaded before thumbnailing starts. - // TODO: This copies the existing functionality but will not fly with Cloud locations (as loading paths will be *way* slower) - // TODO: https://linear.app/spacedriveapp/issue/ENG-1719/cloud-thumbnailer - let thumbnail = if should_generate_thumbnail { - if from == PathFrom::Path { - let size = u64::from_be_bytes((&*item.size_in_bytes_bytes).try_into().expect("Invalid size")); - if let Ok(cas_id) = generate_cas_id(&item.path, size).await.map_err(|err| error!("Error generating cas id for '{:?}': {err:?}", item.path)) { - if ObjectKind::from_i32(item.kind) == ObjectKind::Document { - to_generate.push(GenerateThumbnailArgs::new( - item.extension.clone(), - cas_id.clone(), - PathBuf::from(&item.path), - )); - } else { - to_generate.push(GenerateThumbnailArgs::new( - item.extension.clone(), - cas_id.clone(), - PathBuf::from(&item.path), - )); - } - - Some(get_ephemeral_thumb_key(&cas_id)) - } else { - None - } - } else { - warn!("Thumbnailer not supported for cloud locations"); - None - } - } else { - None - }; - - entries.push(if let Some(item) = locations.get(&item.path) { - ExplorerItem::Location { - item: item.clone(), - } - } else { - ExplorerItem::NonIndexedPath { - thumbnail, - item, - } - }); + Ok(item) => entries.push(item), + Err(e) => match e { + Either::Left(e) => errors.push(e), + Either::Right(e) => errors.push(e.into()), }, - Err(e) => errors.push(e.to_string()), } } - let (nodes, entries) = entries.normalise(|item: &ExplorerItem| item.id()); - yield EphemeralPathsResultItem { entries, errors, - nodes, }; } - - if to_generate.len() > 0 { - node.thumbnailer - .new_ephemeral_thumbnails_batch(BatchToProcess::new( - to_generate, - false, - false, - )) - .await; - } })) }, ) @@ -303,16 +183,16 @@ pub fn mount() -> AlphaRouter { let Library { db, .. } = library.as_ref(); let params = { - let mut params = Vec::new(); + let (mut fp, obj) = merge_filters(filters, db).await?; - for filter in filters { - params.extend(filter.into_file_path_params(db).await?); + if !obj.is_empty() { + fp.push(prisma::file_path::object::is(obj)); } - params + fp }; - let mut query = db.file_path().find_many(params); + let mut query = db.file_path().find_many(andify(params)); if let Some(take) = take { query = query.take(take as i64); @@ -330,38 +210,38 @@ pub fn mount() -> AlphaRouter { } let file_paths = query - .include(file_path_with_object::include()) + .include(file_path_for_frontend::include()) .exec() .await?; let mut items = Vec::with_capacity(file_paths.len()); for file_path in file_paths { - let thumbnail_exists_locally = if let Some(cas_id) = &file_path.cas_id { - library - .thumbnail_exists(&node, cas_id) - .await - .map_err(LocationError::from)? - } else { - false - }; + let has_created_thumbnail = + if let Some(cas_id) = file_path.cas_id.as_ref().map(CasId::from) { + library + .thumbnail_exists(&node, &cas_id) + .await + .map_err(LocationError::from)? + } else { + false + }; items.push(ExplorerItem::Path { thumbnail: file_path .cas_id .as_ref() - .filter(|_| thumbnail_exists_locally) - .map(|i| get_indexed_thumb_key(i, library.id)), - item: file_path, + .map(CasId::from) + .map(CasId::into_owned) + .map(|cas_id| ThumbKey::new_indexed(cas_id, library.id)), + has_created_thumbnail, + item: Box::new(file_path), }) } - let (nodes, items) = items.normalise(|item| item.id()); - Ok(SearchData { items, cursor: None, - nodes, }) }, ) @@ -382,13 +262,13 @@ pub fn mount() -> AlphaRouter { Ok(db .file_path() .count({ - let mut params = Vec::new(); + let (mut fp, obj) = merge_filters(filters, db).await?; - for filter in filters { - params.extend(filter.into_file_path_params(db).await?); + if !obj.is_empty() { + fp.push(prisma::file_path::object::is(obj)); } - params + fp }) .exec() .await? as u32) @@ -419,13 +299,13 @@ pub fn mount() -> AlphaRouter { let mut query = db .object() .find_many({ - let mut params = Vec::new(); + let (fp, mut obj) = merge_filters(filters, db).await?; - for filter in filters { - params.extend(filter.into_object_params(db).await?); + if !fp.is_empty() { + obj.push(prisma::object::file_paths::some(fp)); } - params + andify(obj) }) .take(take as i64); @@ -454,9 +334,11 @@ pub fn mount() -> AlphaRouter { .file_paths .iter() .map(|fp| fp.cas_id.as_ref()) - .find_map(|c| c); + .find_map(|c| c) + .map(CasId::from) + .map(|cas_id| cas_id.to_owned()); - let thumbnail_exists_locally = if let Some(cas_id) = cas_id { + let has_created_thumbnail = if let Some(cas_id) = &cas_id { library.thumbnail_exists(&node, cas_id).await.map_err(|e| { rspc::Error::with_cause( ErrorCode::InternalServerError, @@ -470,19 +352,13 @@ pub fn mount() -> AlphaRouter { items.push(ExplorerItem::Object { thumbnail: cas_id - .filter(|_| thumbnail_exists_locally) - .map(|cas_id| get_indexed_thumb_key(cas_id, library.id)), + .map(|cas_id| ThumbKey::new_indexed(cas_id, library.id)), item: object, + has_created_thumbnail, }); } - let (nodes, items) = items.normalise(|item| item.id()); - - Ok(SearchData { - nodes, - items, - cursor, - }) + Ok(SearchData { items, cursor }) }, ) }) @@ -502,13 +378,13 @@ pub fn mount() -> AlphaRouter { Ok(db .object() .count({ - let mut params = Vec::new(); + let (fp, mut obj) = merge_filters(filters, db).await?; - for filter in filters { - params.extend(filter.into_object_params(db).await?); + if !fp.is_empty() { + obj.push(prisma::object::file_paths::some(fp)); } - params + obj }) .exec() .await? as u32) @@ -516,3 +392,33 @@ pub fn mount() -> AlphaRouter { }) .merge("saved.", saved::mount()) } + +async fn merge_filters( + filters: Vec, + db: &PrismaClient, +) -> Result< + ( + Vec, + Vec, + ), + rspc::Error, +> { + let mut obj = vec![]; + let mut fp = vec![]; + + for filter in filters { + filter.into_params(db, &mut fp, &mut obj).await?; + } + + Ok((fp, obj)) +} + +/// PCR 0.6.x's AND does { AND: [{ ...}] } instead of { AND: [{ ... }, { ... }, { ... }] }, +/// this works around it. +fn andify>>(params: Vec) -> Vec { + params.into_iter().fold(vec![], |mut params, param| { + params.push(param); + + vec![prisma_client_rust::operator::and(params)] + }) +} diff --git a/core/src/api/search/object.rs b/core/src/api/search/object.rs index 247634e2d..5804b3917 100644 --- a/core/src/api/search/object.rs +++ b/core/src/api/search/object.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use specta::Type; use super::{ - media_data::*, + exif_data::*, utils::{self, *}, }; @@ -61,7 +61,7 @@ impl ObjectCursor { pub enum ObjectOrder { DateAccessed(SortOrder), Kind(SortOrder), - MediaData(Box), + MediaData(Box), } impl ObjectOrder { @@ -81,7 +81,7 @@ impl ObjectOrder { match self { Self::DateAccessed(_) => date_accessed::order(dir), Self::Kind(_) => kind::order(dir), - Self::MediaData(v) => media_data::order(vec![v.into_param()]), + Self::MediaData(v) => exif_data::order(vec![v.into_param()]), } } } diff --git a/core/src/api/search/saved.rs b/core/src/api/search/saved.rs index 266455a64..4836fef82 100644 --- a/core/src/api/search/saved.rs +++ b/core/src/api/search/saved.rs @@ -82,7 +82,7 @@ pub(crate) fn mount() -> AlphaRouter { // https://docs.rs/serde/latest/serde/de/struct.IgnoredAny.html if let Err(e) = serde_json::from_str::(&s) { - error!("failed to parse filters: {e:#?}"); + error!(?e, "Failed to parse filters;"); None } else { Some(s) diff --git a/core/src/api/sync.rs b/core/src/api/sync.rs index b54e3fb8d..44b61d586 100644 --- a/core/src/api/sync.rs +++ b/core/src/api/sync.rs @@ -34,7 +34,7 @@ pub(crate) fn mount() -> AlphaRouter { .await?) }) }) - .procedure("enable", { + .procedure("backfill", { R.with2(library()) .mutation(|(node, library), _: ()| async move { if library diff --git a/core/src/api/tags.rs b/core/src/api/tags.rs index f409996e0..b951368f2 100644 --- a/core/src/api/tags.rs +++ b/core/src/api/tags.rs @@ -1,11 +1,10 @@ use crate::{invalidate_query, library::Library, object::tag::TagCreateArgs}; -use sd_cache::{CacheNode, Normalise, NormalisedResult, NormalisedResults, Reference}; use sd_prisma::{ prisma::{file_path, object, tag, tag_on_object}, prisma_sync, }; -use sd_sync::OperationFactory; +use sd_sync::{option_sync_db_entry, OperationFactory}; use sd_utils::{msgpack, uuid_to_bytes}; use std::collections::BTreeMap; @@ -23,40 +22,26 @@ pub(crate) fn mount() -> AlphaRouter { R.router() .procedure("list", { R.with2(library()).query(|(_, library), _: ()| async move { - let tags = library.db.tag().find_many(vec![]).exec().await?; - - let (nodes, items) = tags.normalise(|i| i.id.to_string()); - - Ok(NormalisedResults { nodes, items }) + Ok(library.db.tag().find_many(vec![]).exec().await?) }) }) .procedure("getForObject", { R.with2(library()) .query(|(_, library), object_id: i32| async move { - let tags = library + Ok(library .db .tag() .find_many(vec![tag::tag_objects::some(vec![ tag_on_object::object_id::equals(object_id), ])]) .exec() - .await?; - - let (nodes, items) = tags.normalise(|i| i.id.to_string()); - - Ok(NormalisedResults { nodes, items }) + .await?) }) }) .procedure("getWithObjects", { - #[derive(Serialize, Type)] - pub struct GetWithObjectsResult { - pub data: BTreeMap>>, - pub nodes: Vec, - } - #[derive(Serialize, Type)] pub struct ObjectWithDateCreated { - object: Reference, + object: object::Data, date_created: DateTime, } @@ -97,13 +82,28 @@ pub(crate) fn mount() -> AlphaRouter { .tag() .find_unique(tag::id::equals(tag_id)) .exec() - .await? - .map(|tag| NormalisedResult::from(tag, |i| i.id.to_string()))) + .await?) }) }) .procedure("create", { R.with2(library()) .mutation(|(_, library), args: TagCreateArgs| async move { + // Check if tag with the same name already exists + let existing_tag = library + .db + .tag() + .find_many(vec![tag::name::equals(Some(args.name.clone()))]) + .select(tag::select!({ id })) + .exec() + .await?; + + if !existing_tag.is_empty() { + return Err(rspc::Error::new( + ErrorCode::Conflict, + "Tag with the same name already exists".to_string(), + )); + } + let created_tag = args.exec(&library).await?; invalidate_query!(library, "tags.list"); @@ -221,7 +221,7 @@ pub(crate) fn mount() -> AlphaRouter { .iter() .filter(|fp| fp.is_dir.unwrap_or_default() && fp.object.is_none()) .map(|fp| { - let id = uuid_to_bytes(Uuid::new_v4()); + let id = uuid_to_bytes(&Uuid::new_v4()); sync_params.extend(sync.shared_create( prisma_sync::object::SyncId { pub_id: id.clone() }, @@ -324,29 +324,30 @@ pub(crate) fn mount() -> AlphaRouter { .exec() .await?; + let (sync_params, db_params): (Vec<_>, Vec<_>) = [ + option_sync_db_entry!(args.name, tag::name), + option_sync_db_entry!(args.color, tag::color), + ] + .into_iter() + .flatten() + .unzip(); + sync.write_ops( db, ( - [ - args.name.as_ref().map(|v| (tag::name::NAME, msgpack!(v))), - args.color.as_ref().map(|v| (tag::color::NAME, msgpack!(v))), - ] - .into_iter() - .flatten() - .map(|(k, v)| { - sync.shared_update( - prisma_sync::tag::SyncId { - pub_id: tag.pub_id.clone(), - }, - k, - v, - ) - }) - .collect(), - db.tag().update( - tag::id::equals(args.id), - vec![tag::name::set(args.name), tag::color::set(args.color)], - ), + sync_params + .into_iter() + .map(|(k, v)| { + sync.shared_update( + prisma_sync::tag::SyncId { + pub_id: tag.pub_id.clone(), + }, + k, + v, + ) + }) + .collect(), + db.tag().update(tag::id::equals(args.id), db_params), ), ) .await?; diff --git a/core/src/api/utils/invalidate.rs b/core/src/api/utils/invalidate.rs index bce8aecaf..8df2eea6d 100644 --- a/core/src/api/utils/invalidate.rs +++ b/core/src/api/utils/invalidate.rs @@ -55,7 +55,6 @@ impl InvalidateOperationEvent { /// a request to invalidate a specific resource #[derive(Debug)] -#[allow(dead_code)] pub(crate) struct InvalidationRequest { pub key: &'static str, pub arg_ty: Option, @@ -65,13 +64,11 @@ pub(crate) struct InvalidationRequest { /// invalidation request for a specific resource #[derive(Debug, Default)] -#[allow(dead_code)] pub(crate) struct InvalidRequests { pub queries: Vec, } impl InvalidRequests { - #[allow(unused)] const fn new() -> Self { Self { queries: Vec::new(), @@ -135,6 +132,19 @@ impl InvalidRequests { #[macro_export] // #[allow(clippy::crate_in_macro_def)] macro_rules! invalidate_query { + + ($ctx:expr, $query:ident) => {{ + let ctx: &$crate::library::Library = &$ctx; // Assert the context is the correct type + let query: &'static str = $query; + + ::tracing::trace!(target: "sd_core::invalidate-query", "invalidate_query!(\"{}\") at {}", query, concat!(file!(), ":", line!())); + + // The error are ignored here because they aren't mission critical. If they fail the UI might be outdated for a bit. + ctx.emit($crate::api::CoreEvent::InvalidateOperation( + $crate::api::utils::InvalidateOperationEvent::dangerously_create(query, serde_json::Value::Null, None) + )) + }}; + ($ctx:expr, $key:literal) => {{ let ctx: &$crate::library::Library = &$ctx; // Assert the context is the correct type @@ -327,8 +337,12 @@ pub(crate) fn mount_invalidate() -> AlphaRouter { ) => { let key = match to_key(&(key, arg)) { Ok(key) => key, - Err(err) => { - warn!("Error deriving key for invalidate operation '{:?}': {:?}", first_event, err); + Err(e) => { + warn!( + ?first_event, + ?e, + "Error deriving key for invalidate operation;" + ); continue; } }; @@ -348,7 +362,10 @@ pub(crate) fn mount_invalidate() -> AlphaRouter { } event = event_bus_rx.recv() => { let Ok(event) = event else { - warn!("Shutting down invalidation manager thread due to the core event bus being dropped!"); + warn!( + "Shutting down invalidation manager thread \ + due to the core event bus being dropped!" + ); break; }; @@ -362,8 +379,12 @@ pub(crate) fn mount_invalidate() -> AlphaRouter { Ok(key) => { buf.insert(key, op); }, - Err(err) => { - warn!("Error deriving key for invalidate operation '{:?}': {:?}", op, err); + Err(e) => { + warn!( + ?op, + ?e, + "Error deriving key for invalidate operation;", + ); }, } }, @@ -386,7 +407,10 @@ pub(crate) fn mount_invalidate() -> AlphaRouter { Ok(_) => {} // All receivers are shutdown means that all clients are disconnected. Err(_) => { - debug!("Shutting down invalidation manager! This is normal if all clients disconnects."); + debug!( + "Shutting down invalidation manager! \ + This is normal if all clients disconnects." + ); manager_thread_active.swap(false, Ordering::Relaxed); break; } diff --git a/core/src/api/volumes.rs b/core/src/api/volumes.rs index 1e31258c8..75ad76f73 100644 --- a/core/src/api/volumes.rs +++ b/core/src/api/volumes.rs @@ -1,29 +1,11 @@ use crate::volume::get_volumes; -use sd_cache::{Normalise, NormalisedResults}; - use rspc::alpha::AlphaRouter; use super::{Ctx, R}; pub(crate) fn mount() -> AlphaRouter { R.router().procedure("list", { - R.query(|_, _: ()| async move { - let volumes = get_volumes().await; - - let (nodes, items) = volumes.normalise(|i| { - // TODO: This is a really bad key. Once we hook up volumes with the DB fix this! - blake3::hash( - &i.mount_points - .iter() - .flat_map(|mp| mp.as_os_str().to_string_lossy().as_bytes().to_vec()) - .collect::>(), - ) - .to_hex() - .to_string() - }); - - Ok(NormalisedResults { nodes, items }) - }) + R.query(|_, _: ()| async move { Ok(get_volumes().await) }) }) } diff --git a/core/src/cloud/sync/ingest.rs b/core/src/cloud/sync/ingest.rs index 1d08db285..de1a98603 100644 --- a/core/src/cloud/sync/ingest.rs +++ b/core/src/cloud/sync/ingest.rs @@ -1,3 +1,5 @@ +use sd_prisma::prisma::cloud_crdt_operation; +use sd_sync::CompressedCRDTOperations; use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, @@ -40,38 +42,52 @@ pub async fn run_actor( break; } Request::Messages { timestamps, .. } => timestamps, - _ => continue, }; - let ops = err_break!( + let (ops_ids, ops): (Vec<_>, Vec<_>) = err_break!( sync.get_cloud_ops(GetOpsArgs { clocks: timestamps, count: OPS_PER_REQUEST, }) .await - ); + ) + .into_iter() + .unzip(); if ops.is_empty() { break; } debug!( - "Sending {} messages ({:?} to {:?}) to ingester", - ops.len(), - ops.first().map(|operation| operation.timestamp.as_u64()), - ops.last().map(|operation| operation.timestamp.as_u64()), + messages_count = ops.len(), + first_message = ?ops.first().map(|operation| operation.timestamp.as_u64()), + last_message = ?ops.last().map(|operation| operation.timestamp.as_u64()), + "Sending messages to ingester", ); + let (wait_tx, wait_rx) = tokio::sync::oneshot::channel::<()>(); + err_break!( sync.ingest .event_tx .send(sd_core_sync::Event::Messages(MessagesEvent { instance_id: sync.instance, has_more: ops.len() == OPS_PER_REQUEST as usize, - messages: ops, + messages: CompressedCRDTOperations::new(ops), + wait_tx: Some(wait_tx) })) .await ); + + err_break!(wait_rx.await); + + err_break!( + sync.db + .cloud_crdt_operation() + .delete_many(vec![cloud_crdt_operation::id::in_vec(ops_ids)]) + .exec() + .await + ); } } } diff --git a/core/src/cloud/sync/mod.rs b/core/src/cloud/sync/mod.rs index 5b12e6578..95a110ef0 100644 --- a/core/src/cloud/sync/mod.rs +++ b/core/src/cloud/sync/mod.rs @@ -97,7 +97,7 @@ macro_rules! err_break { match $e { Ok(d) => d, Err(e) => { - tracing::error!("{e}"); + tracing::error!(?e); break; } } diff --git a/core/src/cloud/sync/receive.rs b/core/src/cloud/sync/receive.rs index b148f154a..85354e89c 100644 --- a/core/src/cloud/sync/receive.rs +++ b/core/src/cloud/sync/receive.rs @@ -8,6 +8,7 @@ use sd_utils::uuid_to_bytes; use std::{ collections::{hash_map::Entry, HashMap}, + str::FromStr, sync::{ atomic::{AtomicBool, Ordering}, Arc, @@ -55,7 +56,7 @@ pub async fn run_actor( .map(|id| { db.cloud_crdt_operation() .find_first(vec![cloud_crdt_operation::instance::is(vec![ - instance::pub_id::equals(uuid_to_bytes(*id)), + instance::pub_id::equals(uuid_to_bytes(id)), ])]) .order_by(cloud_crdt_operation::timestamp::order( SortOrder::Desc, @@ -75,8 +76,10 @@ pub async fn run_actor( let cloud_timestamp = d.map(|d| d.timestamp).unwrap_or_default() as u64; debug!( - "Instance {id}, Sync Timestamp {}, Cloud Timestamp {cloud_timestamp}", - sync_timestamp.as_u64() + instance_id = %id, + sync_timestamp = sync_timestamp.as_u64(), + %cloud_timestamp, + "Comparing sync timestamps", ); let max_timestamp = Ord::max(cloud_timestamp, sync_timestamp.as_u64()); @@ -117,7 +120,10 @@ pub async fn run_actor( .await ); - info!("Received {} collections", collections.len()); + info!( + collections_count = collections.len(), + "Received collections;", + ); if collections.is_empty() { break; @@ -164,9 +170,11 @@ pub async fn run_actor( &db, &sync, &libraries, - collection.instance_uuid, + &collection.instance_uuid, instance.identity, - instance.node_id, + &instance.node_id, + RemoteIdentity::from_str(&instance.node_remote_identity) + .expect("malformed remote identity in the DB"), node.p2p.peer_metadata(), ) .await @@ -182,14 +190,10 @@ pub async fn run_actor( let operations = compressed_operations.into_ops(); debug!( - "Processing collection. Instance {}, Start {:?}, End {:?}", - &collection.instance_uuid, - operations - .first() - .map(|operation| operation.timestamp.as_u64()), - operations - .last() - .map(|operation| operation.timestamp.as_u64()), + instance_id = %collection.instance_uuid, + start = ?operations.first().map(|operation| operation.timestamp.as_u64()), + end = ?operations.last().map(|operation| operation.timestamp.as_u64()), + "Processing collection", ); err_break!(write_cloud_ops_to_db(operations, &db).await); @@ -244,9 +248,10 @@ pub async fn upsert_instance( db: &PrismaClient, sync: &sd_core_sync::Manager, libraries: &Libraries, - uuid: Uuid, + uuid: &Uuid, identity: RemoteIdentity, - node_id: Uuid, + node_id: &Uuid, + node_remote_identity: RemoteIdentity, metadata: HashMap, ) -> prisma_client_rust::Result<()> { db.instance() @@ -258,16 +263,21 @@ pub async fn upsert_instance( node_id.as_bytes().to_vec(), Utc::now().into(), Utc::now().into(), - vec![instance::metadata::set(Some( - serde_json::to_vec(&metadata).expect("unable to serialize metadata"), - ))], + vec![ + instance::node_remote_identity::set(Some( + node_remote_identity.get_bytes().to_vec(), + )), + instance::metadata::set(Some( + serde_json::to_vec(&metadata).expect("unable to serialize metadata"), + )), + ], ), vec![], ) .exec() .await?; - sync.timestamps.write().await.entry(uuid).or_default(); + sync.timestamps.write().await.entry(*uuid).or_default(); // Called again so the new instances are picked up libraries.update_instances_by_id(library_id).await; diff --git a/core/src/cloud/sync/send.rs b/core/src/cloud/sync/send.rs index e4744f306..872b92c70 100644 --- a/core/src/cloud/sync/send.rs +++ b/core/src/cloud/sync/send.rs @@ -52,8 +52,8 @@ pub async fn run_actor( use sd_cloud_api::library::message_collections::do_add; debug!( - "Preparing to send {} instances' operations to cloud", - req_adds.len() + total_operations = req_adds.len(), + "Preparing to send instance's operations to cloud;" ); // gets new operations for each instance to send to cloud @@ -84,10 +84,7 @@ pub async fn run_actor( use base64::prelude::*; - debug!( - "Instance {}: {} to {}", - req_add.instance_uuid, start_time, end_time - ); + debug!(instance_id = %req_add.instance_uuid, %start_time, %end_time); instances.push(do_add::Input { uuid: req_add.instance_uuid, diff --git a/core/src/context.rs b/core/src/context.rs new file mode 100644 index 000000000..f47ff5aae --- /dev/null +++ b/core/src/context.rs @@ -0,0 +1,229 @@ +use crate::{api::CoreEvent, invalidate_query, library::Library, old_job::JobProgressEvent, Node}; + +use sd_core_heavy_lifting::{ + job_system::report::{Report, Status}, + OuterContext, ProgressUpdate, UpdateEvent, +}; + +use std::{ + ops::{Deref, DerefMut}, + sync::{ + atomic::{AtomicU8, Ordering}, + Arc, + }, +}; + +use chrono::{DateTime, Utc}; +use tokio::{spawn, sync::RwLock}; +use tracing::{error, trace}; +use uuid::Uuid; + +#[derive(Clone)] +pub struct NodeContext { + pub node: Arc, + pub library: Arc, +} + +pub trait NodeContextExt: sealed::Sealed { + fn library(&self) -> &Arc; +} + +mod sealed { + pub trait Sealed {} +} + +impl sealed::Sealed for NodeContext {} + +impl NodeContextExt for NodeContext { + fn library(&self) -> &Arc { + &self.library + } +} + +impl OuterContext for NodeContext { + fn id(&self) -> Uuid { + self.library.id + } + + fn db(&self) -> &Arc { + &self.library.db + } + + fn sync(&self) -> &Arc { + &self.library.sync + } + + fn invalidate_query(&self, query: &'static str) { + invalidate_query!(self.library, query) + } + + fn query_invalidator(&self) -> impl Fn(&'static str) + Send + Sync { + |query| { + invalidate_query!(self.library, query); + } + } + + fn report_update(&self, update: UpdateEvent) { + // FIX-ME: Remove this conversion once we have a proper atomic updates system + let event = match update { + UpdateEvent::NewThumbnail { thumb_key } => CoreEvent::NewThumbnail { thumb_key }, + UpdateEvent::NewIdentifiedObjects { file_path_ids } => { + CoreEvent::NewIdentifiedObjects { file_path_ids } + } + }; + self.node.emit(event); + } + + fn get_data_directory(&self) -> &std::path::Path { + &self.node.data_dir + } +} + +#[derive(Clone)] +pub struct JobContext { + outer_ctx: OuterCtx, + report: Arc>, + start_time: DateTime, + report_update_counter: Arc, +} + +impl OuterContext for JobContext { + fn id(&self) -> Uuid { + self.outer_ctx.id() + } + + fn db(&self) -> &Arc { + self.outer_ctx.db() + } + + fn sync(&self) -> &Arc { + self.outer_ctx.sync() + } + + fn invalidate_query(&self, query: &'static str) { + self.outer_ctx.invalidate_query(query); + } + + fn query_invalidator(&self) -> impl Fn(&'static str) + Send + Sync { + self.outer_ctx.query_invalidator() + } + + fn report_update(&self, update: UpdateEvent) { + self.outer_ctx.report_update(update); + } + + fn get_data_directory(&self) -> &std::path::Path { + self.outer_ctx.get_data_directory() + } +} + +impl sd_core_heavy_lifting::JobContext + for JobContext +{ + fn new(report: Report, outer_ctx: OuterCtx) -> Self { + Self { + report: Arc::new(RwLock::new(report)), + outer_ctx, + start_time: Utc::now(), + report_update_counter: Arc::new(AtomicU8::new(0)), + } + } + + async fn progress(&self, updates: impl IntoIterator + Send) { + let mut report = self.report.write().await; + + // protect against updates if job is not running + if report.status != Status::Running { + return; + }; + + let mut changed_phase = false; + + for update in updates { + match update { + ProgressUpdate::TaskCount(task_count) => { + report.task_count = task_count as i32; + } + ProgressUpdate::CompletedTaskCount(completed_task_count) => { + report.completed_task_count = completed_task_count as i32; + } + + ProgressUpdate::Message(message) => { + trace!(job_id = %report.id, %message, "job message;"); + report.message = message; + } + ProgressUpdate::Phase(phase) => { + trace!( + job_id = %report.id, + "changing phase: {} -> {phase};", + report.phase + ); + report.phase = phase; + changed_phase = true; + } + } + } + + // Calculate elapsed time + let elapsed = Utc::now() - self.start_time; + + // Calculate remaining time + let task_count = report.task_count as usize; + let completed_task_count = report.completed_task_count as usize; + let remaining_task_count = task_count.saturating_sub(completed_task_count); + + // Adding 1 to avoid division by zero + let remaining_time_per_task = elapsed / (completed_task_count + 1) as i32; + + let remaining_time = remaining_time_per_task * remaining_task_count as i32; + + // Update the report with estimated remaining time + report.estimated_completion = Utc::now() + .checked_add_signed(remaining_time) + .unwrap_or(Utc::now()); + + let library = self.outer_ctx.library(); + + let counter = self.report_update_counter.fetch_add(1, Ordering::AcqRel); + + if counter == 50 || counter == 0 || changed_phase { + self.report_update_counter.store(1, Ordering::Release); + + spawn({ + let db = Arc::clone(&library.db); + let mut report = report.clone(); + async move { + if let Err(e) = report.update(&db).await { + error!( + ?e, + "Failed to update job report on debounced job progress event;" + ); + } + } + }); + } + + // emit a CoreEvent + library.emit(CoreEvent::JobProgress(JobProgressEvent { + id: report.id, + library_id: library.id, + task_count: report.task_count, + completed_task_count: report.completed_task_count, + estimated_completion: report.estimated_completion, + phase: report.phase.clone(), + message: report.message.clone(), + })); + } + + async fn report(&self) -> impl Deref { + Arc::clone(&self.report).read_owned().await + } + + async fn report_mut(&self) -> impl DerefMut { + Arc::clone(&self.report).write_owned().await + } + + fn get_outer_ctx(&self) -> OuterCtx { + self.outer_ctx.clone() + } +} diff --git a/core/src/custom_uri/mod.rs b/core/src/custom_uri/mod.rs index 37ad328f4..33af7c727 100644 --- a/core/src/custom_uri/mod.rs +++ b/core/src/custom_uri/mod.rs @@ -1,19 +1,21 @@ use crate::{ api::{utils::InvalidateOperationEvent, CoreEvent}, library::Library, - object::media::old_thumbnail::WEBP_EXTENSION, - p2p::operations, + p2p::operations::{self, request_file}, util::InfallibleResponse, Node, }; use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_heavy_lifting::media_processor::WEBP_EXTENSION; use sd_core_prisma_helpers::file_path_to_handle_custom_uri; use sd_file_ext::text::is_text; use sd_p2p::{RemoteIdentity, P2P}; +use sd_p2p_block::Range; use sd_prisma::prisma::{file_path, location}; use sd_utils::db::maybe_missing; +use tokio_util::sync::PollSender; use std::{ cmp::min, @@ -25,8 +27,9 @@ use std::{ sync::Arc, }; +use async_stream::stream; use axum::{ - body::{self, Body, BoxBody, Full}, + body::{self, Body, BoxBody, Full, StreamBody}, extract::{self, State}, http::{HeaderMap, HeaderValue, Request, Response, StatusCode}, middleware, @@ -34,6 +37,7 @@ use axum::{ routing::get, Router, }; +use bytes::Bytes; use http_body::combinators::UnsyncBoxBody; use hyper::{header, upgrade::OnUpgrade}; use mini_moka::sync::Cache; @@ -51,6 +55,8 @@ mod mpsc_to_async_write; mod serve_file; mod utils; +use mpsc_to_async_write::MpscToAsyncWrite; + type CacheKey = (Uuid, file_path::id::Type); #[derive(Debug, Clone)] @@ -68,7 +74,11 @@ pub enum ServeFrom { /// Serve from the local filesystem Local, /// Serve from a specific instance - Remote(RemoteIdentity), + Remote { + library_identity: Box, + node_identity: Box, + library: Arc, + }, } #[derive(Clone)] @@ -93,8 +103,8 @@ async fn request_to_remote_node( let mut response = match operations::remote_rspc(p2p.clone(), identity, request).await { Ok(v) => v, - Err(err) => { - warn!("Error doing remote rspc query with '{identity}': {err:?}"); + Err(e) => { + warn!(%identity, ?e, "Error doing remote rspc query with;"); return StatusCode::BAD_GATEWAY.into_response(); } }; @@ -111,21 +121,21 @@ async fn request_to_remote_node( }; tokio::spawn(async move { - let Ok(mut request_upgraded) = request_upgraded.await.map_err(|err| { - warn!("Error upgrading websocket request: {err}"); + let Ok(mut request_upgraded) = request_upgraded.await.map_err(|e| { + warn!(?e, "Error upgrading websocket request;"); }) else { return; }; - let Ok(mut response_upgraded) = response_upgraded.await.map_err(|err| { - warn!("Error upgrading websocket response: {err}"); + let Ok(mut response_upgraded) = response_upgraded.await.map_err(|e| { + warn!(?e, "Error upgrading websocket response;"); }) else { return; }; copy_bidirectional(&mut request_upgraded, &mut response_upgraded) .await - .map_err(|err| { - warn!("Error upgrading websocket response: {err}"); + .map_err(|e| { + warn!(?e, "Error upgrading websocket response;"); }) .ok(); }); @@ -176,17 +186,29 @@ async fn get_or_init_lru_entry( let path = Path::new(path) .join(IsolatedFilePathData::try_from((location_id, &file_path)).map_err(not_found)?); - let identity = + let library_identity = RemoteIdentity::from_bytes(&instance.remote_identity).map_err(internal_server_error)?; + let node_identity = RemoteIdentity::from_bytes( + instance + .node_remote_identity + .as_ref() + .expect("node_remote_identity is required"), + ) + .map_err(internal_server_error)?; + let lru_entry = CacheValue { name: path, ext: maybe_missing(file_path.extension, "extension").map_err(not_found)?, file_path_pub_id: Uuid::from_slice(&file_path.pub_id).map_err(internal_server_error)?, - serve_from: if identity == library.identity.to_remote_identity() { + serve_from: if library_identity == library.identity.to_remote_identity() { ServeFrom::Local } else { - ServeFrom::Remote(identity) + ServeFrom::Remote { + library_identity: Box::new(library_identity), + node_identity: Box::new(node_identity), + library: library.clone(), + } }, }; @@ -216,9 +238,9 @@ pub fn base_router() -> Router { .then_some(()) .ok_or_else(|| not_found(()))?; - let file = File::open(&path).await.map_err(|err| { + let file = File::open(&path).await.map_err(|e| { InfallibleResponse::builder() - .status(if err.kind() == io::ErrorKind::NotFound { + .status(if e.kind() == io::ErrorKind::NotFound { StatusCode::NOT_FOUND } else { StatusCode::INTERNAL_SERVER_ERROR @@ -240,15 +262,12 @@ pub fn base_router() -> Router { .route( "/file/:lib_id/:loc_id/:path_id", get( - |State(state): State, - path: ExtractedPath, - mut request: Request| async move { - let part_parts = path.0.clone(); + |State(state): State, path: ExtractedPath, request: Request| async move { let ( CacheValue { name: file_path_full_path, ext: extension, - file_path_pub_id: _file_path_pub_id, + file_path_pub_id, serve_from, .. }, @@ -264,42 +283,64 @@ pub fn base_router() -> Router { .then_some(()) .ok_or_else(|| not_found(()))?; - let mut file = - File::open(&file_path_full_path).await.map_err(|err| { - InfallibleResponse::builder() - .status(if err.kind() == io::ErrorKind::NotFound { - StatusCode::NOT_FOUND - } else { - StatusCode::INTERNAL_SERVER_ERROR - }) - .body(body::boxed(Full::from(""))) - })?; + let mut file = File::open(&file_path_full_path).await.map_err(|e| { + InfallibleResponse::builder() + .status(if e.kind() == io::ErrorKind::NotFound { + StatusCode::NOT_FOUND + } else { + StatusCode::INTERNAL_SERVER_ERROR + }) + .body(body::boxed(Full::from(""))) + })?; let resp = InfallibleResponse::builder().header( "Content-Type", HeaderValue::from_str( &infer_the_mime_type(&extension, &mut file, &metadata).await?, ) - .map_err(|err| { - error!("Error converting mime-type into header value: {}", err); + .map_err(|e| { + error!(?e, "Error converting mime-type into header value;"); internal_server_error(()) })?, ); serve_file(file, Ok(metadata), request.into_parts().0, resp).await } - ServeFrom::Remote(identity) => { - *request.uri_mut() = - format!("/file/{}/{}/{}", part_parts.0, part_parts.1, part_parts.2) - .parse() - .expect("url was validated by Axum"); + ServeFrom::Remote { + library_identity: _, + node_identity, + library, + } => { + // TODO: Support `Range` requests and `ETag` headers - Ok(request_to_remote_node( + let (tx, mut rx) = tokio::sync::mpsc::channel::>(150); + request_file( state.node.p2p.p2p.clone(), - identity, - request, + *node_identity, + &library.identity, + file_path_pub_id, + Range::Full, + MpscToAsyncWrite::new(PollSender::new(tx)), ) - .await) + .await + .map_err(|e| { + error!( + %file_path_pub_id, + node_identity = ?library.identity.to_remote_identity(), + ?e, + "Error requesting file from other node;", + ); + internal_server_error(()) + })?; + + // TODO: Content Type + Ok(InfallibleResponse::builder().status(StatusCode::OK).body( + body::boxed(StreamBody::new(stream! { + while let Some(item) = rx.recv().await { + yield item; + } + })), + )) } } }, @@ -316,9 +357,9 @@ pub fn base_router() -> Router { .then_some(()) .ok_or_else(|| not_found(()))?; - let mut file = File::open(&path).await.map_err(|err| { + let mut file = File::open(&path).await.map_err(|e| { InfallibleResponse::builder() - .status(if err.kind() == io::ErrorKind::NotFound { + .status(if e.kind() == io::ErrorKind::NotFound { StatusCode::NOT_FOUND } else { StatusCode::INTERNAL_SERVER_ERROR @@ -332,8 +373,8 @@ pub fn base_router() -> Router { None => "text/plain".to_string(), Some(ext) => infer_the_mime_type(ext, &mut file, &metadata).await?, }) - .map_err(|err| { - error!("Error converting mime-type into header value: {}", err); + .map_err(|e| { + error!(?e, "Error converting mime-type into header value;"); internal_server_error(()) })?, ); @@ -387,8 +428,8 @@ pub fn router(node: Arc) -> Router<()> { mut request: Request| async move { let identity = match RemoteIdentity::from_str(&identity) { Ok(identity) => identity, - Err(err) => { - warn!("Error parsing identity '{}': {}", identity, err); + Err(e) => { + warn!(%identity, ?e, "Error parsing identity;"); return (StatusCode::BAD_REQUEST, HeaderMap::new(), vec![]) .into_response(); } diff --git a/core/src/custom_uri/utils.rs b/core/src/custom_uri/utils.rs index 70171e2eb..645da5106 100644 --- a/core/src/custom_uri/utils.rs +++ b/core/src/custom_uri/utils.rs @@ -11,8 +11,8 @@ use http_body::Full; use tracing::debug; #[track_caller] -pub(crate) fn bad_request(err: impl Debug) -> http::Response { - debug!("400: Bad Request at {}: {err:?}", Location::caller()); +pub(crate) fn bad_request(e: impl Debug) -> http::Response { + debug!(caller = %Location::caller(), ?e, "400: Bad Request;"); InfallibleResponse::builder() .status(StatusCode::BAD_REQUEST) @@ -20,8 +20,8 @@ pub(crate) fn bad_request(err: impl Debug) -> http::Response { } #[track_caller] -pub(crate) fn not_found(err: impl Debug) -> http::Response { - debug!("404: Not Found at {}: {err:?}", Location::caller()); +pub(crate) fn not_found(e: impl Debug) -> http::Response { + debug!(caller = %Location::caller(), ?e, "404: Not Found;"); InfallibleResponse::builder() .status(StatusCode::NOT_FOUND) @@ -29,11 +29,8 @@ pub(crate) fn not_found(err: impl Debug) -> http::Response { } #[track_caller] -pub(crate) fn internal_server_error(err: impl Debug) -> http::Response { - debug!( - "500: Internal Server Error at {}: {err:?}", - Location::caller() - ); +pub(crate) fn internal_server_error(e: impl Debug) -> http::Response { + debug!(caller = %Location::caller(), ?e, "500: Internal Server Error;"); InfallibleResponse::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) @@ -41,8 +38,8 @@ pub(crate) fn internal_server_error(err: impl Debug) -> http::Response } #[track_caller] -pub(crate) fn not_implemented(err: impl Debug) -> http::Response { - debug!("501: Not Implemented at {}: {err:?}", Location::caller()); +pub(crate) fn not_implemented(e: impl Debug) -> http::Response { + debug!(caller = %Location::caller(), ?e, "501: Not Implemented;"); InfallibleResponse::builder() .status(StatusCode::NOT_IMPLEMENTED) diff --git a/core/src/lib.rs b/core/src/lib.rs index 3a3306545..48f131116 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,19 +1,19 @@ +#![recursion_limit = "256"] #![warn(clippy::unwrap_used, clippy::panic)] use crate::{ api::{CoreEvent, Router}, location::LocationManagerError, - object::media::old_thumbnail::old_actor::OldThumbnailer, }; +use sd_core_heavy_lifting::{media_processor::ThumbnailKind, JobSystem}; +use sd_core_prisma_helpers::CasId; + #[cfg(feature = "ai")] use sd_ai::old_image_labeler::{DownloadModelError, OldImageLabeler, YoloV8}; -use api::notifications::{Notification, NotificationData, NotificationId}; -use chrono::{DateTime, Utc}; -use node::config; -use notifications::Notifications; -use reqwest::{RequestBuilder, Response}; +use sd_task_system::TaskSystem; +use sd_utils::error::FileIOError; use std::{ fmt, @@ -21,8 +21,11 @@ use std::{ sync::{atomic::AtomicBool, Arc}, }; +use chrono::{DateTime, Utc}; +use futures_concurrency::future::Join; +use reqwest::{RequestBuilder, Response}; use thiserror::Error; -use tokio::{fs, sync::broadcast}; +use tokio::{fs, io, sync::broadcast}; use tracing::{error, info, warn}; use tracing_appender::{ non_blocking::{NonBlocking, WorkerGuard}, @@ -32,6 +35,7 @@ use tracing_subscriber::{filter::FromEnvError, prelude::*, EnvFilter}; pub mod api; mod cloud; +mod context; #[cfg(feature = "crypto")] pub(crate) mod crypto; pub mod custom_uri; @@ -50,6 +54,11 @@ pub(crate) mod volume; pub use env::Env; +use api::notifications::{Notification, NotificationData, NotificationId}; +use context::{JobContext, NodeContext}; +use node::config; +use notifications::Notifications; + pub(crate) use sd_core_sync as sync; /// Represents a single running instance of the Spacedrive core. @@ -63,11 +72,11 @@ pub struct Node { pub p2p: Arc, pub event_bus: (broadcast::Sender, broadcast::Receiver), pub notifications: Notifications, - pub thumbnailer: OldThumbnailer, - pub files_over_p2p_flag: Arc, pub cloud_sync_flag: Arc, pub env: Arc, pub http: reqwest::Client, + pub task_system: TaskSystem, + pub job_system: JobSystem>, #[cfg(feature = "ai")] pub old_image_labeller: Option, } @@ -87,7 +96,7 @@ impl Node { ) -> Result<(Arc, Arc), NodeError> { let data_dir = data_dir.as_ref(); - info!("Starting core with data directory '{}'", data_dir.display()); + info!(data_directory = %data_dir.display(), "Starting core;"); let env = Arc::new(env); @@ -116,27 +125,25 @@ impl Node { let (old_jobs, jobs_actor) = old_job::OldJobs::new(); let libraries = library::Libraries::new(data_dir.join("libraries")).await?; + let task_system = TaskSystem::new(); + let (p2p, start_p2p) = p2p::P2PManager::new(config.clone(), libraries.clone()) .await .map_err(NodeError::P2PManager)?; let node = Arc::new(Node { data_dir: data_dir.to_path_buf(), + job_system: JobSystem::new(task_system.get_dispatcher(), data_dir), + task_system, old_jobs, locations, notifications: notifications::Notifications::new(), p2p, - thumbnailer: OldThumbnailer::new( - data_dir, - libraries.clone(), - event_bus.0.clone(), - config.preferences_watcher(), - ) - .await, config, event_bus, libraries, - files_over_p2p_flag: Arc::new(AtomicBool::new(false)), - cloud_sync_flag: Arc::new(AtomicBool::new(false)), + cloud_sync_flag: Arc::new(AtomicBool::new( + cfg!(target_os = "ios") || cfg!(target_os = "android"), + )), http: reqwest::Client::new(), env, #[cfg(feature = "ai")] @@ -146,7 +153,10 @@ impl Node { ) .await .map_err(|e| { - error!("Failed to initialize image labeller. AI features will be disabled: {e:#?}"); + error!( + ?e, + "Failed to initialize image labeller. AI features will be disabled;" + ); }) .ok(), }); @@ -168,6 +178,27 @@ impl Node { locations_actor.start(node.clone()); node.libraries.init(&node).await?; jobs_actor.start(node.clone()); + + node.job_system + .init( + &node + .libraries + .get_all() + .await + .into_iter() + .map(|library| { + ( + library.id, + NodeContext { + library, + node: Arc::clone(&node), + }, + ) + }) + .collect(), + ) + .await?; + start_p2p( node.clone(), axum::Router::new() @@ -188,7 +219,7 @@ impl Node { .into_make_service(), ); - info!("Spacedrive online."); + info!("Spacedrive online!"); Ok((node, router)) } @@ -210,11 +241,16 @@ impl Node { "info" }; - // let level = "debug"; // Exists for now to debug the location manager - std::env::set_var( "RUST_LOG", - format!("info,sd_core={level},sd_p2p=debug,sd_core::location::manager=info,sd_ai={level}"), + format!( + "info,\ + sd_core={level},\ + sd_p2p={level},\ + sd_core_heavy_lifting={level},\ + sd_task_system={level},\ + sd_ai={level}" + ), ); } @@ -237,12 +273,20 @@ impl Node { .init(); std::panic::set_hook(Box::new(move |panic| { + use std::backtrace::{Backtrace, BacktraceStatus}; + let backtrace = Backtrace::capture(); if let Some(location) = panic.location() { tracing::error!( message = %panic, panic.file = format!("{}:{}", location.file(), location.line()), panic.column = location.column(), ); + if backtrace.status() == BacktraceStatus::Captured { + // NOTE(matheus-consoli): it seems that `tauri` is messing up the stack-trace + // and it doesn't capture anything, even when `RUST_BACKTRACE=full`, + // so in the current architecture, this is emitting an empty event. + tracing::error!(message = %backtrace); + } } else { tracing::error!(message = %panic); } @@ -253,9 +297,18 @@ impl Node { pub async fn shutdown(&self) { info!("Spacedrive shutting down..."); - self.thumbnailer.shutdown().await; - self.old_jobs.shutdown().await; - self.p2p.shutdown().await; + + // Let's shutdown the task system first, as the job system will receive tasks to save + self.task_system.shutdown().await; + + ( + self.old_jobs.shutdown(), + self.p2p.shutdown(), + self.job_system.shutdown(), + ) + .join() + .await; + #[cfg(feature = "ai")] if let Some(image_labeller) = &self.old_image_labeller { image_labeller.shutdown().await; @@ -265,7 +318,21 @@ impl Node { pub(crate) fn emit(&self, event: CoreEvent) { if let Err(e) = self.event_bus.0.send(event) { - warn!("Error sending event to event bus: {e:?}"); + warn!(?e, "Error sending event to event bus;"); + } + } + + pub async fn ephemeral_thumbnail_exists( + &self, + cas_id: &CasId<'_>, + ) -> Result { + let thumb_path = + ThumbnailKind::Ephemeral.compute_path(self.config.data_directory(), cas_id); + + match fs::metadata(&thumb_path).await { + Ok(_) => Ok(true), + Err(e) if e.kind() == io::ErrorKind::NotFound => Ok(false), + Err(e) => Err(FileIOError::from((thumb_path, e))), } } @@ -285,8 +352,8 @@ impl Node { Ok(_) => { self.notifications._internal_send(notification); } - Err(err) => { - error!("Error saving notification to config: {:?}", err); + Err(e) => { + error!(?e, "Error saving notification to config;"); } } } @@ -359,6 +426,9 @@ pub enum NodeError { InitConfig(#[from] util::debug_initializer::InitConfigError), #[error("logger error: {0}")] Logger(#[from] FromEnvError), + #[error(transparent)] + JobSystem(#[from] sd_core_heavy_lifting::JobSystemError), + #[cfg(feature = "ai")] #[error("ai error: {0}")] AI(#[from] sd_ai::Error), diff --git a/core/src/library/config.rs b/core/src/library/config.rs index 4a7bad016..863f744f9 100644 --- a/core/src/library/config.rs +++ b/core/src/library/config.rs @@ -71,10 +71,11 @@ pub enum LibraryConfigVersion { V8 = 8, V9 = 9, V10 = 10, + V11 = 11, } impl ManagedVersion for LibraryConfig { - const LATEST_VERSION: LibraryConfigVersion = LibraryConfigVersion::V10; + const LATEST_VERSION: LibraryConfigVersion = LibraryConfigVersion::V11; const KIND: Kind = Kind::Json("version"); @@ -129,7 +130,7 @@ impl LibraryConfig { db.indexer_rule().update_many( vec![indexer_rule::name::equals(Some(name))], vec![indexer_rule::pub_id::set(sd_utils::uuid_to_bytes( - Uuid::from_u128(i as u128), + &Uuid::from_u128(i as u128), ))], ) }) @@ -220,7 +221,7 @@ impl LibraryConfig { maybe_missing(path.size_in_bytes, "file_path.size_in_bytes") .map_or_else( |e| { - error!("{e:#?}"); + error!(?e); None }, Some, @@ -231,9 +232,11 @@ impl LibraryConfig { Some(size.to_be_bytes().to_vec()) } else { error!( - "File path had invalid size: '{}'", - path.id, size_in_bytes + file_path_id = %path.id, + size = %size_in_bytes, + "File path had invalid size;", ); + None }; @@ -446,8 +449,24 @@ impl LibraryConfig { .await?; } + (LibraryConfigVersion::V10, LibraryConfigVersion::V11) => { + db.instance() + .update_many( + vec![], + vec![instance::node_remote_identity::set(Some( + // This is a remote identity that doesn't exist. The expectation is that: + // - The current node will update it's own and notice the change causing it to push the updated id to the cloud + // - All other instances will be updated when the regular sync process with the cloud happens + "SaEhml9thV088ocsOXZ17BrNjFaROB0ojwBvnPHhztI".into(), + ))], + ) + .exec() + .await?; + } + _ => { - error!("Library config version is not handled: {:?}", current); + error!(current_version = ?current, "Library config version is not handled;"); + return Err(VersionManagerError::UnexpectedMigration { current_version: current.int_value(), next_version: next.int_value(), diff --git a/core/src/library/library.rs b/core/src/library/library.rs index 57ad5ef04..795714ab8 100644 --- a/core/src/library/library.rs +++ b/core/src/library/library.rs @@ -1,9 +1,8 @@ -use crate::{ - api::CoreEvent, cloud, object::media::old_thumbnail::get_indexed_thumbnail_path, sync, Node, -}; +use crate::{api::CoreEvent, cloud, sync, Node}; use sd_core_file_path_helper::IsolatedFilePathData; -use sd_core_prisma_helpers::file_path_to_full_path; +use sd_core_heavy_lifting::media_processor::ThumbnailKind; +use sd_core_prisma_helpers::{file_path_to_full_path, CasId}; use sd_p2p::Identity; use sd_prisma::prisma::{file_path, location, PrismaClient}; @@ -121,12 +120,17 @@ impl Library { // TODO: Remove this once we replace the old invalidation system pub(crate) fn emit(&self, event: CoreEvent) { if let Err(e) = self.event_bus_tx.send(event) { - warn!("Error sending event to event bus: {e:?}"); + warn!(?e, "Error sending event to event bus;"); } } - pub async fn thumbnail_exists(&self, node: &Node, cas_id: &str) -> Result { - let thumb_path = get_indexed_thumbnail_path(node, cas_id, self.id); + pub async fn thumbnail_exists( + &self, + node: &Node, + cas_id: &CasId<'_>, + ) -> Result { + let thumb_path = + ThumbnailKind::Indexed(self.id).compute_path(node.config.data_directory(), cas_id); match fs::metadata(&thumb_path).await { Ok(_) => Ok(true), @@ -182,7 +186,7 @@ impl Library { pub fn do_cloud_sync(&self) { if let Err(e) = self.do_cloud_sync.send(()) { - warn!("Error sending cloud resync message: {e:?}"); + warn!(?e, "Error sending cloud resync message;"); } } } diff --git a/core/src/library/manager/mod.rs b/core/src/library/manager/mod.rs index 0cac2c132..3c98d0a37 100644 --- a/core/src/library/manager/mod.rs +++ b/core/src/library/manager/mod.rs @@ -8,8 +8,9 @@ use crate::{ Node, }; +use futures::future::join_all; use sd_core_sync::SyncMessage; -use sd_p2p::Identity; +use sd_p2p::{Identity, RemoteIdentity}; use sd_prisma::prisma::{crdt_operation, instance, location, SortOrder}; use sd_utils::{ db, @@ -35,7 +36,7 @@ use tokio::{ sync::{broadcast, RwLock}, time::sleep, }; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info, instrument, warn}; use uuid::Uuid; use super::{Library, LibraryConfig, LibraryName}; @@ -112,9 +113,9 @@ impl Libraries { .and_then(|v| v.to_str().map(Uuid::from_str)) else { warn!( - "Attempted to load library from path '{}' \ - but it has an invalid filename. Skipping...", - config_path.display() + config_path = %config_path.display(), + "Attempted to load library from path \ + but it has an invalid filename. Skipping...;", ); continue; }; @@ -123,7 +124,11 @@ impl Libraries { match fs::metadata(&db_path).await { Ok(_) => {} Err(e) if e.kind() == io::ErrorKind::NotFound => { - warn!("Found library '{}' but no matching database file was found. Skipping...", config_path.display()); + warn!( + config_path = %config_path.display(), + "Found library but no matching database file was found. Skipping...;", + ); + continue; } Err(e) => return Err(FileIOError::from((db_path, e)).into()), @@ -157,6 +162,7 @@ impl Libraries { .await } + #[instrument(skip(self, instance, node), err)] #[allow(clippy::too_many_arguments)] pub(crate) async fn create_with_uuid( self: &Arc, @@ -188,9 +194,8 @@ impl Libraries { .await?; debug!( - "Created library '{}' config at '{}'", - id, - config_path.display() + config_path = %config_path.display(), + "Created library;", ); let node_cfg = node.config.get().await; @@ -224,12 +229,12 @@ impl Libraries { ) .await?; - debug!("Loaded library '{id:?}'"); + debug!("Loaded library"); if should_seed { tag::seed::new_library(&library).await?; sd_core_indexer_rules::seed::new_or_existing_library(&library.db).await?; - debug!("Seeded library '{id:?}'"); + debug!("Seeded library"); } invalidate_query!(library, "library.list"); @@ -324,7 +329,7 @@ impl Libraries { .exec() .await .map(|locations| locations.into_iter().filter_map(|location| location.path)) - .map_err(|e| error!("Failed to fetch locations for library deletion: {e:#?}")) + .map_err(|e| error!(?e, "Failed to fetch locations for library deletion;")) { location_paths .map(|location_path| async move { @@ -342,7 +347,7 @@ impl Libraries { .into_iter() .for_each(|res| { if let Err(e) = res { - error!("Failed to remove library from location metadata: {e:#?}"); + error!(?e, "Failed to remove library from location metadata;"); } }); } @@ -370,7 +375,7 @@ impl Libraries { .remove(id) .expect("we have exclusive access and checked it exists!"); - info!("Removed Library ", library.id); + info!(%library.id, "Removed Library;"); invalidate_query!(library, "library.list"); @@ -382,11 +387,53 @@ impl Libraries { self.libraries.read().await.get(library_id).cloned() } + // will return the library context for the given instance + pub async fn get_library_for_instance( + &self, + instance: &RemoteIdentity, + ) -> Option> { + join_all( + self.libraries + .read() + .await + .iter() + .map(|(_, library)| async move { + library + .db + .instance() + .find_many(vec![instance::remote_identity::equals( + instance.get_bytes().to_vec(), + )]) + .exec() + .await + .ok() + .iter() + .flatten() + .filter_map(|i| RemoteIdentity::from_bytes(&i.remote_identity).ok()) + .any(|i| i == *instance) + .then(|| Arc::clone(library)) + }), + ) + .await + .into_iter() + .find_map(|v| v) + } + // get_ctx will return the library context for the given library id. pub async fn hash_library(&self, library_id: &Uuid) -> bool { self.libraries.read().await.get(library_id).is_some() } + #[instrument( + skip_all, + fields( + library_id = %id, + db_path = %db_path.as_ref().display(), + config_path = %config_path.as_ref().display(), + %should_seed, + ), + err, + )] /// load the library from a given path. pub async fn load( self: &Arc, @@ -437,17 +484,34 @@ impl Libraries { .as_ref() .map(|metadata| serde_json::from_slice(metadata).expect("invalid metadata")); let instance_node_id = Uuid::from_slice(&instance.node_id)?; - if instance_node_id != node_config.id || curr_metadata != Some(node.p2p.peer_metadata()) { + let instance_node_remote_identity = instance + .node_remote_identity + .as_ref() + .and_then(|v| RemoteIdentity::from_bytes(v).ok()); + if instance_node_id != node_config.id + || instance_node_remote_identity != Some(node_config.identity.to_remote_identity()) + || curr_metadata != Some(node.p2p.peer_metadata()) + { info!( - "Detected that the library '{}' has changed node from '{}' to '{}'. Reconciling node data...", - id, instance_node_id, node_config.id + old_node_id = %instance_node_id, + new_node_id = %node_config.id, + "Detected that the library has changed nodes. Reconciling node data...", ); + // ensure + db.instance() .update( instance::id::equals(instance.id), vec![ instance::node_id::set(node_config.id.as_bytes().to_vec()), + instance::node_remote_identity::set(Some( + node_config + .identity + .to_remote_identity() + .get_bytes() + .to_vec(), + )), instance::metadata::set(Some( serde_json::to_vec(&node.p2p.peer_metadata()) .expect("invalid peer metadata"), @@ -463,34 +527,41 @@ impl Libraries { // let key_manager = Arc::new(KeyManager::new(vec![]).await?); // seed_keymanager(&db, &key_manager).await?; - let sync = sync::Manager::new(&db, instance_id, &config.generate_sync_operations, { - db._batch( - instances - .iter() - .map(|i| { - db.crdt_operation() - .find_first(vec![crdt_operation::instance::is(vec![ - instance::id::equals(i.id), - ])]) - .order_by(crdt_operation::timestamp::order(SortOrder::Desc)) - }) - .collect::>(), - ) - .await? - .into_iter() - .zip(&instances) - .map(|(op, i)| { - ( - from_bytes_to_uuid(&i.pub_id), - sd_sync::NTP64(op.map(|o| o.timestamp).unwrap_or_default() as u64), - ) - }) - .collect() - }); - let sync_manager = Arc::new(sync.manager); - let actors = Default::default(); + let sync = sync::Manager::new( + &db, + instance_id, + &config.generate_sync_operations, + { + db._batch( + instances + .iter() + .map(|i| { + db.crdt_operation() + .find_first(vec![crdt_operation::instance::is(vec![ + instance::id::equals(i.id), + ])]) + .order_by(crdt_operation::timestamp::order(SortOrder::Desc)) + }) + .collect::>(), + ) + .await? + .into_iter() + .zip(&instances) + .map(|(op, i)| { + ( + from_bytes_to_uuid(&i.pub_id), + sd_sync::NTP64(op.map(|o| o.timestamp).unwrap_or_default() as u64), + ) + }) + .collect() + }, + &actors, + ) + .await; + let sync_manager = Arc::new(sync.manager); + let cloud = crate::cloud::start(node, &actors, id, instance_id, &sync_manager, &db).await; let (tx, mut rx) = broadcast::channel(10); @@ -537,12 +608,12 @@ impl Libraries { .await? { if let Err(e) = node.locations.add(location.id, library.clone()).await { - error!("Failed to watch location on startup: {e}"); + error!(?e, "Failed to watch location on startup;"); }; } if let Err(e) = node.old_jobs.clone().cold_resume(node, &library).await { - error!("Failed to resume jobs for library. {:#?}", e); + error!(?e, "Failed to resume jobs for library;"); } tokio::spawn({ @@ -572,24 +643,31 @@ impl Libraries { .expect("invalid metadata") }); let should_update = this_instance.node_id != node_config.id - || curr_metadata != Some(node.p2p.peer_metadata()); + || RemoteIdentity::from_str( + &this_instance.node_remote_identity, + ) + .ok() != Some( + node_config.identity.to_remote_identity(), + ) || curr_metadata + != Some(node.p2p.peer_metadata()); if should_update { warn!("Library instance on cloud is outdated. Updating..."); - if let Err(err) = - sd_cloud_api::library::update_instance( - node.cloud_api_config().await, - library.id, - this_instance.uuid, - Some(node_config.id), - Some(node.p2p.peer_metadata()), - ) - .await + if let Err(e) = sd_cloud_api::library::update_instance( + node.cloud_api_config().await, + library.id, + this_instance.uuid, + Some(node_config.id), + Some(node_config.identity.to_remote_identity()), + Some(node.p2p.peer_metadata()), + ) + .await { error!( - "Failed to updating instance '{}' on cloud: {:#?}", - this_instance.uuid, err + instance_uuid = %this_instance.uuid, + ?e, + "Failed to updating instance on cloud;", ); } } @@ -598,37 +676,35 @@ impl Libraries { if lib.name != *library.config().await.name { warn!("Library name on cloud is outdated. Updating..."); - if let Err(err) = sd_cloud_api::library::update( + if let Err(e) = sd_cloud_api::library::update( node.cloud_api_config().await, library.id, Some(lib.name), ) .await { - error!( - "Failed to update library name on cloud: {:#?}", - err - ); + error!(?e, "Failed to update library name on cloud;"); } } for instance in lib.instances { - if let Err(err) = cloud::sync::receive::upsert_instance( + if let Err(e) = cloud::sync::receive::upsert_instance( library.id, &library.db, &library.sync, &node.libraries, - instance.uuid, + &instance.uuid, instance.identity, - instance.node_id, + &instance.node_id, + RemoteIdentity::from_str( + &instance.node_remote_identity, + ) + .expect("malformed remote identity from API"), instance.metadata, ) .await { - error!( - "Failed to create instance from cloud: {:#?}", - err - ); + error!(?e, "Failed to create instance on cloud;"); } } } @@ -698,7 +774,7 @@ async fn sync_rx_actor( InvalidateOperationEvent::all(), )), SyncMessage::Created => { - p2p::sync::originator(library.id, &library.sync, &node.p2p).await + p2p::sync::originator(library.clone(), &library.sync, &node.p2p).await } } } diff --git a/core/src/library/statistics.rs b/core/src/library/statistics.rs index 804c35f77..7746975fb 100644 --- a/core/src/library/statistics.rs +++ b/core/src/library/statistics.rs @@ -1,9 +1,10 @@ use crate::{api::utils::get_size, library::Library, volume::get_volumes, Node}; use sd_prisma::prisma::statistics; +use sd_utils::db::size_in_bytes_from_db; use chrono::Utc; -use tracing::info; +use tracing::{error, info}; use super::LibraryManagerError; @@ -31,6 +32,25 @@ pub async fn update_library_statistics( .await .unwrap_or(0); + let total_library_bytes = library + .db + .location() + .find_many(vec![]) + .exec() + .await + .unwrap_or_else(|e| { + error!(?e, "Failed to get locations;"); + vec![] + }) + .into_iter() + .map(|location| { + location + .size_in_bytes + .map(|size| size_in_bytes_from_db(&size)) + .unwrap_or(0) + }) + .sum::(); + let thumbnail_folder_size = get_size(node.config.data_directory().join("thumbnails")) .await .unwrap_or(0); @@ -41,11 +61,11 @@ pub async fn update_library_statistics( date_captured::set(Utc::now().into()), total_object_count::set(0), library_db_size::set(library_db_size.to_string()), - total_bytes_used::set(total_bytes_used.to_string()), - total_bytes_capacity::set(total_capacity.to_string()), - total_unique_bytes::set(0.to_string()), - total_bytes_free::set(available_capacity.to_string()), - preview_media_bytes::set(thumbnail_folder_size.to_string()), + total_library_bytes::set(total_library_bytes.to_string()), + total_local_bytes_used::set(total_bytes_used.to_string()), + total_local_bytes_capacity::set(total_capacity.to_string()), + total_local_bytes_free::set(available_capacity.to_string()), + total_library_preview_media_bytes::set(thumbnail_folder_size.to_string()), ]; let stats = library @@ -60,7 +80,7 @@ pub async fn update_library_statistics( .exec() .await?; - info!("Updated library statistics: {:?}", stats); + info!(?stats, "Updated library statistics;"); Ok(stats) } diff --git a/core/src/location/error.rs b/core/src/location/error.rs index df1bb3c93..87d074b3f 100644 --- a/core/src/location/error.rs +++ b/core/src/location/error.rs @@ -81,35 +81,33 @@ pub enum LocationError { } impl From for rspc::Error { - fn from(err: LocationError) -> Self { + fn from(e: LocationError) -> Self { use LocationError::*; - match err { + match e { // Not found errors PathNotFound(_) | UuidNotFound(_) | IdNotFound(_) | FilePath(FilePathError::IdNotFound(_) | FilePathError::NotFound(_)) => { - Self::with_cause(ErrorCode::NotFound, err.to_string(), err) + Self::with_cause(ErrorCode::NotFound, e.to_string(), e) } // User's fault errors NotDirectory(_) | NestedLocation(_) | LocationAlreadyExists(_) => { - Self::with_cause(ErrorCode::BadRequest, err.to_string(), err) + Self::with_cause(ErrorCode::BadRequest, e.to_string(), e) } // Custom error message is used to differentiate these errors in the frontend // TODO: A better solution would be for rspc to support sending custom data alongside errors - NeedRelink { .. } => { - Self::with_cause(ErrorCode::Conflict, "NEED_RELINK".to_owned(), err) - } + NeedRelink { .. } => Self::with_cause(ErrorCode::Conflict, "NEED_RELINK".to_owned(), e), AddLibraryToMetadata(_) => { - Self::with_cause(ErrorCode::Conflict, "ADD_LIBRARY".to_owned(), err) + Self::with_cause(ErrorCode::Conflict, "ADD_LIBRARY".to_owned(), e) } // Internal errors MissingField(missing_error) => missing_error.into(), - _ => Self::with_cause(ErrorCode::InternalServerError, err.to_string(), err), + _ => Self::with_cause(ErrorCode::InternalServerError, e.to_string(), e), } } } diff --git a/core/src/location/indexer/mod.rs b/core/src/location/indexer/mod.rs deleted file mode 100644 index ef1dff558..000000000 --- a/core/src/location/indexer/mod.rs +++ /dev/null @@ -1,546 +0,0 @@ -use crate::library::Library; - -use sd_core_file_path_helper::{FilePathError, IsolatedFilePathData, IsolatedFilePathDataParts}; -use sd_core_indexer_rules::IndexerRuleError; -use sd_core_prisma_helpers::file_path_pub_and_cas_ids; - -use sd_prisma::{ - prisma::{file_path, location, PrismaClient}, - prisma_sync, -}; -use sd_sync::*; -use sd_utils::{db::inode_to_db, error::FileIOError, from_bytes_to_uuid, msgpack}; - -use std::{collections::HashMap, path::Path}; - -use chrono::Utc; -use futures_concurrency::future::TryJoin; -use itertools::Itertools; -use prisma_client_rust::operator::or; -use rspc::ErrorCode; -use serde::{Deserialize, Serialize}; -use thiserror::Error; -use tracing::{trace, warn}; - -use super::location_with_indexer_rules; - -pub mod old_indexer_job; -mod old_shallow; -mod old_walk; - -use old_walk::WalkedEntry; - -pub use old_indexer_job::OldIndexerJobInit; -pub use old_shallow::*; - -#[derive(Serialize, Deserialize, Debug)] -pub struct OldIndexerJobSaveStep { - chunk_idx: usize, - walked: Vec, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct OldIndexerJobUpdateStep { - chunk_idx: usize, - to_update: Vec, -} - -/// Error type for the indexer module -#[derive(Error, Debug)] -pub enum IndexerError { - // Not Found errors - #[error("indexer rule not found: ")] - IndexerRuleNotFound(i32), - #[error("received sub path not in database: ", .0.display())] - SubPathNotFound(Box), - - // Internal Errors - #[error("Database Error: {}", .0.to_string())] - Database(#[from] prisma_client_rust::QueryError), - #[error(transparent)] - FileIO(#[from] FileIOError), - #[error(transparent)] - FilePath(#[from] FilePathError), - - // Mixed errors - #[error(transparent)] - IndexerRules(#[from] IndexerRuleError), -} - -impl From for rspc::Error { - fn from(err: IndexerError) -> Self { - match err { - IndexerError::IndexerRuleNotFound(_) | IndexerError::SubPathNotFound(_) => { - rspc::Error::with_cause(ErrorCode::NotFound, err.to_string(), err) - } - - IndexerError::IndexerRules(rule_err) => rule_err.into(), - - _ => rspc::Error::with_cause(ErrorCode::InternalServerError, err.to_string(), err), - } - } -} - -async fn execute_indexer_save_step( - location: &location_with_indexer_rules::Data, - OldIndexerJobSaveStep { walked, .. }: &OldIndexerJobSaveStep, - library: &Library, -) -> Result { - let Library { sync, db, .. } = library; - - let (sync_stuff, paths): (Vec<_>, Vec<_>) = walked - .iter() - .map(|entry| { - let IsolatedFilePathDataParts { - materialized_path, - is_dir, - name, - extension, - .. - } = &entry.iso_file_path.to_parts(); - - use file_path::*; - - let pub_id = sd_utils::uuid_to_bytes(entry.pub_id); - - let (sync_params, db_params): (Vec<_>, Vec<_>) = [ - ( - ( - location::NAME, - msgpack!(prisma_sync::location::SyncId { - pub_id: location.pub_id.clone() - }), - ), - location_id::set(Some(location.id)), - ), - sync_db_entry!(materialized_path.to_string(), materialized_path), - sync_db_entry!(name.to_string(), name), - sync_db_entry!(*is_dir, is_dir), - sync_db_entry!(extension.to_string(), extension), - sync_db_entry!( - entry.metadata.size_in_bytes.to_be_bytes().to_vec(), - size_in_bytes_bytes - ), - sync_db_entry!(inode_to_db(entry.metadata.inode), inode), - { - let v = entry.metadata.created_at.into(); - sync_db_entry!(v, date_created) - }, - { - let v = entry.metadata.modified_at.into(); - sync_db_entry!(v, date_modified) - }, - { - let v = Utc::now().into(); - sync_db_entry!(v, date_indexed) - }, - sync_db_entry!(entry.metadata.hidden, hidden), - ] - .into_iter() - .unzip(); - - ( - sync.shared_create( - prisma_sync::file_path::SyncId { - pub_id: sd_utils::uuid_to_bytes(entry.pub_id), - }, - sync_params, - ), - file_path::create_unchecked(pub_id, db_params), - ) - }) - .unzip(); - - let count = sync - .write_ops( - db, - ( - sync_stuff.into_iter().flatten().collect(), - db.file_path().create_many(paths).skip_duplicates(), - ), - ) - .await?; - - trace!("Inserted {count} records"); - - Ok(count) -} - -async fn execute_indexer_update_step( - update_step: &OldIndexerJobUpdateStep, - Library { sync, db, .. }: &Library, -) -> Result { - let (sync_stuff, paths_to_update): (Vec<_>, Vec<_>) = update_step - .to_update - .iter() - .map(|entry| async move { - let IsolatedFilePathDataParts { is_dir, .. } = &entry.iso_file_path.to_parts(); - - let pub_id = sd_utils::uuid_to_bytes(entry.pub_id); - - let should_unlink_object = if let Some(object_id) = entry.maybe_object_id { - db.file_path() - .count(vec![file_path::object_id::equals(Some(object_id))]) - .exec() - .await? > 1 - } else { - false - }; - - use file_path::*; - - let (sync_params, db_params): (Vec<_>, Vec<_>) = [ - // As this file was updated while Spacedrive was offline, we mark the object_id and cas_id as null - // So this file_path will be updated at file identifier job - should_unlink_object - .then_some(((object_id::NAME, msgpack!(nil)), object::disconnect())), - Some(((cas_id::NAME, msgpack!(nil)), cas_id::set(None))), - Some(sync_db_entry!(*is_dir, is_dir)), - Some(sync_db_entry!( - entry.metadata.size_in_bytes.to_be_bytes().to_vec(), - size_in_bytes_bytes - )), - Some(sync_db_entry!(inode_to_db(entry.metadata.inode), inode)), - Some({ - let v = entry.metadata.created_at.into(); - sync_db_entry!(v, date_created) - }), - Some({ - let v = entry.metadata.modified_at.into(); - sync_db_entry!(v, date_modified) - }), - Some(sync_db_entry!(entry.metadata.hidden, hidden)), - ] - .into_iter() - .flatten() - .unzip(); - - Ok::<_, IndexerError>(( - sync_params - .into_iter() - .map(|(field, value)| { - sync.shared_update( - prisma_sync::file_path::SyncId { - pub_id: pub_id.clone(), - }, - field, - value, - ) - }) - .collect::>(), - db.file_path() - .update(file_path::pub_id::equals(pub_id), db_params) - .select(file_path::select!({ id })), - )) - }) - .collect::>() - .try_join() - .await? - .into_iter() - .unzip(); - - let updated = sync - .write_ops( - db, - (sync_stuff.into_iter().flatten().collect(), paths_to_update), - ) - .await?; - - trace!("Updated {updated:?} records"); - - Ok(updated.len() as i64) -} - -fn iso_file_path_factory( - location_id: location::id::Type, - location_path: &Path, -) -> impl Fn(&Path, bool) -> Result, IndexerError> + '_ { - move |path, is_dir| { - IsolatedFilePathData::new(location_id, location_path, path, is_dir).map_err(Into::into) - } -} - -async fn remove_non_existing_file_paths( - to_remove: impl IntoIterator, - db: &PrismaClient, - sync: &sd_core_sync::Manager, -) -> Result { - let (sync_params, db_params): (Vec<_>, Vec<_>) = to_remove - .into_iter() - .map(|d| { - ( - sync.shared_delete(prisma_sync::file_path::SyncId { pub_id: d.pub_id }), - d.id, - ) - }) - .unzip(); - - sync.write_ops( - db, - ( - sync_params, - db.file_path() - .delete_many(vec![file_path::id::in_vec(db_params)]), - ), - ) - .await?; - - Ok(0) -} - -// TODO: Change this macro to a fn when we're able to return -// `impl Fn(Vec) -> impl Future, IndexerError>>` -// Maybe when TAITs arrive -#[macro_export] -macro_rules! file_paths_db_fetcher_fn { - ($db:expr) => {{ - |found_paths| async { - // Each found path is a AND with 4 terms, and SQLite has a expression tree limit of 1000 terms - // so we will use chunks of 200 just to be safe - - // FIXME: Can't pass this chunks variable direct to _batch because of lifetime issues - let chunks = found_paths - .into_iter() - .chunks(200) - .into_iter() - .map(|founds| { - $db.file_path() - .find_many(vec![::prisma_client_rust::operator::or( - founds.collect::>(), - )]) - .select(::sd_core_prisma_helpers::file_path_walker::select()) - }) - .collect::>(); - - $db._batch(chunks) - .await - .map(|fetched| fetched.into_iter().flatten().collect::>()) - .map_err(Into::into) - } - }}; -} - -// TODO: Change this macro to a fn when we're able to return -// `impl Fn(&Path, Vec) -> impl Future, IndexerError>>` -// Maybe when TAITs arrive -// FIXME: (fogodev) I was receiving this error here https://github.com/rust-lang/rust/issues/74497 -#[macro_export] -macro_rules! to_remove_db_fetcher_fn { - ($location_id:expr, $db:expr) => {{ - |parent_iso_file_path, unique_location_id_materialized_path_name_extension_params| async { - let location_id: ::sd_prisma::prisma::location::id::Type = $location_id; - let db: &::sd_prisma::prisma::PrismaClient = $db; - let parent_iso_file_path: ::sd_core_file_path_helper::IsolatedFilePathData< - 'static, - > = parent_iso_file_path; - let unique_location_id_materialized_path_name_extension_params: ::std::vec::Vec< - ::sd_prisma::prisma::file_path::WhereParam, - > = unique_location_id_materialized_path_name_extension_params; - - // FIXME: Can't pass this chunks variable direct to _batch because of lifetime issues - let chunks = unique_location_id_materialized_path_name_extension_params - .into_iter() - .chunks(200) - .into_iter() - .map(|unique_params| { - db.file_path() - .find_many(vec![::prisma_client_rust::operator::or( - unique_params.collect(), - )]) - .select(::sd_prisma::prisma::file_path::select!({ id })) - }) - .collect::<::std::vec::Vec<_>>(); - - let founds_ids = db._batch(chunks).await.map(|founds_chunk| { - founds_chunk - .into_iter() - .map(|file_paths| file_paths.into_iter().map(|file_path| file_path.id)) - .flatten() - .collect::<::std::collections::HashSet<_>>() - })?; - - // NOTE: This batch size can be increased if we wish to trade memory for more performance - const BATCH_SIZE: i64 = 1000; - - let mut to_remove = vec![]; - let mut cursor = 1; - - loop { - let found = $db.file_path() - .find_many(vec![ - ::sd_prisma::prisma::file_path::location_id::equals(Some(location_id)), - ::sd_prisma::prisma::file_path::materialized_path::equals(Some( - parent_iso_file_path - .materialized_path_for_children() - .expect("the received isolated file path must be from a directory"), - )), - ]) - .order_by(::sd_prisma::prisma::file_path::id::order(::sd_prisma::prisma::SortOrder::Asc)) - .take(BATCH_SIZE) - .cursor(::sd_prisma::prisma::file_path::id::equals(cursor)) - .select(::sd_prisma::prisma::file_path::select!({ id pub_id cas_id })) - .exec() - .await?; - - let should_stop = (found.len() as i64) < BATCH_SIZE; - - if let Some(last) = found.last() { - cursor = last.id; - } else { - break; - } - - to_remove.extend( - found - .into_iter() - .filter(|file_path| !founds_ids.contains(&file_path.id)) - .map(|file_path| ::sd_core_prisma_helpers::file_path_pub_and_cas_ids::Data { - id: file_path.id, - pub_id: file_path.pub_id, - cas_id: file_path.cas_id, - }), - ); - - if should_stop { - break; - } - } - - Ok(to_remove) - } - }}; -} - -pub async fn reverse_update_directories_sizes( - base_path: impl AsRef, - location_id: location::id::Type, - location_path: impl AsRef, - library: &Library, -) -> Result<(), FilePathError> { - let base_path = base_path.as_ref(); - let location_path = location_path.as_ref(); - - let Library { sync, db, .. } = library; - - let ancestors = base_path - .ancestors() - .take_while(|&ancestor| ancestor != location_path) - .map(|ancestor| IsolatedFilePathData::new(location_id, location_path, ancestor, true)) - .collect::, _>>()?; - - let chunked_queries = ancestors - .iter() - .chunks(200) - .into_iter() - .map(|ancestors_iso_file_paths_chunk| { - db.file_path() - .find_many(vec![or(ancestors_iso_file_paths_chunk - .into_iter() - .map(file_path::WhereParam::from) - .collect::>())]) - .select(file_path::select!({ pub_id materialized_path name })) - }) - .collect::>(); - - let mut pub_id_by_ancestor_materialized_path = db - ._batch(chunked_queries) - .await? - .into_iter() - .flatten() - .filter_map( - |file_path| match (file_path.materialized_path, file_path.name) { - (Some(materialized_path), Some(name)) => { - Some((format!("{materialized_path}{name}/"), (file_path.pub_id, 0))) - } - _ => { - warn!( - "Found a file_path missing its materialized_path or name: ", - from_bytes_to_uuid(&file_path.pub_id) - ); - None - } - }, - ) - .collect::>(); - - db.file_path() - .find_many(vec![ - file_path::location_id::equals(Some(location_id)), - file_path::materialized_path::in_vec( - ancestors - .iter() - .map(|ancestor_iso_file_path| { - ancestor_iso_file_path - .materialized_path_for_children() - .expect("each ancestor is a directory") - }) - .collect(), - ), - ]) - .select(file_path::select!({ materialized_path size_in_bytes_bytes })) - .exec() - .await? - .into_iter() - .for_each(|file_path| { - if let Some(materialized_path) = file_path.materialized_path { - if let Some((_, size)) = - pub_id_by_ancestor_materialized_path.get_mut(&materialized_path) - { - *size += file_path - .size_in_bytes_bytes - .map(|size_in_bytes_bytes| { - u64::from_be_bytes([ - size_in_bytes_bytes[0], - size_in_bytes_bytes[1], - size_in_bytes_bytes[2], - size_in_bytes_bytes[3], - size_in_bytes_bytes[4], - size_in_bytes_bytes[5], - size_in_bytes_bytes[6], - size_in_bytes_bytes[7], - ]) - }) - .unwrap_or_else(|| { - warn!("Got a directory missing its size in bytes"); - 0 - }); - } - } else { - warn!("Corrupt database possessing a file_path entry without materialized_path"); - } - }); - - let to_sync_and_update = ancestors - .into_iter() - .filter_map(|ancestor_iso_file_path| { - if let Some((pub_id, size)) = pub_id_by_ancestor_materialized_path.remove( - &ancestor_iso_file_path - .materialized_path_for_children() - .expect("each ancestor is a directory"), - ) { - let size_bytes = size.to_be_bytes().to_vec(); - - Some(( - sync.shared_update( - prisma_sync::file_path::SyncId { - pub_id: pub_id.clone(), - }, - file_path::size_in_bytes_bytes::NAME, - msgpack!(size_bytes.clone()), - ), - db.file_path().update( - file_path::pub_id::equals(pub_id), - vec![file_path::size_in_bytes_bytes::set(Some(size_bytes))], - ), - )) - } else { - warn!("Got a missing ancestor for a file_path in the database, maybe we have a corruption"); - None - } - }) - .unzip::<_, _, Vec<_>, Vec<_>>(); - - sync.write_ops(db, to_sync_and_update).await?; - - Ok(()) -} diff --git a/core/src/location/indexer/old_indexer_job.rs b/core/src/location/indexer/old_indexer_job.rs deleted file mode 100644 index 4c4826793..000000000 --- a/core/src/location/indexer/old_indexer_job.rs +++ /dev/null @@ -1,657 +0,0 @@ -use crate::{ - file_paths_db_fetcher_fn, invalidate_query, - library::Library, - location::{location_with_indexer_rules, update_location_size, ScanState}, - old_job::{ - CurrentStep, JobError, JobInitOutput, JobReportUpdate, JobResult, JobRunMetadata, - JobStepOutput, StatefulJob, WorkerContext, - }, - to_remove_db_fetcher_fn, -}; - -use sd_core_file_path_helper::{ - ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - IsolatedFilePathData, -}; -use sd_core_indexer_rules::IndexerRule; - -use sd_prisma::{ - prisma::{file_path, location}, - prisma_sync, -}; -use sd_sync::*; -use sd_utils::{db::maybe_missing, from_bytes_to_uuid, msgpack}; - -use std::{ - collections::HashMap, - hash::{Hash, Hasher}, - path::{Path, PathBuf}, - sync::Arc, - time::Duration, -}; - -use itertools::Itertools; -use prisma_client_rust::operator::or; -use serde::{Deserialize, Serialize}; -use serde_json::json; -use tokio::time::Instant; -use tracing::{debug, info, warn}; - -use super::{ - execute_indexer_save_step, execute_indexer_update_step, iso_file_path_factory, - old_walk::{keep_walking, walk, ToWalkEntry, WalkResult}, - remove_non_existing_file_paths, reverse_update_directories_sizes, IndexerError, - OldIndexerJobSaveStep, OldIndexerJobUpdateStep, -}; - -/// BATCH_SIZE is the number of files to index at each step, writing the chunk of files metadata in the database. -const BATCH_SIZE: usize = 1000; - -/// `IndexerJobInit` receives a `location::Data` object to be indexed -/// and possibly a `sub_path` to be indexed. The `sub_path` is used when -/// we want do index just a part of a location. -#[derive(Serialize, Deserialize, Debug)] -pub struct OldIndexerJobInit { - pub location: location_with_indexer_rules::Data, - pub sub_path: Option, -} - -impl Hash for OldIndexerJobInit { - fn hash(&self, state: &mut H) { - self.location.id.hash(state); - if let Some(ref sub_path) = self.sub_path { - sub_path.hash(state); - } - } -} -/// `IndexerJobData` contains the state of the indexer job, which includes a `location_path` that -/// is cached and casted on `PathBuf` from `local_path` column in the `location` table. It also -/// contains some metadata for logging purposes. -#[derive(Serialize, Deserialize, Debug)] -pub struct OldIndexerJobData { - location_path: PathBuf, - indexed_path: PathBuf, - indexer_rules: Vec, -} - -#[derive(Serialize, Deserialize, Default, Debug)] -pub struct OldIndexerJobRunMetadata { - db_write_time: Duration, - scan_read_time: Duration, - total_paths: u64, - total_updated_paths: u64, - total_save_steps: u64, - total_update_steps: u64, - indexed_count: u64, - updated_count: u64, - removed_count: u64, - paths_and_sizes: HashMap, -} - -impl JobRunMetadata for OldIndexerJobRunMetadata { - fn update(&mut self, new_data: Self) { - self.db_write_time += new_data.db_write_time; - self.scan_read_time += new_data.scan_read_time; - self.total_paths += new_data.total_paths; - self.total_updated_paths += new_data.total_updated_paths; - self.total_save_steps += new_data.total_save_steps; - self.total_update_steps += new_data.total_update_steps; - self.indexed_count += new_data.indexed_count; - self.removed_count += new_data.removed_count; - - for (path, size) in new_data.paths_and_sizes { - *self.paths_and_sizes.entry(path).or_default() += size; - } - } -} - -#[derive(Clone)] -pub enum ScanProgress { - ChunkCount(usize), - SavedChunks(usize), - UpdatedChunks(usize), - Message(String), -} - -impl OldIndexerJobData { - fn on_scan_progress(ctx: &WorkerContext, progress: Vec) { - ctx.progress( - progress - .into_iter() - .map(|p| match p { - ScanProgress::ChunkCount(c) => JobReportUpdate::TaskCount(c), - ScanProgress::SavedChunks(p) | ScanProgress::UpdatedChunks(p) => { - JobReportUpdate::CompletedTaskCount(p) - } - ScanProgress::Message(m) => JobReportUpdate::Message(m), - }) - .collect(), - ) - } -} - -/// `IndexerJobStepInput` defines the action that should be executed in the current step -#[derive(Serialize, Deserialize, Debug)] -pub enum OldIndexerJobStepInput { - Save(OldIndexerJobSaveStep), - Walk(ToWalkEntry), - Update(OldIndexerJobUpdateStep), -} - -/// A `IndexerJob` is a stateful job that walks a directory and indexes all files. -/// First it walks the directory and generates a list of files to index, chunked into -/// batches of [`BATCH_SIZE`]. Then for each chunk it write the file metadata to the database. -#[async_trait::async_trait] -impl StatefulJob for OldIndexerJobInit { - type Data = OldIndexerJobData; - type Step = OldIndexerJobStepInput; - type RunMetadata = OldIndexerJobRunMetadata; - - const NAME: &'static str = "indexer"; - const IS_BATCHED: bool = true; - - fn target_location(&self) -> location::id::Type { - self.location.id - } - - /// Creates a vector of valid path buffers from a directory, chunked into batches of `BATCH_SIZE`. - async fn init( - &self, - ctx: &WorkerContext, - data: &mut Option, - ) -> Result, JobError> { - let init = self; - let location_id = init.location.id; - let location_path = maybe_missing(&init.location.path, "location.path").map(Path::new)?; - - let db = Arc::clone(&ctx.library.db); - let sync = &ctx.library.sync; - - let indexer_rules = init - .location - .indexer_rules - .iter() - .map(|rule| IndexerRule::try_from(&rule.indexer_rule)) - .collect::, _>>() - .map_err(IndexerError::from)?; - - let to_walk_path = match &init.sub_path { - Some(sub_path) if sub_path != Path::new("") => { - let full_path = ensure_sub_path_is_in_location(location_path, sub_path) - .await - .map_err(IndexerError::from)?; - ensure_sub_path_is_directory(location_path, sub_path) - .await - .map_err(IndexerError::from)?; - - ensure_file_path_exists( - sub_path, - &IsolatedFilePathData::new(location_id, location_path, &full_path, true) - .map_err(IndexerError::from)?, - &db, - IndexerError::SubPathNotFound, - ) - .await?; - - full_path - } - _ => location_path.to_path_buf(), - }; - - let scan_start = Instant::now(); - let WalkResult { - walked, - to_update, - to_walk, - to_remove, - errors, - paths_and_sizes, - } = walk( - &to_walk_path, - &indexer_rules, - update_notifier_fn(ctx), - file_paths_db_fetcher_fn!(&db), - to_remove_db_fetcher_fn!(location_id, &db), - iso_file_path_factory(location_id, location_path), - 50_000, - ) - .await?; - let scan_read_time = scan_start.elapsed(); - let to_remove = to_remove.collect::>(); - - debug!( - "Walker at indexer job found {} file_paths to be removed", - to_remove.len() - ); - - ctx.node - .thumbnailer - .remove_indexed_cas_ids( - to_remove - .iter() - .filter_map(|file_path| file_path.cas_id.clone()) - .collect::>(), - ctx.library.id, - ) - .await; - - let db_delete_start = Instant::now(); - // TODO pass these uuids to sync system - let removed_count = remove_non_existing_file_paths(to_remove, &db, sync).await?; - let db_delete_time = db_delete_start.elapsed(); - - let total_new_paths = &mut 0; - let total_updated_paths = &mut 0; - let to_walk_count = to_walk.len(); - let to_save_chunks = &mut 0; - let to_update_chunks = &mut 0; - - let steps = walked - .chunks(BATCH_SIZE) - .into_iter() - .enumerate() - .map(|(i, chunk)| { - let chunk_steps = chunk.collect::>(); - - *total_new_paths += chunk_steps.len() as u64; - *to_save_chunks += 1; - - OldIndexerJobStepInput::Save(OldIndexerJobSaveStep { - chunk_idx: i, - walked: chunk_steps, - }) - }) - .chain( - to_update - .chunks(BATCH_SIZE) - .into_iter() - .enumerate() - .map(|(i, chunk)| { - let chunk_updates = chunk.collect::>(); - - *total_updated_paths += chunk_updates.len() as u64; - *to_update_chunks += 1; - - OldIndexerJobStepInput::Update(OldIndexerJobUpdateStep { - chunk_idx: i, - to_update: chunk_updates, - }) - }), - ) - .chain(to_walk.into_iter().map(OldIndexerJobStepInput::Walk)) - .collect::>(); - - debug!("Walker at indexer job found {total_updated_paths} file_paths to be updated"); - - OldIndexerJobData::on_scan_progress( - ctx, - vec![ - ScanProgress::ChunkCount(*to_save_chunks + *to_update_chunks), - ScanProgress::Message(format!( - "Starting saving {total_new_paths} files or directories, \ - {total_updated_paths} files or directories to update, \ - there still {to_walk_count} directories to index", - )), - ], - ); - - *data = Some(OldIndexerJobData { - location_path: location_path.to_path_buf(), - indexed_path: to_walk_path, - indexer_rules, - }); - - Ok(( - OldIndexerJobRunMetadata { - db_write_time: db_delete_time, - scan_read_time, - total_paths: *total_new_paths, - total_updated_paths: *total_updated_paths, - indexed_count: 0, - updated_count: 0, - removed_count, - total_save_steps: *to_save_chunks as u64, - total_update_steps: *to_update_chunks as u64, - paths_and_sizes, - }, - steps, - errors - .into_iter() - .map(|e| format!("{e}")) - .collect::>() - .into(), - ) - .into()) - } - - /// Process each chunk of entries in the indexer job, writing to the `file_path` table - async fn execute_step( - &self, - ctx: &WorkerContext, - CurrentStep { step, .. }: CurrentStep<'_, Self::Step>, - data: &Self::Data, - run_metadata: &Self::RunMetadata, - ) -> Result, JobError> { - let init = self; - let mut new_metadata = Self::RunMetadata::default(); - match step { - OldIndexerJobStepInput::Save(step) => { - let start_time = Instant::now(); - - OldIndexerJobData::on_scan_progress( - ctx, - vec![ - ScanProgress::SavedChunks(step.chunk_idx + 1), - ScanProgress::Message(format!( - "Writing chunk {} of {} to database", - step.chunk_idx, run_metadata.total_save_steps - )), - ], - ); - - let count = execute_indexer_save_step(&init.location, step, &ctx.library).await?; - - new_metadata.indexed_count = count as u64; - new_metadata.db_write_time = start_time.elapsed(); - - Ok(new_metadata.into()) - } - OldIndexerJobStepInput::Update(to_update) => { - let start_time = Instant::now(); - OldIndexerJobData::on_scan_progress( - ctx, - vec![ - ScanProgress::UpdatedChunks(to_update.chunk_idx + 1), - ScanProgress::Message(format!( - "Updating chunk {} of {} to database", - to_update.chunk_idx, run_metadata.total_save_steps - )), - ], - ); - - let count = execute_indexer_update_step(to_update, &ctx.library).await?; - - new_metadata.updated_count = count as u64; - new_metadata.db_write_time = start_time.elapsed(); - - Ok(new_metadata.into()) - } - - OldIndexerJobStepInput::Walk(to_walk_entry) => { - let location_id = init.location.id; - let location_path = - maybe_missing(&init.location.path, "location.path").map(Path::new)?; - - let db = Arc::clone(&ctx.library.db); - let sync = &ctx.library.sync; - - let scan_start = Instant::now(); - - let WalkResult { - walked, - to_update, - to_walk, - to_remove, - errors, - paths_and_sizes, - } = keep_walking( - to_walk_entry, - &data.indexer_rules, - update_notifier_fn(ctx), - file_paths_db_fetcher_fn!(&db), - to_remove_db_fetcher_fn!(location_id, &db), - iso_file_path_factory(location_id, location_path), - ) - .await?; - - new_metadata.paths_and_sizes = paths_and_sizes; - - new_metadata.scan_read_time = scan_start.elapsed(); - - let db_delete_time = Instant::now(); - // TODO pass these uuids to sync system - new_metadata.removed_count = - remove_non_existing_file_paths(to_remove, &db, sync).await?; - new_metadata.db_write_time = db_delete_time.elapsed(); - - let to_walk_count = to_walk.len(); - - let more_steps = walked - .chunks(BATCH_SIZE) - .into_iter() - .enumerate() - .map(|(i, chunk)| { - let chunk_steps = chunk.collect::>(); - new_metadata.total_paths += chunk_steps.len() as u64; - new_metadata.total_save_steps += 1; - - OldIndexerJobStepInput::Save(OldIndexerJobSaveStep { - chunk_idx: i, - walked: chunk_steps, - }) - }) - .chain(to_update.chunks(BATCH_SIZE).into_iter().enumerate().map( - |(i, chunk)| { - let chunk_updates = chunk.collect::>(); - new_metadata.total_updated_paths += chunk_updates.len() as u64; - new_metadata.total_update_steps += 1; - - OldIndexerJobStepInput::Update(OldIndexerJobUpdateStep { - chunk_idx: i, - to_update: chunk_updates, - }) - }, - )) - .chain(to_walk.into_iter().map(OldIndexerJobStepInput::Walk)) - .collect::>(); - - OldIndexerJobData::on_scan_progress( - ctx, - vec![ - ScanProgress::ChunkCount(more_steps.len() - to_walk_count), - ScanProgress::Message(format!( - "Scanned {} more files or directories; \ - {} more directories to scan and {} more entries to update", - new_metadata.total_paths, - to_walk_count, - new_metadata.total_updated_paths - )), - ], - ); - - Ok(( - more_steps, - new_metadata, - errors - .into_iter() - .map(|e| format!("{e}")) - .collect::>() - .into(), - ) - .into()) - } - } - } - - async fn finalize( - &self, - ctx: &WorkerContext, - data: &Option, - run_metadata: &Self::RunMetadata, - ) -> JobResult { - let init = self; - let indexed_path_str = data - .as_ref() - .map(|data| Ok(data.indexed_path.to_string_lossy().to_string())) - .unwrap_or_else(|| maybe_missing(&init.location.path, "location.path").cloned())?; - - info!( - "Scan of {indexed_path_str} completed in {:?}. {} new files found, \ - indexed {} files in db, updated {} entries. db write completed in {:?}", - run_metadata.scan_read_time, - run_metadata.total_paths, - run_metadata.indexed_count, - run_metadata.total_updated_paths, - run_metadata.db_write_time, - ); - - if run_metadata.indexed_count > 0 || run_metadata.removed_count > 0 { - invalidate_query!(ctx.library, "search.paths"); - } - - if run_metadata.total_updated_paths > 0 { - // Invoking orphan remover here as we probably have some orphans objects due to updates - // ctx.library.orphan_remover.invoke().await; - } - - if run_metadata.indexed_count > 0 - || run_metadata.removed_count > 0 - || run_metadata.updated_count > 0 - { - if let Some(data) = data { - update_directories_sizes( - &run_metadata.paths_and_sizes, - init.location.id, - &data.indexed_path, - &ctx.library, - ) - .await?; - - if data.indexed_path != data.location_path { - reverse_update_directories_sizes( - &data.indexed_path, - init.location.id, - &data.location_path, - &ctx.library, - ) - .await - .map_err(IndexerError::from)?; - } - - update_location_size(init.location.id, &ctx.library) - .await - .map_err(IndexerError::from)?; - - ctx.library - .db - .location() - .update( - location::id::equals(init.location.id), - vec![location::scan_state::set(ScanState::Indexed as i32)], - ) - .exec() - .await - .map_err(IndexerError::from)?; - } - } - - // FIXME(fogodev): This is currently a workaround to don't save paths and sizes in the - // metadata after a job is completed, as it's pretty heavy. A proper fix isn't needed - // right now as I already changed it in the new indexer job. And this old one - // will be removed eventually. - let run_metadata = Self::RunMetadata { - db_write_time: run_metadata.db_write_time, - scan_read_time: run_metadata.scan_read_time, - total_paths: run_metadata.total_paths, - total_updated_paths: run_metadata.total_updated_paths, - total_save_steps: run_metadata.total_save_steps, - total_update_steps: run_metadata.total_update_steps, - indexed_count: run_metadata.indexed_count, - updated_count: run_metadata.updated_count, - removed_count: run_metadata.removed_count, - paths_and_sizes: HashMap::new(), - }; - - Ok(Some(json!({"init: ": init, "run_metadata": run_metadata}))) - } -} - -fn update_notifier_fn(ctx: &WorkerContext) -> impl FnMut(&Path, usize) + '_ { - move |path, total_entries| { - OldIndexerJobData::on_scan_progress( - ctx, - vec![ScanProgress::Message(format!( - "{total_entries} entries found at {}", - path.display() - ))], - ); - } -} - -async fn update_directories_sizes( - paths_and_sizes: &HashMap, - location_id: location::id::Type, - location_path: impl AsRef, - library: &Library, -) -> Result<(), IndexerError> { - let location_path = location_path.as_ref(); - - let Library { db, sync, .. } = library; - - let chunked_queries = paths_and_sizes - .keys() - .chunks(200) - .into_iter() - .map(|paths_chunk| { - paths_chunk - .into_iter() - .map(|path| { - IsolatedFilePathData::new(location_id, location_path, path, true) - .map(file_path::WhereParam::from) - }) - .collect::, _>>() - .map(|params| { - db.file_path() - .find_many(vec![or(params)]) - .select(file_path::select!({ pub_id materialized_path name })) - }) - }) - .collect::, _>>()?; - - let to_sync_and_update = db - ._batch(chunked_queries) - .await? - .into_iter() - .flatten() - .filter_map( - |file_path| match (file_path.materialized_path, file_path.name) { - (Some(materialized_path), Some(name)) => { - let mut directory_full_path = location_path.join(&materialized_path[1..]); - directory_full_path.push(name); - - if let Some(size) = paths_and_sizes.get(&directory_full_path) { - let size_bytes = size.to_be_bytes().to_vec(); - - Some(( - sync.shared_update( - prisma_sync::file_path::SyncId { - pub_id: file_path.pub_id.clone(), - }, - file_path::size_in_bytes_bytes::NAME, - msgpack!(size_bytes.clone()), - ), - db.file_path().update( - file_path::pub_id::equals(file_path.pub_id), - vec![file_path::size_in_bytes_bytes::set(Some(size_bytes))], - ), - )) - } else { - warn!("Found a file_path without ancestor in the database, possible corruption"); - None - } - } - _ => { - warn!( - "Found a file_path missing its materialized_path or name: ", - from_bytes_to_uuid(&file_path.pub_id) - ); - None - } - }, - ) - .unzip::<_, _, Vec<_>, Vec<_>>(); - - sync.write_ops(db, to_sync_and_update).await?; - - Ok(()) -} diff --git a/core/src/location/indexer/old_shallow.rs b/core/src/location/indexer/old_shallow.rs deleted file mode 100644 index 4b24316ed..000000000 --- a/core/src/location/indexer/old_shallow.rs +++ /dev/null @@ -1,196 +0,0 @@ -use crate::{ - file_paths_db_fetcher_fn, invalidate_query, - library::Library, - location::{ - indexer::{ - execute_indexer_update_step, reverse_update_directories_sizes, OldIndexerJobUpdateStep, - }, - scan_location_sub_path, update_location_size, - }, - old_job::JobError, - to_remove_db_fetcher_fn, Node, -}; - -use sd_core_file_path_helper::{ - check_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - IsolatedFilePathData, -}; -use sd_core_indexer_rules::IndexerRule; - -use sd_utils::db::maybe_missing; - -use std::{ - collections::HashSet, - path::{Path, PathBuf}, - sync::Arc, -}; - -use futures::future::join_all; -use itertools::Itertools; -use tracing::{debug, error}; - -use super::{ - execute_indexer_save_step, iso_file_path_factory, location_with_indexer_rules, - old_walk::walk_single_dir, remove_non_existing_file_paths, IndexerError, OldIndexerJobSaveStep, -}; - -/// BATCH_SIZE is the number of files to index at each step, writing the chunk of files metadata in the database. -const BATCH_SIZE: usize = 1000; - -pub async fn old_shallow( - location: &location_with_indexer_rules::Data, - sub_path: &PathBuf, - node: &Arc, - library: &Arc, -) -> Result<(), JobError> { - let location_id = location.id; - let location_path = maybe_missing(&location.path, "location.path").map(Path::new)?; - - let db = library.db.clone(); - let sync = &library.sync; - - let indexer_rules = location - .indexer_rules - .iter() - .map(|rule| IndexerRule::try_from(&rule.indexer_rule)) - .collect::, _>>() - .map_err(IndexerError::from)?; - - let (add_root, to_walk_path) = if sub_path != Path::new("") && sub_path != Path::new("/") { - let full_path = ensure_sub_path_is_in_location(&location_path, &sub_path) - .await - .map_err(IndexerError::from)?; - ensure_sub_path_is_directory(&location_path, &sub_path) - .await - .map_err(IndexerError::from)?; - - ( - !check_file_path_exists::( - &IsolatedFilePathData::new(location_id, location_path, &full_path, true) - .map_err(IndexerError::from)?, - &db, - ) - .await?, - full_path, - ) - } else { - (false, location_path.to_path_buf()) - }; - - let (walked, to_update, to_remove, errors, _s) = { - walk_single_dir( - &to_walk_path, - &indexer_rules, - file_paths_db_fetcher_fn!(&db), - to_remove_db_fetcher_fn!(location_id, &db), - iso_file_path_factory(location_id, location_path), - add_root, - ) - .await? - }; - - let to_remove_count = to_remove.len(); - - node.thumbnailer - .remove_indexed_cas_ids( - to_remove - .iter() - .filter_map(|file_path| file_path.cas_id.clone()) - .collect::>(), - library.id, - ) - .await; - - errors.into_iter().for_each(|e| error!("{e}")); - - remove_non_existing_file_paths(to_remove, &db, sync).await?; - - let mut new_directories_to_scan = HashSet::new(); - - let mut to_create_count = 0; - - let save_steps = walked - .chunks(BATCH_SIZE) - .into_iter() - .enumerate() - .map(|(i, chunk)| { - let walked = chunk.collect::>(); - to_create_count += walked.len(); - - walked - .iter() - .filter_map(|walked_entry| { - walked_entry.iso_file_path.materialized_path_for_children() - }) - .for_each(|new_dir| { - new_directories_to_scan.insert(new_dir); - }); - - OldIndexerJobSaveStep { - chunk_idx: i, - walked, - } - }) - .collect::>(); - - for step in save_steps { - execute_indexer_save_step(location, &step, library).await?; - } - - for scan in join_all( - new_directories_to_scan - .into_iter() - .map(|sub_path| scan_location_sub_path(node, library, location.clone(), sub_path)), - ) - .await - { - if let Err(e) = scan { - error!("{e}"); - } - } - - let mut to_update_count = 0; - - let update_steps = to_update - .chunks(BATCH_SIZE) - .into_iter() - .enumerate() - .map(|(i, chunk)| { - let to_update = chunk.collect::>(); - to_update_count += to_update.len(); - - OldIndexerJobUpdateStep { - chunk_idx: i, - to_update, - } - }) - .collect::>(); - - for step in update_steps { - execute_indexer_update_step(&step, library).await?; - } - - debug!( - "Walker at shallow indexer found: \ - To create: {to_create_count}; To update: {to_update_count}; To remove: {to_remove_count};" - ); - - if to_create_count > 0 || to_update_count > 0 || to_remove_count > 0 { - if to_walk_path != location_path { - reverse_update_directories_sizes(to_walk_path, location_id, location_path, library) - .await - .map_err(IndexerError::from)?; - } - - update_location_size(location.id, library) - .await - .map_err(IndexerError::from)?; - - invalidate_query!(library, "search.paths"); - invalidate_query!(library, "search.objects"); - } - - // library.orphan_remover.invoke().await; - - Ok(()) -} diff --git a/core/src/location/indexer/old_walk.rs b/core/src/location/indexer/old_walk.rs deleted file mode 100644 index 6653165d3..000000000 --- a/core/src/location/indexer/old_walk.rs +++ /dev/null @@ -1,1077 +0,0 @@ -use sd_core_file_path_helper::{FilePathMetadata, IsolatedFilePathData}; -use sd_core_indexer_rules::{IndexerRule, RuleKind}; -use sd_core_prisma_helpers::{file_path_pub_and_cas_ids, file_path_walker}; - -use sd_prisma::prisma::file_path; -use sd_utils::{db::inode_from_db, error::FileIOError}; - -use std::{ - collections::{HashMap, HashSet, VecDeque}, - future::Future, - hash::{Hash, Hasher}, - path::{Path, PathBuf}, -}; - -use chrono::{DateTime, Duration, FixedOffset}; -use serde::{Deserialize, Serialize}; -use tokio::fs; -use tracing::trace; -use uuid::Uuid; - -use super::IndexerError; - -const TO_WALK_QUEUE_INITIAL_CAPACITY: usize = 32; -const WALKER_PATHS_BUFFER_INITIAL_CAPACITY: usize = 256; -const WALK_SINGLE_DIR_PATHS_BUFFER_INITIAL_CAPACITY: usize = 32; - -/// `WalkEntry` represents a single path in the filesystem, for any comparison purposes, we only -/// consider the path itself, not the metadata. -#[derive(Debug, Serialize, Deserialize)] -pub struct WalkedEntry { - pub pub_id: Uuid, - pub maybe_object_id: file_path::object_id::Type, - pub iso_file_path: IsolatedFilePathData<'static>, - pub metadata: FilePathMetadata, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct ToWalkEntry { - path: PathBuf, - parent_dir_accepted_by_its_children: Option, - maybe_parent: Option, -} - -#[derive(Debug)] -struct WalkingEntry { - iso_file_path: IsolatedFilePathData<'static>, - maybe_metadata: Option, -} - -impl From for WalkedEntry { - fn from(walking_entry: WalkingEntry) -> Self { - let WalkingEntry { - iso_file_path, - maybe_metadata, - } = walking_entry; - - Self { - pub_id: Uuid::new_v4(), - maybe_object_id: None, - iso_file_path, - metadata: maybe_metadata - .expect("we always use Some in `the inner_walk_single_dir` function"), - } - } -} - -impl From<(Uuid, file_path::object_id::Type, WalkingEntry)> for WalkedEntry { - fn from( - (pub_id, maybe_object_id, walking_entry): (Uuid, file_path::object_id::Type, WalkingEntry), - ) -> Self { - let WalkingEntry { - iso_file_path, - maybe_metadata, - } = walking_entry; - - Self { - pub_id, - maybe_object_id, - iso_file_path, - metadata: maybe_metadata - .expect("we always use Some in `the inner_walk_single_dir` function"), - } - } -} - -impl PartialEq for WalkingEntry { - fn eq(&self, other: &Self) -> bool { - self.iso_file_path == other.iso_file_path - } -} - -impl Eq for WalkingEntry {} - -impl Hash for WalkingEntry { - fn hash(&self, state: &mut H) { - self.iso_file_path.hash(state); - } -} - -pub struct WalkResult -where - Walked: Iterator, - ToUpdate: Iterator, - ToRemove: Iterator, -{ - pub walked: Walked, - pub to_update: ToUpdate, - pub to_walk: VecDeque, - pub to_remove: ToRemove, - pub errors: Vec, - pub paths_and_sizes: HashMap, -} - -/// This function walks through the filesystem, applying the rules to each entry and then returning -/// a list of accepted entries. There are some useful comments in the implementation of this function -/// in case of doubts. -pub(super) async fn walk( - root: impl AsRef, - indexer_rules: &[IndexerRule], - mut update_notifier: impl FnMut(&Path, usize), - file_paths_db_fetcher: impl Fn(Vec) -> FilePathDBFetcherFut, - to_remove_db_fetcher: impl Fn( - IsolatedFilePathData<'static>, - Vec, - ) -> ToRemoveDbFetcherFut, - iso_file_path_factory: impl Fn(&Path, bool) -> Result, IndexerError>, - limit: u64, -) -> Result< - WalkResult< - impl Iterator, - impl Iterator, - impl Iterator, - >, - IndexerError, -> -where - FilePathDBFetcherFut: Future, IndexerError>>, - ToRemoveDbFetcherFut: - Future, IndexerError>>, -{ - let root = root.as_ref(); - - let mut to_walk = VecDeque::with_capacity(TO_WALK_QUEUE_INITIAL_CAPACITY); - to_walk.push_back(ToWalkEntry { - path: root.to_path_buf(), - parent_dir_accepted_by_its_children: None, - maybe_parent: None, - }); - let mut indexed_paths = HashSet::with_capacity(WALKER_PATHS_BUFFER_INITIAL_CAPACITY); - let mut errors = vec![]; - let mut paths_buffer = HashSet::with_capacity(WALKER_PATHS_BUFFER_INITIAL_CAPACITY); - let mut paths_and_sizes = HashMap::with_capacity(TO_WALK_QUEUE_INITIAL_CAPACITY); - let mut to_remove = vec![]; - - while let Some(entry) = to_walk.pop_front() { - let last_indexed_count = indexed_paths.len(); - - let (entry_size, current_to_remove) = inner_walk_single_dir( - root, - &entry, - indexer_rules, - &to_remove_db_fetcher, - &iso_file_path_factory, - WorkingTable { - indexed_paths: &mut indexed_paths, - paths_buffer: &mut paths_buffer, - maybe_to_walk: Some(&mut to_walk), - errors: &mut errors, - }, - ) - .await; - to_remove.push(current_to_remove); - - update_notifier(&entry.path, indexed_paths.len() - last_indexed_count); - - // Saving the size of current entry - paths_and_sizes.insert(entry.path, entry_size); - - // Adding the size of current entry to its parent - if let Some(parent) = entry.maybe_parent { - *paths_and_sizes.entry(parent).or_default() += entry_size; - } - - if indexed_paths.len() >= limit as usize { - break; - } - } - - let (walked, to_update) = filter_existing_paths(indexed_paths, file_paths_db_fetcher).await?; - - Ok(WalkResult { - walked, - to_update, - to_walk, - to_remove: to_remove.into_iter().flatten(), - errors, - paths_and_sizes, - }) -} - -pub(super) async fn keep_walking( - to_walk_entry: &ToWalkEntry, - indexer_rules: &[IndexerRule], - mut update_notifier: impl FnMut(&Path, usize), - file_paths_db_fetcher: impl Fn(Vec) -> FilePathDBFetcherFut, - to_remove_db_fetcher: impl Fn( - IsolatedFilePathData<'static>, - Vec, - ) -> ToRemoveDbFetcherFut, - iso_file_path_factory: impl Fn(&Path, bool) -> Result, IndexerError>, -) -> Result< - WalkResult< - impl Iterator, - impl Iterator, - impl Iterator, - >, - IndexerError, -> -where - FilePathDBFetcherFut: Future, IndexerError>>, - ToRemoveDbFetcherFut: - Future, IndexerError>>, -{ - let mut to_keep_walking = VecDeque::with_capacity(TO_WALK_QUEUE_INITIAL_CAPACITY); - let mut indexed_paths = HashSet::with_capacity(WALK_SINGLE_DIR_PATHS_BUFFER_INITIAL_CAPACITY); - let mut paths_buffer = HashSet::with_capacity(WALK_SINGLE_DIR_PATHS_BUFFER_INITIAL_CAPACITY); - let mut errors = vec![]; - - let (to_walk_entry_size, to_remove) = inner_walk_single_dir( - to_walk_entry.path.clone(), - to_walk_entry, - indexer_rules, - &to_remove_db_fetcher, - &iso_file_path_factory, - WorkingTable { - indexed_paths: &mut indexed_paths, - paths_buffer: &mut paths_buffer, - maybe_to_walk: Some(&mut to_keep_walking), - errors: &mut errors, - }, - ) - .await; - - update_notifier(&to_walk_entry.path, indexed_paths.len()); - - let (walked, to_update) = filter_existing_paths(indexed_paths, file_paths_db_fetcher).await?; - - Ok(WalkResult { - walked, - to_update, - to_walk: to_keep_walking, - to_remove: to_remove.into_iter(), - errors, - paths_and_sizes: [ - Some((to_walk_entry.path.clone(), to_walk_entry_size)), - to_walk_entry - .maybe_parent - .as_ref() - .map(|parent_path| (parent_path.clone(), to_walk_entry_size)), - ] - .into_iter() - .flatten() - .collect(), - }) -} - -pub(super) async fn walk_single_dir( - root: impl AsRef, - indexer_rules: &[IndexerRule], - file_paths_db_fetcher: impl Fn(Vec) -> FilePathDBFetcherFut, - to_remove_db_fetcher: impl Fn( - IsolatedFilePathData<'static>, - Vec, - ) -> ToRemoveDbFetcherFut, - iso_file_path_factory: impl Fn(&Path, bool) -> Result, IndexerError>, - add_root: bool, -) -> Result< - ( - impl Iterator, - impl Iterator, - Vec, - Vec, - u64, - ), - IndexerError, -> -where - FilePathDBFetcherFut: Future, IndexerError>>, - ToRemoveDbFetcherFut: - Future, IndexerError>>, -{ - let root = root.as_ref(); - - let mut indexed_paths = HashSet::with_capacity(WALK_SINGLE_DIR_PATHS_BUFFER_INITIAL_CAPACITY); - - if add_root { - let metadata = fs::metadata(root) - .await - .map_err(|e| FileIOError::from((root, e)))?; - - indexed_paths.insert(WalkingEntry { - iso_file_path: iso_file_path_factory(root, true)?, - maybe_metadata: Some(FilePathMetadata::from_path(root, &metadata)?), - }); - } - - let mut paths_buffer = HashSet::with_capacity(WALK_SINGLE_DIR_PATHS_BUFFER_INITIAL_CAPACITY); - let mut errors = vec![]; - - let (root_size, to_remove) = inner_walk_single_dir( - root, - &ToWalkEntry { - path: root.to_path_buf(), - parent_dir_accepted_by_its_children: None, - maybe_parent: None, - }, - indexer_rules, - &to_remove_db_fetcher, - &iso_file_path_factory, - WorkingTable { - indexed_paths: &mut indexed_paths, - paths_buffer: &mut paths_buffer, - maybe_to_walk: None, - errors: &mut errors, - }, - ) - .await; - - let (walked, to_update) = filter_existing_paths(indexed_paths, file_paths_db_fetcher).await?; - - Ok((walked, to_update, to_remove, errors, root_size)) -} - -async fn filter_existing_paths( - indexed_paths: HashSet, - file_paths_db_fetcher: impl Fn(Vec) -> F, -) -> Result< - ( - impl Iterator, - impl Iterator, - ), - IndexerError, -> -where - F: Future, IndexerError>>, -{ - if !indexed_paths.is_empty() { - file_paths_db_fetcher( - indexed_paths - .iter() - .map(|entry| &entry.iso_file_path) - .map(Into::into) - .collect(), - ) - .await - } else { - Ok(vec![]) - } - .map(move |file_paths| { - let isolated_paths_already_in_db = file_paths - .into_iter() - .flat_map(|file_path| { - IsolatedFilePathData::try_from(file_path.clone()) - .map(|iso_file_path| (iso_file_path, file_path)) - }) - .collect::>(); - - let mut to_update = vec![]; - - let to_create = indexed_paths - .into_iter() - .filter_map(|entry| { - if let Some(file_path) = isolated_paths_already_in_db.get(&entry.iso_file_path) { - if let (Some(metadata), Some(inode), Some(date_modified)) = ( - &entry.maybe_metadata, - &file_path.inode, - &file_path.date_modified, - ) { - if ( - inode_from_db(&inode[0..8]) != metadata.inode - // Datetimes stored in DB loses a bit of precision, so we need to check against a delta - // instead of using != operator - || DateTime::::from(metadata.modified_at) - *date_modified - > Duration::milliseconds(1) || file_path.hidden.is_none() || metadata.hidden != file_path.hidden.unwrap_or_default() - ) - // We ignore the size of directories because it is not reliable, we need to - // calculate it ourselves later - && !( - entry.iso_file_path.to_parts().is_dir - && metadata.size_in_bytes - != file_path - .size_in_bytes_bytes - .as_ref() - .map(|size_in_bytes_bytes| { - u64::from_be_bytes([ - size_in_bytes_bytes[0], - size_in_bytes_bytes[1], - size_in_bytes_bytes[2], - size_in_bytes_bytes[3], - size_in_bytes_bytes[4], - size_in_bytes_bytes[5], - size_in_bytes_bytes[6], - size_in_bytes_bytes[7], - ]) - }) - .unwrap_or_default() - ) { - to_update.push( - (sd_utils::from_bytes_to_uuid(&file_path.pub_id), file_path.object_id, entry).into(), - ); - } - } - - None - } else { - Some(entry.into()) - } - }) - .collect::>(); - - (to_create.into_iter(), to_update.into_iter()) - }) -} - -struct WorkingTable<'a> { - indexed_paths: &'a mut HashSet, - paths_buffer: &'a mut HashSet, - maybe_to_walk: Option<&'a mut VecDeque>, - errors: &'a mut Vec, -} - -async fn inner_walk_single_dir( - root: impl AsRef, - ToWalkEntry { - path, - parent_dir_accepted_by_its_children, - .. - }: &ToWalkEntry, - indexer_rules: &[IndexerRule], - to_remove_db_fetcher: impl Fn( - IsolatedFilePathData<'static>, - Vec, - ) -> ToRemoveDbFetcherFut, - iso_file_path_factory: &impl Fn(&Path, bool) -> Result, IndexerError>, - WorkingTable { - indexed_paths, - paths_buffer, - mut maybe_to_walk, - errors, - }: WorkingTable<'_>, -) -> (u64, Vec) -where - ToRemoveDbFetcherFut: - Future, IndexerError>>, -{ - let Ok(iso_file_path_to_walk) = iso_file_path_factory(path, true).map_err(|e| errors.push(e)) - else { - return (0, vec![]); - }; - - let Ok(mut read_dir) = fs::read_dir(path) - .await - .map_err(|e| errors.push(FileIOError::from((path.clone(), e)).into())) - else { - return (0, vec![]); - }; - - let root = root.as_ref(); - - // Just to make sure... - paths_buffer.clear(); - - // Marking with a loop label here in case of rejection or errors, to continue with next entry - 'entries: loop { - let entry = match read_dir.next_entry().await { - Ok(Some(entry)) => entry, - Ok(None) => break, - Err(e) => { - errors.push(FileIOError::from((path.clone(), e)).into()); - continue; - } - }; - - // Accept by children has three states, - // None if we don't now yet or if this check doesn't apply - // Some(true) if this check applies and it passes - // Some(false) if this check applies and it was rejected - // and we pass the current parent state to its children - let mut accept_by_children_dir = *parent_dir_accepted_by_its_children; - - let current_path = entry.path(); - - trace!( - "Current filesystem path: {}, accept_by_children_dir: {:#?}", - current_path.display(), - accept_by_children_dir - ); - - let Ok(rules_per_kind) = IndexerRule::apply_all(indexer_rules, ¤t_path) - .await - .map_err(|e| errors.push(e.into())) - else { - continue 'entries; - }; - - if rules_per_kind - .get(&RuleKind::RejectFilesByGlob) - .map_or(false, |reject_results| { - reject_results.iter().any(|reject| !reject) - }) { - trace!( - "Path {} rejected by `RuleKind::RejectFilesByGlob`", - current_path.display() - ); - continue 'entries; - } - - let Ok(metadata) = entry - .metadata() - .await - .map_err(|e| errors.push(FileIOError::from((¤t_path, e)).into())) - else { - continue 'entries; - }; - - // TODO: Hard ignoring symlinks for now, but this should be configurable - if metadata.is_symlink() { - continue 'entries; - } - - let is_dir = metadata.is_dir(); - - if is_dir { - // If it is a directory, first we check if we must reject it and its children entirely - if rules_per_kind - .get(&RuleKind::RejectIfChildrenDirectoriesArePresent) - .map_or(false, |reject_results| { - reject_results.iter().any(|reject| !reject) - }) { - trace!( - "Path {} rejected by rule `RuleKind::RejectIfChildrenDirectoriesArePresent`", - current_path.display(), - ); - continue 'entries; - } - - // Then we check if we must accept it and its children - if let Some(accept_by_children_rules) = - rules_per_kind.get(&RuleKind::AcceptIfChildrenDirectoriesArePresent) - { - if accept_by_children_rules.iter().any(|accept| *accept) { - accept_by_children_dir = Some(true); - } - - // If it wasn't accepted then we mark as rejected - if accept_by_children_dir.is_none() { - trace!( - "Path {} rejected because it didn't passed in any AcceptIfChildrenDirectoriesArePresent rule", - current_path.display() - ); - accept_by_children_dir = Some(false); - } - } - - // Then we mark this directory the be walked in too - if let Some(ref mut to_walk) = maybe_to_walk { - to_walk.push_back(ToWalkEntry { - path: current_path.clone(), - parent_dir_accepted_by_its_children: accept_by_children_dir, - maybe_parent: Some(path.clone()), - }); - } - } - - if rules_per_kind - .get(&RuleKind::AcceptFilesByGlob) - .map_or(false, |accept_rules| { - accept_rules.iter().all(|accept| !accept) - }) { - trace!( - "Path {} reject because it didn't passed in any AcceptFilesByGlob rules", - current_path.display() - ); - continue 'entries; - } - - if accept_by_children_dir.unwrap_or(true) { - let Ok(iso_file_path) = - iso_file_path_factory(¤t_path, is_dir).map_err(|e| errors.push(e)) - else { - continue 'entries; - }; - - let Ok(metadata) = FilePathMetadata::from_path(¤t_path, &metadata) - .map_err(|e| errors.push(e.into())) - else { - continue; - }; - - paths_buffer.insert(WalkingEntry { - iso_file_path, - maybe_metadata: Some(metadata), - }); - - // If the ancestors directories wasn't indexed before, now we do - for ancestor in current_path - .ancestors() - .skip(1) // Skip the current directory as it was already indexed - .take_while(|&ancestor| ancestor != root) - { - let Ok(iso_file_path) = - iso_file_path_factory(ancestor, true).map_err(|e| errors.push(e)) - else { - // Checking the next ancestor, as this one we got an error - continue; - }; - - let mut ancestor_iso_walking_entry = WalkingEntry { - iso_file_path, - maybe_metadata: None, - }; - trace!("Indexing ancestor {}", ancestor.display()); - if !indexed_paths.contains(&ancestor_iso_walking_entry) { - let Ok(metadata) = fs::metadata(ancestor) - .await - .map_err(|e| errors.push(FileIOError::from((&ancestor, e)).into())) - else { - // Checking the next ancestor, as this one we got an error - continue; - }; - - let Ok(metadata) = FilePathMetadata::from_path(ancestor, &metadata) - .map_err(|e| errors.push(e.into())) - else { - continue; - }; - - ancestor_iso_walking_entry.maybe_metadata = Some(metadata); - - paths_buffer.insert(ancestor_iso_walking_entry); - } else { - // If indexed_paths contains the current ancestors, then it will contain - // also all if its ancestors too, so we can stop here - break; - } - } - } - } - - // We continue the function even if we fail to fetch `file_path`s to remove, - // the DB will have old `file_path`s but at least this is better than - // don't adding the newly indexed paths - let to_remove = to_remove_db_fetcher( - iso_file_path_to_walk, - paths_buffer - .iter() - .map(|entry| &entry.iso_file_path) - .map(Into::into) - .collect(), - ) - .await - .unwrap_or_else(|e| { - errors.push(e); - vec![] - }); - - let mut to_walk_entry_size = 0; - - // Just merging the `found_paths` with `indexed_paths` here in the end to avoid possibly - // multiple rehashes during function execution - indexed_paths.extend(paths_buffer.drain().map(|walking_entry| { - if let Some(metadata) = &walking_entry.maybe_metadata { - to_walk_entry_size += metadata.size_in_bytes; - } - walking_entry - })); - - (to_walk_entry_size, to_remove) -} - -#[cfg(test)] -#[allow(clippy::unwrap_used, clippy::panic)] -mod tests { - use super::*; - use chrono::Utc; - use globset::{Glob, GlobSetBuilder}; - use sd_core_indexer_rules::RulePerKind; - use tempfile::{tempdir, TempDir}; - // use tracing_test::traced_test; - - impl PartialEq for WalkedEntry { - fn eq(&self, other: &Self) -> bool { - self.iso_file_path == other.iso_file_path - } - } - - impl Eq for WalkedEntry {} - - impl Hash for WalkedEntry { - fn hash(&self, state: &mut H) { - self.iso_file_path.hash(state); - } - } - - fn new_indexer_rule( - name: impl Into, - default: bool, - rules: Vec, - ) -> IndexerRule { - IndexerRule { - id: None, - name: name.into(), - default, - rules, - date_created: Utc::now(), - date_modified: Utc::now(), - } - } - - async fn prepare_location() -> TempDir { - let root = tempdir().unwrap(); - let root_path = root.path(); - let rust_project = root_path.join("rust_project"); - let inner_project = root_path.join("inner"); - let node_project = inner_project.join("node_project"); - let photos = root_path.join("photos"); - - fs::create_dir(&rust_project).await.unwrap(); - fs::create_dir(&inner_project).await.unwrap(); - fs::create_dir(&node_project).await.unwrap(); - fs::create_dir(&photos).await.unwrap(); - - // Making rust and node projects a git repository - fs::create_dir(rust_project.join(".git")).await.unwrap(); - fs::create_dir(node_project.join(".git")).await.unwrap(); - - // Populating rust project - fs::File::create(rust_project.join("Cargo.toml")) - .await - .unwrap(); - let rust_src_dir = rust_project.join("src"); - fs::create_dir(&rust_src_dir).await.unwrap(); - fs::File::create(rust_src_dir.join("main.rs")) - .await - .unwrap(); - let rust_target_dir = rust_project.join("target"); - fs::create_dir(&rust_target_dir).await.unwrap(); - let rust_build_dir = rust_target_dir.join("debug"); - fs::create_dir(&rust_build_dir).await.unwrap(); - fs::File::create(rust_build_dir.join("main")).await.unwrap(); - - // Populating node project - fs::File::create(node_project.join("package.json")) - .await - .unwrap(); - let node_src_dir = node_project.join("src"); - fs::create_dir(&node_src_dir).await.unwrap(); - fs::File::create(node_src_dir.join("App.tsx")) - .await - .unwrap(); - let node_modules = node_project.join("node_modules"); - fs::create_dir(&node_modules).await.unwrap(); - let node_modules_dep = node_modules.join("react"); - fs::create_dir(&node_modules_dep).await.unwrap(); - fs::File::create(node_modules_dep.join("package.json")) - .await - .unwrap(); - - // Photos directory - for photo in ["photo1.png", "photo2.jpg", "photo3.jpeg", "text.txt"].iter() { - fs::File::create(photos.join(photo)).await.unwrap(); - } - - root - } - - #[tokio::test] - async fn test_walk_without_rules() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug/main"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo1.png"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo2.jpg"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo3.jpeg"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/text.txt"), false), metadata }, - ] - .into_iter() - .collect::>(); - - let walk_result = walk( - root_path.to_path_buf(), - &[], - |_, _| {}, - |_| async { Ok(vec![]) }, - |_, _| async { Ok(vec![]) }, - |path, is_dir| { - IsolatedFilePathData::new(0, root_path, path, is_dir).map_err(Into::into) - }, - 420, - ) - .await - .unwrap(); - - if !walk_result.errors.is_empty() { - panic!("errors: {:#?}", walk_result.errors); - } - - let actual = walk_result.walked.collect::>(); - - if actual != expected { - panic!("difference: {:#?}", expected.difference(&actual)); - } - } - - #[tokio::test] - // #[traced_test] - async fn test_only_photos() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo1.png"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo2.jpg"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("photos/photo3.jpeg"), false), metadata }, - ] - .into_iter() - .collect::>(); - - let only_photos_rule = &[new_indexer_rule( - "only photos".to_string(), - false, - vec![RulePerKind::AcceptFilesByGlob( - vec![], - GlobSetBuilder::new() - .add(Glob::new("{*.png,*.jpg,*.jpeg}").unwrap()) - .build() - .unwrap(), - )], - )]; - - let walk_result = walk( - root_path.to_path_buf(), - only_photos_rule, - |_, _| {}, - |_| async { Ok(vec![]) }, - |_, _| async { Ok(vec![]) }, - |path, is_dir| { - IsolatedFilePathData::new(0, root_path, path, is_dir).map_err(Into::into) - }, - 420, - ) - .await - .unwrap(); - - if !walk_result.errors.is_empty() { - panic!("errors: {:#?}", walk_result.errors); - } - - let actual = walk_result.walked.collect::>(); - - if actual != expected { - panic!("difference: {:#?}", expected.difference(&actual)); - } - } - - #[tokio::test] - // #[traced_test] - async fn test_git_repos() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/target/debug/main"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/node_modules/react/package.json"), false), metadata }, - ] - .into_iter() - .collect::>(); - - let git_repos = &[new_indexer_rule( - "git repos".to_string(), - false, - vec![RulePerKind::AcceptIfChildrenDirectoriesArePresent( - [".git".to_string()].into_iter().collect(), - )], - )]; - - let walk_result = walk( - root_path.to_path_buf(), - git_repos, - |_, _| {}, - |_| async { Ok(vec![]) }, - |_, _| async { Ok(vec![]) }, - |path, is_dir| { - IsolatedFilePathData::new(0, root_path, path, is_dir).map_err(Into::into) - }, - 420, - ) - .await - .unwrap(); - - if !walk_result.errors.is_empty() { - panic!("errors: {:#?}", walk_result.errors); - } - - let actual = walk_result.walked.collect::>(); - - if actual != expected { - panic!("difference: {:#?}", expected.difference(&actual)); - } - } - - #[tokio::test] - // #[traced_test] - async fn git_repos_without_deps_or_build_dirs() { - let root = prepare_location().await; - let root_path = root.path(); - - let metadata = FilePathMetadata { - inode: 0, - size_in_bytes: 0, - created_at: Utc::now(), - modified_at: Utc::now(), - hidden: false, - }; - - let f = |path, is_dir| IsolatedFilePathData::new(0, root_path, path, is_dir).unwrap(); - let pub_id = Uuid::new_v4(); - let maybe_object_id = None; - - #[rustfmt::skip] - let expected = [ - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/Cargo.toml"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("rust_project/src/main.rs"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/.git"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/package.json"), false), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src"), true), metadata }, - WalkedEntry { pub_id, maybe_object_id, iso_file_path: f(root_path.join("inner/node_project/src/App.tsx"), false), metadata }, - ] - .into_iter() - .collect::>(); - - let git_repos_no_deps_no_build_dirs = &[ - new_indexer_rule( - "git repos".to_string(), - false, - vec![RulePerKind::AcceptIfChildrenDirectoriesArePresent( - [".git".to_string()].into_iter().collect(), - )], - ), - new_indexer_rule( - "reject node_modules".to_string(), - false, - vec![RulePerKind::RejectFilesByGlob( - vec![], - GlobSetBuilder::new() - .add(Glob::new("{**/node_modules/*,**/node_modules}").unwrap()) - .build() - .unwrap(), - )], - ), - new_indexer_rule( - "reject rust build dir".to_string(), - false, - vec![RulePerKind::RejectFilesByGlob( - vec![], - GlobSetBuilder::new() - .add(Glob::new("{**/target/*,**/target}").unwrap()) - .build() - .unwrap(), - )], - ), - ]; - - let walk_result = walk( - root_path.to_path_buf(), - git_repos_no_deps_no_build_dirs, - |_, _| {}, - |_| async { Ok(vec![]) }, - |_, _| async { Ok(vec![]) }, - |path, is_dir| { - IsolatedFilePathData::new(0, root_path, path, is_dir).map_err(Into::into) - }, - 420, - ) - .await - .unwrap(); - - if !walk_result.errors.is_empty() { - panic!("errors: {:#?}", walk_result.errors); - } - - let actual = walk_result.walked.collect::>(); - - if actual != expected { - panic!("difference: {:#?}", expected.difference(&actual)); - } - } -} diff --git a/core/src/location/manager/helpers.rs b/core/src/location/manager/helpers.rs deleted file mode 100644 index 095d99768..000000000 --- a/core/src/location/manager/helpers.rs +++ /dev/null @@ -1,281 +0,0 @@ -use crate::{ - library::{Library, LibraryId}, - Node, -}; - -use sd_prisma::prisma::location; -use sd_utils::db::maybe_missing; - -use std::{ - collections::{HashMap, HashSet}, - path::{Path, PathBuf}, - sync::Arc, - time::Duration, -}; - -use tokio::{fs, io::ErrorKind, sync::oneshot, time::sleep}; -use tracing::{error, warn}; -use uuid::Uuid; - -use super::{watcher::LocationWatcher, LocationManagerError}; - -type LocationAndLibraryKey = (location::id::Type, LibraryId); - -const LOCATION_CHECK_INTERVAL: Duration = Duration::from_secs(5); - -pub(super) async fn check_online( - location: &location::Data, - node: &Node, - library: &Library, -) -> Result { - let pub_id = Uuid::from_slice(&location.pub_id)?; - - let location_path = maybe_missing(&location.path, "location.path").map(Path::new)?; - - // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. - if location.instance_id == Some(library.config().await.instance_id) { - match fs::metadata(&location_path).await { - Ok(_) => { - node.locations.add_online(pub_id).await; - Ok(true) - } - Err(e) if e.kind() == ErrorKind::NotFound => { - node.locations.remove_online(&pub_id).await; - Ok(false) - } - Err(e) => { - error!("Failed to check if location is online: {:#?}", e); - Ok(false) - } - } - } else { - // In this case, we don't have a `local_path`, but this location was marked as online - node.locations.remove_online(&pub_id).await; - Err(LocationManagerError::NonLocalLocation(location.id)) - } -} - -pub(super) async fn location_check_sleep( - location_id: location::id::Type, - library: Arc, -) -> (location::id::Type, Arc) { - sleep(LOCATION_CHECK_INTERVAL).await; - (location_id, library) -} - -pub(super) fn watch_location( - location: location::Data, - library_id: LibraryId, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, -) { - let location_id = location.id; - let location_path = location.path.as_ref(); - let Some(location_path) = location_path.map(Path::new) else { - return; - }; - - if let Some(mut watcher) = locations_unwatched.remove(&(location_id, library_id)) { - if watcher.check_path(location_path) { - watcher.watch(); - } - - locations_watched.insert((location_id, library_id), watcher); - } -} - -pub(super) fn unwatch_location( - location: location::Data, - library_id: LibraryId, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, -) { - let location_id = location.id; - let location_path = location.path.as_ref(); - let Some(location_path) = location_path.map(Path::new) else { - return; - }; - - if let Some(mut watcher) = locations_watched.remove(&(location_id, library_id)) { - if watcher.check_path(location_path) { - watcher.unwatch(); - } - - locations_unwatched.insert((location_id, library_id), watcher); - } -} - -pub(super) fn drop_location( - location_id: location::id::Type, - library_id: LibraryId, - message: &str, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, -) { - warn!("{message}: ",); - if let Some(mut watcher) = locations_watched.remove(&(location_id, library_id)) { - watcher.unwatch(); - } else { - locations_unwatched.remove(&(location_id, library_id)); - } -} - -pub(super) async fn get_location( - location_id: location::id::Type, - library: &Library, -) -> Option { - library - .db - .location() - .find_unique(location::id::equals(location_id)) - .exec() - .await - .unwrap_or_else(|err| { - error!("Failed to get location data from location_id: {:#?}", err); - None - }) -} - -pub(super) async fn handle_remove_location_request( - location_id: location::id::Type, - library: Arc, - response_tx: oneshot::Sender>, - forced_unwatch: &mut HashSet, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, - to_remove: &mut HashSet, -) { - let key = (location_id, library.id); - if let Some(location) = get_location(location_id, &library).await { - // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. - if location.instance_id == Some(library.config().await.instance_id) { - unwatch_location(location, library.id, locations_watched, locations_unwatched); - locations_unwatched.remove(&key); - forced_unwatch.remove(&key); - } else { - drop_location( - location_id, - library.id, - "Dropping location from location manager, because we don't have a `local_path` anymore", - locations_watched, - locations_unwatched - ); - } - } else { - drop_location( - location_id, - library.id, - "Removing location from manager, as we failed to fetch from db", - locations_watched, - locations_unwatched, - ); - } - - // Marking location as removed, so we don't try to check it when the time comes - to_remove.insert(key); - - let _ = response_tx.send(Ok(())); // ignore errors, we handle errors on receiver -} - -pub(super) async fn handle_stop_watcher_request( - location_id: location::id::Type, - library: Arc, - response_tx: oneshot::Sender>, - forced_unwatch: &mut HashSet, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, -) { - async fn inner( - location_id: location::id::Type, - library: Arc, - forced_unwatch: &mut HashSet, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, - ) -> Result<(), LocationManagerError> { - let key = (location_id, library.id); - if !forced_unwatch.contains(&key) && locations_watched.contains_key(&key) { - get_location(location_id, &library) - .await - .ok_or_else(|| LocationManagerError::FailedToStopOrReinitWatcher { - reason: String::from("failed to fetch location from db"), - }) - .map(|location| { - unwatch_location(location, library.id, locations_watched, locations_unwatched); - forced_unwatch.insert(key); - }) - } else { - Ok(()) - } - } - - let _ = response_tx.send( - inner( - location_id, - library, - forced_unwatch, - locations_watched, - locations_unwatched, - ) - .await, - ); // ignore errors, we handle errors on receiver -} - -pub(super) async fn handle_reinit_watcher_request( - location_id: location::id::Type, - library: Arc, - response_tx: oneshot::Sender>, - forced_unwatch: &mut HashSet, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, -) { - async fn inner( - location_id: location::id::Type, - library: Arc, - forced_unwatch: &mut HashSet, - locations_watched: &mut HashMap, - locations_unwatched: &mut HashMap, - ) -> Result<(), LocationManagerError> { - let key = (location_id, library.id); - if forced_unwatch.contains(&key) && locations_unwatched.contains_key(&key) { - get_location(location_id, &library) - .await - .ok_or_else(|| LocationManagerError::FailedToStopOrReinitWatcher { - reason: String::from("failed to fetch location from db"), - }) - .map(|location| { - watch_location(location, library.id, locations_watched, locations_unwatched); - forced_unwatch.remove(&key); - }) - } else { - Ok(()) - } - } - - let _ = response_tx.send( - inner( - location_id, - library, - forced_unwatch, - locations_watched, - locations_unwatched, - ) - .await, - ); // ignore errors, we handle errors on receiver -} - -pub(super) fn handle_ignore_path_request( - location_id: location::id::Type, - library: Arc, - path: PathBuf, - ignore: bool, - response_tx: oneshot::Sender>, - locations_watched: &HashMap, -) { - let _ = response_tx.send( - if let Some(watcher) = locations_watched.get(&(location_id, library.id)) { - watcher.ignore_path(path, ignore) - } else { - Ok(()) - }, - ); // ignore errors, we handle errors on receiver -} diff --git a/core/src/location/manager/mod.rs b/core/src/location/manager/mod.rs index 93e1e69ee..ebd5fde8c 100644 --- a/core/src/location/manager/mod.rs +++ b/core/src/location/manager/mod.rs @@ -1,6 +1,5 @@ use crate::{ library::{Library, LibraryManagerEvent}, - old_job::JobManagerError, Node, }; @@ -15,94 +14,84 @@ use std::{ sync::Arc, }; +use async_channel as chan; use futures::executor::block_on; use thiserror::Error; -use tokio::sync::{ - broadcast::{self, Receiver}, - mpsc, oneshot, RwLock, +use tokio::{ + spawn, + sync::{ + broadcast::{self, Receiver}, + oneshot, RwLock, + }, }; -use tracing::{debug, error}; +use tracing::{debug, error, instrument, trace}; use uuid::Uuid; +mod runner; mod watcher; -mod helpers; - #[derive(Clone, Copy, Debug)] -#[allow(dead_code)] enum ManagementMessageAction { Add, Remove, } #[derive(Debug)] -#[allow(dead_code)] pub struct LocationManagementMessage { location_id: location::id::Type, library: Arc, action: ManagementMessageAction, - response_tx: oneshot::Sender>, + ack: oneshot::Sender>, } #[derive(Debug)] -#[allow(dead_code)] enum WatcherManagementMessageAction { - Stop, - Reinit, + Pause, + Resume, IgnoreEventsForPath { path: PathBuf, ignore: bool }, } #[derive(Debug)] -#[allow(dead_code)] pub struct WatcherManagementMessage { location_id: location::id::Type, library: Arc, action: WatcherManagementMessageAction, - response_tx: oneshot::Sender>, + ack: oneshot::Sender>, } #[derive(Error, Debug)] pub enum LocationManagerError { - #[error("Unable to send location management message to location manager actor: (error: {0})")] - ActorSendLocationError(#[from] mpsc::error::SendError), + #[error("location not found in database: ")] + LocationNotFound(location::id::Type), - #[error("Unable to send path to be ignored by watcher actor: (error: {0})")] - ActorIgnorePathError(#[from] mpsc::error::SendError), + #[error("watcher error: {0}")] + Watcher(#[from] notify::Error), - #[error("Unable to watcher management message to watcher manager actor: (error: {0})")] - ActorIgnorePathMessageError(#[from] mpsc::error::SendError), - - #[error("Unable to receive actor response: (error: {0})")] - ActorResponseError(#[from] oneshot::error::RecvError), - - #[error("Watcher error: (error: {0})")] - WatcherError(#[from] notify::Error), - - #[error("Failed to stop or reinit a watcher: {reason}")] - FailedToStopOrReinitWatcher { reason: String }, - - #[error("Missing location from database: ")] - MissingLocation(location::id::Type), - - #[error("Non local location: ")] + #[error("non local location: ")] NonLocalLocation(location::id::Type), - #[error("failed to move file '{}' for reason: {reason}", .path.display())] - MoveError { path: Box, reason: String }, + #[error("file still exists on disk after remove event received: ", .0.display())] + FileStillExistsOnDisk(Box), - #[error("Tried to update a non-existing file: ")] - UpdateNonExistingFile(PathBuf), - #[error("Database error: {0}")] + #[error("failed to move file '{}' for reason: {reason}", .path.display())] + MoveError { + path: Box, + reason: &'static str, + }, + + #[error("database error: {0}")] Database(#[from] prisma_client_rust::QueryError), - #[error("File path related error (error: {0})")] - FilePath(#[from] FilePathError), - #[error("Corrupted location pub_id on database: (error: {0})")] + #[error("corrupted location pub_id on database: {0}")] CorruptedLocationPubId(#[from] uuid::Error), - #[error("Job Manager error: (error: {0})")] - JobManager(#[from] JobManagerError), - #[error("missing-field")] + #[error("missing field: {0}")] MissingField(#[from] MissingFieldError), + #[error(transparent)] + FilePath(#[from] FilePathError), + #[error(transparent)] + IndexerRuler(#[from] sd_core_indexer_rules::Error), + #[error(transparent)] + JobSystem(#[from] sd_core_heavy_lifting::Error), #[error(transparent)] FileIO(#[from] FileIOError), } @@ -111,20 +100,18 @@ type OnlineLocations = BTreeSet>; #[must_use = "'LocationManagerActor::start' must be used to start the actor"] pub struct LocationManagerActor { - location_management_rx: mpsc::Receiver, - - watcher_management_rx: mpsc::Receiver, - - stop_rx: oneshot::Receiver<()>, + location_management_rx: chan::Receiver, + watcher_management_rx: chan::Receiver, + stop_rx: chan::Receiver<()>, } impl LocationManagerActor { pub fn start(self, node: Arc) { - tokio::spawn({ + spawn({ let node = node.clone(); let rx = node.libraries.rx.clone(); async move { - if let Err(err) = rx + if let Err(e) = rx .subscribe(|event| { let node = node.clone(); async move { @@ -138,17 +125,18 @@ impl LocationManagerActor { .await .unwrap_or_else(|e| { error!( - "Failed to get locations from database for location manager: {:#?}", - e - ); + ?e, + "Failed to get locations from database for location manager;", + ); + vec![] }) { if let Err(e) = node.locations.add(location.id, library.clone()).await { error!( - "Failed to add location to location manager: {:#?}", - e + ?e, + "Failed to add location to location manager;", ); } } @@ -164,17 +152,46 @@ impl LocationManagerActor { }) .await { - error!("Core may become unstable! LocationManager's library manager subscription aborted with error: {err:?}"); + error!( + ?e, + "Core may become unstable! LocationManager's \ + library manager subscription aborted with error;", + ); } } }); - tokio::spawn(Locations::run_locations_checker( - self.location_management_rx, - self.watcher_management_rx, - self.stop_rx, - node, - )); + spawn({ + let node = Arc::clone(&node); + let Self { + location_management_rx, + watcher_management_rx, + stop_rx, + } = self; + + async move { + while let Err(e) = spawn({ + runner::run( + location_management_rx.clone(), + watcher_management_rx.clone(), + stop_rx.clone(), + Arc::clone(&node), + ) + }) + .await + { + if e.is_panic() { + error!(?e, "Location manager panicked;"); + } else { + trace!("Location manager received shutdown signal and will exit..."); + break; + } + trace!("Restarting location manager processing task..."); + } + + debug!("Location manager gracefully shutdown"); + } + }); } } @@ -182,64 +199,62 @@ pub struct Locations { online_locations: RwLock, pub online_tx: broadcast::Sender, - location_management_tx: mpsc::Sender, + location_management_tx: chan::Sender, - watcher_management_tx: mpsc::Sender, - stop_tx: Option>, + watcher_management_tx: chan::Sender, + stop_tx: chan::Sender<()>, } impl Locations { pub fn new() -> (Self, LocationManagerActor) { - let online_tx = broadcast::channel(16).0; + let (location_management_tx, location_management_rx) = chan::bounded(128); + let (watcher_management_tx, watcher_management_rx) = chan::bounded(128); + let (stop_tx, stop_rx) = chan::bounded(1); - { - let (location_management_tx, location_management_rx) = mpsc::channel(128); - let (watcher_management_tx, watcher_management_rx) = mpsc::channel(128); - let (stop_tx, stop_rx) = oneshot::channel(); - debug!("Starting location manager actor"); + debug!("Starting location manager actor"); - ( - Self { - online_locations: Default::default(), - online_tx, - location_management_tx, - watcher_management_tx, - stop_tx: Some(stop_tx), - }, - LocationManagerActor { - location_management_rx, - watcher_management_rx, - stop_rx, - }, - ) - } + ( + Self { + online_locations: Default::default(), + online_tx: broadcast::channel(16).0, + location_management_tx, + watcher_management_tx, + stop_tx, + }, + LocationManagerActor { + location_management_rx, + watcher_management_rx, + stop_rx, + }, + ) } + #[instrument(skip(self, library), fields(library_id = %library.id), err)] #[inline] - #[allow(unused_variables)] async fn location_management_message( &self, location_id: location::id::Type, library: Arc, action: ManagementMessageAction, ) -> Result<(), LocationManagerError> { - { - let (tx, rx) = oneshot::channel(); - debug!("Sending location management message to location manager actor: {action:?}"); + let (tx, rx) = oneshot::channel(); + trace!("Sending location management message to location manager actor"); - self.location_management_tx - .send(LocationManagementMessage { - location_id, - library, - action, - response_tx: tx, - }) - .await?; + self.location_management_tx + .send(LocationManagementMessage { + location_id, + library, + action, + ack: tx, + }) + .await + .expect("Location manager actor channel closed sending new location message"); - rx.await? - } + rx.await + .expect("Ack channel closed for location management message response") } + #[instrument(skip(self, library), fields(library_id = %library.id), err)] #[inline] #[allow(unused_variables)] async fn watcher_management_message( @@ -248,22 +263,21 @@ impl Locations { library: Arc, action: WatcherManagementMessageAction, ) -> Result<(), LocationManagerError> { - { - let (tx, rx) = oneshot::channel(); + let (tx, rx) = oneshot::channel(); + trace!("Sending watcher management message to location manager actor"); - debug!("Sending watcher management message to location manager actor: {action:?}"); + self.watcher_management_tx + .send(WatcherManagementMessage { + location_id, + library, + action, + ack: tx, + }) + .await + .expect("Location manager actor channel closed sending new watcher message"); - self.watcher_management_tx - .send(WatcherManagementMessage { - location_id, - library, - action, - response_tx: tx, - }) - .await?; - - rx.await? - } + rx.await + .expect("Ack channel closed for watcher management message response") } pub async fn add( @@ -284,16 +298,16 @@ impl Locations { .await } - pub async fn stop_watcher( + pub async fn pause_watcher( &self, location_id: location::id::Type, library: Arc, ) -> Result<(), LocationManagerError> { - self.watcher_management_message(location_id, library, WatcherManagementMessageAction::Stop) + self.watcher_management_message(location_id, library, WatcherManagementMessageAction::Pause) .await } - pub async fn reinit_watcher( + pub async fn resume_watcher( &self, location_id: location::id::Type, library: Arc, @@ -301,19 +315,19 @@ impl Locations { self.watcher_management_message( location_id, library, - WatcherManagementMessageAction::Reinit, + WatcherManagementMessageAction::Resume, ) .await } - pub async fn temporary_stop( + pub async fn temporary_watcher_pause( &self, location_id: location::id::Type, library: Arc, - ) -> Result { - self.stop_watcher(location_id, library.clone()).await?; + ) -> Result, LocationManagerError> { + self.pause_watcher(location_id, library.clone()).await?; - Ok(StopWatcherGuard { + Ok(PauseWatcherGuard { location_id, library: Some(library), manager: self, @@ -324,8 +338,8 @@ impl Locations { &self, location_id: location::id::Type, library: Arc, - path: impl AsRef, - ) -> Result { + path: impl AsRef + Send, + ) -> Result, LocationManagerError> { let path = path.as_ref().to_path_buf(); self.watcher_management_message( @@ -346,217 +360,6 @@ impl Locations { }) } - async fn run_locations_checker( - mut location_management_rx: mpsc::Receiver, - mut watcher_management_rx: mpsc::Receiver, - mut stop_rx: oneshot::Receiver<()>, - node: Arc, - ) -> Result<(), LocationManagerError> { - use std::collections::{HashMap, HashSet}; - - use futures::stream::{FuturesUnordered, StreamExt}; - use tokio::select; - use tracing::warn; - - use helpers::{ - check_online, drop_location, get_location, handle_ignore_path_request, - handle_reinit_watcher_request, handle_remove_location_request, - handle_stop_watcher_request, location_check_sleep, unwatch_location, watch_location, - }; - use watcher::LocationWatcher; - - let mut to_check_futures = FuturesUnordered::new(); - let mut to_remove = HashSet::new(); - let mut locations_watched = HashMap::new(); - let mut locations_unwatched = HashMap::new(); - let mut forced_unwatch = HashSet::new(); - - loop { - select! { - // Location management messages - Some(LocationManagementMessage{ - location_id, - library, - action, - response_tx - }) = location_management_rx.recv() => { - match action { - - // To add a new location - ManagementMessageAction::Add => { - response_tx.send( - if let Some(location) = get_location(location_id, &library).await { - match check_online(&location, &node, &library).await { - Ok(is_online) => { - - LocationWatcher::new(location, library.clone(), node.clone()) - .await - .map(|mut watcher| { - if is_online { - watcher.watch(); - locations_watched.insert( - (location_id, library.id), - watcher - ); - debug!("Location {location_id} is online, watching it"); - // info!("Locations watched: {:#?}", locations_watched); - } else { - locations_unwatched.insert( - (location_id, library.id), - watcher - ); - } - - to_check_futures.push( - location_check_sleep(location_id, library) - ); - } - ) - }, - Err(e) => { - error!("Error while checking online status of location {location_id}: {e}"); - Ok(()) // TODO: Probs should be error but that will break startup when location is offline - } - } - } else { - warn!( - "Location not found in database to be watched: {}", - location_id - ); - Ok(()) // TODO: Probs should be error but that will break startup when location is offline - }).ok(); // ignore errors, we handle errors on receiver - }, - - // To remove an location - ManagementMessageAction::Remove => { - handle_remove_location_request( - location_id, - library, - response_tx, - &mut forced_unwatch, - &mut locations_watched, - &mut locations_unwatched, - &mut to_remove, - ).await; - }, - } - } - - // Watcher management messages - Some(WatcherManagementMessage{ - location_id, - library, - action, - response_tx, - }) = watcher_management_rx.recv() => { - match action { - // To stop a watcher - WatcherManagementMessageAction::Stop => { - handle_stop_watcher_request( - location_id, - library, - response_tx, - &mut forced_unwatch, - &mut locations_watched, - &mut locations_unwatched, - ).await; - }, - - // To reinit a stopped watcher - WatcherManagementMessageAction::Reinit => { - handle_reinit_watcher_request( - location_id, - library, - response_tx, - &mut forced_unwatch, - &mut locations_watched, - &mut locations_unwatched, - ).await; - }, - - // To ignore or not events for a path - WatcherManagementMessageAction::IgnoreEventsForPath { path, ignore } => { - handle_ignore_path_request( - location_id, - library, - path, - ignore, - response_tx, - &locations_watched, - ); - }, - } - } - - // Periodically checking locations - Some((location_id, library)) = to_check_futures.next() => { - let key = (location_id, library.id); - - if to_remove.contains(&key) { - // The time to check came for an already removed library, so we just ignore it - to_remove.remove(&key); - } else if let Some(location) = get_location(location_id, &library).await { - // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. - if location.instance_id == Some(library.config().await.instance_id) { - let is_online = match check_online(&location, &node, &library).await { - Ok(is_online) => is_online, - Err(e) => { - error!("Error while checking online status of location {location_id}: {e}"); - continue; - } - }; - - if is_online - && !forced_unwatch.contains(&key) - { - watch_location( - location, - library.id, - &mut locations_watched, - &mut locations_unwatched, - ); - } else { - unwatch_location( - location, - library.id, - &mut locations_watched, - &mut locations_unwatched, - ); - } - to_check_futures.push(location_check_sleep(location_id, library)); - } else { - drop_location( - location_id, - library.id, - "Dropping location from location manager, because \ - it isn't a location in the current node", - &mut locations_watched, - &mut locations_unwatched - ); - forced_unwatch.remove(&key); - } - } else { - drop_location( - location_id, - library.id, - "Removing location from manager, as we failed to fetch from db", - &mut locations_watched, - &mut locations_unwatched, - ); - forced_unwatch.remove(&key); - } - } - - _ = &mut stop_rx => { - debug!("Stopping location manager"); - break; - } - } - } - - Ok(()) - } - pub async fn is_online(&self, id: &Uuid) -> bool { let online_locations = self.online_locations.read().await; online_locations.iter().any(|v| v == id.as_bytes()) @@ -595,29 +398,28 @@ impl Locations { impl Drop for Locations { fn drop(&mut self) { - if let Some(stop_tx) = self.stop_tx.take() { - if stop_tx.send(()).is_err() { - error!("Failed to send stop signal to location manager"); - } + // SAFETY: This will never block as we only have 1 sender and this channel has 1 slot + if self.stop_tx.send_blocking(()).is_err() { + error!("Failed to send stop signal to location manager"); } } } #[must_use = "this `StopWatcherGuard` must be held for some time, so the watcher is stopped"] -pub struct StopWatcherGuard<'m> { +pub struct PauseWatcherGuard<'m> { manager: &'m Locations, location_id: location::id::Type, library: Option>, } -impl Drop for StopWatcherGuard<'_> { +impl Drop for PauseWatcherGuard<'_> { fn drop(&mut self) { // FIXME: change this Drop to async drop in the future - if let Err(e) = block_on(self.manager.reinit_watcher( + if let Err(e) = block_on(self.manager.resume_watcher( self.location_id, self.library.take().expect("library should be set"), )) { - error!("Failed to reinit watcher on stop watcher guard drop: {e}"); + error!(?e, "Failed to resume watcher on stop watcher guard drop;"); } } } @@ -641,7 +443,7 @@ impl Drop for IgnoreEventsForPathGuard<'_> { ignore: false, }, )) { - error!("Failed to un-ignore path on watcher guard drop: {e}"); + error!(?e, "Failed to un-ignore path on watcher guard drop;"); } } } diff --git a/core/src/location/manager/runner.rs b/core/src/location/manager/runner.rs new file mode 100644 index 000000000..1daa383ce --- /dev/null +++ b/core/src/location/manager/runner.rs @@ -0,0 +1,449 @@ +use crate::{ + library::{Library, LibraryId}, + Node, +}; + +use sd_core_prisma_helpers::location_ids_and_path; + +use sd_prisma::prisma::location; +use sd_utils::db::maybe_missing; + +use std::{ + collections::{HashMap, HashSet}, + io::ErrorKind, + path::PathBuf, + pin::pin, + sync::Arc, + time::Duration, +}; + +use async_channel as chan; +use futures::stream::StreamExt; +use futures_concurrency::stream::Merge; +use tokio::{ + fs, + sync::oneshot, + time::{interval, MissedTickBehavior}, +}; +use tokio_stream::wrappers::IntervalStream; +use tracing::{debug, error, instrument, trace, warn}; +use uuid::Uuid; + +use super::{ + watcher::LocationWatcher, LocationManagementMessage, LocationManagerError, + ManagementMessageAction, WatcherManagementMessage, WatcherManagementMessageAction, +}; + +type LocationIdAndLibraryId = (location::id::Type, LibraryId); + +struct Runner { + node: Arc, + locations_to_check: HashMap>, + locations_watched: HashMap, + locations_unwatched: HashMap, + forced_unwatch: HashSet, +} +impl Runner { + fn new(node: Arc) -> Self { + Self { + node, + locations_to_check: HashMap::new(), + locations_watched: HashMap::new(), + locations_unwatched: HashMap::new(), + forced_unwatch: HashSet::new(), + } + } + + async fn add_location( + &mut self, + location_id: i32, + library: Arc, + ) -> Result<(), LocationManagerError> { + if let Some(location) = get_location(location_id, &library).await? { + check_online(&location, &self.node, &library) + .await + .and_then(|is_online| { + LocationWatcher::new(location, Arc::clone(&library), Arc::clone(&self.node)) + .map(|mut watcher| { + if is_online { + trace!(%location_id, "Location is online, watching it!;"); + watcher.watch(); + self.locations_watched + .insert((location_id, library.id), watcher); + } else { + self.locations_unwatched + .insert((location_id, library.id), watcher); + } + + self.locations_to_check + .insert(location_id, Arc::clone(&library)); + }) + }) + } else { + Err(LocationManagerError::LocationNotFound(location_id)) + } + } + + async fn remove_location( + &mut self, + location_id: i32, + library: Arc, + ) -> Result<(), LocationManagerError> { + let key = (location_id, library.id); + + if let Some(location) = get_location(location_id, &library).await? { + // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. + if location.instance_id == Some(library.config().await.instance_id) { + self.unwatch_location(location, library.id); + self.locations_unwatched.remove(&key); + self.forced_unwatch.remove(&key); + } else { + self.drop_location( + location_id, + library.id, + "Dropping location from location manager, because we don't have a `local_path` anymore", + ); + } + } else { + self.drop_location( + location_id, + library.id, + "Removing location from location manager, as we failed to fetch from db", + ); + } + + // Removing location from checker + self.locations_to_check.remove(&location_id); + + Ok(()) + } + + #[instrument(skip(self, reason))] + fn drop_location( + &mut self, + location_id: location::id::Type, + library_id: LibraryId, + reason: &'static str, + ) { + warn!(%reason); + if let Some(mut watcher) = self.locations_watched.remove(&(location_id, library_id)) { + watcher.unwatch(); + } else { + self.locations_unwatched.remove(&(location_id, library_id)); + } + } + + fn watch_location( + &mut self, + location_ids_and_path::Data { + id: location_id, + path: maybe_location_path, + .. + }: location_ids_and_path::Data, + library_id: LibraryId, + ) { + if let Some(location_path) = maybe_location_path { + if let Some(mut watcher) = self.locations_unwatched.remove(&(location_id, library_id)) { + if watcher.check_path(location_path) { + watcher.watch(); + } + + self.locations_watched + .insert((location_id, library_id), watcher); + } + } + } + + fn unwatch_location( + &mut self, + location_ids_and_path::Data { + id: location_id, + path: maybe_location_path, + .. + }: location_ids_and_path::Data, + library_id: LibraryId, + ) { + if let Some(location_path) = maybe_location_path { + if let Some(mut watcher) = self.locations_watched.remove(&(location_id, library_id)) { + if watcher.check_path(location_path) { + watcher.unwatch(); + } + + self.locations_unwatched + .insert((location_id, library_id), watcher); + } + } + } + + #[instrument(skip(self, library), fields(library_id = %library.id), err)] + async fn pause_watcher( + &mut self, + location_id: location::id::Type, + library: Arc, + ) -> Result<(), LocationManagerError> { + let key = (location_id, library.id); + + if !self.forced_unwatch.contains(&key) && self.locations_watched.contains_key(&key) { + get_location(location_id, &library) + .await? + .ok_or(LocationManagerError::LocationNotFound(location_id)) + .map(|location| { + self.unwatch_location(location, library.id); + self.forced_unwatch.insert(key); + }) + } else { + Ok(()) + } + } + + #[instrument(skip(self, library), fields(library_id = %library.id), err)] + async fn resume_watcher( + &mut self, + location_id: location::id::Type, + library: Arc, + ) -> Result<(), LocationManagerError> { + let key = (location_id, library.id); + + if self.forced_unwatch.contains(&key) && self.locations_unwatched.contains_key(&key) { + get_location(location_id, &library) + .await? + .ok_or(LocationManagerError::LocationNotFound(location_id)) + .map(|location| { + self.watch_location(location, library.id); + self.forced_unwatch.remove(&key); + }) + } else { + Ok(()) + } + } + + async fn ignore_events_for_path( + &self, + location_id: location::id::Type, + library: Arc, + path: PathBuf, + ignore: bool, + ) { + if let Some(watcher) = self.locations_watched.get(&(location_id, library.id)) { + watcher.ignore_path(path, ignore).await + } + } + + async fn handle_location_management_message( + &mut self, + location_id: location::id::Type, + library: Arc, + action: ManagementMessageAction, + ack: oneshot::Sender>, + ) { + ack.send(match action { + ManagementMessageAction::Add => self.add_location(location_id, library).await, + ManagementMessageAction::Remove => self.remove_location(location_id, library).await, + }) + .expect("Ack channel closed") + } + + async fn handle_watcher_management_message( + &mut self, + location_id: location::id::Type, + library: Arc, + action: WatcherManagementMessageAction, + ack: oneshot::Sender>, + ) { + ack.send(match action { + WatcherManagementMessageAction::Pause => self.pause_watcher(location_id, library).await, + WatcherManagementMessageAction::Resume => { + self.resume_watcher(location_id, library).await + } + WatcherManagementMessageAction::IgnoreEventsForPath { path, ignore } => { + self.ignore_events_for_path(location_id, library, path, ignore) + .await; + Ok(()) + } + }) + .expect("Ack channel closed") + } + + async fn check_locations( + &mut self, + locations_to_check_buffer: &mut Vec<(location::id::Type, Arc)>, + ) -> Result<(), Vec> { + let mut errors = vec![]; + locations_to_check_buffer.clear(); + locations_to_check_buffer.extend(self.locations_to_check.drain()); + + for (location_id, library) in locations_to_check_buffer.drain(..) { + if let Err(e) = self + .check_single_location(location_id, Arc::clone(&library)) + .await + { + self.drop_location( + location_id, + library.id, + "Removing location from manager, as we failed to check if it was online", + ); + self.forced_unwatch.remove(&(location_id, library.id)); + errors.push(e); + } + } + + Ok(()) + } + + async fn check_single_location( + &mut self, + location_id: i32, + library: Arc, + ) -> Result<(), LocationManagerError> { + let key = (location_id, library.id); + + if let Some(location) = get_location(location_id, &library).await? { + // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. + if location.instance_id == Some(library.config().await.instance_id) { + if check_online(&location, &self.node, &library).await? + && !self.forced_unwatch.contains(&key) + { + self.watch_location(location, library.id); + } else { + self.unwatch_location(location, library.id); + } + + self.locations_to_check.insert(location_id, library); + } else { + self.drop_location( + location_id, + library.id, + "Dropping location from location manager, because \ + it isn't a location in the current node", + ); + self.forced_unwatch.remove(&key); + } + + Ok(()) + } else { + Err(LocationManagerError::LocationNotFound(location_id)) + } + } +} + +pub(super) async fn run( + location_management_rx: chan::Receiver, + watcher_management_rx: chan::Receiver, + stop_rx: chan::Receiver<()>, + node: Arc, +) { + enum StreamMessage { + LocationManagementMessage(LocationManagementMessage), + WatcherManagementMessage(WatcherManagementMessage), + CheckLocations, + Stop, + } + + let mut locations_to_check_buffer = vec![]; + + let mut check_locations_interval = interval(Duration::from_secs(2)); + check_locations_interval.set_missed_tick_behavior(MissedTickBehavior::Skip); + + let mut runner = Runner::new(node); + + let mut msg_stream = pin!(( + location_management_rx.map(StreamMessage::LocationManagementMessage), + watcher_management_rx.map(StreamMessage::WatcherManagementMessage), + IntervalStream::new(check_locations_interval).map(|_| StreamMessage::CheckLocations), + stop_rx.map(|()| StreamMessage::Stop), + ) + .merge()); + + while let Some(msg) = msg_stream.next().await { + match msg { + StreamMessage::LocationManagementMessage(LocationManagementMessage { + location_id, + library, + action, + ack, + }) => { + runner + .handle_location_management_message(location_id, library, action, ack) + .await + } + // Watcher management messages + StreamMessage::WatcherManagementMessage(WatcherManagementMessage { + location_id, + library, + action, + ack, + }) => { + runner + .handle_watcher_management_message(location_id, library, action, ack) + .await + } + StreamMessage::CheckLocations => { + if let Err(errors) = runner.check_locations(&mut locations_to_check_buffer).await { + warn!(?errors, "Errors while checking locations;"); + } + } + StreamMessage::Stop => { + debug!("Stopping location manager"); + break; + } + } + } +} + +#[instrument(skip(library), fields(library_id = %library.id), err)] +async fn get_location( + location_id: location::id::Type, + library: &Library, +) -> Result, LocationManagerError> { + library + .db + .location() + .find_unique(location::id::equals(location_id)) + .select(location_ids_and_path::select()) + .exec() + .await + .map_err(Into::into) +} + +#[instrument( + skip_all, + fields(%location_id, library_id = %library.id), + err, +)] +pub(super) async fn check_online( + location_ids_and_path::Data { + id: location_id, + pub_id, + instance_id, + path, + }: &location_ids_and_path::Data, + node: &Node, + library: &Library, +) -> Result { + let pub_id = Uuid::from_slice(pub_id)?; + + // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. + if *instance_id == Some(library.config().await.instance_id) { + match fs::metadata(maybe_missing(path, "location.path")?).await { + Ok(_) => { + node.locations.add_online(pub_id).await; + Ok(true) + } + Err(e) if e.kind() == ErrorKind::NotFound => { + node.locations.remove_online(&pub_id).await; + Ok(false) + } + Err(e) => { + error!( + ?e, + "Failed to check if location is online, will consider as offline;" + ); + Ok(false) + } + } + } else { + // In this case, we don't have a `local_path`, but this location was marked as online + node.locations.remove_online(&pub_id).await; + Err(LocationManagerError::NonLocalLocation(*location_id)) + } +} diff --git a/core/src/location/manager/watcher/android.rs b/core/src/location/manager/watcher/android.rs index e60d6515c..01bd8a2a1 100644 --- a/core/src/location/manager/watcher/android.rs +++ b/core/src/location/manager/watcher/android.rs @@ -12,40 +12,35 @@ use std::{ sync::Arc, }; -use async_trait::async_trait; use notify::{ event::{CreateKind, DataChange, ModifyKind, RenameMode}, Event, EventKind, }; use tokio::{fs, time::Instant}; -use tracing::{debug, error, trace}; +use tracing::{error, instrument, trace}; use super::{ utils::{create_dir, recalculate_directories_size, remove, rename, update_file}, - EventHandler, HUNDRED_MILLIS, ONE_SECOND, + HUNDRED_MILLIS, ONE_SECOND, }; #[derive(Debug)] -pub(super) struct AndroidEventHandler<'lib> { +pub(super) struct EventHandler { location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, + library: Arc, + node: Arc, last_events_eviction_check: Instant, rename_from: HashMap, recently_renamed_from: BTreeMap, files_to_update: HashMap, reincident_to_update_files: HashMap, to_recalculate_size: HashMap, + path_and_instant_buffer: Vec<(PathBuf, Instant)>, } -#[async_trait] -impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { - fn new( - location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - ) -> Self { +impl super::EventHandler for EventHandler { + fn new(location_id: location::id::Type, library: Arc, node: Arc) -> Self { Self { location_id, library, @@ -60,8 +55,19 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { } } + #[instrument( + skip_all, + fields( + location_id = %self.location_id, + library_id = %self.library.id, + waiting_rename_count = %self.recently_renamed_from.len(), + waiting_update_count = %self.files_to_update.len(), + reincident_to_update_files_count = %self.reincident_to_update_files.len(), + waiting_size_count = %self.to_recalculate_size.len(), + ), + )] async fn handle_event(&mut self, event: Event) -> Result<(), LocationManagerError> { - debug!("Received Android event: {:#?}", event); + trace!("Received Android event"); let Event { kind, mut paths, .. @@ -70,7 +76,7 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { match kind { EventKind::Create(CreateKind::File) | EventKind::Modify(ModifyKind::Data(DataChange::Any)) => { - // When we receive a create, modify data or metadata events of the abore kinds + // When we receive a create, modify data or metadata events of the above kinds // we just mark the file to be updated in a near future // each consecutive event of these kinds that we receive for the same file // we just store the path again in the map below, with a new instant @@ -101,13 +107,14 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { &fs::metadata(path) .await .map_err(|e| FileIOError::from((path, e)))?, - self.node, - self.library, + &self.node, + &self.library, ) .await?; } + EventKind::Modify(ModifyKind::Name(RenameMode::From)) => { - // Just in case we can't garantee that we receive the Rename From event before the + // Just in case we can't guarantee that we receive the Rename From event before the // Rename Both event. Just a safeguard if self.recently_renamed_from.remove(&paths[0]).is_none() { self.rename_from.insert(paths.remove(0), Instant::now()); @@ -115,23 +122,25 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { } EventKind::Modify(ModifyKind::Name(RenameMode::Both)) => { - let from_path = &paths[0]; - let to_path = &paths[1]; + let to_path = paths.remove(1); + let from_path = paths.remove(0); + + self.rename_from.remove(&from_path); - self.rename_from.remove(from_path); rename( self.location_id, - to_path, - from_path, - fs::metadata(to_path) + &to_path, + &from_path, + fs::metadata(&to_path) .await - .map_err(|e| FileIOError::from((to_path, e)))?, - self.library, + .map_err(|e| FileIOError::from((&to_path, e)))?, + &self.library, ) .await?; - self.recently_renamed_from - .insert(paths.swap_remove(0), Instant::now()); + + self.recently_renamed_from.insert(from_path, Instant::now()); } + EventKind::Remove(_) => { let path = paths.remove(0); if let Some(parent) = path.parent() { @@ -141,10 +150,11 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { } } - remove(self.location_id, &path, self.library).await?; + remove(self.location_id, &path, &self.library).await?; } - other_event_kind => { - trace!("Other Linux event that we don't handle for now: {other_event_kind:#?}"); + + _ => { + trace!("Other Android event that we don't handle for now"); } } @@ -154,11 +164,14 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { async fn tick(&mut self) { if self.last_events_eviction_check.elapsed() > HUNDRED_MILLIS { if let Err(e) = self.handle_to_update_eviction().await { - error!("Error while handling recently created or update files eviction: {e:#?}"); + error!( + ?e, + "Error while handling recently created or update files eviction;" + ); } if let Err(e) = self.handle_rename_from_eviction().await { - error!("Failed to remove file_path: {e:#?}"); + error!(?e, "Failed to remove file_path;"); } self.recently_renamed_from @@ -169,11 +182,11 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { &mut self.to_recalculate_size, &mut self.path_and_instant_buffer, self.location_id, - self.library, + &self.library, ) .await { - error!("Failed to recalculate directories size: {e:#?}"); + error!(?e, "Failed to recalculate directories size;"); } } @@ -182,9 +195,10 @@ impl<'lib> EventHandler<'lib> for AndroidEventHandler<'lib> { } } -impl AndroidEventHandler<'_> { +impl EventHandler { async fn handle_to_update_eviction(&mut self) -> Result<(), LocationManagerError> { self.path_and_instant_buffer.clear(); + let mut should_invalidate = false; for (path, created_at) in self.files_to_update.drain() { @@ -197,8 +211,11 @@ impl AndroidEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } + self.reincident_to_update_files.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + + update_file(self.location_id, &path, &self.node, &self.library).await?; + should_invalidate = true; } } @@ -221,14 +238,17 @@ impl AndroidEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } + self.files_to_update.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + + update_file(self.location_id, &path, &self.node, &self.library).await?; + should_invalidate = true; } } if should_invalidate { - invalidate_query!(self.library, "search.paths"); + invalidate_query!(&self.library, "search.paths"); } self.reincident_to_update_files @@ -249,21 +269,23 @@ impl AndroidEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; + + remove(self.location_id, &path, &self.library).await?; + should_invalidate = true; - trace!("Removed file_path due timeout: {}", path.display()); + + trace!(path = %path.display(), "Removed file_path due timeout;"); } else { self.path_and_instant_buffer.push((path, instant)); } } if should_invalidate { - invalidate_query!(self.library, "search.paths"); + invalidate_query!(&self.library, "search.paths"); } - for (path, instant) in self.path_and_instant_buffer.drain(..) { - self.rename_from.insert(path, instant); - } + self.rename_from + .extend(self.path_and_instant_buffer.drain(..)); Ok(()) } diff --git a/core/src/location/manager/watcher/ios.rs b/core/src/location/manager/watcher/ios.rs index 63f512e52..3a9c91500 100644 --- a/core/src/location/manager/watcher/ios.rs +++ b/core/src/location/manager/watcher/ios.rs @@ -15,45 +15,40 @@ use std::{ sync::Arc, }; -use async_trait::async_trait; use notify::{ event::{CreateKind, DataChange, MetadataKind, ModifyKind, RenameMode}, Event, EventKind, }; use tokio::{fs, io, time::Instant}; -use tracing::{debug, error, trace, warn}; +use tracing::{error, instrument, trace, warn}; use super::{ utils::{ create_dir, create_file, extract_inode_from_path, extract_location_path, recalculate_directories_size, remove, rename, update_file, }, - EventHandler, INode, InstantAndPath, HUNDRED_MILLIS, ONE_SECOND, + INode, InstantAndPath, HUNDRED_MILLIS, ONE_SECOND, }; #[derive(Debug)] -pub(super) struct IosEventHandler<'lib> { +pub(super) struct EventHandler { location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - files_to_update: HashMap, - reincident_to_update_files: HashMap, + library: Arc, + node: Arc, last_events_eviction_check: Instant, latest_created_dir: Option, old_paths_map: HashMap, new_paths_map: HashMap, - paths_map_buffer: Vec<(INode, InstantAndPath)>, + files_to_update: HashMap, + reincident_to_update_files: HashMap, to_recalculate_size: HashMap, + path_and_instant_buffer: Vec<(PathBuf, Instant)>, + paths_map_buffer: Vec<(INode, InstantAndPath)>, } -#[async_trait] -impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { - fn new( - location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - ) -> Self +impl super::EventHandler for EventHandler { + fn new(location_id: location::id::Type, library: Arc, node: Arc) -> Self where Self: Sized, { @@ -61,38 +56,54 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { location_id, library, node, - files_to_update: HashMap::new(), - reincident_to_update_files: HashMap::new(), last_events_eviction_check: Instant::now(), latest_created_dir: None, old_paths_map: HashMap::new(), new_paths_map: HashMap::new(), - paths_map_buffer: Vec::new(), + files_to_update: HashMap::new(), + reincident_to_update_files: HashMap::new(), to_recalculate_size: HashMap::new(), path_and_instant_buffer: Vec::new(), + paths_map_buffer: Vec::new(), } } + #[instrument( + skip_all, + fields( + location_id = %self.location_id, + library_id = %self.library.id, + latest_created_dir = ?self.latest_created_dir, + old_paths_map_count = %self.old_paths_map.len(), + new_paths_map = %self.new_paths_map.len(), + waiting_update_count = %self.files_to_update.len(), + reincident_to_update_files_count = %self.reincident_to_update_files.len(), + waiting_size_count = %self.to_recalculate_size.len(), + ), + )] async fn handle_event(&mut self, event: Event) -> Result<(), LocationManagerError> { + trace!("Received iOS event"); + let Event { kind, mut paths, .. } = event; match kind { EventKind::Create(CreateKind::Folder) => { - let path = &paths[0]; + let path = paths.remove(0); create_dir( self.location_id, - path, - &fs::metadata(path) + &path, + &fs::metadata(&path) .await - .map_err(|e| FileIOError::from((path, e)))?, - self.node, - self.library, + .map_err(|e| FileIOError::from((&path, e)))?, + &self.node, + &self.library, ) .await?; - self.latest_created_dir = Some(paths.remove(0)); + + self.latest_created_dir = Some(path); } EventKind::Create(CreateKind::File) @@ -100,12 +111,13 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { | EventKind::Modify(ModifyKind::Metadata( MetadataKind::WriteTime | MetadataKind::Extended, )) => { - // When we receive a create, modify data or metadata events of the abore kinds + // When we receive a create, modify data or metadata events of the above kinds // we just mark the file to be updated in a near future // each consecutive event of these kinds that we receive for the same file // we just store the path again in the map below, with a new instant // that effectively resets the timer for the file to be updated <- Copied from macos.rs let path = paths.remove(0); + if self.files_to_update.contains_key(&path) { if let Some(old_instant) = self.files_to_update.insert(path.clone(), Instant::now()) @@ -118,6 +130,7 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { self.files_to_update.insert(path, Instant::now()); } } + EventKind::Modify(ModifyKind::Name(RenameMode::Any)) => { self.handle_single_rename_event(paths.remove(0)).await?; } @@ -125,18 +138,22 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { // For some reason, iOS doesn't have a Delete Event, so the vent type comes up as this. // Delete Event EventKind::Modify(ModifyKind::Metadata(MetadataKind::Any)) => { - debug!("File has been deleted: {:#?}", paths); let path = paths.remove(0); + + trace!(path = %path.display(), "File has been deleted;"); + if let Some(parent) = path.parent() { if parent != Path::new("") { self.to_recalculate_size .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; //FIXME: Find out why this freezes the watcher + + remove(self.location_id, &path, &self.library).await?; //FIXME: Find out why this freezes the watcher } - other_event_kind => { - trace!("Other iOS event that we don't handle for now: {other_event_kind:#?}"); + + _ => { + trace!("Other iOS event that we don't handle for now"); } } @@ -146,16 +163,19 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { async fn tick(&mut self) { if self.last_events_eviction_check.elapsed() > HUNDRED_MILLIS { if let Err(e) = self.handle_to_update_eviction().await { - error!("Error while handling recently created or update files eviction: {e:#?}"); + error!( + ?e, + "Error while handling recently created or update files eviction;" + ); } // Cleaning out recently renamed files that are older than 100 milliseconds if let Err(e) = self.handle_rename_create_eviction().await { - error!("Failed to create file_path on iOS : {e:#?}"); + error!(?e, "Failed to create file_path on iOS;"); } if let Err(e) = self.handle_rename_remove_eviction().await { - error!("Failed to remove file_path: {e:#?}"); + error!(?e, "Failed to remove file_path;"); } if !self.to_recalculate_size.is_empty() { @@ -163,11 +183,11 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { &mut self.to_recalculate_size, &mut self.path_and_instant_buffer, self.location_id, - self.library, + &self.library, ) .await { - error!("Failed to recalculate directories size: {e:#?}"); + error!(?e, "Failed to recalculate directories size;"); } } @@ -176,7 +196,7 @@ impl<'lib> EventHandler<'lib> for IosEventHandler<'lib> { } } -impl IosEventHandler<'_> { +impl EventHandler { async fn handle_to_update_eviction(&mut self) -> Result<(), LocationManagerError> { self.path_and_instant_buffer.clear(); let mut should_invalidate = false; @@ -191,8 +211,11 @@ impl IosEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } + self.reincident_to_update_files.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + + update_file(self.location_id, &path, &self.node, &self.library).await?; + should_invalidate = true; } } @@ -215,8 +238,11 @@ impl IosEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } + self.files_to_update.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + + update_file(self.location_id, &path, &self.node, &self.library).await?; + should_invalidate = true; } } @@ -246,8 +272,14 @@ impl IosEventHandler<'_> { if metadata.is_dir() { // Don't need to dispatch a recalculate directory event as `create_dir` dispatches // a `scan_location_sub_path` function, which recalculates the size already - create_dir(self.location_id, &path, &metadata, self.node, self.library) - .await?; + create_dir( + self.location_id, + &path, + &metadata, + &self.node, + &self.library, + ) + .await?; } else { if let Some(parent) = path.parent() { if parent != Path::new("") { @@ -255,11 +287,19 @@ impl IosEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - create_file(self.location_id, &path, &metadata, self.node, self.library) - .await?; + + create_file( + self.location_id, + &path, + &metadata, + &self.node, + &self.library, + ) + .await?; } - trace!("Created file_path due timeout: {}", path.display()); + trace!(path = %path.display(), "Created file_path due timeout;"); + should_invalidate = true; } } else { @@ -289,8 +329,11 @@ impl IosEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; - trace!("Removed file_path due timeout: {}", path.display()); + + remove(self.location_id, &path, &self.library).await?; + + trace!(path = %path.display(), "Removed file_path due timeout;"); + should_invalidate = true; } else { self.paths_map_buffer.push((inode, (instant, path))); @@ -313,10 +356,10 @@ impl IosEventHandler<'_> { match fs::metadata(&path).await { Ok(meta) => { // File or directory exists, so this can be a "new path" to an actual rename/move or a creation - trace!("Path exists: {}", path.display()); + trace!(path = %path.display(), "Path exists;"); let inode = get_inode(&meta); - let location_path = extract_location_path(self.location_id, self.library).await?; + let location_path = extract_location_path(self.location_id, &self.library).await?; if !check_file_path_exists::( &IsolatedFilePathData::new( @@ -331,21 +374,22 @@ impl IosEventHandler<'_> { { if let Some((_, old_path)) = self.old_paths_map.remove(&inode) { trace!( - "Got a match new -> old: {} -> {}", - path.display(), - old_path.display() + old_path = %old_path.display(), + new_path = %path.display(), + "Got a match new -> old;", ); // We found a new path for this old path, so we can rename it - rename(self.location_id, &path, &old_path, meta, self.library).await?; + rename(self.location_id, &path, &old_path, meta, &self.library).await?; } else { - trace!("No match for new path yet: {}", path.display()); + trace!(path = %path.display(), "No match for new path yet;"); + self.new_paths_map.insert(inode, (Instant::now(), path)); } } else { warn!( - "Received rename event for a file that already exists in the database: {}", - path.display() + path = %path.display(), + "Received rename event for a file that already exists in the database;", ); } } @@ -353,23 +397,25 @@ impl IosEventHandler<'_> { // File or directory does not exist in the filesystem, if it exists in the database, // then we try pairing it with the old path from our map - trace!("Path doesn't exists: {}", path.display()); + trace!(path = %path.display(), "Path doesn't exists;"); let inode = - match extract_inode_from_path(self.location_id, &path, self.library).await { + match extract_inode_from_path(self.location_id, &path, &self.library).await { Ok(inode) => inode, + Err(LocationManagerError::FilePath(FilePathError::NotFound(_))) => { // temporary file, we can ignore it return Ok(()); } + Err(e) => return Err(e), }; if let Some((_, new_path)) = self.new_paths_map.remove(&inode) { trace!( - "Got a match old -> new: {} -> {}", - path.display(), - new_path.display() + old_path = %path.display(), + new_path = %new_path.display(), + "Got a match old -> new;", ); // We found a new path for this old path, so we can rename it @@ -380,11 +426,12 @@ impl IosEventHandler<'_> { fs::metadata(&new_path) .await .map_err(|e| FileIOError::from((&new_path, e)))?, - self.library, + &self.library, ) .await?; } else { - trace!("No match for old path yet: {}", path.display()); + trace!(path = %path.display(), "No match for old path yet;"); + // We didn't find a new path for this old path, so we store ir for later self.old_paths_map.insert(inode, (Instant::now(), path)); } diff --git a/core/src/location/manager/watcher/linux.rs b/core/src/location/manager/watcher/linux.rs index 43bf0edf3..0ec459a3c 100644 --- a/core/src/location/manager/watcher/linux.rs +++ b/core/src/location/manager/watcher/linux.rs @@ -17,40 +17,35 @@ use std::{ sync::Arc, }; -use async_trait::async_trait; use notify::{ event::{CreateKind, DataChange, ModifyKind, RenameMode}, Event, EventKind, }; use tokio::{fs, time::Instant}; -use tracing::{error, trace}; +use tracing::{error, instrument, trace}; use super::{ utils::{create_dir, recalculate_directories_size, remove, rename, update_file}, - EventHandler, HUNDRED_MILLIS, ONE_SECOND, + HUNDRED_MILLIS, ONE_SECOND, }; #[derive(Debug)] -pub(super) struct LinuxEventHandler<'lib> { +pub(super) struct EventHandler { location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, + library: Arc, + node: Arc, last_events_eviction_check: Instant, rename_from: HashMap, recently_renamed_from: BTreeMap, files_to_update: HashMap, reincident_to_update_files: HashMap, to_recalculate_size: HashMap, + path_and_instant_buffer: Vec<(PathBuf, Instant)>, } -#[async_trait] -impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { - fn new( - location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - ) -> Self { +impl super::EventHandler for EventHandler { + fn new(location_id: location::id::Type, library: Arc, node: Arc) -> Self { Self { location_id, library, @@ -65,8 +60,19 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { } } + #[instrument( + skip_all, + fields( + location_id = %self.location_id, + library_id = %self.library.id, + waiting_rename_count = %self.recently_renamed_from.len(), + waiting_update_count = %self.files_to_update.len(), + reincident_to_update_files_count = %self.reincident_to_update_files.len(), + waiting_size_count = %self.to_recalculate_size.len(), + ), + )] async fn handle_event(&mut self, event: Event) -> Result<(), LocationManagerError> { - trace!("Received Linux event: {:#?}", event); + trace!("Received Linux event"); let Event { kind, mut paths, .. @@ -81,6 +87,7 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { // we just store the path again in the map below, with a new instant // that effectively resets the timer for the file to be updated let path = paths.remove(0); + if self.files_to_update.contains_key(&path) { if let Some(old_instant) = self.files_to_update.insert(path.clone(), Instant::now()) @@ -95,22 +102,23 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { } EventKind::Create(CreateKind::Folder) => { - let path = &paths[0]; + let path = paths.remove(0); // Don't need to dispatch a recalculate directory event as `create_dir` dispatches // a `scan_location_sub_path` function, which recalculates the size already create_dir( self.location_id, - path, - &fs::metadata(path) + &path, + &fs::metadata(&path) .await - .map_err(|e| FileIOError::from((path, e)))?, - self.node, - self.library, + .map_err(|e| FileIOError::from((&path, e)))?, + &self.node, + &self.library, ) .await?; } + EventKind::Modify(ModifyKind::Name(RenameMode::From)) => { // Just in case we can't guarantee that we receive the Rename From event before the // Rename Both event. Just a safeguard @@ -120,23 +128,24 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { } EventKind::Modify(ModifyKind::Name(RenameMode::Both)) => { - let from_path = &paths[0]; - let to_path = &paths[1]; + let to_path = paths.remove(1); + let from_path = paths.remove(0); - self.rename_from.remove(from_path); + self.rename_from.remove(&from_path); rename( self.location_id, - to_path, - from_path, - fs::metadata(to_path) + &to_path, + &from_path, + fs::metadata(&to_path) .await - .map_err(|e| FileIOError::from((to_path, e)))?, - self.library, + .map_err(|e| FileIOError::from((&to_path, e)))?, + &self.library, ) .await?; - self.recently_renamed_from - .insert(paths.swap_remove(0), Instant::now()); + + self.recently_renamed_from.insert(from_path, Instant::now()); } + EventKind::Remove(_) => { let path = paths.remove(0); if let Some(parent) = path.parent() { @@ -146,10 +155,11 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { } } - remove(self.location_id, &path, self.library).await?; + remove(self.location_id, &path, &self.library).await?; } - other_event_kind => { - trace!("Other Linux event that we don't handle for now: {other_event_kind:#?}"); + + _ => { + trace!("Other Linux event that we don't handle for now"); } } @@ -159,11 +169,14 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { async fn tick(&mut self) { if self.last_events_eviction_check.elapsed() > HUNDRED_MILLIS { if let Err(e) = self.handle_to_update_eviction().await { - error!("Error while handling recently created or update files eviction: {e:#?}"); + error!( + ?e, + "Error while handling recently created or update files eviction;" + ); } if let Err(e) = self.handle_rename_from_eviction().await { - error!("Failed to remove file_path: {e:#?}"); + error!(?e, "Failed to remove file_path;"); } self.recently_renamed_from @@ -174,11 +187,11 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { &mut self.to_recalculate_size, &mut self.path_and_instant_buffer, self.location_id, - self.library, + &self.library, ) .await { - error!("Failed to recalculate directories size: {e:#?}"); + error!(?e, "Failed to recalculate directories size;"); } } @@ -187,9 +200,10 @@ impl<'lib> EventHandler<'lib> for LinuxEventHandler<'lib> { } } -impl LinuxEventHandler<'_> { +impl EventHandler { async fn handle_to_update_eviction(&mut self) -> Result<(), LocationManagerError> { self.path_and_instant_buffer.clear(); + let mut should_invalidate = false; for (path, created_at) in self.files_to_update.drain() { @@ -202,8 +216,11 @@ impl LinuxEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } + self.reincident_to_update_files.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + + update_file(self.location_id, &path, &self.node, &self.library).await?; + should_invalidate = true; } } @@ -226,8 +243,11 @@ impl LinuxEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } + self.files_to_update.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + + update_file(self.location_id, &path, &self.node, &self.library).await?; + should_invalidate = true; } } @@ -244,6 +264,7 @@ impl LinuxEventHandler<'_> { async fn handle_rename_from_eviction(&mut self) -> Result<(), LocationManagerError> { self.path_and_instant_buffer.clear(); + let mut should_invalidate = false; for (path, instant) in self.rename_from.drain() { @@ -254,9 +275,12 @@ impl LinuxEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; + + remove(self.location_id, &path, &self.library).await?; + should_invalidate = true; - trace!("Removed file_path due timeout: {}", path.display()); + + trace!(path = %path.display(), "Removed file_path due timeout;"); } else { self.path_and_instant_buffer.push((path, instant)); } @@ -266,9 +290,8 @@ impl LinuxEventHandler<'_> { invalidate_query!(self.library, "search.paths"); } - for (path, instant) in self.path_and_instant_buffer.drain(..) { - self.rename_from.insert(path, instant); - } + self.rename_from + .extend(self.path_and_instant_buffer.drain(..)); Ok(()) } diff --git a/core/src/location/manager/watcher/macos.rs b/core/src/location/manager/watcher/macos.rs index 99107e375..11486cd20 100644 --- a/core/src/location/manager/watcher/macos.rs +++ b/core/src/location/manager/watcher/macos.rs @@ -24,45 +24,40 @@ use std::{ sync::Arc, }; -use async_trait::async_trait; use notify::{ event::{CreateKind, DataChange, MetadataKind, ModifyKind, RenameMode}, Event, EventKind, }; use tokio::{fs, io, time::Instant}; -use tracing::{error, trace, warn}; +use tracing::{error, instrument, trace, warn}; use super::{ utils::{ create_dir, create_file, extract_inode_from_path, extract_location_path, recalculate_directories_size, remove, rename, update_file, }, - EventHandler, INode, InstantAndPath, HUNDRED_MILLIS, ONE_SECOND, + INode, InstantAndPath, HUNDRED_MILLIS, ONE_SECOND, }; #[derive(Debug)] -pub(super) struct MacOsEventHandler<'lib> { +pub(super) struct EventHandler { location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - files_to_update: HashMap, - reincident_to_update_files: HashMap, + library: Arc, + node: Arc, last_events_eviction_check: Instant, latest_created_dir: Option, old_paths_map: HashMap, new_paths_map: HashMap, - paths_map_buffer: Vec<(INode, InstantAndPath)>, + files_to_update: HashMap, + reincident_to_update_files: HashMap, to_recalculate_size: HashMap, + path_and_instant_buffer: Vec<(PathBuf, Instant)>, + paths_map_buffer: Vec<(INode, InstantAndPath)>, } -#[async_trait] -impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { - fn new( - location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - ) -> Self +impl super::EventHandler for EventHandler { + fn new(location_id: location::id::Type, library: Arc, node: Arc) -> Self where Self: Sized, { @@ -70,20 +65,33 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { location_id, library, node, - files_to_update: HashMap::new(), - reincident_to_update_files: HashMap::new(), last_events_eviction_check: Instant::now(), latest_created_dir: None, old_paths_map: HashMap::new(), new_paths_map: HashMap::new(), - paths_map_buffer: Vec::new(), + files_to_update: HashMap::new(), + reincident_to_update_files: HashMap::new(), to_recalculate_size: HashMap::new(), path_and_instant_buffer: Vec::new(), + paths_map_buffer: Vec::new(), } } + #[instrument( + skip_all, + fields( + location_id = %self.location_id, + library_id = %self.library.id, + latest_created_dir = ?self.latest_created_dir, + old_paths_map_count = %self.old_paths_map.len(), + new_paths_map = %self.new_paths_map.len(), + waiting_update_count = %self.files_to_update.len(), + reincident_to_update_files_count = %self.reincident_to_update_files.len(), + waiting_size_count = %self.to_recalculate_size.len(), + ), + )] async fn handle_event(&mut self, event: Event) -> Result<(), LocationManagerError> { - trace!("Received MacOS event: {:#?}", event); + trace!("Received MacOS event"); let Event { kind, mut paths, .. @@ -91,8 +99,9 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { match kind { EventKind::Create(CreateKind::Folder) => { - let path = &paths[0]; - if let Some(ref latest_created_dir) = self.latest_created_dir.take() { + let path = paths.remove(0); + + if let Some(latest_created_dir) = self.latest_created_dir.take() { if path == latest_created_dir { // NOTE: This is a MacOS specific event that happens when a folder is created // trough Finder. It creates a folder but 2 events are triggered in @@ -105,18 +114,27 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { // Don't need to dispatch a recalculate directory event as `create_dir` dispatches // a `scan_location_sub_path` function, which recalculates the size already + let metadata = match fs::metadata(&path).await { + Ok(metadata) => metadata, + Err(e) if e.kind() == io::ErrorKind::NotFound => { + // temporary file, bailing out + return Ok(()); + } + Err(e) => return Err(FileIOError::from((&path, e)).into()), + }; + create_dir( self.location_id, - path, - &fs::metadata(path) - .await - .map_err(|e| FileIOError::from((path, e)))?, - self.node, - self.library, + &path, + &metadata, + &self.node, + &self.library, ) .await?; - self.latest_created_dir = Some(paths.remove(0)); + + self.latest_created_dir = Some(path); } + EventKind::Create(CreateKind::File) | EventKind::Modify(ModifyKind::Data(DataChange::Content)) | EventKind::Modify(ModifyKind::Metadata( @@ -128,6 +146,7 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { // we just store the path again in the map below, with a new instant // that effectively resets the timer for the file to be updated let path = paths.remove(0); + if self.files_to_update.contains_key(&path) { if let Some(old_instant) = self.files_to_update.insert(path.clone(), Instant::now()) @@ -140,22 +159,24 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { self.files_to_update.insert(path, Instant::now()); } } + EventKind::Modify(ModifyKind::Name(RenameMode::Any)) => { self.handle_single_rename_event(paths.remove(0)).await?; } EventKind::Remove(_) => { let path = paths.remove(0); + if let Some(parent) = path.parent() { if parent != Path::new("") { self.to_recalculate_size .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; + remove(self.location_id, &path, &self.library).await?; } - other_event_kind => { - trace!("Other MacOS event that we don't handle for now: {other_event_kind:#?}"); + _ => { + trace!("Other MacOS event that we don't handle for now"); } } @@ -165,16 +186,19 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { async fn tick(&mut self) { if self.last_events_eviction_check.elapsed() > HUNDRED_MILLIS { if let Err(e) = self.handle_to_update_eviction().await { - error!("Error while handling recently created or update files eviction: {e:#?}"); + error!( + ?e, + "Error while handling recently created or update files eviction;" + ); } // Cleaning out recently renamed files that are older than 100 milliseconds if let Err(e) = self.handle_rename_create_eviction().await { - error!("Failed to create file_path on MacOS : {e:#?}"); + error!(?e, "Failed to create file_path on MacOS;"); } if let Err(e) = self.handle_rename_remove_eviction().await { - error!("Failed to remove file_path: {e:#?}"); + error!(?e, "Failed to remove file_path;"); } if !self.to_recalculate_size.is_empty() { @@ -182,11 +206,11 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { &mut self.to_recalculate_size, &mut self.path_and_instant_buffer, self.location_id, - self.library, + &self.library, ) .await { - error!("Failed to recalculate directories size: {e:#?}"); + error!(?e, "Failed to recalculate directories size;"); } } @@ -195,9 +219,10 @@ impl<'lib> EventHandler<'lib> for MacOsEventHandler<'lib> { } } -impl MacOsEventHandler<'_> { +impl EventHandler { async fn handle_to_update_eviction(&mut self) -> Result<(), LocationManagerError> { self.path_and_instant_buffer.clear(); + let mut should_invalidate = false; for (path, created_at) in self.files_to_update.drain() { @@ -211,7 +236,7 @@ impl MacOsEventHandler<'_> { } } self.reincident_to_update_files.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + update_file(self.location_id, &path, &self.node, &self.library).await?; should_invalidate = true; } } @@ -235,7 +260,7 @@ impl MacOsEventHandler<'_> { } } self.files_to_update.remove(&path); - update_file(self.location_id, &path, self.node, self.library).await?; + update_file(self.location_id, &path, &self.node, &self.library).await?; should_invalidate = true; } } @@ -253,20 +278,32 @@ impl MacOsEventHandler<'_> { async fn handle_rename_create_eviction(&mut self) -> Result<(), LocationManagerError> { // Just to make sure that our buffer is clean self.paths_map_buffer.clear(); + let mut should_invalidate = false; for (inode, (instant, path)) in self.new_paths_map.drain() { if instant.elapsed() > HUNDRED_MILLIS { if !self.files_to_update.contains_key(&path) { - let metadata = fs::metadata(&path) - .await - .map_err(|e| FileIOError::from((&path, e)))?; + let metadata = match fs::metadata(&path).await { + Ok(metadata) => metadata, + Err(e) if e.kind() == io::ErrorKind::NotFound => { + // temporary file, bailing out + return Ok(()); + } + Err(e) => return Err(FileIOError::from((&path, e)).into()), + }; if metadata.is_dir() { // Don't need to dispatch a recalculate directory event as `create_dir` dispatches // a `scan_location_sub_path` function, which recalculates the size already - create_dir(self.location_id, &path, &metadata, self.node, self.library) - .await?; + create_dir( + self.location_id, + &path, + &metadata, + &self.node, + &self.library, + ) + .await?; } else { if let Some(parent) = path.parent() { if parent != Path::new("") { @@ -274,11 +311,18 @@ impl MacOsEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - create_file(self.location_id, &path, &metadata, self.node, self.library) - .await?; + create_file( + self.location_id, + &path, + &metadata, + &self.node, + &self.library, + ) + .await?; } - trace!("Created file_path due timeout: {}", path.display()); + trace!(path = %path.display(), "Created file_path due timeout;"); + should_invalidate = true; } } else { @@ -298,6 +342,7 @@ impl MacOsEventHandler<'_> { async fn handle_rename_remove_eviction(&mut self) -> Result<(), LocationManagerError> { // Just to make sure that our buffer is clean self.paths_map_buffer.clear(); + let mut should_invalidate = false; for (inode, (instant, path)) in self.old_paths_map.drain() { @@ -308,8 +353,11 @@ impl MacOsEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; - trace!("Removed file_path due timeout: {}", path.display()); + + remove(self.location_id, &path, &self.library).await?; + + trace!(path = %path.display(), "Removed file_path due timeout;"); + should_invalidate = true; } else { self.paths_map_buffer.push((inode, (instant, path))); @@ -332,10 +380,10 @@ impl MacOsEventHandler<'_> { match fs::metadata(&path).await { Ok(meta) => { // File or directory exists, so this can be a "new path" to an actual rename/move or a creation - trace!("Path exists: {}", path.display()); + trace!(path = %path.display(), "Path exists;"); let inode = get_inode(&meta); - let location_path = extract_location_path(self.location_id, self.library).await?; + let location_path = extract_location_path(self.location_id, &self.library).await?; if !check_file_path_exists::( &IsolatedFilePathData::new( @@ -350,45 +398,49 @@ impl MacOsEventHandler<'_> { { if let Some((_, old_path)) = self.old_paths_map.remove(&inode) { trace!( - "Got a match new -> old: {} -> {}", - path.display(), - old_path.display() + new_path = %path.display(), + old_path = %old_path.display(), + "Got a match new -> old;", ); // We found a new path for this old path, so we can rename it - rename(self.location_id, &path, &old_path, meta, self.library).await?; + rename(self.location_id, &path, &old_path, meta, &self.library).await?; } else { - trace!("No match for new path yet: {}", path.display()); + trace!(path = %path.display(), "No match for new path yet;"); + self.new_paths_map.insert(inode, (Instant::now(), path)); } } else { warn!( - "Received rename event for a file that already exists in the database: {}", - path.display() + path = %path.display(), + "Received rename event for a file that already exists in the database;", ); } } + Err(e) if e.kind() == io::ErrorKind::NotFound => { // File or directory does not exist in the filesystem, if it exists in the database, // then we try pairing it with the old path from our map - trace!("Path doesn't exists: {}", path.display()); + trace!(path = %path.display(), "Path doesn't exists;"); let inode = - match extract_inode_from_path(self.location_id, &path, self.library).await { + match extract_inode_from_path(self.location_id, &path, &self.library).await { Ok(inode) => inode, + Err(LocationManagerError::FilePath(FilePathError::NotFound(_))) => { // temporary file, we can ignore it return Ok(()); } + Err(e) => return Err(e), }; if let Some((_, new_path)) = self.new_paths_map.remove(&inode) { trace!( - "Got a match old -> new: {} -> {}", - path.display(), - new_path.display() + old_path = %path.display(), + new_path = %new_path.display(), + "Got a match old -> new;", ); // We found a new path for this old path, so we can rename it @@ -399,15 +451,17 @@ impl MacOsEventHandler<'_> { fs::metadata(&new_path) .await .map_err(|e| FileIOError::from((&new_path, e)))?, - self.library, + &self.library, ) .await?; } else { - trace!("No match for old path yet: {}", path.display()); + trace!(path = %path.display(), "No match for old path yet;"); + // We didn't find a new path for this old path, so we store ir for later self.old_paths_map.insert(inode, (Instant::now(), path)); } } + Err(e) => return Err(FileIOError::from((path, e)).into()), } diff --git a/core/src/location/manager/watcher/mod.rs b/core/src/location/manager/watcher/mod.rs index d6d70b77f..a7950d4fd 100644 --- a/core/src/location/manager/watcher/mod.rs +++ b/core/src/location/manager/watcher/mod.rs @@ -1,25 +1,31 @@ use crate::{library::Library, Node}; -use sd_prisma::prisma::location; +use sd_core_indexer_rules::{IndexerRule, IndexerRuler}; +use sd_core_prisma_helpers::{location_ids_and_path, location_with_indexer_rules}; + +use sd_prisma::prisma::{location, PrismaClient}; use sd_utils::db::maybe_missing; use std::{ collections::HashSet, + future::Future, path::{Path, PathBuf}, + pin::pin, sync::Arc, time::Duration, }; -use async_trait::async_trait; +use async_channel as chan; +use futures::StreamExt; +use futures_concurrency::stream::Merge; use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Watcher}; use tokio::{ - runtime::Handle, - select, - sync::{mpsc, oneshot}, - task::{block_in_place, JoinHandle}, + spawn, + task::JoinHandle, time::{interval_at, Instant, MissedTickBehavior}, }; -use tracing::{debug, error, warn}; +use tokio_stream::wrappers::IntervalStream; +use tracing::{debug, error, info, instrument, trace, warn, Instrument}; use uuid::Uuid; use super::LocationManagerError; @@ -32,22 +38,22 @@ mod windows; mod utils; -use utils::check_event; +use utils::reject_event; #[cfg(target_os = "linux")] -type Handler<'lib> = linux::LinuxEventHandler<'lib>; +type Handler = linux::EventHandler; #[cfg(target_os = "macos")] -type Handler<'lib> = macos::MacOsEventHandler<'lib>; +type Handler = macos::EventHandler; #[cfg(target_os = "windows")] -type Handler<'lib> = windows::WindowsEventHandler<'lib>; +type Handler = windows::EventHandler; #[cfg(target_os = "android")] -type Handler<'lib> = android::AndroidEventHandler<'lib>; +type Handler = android::EventHandler; #[cfg(target_os = "ios")] -type Handler<'lib> = ios::IosEventHandler<'lib>; +type Handler = ios::EventHandler; pub(super) type IgnorePath = (PathBuf, bool); @@ -55,82 +61,115 @@ type INode = u64; type InstantAndPath = (Instant, PathBuf); const ONE_SECOND: Duration = Duration::from_secs(1); +const THIRTY_SECONDS: Duration = Duration::from_secs(30); const HUNDRED_MILLIS: Duration = Duration::from_millis(100); -#[async_trait] -trait EventHandler<'lib> { - fn new( - location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - ) -> Self +trait EventHandler: 'static { + fn new(location_id: location::id::Type, library: Arc, node: Arc) -> Self where Self: Sized; /// Handle a file system event. - async fn handle_event(&mut self, event: Event) -> Result<(), LocationManagerError>; + fn handle_event( + &mut self, + event: Event, + ) -> impl Future> + Send; /// As Event Handlers have some inner state, from time to time we need to call this tick method /// so the event handler can update its state. - async fn tick(&mut self); + fn tick(&mut self) -> impl Future + Send; } #[derive(Debug)] pub(super) struct LocationWatcher { - id: i32, - path: String, + location_id: location::id::Type, + location_path: PathBuf, watcher: RecommendedWatcher, - ignore_path_tx: mpsc::UnboundedSender, + ignore_path_tx: chan::Sender, handle: Option>, - stop_tx: Option>, + stop_tx: chan::Sender<()>, } impl LocationWatcher { - pub(super) async fn new( - location: location::Data, + #[instrument( + name = "location_watcher", + skip(pub_id, maybe_location_path, library, node), + fields( + library_id = %library.id, + location_path = ?maybe_location_path, + ), + )] + pub(super) fn new( + location_ids_and_path::Data { + id: location_id, + pub_id, + path: maybe_location_path, + .. + }: location_ids_and_path::Data, library: Arc, node: Arc, ) -> Result { - let (events_tx, events_rx) = mpsc::unbounded_channel(); - let (ignore_path_tx, ignore_path_rx) = mpsc::unbounded_channel(); - let (stop_tx, stop_rx) = oneshot::channel(); + let location_pub_id = Uuid::from_slice(&pub_id)?; + let location_path = maybe_missing(maybe_location_path, "location.path")?.into(); + + let (events_tx, events_rx) = chan::unbounded(); + let (ignore_path_tx, ignore_path_rx) = chan::bounded(8); + let (stop_tx, stop_rx) = chan::bounded(1); let watcher = RecommendedWatcher::new( move |result| { if !events_tx.is_closed() { - if events_tx.send(result).is_err() { - error!( - "Unable to send watcher event to location manager for location: ", - location.id - ); + // SAFETY: we are not blocking the thread as this is an unbounded channel + if events_tx.send_blocking(result).is_err() { + error!(%location_id, "Unable to send watcher event to location manager;"); } } else { - error!( - "Tried to send location file system events to a closed channel: , library: Arc, - mut events_rx: mpsc::UnboundedReceiver>, - mut ignore_path_rx: mpsc::UnboundedReceiver, - mut stop_rx: oneshot::Receiver<()>, + events_rx: chan::Receiver>, + ignore_path_rx: chan::Receiver, + stop_rx: chan::Receiver<()>, ) { - let mut event_handler = Handler::new(location_id, &library, &node); + enum StreamMessage { + NewEvent(notify::Result), + NewIgnorePath(IgnorePath), + Tick, + Stop, + } + + let mut event_handler = Handler::new(location_id, Arc::clone(&library), Arc::clone(&node)); + + let mut last_event_at = Instant::now(); + + let mut cached_indexer_ruler = None; + let mut cached_location_path = None; let mut paths_to_ignore = HashSet::new(); - let mut handler_interval = interval_at(Instant::now() + HUNDRED_MILLIS, HUNDRED_MILLIS); + let mut handler_tick_interval = + interval_at(Instant::now() + HUNDRED_MILLIS, HUNDRED_MILLIS); // In case of doubt check: https://docs.rs/tokio/latest/tokio/time/enum.MissedTickBehavior.html - handler_interval.set_missed_tick_behavior(MissedTickBehavior::Delay); - loop { - select! { - Some(event) = events_rx.recv() => { - match event { - Ok(event) => { - debug!("[Debug - handle_watch_events] Received event: {:#?}", event); - if let Err(e) = Self::handle_single_event( - location_id, - location_pub_id, - event, - &mut event_handler, - &node, - &library, - &paths_to_ignore, - ).await { - error!("Failed to handle location file system event: \ - ", - ); - } - } - Err(e) => { - error!("watch error: {:#?}", e); - } + handler_tick_interval.set_missed_tick_behavior(MissedTickBehavior::Delay); + + let mut msg_stream = pin!(( + events_rx.map(StreamMessage::NewEvent), + ignore_path_rx.map(StreamMessage::NewIgnorePath), + IntervalStream::new(handler_tick_interval).map(|_| StreamMessage::Tick), + stop_rx.map(|()| StreamMessage::Stop), + ) + .merge()); + + while let Some(msg) = msg_stream.next().await { + match msg { + StreamMessage::NewEvent(Ok(event)) => { + if let Err(e) = get_cached_indexer_ruler_and_location_path( + location_id, + &mut cached_indexer_ruler, + &mut cached_location_path, + &last_event_at, + &library.db, + ) + .await + { + error!(?e, "Failed to get indexer ruler;"); + } + + last_event_at = Instant::now(); + + if let Err(e) = Self::handle_single_event( + location_pub_id, + cached_location_path.as_deref(), + event, + &mut event_handler, + &node, + &paths_to_ignore, + cached_indexer_ruler.as_ref(), + ) + .await + { + error!(?e, "Failed to handle location file system event;"); } } - Some((path, ignore)) = ignore_path_rx.recv() => { - if ignore { + StreamMessage::NewEvent(Err(e)) => error!(?e, "Watcher error;"), + + StreamMessage::NewIgnorePath((path, should_ignore)) => { + if should_ignore { paths_to_ignore.insert(path); } else { paths_to_ignore.remove(&path); } } - _ = handler_interval.tick() => { - event_handler.tick().await; - } + StreamMessage::Tick => event_handler.tick().await, - _ = &mut stop_rx => { - debug!("Stop Location Manager event handler for location: ", location_id); - break + StreamMessage::Stop => { + debug!("Stopping Location Manager event handler for location"); + break; } } } } - async fn handle_single_event<'lib>( - location_id: location::id::Type, + #[instrument(skip_all, fields(?event, ?ignore_paths, ?location_path))] + async fn handle_single_event( location_pub_id: Uuid, + location_path: Option<&Path>, event: Event, - event_handler: &mut impl EventHandler<'lib>, - node: &'lib Node, - _library: &'lib Library, + event_handler: &mut impl EventHandler, + node: &Node, ignore_paths: &HashSet, + indexer_ruler: Option<&IndexerRuler>, ) -> Result<(), LocationManagerError> { - debug!("Event: {:#?}", event); - if !check_event(&event, ignore_paths) { + if reject_event(&event, ignore_paths, location_path, indexer_ruler).await { return Ok(()); } - // let Some(location) = find_location(library, location_id) - // .include(location_with_indexer_rules::include()) - // .exec() - // .await? - // else { - // warn!("Tried to handle event for unknown location: "); - // return Ok(()); - // }; - if !node.locations.is_online(&location_pub_id).await { - warn!("Tried to handle event for offline location: "); + warn!("Tried to handle event for offline location"); return Ok(()); } - // debug!("Handling event: {:#?}", event); - event_handler.handle_event(event).await } - pub(super) fn ignore_path( - &self, - path: PathBuf, - ignore: bool, - ) -> Result<(), LocationManagerError> { - self.ignore_path_tx.send((path, ignore)).map_err(Into::into) + #[instrument( + skip(self, path), + fields( + location_id = %self.location_id, + location_path = %self.location_path.display(), + path = %path.display(), + ), + )] + pub(super) async fn ignore_path(&self, path: PathBuf, ignore: bool) { + self.ignore_path_tx + .send((path, ignore)) + .await + .expect("Location watcher ignore path channel closed"); } pub(super) fn check_path(&self, path: impl AsRef) -> bool { - Path::new(&self.path) == path.as_ref() + self.location_path == path.as_ref() } + #[instrument( + skip(self), + fields( + location_id = %self.location_id, + location_path = %self.location_path.display(), + ), + )] pub(super) fn watch(&mut self) { - let path = &self.path; - debug!("Start watching location: (path: {path})"); + trace!("Start watching location"); if let Err(e) = self .watcher - .watch(Path::new(path), RecursiveMode::Recursive) + .watch(self.location_path.as_path(), RecursiveMode::Recursive) { - error!("Unable to watch location: (path: {path}, error: {e:#?})"); + error!(?e, "Unable to watch location;"); } else { - debug!("Now watching location: (path: {path})"); + trace!("Now watching location"); } } + #[instrument( + skip(self), + fields( + location_id = %self.location_id, + location_path = %self.location_path.display(), + ), + )] pub(super) fn unwatch(&mut self) { - let path = &self.path; - if let Err(e) = self.watcher.unwatch(Path::new(path)) { + if let Err(e) = self.watcher.unwatch(self.location_path.as_path()) { /**************************************** TODO: **************************************** * According to an unit test, this error may occur when a subdirectory is removed * * and we try to unwatch the parent directory then we have to check the implications * * of unwatch error for this case. * **************************************************************************************/ - error!("Unable to unwatch location: (path: {path}, error: {e:#?})",); + error!(?e, "Unable to unwatch location;"); } else { - debug!("Stop watching location: (path: {path})"); + trace!("Stop watching location"); } } } impl Drop for LocationWatcher { fn drop(&mut self) { - if let Some(stop_tx) = self.stop_tx.take() { - if stop_tx.send(()).is_err() { - error!( - "Failed to send stop signal to location watcher: ", - self.id - ); - } + // FIXME: change this Drop to async drop in the future + if let Some(handle) = self.handle.take() { + let stop_tx = self.stop_tx.clone(); + spawn(async move { + stop_tx + .send(()) + .await + .expect("Location watcher stop channel closed"); - // FIXME: change this Drop to async drop in the future - if let Some(handle) = self.handle.take() { - if let Err(e) = block_in_place(move || Handle::current().block_on(handle)) { - error!("Failed to join watcher task: {e:#?}") + if let Err(e) = handle.await { + error!(?e, "Failed to join watcher task;"); } - } + }); } } } +async fn get_cached_indexer_ruler_and_location_path( + location_id: location::id::Type, + cached_indexer_ruler: &mut Option, + location_path: &mut Option, + last_event_at: &Instant, + db: &PrismaClient, +) -> Result<(), LocationManagerError> { + if cached_indexer_ruler.is_none() || last_event_at.elapsed() > THIRTY_SECONDS { + if let Some(location_with_indexer_rules::Data { + path, + indexer_rules, + .. + }) = db + .location() + .find_unique(location::id::equals(location_id)) + .include(location_with_indexer_rules::include()) + .exec() + .await? + { + *cached_indexer_ruler = Some( + indexer_rules + .iter() + .map(|rule| IndexerRule::try_from(&rule.indexer_rule)) + .collect::, _>>() + .map(IndexerRuler::new)?, + ); + + *location_path = path.map(Into::into); + } + } + + Ok(()) +} + /*************************************************************************************************** * Some tests to validate our assumptions of events through different file systems * **************************************************************************************************** @@ -412,26 +520,23 @@ mod tests { expected_event: EventKind, ) { let path = path.as_ref(); - debug!( - "Expecting event: {expected_event:#?} at path: {}", - path.display() - ); + debug!(?expected_event, path = %path.display()); let mut tries = 0; loop { match events_rx.try_recv() { Ok(maybe_event) => { let event = maybe_event.expect("Failed to receive event"); - debug!("Received event: {event:#?}"); + debug!(?event, "Received event;"); // Using `ends_with` and removing root path here due to a weird edge case on CI tests at MacOS if event.paths[0].ends_with(path.iter().skip(1).collect::()) && event.kind == expected_event { - debug!("Received expected event: {expected_event:#?}"); + debug!("Received expected event"); break; } } Err(e) => { - debug!("No event yet: {e:#?}"); + debug!(?e, "No event yet;"); tries += 1; sleep(Duration::from_millis(100)).await; } @@ -451,7 +556,7 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); let file_path = root_dir.path().join("test.txt"); fs::write(&file_path, "test").await.unwrap(); @@ -475,9 +580,9 @@ mod tests { ) .await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } @@ -489,7 +594,7 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); let dir_path = root_dir.path().join("inner"); fs::create_dir(&dir_path) @@ -505,9 +610,9 @@ mod tests { #[cfg(target_os = "linux")] expect_event(events_rx, &dir_path, EventKind::Create(CreateKind::Folder)).await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } @@ -522,7 +627,7 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); let mut file = fs::OpenOptions::new() .append(true) @@ -556,9 +661,9 @@ mod tests { ) .await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } @@ -573,7 +678,7 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); let new_file_name = root_dir.path().join("test2.txt"); @@ -605,9 +710,9 @@ mod tests { ) .await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } @@ -624,7 +729,7 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); let new_dir_name = root_dir.path().join("inner2"); @@ -656,9 +761,9 @@ mod tests { ) .await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } @@ -673,7 +778,7 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); fs::remove_file(&file_path) .await @@ -696,9 +801,9 @@ mod tests { ) .await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } @@ -723,11 +828,11 @@ mod tests { watcher .watch(root_dir.path(), notify::RecursiveMode::Recursive) .expect("Failed to watch root directory"); - debug!("Now watching {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Now watching;"); debug!("First unwatching the inner directory before removing it"); if let Err(e) = watcher.unwatch(&dir_path) { - error!("Failed to unwatch inner directory: {e:#?}"); + error!(?e, "Failed to unwatch inner directory;"); } fs::remove_dir(&dir_path) @@ -751,9 +856,9 @@ mod tests { ) .await; - debug!("Unwatching root directory: {}", root_dir.path().display()); + debug!(root = %root_dir.path().display(), "Unwatching root directory;"); if let Err(e) = watcher.unwatch(root_dir.path()) { - error!("Failed to unwatch root directory: {e:#?}"); + error!(?e, "Failed to unwatch root directory;"); } } } diff --git a/core/src/location/manager/watcher/utils.rs b/core/src/location/manager/watcher/utils.rs index 0df4d10a0..a597833ba 100644 --- a/core/src/location/manager/watcher/utils.rs +++ b/core/src/location/manager/watcher/utils.rs @@ -6,15 +6,7 @@ use crate::{ indexer::reverse_update_directories_sizes, location_with_indexer_rules, manager::LocationManagerError, scan_location_sub_path, update_location_size, }, - object::{ - media::{ - media_data_extractor::{can_extract_media_data_for_image, extract_media_data}, - media_data_image_to_query_params, - old_thumbnail::get_indexed_thumbnail_path, - }, - old_file_identifier::FileMetadata, - validation::hash::file_checksum, - }, + object::validation::hash::file_checksum, Node, }; @@ -24,18 +16,32 @@ use sd_core_file_path_helper::{ loose_find_existing_file_path_params, path_is_hidden, FilePathError, FilePathMetadata, IsolatedFilePathData, MetadataExt, }; -use sd_core_prisma_helpers::file_path_with_object; +use sd_core_heavy_lifting::{ + file_identifier::FileMetadata, + media_processor::{ + exif_media_data, ffmpeg_media_data, generate_single_thumbnail, get_thumbnails_directory, + ThumbnailKind, + }, +}; +use sd_core_indexer_rules::{ + seed::{GitIgnoreRules, GITIGNORE}, + IndexerRuler, RulerDecision, +}; +use sd_core_prisma_helpers::{file_path_with_object, object_ids, CasId, ObjectPubId}; -use sd_file_ext::{extensions::ImageExtension, kind::ObjectKind}; +use sd_file_ext::{ + extensions::{AudioExtension, ImageExtension, VideoExtension}, + kind::ObjectKind, +}; use sd_prisma::{ - prisma::{file_path, location, media_data, object}, + prisma::{file_path, location, object}, prisma_sync, }; use sd_sync::OperationFactory; use sd_utils::{ db::{inode_from_db, inode_to_db, maybe_missing}, error::FileIOError, - msgpack, uuid_to_bytes, + msgpack, }; #[cfg(target_family = "unix")] @@ -54,31 +60,107 @@ use std::{ }; use chrono::{DateTime, FixedOffset, Local, Utc}; +use futures_concurrency::future::Join; use notify::Event; use tokio::{ fs, io::{self, ErrorKind}, spawn, - time::Instant, + time::{sleep, Instant}, }; -use tracing::{debug, error, trace, warn}; -use uuid::Uuid; +use tracing::{error, instrument, trace, warn}; -use super::{INode, HUNDRED_MILLIS}; +use super::{INode, HUNDRED_MILLIS, ONE_SECOND}; -pub(super) fn check_event(event: &Event, ignore_paths: &HashSet) -> bool { +pub(super) async fn reject_event( + event: &Event, + ignore_paths: &HashSet, + location_path: Option<&Path>, + indexer_ruler: Option<&IndexerRuler>, +) -> bool { // if path includes .DS_Store, .spacedrive file creation or is in the `ignore_paths` set, we ignore - !event.paths.iter().any(|p| { + if event.paths.iter().any(|p| { p.file_name() .and_then(OsStr::to_str) .map_or(false, |name| name == ".DS_Store" || name == ".spacedrive") || ignore_paths.contains(p) - }) + }) { + trace!("Rejected by ignored paths"); + return true; + } + + if let Some(indexer_ruler) = indexer_ruler { + let ruler_decisions = event + .paths + .iter() + .map(|path| async move { (path, fs::metadata(path).await) }) + .collect::>() + .join() + .await + .into_iter() + .filter_map(|(path, res)| { + res.map(|metadata| (path, metadata)) + .map_err(|e| { + if e.kind() != ErrorKind::NotFound { + error!(?e, path = %path.display(), "Failed to get metadata for path;"); + } + }) + .ok() + }) + .map(|(path, metadata)| { + let mut independent_ruler = indexer_ruler.clone(); + + async move { + let path_to_check_gitignore = if metadata.is_dir() { + Some(path.as_path()) + } else { + path.parent() + }; + + if let (Some(path_to_check_gitignore), Some(location_path)) = + (path_to_check_gitignore, location_path.as_ref()) + { + if independent_ruler.has_system(&GITIGNORE) { + if let Some(rules) = GitIgnoreRules::get_rules_if_in_git_repo( + location_path, + path_to_check_gitignore, + ) + .await + { + trace!("Found gitignore rules to follow"); + independent_ruler.extend(rules.map(Into::into)); + } + } + } + + independent_ruler.evaluate_path(path, &metadata).await + } + }) + .collect::>() + .join() + .await; + + if !ruler_decisions.is_empty() + && ruler_decisions.into_iter().all(|res| { + matches!( + res.map_err(|e| trace!(?e, "Failed to evaluate path;")) + // In case of error, we accept the path as a safe default + .unwrap_or(RulerDecision::Accept), + RulerDecision::Reject + ) + }) { + trace!("Rejected by indexer ruler"); + return true; + } + } + + false } +#[instrument(skip_all, fields(path = %path.as_ref().display()), err)] pub(super) async fn create_dir( location_id: location::id::Type, - path: impl AsRef, + path: impl AsRef + Send, metadata: &Metadata, node: &Arc, library: &Arc, @@ -87,17 +169,13 @@ pub(super) async fn create_dir( .include(location_with_indexer_rules::include()) .exec() .await? - .ok_or(LocationManagerError::MissingLocation(location_id))?; + .ok_or(LocationManagerError::LocationNotFound(location_id))?; let path = path.as_ref(); let location_path = maybe_missing(&location.path, "location.path")?; - trace!( - "Location: creating directory: {}", - location_path, - path.display() - ); + trace!(new_directory = %path.display(), "Creating directory;"); let iso_file_path = IsolatedFilePathData::new(location.id, location_path, path, true)?; @@ -105,10 +183,8 @@ pub(super) async fn create_dir( if !parent_iso_file_path.is_root() && !check_file_path_exists::(&parent_iso_file_path, &library.db).await? { - warn!( - "Watcher found a directory without parent: {}", - &iso_file_path - ); + warn!(%iso_file_path, "Watcher found a directory without parent;"); + return Ok(()); }; @@ -116,8 +192,6 @@ pub(super) async fn create_dir( .materialized_path_for_children() .expect("We're in the create dir function lol"); - debug!("Creating path: {}", iso_file_path); - create_file_path( library, iso_file_path.to_parts(), @@ -126,8 +200,24 @@ pub(super) async fn create_dir( ) .await?; - // scan the new directory - scan_location_sub_path(node, library, location, &children_materialized_path).await?; + spawn({ + let node = Arc::clone(node); + let library = Arc::clone(library); + + async move { + // Wait a bit for any files being moved into the new directory to be indexed by the watcher + sleep(ONE_SECOND).await; + + trace!(%iso_file_path, "Scanning new directory;"); + + // scan the new directory + if let Err(e) = + scan_location_sub_path(&node, &library, location, &children_materialized_path).await + { + error!(?e, "Failed to scan new directory;"); + } + } + }); invalidate_query!(library, "search.paths"); invalidate_query!(library, "search.objects"); @@ -135,9 +225,10 @@ pub(super) async fn create_dir( Ok(()) } +#[instrument(skip_all, fields(path = %path.as_ref().display()), err)] pub(super) async fn create_file( location_id: location::id::Type, - path: impl AsRef, + path: impl AsRef + Send, metadata: &Metadata, node: &Arc, library: &Arc, @@ -155,8 +246,8 @@ pub(super) async fn create_file( async fn inner_create_file( location_id: location::id::Type, - location_path: impl AsRef, - path: impl AsRef, + location_path: impl AsRef + Send, + path: impl AsRef + Send, metadata: &Metadata, node: &Arc, library @ Library { @@ -169,11 +260,7 @@ async fn inner_create_file( let path = path.as_ref(); let location_path = location_path.as_ref(); - trace!( - "Location: creating file: {}", - location_path.display(), - path.display() - ); + trace!(new_file = %path.display(), "Creating file;"); let iso_file_path = IsolatedFilePathData::new(location_id, location_path, path, false)?; let iso_file_path_parts = iso_file_path.to_parts(); @@ -193,7 +280,8 @@ async fn inner_create_file( .exec() .await? { - trace!("File already exists with that inode: {}", iso_file_path); + trace!(%iso_file_path, "File already exists with that inode;"); + return inner_update_file(location_path, &file_path, path, node, library, None).await; // If we can't find an existing file with the same inode, we check if there is a file with the same path @@ -209,10 +297,8 @@ async fn inner_create_file( .exec() .await? { - trace!( - "File already exists with that iso_file_path: {}", - iso_file_path - ); + trace!(%iso_file_path, "File already exists with that iso_file_path;"); + return inner_update_file( location_path, &file_path, @@ -228,7 +314,8 @@ async fn inner_create_file( if !parent_iso_file_path.is_root() && !check_file_path_exists::(&parent_iso_file_path, db).await? { - warn!("Watcher found a file without parent: {}", &iso_file_path); + warn!(%iso_file_path, "Watcher found a file without parent;"); + return Ok(()); }; @@ -239,17 +326,13 @@ async fn inner_create_file( fs_metadata, } = FileMetadata::new(&location_path, &iso_file_path).await?; - debug!("Creating path: {}", iso_file_path); - let created_file = create_file_path(library, iso_file_path_parts, cas_id.clone(), metadata).await?; - object::select!(object_ids { id pub_id }); - let existing_object = db .object() .find_first(vec![object::file_paths::some(vec![ - file_path::cas_id::equals(cas_id.clone()), + file_path::cas_id::equals(cas_id.clone().map(Into::into)), file_path::pub_id::not(created_file.pub_id.clone()), ])]) .select(object_ids::select()) @@ -262,16 +345,17 @@ async fn inner_create_file( } = if let Some(object) = existing_object { object } else { - let pub_id = uuid_to_bytes(Uuid::new_v4()); + let pub_id: ObjectPubId = ObjectPubId::new(); let date_created: DateTime = DateTime::::from(fs_metadata.created_or_now()).into(); let int_kind = kind as i32; + sync.write_ops( db, ( sync.shared_create( prisma_sync::object::SyncId { - pub_id: pub_id.clone(), + pub_id: pub_id.to_db(), }, [ (object::date_created::NAME, msgpack!(date_created)), @@ -280,7 +364,7 @@ async fn inner_create_file( ), db.object() .create( - pub_id.to_vec(), + pub_id.into(), vec![ object::date_created::set(Some(date_created)), object::kind::set(Some(int_kind)), @@ -312,63 +396,86 @@ async fn inner_create_file( ) .await?; - if !extension.is_empty() && matches!(kind, ObjectKind::Image | ObjectKind::Video) { + if !extension.is_empty() + && matches!( + kind, + ObjectKind::Image | ObjectKind::Video | ObjectKind::Audio + ) { // Running in a detached task as thumbnail generation can take a while and we don't want to block the watcher + if matches!(kind, ObjectKind::Image | ObjectKind::Video) { + if let Some(cas_id) = cas_id { + spawn({ + let extension = extension.clone(); + let path = path.to_path_buf(); + let thumbnails_directory = + get_thumbnails_directory(node.config.data_directory()); + let library_id = *library_id; - if let Some(cas_id) = cas_id { - spawn({ - let extension = extension.clone(); - let path = path.to_path_buf(); - let node = node.clone(); - let library_id = *library_id; - - async move { - if let Err(e) = node - .thumbnailer - .generate_single_indexed_thumbnail(&extension, cas_id, path, library_id) + async move { + if let Err(e) = generate_single_thumbnail( + &thumbnails_directory, + extension, + cas_id, + path, + ThumbnailKind::Indexed(library_id), + ) .await - { - error!("Failed to generate thumbnail in the watcher: {e:#?}"); + { + error!(?e, "Failed to generate thumbnail in the watcher;"); + } } - } - }); + }); + } } - // TODO: Currently we only extract media data for images, remove this if later - if matches!(kind, ObjectKind::Image) { - if let Ok(image_extension) = ImageExtension::from_str(&extension) { - if can_extract_media_data_for_image(&image_extension) { - if let Ok(media_data) = extract_media_data(path) - .await - .map_err(|e| error!("Failed to extract media data: {e:#?}")) - { - let (sync_params, db_params) = media_data_image_to_query_params(media_data); - - sync.write_ops( - db, - ( - sync.shared_create( - prisma_sync::media_data::SyncId { - object: prisma_sync::object::SyncId { - pub_id: object_pub_id.clone(), - }, - }, - sync_params, - ), - db.media_data().upsert( - media_data::object_id::equals(object_id), - media_data::create( - object::id::equals(object_id), - db_params.clone(), - ), - db_params, - ), - ), - ) - .await?; + match kind { + ObjectKind::Image => { + if let Ok(image_extension) = ImageExtension::from_str(&extension) { + if exif_media_data::can_extract(image_extension) { + if let Ok(Some(exif_data)) = exif_media_data::extract(path) + .await + .map_err(|e| error!(?e, "Failed to extract image media data;")) + { + exif_media_data::save( + [(exif_data, object_id, object_pub_id.into())], + db, + sync, + ) + .await?; + } } } } + + ObjectKind::Audio => { + if let Ok(audio_extension) = AudioExtension::from_str(&extension) { + if ffmpeg_media_data::can_extract_for_audio(audio_extension) { + if let Ok(ffmpeg_data) = ffmpeg_media_data::extract(path) + .await + .map_err(|e| error!(?e, "Failed to extract audio media data;")) + { + ffmpeg_media_data::save([(ffmpeg_data, object_id)], db).await?; + } + } + } + } + + ObjectKind::Video => { + if let Ok(video_extension) = VideoExtension::from_str(&extension) { + if ffmpeg_media_data::can_extract_for_video(video_extension) { + if let Ok(ffmpeg_data) = ffmpeg_media_data::extract(path) + .await + .map_err(|e| error!(?e, "Failed to extract video media data;")) + { + ffmpeg_media_data::save([(ffmpeg_data, object_id)], db).await?; + } + } + } + } + + _ => { + // Do nothing + } } } @@ -378,13 +485,14 @@ async fn inner_create_file( Ok(()) } +#[instrument(skip_all, fields(path = %path.as_ref().display()), err)] pub(super) async fn update_file( location_id: location::id::Type, - full_path: impl AsRef, + path: impl AsRef + Send, node: &Arc, library: &Arc, ) -> Result<(), LocationManagerError> { - let full_path = full_path.as_ref(); + let full_path = path.as_ref(); let metadata = match fs::metadata(full_path).await { Ok(metadata) => metadata, @@ -420,16 +528,16 @@ pub(super) async fn update_file( ) .await } - .map(|_| { + .map(|()| { invalidate_query!(library, "search.paths"); invalidate_query!(library, "search.objects"); }) } async fn inner_update_file( - location_path: impl AsRef, + location_path: impl AsRef + Send, file_path: &file_path_with_object::Data, - full_path: impl AsRef, + full_path: impl AsRef + Send, node: &Arc, library @ Library { db, sync, .. }: &Library, maybe_new_inode: Option, @@ -441,9 +549,9 @@ async fn inner_update_file( inode_from_db(&maybe_missing(file_path.inode.as_ref(), "file_path.inode")?[0..8]); trace!( - "Location: updating file: {}", - location_path.display(), - full_path.display() + location_path = %location_path.display(), + path = %full_path.display(), + "Updating file;", ); let iso_file_path = IsolatedFilePathData::try_from(file_path)?; @@ -470,7 +578,7 @@ async fn inner_update_file( }; let is_hidden = path_is_hidden(full_path, &fs_metadata); - if file_path.cas_id != cas_id { + if file_path.cas_id.as_deref() != cas_id.as_ref().map(CasId::as_str) { let (sync_params, db_params): (Vec<_>, Vec<_>) = { use file_path::*; @@ -593,7 +701,7 @@ async fn inner_update_file( .await?; } } else { - let pub_id = uuid_to_bytes(Uuid::new_v4()); + let pub_id = ObjectPubId::new(); let date_created: DateTime = DateTime::::from(fs_metadata.created_or_now()).into(); @@ -602,7 +710,7 @@ async fn inner_update_file( ( sync.shared_create( prisma_sync::object::SyncId { - pub_id: pub_id.clone(), + pub_id: pub_id.to_db(), }, [ (object::date_created::NAME, msgpack!(date_created)), @@ -610,7 +718,7 @@ async fn inner_update_file( ], ), db.object().create( - pub_id.to_vec(), + pub_id.to_db(), vec![ object::date_created::set(Some(date_created)), object::kind::set(Some(int_kind)), @@ -628,49 +736,57 @@ async fn inner_update_file( }, file_path::object::NAME, msgpack!(prisma_sync::object::SyncId { - pub_id: pub_id.clone() + pub_id: pub_id.to_db() }), ), db.file_path().update( file_path::pub_id::equals(file_path.pub_id.clone()), - vec![file_path::object::connect(object::pub_id::equals(pub_id))], + vec![file_path::object::connect(object::pub_id::equals( + pub_id.into(), + ))], ), ) .await?; } - if let Some(old_cas_id) = &file_path.cas_id { + if let Some(old_cas_id) = file_path.cas_id.as_ref().map(CasId::from) { // if this file had a thumbnail previously, we update it to match the new content - if library.thumbnail_exists(node, old_cas_id).await? { + if library.thumbnail_exists(node, &old_cas_id).await? { if let Some(ext) = file_path.extension.clone() { // Running in a detached task as thumbnail generation can take a while and we don't want to block the watcher if let Some(cas_id) = cas_id { let node = Arc::clone(node); let path = full_path.to_path_buf(); let library_id = library.id; - let old_cas_id = old_cas_id.clone(); + let old_cas_id = old_cas_id.to_owned(); + spawn(async move { + let thumbnails_directory = + get_thumbnails_directory(node.config.data_directory()); + let was_overwritten = old_cas_id == cas_id; - if let Err(e) = node - .thumbnailer - .generate_single_indexed_thumbnail( - &ext, cas_id, path, library_id, - ) - .await + if let Err(e) = generate_single_thumbnail( + &thumbnails_directory, + ext.clone(), + cas_id, + path, + ThumbnailKind::Indexed(library_id), + ) + .await { - error!("Failed to generate thumbnail in the watcher: {e:#?}"); + error!(?e, "Failed to generate thumbnail in the watcher;"); } // If only a few bytes changed, cas_id will probably remains intact // so we overwrote our previous thumbnail, so we can't remove it if !was_overwritten { // remove the old thumbnail as we're generating a new one - let thumb_path = - get_indexed_thumbnail_path(&node, &old_cas_id, library_id); + let thumb_path = ThumbnailKind::Indexed(library_id) + .compute_path(node.config.data_directory(), &old_cas_id); if let Err(e) = fs::remove_file(&thumb_path).await { error!( - "Failed to remove old thumbnail: {:#?}", - FileIOError::from((thumb_path, e)) + e = ?FileIOError::from((thumb_path, e)), + "Failed to remove old thumbnail;", ); } } @@ -680,43 +796,55 @@ async fn inner_update_file( } } - // TODO: Change this if to include ObjectKind::Video in the future - if let Some(ext) = &file_path.extension { - if let Ok(image_extension) = ImageExtension::from_str(ext) { - if can_extract_media_data_for_image(&image_extension) - && matches!(kind, ObjectKind::Image) - { - if let Ok(media_data) = extract_media_data(full_path) - .await - .map_err(|e| error!("Failed to extract media data: {e:#?}")) - { - let (sync_params, db_params) = - media_data_image_to_query_params(media_data); - - sync.write_ops( - db, - ( - sync.shared_create( - prisma_sync::media_data::SyncId { - object: prisma_sync::object::SyncId { - pub_id: object.pub_id.clone(), - }, - }, - sync_params, - ), - db.media_data().upsert( - media_data::object_id::equals(object.id), - media_data::create( - object::id::equals(object.id), - db_params.clone(), - ), - db_params, - ), - ), - ) - .await?; + if let Some(extension) = &file_path.extension { + match kind { + ObjectKind::Image => { + if let Ok(image_extension) = ImageExtension::from_str(extension) { + if exif_media_data::can_extract(image_extension) { + if let Ok(Some(exif_data)) = exif_media_data::extract(full_path) + .await + .map_err(|e| error!(?e, "Failed to extract media data;")) + { + exif_media_data::save( + [(exif_data, object.id, object.pub_id.as_slice().into())], + db, + sync, + ) + .await?; + } + } } } + + ObjectKind::Audio => { + if let Ok(audio_extension) = AudioExtension::from_str(extension) { + if ffmpeg_media_data::can_extract_for_audio(audio_extension) { + if let Ok(ffmpeg_data) = ffmpeg_media_data::extract(full_path) + .await + .map_err(|e| error!(?e, "Failed to extract media data;")) + { + ffmpeg_media_data::save([(ffmpeg_data, object.id)], db).await?; + } + } + } + } + + ObjectKind::Video => { + if let Ok(video_extension) = VideoExtension::from_str(extension) { + if ffmpeg_media_data::can_extract_for_video(video_extension) { + if let Ok(ffmpeg_data) = ffmpeg_media_data::extract(full_path) + .await + .map_err(|e| error!(?e, "Failed to extract media data;")) + { + ffmpeg_media_data::save([(ffmpeg_data, object.id)], db).await?; + } + } + } + } + + _ => { + // Do nothing + } } } } @@ -748,10 +876,15 @@ async fn inner_update_file( Ok(()) } +#[instrument( + skip_all, + fields(new_path = %new_path.as_ref().display(), old_path = %old_path.as_ref().display()), + err, +)] pub(super) async fn rename( location_id: location::id::Type, - new_path: impl AsRef, - old_path: impl AsRef, + new_path: impl AsRef + Send, + old_path: impl AsRef + Send, new_path_metadata: Metadata, library: &Library, ) -> Result<(), LocationManagerError> { @@ -766,7 +899,8 @@ pub(super) async fn rename( let new_path_materialized_str = extract_normalized_materialized_path_str(location_id, &location_path, new_path)?; - // Renaming a file could potentially be a move to another directory, so we check if our parent changed + // Renaming a file could potentially be a move to another directory, + // so we check if our parent changed if old_path_materialized_str != new_path_materialized_str && !check_file_path_exists::( &IsolatedFilePathData::new(location_id, &location_path, new_path, true)?.parent(), @@ -776,7 +910,7 @@ pub(super) async fn rename( { return Err(LocationManagerError::MoveError { path: new_path.into(), - reason: "parent directory does not exist".into(), + reason: "parent directory does not exist", }); } @@ -815,7 +949,7 @@ pub(super) async fn rename( .exec() .await?; - let len = paths.len(); + let total_paths_count = paths.len(); let (sync_params, db_params): (Vec<_>, Vec<_>) = paths .into_iter() .filter_map(|path| path.materialized_path.map(|mp| (path.id, path.pub_id, mp))) @@ -841,7 +975,7 @@ pub(super) async fn rename( sync.write_ops(db, (sync_params, db_params)).await?; - trace!("Updated {len} file_paths"); + trace!(%total_paths_count, "Updated file_paths;"); } let is_hidden = path_is_hidden(new_path, &new_path_metadata); @@ -904,12 +1038,13 @@ pub(super) async fn rename( Ok(()) } +#[instrument(skip_all, fields(path = %path.as_ref().display()), err)] pub(super) async fn remove( location_id: location::id::Type, - full_path: impl AsRef, + path: impl AsRef + Send, library: &Library, ) -> Result<(), LocationManagerError> { - let full_path = full_path.as_ref(); + let full_path = path.as_ref(); let location_path = extract_location_path(location_id, library).await?; // if it doesn't exist either way, then we don't care @@ -930,16 +1065,22 @@ pub(super) async fn remove( remove_by_file_path(location_id, full_path, &file_path, library).await } -pub(super) async fn remove_by_file_path( +async fn remove_by_file_path( location_id: location::id::Type, - path: impl AsRef, + path: impl AsRef + Send, file_path: &file_path::Data, library: &Library, ) -> Result<(), LocationManagerError> { // check file still exists on disk match fs::metadata(path.as_ref()).await { Ok(_) => { - todo!("file has changed in some way, re-identify it") + // It's possible that in the interval of time between the removal file event being + // received and we reaching this point, the file has been created again for some + // external reason, so we just error out and hope to receive this new create event + // later + return Err(LocationManagerError::FileStillExistsOnDisk( + path.as_ref().into(), + )); } Err(e) if e.kind() == ErrorKind::NotFound => { let Library { sync, db, .. } = library; @@ -985,9 +1126,10 @@ pub(super) async fn remove_by_file_path( Ok(()) } +#[instrument(skip_all, fields(path = %path.as_ref().display()), err)] pub(super) async fn extract_inode_from_path( location_id: location::id::Type, - path: impl AsRef, + path: impl AsRef + Send, library: &Library, ) -> Result { let path = path.as_ref(); @@ -995,7 +1137,7 @@ pub(super) async fn extract_inode_from_path( .select(location::select!({ path })) .exec() .await? - .ok_or(LocationManagerError::MissingLocation(location_id))?; + .ok_or(LocationManagerError::LocationNotFound(location_id))?; let location_path = maybe_missing(&location.path, "location.path")?; @@ -1020,6 +1162,7 @@ pub(super) async fn extract_inode_from_path( ) } +#[instrument(skip_all, err)] pub(super) async fn extract_location_path( location_id: location::id::Type, library: &Library, @@ -1029,12 +1172,12 @@ pub(super) async fn extract_location_path( .exec() .await? .map_or( - Err(LocationManagerError::MissingLocation(location_id)), + Err(LocationManagerError::LocationNotFound(location_id)), // NOTE: The following usage of `PathBuf` doesn't incur a new allocation so it's fine |location| Ok(maybe_missing(location.path, "location.path")?.into()), ) } - +#[instrument(skip_all, err)] pub(super) async fn recalculate_directories_size( candidates: &mut HashMap, buffer: &mut Vec<(PathBuf, Instant)>, @@ -1054,7 +1197,7 @@ pub(super) async fn recalculate_directories_size( .select(location::select!({ path })) .exec() .await? - .ok_or(LocationManagerError::MissingLocation(location_id))? + .ok_or(LocationManagerError::LocationNotFound(location_id))? .path, "location.path", )?)) @@ -1063,12 +1206,29 @@ pub(super) async fn recalculate_directories_size( if let Some(location_path) = &location_path_cache { if path != *location_path { trace!( - "Reverse calculating directory sizes starting at {} until {}", - path.display(), - location_path.display(), + start_directory = %path.display(), + end_directory = %location_path.display(), + "Reverse calculating directory sizes;", ); - reverse_update_directories_sizes(path, location_id, location_path, library) - .await?; + let mut non_critical_errors = vec![]; + reverse_update_directories_sizes( + path, + location_id, + location_path, + &library.db, + &library.sync, + &mut non_critical_errors, + ) + .await + .map_err(sd_core_heavy_lifting::Error::from)?; + + if !non_critical_errors.is_empty() { + error!( + ?non_critical_errors, + "Reverse calculating directory sizes finished errors;", + ); + } + should_invalidate = true; } else { should_update_location_size = true; diff --git a/core/src/location/manager/watcher/windows.rs b/core/src/location/manager/watcher/windows.rs index f926f76b9..a9b24c54c 100644 --- a/core/src/location/manager/watcher/windows.rs +++ b/core/src/location/manager/watcher/windows.rs @@ -20,46 +20,41 @@ use std::{ sync::Arc, }; -use async_trait::async_trait; use notify::{ event::{CreateKind, ModifyKind, RenameMode}, Event, EventKind, }; use tokio::{fs, time::Instant}; -use tracing::{error, trace}; +use tracing::{error, instrument, trace}; use super::{ utils::{ create_dir, extract_inode_from_path, recalculate_directories_size, remove, rename, update_file, }, - EventHandler, INode, InstantAndPath, HUNDRED_MILLIS, ONE_SECOND, + INode, InstantAndPath, HUNDRED_MILLIS, ONE_SECOND, }; /// Windows file system event handler #[derive(Debug)] -pub(super) struct WindowsEventHandler<'lib> { +pub(super) struct EventHandler { location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, + library: Arc, + node: Arc, last_events_eviction_check: Instant, rename_from_map: BTreeMap, rename_to_map: BTreeMap, files_to_remove: HashMap, - files_to_remove_buffer: Vec<(INode, InstantAndPath)>, files_to_update: HashMap, reincident_to_update_files: HashMap, to_recalculate_size: HashMap, + path_and_instant_buffer: Vec<(PathBuf, Instant)>, + files_to_remove_buffer: Vec<(INode, InstantAndPath)>, } -#[async_trait] -impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { - fn new( - location_id: location::id::Type, - library: &'lib Arc, - node: &'lib Arc, - ) -> Self +impl super::EventHandler for EventHandler { + fn new(location_id: location::id::Type, library: Arc, node: Arc) -> Self where Self: Sized, { @@ -71,33 +66,51 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { rename_from_map: BTreeMap::new(), rename_to_map: BTreeMap::new(), files_to_remove: HashMap::new(), - files_to_remove_buffer: Vec::new(), files_to_update: HashMap::new(), reincident_to_update_files: HashMap::new(), to_recalculate_size: HashMap::new(), path_and_instant_buffer: Vec::new(), + files_to_remove_buffer: Vec::new(), } } + #[instrument( + skip_all, + fields( + location_id = %self.location_id, + library_id = %self.library.id, + rename_from_map_count = %self.rename_from_map.len(), + rename_to_map_count = %self.rename_to_map.len(), + files_to_remove_map = %self.files_to_remove.len(), + waiting_update_count = %self.files_to_update.len(), + reincident_to_update_files_count = %self.reincident_to_update_files.len(), + waiting_size_count = %self.to_recalculate_size.len(), + ), + )] async fn handle_event(&mut self, event: Event) -> Result<(), LocationManagerError> { - trace!("Received Windows event: {:#?}", event); + trace!("Received Windows event"); + let Event { kind, mut paths, .. } = event; match kind { EventKind::Create(CreateKind::Any) => { - let inode = match get_inode_from_path(&paths[0]).await { + let path = paths.remove(0); + + let inode = match get_inode_from_path(&path).await { Ok(inode) => inode, + Err(FilePathError::FileIO(FileIOError { source, .. })) if source.raw_os_error() == Some(32) => { // This is still being manipulated by another process, so we can just ignore it for now // as we will probably receive update events later - self.files_to_update.insert(paths.remove(0), Instant::now()); + self.files_to_update.insert(path, Instant::now()); return Ok(()); } + Err(e) => { return Err(e.into()); } @@ -109,24 +122,23 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { // so we can treat if just as a file rename, like in other OSes trace!( - "Got a rename instead of remove/create: {} -> {}", - old_path.display(), - paths[0].display(), + old_path = %old_path.display(), + new_path = %path.display(), + "Got a rename instead of remove/create;", ); // We found a new path for this old path, so we can rename it instead of removing and creating it rename( self.location_id, - &paths[0], + &path, &old_path, - fs::metadata(&paths[0]) + fs::metadata(&path) .await - .map_err(|e| FileIOError::from((&paths[0], e)))?, - self.library, + .map_err(|e| FileIOError::from((&path, e)))?, + &self.library, ) .await?; } else { - let path = paths.remove(0); let metadata = fs::metadata(&path) .await .map_err(|e| FileIOError::from((&path, e)))?; @@ -134,7 +146,7 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { if metadata.is_dir() { // Don't need to dispatch a recalculate directory event as `create_dir` dispatches // a `scan_location_sub_path` function, which recalculates the size already - create_dir(self.location_id, path, &metadata, self.node, self.library) + create_dir(self.location_id, path, &metadata, &self.node, &self.library) .await?; } else if self.files_to_update.contains_key(&path) { if let Some(old_instant) = @@ -149,8 +161,10 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { } } } + EventKind::Modify(ModifyKind::Any) => { let path = paths.remove(0); + if self.files_to_update.contains_key(&path) { if let Some(old_instant) = self.files_to_update.insert(path.clone(), Instant::now()) @@ -163,10 +177,11 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { self.files_to_update.insert(path, Instant::now()); } } + EventKind::Modify(ModifyKind::Name(RenameMode::From)) => { let path = paths.remove(0); - let inode = extract_inode_from_path(self.location_id, &path, self.library).await?; + let inode = extract_inode_from_path(self.location_id, &path, &self.library).await?; if let Some((_, new_path)) = self.rename_to_map.remove(&inode) { // We found a new path for this old path, so we can rename it @@ -177,13 +192,14 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { fs::metadata(&new_path) .await .map_err(|e| FileIOError::from((&new_path, e)))?, - self.library, + &self.library, ) .await?; } else { self.rename_from_map.insert(inode, (Instant::now(), path)); } } + EventKind::Modify(ModifyKind::Name(RenameMode::To)) => { let path = paths.remove(0); @@ -198,23 +214,25 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { fs::metadata(&path) .await .map_err(|e| FileIOError::from((&path, e)))?, - self.library, + &self.library, ) .await?; } else { self.rename_to_map.insert(inode, (Instant::now(), path)); } } + EventKind::Remove(_) => { let path = paths.remove(0); + self.files_to_remove.insert( - extract_inode_from_path(self.location_id, &path, self.library).await?, + extract_inode_from_path(self.location_id, &path, &self.library).await?, (Instant::now(), path), ); } - other_event_kind => { - trace!("Other Windows event that we don't handle for now: {other_event_kind:#?}"); + _ => { + trace!("Other Windows event that we don't handle for now"); } } @@ -224,26 +242,34 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { async fn tick(&mut self) { if self.last_events_eviction_check.elapsed() > HUNDRED_MILLIS { if let Err(e) = self.handle_to_update_eviction().await { - error!("Error while handling recently created or update files eviction: {e:#?}"); + error!( + ?e, + "Error while handling recently created or update files eviction;" + ); } self.rename_from_map.retain(|_, (created_at, path)| { let to_retain = created_at.elapsed() < HUNDRED_MILLIS; + if !to_retain { - trace!("Removing from rename from map: {:#?}", path.display()) + trace!(path = %path.display(), "Removing from rename from map;") } + to_retain }); + self.rename_to_map.retain(|_, (created_at, path)| { let to_retain = created_at.elapsed() < HUNDRED_MILLIS; + if !to_retain { - trace!("Removing from rename to map: {:#?}", path.display()) + trace!(path = %path.display(), "Removing from rename to map;") } + to_retain }); if let Err(e) = self.handle_removes_eviction().await { - error!("Failed to remove file_path: {e:#?}"); + error!(?e, "Failed to remove file_path;"); } if !self.to_recalculate_size.is_empty() { @@ -251,11 +277,11 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { &mut self.to_recalculate_size, &mut self.path_and_instant_buffer, self.location_id, - self.library, + &self.library, ) .await { - error!("Failed to recalculate directories size: {e:#?}"); + error!(?e, "Failed to recalculate directories size;"); } } @@ -264,9 +290,10 @@ impl<'lib> EventHandler<'lib> for WindowsEventHandler<'lib> { } } -impl WindowsEventHandler<'_> { +impl EventHandler { async fn handle_to_update_eviction(&mut self) -> Result<(), LocationManagerError> { self.path_and_instant_buffer.clear(); + let mut should_invalidate = false; for (path, created_at) in self.files_to_update.drain() { @@ -274,14 +301,16 @@ impl WindowsEventHandler<'_> { self.path_and_instant_buffer.push((path, created_at)); } else { self.reincident_to_update_files.remove(&path); + handle_update( self.location_id, &path, - self.node, + &self.node, &mut self.to_recalculate_size, - self.library, + &self.library, ) .await?; + should_invalidate = true; } } @@ -299,14 +328,16 @@ impl WindowsEventHandler<'_> { self.path_and_instant_buffer.push((path, created_at)); } else { self.files_to_update.remove(&path); + handle_update( self.location_id, &path, - self.node, + &self.node, &mut self.to_recalculate_size, - self.library, + &self.library, ) .await?; + should_invalidate = true; } } @@ -323,6 +354,7 @@ impl WindowsEventHandler<'_> { async fn handle_removes_eviction(&mut self) -> Result<(), LocationManagerError> { self.files_to_remove_buffer.clear(); + let mut should_invalidate = false; for (inode, (instant, path)) in self.files_to_remove.drain() { @@ -333,9 +365,12 @@ impl WindowsEventHandler<'_> { .insert(parent.to_path_buf(), Instant::now()); } } - remove(self.location_id, &path, self.library).await?; + + remove(self.location_id, &path, &self.library).await?; + should_invalidate = true; - trace!("Removed file_path due timeout: {}", path.display()); + + trace!(path = %path.display(), "Removed file_path due timeout;"); } else { self.files_to_remove_buffer.push((inode, (instant, path))); } @@ -344,30 +379,31 @@ impl WindowsEventHandler<'_> { invalidate_query!(self.library, "search.paths"); } - for (key, value) in self.files_to_remove_buffer.drain(..) { - self.files_to_remove.insert(key, value); - } + self.files_to_remove + .extend(self.files_to_remove_buffer.drain(..)); Ok(()) } } -async fn handle_update<'lib>( +async fn handle_update( location_id: location::id::Type, path: &PathBuf, - node: &'lib Arc, + node: &Arc, to_recalculate_size: &mut HashMap, - library: &'lib Arc, + library: &Arc, ) -> Result<(), LocationManagerError> { let metadata = fs::metadata(&path) .await .map_err(|e| FileIOError::from((&path, e)))?; + if metadata.is_file() { if let Some(parent) = path.parent() { if parent != Path::new("") { to_recalculate_size.insert(parent.to_path_buf(), Instant::now()); } } + update_file(location_id, path, node, library).await?; } diff --git a/core/src/location/metadata.rs b/core/src/location/metadata.rs index 7a8ffade5..ecbfabe42 100644 --- a/core/src/location/metadata.rs +++ b/core/src/location/metadata.rs @@ -56,10 +56,12 @@ impl SpacedriveLocationMetadataFile { #[cfg(debug_assertions)] { error!( + metadata_file_name = %metadata_file_name.display(), + ?e, "Failed to deserialize corrupted metadata file, \ - we will remove it and create a new one; File: {}; Error: {e}", - metadata_file_name.display() + we will remove it and create a new one;", ); + fs::remove_file(&metadata_file_name).await.map_err(|e| { LocationMetadataError::Delete( e, diff --git a/core/src/location/mod.rs b/core/src/location/mod.rs index f99418ce9..d613aca4e 100644 --- a/core/src/location/mod.rs +++ b/core/src/location/mod.rs @@ -1,20 +1,17 @@ -use crate::{ - invalidate_query, - library::Library, - object::{ - media::{old_media_processor, OldMediaProcessorJobInit}, - old_file_identifier::{self, old_file_identifier_job::OldFileIdentifierJobInit}, - }, - old_job::{JobBuilder, JobError, JobManagerError}, - Node, -}; +use crate::{context::NodeContext, invalidate_query, library::Library, Node}; use sd_core_file_path_helper::{ filter_existing_file_path_params, IsolatedFilePathData, IsolatedFilePathDataParts, }; -use sd_core_prisma_helpers::location_with_indexer_rules; +use sd_core_heavy_lifting::{ + file_identifier::{self, FileIdentifier}, + indexer::{self, job::Indexer}, + job_system::report::ReportInputMetadata, + media_processor::{self, job::MediaProcessor}, + JobEnqueuer, JobId, +}; +use sd_core_prisma_helpers::{location_with_indexer_rules, CasId}; -use sd_indexer::path::normalize_path; use sd_prisma::{ prisma::{file_path, indexer_rules_in_location, location, PrismaClient}, prisma_sync, @@ -28,27 +25,26 @@ use sd_utils::{ use std::{ collections::HashSet, - path::{Path, PathBuf}, + path::{Component, Path, PathBuf}, sync::Arc, }; use chrono::Utc; use futures::future::TryFutureExt; +use normpath::PathExt; use prisma_client_rust::{operator::and, or, QueryError}; use serde::{Deserialize, Serialize}; -use serde_json::json; use specta::Type; use tokio::{fs, io, time::Instant}; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info, instrument, warn}; use uuid::Uuid; mod error; -pub mod indexer; mod manager; pub mod metadata; +pub mod non_indexed; pub use error::LocationError; -use indexer::OldIndexerJobInit; pub use manager::{LocationManagerError, Locations}; use metadata::SpacedriveLocationMetadataFile; @@ -80,7 +76,7 @@ impl TryFrom for ScanState { /// `LocationCreateArgs` is the argument received from the client using `rspc` to create a new location. /// It has the actual path and a vector of indexer rules ids, to create many-to-many relationships /// between the location and indexer rules. -#[derive(Type, Deserialize)] +#[derive(Debug, Type, Deserialize)] pub struct LocationCreateArgs { pub path: PathBuf, pub dry_run: bool, @@ -88,6 +84,7 @@ pub struct LocationCreateArgs { } impl LocationCreateArgs { + #[instrument(skip(node, library), err)] pub async fn create( self, node: &Node, @@ -158,13 +155,12 @@ impl LocationCreateArgs { } debug!( - "{} new location for '{}'", + "{} new location", if self.dry_run { "Dry run: Would create" } else { "Trying to create" - }, - self.path.display() + } ); let uuid = Uuid::new_v4(); @@ -179,8 +175,10 @@ impl LocationCreateArgs { .await?; if let Some(location) = location { + info!(location_name = ?location.name, "Created location;"); + // Write location metadata to a .spacedrive file - if let Err(err) = SpacedriveLocationMetadataFile::create_and_save( + if let Err(e) = SpacedriveLocationMetadataFile::create_and_save( library.id, uuid, &self.path, @@ -196,19 +194,18 @@ impl LocationCreateArgs { .await { // DISABLED TO FAIL SILENTLY - HOTFIX FOR LACK OF WRITE PERMISSION PREVENTING LOCATION CREATION - error!("Failed to write .spacedrive file: {:?}", err); + error!(?e, "Failed to write .spacedrive file;"); // delete_location(node, library, location.data.id).await?; - // Err(err)?; + // Err(e)?; } - info!("Created location: {:?}", &location.data); - Ok(Some(location.data)) } else { Ok(None) } } + #[instrument(skip(node, library), fields(library_id = %library.id), err)] pub async fn add_library( self, node: &Node, @@ -241,14 +238,12 @@ impl LocationCreateArgs { } debug!( - "{} a new Library to an already existing location '{}'", + "{} a new Library to an already existing location", if self.dry_run { "Dry run: Would add" } else { "Trying to add" }, - library.id, - self.path.display() ); let uuid = Uuid::new_v4(); @@ -271,10 +266,7 @@ impl LocationCreateArgs { .add(location.data.id, library.clone()) .await?; - info!( - "Added library (library_id = {}) to location: {:?}", - library.id, &location.data - ); + info!(location_id = %location.data.id, "Added library to location;"); Ok(Some(location.data)) } else { @@ -460,151 +452,192 @@ async fn link_location_and_indexer_rules( Ok(()) } +#[instrument( + skip(node, library, location), + fields(library_id = %library.id, location_id = %location.id), + err, +)] pub async fn scan_location( node: &Arc, library: &Arc, location: location_with_indexer_rules::Data, location_scan_state: ScanState, -) -> Result<(), JobManagerError> { +) -> Result, sd_core_heavy_lifting::Error> { // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. if location.instance_id != Some(library.config().await.instance_id) { - return Ok(()); + warn!("Tried to scan a location on a different instance"); + return Ok(None); } + let location_id = location.id; + let ctx = NodeContext { + node: Arc::clone(node), + library: Arc::clone(library), + }; + let location_base_data = location::Data::from(&location); - debug!("Scanning location with state: {location_scan_state:?}"); + debug!("Scanning location"); - match location_scan_state { + let job_id = match location_scan_state { ScanState::Pending | ScanState::Completed => { - JobBuilder::new(OldIndexerJobInit { - location, - sub_path: None, - }) - .with_action("scan_location") - .with_metadata(json!({"location": location_base_data.clone()})) - .build() - .queue_next(OldFileIdentifierJobInit { - location: location_base_data.clone(), - sub_path: None, - }) - .queue_next(OldMediaProcessorJobInit { - location: location_base_data, - sub_path: None, - regenerate_thumbnails: false, - regenerate_labels: false, - }) - .spawn(node, library) - .await + node.job_system + .dispatch( + JobEnqueuer::new(Indexer::new(location, None)?) + .with_action("scan_location") + .with_metadata(ReportInputMetadata::Location(location_base_data.clone())) + .enqueue_next(FileIdentifier::new(location_base_data.clone(), None)?) + .enqueue_next(MediaProcessor::new(location_base_data, None, false)?), + location_id, + ctx.clone(), + ) + .await? } ScanState::Indexed => { - JobBuilder::new(OldFileIdentifierJobInit { - location: location_base_data.clone(), - sub_path: None, - }) - .with_action("scan_location_already_indexed") - .with_metadata(json!({"location": location_base_data.clone()})) - .build() - .queue_next(OldMediaProcessorJobInit { - location: location_base_data, - sub_path: None, - regenerate_thumbnails: false, - regenerate_labels: false, - }) - .spawn(node, library) - .await + node.job_system + .dispatch( + JobEnqueuer::new(FileIdentifier::new(location_base_data.clone(), None)?) + .with_action("scan_location_already_indexed") + .with_metadata(ReportInputMetadata::Location(location_base_data.clone())) + .enqueue_next(MediaProcessor::new(location_base_data, None, false)?), + location_id, + ctx.clone(), + ) + .await? } ScanState::FilesIdentified => { - JobBuilder::new(OldMediaProcessorJobInit { - location: location_base_data.clone(), - sub_path: None, - regenerate_thumbnails: false, - regenerate_labels: false, - }) - .with_action("scan_location_files_already_identified") - .with_metadata(json!({"location": location_base_data})) - .build() - .spawn(node, library) - .await + node.job_system + .dispatch( + JobEnqueuer::new(MediaProcessor::new( + location_base_data.clone(), + None, + false, + )?) + .with_action("scan_location_files_already_identified") + .with_metadata(ReportInputMetadata::Location(location_base_data)), + location_id, + ctx.clone(), + ) + .await? } - } - .map_err(Into::into) + }; + + Ok(Some(job_id)) } +#[instrument( + skip_all, + fields( + library_id = %library.id, + location_id = %location.id, + sub_path = %sub_path.as_ref().display(), + ), + err, +)] pub async fn scan_location_sub_path( node: &Arc, library: &Arc, location: location_with_indexer_rules::Data, - sub_path: impl AsRef, -) -> Result<(), JobManagerError> { + sub_path: impl AsRef + Send, +) -> Result, sd_core_heavy_lifting::Error> { let sub_path = sub_path.as_ref().to_path_buf(); // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. if location.instance_id != Some(library.config().await.instance_id) { - return Ok(()); + warn!("Tried to scan a location on a different instance"); + return Ok(None); } + let location_id = location.id; + let ctx = NodeContext { + node: Arc::clone(node), + library: Arc::clone(library), + }; + let location_base_data = location::Data::from(&location); - JobBuilder::new(OldIndexerJobInit { - location, - sub_path: Some(sub_path.clone()), - }) - .with_action("scan_location_sub_path") - .with_metadata(json!({ - "location": location_base_data.clone(), - "sub_path": sub_path.clone(), - })) - .build() - .queue_next(OldFileIdentifierJobInit { - location: location_base_data.clone(), - sub_path: Some(sub_path.clone()), - }) - .queue_next(OldMediaProcessorJobInit { - location: location_base_data, - sub_path: Some(sub_path), - regenerate_thumbnails: false, - regenerate_labels: false, - }) - .spawn(node, library) - .await - .map_err(Into::into) + debug!("Scanning location on a sub path"); + + node.job_system + .dispatch( + JobEnqueuer::new(Indexer::new(location, Some(sub_path.clone()))?) + .with_action("scan_location") + .with_metadata(ReportInputMetadata::Location(location_base_data.clone())) + .with_metadata(ReportInputMetadata::SubPath(sub_path.clone())) + .enqueue_next(FileIdentifier::new( + location_base_data.clone(), + Some(sub_path.clone()), + )?) + .enqueue_next(MediaProcessor::new( + location_base_data, + Some(sub_path), + false, + )?), + location_id, + ctx.clone(), + ) + .await + .map_err(Into::into) + .map(Some) } +#[instrument( + skip_all, + fields( + library_id = %library.id, + location_id = %location.id, + sub_path = %sub_path.as_ref().display(), + ), + err, +)] pub async fn light_scan_location( node: Arc, library: Arc, location: location_with_indexer_rules::Data, sub_path: impl AsRef, -) -> Result<(), JobError> { +) -> Result<(), sd_core_heavy_lifting::Error> { let sub_path = sub_path.as_ref().to_path_buf(); // TODO(N): This isn't gonna work with removable media and this will likely permanently break if the DB is restored from a backup. if location.instance_id != Some(library.config().await.instance_id) { + warn!("Tried to scan a location on a different instance"); return Ok(()); } let location_base_data = location::Data::from(&location); - indexer::old_shallow(&location, &sub_path, &node, &library).await?; - old_file_identifier::old_shallow(&location_base_data, &sub_path, &library).await?; - old_media_processor::old_shallow( - &location_base_data, - &sub_path, - &library, - #[cfg(feature = "ai")] - false, - &node, - ) - .await?; + let dispatcher = node.task_system.get_dispatcher(); + let ctx = NodeContext { node, library }; + + for e in indexer::shallow(location, &sub_path, &dispatcher, &ctx).await? { + error!(?e, "Shallow indexer errors;"); + } + + for e in + file_identifier::shallow(location_base_data.clone(), &sub_path, &dispatcher, &ctx).await? + { + error!(?e, "Shallow file identifier errors;"); + } + + for e in media_processor::shallow(location_base_data, &sub_path, &dispatcher, &ctx).await? { + error!(?e, "Shallow media processor errors;"); + } Ok(()) } +#[instrument( + skip_all, + fields( + library_id = %id, + location_path = %location_path.as_ref().display(), + ), + err, +)] pub async fn relink_location( Library { db, id, sync, .. }: &Library, location_path: impl AsRef, -) -> Result { +) -> Result { let location_path = location_path.as_ref(); let mut metadata = SpacedriveLocationMetadataFile::try_load(&location_path) .await? @@ -612,7 +645,7 @@ pub async fn relink_location( metadata.relink(*id, location_path).await?; - let pub_id = metadata.location_pub_id(*id)?.as_ref().to_vec(); + let pub_id = uuid_to_bytes(&metadata.location_pub_id(*id)?); let path = location_path .to_str() .map(str::to_string) @@ -653,6 +686,57 @@ pub struct CreatedLocationResult { pub data: location_with_indexer_rules::Data, } +pub(crate) fn normalize_path(path: impl AsRef) -> io::Result<(String, String)> { + let mut path = path.as_ref().to_path_buf(); + let (location_path, normalized_path) = path + // Normalize path and also check if it exists + .normalize() + .and_then(|normalized_path| { + if cfg!(windows) { + // Use normalized path as main path on Windows + // This ensures we always receive a valid windows formatted path + // ex: /Users/JohnDoe/Downloads will become C:\Users\JohnDoe\Downloads + // Internally `normalize` calls `GetFullPathNameW` on Windows + // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew + path = normalized_path.as_path().to_path_buf(); + } + + Ok(( + // TODO: Maybe save the path bytes instead of the string representation to avoid depending on UTF-8 + path.to_str().map(str::to_string).ok_or(io::Error::new( + io::ErrorKind::InvalidInput, + "Found non-UTF-8 path", + ))?, + normalized_path, + )) + })?; + + // Not needed on Windows because the normalization already handles it + if cfg!(not(windows)) { + // Replace location_path with normalize_path, when the first one ends in `.` or `..` + // This is required so localize_name doesn't panic + if let Some(component) = path.components().next_back() { + if matches!(component, Component::CurDir | Component::ParentDir) { + path = normalized_path.as_path().to_path_buf(); + } + } + } + + // Use `to_string_lossy` because a partially corrupted but identifiable name is better than nothing + let mut name = path.localize_name().to_string_lossy().to_string(); + + // Windows doesn't have a root directory + if cfg!(not(windows)) && name == "/" { + name = "Root".to_string() + } + + if name.replace(char::REPLACEMENT_CHARACTER, "") == "" { + name = "Unknown".to_string() + } + + Ok((location_path, name)) +} + async fn create_location( library @ Library { db, sync, .. }: &Library, location_pub_id: Uuid, @@ -742,6 +826,7 @@ async fn create_location( })) } +#[instrument(skip(node, library), fields(library_id = %library.id), err)] pub async fn delete_location( node: &Node, library: &Arc, @@ -751,17 +836,11 @@ pub async fn delete_location( let start = Instant::now(); node.locations.remove(location_id, library.clone()).await?; - debug!( - "Elapsed time to remove location from node: {:?}", - start.elapsed() - ); + debug!(elapsed_time = ?start.elapsed(), "Removed location from node;"); let start = Instant::now(); delete_directory(library, location_id, None).await?; - debug!( - "Elapsed time to delete location file paths: {:?}", - start.elapsed() - ); + debug!(elapsed_time = ?start.elapsed(), "Deleted location file paths;"); let location = library .db @@ -794,10 +873,7 @@ pub async fn delete_location( } } } - debug!( - "Elapsed time to remove location metadata: {:?}", - start.elapsed() - ); + debug!(elapsed_time = ?start.elapsed(), "Removed location metadata;"); let start = Instant::now(); @@ -809,10 +885,7 @@ pub async fn delete_location( )]) .exec() .await?; - debug!( - "Elapsed time to delete indexer rules in location: {:?}", - start.elapsed() - ); + debug!(elapsed_time = ?start.elapsed(), "Deleted indexer rules in location;"); let start = Instant::now(); @@ -825,20 +898,18 @@ pub async fn delete_location( ) .await?; - debug!( - "Elapsed time to delete location from db: {:?}", - start.elapsed() - ); + debug!(elapsed_time = ?start.elapsed(), "Deleted location from db;"); invalidate_query!(library, "locations.list"); - info!("Location {location_id} deleted"); + info!("Location deleted"); Ok(()) } /// Will delete a directory recursively with Objects if left as orphans /// this function is used to delete a location and when ingesting directory deletion events +#[instrument(skip_all, err)] pub async fn delete_directory( library: &Library, location_id: location::id::Type, @@ -872,6 +943,7 @@ pub async fn delete_directory( Ok(()) } +#[instrument(skip_all, err)] async fn check_nested_location( location_path: impl AsRef, db: &PrismaClient, @@ -904,8 +976,8 @@ async fn check_nested_location( let is_a_child_location = potential_children.into_iter().any(|v| { let Some(location_path) = v.path else { warn!( - "Missing location path on location at check nested location", - v.id + location_id = %v.id, + "Missing location path on location at check nested location", ); return false; }; @@ -928,6 +1000,7 @@ async fn check_nested_location( Ok(parents_count > 0 || is_a_child_location) } +#[instrument(skip_all, err)] pub async fn update_location_size( location_id: location::id::Type, library: &Library, @@ -976,6 +1049,7 @@ pub async fn update_location_size( Ok(()) } +#[instrument(skip_all, err)] pub async fn get_location_path_from_location_id( db: &PrismaClient, location_id: file_path::id::Type, @@ -997,6 +1071,7 @@ pub async fn get_location_path_from_location_id( }) } +#[instrument(skip_all, err)] pub async fn create_file_path( crate::location::Library { db, sync, .. }: &crate::location::Library, IsolatedFilePathDataParts { @@ -1007,7 +1082,7 @@ pub async fn create_file_path( extension, .. }: IsolatedFilePathDataParts<'_>, - cas_id: Option, + cas_id: Option>, metadata: sd_core_file_path_helper::FilePathMetadata, ) -> Result { use sd_utils::db::inode_to_db; @@ -1039,7 +1114,10 @@ pub async fn create_file_path( ), location::connect(prisma::location::id::equals(location.id)), ), - ((cas_id::NAME, msgpack!(cas_id)), cas_id::set(cas_id)), + ( + (cas_id::NAME, msgpack!(cas_id)), + cas_id::set(cas_id.map(Into::into)), + ), ( (materialized_path::NAME, msgpack!(materialized_path)), materialized_path::set(Some(materialized_path.into())), @@ -1082,7 +1160,7 @@ pub async fn create_file_path( .unzip() }; - let pub_id = sd_utils::uuid_to_bytes(Uuid::new_v4()); + let pub_id = sd_utils::uuid_to_bytes(&Uuid::new_v4()); let created_path = sync .write_ops( diff --git a/core/src/location/non_indexed.rs b/core/src/location/non_indexed.rs new file mode 100644 index 000000000..04d040f1c --- /dev/null +++ b/core/src/location/non_indexed.rs @@ -0,0 +1,412 @@ +use crate::{api::locations::ExplorerItem, context::NodeContext, library::Library, Node}; + +use sd_core_file_path_helper::{path_is_hidden, MetadataExt}; +use sd_core_heavy_lifting::{ + file_identifier::generate_cas_id, + media_processor::{ + self, get_thumbnails_directory, thumbnailer::NewThumbnailReporter, GenerateThumbnailArgs, + NewThumbnailsReporter, ThumbKey, + }, +}; +use sd_core_indexer_rules::{ + seed::{NO_HIDDEN, NO_SYSTEM_FILES}, + IndexerRule, IndexerRuler, RulerDecision, +}; + +use sd_file_ext::{extensions::Extension, kind::ObjectKind}; +use sd_prisma::prisma::location; +use sd_utils::{chain_optional_iter, error::FileIOError}; + +use std::{ + collections::HashMap, + io::ErrorKind, + ops::Deref, + path::{Path, PathBuf}, + sync::Arc, +}; + +use chrono::{DateTime, Utc}; +use futures::Stream; +use itertools::{Either, Itertools}; +use rspc::ErrorCode; +use serde::Serialize; +use specta::Type; +use thiserror::Error; +use tokio::{io, spawn, sync::mpsc, task::JoinError}; +use tokio_stream::wrappers::ReceiverStream; +use tracing::{debug, error, span, warn, Level}; + +use super::normalize_path; + +#[derive(Debug, Error)] +pub enum NonIndexedLocationError { + #[error("path not found: {}", .0.display())] + NotFound(PathBuf), + + #[error(transparent)] + FileIO(#[from] FileIOError), + + #[error("database error: {0}")] + Database(#[from] prisma_client_rust::QueryError), + + #[error("error joining tokio task: {0}")] + TaskJoinError(#[from] JoinError), + + #[error("receiver shutdown error")] + SendError, +} + +impl From> for NonIndexedLocationError { + fn from(_: mpsc::error::SendError) -> Self { + Self::SendError + } +} + +impl From for rspc::Error { + fn from(e: NonIndexedLocationError) -> Self { + match e { + NonIndexedLocationError::NotFound(_) => { + rspc::Error::with_cause(ErrorCode::NotFound, e.to_string(), e) + } + _ => rspc::Error::with_cause(ErrorCode::InternalServerError, e.to_string(), e), + } + } +} + +impl> From<(P, io::Error)> for NonIndexedLocationError { + fn from((path, source): (P, io::Error)) -> Self { + if source.kind() == io::ErrorKind::NotFound { + Self::NotFound(path.as_ref().into()) + } else { + Self::FileIO(FileIOError::from((path, source))) + } + } +} + +#[derive(Serialize, Type, Debug)] +pub struct NonIndexedPathItem { + pub path: String, + pub name: String, + pub extension: String, + pub kind: i32, + pub is_dir: bool, + pub date_created: DateTime, + pub date_modified: DateTime, + pub size_in_bytes_bytes: Vec, + pub hidden: bool, +} + +// #[instrument(name = "non_indexed::walk", skip(sort_fn))] +pub async fn walk( + path: PathBuf, + with_hidden_files: bool, + node: Arc, + library: Arc, + sort_fn: impl FnOnce(&mut Vec) + Send, +) -> Result< + impl Stream>> + Send, + NonIndexedLocationError, +> { + let mut entries = get_all_entries(path.clone()).await?; + + { + let span = span!(Level::INFO, "sort_fn"); + let _enter = span.enter(); + + sort_fn(&mut entries); + } + + let (tx, rx) = mpsc::channel(128); + let tx2 = tx.clone(); + + // We wanna process and let the caller use the stream. + let task = spawn(async move { + let path = &path; + let indexer_ruler = IndexerRuler::new(chain_optional_iter( + [IndexerRule::from(NO_SYSTEM_FILES.deref())], + [(!with_hidden_files).then(|| IndexerRule::from(NO_HIDDEN.deref()))], + )); + + let mut thumbnails_to_generate = vec![]; + // Generating thumbnails for PDFs is kinda slow, so we're leaving them for last in the batch + let mut document_thumbnails_to_generate = vec![]; + let mut directories = vec![]; + + for entry in entries.into_iter() { + let (entry_path, name) = match normalize_path(entry.path) { + Ok(v) => v, + Err(e) => { + tx.send(Err(Either::Left( + NonIndexedLocationError::from((path, e)).into(), + ))) + .await?; + continue; + } + }; + + match indexer_ruler + .evaluate_path(&entry_path, &entry.metadata) + .await + { + Ok(RulerDecision::Accept) => { /* Everything is awesome! */ } + + Ok(RulerDecision::Reject) => { + continue; + } + + Err(e) => { + tx.send(Err(Either::Left(e.into()))).await?; + continue; + } + } + + if entry.metadata.is_dir() { + directories.push((entry_path, name, entry.metadata)); + } else { + let path = Path::new(&entry_path); + + let Some(name) = path + .file_stem() + .and_then(|s| s.to_str().map(str::to_string)) + else { + warn!(%entry_path, "Failed to extract name from path;"); + continue; + }; + + let extension = path + .extension() + .and_then(|s| s.to_str().map(str::to_string)) + .unwrap_or_default(); + + let kind = Extension::resolve_conflicting(&path, false) + .await + .map(Into::into) + .unwrap_or(ObjectKind::Unknown); + + let should_generate_thumbnail = { + #[cfg(feature = "ffmpeg")] + { + matches!( + kind, + ObjectKind::Image | ObjectKind::Video | ObjectKind::Document + ) + } + + #[cfg(not(feature = "ffmpeg"))] + { + matches!(kind, ObjectKind::Image | ObjectKind::Document) + } + }; + + let (thumbnail_key, has_created_thumbnail) = if should_generate_thumbnail { + if let Ok(cas_id) = + generate_cas_id(&path, entry.metadata.len()) + .await + .map_err(|e| { + tx.send(Err(Either::Left( + NonIndexedLocationError::from((path, e)).into(), + ))) + }) { + if kind == ObjectKind::Document { + document_thumbnails_to_generate.push(GenerateThumbnailArgs::new( + extension.clone(), + cas_id.clone(), + path.to_path_buf(), + )); + } else { + thumbnails_to_generate.push(GenerateThumbnailArgs::new( + extension.clone(), + cas_id.clone(), + path.to_path_buf(), + )); + } + + let thumb_exists = node + .ephemeral_thumbnail_exists(&cas_id) + .await + .map_err(NonIndexedLocationError::from)?; + + (Some(ThumbKey::new_ephemeral(cas_id)), thumb_exists) + } else { + (None, false) + } + } else { + (None, false) + }; + + tx.send(Ok(ExplorerItem::NonIndexedPath { + thumbnail: thumbnail_key, + item: NonIndexedPathItem { + hidden: path_is_hidden(Path::new(&entry_path), &entry.metadata), + path: entry_path, + name, + extension, + kind: kind as i32, + is_dir: false, + date_created: entry.metadata.created_or_now().into(), + date_modified: entry.metadata.modified_or_now().into(), + size_in_bytes_bytes: entry.metadata.len().to_be_bytes().to_vec(), + }, + has_created_thumbnail, + })) + .await?; + } + } + + thumbnails_to_generate.extend(document_thumbnails_to_generate); + + let thumbnails_directory = Arc::new(get_thumbnails_directory(node.config.data_directory())); + let reporter: Arc = Arc::new(NewThumbnailsReporter { + ctx: NodeContext { + node: Arc::clone(&node), + library: Arc::clone(&library), + }, + }); + + if node + .task_system + .dispatch_many( + thumbnails_to_generate + .into_iter() + .chunks(10) + .into_iter() + .map(|chunk| { + media_processor::Thumbnailer::new_ephemeral( + Arc::clone(&thumbnails_directory), + chunk.collect(), + Arc::clone(&reporter), + ) + }) + .collect::>(), + ) + .await + .is_err() + { + debug!("Task system shutting down"); + } + + let mut locations = library + .db + .location() + .find_many(vec![location::path::in_vec( + directories + .iter() + .map(|(path, _, _)| path.clone()) + .collect(), + )]) + .exec() + .await? + .into_iter() + .flat_map(|location| { + location + .path + .clone() + .map(|location_path| (location_path, location)) + }) + .collect::>(); + + for (directory, name, metadata) in directories { + if let Some(location) = locations.remove(&directory) { + tx.send(Ok(ExplorerItem::Location { item: location })) + .await?; + } else { + tx.send(Ok(ExplorerItem::NonIndexedPath { + thumbnail: None, + item: NonIndexedPathItem { + hidden: path_is_hidden(Path::new(&directory), &metadata), + path: directory, + name, + extension: String::new(), + kind: ObjectKind::Folder as i32, + is_dir: true, + date_created: metadata.created_or_now().into(), + date_modified: metadata.modified_or_now().into(), + size_in_bytes_bytes: metadata.len().to_be_bytes().to_vec(), + }, + has_created_thumbnail: false, + })) + .await?; + } + } + + Ok::<_, NonIndexedLocationError>(()) + }); + + spawn(async move { + match task.await { + Ok(Ok(())) => {} + Ok(Err(e)) => { + let _ = tx2.send(Err(Either::Left(e.into()))).await; + } + Err(e) => error!(?e, "error joining tokio task"), + } + }); + + Ok(ReceiverStream::new(rx)) +} + +#[derive(Debug)] +pub struct Entry { + path: PathBuf, + name: String, + // size_in_bytes: u64, + // date_created: + metadata: std::fs::Metadata, +} + +impl Entry { + pub fn name(&self) -> &str { + &self.name + } + + pub fn size_in_bytes(&self) -> u64 { + self.metadata.len() + } + + pub fn date_created(&self) -> DateTime { + self.metadata.created_or_now().into() + } + + pub fn date_modified(&self) -> DateTime { + self.metadata.modified_or_now().into() + } +} + +/// We get all of the FS entries first before we start processing on each of them. +/// +/// From my M1 Macbook Pro this: +/// - takes 11ms per 10 000 files +/// and +/// - consumes 0.16MB of RAM per 10 000 entries. +/// +/// The reason we collect these all up is so we can apply ordering, and then begin streaming the data as it's processed to the frontend. +// #[instrument(name = "get_all_entries")] +pub async fn get_all_entries(path: PathBuf) -> Result, NonIndexedLocationError> { + tokio::task::spawn_blocking(move || { + let path = &path; + let dir = std::fs::read_dir(path).map_err(|e| (path, e))?; + let mut entries = Vec::new(); + for entry in dir { + let entry = entry.map_err(|e| (path, e))?; + + // We must not keep `entry` around as we will quickly hit the OS limit on open file descriptors + entries.push(Entry { + path: entry.path(), + name: entry + .file_name() + .to_str() + .ok_or_else(|| { + ( + path, + io::Error::new(ErrorKind::Other, "error non UTF-8 path"), + ) + })? + .to_string(), + metadata: entry.metadata().map_err(|e| (path, e))?, + }); + } + + Ok(entries) + }) + .await? +} diff --git a/core/src/node/config.rs b/core/src/node/config.rs index 4518a38f8..17098ca7c 100644 --- a/core/src/node/config.rs +++ b/core/src/node/config.rs @@ -1,6 +1,6 @@ use crate::{ api::{notifications::Notification, BackendFeature}, - object::media::old_thumbnail::preferences::ThumbnailerPreferences, + /*object::media::old_thumbnail::preferences::ThumbnailerPreferences,*/ util::version_manager::{Kind, ManagedVersion, VersionManager, VersionManagerError}, }; @@ -8,6 +8,7 @@ use sd_p2p::Identity; use sd_utils::error::FileIOError; use std::{ + collections::HashSet, path::{Path, PathBuf}, sync::Arc, }; @@ -37,20 +38,78 @@ pub enum P2PDiscoveryState { } #[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, Type)] -#[serde(rename_all = "snake_case", untagged)] +#[serde(rename_all = "snake_case", tag = "type", content = "value")] pub enum Port { - Disabled, #[default] Random, Discrete(u16), } impl Port { - pub fn is_random(&self) -> bool { + pub fn get(&self) -> u16 { + if is_in_docker() { + return 7373; + } + + match self { + Port::Random => 0, + Port::Discrete(port) => *port, + } + } + + pub fn is_default(&self) -> bool { matches!(self, Port::Random) } } +pub fn is_in_docker() -> bool { + std::env::var("SD_DOCKER").as_deref() == Ok("true") +} + +fn skip_if_false(value: &bool) -> bool { + !*value +} + +#[derive(Debug, Clone, Serialize, Deserialize, Type)] +pub struct NodeConfigP2P { + #[serde(default)] + pub discovery: P2PDiscoveryState, + #[serde(default, skip_serializing_if = "Port::is_default")] + pub port: Port, + #[serde(default, skip_serializing_if = "skip_if_false")] + pub disabled: bool, + #[serde(default, skip_serializing_if = "skip_if_false")] + pub disable_ipv6: bool, + #[serde(default, skip_serializing_if = "skip_if_false")] + pub disable_relay: bool, + #[serde(default, skip_serializing_if = "skip_if_false")] + pub enable_remote_access: bool, + /// A list of peer addresses to try and manually connect to, instead of relying on discovery. + /// + /// All of these are valid values: + /// - `localhost` + /// - `otbeaumont.me` or `otbeaumont.me:3000` + /// - `127.0.0.1` or `127.0.0.1:300` + /// - `[::1]` or `[::1]:3000` + /// which is why we use `String` not `SocketAddr` + #[serde(default)] + pub manual_peers: HashSet, +} + +impl Default for NodeConfigP2P { + fn default() -> Self { + Self { + discovery: P2PDiscoveryState::Everyone, + port: Port::Random, + disabled: true, + disable_ipv6: true, + disable_relay: true, + enable_remote_access: false, + manual_peers: Default::default(), + } + } +} + /// NodeConfig is the configuration for a node. This is shared between all libraries and is stored in a JSON file on disk. #[derive(Debug, Clone, Serialize, Deserialize)] // If you are adding `specta::Type` on this your probably about to leak the P2P private key pub struct NodeConfig { @@ -66,12 +125,8 @@ pub struct NodeConfig { #[serde(with = "identity_serde")] pub identity: Identity, /// P2P config - #[serde(default, skip_serializing_if = "Port::is_random")] - pub p2p_ipv4_port: Port, - #[serde(default, skip_serializing_if = "Port::is_random")] - pub p2p_ipv6_port: Port, #[serde(default)] - pub p2p_discovery: P2PDiscoveryState, + pub p2p: NodeConfigP2P, /// Feature flags enabled on the node #[serde(default)] pub features: Vec, @@ -114,7 +169,8 @@ mod identity_serde { #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Type)] pub struct NodePreferences { - pub thumbnailer: ThumbnailerPreferences, + // pub thumbnailer: ThumbnailerPreferences, + // TODO(fogodev): introduce preferences to choose how many worker the task system should have } #[derive( @@ -138,7 +194,11 @@ impl ManagedVersion for NodeConfig { // SAFETY: This is just for display purposes so it doesn't matter if it's lossy Ok(hostname) => hostname.to_string_lossy().into_owned(), Err(e) => { - error!("Falling back to default node name as an error occurred getting your systems hostname: '{e:#?}'"); + error!( + ?e, + "Falling back to default node name as an error occurred getting your systems hostname;", + ); + "my-spacedrive".into() } }; @@ -153,9 +213,7 @@ impl ManagedVersion for NodeConfig { id: Uuid::new_v4(), name, identity: Identity::default(), - p2p_ipv4_port: Port::Random, - p2p_ipv6_port: Port::Random, - p2p_discovery: P2PDiscoveryState::Everyone, + p2p: NodeConfigP2P::default(), version: Self::LATEST_VERSION, features: vec![], notifications: vec![], @@ -256,7 +314,7 @@ impl NodeConfig { } _ => { - error!("Node config version is not handled: {:?}", current); + error!(current_version = ?current, "Node config version is not handled;"); return Err(VersionManagerError::UnexpectedMigration { current_version: current.int_value(), next_version: next.int_value(), @@ -325,11 +383,6 @@ impl Manager { self.config.read().await.clone() } - /// get a node config preferences watcher receiver - pub(crate) fn preferences_watcher(&self) -> watch::Receiver { - self.preferences_watcher_tx.subscribe() - } - /// data_directory returns the path to the directory storing the configuration data. pub(crate) fn data_directory(&self) -> PathBuf { self.data_directory_path.clone() diff --git a/core/src/object/fs/old_copy.rs b/core/src/object/fs/old_copy.rs index cbe4c4f0a..41b1d1b1a 100644 --- a/core/src/object/fs/old_copy.rs +++ b/core/src/object/fs/old_copy.rs @@ -172,8 +172,8 @@ impl StatefulJob for OldFileCopierJobInit { Err(FileSystemJobsError::FilePathNotFound(path)) => { // FilePath doesn't exist in the database, it possibly wasn't indexed, so we skip it warn!( - "Skipping duplicating {} as it wasn't indexed", - path.display() + path = %path.display(), + "Skipping duplicating as it wasn't indexed;", ); } Err(e) => return Err(e.into()), @@ -208,9 +208,9 @@ impl StatefulJob for OldFileCopierJobInit { } Err(e) if e.kind() == io::ErrorKind::NotFound => { trace!( - "Copying from {} to {}", - source_file_data.full_path.display(), - target_full_path.display() + source = %source_file_data.full_path.display(), + target = %target_full_path.display(), + "Copying source -> target;", ); fs::copy(&source_file_data.full_path, &target_full_path) diff --git a/core/src/object/fs/old_cut.rs b/core/src/object/fs/old_cut.rs index 4135dc631..887d92b02 100644 --- a/core/src/object/fs/old_cut.rs +++ b/core/src/object/fs/old_cut.rs @@ -99,8 +99,8 @@ impl StatefulJob for OldFileCutterJobInit { match fs::metadata(&full_output).await { Ok(_) => { warn!( - "Skipping {} as it would be overwritten", - full_output.display() + output_path = %full_output.display(), + "Skipping as it would be overwritten;", ); Ok(JobRunErrors(vec![FileSystemJobsError::WouldOverwrite( @@ -111,9 +111,9 @@ impl StatefulJob for OldFileCutterJobInit { } Err(e) if e.kind() == io::ErrorKind::NotFound => { trace!( - "Cutting {} to {}", - file_data.full_path.display(), - full_output.display() + source = %file_data.full_path.display(), + target = %full_output.display(), + "Cutting source -> target;", ); fs::rename(&file_data.full_path, &full_output) diff --git a/core/src/object/fs/old_delete.rs b/core/src/object/fs/old_delete.rs index 0e33000d1..0b05a6103 100644 --- a/core/src/object/fs/old_delete.rs +++ b/core/src/object/fs/old_delete.rs @@ -84,9 +84,10 @@ impl StatefulJob for OldFileDeleterJobInit { Ok(()) => { /* Everything is awesome! */ } Err(e) if e.kind() == io::ErrorKind::NotFound => { warn!( - "File not found in the file system, will remove from database: {}", - step.full_path.display() + path = %step.full_path.display(), + "File not found in the file system, will remove from database;", ); + sync.write_op( db, sync.shared_delete(prisma_sync::file_path::SyncId { diff --git a/core/src/object/fs/old_erase.rs b/core/src/object/fs/old_erase.rs index 05c49d8e3..d04970590 100644 --- a/core/src/object/fs/old_erase.rs +++ b/core/src/object/fs/old_erase.rs @@ -155,16 +155,13 @@ impl StatefulJob for OldFileEraserJobInit { // .len(); trace!( - "Overwriting file: {} with {} passes", - step.full_path.display(), - init.passes + path = %step.full_path.display(), + passes = init.passes, + "Overwriting file;", ); - #[cfg(feature = "crypto")] - // sd_crypto::fs::erase::erase_async(&mut file, file_len as usize, init.passes).await?; - #[cfg(not(feature = "crypto"))] - warn!("File not fully erased due to missing crypto module"); - + // TODO: File is only being truncated and not actually erased, + // we should provide a way for securely overwriting the file with random data file.set_len(0) .await .map_err(|e| FileIOError::from((&step.full_path, e)))?; diff --git a/core/src/object/media/media_data_extractor.rs b/core/src/object/media/media_data_extractor.rs deleted file mode 100644 index 7fd7b2b3c..000000000 --- a/core/src/object/media/media_data_extractor.rs +++ /dev/null @@ -1,179 +0,0 @@ -use crate::old_job::JobRunErrors; - -use sd_core_file_path_helper::IsolatedFilePathData; -use sd_core_prisma_helpers::file_path_for_media_processor; - -use sd_file_ext::extensions::{Extension, ImageExtension, ALL_IMAGE_EXTENSIONS}; -use sd_media_metadata::ImageMetadata; -use sd_prisma::prisma::{location, media_data, PrismaClient}; -use sd_utils::error::FileIOError; - -use std::{collections::HashSet, path::Path}; - -use futures_concurrency::future::Join; -use once_cell::sync::Lazy; -use serde::{Deserialize, Serialize}; -use thiserror::Error; -use tokio::task::spawn_blocking; -use tracing::error; - -use super::media_data_image_to_query; - -#[derive(Error, Debug)] -pub enum MediaDataError { - // Internal errors - #[error("database error: {0}")] - Database(#[from] prisma_client_rust::QueryError), - #[error(transparent)] - FileIO(#[from] FileIOError), - #[error(transparent)] - MediaData(#[from] sd_media_metadata::Error), - #[error("failed to join tokio task: {0}")] - TokioJoinHandle(#[from] tokio::task::JoinError), -} - -#[derive(Serialize, Deserialize, Default, Debug)] -pub struct OldMediaDataExtractorMetadata { - pub extracted: u32, - pub skipped: u32, -} - -pub(super) static FILTERED_IMAGE_EXTENSIONS: Lazy> = Lazy::new(|| { - ALL_IMAGE_EXTENSIONS - .iter() - .cloned() - .filter(can_extract_media_data_for_image) - .map(Extension::Image) - .collect() -}); - -pub const fn can_extract_media_data_for_image(image_extension: &ImageExtension) -> bool { - use ImageExtension::*; - matches!( - image_extension, - Tiff | Dng | Jpeg | Jpg | Heif | Heifs | Heic | Avif | Avcs | Avci | Hif | Png | Webp - ) -} - -pub async fn extract_media_data(path: impl AsRef) -> Result { - let path = path.as_ref().to_path_buf(); - - // Running in a separated blocking thread due to MediaData blocking behavior (due to sync exif lib) - spawn_blocking(|| ImageMetadata::from_path(path)) - .await? - .map_err(Into::into) -} - -pub async fn process( - files_paths: &[file_path_for_media_processor::Data], - location_id: location::id::Type, - location_path: impl AsRef, - db: &PrismaClient, - ctx_update_fn: &impl Fn(usize), -) -> Result<(OldMediaDataExtractorMetadata, JobRunErrors), MediaDataError> { - let mut run_metadata = OldMediaDataExtractorMetadata::default(); - if files_paths.is_empty() { - return Ok((run_metadata, JobRunErrors::default())); - } - - let location_path = location_path.as_ref(); - - let objects_already_with_media_data = db - .media_data() - .find_many(vec![media_data::object_id::in_vec( - files_paths - .iter() - .filter_map(|file_path| file_path.object_id) - .collect(), - )]) - .select(media_data::select!({ object_id })) - .exec() - .await?; - - if files_paths.len() == objects_already_with_media_data.len() { - // All files already have media data, skipping - run_metadata.skipped = files_paths.len() as u32; - return Ok((run_metadata, JobRunErrors::default())); - } - - let objects_already_with_media_data = objects_already_with_media_data - .into_iter() - .map(|media_data| media_data.object_id) - .collect::>(); - - run_metadata.skipped = objects_already_with_media_data.len() as u32; - - let (media_datas, errors) = { - let maybe_media_data = files_paths - .iter() - .enumerate() - .filter_map(|(idx, file_path)| { - file_path.object_id.and_then(|object_id| { - (!objects_already_with_media_data.contains(&object_id)) - .then_some((idx, file_path, object_id)) - }) - }) - .filter_map(|(idx, file_path, object_id)| { - IsolatedFilePathData::try_from((location_id, file_path)) - .map_err(|e| error!("{e:#?}")) - .ok() - .map(|iso_file_path| (idx, location_path.join(iso_file_path), object_id)) - }) - .map(|(idx, path, object_id)| async move { - let res = extract_media_data(&path).await; - ctx_update_fn(idx + 1); - (res, path, object_id) - }) - .collect::>() - .join() - .await; - - let total_media_data = maybe_media_data.len(); - - maybe_media_data.into_iter().fold( - // In the good case, all media data were extracted - (Vec::with_capacity(total_media_data), Vec::new()), - |(mut media_datas, mut errors), (maybe_media_data, path, object_id)| { - match maybe_media_data { - Ok(media_data) => media_datas.push((media_data, object_id)), - Err(MediaDataError::MediaData(sd_media_metadata::Error::NoExifDataOnPath( - _, - ))) => { - // No exif data on path, skipping - run_metadata.skipped += 1; - } - Err(e) => errors.push((e, path)), - } - (media_datas, errors) - }, - ) - }; - - let created = db - .media_data() - .create_many( - media_datas - .into_iter() - .filter_map(|(media_data, object_id)| { - media_data_image_to_query(media_data, object_id) - .map_err(|e| error!("{e:#?}")) - .ok() - }) - .collect(), - ) - .skip_duplicates() - .exec() - .await?; - - run_metadata.extracted = created as u32; - run_metadata.skipped += errors.len() as u32; - - Ok(( - run_metadata, - errors - .into_iter() - .map(|(e, path)| format!("Couldn't process file: \"{}\"; Error: {e}", path.display())) - .collect::>() - .into(), - )) -} diff --git a/core/src/object/media/mod.rs b/core/src/object/media/mod.rs deleted file mode 100644 index 4eee9c3ca..000000000 --- a/core/src/object/media/mod.rs +++ /dev/null @@ -1,75 +0,0 @@ -pub mod media_data_extractor; -pub mod old_media_processor; -pub mod old_thumbnail; - -pub use old_media_processor::OldMediaProcessorJobInit; -use sd_media_metadata::ImageMetadata; -use sd_prisma::prisma::media_data::*; - -use self::media_data_extractor::MediaDataError; - -pub fn media_data_image_to_query( - mdi: ImageMetadata, - object_id: object_id::Type, -) -> Result { - Ok(CreateUnchecked { - object_id, - _params: vec![ - camera_data::set(serde_json::to_vec(&mdi.camera_data).ok()), - media_date::set(serde_json::to_vec(&mdi.date_taken).ok()), - resolution::set(serde_json::to_vec(&mdi.resolution).ok()), - media_location::set(serde_json::to_vec(&mdi.location).ok()), - artist::set(mdi.artist), - description::set(mdi.description), - copyright::set(mdi.copyright), - exif_version::set(mdi.exif_version), - epoch_time::set(mdi.date_taken.map(|x| x.unix_timestamp())), - ], - }) -} - -pub fn media_data_image_to_query_params( - mdi: ImageMetadata, -) -> (Vec<(&'static str, rmpv::Value)>, Vec) { - use sd_sync::option_sync_db_entry; - use sd_utils::chain_optional_iter; - - chain_optional_iter( - [], - [ - option_sync_db_entry!(serde_json::to_vec(&mdi.camera_data).ok(), camera_data), - option_sync_db_entry!(serde_json::to_vec(&mdi.date_taken).ok(), media_date), - option_sync_db_entry!(serde_json::to_vec(&mdi.location).ok(), media_location), - option_sync_db_entry!(mdi.artist, artist), - option_sync_db_entry!(mdi.description, description), - option_sync_db_entry!(mdi.copyright, copyright), - option_sync_db_entry!(mdi.exif_version, exif_version), - ], - ) - .into_iter() - .unzip() -} - -pub fn media_data_image_from_prisma_data( - data: sd_prisma::prisma::media_data::Data, -) -> Result { - Ok(ImageMetadata { - camera_data: from_slice_option_to_option(data.camera_data).unwrap_or_default(), - date_taken: from_slice_option_to_option(data.media_date).unwrap_or_default(), - resolution: from_slice_option_to_option(data.resolution).unwrap_or_default(), - location: from_slice_option_to_option(data.media_location), - artist: data.artist, - description: data.description, - copyright: data.copyright, - exif_version: data.exif_version, - }) -} - -#[must_use] -fn from_slice_option_to_option( - value: Option>, -) -> Option { - value - .map(|x| serde_json::from_slice(&x).ok()) - .unwrap_or_default() -} diff --git a/core/src/object/media/old_media_processor/job.rs b/core/src/object/media/old_media_processor/job.rs deleted file mode 100644 index 47aa5eff0..000000000 --- a/core/src/object/media/old_media_processor/job.rs +++ /dev/null @@ -1,634 +0,0 @@ -use crate::{ - invalidate_query, - library::Library, - location::ScanState, - old_job::{ - CurrentStep, JobError, JobInitOutput, JobReportUpdate, JobResult, JobStepOutput, - StatefulJob, WorkerContext, - }, - Node, -}; - -#[cfg(feature = "ai")] -use crate::old_job::JobRunErrors; - -use sd_core_file_path_helper::{ - ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - IsolatedFilePathData, -}; -use sd_core_prisma_helpers::file_path_for_media_processor; - -use sd_file_ext::extensions::Extension; -use sd_prisma::prisma::{location, PrismaClient}; -use sd_utils::db::maybe_missing; - -#[cfg(feature = "ai")] -use sd_ai::old_image_labeler::{BatchToken as ImageLabelerBatchToken, LabelerOutput}; - -#[cfg(feature = "ai")] -use std::sync::Arc; - -use std::{ - hash::Hash, - path::{Path, PathBuf}, - pin::pin, - time::Duration, -}; - -use async_channel as chan; -use futures::StreamExt; -use itertools::Itertools; -use prisma_client_rust::{raw, PrismaValue}; -use serde::{Deserialize, Serialize}; -use serde_json::json; -use tokio::time::sleep; -use tracing::{debug, error, info, trace, warn}; - -use super::{ - media_data_extractor, - old_thumbnail::{self, GenerateThumbnailArgs}, - process, BatchToProcess, MediaProcessorError, OldMediaProcessorMetadata, -}; - -const BATCH_SIZE: usize = 10; - -#[derive(Serialize, Deserialize, Debug)] -pub struct OldMediaProcessorJobInit { - pub location: location::Data, - pub sub_path: Option, - pub regenerate_thumbnails: bool, - pub regenerate_labels: bool, -} - -impl Hash for OldMediaProcessorJobInit { - fn hash(&self, state: &mut H) { - self.location.id.hash(state); - if let Some(ref sub_path) = self.sub_path { - sub_path.hash(state); - } - } -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct OldMediaProcessorJobData { - location_path: PathBuf, - to_process_path: PathBuf, - #[serde(skip, default)] - maybe_thumbnailer_progress_rx: Option>, - #[cfg(feature = "ai")] - labeler_batch_token: ImageLabelerBatchToken, - #[cfg(feature = "ai")] - #[serde(skip, default)] - maybe_labels_rx: Option>, -} - -#[derive(Debug, Serialize, Deserialize)] -pub enum OldMediaProcessorJobStep { - ExtractMediaData(Vec), - WaitThumbnails(usize), - #[cfg(feature = "ai")] - WaitLabels(usize), -} - -#[async_trait::async_trait] -impl StatefulJob for OldMediaProcessorJobInit { - type Data = OldMediaProcessorJobData; - type Step = OldMediaProcessorJobStep; - type RunMetadata = OldMediaProcessorMetadata; - - const NAME: &'static str = "media_processor"; - const IS_BATCHED: bool = true; - - fn target_location(&self) -> location::id::Type { - self.location.id - } - - async fn init( - &self, - ctx: &WorkerContext, - data: &mut Option, - ) -> Result, JobError> { - let Library { - db, - #[cfg(feature = "ai")] - sync, - .. - } = ctx.library.as_ref(); - - let location_id = self.location.id; - let location_path = - maybe_missing(&self.location.path, "location.path").map(PathBuf::from)?; - - let (to_process_path, iso_file_path) = match &self.sub_path { - Some(sub_path) if sub_path != Path::new("") => { - let full_path = ensure_sub_path_is_in_location(&location_path, sub_path) - .await - .map_err(MediaProcessorError::from)?; - ensure_sub_path_is_directory(&location_path, sub_path) - .await - .map_err(MediaProcessorError::from)?; - - let sub_iso_file_path = - IsolatedFilePathData::new(location_id, &location_path, &full_path, true) - .map_err(MediaProcessorError::from)?; - - ensure_file_path_exists( - sub_path, - &sub_iso_file_path, - db, - MediaProcessorError::SubPathNotFound, - ) - .await?; - - (full_path, sub_iso_file_path) - } - _ => ( - location_path.to_path_buf(), - IsolatedFilePathData::new(location_id, &location_path, &location_path, true) - .map_err(MediaProcessorError::from)?, - ), - }; - - debug!( - "Searching for media files in location {location_id} at directory \"{iso_file_path}\"" - ); - - let thumbs_to_process_count = dispatch_thumbnails_for_processing( - location_id, - &location_path, - &iso_file_path, - &ctx.library, - &ctx.node, - self.regenerate_thumbnails, - ) - .await?; - - let maybe_thumbnailer_progress_rx = if thumbs_to_process_count > 0 { - let (progress_tx, progress_rx) = chan::unbounded(); - - ctx.node - .thumbnailer - .register_reporter(location_id, progress_tx) - .await; - - Some(progress_rx) - } else { - None - }; - - let file_paths = get_files_for_media_data_extraction(db, &iso_file_path).await?; - - #[cfg(feature = "ai")] - let file_paths_for_labeling = - get_files_for_labeling(db, &iso_file_path, self.regenerate_labels).await?; - - #[cfg(feature = "ai")] - let total_files_for_labeling = file_paths_for_labeling.len(); - - #[cfg(feature = "ai")] - let (labeler_batch_token, labels_rx) = - if let Some(image_labeller) = ctx.node.old_image_labeller.as_ref() { - let (labeler_batch_token, labels_rx) = image_labeller - .new_resumable_batch( - location_id, - location_path.clone(), - file_paths_for_labeling, - Arc::clone(db), - sync.clone(), - ) - .await; - (labeler_batch_token, Some(labels_rx)) - } else { - (uuid::Uuid::new_v4(), None) - }; - - let total_files = file_paths.len(); - - let chunked_files = file_paths - .into_iter() - .chunks(BATCH_SIZE) - .into_iter() - .map(|chunk| chunk.collect::>()) - .map(OldMediaProcessorJobStep::ExtractMediaData) - .chain( - [(thumbs_to_process_count > 0).then_some( - OldMediaProcessorJobStep::WaitThumbnails(thumbs_to_process_count as usize), - )] - .into_iter() - .flatten(), - ) - .chain( - [ - #[cfg(feature = "ai")] - { - (total_files_for_labeling > 0).then_some( - OldMediaProcessorJobStep::WaitLabels(total_files_for_labeling), - ) - }, - #[cfg(not(feature = "ai"))] - { - None - }, - ] - .into_iter() - .flatten(), - ) - .collect::>(); - - ctx.progress(vec![ - JobReportUpdate::TaskCount(total_files), - JobReportUpdate::Phase("media_data".to_string()), - JobReportUpdate::Message(format!( - "Preparing to process {total_files} files in {} chunks", - chunked_files.len() - )), - ]); - - *data = Some(OldMediaProcessorJobData { - location_path, - to_process_path, - maybe_thumbnailer_progress_rx, - #[cfg(feature = "ai")] - labeler_batch_token, - #[cfg(feature = "ai")] - maybe_labels_rx: labels_rx, - }); - - Ok(( - Self::RunMetadata { - thumbs_processed: thumbs_to_process_count, - ..Default::default() - }, - chunked_files, - ) - .into()) - } - - async fn execute_step( - &self, - ctx: &WorkerContext, - CurrentStep { step, step_number }: CurrentStep<'_, Self::Step>, - data: &Self::Data, - _: &Self::RunMetadata, - ) -> Result, JobError> { - match step { - OldMediaProcessorJobStep::ExtractMediaData(file_paths) => process( - file_paths, - self.location.id, - &data.location_path, - &ctx.library.db, - &|completed_count| { - ctx.progress(vec![JobReportUpdate::CompletedTaskCount( - step_number * BATCH_SIZE + completed_count, - )]); - }, - ) - .await - .map(Into::into) - .map_err(Into::into), - - OldMediaProcessorJobStep::WaitThumbnails(total_thumbs) => { - ctx.progress(vec![ - JobReportUpdate::TaskCount(*total_thumbs), - JobReportUpdate::Phase("thumbnails".to_string()), - JobReportUpdate::Message(format!( - "Waiting for processing of {total_thumbs} thumbnails", - )), - ]); - - let mut progress_rx = pin!(if let Some(progress_rx) = - data.maybe_thumbnailer_progress_rx.clone() - { - progress_rx - } else { - let (progress_tx, progress_rx) = chan::unbounded(); - - ctx.node - .thumbnailer - .register_reporter(self.location.id, progress_tx) - .await; - - progress_rx - }); - - let mut total_completed = 0; - - while let Some((completed, total)) = progress_rx.next().await { - trace!("Received progress update from thumbnailer: {completed}/{total}",); - ctx.progress(vec![JobReportUpdate::CompletedTaskCount( - completed as usize, - )]); - total_completed = completed; - } - - if progress_rx.is_closed() && total_completed < *total_thumbs as u32 { - warn!( - "Thumbnailer progress reporter channel closed before all thumbnails were \ - processed, job will wait a bit waiting for a shutdown signal from manager" - ); - sleep(Duration::from_secs(5)).await; - } - - Ok(None.into()) - } - - #[cfg(feature = "ai")] - OldMediaProcessorJobStep::WaitLabels(total_labels) => { - let Some(image_labeller) = ctx.node.old_image_labeller.as_ref() else { - let err = "AI system is disabled due to a previous error, skipping labels job"; - error!(err); - return Ok(JobRunErrors(vec![err.to_string()]).into()); - }; - - ctx.progress(vec![ - JobReportUpdate::TaskCount(*total_labels), - JobReportUpdate::Phase("labels".to_string()), - JobReportUpdate::Message( - format!("Extracting labels for {total_labels} files",), - ), - ]); - - let mut labels_rx = pin!(if let Some(labels_rx) = data.maybe_labels_rx.clone() { - labels_rx - } else { - match image_labeller - .resume_batch( - data.labeler_batch_token, - Arc::clone(&ctx.library.db), - ctx.library.sync.clone(), - ) - .await - { - Ok(labels_rx) => labels_rx, - Err(e) => return Ok(JobRunErrors(vec![e.to_string()]).into()), - } - }); - - let mut total_labeled = 0; - - let mut errors = Vec::new(); - - while let Some(LabelerOutput { - file_path_id, - has_new_labels, - result, - }) = labels_rx.next().await - { - total_labeled += 1; - ctx.progress(vec![JobReportUpdate::CompletedTaskCount(total_labeled)]); - - if let Err(e) = result { - error!( - "Failed to generate labels : {e:#?}", - file_path_id - ); - - errors.push(e.to_string()); - } else if has_new_labels { - // invalidate_query!(&ctx.library, "labels.count"); // TODO: This query doesn't exist on main yet - } - } - - invalidate_query!(&ctx.library, "labels.list"); - invalidate_query!(&ctx.library, "labels.getForObject"); - invalidate_query!(&ctx.library, "labels.getWithObjects"); - - if !errors.is_empty() { - Ok(JobRunErrors(errors).into()) - } else { - Ok(None.into()) - } - } - } - } - - async fn finalize( - &self, - ctx: &WorkerContext, - data: &Option, - run_metadata: &Self::RunMetadata, - ) -> JobResult { - info!( - "Finished media processing for location {} at {}", - self.location.id, - data.as_ref() - .expect("critical error: missing data on job state") - .to_process_path - .display() - ); - - if run_metadata.media_data.extracted > 0 { - invalidate_query!(ctx.library, "search.paths"); - } - - ctx.library - .db - .location() - .update( - location::id::equals(self.location.id), - vec![location::scan_state::set(ScanState::Completed as i32)], - ) - .exec() - .await - .map_err(MediaProcessorError::from)?; - - Ok(Some(json!({"init: ": self, "run_metadata": run_metadata}))) - } -} - -async fn dispatch_thumbnails_for_processing( - location_id: location::id::Type, - location_path: impl AsRef, - parent_iso_file_path: &IsolatedFilePathData<'_>, - library: &Library, - node: &Node, - should_regenerate: bool, -) -> Result { - let Library { db, .. } = library; - - let location_path = location_path.as_ref(); - - let mut file_paths = get_all_children_files_by_extensions( - db, - parent_iso_file_path, - &old_thumbnail::ALL_THUMBNAILABLE_EXTENSIONS, - ) - .await?; - - if file_paths.is_empty() { - return Ok(0); - } - - let first_materialized_path = file_paths[0].materialized_path.clone(); - - // Only the first materialized_path should be processed in foreground - let different_materialized_path_idx = file_paths - .iter() - .position(|file_path| file_path.materialized_path != first_materialized_path); - - let background_thumbs_args = different_materialized_path_idx - .map(|idx| { - file_paths - .split_off(idx) - .into_iter() - .filter_map(|file_path| prepare_args(location_id, location_path, file_path)) - .collect::>() - }) - .unwrap_or_default(); - - let foreground_thumbs_args = file_paths - .into_iter() - .filter_map(|file_path| prepare_args(location_id, location_path, file_path)) - .collect::>(); - - let thumbs_count = background_thumbs_args.len() + foreground_thumbs_args.len(); - - debug!( - "Dispatching {thumbs_count} thumbnails to be processed, {} in foreground and {} in background", - foreground_thumbs_args.len(), - background_thumbs_args.len() - ); - - if !foreground_thumbs_args.is_empty() { - node.thumbnailer - .new_indexed_thumbnails_tracked_batch( - BatchToProcess::new(foreground_thumbs_args, should_regenerate, false), - library.id, - location_id, - ) - .await; - } - - if !background_thumbs_args.is_empty() { - node.thumbnailer - .new_indexed_thumbnails_tracked_batch( - BatchToProcess::new(background_thumbs_args, should_regenerate, true), - library.id, - location_id, - ) - .await; - } - - Ok(thumbs_count as u32) -} - -async fn get_files_for_media_data_extraction( - db: &PrismaClient, - parent_iso_file_path: &IsolatedFilePathData<'_>, -) -> Result, MediaProcessorError> { - get_all_children_files_by_extensions( - db, - parent_iso_file_path, - &media_data_extractor::FILTERED_IMAGE_EXTENSIONS, - ) - .await - .map_err(Into::into) -} - -#[cfg(feature = "ai")] -async fn get_files_for_labeling( - db: &PrismaClient, - parent_iso_file_path: &IsolatedFilePathData<'_>, - regenerate_labels: bool, -) -> Result, MediaProcessorError> { - // FIXME: Had to use format! macro because PCR doesn't support IN with Vec for SQLite - // We have no data coming from the user, so this is sql injection safe - db._query_raw(raw!( - &format!( - "SELECT id, materialized_path, is_dir, name, extension, cas_id, object_id - FROM file_path f - WHERE - location_id={{}} - AND cas_id IS NOT NULL - AND LOWER(extension) IN ({}) - AND materialized_path LIKE {{}} - {} - ORDER BY materialized_path ASC", - // Ordering by materialized_path so we can prioritize processing the first files - // in the above part of the directories tree - &media_data_extractor::FILTERED_IMAGE_EXTENSIONS - .iter() - .map(|ext| format!("LOWER('{ext}')")) - .collect::>() - .join(","), - if !regenerate_labels { - "AND NOT EXISTS (SELECT 1 FROM label_on_object WHERE object_id = f.object_id)" - } else { - "" - } - ), - PrismaValue::Int(parent_iso_file_path.location_id() as i64), - PrismaValue::String(format!( - "{}%", - parent_iso_file_path - .materialized_path_for_children() - .expect("sub path iso_file_path must be a directory") - )) - )) - .exec() - .await - .map_err(Into::into) -} - -async fn get_all_children_files_by_extensions( - db: &PrismaClient, - parent_iso_file_path: &IsolatedFilePathData<'_>, - extensions: &[Extension], -) -> Result, MediaProcessorError> { - // FIXME: Had to use format! macro because PCR doesn't support IN with Vec for SQLite - // We have no data coming from the user, so this is sql injection safe - db._query_raw(raw!( - &format!( - "SELECT id, materialized_path, is_dir, name, extension, cas_id, object_id - FROM file_path - WHERE - location_id={{}} - AND cas_id IS NOT NULL - AND LOWER(extension) IN ({}) - AND materialized_path LIKE {{}} - ORDER BY materialized_path ASC", - // Ordering by materialized_path so we can prioritize processing the first files - // in the above part of the directories tree - extensions - .iter() - .map(|ext| format!("LOWER('{ext}')")) - .collect::>() - .join(",") - ), - PrismaValue::Int(parent_iso_file_path.location_id() as i64), - PrismaValue::String(format!( - "{}%", - parent_iso_file_path - .materialized_path_for_children() - .expect("sub path iso_file_path must be a directory") - )) - )) - .exec() - .await - .map_err(Into::into) -} - -fn prepare_args( - location_id: location::id::Type, - location_path: &Path, // This function is only used internally once, so we can pass &Path as a parameter - file_path: file_path_for_media_processor::Data, -) -> Option { - let file_path_id = file_path.id; - - let Ok(cas_id) = maybe_missing(&file_path.cas_id, "file_path.cas_id").cloned() else { - error!("Missing cas_id for file_path "); - return None; - }; - - let Ok(iso_file_path) = IsolatedFilePathData::try_from((location_id, file_path)).map_err(|e| { - error!("Failed to extract isolated file path data from file path : {e:#?}"); - }) else { - return None; - }; - - Some(GenerateThumbnailArgs::new( - iso_file_path.extension().to_string(), - cas_id, - location_path.join(&iso_file_path), - )) -} diff --git a/core/src/object/media/old_media_processor/mod.rs b/core/src/object/media/old_media_processor/mod.rs deleted file mode 100644 index 6fefbb3a5..000000000 --- a/core/src/object/media/old_media_processor/mod.rs +++ /dev/null @@ -1,80 +0,0 @@ -use crate::old_job::{JobRunErrors, JobRunMetadata}; - -use sd_core_file_path_helper::FilePathError; -use sd_core_prisma_helpers::file_path_for_media_processor; - -use sd_prisma::prisma::{location, PrismaClient}; - -use std::path::Path; - -use serde::{Deserialize, Serialize}; -use thiserror::Error; -use tracing::error; - -use super::{ - media_data_extractor::{self, MediaDataError, OldMediaDataExtractorMetadata}, - old_thumbnail::{self, BatchToProcess, ThumbnailerError}, -}; - -mod job; -mod shallow; - -pub use job::OldMediaProcessorJobInit; -pub use shallow::old_shallow; - -#[derive(Error, Debug)] -pub enum MediaProcessorError { - #[error("sub path not found: ", .0.display())] - SubPathNotFound(Box), - - #[error("database error: {0}")] - Database(#[from] prisma_client_rust::QueryError), - #[error(transparent)] - FilePath(#[from] FilePathError), - - #[error(transparent)] - Thumbnailer(#[from] ThumbnailerError), - #[error(transparent)] - MediaDataExtractor(#[from] MediaDataError), -} - -#[derive(Debug, Serialize, Deserialize, Default)] -pub struct OldMediaProcessorMetadata { - media_data: OldMediaDataExtractorMetadata, - thumbs_processed: u32, - labels_extracted: u32, -} - -impl From for OldMediaProcessorMetadata { - fn from(media_data: OldMediaDataExtractorMetadata) -> Self { - Self { - media_data, - thumbs_processed: 0, - labels_extracted: 0, - } - } -} - -impl JobRunMetadata for OldMediaProcessorMetadata { - fn update(&mut self, new_data: Self) { - self.media_data.extracted += new_data.media_data.extracted; - self.media_data.skipped += new_data.media_data.skipped; - self.thumbs_processed += new_data.thumbs_processed; - self.labels_extracted += new_data.labels_extracted; - } -} - -pub async fn process( - files_paths: &[file_path_for_media_processor::Data], - location_id: location::id::Type, - location_path: impl AsRef, - db: &PrismaClient, - ctx_update_fn: &impl Fn(usize), -) -> Result<(OldMediaProcessorMetadata, JobRunErrors), MediaProcessorError> { - // Add here new kinds of media processing if necessary in the future - - media_data_extractor::process(files_paths, location_id, location_path, db, ctx_update_fn) - .await - .map(|(media_data, errors)| (media_data.into(), errors)) - .map_err(Into::into) -} diff --git a/core/src/object/media/old_media_processor/shallow.rs b/core/src/object/media/old_media_processor/shallow.rs deleted file mode 100644 index 59d89ca2f..000000000 --- a/core/src/object/media/old_media_processor/shallow.rs +++ /dev/null @@ -1,330 +0,0 @@ -use crate::{ - invalidate_query, - library::Library, - object::media::old_thumbnail::GenerateThumbnailArgs, - old_job::{JobError, JobRunMetadata}, - Node, -}; - -use sd_core_file_path_helper::{ - ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - IsolatedFilePathData, -}; -use sd_core_prisma_helpers::file_path_for_media_processor; - -use sd_file_ext::extensions::Extension; -use sd_prisma::prisma::{location, PrismaClient}; -use sd_utils::db::maybe_missing; - -#[cfg(feature = "ai")] -use sd_ai::old_image_labeler::LabelerOutput; - -use std::path::{Path, PathBuf}; - -#[cfg(feature = "ai")] -use std::sync::Arc; - -use itertools::Itertools; -use prisma_client_rust::{raw, PrismaValue}; -use tracing::{debug, error}; - -#[cfg(feature = "ai")] -use futures::StreamExt; - -use super::{ - media_data_extractor::{self, process}, - old_thumbnail::{self, BatchToProcess}, - MediaProcessorError, OldMediaProcessorMetadata, -}; - -const BATCH_SIZE: usize = 10; - -pub async fn old_shallow( - location: &location::Data, - sub_path: &PathBuf, - library @ Library { - db, - #[cfg(feature = "ai")] - sync, - .. - }: &Library, - #[cfg(feature = "ai")] regenerate_labels: bool, - node: &Node, -) -> Result<(), JobError> { - let location_id = location.id; - let location_path = maybe_missing(&location.path, "location.path").map(PathBuf::from)?; - - let iso_file_path = if sub_path != Path::new("") { - let full_path = ensure_sub_path_is_in_location(&location_path, &sub_path) - .await - .map_err(MediaProcessorError::from)?; - ensure_sub_path_is_directory(&location_path, &sub_path) - .await - .map_err(MediaProcessorError::from)?; - - let sub_iso_file_path = - IsolatedFilePathData::new(location_id, &location_path, &full_path, true) - .map_err(MediaProcessorError::from)?; - - ensure_file_path_exists( - &sub_path, - &sub_iso_file_path, - db, - MediaProcessorError::SubPathNotFound, - ) - .await?; - - sub_iso_file_path - } else { - IsolatedFilePathData::new(location_id, &location_path, &location_path, true) - .map_err(MediaProcessorError::from)? - }; - - debug!("Searching for media in location {location_id} at path {iso_file_path}"); - - dispatch_thumbnails_for_processing( - location.id, - &location_path, - &iso_file_path, - library, - node, - false, - ) - .await?; - - let file_paths = get_files_for_media_data_extraction(db, &iso_file_path).await?; - - #[cfg(feature = "ai")] - let file_paths_for_labelling = - get_files_for_labeling(db, &iso_file_path, regenerate_labels).await?; - - #[cfg(feature = "ai")] - let has_labels = !file_paths_for_labelling.is_empty(); - - let total_files = file_paths.len(); - - let chunked_files = file_paths - .into_iter() - .chunks(BATCH_SIZE) - .into_iter() - .map(Iterator::collect) - .collect::>>(); - - debug!( - "Preparing to process {total_files} files in {} chunks", - chunked_files.len() - ); - - #[cfg(feature = "ai")] - // Check if we have an image labeller and has_labels then enqueue a new batch - let labels_rx = node.old_image_labeller.as_ref().and_then(|image_labeller| { - has_labels.then(|| { - image_labeller.new_batch( - location_id, - location_path.clone(), - file_paths_for_labelling, - Arc::clone(db), - sync.clone(), - ) - }) - }); - - let mut run_metadata = OldMediaProcessorMetadata::default(); - - for files in chunked_files { - let (more_run_metadata, errors) = process(&files, location.id, &location_path, db, &|_| {}) - .await - .map_err(MediaProcessorError::from)?; - - run_metadata.update(more_run_metadata.into()); - - if !errors.is_empty() { - error!("Errors processing chunk of media data shallow extraction:\n{errors}"); - } - } - - debug!("Media shallow processor run metadata: {run_metadata:?}"); - - if run_metadata.media_data.extracted > 0 { - invalidate_query!(library, "search.paths"); - invalidate_query!(library, "search.objects"); - } - - #[cfg(feature = "ai")] - { - if has_labels { - if let Some(labels_rx) = labels_rx { - labels_rx - .await - .for_each( - |LabelerOutput { - file_path_id, - has_new_labels, - result, - }| async move { - if let Err(e) = result { - error!( - "Failed to generate labels : {e:#?}" - ); - } else if has_new_labels { - // invalidate_query!(library, "labels.count"); // TODO: This query doesn't exist on main yet - } - }, - ) - .await; - - invalidate_query!(library, "labels.list"); - invalidate_query!(library, "labels.getForObject"); - invalidate_query!(library, "labels.getWithObjects"); - } - } - } - - Ok(()) -} - -async fn get_files_for_media_data_extraction( - db: &PrismaClient, - parent_iso_file_path: &IsolatedFilePathData<'_>, -) -> Result, MediaProcessorError> { - get_files_by_extensions( - db, - parent_iso_file_path, - &media_data_extractor::FILTERED_IMAGE_EXTENSIONS, - ) - .await - .map_err(Into::into) -} - -#[cfg(feature = "ai")] -async fn get_files_for_labeling( - db: &PrismaClient, - parent_iso_file_path: &IsolatedFilePathData<'_>, - regenerate_labels: bool, -) -> Result, MediaProcessorError> { - // FIXME: Had to use format! macro because PCR doesn't support IN with Vec for SQLite - // We have no data coming from the user, so this is sql injection safe - db._query_raw(raw!( - &format!( - "SELECT id, materialized_path, is_dir, name, extension, cas_id, object_id - FROM file_path f - WHERE - location_id={{}} - AND cas_id IS NOT NULL - AND LOWER(extension) IN ({}) - AND materialized_path = {{}} - {}", - &media_data_extractor::FILTERED_IMAGE_EXTENSIONS - .iter() - .map(|ext| format!("LOWER('{ext}')")) - .collect::>() - .join(","), - if !regenerate_labels { - "AND NOT EXISTS (SELECT 1 FROM label_on_object WHERE object_id = f.object_id)" - } else { - "" - } - ), - PrismaValue::Int(parent_iso_file_path.location_id() as i64), - PrismaValue::String( - parent_iso_file_path - .materialized_path_for_children() - .expect("sub path iso_file_path must be a directory") - ) - )) - .exec() - .await - .map_err(Into::into) -} - -async fn dispatch_thumbnails_for_processing( - location_id: location::id::Type, - location_path: impl AsRef, - parent_iso_file_path: &IsolatedFilePathData<'_>, - library: &Library, - node: &Node, - should_regenerate: bool, -) -> Result<(), MediaProcessorError> { - let Library { db, .. } = library; - - let location_path = location_path.as_ref(); - - let file_paths = get_files_by_extensions( - db, - parent_iso_file_path, - &old_thumbnail::ALL_THUMBNAILABLE_EXTENSIONS, - ) - .await?; - - let current_batch = file_paths - .into_iter() - .filter_map(|file_path| { - if let Some(cas_id) = file_path.cas_id.as_ref() { - Some((cas_id.clone(), file_path)) - } else { - error!("File path has no cas_id, skipping", file_path.id); - None - } - }) - .filter_map(|(cas_id, file_path)| { - let file_path_id = file_path.id; - IsolatedFilePathData::try_from((location_id, file_path)) - .map_err(|e| { - error!("Failed to extract isolated file path data from file path : {e:#?}"); - }) - .ok() - .map(|iso_file_path| (cas_id, iso_file_path)) - }) - .map(|(cas_id, iso_file_path)| { - let full_path = location_path.join(&iso_file_path); - - GenerateThumbnailArgs::new(iso_file_path.extension().to_string(), cas_id, full_path) - }) - .collect::>(); - - // Let's not send an empty batch lol - if !current_batch.is_empty() { - node.thumbnailer - .new_indexed_thumbnails_batch( - BatchToProcess::new(current_batch, should_regenerate, false), - library.id, - ) - .await; - } - - Ok(()) -} - -async fn get_files_by_extensions( - db: &PrismaClient, - parent_iso_file_path: &IsolatedFilePathData<'_>, - extensions: &[Extension], -) -> Result, MediaProcessorError> { - // FIXME: Had to use format! macro because PCR doesn't support IN with Vec for SQLite - // We have no data coming from the user, so this is sql injection safe - db._query_raw(raw!( - &format!( - "SELECT id, materialized_path, is_dir, name, extension, cas_id, object_id - FROM file_path - WHERE - location_id={{}} - AND cas_id IS NOT NULL - AND LOWER(extension) IN ({}) - AND materialized_path = {{}}", - extensions - .iter() - .map(|ext| format!("LOWER('{ext}')")) - .collect::>() - .join(",") - ), - PrismaValue::Int(parent_iso_file_path.location_id() as i64), - PrismaValue::String( - parent_iso_file_path - .materialized_path_for_children() - .expect("sub path iso_file_path must be a directory") - ) - )) - .exec() - .await - .map_err(Into::into) -} diff --git a/core/src/object/media/old_thumbnail/clean_up.rs b/core/src/object/media/old_thumbnail/clean_up.rs index 70a4c7f4d..0d65409be 100644 --- a/core/src/object/media/old_thumbnail/clean_up.rs +++ b/core/src/object/media/old_thumbnail/clean_up.rs @@ -11,6 +11,8 @@ use tracing::{debug, error}; use super::{ThumbnailerError, EPHEMERAL_DIR, WEBP_EXTENSION}; +// TODO(fogodev) Introduce a task using the new task system to clean up the thumbnails from time to time. + pub(super) async fn process_ephemeral_clean_up( thumbnails_directory: Arc, existing_ephemeral_thumbs: HashSet, @@ -51,9 +53,10 @@ pub(super) async fn process_ephemeral_clean_up( { to_remove.push(async move { debug!( - "Removing stale ephemeral thumbnail: {}", - thumb_path.display() + thumb_path = %thumb_path.display(), + "Removing stale ephemeral thumbnail;", ); + fs::remove_file(&thumb_path).await.map_err(|e| { ThumbnailerError::FileIO(FileIOError::from((thumb_path, e))) }) @@ -67,14 +70,14 @@ pub(super) async fn process_ephemeral_clean_up( }) .await .map_or_else( - |e| error!("Join error on ephemeral clean up: {e:#?}",), + |e| error!(?e, "Join error on ephemeral clean up;",), |fetching_res| { fetching_res.map_or_else( - |e| error!("Error fetching ephemeral thumbs to be removed: {e:#?}"), + |e| error!(?e, "Error fetching ephemeral thumbs to be removed;"), |remove_results| { remove_results.into_iter().for_each(|remove_res| { if let Err(e) = remove_res { - error!("Error on ephemeral clean up: {e:#?}"); + error!(?e, "Error on ephemeral clean up;"); } }) }, @@ -140,9 +143,10 @@ pub(super) async fn process_indexed_clean_up( { to_remove.push(async move { debug!( - "Removing stale indexed thumbnail: {}", - thumb_path.display() + thumb_path = %thumb_path.display(), + "Removing stale indexed thumbnail;", ); + fs::remove_file(&thumb_path).await.map_err(|e| { ThumbnailerError::FileIO(FileIOError::from((thumb_path, e))) }) @@ -161,18 +165,18 @@ pub(super) async fn process_indexed_clean_up( .into_iter() .filter_map(|join_res| { join_res - .map_err(|e| error!("Join error on indexed clean up: {e:#?}")) + .map_err(|e| error!(?e, "Join error on indexed clean up;")) .ok() }) .filter_map(|fetching_res| { fetching_res - .map_err(|e| error!("Error fetching indexed thumbs to be removed: {e:#?}")) + .map_err(|e| error!(?e, "Error fetching indexed thumbs to be removed;")) .ok() }) .for_each(|remove_results| { remove_results.into_iter().for_each(|remove_res| { if let Err(e) = remove_res { - error!("Error on indexed clean up: {e:#?}"); + error!(?e, "Error on indexed clean up;"); } }) }) diff --git a/core/src/object/media/old_thumbnail/directory.rs b/core/src/object/media/old_thumbnail/directory.rs index 38db7adf5..d6d00caca 100644 --- a/core/src/object/media/old_thumbnail/directory.rs +++ b/core/src/object/media/old_thumbnail/directory.rs @@ -27,6 +27,8 @@ use super::{ VERSION_FILE, WEBP_EXTENSION, }; +// TODO(fogodev): Move this logic to be used alongside the NodeConfig or other Node part to run at app startup + #[derive( IntEnum, Debug, Clone, Copy, Eq, PartialEq, strum::Display, Serialize_repr, Deserialize_repr, )] @@ -56,7 +58,7 @@ pub(super) async fn init_thumbnail_dir( debug!("Initializing thumbnail directory"); let thumbnails_directory = data_dir.as_ref().join(THUMBNAIL_CACHE_DIR_NAME); - debug!("Thumbnail directory: {:?}", thumbnails_directory); + debug!(thumbnails_directory = %thumbnails_directory.display()); // create thumbnails base directory fs::create_dir_all(&thumbnails_directory) @@ -89,7 +91,7 @@ pub(super) async fn init_thumbnail_dir( }; if let Err(e) = process_migration(thumbnails_directory, databases).await { - error!("Failed to migrate thumbnails: {e:#?}"); + error!(?e, "Failed to migrate thumbnails;"); } } }); @@ -133,7 +135,8 @@ async fn process_migration( } _ => { - error!("Thumbnail version is not handled: {:?}", current); + error!(current_version = ?current, "Thumbnail version is not handled;"); + Err(VersionManagerError::UnexpectedMigration { current_version: current.int_value(), next_version: next.int_value(), @@ -187,10 +190,7 @@ async fn move_to_shards(thumbnails_directory: impl AsRef) -> Result<(), Th } } - info!( - "Moved {} webp files to their respective shard folders.", - count - ); + info!(%count, "Moved webp files to their respective shard folders;"); Ok(()) } @@ -237,9 +237,9 @@ async fn segregate_thumbnails_by_library( async move { trace!( - "Moving thumbnail from old location to new location: {} -> {}", - old.display(), - new.display() + old_location = %old.display(), + new_location = %new.display(), + "Moving thumbnail from old location to new location;", ); match fs::rename(&old, new).await { @@ -271,8 +271,10 @@ async fn segregate_thumbnails_by_library( let moved_count = to_move.try_join().await?.into_iter().sum::(); info!( - "Created {shards_created_count} shards and moved {moved_count} \ - thumbnails to library folder {library_id}" + %shards_created_count, + %moved_count, + %library_id + "Created shards and moved thumbnails to library folder;", ); Ok::<_, ThumbnailerError>(()) @@ -332,9 +334,9 @@ async fn segregate_thumbnails_by_library( to_move.push(async move { trace!( - "Moving thumbnail from old location to new location: {} -> {}", - thumb_path.display(), - new_ephemeral_shard.display() + old_location = %thumb_path.display(), + new_location = %new_ephemeral_shard.display(), + "Moving thumbnail from old location to new location;" ); fs::rename(&thumb_path, &new_ephemeral_shard) @@ -361,7 +363,7 @@ async fn segregate_thumbnails_by_library( let moved_shard = to_move.try_join().await?.len(); - info!("Moved {moved_shard} shards to the ephemeral directory"); + info!(%moved_shards, "Moved shards to the ephemeral directory;"); empty_shards .into_iter() @@ -369,7 +371,7 @@ async fn segregate_thumbnails_by_library( path.file_name() .map_or(false, |name| name.len() == 2) .then_some(async move { - trace!("Removing empty shard directory: {}", path.display()); + trace!(path = path.display(), "Removing empty shard directory;"); fs::remove_dir(&path) .await .map_err(|e| FileIOError::from((path, e))) diff --git a/core/src/object/media/old_thumbnail/mod.rs b/core/src/object/media/old_thumbnail/mod.rs deleted file mode 100644 index 0880800a9..000000000 --- a/core/src/object/media/old_thumbnail/mod.rs +++ /dev/null @@ -1,201 +0,0 @@ -use crate::{library::LibraryId, util::version_manager::VersionManagerError, Node}; - -use sd_file_ext::extensions::{ - DocumentExtension, Extension, ImageExtension, ALL_DOCUMENT_EXTENSIONS, ALL_IMAGE_EXTENSIONS, -}; -use sd_utils::error::FileIOError; - -#[cfg(feature = "ffmpeg")] -use sd_file_ext::extensions::{VideoExtension, ALL_VIDEO_EXTENSIONS}; - -use std::{ - path::{Path, PathBuf}, - time::Duration, -}; - -use once_cell::sync::Lazy; -use serde::{Deserialize, Serialize}; -use thiserror::Error; -use tokio::task; -use tracing::error; - -mod clean_up; -mod directory; -pub mod old_actor; -pub mod preferences; -mod process; -mod shard; -mod state; -mod worker; - -pub use process::{BatchToProcess, GenerateThumbnailArgs}; -pub use shard::get_shard_hex; - -use directory::ThumbnailVersion; - -// Files names constants -const THUMBNAIL_CACHE_DIR_NAME: &str = "thumbnails"; -const SAVE_STATE_FILE: &str = "thumbs_to_process.bin"; -const VERSION_FILE: &str = "version.txt"; -pub const WEBP_EXTENSION: &str = "webp"; -const EPHEMERAL_DIR: &str = "ephemeral"; - -/// This is the target pixel count for all thumbnails to be resized to, and it is eventually downscaled -/// to [`TARGET_QUALITY`]. -const TARGET_PX: f32 = 262144_f32; - -/// This is the target quality that we render thumbnails at, it is a float between 0-100 -/// and is treated as a percentage (so 30% in this case, or it's the same as multiplying by `0.3`). -const TARGET_QUALITY: f32 = 30_f32; - -// Some time constants -const ONE_SEC: Duration = Duration::from_secs(1); -const THIRTY_SECS: Duration = Duration::from_secs(30); -const HALF_HOUR: Duration = Duration::from_secs(30 * 60); - -#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] -pub enum ThumbnailKind { - Ephemeral, - Indexed(LibraryId), -} - -pub fn get_indexed_thumbnail_path(node: &Node, cas_id: &str, library_id: LibraryId) -> PathBuf { - get_thumbnail_path(node, cas_id, ThumbnailKind::Indexed(library_id)) -} - -/// This does not check if a thumbnail exists, it just returns the path that it would exist at -fn get_thumbnail_path(node: &Node, cas_id: &str, kind: ThumbnailKind) -> PathBuf { - let mut thumb_path = node.config.data_directory(); - - thumb_path.push(THUMBNAIL_CACHE_DIR_NAME); - match kind { - ThumbnailKind::Ephemeral => thumb_path.push(EPHEMERAL_DIR), - ThumbnailKind::Indexed(library_id) => { - thumb_path.push(library_id.to_string()); - } - } - thumb_path.push(get_shard_hex(cas_id)); - thumb_path.push(cas_id); - thumb_path.set_extension(WEBP_EXTENSION); - - thumb_path -} - -pub fn get_indexed_thumb_key(cas_id: &str, library_id: LibraryId) -> Vec { - get_thumb_key(cas_id, ThumbnailKind::Indexed(library_id)) -} - -pub fn get_ephemeral_thumb_key(cas_id: &str) -> Vec { - get_thumb_key(cas_id, ThumbnailKind::Ephemeral) -} - -// this is used to pass the relevant data to the frontend so it can request the thumbnail -// it supports extending the shard hex to support deeper directory structures in the future -fn get_thumb_key(cas_id: &str, kind: ThumbnailKind) -> Vec { - vec![ - match kind { - ThumbnailKind::Ephemeral => String::from(EPHEMERAL_DIR), - ThumbnailKind::Indexed(library_id) => library_id.to_string(), - }, - get_shard_hex(cas_id).to_string(), - cas_id.to_string(), - ] -} - -#[cfg(feature = "ffmpeg")] -pub(super) static THUMBNAILABLE_VIDEO_EXTENSIONS: Lazy> = Lazy::new(|| { - ALL_VIDEO_EXTENSIONS - .iter() - .cloned() - .filter(can_generate_thumbnail_for_video) - .map(Extension::Video) - .collect() -}); - -pub(super) static THUMBNAILABLE_EXTENSIONS: Lazy> = Lazy::new(|| { - ALL_IMAGE_EXTENSIONS - .iter() - .cloned() - .filter(can_generate_thumbnail_for_image) - .map(Extension::Image) - .chain( - ALL_DOCUMENT_EXTENSIONS - .iter() - .cloned() - .filter(can_generate_thumbnail_for_document) - .map(Extension::Document), - ) - .collect() -}); - -pub(super) static ALL_THUMBNAILABLE_EXTENSIONS: Lazy> = Lazy::new(|| { - #[cfg(feature = "ffmpeg")] - return THUMBNAILABLE_EXTENSIONS - .iter() - .cloned() - .chain(THUMBNAILABLE_VIDEO_EXTENSIONS.iter().cloned()) - .collect(); - - #[cfg(not(feature = "ffmpeg"))] - THUMBNAILABLE_EXTENSIONS.clone() -}); - -#[derive(Error, Debug)] -pub enum ThumbnailerError { - // Internal errors - #[error("database error: {0}")] - Database(#[from] prisma_client_rust::QueryError), - #[error(transparent)] - FileIO(#[from] FileIOError), - #[error(transparent)] - VersionManager(#[from] VersionManagerError), - #[error("failed to encode webp")] - WebPEncoding { path: Box, reason: String }, - #[error("error while converting the image")] - SdImages { - path: Box, - error: sd_images::Error, - }, - #[error("failed to execute converting task: {0}")] - Task(#[from] task::JoinError), - #[cfg(feature = "ffmpeg")] - #[error(transparent)] - FFmpeg(#[from] sd_ffmpeg::Error), - #[error("thumbnail generation timed out for {}", .0.display())] - TimedOut(Box), -} - -#[derive(Debug, Serialize, Deserialize, Clone, Copy)] -pub enum ThumbnailerEntryKind { - Image, - #[cfg(feature = "ffmpeg")] - Video, -} - -#[derive(Serialize, Deserialize, Default, Debug)] -pub struct ThumbnailerMetadata { - pub created: u32, - pub skipped: u32, -} - -#[cfg(feature = "ffmpeg")] -pub const fn can_generate_thumbnail_for_video(video_extension: &VideoExtension) -> bool { - use VideoExtension::*; - // File extensions that are specifically not supported by the thumbnailer - !matches!(video_extension, Mpg | Swf | M2v | Hevc | M2ts | Mts | Ts) -} - -pub const fn can_generate_thumbnail_for_image(image_extension: &ImageExtension) -> bool { - use ImageExtension::*; - - matches!( - image_extension, - Jpg | Jpeg | Png | Webp | Gif | Svg | Heic | Heics | Heif | Heifs | Avif | Bmp | Ico - ) -} - -pub const fn can_generate_thumbnail_for_document(document_extension: &DocumentExtension) -> bool { - use DocumentExtension::*; - - matches!(document_extension, Pdf) -} diff --git a/core/src/object/media/old_thumbnail/old_actor.rs b/core/src/object/media/old_thumbnail/old_actor.rs deleted file mode 100644 index 8996c81f3..000000000 --- a/core/src/object/media/old_thumbnail/old_actor.rs +++ /dev/null @@ -1,335 +0,0 @@ -use crate::{ - api::CoreEvent, - library::{Libraries, LibraryId, LibraryManagerEvent}, - node::config::NodePreferences, -}; - -use sd_prisma::prisma::{location, PrismaClient}; -use sd_utils::error::{FileIOError, NonUtf8PathError}; - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use async_channel as chan; -use once_cell::sync::OnceCell; -use thiserror::Error; -use tokio::{ - fs, spawn, - sync::{broadcast, oneshot, watch, Mutex}, - time::{sleep, Instant}, -}; -use tracing::{error, trace}; -use uuid::Uuid; - -use super::{ - directory::init_thumbnail_dir, - process::{generate_thumbnail, ThumbData}, - state::RegisterReporter, - worker::{old_worker, WorkerChannels}, - BatchToProcess, ThumbnailKind, ThumbnailerError, ONE_SEC, THUMBNAIL_CACHE_DIR_NAME, -}; - -static AVAILABLE_PARALLELISM: OnceCell = OnceCell::new(); - -#[derive(Error, Debug)] -pub(super) enum ActorError { - #[error("database error")] - Database(#[from] prisma_client_rust::QueryError), - #[error(transparent)] - FileIO(#[from] FileIOError), - #[error(transparent)] - NonUtf8Path(#[from] NonUtf8PathError), -} - -#[derive(Debug)] -pub(super) enum DatabaseMessage { - Add(Uuid, Arc), - Update(Uuid, Arc), - Remove(Uuid), -} - -// Thumbnails directory have the following structure: -// thumbnails/ -// ├── version.txt -// ├── thumbs_to_process.bin # processing save state -// ├── ephemeral/ # ephemeral ones have it's own directory -// │ └── [0..3]/ # sharding -// │ └── .webp -// └── / # we segregate thumbnails by library -// └── [0..3]/ # sharding -// └── .webp -pub struct OldThumbnailer { - thumbnails_directory: Arc, - cas_ids_to_delete_tx: chan::Sender<(Vec, ThumbnailKind)>, - thumbnails_to_generate_tx: chan::Sender<(BatchToProcess, ThumbnailKind)>, - progress_reporter_tx: chan::Sender, - last_single_thumb_generated: Mutex, - reporter: broadcast::Sender, - cancel_tx: chan::Sender>, -} - -impl OldThumbnailer { - pub async fn new( - data_dir: impl AsRef, - libraries_manager: Arc, - reporter: broadcast::Sender, - node_preferences_rx: watch::Receiver, - ) -> Self { - let data_dir = data_dir.as_ref(); - let thumbnails_directory = Arc::new( - init_thumbnail_dir(data_dir, Arc::clone(&libraries_manager)) - .await - .unwrap_or_else(|e| { - error!("Failed to initialize thumbnail directory: {e:#?}"); - data_dir.join(THUMBNAIL_CACHE_DIR_NAME) - }), - ); - - let (progress_management_tx, progress_management_rx) = chan::bounded(16); - - let (databases_tx, databases_rx) = chan::bounded(4); - let (thumbnails_to_generate_tx, ephemeral_thumbnails_to_generate_rx) = chan::unbounded(); - let (cas_ids_to_delete_tx, cas_ids_to_delete_rx) = chan::bounded(16); - let (cancel_tx, cancel_rx) = chan::bounded(1); - - AVAILABLE_PARALLELISM - .set(std::thread::available_parallelism().map_or_else( - |e| { - error!("Failed to get available parallelism: {e:#?}"); - 4 - }, - |non_zero| non_zero.get(), - )) - .ok(); - - spawn({ - let progress_management_rx = progress_management_rx.clone(); - let cancel_rx = cancel_rx.clone(); - let thumbnails_directory = Arc::clone(&thumbnails_directory); - let reporter = reporter.clone(); - let node_preferences = node_preferences_rx.clone(); - - async move { - while let Err(e) = spawn(old_worker( - *AVAILABLE_PARALLELISM - .get() - .expect("BATCH_SIZE is set at thumbnailer new method"), - node_preferences.clone(), - reporter.clone(), - thumbnails_directory.clone(), - WorkerChannels { - progress_management_rx: progress_management_rx.clone(), - databases_rx: databases_rx.clone(), - cas_ids_to_delete_rx: cas_ids_to_delete_rx.clone(), - thumbnails_to_generate_rx: ephemeral_thumbnails_to_generate_rx.clone(), - cancel_rx: cancel_rx.clone(), - }, - )) - .await - { - error!( - "Error on Thumbnail Remover Actor; \ - Error: {e}; \ - Restarting the worker loop...", - ); - } - } - }); - - spawn({ - let rx = libraries_manager.rx.clone(); - let thumbnails_directory = Arc::clone(&thumbnails_directory); - - async move { - let subscribe_res = rx - .subscribe(|event| { - let databases_tx = databases_tx.clone(); - - let thumbnails_directory = &thumbnails_directory; - - async move { - match event { - LibraryManagerEvent::Load(library) => { - let library_dir = - thumbnails_directory.join(library.id.to_string()); - - if let Err(e) = fs::create_dir_all(&library_dir).await { - error!( - "Failed to create library dir for thumbnails: {:#?}", - FileIOError::from((library_dir, e)) - ); - } - - databases_tx - .send(DatabaseMessage::Add( - library.id, - Arc::clone(&library.db), - )) - .await - .expect("critical thumbnailer error: databases channel closed on send add") - } - - LibraryManagerEvent::Edit(library) - | LibraryManagerEvent::InstancesModified(library) => databases_tx - .send(DatabaseMessage::Update( - library.id, - Arc::clone(&library.db), - )) - .await - .expect("critical thumbnailer error: databases channel closed on send update"), - - LibraryManagerEvent::Delete(library) => databases_tx - .send(DatabaseMessage::Remove(library.id)) - .await - .expect("critical thumbnailer error: databases channel closed on send delete"), - } - } - }) - .await; - - if subscribe_res.is_err() { - error!("Thumbnailer actor has crashed...") - } - } - }); - - Self { - thumbnails_directory, - cas_ids_to_delete_tx, - thumbnails_to_generate_tx, - progress_reporter_tx: progress_management_tx, - last_single_thumb_generated: Mutex::new(Instant::now()), - reporter, - cancel_tx, - } - } - - #[inline] - async fn new_batch(&self, batch: BatchToProcess, kind: ThumbnailKind) { - if !batch.batch.is_empty() { - self.thumbnails_to_generate_tx - .send((batch, kind)) - .await - .expect("critical thumbnailer error: failed to send new batch"); - } else { - trace!("Empty batch received, skipping..."); - } - } - - #[inline] - pub async fn new_ephemeral_thumbnails_batch(&self, batch: BatchToProcess) { - self.new_batch(batch, ThumbnailKind::Ephemeral).await - } - - #[inline] - pub async fn new_indexed_thumbnails_batch(&self, batch: BatchToProcess, library_id: LibraryId) { - self.new_batch(batch, ThumbnailKind::Indexed(library_id)) - .await - } - - #[inline] - pub async fn new_indexed_thumbnails_tracked_batch( - &self, - mut batch: BatchToProcess, - library_id: LibraryId, - location_id: location::id::Type, - ) { - batch.location_id = Some(location_id); - - self.new_batch(batch, ThumbnailKind::Indexed(library_id)) - .await; - } - - #[inline] - pub async fn register_reporter( - &self, - location_id: location::id::Type, - progress_tx: chan::Sender<(u32, u32)>, - ) { - self.progress_reporter_tx - .send((location_id, progress_tx)) - .await - .expect("critical thumbnailer error: failed to send register reporter fn"); - } - - #[inline] - async fn remove_cas_ids(&self, cas_ids: Vec, kind: ThumbnailKind) { - self.cas_ids_to_delete_tx - .send((cas_ids, kind)) - .await - .expect("critical thumbnailer error: failed to send cas ids to delete"); - } - - #[inline] - pub async fn remove_ephemeral_cas_ids(&self, cas_ids: Vec) { - self.remove_cas_ids(cas_ids, ThumbnailKind::Ephemeral).await - } - - #[inline] - pub async fn remove_indexed_cas_ids(&self, cas_ids: Vec, library_id: LibraryId) { - self.remove_cas_ids(cas_ids, ThumbnailKind::Indexed(library_id)) - .await - } - - #[inline] - pub async fn shutdown(&self) { - let (tx, rx) = oneshot::channel(); - self.cancel_tx - .send(tx) - .await - .expect("critical thumbnailer error: failed to send shutdown signal"); - - rx.await - .expect("critical thumbnailer error: failed to receive shutdown signal response"); - } - - /// WARNING!!!! DON'T USE THIS METHOD IN A LOOP!!!!!!!!!!!!! It will be pretty slow on purpose! - pub async fn generate_single_indexed_thumbnail( - &self, - extension: &str, - cas_id: String, - path: impl AsRef, - library_id: LibraryId, - ) -> Result<(), ThumbnailerError> { - self.generate_single_thumbnail(extension, cas_id, path, ThumbnailKind::Indexed(library_id)) - .await - } - - async fn generate_single_thumbnail( - &self, - extension: &str, - cas_id: String, - path: impl AsRef, - kind: ThumbnailKind, - ) -> Result<(), ThumbnailerError> { - let mut last_single_thumb_generated_guard = self.last_single_thumb_generated.lock().await; - - let elapsed = Instant::now() - *last_single_thumb_generated_guard; - if elapsed < ONE_SEC { - // This will choke up in case someone try to use this method in a loop, otherwise - // it will consume all the machine resources like a gluton monster from hell - sleep(ONE_SEC - elapsed).await; - } - - let res = generate_thumbnail( - self.thumbnails_directory.as_ref().clone(), - ThumbData { - extension, - cas_id, - path, - in_background: false, - should_regenerate: false, - kind, - }, - self.reporter.clone(), - ) - .await - .map(|_| ()); - - *last_single_thumb_generated_guard = Instant::now(); - - res - } -} diff --git a/core/src/object/media/old_thumbnail/preferences.rs b/core/src/object/media/old_thumbnail/preferences.rs deleted file mode 100644 index 39c116e0c..000000000 --- a/core/src/object/media/old_thumbnail/preferences.rs +++ /dev/null @@ -1,34 +0,0 @@ -use serde::{Deserialize, Serialize}; -use specta::Type; - -#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq, Type)] -pub struct ThumbnailerPreferences { - background_processing_percentage: u8, // 0-100 -} - -impl Default for ThumbnailerPreferences { - fn default() -> Self { - Self { - background_processing_percentage: 50, // 50% of CPU cores available - } - } -} - -impl ThumbnailerPreferences { - pub fn background_processing_percentage(&self) -> u8 { - self.background_processing_percentage - } - - pub fn set_background_processing_percentage( - &mut self, - mut background_processing_percentage: u8, - ) -> &mut Self { - if background_processing_percentage > 100 { - background_processing_percentage = 100; - } - - self.background_processing_percentage = background_processing_percentage; - - self - } -} diff --git a/core/src/object/media/old_thumbnail/process.rs b/core/src/object/media/old_thumbnail/process.rs deleted file mode 100644 index 277f64700..000000000 --- a/core/src/object/media/old_thumbnail/process.rs +++ /dev/null @@ -1,473 +0,0 @@ -use crate::api::CoreEvent; - -use sd_file_ext::extensions::{DocumentExtension, ImageExtension}; -use sd_images::{format_image, scale_dimensions, ConvertibleExtension}; -use sd_media_metadata::image::Orientation; -use sd_prisma::prisma::location; -use sd_utils::error::FileIOError; - -use std::{ - collections::VecDeque, - ffi::OsString, - ops::Deref, - path::{Path, PathBuf}, - str::FromStr, - sync::Arc, -}; - -use async_channel as chan; -use futures_concurrency::future::{Join, Race}; -use image::{imageops, DynamicImage, GenericImageView}; -use serde::{Deserialize, Serialize}; -use tokio::{ - fs, io, - sync::{broadcast, oneshot, Semaphore}, - task::{spawn, spawn_blocking}, - time::timeout, -}; -use tokio_stream::StreamExt; -use tracing::{debug, error, trace, warn}; -use webp::Encoder; - -use super::{ - can_generate_thumbnail_for_document, can_generate_thumbnail_for_image, get_thumb_key, - preferences::ThumbnailerPreferences, shard::get_shard_hex, ThumbnailKind, ThumbnailerError, - EPHEMERAL_DIR, TARGET_PX, TARGET_QUALITY, THIRTY_SECS, WEBP_EXTENSION, -}; - -#[derive(Debug, Serialize, Deserialize)] -pub struct GenerateThumbnailArgs { - pub extension: String, - pub cas_id: String, - pub path: PathBuf, -} - -impl GenerateThumbnailArgs { - pub fn new(extension: String, cas_id: String, path: PathBuf) -> Self { - Self { - extension, - cas_id, - path, - } - } -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct BatchToProcess { - pub(super) batch: Vec, - pub(super) should_regenerate: bool, - pub(super) in_background: bool, - pub(super) location_id: Option, -} - -impl BatchToProcess { - pub fn new( - batch: Vec, - should_regenerate: bool, - in_background: bool, - ) -> Self { - Self { - batch, - should_regenerate, - in_background, - location_id: None, - } - } -} - -pub(super) struct ProcessorControlChannels { - pub stop_rx: chan::Receiver>, - pub done_tx: oneshot::Sender<()>, - pub batch_report_progress_tx: chan::Sender<(location::id::Type, u32)>, -} - -pub(super) async fn batch_processor( - thumbnails_directory: Arc, - ( - BatchToProcess { - batch, - should_regenerate, - in_background, - location_id, - }, - kind, - ): (BatchToProcess, ThumbnailKind), - generated_ephemeral_thumbs_file_names_tx: chan::Sender>, - ProcessorControlChannels { - stop_rx, - done_tx, - batch_report_progress_tx, - }: ProcessorControlChannels, - leftovers_tx: chan::Sender<(BatchToProcess, ThumbnailKind)>, - reporter: broadcast::Sender, - (available_parallelism, thumbnailer_preferences): (usize, ThumbnailerPreferences), -) { - let in_parallel_count = if !in_background { - available_parallelism - } else { - usize::max( - // If the user sets the background processing percentage to 0, we still want to process at least sequentially - thumbnailer_preferences.background_processing_percentage() as usize - * available_parallelism - / 100, - 1, - ) - }; - - debug!( - "Processing thumbnails batch of kind {kind:?} with size {} in {}, \ - at most {in_parallel_count} thumbnails at a time", - batch.len(), - if in_background { - "background" - } else { - "foreground" - }, - ); - - let semaphore = Arc::new(Semaphore::new(in_parallel_count)); - - let batch_size = batch.len(); - - // Transforming to `VecDeque` so we don't need to move anything as we consume from the beginning - // This from is guaranteed to be O(1) - let mut queue = VecDeque::from(batch); - - enum RaceOutputs { - Processed, - Stop(oneshot::Sender<()>), - } - - let (maybe_cas_ids_tx, maybe_cas_ids_rx) = if kind == ThumbnailKind::Ephemeral { - let (tx, rx) = chan::bounded(batch_size); - (Some(tx), Some(rx)) - } else { - (None, None) - }; - - let maybe_stopped_tx = if let RaceOutputs::Stop(stopped_tx) = ( - async { - let mut join_handles = Vec::with_capacity(batch_size); - - while !queue.is_empty() { - let permit = Arc::clone(&semaphore) - .acquire_owned() - .await - .expect("this semaphore never closes"); - - let GenerateThumbnailArgs { - extension, - cas_id, - path, - } = queue.pop_front().expect("queue is not empty"); - - // As we got a permit, then there is available CPU to process this thumbnail - join_handles.push(spawn({ - let reporter = reporter.clone(); - let thumbnails_directory = thumbnails_directory.as_ref().clone(); - let report_progress_tx = batch_report_progress_tx.clone(); - let maybe_cas_ids_tx = maybe_cas_ids_tx.clone(); - - async move { - let res = timeout(THIRTY_SECS, async { - generate_thumbnail( - thumbnails_directory, - ThumbData { - extension: &extension, - cas_id, - path: &path, - in_background, - should_regenerate, - kind, - }, - reporter, - ) - .await - .map(|cas_id| { - // this send_blocking never blocks as we have a bounded channel with - // the same capacity as the batch size, so there is always a space - // in the queue - if let Some(cas_ids_tx) = maybe_cas_ids_tx { - if cas_ids_tx - .send_blocking(OsString::from(format!("{}.webp", cas_id))) - .is_err() - { - warn!("No one to listen to generated ephemeral thumbnail cas id"); - } - } - }) - }) - .await - .unwrap_or_else(|_| { - Err(ThumbnailerError::TimedOut(path.into_boxed_path())) - }); - - if let Some(location_id) = location_id { - report_progress_tx.send((location_id, 1)).await.ok(); - } - - drop(permit); - - res - } - })); - } - - for res in join_handles.join().await { - match res { - Ok(Ok(())) => { /* Everything is awesome! */ } - Ok(Err(e)) => { - error!( - "Failed to generate thumbnail for {} location: {e:#?}", - if let ThumbnailKind::Ephemeral = kind { - "ephemeral" - } else { - "indexed" - } - ) - } - Err(e) => { - error!("Failed to join thumbnail generation task: {e:#?}"); - } - } - } - - if let Some(cas_ids_tx) = &maybe_cas_ids_tx { - cas_ids_tx.close(); - } - - trace!("Processed batch with {batch_size} thumbnails"); - - RaceOutputs::Processed - }, - async { - let tx = stop_rx - .recv() - .await - .expect("Critical error on thumbnails actor"); - trace!("Received a stop signal"); - RaceOutputs::Stop(tx) - }, - ) - .race() - .await - { - // Our queue is always contiguous, so this `from` is free - let leftovers = Vec::from(queue); - - trace!( - "Stopped with {} thumbnails left to process", - leftovers.len() - ); - if !leftovers.is_empty() - && leftovers_tx - .send(( - BatchToProcess { - batch: leftovers, - should_regenerate, - in_background: true, // Leftovers should always be in background - location_id, - }, - kind, - )) - .await - .is_err() - { - error!("Thumbnail actor is dead: Failed to send leftovers") - } - - if let Some(cas_ids_tx) = &maybe_cas_ids_tx { - cas_ids_tx.close(); - } - - Some(stopped_tx) - } else { - None - }; - - if let Some(cas_ids_rx) = maybe_cas_ids_rx { - if generated_ephemeral_thumbs_file_names_tx - .send(cas_ids_rx.collect().await) - .await - .is_err() - { - error!("Thumbnail actor is dead: Failed to send generated cas ids") - } - } - - if let Some(stopped_tx) = maybe_stopped_tx { - stopped_tx.send(()).ok(); - } else { - trace!("Finished batch!"); - } - - done_tx.send(()).ok(); -} - -pub(super) struct ThumbData<'ext, P: AsRef> { - pub extension: &'ext str, - pub cas_id: String, - pub path: P, - pub in_background: bool, - pub should_regenerate: bool, - pub kind: ThumbnailKind, -} - -pub(super) async fn generate_thumbnail( - thumbnails_directory: PathBuf, - ThumbData { - extension, - cas_id, - path, - in_background, - should_regenerate, - kind, - }: ThumbData<'_, impl AsRef>, - reporter: broadcast::Sender, -) -> Result { - let path = path.as_ref(); - trace!("Generating thumbnail for {}", path.display()); - - let mut output_path = thumbnails_directory; - match kind { - ThumbnailKind::Ephemeral => output_path.push(EPHEMERAL_DIR), - ThumbnailKind::Indexed(library_id) => output_path.push(library_id.to_string()), - }; - output_path.push(get_shard_hex(&cas_id)); - output_path.push(&cas_id); - output_path.set_extension(WEBP_EXTENSION); - - if let Err(e) = fs::metadata(&output_path).await { - if e.kind() != io::ErrorKind::NotFound { - error!( - "Failed to check if thumbnail exists, but we will try to generate it anyway: {e:#?}" - ); - } - // Otherwise we good, thumbnail doesn't exist so we can generate it - } else if !should_regenerate { - trace!( - "Skipping thumbnail generation for {} because it already exists", - path.display() - ); - return Ok(cas_id); - } - - if let Ok(extension) = ImageExtension::from_str(extension) { - if can_generate_thumbnail_for_image(&extension) { - generate_image_thumbnail(&path, &output_path).await?; - } - } else if let Ok(extension) = DocumentExtension::from_str(extension) { - if can_generate_thumbnail_for_document(&extension) { - generate_image_thumbnail(&path, &output_path).await?; - } - } - - #[cfg(feature = "ffmpeg")] - { - use crate::object::media::old_thumbnail::can_generate_thumbnail_for_video; - use sd_file_ext::extensions::VideoExtension; - - if let Ok(extension) = VideoExtension::from_str(extension) { - if can_generate_thumbnail_for_video(&extension) { - generate_video_thumbnail(&path, &output_path).await?; - } - } - } - - if !in_background { - trace!("Emitting new thumbnail event"); - if reporter - .send(CoreEvent::NewThumbnail { - thumb_key: get_thumb_key(&cas_id, kind), - }) - .is_err() - { - warn!("Error sending event to Node's event bus"); - } - } - - trace!("Generated thumbnail for {}", path.display()); - - Ok(cas_id) -} - -async fn generate_image_thumbnail( - file_path: impl AsRef, - output_path: impl AsRef, -) -> Result<(), ThumbnailerError> { - let file_path = file_path.as_ref().to_path_buf(); - - let webp = spawn_blocking(move || -> Result<_, ThumbnailerError> { - let mut img = format_image(&file_path).map_err(|e| ThumbnailerError::SdImages { - path: file_path.clone().into_boxed_path(), - error: e, - })?; - - let (w, h) = img.dimensions(); - let (w_scaled, h_scaled) = scale_dimensions(w as f32, h as f32, TARGET_PX); - - // Optionally, resize the existing photo and convert back into DynamicImage - if w != w_scaled && h != h_scaled { - img = DynamicImage::ImageRgba8(imageops::resize( - &img, - w_scaled, - h_scaled, - imageops::FilterType::Triangle, - )); - } - - // this corrects the rotation/flip of the image based on the *available* exif data - // not all images have exif data, so we don't error. we also don't rotate HEIF as that's against the spec - if let Some(orientation) = Orientation::from_path(&file_path) { - if ConvertibleExtension::try_from(file_path.as_ref()) - .expect("we already checked if the image was convertible") - .should_rotate() - { - img = orientation.correct_thumbnail(img); - } - } - - // Create the WebP encoder for the above image - let encoder = - Encoder::from_image(&img).map_err(|reason| ThumbnailerError::WebPEncoding { - path: file_path.into_boxed_path(), - reason: reason.to_string(), - })?; - - // Type WebPMemory is !Send, which makes the Future in this function !Send, - // this make us `deref` to have a `&[u8]` and then `to_owned` to make a Vec - // which implies on a unwanted clone... - Ok(encoder.encode(TARGET_QUALITY).deref().to_owned()) - }) - .await??; - - let output_path = output_path.as_ref(); - - if let Some(shard_dir) = output_path.parent() { - fs::create_dir_all(shard_dir) - .await - .map_err(|e| FileIOError::from((shard_dir, e)))?; - } else { - error!( - "Failed to get parent directory of '{}' for sharding parent directory", - output_path.display() - ); - } - - fs::write(output_path, &webp) - .await - .map_err(|e| FileIOError::from((output_path, e))) - .map_err(Into::into) -} - -#[cfg(feature = "ffmpeg")] -async fn generate_video_thumbnail( - file_path: impl AsRef, - output_path: impl AsRef, -) -> Result<(), ThumbnailerError> { - use sd_ffmpeg::to_thumbnail; - - to_thumbnail(file_path, output_path, 256, TARGET_QUALITY) - .await - .map_err(Into::into) -} diff --git a/core/src/object/media/old_thumbnail/shard.rs b/core/src/object/media/old_thumbnail/shard.rs deleted file mode 100644 index be61e2034..000000000 --- a/core/src/object/media/old_thumbnail/shard.rs +++ /dev/null @@ -1,13 +0,0 @@ -/// The practice of dividing files into hex coded folders, often called "sharding," -/// is mainly used to optimize file system performance. File systems can start to slow down -/// as the number of files in a directory increases. Thus, it's often beneficial to split -/// files into multiple directories to avoid this performance degradation. - -/// `get_shard_hex` takes a cas_id (a hexadecimal hash) as input and returns the first -/// three characters of the hash as the directory name. Because we're using these first -/// three characters of a the hash, this will give us 4096 (16^3) possible directories, -/// named 000 to fff. -pub fn get_shard_hex(cas_id: &str) -> &str { - // Use the first three characters of the hash as the directory name - &cas_id[0..3] -} diff --git a/core/src/object/media/old_thumbnail/state.rs b/core/src/object/media/old_thumbnail/state.rs deleted file mode 100644 index 7cce8d1df..000000000 --- a/core/src/object/media/old_thumbnail/state.rs +++ /dev/null @@ -1,225 +0,0 @@ -use crate::library::LibraryId; - -use sd_prisma::prisma::location; -use sd_utils::error::FileIOError; - -use std::{ - collections::{hash_map::Entry, HashMap, HashSet, VecDeque}, - ffi::OsString, - path::Path, -}; - -use async_channel as chan; -use futures_concurrency::future::TryJoin; -use serde::{Deserialize, Serialize}; -use tokio::{fs, io}; -use tracing::{error, info, trace}; - -use super::{ - get_shard_hex, old_actor::ActorError, BatchToProcess, ThumbnailKind, EPHEMERAL_DIR, - SAVE_STATE_FILE, -}; - -#[derive(Debug, Serialize, Deserialize)] -pub(super) struct OldThumbsProcessingSaveState { - pub(super) bookkeeper: BookKeeper, - pub(super) ephemeral_file_names: HashSet, - // This queues doubles as LIFO and FIFO, assuming LIFO in case of users asking for a new batch - // by entering a new directory in the explorer, otherwise processing as FIFO - pub(super) queue: VecDeque<(BatchToProcess, ThumbnailKind)>, - // These below are FIFO queues, so we can process leftovers from the previous batch first - pub(super) indexed_leftovers_queue: VecDeque<(BatchToProcess, LibraryId)>, - pub(super) ephemeral_leftovers_queue: VecDeque, -} - -impl Default for OldThumbsProcessingSaveState { - fn default() -> Self { - Self { - bookkeeper: BookKeeper::default(), - ephemeral_file_names: HashSet::with_capacity(128), - queue: VecDeque::with_capacity(32), - indexed_leftovers_queue: VecDeque::with_capacity(8), - ephemeral_leftovers_queue: VecDeque::with_capacity(8), - } - } -} - -impl OldThumbsProcessingSaveState { - pub(super) async fn load(thumbnails_directory: impl AsRef) -> Self { - let resume_file = thumbnails_directory.as_ref().join(SAVE_STATE_FILE); - - match fs::read(&resume_file).await { - Ok(bytes) => { - let this = rmp_serde::from_slice::(&bytes).unwrap_or_else(|e| { - error!("Failed to deserialize save state at thumbnailer actor: {e:#?}"); - Self::default() - }); - - if let Err(e) = fs::remove_file(&resume_file).await { - error!( - "Failed to remove save state file at thumbnailer actor: {:#?}", - FileIOError::from((resume_file, e)) - ); - } - - info!( - "Resuming thumbnailer actor state: Existing ephemeral thumbs: {}; \ - Queued batches waiting processing: {}", - this.ephemeral_file_names.len(), - this.queue.len() - + this.indexed_leftovers_queue.len() - + this.ephemeral_leftovers_queue.len() - ); - - this - } - Err(e) if e.kind() == io::ErrorKind::NotFound => { - trace!("No save state found at thumbnailer actor"); - Self::default() - } - Err(e) => { - error!( - "Failed to read save state at thumbnailer actor: {:#?}", - FileIOError::from((resume_file, e)) - ); - Self::default() - } - } - } - - pub(super) async fn store(self, thumbnails_directory: impl AsRef) { - let resume_file = thumbnails_directory.as_ref().join(SAVE_STATE_FILE); - - info!( - "Saving thumbnailer actor state: Existing ephemeral thumbs: {}; \ - Queued batches waiting processing: {}", - self.ephemeral_file_names.len(), - self.queue.len() - + self.indexed_leftovers_queue.len() - + self.ephemeral_leftovers_queue.len() - ); - - let Ok(bytes) = rmp_serde::to_vec_named(&self).map_err(|e| { - error!("Failed to serialize save state at thumbnailer actor: {e:#?}"); - }) else { - return; - }; - - if let Err(e) = fs::write(&resume_file, bytes).await { - error!( - "Failed to write save state at thumbnailer actor: {:#?}", - FileIOError::from((resume_file, e)) - ); - } - } -} - -pub(super) async fn remove_by_cas_ids( - thumbnails_directory: &Path, - cas_ids: Vec, - kind: ThumbnailKind, -) -> Result<(), ActorError> { - let base_dir = match kind { - ThumbnailKind::Ephemeral => thumbnails_directory.join(EPHEMERAL_DIR), - ThumbnailKind::Indexed(library_id) => thumbnails_directory.join(library_id.to_string()), - }; - - cas_ids - .into_iter() - .map(|cas_id| { - let thumbnail_path = base_dir.join(format!("{}/{cas_id}.webp", get_shard_hex(&cas_id))); - - trace!("Removing thumbnail: {}", thumbnail_path.display()); - - async move { - match fs::remove_file(&thumbnail_path).await { - Ok(()) => Ok(()), - Err(e) if e.kind() == io::ErrorKind::NotFound => Ok(()), - Err(e) => Err(FileIOError::from((thumbnail_path, e))), - } - } - }) - .collect::>() - .try_join() - .await?; - - Ok(()) -} - -pub(super) type RegisterReporter = (location::id::Type, chan::Sender<(u32, u32)>); - -#[derive(Debug, Serialize, Deserialize)] -pub(super) struct BookKeeper { - work_progress: HashMap, // (pending, total) - - // We can't save reporter function or a channel to disk, the job must ask again to be registered - #[serde(skip, default)] - reporter_by_location: HashMap>, -} -impl Default for BookKeeper { - fn default() -> Self { - Self { - work_progress: HashMap::with_capacity(8), - reporter_by_location: HashMap::with_capacity(8), - } - } -} - -impl BookKeeper { - pub(super) async fn add_work(&mut self, location_id: location::id::Type, thumbs_count: u32) { - let (in_progress, total) = match self.work_progress.entry(location_id) { - Entry::Occupied(mut entry) => { - let (in_progress, total) = entry.get_mut(); - - *total += thumbs_count; - - (*in_progress, *total) - } - Entry::Vacant(entry) => { - entry.insert((0, thumbs_count)); - - (0, thumbs_count) - } - }; - - if let Some(progress_tx) = self.reporter_by_location.get(&location_id) { - if progress_tx.send((in_progress, total)).await.is_err() { - error!( - "Failed to send progress update to reporter on location " - ); - } - } - } - - pub(super) fn register_reporter( - &mut self, - location_id: location::id::Type, - reporter_tx: chan::Sender<(u32, u32)>, - ) { - self.reporter_by_location.insert(location_id, reporter_tx); - } - - pub(super) async fn add_progress(&mut self, location_id: location::id::Type, progress: u32) { - if let Some((current_progress, total)) = self.work_progress.get_mut(&location_id) { - *current_progress += progress; - - if *current_progress == *total { - if let Some(progress_tx) = self.reporter_by_location.remove(&location_id) { - if progress_tx.send((*current_progress, *total)).await.is_err() { - error!( - "Failed to send progress update to reporter on location " - ); - } - } - - self.work_progress.remove(&location_id); - } else if let Some(progress_tx) = self.reporter_by_location.get(&location_id) { - if progress_tx.send((*current_progress, *total)).await.is_err() { - error!( - "Failed to send progress update to reporter on location " - ); - } - } - } - } -} diff --git a/core/src/object/media/old_thumbnail/worker.rs b/core/src/object/media/old_thumbnail/worker.rs deleted file mode 100644 index c3696028a..000000000 --- a/core/src/object/media/old_thumbnail/worker.rs +++ /dev/null @@ -1,350 +0,0 @@ -use crate::{api::CoreEvent, node::config::NodePreferences}; - -use sd_prisma::prisma::location; - -use std::{collections::HashMap, ffi::OsString, path::PathBuf, pin::pin, sync::Arc}; - -use async_channel as chan; -use futures_concurrency::stream::Merge; -use tokio::{ - spawn, - sync::{broadcast, oneshot, watch}, - time::{interval, interval_at, timeout, Instant, MissedTickBehavior}, -}; -use tokio_stream::{ - wrappers::{IntervalStream, WatchStream}, - StreamExt, -}; -use tracing::{debug, error, trace}; - -use super::{ - clean_up::{process_ephemeral_clean_up, process_indexed_clean_up}, - old_actor::DatabaseMessage, - preferences::ThumbnailerPreferences, - process::{batch_processor, ProcessorControlChannels}, - state::{remove_by_cas_ids, OldThumbsProcessingSaveState, RegisterReporter}, - BatchToProcess, ThumbnailKind, HALF_HOUR, ONE_SEC, THIRTY_SECS, -}; - -#[derive(Debug, Clone)] -pub(super) struct WorkerChannels { - pub(super) progress_management_rx: chan::Receiver, - pub(super) databases_rx: chan::Receiver, - pub(super) cas_ids_to_delete_rx: chan::Receiver<(Vec, ThumbnailKind)>, - pub(super) thumbnails_to_generate_rx: chan::Receiver<(BatchToProcess, ThumbnailKind)>, - pub(super) cancel_rx: chan::Receiver>, -} - -pub(super) async fn old_worker( - available_parallelism: usize, - node_preferences_rx: watch::Receiver, - reporter: broadcast::Sender, - thumbnails_directory: Arc, - WorkerChannels { - progress_management_rx, - databases_rx, - cas_ids_to_delete_rx, - thumbnails_to_generate_rx, - cancel_rx, - }: WorkerChannels, -) { - let mut to_remove_interval = interval_at(Instant::now() + THIRTY_SECS, HALF_HOUR); - to_remove_interval.set_missed_tick_behavior(MissedTickBehavior::Skip); - - let mut idle_interval = interval(ONE_SEC); - idle_interval.set_missed_tick_behavior(MissedTickBehavior::Skip); - - let mut databases = HashMap::new(); - - #[derive(Debug)] - enum StreamMessage { - RemovalTick, - ToDelete((Vec, ThumbnailKind)), - Database(DatabaseMessage), - NewBatch((BatchToProcess, ThumbnailKind)), - Leftovers((BatchToProcess, ThumbnailKind)), - NewEphemeralThumbnailsFilenames(Vec), - ProgressManagement(RegisterReporter), - BatchProgress((location::id::Type, u32)), - Shutdown(oneshot::Sender<()>), - UpdatedPreferences(ThumbnailerPreferences), - IdleTick, - } - - let OldThumbsProcessingSaveState { - mut bookkeeper, - mut ephemeral_file_names, - mut queue, - mut indexed_leftovers_queue, - mut ephemeral_leftovers_queue, - } = OldThumbsProcessingSaveState::load(thumbnails_directory.as_ref()).await; - - let (generated_ephemeral_thumbnails_tx, ephemeral_thumbnails_cas_ids_rx) = chan::bounded(32); - let (leftovers_tx, leftovers_rx) = chan::bounded(8); - let (batch_report_progress_tx, batch_report_progress_rx) = chan::bounded(8); - let (stop_older_processing_tx, stop_older_processing_rx) = chan::bounded(1); - - let mut shutdown_leftovers_rx = pin!(leftovers_rx.clone()); - let mut shutdown_batch_report_progress_rx = pin!(batch_report_progress_rx.clone()); - - let mut current_batch_processing_rx: Option> = None; - - let mut msg_stream = pin!(( - IntervalStream::new(to_remove_interval).map(|_| StreamMessage::RemovalTick), - cas_ids_to_delete_rx.map(StreamMessage::ToDelete), - databases_rx.map(StreamMessage::Database), - thumbnails_to_generate_rx.map(StreamMessage::NewBatch), - leftovers_rx.map(StreamMessage::Leftovers), - ephemeral_thumbnails_cas_ids_rx.map(StreamMessage::NewEphemeralThumbnailsFilenames), - progress_management_rx.map(StreamMessage::ProgressManagement), - batch_report_progress_rx.map(StreamMessage::BatchProgress), - cancel_rx.map(StreamMessage::Shutdown), - IntervalStream::new(idle_interval).map(|_| StreamMessage::IdleTick), - WatchStream::new(node_preferences_rx).map(|node_preferences| { - StreamMessage::UpdatedPreferences(node_preferences.thumbnailer) - }), - ) - .merge()); - - let mut thumbnailer_preferences = ThumbnailerPreferences::default(); - - while let Some(msg) = msg_stream.next().await { - match msg { - StreamMessage::IdleTick => { - if let Some(done_rx) = current_batch_processing_rx.as_mut() { - // Checking if the previous run finished or was aborted to clean state - match done_rx.try_recv() { - Ok(()) | Err(oneshot::error::TryRecvError::Closed) => { - current_batch_processing_rx = None; - } - - Err(oneshot::error::TryRecvError::Empty) => { - // The previous run is still running - continue; - } - } - } - - if current_batch_processing_rx.is_none() - && (!queue.is_empty() - || !indexed_leftovers_queue.is_empty() - || !ephemeral_leftovers_queue.is_empty()) - { - let (done_tx, done_rx) = oneshot::channel(); - current_batch_processing_rx = Some(done_rx); - - let batch_and_kind = if let Some(batch_and_kind) = queue.pop_front() { - batch_and_kind - } else if let Some((batch, library_id)) = indexed_leftovers_queue.pop_front() { - // indexed leftovers have bigger priority - (batch, ThumbnailKind::Indexed(library_id)) - } else if let Some(batch) = ephemeral_leftovers_queue.pop_front() { - (batch, ThumbnailKind::Ephemeral) - } else { - continue; - }; - - spawn(batch_processor( - thumbnails_directory.clone(), - batch_and_kind, - generated_ephemeral_thumbnails_tx.clone(), - ProcessorControlChannels { - stop_rx: stop_older_processing_rx.clone(), - done_tx, - batch_report_progress_tx: batch_report_progress_tx.clone(), - }, - leftovers_tx.clone(), - reporter.clone(), - (available_parallelism, thumbnailer_preferences.clone()), - )); - } - } - - StreamMessage::RemovalTick => { - // For any of them we process a clean up if a time since the last one already passed - if !databases.is_empty() { - spawn(process_indexed_clean_up( - thumbnails_directory.clone(), - databases - .iter() - .map(|(id, db)| (*id, Arc::clone(db))) - .collect::>(), - )); - } - - if !ephemeral_file_names.is_empty() { - spawn(process_ephemeral_clean_up( - thumbnails_directory.clone(), - ephemeral_file_names.clone(), - )); - } - } - - StreamMessage::ToDelete((cas_ids, kind)) => { - if !cas_ids.is_empty() { - if let Err(e) = remove_by_cas_ids(&thumbnails_directory, cas_ids, kind).await { - error!("Got an error when trying to remove thumbnails: {e:#?}"); - } - } - } - - StreamMessage::NewBatch((batch, kind)) => { - let in_background = batch.in_background; - - if let Some(location_id) = batch.location_id { - bookkeeper - .add_work(location_id, batch.batch.len() as u32) - .await; - } - - trace!( - "New {kind:?} batch to process in {}, size: {}", - if in_background { - "background" - } else { - "foreground" - }, - batch.batch.len() - ); - - if in_background { - queue.push_back((batch, kind)); - } else { - // If a processing must be in foreground, then it takes maximum priority - queue.push_front((batch, kind)); - } - - // Only sends stop signal if there is a batch being processed - if !in_background { - stop_batch( - ¤t_batch_processing_rx, - &stop_older_processing_tx, - &stop_older_processing_rx, - ) - .await; - } - } - - StreamMessage::Leftovers((batch, ThumbnailKind::Indexed(library_id))) => { - indexed_leftovers_queue.push_back((batch, library_id)) - } - - StreamMessage::Leftovers((batch, ThumbnailKind::Ephemeral)) => { - ephemeral_leftovers_queue.push_back(batch) - } - - StreamMessage::Database(DatabaseMessage::Add(id, db)) - | StreamMessage::Database(DatabaseMessage::Update(id, db)) => { - databases.insert(id, db); - } - - StreamMessage::Database(DatabaseMessage::Remove(id)) => { - databases.remove(&id); - } - - StreamMessage::NewEphemeralThumbnailsFilenames(new_ephemeral_thumbs) => { - trace!("New ephemeral thumbnails: {}", new_ephemeral_thumbs.len()); - ephemeral_file_names.extend(new_ephemeral_thumbs); - } - - StreamMessage::BatchProgress((location_id, progressed)) => { - bookkeeper.add_progress(location_id, progressed).await; - } - - StreamMessage::Shutdown(cancel_tx) => { - debug!("Thumbnail actor is shutting down..."); - let start = Instant::now(); - - stop_batch( - ¤t_batch_processing_rx, - &stop_older_processing_tx, - &stop_older_processing_rx, - ) - .await; - - // Closing the leftovers channel to stop the batch processor as we already sent - // an stop signal - leftovers_tx.close(); - while let Some((batch, kind)) = shutdown_leftovers_rx.next().await { - match kind { - ThumbnailKind::Indexed(library_id) => { - indexed_leftovers_queue.push_back((batch, library_id)) - } - ThumbnailKind::Ephemeral => ephemeral_leftovers_queue.push_back(batch), - } - } - - // Consuming the last progress reports to keep everything up to date - shutdown_batch_report_progress_rx.close(); - while let Some((location_id, progressed)) = - shutdown_batch_report_progress_rx.next().await - { - bookkeeper.add_progress(location_id, progressed).await; - } - - // Saving state - OldThumbsProcessingSaveState { - bookkeeper, - ephemeral_file_names, - queue, - indexed_leftovers_queue, - ephemeral_leftovers_queue, - } - .store(thumbnails_directory.as_ref()) - .await; - - // Signaling that we're done shutting down - cancel_tx.send(()).ok(); - - debug!("Thumbnailer has been shutdown in {:?}", start.elapsed()); - return; - } - - StreamMessage::ProgressManagement((location_id, progress_tx)) => { - bookkeeper.register_reporter(location_id, progress_tx); - } - - StreamMessage::UpdatedPreferences(preferences) => { - thumbnailer_preferences = preferences; - stop_batch( - ¤t_batch_processing_rx, - &stop_older_processing_tx, - &stop_older_processing_rx, - ) - .await; - } - } - } -} - -#[inline] -async fn stop_batch( - current_batch_processing_rx: &Option>, - stop_older_processing_tx: &chan::Sender>, - stop_older_processing_rx: &chan::Receiver>, -) { - // First stopping the current batch processing - if current_batch_processing_rx.is_some() { - trace!("Sending stop signal to older processing"); - - let (tx, rx) = oneshot::channel(); - - match stop_older_processing_tx.try_send(tx) { - Ok(()) => { - // We put a timeout here to avoid a deadlock in case the older processing already - // finished its batch - if timeout(ONE_SEC, rx).await.is_err() { - stop_older_processing_rx.recv().await.ok(); - } - } - Err(e) if e.is_full() => { - // The last signal we sent happened after a batch was already processed - // So we clean the channel and we're good to go. - stop_older_processing_rx.recv().await.ok(); - } - Err(_) => { - error!("Thumbnail actor died when trying to stop older processing"); - } - } - } -} diff --git a/core/src/object/mod.rs b/core/src/object/mod.rs index 08c41f1a4..e4de76f43 100644 --- a/core/src/object/mod.rs +++ b/core/src/object/mod.rs @@ -1,29 +1,3 @@ -use sd_prisma::prisma::{file_path, object}; - -use serde::{Deserialize, Serialize}; -use specta::Type; - -pub mod cas; pub mod fs; -pub mod media; -pub mod old_file_identifier; -pub mod old_orphan_remover; pub mod tag; pub mod validation; - -// Objects are primarily created by the identifier from Paths -// Some Objects are purely virtual, unless they have one or more associated Paths, which refer to a file found in a Location -// Objects are what can be added to Spaces - -// The response to provide the Explorer when looking at Objects -#[derive(Debug, Serialize, Deserialize, Type)] -pub struct ObjectsForExplorer { - pub objects: Vec, - // pub context: ExplorerContext, -} - -#[derive(Debug, Serialize, Deserialize, Type)] -pub enum ObjectData { - Object(Box), - Path(Box), -} diff --git a/core/src/object/old_file_identifier/mod.rs b/core/src/object/old_file_identifier/mod.rs deleted file mode 100644 index a98495420..000000000 --- a/core/src/object/old_file_identifier/mod.rs +++ /dev/null @@ -1,404 +0,0 @@ -use crate::{library::Library, object::cas::generate_cas_id, old_job::JobError}; - -use sd_core_file_path_helper::{FilePathError, IsolatedFilePathData}; -use sd_core_prisma_helpers::{file_path_for_file_identifier, object_for_file_identifier}; - -use sd_file_ext::{extensions::Extension, kind::ObjectKind}; -use sd_prisma::{ - prisma::{file_path, location, object, PrismaClient}, - prisma_sync, -}; -use sd_sync::{CRDTOperation, OperationFactory}; -use sd_utils::{db::maybe_missing, error::FileIOError, msgpack, uuid_to_bytes}; - -use std::{ - collections::{HashMap, HashSet}, - fmt::Debug, - path::Path, -}; - -use futures::future::join_all; -use tokio::fs; -use tracing::{error, trace}; -use uuid::Uuid; - -pub mod old_file_identifier_job; -mod shallow; - -pub use shallow::*; - -// we break these jobs into chunks of 100 to improve performance -const CHUNK_SIZE: usize = 100; - -#[derive(thiserror::Error, Debug)] -pub enum FileIdentifierJobError { - #[error("received sub path not in database: ", .0.display())] - SubPathNotFound(Box), - - // Internal Errors - #[error(transparent)] - FilePathError(#[from] FilePathError), - #[error("database error: {0}")] - Database(#[from] prisma_client_rust::QueryError), -} - -#[derive(Debug, Clone)] -pub struct FileMetadata { - pub cas_id: Option, - pub kind: ObjectKind, - pub fs_metadata: std::fs::Metadata, -} - -impl FileMetadata { - /// Assembles `create_unchecked` params for a given file path - pub async fn new( - location_path: impl AsRef, - iso_file_path: &IsolatedFilePathData<'_>, // TODO: use dedicated CreateUnchecked type - ) -> Result { - let path = location_path.as_ref().join(iso_file_path); - - let fs_metadata = fs::metadata(&path) - .await - .map_err(|e| FileIOError::from((&path, e)))?; - - assert!( - !fs_metadata.is_dir(), - "We can't generate cas_id for directories" - ); - - // derive Object kind - let kind = Extension::resolve_conflicting(&path, false) - .await - .map(Into::into) - .unwrap_or(ObjectKind::Unknown); - - let cas_id = if fs_metadata.len() != 0 { - generate_cas_id(&path, fs_metadata.len()) - .await - .map(Some) - .map_err(|e| FileIOError::from((&path, e)))? - } else { - // We can't do shit with empty files - None - }; - - trace!("Analyzed file: {path:?} {cas_id:?} {kind:?}"); - - Ok(FileMetadata { - cas_id, - kind, - fs_metadata, - }) - } -} - -async fn identifier_job_step( - Library { db, sync, .. }: &Library, - location: &location::Data, - file_paths: &[file_path_for_file_identifier::Data], -) -> Result<(usize, usize), JobError> { - let location_path = maybe_missing(&location.path, "location.path").map(Path::new)?; - - let file_paths_metadatas = join_all( - file_paths - .iter() - .filter_map(|file_path| { - IsolatedFilePathData::try_from((location.id, file_path)) - .map(|iso_file_path| (iso_file_path, file_path)) - .map_err(|e| error!("Failed to extract isolated file path data: {e:#?}")) - .ok() - }) - .map(|(iso_file_path, file_path)| async move { - FileMetadata::new(&location_path, &iso_file_path) - .await - .map(|metadata| { - ( - // SAFETY: This should never happen - Uuid::from_slice(&file_path.pub_id) - .expect("file_path.pub_id is invalid!"), - (metadata, file_path), - ) - }) - .map_err(|e| { - #[cfg(target_os = "windows")] - { - // Handle case where file is on-demand (NTFS only) - if e.source.raw_os_error().map_or(false, |code| code == 362) { - error!("Failed to extract metadata from on-demand file: {e:#?}"); - } else { - error!("Failed to extract file metadata: {e:#?}") - } - } - - #[cfg(not(target_os = "windows"))] - { - error!("Failed to extract file metadata: {e:#?}"); - } - }) - .ok() - }), - ) - .await - .into_iter() - .flatten() - .collect::>(); - - let unique_cas_ids = file_paths_metadatas - .values() - .filter_map(|(metadata, _)| metadata.cas_id.clone()) - .collect::>() - .into_iter() - .collect(); - - // Assign cas_id to each file path - sync.write_ops( - db, - file_paths_metadatas - .iter() - .map(|(pub_id, (metadata, _))| { - ( - sync.shared_update( - prisma_sync::file_path::SyncId { - pub_id: sd_utils::uuid_to_bytes(*pub_id), - }, - file_path::cas_id::NAME, - msgpack!(&metadata.cas_id), - ), - db.file_path().update( - file_path::pub_id::equals(sd_utils::uuid_to_bytes(*pub_id)), - vec![file_path::cas_id::set(metadata.cas_id.clone())], - ), - ) - }) - .unzip::<_, _, _, Vec<_>>(), - ) - .await?; - - // Retrieves objects that are already connected to file paths with the same id - let existing_objects = db - .object() - .find_many(vec![object::file_paths::some(vec![ - file_path::cas_id::in_vec(unique_cas_ids), - ])]) - .select(object_for_file_identifier::select()) - .exec() - .await?; - - let existing_object_cas_ids = existing_objects - .iter() - .flat_map(|object| { - object - .file_paths - .iter() - .filter_map(|file_path| file_path.cas_id.as_ref()) - }) - .collect::>(); - - // Attempt to associate each file path with an object that has been - // connected to file paths with the same cas_id - let updated_file_paths = sync - .write_ops( - db, - file_paths_metadatas - .iter() - .filter_map(|(pub_id, (metadata, file_path))| { - // Filtering out files without cas_id due to being empty - metadata - .cas_id - .is_some() - .then_some((pub_id, (metadata, file_path))) - }) - .flat_map(|(pub_id, (metadata, _))| { - existing_objects - .iter() - .find(|object| { - object - .file_paths - .iter() - .any(|file_path| file_path.cas_id == metadata.cas_id) - }) - .map(|object| (*pub_id, object)) - }) - .map(|(pub_id, object)| { - let (crdt_op, db_op) = connect_file_path_to_object( - pub_id, - // SAFETY: This pub_id is generated by the uuid lib, but we have to store bytes in sqlite - Uuid::from_slice(&object.pub_id).expect("uuid bytes are invalid"), - sync, - db, - ); - - (crdt_op, db_op.select(file_path::select!({ pub_id }))) - }) - .unzip::<_, _, Vec<_>, Vec<_>>(), - ) - .await?; - - trace!( - "Found {} existing Objects in Library, linking file paths...", - existing_objects.len() - ); - - // extract objects that don't already exist in the database - let file_paths_requiring_new_object = file_paths_metadatas - .into_iter() - .filter(|(_, (FileMetadata { cas_id, .. }, _))| { - cas_id - .as_ref() - .map(|cas_id| !existing_object_cas_ids.contains(cas_id)) - .unwrap_or(true) - }) - .collect::>(); - - let total_created = if !file_paths_requiring_new_object.is_empty() { - trace!( - "Creating {} new Objects in Library", - file_paths_requiring_new_object.len(), - ); - - let (object_create_args, file_path_update_args): (Vec<_>, Vec<_>) = - file_paths_requiring_new_object - .iter() - .map( - |( - file_path_pub_id, - ( - FileMetadata { kind, .. }, - file_path_for_file_identifier::Data { date_created, .. }, - ), - )| { - let object_pub_id = Uuid::new_v4(); - let sync_id = || prisma_sync::object::SyncId { - pub_id: sd_utils::uuid_to_bytes(object_pub_id), - }; - - let kind = *kind as i32; - - let (sync_params, db_params): (Vec<_>, Vec<_>) = [ - ( - (object::date_created::NAME, msgpack!(date_created)), - object::date_created::set(*date_created), - ), - ( - (object::kind::NAME, msgpack!(kind)), - object::kind::set(Some(kind)), - ), - ] - .into_iter() - .unzip(); - - ( - ( - sync.shared_create(sync_id(), sync_params), - object::create_unchecked(uuid_to_bytes(object_pub_id), db_params), - ), - { - let (crdt_op, db_op) = connect_file_path_to_object( - *file_path_pub_id, - object_pub_id, - sync, - db, - ); - - (crdt_op, db_op.select(file_path::select!({ pub_id }))) - }, - ) - }, - ) - .unzip(); - - // create new object records with assembled values - let total_created_files = sync - .write_ops(db, { - let (sync, db_params): (Vec<_>, Vec<_>) = object_create_args.into_iter().unzip(); - - ( - sync.into_iter().flatten().collect(), - db.object().create_many(db_params), - ) - }) - .await - .unwrap_or_else(|e| { - error!("Error inserting files: {:#?}", e); - 0 - }); - - trace!("Created {} new Objects in Library", total_created_files); - - if total_created_files > 0 { - trace!("Updating file paths with created objects"); - - sync.write_ops(db, { - let data: (Vec<_>, Vec<_>) = file_path_update_args.into_iter().unzip(); - - data - }) - .await?; - - trace!("Updated file paths with created objects"); - } - - total_created_files as usize - } else { - 0 - }; - - Ok((total_created, updated_file_paths.len())) -} - -fn connect_file_path_to_object<'db>( - file_path_id: Uuid, - object_id: Uuid, - sync: &crate::sync::Manager, - db: &'db PrismaClient, -) -> (CRDTOperation, file_path::UpdateQuery<'db>) { - #[cfg(debug_assertions)] - trace!("Connecting to "); - - let vec_id = object_id.as_bytes().to_vec(); - - ( - sync.shared_update( - prisma_sync::file_path::SyncId { - pub_id: sd_utils::uuid_to_bytes(file_path_id), - }, - file_path::object::NAME, - msgpack!(prisma_sync::object::SyncId { - pub_id: vec_id.clone() - }), - ), - db.file_path().update( - file_path::pub_id::equals(sd_utils::uuid_to_bytes(file_path_id)), - vec![file_path::object::connect(object::pub_id::equals(vec_id))], - ), - ) -} - -async fn process_identifier_file_paths( - location: &location::Data, - file_paths: &[file_path_for_file_identifier::Data], - step_number: usize, - cursor: file_path::id::Type, - library: &Library, - orphan_count: usize, -) -> Result<(usize, usize, file_path::id::Type), JobError> { - trace!( - "Processing {:?} orphan Paths. ({} completed of {})", - file_paths.len(), - step_number, - orphan_count - ); - - let (total_objects_created, total_objects_linked) = - identifier_job_step(library, location, file_paths).await?; - - Ok(( - total_objects_created, - total_objects_linked, - // returns a new cursor to the last row of this chunk or the current one - file_paths - .last() - .map(|last_row| last_row.id) - .unwrap_or(cursor), - )) -} diff --git a/core/src/object/old_file_identifier/old_file_identifier_job.rs b/core/src/object/old_file_identifier/old_file_identifier_job.rs deleted file mode 100644 index 3a1afa3f6..000000000 --- a/core/src/object/old_file_identifier/old_file_identifier_job.rs +++ /dev/null @@ -1,333 +0,0 @@ -use crate::{ - library::Library, - location::ScanState, - old_job::{ - CurrentStep, JobError, JobInitOutput, JobReportUpdate, JobResult, JobRunMetadata, - JobStepOutput, StatefulJob, WorkerContext, - }, -}; - -use sd_core_file_path_helper::{ - ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - IsolatedFilePathData, -}; -use sd_core_prisma_helpers::file_path_for_file_identifier; - -use sd_prisma::prisma::{file_path, location, PrismaClient, SortOrder}; -use sd_utils::db::maybe_missing; - -use std::{ - hash::{Hash, Hasher}, - path::{Path, PathBuf}, -}; - -use prisma_client_rust::or; -use serde::{Deserialize, Serialize}; -use serde_json::json; -use tracing::{debug, info, trace}; - -use super::{process_identifier_file_paths, FileIdentifierJobError, CHUNK_SIZE}; - -/// `FileIdentifierJobInit` takes file_paths without an object_id from a location -/// or starting from a `sub_path` getting every descendent from this `sub_path` -/// and uniquely identifies them: -/// - first: generating the cas_id and extracting metadata -/// - finally: creating unique object records, and linking them to their file_paths -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct OldFileIdentifierJobInit { - pub location: location::Data, - pub sub_path: Option, // subpath to start from -} - -impl Hash for OldFileIdentifierJobInit { - fn hash(&self, state: &mut H) { - self.location.id.hash(state); - if let Some(ref sub_path) = self.sub_path { - sub_path.hash(state); - } - } -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct OldFileIdentifierJobData { - location_path: PathBuf, - maybe_sub_iso_file_path: Option>, -} - -#[derive(Serialize, Deserialize, Default, Debug)] -pub struct OldFileIdentifierJobRunMetadata { - cursor: file_path::id::Type, - total_orphan_paths: usize, - total_objects_created: usize, - total_objects_linked: usize, - total_objects_ignored: usize, -} - -impl JobRunMetadata for OldFileIdentifierJobRunMetadata { - fn update(&mut self, new_data: Self) { - self.total_orphan_paths += new_data.total_orphan_paths; - self.total_objects_created += new_data.total_objects_created; - self.total_objects_linked += new_data.total_objects_linked; - self.total_objects_ignored += new_data.total_objects_ignored; - self.cursor = new_data.cursor; - } -} - -#[async_trait::async_trait] -impl StatefulJob for OldFileIdentifierJobInit { - type Data = OldFileIdentifierJobData; - type Step = (); - type RunMetadata = OldFileIdentifierJobRunMetadata; - - const NAME: &'static str = "file_identifier"; - const IS_BATCHED: bool = true; - - fn target_location(&self) -> location::id::Type { - self.location.id - } - - async fn init( - &self, - ctx: &WorkerContext, - data: &mut Option, - ) -> Result, JobError> { - let init = self; - let Library { db, .. } = &*ctx.library; - - debug!("Identifying orphan File Paths..."); - - let location_id = init.location.id; - - let location_path = maybe_missing(&init.location.path, "location.path").map(Path::new)?; - - let maybe_sub_iso_file_path = match &init.sub_path { - Some(sub_path) if sub_path != Path::new("") => { - let full_path = ensure_sub_path_is_in_location(location_path, sub_path) - .await - .map_err(FileIdentifierJobError::from)?; - ensure_sub_path_is_directory(location_path, sub_path) - .await - .map_err(FileIdentifierJobError::from)?; - - let sub_iso_file_path = - IsolatedFilePathData::new(location_id, location_path, &full_path, true) - .map_err(FileIdentifierJobError::from)?; - - ensure_file_path_exists( - sub_path, - &sub_iso_file_path, - db, - FileIdentifierJobError::SubPathNotFound, - ) - .await?; - - Some(sub_iso_file_path) - } - _ => None, - }; - - let orphan_count = - count_orphan_file_paths(db, location_id, &maybe_sub_iso_file_path).await?; - - // Initializing `state.data` here because we need a complete state in case of early finish - *data = Some(OldFileIdentifierJobData { - location_path: location_path.to_path_buf(), - maybe_sub_iso_file_path, - }); - - let data = data.as_ref().expect("we just set it"); - - if orphan_count == 0 { - return Err(JobError::EarlyFinish { - name: ::NAME.to_string(), - reason: "Found no orphan file paths to process".to_string(), - }); - } - - debug!("Found {} orphan file paths", orphan_count); - - let task_count = (orphan_count as f64 / CHUNK_SIZE as f64).ceil() as usize; - debug!( - "Found {} orphan Paths. Will execute {} tasks...", - orphan_count, task_count - ); - - let first_path = db - .file_path() - .find_first(orphan_path_filters( - location_id, - None, - &data.maybe_sub_iso_file_path, - )) - .select(file_path::select!({ id })) - .exec() - .await? - .expect("We already validated before that there are orphans `file_path`s"); - - ctx.progress(vec![ - JobReportUpdate::TaskCount(orphan_count), - JobReportUpdate::Message(format!("Found {orphan_count} files to be identified")), - ]); - - Ok(( - OldFileIdentifierJobRunMetadata { - total_orphan_paths: orphan_count, - cursor: first_path.id, - ..Default::default() - }, - vec![(); task_count], - ) - .into()) - } - - async fn execute_step( - &self, - ctx: &WorkerContext, - CurrentStep { step_number, .. }: CurrentStep<'_, Self::Step>, - data: &Self::Data, - run_metadata: &Self::RunMetadata, - ) -> Result, JobError> { - let init = self; - let location = &init.location; - - let mut new_metadata = Self::RunMetadata::default(); - - // get chunk of orphans to process - let file_paths = get_orphan_file_paths( - &ctx.library.db, - location.id, - run_metadata.cursor, - &data.maybe_sub_iso_file_path, - ) - .await?; - - // if no file paths found, abort entire job early, there is nothing to do - // if we hit this error, there is something wrong with the data/query - if file_paths.is_empty() { - return Err(JobError::EarlyFinish { - name: ::NAME.to_string(), - reason: "Expected orphan Paths not returned from database query for this chunk" - .to_string(), - }); - } - - let (total_objects_created, total_objects_linked, new_cursor) = - process_identifier_file_paths( - location, - &file_paths, - step_number, - run_metadata.cursor, - &ctx.library, - run_metadata.total_orphan_paths, - ) - .await?; - - new_metadata.total_objects_created = total_objects_created; - new_metadata.total_objects_linked = total_objects_linked; - new_metadata.cursor = new_cursor; - - ctx.progress(vec![ - JobReportUpdate::CompletedTaskCount(step_number * CHUNK_SIZE + file_paths.len()), - JobReportUpdate::Message(format!( - "Processed {} of {} orphan Paths", - step_number * CHUNK_SIZE, - run_metadata.total_orphan_paths - )), - ]); - - Ok(new_metadata.into()) - } - - async fn finalize( - &self, - ctx: &WorkerContext, - _data: &Option, - run_metadata: &Self::RunMetadata, - ) -> JobResult { - let init = self; - info!("Finalizing identifier job: {:?}", &run_metadata); - - ctx.library - .db - .location() - .update( - location::id::equals(init.location.id), - vec![location::scan_state::set(ScanState::FilesIdentified as i32)], - ) - .exec() - .await - .map_err(FileIdentifierJobError::from)?; - - Ok(Some(json!({"init: ": init, "run_metadata": run_metadata}))) - } -} - -fn orphan_path_filters( - location_id: location::id::Type, - file_path_id: Option, - maybe_sub_iso_file_path: &Option>, -) -> Vec { - sd_utils::chain_optional_iter( - [ - or!( - file_path::object_id::equals(None), - file_path::cas_id::equals(None) - ), - file_path::is_dir::equals(Some(false)), - file_path::location_id::equals(Some(location_id)), - file_path::size_in_bytes_bytes::not(Some(0u64.to_be_bytes().to_vec())), - ], - [ - // this is a workaround for the cursor not working properly - file_path_id.map(file_path::id::gte), - maybe_sub_iso_file_path.as_ref().map(|sub_iso_file_path| { - file_path::materialized_path::starts_with( - sub_iso_file_path - .materialized_path_for_children() - .expect("sub path iso_file_path must be a directory"), - ) - }), - ], - ) -} - -async fn count_orphan_file_paths( - db: &PrismaClient, - location_id: location::id::Type, - maybe_sub_materialized_path: &Option>, -) -> Result { - db.file_path() - .count(orphan_path_filters( - location_id, - None, - maybe_sub_materialized_path, - )) - .exec() - .await - .map(|c| c as usize) -} - -async fn get_orphan_file_paths( - db: &PrismaClient, - location_id: location::id::Type, - file_path_id: file_path::id::Type, - maybe_sub_materialized_path: &Option>, -) -> Result, prisma_client_rust::QueryError> { - trace!( - "Querying {} orphan Paths at cursor: {:?}", - CHUNK_SIZE, - file_path_id - ); - db.file_path() - .find_many(orphan_path_filters( - location_id, - Some(file_path_id), - maybe_sub_materialized_path, - )) - .order_by(file_path::id::order(SortOrder::Asc)) - .take(CHUNK_SIZE as i64) - // .skip(1) - .select(file_path_for_file_identifier::select()) - .exec() - .await -} diff --git a/core/src/object/old_file_identifier/shallow.rs b/core/src/object/old_file_identifier/shallow.rs deleted file mode 100644 index 04355be15..000000000 --- a/core/src/object/old_file_identifier/shallow.rs +++ /dev/null @@ -1,182 +0,0 @@ -use crate::{invalidate_query, library::Library, old_job::JobError}; - -use sd_core_file_path_helper::{ - ensure_file_path_exists, ensure_sub_path_is_directory, ensure_sub_path_is_in_location, - IsolatedFilePathData, -}; -use sd_core_prisma_helpers::file_path_for_file_identifier; - -use sd_prisma::prisma::{file_path, location, PrismaClient, SortOrder}; -use sd_utils::db::maybe_missing; - -use std::path::{Path, PathBuf}; - -use prisma_client_rust::or; -use serde::{Deserialize, Serialize}; -use tracing::{trace, warn}; - -use super::{process_identifier_file_paths, FileIdentifierJobError, CHUNK_SIZE}; - -#[derive(Serialize, Deserialize)] -pub struct ShallowFileIdentifierJobState { - cursor: file_path::id::Type, - sub_iso_file_path: IsolatedFilePathData<'static>, -} - -pub async fn old_shallow( - location: &location::Data, - sub_path: &PathBuf, - library: &Library, -) -> Result<(), JobError> { - let Library { db, .. } = library; - - warn!("Identifying orphan File Paths..."); - - let location_id = location.id; - let location_path = maybe_missing(&location.path, "location.path").map(Path::new)?; - - let sub_iso_file_path = if sub_path != Path::new("") { - let full_path = ensure_sub_path_is_in_location(location_path, &sub_path) - .await - .map_err(FileIdentifierJobError::from)?; - ensure_sub_path_is_directory(location_path, &sub_path) - .await - .map_err(FileIdentifierJobError::from)?; - - let sub_iso_file_path = - IsolatedFilePathData::new(location_id, location_path, &full_path, true) - .map_err(FileIdentifierJobError::from)?; - - ensure_file_path_exists( - &sub_path, - &sub_iso_file_path, - db, - FileIdentifierJobError::SubPathNotFound, - ) - .await?; - - sub_iso_file_path - } else { - IsolatedFilePathData::new(location_id, location_path, location_path, true) - .map_err(FileIdentifierJobError::from)? - }; - - let orphan_count = count_orphan_file_paths(db, location_id, &sub_iso_file_path).await?; - - if orphan_count == 0 { - return Ok(()); - } - - let task_count = (orphan_count as f64 / CHUNK_SIZE as f64).ceil() as usize; - warn!( - "Found {} orphan Paths. Will execute {} tasks...", - orphan_count, task_count - ); - - let Some(first_path) = db - .file_path() - .find_first(orphan_path_filters(location_id, None, &sub_iso_file_path)) - // .order_by(file_path::id::order(Direction::Asc)) - .select(file_path::select!({ id })) - .exec() - .await? - else { - warn!("No orphan Paths found due to another Job finishing first"); - return Ok(()); - }; - - // Initializing `state.data` here because we need a complete state in case of early finish - let mut data = ShallowFileIdentifierJobState { - cursor: first_path.id, - sub_iso_file_path, - }; - - for step_number in 0..task_count { - let ShallowFileIdentifierJobState { - cursor, - sub_iso_file_path, - } = &mut data; - - // get chunk of orphans to process - let file_paths = - get_orphan_file_paths(&library.db, location.id, *cursor, sub_iso_file_path).await?; - - let (_, _, new_cursor) = process_identifier_file_paths( - location, - &file_paths, - step_number, - *cursor, - library, - orphan_count, - ) - .await?; - *cursor = new_cursor; - } - - invalidate_query!(library, "search.paths"); - invalidate_query!(library, "search.objects"); - - Ok(()) -} - -fn orphan_path_filters( - location_id: location::id::Type, - file_path_id: Option, - sub_iso_file_path: &IsolatedFilePathData<'_>, -) -> Vec { - sd_utils::chain_optional_iter( - [ - or!( - file_path::object_id::equals(None), - file_path::cas_id::equals(None) - ), - file_path::is_dir::equals(Some(false)), - file_path::location_id::equals(Some(location_id)), - file_path::materialized_path::equals(Some( - sub_iso_file_path - .materialized_path_for_children() - .expect("sub path for shallow identifier must be a directory"), - )), - file_path::size_in_bytes_bytes::not(Some(0u64.to_be_bytes().to_vec())), - ], - [file_path_id.map(file_path::id::gte)], - ) -} - -async fn count_orphan_file_paths( - db: &PrismaClient, - location_id: location::id::Type, - sub_iso_file_path: &IsolatedFilePathData<'_>, -) -> Result { - db.file_path() - .count(orphan_path_filters(location_id, None, sub_iso_file_path)) - .exec() - .await - .map(|c| c as usize) -} - -async fn get_orphan_file_paths( - db: &PrismaClient, - location_id: location::id::Type, - file_path_id_cursor: file_path::id::Type, - sub_iso_file_path: &IsolatedFilePathData<'_>, -) -> Result, prisma_client_rust::QueryError> { - trace!( - "Querying {} orphan Paths at cursor: {:?}", - CHUNK_SIZE, - file_path_id_cursor - ); - db.file_path() - .find_many(orphan_path_filters( - location_id, - Some(file_path_id_cursor), - sub_iso_file_path, - )) - .order_by(file_path::id::order(SortOrder::Asc)) - // .cursor(cursor.into()) - .take(CHUNK_SIZE as i64) - // .skip(1) - .select(file_path_for_file_identifier::select()) - .exec() - .await -} diff --git a/core/src/object/old_orphan_remover.rs b/core/src/object/old_orphan_remover.rs index 35b316842..25acf9852 100644 --- a/core/src/object/old_orphan_remover.rs +++ b/core/src/object/old_orphan_remover.rs @@ -9,6 +9,8 @@ use tokio::{ }; use tracing::{error, trace}; +// TODO(fogodev): To be rewritten using new task system + const TEN_SECONDS: Duration = Duration::from_secs(10); const ONE_MINUTE: Duration = Duration::from_secs(60); @@ -73,7 +75,7 @@ impl OrphanRemoverActor { .map(|object| object.id) .collect::>() }) - .map_err(|e| error!("Failed to fetch orphaned objects: {e:#?}")) + .map_err(|e| error!(?e, "Failed to fetch orphaned objects;")) else { break; }; @@ -82,7 +84,10 @@ impl OrphanRemoverActor { break; } - trace!("Removing {} orphaned objects", objects_ids.len()); + trace!( + orphans_count = objects_ids.len(), + "Removing orphaned objects;" + ); if let Err(e) = db ._batch(( @@ -93,7 +98,7 @@ impl OrphanRemoverActor { )) .await { - error!("Failed to remove orphaned objects: {e:#?}"); + error!(?e, "Failed to remove orphaned objects;"); break; } } diff --git a/core/src/object/tag/mod.rs b/core/src/object/tag/mod.rs index 240c5c4f2..82b82c3d7 100644 --- a/core/src/object/tag/mod.rs +++ b/core/src/object/tag/mod.rs @@ -4,8 +4,6 @@ use sd_prisma::{prisma::tag, prisma_sync}; use sd_sync::*; use chrono::{DateTime, FixedOffset, Utc}; - -use sd_utils::msgpack; use serde::Deserialize; use specta::Type; use uuid::Uuid; @@ -26,6 +24,15 @@ impl TagCreateArgs { let pub_id = Uuid::new_v4().as_bytes().to_vec(); let date_created: DateTime = Utc::now().into(); + let (sync_params, db_params): (Vec<_>, Vec<_>) = [ + sync_db_entry!(self.name, tag::name), + sync_db_entry!(self.color, tag::color), + sync_db_entry!(false, tag::is_hidden), + sync_db_entry!(date_created, tag::date_created), + ] + .into_iter() + .unzip(); + sync.write_ops( db, ( @@ -33,25 +40,9 @@ impl TagCreateArgs { prisma_sync::tag::SyncId { pub_id: pub_id.clone(), }, - [ - (tag::name::NAME, msgpack!(&self.name)), - (tag::color::NAME, msgpack!(&self.color)), - (tag::is_hidden::NAME, msgpack!(false)), - ( - tag::date_created::NAME, - msgpack!(&date_created.to_rfc3339()), - ), - ], - ), - db.tag().create( - pub_id, - vec![ - tag::name::set(Some(self.name)), - tag::color::set(Some(self.color)), - tag::is_hidden::set(Some(false)), - tag::date_created::set(Some(date_created)), - ], + sync_params, ), + db.tag().create(pub_id, db_params), ), ) .await diff --git a/core/src/object/validation/old_validator_job.rs b/core/src/object/validation/old_validator_job.rs index 4cbafcfab..d90fc56cb 100644 --- a/core/src/object/validation/old_validator_job.rs +++ b/core/src/object/validation/old_validator_job.rs @@ -189,13 +189,10 @@ impl StatefulJob for OldObjectValidatorJobInit { .expect("critical error: missing data on job state"); info!( - "finalizing validator job at {}{}: {} tasks", - data.location_path.display(), - init.sub_path - .as_ref() - .map(|p| format!("{}", p.display())) - .unwrap_or_default(), - data.task_count + location_path = %data.location_path.display(), + sub_path = ?init.sub_path.as_ref().map(|p| p.display()), + task_count = data.task_count, + "finalizing validator job;", ); Ok(Some(json!({ "init": init }))) diff --git a/core/src/old_job/error.rs b/core/src/old_job/error.rs index 5cc4f9604..e5315916c 100644 --- a/core/src/old_job/error.rs +++ b/core/src/old_job/error.rs @@ -1,8 +1,8 @@ use crate::{ - location::{indexer::IndexerError, LocationError}, + location::{/*indexer::IndexerError,*/ LocationError}, object::{ - fs::error::FileSystemJobsError, media::old_media_processor::MediaProcessorError, - old_file_identifier::FileIdentifierJobError, validation::ValidatorError, + fs::error::FileSystemJobsError, /*media::old_media_processor::MediaProcessorError,*/ + /*old_file_identifier::FileIdentifierJobError,*/ validation::ValidatorError, }, }; @@ -57,12 +57,6 @@ pub enum JobError { // Specific job errors #[error(transparent)] - Indexer(#[from] IndexerError), - #[error(transparent)] - MediaProcessor(#[from] MediaProcessorError), - #[error(transparent)] - FileIdentifier(#[from] FileIdentifierJobError), - #[error(transparent)] Validator(#[from] ValidatorError), #[error(transparent)] FileSystemJobsError(#[from] FileSystemJobsError), diff --git a/core/src/old_job/manager.rs b/core/src/old_job/manager.rs index 9d373c05c..2770eb7e5 100644 --- a/core/src/old_job/manager.rs +++ b/core/src/old_job/manager.rs @@ -1,16 +1,13 @@ use crate::{ library::Library, - location::indexer::old_indexer_job::OldIndexerJobInit, object::{ fs::{ old_copy::OldFileCopierJobInit, old_cut::OldFileCutterJobInit, old_delete::OldFileDeleterJobInit, old_erase::OldFileEraserJobInit, }, - media::old_media_processor::OldMediaProcessorJobInit, - old_file_identifier::old_file_identifier_job::OldFileIdentifierJobInit, validation::old_validator_job::OldObjectValidatorJobInit, }, - old_job::{worker::Worker, DynJob, Job, JobError}, + old_job::{worker::Worker, DynJob, JobError, OldJob}, Node, }; @@ -24,10 +21,10 @@ use std::{ use futures::future::join_all; use prisma_client_rust::operator::or; use tokio::sync::{mpsc, oneshot, RwLock}; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info, instrument, warn}; use uuid::Uuid; -use super::{JobIdentity, JobManagerError, JobReport, JobStatus, StatefulJob}; +use super::{JobIdentity, JobManagerError, JobStatus, OldJobReport, StatefulJob}; const MAX_WORKERS: usize = 5; @@ -66,9 +63,8 @@ impl Actor { } } -/// JobManager handles queueing and executing jobs using the `DynJob` -/// Handling persisting JobReports to the database, pause/resuming, and -/// +/// JobManager handles queueing and executing jobs using the [`DynJob`] +/// Handling persisting JobReports to the database, pause/resuming pub struct OldJobs { current_jobs_hashes: RwLock>, job_queue: RwLock>>, @@ -97,12 +93,17 @@ impl OldJobs { ) } + #[instrument( + skip_all, + fields(library_id = %library.id, job_name = %job.name(), job_hash = %job.hash()), + err, + )] /// Ingests a new job and dispatches it if possible, queues it otherwise. pub async fn ingest( self: Arc, node: &Arc, library: &Arc, - job: Box>, + job: Box>, ) -> Result<(), JobManagerError> { let job_hash = job.hash(); @@ -113,17 +114,17 @@ impl OldJobs { }); } - debug!( - "Ingesting job: ", - job.name(), - job_hash - ); + debug!("Ingesting job;"); self.current_jobs_hashes.write().await.insert(job_hash); self.dispatch(node, library, job).await; Ok(()) } + #[instrument( + skip_all, + fields(library_id = %library.id, job_name = %job.name(), job_hash = %job.hash()), + )] /// Dispatches a job to a worker if under MAX_WORKERS limit, queues it otherwise. async fn dispatch( self: Arc, @@ -138,7 +139,7 @@ impl OldJobs { .expect("critical error: missing job on worker"); if running_workers.len() < MAX_WORKERS { - info!("Running job: {:?}", job.name()); + info!("Running job"); let worker_id = job_report.parent_id.unwrap_or(job_report.id); @@ -153,21 +154,17 @@ impl OldJobs { .await .map_or_else( |e| { - error!("Error spawning worker: {:#?}", e); + error!(?e, "Error spawning worker;"); }, |worker| { running_workers.insert(worker_id, worker); }, ); } else { - debug!( - "Queueing job: ", - job.name(), - job.hash() - ); + debug!("Queueing job"); if let Err(e) = job_report.create(library).await { // It's alright to just log here, as will try to create the report on run if it wasn't created before - error!("Error creating job report: {:#?}", e); + error!(?e, "Error creating job report;"); } // Put the report back, or it will be lost forever @@ -218,11 +215,12 @@ impl OldJobs { }); } + #[instrument(skip(self))] /// Pause a specific job. pub async fn pause(&self, job_id: Uuid) -> Result<(), JobManagerError> { // Look up the worker for the given job ID. if let Some(worker) = self.running_workers.read().await.get(&job_id) { - debug!("Pausing job: {:#?}", worker.report()); + debug!(report = ?worker.report(), "Pausing job;"); // Set the pause signal in the worker. worker.pause().await; @@ -236,7 +234,7 @@ impl OldJobs { pub async fn resume(&self, job_id: Uuid) -> Result<(), JobManagerError> { // Look up the worker for the given job ID. if let Some(worker) = self.running_workers.read().await.get(&job_id) { - debug!("Resuming job: {:?}", worker.report()); + debug!(report = ?worker.report(), "Resuming job;"); // Set the pause signal in the worker. worker.resume().await; @@ -251,7 +249,7 @@ impl OldJobs { pub async fn cancel(&self, job_id: Uuid) -> Result<(), JobManagerError> { // Look up the worker for the given job ID. if let Some(worker) = self.running_workers.read().await.get(&job_id) { - debug!("Canceling job: {:#?}", worker.report()); + debug!(report = ?worker.report(), "Canceling job;"); // Set the cancel signal in the worker. worker.cancel().await; @@ -285,24 +283,36 @@ impl OldJobs { .exec() .await? .into_iter() - .map(JobReport::try_from); + .map(OldJobReport::try_from); for job in all_jobs { let job = job?; match initialize_resumable_job(job.clone(), None) { Ok(resumable_job) => { - info!("Resuming job: {} with uuid {}", job.name, job.id); + info!(%job.name, %job.id, "Resuming job;"); Arc::clone(&self) .dispatch(node, library, resumable_job) .await; } - Err(err) => { + Err(JobError::UnknownJobName(_, job_name)) + if matches!( + job_name.as_str(), + "indexer" | "file_identifier" | "media_processor" + ) => + { + debug!(%job_name, "Moved to new job system"); + } + Err(e) => { warn!( - "Failed to initialize job: {} with uuid {}, error: {:?}", - job.name, job.id, err + %job.name, + %job.id, + ?e, + "Failed to initialize job;", ); - info!("Cancelling job: {} with uuid {}", job.name, job.id); + + info!(%job.name, %job.id, "Cancelling job;"); + library .db .job() @@ -319,7 +329,7 @@ impl OldJobs { } // get all active jobs, including paused jobs organized by job id - pub async fn get_active_reports_with_id(&self) -> HashMap { + pub async fn get_active_reports_with_id(&self) -> HashMap { self.running_workers .read() .await @@ -332,7 +342,7 @@ impl OldJobs { } // get all running jobs, excluding paused jobs organized by action - pub async fn get_running_reports(&self) -> HashMap { + pub async fn get_running_reports(&self) -> HashMap { self.running_workers .read() .await @@ -382,23 +392,21 @@ mod macros { } /// This function is used to initialize a DynJob from a job report. fn initialize_resumable_job( - job_report: JobReport, + job_report: OldJobReport, next_jobs: Option>>, ) -> Result, JobError> { dispatch_call_to_job_by_name!( job_report.name.as_str(), - T -> Job::::new_from_report(job_report, next_jobs), + T -> OldJob::::new_from_report(job_report, next_jobs), default = { error!( - "Unknown job type: {}, id: {}", - job_report.name, job_report.id + %job_report.name, + %job_report.id, + "Unknown job type;", ); Err(JobError::UnknownJobName(job_report.id, job_report.name)) }, jobs = [ - OldMediaProcessorJobInit, - OldIndexerJobInit, - OldFileIdentifierJobInit, OldObjectValidatorJobInit, OldFileCutterJobInit, OldFileCopierJobInit, diff --git a/core/src/old_job/mod.rs b/core/src/old_job/mod.rs index ab22d1672..42190645d 100644 --- a/core/src/old_job/mod.rs +++ b/core/src/old_job/mod.rs @@ -20,7 +20,7 @@ use tokio::{ spawn, task::{JoinError, JoinHandle}, }; -use tracing::{debug, error, info, trace, warn}; +use tracing::{debug, error, info, instrument, trace, warn}; use uuid::Uuid; mod error; @@ -133,8 +133,8 @@ pub trait StatefulJob: pub trait DynJob: Send + Sync { fn id(&self) -> Uuid; fn parent_id(&self) -> Option; - fn report(&self) -> &Option; - fn report_mut(&mut self) -> &mut Option; + fn report(&self) -> &Option; + fn report_mut(&mut self) -> &mut Option; fn name(&self) -> &'static str; async fn run( &mut self, @@ -149,20 +149,23 @@ pub trait DynJob: Send + Sync { async fn cancel_children(&mut self, library: &Library) -> Result<(), JobError>; } -pub struct JobBuilder { +pub struct OldJob { id: Uuid, - init: SJob, - report_builder: JobReportBuilder, + hash: u64, + report: Option, + state: Option>, + next_jobs: VecDeque>, } -impl JobBuilder { - pub fn build(self) -> Box> { - Box::new(Job:: { - id: self.id, - hash: ::hash(&self.init), - report: Some(self.report_builder.build()), +impl OldJob { + pub fn new(init: SJob) -> Box { + let id = Uuid::new_v4(); + Box::new(OldJob:: { + id, + hash: ::hash(&init), + report: Some(JobReportBuilder::new(id, SJob::NAME.to_string()).build()), state: Some(JobState { - init: self.init, + init, data: None, steps: VecDeque::new(), step_number: 0, @@ -172,67 +175,9 @@ impl JobBuilder { }) } - pub fn new(init: SJob) -> Self { - let id = Uuid::new_v4(); - Self { - id, - init, - report_builder: JobReportBuilder::new(id, SJob::NAME.to_string()), - } - } - - pub fn with_action(mut self, action: impl AsRef) -> Self { - self.report_builder = self.report_builder.with_action(action); - self - } - - pub fn with_parent_id(mut self, parent_id: Uuid) -> Self { - self.report_builder = self.report_builder.with_parent_id(parent_id); - self - } - - pub fn with_metadata(mut self, metadata: serde_json::Value) -> Self { - self.report_builder = self.report_builder.with_metadata(metadata); - self - } -} - -pub struct Job { - id: Uuid, - hash: u64, - report: Option, - state: Option>, - next_jobs: VecDeque>, -} - -impl Job { - pub fn new(init: SJob) -> Box { - JobBuilder::new(init).build() - } - - pub fn queue_next(mut self: Box, init: NextSJob) -> Box - where - NextSJob: StatefulJob + 'static, - { - let next_job_order = self.next_jobs.len() + 1; - - let mut child_job_builder = JobBuilder::new(init).with_parent_id(self.id); - - if let Some(parent_report) = self.report() { - if let Some(parent_action) = &parent_report.action { - child_job_builder = - child_job_builder.with_action(format!("{parent_action}-{next_job_order}")); - } - } - - self.next_jobs.push_back(child_job_builder.build()); - - self - } - // this function returns an ingestible job instance from a job report pub fn new_from_report( - mut report: JobReport, + mut report: OldJobReport, next_jobs: Option>>, ) -> Result, JobError> { let state = rmp_serde::from_slice::>( @@ -435,7 +380,7 @@ impl From> for JobStepOutput DynJob for Job { +impl DynJob for OldJob { fn id(&self) -> Uuid { // SAFETY: This method is using during queueing, so we still have a report self.report() @@ -448,11 +393,11 @@ impl DynJob for Job { self.report.as_ref().and_then(|r| r.parent_id) } - fn report(&self) -> &Option { + fn report(&self) -> &Option { &self.report } - fn report_mut(&mut self) -> &mut Option { + fn report_mut(&mut self) -> &mut Option { &mut self.report } @@ -460,6 +405,8 @@ impl DynJob for Job { ::NAME } + #[instrument(skip_all, fields(job_name = %self.name(), job_id = %self.id()), err)] + #[allow(clippy::blocks_in_conditions)] // Due to `err` on instrument above async fn run( &mut self, ctx: WorkerContext, @@ -468,7 +415,7 @@ impl DynJob for Job { let job_name = self.name(); let job_id = self.id; let mut errors = vec![]; - info!("Starting Job "); + info!("Starting Job"); let JobState { init, @@ -542,7 +489,7 @@ impl DynJob for Job { run_metadata.update(new_run_metadata); } Err(e @ JobError::EarlyFinish { .. }) => { - info!("{e}"); + info!(%e); job_should_run = false; } Err(e) => return Err(e), @@ -654,16 +601,16 @@ impl DynJob for Job { } if !new_errors.is_empty() { - warn!("Job had a step with errors"); - new_errors.iter().for_each(|err| { - warn!("Job error: {:?}", err); + warn!("Job had a step with errors"); + new_errors.iter().for_each(|e| { + warn!(?e, "Job error;"); }); errors.extend(new_errors); } } Err(e @ JobError::EarlyFinish { .. }) => { - info!("{e}"); + info!(%e); break; } Err(e) => return Err(e), @@ -672,14 +619,11 @@ impl DynJob for Job { step_number += 1; } - debug!( - "Total job run time {:?} Job ", - job_init_time.elapsed() - ); + debug!(job_init_time = ?job_init_time.elapsed(), "Total job run time;"); Some(Arc::try_unwrap(working_data_arc).expect("job already ran, no more refs")) } else { - warn!("Tried to run a job without data Job "); + warn!("Tried to run a job without data"); None }; @@ -692,9 +636,10 @@ impl DynJob for Job { errors: errors.into(), next_job: next_jobs.pop_front().map(|mut next_job| { debug!( - "Job requesting to spawn '{}' now that it's complete!", - next_job.name() + next_job_name = %next_job.name(), + "Job requesting to spawn next job now that it's complete!;", ); + next_job.set_next_jobs(next_jobs); next_job @@ -823,16 +768,13 @@ async fn handle_init_phase( match msg { StreamMessage::InitResult(Err(join_error)) => { error!( - "Job \ - failed to initialize due to an internal error: {join_error:#?}", + ?join_error, + "Job failed to initialize due to an internal error;" ); return Err(join_error.into()); } StreamMessage::InitResult(Ok((stateful_job, maybe_data, output))) => { - debug!( - "Init phase took {:?} Job ", - init_time.elapsed() - ); + debug!(init_phase_time = ?init_time.elapsed(), "Init phase completed;"); return Ok(InitPhaseOutput { stateful_job, @@ -854,10 +796,7 @@ async fn handle_init_phase( } } StreamMessage::NewCommand(WorkerCommand::Pause(when)) => { - debug!( - "Pausing Job at init phase took {:?}", - when.elapsed() - ); + debug!(pausing_time = ?when.elapsed(), "Pausing Job at init phase;"); // Notify the worker's work task that now we're paused worker_ctx.pause(); @@ -883,13 +822,11 @@ async fn handle_init_phase( } WorkerCommand::Resume(when) => { debug!( - "Resuming Job at init phase took {:?}", - when.elapsed() - ); - debug!( - "Total paused time {:?} Job ", - paused_time.elapsed() + resuming_time = ?when.elapsed(), + paused_time = ?paused_time.elapsed(), + "Resuming Job at init phase;", ); + status = JobStatus::Running; continue 'messages; @@ -899,12 +836,11 @@ async fn handle_init_phase( init_abort_handle.abort(); debug!( - "Shuting down Job at init phase \ - took {:?} after running for {:?}", - when.elapsed(), - init_time.elapsed(), + shutting_down_time = ?when.elapsed(), + paused_time = ?paused_time.elapsed(), + total_running_time = ?init_time.elapsed(), + "Shuting down Job at init phase;", ); - debug!("Total paused time {:?}", paused_time.elapsed()); // Shutting down at init phase will abort the job return Err(JobError::Canceled(signal_tx)); @@ -912,25 +848,19 @@ async fn handle_init_phase( WorkerCommand::Cancel(when, signal_tx) => { init_abort_handle.abort(); debug!( - "Canceling Job at init phase \ - took {:?} after running for {:?}", - when.elapsed(), - init_time.elapsed(), - ); - debug!( - "Total paused time {:?} Job ", - paused_time.elapsed() + canceling_time = ?when.elapsed(), + paused_time = ?paused_time.elapsed(), + total_running_time = ?init_time.elapsed(), + "Canceling Job at init phase;", ); + return Err(JobError::Canceled(signal_tx)); } WorkerCommand::Pause(_) => { // We continue paused lol } WorkerCommand::Timeout(elapsed, tx) => { - error!( - "Job \ - timed out at init phase after {elapsed:?} without updates" - ); + error!(elapsed_time = ?elapsed, "Job timed out at init phase;"); tx.send(()).ok(); return Err(JobError::Timeout(elapsed)); } @@ -938,10 +868,7 @@ async fn handle_init_phase( } if commands_rx.is_closed() { - error!( - "Job \ - closed the command channel while paused" - ); + error!("Job closed the command channel while paused"); return Err(JobError::Critical( "worker command channel closed while job was paused", )); @@ -954,10 +881,9 @@ async fn handle_init_phase( init_abort_handle.abort(); debug!( - "Shuting down at init phase Job took {:?} \ - after running for {:?}", - when.elapsed(), - init_time.elapsed(), + shutting_down_time = ?when.elapsed(), + total_running_time = ?init_time.elapsed(), + "Shuting down at init phase;", ); // Shutting down at init phase will abort the job @@ -967,18 +893,17 @@ async fn handle_init_phase( init_abort_handle.abort(); debug!( - "Canceling at init phase Job took {:?} \ - after running for {:?}", - when.elapsed(), - init_time.elapsed() + canceling_time = ?when.elapsed(), + total_running_time = ?init_time.elapsed(), + "Canceling at init phase;", ); return Err(JobError::Canceled(signal_tx)); } StreamMessage::NewCommand(WorkerCommand::Timeout(elapsed, tx)) => { error!( - "Job \ - timed out at init phase after {elapsed:?} without updates" + elapsed_time = ?elapsed, + "Job timed out at init phase;", ); tx.send(()).ok(); return Err(JobError::Timeout(elapsed)); @@ -1014,6 +939,7 @@ type StepArcs = ( Arc, ); +#[instrument(skip_all, fields(job_id = %id, job_name = %name, %step_number))] #[inline] async fn handle_single_step( JobRunWorkTable { @@ -1030,7 +956,7 @@ async fn handle_single_step( step, mut step_task, }: JobStepDataWorkTable, - mut commands_rx: chan::Receiver, + commands_rx: chan::Receiver, ) -> Result, JobError> { enum StreamMessage { NewCommand(WorkerCommand), @@ -1050,17 +976,11 @@ async fn handle_single_step( 'messages: while let Some(msg) = msg_stream.next().await { match msg { StreamMessage::StepResult(Err(join_error)) => { - error!( - "Job \ - failed to run step #{step_number} due to an internal error: {join_error:#?}", - ); + error!(?join_error, "Failed to run step due to an internal error;"); return Err(join_error.into()); } StreamMessage::StepResult(Ok(output)) => { - trace!( - "Step finished in {:?} Job ", - init_time.elapsed(), - ); + trace!(elapsed = ?init_time.elapsed(), "Step finished;"); return Ok(JobStepsPhaseOutput { steps, @@ -1082,10 +1002,7 @@ async fn handle_single_step( } } StreamMessage::NewCommand(WorkerCommand::Pause(when)) => { - debug!( - "Pausing Job took {:?}", - when.elapsed() - ); + debug!(elapsed = ?when.elapsed(), "Pausing Job;"); worker_ctx.pause(); @@ -1109,14 +1026,8 @@ async fn handle_single_step( } } WorkerCommand::Resume(when) => { - debug!( - "Resuming Job took {:?}", - when.elapsed(), - ); - debug!( - "Total paused time {:?} Job ", - paused_time.elapsed(), - ); + debug!(elapsed = ?when.elapsed(), "Resuming Job;"); + debug!(paused_time = ?paused_time.elapsed(), "Total paused time;"); status = JobStatus::Running; continue 'messages; @@ -1127,15 +1038,11 @@ async fn handle_single_step( let _ = step_task.await; debug!( - "Shuting down Job took {:?} \ - after running for {:?}", - when.elapsed(), - job_init_time.elapsed(), - ); - debug!( - "Total paused time {:?} Job ", - paused_time.elapsed(), + elapsed_time_to_shutdown = ?when.elapsed(), + job_run_time = ?job_init_time.elapsed(), + "Shuting down;", ); + debug!(paused_time = ?paused_time.elapsed(), "Total paused time;"); // Taking back the last step, so it can run to completion later steps.push_front( @@ -1162,15 +1069,11 @@ async fn handle_single_step( step_task.abort(); let _ = step_task.await; debug!( - "Canceling Job \ - took {:?} after running for {:?}", - when.elapsed(), - job_init_time.elapsed(), - ); - debug!( - "Total paused time {:?} Job ", - paused_time.elapsed(), + canceling_time = ?when.elapsed(), + job_run_time = ?job_init_time.elapsed(), + "Canceling Job;", ); + debug!(paused_time = ?paused_time.elapsed(), "Total paused time;"); return Err(JobError::Canceled(signal_tx)); } WorkerCommand::Pause(_) => { @@ -1178,10 +1081,7 @@ async fn handle_single_step( } WorkerCommand::Timeout(elapsed, tx) => { - error!( - "Job \ - timed out at step #{step_number} after {elapsed:?} without updates" - ); + error!(?elapsed, "Step timed out;"); tx.send(()).ok(); return Err(JobError::Timeout(elapsed)); } @@ -1189,10 +1089,7 @@ async fn handle_single_step( } if commands_rx.is_closed() { - error!( - "Job \ - closed the command channel while paused" - ); + error!("Closed the command channel while paused"); return Err(JobError::Critical( "worker command channel closed while job was paused", )); @@ -1206,10 +1103,9 @@ async fn handle_single_step( let _ = step_task.await; debug!( - "Shuting down Job took {:?} \ - after running for {:?}", - when.elapsed(), - job_init_time.elapsed(), + elapsed = ?when.elapsed(), + job_run_time = ?job_init_time.elapsed(), + "Shutting down Job;", ); // Taking back the last step, so it can run to completion later @@ -1237,18 +1133,15 @@ async fn handle_single_step( step_task.abort(); let _ = step_task.await; debug!( - "Canceling Job took {:?} \ - after running for {:?}", - when.elapsed(), - job_init_time.elapsed(), + cancel_time = ?when.elapsed(), + job_run_time = ?job_init_time.elapsed(), + "Canceling Job;", ); + return Err(JobError::Canceled(signal_tx)); } StreamMessage::NewCommand(WorkerCommand::Timeout(elapsed, tx)) => { - error!( - "Job \ - timed out at step #{step_number} after {elapsed:?} without updates" - ); + error!(?elapsed, "Job timed out without updates;"); tx.send(()).ok(); return Err(JobError::Timeout(elapsed)); } diff --git a/core/src/old_job/report.rs b/core/src/old_job/report.rs index 1e620290f..b85f58110 100644 --- a/core/src/old_job/report.rs +++ b/core/src/old_job/report.rs @@ -1,14 +1,20 @@ -use crate::library::Library; +use crate::{ + library::Library, + object::{ + fs::{ + old_copy::OldFileCopierJobInit, old_cut::OldFileCutterJobInit, + old_delete::OldFileDeleterJobInit, old_erase::OldFileEraserJobInit, + }, + validation::old_validator_job::OldObjectValidatorJobInit, + }, +}; use sd_core_prisma_helpers::job_without_data; use sd_prisma::prisma::job; use sd_utils::db::{maybe_missing, MissingFieldError}; -use std::{ - collections::HashMap, - fmt::{Display, Formatter}, -}; +use std::fmt::{Display, Formatter}; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; @@ -26,15 +32,15 @@ pub enum JobReportUpdate { Phase(String), } -#[derive(Debug, Serialize, Deserialize, Type, Clone)] -pub struct JobReport { +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct OldJobReport { pub id: Uuid, pub name: String, pub action: Option, pub data: Option>, - // In Typescript `any | null` is just `any` so we don't get prompted for null checks - // TODO(@Oscar): This will be fixed - #[specta(type = Option>)] + // // In Typescript `any | null` is just `any` so we don't get prompted for null checks + // // TODO(@Oscar): This will be fixed + // #[specta(type = Option>)] pub metadata: Option, pub errors_text: Vec, @@ -53,7 +59,150 @@ pub struct JobReport { pub estimated_completion: DateTime, } -impl Display for JobReport { +impl From for sd_core_heavy_lifting::job_system::report::Report { + fn from( + OldJobReport { + id, + name, + action, + data: _, // Not used in the new job system + metadata, + errors_text: _, // New job system uses type-safe errors + created_at, + started_at, + completed_at, + parent_id, + status, + task_count, + completed_task_count, + phase, + message, + estimated_completion, + }: OldJobReport, + ) -> Self { + use sd_core_heavy_lifting::{job_system::report::ReportOutputMetadata, JobName}; + + let mut new_metadata = Vec::new(); + + if let Some(metadata) = metadata { + if let Some(metadata) = metadata.as_object() { + if let Some(metadata) = metadata.get("output") { + if let Some(metadata) = metadata.as_object() { + if let Some(metadata) = metadata.get("init") { + if let Ok(OldFileCopierJobInit { + source_location_id, + target_location_id, + sources_file_path_ids, + target_location_relative_directory_path, + }) = serde_json::from_value::(metadata.clone()) + { + new_metadata.push( + ReportOutputMetadata::Copier { + source_location_id, + target_location_id, + sources_file_path_ids, + target_location_relative_directory_path, + } + .into(), + ); + } else if let Ok(OldFileCutterJobInit { + source_location_id, + target_location_id, + sources_file_path_ids, + target_location_relative_directory_path, + }) = + serde_json::from_value::(metadata.clone()) + { + new_metadata.push( + ReportOutputMetadata::Mover { + source_location_id, + target_location_id, + sources_file_path_ids, + target_location_relative_directory_path, + } + .into(), + ); + } else if let Ok(OldFileDeleterJobInit { + location_id, + file_path_ids, + }) = + serde_json::from_value::(metadata.clone()) + { + new_metadata.push( + ReportOutputMetadata::Deleter { + location_id, + file_path_ids, + } + .into(), + ); + } else if let Ok(OldFileEraserJobInit { + location_id, + file_path_ids, + passes, + }) = + serde_json::from_value::(metadata.clone()) + { + new_metadata.push( + ReportOutputMetadata::Eraser { + location_id, + file_path_ids, + passes: passes as u32, + } + .into(), + ); + } else if let Ok(OldObjectValidatorJobInit { location, sub_path }) = + serde_json::from_value::( + metadata.clone(), + ) { + new_metadata.push( + ReportOutputMetadata::FileValidator { + location_id: location.id, + sub_path, + } + .into(), + ); + } + } + } + } + } + } + + Self { + id, + name: match name.as_str() { + "file_copier" => JobName::Copy, + "file_cutter" => JobName::Move, + "file_deleter" => JobName::Delete, + "file_eraser" => JobName::Erase, + "object_validator" => JobName::FileValidator, + + // Already implemented in the new job system + "indexer" => JobName::Indexer, + "file_identifier" => JobName::FileIdentifier, + "media_processor" => JobName::MediaProcessor, + + unexpected_job => unimplemented!("Job {unexpected_job} not implemented"), + }, + action, + metadata: new_metadata, + critical_error: None, + non_critical_errors: Vec::new(), + created_at, + started_at, + completed_at, + parent_id, + status: status.into(), + task_count, + completed_task_count, + phase, + message, + estimated_completion, + } + } +} + +impl Display for OldJobReport { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!( f, @@ -64,7 +213,7 @@ impl Display for JobReport { } // convert database struct into a resource struct -impl TryFrom for JobReport { +impl TryFrom for OldJobReport { type Error = MissingFieldError; fn try_from(data: job::Data) -> Result { @@ -75,7 +224,7 @@ impl TryFrom for JobReport { data: data.data, metadata: data.metadata.and_then(|m| { serde_json::from_slice(&m).unwrap_or_else(|e| -> Option { - error!("Failed to deserialize job metadata: {}", e); + error!(?e, "Failed to deserialize job metadata;"); None }) }), @@ -105,7 +254,7 @@ impl TryFrom for JobReport { // I despise having to write this twice, but it seems to be the only way to // remove the data field from the struct // would love to get this DRY'd up -impl TryFrom for JobReport { +impl TryFrom for OldJobReport { type Error = MissingFieldError; fn try_from(data: job_without_data::Data) -> Result { @@ -116,7 +265,7 @@ impl TryFrom for JobReport { data: None, metadata: data.metadata.and_then(|m| { serde_json::from_slice(&m).unwrap_or_else(|e| -> Option { - error!("Failed to deserialize job metadata: {}", e); + error!(?e, "Failed to deserialize job metadata;"); None }) }), @@ -144,7 +293,7 @@ impl TryFrom for JobReport { } } -impl JobReport { +impl OldJobReport { pub fn new(uuid: Uuid, name: String) -> Self { Self { id: uuid, @@ -286,6 +435,21 @@ impl TryFrom for JobStatus { } } +// TODO(fogodev): this is temporary until we can get rid of the old job system +impl From for sd_core_heavy_lifting::job_system::report::Status { + fn from(value: JobStatus) -> Self { + match value { + JobStatus::Queued => Self::Queued, + JobStatus::Running => Self::Running, + JobStatus::Completed => Self::Completed, + JobStatus::Canceled => Self::Canceled, + JobStatus::Failed => Self::Failed, + JobStatus::Paused => Self::Paused, + JobStatus::CompletedWithErrors => Self::CompletedWithErrors, + } + } +} + pub struct JobReportBuilder { pub id: Uuid, pub name: String, @@ -295,8 +459,8 @@ pub struct JobReportBuilder { } impl JobReportBuilder { - pub fn build(self) -> JobReport { - JobReport { + pub fn build(self) -> OldJobReport { + OldJobReport { id: self.id, name: self.name, action: self.action, @@ -325,19 +489,4 @@ impl JobReportBuilder { parent_id: None, } } - - pub fn with_action(mut self, action: impl AsRef) -> Self { - self.action = Some(action.as_ref().to_string()); - self - } - - pub fn with_metadata(mut self, metadata: serde_json::Value) -> Self { - self.metadata = Some(metadata); - self - } - - pub fn with_parent_id(mut self, parent_id: Uuid) -> Self { - self.parent_id = Some(parent_id); - self - } } diff --git a/core/src/old_job/worker.rs b/core/src/old_job/worker.rs index a3f7def87..69815fca1 100644 --- a/core/src/old_job/worker.rs +++ b/core/src/old_job/worker.rs @@ -24,12 +24,12 @@ use tokio::{ time::{interval, timeout, Instant, MissedTickBehavior}, }; use tokio_stream::wrappers::IntervalStream; -use tracing::{debug, error, info, trace, warn}; +use tracing::{debug, error, info, instrument, trace, warn}; use uuid::Uuid; use super::{ - DynJob, JobError, JobIdentity, JobReport, JobReportUpdate, JobRunErrors, JobRunOutput, - JobStatus, OldJobs, + DynJob, JobError, JobIdentity, JobReportUpdate, JobRunErrors, JobRunOutput, JobStatus, + OldJobReport, OldJobs, }; const FIVE_SECS: Duration = Duration::from_secs(5); @@ -114,8 +114,8 @@ impl WorkerContext { pub struct Worker { pub(super) library_id: Uuid, commands_tx: chan::Sender, - report_watch_tx: Arc>, - report_watch_rx: watch::Receiver, + report_watch_tx: Arc>, + report_watch_rx: watch::Receiver, paused: AtomicBool, } @@ -123,7 +123,7 @@ impl Worker { pub async fn new( id: Uuid, mut job: Box, - mut report: JobReport, + mut report: OldJobReport, library: Arc, node: Arc, job_manager: Arc, @@ -255,7 +255,7 @@ impl Worker { } } - pub fn report(&self) -> JobReport { + pub fn report(&self) -> OldJobReport { self.report_watch_rx.borrow().clone() } @@ -263,10 +263,11 @@ impl Worker { self.paused.load(Ordering::Relaxed) } + #[instrument(skip_all, fields(job_id = %report.id, job_name = %report.name))] fn track_progress( - report: &mut JobReport, + report: &mut OldJobReport, last_report_watch_update: &mut Instant, - report_watch_tx: &watch::Sender, + report_watch_tx: &watch::Sender, start_time: DateTime, updates: Vec, library: &Library, @@ -286,14 +287,14 @@ impl Worker { } JobReportUpdate::Message(message) => { - trace!("job {} message: {}", report.id, message); + trace!(?message); report.message = message; } JobReportUpdate::Phase(phase) => { trace!( - "changing Job phase: {} -> {phase}", - report.id, - report.phase + old_phase = %report.phase, + new_phase = %phase, + "Changing Job phase;", ); report.phase = phase; } @@ -307,7 +308,9 @@ impl Worker { let task_count = report.task_count as usize; let completed_task_count = report.completed_task_count as usize; let remaining_task_count = task_count.saturating_sub(completed_task_count); - let remaining_time_per_task = elapsed / (completed_task_count + 1) as i32; // Adding 1 to avoid division by zero + + // To avoid division by zero + let remaining_time_per_task = elapsed / (usize::max(completed_task_count, 1) as i32); let remaining_time = remaining_time_per_task * remaining_task_count as i32; // Update the report with estimated remaining time @@ -321,7 +324,7 @@ impl Worker { old.task_count = report.task_count; old.completed_task_count = report.completed_task_count; old.estimated_completion = report.estimated_completion; - old.message = report.message.clone(); + old.message.clone_from(&report.message); }); *last_report_watch_update = Instant::now(); } @@ -338,6 +341,16 @@ impl Worker { })); } + #[instrument( + skip_all, + fields( + job_id = %report.id, + job_name = %report.name, + worker_id = %worker_id, + %start_time, + library_id = %library.id, + ), + )] async fn do_work( worker_id: Uuid, JobWorkTable { @@ -346,7 +359,7 @@ impl Worker { hash, mut report, }: JobWorkTable, - report_watch_tx: Arc>, + report_watch_tx: Arc>, start_time: DateTime, (commands_tx, commands_rx): (chan::Sender, chan::Receiver), library: Arc, @@ -404,7 +417,7 @@ impl Worker { while let Some(msg) = msg_stream.next().await { match msg { StreamMessage::JobResult(Err(join_error)) => { - error!("Worker had a critical error: {join_error:#?}"); + error!(?join_error, "Critical error;"); break; } StreamMessage::JobResult(Ok((job, job_result))) => { @@ -430,10 +443,7 @@ impl Worker { report_watch_tx.send(report.clone()).ok(); - debug!( - "Worker completed Job", - report.id, report.name - ); + debug!("Worker completed Job"); return manager.complete(&library, worker_id, hash, next_job).await; } @@ -460,8 +470,9 @@ impl Worker { let elapsed = last_update_received_at.elapsed(); if elapsed > FIVE_MINUTES { error!( - "Worker has not received any updates for {elapsed:?}" - ); + time_without_updates = ?elapsed, + "Worker has not received any updates;", + ); let (tx, rx) = oneshot::channel(); if commands_tx @@ -469,15 +480,16 @@ impl Worker { .await .is_err() { - error!("Worker failed to send timeout step command to a running job"); + error!("Failed to send timeout step command to a running job"); } else if timeout(FIVE_SECS, rx).await.is_err() { - error!("Worker failed to receive timeout step answer from a running job"); + error!("Failed to receive timeout step answer from a running job"); } // As we already sent a timeout command, we can safely join as the job is over - let Ok((job, job_result)) = run_task.await.map_err(|join_error| { - error!("Worker had a critical error: {join_error:#?}") - }) else { + let Ok((job, job_result)) = run_task + .await + .map_err(|join_error| error!(?join_error, "Had a critical error;")) + else { break; }; @@ -485,10 +497,7 @@ impl Worker { report_watch_tx.send(report.clone()).ok(); - error!( - "Worker timed out Job", - report.id, report.name - ); + error!("Timed out"); break; } @@ -503,7 +512,7 @@ impl Worker { async fn process_job_output( mut job: Box, job_result: Result, - report: &mut JobReport, + report: &mut OldJobReport, library: &Library, ) -> Option> { // Run the job and handle the result @@ -527,10 +536,10 @@ impl Worker { }; report.completed_at = Some(Utc::now()); if let Err(e) = report.update(library).await { - error!("failed to update job report: {:#?}", e); + error!(?e, "Failed to update job report;"); } - debug!("{report}"); + debug!(?report); invalidate_queries(library); @@ -542,10 +551,7 @@ impl Worker { errors: JobRunErrors(errors), next_job, }) => { - warn!( - "Job completed with errors", - report.id, report.name - ); + warn!("Completed with errors"); report.status = JobStatus::CompletedWithErrors; report.errors_text = errors; report.data = None; @@ -560,10 +566,10 @@ impl Worker { }; report.completed_at = Some(Utc::now()); if let Err(e) = report.update(library).await { - error!("failed to update job report: {:#?}", e); + error!(?e, "Failed to update job report;"); } - debug!("{report}"); + debug!(?report); invalidate_queries(library); @@ -571,12 +577,9 @@ impl Worker { } // -> Job paused Err(JobError::Paused(state, signal_tx)) => { - info!( - "Job paused, we will pause all children jobs", - report.id, report.name - ); + info!("Job paused, we will pause all children jobs"); if let Err(e) = job.pause_children(library).await { - error!("Failed to pause children jobs: {e:#?}"); + error!(?e, "Failed to pause children jobs;"); } debug!("Setting worker status to paused"); @@ -585,23 +588,20 @@ impl Worker { report.data = Some(state); if let Err(e) = report.update(library).await { - error!("failed to update job report: {:#?}", e); + error!(?e, "Failed to update job report;"); } - debug!("{report}"); + debug!(?report); invalidate_queries(library); signal_tx.send(()).ok(); } - // -> Job paused + // -> Job canceled Err(JobError::Canceled(signal_tx)) => { - info!( - "Job canceled, we will cancel all children jobs", - report.id, report.name - ); + info!("Job canceled, we will cancel all children jobs"); if let Err(e) = job.cancel_children(library).await { - error!("Failed to pause children jobs: {e:#?}"); + error!(?e, "Failed to pause children jobs;"); } debug!("Setting worker status to paused"); @@ -610,10 +610,10 @@ impl Worker { report.data = None; if let Err(e) = report.update(library).await { - error!("failed to update job report: {:#?}", e); + error!(?e, "Failed to update job report;"); } - debug!("{report}"); + debug!(?report); invalidate_queries(library); @@ -621,21 +621,18 @@ impl Worker { } // -> Job failed Err(e) => { - error!( - "Job failed with error: {e:#?};", - report.id, report.name - ); + error!(?e, "Job failed with error;"); if let Err(e) = job.cancel_children(library).await { - error!("Failed to cancel children jobs: {e:#?}"); + error!(?e, "Failed to cancel children jobs;"); } report.status = JobStatus::Failed; report.data = None; if let Err(e) = report.update(library).await { - error!("failed to update job report: {:#?}", e); + error!(?e, "Failed to update job report;"); } - warn!("{report}"); + warn!(?report); invalidate_queries(library); } @@ -649,7 +646,7 @@ struct JobWorkTable { job: Box, manager: Arc, hash: u64, - report: JobReport, + report: OldJobReport, } fn invalidate_queries(library: &Library) { diff --git a/core/src/p2p/events.rs b/core/src/p2p/events.rs index 179a3fdab..7523e64cb 100644 --- a/core/src/p2p/events.rs +++ b/core/src/p2p/events.rs @@ -1,6 +1,8 @@ -use std::sync::Arc; +use std::{collections::HashSet, net::SocketAddr, sync::Arc}; -use sd_p2p::{flume::bounded, HookEvent, HookId, PeerConnectionCandidate, RemoteIdentity, P2P}; +use sd_p2p::{ + flume::bounded, hooks::QuicHandle, HookEvent, PeerConnectionCandidate, RemoteIdentity, P2P, +}; use serde::Serialize; use specta::Type; use tokio::sync::broadcast; @@ -28,6 +30,8 @@ pub enum DiscoveryMethod { Relay, // Found via mDNS or a manual IP Local, + // Found via manual entry on either node + Manual, } // This is used for synchronizing events between the backend and the frontend. @@ -40,6 +44,7 @@ pub enum P2PEvent { connection: ConnectionMethod, discovery: DiscoveryMethod, metadata: PeerMetadata, + addrs: HashSet, }, // Delete a peer PeerDelete { @@ -69,7 +74,7 @@ pub struct P2PEvents { } impl P2PEvents { - pub fn spawn(p2p: Arc, libraries_hook_id: HookId) -> Self { + pub fn spawn(p2p: Arc, quic: Arc) -> Self { let events = broadcast::channel(15); let (tx, rx) = bounded(15); let _ = p2p.register_hook("sd-frontend-events", tx); @@ -77,62 +82,66 @@ impl P2PEvents { let events_tx = events.0.clone(); tokio::spawn(async move { while let Ok(event) = rx.recv_async().await { - let event = match event { - // We use `HookEvent::PeerUnavailable`/`HookEvent::PeerAvailable` over `HookEvent::PeerExpiredBy`/`HookEvent::PeerDiscoveredBy` so that having an active connection is treated as "discovered". - // It's possible to have an active connection without mDNS data (which is what Peer*By` are for) - HookEvent::PeerConnectedWith(_, peer) - | HookEvent::PeerAvailable(peer) - // This will fire for updates to the mDNS metadata which are important for UX. - | HookEvent::PeerDiscoveredBy(_, peer) => { - let metadata = match PeerMetadata::from_hashmap(&peer.metadata()) { - Ok(metadata) => metadata, - Err(e) => { - println!( - "Invalid metadata for peer '{}': {:?}", - peer.identity(), - e - ); + let peer = match event { + HookEvent::PeerDisconnectedWith(_, identity) + | HookEvent::PeerExpiredBy(_, identity) => { + let peers = p2p.peers(); + let Some(peer) = peers.get(&identity) else { + let _ = events_tx.send(P2PEvent::PeerDelete { identity }); continue; - } - }; + }; - P2PEvent::PeerChange { - identity: peer.identity(), - connection: if peer.is_connected_with_hook(libraries_hook_id) { - ConnectionMethod::Relay - } else if peer.is_connected() { - ConnectionMethod::Local - } else { - ConnectionMethod::Disconnected - }, - discovery: match peer - .connection_candidates() - .contains(&PeerConnectionCandidate::Relay) - { - true => DiscoveryMethod::Relay, - false => DiscoveryMethod::Local, - }, - metadata, - } - } - HookEvent::PeerUnavailable(identity) => P2PEvent::PeerDelete { identity }, - HookEvent::PeerDisconnectedWith(_, identity) => { - let peers = p2p.peers(); - let Some(peer) = peers.get(&identity) else { + peer.clone() + }, + // We use `HookEvent::PeerUnavailable`/`HookEvent::PeerAvailable` over `HookEvent::PeerExpiredBy`/`HookEvent::PeerDiscoveredBy` so that having an active connection is treated as "discovered". + // It's possible to have an active connection without mDNS data (which is what Peer*By` are for) + HookEvent::PeerConnectedWith(_, peer) + | HookEvent::PeerAvailable(peer) + // This will fire for updates to the mDNS metadata which are important for UX. + | HookEvent::PeerDiscoveredBy(_, peer) => peer, + HookEvent::PeerUnavailable(identity) => { + let _ = events_tx.send(P2PEvent::PeerDelete { identity }); continue; - }; + }, + HookEvent::Shutdown { _guard } => break, + _ => continue, + }; - if !peer.is_connected() { - P2PEvent::PeerDelete { identity } - } else { - continue; - } - } - HookEvent::Shutdown { _guard } => break, - _ => continue, + let Ok(metadata) = PeerMetadata::from_hashmap(&peer.metadata()).map_err(|err| { + println!("Invalid metadata for peer '{}': {err:?}", peer.identity()) + }) else { + continue; }; - let _ = events_tx.send(event); + let _ = events_tx.send(P2PEvent::PeerChange { + identity: peer.identity(), + connection: if peer.is_connected() { + if quic.is_relayed(peer.identity()) { + ConnectionMethod::Relay + } else { + ConnectionMethod::Local + } + } else { + ConnectionMethod::Disconnected + }, + discovery: if peer + .connection_candidates() + .iter() + .any(|c| matches!(c, PeerConnectionCandidate::Manual(_))) + { + DiscoveryMethod::Manual + } else if peer + .connection_candidates() + .iter() + .all(|c| *c == PeerConnectionCandidate::Relay) + { + DiscoveryMethod::Relay + } else { + DiscoveryMethod::Local + }, + metadata, + addrs: peer.addrs(), + }); } }); diff --git a/core/src/p2p/libraries.rs b/core/src/p2p/libraries.rs index 065b935d5..aa83cfcc1 100644 --- a/core/src/p2p/libraries.rs +++ b/core/src/p2p/libraries.rs @@ -1,6 +1,9 @@ -use std::{collections::HashMap, sync::Arc}; +use std::{ + collections::HashMap, + sync::{Arc, Mutex, PoisonError}, +}; -use sd_p2p::{flume::bounded, HookEvent, HookId, PeerConnectionCandidate, RemoteIdentity, P2P}; +use sd_p2p::{hooks::QuicHandle, RemoteIdentity, P2P}; use tracing::error; use crate::library::{Libraries, LibraryManagerEvent}; @@ -10,91 +13,127 @@ use crate::library::{Libraries, LibraryManagerEvent}; /// This hooks is responsible for: /// - injecting library peers into the P2P system so we can connect to them over internet. /// -pub fn libraries_hook(p2p: Arc, libraries: Arc) -> HookId { - let (tx, rx) = bounded(15); - let hook_id = p2p.register_hook("sd-libraries-hook", tx); +pub fn libraries_hook(p2p: Arc, quic: Arc, libraries: Arc) { + let nodes_to_instance = Arc::new(Mutex::new(HashMap::new())); - let handle = tokio::spawn(async move { - if let Err(err) = libraries - .rx - .clone() - .subscribe(|msg| { - let p2p = p2p.clone(); - async move { - match msg { - LibraryManagerEvent::InstancesModified(library) - | LibraryManagerEvent::Load(library) => { - p2p.metadata_mut().insert( - library.id.to_string(), - library.identity.to_remote_identity().to_string(), - ); + let handle = tokio::spawn({ + let quic = quic.clone(); - let Ok(instances) = - library.db.instance().find_many(vec![]).exec().await - else { - return; - }; + async move { + if let Err(e) = libraries + .rx + .clone() + .subscribe(|msg| { + let p2p = p2p.clone(); + let nodes_to_instance = nodes_to_instance.clone(); + let quic = quic.clone(); - for i in instances.iter() { - let identity = RemoteIdentity::from_bytes(&i.remote_identity) - .expect("lol: invalid DB entry"); - - // Skip self - if identity == library.identity.to_remote_identity() { - continue; - } - - p2p.clone().discover_peer( - hook_id, - identity, - HashMap::new(), // TODO: We should probs cache this so we have something - [PeerConnectionCandidate::Relay].into_iter().collect(), + async move { + match msg { + LibraryManagerEvent::InstancesModified(library) + | LibraryManagerEvent::Load(library) => { + p2p.metadata_mut().insert( + library.id.to_string(), + library.identity.to_remote_identity().to_string(), ); - } - } - LibraryManagerEvent::Edit(_library) => { - // TODO: Send changes to all connected nodes or queue sending for when they are online! - } - LibraryManagerEvent::Delete(library) => { - p2p.metadata_mut().remove(&library.id.to_string()); - let Ok(instances) = - library.db.instance().find_many(vec![]).exec().await - else { - return; - }; - - for i in instances.iter() { - let identity = RemoteIdentity::from_bytes(&i.remote_identity) - .expect("lol: invalid DB entry"); - - let peers = p2p.peers(); - let Some(peer) = peers.get(&identity) else { - continue; + let Ok(instances) = + library.db.instance().find_many(vec![]).exec().await + else { + return; }; - peer.undiscover_peer(hook_id); + + let mut nodes_to_instance = nodes_to_instance + .lock() + .unwrap_or_else(PoisonError::into_inner); + + for i in instances.iter() { + let identity = RemoteIdentity::from_bytes(&i.remote_identity) + .expect("invalid instance identity"); + let node_identity = RemoteIdentity::from_bytes( + i.node_remote_identity + .as_ref() + .expect("node remote identity is required"), + ) + .expect("invalid node remote identity"); + + // Skip self + if i.identity.is_some() { + continue; + } + + nodes_to_instance + .entry(identity) + .or_insert(vec![]) + .push(node_identity); + + quic.track_peer( + node_identity, + serde_json::from_slice( + i.metadata.as_ref().expect("this is a required field"), + ) + .expect("invalid metadata"), + ); + } + } + LibraryManagerEvent::Edit(_library) => { + // TODO: Send changes to all connected nodes or queue sending for when they are online! + } + LibraryManagerEvent::Delete(library) => { + p2p.metadata_mut().remove(&library.id.to_string()); + + let Ok(instances) = + library.db.instance().find_many(vec![]).exec().await + else { + return; + }; + + let mut nodes_to_instance = nodes_to_instance + .lock() + .unwrap_or_else(PoisonError::into_inner); + + for i in instances.iter() { + let identity = RemoteIdentity::from_bytes(&i.remote_identity) + .expect("invalid remote identity"); + let node_identity = RemoteIdentity::from_bytes( + i.node_remote_identity + .as_ref() + .expect("node remote identity is required"), + ) + .expect("invalid node remote identity"); + + // Skip self + if i.identity.is_some() { + continue; + } + + // Only remove if all instances pointing to this node are removed + let Some(identities) = nodes_to_instance.get_mut(&identity) + else { + continue; + }; + if let Some(i) = + identities.iter().position(|i| i == &node_identity) + { + identities.remove(i); + } + if identities.is_empty() { + quic.untrack_peer(node_identity); + } + } } } } - } - }) - .await - { - error!("Core may become unstable! `LibraryServices::start` manager aborted with error: {err:?}"); - } - }); - - tokio::spawn(async move { - while let Ok(event) = rx.recv_async().await { - match event { - HookEvent::Shutdown { _guard } => { - handle.abort(); - break; - } - _ => continue, + }) + .await + { + error!(?e, "Core may become unstable! `LibraryServices::start` manager aborted with error;"); } } }); - hook_id + tokio::spawn(async move { + quic.shutdown().await; + handle.abort(); + }); } diff --git a/core/src/p2p/manager.rs b/core/src/p2p/manager.rs index 36f2c0163..7dfcb95ea 100644 --- a/core/src/p2p/manager.rs +++ b/core/src/p2p/manager.rs @@ -1,6 +1,6 @@ use crate::{ node::{ - config::{self, P2PDiscoveryState, Port}, + config::{self, P2PDiscoveryState}, get_hardware_model_name, HardwareModel, }, p2p::{ @@ -14,40 +14,60 @@ use axum::routing::IntoMakeService; use sd_p2p::{ flume::{bounded, Receiver}, - HookId, Libp2pPeerId, Listener, Mdns, Peer, QuicTransport, RelayServerEntry, RemoteIdentity, - UnicastStream, P2P, + hooks::{Libp2pPeerId, Mdns, QuicHandle, QuicTransport, RelayServerEntry}, + Peer, RemoteIdentity, UnicastStream, P2P, }; use sd_p2p_tunnel::Tunnel; use serde::Serialize; use serde_json::json; use specta::Type; use std::{ - collections::{HashMap, HashSet}, + collections::HashMap, convert::Infallible, - net::SocketAddr, sync::{atomic::AtomicBool, Arc, Mutex, PoisonError}, time::Duration, }; use tower_service::Service; use tracing::error; -use tokio::sync::oneshot; +use tokio::sync::{oneshot, Notify}; use tracing::info; use uuid::Uuid; use super::{P2PEvents, PeerMetadata}; +#[derive(Default, Clone, Serialize, Type)] +#[serde(tag = "type")] +pub enum ListenerState { + Listening, + Error { + error: String, + }, + #[default] + NotListening, +} + +#[derive(Default, Clone, Serialize, Type)] +pub struct Listeners { + ipv4: ListenerState, + ipv6: ListenerState, + relay: ListenerState, +} + pub struct P2PManager { pub(crate) p2p: Arc, mdns: Mutex>, - quic: QuicTransport, + quic_transport: QuicTransport, + pub quic: Arc, // The `libp2p::PeerId`. This is for debugging only, use `RemoteIdentity` instead. lp2p_peer_id: Libp2pPeerId, pub(crate) events: P2PEvents, pub(super) spacedrop_pairing_reqs: Arc>>>>, pub(super) spacedrop_cancellations: Arc>>>, pub(crate) node_config: Arc, - pub libraries_hook_id: HookId, + pub listeners: Mutex, + relay_config: Mutex>, + trigger_relay_config_update: Notify, } impl P2PManager { @@ -63,26 +83,29 @@ impl P2PManager { > { let (tx, rx) = bounded(25); let p2p = P2P::new(SPACEDRIVE_APP_ID, node_config.get().await.identity, tx); - let (quic, lp2p_peer_id) = QuicTransport::spawn(p2p.clone())?; - let libraries_hook_id = libraries_hook(p2p.clone(), libraries); + let (quic, lp2p_peer_id) = QuicTransport::spawn(p2p.clone()).map_err(|e| e.to_string())?; + libraries_hook(p2p.clone(), quic.handle(), libraries); let this = Arc::new(Self { p2p: p2p.clone(), lp2p_peer_id, mdns: Mutex::new(None), - quic, - events: P2PEvents::spawn(p2p.clone(), libraries_hook_id), + events: P2PEvents::spawn(p2p.clone(), quic.handle()), + quic: quic.handle(), + quic_transport: quic, spacedrop_pairing_reqs: Default::default(), spacedrop_cancellations: Default::default(), node_config, - libraries_hook_id, + listeners: Default::default(), + relay_config: Default::default(), + trigger_relay_config_update: Default::default(), }); this.on_node_config_change().await; info!( - "Node RemoteIdentity('{}') libp2p::PeerId('{:?}') is now online listening at addresses: {:?}", - this.p2p.remote_identity(), - this.lp2p_peer_id, - this.p2p.listeners() + remote_identity = %this.p2p.remote_identity(), + peer_id = ?this.lp2p_peer_id, + addresses = ?this.p2p.listeners(), + "Node is now online listening;", ); Ok((this.clone(), |node: Arc, router| { @@ -107,19 +130,60 @@ impl P2PManager { } else { match resp.json::>().await { Ok(config) => { - this.quic.set_relay_config(config).await; - info!("Updated p2p relay configuration successfully.") + node.p2p + .relay_config + .lock() + .unwrap_or_else(PoisonError::into_inner) + .clone_from(&config); + + let config = { + let node_config = node.config.get().await; + if !node_config.p2p.disabled + && !node_config.p2p.disable_relay + { + config + } else { + vec![] + } + }; + let no_relays = config.len(); + + this.listeners + .lock() + .unwrap_or_else(PoisonError::into_inner) + .relay = match this.quic_transport.set_relay_config(config).await { + Ok(_) => { + info!( + "Updated p2p relay configuration successfully." + ); + if no_relays == 0 { + this.quic.disable(); + + ListenerState::NotListening + } else { + this.quic.enable(); + + ListenerState::Listening + } + } + Err(err) => ListenerState::Error { + error: err.to_string(), + }, + }; } - Err(err) => { - error!("Failed to parse p2p relay configuration: {err:?}") + Err(e) => { + error!(?e, "Failed to parse p2p relay configuration;") } } } } - Err(err) => error!("Error pulling p2p relay configuration: {err:?}"), + Err(e) => error!(?e, "Error pulling p2p relay configuration;"), } - tokio::time::sleep(Duration::from_secs(11 * 60)).await; + tokio::select! { + _ = this.trigger_relay_config_update.notified() => {} + _ = tokio::time::sleep(Duration::from_secs(11 * 60)) => {} + } } }); })) @@ -131,66 +195,76 @@ impl P2PManager { // TODO: Remove this and add a subscription system to `config::Manager` pub async fn on_node_config_change(&self) { + self.trigger_relay_config_update.notify_waiters(); + let config = self.node_config.get().await; - PeerMetadata { - name: config.name.clone(), - operating_system: Some(OperatingSystem::get_os()), - device_model: Some(get_hardware_model_name().unwrap_or(HardwareModel::Other)), - version: Some(env!("CARGO_PKG_VERSION").to_string()), - } - .update(&mut self.p2p.metadata_mut()); + if config.p2p.discovery == P2PDiscoveryState::ContactsOnly { + PeerMetadata::remove(&mut self.p2p.metadata_mut()); - let port = match config.p2p_ipv4_port { - Port::Disabled => None, - Port::Random => Some(0), - Port::Discrete(port) => Some(port), - }; - info!("Setting quic ipv4 listener to: {port:?}"); - if let Err(err) = self.quic.set_ipv4_enabled(port).await { - error!("Failed to enabled quic ipv4 listener: {err}"); - self.node_config - .write(|c| c.p2p_ipv4_port = Port::Disabled) - .await - .ok(); - } - - let port = match config.p2p_ipv6_port { - Port::Disabled => None, - Port::Random => Some(0), - Port::Discrete(port) => Some(port), - }; - info!("Setting quic ipv4 listener to: {port:?}"); - if let Err(err) = self.quic.set_ipv6_enabled(port).await { - error!("Failed to enabled quic ipv6 listener: {err}"); - self.node_config - .write(|c| c.p2p_ipv6_port = Port::Disabled) - .await - .ok(); - } - - let should_revert = match config.p2p_discovery { - P2PDiscoveryState::Everyone - // TODO: Make `ContactsOnly` work - | P2PDiscoveryState::ContactsOnly => { - let mut mdns = self.mdns.lock().unwrap_or_else(PoisonError::into_inner); - if mdns.is_none() { - match Mdns::spawn(self.p2p.clone()) { - Ok(m) => { - info!("mDNS started successfully."); - *mdns = Some(m); - false - } - Err(err) => { - error!("Failed to start mDNS: {err}"); - true - } - } - } else { - false - } + // TODO: Hash Spacedrive account ID and put it in the metadata. + } else { + PeerMetadata { + name: config.name.clone(), + operating_system: Some(OperatingSystem::get_os()), + device_model: Some(get_hardware_model_name().unwrap_or(HardwareModel::Other)), + version: Some(env!("CARGO_PKG_VERSION").to_string()), } - P2PDiscoveryState::Disabled => { + .update(&mut self.p2p.metadata_mut()); + } + + let port = config.p2p.port.get(); + + let ipv4_port = (!config.p2p.disabled).then_some(port); + info!(?ipv4_port, "Setting quic ipv4 listener;"); + self.listeners + .lock() + .unwrap_or_else(PoisonError::into_inner) + .ipv4 = if let Err(e) = self.quic_transport.set_ipv4_enabled(ipv4_port).await { + error!(?e, "Failed to enabled quic ipv4 listener;"); + self.node_config + .write(|c| c.p2p.disabled = false) + .await + .ok(); + + ListenerState::Error { + error: e.to_string(), + } + } else { + match !config.p2p.disabled { + true => ListenerState::Listening, + false => ListenerState::NotListening, + } + }; + + let enable_ipv6 = !config.p2p.disabled && !config.p2p.disable_ipv6; + let ipv6_port = enable_ipv6.then_some(port); + info!(?ipv6_port, "Setting quic ipv6 listener;"); + self.listeners + .lock() + .unwrap_or_else(PoisonError::into_inner) + .ipv6 = if let Err(e) = self.quic_transport.set_ipv6_enabled(ipv6_port).await { + error!(?e, "Failed to enabled quic ipv6 listener;"); + self.node_config + .write(|c| c.p2p.disable_ipv6 = false) + .await + .ok(); + + ListenerState::Error { + error: e.to_string(), + } + } else { + match enable_ipv6 { + true => ListenerState::Listening, + false => ListenerState::NotListening, + } + }; + + self.quic_transport + .set_manual_peer_addrs(config.p2p.manual_peers); + + let should_revert = match (config.p2p.disabled, config.p2p.discovery) { + (true, _) | (_, P2PDiscoveryState::Disabled) => { let mdns = { let mut mdns = self.mdns.lock().unwrap_or_else(PoisonError::into_inner); mdns.take() @@ -201,7 +275,25 @@ impl P2PManager { } false - }, + } + (_, P2PDiscoveryState::Everyone | P2PDiscoveryState::ContactsOnly) => { + let mut mdns = self.mdns.lock().unwrap_or_else(PoisonError::into_inner); + if mdns.is_none() { + match Mdns::spawn(self.p2p.clone()) { + Ok(m) => { + info!("mDNS started successfully."); + *mdns = Some(m); + false + } + Err(e) => { + error!(?e, "Failed to start mDNS;"); + true + } + } + } else { + false + } + } }; // The `should_revert` bit is weird but we need this future to stay `Send` as rspc requires. @@ -210,7 +302,7 @@ impl P2PManager { if should_revert { let _ = self .node_config - .write(|c| c.p2p_discovery = P2PDiscoveryState::Disabled) + .write(|c| c.p2p.discovery = P2PDiscoveryState::Disabled) .await; } } @@ -249,18 +341,16 @@ impl P2PManager { "active_connections": p.active_connections(), "connection_methods": p.connection_methods().iter().map(|id| format!("{:?}", id)).collect::>(), "discovered_by": p.discovered_by().iter().map(|id| format!("{:?}", id)).collect::>(), + "candidates": p.connection_candidates().iter().map(|a| format!("{a:?}")).collect::>(), })).collect::>(), "hooks": self.p2p.hooks().iter().map(|(id, name)| json!({ "id": format!("{:?}", id), "name": name, "listener_addrs": listeners.iter().find(|l| l.is_hook_id(*id)).map(|l| l.addrs.clone()), })).collect::>(), - "config": json!({ - "p2p_ipv4_port": node_config.p2p_ipv4_port, - "p2p_ipv6_port": node_config.p2p_ipv6_port, - "p2p_discovery": node_config.p2p_discovery, - }), - "relay_config": self.quic.get_relay_config(), + "config": node_config.p2p, + "relay_config": self.quic_transport.get_relay_config(), + "listeners": self.listeners.lock().unwrap_or_else(PoisonError::into_inner).clone(), }) } @@ -282,10 +372,8 @@ async fn start( let mut service = unwrap_infallible(service.call(()).await); tokio::spawn(async move { - println!("APPLICATION GOT STREAM: {:?}", stream); // TODO - - let Ok(header) = Header::from_stream(&mut stream).await.map_err(|err| { - error!("Failed to read header from stream: {}", err); + let Ok(header) = Header::from_stream(&mut stream).await.map_err(|e| { + error!(?e, "Failed to read header from stream;"); }) else { return; }; @@ -299,28 +387,28 @@ async fn start( error!("Failed to handle Spacedrop request"); } - Header::Sync(library_id) => { - let Ok(mut tunnel) = Tunnel::responder(stream).await.map_err(|err| { - error!("Failed `Tunnel::responder`: {}", err); + Header::Sync => { + let Ok(mut tunnel) = Tunnel::responder(stream).await.map_err(|e| { + error!(?e, "Failed `Tunnel::responder`;"); }) else { return; }; - let Ok(msg) = SyncMessage::from_stream(&mut tunnel).await.map_err(|err| { - error!("Failed `SyncMessage::from_stream`: {}", err); + let Ok(msg) = SyncMessage::from_stream(&mut tunnel).await.map_err(|e| { + error!(?e, "Failed `SyncMessage::from_stream`"); }) else { return; }; - let Ok(library) = - node.libraries - .get_library(&library_id) - .await - .ok_or_else(|| { - error!("Failed to get library '{library_id}'"); + let Ok(library) = node + .libraries + .get_library_for_instance(&tunnel.library_remote_identity()) + .await + .ok_or_else(|| { + error!(remove_identity = %tunnel.library_remote_identity(), "Failed to get library;"); - // TODO: Respond to remote client with warning! - }) + // TODO: Respond to remote client with warning! + }) else { return; }; @@ -335,13 +423,32 @@ async fn start( } }; } - Header::Http => { + Header::RspcRemote => { let remote = stream.remote_identity(); - let Err(err) = operations::rspc::receiver(stream, &mut service).await else { + let Err(e) = operations::rspc::receiver(stream, &mut service, &node).await + else { return; }; - error!("Failed to handling rspc request with '{remote}': {err:?}"); + error!(%remote, ?e, "Failed to handling rspc request;"); + } + Header::LibraryFile { + file_path_id, + range, + } => { + let remote = stream.remote_identity(); + let Err(e) = + operations::library::receiver(stream, file_path_id, range, &node).await + else { + return; + }; + + error!( + ?remote, + %file_path_id, + ?e, + "Failed to handling library file request;", + ); } }; }); @@ -350,23 +457,6 @@ async fn start( Ok::<_, ()>(()) } -#[derive(Debug, Serialize, Type)] -pub struct Listener2 { - pub id: String, - pub name: &'static str, - pub addrs: HashSet, -} - -pub fn into_listener2(l: &[Listener]) -> Vec { - l.iter() - .map(|l| Listener2 { - id: format!("{:?}", l.id), - name: l.name, - addrs: l.addrs.clone(), - }) - .collect() -} - fn unwrap_infallible(result: Result) -> T { match result { Ok(value) => value, diff --git a/core/src/p2p/metadata.rs b/core/src/p2p/metadata.rs index a54694158..5e03e9c7d 100644 --- a/core/src/p2p/metadata.rs +++ b/core/src/p2p/metadata.rs @@ -14,6 +14,13 @@ pub struct PeerMetadata { } impl PeerMetadata { + pub fn remove(map: &mut HashMap) { + map.remove("name"); + map.remove("os"); + map.remove("device_model"); + map.remove("version"); + } + pub fn update(self, map: &mut HashMap) { map.insert("name".to_owned(), self.name.clone()); if let Some(os) = self.operating_system { diff --git a/core/src/p2p/operations/library.rs b/core/src/p2p/operations/library.rs new file mode 100644 index 000000000..d68456cd6 --- /dev/null +++ b/core/src/p2p/operations/library.rs @@ -0,0 +1,134 @@ +use std::{ + error::Error, + path::Path, + sync::{atomic::AtomicBool, Arc}, +}; + +use sd_core_file_path_helper::IsolatedFilePathData; +use sd_core_prisma_helpers::file_path_to_handle_p2p_serve_file; +use sd_p2p::{Identity, RemoteIdentity, UnicastStream, P2P}; +use sd_p2p_block::{BlockSize, Range, SpaceblockRequest, SpaceblockRequests, Transfer}; +use sd_prisma::prisma::file_path; +use tokio::{ + fs::File, + io::{AsyncReadExt, AsyncWrite, AsyncWriteExt, BufReader}, +}; +use tracing::debug; +use uuid::Uuid; + +use crate::{p2p::Header, Node}; + +/// Request a file from a remote library +#[allow(unused)] +pub async fn request_file( + p2p: Arc, + identity: RemoteIdentity, + library_identity: &Identity, + file_path_id: Uuid, + range: Range, + output: impl AsyncWrite + Unpin, +) -> Result<(), Box> { + let peer = p2p.peers().get(&identity).ok_or("Peer offline")?.clone(); + let mut stream = peer.new_stream().await?; + + stream + .write_all( + &Header::LibraryFile { + file_path_id, + range: range.clone(), + } + .to_bytes(), + ) + .await?; + + let mut stream = sd_p2p_tunnel::Tunnel::initiator(stream, library_identity).await?; + + let block_size = BlockSize::from_stream(&mut stream).await?; + let size = stream.read_u64_le().await?; + + Transfer::new( + &SpaceblockRequests { + id: Uuid::new_v4(), + block_size, + requests: vec![SpaceblockRequest { + name: "_".to_string(), + size, + range, + }], + }, + |percent| debug!("P2P receiving file path {file_path_id:?} - progress {percent}%"), + &Arc::new(AtomicBool::new(false)), + ) + .receive(&mut stream, output) + .await; + + Ok(()) +} + +pub(crate) async fn receiver( + stream: UnicastStream, + file_path_id: Uuid, + range: Range, + node: &Arc, +) -> Result<(), Box> { + debug!( + "Received library request from peer '{}'", + stream.remote_identity() + ); + + // The tunnel takes care of authentication and encrypts all traffic to the library to be certain we are talking to a node with the library. + let mut stream = sd_p2p_tunnel::Tunnel::responder(stream).await?; + + let library = node + .libraries + .get_library_for_instance(&stream.library_remote_identity()) + .await + .ok_or_else(|| format!("Library not found: {:?}", stream.library_remote_identity()))?; + + let file_path = library + .db + .file_path() + .find_unique(file_path::pub_id::equals(file_path_id.as_bytes().to_vec())) + .select(file_path_to_handle_p2p_serve_file::select()) + .exec() + .await? + .ok_or_else(|| format!("File path {file_path_id:?} not found in {:?}", library.id))?; + + let location = file_path.location.as_ref().expect("included in query"); + let location_path = location.path.as_ref().expect("included in query"); + let path = + Path::new(location_path).join(IsolatedFilePathData::try_from((location.id, &file_path))?); + + debug!( + "Serving path {path:?} for library {:?} over P2P", + library.id + ); + + let file = File::open(&path).await?; + + let metadata = file.metadata().await?; + let block_size = BlockSize::from_file_size(metadata.len()); + + stream.write_all(&block_size.to_bytes()).await?; + stream.write_all(&metadata.len().to_le_bytes()).await?; + + let file = BufReader::new(file); + Transfer::new( + &SpaceblockRequests { + id: Uuid::new_v4(), + block_size, + requests: vec![SpaceblockRequest { + name: "_".into(), + size: metadata.len(), + range, + }], + }, + |percent| debug!("P2P loading file path {file_path_id:?} - progress {percent}%"), + // TODO: Properly handle cancellation with webview + &Arc::new(AtomicBool::new(false)), + ) + .send(&mut stream, file) + .await?; + + Ok(()) +} diff --git a/core/src/p2p/operations/mod.rs b/core/src/p2p/operations/mod.rs index 02d01766d..32ef65e29 100644 --- a/core/src/p2p/operations/mod.rs +++ b/core/src/p2p/operations/mod.rs @@ -1,6 +1,8 @@ +pub mod library; pub mod ping; pub mod rspc; pub mod spacedrop; +pub use library::request_file; pub use rspc::remote_rspc; pub use spacedrop::spacedrop; diff --git a/core/src/p2p/operations/ping.rs b/core/src/p2p/operations/ping.rs index ba859cc3d..235e1111f 100644 --- a/core/src/p2p/operations/ping.rs +++ b/core/src/p2p/operations/ping.rs @@ -1,12 +1,37 @@ -use sd_p2p::UnicastStream; +use std::{error::Error, sync::Arc}; + +use sd_p2p::{RemoteIdentity, UnicastStream, P2P}; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tracing::debug; +use crate::p2p::Header; + /// Send a ping to all peers we are connected to #[allow(unused)] -pub async fn ping() { - todo!(); +pub async fn ping(p2p: Arc, identity: RemoteIdentity) -> Result<(), Box> { + let peer = p2p + .peers() + .get(&identity) + .ok_or("Peer not found, has it been discovered?")? + .clone(); + let mut stream = peer.new_stream().await?; + + stream.write_all(&Header::Ping.to_bytes()).await?; + + let mut result = [0; 4]; + let _ = stream.read_exact(&mut result).await?; + if result != *b"PONG" { + return Err("Failed to receive pong".into()); + } + + Ok(()) } -pub(crate) async fn receiver(stream: UnicastStream) { - debug!("Received ping from peer '{}'", stream.remote_identity()); +pub(crate) async fn receiver(mut stream: UnicastStream) { + debug!(peer = %stream.remote_identity(), "Received ping from;"); + + stream + .write_all(b"PONG") + .await + .expect("Failed to send pong"); } diff --git a/core/src/p2p/operations/rspc.rs b/core/src/p2p/operations/rspc.rs index d6823eed1..ed86c0912 100644 --- a/core/src/p2p/operations/rspc.rs +++ b/core/src/p2p/operations/rspc.rs @@ -6,10 +6,9 @@ use sd_p2p::{RemoteIdentity, UnicastStream, P2P}; use tokio::io::AsyncWriteExt; use tracing::debug; -use crate::p2p::Header; +use crate::{p2p::Header, Node}; /// Transfer an rspc query to a remote node. -#[allow(unused)] pub async fn remote_rspc( p2p: Arc, identity: RemoteIdentity, @@ -22,12 +21,12 @@ pub async fn remote_rspc( .clone(); let mut stream = peer.new_stream().await?; - stream.write_all(&Header::Http.to_bytes()).await?; + stream.write_all(&Header::RspcRemote.to_bytes()).await?; let (mut sender, conn) = hyper::client::conn::handshake(stream).await?; tokio::task::spawn(async move { - if let Err(err) = conn.await { - println!("Connection error: {:?}", err); + if let Err(e) = conn.await { + println!("Connection error: {:?}", e); } }); @@ -37,16 +36,17 @@ pub async fn remote_rspc( pub(crate) async fn receiver( stream: UnicastStream, service: &mut Router, + node: &Node, ) -> Result<(), Box> { debug!( - "Received http request from peer '{}'", - stream.remote_identity(), + peer = %stream.remote_identity(), + "Received http request from;", ); // TODO: Authentication #[allow(clippy::todo)] - if true { - todo!("You wouldn't download a car!"); + if !node.config.get().await.p2p.enable_remote_access { + todo!("No way buddy!"); } Http::new() diff --git a/core/src/p2p/operations/spacedrop.rs b/core/src/p2p/operations/spacedrop.rs index c4df1dd32..1118a6531 100644 --- a/core/src/p2p/operations/spacedrop.rs +++ b/core/src/p2p/operations/spacedrop.rs @@ -12,6 +12,7 @@ use crate::p2p::{Header, P2PEvent, P2PManager}; use futures::future::join_all; use sd_p2p::{RemoteIdentity, UnicastStream}; use sd_p2p_block::{BlockSize, Range, SpaceblockRequest, SpaceblockRequests, Transfer}; +use thiserror::Error; use tokio::{ fs::{create_dir_all, File}, io::{AsyncReadExt, AsyncWriteExt, BufReader, BufWriter}, @@ -24,14 +25,25 @@ use uuid::Uuid; /// The amount of time to wait for a Spacedrop request to be accepted or rejected before it's automatically rejected pub(crate) const SPACEDROP_TIMEOUT: Duration = Duration::from_secs(60); -// TODO: Proper error handling +#[derive(Debug, Error)] +pub enum SpacedropError { + #[error("paths argument is an empty vector")] + EmptyPath, + #[error("error connecting to peer")] + FailedPeerConnection, + #[error("error creating stream: {0}")] + FailedNewStream(#[from] sd_p2p::NewStreamError), + #[error("error opening file: {0}")] + FailedFileOpen(#[from] std::io::Error), +} + pub async fn spacedrop( p2p: Arc, identity: RemoteIdentity, paths: Vec, -) -> Result { +) -> Result { if paths.is_empty() { - return Err(()); + return Err(SpacedropError::EmptyPath); } let (files, requests): (Vec<_>, Vec<_>) = join_all(paths.into_iter().map(|path| async move { @@ -55,53 +67,50 @@ pub async fn spacedrop( .await .into_iter() .collect::, std::io::Error>>() - .map_err(|err| { - warn!("error opening file: '{err:?}'"); - // TODO: Proper error type - })? + .map_err(SpacedropError::FailedFileOpen)? .into_iter() .unzip(); let total_length: u64 = requests.iter().map(|req| req.size).sum(); let id = Uuid::new_v4(); - debug!("({id}): starting Spacedrop with peer '{identity}"); + debug!(spacedrop_id = %id, peer = %identity, "Starting Spacedrop;"); let peer = p2p .p2p .peers() .get(&identity) .ok_or_else(|| { - debug!("({id}): failed to find connection method with '{identity}'"); - // TODO: Proper error + debug!(spacedrop_id = %id, peer = %identity, "Failed to find connection method;"); + SpacedropError::FailedPeerConnection })? .clone(); - let mut stream = peer.new_stream().await.map_err(|err| { - debug!("({id}): failed to connect to '{identity}': {err:?}"); - // TODO: Proper error + let mut stream = peer.new_stream().await.map_err(|e| { + debug!(spacedrop_id = %id, peer = %identity, ?e, "Failed to connect"); + SpacedropError::FailedNewStream(e) })?; tokio::spawn(async move { - debug!("({id}): connected, sending header"); + debug!(spacedrop_id = %id, "Connected, sending header"); let header = Header::Spacedrop(SpaceblockRequests { id, - block_size: BlockSize::from_size(total_length), + block_size: BlockSize::from_file_size(total_length), requests, }); - if let Err(err) = stream.write_all(&header.to_bytes()).await { - debug!("({id}): failed to send header: {err}"); + if let Err(e) = stream.write_all(&header.to_bytes()).await { + debug!(spacedrop_id = %id, ?e, "Failed to send header"); return; } let Header::Spacedrop(requests) = header else { unreachable!(); }; - debug!("({id}): waiting for response"); + debug!(spacedrop_id = %id, "Waiting for response"); let result = tokio::select! { result = stream.read_u8() => result, // Add 5 seconds incase the user responded on the deadline and slow network _ = sleep(SPACEDROP_TIMEOUT + Duration::from_secs(5)) => { - debug!("({id}): timed out, cancelling"); + debug!(spacedrop_id = %id, "Timed out, cancelling"); p2p.events.send(P2PEvent::SpacedropTimedOut { id }).ok(); return; }, @@ -109,13 +118,13 @@ pub async fn spacedrop( match result { Ok(0) => { - debug!("({id}): Spacedrop was rejected from peer '{identity}'"); + debug!(spacedrop_id = %id, peer = %identity, "Spacedrop was rejected from;"); p2p.events.send(P2PEvent::SpacedropRejected { id }).ok(); return; } - Ok(1) => {} // Okay - Ok(_) => todo!(), // TODO: Proper error - Err(err) => todo!("{:?}", err), // TODO: Proper error + Ok(1) => {} // Okay + Ok(_) => todo!(), // TODO: Proper error + Err(e) => todo!("{:?}", e), // TODO: Proper error } let cancelled = Arc::new(AtomicBool::new(false)); @@ -124,7 +133,7 @@ pub async fn spacedrop( .unwrap_or_else(PoisonError::into_inner) .insert(id, cancelled.clone()); - debug!("({id}): starting transfer"); + debug!(spacedrop_id = %id, "Starting transfer"); let i = Instant::now(); let mut transfer = Transfer::new( @@ -138,10 +147,20 @@ pub async fn spacedrop( ); for (file_id, (path, file)) in files.into_iter().enumerate() { - debug!("({id}): transmitting '{file_id}' from '{path:?}'"); + debug!( + spacedrop_id = %id, + %file_id, + path = %path.display(), + "Transmitting;", + ); + let file = BufReader::new(file); - if let Err(err) = transfer.send(&mut stream, file).await { - debug!("({id}): failed to send file '{file_id}': {err}"); + if let Err(e) = transfer.send(&mut stream, file).await { + debug!( + spacedrop_id = %id, + %file_id, + ?e, + "Failed to send file;"); // TODO: Error to frontend // p2p.events // .send(P2PEvent::SpacedropFailed { id, file_id }) @@ -150,7 +169,7 @@ pub async fn spacedrop( } } - debug!("({id}): finished; took '{:?}", i.elapsed()); + debug!(spacedrop_id = %id, elapsed_time = ?i.elapsed(), "Finished;"); }); Ok(id) @@ -166,8 +185,8 @@ impl P2PManager { .remove(&id) { chan.send(Some(path)) - .map_err(|err| { - warn!("error accepting Spacedrop '{id:?}': '{err:?}'"); + .map_err(|e| { + warn!(spacedrop_id = %id, ?e, "Error accepting Spacedrop;"); }) .ok(); } @@ -181,8 +200,8 @@ impl P2PManager { .remove(&id) { chan.send(None) - .map_err(|err| { - warn!("error rejecting Spacedrop '{id:?}': '{err:?}'"); + .map_err(|e| { + warn!(spacedrop_id = %id, ?e, "Error rejecting Spacedrop;"); }) .ok(); } @@ -209,10 +228,11 @@ pub(crate) async fn receiver( let (tx, rx) = oneshot::channel(); info!( - "({id}): received '{}' files from peer '{}' with block size '{:?}'", - req.requests.len(), - stream.remote_identity(), - req.block_size + spacedrop_id = %id, + files_count = req.requests.len(), + peer = %stream.remote_identity(), + block_size = ?req.block_size, + "Receiving spacedrop files;", ); this.spacedrop_pairing_reqs .lock() @@ -249,19 +269,19 @@ pub(crate) async fn receiver( tokio::select! { _ = sleep(SPACEDROP_TIMEOUT) => { - info!("({id}): timeout, rejecting!"); + info!(spacedrop_id = %id, "Timeout, rejecting!;"); - stream.write_all(&[0]).await.map_err(|err| { - error!("({id}): error reject bit: '{err:?}'"); + stream.write_all(&[0]).await.map_err(|e| { + error!(spacedrop_id = %id, ?e, "Error reject bit;"); })?; - stream.flush().await.map_err(|err| { - error!("({id}): error flushing reject bit: '{err:?}'"); + stream.flush().await.map_err(|e| { + error!(spacedrop_id = %id, ?e, "Error flushing reject bit;"); })?; } file_path = rx => { match file_path { Ok(Some(file_path)) => { - info!("({id}): accepted saving to '{:?}'", file_path); + info!(spacedrop_id = %id, saving_to = %file_path, "Accepted;"); let cancelled = Arc::new(AtomicBool::new(false)); this.spacedrop_cancellations @@ -269,8 +289,8 @@ pub(crate) async fn receiver( .unwrap_or_else(PoisonError::into_inner) .insert(id, cancelled.clone()); - stream.write_all(&[1]).await.map_err(|err| { - error!("({id}): error sending continuation bit: '{err:?}'"); + stream.write_all(&[1]).await.map_err(|e| { + error!(spacedrop_id = %id, ?e, "Error sending continuation bit;"); // TODO: Send error to the frontend @@ -292,11 +312,20 @@ pub(crate) async fn receiver( path.push(&file_name); } - debug!("({id}): accepting '{file_name}' and saving to '{:?}'", path); + debug!( + spacedrop_id = %id, + %file_name, + saving_to = %path.display(), + "Accepting;", + ); if let Some(parent) = path.parent() { - create_dir_all(&parent).await.map_err(|err| { - error!("({id}): error creating parent directory '{parent:?}': '{err:?}'"); + create_dir_all(&parent).await.map_err(|e| { + error!( + spacedrop_id = %id, + parent = %parent.display(), + ?e, + "Error creating parent directory;"); // TODO: Send error to the frontend @@ -304,16 +333,25 @@ pub(crate) async fn receiver( })?; } - let f = File::create(&path).await.map_err(|err| { - error!("({id}): error creating file at '{path:?}': '{err:?}'"); + let f = File::create(&path).await.map_err(|e| { + error!( + spacedrop_id = %id, + creating_file_at = %path.display(), + ?e, + "Error creating file;", + ); // TODO: Send error to the frontend // TODO: Send error to remote peer })?; let f = BufWriter::new(f); - if let Err(err) = transfer.receive(&mut stream, f).await { - error!("({id}): error receiving file '{file_name}': '{err:?}'"); + if let Err(e) = transfer.receive(&mut stream, f).await { + error!( + spacedrop_id = %id, + %file_name, + ?e, + "Error receiving file;"); // TODO: Send error to frontend @@ -321,20 +359,20 @@ pub(crate) async fn receiver( } } - info!("({id}): complete"); + info!(spacedrop_id = %id, "Completed;"); } Ok(None) => { - info!("({id}): rejected"); + info!(spacedrop_id = %id, "Rejected;"); - stream.write_all(&[0]).await.map_err(|err| { - error!("({id}): error sending rejection: '{err:?}'"); + stream.write_all(&[0]).await.map_err(|e| { + error!(spacedrop_id = %id, ?e, "Error sending rejection;"); })?; - stream.flush().await.map_err(|err| { - error!("({id}): error flushing rejection: '{err:?}'"); + stream.flush().await.map_err(|e| { + error!(spacedrop_id = %id, ?e, "Error flushing rejection;"); })?; } Err(_) => { - warn!("({id}): error with Spacedrop pairing request receiver!"); + warn!(spacedrop_id = %id, "Error with Spacedrop pairing request receiver!;"); } } } diff --git a/core/src/p2p/protocol.rs b/core/src/p2p/protocol.rs index 436151b5c..e6c40e3d0 100644 --- a/core/src/p2p/protocol.rs +++ b/core/src/p2p/protocol.rs @@ -1,4 +1,4 @@ -use sd_p2p_block::{SpaceblockRequests, SpaceblockRequestsError}; +use sd_p2p_block::{Range, SpaceblockRequests, SpaceblockRequestsError}; use sd_p2p_proto::{decode, encode}; use thiserror::Error; use tokio::io::{AsyncRead, AsyncReadExt}; @@ -7,12 +7,20 @@ use uuid::Uuid; /// TODO #[derive(Debug, PartialEq, Eq)] pub enum Header { - // TODO: Split out cause this is a broadcast + /// Basic pin protocol for demonstrating the P2P system Ping, + /// Spacedrop file sending Spacedrop(SpaceblockRequests), - Sync(Uuid), + /// Used for sending sync messages between nodes. + Sync, // A HTTP server used for rspc requests and streaming files - Http, + RspcRemote, + // Request a file within a library + // We don't include a library ID here as it's taken care of by `sd_p2p_tunnel::Tunnel`. + LibraryFile { + file_path_id: Uuid, + range: Range, + }, } #[derive(Debug, Error)] @@ -23,8 +31,12 @@ pub enum HeaderError { DiscriminatorInvalid(u8), #[error("error reading spacedrop request: {0}")] SpacedropRequest(#[from] SpaceblockRequestsError), - #[error("error reading sync request: {0}")] - SyncRequest(decode::Error), + #[error("error with library file decode '{0}'")] + LibraryFileDecodeError(decode::Error), + #[error("error with library file io '{0}'")] + LibraryFileIoError(std::io::Error), + #[error("invalid range discriminator for library file req '{0}'")] + LibraryDiscriminatorInvalid(u8), } impl Header { @@ -39,12 +51,32 @@ impl Header { SpaceblockRequests::from_stream(stream).await?, )), 1 => Ok(Self::Ping), - 3 => Ok(Self::Sync( - decode::uuid(stream) + 3 => Ok(Self::Sync), + 5 => Ok(Self::RspcRemote), + 6 => Ok(Self::LibraryFile { + file_path_id: decode::uuid(stream) .await - .map_err(HeaderError::SyncRequest)?, - )), - 5 => Ok(Self::Http), + .map_err(HeaderError::LibraryFileDecodeError)?, + range: match stream + .read_u8() + .await + .map_err(HeaderError::LibraryFileIoError)? + { + 0 => Range::Full, + 1 => { + let start = stream + .read_u64_le() + .await + .map_err(HeaderError::LibraryFileIoError)?; + let end = stream + .read_u64_le() + .await + .map_err(HeaderError::LibraryFileIoError)?; + Range::Partial(start..end) + } + d => return Err(HeaderError::LibraryDiscriminatorInvalid(d)), + }, + }), d => Err(HeaderError::DiscriminatorInvalid(d)), } } @@ -57,12 +89,17 @@ impl Header { bytes } Self::Ping => vec![1], - Self::Sync(uuid) => { - let mut bytes = vec![3]; - encode::uuid(&mut bytes, uuid); - bytes + Self::Sync => vec![3], + Self::RspcRemote => vec![5], + Self::LibraryFile { + file_path_id, + range, + } => { + let mut buf = vec![6]; + encode::uuid(&mut buf, file_path_id); + buf.extend_from_slice(&range.to_bytes()); + buf } - Self::Http => vec![5], } } } diff --git a/core/src/p2p/sync/mod.rs b/core/src/p2p/sync/mod.rs index 15c37a799..421b0e6a7 100644 --- a/core/src/p2p/sync/mod.rs +++ b/core/src/p2p/sync/mod.rs @@ -6,13 +6,12 @@ use crate::{ }; use sd_p2p_proto::{decode, encode}; -use sd_sync::CRDTOperation; +use sd_sync::CompressedCRDTOperations; use std::sync::Arc; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt}; use tracing::*; -use uuid::Uuid; use super::P2PManager; @@ -28,10 +27,11 @@ mod originator { use sd_p2p_tunnel::Tunnel; pub mod tx { + use super::*; #[derive(Debug, PartialEq)] - pub struct Operations(pub Vec); + pub struct Operations(pub CompressedCRDTOperations); impl Operations { // TODO: Per field errors for better error handling @@ -56,8 +56,11 @@ mod originator { #[cfg(test)] #[tokio::test] async fn test() { + use sd_sync::CRDTOperation; + use uuid::Uuid; + { - let original = Operations(vec![]); + let original = Operations(CompressedCRDTOperations::new(vec![])); let mut cursor = std::io::Cursor::new(original.to_bytes()); let result = Operations::from_stream(&mut cursor).await.unwrap(); @@ -65,13 +68,13 @@ mod originator { } { - let original = Operations(vec![CRDTOperation { + let original = Operations(CompressedCRDTOperations::new(vec![CRDTOperation { instance: Uuid::new_v4(), timestamp: sync::NTP64(0), record_id: rmpv::Value::Nil, model: 0, - data: sd_sync::CRDTOperationData::Create, - }]); + data: sd_sync::CRDTOperationData::create(), + }])); let mut cursor = std::io::Cursor::new(original.to_bytes()); let result = Operations::from_stream(&mut cursor).await.unwrap(); @@ -80,28 +83,33 @@ mod originator { } } + #[instrument(skip(sync, p2p))] /// REMEMBER: This only syncs one direction! - pub async fn run(library_id: Uuid, sync: &Arc, p2p: &Arc) { - for (remote_identity, peer) in p2p.get_library_instances(&library_id) { + pub async fn run( + library: Arc, + sync: &Arc, + p2p: &Arc, + ) { + for (remote_identity, peer) in p2p.get_library_instances(&library.id) { if !peer.is_connected() { continue; }; let sync = sync.clone(); + let library = library.clone(); tokio::spawn(async move { debug!( - "Alerting peer '{remote_identity:?}' of new sync events for library '{library_id:?}'" + ?remote_identity, + %library.id, + "Alerting peer of new sync events for library;" ); let mut stream = peer.new_stream().await.unwrap(); - stream - .write_all(&Header::Sync(library_id).to_bytes()) - .await - .unwrap(); + stream.write_all(&Header::Sync.to_bytes()).await.unwrap(); - let mut tunnel = Tunnel::initiator(stream).await.unwrap(); + let mut tunnel = Tunnel::initiator(stream, &library.identity).await.unwrap(); tunnel .write_all(&SyncMessage::NewOperations.to_bytes()) @@ -115,7 +123,7 @@ mod originator { let ops = sync.get_ops(args).await.unwrap(); tunnel - .write_all(&tx::Operations(ops).to_bytes()) + .write_all(&tx::Operations(CompressedCRDTOperations::new(ops)).to_bytes()) .await .unwrap(); tunnel.flush().await.unwrap(); @@ -217,10 +225,9 @@ mod responder { let timestamps = match req { Request::FinishedIngesting => break, Request::Messages { timestamps, .. } => timestamps, - _ => continue, }; - debug!("Getting ops for timestamps {timestamps:?}"); + debug!(?timestamps, "Getting ops for timestamps;"); stream .write_all( @@ -236,15 +243,20 @@ mod responder { let rx::Operations(ops) = rx::Operations::from_stream(stream).await.unwrap(); + let (wait_tx, wait_rx) = tokio::sync::oneshot::channel::<()>(); + ingest .event_tx .send(Event::Messages(MessagesEvent { instance_id: library.sync.instance, has_more: ops.len() == OPS_PER_REQUEST as usize, messages: ops, + wait_tx: Some(wait_tx), })) .await .expect("TODO: Handle ingest channel closed, so we don't loose ops"); + + wait_rx.await.unwrap() } debug!("Sync responder done"); diff --git a/core/src/preferences/library.rs b/core/src/preferences/library.rs index 9b299f42d..a73cd825b 100644 --- a/core/src/preferences/library.rs +++ b/core/src/preferences/library.rs @@ -37,7 +37,7 @@ impl LibraryPreferences { kvs.into_iter() .filter_map(|data| { rmpv::decode::read_value(&mut data.value?.as_slice()) - .map_err(|e| error!("{e:#?}")) + .map_err(|e| error!(?e)) .ok() .map(|value| { ( diff --git a/core/src/preferences/mod.rs b/core/src/preferences/mod.rs index 006e283d5..215798fb1 100644 --- a/core/src/preferences/mod.rs +++ b/core/src/preferences/mod.rs @@ -38,7 +38,7 @@ where .into_iter() .filter_map(|(key, entry)| { Uuid::parse_str(&key) - .map_err(|e| error!("{e:#?}")) + .map_err(|e| error!(?e)) .ok() .map(|uuid| (uuid, entry.expect_value())) }) diff --git a/core/src/util/batched_stream.rs b/core/src/util/batched_stream.rs index d39cc7152..1cd350840 100644 --- a/core/src/util/batched_stream.rs +++ b/core/src/util/batched_stream.rs @@ -31,7 +31,7 @@ impl BatchedStream { } } -impl Stream for BatchedStream { +impl Stream for BatchedStream { type Item = Vec; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { diff --git a/core/src/util/debug_initializer.rs b/core/src/util/debug_initializer.rs index 8d796cc3d..8221aa77e 100644 --- a/core/src/util/debug_initializer.rs +++ b/core/src/util/debug_initializer.rs @@ -28,7 +28,7 @@ use tokio::{ fs::{self, metadata}, time::sleep, }; -use tracing::{info, warn}; +use tracing::{info, instrument, warn}; use uuid::Uuid; #[derive(Deserialize)] @@ -75,6 +75,8 @@ pub enum InitConfigError { #[error("failed to get current directory from environment: {0}")] CurrentDir(io::Error), + #[error(transparent)] + Processing(#[from] sd_core_heavy_lifting::Error), #[error(transparent)] FileIO(#[from] FileIOError), } @@ -107,18 +109,19 @@ impl InitConfig { Ok(None) } + #[instrument(skip_all, fields(path = %self.path.display()), err)] pub async fn apply( self, library_manager: &Arc, node: &Arc, ) -> Result<(), InitConfigError> { - info!("Initializing app from file: {:?}", self.path); + info!("Initializing app from file"); for lib in self.libraries { let name = lib.name.to_string(); let _guard = AbortOnDrop(tokio::spawn(async move { loop { - info!("Initializing library '{name}' from 'sd_init.json'..."); + info!(library_name = %name, "Initializing library from 'sd_init.json'...;"); sleep(Duration::from_secs(1)).await; } })); @@ -145,7 +148,7 @@ impl InitConfig { let locations = library.db.location().find_many(vec![]).exec().await?; for location in locations { - warn!("deleting location: {:?}", location.path); + warn!(location_path = ?location.path, "deleting location;"); delete_location(node, &library, location.id).await?; } } @@ -158,7 +161,7 @@ impl InitConfig { .exec() .await? { - warn!("deleting location: {:?}", location.path); + warn!(location_path = ?location.path, "deleting location;"); delete_location(node, &library, location.id).await?; } @@ -166,7 +169,7 @@ impl InitConfig { if let Err(e) = fs::remove_file(sd_file).await { if e.kind() != io::ErrorKind::NotFound { - warn!("failed to remove '.spacedrive' file: {:?}", e); + warn!(?e, "failed to remove '.spacedrive' file;"); } } @@ -181,14 +184,14 @@ impl InitConfig { scan_location(node, &library, location, ScanState::Pending).await?; } else { warn!( - "Debug init error: location '{}' was not found after being created!", - loc.path + location_path = ?loc.path, + "Debug init error: location was not found after being created!", ); } } } - info!("Initialized app from file: {}", self.path.display()); + info!("Initialized app from file"); Ok(()) } diff --git a/core/src/util/mpscrr.rs b/core/src/util/mpscrr.rs index c3a108467..4c7826bea 100644 --- a/core/src/util/mpscrr.rs +++ b/core/src/util/mpscrr.rs @@ -110,7 +110,7 @@ impl Sender { .await .into_iter() .filter_map(|x| { - x.map_err(|err| match err { + x.map_err(|e| match e { SenderError::Finished(key) => { self.0 .write() @@ -240,7 +240,7 @@ impl<'a> Drop for Bomb<'a> { mod tests { use std::{sync::Arc, time::Duration}; - use aovec::Aovec; + use boxcar; // Not using super because `use super as mpscrr` doesn't work :( use crate::util::mpscrr; @@ -255,7 +255,7 @@ mod tests { #[tokio::test] async fn test_mpscrr() { - let stack = Arc::new(Aovec::new(5)); + let stack = Arc::new(boxcar::Vec::new()); let (tx, rx) = mpscrr::unbounded_channel::(); @@ -315,16 +315,12 @@ mod tests { assert_eq!(result, vec![1, 2]); // Check the order of operations assert_eq!( - &aovec_to_vec(&stack), + &to_vec(&stack), &[Step::Send, Step::RecvA, Step::RecvB, Step::SendComplete,] ) } - fn aovec_to_vec(a: &Aovec) -> Vec { - let mut v = Vec::with_capacity(a.len()); - for i in 0..a.len() { - v.push(a.get(i).unwrap().clone()); - } - v + fn to_vec(a: &boxcar::Vec) -> Vec { + a.iter().map(|(_, entry)| entry).cloned().collect() } } diff --git a/core/src/util/unsafe_streamed_query.rs b/core/src/util/unsafe_streamed_query.rs index 8d7f2dbd5..1e3954512 100644 --- a/core/src/util/unsafe_streamed_query.rs +++ b/core/src/util/unsafe_streamed_query.rs @@ -1,8 +1,9 @@ +use std::pin::pin; + use async_stream::stream; use futures::{Stream, StreamExt}; use serde::Serialize; -use specta::{reference::Reference, DataType, Type, TypeMap}; -use sync_wrapper::SyncStream; +use specta::{reference::Reference, DataType, Generics, Type, TypeMap}; #[derive(Serialize)] #[serde(untagged)] @@ -12,32 +13,23 @@ pub enum Output { } impl Type for Output { - fn inline(type_map: &mut TypeMap, generics: &[DataType]) -> DataType { + fn inline(type_map: &mut TypeMap, generics: Generics) -> DataType { T::inline(type_map, generics) } - fn definition(type_map: &mut TypeMap) -> DataType { - T::definition(type_map) - } - fn reference(type_map: &mut TypeMap, generics: &[DataType]) -> Reference { T::reference(type_map, generics) } } // Marked as unsafe as the types are a lie and this should always be used with `useUnsafeStreamedQuery` -pub fn unsafe_streamed_query( - stream: S, -) -> impl Stream> + Send + Sync -where - S::Item: Send, -{ - SyncStream::new(stream! { - let mut stream = std::pin::pin!(stream); +pub fn unsafe_streamed_query(stream: S) -> impl Stream> { + stream! { + let mut stream = pin!(stream); while let Some(v) = stream.next().await { yield Output::Data(v); } yield Output::Complete { __stream_complete: () }; - }) + } } diff --git a/core/src/util/version_manager.rs b/core/src/util/version_manager.rs index da4cd37bd..62d42308d 100644 --- a/core/src/util/version_manager.rs +++ b/core/src/util/version_manager.rs @@ -157,9 +157,9 @@ impl< Ok(version) => version, Err(VersionManagerError::VersionFileDoesNotExist) => { warn!( - "Config file for {} does not exist, trying to create a new one with version -> {}", - type_name::(), - Config::LATEST_VERSION + config = %type_name::(), + latest_version = %Config::LATEST_VERSION, + "Config file for does not exist, trying to create a new one with latest version;", ); let Some(latest_config) = Config::from_latest_version() else { @@ -198,8 +198,10 @@ impl< ); info!( - "Running {} migrator: {current} -> {next}", - type_name::() + config = %type_name::(), + %current, + %next, + "Running migrator;", ); migrate_fn(current, next).await?; } @@ -207,7 +209,7 @@ impl< this.set_version(version_file_path, Config::LATEST_VERSION) .await?; } else { - debug!("No migration required for {}", type_name::()); + debug!(config = %type_name::(), "No migration required;"); } fs::read(version_file_path) diff --git a/core/src/volume/mod.rs b/core/src/volume/mod.rs index fc0ffa306..1cae4191b 100644 --- a/core/src/volume/mod.rs +++ b/core/src/volume/mod.rs @@ -1,5 +1,4 @@ // Adapted from: https://github.com/kimlimjustin/xplorer/blob/f4f3590d06783d64949766cc2975205a3b689a56/src-tauri/src/drives.rs -use sd_cache::Model; use std::{ fmt::Display, @@ -57,12 +56,6 @@ pub struct Volume { pub is_root_filesystem: bool, } -impl Model for Volume { - fn name() -> &'static str { - "Volume" - } -} - impl Hash for Volume { fn hash(&self, state: &mut H) { self.name.hash(state); @@ -135,12 +128,8 @@ pub async fn get_volumes() -> Vec { // Ensure disk has a valid device path let real_path = match tokio::fs::canonicalize(disk_name).await { - Err(real_path) => { - error!( - "Failed to canonicalize disk path {}: {:#?}", - disk_name.to_string_lossy(), - real_path - ); + Err(e) => { + error!(?disk_name, ?e, "Failed to canonicalize disk path;",); continue; } Ok(real_path) => real_path, @@ -313,7 +302,7 @@ pub async fn get_volumes() -> Vec { .args(["info", "-plist"]) .output() .await - .map_err(|err| error!("Failed to execute hdiutil: {err:#?}")) + .map_err(|e| error!(?e, "Failed to execute hdiutil;")) .ok() .and_then(|wmic_process| { use std::str::FromStr; @@ -321,8 +310,8 @@ pub async fn get_volumes() -> Vec { if wmic_process.status.success() { let info: Result = plist::from_bytes(&wmic_process.stdout); match info { - Err(err) => { - error!("Failed to parse hdiutil output: {err:#?}"); + Err(e) => { + error!(?e, "Failed to parse hdiutil output;"); None } Ok(info) => Some( @@ -403,7 +392,7 @@ pub async fn get_volumes() -> Vec { ]) .output() .await - .map_err(|err| error!("Failed to execute hdiutil: {err:#?}")) + .map_err(|e| error!(?e, "Failed to execute hdiutil;")) .ok() .and_then(|wmic_process| { if wmic_process.status.success() { @@ -420,7 +409,7 @@ pub async fn get_volumes() -> Vec { .trim() .parse::() { - Err(err) => error!("Failed to parse wmic output: {err:#?}"), + Err(e) => error!(?e, "Failed to parse wmic output;"), Ok(n) => total_capacity = n, } } diff --git a/crates/actors/Cargo.toml b/crates/actors/Cargo.toml index bdcf2401e..20b8e7694 100644 --- a/crates/actors/Cargo.toml +++ b/crates/actors/Cargo.toml @@ -5,8 +5,6 @@ license.workspace = true edition.workspace = true repository.workspace = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -futures.workspace = true -tokio.workspace = true +futures = { workspace = true } +tokio = { workspace = true } diff --git a/crates/ai/Cargo.toml b/crates/ai/Cargo.toml index f31fd9b8e..a1cb437e6 100644 --- a/crates/ai/Cargo.toml +++ b/crates/ai/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["Ericson Soares "] readme = "README.md" description = "A simple library to generate video thumbnails using ffmpeg with the webp format" -rust-version = "1.75.0" +rust-version = "1.75" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } @@ -29,19 +29,19 @@ once_cell = { workspace = true } prisma-client-rust = { workspace = true } reqwest = { workspace = true, features = ["stream", "native-tls-vendored"] } rmp-serde = { workspace = true } +rmpv = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["fs"] } tokio-stream = { workspace = true } tracing = { workspace = true } -url = '2.5.0' uuid = { workspace = true, features = ["v4", "serde"] } -# Note: Keep same version as used by ort -ndarray = { version = "0.15.6" } +# Note: half and ndarray version must be the same as used in ort half = { version = "2.1", features = ['num-traits'] } -rmpv.workspace = true +ndarray = "0.15" +url = '2.5.0' # Microsoft does not provide a release for osx-gpu. See: https://github.com/microsoft/onnxruntime/releases # "gpu" means CUDA or TensorRT EP. Thus, the ort crate cannot download them at build time. diff --git a/crates/ai/src/old_image_labeler/process.rs b/crates/ai/src/old_image_labeler/process.rs index 8e674f3be..125dbe21c 100644 --- a/crates/ai/src/old_image_labeler/process.rs +++ b/crates/ai/src/old_image_labeler/process.rs @@ -85,7 +85,7 @@ pub(super) async fn spawned_processing( let mut queue = file_paths .into_iter() .filter_map(|file_path| { - if file_path.object_id.is_none() { + if file_path.object.is_none() { errors.push(( file_path.id, ImageLabelerError::IsolateFilePathData(MissingFieldError::new( @@ -201,7 +201,7 @@ pub(super) async fn spawned_processing( let ids = ( file_path.id, - file_path.object_id.expect("already checked above"), + file_path.object.as_ref().expect("already checked above").id, ); if output_tx.is_closed() { diff --git a/crates/cache/Cargo.toml b/crates/cache/Cargo.toml deleted file mode 100644 index c29269854..000000000 --- a/crates/cache/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "sd-cache" -version = "0.0.0" -license = { workspace = true } -edition = { workspace = true } -repository = { workspace = true } - -[dependencies] -serde = { workspace = true } -serde_json = { workspace = true } -specta = { workspace = true } diff --git a/crates/cache/src/lib.rs b/crates/cache/src/lib.rs deleted file mode 100644 index 944228d16..000000000 --- a/crates/cache/src/lib.rs +++ /dev/null @@ -1,229 +0,0 @@ -use std::{ - hash::{Hash, Hasher}, - marker::PhantomData, - sync::Arc, -}; - -use serde::{ser::SerializeMap, Serialize, Serializer}; -use specta::{Any, DataType, NamedType, Type, TypeMap}; - -/// A type that can be used to return a group of `Reference` and `CacheNode`'s -/// -/// You don't need to use this, it's just a shortcut to avoid having to write out the full type every time. -#[derive(Serialize, Type, Debug)] -pub struct NormalisedResults { - pub items: Vec>, - pub nodes: Vec, -} - -/// A type that can be used to return a group of `Reference` and `CacheNode`'s -/// -/// You don't need to use this, it's just a shortcut to avoid having to write out the full type every time. -#[derive(Serialize, Type, Debug)] -pub struct NormalisedResult { - pub item: Reference, - pub nodes: Vec, -} - -impl NormalisedResult { - pub fn from(item: T, id_fn: impl Fn(&T) -> String) -> Self { - let id = id_fn(&item); - Self { - item: Reference::new(id.clone()), - nodes: vec![CacheNode::new(id, item)], - } - } -} - -/// A type which can be stored in the cache. -pub trait Model { - /// Must return a unique identifier for this model within the cache. - fn name() -> &'static str; -} - -/// A reference to a `CacheNode`. -/// -/// This does not contain the actual data, but instead a reference to it. -/// This allows the CacheNode's to be switched out and the query recomputed without any backend communication. -/// -/// If you use a `Reference` in a query, you *must* ensure the corresponding `CacheNode` is also in the query. -#[derive(Type, Debug, Clone, Hash, PartialEq, Eq)] -pub struct Reference { - __type: &'static str, - __id: String, - #[specta(rename = "#type")] - ty: PhantomType, -} - -impl Reference { - pub fn new(key: String) -> Self { - Self { - __type: "", // This is just to fake the field for Specta - __id: key, - ty: PhantomType(PhantomData), - } - } -} - -impl Serialize for Reference { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let mut map = serializer.serialize_map(Some(2))?; - map.serialize_entry("__type", T::name())?; - map.serialize_entry("__id", &self.__id)?; - map.end() - } -} - -/// A node in the cache. -/// This holds the data and is identified by it's type and id. -#[derive(Debug, Clone)] -pub struct CacheNode( - &'static str, - serde_json::Value, - Result>, -); - -impl CacheNode { - pub fn new(key: String, value: T) -> Self { - Self( - T::name(), - key.into(), - serde_json::to_value(value).map_err(Arc::new), - ) - } -} - -impl PartialEq for CacheNode { - fn eq(&self, other: &Self) -> bool { - self.0 == other.0 - && self.1 == other.1 - && match (&self.2, &other.2) { - (Ok(v0), Ok(v1)) => v0 == v1, - // Compares the values in the Arcs, not the Arc objects themselves. - (Err(e0), Err(e1)) => { - (*e0).classify() == (*e1).classify() - && (*e0).column() == (*e1).column() - && (*e0).line() == (*e1).line() - } - _ => false, - } - } -} - -impl Eq for CacheNode {} - -impl Hash for CacheNode { - fn hash(&self, state: &mut H) { - self.0.hash(state); - self.1.as_str().hash(state); - self.1.as_str().hash(state); - } -} - -#[derive(Type, Default)] -#[specta(rename = "CacheNode", remote = CacheNode)] -#[allow(unused)] -struct CacheNodeTy { - __type: String, - __id: String, - #[specta(rename = "#node")] - node: Any, -} - -#[derive(Serialize)] -struct NodeSerdeRepr<'a> { - __type: &'static str, - __id: &'a serde_json::Value, - #[serde(flatten)] - v: &'a serde_json::Value, -} - -impl Serialize for CacheNode { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - NodeSerdeRepr { - __type: self.0, - __id: &self.1, - v: self.2.as_ref().map_err(|err| { - serde::ser::Error::custom(format!("Failed to serialize node: {}", err)) - })?, - } - .serialize(serializer) - } -} - -/// A helper for easily normalizing data. -pub trait Normalise { - type Item: Model + Type; - - fn normalise( - self, - id_fn: impl Fn(&Self::Item) -> String, - ) -> (Vec, Vec>); -} - -impl Normalise for Vec { - type Item = T; - - fn normalise( - self, - id_fn: impl Fn(&Self::Item) -> String, - ) -> (Vec, Vec>) { - let mut nodes = Vec::with_capacity(self.len()); - let mut references = Vec::with_capacity(self.len()); - - for item in self.into_iter() { - let id = id_fn(&item); - nodes.push(CacheNode::new(id.clone(), item)); - references.push(Reference::new(id)); - } - - (nodes, references) - } -} - -/// Basically `PhantomData`. -/// -/// With Specta `PhantomData` is exported as `null`. -/// This will export as `T` but serve the same purpose as `PhantomData` (holding a type without it being instantiated). -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct PhantomType(PhantomData); - -/// WARNING: This type is surgically updated within `Reference` in the final typedefs due it being impossible to properly implement. -/// Be careful changing it! - -impl Type for PhantomType { - fn inline(type_map: &mut TypeMap, generics: &[DataType]) -> DataType { - T::inline(type_map, generics) - } - - fn reference(type_map: &mut TypeMap, generics: &[DataType]) -> specta::reference::Reference { - T::reference(type_map, generics) - } - - fn definition(type_map: &mut TypeMap) -> DataType { - T::definition(type_map) - } -} - -// This function is cursed. -pub fn patch_typedef(type_map: &mut TypeMap) { - #[derive(Type)] - #[specta(rename = "Reference")] - #[allow(unused)] - struct ReferenceTy { - __type: &'static str, - __id: String, - #[specta(rename = "#type")] - ty: T, - } - - let mut def = as NamedType>::definition_named_data_type(type_map); - def.inner = ReferenceTy::::definition(type_map); - type_map.insert( as NamedType>::SID, def) -} diff --git a/crates/cloud-api/Cargo.toml b/crates/cloud-api/Cargo.toml index 709bbe93c..792947700 100644 --- a/crates/cloud-api/Cargo.toml +++ b/crates/cloud-api/Cargo.toml @@ -9,15 +9,14 @@ repository.workspace = true # Spacedrive Sub-crates sd-p2p = { path = "../p2p" } +# Workspace dependencies base64 = { workspace = true } +reqwest = { workspace = true, features = ["native-tls-vendored"] } rmpv = { workspace = true } rspc = { workspace = true } - serde = { workspace = true } serde_json = { workspace = true } specta = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } uuid = { workspace = true } - -reqwest = "0.11.22" diff --git a/crates/cloud-api/src/lib.rs b/crates/cloud-api/src/lib.rs index 7bed4bd39..6db87ade8 100644 --- a/crates/cloud-api/src/lib.rs +++ b/crates/cloud-api/src/lib.rs @@ -49,6 +49,7 @@ pub struct Instance { pub identity: RemoteIdentity, #[serde(rename = "nodeId")] pub node_id: Uuid, + pub node_remote_identity: String, pub metadata: HashMap, } @@ -209,6 +210,7 @@ pub mod library { instance_uuid: Uuid, instance_identity: RemoteIdentity, node_id: Uuid, + node_remote_identity: RemoteIdentity, metadata: &HashMap, ) -> Result { let Some(auth_token) = config.auth_token else { @@ -226,6 +228,7 @@ pub mod library { "instanceUuid": instance_uuid, "instanceIdentity": instance_identity, "nodeId": node_id, + "nodeRemoteIdentity": node_remote_identity, "metadata": metadata, })) .with_auth(auth_token) @@ -277,6 +280,7 @@ pub mod library { library_id: Uuid, instance_id: Uuid, node_id: Option, + node_remote_identity: Option, metadata: Option>, ) -> Result<(), Error> { let Some(auth_token) = config.auth_token else { @@ -291,6 +295,7 @@ pub mod library { )) .json(&json!({ "nodeId": node_id, + "nodeRemoteIdentity": node_remote_identity, "metadata": metadata, })) .with_auth(auth_token) @@ -311,6 +316,7 @@ pub mod library { instance_uuid: Uuid, instance_identity: RemoteIdentity, node_id: Uuid, + node_remote_identity: RemoteIdentity, metadata: HashMap, ) -> Result, Error> { let Some(auth_token) = config.auth_token else { @@ -326,6 +332,7 @@ pub mod library { .json(&json!({ "instanceIdentity": instance_identity, "nodeId": node_id, + "nodeRemoteIdentity": node_remote_identity, "metadata": metadata, })) .with_auth(auth_token) diff --git a/crates/crypto/Cargo.toml b/crates/crypto/Cargo.toml index 707aa21c5..4b570d2e2 100644 --- a/crates/crypto/Cargo.toml +++ b/crates/crypto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sd-crypto" -rust-version = "1.72.0" +rust-version = "1.72" version = "0.0.0" authors = ["Jake Robinson "] description = """ @@ -91,11 +91,12 @@ uuid = { version = "1.7.0", features = ["v4"] } linux-keyutils = { version = "0.2.4", features = ["std"], optional = true } secret-service = { version = "3.0.1", features = [ "crypto-rust", + "rt-tokio-crypto-rust", ], optional = true } # this needs to remain at versions < 4, as they made some changes and i can't get it # to compile for the time being -zbus = { version = "3.15.2", default_features = false, features = [ +zbus = { version = "4.0", default_features = false, features = [ "tokio", "blocking", ], optional = true } diff --git a/crates/crypto/src/keyring/linux/secret_service.rs b/crates/crypto/src/keyring/linux/secret_service.rs index 4236174d9..334a52b88 100644 --- a/crates/crypto/src/keyring/linux/secret_service.rs +++ b/crates/crypto/src/keyring/linux/secret_service.rs @@ -33,14 +33,11 @@ impl KeyringInterface for SecretServiceKeyring { } fn contains_key(&self, id: &Identifier) -> bool { - self.get_collection() - .ok() - .map(|k| { - k.search_items(id.as_sec_ser_identifier()) - .ok() - .map_or(false, |x| !x.is_empty()) - }) - .unwrap_or_default() + self.get_collection().ok().is_some_and(|k| { + k.search_items(id.as_sec_ser_identifier()) + .ok() + .map_or(false, |x| !x.is_empty()) + }) } fn get(&self, id: &Identifier) -> Result>> { diff --git a/crates/crypto/src/types.rs b/crates/crypto/src/types.rs index 298c07bb2..45416ba48 100644 --- a/crates/crypto/src/types.rs +++ b/crates/crypto/src/types.rs @@ -326,7 +326,7 @@ where I: ArrayLength, { fn from(value: &Key) -> Self { - value.expose().iter().copied().collect() // TODO(brxken128): streamline this? + GenericArray::clone_from_slice(value.expose()) } } diff --git a/crates/ffmpeg/Cargo.toml b/crates/ffmpeg/Cargo.toml index 04c346be1..9f84182f2 100644 --- a/crates/ffmpeg/Cargo.toml +++ b/crates/ffmpeg/Cargo.toml @@ -1,22 +1,32 @@ [package] name = "sd-ffmpeg" version = "0.1.0" -authors = ["Ericson Soares "] +authors = [ + "Ericson Soares ", + "Vítor Vasconcellos ", +] readme = "README.md" description = "A simple library to generate video thumbnails using ffmpeg with the webp format" -rust-version = "1.64.0" +rust-version = "1.78" license = { workspace = true } repository = { workspace = true } edition = { workspace = true } [dependencies] +# Spacedrive Sub-crates +sd-utils = { path = "../utils" } + +# Workspace dependencies +chrono = { workspace = true, features = ["serde"] } +image = { workspace = true } +libc = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["fs", "rt"] } tracing = { workspace = true } webp = { workspace = true } -ffmpeg-sys-next = "6.0.1" - +# Specific FFmpeg dependencies +ffmpeg-sys-next = "7.0" [dev-dependencies] tempfile = { workspace = true } diff --git a/crates/ffmpeg/README.md b/crates/ffmpeg/README.md index 385f75a60..09419078a 100644 --- a/crates/ffmpeg/README.md +++ b/crates/ffmpeg/README.md @@ -29,7 +29,6 @@ async fn main() -> Result<(), ThumbnailerError> { let thumbnailer = ThumbnailerBuilder::new() .width_and_height(420, 315) .seek_percentage(0.25)? - .with_film_strip(false) .quality(80.0)? .build(); diff --git a/crates/ffmpeg/src/codec_ctx.rs b/crates/ffmpeg/src/codec_ctx.rs new file mode 100644 index 000000000..1b5690d62 --- /dev/null +++ b/crates/ffmpeg/src/codec_ctx.rs @@ -0,0 +1,460 @@ +use crate::{ + error::{Error, FFmpegError}, + model::{FFmpegAudioProps, FFmpegCodec, FFmpegProps, FFmpegSubtitleProps, FFmpegVideoProps}, + utils::check_error, +}; + +use std::{ + ffi::{CStr, CString}, + ptr, +}; + +use ffmpeg_sys_next::{ + av_bprint_finalize, av_bprint_init, av_channel_layout_describe_bprint, av_chroma_location_name, + av_color_primaries_name, av_color_range_name, av_color_space_name, av_color_transfer_name, + av_fourcc_make_string, av_get_bits_per_sample, av_get_bytes_per_sample, + av_get_media_type_string, av_get_pix_fmt_name, av_get_sample_fmt_name, av_pix_fmt_desc_get, + av_reduce, avcodec_alloc_context3, avcodec_flush_buffers, avcodec_free_context, + avcodec_get_name, avcodec_open2, avcodec_parameters_to_context, avcodec_profile_name, + avcodec_receive_frame, avcodec_send_packet, AVBPrint, AVChromaLocation, AVCodec, + AVCodecContext, AVCodecParameters, AVColorPrimaries, AVColorRange, AVColorSpace, + AVColorTransferCharacteristic, AVFieldOrder, AVFrame, AVMediaType, AVPacket, AVPixelFormat, + AVRational, AVSampleFormat, AVERROR, AVERROR_EOF, AV_FOURCC_MAX_STRING_SIZE, + FF_CODEC_PROPERTY_CLOSED_CAPTIONS, FF_CODEC_PROPERTY_FILM_GRAIN, FF_CODEC_PROPERTY_LOSSLESS, +}; +use libc::EAGAIN; + +pub struct FFmpegCodecContext(*mut AVCodecContext); + +impl FFmpegCodecContext { + pub(crate) fn new() -> Result { + let ptr = unsafe { avcodec_alloc_context3(ptr::null_mut()) }; + if ptr.is_null() { + Err(FFmpegError::VideoCodecAllocation)?; + } + + Ok(Self(ptr)) + } + + pub(crate) fn as_ref(&self) -> &AVCodecContext { + unsafe { self.0.as_ref() }.expect("initialized on struct creation") + } + + pub(crate) fn as_mut(&mut self) -> &mut AVCodecContext { + unsafe { self.0.as_mut() }.expect("initialized on struct creation") + } + + pub(crate) fn parameters_to_context( + &mut self, + codec_params: &AVCodecParameters, + ) -> Result<&Self, Error> { + check_error( + unsafe { avcodec_parameters_to_context(self.as_mut(), codec_params) }, + "Fail to fill the codec context with codec parameters", + )?; + + Ok(self) + } + + pub(crate) fn open2(&mut self, video_codec: &AVCodec) -> Result<&Self, Error> { + check_error( + unsafe { avcodec_open2(self.as_mut(), video_codec, ptr::null_mut()) }, + "Failed to open video codec", + )?; + + Ok(self) + } + + pub(crate) fn flush(&mut self) { + unsafe { avcodec_flush_buffers(self.as_mut()) }; + } + + pub(crate) fn send_packet(&mut self, packet: *mut AVPacket) -> Result { + match unsafe { avcodec_send_packet(self.as_mut(), packet) } { + AVERROR_EOF => Ok(false), + ret if ret == AVERROR(EAGAIN) => Err(FFmpegError::Again), + ret if ret < 0 => Err(FFmpegError::from(ret)), + _ => Ok(true), + } + } + + pub(crate) fn receive_frame(&mut self, frame: *mut AVFrame) -> Result { + match unsafe { avcodec_receive_frame(self.as_mut(), frame) } { + AVERROR_EOF => Ok(false), + ret if ret == AVERROR(EAGAIN) => Err(FFmpegError::Again), + ret if ret < 0 => Err(FFmpegError::from(ret)), + _ => Ok(true), + } + } + + fn kind(&self) -> (Option, Option) { + let kind = unsafe { av_get_media_type_string(self.as_ref().codec_type).as_ref() } + .map(|media_type| unsafe { CStr::from_ptr(media_type) }); + + let sub_kind = unsafe { self.as_ref().codec.as_ref() } + .and_then(|codec| unsafe { codec.name.as_ref() }) + .map(|name| unsafe { CStr::from_ptr(name) }) + .and_then(|sub_kind| { + if let Some(kind) = kind { + if kind == sub_kind { + return None; + } + } + + Some(String::from_utf8_lossy(sub_kind.to_bytes()).to_string()) + }); + + ( + kind.map(|cstr| String::from_utf8_lossy(cstr.to_bytes()).to_string()), + sub_kind, + ) + } + + fn name(&self) -> Option { + unsafe { avcodec_get_name(self.as_ref().codec_id).as_ref() }.map(|codec_name| { + let cstr = unsafe { CStr::from_ptr(codec_name) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }) + } + + fn profile(&self) -> Option { + if self.as_ref().profile == 0 { + None + } else { + unsafe { avcodec_profile_name(self.as_ref().codec_id, self.as_ref().profile).as_ref() } + .map(|profile| { + let cstr = unsafe { CStr::from_ptr(profile) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }) + } + } + + fn tag(&self) -> Option { + if self.as_ref().codec_tag != 0 { + CString::new(vec![ + 0; + usize::try_from(AV_FOURCC_MAX_STRING_SIZE).expect( + "AV_FOURCC_MAX_STRING_SIZE is 32, must fit in an usize" + ) + ]) + .ok() + .map(|buffer| { + let tag = unsafe { + CString::from_raw(av_fourcc_make_string( + buffer.into_raw(), + self.as_ref().codec_tag, + )) + }; + String::from_utf8_lossy(tag.as_bytes()).to_string() + }) + } else { + None + } + } + + fn bit_rate(&self) -> i32 { + // TODO: use i64 instead of i32 when rspc supports it + let ctx = self.as_ref(); + match self.as_ref().codec_type { + AVMediaType::AVMEDIA_TYPE_VIDEO + | AVMediaType::AVMEDIA_TYPE_DATA + | AVMediaType::AVMEDIA_TYPE_SUBTITLE + | AVMediaType::AVMEDIA_TYPE_ATTACHMENT => ctx.bit_rate.try_into().unwrap_or_default(), + AVMediaType::AVMEDIA_TYPE_AUDIO => { + let bits_per_sample = unsafe { av_get_bits_per_sample(ctx.codec_id) }; + if bits_per_sample != 0 { + let bit_rate = ctx.sample_rate * ctx.ch_layout.nb_channels; + if bit_rate <= i32::MAX / bits_per_sample { + return bit_rate * (bits_per_sample); + } + } + ctx.bit_rate.try_into().unwrap_or_default() + } + _ => 0, + } + } + + fn video_props(&self) -> Option { + let ctx = self.as_ref(); + if ctx.codec_type != AVMediaType::AVMEDIA_TYPE_VIDEO { + return None; + } + + let pixel_format = extract_pixel_format(ctx); + + let bits_per_channel = extract_bits_per_channel(ctx); + + let color_range = extract_color_range(ctx); + + let (color_space, color_primaries, color_transfer) = extract_colors(ctx); + + // Field Order + let field_order = extract_field_order(ctx); + + // Chroma Sample Location + let chroma_location = extract_chroma_location(ctx); + + let width = ctx.width; + let height = ctx.height; + + let (aspect_ratio_num, aspect_ratio_den) = extract_aspect_ratio(ctx, width, height); + + let mut properties = vec![]; + if ctx.properties & (FF_CODEC_PROPERTY_LOSSLESS.unsigned_abs()) != 0 { + properties.push("Closed Captions".to_string()); + } + if ctx.properties & (FF_CODEC_PROPERTY_CLOSED_CAPTIONS.unsigned_abs()) != 0 { + properties.push("Film Grain".to_string()); + } + if ctx.properties & (FF_CODEC_PROPERTY_FILM_GRAIN.unsigned_abs()) != 0 { + properties.push("lossless".to_string()); + } + + Some(FFmpegVideoProps { + pixel_format, + color_range, + bits_per_channel, + color_space, + color_primaries, + color_transfer, + field_order, + chroma_location, + width, + height, + aspect_ratio_num, + aspect_ratio_den, + properties, + }) + } + + fn audio_props(&self) -> Option { + let ctx = self.as_ref(); + if ctx.codec_type != AVMediaType::AVMEDIA_TYPE_AUDIO { + return None; + } + + let sample_rate = if ctx.sample_rate > 0 { + Some(ctx.sample_rate) + } else { + None + }; + + let mut bprint = AVBPrint { + str_: ptr::null_mut(), + len: 0, + size: 0, + size_max: 0, + reserved_internal_buffer: [0; 1], + reserved_padding: [0; 1000], + }; + unsafe { + av_bprint_init(&mut bprint, 0, u32::MAX /* AV_BPRINT_SIZE_UNLIMITED */); + }; + let mut channel_layout = ptr::null_mut(); + let channel_layout = + if unsafe { av_channel_layout_describe_bprint(&ctx.ch_layout, &mut bprint) } < 0 + || unsafe { av_bprint_finalize(&mut bprint, &mut channel_layout) } < 0 + || channel_layout.is_null() + { + None + } else { + let cstr = unsafe { CStr::from_ptr(channel_layout) }; + Some(String::from_utf8_lossy(cstr.to_bytes()).to_string()) + }; + + let sample_format = if ctx.sample_fmt == AVSampleFormat::AV_SAMPLE_FMT_NONE { + None + } else { + unsafe { av_get_sample_fmt_name(ctx.sample_fmt).as_ref() }.map(|sample_fmt| { + let cstr = unsafe { CStr::from_ptr(sample_fmt) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }) + }; + + let bit_per_sample = if ctx.bits_per_raw_sample > 0 + && ctx.bits_per_raw_sample != unsafe { av_get_bytes_per_sample(ctx.sample_fmt) } * 8 + { + Some(ctx.bits_per_raw_sample) + } else { + None + }; + + Some(FFmpegAudioProps { + delay: ctx.initial_padding, + padding: ctx.trailing_padding, + sample_rate, + sample_format, + bit_per_sample, + channel_layout, + }) + } + + fn subtitle_props(&self) -> Option { + if self.as_ref().codec_type != AVMediaType::AVMEDIA_TYPE_SUBTITLE { + return None; + } + + Some(FFmpegSubtitleProps { + width: self.as_ref().width, + height: self.as_ref().height, + }) + } + + fn props(&self) -> Option { + match self.as_ref().codec_type { + AVMediaType::AVMEDIA_TYPE_VIDEO => self.video_props().map(FFmpegProps::Video), + AVMediaType::AVMEDIA_TYPE_AUDIO => self.audio_props().map(FFmpegProps::Audio), + AVMediaType::AVMEDIA_TYPE_SUBTITLE => self.subtitle_props().map(FFmpegProps::Subtitle), + _ => None, + } + } +} + +fn extract_aspect_ratio( + ctx: &AVCodecContext, + width: i32, + height: i32, +) -> (Option, Option) { + if ctx.sample_aspect_ratio.num == 0 { + (None, None) + } else { + let mut display_aspect_ratio = AVRational { num: 0, den: 0 }; + let num = i64::from(width * ctx.sample_aspect_ratio.num); + let den = i64::from(height * ctx.sample_aspect_ratio.den); + let max = 1024 * 1024; + unsafe { + av_reduce( + &mut display_aspect_ratio.num, + &mut display_aspect_ratio.den, + num, + den, + max, + ); + } + + ( + Some(display_aspect_ratio.num), + Some(display_aspect_ratio.den), + ) + } +} + +fn extract_chroma_location(ctx: &AVCodecContext) -> Option { + if ctx.chroma_sample_location == AVChromaLocation::AVCHROMA_LOC_UNSPECIFIED { + None + } else { + unsafe { av_chroma_location_name(ctx.chroma_sample_location).as_ref() }.map( + |chroma_location| { + let cstr = unsafe { CStr::from_ptr(chroma_location) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }, + ) + } +} + +fn extract_field_order(ctx: &AVCodecContext) -> Option { + if ctx.field_order == AVFieldOrder::AV_FIELD_UNKNOWN { + None + } else { + Some( + (match ctx.field_order { + AVFieldOrder::AV_FIELD_TT => "top first", + AVFieldOrder::AV_FIELD_BB => "bottom first", + AVFieldOrder::AV_FIELD_TB => "top coded first (swapped)", + AVFieldOrder::AV_FIELD_BT => "bottom coded first (swapped)", + _ => "progressive", + }) + .to_string(), + ) + } +} + +fn extract_colors(ctx: &AVCodecContext) -> (Option, Option, Option) { + if ctx.colorspace == AVColorSpace::AVCOL_SPC_UNSPECIFIED + && ctx.color_primaries == AVColorPrimaries::AVCOL_PRI_UNSPECIFIED + && ctx.color_trc == AVColorTransferCharacteristic::AVCOL_TRC_UNSPECIFIED + { + (None, None, None) + } else { + let color_space = + unsafe { av_color_space_name(ctx.colorspace).as_ref() }.map(|color_space| { + let cstr = unsafe { CStr::from_ptr(color_space) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }); + let color_primaries = unsafe { av_color_primaries_name(ctx.color_primaries).as_ref() }.map( + |color_primaries| { + let cstr = unsafe { CStr::from_ptr(color_primaries) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }, + ); + let color_transfer = + unsafe { av_color_transfer_name(ctx.color_trc).as_ref() }.map(|color_transfer| { + let cstr = unsafe { CStr::from_ptr(color_transfer) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }); + + (color_space, color_primaries, color_transfer) + } +} + +fn extract_color_range(ctx: &AVCodecContext) -> Option { + if ctx.color_range == AVColorRange::AVCOL_RANGE_UNSPECIFIED { + None + } else { + unsafe { av_color_range_name(ctx.color_range).as_ref() }.map(|color_range| { + let cstr = unsafe { CStr::from_ptr(color_range) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }) + } +} + +fn extract_bits_per_channel(ctx: &AVCodecContext) -> Option { + if ctx.bits_per_raw_sample == 0 || ctx.pix_fmt == AVPixelFormat::AV_PIX_FMT_NONE { + None + } else { + unsafe { av_pix_fmt_desc_get(ctx.pix_fmt).as_ref() }.and_then(|pix_fmt_desc| { + let comp = pix_fmt_desc.comp[0]; + if ctx.bits_per_raw_sample < comp.depth { + Some(ctx.bits_per_raw_sample) + } else { + None + } + }) + } +} + +fn extract_pixel_format(ctx: &AVCodecContext) -> Option { + if ctx.pix_fmt == AVPixelFormat::AV_PIX_FMT_NONE { + None + } else { + unsafe { av_get_pix_fmt_name(ctx.pix_fmt).as_ref() }.map(|pixel_format| { + let cstr = unsafe { CStr::from_ptr(pixel_format) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }) + } +} + +impl Drop for FFmpegCodecContext { + fn drop(&mut self) { + if !self.0.is_null() { + unsafe { avcodec_free_context(&mut self.0) }; + self.0 = ptr::null_mut(); + } + } +} + +impl From<&FFmpegCodecContext> for FFmpegCodec { + fn from(ctx: &FFmpegCodecContext) -> Self { + let (kind, sub_kind) = ctx.kind(); + + Self { + kind, + sub_kind, + name: ctx.name(), + profile: ctx.profile(), + tag: ctx.tag(), + bit_rate: ctx.bit_rate(), + props: ctx.props(), + } + } +} diff --git a/crates/ffmpeg/src/dict.rs b/crates/ffmpeg/src/dict.rs new file mode 100644 index 000000000..7d1d5726b --- /dev/null +++ b/crates/ffmpeg/src/dict.rs @@ -0,0 +1,181 @@ +use crate::{error::Error, model::FFmpegMetadata, utils::check_error}; + +use std::{ffi::CStr, ptr}; + +use chrono::DateTime; +use ffmpeg_sys_next::{ + av_dict_free, av_dict_get, av_dict_iterate, av_dict_set, AVDictionary, AVDictionaryEntry, + AV_DICT_MATCH_CASE, +}; + +#[derive(Debug)] +pub struct FFmpegDictionary { + dict: *mut AVDictionary, + managed: bool, +} + +impl FFmpegDictionary { + pub(crate) fn new(av_dict: Option<&mut AVDictionary>) -> Self { + av_dict.map_or_else( + || Self { + dict: ptr::null_mut(), + managed: true, + }, + |ptr| Self { + dict: ptr, + managed: false, + }, + ) + } + + pub(crate) fn get(&self, key: &CStr) -> Option { + if self.dict.is_null() { + return None; + } + + unsafe { av_dict_get(self.dict, key.as_ptr(), ptr::null(), AV_DICT_MATCH_CASE).as_ref() } + .and_then(|entry| unsafe { entry.value.as_ref() }) + .map(|value| { + let cstr = unsafe { CStr::from_ptr(value) }; + String::from_utf8_lossy(cstr.to_bytes()).to_string() + }) + } + + pub(crate) fn remove(&mut self, key: &CStr) -> Result<(), Error> { + check_error( + unsafe { + av_dict_set( + &mut self.dict, + key.as_ptr(), + ptr::null(), + AV_DICT_MATCH_CASE, + ) + }, + "Fail to set dictionary key-value pair", + )?; + + Ok(()) + } +} + +impl Drop for FFmpegDictionary { + fn drop(&mut self) { + if self.managed && !self.dict.is_null() { + unsafe { av_dict_free(&mut self.dict) }; + self.dict = ptr::null_mut(); + } + } +} + +impl<'a> IntoIterator for &'a FFmpegDictionary { + type Item = (String, Option); + type IntoIter = FFmpegDictIter<'a>; + + #[inline] + fn into_iter(self) -> FFmpegDictIter<'a> { + FFmpegDictIter { + dict: self.dict, + prev: ptr::null(), + _lifetime: std::marker::PhantomData, + } + } +} + +pub struct FFmpegDictIter<'a> { + dict: *mut AVDictionary, + prev: *const AVDictionaryEntry, + _lifetime: std::marker::PhantomData<&'a ()>, +} + +impl<'a> Iterator for FFmpegDictIter<'a> { + type Item = (String, Option); + + fn next(&mut self) -> Option<(String, Option)> { + unsafe { av_dict_iterate(self.dict, self.prev).as_ref() }.and_then(|prev| { + self.prev = prev; + let key = unsafe { prev.key.as_ref() }.map(|key| unsafe { CStr::from_ptr(key) }); + let value = + unsafe { prev.value.as_ref() }.map(|value| unsafe { CStr::from_ptr(value) }); + + match (key, value) { + (None, _) => None, + (Some(key), None) => { + Some((String::from_utf8_lossy(key.to_bytes()).to_string(), None)) + } + (Some(key), Some(value)) => Some(( + String::from_utf8_lossy(key.to_bytes()).to_string(), + Some(String::from_utf8_lossy(value.to_bytes()).to_string()), + )), + } + }) + } +} + +impl From<&FFmpegDictionary> for FFmpegMetadata { + fn from(dict: &FFmpegDictionary) -> Self { + let mut media_metadata = Self::default(); + + for (key, value) in dict { + if let Some(value) = value { + match key.as_str() { + "album" => media_metadata.album = Some(value.clone()), + "album_artist" => media_metadata.album_artist = Some(value.clone()), + "artist" => media_metadata.artist = Some(value.clone()), + "comment" => media_metadata.comment = Some(value.clone()), + "composer" => media_metadata.composer = Some(value.clone()), + "copyright" => media_metadata.copyright = Some(value.clone()), + "creation_time" => { + if let Ok(creation_time) = DateTime::parse_from_rfc2822(&value) { + media_metadata.creation_time = Some(creation_time.into()); + } else if let Ok(creation_time) = DateTime::parse_from_rfc3339(&value) { + media_metadata.creation_time = Some(creation_time.into()); + } + } + "date" => { + if let Ok(date) = DateTime::parse_from_rfc2822(&value) { + media_metadata.date = Some(date.into()); + } else if let Ok(date) = DateTime::parse_from_rfc3339(&value) { + media_metadata.date = Some(date.into()); + } + } + "disc" => { + if let Ok(disc) = value.parse() { + media_metadata.disc = Some(disc); + } + } + "encoder" => media_metadata.encoder = Some(value.clone()), + "encoded_by" => media_metadata.encoded_by = Some(value.clone()), + "filename" => media_metadata.filename = Some(value.clone()), + "genre" => media_metadata.genre = Some(value.clone()), + "language" => media_metadata.language = Some(value.clone()), + "performer" => media_metadata.performer = Some(value.clone()), + "publisher" => media_metadata.publisher = Some(value.clone()), + "service_name" => media_metadata.service_name = Some(value.clone()), + "service_provider" => media_metadata.service_provider = Some(value.clone()), + "title" => media_metadata.title = Some(value.clone()), + "track" => { + if let Ok(track) = value.parse() { + media_metadata.track = Some(track); + } + } + "variant_bitrate" => { + if let Ok(variant_bit_rate) = value.parse() { + media_metadata.variant_bit_rate = Some(variant_bit_rate); + } + } + _ => { + media_metadata.custom.insert(key.clone(), value.clone()); + } + } + } + } + + media_metadata + } +} + +impl From for FFmpegMetadata { + fn from(dict: FFmpegDictionary) -> Self { + (&dict).into() + } +} diff --git a/crates/ffmpeg/src/error.rs b/crates/ffmpeg/src/error.rs index f399d3e92..57ef20e26 100644 --- a/crates/ffmpeg/src/error.rs +++ b/crates/ffmpeg/src/error.rs @@ -1,5 +1,9 @@ -use std::path::PathBuf; -use std::{ffi::c_int, num::TryFromIntError}; +use sd_utils::error::FileIOError; +use std::{ + ffi::{c_int, NulError}, + num::TryFromIntError, + path::{Path, PathBuf}, +}; use thiserror::Error; use tokio::task::JoinError; @@ -16,43 +20,48 @@ use ffmpeg_sys_next::{ /// Error type for the library. #[derive(Error, Debug)] pub enum Error { - #[error("I/O Error: {0}")] - Io(#[from] std::io::Error), + #[error("Background task failed: {0}")] + BackgroundTaskFailed(#[from] JoinError), + #[error("the video is most likely corrupt and will be skipped: ", .0.display())] + CorruptVideo(Box), + #[error("Received an invalid quality, expected range [0.0, 100.0], received: {0}")] + InvalidQuality(f32), + #[error("Received an invalid seek percentage: {0}")] + InvalidSeekPercentage(f32), + #[error("Error while casting an integer to another integer type")] + IntCastError(#[from] TryFromIntError), + #[error("Duration for video stream is unavailable")] + NoVideoDuration, + #[error("Failed to allocate C data: {0}")] + NulError(#[from] NulError), #[error("Path conversion error: Path: {0:#?}")] PathConversion(PathBuf), #[error("FFmpeg internal error: {0}")] - Ffmpeg(#[from] FfmpegError), + FFmpeg(#[from] FFmpegError), #[error("FFmpeg internal error: {0}; Reason: {1}")] - FfmpegWithReason(FfmpegError, String), + FFmpegWithReason(FFmpegError, String), #[error("Failed to decode video frame")] FrameDecodeError, #[error("Failed to seek video")] SeekError, #[error("Seek not allowed")] SeekNotAllowed, - #[error("Received an invalid seek percentage: {0}")] - InvalidSeekPercentage(f32), - #[error("Received an invalid quality, expected range [0.0, 100.0], received: {0}")] - InvalidQuality(f32), - #[error("Background task failed: {0}")] - BackgroundTaskFailed(#[from] JoinError), - #[error("The video is most likely corrupt and will be skipped")] - CorruptVideo, - #[error("Error while casting an integer to another integer type")] - IntCastError(#[from] TryFromIntError), + + #[error(transparent)] + FileIO(#[from] FileIOError), } /// Enum to represent possible errors from `FFmpeg` library /// /// Extracted from #[derive(Error, Debug)] -pub enum FfmpegError { +pub enum FFmpegError { #[error("Bitstream filter not found")] BitstreamFilterNotFound, - #[error("Internal bug, also see AVERROR_BUG2")] - InternalBug, #[error("Buffer too small")] BufferTooSmall, + #[error("Context allocation error")] + ContextAllocation, #[error("Decoder not found")] DecoderNotFound, #[error("Demuxer not found")] @@ -69,6 +78,8 @@ pub enum FfmpegError { FilterNotFound, #[error("Invalid data found when processing input")] InvalidData, + #[error("Internal bug, also see AVERROR_BUG2")] + InternalBug, #[error("Muxer not found")] MuxerNotFound, #[error("Option not found")] @@ -111,9 +122,13 @@ pub enum FfmpegError { FilterGraphAllocation, #[error("Codec Open Error")] CodecOpen, + #[error("Data not found")] + NullError, + #[error("Resource temporarily unavailable")] + Again, } -impl From for FfmpegError { +impl From for FFmpegError { fn from(code: c_int) -> Self { match code { AVERROR_BSF_NOT_FOUND => Self::BitstreamFilterNotFound, diff --git a/crates/ffmpeg/src/film_strip.rs b/crates/ffmpeg/src/film_strip.rs deleted file mode 100644 index b186e5095..000000000 --- a/crates/ffmpeg/src/film_strip.rs +++ /dev/null @@ -1,693 +0,0 @@ -use crate::video_frame::VideoFrame; - -static FILM_STRIP_4: [u8; 4 * 4 * 3] = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 135, 135, 135, 55, 55, 55, 0, 0, 0, - 159, 159, 159, 195, 195, 195, 82, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -]; - -static FILM_STRIP_8: [u8; 8 * 8 * 3] = [ - 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, 32, 32, 32, 55, 55, 55, 58, - 58, 58, 58, 58, 58, 52, 52, 52, 1, 1, 1, 0, 0, 0, 2, 2, 2, 133, 133, 133, 208, 208, 208, 219, - 219, 219, 219, 219, 219, 203, 203, 203, 26, 26, 26, 0, 0, 0, 2, 2, 2, 158, 158, 158, 240, 240, - 240, 251, 251, 251, 251, 251, 251, 235, 235, 235, 31, 31, 31, 0, 0, 0, 0, 0, 0, 70, 70, 70, - 115, 115, 115, 121, 121, 121, 121, 121, 121, 110, 110, 110, 2, 2, 2, 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, -]; - -static FILM_STRIP_16: [u8; 16 * 16 * 3] = [ - 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, - 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, 9, 9, 9, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 56, 56, 89, 89, 89, 114, 114, 114, 124, 124, 124, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 122, 122, 122, 109, 109, 109, 19, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 9, 9, 9, 89, 89, 89, 140, 140, 140, 175, 175, 175, 190, 190, 190, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 193, 193, 193, 187, 187, 187, 168, 168, 168, 64, 64, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 113, 113, 113, 175, 175, 175, 214, 214, 214, 231, 231, - 231, 235, 235, 235, 236, 236, 236, 236, 236, 236, 235, 235, 235, 228, 228, 228, 207, 207, 207, - 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 123, 123, 123, 188, 188, 188, 229, - 229, 229, 245, 245, 245, 250, 250, 250, 251, 251, 251, 251, 251, 251, 249, 249, 249, 243, 243, - 243, 221, 221, 221, 86, 86, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 120, 120, 120, - 184, 184, 184, 224, 224, 224, 241, 241, 241, 245, 245, 245, 246, 246, 246, 246, 246, 246, 245, - 245, 245, 238, 238, 238, 217, 217, 217, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, - 1, 103, 103, 103, 160, 160, 160, 198, 198, 198, 214, 214, 214, 218, 218, 218, 220, 220, 220, - 220, 220, 220, 218, 218, 218, 212, 212, 212, 191, 191, 191, 34, 34, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 26, 26, 26, 32, 32, 32, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 35, 35, 35, 10, 10, 10, 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, 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, -]; - -static FILM_STRIP_32: [u8; 32 * 32 * 3] = [ - 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, - 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, - 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, - 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, - 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, - 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, - 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, 11, 11, 11, - 23, 23, 23, 28, 28, 28, 32, 32, 32, 34, 34, 34, 36, 36, 36, 37, 37, 37, 37, 37, 37, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 35, 35, 35, - 29, 29, 29, 3, 3, 3, 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, 28, 28, 28, 54, 54, 54, 69, 69, 69, 83, 83, 83, 93, 93, 93, - 101, 101, 101, 105, 105, 105, 108, 108, 108, 109, 109, 109, 111, 111, 111, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 109, 109, 109, 107, 107, 107, 103, 103, - 103, 97, 97, 97, 88, 88, 88, 13, 13, 13, 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, 11, 11, 11, 54, 54, 54, 74, 74, 74, 93, 93, 93, 110, 110, - 110, 124, 124, 124, 133, 133, 133, 139, 139, 139, 143, 143, 143, 144, 144, 144, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 145, 145, 145, 144, 144, 144, 141, - 141, 141, 136, 136, 136, 129, 129, 129, 118, 118, 118, 88, 88, 88, 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, 23, 23, 23, 69, 69, 69, 93, 93, - 93, 117, 117, 117, 138, 138, 138, 154, 154, 154, 165, 165, 165, 172, 172, 172, 176, 176, 176, - 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 178, - 178, 178, 177, 177, 177, 174, 174, 174, 170, 170, 170, 161, 161, 161, 146, 146, 146, 128, 128, - 128, 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, - 28, 28, 28, 82, 82, 82, 110, 110, 110, 138, 138, 138, 162, 162, 162, 180, 180, 180, 192, 192, - 192, 200, 200, 200, 204, 204, 204, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 205, 205, 205, 202, 202, 202, 197, 197, 197, 187, - 187, 187, 172, 172, 172, 151, 151, 151, 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, 32, 32, 32, 92, 92, 92, 124, 124, 124, 154, 154, 154, 180, - 180, 180, 199, 199, 199, 212, 212, 212, 220, 220, 220, 225, 225, 225, 226, 226, 226, 227, 227, - 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 227, 227, 227, 226, 226, 226, - 223, 223, 223, 217, 217, 217, 207, 207, 207, 191, 191, 191, 168, 168, 168, 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, 34, 34, 34, 100, 100, 100, - 134, 134, 134, 165, 165, 165, 192, 192, 192, 212, 212, 212, 226, 226, 226, 234, 234, 234, 238, - 238, 238, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241, 241, 240, 240, 240, 236, 236, 236, 230, 230, 230, 220, 220, 220, 203, 203, 203, - 180, 180, 180, 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, 36, 36, 36, 104, 104, 104, 138, 138, 138, 171, 171, 171, 199, 199, 199, 219, 219, 219, - 233, 233, 233, 240, 240, 240, 245, 245, 245, 247, 247, 247, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 247, 247, 247, 246, 246, 246, 243, 243, 243, 237, 237, - 237, 227, 227, 227, 210, 210, 210, 186, 186, 186, 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, 36, 36, 36, 105, 105, 105, 140, 140, 140, 173, - 173, 173, 201, 201, 201, 222, 222, 222, 235, 235, 235, 243, 243, 243, 248, 248, 248, 250, 250, - 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 250, 250, 250, - 249, 249, 249, 246, 246, 246, 240, 240, 240, 229, 229, 229, 212, 212, 212, 188, 188, 188, 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, 36, 36, 36, - 104, 104, 104, 138, 138, 138, 171, 171, 171, 199, 199, 199, 219, 219, 219, 233, 233, 233, 240, - 240, 240, 245, 245, 245, 247, 247, 247, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 247, 247, 247, 246, 246, 246, 243, 243, 243, 237, 237, 237, 227, 227, 227, - 210, 210, 210, 186, 186, 186, 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, 34, 34, 34, 100, 100, 100, 134, 134, 134, 165, 165, 165, 192, 192, 192, - 212, 212, 212, 226, 226, 226, 234, 234, 234, 238, 238, 238, 240, 240, 240, 241, 241, 241, 241, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 240, 236, 236, - 236, 230, 230, 230, 220, 220, 220, 203, 203, 203, 180, 180, 180, 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, 19, 19, 19, 92, 92, 92, 124, 124, - 124, 154, 154, 154, 180, 180, 180, 200, 200, 200, 212, 212, 212, 220, 220, 220, 225, 225, 225, - 226, 226, 226, 227, 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 227, - 227, 227, 226, 226, 226, 223, 223, 223, 217, 217, 217, 207, 207, 207, 191, 191, 191, 146, 146, - 146, 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, 59, 59, 59, 110, 110, 110, 138, 138, 138, 162, 162, 162, 180, 180, 180, 193, 193, 193, - 200, 200, 200, 204, 204, 204, 206, 206, 206, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, - 208, 208, 208, 208, 208, 207, 207, 207, 205, 205, 205, 203, 203, 203, 197, 197, 197, 187, 187, - 187, 172, 172, 172, 27, 27, 27, 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, 27, 27, 27, 58, 58, 58, 69, 69, 69, 77, 77, 77, - 83, 83, 83, 86, 86, 86, 88, 88, 88, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 87, 85, 85, 85, 70, 70, 70, 8, 8, 8, 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, 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, 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, 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, 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, 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, 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, -]; - -static FILM_STRIP_64: [u8; 64 * 64 * 3] = [ - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, - 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, 16, 16, 16, 34, 34, 34, 47, - 47, 47, 54, 54, 54, 59, 59, 59, 64, 64, 64, 68, 68, 68, 72, 72, 72, 75, 75, 75, 77, 77, 77, 79, - 79, 79, 81, 81, 81, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 82, 81, 81, 81, 79, 79, 79, 77, 77, 77, 72, - 72, 72, 57, 57, 57, 30, 30, 30, 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, 3, 3, 3, 30, 30, 30, 46, 46, - 46, 52, 52, 52, 59, 59, 59, 66, 66, 66, 72, 72, 72, 78, 78, 78, 82, 82, 82, 87, 87, 87, 90, 90, - 90, 93, 93, 93, 95, 95, 95, 97, 97, 97, 98, 98, 98, 99, 99, 99, 100, 100, 100, 100, 100, 100, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 100, 100, 100, 100, 100, - 100, 99, 99, 99, 98, 98, 98, 97, 97, 97, 95, 95, 95, 93, 93, 93, 90, 90, 90, 87, 87, 87, 82, - 82, 82, 61, 61, 61, 8, 8, 8, 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, 30, 30, 30, 47, 47, 47, 55, 55, 55, 63, 63, 63, - 71, 71, 71, 78, 78, 78, 86, 86, 86, 92, 92, 92, 98, 98, 98, 103, 103, 103, 107, 107, 107, 110, - 110, 110, 112, 112, 112, 114, 114, 114, 116, 116, 116, 117, 117, 117, 118, 118, 118, 118, 118, - 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 118, 118, 118, 118, - 118, 118, 117, 117, 117, 116, 116, 116, 114, 114, 114, 113, 113, 113, 110, 110, 110, 107, 107, - 107, 103, 103, 103, 98, 98, 98, 92, 92, 92, 67, 67, 67, 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, 16, 16, 16, 46, 46, 46, 54, 54, - 54, 64, 64, 64, 73, 73, 73, 82, 82, 82, 91, 91, 91, 99, 99, 99, 106, 106, 106, 113, 113, 113, - 118, 118, 118, 123, 123, 123, 126, 126, 126, 129, 129, 129, 131, 131, 131, 133, 133, 133, 134, - 134, 134, 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 135, 135, 135, 135, 135, 135, 134, 134, 134, 133, 133, 133, 131, 131, 131, 129, - 129, 129, 126, 126, 126, 123, 123, 123, 118, 118, 118, 113, 113, 113, 106, 106, 106, 99, 99, - 99, 41, 41, 41, 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, 34, 34, 34, 52, 52, 52, 62, 62, 62, 73, 73, 73, 83, 83, 83, 94, 94, 94, 104, - 104, 104, 113, 113, 113, 121, 121, 121, 128, 128, 128, 134, 134, 134, 139, 139, 139, 143, 143, - 143, 146, 146, 146, 149, 149, 149, 150, 150, 150, 152, 152, 152, 152, 152, 152, 153, 153, 153, - 153, 153, 153, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 152, 152, 152, 150, 150, 150, 149, 149, 149, 146, 146, 146, 143, 143, 143, 139, 139, 139, - 134, 134, 134, 128, 128, 128, 121, 121, 121, 113, 113, 113, 82, 82, 82, 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, 47, 47, 47, 59, 59, 59, - 71, 71, 71, 82, 82, 82, 94, 94, 94, 105, 105, 105, 116, 116, 116, 126, 126, 126, 135, 135, 135, - 143, 143, 143, 150, 150, 150, 155, 155, 155, 159, 159, 159, 163, 163, 163, 165, 165, 165, 167, - 167, 167, 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 170, 170, 170, 170, 170, 170, 169, 169, 169, 169, 169, 169, 167, 167, 167, 165, - 165, 165, 163, 163, 163, 160, 160, 160, 155, 155, 155, 150, 150, 150, 143, 143, 143, 135, 135, - 135, 126, 126, 126, 111, 111, 111, 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, 54, 54, 54, 66, 66, 66, 78, 78, 78, 91, 91, 91, 104, 104, 104, - 116, 116, 116, 128, 128, 128, 139, 139, 139, 148, 148, 148, 157, 157, 157, 164, 164, 164, 169, - 169, 169, 174, 174, 174, 178, 178, 178, 180, 180, 180, 182, 182, 182, 183, 183, 183, 184, 184, - 184, 185, 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 185, - 185, 185, 184, 184, 184, 184, 184, 184, 182, 182, 182, 180, 180, 180, 178, 178, 178, 174, 174, - 174, 170, 170, 170, 164, 164, 164, 157, 157, 157, 148, 148, 148, 139, 139, 139, 128, 128, 128, - 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, - 59, 59, 59, 72, 72, 72, 85, 85, 85, 99, 99, 99, 113, 113, 113, 126, 126, 126, 139, 139, 139, - 150, 150, 150, 161, 161, 161, 169, 169, 169, 177, 177, 177, 183, 183, 183, 188, 188, 188, 191, - 191, 191, 194, 194, 194, 196, 196, 196, 197, 197, 197, 198, 198, 198, 199, 199, 199, 199, 199, - 199, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 199, 199, 199, 198, 198, 198, 198, - 198, 198, 196, 196, 196, 194, 194, 194, 191, 191, 191, 188, 188, 188, 183, 183, 183, 177, 177, - 177, 169, 169, 169, 161, 161, 161, 150, 150, 150, 139, 139, 139, 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, 64, 64, 64, 77, 77, 77, 92, 92, - 92, 106, 106, 106, 121, 121, 121, 135, 135, 135, 149, 149, 149, 161, 161, 161, 172, 172, 172, - 181, 181, 181, 189, 189, 189, 195, 195, 195, 200, 200, 200, 204, 204, 204, 207, 207, 207, 209, - 209, 209, 210, 210, 210, 211, 211, 211, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 212, 212, 212, 211, 211, 211, 210, 210, 210, 209, 209, 209, 207, - 207, 207, 204, 204, 204, 200, 200, 200, 195, 195, 195, 189, 189, 189, 181, 181, 181, 172, 172, - 172, 161, 161, 161, 149, 149, 149, 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, 68, 68, 68, 82, 82, 82, 97, 97, 97, 113, 113, 113, 128, 128, - 128, 143, 143, 143, 157, 157, 157, 170, 170, 170, 181, 181, 181, 190, 190, 190, 199, 199, 199, - 205, 205, 205, 210, 210, 210, 214, 214, 214, 217, 217, 217, 219, 219, 219, 220, 220, 220, 221, - 221, 221, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, - 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, - 222, 222, 222, 221, 221, 221, 220, 220, 220, 219, 219, 219, 217, 217, 217, 214, 214, 214, 210, - 210, 210, 205, 205, 205, 199, 199, 199, 191, 191, 191, 181, 181, 181, 170, 170, 170, 157, 157, - 157, 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, 72, 72, 72, 87, 87, 87, 102, 102, 102, 118, 118, 118, 134, 134, 134, 150, 150, 150, 164, - 164, 164, 177, 177, 177, 189, 189, 189, 198, 198, 198, 207, 207, 207, 213, 213, 213, 218, 218, - 218, 222, 222, 222, 225, 225, 225, 227, 227, 227, 229, 229, 229, 229, 229, 229, 230, 230, 230, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 230, 230, 230, 230, 230, - 230, 229, 229, 229, 227, 227, 227, 225, 225, 225, 222, 222, 222, 218, 218, 218, 213, 213, 213, - 207, 207, 207, 198, 198, 198, 189, 189, 189, 177, 177, 177, 164, 164, 164, 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, 75, 75, 75, 90, 90, 90, - 106, 106, 106, 123, 123, 123, 139, 139, 139, 155, 155, 155, 170, 170, 170, 183, 183, 183, 195, - 195, 195, 205, 205, 205, 213, 213, 213, 220, 220, 220, 225, 225, 225, 229, 229, 229, 232, 232, - 232, 234, 234, 234, 236, 236, 236, 236, 236, 236, 237, 237, 237, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 237, 237, 237, 237, 237, 237, 236, 236, 236, 234, 234, - 234, 232, 232, 232, 229, 229, 229, 225, 225, 225, 220, 220, 220, 213, 213, 213, 205, 205, 205, - 195, 195, 195, 183, 183, 183, 170, 170, 170, 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, 77, 77, 77, 93, 93, 93, 109, 109, 109, 126, 126, 126, - 143, 143, 143, 159, 159, 159, 174, 174, 174, 188, 188, 188, 200, 200, 200, 210, 210, 210, 218, - 218, 218, 225, 225, 225, 230, 230, 230, 234, 234, 234, 237, 237, 237, 239, 239, 239, 241, 241, - 241, 242, 242, 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 242, 242, 242, 242, 242, 242, 241, 241, 241, 239, 239, 239, 237, 237, 237, 234, 234, - 234, 230, 230, 230, 225, 225, 225, 218, 218, 218, 210, 210, 210, 200, 200, 200, 188, 188, 188, - 174, 174, 174, 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, 78, 78, 78, 94, 94, 94, 111, 111, 111, 128, 128, 128, 145, 145, 145, 162, 162, 162, - 177, 177, 177, 191, 191, 191, 203, 203, 203, 213, 213, 213, 221, 221, 221, 228, 228, 228, 233, - 233, 233, 237, 237, 237, 240, 240, 240, 242, 242, 242, 244, 244, 244, 245, 245, 245, 245, 245, - 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, - 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 245, 245, 245, 245, - 245, 245, 244, 244, 244, 242, 242, 242, 240, 240, 240, 237, 237, 237, 233, 233, 233, 228, 228, - 228, 221, 221, 221, 213, 213, 213, 203, 203, 203, 191, 191, 191, 177, 177, 177, 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, 80, 80, 80, 96, - 96, 96, 113, 113, 113, 130, 130, 130, 147, 147, 147, 164, 164, 164, 179, 179, 179, 193, 193, - 193, 205, 205, 205, 215, 215, 215, 224, 224, 224, 230, 230, 230, 236, 236, 236, 239, 239, 239, - 242, 242, 242, 244, 244, 244, 246, 246, 246, 247, 247, 247, 247, 247, 247, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 247, 247, 247, 247, 247, 247, 246, 246, 246, - 244, 244, 244, 242, 242, 242, 240, 240, 240, 236, 236, 236, 230, 230, 230, 224, 224, 224, 215, - 215, 215, 205, 205, 205, 193, 193, 193, 179, 179, 179, 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, 80, 80, 80, 96, 96, 96, 113, 113, 113, - 131, 131, 131, 148, 148, 148, 165, 165, 165, 180, 180, 180, 194, 194, 194, 206, 206, 206, 217, - 217, 217, 225, 225, 225, 232, 232, 232, 237, 237, 237, 241, 241, 241, 244, 244, 244, 246, 246, - 246, 248, 248, 248, 249, 249, 249, 249, 249, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 249, 249, 249, 249, 249, 249, 248, 248, 248, 246, 246, 246, 244, 244, - 244, 241, 241, 241, 237, 237, 237, 232, 232, 232, 225, 225, 225, 217, 217, 217, 206, 206, 206, - 194, 194, 194, 180, 180, 180, 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, 80, 80, 80, 96, 96, 96, 113, 113, 113, 131, 131, 131, 148, 148, 148, - 165, 165, 165, 180, 180, 180, 194, 194, 194, 206, 206, 206, 217, 217, 217, 225, 225, 225, 232, - 232, 232, 237, 237, 237, 241, 241, 241, 244, 244, 244, 246, 246, 246, 248, 248, 248, 249, 249, - 249, 249, 249, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 249, - 249, 249, 249, 249, 249, 248, 248, 248, 246, 246, 246, 244, 244, 244, 241, 241, 241, 237, 237, - 237, 232, 232, 232, 225, 225, 225, 217, 217, 217, 206, 206, 206, 194, 194, 194, 180, 180, 180, - 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, - 80, 80, 80, 96, 96, 96, 113, 113, 113, 130, 130, 130, 147, 147, 147, 164, 164, 164, 179, 179, - 179, 193, 193, 193, 205, 205, 205, 215, 215, 215, 224, 224, 224, 230, 230, 230, 236, 236, 236, - 239, 239, 239, 242, 242, 242, 244, 244, 244, 246, 246, 246, 247, 247, 247, 247, 247, 247, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 247, 247, 247, 247, 247, 247, - 246, 246, 246, 244, 244, 244, 242, 242, 242, 240, 240, 240, 236, 236, 236, 230, 230, 230, 224, - 224, 224, 215, 215, 215, 205, 205, 205, 193, 193, 193, 179, 179, 179, 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, 78, 78, 78, 94, 94, 94, - 111, 111, 111, 128, 128, 128, 145, 145, 145, 162, 162, 162, 177, 177, 177, 191, 191, 191, 203, - 203, 203, 213, 213, 213, 221, 221, 221, 228, 228, 228, 233, 233, 233, 237, 237, 237, 240, 240, - 240, 242, 242, 242, 244, 244, 244, 245, 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, - 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, - 246, 246, 246, 246, 246, 246, 246, 246, 245, 245, 245, 245, 245, 245, 244, 244, 244, 242, 242, - 242, 240, 240, 240, 237, 237, 237, 233, 233, 233, 228, 228, 228, 221, 221, 221, 213, 213, 213, - 203, 203, 203, 191, 191, 191, 177, 177, 177, 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, 77, 77, 77, 93, 93, 93, 109, 109, 109, 126, 126, 126, - 143, 143, 143, 159, 159, 159, 174, 174, 174, 188, 188, 188, 200, 200, 200, 210, 210, 210, 218, - 218, 218, 225, 225, 225, 230, 230, 230, 234, 234, 234, 237, 237, 237, 239, 239, 239, 241, 241, - 241, 242, 242, 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 242, 242, 242, 242, 242, 242, 241, 241, 241, 239, 239, 239, 237, 237, 237, 234, 234, - 234, 230, 230, 230, 225, 225, 225, 218, 218, 218, 210, 210, 210, 200, 200, 200, 188, 188, 188, - 174, 174, 174, 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, 72, 72, 72, 90, 90, 90, 106, 106, 106, 123, 123, 123, 139, 139, 139, 155, 155, 155, - 170, 170, 170, 183, 183, 183, 195, 195, 195, 205, 205, 205, 213, 213, 213, 220, 220, 220, 225, - 225, 225, 229, 229, 229, 232, 232, 232, 234, 234, 234, 236, 236, 236, 236, 236, 236, 237, 237, - 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 237, 237, 237, 237, - 237, 237, 236, 236, 236, 234, 234, 234, 232, 232, 232, 229, 229, 229, 225, 225, 225, 220, 220, - 220, 213, 213, 213, 205, 205, 205, 195, 195, 195, 183, 183, 183, 163, 163, 163, 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, 57, 57, 57, 87, - 87, 87, 102, 102, 102, 118, 118, 118, 134, 134, 134, 150, 150, 150, 164, 164, 164, 177, 177, - 177, 189, 189, 189, 198, 198, 198, 207, 207, 207, 213, 213, 213, 218, 218, 218, 222, 222, 222, - 225, 225, 225, 227, 227, 227, 229, 229, 229, 229, 229, 229, 230, 230, 230, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 230, 230, 230, 230, 230, 230, 229, 229, 229, - 227, 227, 227, 225, 225, 225, 222, 222, 222, 218, 218, 218, 213, 213, 213, 207, 207, 207, 198, - 198, 198, 189, 189, 189, 177, 177, 177, 129, 129, 129, 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, 30, 30, 30, 82, 82, 82, 97, 97, 97, 113, - 113, 113, 128, 128, 128, 143, 143, 143, 157, 157, 157, 170, 170, 170, 181, 181, 181, 191, 191, - 191, 199, 199, 199, 205, 205, 205, 210, 210, 210, 214, 214, 214, 217, 217, 217, 219, 219, 219, - 220, 220, 220, 221, 221, 221, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, - 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, - 223, 223, 223, 223, 222, 222, 222, 221, 221, 221, 221, 221, 221, 219, 219, 219, 217, 217, 217, - 214, 214, 214, 210, 210, 210, 205, 205, 205, 199, 199, 199, 191, 191, 191, 181, 181, 181, 170, - 170, 170, 71, 71, 71, 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, 61, 61, 61, 92, 92, 92, 106, 106, 106, 121, 121, 121, 135, 135, - 135, 149, 149, 149, 161, 161, 161, 172, 172, 172, 181, 181, 181, 189, 189, 189, 195, 195, 195, - 200, 200, 200, 204, 204, 204, 207, 207, 207, 209, 209, 209, 210, 210, 210, 211, 211, 211, 212, - 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 212, 212, 212, - 211, 211, 211, 210, 210, 210, 209, 209, 209, 207, 207, 207, 204, 204, 204, 200, 200, 200, 195, - 195, 195, 189, 189, 189, 181, 181, 181, 172, 172, 172, 126, 126, 126, 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, 8, 8, 8, - 67, 67, 67, 99, 99, 99, 113, 113, 113, 126, 126, 126, 139, 139, 139, 151, 151, 151, 161, 161, - 161, 170, 170, 170, 177, 177, 177, 184, 184, 184, 188, 188, 188, 192, 192, 192, 195, 195, 195, - 197, 197, 197, 198, 198, 198, 199, 199, 199, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, - 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 200, 200, 200, 200, 200, 200, 199, 199, 199, 198, 198, 198, 197, 197, 197, - 195, 195, 195, 192, 192, 192, 189, 189, 189, 184, 184, 184, 178, 178, 178, 170, 170, 170, 126, - 126, 126, 18, 18, 18, 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, 41, 41, 41, 82, 82, 82, 111, 111, 111, - 128, 128, 128, 139, 139, 139, 149, 149, 149, 157, 157, 157, 164, 164, 164, 170, 170, 170, 175, - 175, 175, 178, 178, 178, 181, 181, 181, 183, 183, 183, 184, 184, 184, 185, 185, 185, 186, 186, - 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 186, 186, 186, 186, 186, 186, 185, - 185, 185, 184, 184, 184, 183, 183, 183, 181, 181, 181, 178, 178, 178, 175, 175, 175, 163, 163, - 163, 129, 129, 129, 71, 71, 71, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, -]; - -struct FilmStrip { - width: u32, - height: u32, - strip: Option<&'static [u8]>, -} - -pub fn film_strip_filter(video_frame: &mut VideoFrame) { - let FilmStrip { - width, - height, - strip, - } = determine_film_strip(video_frame.width); - - if let Some(strip) = strip { - let mut frame_index = 0; - let mut film_hole_index = 0; - let offset = ((video_frame.width * 3) - 3) as usize; - - for i in 0..(video_frame.height as usize) { - for j in (0..(width as usize * 3)).step_by(3) { - let current_stripe_index = film_hole_index + j; - - video_frame.data[frame_index + j] = strip[current_stripe_index]; - video_frame.data[frame_index + j + 1] = strip[current_stripe_index + 1]; - video_frame.data[frame_index + j + 2] = strip[current_stripe_index + 2]; - - video_frame.data[frame_index + offset - j] = strip[current_stripe_index]; - video_frame.data[frame_index + offset - j + 1] = strip[current_stripe_index + 1]; - video_frame.data[frame_index + offset - j + 2] = strip[current_stripe_index + 2]; - } - - frame_index += video_frame.line_size as usize; - film_hole_index = (i % height as usize) * width as usize * 3; - } - } -} - -fn determine_film_strip(video_width: u32) -> FilmStrip { - match video_width { - // We consider that the smallest film strip is 4, doubling it for each side, we have 8 pixels - 0..=8 => FilmStrip { - width: 0, - height: 0, - strip: None, - }, - 9..=96 => FilmStrip { - width: 4, - height: 4, - strip: Some(&FILM_STRIP_4), - }, - 97..=192 => FilmStrip { - width: 8, - height: 8, - strip: Some(&FILM_STRIP_8), - }, - 193..=384 => FilmStrip { - width: 16, - height: 16, - strip: Some(&FILM_STRIP_16), - }, - 385..=768 => FilmStrip { - width: 32, - height: 32, - strip: Some(&FILM_STRIP_32), - }, - _ => FilmStrip { - width: 64, - height: 64, - strip: Some(&FILM_STRIP_64), - }, - } -} diff --git a/crates/ffmpeg/src/filter_graph.rs b/crates/ffmpeg/src/filter_graph.rs new file mode 100644 index 000000000..05672a762 --- /dev/null +++ b/crates/ffmpeg/src/filter_graph.rs @@ -0,0 +1,256 @@ +use std::{ + ffi::{CStr, CString}, + ptr, +}; + +use crate::{ + codec_ctx::FFmpegCodecContext, error::FFmpegError, frame_decoder::ThumbnailSize, + utils::check_error, Error, +}; +use ffmpeg_sys_next::{ + avfilter_get_by_name, avfilter_graph_alloc, avfilter_graph_config, + avfilter_graph_create_filter, avfilter_graph_free, avfilter_link, AVFilterContext, + AVFilterGraph, AVRational, +}; + +pub struct FFmpegFilterGraph(*mut AVFilterGraph); + +impl<'a> FFmpegFilterGraph { + pub(crate) fn new() -> Result { + let ptr = unsafe { avfilter_graph_alloc() }; + if ptr.is_null() { + return Err(FFmpegError::FrameAllocation); + } + Ok(Self(ptr)) + } + + fn link( + src: *mut AVFilterContext, + src_pad: u32, + dst: *mut AVFilterContext, + dst_pad: u32, + error: &str, + ) -> Result<(), Error> { + check_error(unsafe { avfilter_link(src, src_pad, dst, dst_pad) }, error)?; + Ok(()) + } + + pub(crate) fn thumbnail_graph( + size: Option, + time_base: &AVRational, + codec_ctx: &FFmpegCodecContext, + interlaced_frame: bool, + pixel_aspect_ratio: AVRational, + maintain_aspect_ratio: bool, + ) -> Result<(Self, &'a mut AVFilterContext, &'a mut AVFilterContext), Error> { + let mut filter_graph = Self::new()?; + + let args = format!( + "video_size={}x{}:pix_fmt={}:time_base={}/{}:pixel_aspect={}/{}", + codec_ctx.as_ref().width, + codec_ctx.as_ref().height, + // AVPixelFormat is an i32 enum, so it's safe to cast it to i32 + codec_ctx.as_ref().pix_fmt as i32, + time_base.num, + time_base.den, + codec_ctx.as_ref().sample_aspect_ratio.num, + i32::max(codec_ctx.as_ref().sample_aspect_ratio.den, 1) + ); + + let mut filter_source = ptr::null_mut(); + filter_graph.setup_filter( + &mut filter_source, + c"buffer", + c"thumb_buffer", + Some(CString::new(args)?.as_c_str()), + "Failed to create filter source", + )?; + let filter_source_ctx = unsafe { filter_source.as_mut() }.ok_or(FFmpegError::NullError)?; + + let mut filter_sink = ptr::null_mut(); + filter_graph.setup_filter( + &mut filter_sink, + c"buffersink", + c"thumb_buffersink", + None, + "Failed to create filter sink", + )?; + let filter_sink_ctx = unsafe { filter_sink.as_mut() }.ok_or(FFmpegError::NullError)?; + + let mut yadif_filter = ptr::null_mut(); + if interlaced_frame { + filter_graph.setup_filter( + &mut yadif_filter, + c"yadif", + c"thumb_deint", + Some(c"deint=1"), + "Failed to create de-interlace filter", + )?; + } + + let mut scale_filter = ptr::null_mut(); + filter_graph.setup_filter( + &mut scale_filter, + c"scale", + c"thumb_scale", + Some( + CString::new(thumb_scale_filter_args( + size, + codec_ctx, + pixel_aspect_ratio, + maintain_aspect_ratio, + ))? + .as_c_str(), + ), + "Failed to create scale filter", + )?; + + let mut format_filter = ptr::null_mut(); + filter_graph.setup_filter( + &mut format_filter, + c"format", + c"thumb_format", + Some(c"pix_fmts=rgb24"), + "Failed to create format filter", + )?; + + Self::link( + format_filter, + 0, + filter_sink_ctx, + 0, + "Failed to link final filter", + )?; + + Self::link( + scale_filter, + 0, + format_filter, + 0, + "Failed to link scale filter", + )?; + + if !yadif_filter.is_null() { + Self::link( + yadif_filter, + 0, + scale_filter, + 0, + "Failed to link yadif filter", + )?; + } + + Self::link( + filter_source_ctx, + 0, + if yadif_filter.is_null() { + scale_filter + } else { + yadif_filter + }, + 0, + "Failed to link source filter", + )?; + + filter_graph.config()?; + + Ok((filter_graph, filter_source_ctx, filter_sink_ctx)) + } + + pub(crate) fn as_mut(&mut self) -> &mut AVFilterGraph { + unsafe { self.0.as_mut() }.expect("initialized on struct creation") + } + + fn setup_filter( + &mut self, + filter_ctx: *mut *mut AVFilterContext, + filter_name: &CStr, + filter_setup_name: &CStr, + args: Option<&CStr>, + error_message: &str, + ) -> Result<(), Error> { + check_error( + unsafe { + avfilter_graph_create_filter( + filter_ctx, + avfilter_get_by_name(filter_name.as_ptr()), + filter_setup_name.as_ptr(), + args.map_or(ptr::null(), CStr::as_ptr), + ptr::null_mut(), + self.as_mut(), + ) + }, + error_message, + ) + } + + fn config(&mut self) -> Result<&mut Self, Error> { + check_error( + unsafe { avfilter_graph_config(self.as_mut(), ptr::null_mut()) }, + "Failed to configure filter graph", + )?; + + Ok(self) + } +} + +impl Drop for FFmpegFilterGraph { + fn drop(&mut self) { + if !self.0.is_null() { + unsafe { avfilter_graph_free(&mut self.0) }; + self.0 = ptr::null_mut(); + } + } +} + +fn thumb_scale_filter_args( + size: Option, + codec_ctx: &FFmpegCodecContext, + pixel_aspect_ratio: AVRational, + maintain_aspect_ratio: bool, +) -> String { + let (width, height) = match size { + Some(ThumbnailSize::Dimensions { width, height }) => (width, Some(height)), + Some(ThumbnailSize::Scale(width)) => (width, None), + None => return "w=0:h=0".to_string(), + }; + + let mut scale = String::new(); + + if let Some(height) = height { + scale.push_str(&format!("w={width}:h={height}")); + if maintain_aspect_ratio { + scale.push_str(":force_original_aspect_ratio=decrease"); + } + } else if !maintain_aspect_ratio { + scale.push_str(&format!("w={width}:h={width}")); + } else { + let size = width; + let mut width = codec_ctx.as_ref().width.unsigned_abs(); + let mut height = codec_ctx.as_ref().height.unsigned_abs(); + + // if the pixel aspect ratio is defined and is not 1, we have an anamorphic stream + if pixel_aspect_ratio.num != 0 && pixel_aspect_ratio.num != pixel_aspect_ratio.den { + width = (width * pixel_aspect_ratio.num.unsigned_abs()) + / pixel_aspect_ratio.den.unsigned_abs(); + + if size != 0 { + if height > width { + width = (width * size) / height; + height = size; + } else { + height = (height * size) / width; + width = size; + } + } + + scale.push_str(&format!("w={width}:h={height}")); + } else if height > width { + scale.push_str(&format!("w=-1:h={}", if size == 0 { height } else { size })); + } else { + scale.push_str(&format!("h=-1:w={}", if size == 0 { width } else { size })); + } + } + + scale +} diff --git a/crates/ffmpeg/src/format_ctx.rs b/crates/ffmpeg/src/format_ctx.rs new file mode 100644 index 000000000..4d10647e6 --- /dev/null +++ b/crates/ffmpeg/src/format_ctx.rs @@ -0,0 +1,427 @@ +use crate::{ + codec_ctx::FFmpegCodecContext, + dict::FFmpegDictionary, + error::{Error, FFmpegError}, + model::{FFmpegChapter, FFmpegMediaData, FFmpegMetadata, FFmpegProgram, FFmpegStream}, + utils::check_error, +}; + +use ffmpeg_sys_next::{ + av_cmp_q, av_display_rotation_get, av_read_frame, av_reduce, av_stream_get_side_data, + avformat_close_input, avformat_find_stream_info, avformat_open_input, AVChapter, AVCodecID, + AVDictionary, AVFormatContext, AVMediaType, AVPacket, AVPacketSideDataType, AVRational, + AVStream, AV_DISPOSITION_ATTACHED_PIC, AV_DISPOSITION_CAPTIONS, AV_DISPOSITION_CLEAN_EFFECTS, + AV_DISPOSITION_COMMENT, AV_DISPOSITION_DEFAULT, AV_DISPOSITION_DEPENDENT, + AV_DISPOSITION_DESCRIPTIONS, AV_DISPOSITION_DUB, AV_DISPOSITION_FORCED, + AV_DISPOSITION_HEARING_IMPAIRED, AV_DISPOSITION_KARAOKE, AV_DISPOSITION_LYRICS, + AV_DISPOSITION_METADATA, AV_DISPOSITION_NON_DIEGETIC, AV_DISPOSITION_ORIGINAL, + AV_DISPOSITION_STILL_IMAGE, AV_DISPOSITION_TIMED_THUMBNAILS, AV_DISPOSITION_VISUAL_IMPAIRED, + AV_NOPTS_VALUE, +}; + +use std::{collections::HashSet, ffi::CStr, ptr}; + +fn extract_name_and_convert_metadata( + metadata: *mut AVDictionary, +) -> (FFmpegMetadata, Option) { + let mut metadata = FFmpegDictionary::new(unsafe { metadata.as_mut() }); + let name = metadata.get(c"name"); + if name.is_some() { + let _ = metadata.remove(c"name"); + } + + (metadata.into(), name) +} + +#[derive(Debug)] +pub struct FFmpegFormatContext(*mut AVFormatContext); + +impl FFmpegFormatContext { + pub(crate) fn open_file(filename: &CStr) -> Result { + let mut ptr = ptr::null_mut(); + + check_error( + unsafe { + avformat_open_input(&mut ptr, filename.as_ptr(), ptr::null(), ptr::null_mut()) + }, + "Fail to open an input stream and read the header", + ) + .map(|()| Self(ptr)) + } + + pub(crate) fn as_ref(&self) -> &AVFormatContext { + unsafe { self.0.as_ref() }.expect("initialized on struct creation") + } + + pub(crate) fn as_mut(&mut self) -> &mut AVFormatContext { + unsafe { self.0.as_mut() }.expect("initialized on struct creation") + } + + pub(crate) fn duration(&self) -> Option { + let duration = self.as_ref().duration; + if duration == AV_NOPTS_VALUE { + return None; + } + + Some(duration) + } + + pub(crate) fn stream(&self, index: u32) -> Option<&mut AVStream> { + let streams = self.as_ref().streams; + if streams.is_null() { + return None; + } + + let Ok(index) = isize::try_from(index) else { + return None; + }; + + unsafe { (*(streams.offset(index))).as_mut() } + } + + pub(crate) fn get_stream_rotation_angle(&self, index: u32) -> f64 { + let Some(stream) = self.stream(index) else { + return 0.0; + }; + + /* + * This side data contains a 3x3 transformation matrix describing an affine transformation + * that needs to be applied to the decoded video frames for correct presentation. + * + * See libavutil/display.h for a detailed description of the data. + * https://github.com/FFmpeg/FFmpeg/blob/n6.1.1/libavutil/display.h#L32-L71 + * + * The pointer conversion is due to the fact that av_stream_get_side_data is a generic function that has no prior + * knowledge of the type of the side data it is retrieving. + */ + #[allow(clippy::cast_ptr_alignment)] + let matrix = (unsafe { + av_stream_get_side_data( + stream, + AVPacketSideDataType::AV_PKT_DATA_DISPLAYMATRIX, + ptr::null_mut(), + ) + } as *const i32); + + if matrix.is_null() { + 0.0 + } else { + unsafe { av_display_rotation_get(matrix) } + } + } + + pub(crate) fn read_frame(&mut self, packet: *mut AVPacket) -> Result<&mut Self, Error> { + check_error( + unsafe { av_read_frame(self.as_mut(), packet) }, + "Fail to read the next frame of a media file", + )?; + + Ok(self) + } + + pub(crate) fn find_stream_info(&mut self) -> Result<&mut Self, Error> { + check_error( + unsafe { avformat_find_stream_info(self.as_mut(), ptr::null_mut()) }, + "Fail to read packets of a media file to get stream information", + )?; + + Ok(self) + } + + pub(crate) fn find_preferred_video_stream( + &self, + prefer_embedded_metadata: bool, + ) -> Result<(bool, &mut AVStream), Error> { + let mut video_streams = vec![]; + let mut embedded_data_streams = vec![]; + + 'outer: for stream_idx in 0..self.as_ref().nb_streams { + let Some(stream) = self.stream(stream_idx) else { + continue; + }; + + let Some((codec_type, codec_id)) = unsafe { stream.codecpar.as_ref() } + .map(|codec_params| (codec_params.codec_type, codec_params.codec_id)) + else { + continue; + }; + + if codec_type != AVMediaType::AVMEDIA_TYPE_VIDEO { + continue; + } + + if !prefer_embedded_metadata + || !(codec_id == AVCodecID::AV_CODEC_ID_MJPEG + || codec_id == AVCodecID::AV_CODEC_ID_PNG) + { + video_streams.push(stream_idx); + continue; + } + + if let Some(metadata) = unsafe { stream.metadata.as_mut() } + .map(|metadata| FFmpegDictionary::new(Some(metadata))) + { + for (key, value) in &metadata { + if let Some(value) = value { + if key == "filename" && value.starts_with("cover.") { + embedded_data_streams.insert(0, stream_idx); + continue 'outer; + } + } + } + } + + embedded_data_streams.push(stream_idx); + } + + if prefer_embedded_metadata && !embedded_data_streams.is_empty() { + for stream_index in embedded_data_streams { + if let Some(stream) = self.stream(stream_index) { + return Ok((true, stream)); + } + } + } + + for stream_index in video_streams { + if let Some(stream) = self.stream(stream_index) { + return Ok((false, stream)); + } + } + + Err(FFmpegError::StreamNotFound)? + } + + fn formats(&self) -> Vec { + unsafe { self.as_ref().iformat.as_ref() } + .and_then(|format| unsafe { format.name.as_ref() }) + .map(|name| { + let cstr = unsafe { CStr::from_ptr(name) }; + String::from_utf8_lossy(cstr.to_bytes()) + .split(',') + .map(|entry| entry.trim().to_string()) + .filter(|entry| !entry.is_empty()) + .collect() + }) + .unwrap_or(vec![]) + } + + fn start_time(&self) -> Option { + let start_time = self.as_ref().start_time; + if start_time == AV_NOPTS_VALUE { + return None; + } + + Some(start_time) + } + + fn bit_rate(&self) -> i64 { + self.as_ref().bit_rate + } + + fn chapters(&self) -> Vec { + let chapters_ptr = self.as_ref().chapters; + (!chapters_ptr.is_null()) + .then(|| { + (0..isize::try_from(self.as_ref().nb_chapters).unwrap_or(0)) + .filter_map(|id| unsafe { (*(chapters_ptr.offset(id))).as_ref() }) + .map(Into::into) + .collect() + }) + .unwrap_or(vec![]) + } + + fn programs(&self) -> Vec { + let mut visited_streams: HashSet = HashSet::new(); + let programs_ptr = self.as_ref().programs; + + let mut programs = (!programs_ptr.is_null()) + .then(|| { + (0..isize::try_from(self.as_ref().nb_programs).unwrap_or(0)) + .filter_map(|id| unsafe { (*(programs_ptr.offset(id))).as_ref() }) + .map(|program| { + let (metadata, name) = extract_name_and_convert_metadata(program.metadata); + + let streams = (0..isize::try_from(program.nb_stream_indexes).unwrap_or(0)) + .filter_map(|index| unsafe { + program.stream_index.offset(index).as_ref() + }) + .copied() + .filter_map(|stream_index| { + visited_streams.insert(stream_index); + self.stream(stream_index) + }) + .map(|stream| (&*stream).into()) + .collect::>(); + + FFmpegProgram { + id: program.id, + name, + streams, + metadata, + } + }) + .collect::>() + }) + .unwrap_or(vec![]); + + let unvisited_streams = (0..self.as_ref().nb_streams) + .filter(|i| !visited_streams.contains(i)) + .filter_map(|i| self.stream(i).map(|stream| (&*stream).into())) + .collect::>(); + if !unvisited_streams.is_empty() { + if let Ok(id) = i32::try_from(programs.len()) { + // Create an empty program to hold unvisited streams if there are any + programs.push(FFmpegProgram { + id, + name: Some("No Program".to_string()), + streams: unvisited_streams, + metadata: FFmpegMetadata::default(), + }); + } + } + + programs + } + + fn metadata(&self) -> FFmpegMetadata { + let fmt_ctx = self.as_ref(); + unsafe { fmt_ctx.metadata.as_mut() }.map_or_else(FFmpegMetadata::default, |metadata| { + FFmpegDictionary::new(Some(metadata)).into() + }) + } +} + +impl Drop for FFmpegFormatContext { + fn drop(&mut self) { + if !self.0.is_null() { + unsafe { avformat_close_input(&mut self.0) }; + self.0 = ptr::null_mut(); + } + } +} + +impl From<&FFmpegFormatContext> for FFmpegMediaData { + fn from(ctx: &FFmpegFormatContext) -> Self { + Self { + formats: ctx.formats(), + duration: ctx.duration(), + start_time: ctx.start_time(), + bit_rate: ctx.bit_rate(), + chapters: ctx.chapters(), + programs: ctx.programs(), + metadata: ctx.metadata(), + } + } +} + +impl From<&AVChapter> for FFmpegChapter { + fn from( + AVChapter { + id, + time_base, + start, + end, + metadata, + }: &AVChapter, + ) -> Self { + Self { + // NOTICE: chapter.id is a i64, but I think it will be extremely rare to have a chapter id that doesn't fit in a i32 + id: *id, + start: *start, + end: *end, + time_base_num: time_base.num, + time_base_den: time_base.den, + metadata: unsafe { metadata.as_mut() } + .map_or_else(FFmpegMetadata::default, |metadata| { + FFmpegDictionary::new(Some(metadata)).into() + }), + } + } +} + +impl From<&AVStream> for FFmpegStream { + fn from(stream: &AVStream) -> Self { + let (metadata, name) = extract_name_and_convert_metadata(stream.metadata); + + let aspect_ratio = unsafe { stream.codecpar.as_ref() } + .and_then(|codecpar| { + if stream.sample_aspect_ratio.num != 0 + && unsafe { av_cmp_q(stream.sample_aspect_ratio, codecpar.sample_aspect_ratio) } + != 0 + { + let mut display_aspect_ratio = AVRational { num: 0, den: 0 }; + let num = i64::from(codecpar.width * codecpar.sample_aspect_ratio.num); + let den = i64::from(codecpar.height * codecpar.sample_aspect_ratio.den); + let max = 1024 * 1024; + unsafe { + av_reduce( + &mut display_aspect_ratio.num, + &mut display_aspect_ratio.den, + num, + den, + max, + ); + } + + Some(display_aspect_ratio) + } else { + None + } + }) + .unwrap_or(stream.sample_aspect_ratio); + + let dispositions = [ + (AV_DISPOSITION_DEFAULT, "default"), + (AV_DISPOSITION_DUB, "dub"), + (AV_DISPOSITION_ORIGINAL, "original"), + (AV_DISPOSITION_COMMENT, "comment"), + (AV_DISPOSITION_LYRICS, "lyrics"), + (AV_DISPOSITION_KARAOKE, "karaoke"), + (AV_DISPOSITION_FORCED, "forced"), + (AV_DISPOSITION_HEARING_IMPAIRED, "hearing impaired"), + (AV_DISPOSITION_VISUAL_IMPAIRED, "visual impaired"), + (AV_DISPOSITION_CLEAN_EFFECTS, "clean effects"), + (AV_DISPOSITION_ATTACHED_PIC, "attached pic"), + (AV_DISPOSITION_TIMED_THUMBNAILS, "timed thumbnails"), + (AV_DISPOSITION_CAPTIONS, "captions"), + (AV_DISPOSITION_DESCRIPTIONS, "descriptions"), + (AV_DISPOSITION_METADATA, "metadata"), + (AV_DISPOSITION_DEPENDENT, "dependent"), + (AV_DISPOSITION_STILL_IMAGE, "still image"), + (AV_DISPOSITION_NON_DIEGETIC, "non-diegetic"), + ] + .iter() + .filter_map(|&(flag, name)| { + if stream.disposition & flag != 0 { + Some(name.to_string()) + } else { + None + } + }) + .collect::>(); + + let codec = unsafe { stream.codecpar.as_ref() }.and_then(|codec_params| { + FFmpegCodecContext::new() + .and_then(|mut codec| { + codec.parameters_to_context(codec_params)?; + Ok(codec) + }) + .map(|codec| (&codec).into()) + .ok() + }); + + Self { + id: stream.index, + name, + codec, + aspect_ratio_num: aspect_ratio.num, + aspect_ratio_den: aspect_ratio.den, + frames_per_second_num: stream.avg_frame_rate.num, + frames_per_second_den: stream.avg_frame_rate.den, + time_base_real_num: stream.time_base.num, + time_base_real_den: stream.time_base.den, + dispositions, + metadata, + } + } +} diff --git a/crates/ffmpeg/src/frame_decoder.rs b/crates/ffmpeg/src/frame_decoder.rs new file mode 100644 index 000000000..95516b6f2 --- /dev/null +++ b/crates/ffmpeg/src/frame_decoder.rs @@ -0,0 +1,290 @@ +use crate::{ + codec_ctx::FFmpegCodecContext, + error::{Error, FFmpegError}, + filter_graph::FFmpegFilterGraph, + format_ctx::FFmpegFormatContext, + utils::{check_error, from_path}, + video_frame::FFmpegFrame, +}; + +use std::{path::Path, ptr}; + +use ffmpeg_sys_next::{ + av_buffersink_get_frame, av_buffersrc_write_frame, av_frame_alloc, + av_guess_sample_aspect_ratio, av_packet_alloc, av_packet_free, av_packet_unref, av_seek_frame, + avcodec_find_decoder, AVPacket, AVRational, AVStream, AVERROR, AVPROBE_SCORE_MAX, + AV_FRAME_FLAG_INTERLACED, AV_FRAME_FLAG_KEY, AV_TIME_BASE, EAGAIN, +}; + +#[derive(Debug, Clone, Copy)] +pub enum ThumbnailSize { + Scale(u32), + Dimensions { width: u32, height: u32 }, +} + +#[derive(Debug)] +pub struct VideoFrame { + pub data: Vec, + pub width: u32, + pub height: u32, + pub rotation: f64, +} + +pub struct FrameDecoder { + format_ctx: FFmpegFormatContext, + preferred_stream_id: u32, + codec_ctx: FFmpegCodecContext, + frame: FFmpegFrame, + packet: *mut AVPacket, + embedded: bool, + allow_seek: bool, +} + +impl FrameDecoder { + pub(crate) fn new( + filename: impl AsRef, + allow_seek: bool, + prefer_embedded: bool, + ) -> Result { + let filename = filename.as_ref(); + + let mut format_context = FFmpegFormatContext::open_file(from_path(filename)?.as_c_str())?; + + format_context.find_stream_info()?; + + // This needs to remain at 100 or the app will force crash if it comes + // across a video with subtitles or any type of corruption. + if format_context.as_ref().probe_score != AVPROBE_SCORE_MAX { + return Err(Error::CorruptVideo( + filename.to_path_buf().into_boxed_path(), + )); + } + + let (embedded, video_stream) = + format_context.find_preferred_video_stream(prefer_embedded)?; + + let preferred_stream_id = u32::try_from(video_stream.index)?; + + let video_codec = unsafe { video_stream.codecpar.as_ref() } + .and_then(|codecpar| unsafe { avcodec_find_decoder(codecpar.codec_id).as_ref() }) + .ok_or(FFmpegError::DecoderNotFound)?; + + let mut video_codec_context = FFmpegCodecContext::new()?; + video_codec_context.parameters_to_context( + unsafe { video_stream.codecpar.as_ref() }.ok_or(FFmpegError::NullError)?, + )?; + video_codec_context.as_mut().workaround_bugs = 1; + video_codec_context.open2(video_codec)?; + + let frame = unsafe { av_frame_alloc() }; + if frame.is_null() { + Err(FFmpegError::FrameAllocation)?; + } + + Ok(Self { + format_ctx: format_context, + preferred_stream_id, + codec_ctx: video_codec_context, + frame: FFmpegFrame::new()?, + packet: ptr::null_mut(), + allow_seek, + embedded, + }) + } + + pub(crate) fn use_embedded(&mut self) -> bool { + self.embedded + } + + pub(crate) fn decode_video_frame(&mut self) -> Result<(), Error> { + let mut frame_finished = false; + + while !frame_finished && self.find_packet_for_stream() { + frame_finished = self.decode_packet()?; + } + + if !frame_finished { + return Err(Error::FrameDecodeError); + } + + Ok(()) + } + + pub(crate) fn seek(&mut self, seconds: i64) -> Result<(), Error> { + if !self.allow_seek { + return Ok(()); + } + + let timestamp = i64::from(AV_TIME_BASE).checked_mul(seconds).unwrap_or(0); + + check_error( + unsafe { av_seek_frame(self.format_ctx.as_mut(), -1, timestamp, 0) }, + "Seeking video failed", + )?; + + self.codec_ctx.flush(); + + let mut got_frame = false; + for _ in 0..200 { + got_frame = false; + let mut count = 0; + while !got_frame && count < 20 { + self.find_packet_for_stream(); + got_frame = self.decode_packet().unwrap_or(false); + count += 1; + } + + if got_frame && self.frame.as_ref().flags & AV_FRAME_FLAG_KEY != 0 { + break; + } + } + + if got_frame { + Ok(()) + } else { + Err(Error::SeekError) + } + } + + pub(crate) fn get_scaled_video_frame( + &mut self, + size: Option, + maintain_aspect_ratio: bool, + ) -> Result { + let (time_base, stream_ptr) = self + .format_ctx + .stream(self.preferred_stream_id) + .map(|stream| -> (AVRational, *mut AVStream) { (stream.time_base, stream) }) + .ok_or(FFmpegError::NullError)?; + + let pixel_aspect_ratio = unsafe { + av_guess_sample_aspect_ratio(self.format_ctx.as_mut(), stream_ptr, self.frame.as_mut()) + }; + + let (_guard, filter_source, filter_sink) = FFmpegFilterGraph::thumbnail_graph( + size, + &time_base, + &self.codec_ctx, + (self.frame.as_mut().flags & AV_FRAME_FLAG_INTERLACED) != 0, + pixel_aspect_ratio, + maintain_aspect_ratio, + )?; + + let mut new_frame = FFmpegFrame::new()?; + let mut get_frame_errno = 0; + for _ in 0..10 { + check_error( + unsafe { av_buffersrc_write_frame(filter_source, self.frame.as_ref()) }, + "Failed to write frame to filter graph", + )?; + + get_frame_errno = unsafe { av_buffersink_get_frame(filter_sink, new_frame.as_mut()) }; + if get_frame_errno != AVERROR(EAGAIN) { + break; + } + + self.decode_video_frame()?; + } + check_error(get_frame_errno, "Failed to get buffer from filter")?; + + let width = new_frame.as_ref().width.unsigned_abs(); + let height = new_frame.as_ref().height.unsigned_abs(); + let line_size = usize::try_from(new_frame.as_ref().linesize[0])?; + + let mut data = Vec::with_capacity(line_size * usize::try_from(height)?); + data.extend_from_slice(unsafe { + std::slice::from_raw_parts(new_frame.as_ref().data[0], data.capacity()) + }); + + Ok(VideoFrame { + data, + width, + height, + rotation: self + .format_ctx + .get_stream_rotation_angle(self.preferred_stream_id) + .round(), + }) + } + + pub fn get_duration_secs(&self) -> Option { + self.format_ctx.duration().map(|duration| { + let av_time_base = i64::from(AV_TIME_BASE); + #[allow(clippy::cast_precision_loss)] + { + // SAFETY: the duration would need to be humongous for this cast to f64 to cause problems + (duration / av_time_base) as f64 + + ((duration % av_time_base) as f64 / f64::from(AV_TIME_BASE)) + } + }) + } + + fn reset_packet(&mut self) { + if self.packet.is_null() { + self.packet = unsafe { av_packet_alloc() }; + } else { + unsafe { av_packet_unref(self.packet) } + } + } + + fn is_packet_for_stream(&self) -> Option<&mut AVPacket> { + let packet = (unsafe { self.packet.as_mut() })?; + + let packet_stream_id = u32::try_from(packet.stream_index).ok()?; + + if packet_stream_id == self.preferred_stream_id { + Some(packet) + } else { + None + } + } + + fn find_packet_for_stream(&mut self) -> bool { + self.reset_packet(); + while self.format_ctx.read_frame(self.packet).is_ok() { + if self.is_packet_for_stream().is_some() { + return true; + } + + self.reset_packet(); + } + + false + } + + fn decode_packet(&mut self) -> Result { + let Some(packet) = self.is_packet_for_stream() else { + return Ok(false); + }; + + if match self.codec_ctx.send_packet(packet) { + Ok(b) => b, + Err(FFmpegError::Again) => true, + Err(e) => { + return Err(Error::FFmpegWithReason( + e, + "Failed to send packet to decoder".to_string(), + )) + } + } { + match self.codec_ctx.receive_frame(self.frame.as_mut()) { + Ok(ok) => Ok(ok), + Err(FFmpegError::Again) => Ok(false), + Err(e) => Err(Error::FFmpegWithReason( + e, + "Failed to receive frame from decoder".to_string(), + )), + } + } else { + Ok(false) + } + } +} + +impl Drop for FrameDecoder { + fn drop(&mut self) { + unsafe { + av_packet_free(&mut self.packet); + } + } +} diff --git a/crates/ffmpeg/src/lib.rs b/crates/ffmpeg/src/lib.rs index c1170afe0..26eaae419 100644 --- a/crates/ffmpeg/src/lib.rs +++ b/crates/ffmpeg/src/lib.rs @@ -1,30 +1,95 @@ -use crate::{ - film_strip::film_strip_filter, - movie_decoder::{MovieDecoder, ThumbnailSize}, - video_frame::VideoFrame, -}; +#![warn( + clippy::all, + clippy::pedantic, + clippy::correctness, + clippy::perf, + clippy::style, + clippy::suspicious, + clippy::complexity, + clippy::nursery, + clippy::unwrap_used, + unused_qualifications, + rust_2018_idioms, + trivial_casts, + trivial_numeric_casts, + unused_allocation, + clippy::unnecessary_cast, + clippy::cast_lossless, + clippy::cast_possible_truncation, + clippy::cast_possible_wrap, + clippy::cast_precision_loss, + clippy::cast_sign_loss, + clippy::dbg_macro, + clippy::deprecated_cfg_attr, + clippy::separated_literal_suffix, + deprecated +)] +#![forbid(deprecated_in_future)] +#![allow(clippy::missing_errors_doc, clippy::module_name_repetitions)] + +use crate::{format_ctx::FFmpegFormatContext, frame_decoder::FrameDecoder, utils::from_path}; use std::path::Path; +use ffmpeg_sys_next::{av_log_set_level, AV_LOG_FATAL}; + +mod codec_ctx; +mod dict; mod error; -mod film_strip; -mod movie_decoder; +mod filter_graph; +mod format_ctx; +mod frame_decoder; +pub mod model; mod thumbnailer; mod utils; mod video_frame; pub use error::Error; -pub use thumbnailer::{Thumbnailer, ThumbnailerBuilder}; +pub use frame_decoder::ThumbnailSize; +pub use model::FFmpegMediaData; +pub use thumbnailer::ThumbnailerBuilder; +use tokio::task::spawn_blocking; + +/// Helper function to generate retrieve media data from from a video/audio file +pub async fn probe(filename: impl AsRef + Send) -> Result { + // Reduce the amount of logs generated by FFmpeg + unsafe { av_log_set_level(AV_LOG_FATAL) }; + + // Dictionary to store format options + // let mut format_opts = FFmpegDict::new(None); + // Some MPEGTS specific option (copied from ffprobe) + // let scan_all_pmts = c"scan_all_pmts"; + // format_opts.set(scan_all_pmts, c"1")?; + + // Open an input stream, read the header and allocate the format context + spawn_blocking({ + let filename = filename.as_ref().to_path_buf(); + move || { + let mut fmt_ctx = FFmpegFormatContext::open_file(from_path(filename)?.as_c_str())?; + + // // Reset MPEGTS specific option + // format_opts.remove(scan_all_pmts)?; + + // Read packets of media file to get stream information. + fmt_ctx.find_stream_info()?; + + Ok((&fmt_ctx).into()) + } + }) + .await? +} /// Helper function to generate a thumbnail file from a video file with reasonable defaults pub async fn to_thumbnail( - video_file_path: impl AsRef, - output_thumbnail_path: impl AsRef, - size: u32, + video_file_path: impl AsRef + Send, + output_thumbnail_path: impl AsRef + Send, + size: ThumbnailSize, quality: f32, ) -> Result<(), Error> { + // Reduce the amount of logs generated by FFmpeg + unsafe { av_log_set_level(AV_LOG_FATAL) }; + ThumbnailerBuilder::new() - .with_film_strip(false) .size(size) .quality(quality)? .build() @@ -32,20 +97,6 @@ pub async fn to_thumbnail( .await } -/// Helper function to generate a thumbnail bytes from a video file with reasonable defaults -pub async fn to_webp_bytes( - video_file_path: impl AsRef, - size: u32, - quality: f32, -) -> Result, Error> { - ThumbnailerBuilder::new() - .size(size) - .quality(quality)? - .build() - .process_to_webp_bytes(video_file_path) - .await -} - #[cfg(test)] mod tests { use super::*; @@ -93,7 +144,7 @@ mod tests { ]; for (input, output) in video_file_path.iter().zip(actual_webp_files.iter()) { - if let Err(e) = to_thumbnail(input, output, 128, 100.0).await { + if let Err(e) = to_thumbnail(input, output, ThumbnailSize::Scale(128), 100.0).await { eprintln!("Error: {e}; Input: {}", input.display()); panic!("{}", e); } diff --git a/crates/ffmpeg/src/model.rs b/crates/ffmpeg/src/model.rs new file mode 100644 index 000000000..751ccbaaf --- /dev/null +++ b/crates/ffmpeg/src/model.rs @@ -0,0 +1,124 @@ +use std::collections::HashMap; + +use chrono::{DateTime, Utc}; + +#[derive(Debug)] +pub struct FFmpegMediaData { + pub formats: Vec, + pub duration: Option, + pub start_time: Option, + pub bit_rate: i64, + pub chapters: Vec, + pub programs: Vec, + pub metadata: FFmpegMetadata, +} + +#[derive(Debug)] +pub struct FFmpegChapter { + pub id: i64, + pub start: i64, + pub end: i64, + pub time_base_den: i32, + pub time_base_num: i32, + pub metadata: FFmpegMetadata, +} + +#[derive(Default, Debug)] +pub struct FFmpegMetadata { + pub album: Option, + pub album_artist: Option, + pub artist: Option, + pub comment: Option, + pub composer: Option, + pub copyright: Option, + pub creation_time: Option>, + pub date: Option>, + pub disc: Option, + pub encoder: Option, + pub encoded_by: Option, + pub filename: Option, + pub genre: Option, + pub language: Option, + pub performer: Option, + pub publisher: Option, + pub service_name: Option, + pub service_provider: Option, + pub title: Option, + pub track: Option, + pub variant_bit_rate: Option, + pub custom: HashMap, +} + +#[derive(Debug)] +pub struct FFmpegProgram { + pub id: i32, + pub name: Option, + pub streams: Vec, + pub metadata: FFmpegMetadata, +} + +#[derive(Debug)] +pub struct FFmpegStream { + pub id: i32, + pub name: Option, + pub codec: Option, + pub aspect_ratio_num: i32, + pub aspect_ratio_den: i32, + pub frames_per_second_num: i32, + pub frames_per_second_den: i32, + pub time_base_real_den: i32, + pub time_base_real_num: i32, + pub dispositions: Vec, + pub metadata: FFmpegMetadata, +} + +#[derive(Debug)] +pub struct FFmpegCodec { + pub kind: Option, + pub sub_kind: Option, + pub tag: Option, + pub name: Option, + pub profile: Option, + pub bit_rate: i32, + pub props: Option, +} + +#[derive(Debug)] +pub enum FFmpegProps { + Video(FFmpegVideoProps), + Audio(FFmpegAudioProps), + Subtitle(FFmpegSubtitleProps), +} + +#[derive(Debug)] +pub struct FFmpegVideoProps { + pub pixel_format: Option, + pub color_range: Option, + pub bits_per_channel: Option, + pub color_space: Option, + pub color_primaries: Option, + pub color_transfer: Option, + pub field_order: Option, + pub chroma_location: Option, + pub width: i32, + pub height: i32, + pub aspect_ratio_num: Option, + pub aspect_ratio_den: Option, + pub properties: Vec, +} + +#[derive(Debug)] +pub struct FFmpegAudioProps { + pub delay: i32, + pub padding: i32, + pub sample_rate: Option, + pub sample_format: Option, + pub bit_per_sample: Option, + pub channel_layout: Option, +} + +#[derive(Debug)] +pub struct FFmpegSubtitleProps { + pub width: i32, + pub height: i32, +} diff --git a/crates/ffmpeg/src/movie_decoder.rs b/crates/ffmpeg/src/movie_decoder.rs deleted file mode 100644 index 17b527c01..000000000 --- a/crates/ffmpeg/src/movie_decoder.rs +++ /dev/null @@ -1,750 +0,0 @@ -use crate::{ - error::{Error, FfmpegError}, - utils::from_path, - video_frame::{FfmpegFrame, FrameSource, VideoFrame}, -}; - -use ffmpeg_sys_next::{ - av_buffersink_get_frame, av_buffersrc_write_frame, av_dict_get, av_display_rotation_get, - av_frame_alloc, av_frame_free, av_packet_alloc, av_packet_free, av_packet_unref, av_read_frame, - av_seek_frame, av_stream_get_side_data, avcodec_alloc_context3, avcodec_find_decoder, - avcodec_flush_buffers, avcodec_free_context, avcodec_open2, avcodec_parameters_to_context, - avcodec_receive_frame, avcodec_send_packet, avfilter_get_by_name, avfilter_graph_alloc, - avfilter_graph_config, avfilter_graph_create_filter, avfilter_graph_free, avfilter_link, - avformat_close_input, avformat_find_stream_info, avformat_open_input, AVCodec, AVCodecContext, - AVCodecID, AVFilterContext, AVFilterGraph, AVFormatContext, AVFrame, AVMediaType, AVPacket, - AVPacketSideDataType, AVRational, AVStream, AVERROR, AVERROR_EOF, AVPROBE_SCORE_MAX, - AV_DICT_IGNORE_SUFFIX, AV_TIME_BASE, EAGAIN, -}; -use std::{ - ffi::{CStr, CString}, - fmt::Write, - path::Path, - time::Duration, -}; - -#[derive(Debug, Clone, Copy)] -pub enum ThumbnailSize { - Dimensions { width: u32, height: u32 }, - Size(u32), -} - -pub struct MovieDecoder { - video_stream_index: i32, - format_context: *mut AVFormatContext, - video_codec_context: *mut AVCodecContext, - video_codec: *const AVCodec, - filter_graph: *mut AVFilterGraph, - filter_source: *mut AVFilterContext, - filter_sink: *mut AVFilterContext, - video_stream: *mut AVStream, - frame: *mut AVFrame, - packet: *mut AVPacket, - allow_seek: bool, - use_embedded_data: bool, -} - -impl MovieDecoder { - pub(crate) fn new( - filename: impl AsRef, - prefer_embedded_metadata: bool, - ) -> Result { - let filename = filename.as_ref(); - - let input_file = if filename == Path::new("-") { - Path::new("pipe:") - } else { - filename - }; - let allow_seek = filename != Path::new("-") - && !filename.starts_with("rsts://") - && !filename.starts_with("udp://"); - - let mut decoder = Self { - video_stream_index: -1, - format_context: std::ptr::null_mut(), - video_codec_context: std::ptr::null_mut(), - video_codec: std::ptr::null_mut(), - filter_graph: std::ptr::null_mut(), - filter_source: std::ptr::null_mut(), - filter_sink: std::ptr::null_mut(), - video_stream: std::ptr::null_mut(), - frame: std::ptr::null_mut(), - packet: std::ptr::null_mut(), - allow_seek, - use_embedded_data: false, - }; - - unsafe { - let input_file_cstring = from_path(input_file)?; - match avformat_open_input( - &mut decoder.format_context, - input_file_cstring.as_ptr(), - std::ptr::null_mut(), - std::ptr::null_mut(), - ) { - 0 => { - check_error( - avformat_find_stream_info(decoder.format_context, std::ptr::null_mut()), - "Failed to get stream info", - )?; - } - e => { - return Err(Error::FfmpegWithReason( - FfmpegError::from(e), - "Failed to open input".to_string(), - )) - } - } - } - - unsafe { - // This needs to remain at 100 or the app will force crash if it comes - // across a video with subtitles or any type of corruption. - if (*decoder.format_context).probe_score != AVPROBE_SCORE_MAX { - return Err(Error::CorruptVideo); - } - } - - decoder.initialize_video(prefer_embedded_metadata)?; - - decoder.frame = unsafe { av_frame_alloc() }; - if decoder.frame.is_null() { - return Err(FfmpegError::FrameAllocation.into()); - } - - Ok(decoder) - } - - pub(crate) fn decode_video_frame(&mut self) -> Result<(), Error> { - let mut frame_finished = false; - - while !frame_finished && self.get_video_packet() { - frame_finished = self.decode_video_packet()?; - } - - if !frame_finished { - return Err(Error::FrameDecodeError); - } - - Ok(()) - } - - pub(crate) const fn embedded_metadata_is_available(&self) -> bool { - self.use_embedded_data - } - - pub(crate) fn seek(&mut self, seconds: i64) -> Result<(), Error> { - if !self.allow_seek { - return Ok(()); - } - - let timestamp = i64::from(AV_TIME_BASE).checked_mul(seconds).unwrap_or(0); - - check_error( - unsafe { av_seek_frame(self.format_context, -1, timestamp, 0) }, - "Seeking video failed", - )?; - unsafe { avcodec_flush_buffers(self.video_codec_context) }; - - let mut key_frame_attempts = 0; - let mut got_frame; - - loop { - let mut count = 0; - got_frame = false; - - while !got_frame && count < 20 { - self.get_video_packet(); - got_frame = self.decode_video_packet().unwrap_or(false); - count += 1; - } - - key_frame_attempts += 1; - - if !((!got_frame || unsafe { (*self.frame).key_frame } == 0) - && key_frame_attempts < 200) - { - break; - } - } - - if !got_frame { - return Err(Error::SeekError); - } - - Ok(()) - } - - pub(crate) fn get_scaled_video_frame( - &mut self, - scaled_size: Option, - maintain_aspect_ratio: bool, - video_frame: &mut VideoFrame, - ) -> Result<(), Error> { - self.initialize_filter_graph( - unsafe { - &(*(*(*self.format_context) - .streams - .offset(self.video_stream_index as isize))) - .time_base - }, - scaled_size, - maintain_aspect_ratio, - )?; - - check_error( - unsafe { av_buffersrc_write_frame(self.filter_source, self.frame) }, - "Failed to write frame to filter graph", - )?; - - let mut new_frame = FfmpegFrame::new()?; - let mut attempts = 0; - let mut ret = unsafe { av_buffersink_get_frame(self.filter_sink, new_frame.as_mut_ptr()) }; - while ret == AVERROR(EAGAIN) && attempts < 10 { - self.decode_video_frame()?; - check_error( - unsafe { av_buffersrc_write_frame(self.filter_source, self.frame) }, - "Failed to write frame to filter graph", - )?; - ret = unsafe { av_buffersink_get_frame(self.filter_sink, new_frame.as_mut_ptr()) }; - attempts += 1; - } - if ret < 0 { - return Err(Error::FfmpegWithReason( - FfmpegError::from(ret), - "Failed to get buffer from filter".to_string(), - )); - } - - // SAFETY: these should always be positive, so clippy doesn't need to alert on them - #[allow(clippy::cast_sign_loss)] - { - video_frame.width = unsafe { (*new_frame.as_mut_ptr()).width as u32 }; - video_frame.height = unsafe { (*new_frame.as_mut_ptr()).height as u32 }; - video_frame.line_size = unsafe { (*new_frame.as_mut_ptr()).linesize[0] as u32 }; - } - video_frame.source = if self.use_embedded_data { - Some(FrameSource::Metadata) - } else { - Some(FrameSource::VideoStream) - }; - - let frame_data_size = video_frame.line_size as usize * video_frame.height as usize; - match video_frame.data.capacity() { - 0 => { - video_frame.data = Vec::with_capacity(frame_data_size); - } - c if c < frame_data_size => { - video_frame.data.reserve_exact(frame_data_size - c); - video_frame.data.clear(); - } - c if c > frame_data_size => { - video_frame.data.shrink_to(frame_data_size); - video_frame.data.clear(); - } - _ => { - video_frame.data.clear(); - } - } - - video_frame.data.extend_from_slice(unsafe { - std::slice::from_raw_parts((*new_frame.as_mut_ptr()).data[0], frame_data_size) - }); - - if !self.filter_graph.is_null() { - unsafe { avfilter_graph_free(&mut self.filter_graph) }; - self.filter_graph = std::ptr::null_mut(); - } - - Ok(()) - } - - // SAFETY: this should always be positive, so clippy doesn't need to alert on them - #[allow(clippy::cast_sign_loss)] - pub fn get_video_duration(&self) -> Duration { - Duration::from_secs(unsafe { (*self.format_context).duration as u64 / AV_TIME_BASE as u64 }) - } - - fn initialize_video(&mut self, prefer_embedded_metadata: bool) -> Result<(), Error> { - self.find_preferred_video_stream(prefer_embedded_metadata)?; - - self.video_stream = unsafe { - *(*self.format_context) - .streams - .offset(self.video_stream_index as isize) - }; - self.video_codec = - unsafe { avcodec_find_decoder((*(*self.video_stream).codecpar).codec_id) }; - if self.video_codec.is_null() { - return Err(FfmpegError::DecoderNotFound.into()); - } - - self.video_codec_context = unsafe { avcodec_alloc_context3(self.video_codec) }; - if self.video_codec_context.is_null() { - return Err(FfmpegError::VideoCodecAllocation.into()); - } - - check_error( - unsafe { - avcodec_parameters_to_context( - self.video_codec_context, - (*self.video_stream).codecpar, - ) - }, - "Failed to get parameters from context", - )?; - - unsafe { (*self.video_codec_context).workaround_bugs = 1 }; - - check_error( - unsafe { - avcodec_open2( - self.video_codec_context, - self.video_codec, - std::ptr::null_mut(), - ) - }, - "Failed to open video codec", - ) - } - - fn find_preferred_video_stream(&mut self, prefer_embedded_metadata: bool) -> Result<(), Error> { - let mut video_streams = vec![]; - let mut embedded_data_streams = vec![]; - let empty_cstring = CString::new("").unwrap(); - - for stream_idx in 0..(unsafe { (*self.format_context).nb_streams.try_into()? }) { - let stream = unsafe { *(*self.format_context).streams.offset(stream_idx as isize) }; - let codec_params = unsafe { (*stream).codecpar }; - - if unsafe { (*codec_params).codec_type } == AVMediaType::AVMEDIA_TYPE_VIDEO { - let codec_id = unsafe { (*codec_params).codec_id }; - if !prefer_embedded_metadata - || !(codec_id == AVCodecID::AV_CODEC_ID_MJPEG - || codec_id == AVCodecID::AV_CODEC_ID_PNG) - { - video_streams.push(stream_idx); - continue; - } - - if unsafe { !(*stream).metadata.is_null() } { - let mut tag = std::ptr::null_mut(); - loop { - tag = unsafe { - av_dict_get( - (*stream).metadata, - empty_cstring.as_ptr(), - tag, - AV_DICT_IGNORE_SUFFIX, - ) - }; - - if tag.is_null() { - break; - } - - // WARNING: NEVER use CString with foreign raw pointer (causes double-free) - let key = unsafe { CStr::from_ptr((*tag).key) }.to_str(); - if let Ok(key) = key { - let value = unsafe { CStr::from_ptr((*tag).value) }.to_str(); - if let Ok(value) = value { - if key == "filename" && value == "cover." { - embedded_data_streams.insert(0, stream_idx); - continue; - } - } - } - } - } - - embedded_data_streams.push(stream_idx); - } - } - - self.use_embedded_data = false; - if prefer_embedded_metadata && !embedded_data_streams.is_empty() { - self.use_embedded_data = true; - self.video_stream_index = embedded_data_streams[0]; - Ok(()) - } else if !video_streams.is_empty() { - self.video_stream_index = video_streams[0]; - Ok(()) - } else { - Err(FfmpegError::StreamNotFound.into()) - } - } - - fn get_video_packet(&mut self) -> bool { - let mut frames_available = true; - let mut frame_decoded = false; - - if !self.packet.is_null() { - unsafe { - av_packet_unref(self.packet); - av_packet_free(&mut self.packet); - } - } - - self.packet = unsafe { av_packet_alloc() }; - - while frames_available && !frame_decoded { - frames_available = unsafe { av_read_frame(self.format_context, self.packet) >= 0 }; - if frames_available { - frame_decoded = unsafe { (*self.packet).stream_index } == self.video_stream_index; - if !frame_decoded { - unsafe { av_packet_unref(self.packet) }; - } - } - } - - frame_decoded - } - - fn decode_video_packet(&self) -> Result { - if unsafe { (*self.packet).stream_index } != self.video_stream_index { - return Ok(false); - } - - let ret = unsafe { avcodec_send_packet(self.video_codec_context, self.packet) }; - if ret != AVERROR(EAGAIN) { - if ret == AVERROR_EOF { - return Ok(false); - } else if ret < 0 { - return Err(Error::FfmpegWithReason( - FfmpegError::from(ret), - "Failed to send packet to decoder".to_string(), - )); - } - } - - match unsafe { avcodec_receive_frame(self.video_codec_context, self.frame) } { - 0 => Ok(true), - e if e != AVERROR(EAGAIN) => Err(Error::FfmpegWithReason( - FfmpegError::from(e), - "Failed to receive frame from decoder".to_string(), - )), - _ => Ok(false), - } - } - - #[allow(clippy::too_many_lines)] - fn initialize_filter_graph( - &mut self, - timebase: &AVRational, - scaled_size: Option, - maintain_aspect_ratio: bool, - ) -> Result<(), Error> { - unsafe { self.filter_graph = avfilter_graph_alloc() }; - if self.filter_graph.is_null() { - return Err(FfmpegError::FilterGraphAllocation.into()); - } - - let args = unsafe { - format!( - "video_size={}x{}:pix_fmt={}:time_base={}/{}:pixel_aspect={}/{}", - (*self.video_codec_context).width, - (*self.video_codec_context).height, - (*self.video_codec_context).pix_fmt as i32, - timebase.num, - timebase.den, - (*self.video_codec_context).sample_aspect_ratio.num, - i32::max((*self.video_codec_context).sample_aspect_ratio.den, 1) - ) - }; - - setup_filter( - &mut self.filter_source, - "buffer", - "thumb_buffer", - &args, - self.filter_graph, - "Failed to create filter source", - )?; - - setup_filter_without_args( - &mut self.filter_sink, - "buffersink", - "thumb_buffersink", - self.filter_graph, - "Failed to create filter sink", - )?; - - let mut yadif_filter = std::ptr::null_mut(); - if unsafe { (*self.frame).interlaced_frame } != 0 { - setup_filter( - &mut yadif_filter, - "yadif", - "thumb_deint", - "deint=1", - self.filter_graph, - "Failed to create de-interlace filter", - )?; - } - - let mut scale_filter = std::ptr::null_mut(); - setup_filter( - &mut scale_filter, - "scale", - "thumb_scale", - &Self::create_scale_string(scaled_size, maintain_aspect_ratio), - self.filter_graph, - "Failed to create scale filter", - )?; - - let mut format_filter = std::ptr::null_mut(); - setup_filter( - &mut format_filter, - "format", - "thumb_format", - "pix_fmts=rgb24", - self.filter_graph, - "Failed to create format filter", - )?; - - let mut rotate_filter = std::ptr::null_mut(); - let rotation = self.get_stream_rotation(); - if rotation == 3 { - setup_filter( - &mut rotate_filter, - "rotate", - "thumb_rotate", - "PI", - self.filter_graph, - "Failed to create rotate filter", - )?; - } else if rotation != -1 { - setup_filter( - &mut rotate_filter, - "transpose", - "thumb_transpose", - &rotation.to_string(), - self.filter_graph, - "Failed to create transpose filter", - )?; - } - - check_error( - unsafe { - avfilter_link( - if rotate_filter.is_null() { - format_filter - } else { - rotate_filter - }, - 0, - self.filter_sink, - 0, - ) - }, - "Failed to link final filter", - )?; - - if !rotate_filter.is_null() { - check_error( - unsafe { avfilter_link(format_filter, 0, rotate_filter, 0) }, - "Failed to link format filter", - )?; - } - - check_error( - unsafe { avfilter_link(scale_filter, 0, format_filter, 0) }, - "Failed to link scale filter", - )?; - - if !yadif_filter.is_null() { - check_error( - unsafe { avfilter_link(yadif_filter, 0, scale_filter, 0) }, - "Failed to link yadif filter", - )?; - } - - check_error( - unsafe { - avfilter_link( - self.filter_source, - 0, - if yadif_filter.is_null() { - scale_filter - } else { - yadif_filter - }, - 0, - ) - }, - "Failed to link source filter", - )?; - - check_error( - unsafe { avfilter_graph_config(self.filter_graph, std::ptr::null_mut()) }, - "Failed to configure filter graph", - )?; - - Ok(()) - } - - fn create_scale_string(size: Option, maintain_aspect_ratio: bool) -> String { - let mut scaled_width; - let mut scaled_height = -1; - if size.is_none() { - return "w=0:h=0".to_string(); - } - let size = size.expect("Size should have been checked for None"); - - #[allow(clippy::cast_possible_wrap)] - match size { - ThumbnailSize::Dimensions { width, height } => { - scaled_width = width as i32; - scaled_height = height as i32; - } - ThumbnailSize::Size(width) => { - scaled_width = width as i32; - } - } - - if scaled_width <= 0 { - scaled_width = -1; - } - - if scaled_height <= 0 { - scaled_height = -1; - } - - let mut scale = String::new(); - - write!(scale, "w={scaled_width}:h={scaled_height}") - .expect("Write of const string should work"); - - if maintain_aspect_ratio { - write!(scale, ":force_original_aspect_ratio=decrease") - .expect("Write of const string should work"); - } - - // TODO: Handle anamorphic videos - - scale - } - - #[allow(clippy::cast_ptr_alignment)] - fn get_stream_rotation(&self) -> i32 { - let matrix = unsafe { - av_stream_get_side_data( - self.video_stream, - AVPacketSideDataType::AV_PKT_DATA_DISPLAYMATRIX, - std::ptr::null_mut(), - ) - } as *const i32; - - if !matrix.is_null() { - let angle = (unsafe { av_display_rotation_get(matrix) }).round(); - if angle < -135.0 { - return 3; - } else if angle > 45.0 && angle < 135.0 { - return 2; - } else if angle < -45.0 && angle > -135.0 { - return 1; - } - } - - -1 - } -} - -impl Drop for MovieDecoder { - fn drop(&mut self) { - if !self.video_codec_context.is_null() { - unsafe { - avcodec_free_context(&mut self.video_codec_context); - } - self.video_codec = std::ptr::null_mut(); - } - - if !self.format_context.is_null() { - unsafe { - avformat_close_input(&mut self.format_context); - } - self.format_context = std::ptr::null_mut(); - } - - if !self.packet.is_null() { - unsafe { - av_packet_unref(self.packet); - av_packet_free(&mut self.packet); - } - self.packet = std::ptr::null_mut(); - } - - if !self.frame.is_null() { - unsafe { - av_frame_free(&mut self.frame); - self.frame = std::ptr::null_mut(); - } - self.frame = std::ptr::null_mut(); - } - - self.video_stream_index = -1; - } -} - -fn check_error(return_code: i32, error_message: &str) -> Result<(), Error> { - if return_code < 0 { - Err(Error::FfmpegWithReason( - FfmpegError::from(return_code), - error_message.to_string(), - )) - } else { - Ok(()) - } -} - -fn setup_filter( - filter_ctx: *mut *mut AVFilterContext, - filter_name: &str, - filter_setup_name: &str, - args: &str, - graph_ctx: *mut AVFilterGraph, - error_message: &str, -) -> Result<(), Error> { - let filter_name_cstr = CString::new(filter_name).expect("CString from str"); - let filter_setup_name_cstr = CString::new(filter_setup_name).expect("CString from str"); - let args_cstr = CString::new(args).expect("CString from str"); - - check_error( - unsafe { - avfilter_graph_create_filter( - filter_ctx, - avfilter_get_by_name(filter_name_cstr.as_ptr()), - filter_setup_name_cstr.as_ptr(), - args_cstr.as_ptr(), - std::ptr::null_mut(), - graph_ctx, - ) - }, - error_message, - ) -} - -fn setup_filter_without_args( - filter_ctx: *mut *mut AVFilterContext, - filter_name: &str, - filter_setup_name: &str, - graph_ctx: *mut AVFilterGraph, - error_message: &str, -) -> Result<(), Error> { - let filter_name_cstr = CString::new(filter_name).unwrap(); - let filter_setup_name_cstr = CString::new(filter_setup_name).unwrap(); - - check_error( - unsafe { - avfilter_graph_create_filter( - filter_ctx, - avfilter_get_by_name(filter_name_cstr.as_ptr()), - filter_setup_name_cstr.as_ptr(), - std::ptr::null_mut(), - std::ptr::null_mut(), - graph_ctx, - ) - }, - error_message, - ) -} diff --git a/crates/ffmpeg/src/thumbnailer.rs b/crates/ffmpeg/src/thumbnailer.rs index 820c5a6ee..afd008813 100644 --- a/crates/ffmpeg/src/thumbnailer.rs +++ b/crates/ffmpeg/src/thumbnailer.rs @@ -1,6 +1,9 @@ -use crate::{film_strip_filter, Error, MovieDecoder, ThumbnailSize, VideoFrame}; +use crate::{frame_decoder::ThumbnailSize, Error, FrameDecoder}; use std::{io, ops::Deref, path::Path}; + +use image::{imageops, DynamicImage, RgbImage}; +use sd_utils::error::FileIOError; use tokio::{fs, task::spawn_blocking}; use tracing::error; use webp::Encoder; @@ -14,79 +17,114 @@ pub struct Thumbnailer { impl Thumbnailer { /// Processes an video input file and write to file system a thumbnail with webp format - pub async fn process( + pub(crate) async fn process( &self, - video_file_path: impl AsRef, - output_thumbnail_path: impl AsRef, + video_file_path: impl AsRef + Send, + output_thumbnail_path: impl AsRef + Send, ) -> Result<(), Error> { - let path = output_thumbnail_path.as_ref().parent().ok_or_else(|| { - io::Error::new( - io::ErrorKind::InvalidInput, - "Cannot determine parent directory", - ) + let output_thumbnail_path = output_thumbnail_path.as_ref(); + let path = output_thumbnail_path.parent().ok_or_else(|| { + FileIOError::from(( + output_thumbnail_path, + io::Error::new( + io::ErrorKind::InvalidInput, + "Cannot determine parent directory", + ), + )) })?; - fs::create_dir_all(path).await?; + fs::create_dir_all(path) + .await + .map_err(|e| FileIOError::from((path, e)))?; fs::write( output_thumbnail_path, &*self.process_to_webp_bytes(video_file_path).await?, ) .await - .map_err(Into::into) + .map_err(|e| FileIOError::from((output_thumbnail_path, e)).into()) } /// Processes an video input file and returns a webp encoded thumbnail as bytes - pub async fn process_to_webp_bytes( + async fn process_to_webp_bytes( &self, - video_file_path: impl AsRef, + video_file_path: impl AsRef + Send, ) -> Result, Error> { - let video_file_path = video_file_path.as_ref().to_path_buf(); let prefer_embedded_metadata = self.builder.prefer_embedded_metadata; let seek_percentage = self.builder.seek_percentage; let size = self.builder.size; let maintain_aspect_ratio = self.builder.maintain_aspect_ratio; - let with_film_strip = self.builder.with_film_strip; let quality = self.builder.quality; - spawn_blocking(move || -> Result, Error> { - let mut decoder = MovieDecoder::new(video_file_path.clone(), prefer_embedded_metadata)?; - // We actually have to decode a frame to get some metadata before we can start decoding for real - decoder.decode_video_frame()?; + spawn_blocking({ + let video_file_path = video_file_path.as_ref().to_path_buf(); + move || -> Result, Error> { + let mut decoder = FrameDecoder::new( + &video_file_path, + // TODO: allow_seek should be false for remote files + true, + prefer_embedded_metadata, + )?; - #[allow(clippy::cast_possible_truncation)] - #[allow(clippy::cast_precision_loss)] - if !decoder.embedded_metadata_is_available() { - let result = decoder.seek( - (decoder.get_video_duration().as_secs() as f64 * f64::from(seek_percentage)) - .round() as i64, + // We actually have to decode a frame to get some metadata before we can start decoding for real + decoder.decode_video_frame()?; + + if !decoder.use_embedded() { + let result = decoder + .get_duration_secs() + .ok_or(Error::NoVideoDuration) + .and_then(|duration| { + decoder.seek( + #[allow(clippy::cast_possible_truncation)] + { + // This conversion is ok because we don't worry much about precision here + (duration * f64::from(seek_percentage)).round() as i64 + }, + ) + }); + + if let Err(err) = result { + error!( + "Failed to seek {}: {err:#?}", + video_file_path.to_string_lossy() + ); + // Seeking failed, try first frame again + // Re-instantiating decoder to avoid possible segfault + // https://github.com/dirkvdb/ffmpegthumbnailer/commit/da292ccb51a526ebc833f851a388ca308d747289 + decoder = + FrameDecoder::new(&video_file_path, false, prefer_embedded_metadata)?; + decoder.decode_video_frame()?; + } + } + + let video_frame = + decoder.get_scaled_video_frame(Some(size), maintain_aspect_ratio)?; + + let mut image = DynamicImage::ImageRgb8( + RgbImage::from_raw(video_frame.width, video_frame.height, video_frame.data) + .ok_or(Error::CorruptVideo(video_file_path.into_boxed_path()))?, ); - if let Err(err) = result { - error!("Failed to seek: {err:#?}"); - // seeking failed, try the first frame again - decoder = MovieDecoder::new(video_file_path, prefer_embedded_metadata)?; - decoder.decode_video_frame()?; - } - } + let image = if video_frame.rotation < -135.0 { + imageops::rotate180_in_place(&mut image); + image + } else if video_frame.rotation > 45.0 && video_frame.rotation < 135.0 { + image.rotate270() + } else if video_frame.rotation < -45.0 && video_frame.rotation > -135.0 { + image.rotate90() + } else { + image + }; - let mut video_frame = VideoFrame::default(); - - decoder.get_scaled_video_frame(Some(size), maintain_aspect_ratio, &mut video_frame)?; - - if with_film_strip { - film_strip_filter(&mut video_frame); - } - - // Type WebPMemory is !Send, which makes the Future in this function !Send, - // this make us `deref` to have a `&[u8]` and then `to_owned` to make a Vec - // which implies on a unwanted clone... - Ok( - Encoder::from_rgb(&video_frame.data, video_frame.width, video_frame.height) + // Type WebPMemory is !Send, which makes the Future in this function !Send, + // this make us `deref` to have a `&[u8]` and then `to_owned` to make a Vec + // which implies on a unwanted clone... + Ok(Encoder::from_image(&image) + .expect("Should not fail as the underlining DynamicImage is an RgbImage") .encode(quality) .deref() - .to_vec(), - ) + .to_vec()) + } }) .await? } @@ -102,18 +140,16 @@ pub struct ThumbnailerBuilder { seek_percentage: f32, quality: f32, prefer_embedded_metadata: bool, - with_film_strip: bool, } impl Default for ThumbnailerBuilder { fn default() -> Self { Self { maintain_aspect_ratio: true, - size: ThumbnailSize::Size(128), + size: ThumbnailSize::Scale(1024), seek_percentage: 0.1, quality: 80.0, prefer_embedded_metadata: true, - with_film_strip: true, } } } @@ -125,7 +161,6 @@ impl ThumbnailerBuilder { /// - `seek_percentage`: 10% /// - `quality`: 80 /// - `prefer_embedded_metadata`: true - /// - `with_film_strip`: true pub fn new() -> Self { Self::default() } @@ -137,14 +172,8 @@ impl ThumbnailerBuilder { } /// To set a thumbnail size, respecting or not its aspect ratio, according to `maintain_aspect_ratio` value - pub const fn size(mut self, size: u32) -> Self { - self.size = ThumbnailSize::Size(size); - self - } - - /// To specify width and height of the thumbnail - pub const fn width_and_height(mut self, width: u32, height: u32) -> Self { - self.size = ThumbnailSize::Dimensions { width, height }; + pub const fn size(mut self, size: ThumbnailSize) -> Self { + self.size = size; self } @@ -173,12 +202,6 @@ impl ThumbnailerBuilder { self } - /// If `with_film_strip` is true, a film strip will be added to the thumbnail borders - pub const fn with_film_strip(mut self, with_film_strip: bool) -> Self { - self.with_film_strip = with_film_strip; - self - } - /// Builds a `Thumbnailer` struct #[must_use] pub const fn build(self) -> Thumbnailer { diff --git a/crates/ffmpeg/src/utils.rs b/crates/ffmpeg/src/utils.rs index ea202f5d8..938d003a9 100644 --- a/crates/ffmpeg/src/utils.rs +++ b/crates/ffmpeg/src/utils.rs @@ -1,4 +1,4 @@ -use crate::error::Error; +use crate::error::{Error, FFmpegError}; use std::ffi::CString; use std::path::Path; @@ -19,3 +19,14 @@ pub fn from_path(path: impl AsRef) -> Result { .ok_or(Error::PathConversion(path.to_path_buf())) } } + +pub fn check_error(return_code: i32, error_message: &str) -> Result<(), Error> { + if return_code < 0 { + Err(Error::FFmpegWithReason( + FFmpegError::from(return_code), + error_message.to_string(), + )) + } else { + Ok(()) + } +} diff --git a/crates/ffmpeg/src/video_frame.rs b/crates/ffmpeg/src/video_frame.rs index 7f775e4f7..1694dc5cf 100644 --- a/crates/ffmpeg/src/video_frame.rs +++ b/crates/ffmpeg/src/video_frame.rs @@ -1,44 +1,31 @@ -use crate::error::FfmpegError; +use crate::error::FFmpegError; use ffmpeg_sys_next::{av_frame_alloc, av_frame_free, AVFrame}; -#[derive(Debug)] -pub enum FrameSource { - VideoStream, - Metadata, -} +pub struct FFmpegFrame(*mut AVFrame); -#[derive(Debug, Default)] -pub struct VideoFrame { - pub width: u32, - pub height: u32, - pub line_size: u32, - pub data: Vec, - pub source: Option, -} - -pub struct FfmpegFrame { - data: *mut AVFrame, -} - -impl FfmpegFrame { - pub fn new() -> Result { - let data = unsafe { av_frame_alloc() }; - if data.is_null() { - return Err(FfmpegError::FrameAllocation); +impl FFmpegFrame { + pub(crate) fn new() -> Result { + let ptr = unsafe { av_frame_alloc() }; + if ptr.is_null() { + return Err(FFmpegError::FrameAllocation); } - Ok(Self { data }) + Ok(Self(ptr)) } - pub fn as_mut_ptr(&mut self) -> *mut AVFrame { - self.data + pub(crate) fn as_ref(&self) -> &AVFrame { + unsafe { self.0.as_ref() }.expect("initialized on struct creation") + } + + pub(crate) fn as_mut(&mut self) -> &mut AVFrame { + unsafe { self.0.as_mut() }.expect("initialized on struct creation") } } -impl Drop for FfmpegFrame { +impl Drop for FFmpegFrame { fn drop(&mut self) { - if !self.data.is_null() { - unsafe { av_frame_free(&mut self.data) }; - self.data = std::ptr::null_mut(); + if !self.0.is_null() { + unsafe { av_frame_free(&mut self.0) }; + self.0 = std::ptr::null_mut(); } } } diff --git a/crates/file-ext/src/extensions.rs b/crates/file-ext/src/extensions.rs index bb904a6c4..4365032bb 100644 --- a/crates/file-ext/src/extensions.rs +++ b/crates/file-ext/src/extensions.rs @@ -99,7 +99,7 @@ extension_category_enum! { // audio extensions extension_category_enum! { - AudioExtension _ALL_AUDIO_EXTENSIONS { + AudioExtension ALL_AUDIO_EXTENSIONS { Mp3 = [0x49, 0x44, 0x33], Mp2 = [0xFF, 0xFB] | [0xFF, 0xFD], M4a = [0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41, 0x20] + 4, diff --git a/crates/file-ext/src/kind.rs b/crates/file-ext/src/kind.rs index 2c21a3052..058e206a4 100644 --- a/crates/file-ext/src/kind.rs +++ b/crates/file-ext/src/kind.rs @@ -60,38 +60,3 @@ pub enum ObjectKind { /// Label Label = 26, } - -impl ObjectKind { - pub fn from_i32(value: i32) -> Self { - match value { - 0 => ObjectKind::Unknown, - 1 => ObjectKind::Document, - 2 => ObjectKind::Folder, - 3 => ObjectKind::Text, - 4 => ObjectKind::Package, - 5 => ObjectKind::Image, - 6 => ObjectKind::Audio, - 7 => ObjectKind::Video, - 8 => ObjectKind::Archive, - 9 => ObjectKind::Executable, - 10 => ObjectKind::Alias, - 11 => ObjectKind::Encrypted, - 12 => ObjectKind::Key, - 13 => ObjectKind::Link, - 14 => ObjectKind::WebPageArchive, - 15 => ObjectKind::Widget, - 16 => ObjectKind::Album, - 17 => ObjectKind::Collection, - 18 => ObjectKind::Font, - 19 => ObjectKind::Mesh, - 20 => ObjectKind::Code, - 21 => ObjectKind::Database, - 22 => ObjectKind::Book, - 23 => ObjectKind::Config, - 24 => ObjectKind::Dotfile, - 25 => ObjectKind::Screenshot, - 26 => ObjectKind::Label, - _ => ObjectKind::Unknown, - } - } -} diff --git a/crates/images/Cargo.toml b/crates/images/Cargo.toml index 030cca381..73fc9fd77 100644 --- a/crates/images/Cargo.toml +++ b/crates/images/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sd-images" -version = "0.0.0" +version = "0.1.0" authors = [ "Jake Robinson ", "Vítor Vasconcellos ", @@ -13,6 +13,7 @@ edition = { workspace = true } heif = ["dep:libheif-rs", "dep:libheif-sys"] [dependencies] +# Workspace dependencies image = { workspace = true } once_cell = { workspace = true } rspc = { workspace = true, optional = true } # error conversion @@ -21,18 +22,17 @@ serde = { workspace = true, optional = true, features = ["derive"] } thiserror = { workspace = true } tracing = { workspace = true } -bincode = { version = "2.0.0-rc.3", features = [ +# Specific Images dependencies +bincode = { version = "=2.0.0-rc.3", features = [ "derive", "alloc", ], optional = true } -resvg = "0.40.0" - -# both of these added *default* bindgen features in 0.22.0 and 2.0.0 respectively -# this broke builds as we build our own liibheif, so i disabled their default features -libheif-rs = { version = "0.22.0", default-features = false, optional = true } -libheif-sys = { version = "2.0.0", default-features = false, optional = true } +# Disable defaults for libheif* to avoid bindgen and use pre-compiled headers +libheif-rs = { version = "1.0", default-features = false, optional = true } +libheif-sys = { version = "2.1", default-features = false, optional = true } pdfium-render = { version = "0.8.15", features = [ "sync", "image", "thread_safe", ] } +resvg = "0.42.0" diff --git a/crates/images/src/svg.rs b/crates/images/src/svg.rs index 108be6290..ec76829f4 100644 --- a/crates/images/src/svg.rs +++ b/crates/images/src/svg.rs @@ -1,12 +1,8 @@ -use std::path::Path; +use std::{path::Path, sync::Arc}; use crate::{consts::SVG_TARGET_PX, scale_dimensions, Error, ImageHandler, Result}; use image::DynamicImage; -use resvg::{ - tiny_skia::{self}, - usvg, -}; -use usvg::fontdb; +use resvg::{tiny_skia, usvg}; #[derive(PartialEq, Eq)] pub struct SvgHandler {} @@ -20,9 +16,28 @@ impl ImageHandler for SvgHandler { )] fn handle_image(&self, path: &Path) -> Result { let data = self.get_data(path)?; - let mut fontdb = fontdb::Database::new(); + + let mut fontdb = usvg::fontdb::Database::new(); fontdb.load_system_fonts(); - let rtree = usvg::Tree::from_data(&data, &usvg::Options::default(), &fontdb)?; + + let options = usvg::Options { + resources_dir: None, + dpi: 96.0, + // Default font is user-agent dependent so we can use whichever we like. + font_family: "Times New Roman".to_owned(), + font_size: 12.0, + languages: vec!["en".to_string()], + shape_rendering: usvg::ShapeRendering::default(), + text_rendering: usvg::TextRendering::default(), + image_rendering: usvg::ImageRendering::default(), + #[allow(clippy::expect_used)] + default_size: usvg::Size::from_wh(100.0, 100.0).expect("Must be a valid size"), + image_href_resolver: usvg::ImageHrefResolver::default(), + font_resolver: usvg::FontResolver::default(), + fontdb: Arc::new(fontdb), + }; + + let rtree = usvg::Tree::from_data(&data, &options)?; let (scaled_w, scaled_h) = scale_dimensions(rtree.size().width(), rtree.size().height(), SVG_TARGET_PX); diff --git a/crates/media-metadata/Cargo.toml b/crates/media-metadata/Cargo.toml index 45e9b5a89..a0ed6c83f 100644 --- a/crates/media-metadata/Cargo.toml +++ b/crates/media-metadata/Cargo.toml @@ -1,19 +1,30 @@ [package] name = "sd-media-metadata" -version = "0.0.0" -authors = ["Jake Robinson "] +version = "0.1.0" +authors = [ + "Jake Robinson ", + "Vítor Vasconcellos ", + "Ericson Soares ", +] edition = "2021" +[features] +ffmpeg = ["dep:sd-ffmpeg"] + [dependencies] +# Spacedrive Sub-crates +sd-ffmpeg = { path = "../ffmpeg", optional = true } +sd-utils = { path = "../utils" } + +# Workspace dependencies chrono = { workspace = true, features = ["serde"] } image = { workspace = true } rand = { workspace = true } -rand_chacha = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } specta = { workspace = true, features = ["chrono"] } thiserror = { workspace = true } +tokio = { workspace = true } +# Specific Media Metadata dependencies kamadak-exif = "0.5.5" - -# symphonia crate looks great for audio metadata diff --git a/crates/media-metadata/src/audio.rs b/crates/media-metadata/src/audio.rs deleted file mode 100644 index 683947424..000000000 --- a/crates/media-metadata/src/audio.rs +++ /dev/null @@ -1,19 +0,0 @@ -use std::path::Path; - -use crate::Result; - -#[derive( - Default, Clone, PartialEq, Eq, Debug, serde::Serialize, serde::Deserialize, specta::Type, -)] -pub struct AudioMetadata { - duration: Option, // can't use `Duration` due to bigint - audio_codec: Option, -} - -impl AudioMetadata { - #[allow(clippy::missing_errors_doc)] - #[allow(clippy::missing_panics_doc)] - pub fn from_path(_path: impl AsRef) -> Result { - todo!() - } -} diff --git a/crates/media-metadata/src/error.rs b/crates/media-metadata/src/error.rs index 25a35d06a..5b130880a 100644 --- a/crates/media-metadata/src/error.rs +++ b/crates/media-metadata/src/error.rs @@ -1,31 +1,29 @@ -use std::{ - num::ParseFloatError, - path::{Path, PathBuf}, -}; +use sd_utils::error::FileIOError; #[derive(Debug, thiserror::Error)] pub enum Error { - #[error("there was an i/o error {0} at {}", .1.display())] - Io(std::io::Error, Box), #[error("error from the exif crate: {0}")] Exif(#[from] exif::Error), + #[cfg(feature = "ffmpeg")] + #[error("error from the ffmpeg crate: {0}")] + FFmpeg(#[from] sd_ffmpeg::Error), + #[cfg(not(feature = "ffmpeg"))] + #[error("ffmpeg not available")] + NoFFmpeg, #[error("there was an error while parsing time with chrono: {0}")] Chrono(#[from] chrono::ParseError), #[error("there was an error while converting between types")] Conversion, #[error("there was an error while parsing the location of an image")] MediaLocationParse, - #[error("there was an error while parsing a float")] - FloatParse(#[from] ParseFloatError), - #[error("there was an error while initializing the exif reader")] - Init, - #[error("the file provided at ({0}) contains no exif data")] - NoExifDataOnPath(PathBuf), - #[error("the slice provided contains no exif data")] - NoExifDataOnSlice, #[error("serde error {0}")] Serde(#[from] serde_json::Error), + #[error("failed to join tokio task: {0}")] + TokioJoinHandle(#[from] tokio::task::JoinError), + + #[error(transparent)] + FileIO(#[from] FileIOError), } pub type Result = std::result::Result; diff --git a/crates/media-metadata/src/image/composite.rs b/crates/media-metadata/src/exif/composite.rs similarity index 100% rename from crates/media-metadata/src/image/composite.rs rename to crates/media-metadata/src/exif/composite.rs diff --git a/crates/media-metadata/src/image/consts.rs b/crates/media-metadata/src/exif/consts.rs similarity index 84% rename from crates/media-metadata/src/image/consts.rs rename to crates/media-metadata/src/exif/consts.rs index 24ad269dd..874757499 100644 --- a/crates/media-metadata/src/image/consts.rs +++ b/crates/media-metadata/src/exif/consts.rs @@ -7,10 +7,10 @@ use exif::Tag; /// ``` /// use sd_media_metadata::image::DMS_DIVISION; /// -/// let latitude = [53_f64, 19_f64, 35.11_f64]; // in DMS +/// let latitude = [53.0, 19.0, 35.11]; // in DMS /// latitude.iter().zip(DMS_DIVISION.iter()); /// ``` -pub const DMS_DIVISION: [f64; 3] = [1_f64, 60_f64, 3600_f64]; +pub const DMS_DIVISION: [f64; 3] = [1.0, 60.0, 3600.0]; /// The amount of significant figures we wish to retain after the decimal point. /// @@ -18,7 +18,7 @@ pub const DMS_DIVISION: [f64; 3] = [1_f64, 60_f64, 3600_f64]; /// applications. /// /// This is calculated with `10^n`, where `n` is the desired amount of SFs. -pub const DECIMAL_SF: f64 = 100_000_000_f64; +pub const DECIMAL_SF: f64 = 100_000_000.0; /// All possible time tags, to be zipped with [`OFFSET_TAGS`] pub const TIME_TAGS: [Tag; 3] = [Tag::DateTime, Tag::DateTimeOriginal, Tag::DateTimeDigitized]; @@ -31,19 +31,19 @@ pub const OFFSET_TAGS: [Tag; 3] = [ ]; /// The Earth's maximum latitude (can also be negative, depending on if you're North or South of the Equator). -pub const LAT_MAX_POS: f64 = 90_f64; +pub const LAT_MAX_POS: f64 = 90.0; /// The Earth's maximum longitude (can also be negative depending on if you're East or West of the Prime meridian). /// /// The negative value of this is known as the anti-meridian, and when combined they make a 360 degree circle around the Earth. -pub const LONG_MAX_POS: f64 = 180_f64; +pub const LONG_MAX_POS: f64 = 180.0; /// 125km. This is the Kármán line + a 25km additional padding just to be safe. -pub const ALT_MAX_HEIGHT: i32 = 125_000_i32; +pub const ALT_MAX_HEIGHT: i32 = 125_000; /// -1km. This should be adequate for even the Dead Sea on the Israeli border, /// the lowest point on land (and much deeper). -pub const ALT_MIN_HEIGHT: i32 = -1000_i32; +pub const ALT_MIN_HEIGHT: i32 = -1000; /// The maximum degrees that a direction can be (as a bearing, starting from 0 degrees) pub const DIRECTION_MAX: i32 = 360; diff --git a/crates/media-metadata/src/image/datetime.rs b/crates/media-metadata/src/exif/datetime.rs similarity index 97% rename from crates/media-metadata/src/image/datetime.rs rename to crates/media-metadata/src/exif/datetime.rs index 3840d4768..39c6a40b6 100644 --- a/crates/media-metadata/src/image/datetime.rs +++ b/crates/media-metadata/src/exif/datetime.rs @@ -55,10 +55,10 @@ impl MediaDate { /// /// This is for search ordering/sorting #[must_use] - pub fn unix_timestamp(&self) -> i64 { + pub const fn unix_timestamp(&self) -> i64 { match self { Self::Utc(t) => t.timestamp(), - Self::Naive(t) => t.timestamp(), + Self::Naive(t) => t.and_utc().timestamp(), } } } diff --git a/crates/media-metadata/src/image/flash/consts.rs b/crates/media-metadata/src/exif/flash/consts.rs similarity index 100% rename from crates/media-metadata/src/image/flash/consts.rs rename to crates/media-metadata/src/exif/flash/consts.rs diff --git a/crates/media-metadata/src/image/flash/data.rs b/crates/media-metadata/src/exif/flash/data.rs similarity index 98% rename from crates/media-metadata/src/image/flash/data.rs rename to crates/media-metadata/src/exif/flash/data.rs index b9a2745aa..272b5fd7b 100644 --- a/crates/media-metadata/src/image/flash/data.rs +++ b/crates/media-metadata/src/exif/flash/data.rs @@ -1,7 +1,7 @@ use exif::Tag; use super::FlashValue; -use crate::image::{flash::consts::FLASH_MODES, ExifReader}; +use crate::exif::{flash::consts::FLASH_MODES, ExifReader}; #[derive( Default, Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, specta::Type, @@ -37,7 +37,7 @@ pub enum FlashMode { /// The data is present, but we're unable to determine what they mean #[default] Unknown, - /// FLash was on + /// `FLash` was on On, /// Flash was off Off, diff --git a/crates/media-metadata/src/image/flash/mod.rs b/crates/media-metadata/src/exif/flash/mod.rs similarity index 100% rename from crates/media-metadata/src/image/flash/mod.rs rename to crates/media-metadata/src/exif/flash/mod.rs diff --git a/crates/media-metadata/src/image/flash/values.rs b/crates/media-metadata/src/exif/flash/values.rs similarity index 100% rename from crates/media-metadata/src/image/flash/values.rs rename to crates/media-metadata/src/exif/flash/values.rs diff --git a/crates/media-metadata/src/image/geographic/location.rs b/crates/media-metadata/src/exif/geographic/location.rs similarity index 92% rename from crates/media-metadata/src/image/geographic/location.rs rename to crates/media-metadata/src/exif/geographic/location.rs index 62ccf97a7..4d0be3306 100644 --- a/crates/media-metadata/src/image/geographic/location.rs +++ b/crates/media-metadata/src/exif/geographic/location.rs @@ -1,5 +1,5 @@ use crate::{ - image::{ + exif::{ consts::{ ALT_MAX_HEIGHT, ALT_MIN_HEIGHT, DECIMAL_SF, DIRECTION_MAX, DMS_DIVISION, LAT_MAX_POS, LONG_MAX_POS, @@ -9,8 +9,6 @@ use crate::{ Error, Result, }; use exif::Tag; -use rand::{Rng, SeedableRng}; -use rand_chacha::ChaCha20Rng; use std::ops::Neg; #[derive(Default, Clone, PartialEq, Debug, serde::Serialize, serde::Deserialize, specta::Type)] @@ -108,26 +106,6 @@ impl MediaLocation { .ok_or(Error::MediaLocationParse) } - #[must_use] - pub fn generate() -> Self { - let mut rng = ChaCha20Rng::from_entropy(); - let latitude = rng.gen_range(-LAT_MAX_POS..=LAT_MAX_POS); - let longitude = rng.gen_range(-LONG_MAX_POS..=LONG_MAX_POS); - - let pluscode = PlusCode::new(latitude, longitude); - - let altitude = Some(rng.gen_range(ALT_MIN_HEIGHT..=ALT_MAX_HEIGHT)); - let direction = Some(rng.gen_range(0..=DIRECTION_MAX)); - - Self { - latitude, - longitude, - pluscode, - altitude, - direction, - } - } - /// This returns the contained coordinates as `(latitude, longitude)` /// /// # Examples diff --git a/crates/media-metadata/src/image/geographic/mod.rs b/crates/media-metadata/src/exif/geographic/mod.rs similarity index 100% rename from crates/media-metadata/src/image/geographic/mod.rs rename to crates/media-metadata/src/exif/geographic/mod.rs diff --git a/crates/media-metadata/src/image/geographic/pluscodes.rs b/crates/media-metadata/src/exif/geographic/pluscodes.rs similarity index 98% rename from crates/media-metadata/src/image/geographic/pluscodes.rs rename to crates/media-metadata/src/exif/geographic/pluscodes.rs index 1988b2f26..df1dff8c5 100644 --- a/crates/media-metadata/src/image/geographic/pluscodes.rs +++ b/crates/media-metadata/src/exif/geographic/pluscodes.rs @@ -1,5 +1,5 @@ use crate::{ - image::consts::{PLUSCODE_DIGITS, PLUSCODE_GRID_SIZE}, + exif::consts::{PLUSCODE_DIGITS, PLUSCODE_GRID_SIZE}, Error, }; use std::{ diff --git a/crates/media-metadata/src/exif/mod.rs b/crates/media-metadata/src/exif/mod.rs new file mode 100644 index 000000000..739c9c41e --- /dev/null +++ b/crates/media-metadata/src/exif/mod.rs @@ -0,0 +1,158 @@ +use std::path::Path; + +use exif::Tag; +use sd_utils::error::FileIOError; +use tokio::task::spawn_blocking; + +mod composite; +mod consts; +mod datetime; +mod flash; +mod geographic; +mod orientation; +mod profile; +mod reader; +mod resolution; + +pub use composite::Composite; +pub use consts::DMS_DIVISION; +pub use datetime::MediaDate; +pub use flash::{Flash, FlashMode, FlashValue}; +pub use geographic::{MediaLocation, PlusCode}; +pub use orientation::Orientation; +pub use profile::ColorProfile; +pub use reader::ExifReader; +pub use resolution::Resolution; + +use crate::{Error, Result}; + +#[derive(Default, Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, specta::Type)] +pub struct ExifMetadata { + pub resolution: Resolution, + pub date_taken: Option, + pub location: Option, + pub camera_data: CameraData, + pub artist: Option, + pub description: Option, + pub copyright: Option, + pub exif_version: Option, +} + +impl ExifMetadata { + pub async fn from_path(path: impl AsRef + Send) -> Result> { + match spawn_blocking({ + let path = path.as_ref().to_owned(); + move || ExifReader::from_path(path).map(|reader| Self::from_reader(&reader)) + }) + .await? + { + Ok(data) => Ok(Some(data)), + Err(Error::Exif( + exif::Error::NotFound(_) + | exif::Error::NotSupported(_) + | exif::Error::BlankValue(_), + )) => Ok(None), + Err(Error::Exif(exif::Error::Io(e))) => Err(FileIOError::from((path, e)).into()), + Err(e) => Err(e), + } + } + + pub fn from_slice(bytes: &[u8]) -> Result> { + let res = ExifReader::from_slice(bytes).map(|reader| Self::from_reader(&reader)); + + if matches!( + res, + Err(Error::Exif( + exif::Error::NotFound(_) + | exif::Error::NotSupported(_) + | exif::Error::BlankValue(_) + )) + ) { + return Ok(None); + } + + res.map(Some) + } + + #[allow(clippy::field_reassign_with_default)] + fn from_reader(reader: &ExifReader) -> Self { + Self { + resolution: Resolution::from_reader(reader), + date_taken: MediaDate::from_reader(reader), + location: MediaLocation::from_exif_reader(reader).ok(), + camera_data: CameraData { + device_make: reader.get_tag(Tag::Make), + device_model: reader.get_tag(Tag::Model), + color_space: reader.get_tag(Tag::ColorSpace), + color_profile: ColorProfile::from_reader(reader), + focal_length: reader.get_tag(Tag::FocalLength), + shutter_speed: reader.get_tag(Tag::ShutterSpeedValue), + flash: Flash::from_reader(reader), + orientation: Orientation::from_reader(reader).unwrap_or_default(), + lens_make: reader.get_tag(Tag::LensMake), + lens_model: reader.get_tag(Tag::LensModel), + bit_depth: reader.get_tag::(Tag::BitsPerSample).map_or_else( + || { + reader + .get_tag::(Tag::CompressedBitsPerPixel) + .unwrap_or_default() + .parse() + .ok() + }, + |x| x.parse::().ok(), + ), + zoom: reader + .get_tag(Tag::DigitalZoomRatio) + .map(|x: String| x.replace("unused", "1").parse().ok()) + .unwrap_or_default(), + iso: reader.get_tag(Tag::PhotographicSensitivity), + software: reader.get_tag(Tag::Software), + serial_number: reader.get_tag(Tag::BodySerialNumber), + lens_serial_number: reader.get_tag(Tag::LensSerialNumber), + contrast: reader.get_tag(Tag::Contrast), + saturation: reader.get_tag(Tag::Saturation), + sharpness: reader.get_tag(Tag::Sharpness), + composite: Composite::from_reader(reader), + }, + artist: reader.get_tag(Tag::Artist), + description: reader.get_tag(Tag::ImageDescription), + copyright: reader.get_tag(Tag::Copyright), + exif_version: reader.get_tag(Tag::ExifVersion), + } + } +} + +#[derive(Default, Clone, PartialEq, Debug, serde::Serialize, serde::Deserialize, specta::Type)] +pub struct CameraData { + pub device_make: Option, + pub device_model: Option, + pub color_space: Option, + pub color_profile: Option, + pub focal_length: Option, + pub shutter_speed: Option, + pub flash: Option, + pub orientation: Orientation, + pub lens_make: Option, + pub lens_model: Option, + pub bit_depth: Option, + pub zoom: Option, + pub iso: Option, + pub software: Option, + pub serial_number: Option, + pub lens_serial_number: Option, + pub contrast: Option, + pub saturation: Option, + pub sharpness: Option, + pub composite: Option, +} + +// TODO(brxken128): more exif spec reading so we can source color spaces correctly too +// pub enum ImageColorSpace { +// Rgb, +// RgbP, +// SRgb, +// Cmyk, +// DciP3, +// Wiz, +// Biz, +// } diff --git a/crates/media-metadata/src/image/orientation.rs b/crates/media-metadata/src/exif/orientation.rs similarity index 100% rename from crates/media-metadata/src/image/orientation.rs rename to crates/media-metadata/src/exif/orientation.rs diff --git a/crates/media-metadata/src/image/profile.rs b/crates/media-metadata/src/exif/profile.rs similarity index 100% rename from crates/media-metadata/src/image/profile.rs rename to crates/media-metadata/src/exif/profile.rs diff --git a/crates/media-metadata/src/image/reader.rs b/crates/media-metadata/src/exif/reader.rs similarity index 76% rename from crates/media-metadata/src/image/reader.rs rename to crates/media-metadata/src/exif/reader.rs index 720ffdefd..98a13e5ea 100644 --- a/crates/media-metadata/src/image/reader.rs +++ b/crates/media-metadata/src/exif/reader.rs @@ -1,3 +1,5 @@ +use crate::Result; + use std::{ fs::File, io::{BufReader, Cursor}, @@ -6,8 +8,7 @@ use std::{ }; use exif::{Exif, In, Tag}; - -use crate::{Error, Result}; +use sd_utils::error::FileIOError; /// An [`ExifReader`]. This can get exif tags from images (either files or slices). pub struct ExifReader(Exif); @@ -16,19 +17,17 @@ impl ExifReader { pub fn from_path(path: impl AsRef) -> Result { exif::Reader::new() .read_from_container(&mut BufReader::new( - File::open(&path) - .map_err(|e| Error::Io(e, path.as_ref().to_path_buf().into_boxed_path()))?, + File::open(&path).map_err(|e| FileIOError::from((path, e)))?, )) - .map_or_else( - |_| Err(Error::NoExifDataOnPath(path.as_ref().to_path_buf())), - |reader| Ok(Self(reader)), - ) + .map(Self) + .map_err(Into::into) } pub fn from_slice(slice: &[u8]) -> Result { exif::Reader::new() .read_from_container(&mut Cursor::new(slice)) - .map_or_else(|_| Err(Error::NoExifDataOnSlice), |reader| Ok(Self(reader))) + .map(Self) + .map_err(Into::into) } /// A helper function which gets the target `Tag` as `T`, provided `T` impls `FromStr`. diff --git a/crates/media-metadata/src/image/resolution.rs b/crates/media-metadata/src/exif/resolution.rs similarity index 100% rename from crates/media-metadata/src/image/resolution.rs rename to crates/media-metadata/src/exif/resolution.rs diff --git a/crates/media-metadata/src/ffmpeg/audio_props.rs b/crates/media-metadata/src/ffmpeg/audio_props.rs new file mode 100644 index 000000000..2b71a0db9 --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/audio_props.rs @@ -0,0 +1,12 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct AudioProps { + pub delay: i32, + pub padding: i32, + pub sample_rate: Option, + pub sample_format: Option, + pub bit_per_sample: Option, + pub channel_layout: Option, +} diff --git a/crates/media-metadata/src/ffmpeg/chapter.rs b/crates/media-metadata/src/ffmpeg/chapter.rs new file mode 100644 index 000000000..681ff9679 --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/chapter.rs @@ -0,0 +1,14 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +use super::metadata::Metadata; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct Chapter { + pub id: i32, + pub start: (i32, u32), + pub end: (i32, u32), + pub time_base_den: i32, + pub time_base_num: i32, + pub metadata: Metadata, +} diff --git a/crates/media-metadata/src/ffmpeg/codec.rs b/crates/media-metadata/src/ffmpeg/codec.rs new file mode 100644 index 000000000..c583ed59f --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/codec.rs @@ -0,0 +1,22 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +use super::{audio_props::AudioProps, subtitle_props::SubtitleProps, video_props::VideoProps}; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct Codec { + pub kind: Option, + pub sub_kind: Option, + pub tag: Option, + pub name: Option, + pub profile: Option, + pub bit_rate: i32, + pub props: Option, +} + +#[derive(Debug, Serialize, Deserialize, Type)] +pub enum Props { + Video(VideoProps), + Audio(AudioProps), + Subtitle(SubtitleProps), +} diff --git a/crates/media-metadata/src/ffmpeg/metadata.rs b/crates/media-metadata/src/ffmpeg/metadata.rs new file mode 100644 index 000000000..8b576dff7 --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/metadata.rs @@ -0,0 +1,31 @@ +use std::collections::HashMap; + +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; +use specta::Type; + +#[derive(Default, Debug, Serialize, Deserialize, Type)] +pub struct Metadata { + pub album: Option, + pub album_artist: Option, + pub artist: Option, + pub comment: Option, + pub composer: Option, + pub copyright: Option, + pub creation_time: Option>, + pub date: Option>, + pub disc: Option, + pub encoder: Option, + pub encoded_by: Option, + pub filename: Option, + pub genre: Option, + pub language: Option, + pub performer: Option, + pub publisher: Option, + pub service_name: Option, + pub service_provider: Option, + pub title: Option, + pub track: Option, + pub variant_bit_rate: Option, + pub custom: HashMap, +} diff --git a/crates/media-metadata/src/ffmpeg/mod.rs b/crates/media-metadata/src/ffmpeg/mod.rs new file mode 100644 index 000000000..702762c86 --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/mod.rs @@ -0,0 +1,313 @@ +use crate::Result; + +use std::path::Path; + +use serde::{Deserialize, Serialize}; +use specta::Type; + +pub mod audio_props; +pub mod chapter; +pub mod codec; +pub mod metadata; +pub mod program; +pub mod stream; +pub mod subtitle_props; +pub mod video_props; + +use chapter::Chapter; +use metadata::Metadata; +use program::Program; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct FFmpegMetadata { + pub formats: Vec, + pub duration: Option<(i32, u32)>, + pub start_time: Option<(i32, u32)>, + pub bit_rate: (i32, u32), + pub chapters: Vec, + pub programs: Vec, + pub metadata: Metadata, +} + +impl FFmpegMetadata { + pub async fn from_path(path: impl AsRef + Send) -> Result { + #[cfg(not(feature = "ffmpeg"))] + { + let _ = path; + Err(crate::Error::NoFFmpeg) + } + + #[cfg(feature = "ffmpeg")] + { + sd_ffmpeg::probe(path) + .await + .map(Into::into) + .map_err(Into::into) + } + } +} + +#[cfg(feature = "ffmpeg")] +mod extract_data { + + use sd_ffmpeg::model::{ + FFmpegAudioProps, FFmpegChapter, FFmpegCodec, FFmpegMediaData, FFmpegMetadata, + FFmpegProgram, FFmpegProps, FFmpegStream, FFmpegSubtitleProps, FFmpegVideoProps, + }; + use sd_utils::i64_to_frontend; + + impl From for super::FFmpegMetadata { + fn from( + FFmpegMediaData { + formats, + duration, + start_time, + bit_rate, + chapters, + programs, + metadata, + }: FFmpegMediaData, + ) -> Self { + Self { + formats, + duration: duration.map(i64_to_frontend), + start_time: start_time.map(i64_to_frontend), + bit_rate: i64_to_frontend(bit_rate), + chapters: chapters.into_iter().map(Into::into).collect(), + programs: programs.into_iter().map(Into::into).collect(), + metadata: metadata.into(), + } + } + } + + impl From for super::Chapter { + fn from( + FFmpegChapter { + id, + start, + end, + time_base_den, + time_base_num, + metadata, + }: FFmpegChapter, + ) -> Self { + Self { + id: { + #[allow(clippy::cast_possible_truncation)] + { + // NOTICE: chapter.id is a i64, but I think it will be extremely rare to have a chapter id that doesn't fit in a i32 + id as i32 + } + }, + // TODO: FIX these 2 when rspc/specta supports bigint + start: i64_to_frontend(start), + end: i64_to_frontend(end), + time_base_num, + time_base_den, + metadata: metadata.into(), + } + } + } + + impl From for super::Program { + fn from( + FFmpegProgram { + id, + name, + streams, + metadata, + }: FFmpegProgram, + ) -> Self { + Self { + id, + name, + streams: streams.into_iter().map(Into::into).collect(), + metadata: metadata.into(), + } + } + } + + impl From for super::stream::Stream { + fn from( + FFmpegStream { + id, + name, + codec, + aspect_ratio_num, + aspect_ratio_den, + frames_per_second_num, + frames_per_second_den, + time_base_real_den, + time_base_real_num, + dispositions, + metadata, + }: FFmpegStream, + ) -> Self { + Self { + id, + name, + codec: codec.map(Into::into), + aspect_ratio_num, + aspect_ratio_den, + frames_per_second_num, + frames_per_second_den, + time_base_real_den, + time_base_real_num, + dispositions, + metadata: metadata.into(), + } + } + } + + impl From for super::codec::Codec { + fn from( + FFmpegCodec { + kind, + sub_kind, + tag, + name, + profile, + bit_rate, + props, + }: FFmpegCodec, + ) -> Self { + Self { + kind, + sub_kind, + tag, + name, + profile, + bit_rate, + props: props.map(Into::into), + } + } + } + + impl From for super::codec::Props { + fn from(props: FFmpegProps) -> Self { + match props { + FFmpegProps::Video(video_props) => Self::Video(video_props.into()), + FFmpegProps::Audio(audio_props) => Self::Audio(audio_props.into()), + FFmpegProps::Subtitle(subtitle_props) => Self::Subtitle(subtitle_props.into()), + } + } + } + + impl From for super::audio_props::AudioProps { + fn from( + FFmpegAudioProps { + delay, + padding, + sample_rate, + sample_format, + bit_per_sample, + channel_layout, + }: FFmpegAudioProps, + ) -> Self { + Self { + delay, + padding, + sample_rate, + sample_format, + bit_per_sample, + channel_layout, + } + } + } + + impl From for super::subtitle_props::SubtitleProps { + fn from(FFmpegSubtitleProps { width, height }: FFmpegSubtitleProps) -> Self { + Self { width, height } + } + } + + impl From for super::video_props::VideoProps { + fn from( + FFmpegVideoProps { + pixel_format, + color_range, + bits_per_channel, + color_space, + color_primaries, + color_transfer, + field_order, + chroma_location, + width, + height, + aspect_ratio_num, + aspect_ratio_den, + properties, + }: FFmpegVideoProps, + ) -> Self { + Self { + pixel_format, + color_range, + bits_per_channel, + color_space, + color_primaries, + color_transfer, + field_order, + chroma_location, + width, + height, + aspect_ratio_num, + aspect_ratio_den, + properties, + } + } + } + + impl From for super::Metadata { + fn from( + FFmpegMetadata { + album, + album_artist, + artist, + comment, + composer, + copyright, + creation_time, + date, + disc, + encoder, + encoded_by, + filename, + genre, + language, + performer, + publisher, + service_name, + service_provider, + title, + track, + variant_bit_rate, + custom, + }: FFmpegMetadata, + ) -> Self { + Self { + album, + album_artist, + artist, + comment, + composer, + copyright, + creation_time, + date, + disc, + encoder, + encoded_by, + filename, + genre, + language, + performer, + publisher, + service_name, + service_provider, + title, + track, + variant_bit_rate, + custom, + } + } + } +} diff --git a/crates/media-metadata/src/ffmpeg/program.rs b/crates/media-metadata/src/ffmpeg/program.rs new file mode 100644 index 000000000..54952e126 --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/program.rs @@ -0,0 +1,12 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +use super::{metadata::Metadata, stream::Stream}; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct Program { + pub id: i32, + pub name: Option, + pub streams: Vec, + pub metadata: Metadata, +} diff --git a/crates/media-metadata/src/ffmpeg/stream.rs b/crates/media-metadata/src/ffmpeg/stream.rs new file mode 100644 index 000000000..a5a299752 --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/stream.rs @@ -0,0 +1,19 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +use super::{codec::Codec, metadata::Metadata}; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct Stream { + pub id: i32, + pub name: Option, + pub codec: Option, + pub aspect_ratio_num: i32, + pub aspect_ratio_den: i32, + pub frames_per_second_num: i32, + pub frames_per_second_den: i32, + pub time_base_real_den: i32, + pub time_base_real_num: i32, + pub dispositions: Vec, + pub metadata: Metadata, +} diff --git a/crates/media-metadata/src/ffmpeg/subtitle_props.rs b/crates/media-metadata/src/ffmpeg/subtitle_props.rs new file mode 100644 index 000000000..f84bcdbda --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/subtitle_props.rs @@ -0,0 +1,8 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct SubtitleProps { + pub width: i32, + pub height: i32, +} diff --git a/crates/media-metadata/src/ffmpeg/video_props.rs b/crates/media-metadata/src/ffmpeg/video_props.rs new file mode 100644 index 000000000..7447f00eb --- /dev/null +++ b/crates/media-metadata/src/ffmpeg/video_props.rs @@ -0,0 +1,19 @@ +use serde::{Deserialize, Serialize}; +use specta::Type; + +#[derive(Debug, Serialize, Deserialize, Type)] +pub struct VideoProps { + pub pixel_format: Option, + pub color_range: Option, + pub bits_per_channel: Option, + pub color_space: Option, + pub color_primaries: Option, + pub color_transfer: Option, + pub field_order: Option, + pub chroma_location: Option, + pub width: i32, + pub height: i32, + pub aspect_ratio_num: Option, + pub aspect_ratio_den: Option, + pub properties: Vec, +} diff --git a/crates/media-metadata/src/image/mod.rs b/crates/media-metadata/src/image/mod.rs deleted file mode 100644 index 104bfee07..000000000 --- a/crates/media-metadata/src/image/mod.rs +++ /dev/null @@ -1,135 +0,0 @@ -use exif::Tag; -use std::path::Path; - -mod composite; -mod consts; -mod datetime; -mod flash; -mod geographic; -mod orientation; -mod profile; -mod reader; -mod resolution; - -pub use composite::Composite; -pub use consts::DMS_DIVISION; -pub use datetime::MediaDate; -pub use flash::{Flash, FlashMode, FlashValue}; -pub use geographic::{MediaLocation, PlusCode}; -pub use orientation::Orientation; -pub use profile::ColorProfile; -pub use reader::ExifReader; -pub use resolution::Resolution; - -use crate::Result; - -#[derive(Default, Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize, specta::Type)] -pub struct ImageMetadata { - pub resolution: Resolution, - pub date_taken: Option, - pub location: Option, - pub camera_data: CameraData, - pub artist: Option, - pub description: Option, - pub copyright: Option, - pub exif_version: Option, -} - -#[derive(Default, Clone, PartialEq, Debug, serde::Serialize, serde::Deserialize, specta::Type)] -pub struct CameraData { - pub device_make: Option, - pub device_model: Option, - pub color_space: Option, - pub color_profile: Option, - pub focal_length: Option, - pub shutter_speed: Option, - pub flash: Option, - pub orientation: Orientation, - pub lens_make: Option, - pub lens_model: Option, - pub bit_depth: Option, - pub red_eye: Option, - pub zoom: Option, - pub iso: Option, - pub software: Option, - pub serial_number: Option, - pub lens_serial_number: Option, - pub contrast: Option, - pub saturation: Option, - pub sharpness: Option, - pub composite: Option, -} - -impl ImageMetadata { - pub fn from_path(path: impl AsRef) -> Result { - Self::from_reader(&ExifReader::from_path(path)?) - } - - pub fn from_slice(bytes: &[u8]) -> Result { - Self::from_reader(&ExifReader::from_slice(bytes)?) - } - - #[allow(clippy::field_reassign_with_default)] - pub fn from_reader(reader: &ExifReader) -> Result { - let mut data = Self::default(); - let camera_data = &mut data.camera_data; - - data.date_taken = MediaDate::from_reader(reader); - data.resolution = Resolution::from_reader(reader); - data.artist = reader.get_tag(Tag::Artist); - data.description = reader.get_tag(Tag::ImageDescription); - data.copyright = reader.get_tag(Tag::Copyright); - data.exif_version = reader.get_tag(Tag::ExifVersion); - data.location = MediaLocation::from_exif_reader(reader).ok(); - - camera_data.device_make = reader.get_tag(Tag::Make); - camera_data.device_model = reader.get_tag(Tag::Model); - camera_data.focal_length = reader.get_tag(Tag::FocalLength); - camera_data.shutter_speed = reader.get_tag(Tag::ShutterSpeedValue); - camera_data.color_space = reader.get_tag(Tag::ColorSpace); - camera_data.color_profile = ColorProfile::from_reader(reader); - - camera_data.lens_make = reader.get_tag(Tag::LensMake); - camera_data.lens_model = reader.get_tag(Tag::LensModel); - camera_data.iso = reader.get_tag(Tag::PhotographicSensitivity); - camera_data.zoom = reader - .get_tag(Tag::DigitalZoomRatio) - .map(|x: String| x.replace("unused", "1").parse().ok()) - .unwrap_or_default(); - - camera_data.bit_depth = reader.get_tag::(Tag::BitsPerSample).map_or_else( - || { - reader - .get_tag::(Tag::CompressedBitsPerPixel) - .unwrap_or_default() - .parse() - .ok() - }, - |x| x.parse::().ok(), - ); - - camera_data.orientation = Orientation::from_reader(reader).unwrap_or_default(); - camera_data.flash = Flash::from_reader(reader); - camera_data.software = reader.get_tag(Tag::Software); - camera_data.serial_number = reader.get_tag(Tag::BodySerialNumber); - camera_data.lens_serial_number = reader.get_tag(Tag::LensSerialNumber); - camera_data.software = reader.get_tag(Tag::Software); - camera_data.contrast = reader.get_tag(Tag::Contrast); - camera_data.saturation = reader.get_tag(Tag::Saturation); - camera_data.sharpness = reader.get_tag(Tag::Sharpness); - camera_data.composite = Composite::from_reader(reader); - - Ok(data) - } -} - -// TODO(brxken128): more exif spec reading so we can source color spaces correctly too -// pub enum ImageColorSpace { -// Rgb, -// RgbP, -// SRgb, -// Cmyk, -// DciP3, -// Wiz, -// Biz, -// } diff --git a/crates/media-metadata/src/lib.rs b/crates/media-metadata/src/lib.rs index 2e9759cf2..026ab7c81 100644 --- a/crates/media-metadata/src/lib.rs +++ b/crates/media-metadata/src/lib.rs @@ -11,30 +11,28 @@ clippy::unwrap_used, unused_qualifications, rust_2018_idioms, - clippy::expect_used, trivial_casts, trivial_numeric_casts, unused_allocation, - clippy::as_conversions, - clippy::dbg_macro + clippy::unnecessary_cast, + clippy::cast_lossless, + clippy::cast_possible_truncation, + clippy::cast_possible_wrap, + clippy::cast_precision_loss, + clippy::cast_sign_loss, + clippy::dbg_macro, + clippy::deprecated_cfg_attr, + clippy::separated_literal_suffix, + deprecated )] +#![forbid(deprecated_in_future)] #![forbid(unsafe_code)] #![allow(clippy::missing_errors_doc, clippy::module_name_repetitions)] -pub mod audio; mod error; -pub mod image; -pub mod video; +pub mod exif; +pub mod ffmpeg; -pub use audio::AudioMetadata; pub use error::{Error, Result}; -pub use image::ImageMetadata; -pub use video::VideoMetadata; - -#[derive(Clone, PartialEq, Debug, serde::Serialize, serde::Deserialize, specta::Type)] -#[serde(tag = "type")] -pub enum MediaMetadata { - Image(Box), - Video(Box), - Audio(Box), -} +pub use exif::ExifMetadata; +pub use ffmpeg::FFmpegMetadata; diff --git a/crates/media-metadata/src/video.rs b/crates/media-metadata/src/video.rs deleted file mode 100644 index a1c4922dd..000000000 --- a/crates/media-metadata/src/video.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::path::Path; - -use crate::Result; - -#[derive( - Default, Clone, PartialEq, Eq, Debug, serde::Serialize, serde::Deserialize, specta::Type, -)] -pub struct VideoMetadata { - duration: Option, // bigint - video_codec: Option, - audio_codec: Option, -} - -impl VideoMetadata { - #[allow(clippy::missing_errors_doc)] - #[allow(clippy::missing_panics_doc)] - pub fn from_path(_path: impl AsRef) -> Result { - todo!() - } -} diff --git a/crates/p2p-block/src/block_size.rs b/crates/p2p-block/src/block_size.rs deleted file mode 100644 index 8e92c93e9..000000000 --- a/crates/p2p-block/src/block_size.rs +++ /dev/null @@ -1,55 +0,0 @@ -use std::io; - -use tokio::io::{AsyncRead, AsyncReadExt}; - -/// TODO -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct BlockSize(u32); // Max block size is gonna be 3.9GB which is stupidly overkill - -impl BlockSize { - // TODO: Validating `BlockSize` are multiple of 2, i think. Idk why but BEP does it. - - pub async fn from_stream(stream: &mut (impl AsyncRead + Unpin)) -> io::Result { - stream.read_u32_le().await.map(Self) - } - - #[must_use] - pub fn to_bytes(&self) -> [u8; 4] { - self.0.to_le_bytes() - } - - #[must_use] - pub fn from_size(size: u64) -> Self { - // TODO: Something like: https://docs.syncthing.net/specs/bep-v1.html#selection-of-block-size - Self(131_072) // 128 KiB - } - - /// This is super dangerous as it doesn't enforce any assumptions of the protocol and is designed just for tests. - #[cfg(test)] - #[must_use] - pub fn dangerously_new(size: u32) -> Self { - Self(size) - } - - #[must_use] - pub fn size(&self) -> u32 { - self.0 - } -} - -#[cfg(test)] -mod tests { - use std::io::Cursor; - - use super::*; - - #[tokio::test] - async fn test_block_size() { - let req = BlockSize::dangerously_new(5); - let bytes = req.to_bytes(); - let req2 = BlockSize::from_stream(&mut Cursor::new(bytes)) - .await - .unwrap(); - assert_eq!(req, req2); - } -} diff --git a/crates/p2p-tunnel/src/lib.rs b/crates/p2p-tunnel/src/lib.rs deleted file mode 100644 index 397f860f5..000000000 --- a/crates/p2p-tunnel/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! A system for creating encrypted tunnels between peers over untrusted connections. - -mod tunnel; - -pub use sd_p2p::{Identity, IdentityErr, RemoteIdentity}; -pub use tunnel::*; diff --git a/crates/p2p-tunnel/src/tunnel.rs b/crates/p2p-tunnel/src/tunnel.rs deleted file mode 100644 index 9a83c4e9e..000000000 --- a/crates/p2p-tunnel/src/tunnel.rs +++ /dev/null @@ -1,77 +0,0 @@ -use std::{ - io, - pin::Pin, - task::{Context, Poll}, -}; - -use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf}; - -use sd_p2p::UnicastStream; - -#[derive(Debug)] -pub struct Tunnel { - stream: UnicastStream, -} - -impl Tunnel { - // TODO: Proper errors - pub async fn initiator(mut stream: UnicastStream) -> Result { - stream - .write_all(&[b'T']) - .await - .map_err(|_| "Error writing discriminator")?; - - // TODO: Do pairing + authentication - - Ok(Self { stream }) - } - - // TODO: Proper errors - pub async fn responder(mut stream: UnicastStream) -> Result { - let discriminator = stream - .read_u8() - .await - .map_err(|_| "Error reading discriminator. Is this stream actually a tunnel?")?; - if discriminator != b'T' { - return Err("Invalid discriminator. Is this stream actually a tunnel?"); - } - - // TODO: Do pairing + authentication - - Ok(Self { stream }) - } -} - -impl AsyncRead for Tunnel { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut ReadBuf<'_>, - ) -> Poll> { - // TODO: Do decryption - - Pin::new(&mut self.get_mut().stream).poll_read(cx, buf) - } -} - -impl AsyncWrite for Tunnel { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &[u8], - ) -> Poll> { - // TODO: Do encryption - - Pin::new(&mut self.get_mut().stream).poll_write(cx, buf) - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - Pin::new(&mut self.get_mut().stream).poll_flush(cx) - } - - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - Pin::new(&mut self.get_mut().stream).poll_shutdown(cx) - } -} - -// TODO: Unit tests diff --git a/crates/p2p/Cargo.toml b/crates/p2p/Cargo.toml index 9b135796b..c670181f8 100644 --- a/crates/p2p/Cargo.toml +++ b/crates/p2p/Cargo.toml @@ -15,8 +15,14 @@ default = [] specta = [] [dependencies] +# Workspace dependencies base64 = { workspace = true } +base91 = { workspace = true } +ed25519-dalek = { workspace = true } +futures = { workspace = true } pin-project-lite = { workspace = true } +reqwest = { workspace = true } +rmp-serde = { workspace = true } serde = { workspace = true, features = ["derive"] } specta = { workspace = true } thiserror = { workspace = true } @@ -32,13 +38,15 @@ tokio-util = { workspace = true, features = ["compat"] } tracing = { workspace = true } uuid = { workspace = true, features = ["serde"] } -ed25519-dalek = { version = "2.1.1", features = [] } +# Specific P2P dependencies +dns-lookup = "2.0" flume = "=0.11.0" # Must match version used by `mdns-sd` futures-core = "0.3.30" +hash_map_diff = "0.2.0" if-watch = { version = "=3.2.0", features = [ "tokio", -] } # Override the features of if-watch which is used by libp2p-quic -libp2p = { version = "0.53.2", features = [ +] } # Override features used by libp2p-quic +libp2p = { version = "=0.53.2", features = [ "tokio", "serde", "macros", @@ -48,20 +56,17 @@ libp2p = { version = "0.53.2", features = [ "yamux", "noise", "dcutr", -] } -libp2p-stream = "0.1.0-alpha" -mdns-sd = "0.10.3" -rand_core = { version = "0.6.4" } -streamunordered = "0.5.3" -zeroize = { version = "1.7.0", features = ["derive"] } -base91 = "0.1.0" +] } # Update blocked due to custom patch +libp2p-stream = "=0.1.0-alpha" # Update blocked due to custom patch +mdns-sd = "0.11.1" +rand_core = "0.6.4" sha256 = "1.5.0" -stable-vec = "0.4.0" -hash_map_diff = "0.2.0" -sync_wrapper = "0.1.2" -reqwest.workspace = true +stable-vec = "0.4.1" +streamunordered = "0.5.3" +sync_wrapper = "1.0" +zeroize = { version = "1.8", features = ["derive"] } [dev-dependencies] tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -tracing-subscriber = { version = "0.3.18" } +tracing-subscriber = { workspace = true } uuid = { workspace = true, features = ["v4"] } diff --git a/crates/p2p-block/Cargo.toml b/crates/p2p/crates/block/Cargo.toml similarity index 78% rename from crates/p2p-block/Cargo.toml rename to crates/p2p/crates/block/Cargo.toml index 7e23b35d3..033345e04 100644 --- a/crates/p2p-block/Cargo.toml +++ b/crates/p2p/crates/block/Cargo.toml @@ -8,9 +8,10 @@ repository.workspace = true [dependencies] # Spacedrive Sub-crates -sd-p2p = { path = "../p2p" } -sd-p2p-proto = { path = "../p2p-proto" } +sd-p2p = { path = "../../" } +sd-p2p-proto = { path = "../proto" } +# Workspace dependencies thiserror = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } diff --git a/crates/p2p-block/src/block.rs b/crates/p2p/crates/block/src/block.rs similarity index 99% rename from crates/p2p-block/src/block.rs rename to crates/p2p/crates/block/src/block.rs index be64f4e3c..12268c822 100644 --- a/crates/p2p-block/src/block.rs +++ b/crates/p2p/crates/block/src/block.rs @@ -58,8 +58,6 @@ impl<'a> Block<'a> { mod tests { use std::io::Cursor; - use crate::BlockSize; - use super::*; #[tokio::test] diff --git a/crates/p2p/crates/block/src/block_size.rs b/crates/p2p/crates/block/src/block_size.rs new file mode 100644 index 000000000..0aac54de2 --- /dev/null +++ b/crates/p2p/crates/block/src/block_size.rs @@ -0,0 +1,120 @@ +#![allow(non_upper_case_globals)] + +use std::io; + +use tokio::io::{AsyncRead, AsyncReadExt}; + +const KiB: u32 = 1024; +const MiB: u32 = 1024 * KiB; +const GiB: u32 = 1024 * MiB; + +/// defines the size of each chunk of data that is sent +/// +/// We store this in an enum so it's super efficient. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum BlockSize { + _128KiB, + _256KiB, + _512KiB, + _1MiB, + _2MiB, + _4MiB, + _8MiB, + _16MiB, +} + +impl BlockSize { + /// Determine the optimal block size for a given file size + #[must_use] + pub fn from_file_size(size: u64) -> Self { + // Values directly copied from https://docs.syncthing.net/specs/bep-v1.html#selection-of-block-size + if size < 250 * u64::from(MiB) { + return Self::_128KiB; + } else if size < 500 * u64::from(MiB) { + return Self::_256KiB; + } else if size < u64::from(GiB) { + return Self::_512KiB; + } else if size < 2 * u64::from(GiB) { + return Self::_1MiB; + } else if size < 4 * u64::from(GiB) { + return Self::_2MiB; + } else if size < 8 * u64::from(GiB) { + return Self::_4MiB; + } else if size < 16 * u64::from(GiB) { + return Self::_8MiB; + } + Self::_16MiB + } + + /// Get the size of the block in bytes + #[must_use] + pub fn size(&self) -> u32 { + match self { + Self::_128KiB => 128 * KiB, + Self::_256KiB => 256 * KiB, + Self::_512KiB => 512 * KiB, + Self::_1MiB => MiB, + Self::_2MiB => 2 * MiB, + Self::_4MiB => 4 * MiB, + Self::_8MiB => 8 * MiB, + Self::_16MiB => 16 * MiB, + } + } + + pub async fn from_stream(stream: &mut (impl AsyncRead + Unpin)) -> io::Result { + // WARNING: Be careful modifying this cause it may break backwards/forwards-compatibility + match stream.read_u8().await? { + 0 => Ok(Self::_128KiB), + 1 => Ok(Self::_256KiB), + 2 => Ok(Self::_512KiB), + 3 => Ok(Self::_1MiB), + 4 => Ok(Self::_2MiB), + 5 => Ok(Self::_4MiB), + 6 => Ok(Self::_8MiB), + 7 => Ok(Self::_16MiB), + _ => Err(io::Error::new( + io::ErrorKind::InvalidData, + "Invalid block size", + )), + } + } + + #[must_use] + pub fn to_bytes(&self) -> [u8; 1] { + // WARNING: Be careful modifying this cause it may break backwards/forwards-compatibility + [match self { + Self::_128KiB => 0, + Self::_256KiB => 1, + Self::_512KiB => 2, + Self::_1MiB => 3, + Self::_2MiB => 4, + Self::_4MiB => 5, + Self::_8MiB => 6, + Self::_16MiB => 7, + }] + } +} + +#[cfg(test)] +mod tests { + use std::io::Cursor; + + use super::*; + + #[tokio::test] + async fn test_block_size() { + let req = BlockSize::_128KiB; + let bytes = req.to_bytes(); + let req2 = BlockSize::from_stream(&mut Cursor::new(bytes)) + .await + .unwrap(); + assert_eq!(req, req2); + + let req = BlockSize::_16MiB; + let bytes = req.to_bytes(); + let req2 = BlockSize::from_stream(&mut Cursor::new(bytes)) + .await + .unwrap(); + assert_eq!(req, req2); + } +} diff --git a/crates/p2p-block/src/lib.rs b/crates/p2p/crates/block/src/lib.rs similarity index 84% rename from crates/p2p-block/src/lib.rs rename to crates/p2p/crates/block/src/lib.rs index 4582769ea..7d6554dfd 100644 --- a/crates/p2p-block/src/lib.rs +++ b/crates/p2p/crates/block/src/lib.rs @@ -1,32 +1,22 @@ -//! TODO -// TODO: Clippy lints here - -//! Spaceblock is a file transfer protocol that uses a block based system to transfer files. -//! This protocol is modelled after `SyncThing`'s BEP protocol. A huge thanks to it's original authors! +//! A protocol for efficiently and securely transferring files between peers. +//! +//! Goals: +//! - Fast - Transfer files as quickly as possible +//! - Safe - Verify the files integrity on both ends +//! +//! This protocol was heavily inspired by SyncThing's Block Exchange Protocol protocol although it's not compatible. //! You can read more about it here: -#![allow(unused)] // TODO: This module is still in heavy development! +//! +#![warn(clippy::unwrap_used, clippy::panic)] use std::{ io, - marker::PhantomData, - path::{Path, PathBuf}, - string::FromUtf8Error, - sync::{ - atomic::{AtomicBool, Ordering}, - Arc, - }, + sync::atomic::{AtomicBool, Ordering}, }; -use thiserror::Error; -use tokio::{ - fs::File, - io::{AsyncBufRead, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, BufReader}, -}; +use tokio::io::{AsyncBufRead, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; use tracing::debug; -use sd_p2p::UnicastStream; -use sd_p2p_proto::{decode, encode}; - mod block; mod block_size; mod sb_request; @@ -123,9 +113,8 @@ where ); // SAFETY: Percent must be between 0 and 100 if read == 0 { - #[allow(clippy::panic)] // TODO: Remove panic - // The file may have been modified during sender on the sender and we don't account for that. - // TODO: Error handling + send error to remote + // The file may have been modified during sender on the sender and we don't account for that. + // TODO: Error handling + send error to remote assert!( (offset + read as u64) == self.reqs.requests[self.i].size, "File sending has stopped but it doesn't match the expected length!" @@ -236,9 +225,9 @@ where #[cfg(test)] mod tests { - use std::{io::Cursor, mem}; + use std::{io::Cursor, mem, sync::Arc}; - use tokio::sync::oneshot; + use tokio::{io::BufReader, sync::oneshot}; use uuid::Uuid; use super::*; @@ -251,7 +240,7 @@ mod tests { let data = b"Spacedrive".to_vec(); let req = SpaceblockRequests { id: Uuid::new_v4(), - block_size: BlockSize::from_size(data.len() as u64), + block_size: BlockSize::from_file_size(data.len() as u64), requests: vec![SpaceblockRequest { name: "Demo".to_string(), size: data.len() as u64, @@ -268,7 +257,7 @@ mod tests { tx.send(()).unwrap(); Transfer::new(&req, |_| {}, &Default::default()) .send(&mut client, file) - .await; + .await } }); @@ -277,7 +266,8 @@ mod tests { let mut result = Vec::new(); Transfer::new(&req, |_| {}, &Default::default()) .receive(&mut server, &mut result) - .await; + .await + .unwrap(); assert_eq!(result, data); } @@ -287,9 +277,8 @@ mod tests { let (mut client, mut server) = tokio::io::duplex(64); // This is sent out of band of Spaceblock - let block_size = 131_072_u32; - let data = vec![0u8; block_size as usize * 4]; // Let's pacman some RAM - let block_size = BlockSize::dangerously_new(block_size); + let block_size = BlockSize::_128KiB; + let data = vec![0u8; block_size.size() as usize * 4]; // Let's pacman some RAM let req = SpaceblockRequests { id: Uuid::new_v4(), @@ -310,7 +299,7 @@ mod tests { tx.send(()).unwrap(); Transfer::new(&req, |_| {}, &Default::default()) .send(&mut client, file) - .await; + .await } }); @@ -319,7 +308,9 @@ mod tests { let mut result = Vec::new(); Transfer::new(&req, |_| {}, &Default::default()) .receive(&mut server, &mut result) - .await; + .await + .unwrap(); + assert_eq!(result, data); } @@ -328,9 +319,8 @@ mod tests { let (mut client, mut server) = tokio::io::duplex(64); // This is sent out of band of Spaceblock - let block_size = 25u32; - let data = vec![0u8; block_size as usize]; - let block_size = BlockSize::dangerously_new(block_size); // TODO: Determine it using proper algo instead of hardcoding it + let block_size = BlockSize::_128KiB; + let data = vec![0u8; block_size.size() as usize]; let req = SpaceblockRequests { id: Uuid::new_v4(), @@ -352,14 +342,14 @@ mod tests { Transfer::new(&req, |_| {}, &Arc::new(AtomicBool::new(true))) .send(&mut client, file) - .await; + .await } }); rx.await.unwrap(); let mut result = Vec::new(); - Transfer::new(&req, |_| {}, &Default::default()) + let _ = Transfer::new(&req, |_| {}, &Default::default()) .receive(&mut server, &mut result) .await; assert_eq!(result, Vec::::new()); // Cancelled by sender so no data @@ -370,9 +360,8 @@ mod tests { let (mut client, mut server) = tokio::io::duplex(64); // This is sent out of band of Spaceblock - let block_size = 25u32; - let data = vec![0u8; block_size as usize]; - let block_size = BlockSize::dangerously_new(block_size); // TODO: Determine it using proper algo instead of hardcoding it + let block_size = BlockSize::_128KiB; + let data = vec![0u8; block_size.size() as usize]; let req = SpaceblockRequests { id: Uuid::new_v4(), @@ -394,14 +383,14 @@ mod tests { Transfer::new(&req, |_| {}, &Default::default()) .send(&mut client, file) - .await; + .await } }); rx.await.unwrap(); let mut result = Vec::new(); - Transfer::new(&req, |_| {}, &Arc::new(AtomicBool::new(true))) + let _ = Transfer::new(&req, |_| {}, &Arc::new(AtomicBool::new(true))) .receive(&mut server, &mut result) .await; assert_eq!(result, Vec::::new()); // Cancelled by sender so no data @@ -413,9 +402,8 @@ mod tests { let (mut client, mut server) = tokio::io::duplex(64); // This is sent out of band of Spaceblock - let block_size = 25u32; + let block_size = BlockSize::_128KiB; let data = vec![0u8; 0]; // Zero sized file - let block_size = BlockSize::dangerously_new(block_size); // TODO: Determine it using proper algo instead of hardcoding it let req = SpaceblockRequests { id: Uuid::new_v4(), @@ -437,14 +425,14 @@ mod tests { Transfer::new(&req, |_| {}, &Default::default()) .send(&mut client, file) - .await; + .await } }); rx.await.unwrap(); let mut result = Vec::new(); - Transfer::new(&req, |_| {}, &Default::default()) + let _ = Transfer::new(&req, |_| {}, &Default::default()) .receive(&mut server, &mut result) .await; assert_eq!(result, Vec::::new()); // Cancelled by sender so no data diff --git a/crates/p2p-block/src/sb_request.rs b/crates/p2p/crates/block/src/sb_request.rs similarity index 95% rename from crates/p2p-block/src/sb_request.rs rename to crates/p2p/crates/block/src/sb_request.rs index 81af2d0cc..1384ca5ed 100644 --- a/crates/p2p-block/src/sb_request.rs +++ b/crates/p2p/crates/block/src/sb_request.rs @@ -88,7 +88,7 @@ impl SpaceblockRequests { .map_err(SpaceblockRequestsError::InvalidLen)?; let mut requests = Vec::new(); - for i in 0..size { + for _i in 0..size { requests.push(SpaceblockRequest::from_stream(stream).await?); } @@ -106,7 +106,6 @@ impl SpaceblockRequests { block_size, requests, } = self; - #[allow(clippy::panic)] // TODO: Remove this panic assert!( requests.len() <= 255, "Can't Spacedrop more than 255 files at once!" @@ -167,10 +166,9 @@ impl SpaceblockRequest { #[must_use] pub fn to_bytes(&self) -> Vec { - let Self { name, size, range } = self; let mut buf = Vec::new(); - encode::string(&mut buf, name); + encode::string(&mut buf, &self.name); buf.extend_from_slice(&self.size.to_le_bytes()); buf.extend_from_slice(&self.range.to_bytes()); buf @@ -200,7 +198,7 @@ mod tests { async fn test_spaceblock_requests_empty() { let req = SpaceblockRequests { id: Uuid::new_v4(), - block_size: BlockSize::from_size(42069), + block_size: BlockSize::from_file_size(42069), requests: vec![], }; @@ -215,7 +213,7 @@ mod tests { async fn test_spaceblock_requests_one() { let req = SpaceblockRequests { id: Uuid::new_v4(), - block_size: BlockSize::from_size(42069), + block_size: BlockSize::from_file_size(42069), requests: vec![SpaceblockRequest { name: "Demo".to_string(), size: 42069, @@ -246,7 +244,7 @@ mod tests { async fn test_spaceblock_requests_many() { let req = SpaceblockRequests { id: Uuid::new_v4(), - block_size: BlockSize::from_size(42069), + block_size: BlockSize::from_file_size(42069), requests: vec![ SpaceblockRequest { name: "Demo".to_string(), diff --git a/crates/p2p-proto/Cargo.toml b/crates/p2p/crates/proto/Cargo.toml similarity index 89% rename from crates/p2p-proto/Cargo.toml rename to crates/p2p/crates/proto/Cargo.toml index 4d7b43135..51bd00b91 100644 --- a/crates/p2p-proto/Cargo.toml +++ b/crates/p2p/crates/proto/Cargo.toml @@ -7,8 +7,7 @@ edition.workspace = true repository.workspace = true [dependencies] +ed25519-dalek = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["io-util"] } uuid = { workspace = true } - -ed25519-dalek = "2.1.1" diff --git a/crates/p2p-proto/src/lib.rs b/crates/p2p/crates/proto/src/lib.rs similarity index 100% rename from crates/p2p-proto/src/lib.rs rename to crates/p2p/crates/proto/src/lib.rs diff --git a/crates/p2p-tunnel/Cargo.toml b/crates/p2p/crates/tunnel/Cargo.toml similarity index 61% rename from crates/p2p-tunnel/Cargo.toml rename to crates/p2p/crates/tunnel/Cargo.toml index de13cbab9..816a5cef1 100644 --- a/crates/p2p-tunnel/Cargo.toml +++ b/crates/p2p/crates/tunnel/Cargo.toml @@ -8,6 +8,10 @@ repository.workspace = true [dependencies] # Spacedrive Sub-crates -sd-p2p = { path = "../p2p" } +sd-p2p = { path = "../../" } +sd-p2p-proto = { path = "../proto" } +# Workspace dependencies tokio = { workspace = true, features = ["io-util"] } +thiserror = { workspace = true } +uuid = { workspace = true, features = ["v4"] } diff --git a/crates/p2p/crates/tunnel/src/lib.rs b/crates/p2p/crates/tunnel/src/lib.rs new file mode 100644 index 000000000..df7706255 --- /dev/null +++ b/crates/p2p/crates/tunnel/src/lib.rs @@ -0,0 +1,143 @@ +//! A system for creating encrypted tunnels between peers over untrusted connections. + +use std::{ + io, + pin::Pin, + task::{Context, Poll}, +}; + +use sd_p2p_proto::{decode, encode}; +use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf}; + +use thiserror::Error; + +use sd_p2p::{Identity, IdentityErr, RemoteIdentity, UnicastStream}; + +#[derive(Debug, Error)] +pub enum TunnelError { + #[error("Error writing discriminator.")] + DiscriminatorWriteError, + #[error("Error reading discriminator. Is this stream actually a tunnel?")] + DiscriminatorReadError, + #[error("Invalid discriminator. Is this stream actually a tunnel?")] + InvalidDiscriminator, + #[error("Error sending library id: {0:?}")] + ErrorSendingLibraryId(io::Error), + #[error("Error receiving library identity: {0:?}")] + ErrorReceivingLibraryIdentity(decode::Error), + #[error("Error decoding library identity: {0:?}")] + ErrorDecodingLibraryIdentity(IdentityErr), +} + +/// An encrypted tunnel between two libraries. +/// +/// This sits on top of the existing node to node encryption provided by Quic. +/// +/// It's primarily designed to avoid an attack where traffic flows: +/// node <-> attacker node <-> node +/// The attackers node can't break TLS but if they get in the middle they can present their own node identity to each side and then intercept library related traffic. +/// To avoid that we use this tunnel to encrypt all library related traffic so it can only be decoded by another instance of the same library. +#[derive(Debug)] +pub struct Tunnel { + stream: UnicastStream, + library_remote_id: RemoteIdentity, +} + +impl Tunnel { + /// Create a new tunnel. + /// + /// This should be used by the node that initiated the request which this tunnel is used for. + pub async fn initiator( + mut stream: UnicastStream, + library_identity: &Identity, + ) -> Result { + stream + .write_all(&[b'T']) + .await + .map_err(|_| TunnelError::DiscriminatorWriteError)?; + + let mut buf = vec![]; + encode::buf(&mut buf, &library_identity.to_remote_identity().get_bytes()); + stream + .write_all(&buf) + .await + .map_err(TunnelError::ErrorSendingLibraryId)?; + + // TODO: Do encryption things + + Ok(Self { + stream, + library_remote_id: library_identity.to_remote_identity(), + }) + } + + /// Create a new tunnel. + /// + /// This should be used by the node that responded to the request which this tunnel is used for. + pub async fn responder(mut stream: UnicastStream) -> Result { + let discriminator = stream + .read_u8() + .await + .map_err(|_| TunnelError::DiscriminatorReadError)?; + if discriminator != b'T' { + return Err(TunnelError::InvalidDiscriminator); + } + + // TODO: Blindly decoding this from the stream is not secure. We need a cryptographic handshake here to prove the peer on the other ends is holding the private key. + let library_remote_id = decode::buf(&mut stream) + .await + .map_err(TunnelError::ErrorReceivingLibraryIdentity)?; + + let library_remote_id = RemoteIdentity::from_bytes(&library_remote_id) + .map_err(TunnelError::ErrorDecodingLibraryIdentity)?; + + // TODO: Do encryption things + + Ok(Self { + library_remote_id, + stream, + }) + } + + /// Get the `RemoteIdentity` of the peer on the other end of the tunnel. + pub fn node_remote_identity(&self) -> RemoteIdentity { + self.stream.remote_identity() + } + + /// Get the `RemoteIdentity` of the library instance on the other end of the tunnel. + pub fn library_remote_identity(&self) -> RemoteIdentity { + self.library_remote_id + } +} + +impl AsyncRead for Tunnel { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &mut ReadBuf<'_>, + ) -> Poll> { + // TODO: Do decryption + + Pin::new(&mut self.get_mut().stream).poll_read(cx, buf) + } +} + +impl AsyncWrite for Tunnel { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + // TODO: Do encryption + + Pin::new(&mut self.get_mut().stream).poll_write(cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.get_mut().stream).poll_flush(cx) + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.get_mut().stream).poll_shutdown(cx) + } +} diff --git a/crates/p2p/src/hook.rs b/crates/p2p/src/hook.rs new file mode 100644 index 000000000..c3d9e0cbe --- /dev/null +++ b/crates/p2p/src/hook.rs @@ -0,0 +1,141 @@ +use std::{ + collections::{BTreeSet, HashSet}, + fmt, + net::SocketAddr, + sync::Arc, +}; + +use flume::Sender; +use tokio::sync::oneshot; + +use crate::{Peer, PeerConnectionCandidate, RemoteIdentity}; + +#[derive(Debug, Clone)] +pub enum HookEvent { + /// `P2P::service` has changed + MetadataModified, + + /// A new listener was registered with the P2P system. + ListenerRegistered(ListenerId), + /// A listener's address was added. + ListenerAddrAdded(ListenerId, SocketAddr), + /// A listener's address was removed. + ListenerAddrRemoved(ListenerId, SocketAddr), + /// A listener was unregistered from the P2P system. + ListenerUnregistered(ListenerId), + + /// A peer was inserted into `P2P::peers` + /// This peer could have connected to or have been discovered by a hook. + PeerAvailable(Arc), + /// A peer was removed from `P2P::peers` + /// This is due to it no longer being discovered, containing no active connections or available connection methods. + PeerUnavailable(RemoteIdentity), + + /// A peer was discovered by a hook + /// This will fire for *every peer* per every *hook* that discovers it. + PeerDiscoveredBy(HookId, Arc), + /// A hook expired a peer + /// This will fire for *every peer* per every *hook* that discovers it. + PeerExpiredBy(HookId, RemoteIdentity), + + /// "Connections" are an internal concept to the P2P library but they will be automatically triggered by `Peer::new_stream`. + /// They are a concept users of the application may care about so they are exposed here. + + /// A new listener established a connection with a peer + PeerConnectedWith(ListenerId, Arc), + /// A connection closed with a peer. + PeerDisconnectedWith(ListenerId, RemoteIdentity), + + /// Your hook or the P2P system was told to shutdown. + Shutdown { + // We can detect when this guard is dropped, it doesn't need to be used. + _guard: ShutdownGuard, + }, +} + +#[derive(Debug)] +pub struct ShutdownGuard(pub(crate) Option>); + +impl ShutdownGuard { + pub(crate) fn new() -> (Self, oneshot::Receiver<()>) { + let (tx, rx) = oneshot::channel(); + (Self(Some(tx)), rx) + } +} + +impl Drop for ShutdownGuard { + fn drop(&mut self) { + if let Some(tx) = self.0.take() { + let _ = tx.send(()); + } + } +} + +impl Clone for ShutdownGuard { + fn clone(&self) -> Self { + Self(None) + } +} + +#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] +pub struct HookId(pub(crate) usize); + +#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] +pub struct ListenerId(pub(crate) usize); + +impl From for HookId { + fn from(value: ListenerId) -> Self { + Self(value.0) + } +} + +#[derive(Debug)] +pub(crate) struct Hook { + /// A name used for debugging purposes. + pub(crate) name: &'static str, + /// A channel to send events to the hook. + /// This hooks implementing will be responsible for subscribing to this channel. + pub(crate) tx: Sender, + /// If this hook is a listener this will be set. + pub(crate) listener: Option, +} + +impl Hook { + pub fn send(&self, event: HookEvent) { + let _ = self.tx.send(event); + } + + pub fn acceptor( + &self, + id: ListenerId, + peer: &Arc, + addrs: &BTreeSet, + ) { + if let Some(listener) = &self.listener { + (listener.acceptor.0)(id, peer, addrs); + } + } +} + +#[derive(Debug)] +pub(crate) struct ListenerData { + /// The address the listener is bound to. + /// These will be advertised by any discovery methods attached to the P2P system. + pub addrs: HashSet, + /// This is a function over a channel because we need to ensure the code runs prior to the peer being emitted to the application. + /// If not the peer would have no registered way to connect to it initially which would be confusing. + #[allow(clippy::type_complexity)] + pub acceptor: HandlerFn< + Arc, &BTreeSet) + Send + Sync>, + >, +} + +/// A little wrapper for functions to make them `Debug`. +#[derive(Clone)] +pub(crate) struct HandlerFn(pub(crate) F); + +impl fmt::Debug for HandlerFn { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "HandlerFn") + } +} diff --git a/crates/p2p/src/hooks.rs b/crates/p2p/src/hooks.rs index c3d9e0cbe..f8966e7eb 100644 --- a/crates/p2p/src/hooks.rs +++ b/crates/p2p/src/hooks.rs @@ -1,141 +1,9 @@ -use std::{ - collections::{BTreeSet, HashSet}, - fmt, - net::SocketAddr, - sync::Arc, -}; +//! Components implemented as P2P hooks. +//! +//! Although these are included within `sd_p2p` you could be implemented in userspace. -use flume::Sender; -use tokio::sync::oneshot; +mod mdns; +mod quic; -use crate::{Peer, PeerConnectionCandidate, RemoteIdentity}; - -#[derive(Debug, Clone)] -pub enum HookEvent { - /// `P2P::service` has changed - MetadataModified, - - /// A new listener was registered with the P2P system. - ListenerRegistered(ListenerId), - /// A listener's address was added. - ListenerAddrAdded(ListenerId, SocketAddr), - /// A listener's address was removed. - ListenerAddrRemoved(ListenerId, SocketAddr), - /// A listener was unregistered from the P2P system. - ListenerUnregistered(ListenerId), - - /// A peer was inserted into `P2P::peers` - /// This peer could have connected to or have been discovered by a hook. - PeerAvailable(Arc), - /// A peer was removed from `P2P::peers` - /// This is due to it no longer being discovered, containing no active connections or available connection methods. - PeerUnavailable(RemoteIdentity), - - /// A peer was discovered by a hook - /// This will fire for *every peer* per every *hook* that discovers it. - PeerDiscoveredBy(HookId, Arc), - /// A hook expired a peer - /// This will fire for *every peer* per every *hook* that discovers it. - PeerExpiredBy(HookId, RemoteIdentity), - - /// "Connections" are an internal concept to the P2P library but they will be automatically triggered by `Peer::new_stream`. - /// They are a concept users of the application may care about so they are exposed here. - - /// A new listener established a connection with a peer - PeerConnectedWith(ListenerId, Arc), - /// A connection closed with a peer. - PeerDisconnectedWith(ListenerId, RemoteIdentity), - - /// Your hook or the P2P system was told to shutdown. - Shutdown { - // We can detect when this guard is dropped, it doesn't need to be used. - _guard: ShutdownGuard, - }, -} - -#[derive(Debug)] -pub struct ShutdownGuard(pub(crate) Option>); - -impl ShutdownGuard { - pub(crate) fn new() -> (Self, oneshot::Receiver<()>) { - let (tx, rx) = oneshot::channel(); - (Self(Some(tx)), rx) - } -} - -impl Drop for ShutdownGuard { - fn drop(&mut self) { - if let Some(tx) = self.0.take() { - let _ = tx.send(()); - } - } -} - -impl Clone for ShutdownGuard { - fn clone(&self) -> Self { - Self(None) - } -} - -#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] -pub struct HookId(pub(crate) usize); - -#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)] -pub struct ListenerId(pub(crate) usize); - -impl From for HookId { - fn from(value: ListenerId) -> Self { - Self(value.0) - } -} - -#[derive(Debug)] -pub(crate) struct Hook { - /// A name used for debugging purposes. - pub(crate) name: &'static str, - /// A channel to send events to the hook. - /// This hooks implementing will be responsible for subscribing to this channel. - pub(crate) tx: Sender, - /// If this hook is a listener this will be set. - pub(crate) listener: Option, -} - -impl Hook { - pub fn send(&self, event: HookEvent) { - let _ = self.tx.send(event); - } - - pub fn acceptor( - &self, - id: ListenerId, - peer: &Arc, - addrs: &BTreeSet, - ) { - if let Some(listener) = &self.listener { - (listener.acceptor.0)(id, peer, addrs); - } - } -} - -#[derive(Debug)] -pub(crate) struct ListenerData { - /// The address the listener is bound to. - /// These will be advertised by any discovery methods attached to the P2P system. - pub addrs: HashSet, - /// This is a function over a channel because we need to ensure the code runs prior to the peer being emitted to the application. - /// If not the peer would have no registered way to connect to it initially which would be confusing. - #[allow(clippy::type_complexity)] - pub acceptor: HandlerFn< - Arc, &BTreeSet) + Send + Sync>, - >, -} - -/// A little wrapper for functions to make them `Debug`. -#[derive(Clone)] -pub(crate) struct HandlerFn(pub(crate) F); - -impl fmt::Debug for HandlerFn { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "HandlerFn") - } -} +pub use mdns::Mdns; +pub use quic::{Libp2pPeerId, QuicHandle, QuicTransport, RelayServerEntry}; diff --git a/crates/p2p/src/mdns.rs b/crates/p2p/src/hooks/mdns.rs similarity index 91% rename from crates/p2p/src/mdns.rs rename to crates/p2p/src/hooks/mdns.rs index 3319b5a69..81511f402 100644 --- a/crates/p2p/src/mdns.rs +++ b/crates/p2p/src/hooks/mdns.rs @@ -1,3 +1,7 @@ +//! mDNS-based service discovery. +//! +//! This uses [mdns-sd](https://docs.rs/mdns-sd) under the hood. + use std::{ collections::HashMap, net::SocketAddr, pin::Pin, str::FromStr, sync::Arc, time::Duration, }; @@ -29,6 +33,22 @@ impl Mdns { Ok(Self { p2p, hook_id }) } + // pub fn is_discovered_by(&self, identity: &RemoteIdentity) -> bool { + // self.p2p + // .peers() + // .get(identity) + // .map(|p| p.discovered_by().contains(&self.hook_id)) + // .unwrap_or(false) + // } + + // pub fn is_connected_with(&self, identity: &RemoteIdentity) -> bool { + // self.p2p + // .peers() + // .get(identity) + // .map(|p| p.is_connected_with_hook(self.hook_id)) + // .unwrap_or(false) + // } + pub async fn shutdown(self) { self.p2p.unregister_hook(self.hook_id).await; } diff --git a/crates/p2p/src/hooks/quic.rs b/crates/p2p/src/hooks/quic.rs new file mode 100644 index 000000000..b81bae73a --- /dev/null +++ b/crates/p2p/src/hooks/quic.rs @@ -0,0 +1,10 @@ +//! Quic-based transport. +//! +//! This uses [libp2p](https://docs.rs/libp2p) under the hood. + +pub(super) mod handle; +pub(super) mod transport; +pub(super) mod utils; + +pub use handle::QuicHandle; +pub use transport::{Libp2pPeerId, QuicTransport, RelayServerEntry}; diff --git a/crates/p2p/src/hooks/quic/handle.rs b/crates/p2p/src/hooks/quic/handle.rs new file mode 100644 index 000000000..15c667591 --- /dev/null +++ b/crates/p2p/src/hooks/quic/handle.rs @@ -0,0 +1,122 @@ +use std::{ + collections::{HashMap, HashSet}, + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, Mutex, PoisonError, + }, +}; + +use tokio::sync::Notify; + +use crate::{HookId, PeerConnectionCandidate, RemoteIdentity, P2P}; + +/// A handle to the QUIC hook. +/// +/// This allows for manually registering peers, which is required so that we can ask the relay to connect to them. +#[derive(Debug)] +pub struct QuicHandle { + pub(super) shutdown: Notify, + pub(super) p2p: Arc, + pub(super) hook_id: HookId, + pub(super) nodes: Mutex>>, + pub(super) enabled: AtomicBool, + pub(super) connected_via_relay: Mutex>, +} + +impl QuicHandle { + /// A future that resolves when the QUIC hook is shut down. + pub async fn shutdown(&self) { + self.shutdown.notified().await + } + + /// add a new peer to be tracked. + /// + /// This will allow the relay to connect to it. + pub fn track_peer(&self, identity: RemoteIdentity, metadata: HashMap) { + self.nodes + .lock() + .unwrap_or_else(PoisonError::into_inner) + .insert(identity, metadata.clone()); + + if self.enabled.load(Ordering::Relaxed) { + self.p2p.clone().discover_peer( + self.hook_id, + identity, + metadata, + [PeerConnectionCandidate::Relay].into_iter().collect(), + ); + } + } + + /// remove a peer from being tracked. + /// + /// This will stop the relay from trying to connect to it. + pub fn untrack_peer(&self, identity: RemoteIdentity) { + self.nodes + .lock() + .unwrap_or_else(PoisonError::into_inner) + .remove(&identity); + + if self.enabled.load(Ordering::Relaxed) { + if let Some(peer) = self.p2p.peers().get(&identity) { + peer.undiscover_peer(self.hook_id) + } + } + } + + /// remove all peers from being tracked. + pub fn untrack_all(&self) { + let mut nodes = self.nodes.lock().unwrap_or_else(PoisonError::into_inner); + for (node, _) in nodes.drain() { + if let Some(peer) = self.p2p.peers().get(&node) { + peer.undiscover_peer(self.hook_id) + } + } + } + + /// enabled the track peers from being registered to the P2P system. + /// + /// This allows easily removing them when the relay is disabled. + pub fn enable(&self) { + self.enabled.store(true, Ordering::Relaxed); + + for (identity, metadata) in self + .nodes + .lock() + .unwrap_or_else(PoisonError::into_inner) + .iter() + { + self.p2p.clone().discover_peer( + self.hook_id, + *identity, + metadata.clone(), + [PeerConnectionCandidate::Relay].into_iter().collect(), + ); + } + } + + /// disabled tracking the peers from being registered to the P2P system. + pub fn disable(&self) { + self.enabled.store(false, Ordering::Relaxed); + + for (identity, _) in self + .nodes + .lock() + .unwrap_or_else(PoisonError::into_inner) + .iter() + { + if let Some(peer) = self.p2p.peers().get(identity) { + peer.undiscover_peer(self.hook_id) + } + } + } + + /// check if a peer is being relayed. + pub fn is_relayed(&self, identity: RemoteIdentity) -> bool { + self.connected_via_relay + .lock() + .unwrap_or_else(PoisonError::into_inner) + .get(&identity) + .is_some() + } +} diff --git a/crates/p2p/src/hooks/quic/transport.rs b/crates/p2p/src/hooks/quic/transport.rs new file mode 100644 index 000000000..262535b5f --- /dev/null +++ b/crates/p2p/src/hooks/quic/transport.rs @@ -0,0 +1,928 @@ +use std::{ + collections::{BTreeSet, HashMap, HashSet}, + io::{self, ErrorKind}, + net::{Ipv4Addr, Ipv6Addr, SocketAddr}, + str::FromStr, + sync::{atomic::AtomicBool, Arc, Mutex, MutexGuard, PoisonError, RwLock}, + time::Duration, +}; + +use flume::{bounded, Receiver, Sender}; +use futures::future::join_all; +use libp2p::{ + autonat, dcutr, + futures::{AsyncReadExt, AsyncWriteExt, StreamExt}, + multiaddr::Protocol, + noise, relay, + swarm::{dial_opts::DialOpts, NetworkBehaviour, SwarmEvent}, + yamux, Multiaddr, PeerId, Stream, StreamProtocol, Swarm, SwarmBuilder, +}; +use serde::{Deserialize, Serialize}; +use thiserror::Error; +use tokio::{ + net::TcpListener, + sync::{mpsc, oneshot}, + time::timeout, +}; +use tokio_util::compat::FuturesAsyncReadCompatExt; +use tracing::{debug, error, info, warn}; +use uuid::Uuid; + +use super::{ + handle::QuicHandle, + utils::{ + identity_to_libp2p_keypair, remote_identity_to_libp2p_peerid, socketaddr_to_multiaddr, + }, +}; +use crate::{ + hooks::quic::utils::multiaddr_to_socketaddr, identity::REMOTE_IDENTITY_LEN, ConnectionRequest, + HookEvent, ListenerId, PeerConnectionCandidate, RemoteIdentity, UnicastStream, P2P, +}; + +const PROTOCOL: StreamProtocol = StreamProtocol::new("/sdp2p/1"); + +/// [libp2p::PeerId] for debugging purposes only. +#[derive(Debug)] +#[allow(dead_code)] +pub struct Libp2pPeerId(libp2p::PeerId); + +#[derive(Debug)] +enum InternalEvent { + RegisterListener { + id: ListenerId, + ipv4: bool, + addr: SocketAddr, + result: oneshot::Sender>, + }, + UnregisterListener { + id: ListenerId, + ipv4: bool, + result: oneshot::Sender>, + }, + RegisterRelays { + relays: Vec, + result: oneshot::Sender>, + }, + RegisterPeerAddr { + // These can be socket addr's or FQDN's + addrs: HashSet, + }, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct RelayServerEntry { + id: Uuid, + peer_id: String, + addrs: Vec, +} + +#[derive(NetworkBehaviour)] +struct MyBehaviour { + stream: libp2p_stream::Behaviour, + // TODO: Can this be optional? + relay: relay::client::Behaviour, + // TODO: Can this be optional? + autonat: autonat::Behaviour, + // TODO: Can this be optional? + dcutr: dcutr::Behaviour, +} + +#[derive(Debug, Error)] +pub enum QuicTransportError { + #[error("Failed to modify the SwarmBuilder: {0}")] + SwarmBuilderCreation(String), + #[error("Internal response channel closed: {0}")] + SendChannelClosed(String), + #[error("Internal response channel closed: {0}")] + ReceiveChannelClosed(#[from] oneshot::error::RecvError), + #[error("Failed internal event: {0}")] + InternalEvent(String), + #[error("Failed to create the Listener: {0}")] + ListenerSetup(std::io::Error), +} + +/// Transport using Quic to establish a connection between peers. +/// This uses `libp2p` internally. +#[derive(Debug)] +pub struct QuicTransport { + id: ListenerId, + p2p: Arc, + internal_tx: Sender, + relay_config: Mutex>, + ipv4_listener: Mutex, + ipv6_listener: Mutex, + handle: Arc, +} + +#[derive(Debug, Clone, Default)] +enum ListenerInfo { + /// The listener is disabled. + #[default] + Disabled, + /// The user requested a specific port. + Absolute(SocketAddr), + /// The user requested a random port. + /// The value contains the selected port. + Random(SocketAddr), +} + +impl QuicTransport { + /// Spawn the `QuicTransport` and register it with the P2P system. + /// Be aware spawning this does nothing unless you call `Self::set_ipv4_enabled`/`Self::set_ipv6_enabled` to enable the listeners. + pub fn spawn(p2p: Arc) -> Result<(Self, Libp2pPeerId), QuicTransportError> { + let keypair = identity_to_libp2p_keypair(p2p.identity()); + let libp2p_peer_id = Libp2pPeerId(keypair.public().to_peer_id()); + + let (tx, rx) = bounded(15); + let (internal_tx, internal_rx) = bounded(15); + let (connect_tx, connect_rx) = mpsc::channel(15); + let id = p2p.register_listener("libp2p-quic", tx, move |listener_id, peer, _addrs| { + // TODO: I don't love this always being registered. Really it should only show up if the other device is online (do a ping-type thing)??? + peer.clone() + .listener_available(listener_id, connect_tx.clone()); + }); + + let swarm = SwarmBuilder::with_existing_identity(keypair) + .with_tokio() + .with_quic() + .with_relay_client(noise::Config::new, yamux::Config::default) + .map_err(|err| QuicTransportError::SwarmBuilderCreation(err.to_string()))? + .with_behaviour(|keypair, relay_behaviour| MyBehaviour { + stream: libp2p_stream::Behaviour::new(), + relay: relay_behaviour, + autonat: autonat::Behaviour::new(keypair.public().to_peer_id(), Default::default()), + dcutr: dcutr::Behaviour::new(keypair.public().to_peer_id()), + }) + .map_err(|err| QuicTransportError::SwarmBuilderCreation(err.to_string()))? + .with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60))) + .build(); + + let handle = Arc::new(QuicHandle { + shutdown: Default::default(), + p2p: p2p.clone(), + hook_id: id.into(), + nodes: Default::default(), + enabled: AtomicBool::new(true), + connected_via_relay: Default::default(), + }); + + tokio::spawn(start( + p2p.clone(), + id, + swarm, + rx, + internal_rx, + connect_rx, + handle.clone(), + )); + + Ok(( + Self { + id, + p2p, + internal_tx, + relay_config: Mutex::new(Vec::new()), + ipv4_listener: Default::default(), + ipv6_listener: Default::default(), + handle, + }, + libp2p_peer_id, + )) + } + + /// Configure the relay servers to use. + /// This method will replace any existing relay servers. + pub async fn set_relay_config( + &self, + relays: Vec, + ) -> Result<(), QuicTransportError> { + let (tx, rx) = oneshot::channel(); + let event = InternalEvent::RegisterRelays { + relays: relays.clone(), + result: tx, + }; + + self.internal_tx + .send(event) + .map_err(|e| QuicTransportError::SendChannelClosed(e.to_string()))?; + + let result = rx + .await + .map_err(QuicTransportError::ReceiveChannelClosed) + .and_then(|r| r.map_err(QuicTransportError::InternalEvent)); + + if result.is_ok() { + *self + .relay_config + .lock() + .unwrap_or_else(PoisonError::into_inner) = relays; + } + + result + } + + pub fn get_relay_config(&self) -> Vec { + self.relay_config + .lock() + .unwrap_or_else(PoisonError::into_inner) + .clone() + } + + pub fn set_manual_peer_addrs(&self, addrs: HashSet) { + self.internal_tx + .send(InternalEvent::RegisterPeerAddr { addrs }) + .ok(); + } + + // `None` on the port means disabled. Use `0` for random port. + pub async fn set_ipv4_enabled(&self, port: Option) -> Result<(), QuicTransportError> { + self.setup_listener( + port.map(|p| SocketAddr::from((Ipv4Addr::UNSPECIFIED, p))), + true, + |this| { + this.ipv4_listener + .lock() + .unwrap_or_else(PoisonError::into_inner) + }, + ) + .await + } + + pub async fn set_ipv6_enabled(&self, port: Option) -> Result<(), QuicTransportError> { + self.setup_listener( + port.map(|p| SocketAddr::from((Ipv6Addr::UNSPECIFIED, p))), + false, + |this| { + this.ipv6_listener + .lock() + .unwrap_or_else(PoisonError::into_inner) + }, + ) + .await + } + + async fn setup_listener( + &self, + addr: Option, + ipv4: bool, + get_listener: impl Fn(&Self) -> MutexGuard, + ) -> Result<(), QuicTransportError> { + let mut desired = match addr { + Some(addr) if addr.port() == 0 => ListenerInfo::Random(addr), + Some(addr) => ListenerInfo::Absolute(addr), + None => ListenerInfo::Disabled, + }; + + let (tx, rx) = oneshot::channel(); + let event = { + let listener_state = get_listener(self).clone(); + + match (listener_state, &mut desired) { + // Desired state is the same as current state + // This is designed to preserve the random port that was determined earlier, making this operation idempotent. + (ListenerInfo::Disabled, ListenerInfo::Disabled) + | (ListenerInfo::Absolute(_), ListenerInfo::Absolute(_)) + | (ListenerInfo::Random(_), ListenerInfo::Random(_)) => return Ok(()), + + // We are enabled and want to be disabled + (_, ListenerInfo::Disabled) => InternalEvent::UnregisterListener { + id: self.id, + ipv4, + result: tx, + }, + + // We are any state (but not the same as the desired state) and want to be enabled + (_, ListenerInfo::Random(ref mut addr)) + | (_, ListenerInfo::Absolute(ref mut addr)) => { + // We mutable assign back to `desired` so it can be saved if this operation succeeds. + if addr.port() == 0 { + addr.set_port( + TcpListener::bind(*addr) + .await + .map_err(QuicTransportError::ListenerSetup)? + .local_addr() + .map_err(QuicTransportError::ListenerSetup)? + .port(), + ); + } + + InternalEvent::RegisterListener { + id: self.id, + ipv4, + addr: *addr, + result: tx, + } + } + } + }; + + self.internal_tx + .send(event) + .map_err(|e| QuicTransportError::SendChannelClosed(e.to_string()))?; + + rx.await + .map_err(QuicTransportError::ReceiveChannelClosed) + .and_then(|r| r.map_err(QuicTransportError::InternalEvent))?; + + *get_listener(self) = desired; + + Ok(()) + } + + pub fn handle(&self) -> Arc { + self.handle.clone() + } + + pub async fn shutdown(self) { + self.p2p.unregister_hook(self.id.into()).await; + } +} + +async fn start( + p2p: Arc, + id: ListenerId, + mut swarm: Swarm, + rx: Receiver, + internal_rx: Receiver, + mut connect_rx: mpsc::Receiver, + handle: Arc, +) { + let mut ipv4_listener = None; + let mut ipv6_listener = None; + + let mut control = swarm.behaviour().stream.new_control(); + #[allow(clippy::unwrap_used)] // TODO: Error handling + let mut incoming = control.accept(PROTOCOL).unwrap(); + let map = Arc::new(RwLock::new(HashMap::new())); + let mut relay_config = Vec::new(); + let mut registered_relays = HashMap::new(); + let mut manual_addrs = HashSet::new(); + let mut manual_addr_dial_attempts = HashMap::new(); + let (manual_peers_dial_tx, mut manual_peers_dial_rx) = mpsc::channel(15); + let mut interval = tokio::time::interval(Duration::from_secs(60)); + let mut peer_id_to_addrs: HashMap> = HashMap::new(); + + loop { + tokio::select! { + Ok(event) = rx.recv_async() => match event { + HookEvent::PeerExpiredBy(_, identity) => { + let Some(peer) = p2p.peers.read().unwrap_or_else(PoisonError::into_inner).get(&identity).cloned() else { + continue; + }; + + let peer_id = remote_identity_to_libp2p_peerid(&identity); + let addrs = { + let state = peer.state.read().unwrap_or_else(PoisonError::into_inner); + + get_addrs(peer_id, &relay_config, state.discovered.values().flatten()) + }; + + + let mut control = control.clone(); + tokio::spawn(async move { + match timeout(Duration::from_secs(5), control.open_stream_with_addrs( + peer_id, + PROTOCOL, + addrs + )).await { + Ok(Ok(_)) => {} + Err(_) | Ok(Err(_)) => peer.disconnected_from(id), + }; + }); + }, + HookEvent::Shutdown { _guard } => { + let connected_peers = swarm.connected_peers().cloned().collect::>(); + for peer_id in connected_peers { + let _ = swarm.disconnect_peer_id(peer_id); + } + + if let Some((id, _)) = ipv4_listener.take() { + let _ = swarm.remove_listener(id); + } + if let Some((id, _)) = ipv6_listener.take() { + let _ = swarm.remove_listener(id); + } + + // TODO: We don't break the event loop so libp2p can be polled to keep cleaning up. + // break; + }, + _ => {}, + }, + Some((peer_id, mut stream)) = incoming.next() => { + let p2p = p2p.clone(); + let map = map.clone(); + let peer_id_to_addrs = peer_id_to_addrs.clone(); + + tokio::spawn(async move { + let mut mode = [0; 1]; + match stream.read_exact(&mut mode).await { + Ok(_) => {}, + Err(e) => { + warn!("Failed to read mode with libp2p::PeerId({peer_id:?}): {e:?}"); + return; + } + } + + match mode[0] { + // This is the regular mode for relay or mDNS + 0 => {}, + // Used for manual peers to discover the peers identity. + 1 => { + match stream.write_all(&p2p.identity().to_remote_identity().get_bytes()).await { + Ok(_) => {}, + Err(e) => { + warn!("Failed to write remote identity in mode 1 with libp2p::PeerId({peer_id:?}): {e:?}"); + return; + } + } + } + mode => { + warn!("Peer libp2p::PeerId({peer_id:?}) attempted to use invalid mode '{mode}'"); + return; + } + } + + let mut actual = [0; REMOTE_IDENTITY_LEN]; + match stream.read_exact(&mut actual).await { + Ok(_) => {}, + Err(e) => { + warn!("Failed to read remote identity with libp2p::PeerId({peer_id:?}): {e:?}"); + return; + }, + } + let identity = match RemoteIdentity::from_bytes(&actual) { + Ok(i) => i, + Err(e) => { + warn!("Failed to parse remote identity with libp2p::PeerId({peer_id:?}): {e:?}"); + return; + }, + }; + + // We need to go `PeerId -> RemoteIdentity` but as `PeerId` is a hash that's impossible. + // So to make this work the connection initiator will send their remote identity. + // It is however untrusted as they could send anything, so we convert it to a PeerId and check it matches the PeerId for this connection. + // If it matches, we are certain they own the private key as libp2p takes care of ensuring the PeerId is trusted. + let remote_identity_peer_id = remote_identity_to_libp2p_peerid(&identity); + if peer_id != remote_identity_peer_id { + warn!("Derived remote identity '{remote_identity_peer_id:?}' does not match libp2p::PeerId({peer_id:?})"); + return; + } + map.write().unwrap_or_else(PoisonError::into_inner).insert(peer_id, identity); + + let remote_metadata = match read_metadata(&mut stream, &p2p).await { + Ok(metadata) => metadata, + Err(e) => { + warn!("Failed to read metadata from '{}': {e}", identity); + return; + }, + }; + + // For mode 1 the stream will be dropped now + if mode[0] != 1 { + let stream = UnicastStream::new(identity, stream.compat()); + p2p.connected_to_incoming( + id, + remote_metadata, + stream, + ); + } else { + p2p.discover_peer(id.into(), identity, remote_metadata, peer_id_to_addrs.get(&peer_id).into_iter().flatten().map(|v| PeerConnectionCandidate::Manual(*v)).collect()); + } + + debug!("established inbound stream with '{}'", identity); + }); + }, + event = swarm.select_next_some() => match event { + SwarmEvent::ConnectionEstablished { peer_id, endpoint, connection_id, .. } => { + if let Some(addr) = multiaddr_to_socketaddr(endpoint.get_remote_address()) { + peer_id_to_addrs.entry(peer_id).or_default().insert(addr); + } + + if let Some((addr, socket_addr)) = manual_addr_dial_attempts.remove(&connection_id) { + let mut control = control.clone(); + let map = map.clone(); + let p2p = p2p.clone(); + let self_remote_identity = p2p.identity().to_remote_identity(); + debug!("Successfully dialled manual peer '{addr}' found peer '{peer_id}'. Opening stream to get peer information..."); + + + tokio::spawn(async move { + match control.open_stream_with_addrs( + peer_id, + PROTOCOL, + vec![socketaddr_to_multiaddr(&socket_addr)] + ).await { + Ok(mut stream) => { + match stream.write_all(&[1]).await { + Ok(_) => {}, + Err(e) => { + warn!("Failed to write mode 1 to manual peer '{addr}': {e}"); + return; + }, + } + + let mut identity = [0; REMOTE_IDENTITY_LEN]; + match stream.read_exact(&mut identity).await { + Ok(_) => {}, + Err(e) => { + warn!("Failed to read remote identity from manual peer '{addr}': {e}"); + return; + }, + } + let identity = match RemoteIdentity::from_bytes(&identity) { + Ok(i) => i, + Err(e) => { + warn!("Failed to parse remote identity from manual peer '{addr}': {e}"); + return; + }, + }; + + info!("Successfully connected with manual peer '{addr}' and found peer '{identity}'"); + + map.write().unwrap_or_else(PoisonError::into_inner).insert(peer_id, identity); + + match stream.write_all(&self_remote_identity.get_bytes()).await { + Ok(_) => { + debug!("Established manual connection with '{identity}'"); + + let remote_metadata = match send_metadata(&mut stream, &p2p).await { + Ok(metadata) => metadata, + Err(e) => { + warn!("Failed to send metadata to manual peer '{identity}': {e}"); + return; + }, + }; + + p2p.discover_peer(id.into(), identity, remote_metadata, BTreeSet::from([PeerConnectionCandidate::Manual(socket_addr)])); + }, + Err(e) => { + warn!("Failed to write remote identity to manual peer '{identity}': {e}"); + return; + }, + } + + stream.close().await.ok(); + }, + Err(e) => { + warn!("Failed to open stream with manual peer '{addr}': {e}"); + }, + } + }); + } + + if endpoint.is_relayed() { + if let Some((remote_identity, _)) = handle.nodes.lock() + .unwrap_or_else(PoisonError::into_inner) + .iter() + .find(|(i, _)| remote_identity_to_libp2p_peerid(i) == peer_id) { + handle.connected_via_relay.lock() + .unwrap_or_else(PoisonError::into_inner) + .insert(*remote_identity); + } + } + } + SwarmEvent::ConnectionClosed { peer_id, num_established: 0, connection_id, endpoint, .. } => { + if let Some(addr) = multiaddr_to_socketaddr(endpoint.get_remote_address()) { + peer_id_to_addrs.entry(peer_id).or_default().remove(&addr); + } + + if let Some((addr, _)) = manual_addr_dial_attempts.remove(&connection_id) { + warn!("Failed to establish manual connection with '{addr}'"); + } + + let Some(identity) = map.write().unwrap_or_else(PoisonError::into_inner).remove(&peer_id) else { + warn!("Tried to remove a peer that wasn't in the map."); + continue; + }; + + let peers = p2p.peers.read().unwrap_or_else(PoisonError::into_inner); + let Some(peer) = peers.get(&identity) else { + warn!("Tried to remove a peer that wasn't in the P2P system."); + continue; + }; + + peer.disconnected_from(id); + }, + _ => {} + }, + Ok(event) = internal_rx.recv_async() => match event { + InternalEvent::RegisterListener { id, ipv4, addr, result } => { + match swarm.listen_on(socketaddr_to_multiaddr(&addr)) { + Ok(libp2p_listener_id) => { + let this = match ipv4 { + true => &mut ipv4_listener, + false => &mut ipv6_listener, + }; + // TODO: Diff the `addr` & if it's changed actually update it + if this.is_none() { + *this = Some((libp2p_listener_id, addr)); + p2p.register_listener_addr(id, addr); + } + + let _ = result.send(Ok(())); + }, + Err(e) => { + let _ = result.send(Err(e.to_string())); + }, + } + }, + InternalEvent::UnregisterListener { id, ipv4, result } => { + let this = match ipv4 { + true => &mut ipv4_listener, + false => &mut ipv6_listener, + }; + if let Some((addr_id, addr)) = this.take() { + if swarm.remove_listener(addr_id) { + p2p.unregister_listener_addr(id, addr); + } + } + let _ = result.send(Ok(())); + }, + InternalEvent::RegisterRelays { relays, result } => { + // TODO: We should only add some of the relays - This is discussion in P2P documentation about the Relay + let mut err = None; + for relay in &relays { + let peer_id = match PeerId::from_str(&relay.peer_id) { + Ok(peer_id) => peer_id, + Err(err) => { + error!("Failed to parse Relay peer ID '{}': {err:?}", relay.peer_id); + continue; + }, + }; + + let addrs = relay + .addrs + .iter() + .map(socketaddr_to_multiaddr) + .collect::>(); + + for addr in addrs { + swarm + .behaviour_mut() + .autonat + .add_server(peer_id, Some(addr.clone())); + swarm.add_peer_address(peer_id, addr); + } + + match swarm.listen_on( + Multiaddr::empty() + .with(Protocol::Memory(40)) + .with(Protocol::P2p(peer_id)) + .with(Protocol::P2pCircuit) + ) { + Ok(listener_id) => { + for addr in &relay.addrs { + registered_relays.insert(*addr, listener_id); + } + }, + Err(e) => { + err = Some(format!("Failed to listen on relay server '{}': {e}", relay.id)); + break; + }, + } + } + + if let Some(err) = err { + let _ = result.send(Err(err)); + continue; + } + + // Cleanup connections to relays that are no longer in the config + // We intentionally do this after establishing new connections so we don't have a gap in connectivity + for (addr, listener_id) in ®istered_relays { + if relays.iter().any(|e| e.addrs.contains(addr)) { + continue; + } + + swarm.remove_listener(*listener_id); + } + + relay_config = relays; + + result.send(Ok(())).ok(); + }, + InternalEvent::RegisterPeerAddr { addrs } => { + manual_addrs = addrs; + interval.reset_immediately(); + } + }, + Some(req) = connect_rx.recv() => { + let mut control = control.clone(); + let self_remote_identity = p2p.identity().to_remote_identity(); + let map = map.clone(); + let p2p = p2p.clone(); + let peer_id = remote_identity_to_libp2p_peerid(&req.to); + let addrs = get_addrs(peer_id, &relay_config, req.addrs.iter()); + + tokio::spawn(async move { + match control.open_stream_with_addrs( + peer_id, + PROTOCOL, + addrs, + ).await { + Ok(mut stream) => { + map.write().unwrap_or_else(PoisonError::into_inner).insert(peer_id, req.to); + + // We are in mode `0` so we send a 0 before the remote identity. + let mut buf = [0; REMOTE_IDENTITY_LEN + 1]; + buf[1..].copy_from_slice(&self_remote_identity.get_bytes()); + + match stream.write_all(&buf).await { + Ok(_) => { + debug!("Established outbound stream with '{}'", req.to); + + let remote_metadata = match send_metadata(&mut stream, &p2p).await { + Ok(metadata) => metadata, + Err(e) => { + let _ = req.tx.send(Err(e)); + return; + }, + }; + + p2p.connected_to_outgoing(id, remote_metadata, req.to); + + let _ = req.tx.send(Ok(UnicastStream::new(req.to, stream.compat()))); + }, + Err(e) => { + let _ = req.tx.send(Err(e.to_string())); + }, + } + }, + Err(e) => { + let _ = req.tx.send(Err(e.to_string())); + }, + } + }); + } + Some((addr, socket_addr)) = manual_peers_dial_rx.recv() => { + let opts = DialOpts::unknown_peer_id() + .address(socketaddr_to_multiaddr(&socket_addr)) + .build(); + + manual_addr_dial_attempts.insert(opts.connection_id(), (addr, socket_addr)); + match swarm.dial(opts) { + Ok(_) => debug!("Dialling manual peer '{socket_addr}'"), + Err(err) => warn!("Failed to dial manual peer '{socket_addr}': {err}"), + } + } + _ = interval.tick() => { + let addrs = manual_addrs.clone(); + let manual_peers_dial_tx = manual_peers_dial_tx.clone(); + + // Off loop we resolve the IP's and message them back to the main loop, for it to dial as the `swarm` can't be moved. + tokio::spawn(async move { + join_all(addrs.into_iter().map(|addr| { + let manual_peers_dial_tx = manual_peers_dial_tx.clone(); + async move { + // TODO: We should probs track these errors for the UI + let Ok(socket_addr) = parse_manual_addr(addr.clone()) + .map_err(|err| { + warn!("Failed to parse manual peer address '{addr}': {err}"); + }) else { + return; + }; + + manual_peers_dial_tx.send((addr, socket_addr)).await.ok(); + } + })).await; + }); + + } + } + } +} + +async fn send_metadata( + stream: &mut Stream, + p2p: &Arc, +) -> Result, String> { + { + let metadata = p2p.metadata().clone(); + let result = rmp_serde::encode::to_vec_named(&metadata) + .map_err(|err| format!("Error encoding metadata: {err:?}"))?; + stream + .write_all(&(result.len() as u64).to_le_bytes()) + .await + .map_err(|err| format!("Error writing metadata length: {err:?}"))?; + stream + .write_all(&result) + .await + .map_err(|err| format!("Error writing metadata: {err:?}"))?; + } + + let mut len = [0; 8]; + stream + .read_exact(&mut len) + .await + .map_err(|err| format!("Error reading metadata length: {err:?}"))?; + let len = u64::from_le_bytes(len); + if len > 1000 { + return Err("Error metadata too large".into()); + } + let mut buf = vec![0; len as usize]; + stream + .read_exact(&mut buf) + .await + .map_err(|err| format!("Error reading metadata length: {err:?}"))?; + rmp_serde::decode::from_slice(&buf).map_err(|err| format!("Error decoding metadata: {err:?}")) +} + +async fn read_metadata( + stream: &mut Stream, + p2p: &Arc, +) -> Result, String> { + let metadata = { + let mut len = [0; 8]; + stream + .read_exact(&mut len) + .await + .map_err(|err| format!("Error reading metadata length: {err:?}"))?; + let len = u64::from_le_bytes(len); + if len > 1000 { + return Err("Error metadata too large".into()); + } + let mut buf = vec![0; len as usize]; + stream + .read_exact(&mut buf) + .await + .map_err(|err| format!("Error reading metadata length: {err:?}"))?; + rmp_serde::decode::from_slice(&buf) + .map_err(|err| format!("Error decoding metadata: {err:?}"))? + }; + + { + let metadata = p2p.metadata().clone(); + let result = rmp_serde::encode::to_vec_named(&metadata) + .map_err(|err| format!("Error encoding metadata: {err:?}"))?; + stream + .write_all(&(result.len() as u64).to_le_bytes()) + .await + .map_err(|err| format!("Error writing metadata length: {err:?}"))?; + stream + .write_all(&result) + .await + .map_err(|err| format!("Error writing metadata: {err:?}"))?; + } + + Ok(metadata) +} + +fn get_addrs<'a>( + peer_id: PeerId, + relay_config: &[RelayServerEntry], + addrs: impl Iterator + 'a, +) -> Vec { + addrs + .flat_map(|v| match v { + PeerConnectionCandidate::SocketAddr(addr) => vec![socketaddr_to_multiaddr(addr)], + PeerConnectionCandidate::Manual(addr) => vec![socketaddr_to_multiaddr(addr)], + PeerConnectionCandidate::Relay => relay_config + .iter() + .filter_map(|e| match PeerId::from_str(&e.peer_id) { + Ok(peer_id) => Some(e.addrs.iter().map(move |addr| (peer_id, addr))), + Err(err) => { + error!("Failed to parse peer ID '{}': {err:?}", e.peer_id); + None + } + }) + .flatten() + .map(|(relay_peer_id, addr)| { + let mut addr = socketaddr_to_multiaddr(addr); + addr.push(Protocol::P2p(relay_peer_id)); + addr.push(Protocol::P2pCircuit); + addr.push(Protocol::P2p(peer_id)); + addr + }) + .collect::>(), + }) + .collect::>() +} + +/// Parse the user's input into and do DNS resolution if required. +/// +/// `dns_lookup::lookup_host` does allow IP addresses but not socket addresses (ports) so we split them out and handle them separately. +/// +fn parse_manual_addr(addr: String) -> io::Result { + let mut addr = addr.split(':').peekable(); + + match (addr.next(), addr.next(), addr.peek()) { + (Some(host), None, _) => dns_lookup::lookup_host(host).and_then(|addr| { + addr.into_iter() + .next() + .map(|ip| SocketAddr::new(ip, 7373)) + .ok_or(io::Error::new(ErrorKind::Other, "Invalid address")) + }), + (Some(host), Some(port), None) => { + let port = port + .parse::() + .map_err(|_| io::Error::new(ErrorKind::Other, "Invalid port number"))?; + dns_lookup::lookup_host(host).and_then(|addr| { + addr.into_iter() + .next() + .map(|ip| SocketAddr::new(ip, port)) + .ok_or(io::Error::new(ErrorKind::Other, "Invalid address")) + }) + } + (_, _, _) => Err(io::Error::new(ErrorKind::Other, "Invalid address")), + } +} diff --git a/crates/p2p/src/quic/utils.rs b/crates/p2p/src/hooks/quic/utils.rs similarity index 76% rename from crates/p2p/src/quic/utils.rs rename to crates/p2p/src/hooks/quic/utils.rs index 2507e36a1..7d77c0638 100644 --- a/crates/p2p/src/quic/utils.rs +++ b/crates/p2p/src/hooks/quic/utils.rs @@ -7,7 +7,7 @@ use libp2p::{identity::Keypair, multiaddr::Protocol, Multiaddr, PeerId}; use crate::{Identity, RemoteIdentity}; #[must_use] -pub(crate) fn socketaddr_to_quic_multiaddr(m: &SocketAddr) -> Multiaddr { +pub(crate) fn socketaddr_to_multiaddr(m: &SocketAddr) -> Multiaddr { let mut addr = Multiaddr::empty(); match m { SocketAddr::V4(ip) => addr.push(Protocol::Ip4(*ip.ip())), @@ -18,6 +18,21 @@ pub(crate) fn socketaddr_to_quic_multiaddr(m: &SocketAddr) -> Multiaddr { addr } +#[must_use] +pub(crate) fn multiaddr_to_socketaddr(m: &Multiaddr) -> Option { + let mut iter = m.iter(); + let ip = match iter.next()? { + Protocol::Ip4(ip) => ip.into(), + Protocol::Ip6(ip) => ip.into(), + _ => return None, + }; + let port = match iter.next()? { + Protocol::Tcp(port) | Protocol::Udp(port) => port, + _ => return None, + }; + Some(SocketAddr::new(ip, port)) +} + // This is sketchy, but it makes the whole system a lot easier to work with // We are assuming the libp2p `PublicKey` is the same format as our `RemoteIdentity` type. // This is *acktually* true but they reserve the right to change it at any point. diff --git a/crates/p2p/src/lib.rs b/crates/p2p/src/lib.rs index 3207e1066..db7c5afa6 100644 --- a/crates/p2p/src/lib.rs +++ b/crates/p2p/src/lib.rs @@ -1,22 +1,34 @@ //! Rust Peer to Peer Networking Library #![warn(clippy::all, clippy::unwrap_used, clippy::panic)] -pub(crate) mod hooks; +pub(crate) mod hook; +pub mod hooks; mod identity; -mod mdns; mod p2p; mod peer; -mod quic; mod smart_guards; mod stream; -pub use hooks::{HookEvent, HookId, ListenerId, ShutdownGuard}; +pub use hook::{HookEvent, HookId, ListenerId, ShutdownGuard}; pub use identity::{Identity, IdentityErr, RemoteIdentity}; -pub use mdns::Mdns; pub use p2p::{Listener, P2P}; pub use peer::{ConnectionRequest, Peer, PeerConnectionCandidate}; -pub use quic::{Libp2pPeerId, QuicTransport, RelayServerEntry}; pub use smart_guards::SmartWriteGuard; pub use stream::UnicastStream; pub use flume; + +use thiserror::Error; +use tokio::sync::{mpsc, oneshot}; + +#[derive(Debug, Error)] +pub enum NewStreamError { + #[error("No connection methods available for peer")] + NoConnectionMethodsAvailable, + #[error("The event loop is offline")] + EventLoopOffline(mpsc::error::SendError), + #[error("Failed to establish the connection w/ error: {0}")] + ConnectionNeverEstablished(oneshot::error::RecvError), + #[error("error connecting to peer: {0}")] + Connecting(String), +} diff --git a/crates/p2p/src/p2p.rs b/crates/p2p/src/p2p.rs index 0288f3586..65d502b9e 100644 --- a/crates/p2p/src/p2p.rs +++ b/crates/p2p/src/p2p.rs @@ -9,11 +9,11 @@ use flume::Sender; use hash_map_diff::hash_map_diff; use libp2p::futures::future::join_all; use stable_vec::StableVec; -use tokio::{sync::oneshot, time::timeout}; +use tokio::time::timeout; use tracing::info; use crate::{ - hooks::{HandlerFn, Hook, HookEvent, ListenerData, ListenerId, ShutdownGuard}, + hook::{HandlerFn, Hook, HookEvent, ListenerData, ListenerId, ShutdownGuard}, smart_guards::SmartWriteGuard, HookId, Identity, Peer, PeerConnectionCandidate, RemoteIdentity, UnicastStream, }; @@ -134,11 +134,12 @@ impl P2P { }) .clone(); - { - let mut state: std::sync::RwLockWriteGuard<'_, crate::peer::State> = - peer.state.write().unwrap_or_else(PoisonError::into_inner); - state.discovered.insert(hook_id, addrs.clone()); - } + let addrs = { + let mut state = peer.state.write().unwrap_or_else(PoisonError::into_inner); + let a = state.discovered.entry(hook_id).or_default(); + a.extend(addrs); + a.clone() + }; peer.metadata_mut().extend(metadata); @@ -162,14 +163,25 @@ impl P2P { peer } - pub fn connected_to( + pub fn connected_to_incoming( self: Arc, listener: ListenerId, metadata: HashMap, stream: UnicastStream, - shutdown_tx: oneshot::Sender<()>, ) -> Arc { - let identity = stream.remote_identity(); + let peer = self + .clone() + .connected_to_outgoing(listener, metadata, stream.remote_identity()); + let _ = self.handler_tx.send(stream); + peer + } + + pub fn connected_to_outgoing( + self: Arc, + listener: ListenerId, + metadata: HashMap, + identity: RemoteIdentity, + ) -> Arc { let mut peers = self.peers.write().unwrap_or_else(PoisonError::into_inner); let peer = peers.entry(identity); let was_peer_inserted = matches!(peer, Entry::Vacant(_)); @@ -182,7 +194,7 @@ impl P2P { { let mut state = peer.state.write().unwrap_or_else(PoisonError::into_inner); - state.active_connections.insert(listener, shutdown_tx); + state.active_connections.insert(listener); } peer.metadata_mut().extend(metadata); @@ -201,8 +213,6 @@ impl P2P { }); } - let _ = self.handler_tx.send(stream); - peer } @@ -332,14 +342,21 @@ impl P2P { let mut peers_to_remove = HashSet::new(); // We are mutate while iterating for (identity, peer) in peers.iter_mut() { let mut state = peer.state.write().unwrap_or_else(PoisonError::into_inner); - if let Some(active_connection) = - state.active_connections.remove(&ListenerId(id.0)) - { - let _ = active_connection.send(()); + if state.active_connections.remove(&ListenerId(id.0)) { + hooks.iter().for_each(|(_, hook)| { + hook.send(HookEvent::PeerDisconnectedWith( + ListenerId(id.0), + peer.identity(), + )); + }); } state.connection_methods.remove(&ListenerId(id.0)); state.discovered.remove(&id); + hooks.iter().for_each(|(_, hook)| { + hook.send(HookEvent::PeerExpiredBy(id, peer.identity())); + }); + if state.connection_methods.is_empty() && state.discovered.is_empty() { peers_to_remove.insert(*identity); } diff --git a/crates/p2p/src/peer.rs b/crates/p2p/src/peer.rs index 9434b2147..13c827cfc 100644 --- a/crates/p2p/src/peer.rs +++ b/crates/p2p/src/peer.rs @@ -4,7 +4,7 @@ use std::{ sync::{Arc, PoisonError, RwLock, RwLockReadGuard, RwLockWriteGuard, Weak}, }; -use thiserror::Error; +use crate::NewStreamError; use tokio::sync::{mpsc, oneshot}; use tracing::warn; @@ -28,13 +28,14 @@ pub struct Peer { pub enum PeerConnectionCandidate { SocketAddr(SocketAddr), Relay, + Manual(SocketAddr), // Custom(String), } #[derive(Debug, Default)] pub(crate) struct State { /// Active connections with the remote - pub(crate) active_connections: HashMap>, + pub(crate) active_connections: HashSet, /// Methods for establishing an active connections with the remote /// These should be inject by `Listener::acceptor` which is called when a new peer is discovered. pub(crate) connection_methods: HashMap>, @@ -148,7 +149,7 @@ impl Peer { .read() .unwrap_or_else(PoisonError::into_inner) .active_connections - .contains_key(&ListenerId(hook_id.0)) + .contains(&ListenerId(hook_id.0)) } pub fn is_connected_with(&self, listener_id: ListenerId) -> bool { @@ -156,7 +157,7 @@ impl Peer { .read() .unwrap_or_else(PoisonError::into_inner) .active_connections - .contains_key(&listener_id) + .contains(&listener_id) } pub fn connection_methods(&self) -> HashSet { @@ -179,6 +180,20 @@ impl Peer { .collect() } + pub fn addrs(&self) -> HashSet { + self.state + .read() + .unwrap_or_else(PoisonError::into_inner) + .discovered + .values() + .flatten() + .filter_map(|addr| match addr { + PeerConnectionCandidate::SocketAddr(addr) => Some(*addr), + _ => None, + }) + .collect() + } + /// Construct a new Quic stream to the peer. pub async fn new_stream(&self) -> Result { let (addrs, connect_tx) = { @@ -239,12 +254,28 @@ impl Peer { .insert(hook, addrs); } - pub fn listener_available(&self, listener: ListenerId, tx: mpsc::Sender) { + pub fn listener_available( + self: Arc, + listener: ListenerId, + tx: mpsc::Sender, + ) { self.state .write() .unwrap_or_else(PoisonError::into_inner) .connection_methods .insert(listener, tx); + + let Some(p2p) = self.p2p.upgrade() else { + return; + }; + + p2p.hooks + .read() + .unwrap_or_else(PoisonError::into_inner) + .iter() + .for_each(|(_, hook)| { + hook.send(HookEvent::PeerDiscoveredBy(listener.into(), self.clone())); + }); } pub fn undiscover_peer(&self, hook_id: HookId) { @@ -298,15 +329,3 @@ impl Peer { } } } - -#[derive(Debug, Error)] -pub enum NewStreamError { - #[error("No connection methods available for peer")] - NoConnectionMethodsAvailable, - #[error("The event loop is offline")] - EventLoopOffline(mpsc::error::SendError), - #[error("Failed to establish the connection w/ error: {0}")] - ConnectionNeverEstablished(oneshot::error::RecvError), - #[error("error connecting to peer: {0}")] - Connecting(String), -} diff --git a/crates/p2p/src/quic/mod.rs b/crates/p2p/src/quic/mod.rs deleted file mode 100644 index 23f47af80..000000000 --- a/crates/p2p/src/quic/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub(super) mod transport; -pub(super) mod utils; - -pub use transport::{Libp2pPeerId, QuicTransport, RelayServerEntry}; diff --git a/crates/p2p/src/quic/transport.rs b/crates/p2p/src/quic/transport.rs deleted file mode 100644 index 0d493f66b..000000000 --- a/crates/p2p/src/quic/transport.rs +++ /dev/null @@ -1,495 +0,0 @@ -use std::{ - collections::HashMap, - net::{Ipv4Addr, Ipv6Addr, SocketAddr}, - str::FromStr, - sync::{Arc, Mutex, PoisonError, RwLock}, - time::Duration, -}; - -use flume::{bounded, Receiver, Sender}; -use libp2p::{ - autonat, dcutr, - futures::{AsyncReadExt, AsyncWriteExt, StreamExt}, - multiaddr::Protocol, - noise, relay, - swarm::{NetworkBehaviour, SwarmEvent}, - yamux, Multiaddr, PeerId, StreamProtocol, Swarm, SwarmBuilder, -}; -use serde::{Deserialize, Serialize}; -use tokio::{ - net::TcpListener, - sync::{mpsc, oneshot}, - time::timeout, -}; -use tokio_util::compat::FuturesAsyncReadCompatExt; -use tracing::{debug, error, warn}; -use uuid::Uuid; - -use crate::{ - identity::REMOTE_IDENTITY_LEN, - quic::utils::{ - identity_to_libp2p_keypair, remote_identity_to_libp2p_peerid, socketaddr_to_quic_multiaddr, - }, - ConnectionRequest, HookEvent, ListenerId, PeerConnectionCandidate, RemoteIdentity, - UnicastStream, P2P, -}; - -const PROTOCOL: StreamProtocol = StreamProtocol::new("/sdp2p/1"); - -/// [libp2p::PeerId] for debugging purposes only. -#[derive(Debug)] -#[allow(dead_code)] -pub struct Libp2pPeerId(libp2p::PeerId); - -#[derive(Debug)] -enum InternalEvent { - RegisterListener { - id: ListenerId, - ipv4: bool, - addr: SocketAddr, - result: oneshot::Sender>, - }, - UnregisterListener { - id: ListenerId, - ipv4: bool, - result: oneshot::Sender>, - }, - RegisterRelays { - relays: Vec, - result: oneshot::Sender>, - }, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct RelayServerEntry { - id: Uuid, - peer_id: String, - addrs: Vec, -} - -#[derive(NetworkBehaviour)] -struct MyBehaviour { - stream: libp2p_stream::Behaviour, - // TODO: Can this be optional? - relay: relay::client::Behaviour, - // TODO: Can this be optional? - autonat: autonat::Behaviour, - // TODO: Can this be optional? - dcutr: dcutr::Behaviour, -} - -/// Transport using Quic to establish a connection between peers. -/// This uses `libp2p` internally. -#[derive(Debug)] -pub struct QuicTransport { - id: ListenerId, - p2p: Arc, - internal_tx: Sender, - relay_config: Mutex>, -} - -impl QuicTransport { - /// Spawn the `QuicTransport` and register it with the P2P system. - /// Be aware spawning this does nothing unless you call `Self::set_ipv4_enabled`/`Self::set_ipv6_enabled` to enable the listeners. - // TODO: Error type here - pub fn spawn(p2p: Arc) -> Result<(Self, Libp2pPeerId), String> { - let keypair = identity_to_libp2p_keypair(p2p.identity()); - let libp2p_peer_id = Libp2pPeerId(keypair.public().to_peer_id()); - - let (tx, rx) = bounded(15); - let (internal_tx, internal_rx) = bounded(15); - let (connect_tx, connect_rx) = mpsc::channel(15); - let id = p2p.register_listener("libp2p-quic", tx, move |listener_id, peer, _addrs| { - // TODO: I don't love this always being registered. Really it should only show up if the other device is online (do a ping-type thing)??? - peer.listener_available(listener_id, connect_tx.clone()); - }); - - let swarm = SwarmBuilder::with_existing_identity(keypair) - .with_tokio() - .with_quic() - .with_relay_client(noise::Config::new, yamux::Config::default) - .map_err(|err| err.to_string())? - .with_behaviour(|keypair, relay_behaviour| MyBehaviour { - stream: libp2p_stream::Behaviour::new(), - relay: relay_behaviour, - autonat: autonat::Behaviour::new(keypair.public().to_peer_id(), Default::default()), - dcutr: dcutr::Behaviour::new(keypair.public().to_peer_id()), - }) - .map_err(|err| err.to_string())? - .with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60))) - .build(); - - tokio::spawn(start(p2p.clone(), id, swarm, rx, internal_rx, connect_rx)); - - Ok(( - Self { - id, - p2p, - internal_tx, - relay_config: Mutex::new(Vec::new()), - }, - libp2p_peer_id, - )) - } - - /// Configure the relay servers to use. - /// This method will replace any existing relay servers. - pub async fn set_relay_config(&self, relays: Vec) { - let (tx, rx) = oneshot::channel(); - let event = InternalEvent::RegisterRelays { - relays: relays.clone(), - result: tx, - }; - - let Ok(_) = self.internal_tx.send(event) else { - return; - }; - match rx.await { - Ok(_) => { - *self - .relay_config - .lock() - .unwrap_or_else(PoisonError::into_inner) = relays; - } - Err(e) => error!("Failed to register relay config as the event loop has died: {e}"), - } - } - - pub fn get_relay_config(&self) -> Vec { - self.relay_config - .lock() - .unwrap_or_else(PoisonError::into_inner) - .clone() - } - - // `None` on the port means disabled. Use `0` for random port. - pub async fn set_ipv4_enabled(&self, port: Option) -> Result<(), String> { - self.setup_listener( - port.map(|p| SocketAddr::from((Ipv4Addr::UNSPECIFIED, p))), - true, - ) - .await - } - - pub async fn set_ipv6_enabled(&self, port: Option) -> Result<(), String> { - self.setup_listener( - port.map(|p| SocketAddr::from((Ipv6Addr::UNSPECIFIED, p))), - false, - ) - .await - } - - // TODO: Proper error type - async fn setup_listener(&self, addr: Option, ipv4: bool) -> Result<(), String> { - let (tx, rx) = oneshot::channel(); - let event = if let Some(mut addr) = addr { - if addr.port() == 0 { - #[allow(clippy::unwrap_used)] // TODO: Error handling - addr.set_port( - TcpListener::bind(addr) - .await - .unwrap() - .local_addr() - .unwrap() - .port(), - ); - } - - InternalEvent::RegisterListener { - id: self.id, - ipv4, - addr, - result: tx, - } - } else { - InternalEvent::UnregisterListener { - id: self.id, - ipv4, - result: tx, - } - }; - - let Ok(_) = self.internal_tx.send(event) else { - return Err("internal channel closed".to_string()); - }; - rx.await - .map_err(|_| "internal response channel closed".to_string()) - .and_then(|r| r) - } - - pub async fn shutdown(self) { - self.p2p.unregister_hook(self.id.into()).await; - } -} - -async fn start( - p2p: Arc, - id: ListenerId, - mut swarm: Swarm, - rx: Receiver, - internal_rx: Receiver, - mut connect_rx: mpsc::Receiver, -) { - let mut ipv4_listener = None; - let mut ipv6_listener = None; - - let mut control = swarm.behaviour().stream.new_control(); - #[allow(clippy::unwrap_used)] // TODO: Error handling - let mut incoming = control.accept(PROTOCOL).unwrap(); - let map = Arc::new(RwLock::new(HashMap::new())); - let mut relay_config = Vec::new(); - - loop { - tokio::select! { - Ok(event) = rx.recv_async() => match event { - HookEvent::PeerExpiredBy(_, identity) => { - let Some(peer) = p2p.peers.read().unwrap_or_else(PoisonError::into_inner).get(&identity).cloned() else { - continue; - }; - - let peer_id = remote_identity_to_libp2p_peerid(&identity); - let addrs = { - let state = peer.state.read().unwrap_or_else(PoisonError::into_inner); - - get_addrs(peer_id, &relay_config, state.discovered.values().flatten()) - }; - - - let mut control = control.clone(); - tokio::spawn(async move { - match timeout(Duration::from_secs(5), control.open_stream_with_addrs( - peer_id, - PROTOCOL, - addrs - )).await { - Ok(Ok(_)) => {} - Err(_) | Ok(Err(_)) => peer.disconnected_from(id), - }; - }); - }, - HookEvent::Shutdown { _guard } => { - let connected_peers = swarm.connected_peers().cloned().collect::>(); - for peer_id in connected_peers { - let _ = swarm.disconnect_peer_id(peer_id); - } - - if let Some((id, _)) = ipv4_listener.take() { - let _ = swarm.remove_listener(id); - } - if let Some((id, _)) = ipv6_listener.take() { - let _ = swarm.remove_listener(id); - } - - // TODO: We don't break the event loop so libp2p can be polled to keep cleaning up. - // break; - }, - _ => {}, - }, - Some((peer_id, mut stream)) = incoming.next() => { - let p2p = p2p.clone(); - let map = map.clone(); - tokio::spawn(async move { - let mut actual = [0; REMOTE_IDENTITY_LEN]; - match stream.read_exact(&mut actual).await { - Ok(_) => {}, - Err(e) => { - warn!("Failed to read remote identity with libp2p::PeerId({peer_id:?}): {e:?}"); - return; - }, - } - let identity = match RemoteIdentity::from_bytes(&actual) { - Ok(i) => i, - Err(e) => { - warn!("Failed to parse remote identity with libp2p::PeerId({peer_id:?}): {e:?}"); - return; - }, - }; - - // We need to go `PeerId -> RemoteIdentity` but as `PeerId` is a hash that's impossible. - // So to make this work the connection initiator will send their remote identity. - // It is however untrusted as they could send anything, so we convert it to a PeerId and check it matches the PeerId for this connection. - // If it matches, we are certain they own the private key as libp2p takes care of ensuring the PeerId is trusted. - let remote_identity_peer_id = remote_identity_to_libp2p_peerid(&identity); - if peer_id != remote_identity_peer_id { - warn!("Derived remote identity '{remote_identity_peer_id:?}' does not match libp2p::PeerId({peer_id:?})"); - return; - } - map.write().unwrap_or_else(PoisonError::into_inner).insert(peer_id, identity); - - // TODO: Sync metadata - let metadata = HashMap::new(); - - let stream = UnicastStream::new(identity, stream.compat()); - let (shutdown_tx, shutdown_rx) = oneshot::channel(); - p2p.connected_to( - id, - metadata, - stream, - shutdown_tx, - ); - - debug!("established inbound stream with '{}'", identity); - - let _todo = shutdown_rx; // TODO: Handle `shutdown_rx` - }); - }, - event = swarm.select_next_some() => if let SwarmEvent::ConnectionClosed { peer_id, num_established: 0, .. } = event { - let Some(identity) = map.write().unwrap_or_else(PoisonError::into_inner).remove(&peer_id) else { - warn!("Tried to remove a peer that wasn't in the map."); - continue; - }; - - let peers = p2p.peers.read().unwrap_or_else(PoisonError::into_inner); - let Some(peer) = peers.get(&identity) else { - warn!("Tried to remove a peer that wasn't in the P2P system."); - continue; - }; - - peer.disconnected_from(id); - }, - Ok(event) = internal_rx.recv_async() => match event { - InternalEvent::RegisterListener { id, ipv4, addr, result } => { - match swarm.listen_on(socketaddr_to_quic_multiaddr(&addr)) { - Ok(libp2p_listener_id) => { - let this = match ipv4 { - true => &mut ipv4_listener, - false => &mut ipv6_listener, - }; - // TODO: Diff the `addr` & if it's changed actually update it - if this.is_none() { - *this = Some((libp2p_listener_id, addr)); - p2p.register_listener_addr(id, addr); - } - - let _ = result.send(Ok(())); - }, - Err(e) => { - let _ = result.send(Err(e.to_string())); - }, - } - }, - InternalEvent::UnregisterListener { id, ipv4, result } => { - let this = match ipv4 { - true => &mut ipv4_listener, - false => &mut ipv6_listener, - }; - if let Some((addr_id, addr)) = this.take() { - if swarm.remove_listener(addr_id) { - p2p.unregister_listener_addr(id, addr); - } - } - let _ = result.send(Ok(())); - }, - InternalEvent::RegisterRelays { relays, result } => { - // TODO: Replace any existing relays - // TODO: Only add some of the relays??? - - for relay in &relays { - let peer_id = match PeerId::from_str(&relay.peer_id) { - Ok(peer_id) => peer_id, - Err(err) => { - error!("Failed to parse Relay peer ID '{}': {err:?}", relay.peer_id); - continue; - }, - }; - let addrs = relay - .addrs - .iter() - .map(socketaddr_to_quic_multiaddr) - .collect::>(); - - for addr in addrs { - swarm - .behaviour_mut() - .autonat - .add_server(peer_id, Some(addr.clone())); - swarm.add_peer_address(peer_id, addr); - } - - // TODO: Only do this if autonat fails - match swarm.listen_on( - Multiaddr::empty() - .with(Protocol::Memory(40)) - .with(Protocol::P2p(peer_id)) - .with(Protocol::P2pCircuit) - ) { - Ok(_) => {}, - Err(e) => { - error!("Failed to listen on relay server '{}': {e}", relay.id); - - // TODO: Try again if this fails - }, - } - } - - relay_config = relays; - - // TODO: Proper error handling - result.send(Ok(())).ok(); - }, - }, - Some(req) = connect_rx.recv() => { - let mut control = control.clone(); - let self_remote_identity = p2p.identity().to_remote_identity(); - let map = map.clone(); - let peer_id = remote_identity_to_libp2p_peerid(&req.to); - let addrs = get_addrs(peer_id, &relay_config, req.addrs.iter()); - - tokio::spawn(async move { - match control.open_stream_with_addrs( - peer_id, - PROTOCOL, - addrs, - ).await { - Ok(mut stream) => { - map.write().unwrap_or_else(PoisonError::into_inner).insert(peer_id, req.to); - - match stream.write_all(&self_remote_identity.get_bytes()).await { - Ok(_) => { - debug!("Established outbound stream with '{}'", req.to); - let _ = req.tx.send(Ok(UnicastStream::new(req.to, stream.compat()))); - }, - Err(e) => { - let _ = req.tx.send(Err(e.to_string())); - }, - } - }, - Err(e) => { - let _ = req.tx.send(Err(e.to_string())); - }, - } - }); - } - } - } -} - -fn get_addrs<'a>( - peer_id: PeerId, - relay_config: &[RelayServerEntry], - addrs: impl Iterator + 'a, -) -> Vec { - addrs - .flat_map(|v| match v { - PeerConnectionCandidate::SocketAddr(addr) => vec![socketaddr_to_quic_multiaddr(addr)], - PeerConnectionCandidate::Relay => relay_config - .iter() - .filter_map(|e| match PeerId::from_str(&e.peer_id) { - Ok(peer_id) => Some(e.addrs.iter().map(move |addr| (peer_id, addr))), - Err(err) => { - error!("Failed to parse peer ID '{}': {err:?}", e.peer_id); - None - } - }) - .flatten() - .map(|(relay_peer_id, addr)| { - let mut addr = socketaddr_to_quic_multiaddr(addr); - addr.push(Protocol::P2p(relay_peer_id)); - addr.push(Protocol::P2pCircuit); - addr.push(Protocol::P2p(peer_id)); - addr - }) - .collect::>(), - }) - .collect::>() -} diff --git a/crates/prisma-cli/Cargo.toml b/crates/prisma-cli/Cargo.toml index 4c531ff61..69522f1af 100644 --- a/crates/prisma-cli/Cargo.toml +++ b/crates/prisma-cli/Cargo.toml @@ -9,4 +9,5 @@ edition = { workspace = true } # Spacedrive Sub-crates sd-sync-generator = { path = "../sync-generator" } +# Workspace dependencies prisma-client-rust-cli = { workspace = true } diff --git a/crates/prisma/Cargo.toml b/crates/prisma/Cargo.toml index d83158cd1..d42d563c8 100644 --- a/crates/prisma/Cargo.toml +++ b/crates/prisma/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] # Spacedrive Sub-crates -sd-cache = { path = "../cache" } sd-sync = { path = "../sync" } +# Workspace dependencies prisma-client-rust = { workspace = true } +rmpv = { workspace = true } +rmp-serde = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -rmp-serde = "1.1.2" -rmpv.workspace = true uuid = { workspace = true } diff --git a/crates/prisma/src/lib.rs b/crates/prisma/src/lib.rs index 5a5a5f3b9..d5116b855 100644 --- a/crates/prisma/src/lib.rs +++ b/crates/prisma/src/lib.rs @@ -1,24 +1,9 @@ +#![recursion_limit = "256"] #[allow(warnings, unused)] pub mod prisma; #[allow(warnings, unused)] pub mod prisma_sync; -macro_rules! impl_model { - ($module:ident) => { - impl sd_cache::Model for prisma::$module::Data { - fn name() -> &'static str { - prisma::$module::NAME - } - } - }; -} - -impl_model!(tag); -impl_model!(object); -impl_model!(location); -impl_model!(indexer_rule); -impl_model!(file_path); - pub async fn test_db() -> std::sync::Arc { std::sync::Arc::new( prisma::PrismaClient::_builder() diff --git a/crates/sd-indexer/Cargo.toml b/crates/sd-indexer/Cargo.toml deleted file mode 100644 index 65e18084e..000000000 --- a/crates/sd-indexer/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "sd-indexer" -version = "0.0.1" -license.workspace = true -edition.workspace = true -repository.workspace = true -publish = false - -[dependencies] -sd-utils = { path = "../utils" } -sd-file-ext = { path = "../file-ext" } -sd-core-file-path-helper = { path = "../../core/crates/file-path-helper" } -sd-core-indexer-rules = { path = "../../core/crates/indexer-rules" } - -chrono.workspace = true -futures-util = "0.3.30" -globset = { version = "0.4.14", features = ["serde1"] } -opendal = "0.45.1" -serde = { workspace = true, features = ["derive"] } -specta.workspace = true -thiserror.workspace = true -tracing.workspace = true -rmp-serde = "1.1.2" - -# TODO: Remove these -rspc.workspace = true -tokio = { workspace = true, features = ["fs"] } -sd-prisma = { path = "../prisma" } -tempfile.workspace = true -normpath = { workspace = true, features = ["localization"] } diff --git a/crates/sd-indexer/src/ephemeral.rs b/crates/sd-indexer/src/ephemeral.rs deleted file mode 100644 index 3b38d3b9d..000000000 --- a/crates/sd-indexer/src/ephemeral.rs +++ /dev/null @@ -1,212 +0,0 @@ -use std::{ - future::ready, - io::{self, ErrorKind}, - path::PathBuf, -}; - -use chrono::{DateTime, Utc}; -use futures_util::{Stream, StreamExt, TryFutureExt}; -use opendal::{Operator, Scheme}; -use sd_core_file_path_helper::path_is_hidden; -use sd_core_indexer_rules::{IndexerRule, RuleKind}; -use sd_file_ext::{extensions::Extension, kind::ObjectKind}; -use serde::Serialize; -use specta::Type; - -use crate::stream::TaskStream; - -#[derive(Serialize, Type, Debug)] -pub struct NonIndexedPathItem { - pub path: String, - pub name: String, - pub extension: String, - pub kind: i32, // TODO: Use `ObjectKind` instead - // TODO: Use `kind` instead and drop this - pub is_dir: bool, - pub date_created: DateTime, - pub date_modified: DateTime, - pub size_in_bytes_bytes: Vec, - pub hidden: bool, -} - -pub async fn ephemeral( - opendal: Operator, - rules: Vec, - path: &str, -) -> opendal::Result>> { - let is_fs = opendal.info().scheme() == Scheme::Fs; - let base_path = PathBuf::from(opendal.info().root()); - let mut lister = opendal.lister(path).await?; - - Ok(TaskStream::new(move |tx| async move { - let rules = &*rules; - while let Some(entry) = lister.next().await { - let base_path = base_path.clone(); - let result = ready(entry) - .map_err(|err| io::Error::new(ErrorKind::Other, format!("OpenDAL: {err:?}"))) - .and_then(|entry| async move { - let path = base_path.join(entry.path()); - - let extension = (!path.is_dir()) - .then(|| { - path.extension() - .and_then(|s| s.to_str().map(str::to_string)) - .unwrap_or_default() - }) - .unwrap_or_default(); - - // Only Windows supports normalised files without FS access. - // For now we only do normalisation for local files. - let (relative_path, name) = if is_fs { - crate::path::normalize_path(&path).map_err(|err| { - io::Error::new( - ErrorKind::Other, - format!("Error normalising path '{path:?}': {err:?}"), - ) - })? - } else { - unreachable!(); - // ( - // path.file_stem() - // .and_then(|s| s.to_str().map(str::to_string)) - // .ok_or_else(|| { - // io::Error::new( - // ErrorKind::Other, - // "error on file '{path:?}: non UTF-8", - // ) - // })? - // .to_string(), - // path.to_str() - // .expect("non UTF-8 path - is unreachable") - // .to_string(), - // ) - }; - - let kind = if entry.metadata().is_dir() { - ObjectKind::Folder - } else if is_fs { - Extension::resolve_conflicting(&path, false) - .await - .map(Into::into) - .unwrap_or(ObjectKind::Unknown) - } else { - // TODO: Determine kind of remote files - https://linear.app/spacedriveapp/issue/ENG-1718/fix-objectkind-of-remote-files - ObjectKind::Unknown - }; - - let name = (kind != ObjectKind::Folder) - .then(|| { - path.file_stem() - .and_then(|s| s.to_str().map(str::to_string)) - }) - .flatten() - .unwrap_or(name); - - let mut path = path - .to_str() - .expect("comes from string so this is impossible") - .to_string(); - - // OpenDAL will *always* end in a `/` for directories, we strip it here so we can give the path to Tokio. - if path.ends_with('/') && path.len() > 1 { - path.pop(); - } - - let result = IndexerRule::apply_all(rules, &path).await.map_err(|err| { - io::Error::new( - ErrorKind::Other, - format!("Error running indexer rules on file '{path:?}': {err:?}"), - ) - })?; - - // No OS Protected and No Hidden rules, must always be from this kind, should panic otherwise - if result[&RuleKind::RejectFilesByGlob] - .iter() - .any(|reject| !reject) - { - return Ok(None); // Skip this file - }; - - // TODO: OpenDAL last modified time - https://linear.app/spacedriveapp/issue/ENG-1717/fix-modified-time - // TODO: OpenDAL hidden files - https://linear.app/spacedriveapp/issue/ENG-1720/fix-hidden-files - let (hidden, date_created, date_modified, size) = if is_fs { - let metadata = tokio::fs::metadata(&path).await.map_err(|err| { - io::Error::new( - ErrorKind::Other, - format!("Error getting metadata for '{path:?}': {err:?}"), - ) - })?; - - ( - path_is_hidden(&path, &metadata), - metadata - .created() - .map_err(|err| { - io::Error::new( - ErrorKind::Other, - format!("Error determining created time for '{path:?}': {err:?}"), - ) - })? - .into(), - metadata - .modified() - .map_err(|err| { - io::Error::new( - ErrorKind::Other, - format!("Error determining modified time for '{path:?}': {err:?}"), - ) - })? - .into(), - metadata.len(), - ) - } else { - (false, Default::default(), Default::default(), 0) - }; - - // TODO: Fix this - https://linear.app/spacedriveapp/issue/ENG-1725/fix-last-modified - #[allow(clippy::redundant_locals)] - let date_modified = date_modified; - // entry.metadata().last_modified().ok_or_else(|| { - // io::Error::new( - // ErrorKind::Other, - // format!("Error getting modified time for '{path:?}'"), - // ) - // })?; - - #[allow(clippy::redundant_locals)] - // TODO: Fix this - https://linear.app/spacedriveapp/issue/ENG-1726/fix-file-size - let size = size; - - Ok(Some(NonIndexedPathItem { - path: relative_path, - name, - extension, - kind: kind as i32, - is_dir: kind == ObjectKind::Folder, - date_created, - date_modified, - // TODO - // entry - // .metadata() - // .content_length() - size_in_bytes_bytes: size.to_be_bytes().to_vec(), - hidden, - })) - }) - .await; - - if tx - .send(match result { - Ok(Some(item)) => Ok(item), - Ok(None) => continue, - Err(err) => Err(err), - }) - .await - .is_err() - { - // Stream has been dropped. - continue; - } - } - })) -} diff --git a/crates/sd-indexer/src/lib.rs b/crates/sd-indexer/src/lib.rs deleted file mode 100644 index c34480996..000000000 --- a/crates/sd-indexer/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod ephemeral; -pub mod path; -mod stream; - -pub use ephemeral::*; diff --git a/crates/sd-indexer/src/path.rs b/crates/sd-indexer/src/path.rs deleted file mode 100644 index 9803c84a2..000000000 --- a/crates/sd-indexer/src/path.rs +++ /dev/null @@ -1,57 +0,0 @@ -use std::{ - io, - path::{Component, Path}, -}; - -use normpath::PathExt; - -pub fn normalize_path(path: impl AsRef) -> io::Result<(String, String)> { - let mut path = path.as_ref().to_path_buf(); - let (location_path, normalized_path) = path - // Normalize path and also check if it exists - .normalize() - .and_then(|normalized_path| { - if cfg!(windows) { - // Use normalized path as main path on Windows - // This ensures we always receive a valid windows formatted path - // ex: /Users/JohnDoe/Downloads will become C:\Users\JohnDoe\Downloads - // Internally `normalize` calls `GetFullPathNameW` on Windows - // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew - path = normalized_path.as_path().to_path_buf(); - } - - Ok(( - // TODO: Maybe save the path bytes instead of the string representation to avoid depending on UTF-8 - path.to_str().map(str::to_string).ok_or(io::Error::new( - io::ErrorKind::InvalidInput, - "Found non-UTF-8 path", - ))?, - normalized_path, - )) - })?; - - // Not needed on Windows because the normalization already handles it - if cfg!(not(windows)) { - // Replace location_path with normalize_path, when the first one ends in `.` or `..` - // This is required so localize_name doesn't panic - if let Some(component) = path.components().next_back() { - if matches!(component, Component::CurDir | Component::ParentDir) { - path = normalized_path.as_path().to_path_buf(); - } - } - } - - // Use `to_string_lossy` because a partially corrupted but identifiable name is better than nothing - let mut name = path.localize_name().to_string_lossy().to_string(); - - // Windows doesn't have a root directory - if cfg!(not(windows)) && name == "/" { - name = "Root".to_string() - } - - if name.replace(char::REPLACEMENT_CHARACTER, "") == "" { - name = "Unknown".to_string() - } - - Ok((location_path, name)) -} diff --git a/crates/sd-indexer/src/stream.rs b/crates/sd-indexer/src/stream.rs deleted file mode 100644 index 0922c3399..000000000 --- a/crates/sd-indexer/src/stream.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::{ - pin::Pin, - task::{Context, Poll}, -}; - -use futures_util::Future; -use tokio::sync::mpsc; - -/// Construct a stream from a Tokio task. -/// Similar to `tokio_stream::stream!` but not a macro for better DX. -pub struct TaskStream { - task: tokio::task::JoinHandle<()>, - receiver: mpsc::Receiver, -} - -impl TaskStream { - pub fn new(task: impl FnOnce(mpsc::Sender) -> F + Send + 'static) -> Self { - let (tx, rx) = mpsc::channel(256); - Self { - task: tokio::spawn(async move { - task(tx).await; - }), - receiver: rx, - } - } -} - -impl futures_util::Stream for TaskStream { - type Item = T; - - fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - self.receiver.poll_recv(cx) - } -} - -impl Drop for TaskStream { - fn drop(&mut self) { - self.task.abort(); - } -} diff --git a/crates/sync-generator/Cargo.toml b/crates/sync-generator/Cargo.toml index 66c751138..8b07f7146 100644 --- a/crates/sync-generator/Cargo.toml +++ b/crates/sync-generator/Cargo.toml @@ -10,4 +10,5 @@ prisma-client-rust-sdk = { workspace = true } serde = { workspace = true, features = ["derive"] } thiserror = { workspace = true } +# Specific Sync Generator dependencies nom = "7.1.3" diff --git a/crates/sync-generator/src/lib.rs b/crates/sync-generator/src/lib.rs index 4d61c045e..0d546575c 100644 --- a/crates/sync-generator/src/lib.rs +++ b/crates/sync-generator/src/lib.rs @@ -17,7 +17,6 @@ enum Error {} #[derive(serde::Deserialize)] struct SDSyncGenerator {} -#[allow(unused)] #[derive(Clone)] pub enum ModelSyncType<'a> { Local { diff --git a/crates/sync-generator/src/model.rs b/crates/sync-generator/src/model.rs index 6c8cb7bef..f68437446 100644 --- a/crates/sync-generator/src/model.rs +++ b/crates/sync-generator/src/model.rs @@ -174,6 +174,7 @@ pub fn module((model, sync_type): ModelWithSyncType) -> Module { model.name(), quote! { use super::prisma::*; + use prisma_client_rust::scalar_types::*; #sync_id diff --git a/crates/sync-generator/src/sync_data.rs b/crates/sync-generator/src/sync_data.rs index 041438627..f1bfcade7 100644 --- a/crates/sync-generator/src/sync_data.rs +++ b/crates/sync-generator/src/sync_data.rs @@ -37,10 +37,10 @@ pub fn r#enum(models: Vec) -> TokenStream { let model_name_snake = snake_ident(model.name()); let match_arms = match sync_type.as_ref()? { - ModelSyncType::Shared { id, .. } => { + ModelSyncType::Shared { id, model_id } => { let (get_id, equals_value, id_name_snake, create_id) = match id.refine() { RefinedFieldWalker::Relation(rel) => { - let scalar_field = rel.referenced_fields().unwrap().next().unwrap(); + let scalar_field = rel.fields().unwrap().next().unwrap(); let id_name_snake = snake_ident(scalar_field.name()); let field_name_snake = snake_ident(rel.name()); let opposite_model_name_snake = @@ -77,12 +77,16 @@ pub fn r#enum(models: Vec) -> TokenStream { #get_id match data { - sd_sync::CRDTOperationData::Create => { + sd_sync::CRDTOperationData::Create(data) => { + let data: Vec<_> = data.into_iter().map(|(field, value)| { + prisma::#model_name_snake::SetParam::deserialize(&field, value).unwrap() + }).collect(); + db.#model_name_snake() .upsert( prisma::#model_name_snake::#id_name_snake::equals(#equals_value), - prisma::#model_name_snake::create(#create_id, vec![]), - vec![] + prisma::#model_name_snake::create(#create_id, data.clone()), + data ) .exec() .await?; @@ -106,6 +110,15 @@ pub fn r#enum(models: Vec) -> TokenStream { .delete(prisma::#model_name_snake::#id_name_snake::equals(#equals_value)) .exec() .await?; + + db.crdt_operation() + .delete_many(vec![ + prisma::crdt_operation::model::equals(#model_id as i32), + prisma::crdt_operation::record_id::equals(rmp_serde::to_vec(&id).unwrap()), + prisma::crdt_operation::kind::equals(sd_sync::OperationKind::Create.to_string()) + ]) + .exec() + .await?; }, } } @@ -171,7 +184,7 @@ pub fn r#enum(models: Vec) -> TokenStream { let id = prisma::#model_name_snake::#compound_id(group.id, item.id); match data { - sd_sync::CRDTOperationData::Create => { + sd_sync::CRDTOperationData::Create(_) => { db.#model_name_snake() .upsert( id, diff --git a/crates/sync/Cargo.toml b/crates/sync/Cargo.toml index 860e6fa40..003217aaf 100644 --- a/crates/sync/Cargo.toml +++ b/crates/sync/Cargo.toml @@ -7,8 +7,8 @@ edition = { workspace = true } [dependencies] prisma-client-rust = { workspace = true } -rmp = "0.8.12" -rmp-serde = "1.1.2" +rmp = { workspace = true } +rmp-serde = { workspace = true } rmpv = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/crates/sync/README.md b/crates/sync/README.md deleted file mode 100644 index 1098b660d..000000000 --- a/crates/sync/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# crdt-rs - -Just @brendonovich experimenting with CRDT stuff. diff --git a/crates/sync/example/Cargo.toml b/crates/sync/example/Cargo.toml index 993a15369..8bd3f690d 100644 --- a/crates/sync/example/Cargo.toml +++ b/crates/sync/example/Cargo.toml @@ -11,14 +11,16 @@ edition = { workspace = true } # Spacedrive Sub-crates sd-sync = { path = ".." } +# Workspace dependencies axum = { workspace = true } -rspc = { workspace = true, features = ["axum"] } -tokio = { workspace = true, features = ["full"] } +http = { workspace = true } prisma-client-rust = { workspace = true } +rspc = { workspace = true, features = ["axum"] } serde_json = { workspace = true } serde = { workspace = true, features = ["derive"] } +tokio = { workspace = true, features = ["full"] } uuid = { workspace = true, features = ["v4"] } +# Specific Core dependencies dotenv = "0.15.0" -tower-http = { version = "0.3.4", features = ["cors"] } -http = "0.2.8" +tower-http = { version = "0.4.4", features = ["cors"] } # Update blocked by http diff --git a/crates/sync/src/compressed.rs b/crates/sync/src/compressed.rs index d4b1adf9e..1056a68ad 100644 --- a/crates/sync/src/compressed.rs +++ b/crates/sync/src/compressed.rs @@ -7,10 +7,8 @@ use crate::{CRDTOperation, CRDTOperationData}; pub type CompressedCRDTOperationsForModel = Vec<(rmpv::Value, Vec)>; /// Stores a bunch of CRDTOperations in a more memory-efficient form for sending to the cloud. -#[derive(Serialize, Deserialize)] -pub struct CompressedCRDTOperations( - pub(self) Vec<(Uuid, Vec<(u16, CompressedCRDTOperationsForModel)>)>, -); +#[derive(Serialize, Deserialize, Debug, PartialEq)] +pub struct CompressedCRDTOperations(pub Vec<(Uuid, Vec<(u16, CompressedCRDTOperationsForModel)>)>); impl CompressedCRDTOperations { pub fn new(ops: Vec) -> Self { @@ -25,7 +23,7 @@ impl CompressedCRDTOperations { let mut instance_id = first.instance; let mut instance = vec![]; - let mut model_str = first.model.clone(); + let mut model_str = first.model; let mut model = vec![]; let mut record_id = first.record_id.clone(); @@ -38,7 +36,7 @@ impl CompressedCRDTOperations { std::mem::take(&mut record), )); instance.push(( - std::mem::replace(&mut model_str, op.model.clone()), + std::mem::replace(&mut model_str, op.model), std::mem::take(&mut model), )); compressed.push(( @@ -51,7 +49,7 @@ impl CompressedCRDTOperations { std::mem::take(&mut record), )); instance.push(( - std::mem::replace(&mut model_str, op.model.clone()), + std::mem::replace(&mut model_str, op.model), std::mem::take(&mut model), )); } else if record_id != op.record_id { @@ -71,6 +69,41 @@ impl CompressedCRDTOperations { Self(compressed) } + pub fn first(&self) -> Option<(Uuid, u16, &rmpv::Value, &CompressedCRDTOperation)> { + self.0.first().and_then(|(instance, data)| { + data.first().and_then(|(model, data)| { + data.first() + .and_then(|(record, ops)| ops.first().map(|op| (*instance, *model, record, op))) + }) + }) + } + + pub fn last(&self) -> Option<(Uuid, u16, &rmpv::Value, &CompressedCRDTOperation)> { + self.0.last().and_then(|(instance, data)| { + data.last().and_then(|(model, data)| { + data.last() + .and_then(|(record, ops)| ops.last().map(|op| (*instance, *model, record, op))) + }) + }) + } + + #[must_use] + pub fn len(&self) -> usize { + self.0 + .iter() + .map(|(_, data)| { + data.iter() + .map(|(_, data)| data.iter().map(|(_, ops)| ops.len()).sum::()) + .sum::() + }) + .sum::() + } + + #[must_use] + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + pub fn into_ops(self) -> Vec { let mut ops = vec![]; @@ -80,7 +113,7 @@ impl CompressedCRDTOperations { for op in record { ops.push(CRDTOperation { instance: instance_id, - model: model_str.clone(), + model: model_str, record_id: record_id.clone(), timestamp: op.timestamp, data: op.data, @@ -94,7 +127,7 @@ impl CompressedCRDTOperations { } } -#[derive(PartialEq, Serialize, Deserialize, Clone)] +#[derive(PartialEq, Serialize, Deserialize, Clone, Debug)] pub struct CompressedCRDTOperation { pub timestamp: NTP64, pub data: CRDTOperationData, @@ -123,49 +156,49 @@ mod test { timestamp: NTP64(0), model: 0, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CRDTOperation { instance, timestamp: NTP64(0), model: 0, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CRDTOperation { instance, timestamp: NTP64(0), model: 0, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CRDTOperation { instance, timestamp: NTP64(0), model: 1, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CRDTOperation { instance, timestamp: NTP64(0), model: 1, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CRDTOperation { instance, timestamp: NTP64(0), model: 0, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CRDTOperation { instance, timestamp: NTP64(0), model: 0, record_id: rmpv::Value::Nil, - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, ]; @@ -192,15 +225,15 @@ mod test { vec![ CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, ], )], @@ -212,11 +245,11 @@ mod test { vec![ CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, ], )], @@ -228,11 +261,11 @@ mod test { vec![ CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, CompressedCRDTOperation { timestamp: NTP64(0), - data: CRDTOperationData::Create, + data: CRDTOperationData::create(), }, ], )], diff --git a/crates/sync/src/crdt.rs b/crates/sync/src/crdt.rs index ef7a4ff86..1b5f265c2 100644 --- a/crates/sync/src/crdt.rs +++ b/crates/sync/src/crdt.rs @@ -1,4 +1,4 @@ -use std::fmt::Debug; +use std::{collections::BTreeMap, fmt::Debug}; use serde::{Deserialize, Serialize}; use specta::Type; @@ -24,7 +24,7 @@ impl std::fmt::Display for OperationKind<'_> { #[derive(PartialEq, Serialize, Deserialize, Clone, Debug, Type)] pub enum CRDTOperationData { #[serde(rename = "c")] - Create, + Create(#[specta(type = BTreeMap)] BTreeMap), #[serde(rename = "u")] Update { field: String, @@ -36,9 +36,13 @@ pub enum CRDTOperationData { } impl CRDTOperationData { + pub fn create() -> Self { + Self::Create(Default::default()) + } + pub fn as_kind(&self) -> OperationKind { match self { - Self::Create => OperationKind::Create, + Self::Create(_) => OperationKind::Create, Self::Update { field, .. } => OperationKind::Update(field), Self::Delete => OperationKind::Delete, } @@ -66,9 +70,9 @@ impl CRDTOperation { impl Debug for CRDTOperation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("CRDTOperation") - .field("instance", &self.instance.to_string()) - .field("timestamp", &self.timestamp.to_string()) - // .field("typ", &self.typ) + .field("data", &self.data) + .field("model", &self.model) + .field("record_id", &self.record_id.to_string()) .finish() } } diff --git a/crates/sync/src/factory.rs b/crates/sync/src/factory.rs index dea6a86e0..80966b477 100644 --- a/crates/sync/src/factory.rs +++ b/crates/sync/src/factory.rs @@ -21,7 +21,10 @@ pub trait OperationFactory { fn get_clock(&self) -> &HLC; fn get_instance(&self) -> Uuid; - fn new_op(&self, id: &TSyncId, data: CRDTOperationData) -> CRDTOperation { + fn new_op(&self, id: &TSyncId, data: CRDTOperationData) -> CRDTOperation + where + TSyncId::Model: crate::SyncModel, + { let timestamp = self.get_clock().new_timestamp(); CRDTOperation { @@ -38,18 +41,15 @@ pub trait OperationFactory { id: TSyncId, values: impl IntoIterator + 'static, ) -> Vec { - [self.new_op(&id, CRDTOperationData::Create)] - .into_iter() - .chain(values.into_iter().map(|(name, value)| { - self.new_op( - &id, - CRDTOperationData::Update { - field: name.to_string(), - value, - }, - ) - })) - .collect() + vec![self.new_op( + &id, + CRDTOperationData::Create( + values + .into_iter() + .map(|(name, value)| (name.to_string(), value)) + .collect(), + ), + )] } fn shared_update, TModel: SharedSyncModel>( &self, @@ -77,18 +77,15 @@ pub trait OperationFactory { id: TSyncId, values: impl IntoIterator + 'static, ) -> Vec { - [self.new_op(&id, CRDTOperationData::Create)] - .into_iter() - .chain(values.into_iter().map(|(name, value)| { - self.new_op( - &id, - CRDTOperationData::Update { - field: name.to_string(), - value, - }, - ) - })) - .collect() + vec![self.new_op( + &id, + CRDTOperationData::Create( + values + .into_iter() + .map(|(name, value)| (name.to_string(), value)) + .collect(), + ), + )] } fn relation_update, TModel: RelationSyncModel>( &self, diff --git a/crates/sync/src/model_traits.rs b/crates/sync/src/model_traits.rs index cd7d2d73f..b0a063f2e 100644 --- a/crates/sync/src/model_traits.rs +++ b/crates/sync/src/model_traits.rs @@ -2,7 +2,7 @@ use prisma_client_rust::ModelTypes; use serde::{de::DeserializeOwned, Serialize}; pub trait SyncId: Serialize + DeserializeOwned { - type Model: SyncModel; + type Model; } pub trait SyncModel: ModelTypes { diff --git a/crates/task-system/Cargo.toml b/crates/task-system/Cargo.toml index 062983eac..e1d932230 100644 --- a/crates/task-system/Cargo.toml +++ b/crates/task-system/Cargo.toml @@ -1,14 +1,12 @@ [package] name = "sd-task-system" version = "0.1.0" -authors = ["Ericson \"Fogo\" Soares "] -rust-version = "1.75.0" +authors = ["Ericson Soares "] +rust-version = "1.75" license.workspace = true edition.workspace = true repository.workspace = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] # Workspace deps async-channel = { workspace = true } @@ -26,19 +24,18 @@ tokio-stream = { workspace = true } tracing = { workspace = true } uuid = { workspace = true, features = ["v4"] } -# External deps -downcast-rs = "1.2.0" -pin-project = "1.1.4" +# Specific Task System dependencies +downcast-rs = "1.2" +pin-project = "1.1" [dev-dependencies] -tokio = { workspace = true, features = ["macros", "test-util", "fs"] } -tempfile = { workspace = true } -rand = "0.8.5" -tracing-test = { workspace.dev-dependencies = true, features = [ - "no-env-filter", -] } -thiserror = { workspace = true } lending-stream = { workspace = true } -serde = { workspace = true, features = ["derive"] } +rand = { workspace = true } rmp-serde = { workspace = true } +serde = { workspace = true, features = ["derive"] } +tempfile = { workspace = true } +thiserror = { workspace = true } +tokio = { workspace = true, features = ["macros", "test-util", "fs"] } +tracing-test = { workspace = true, features = ["no-env-filter"] } uuid = { workspace = true, features = ["serde"] } +tracing-subscriber = { workspace = true, features = ["env-filter"] } diff --git a/crates/task-system/src/error.rs b/crates/task-system/src/error.rs index 626be73c3..8e9747b8e 100644 --- a/crates/task-system/src/error.rs +++ b/crates/task-system/src/error.rs @@ -1,6 +1,6 @@ use std::{error::Error, fmt}; -use super::task::TaskId; +use super::task::{Task, TaskId}; /// Task system's error type definition, representing when internal errors occurs. #[derive(Debug, thiserror::Error)] @@ -11,6 +11,8 @@ pub enum SystemError { TaskAborted(TaskId), #[error("task join error ")] TaskJoin(TaskId), + #[error("task timeout error ")] + TaskTimeout(TaskId), #[error("forced abortion for task timed out")] TaskForcedAbortTimeout(TaskId), } @@ -26,3 +28,8 @@ pub trait RunError: Error + fmt::Debug + Send + Sync + 'static {} /// [`std::fmt::Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html). /// So you will not need to implement this trait for your error type, just implement the `Error` and `Debug` impl RunError for T {} + +/// A task system dispatcher error type, returning tasks when the task system has shutdown. +#[derive(Debug, thiserror::Error)] +#[error("task system already shutdown and can't dispatch more tasks: ", .0.len())] +pub struct DispatcherShutdownError(pub Vec>>); diff --git a/crates/task-system/src/lib.rs b/crates/task-system/src/lib.rs index ef2ed8eb7..7e6349db5 100644 --- a/crates/task-system/src/lib.rs +++ b/crates/task-system/src/lib.rs @@ -93,7 +93,7 @@ mod system; mod task; mod worker; -pub use error::{RunError, SystemError as TaskSystemError}; +pub use error::{DispatcherShutdownError, RunError, SystemError as TaskSystemError}; pub use system::{ BaseDispatcher as BaseTaskDispatcher, Dispatcher as TaskDispatcher, System as TaskSystem, }; diff --git a/crates/task-system/src/message.rs b/crates/task-system/src/message.rs index f6f8265c7..723506e3f 100644 --- a/crates/task-system/src/message.rs +++ b/crates/task-system/src/message.rs @@ -1,8 +1,11 @@ +use std::sync::Arc; + +use async_channel as chan; use tokio::sync::oneshot; use super::{ error::{RunError, SystemError}, - task::{TaskId, TaskWorkState}, + task::{InternalTaskExecStatus, TaskId, TaskWorkState, TaskWorktable}, worker::WorkerId, }; @@ -12,35 +15,29 @@ pub enum SystemMessage { WorkingReport(WorkerId), ResumeTask { task_id: TaskId, - worker_id: WorkerId, + task_work_table: Arc, ack: oneshot::Sender>, }, PauseNotRunningTask { task_id: TaskId, - worker_id: WorkerId, + task_work_table: Arc, ack: oneshot::Sender>, }, CancelNotRunningTask { task_id: TaskId, - worker_id: WorkerId, - ack: oneshot::Sender<()>, + task_work_table: Arc, + ack: oneshot::Sender>, }, ForceAbortion { task_id: TaskId, - worker_id: WorkerId, + task_work_table: Arc, ack: oneshot::Sender>, }, - NotifyIdleWorkers { - start_from: WorkerId, - task_count: usize, - }, ShutdownRequest(oneshot::Sender>), } -#[derive(Debug)] pub enum WorkerMessage { NewTask(TaskWorkState), - TaskCountRequest(oneshot::Sender), ResumeTask { task_id: TaskId, ack: oneshot::Sender>, @@ -51,13 +48,25 @@ pub enum WorkerMessage { }, CancelNotRunningTask { task_id: TaskId, - ack: oneshot::Sender<()>, + ack: oneshot::Sender>, }, ForceAbortion { task_id: TaskId, ack: oneshot::Sender>, }, ShutdownRequest(oneshot::Sender<()>), - StealRequest(oneshot::Sender>>), - WakeUp, + StealRequest { + stealer_id: WorkerId, + ack: oneshot::Sender, + stolen_task_tx: chan::Sender>>, + }, } + +pub struct TaskRunnerOutput { + pub task_work_state: TaskWorkState, + pub status: InternalTaskExecStatus, +} + +pub struct TaskOutputMessage(pub TaskId, pub Result, ()>); + +pub struct StoleTaskMessage(pub TaskWorkState); diff --git a/crates/task-system/src/system.rs b/crates/task-system/src/system.rs index 41a2c802d..904b0a5eb 100644 --- a/crates/task-system/src/system.rs +++ b/crates/task-system/src/system.rs @@ -15,13 +15,13 @@ use async_channel as chan; use futures::StreamExt; use futures_concurrency::future::Join; use tokio::{spawn, sync::oneshot, task::JoinHandle}; -use tracing::{error, info, trace, warn}; +use tracing::{error, info, instrument, trace, warn, Instrument}; use super::{ - error::{RunError, SystemError}, + error::{DispatcherShutdownError, RunError, SystemError}, message::SystemMessage, - task::{IntoTask, Task, TaskHandle, TaskId}, - worker::{AtomicWorkerId, WorkStealer, Worker, WorkerBuilder, WorkerId}, + task::{IntoTask, Task, TaskHandle, TaskId, TaskWorktable}, + worker::{AtomicWorkerId, WorkStealer, Worker, WorkerBuilder}, }; /// The task system is the main entry point for the library, it is responsible for creating and managing the workers @@ -34,17 +34,22 @@ pub struct System { msgs_tx: chan::Sender, dispatcher: BaseDispatcher, handle: RefCell>>, + has_shutdown: Arc, } impl System { /// Created a new task system with a number of workers equal to the available parallelism in the user's machine. pub fn new() -> Self { - let workers_count = std::thread::available_parallelism().map_or_else( - |e| { - error!("Failed to get available parallelism in the job system: {e:#?}"); - 1 - }, - NonZeroUsize::get, + // TODO: Using only the half of available cores, make this configurable on runtime in the future + let workers_count = usize::max( + std::thread::available_parallelism().map_or_else( + |e| { + error!("Failed to get available parallelism in the job system: {e:#?}"); + 1 + }, + NonZeroUsize::get, + ) / 2, + 1, ); let (msgs_tx, msgs_rx) = chan::bounded(8); @@ -79,7 +84,7 @@ impl System { .await { if e.is_panic() { - error!("Job system panicked: {e:#?}"); + error!(?e, "Task system panicked"); } else { trace!("Task system received shutdown signal and will exit..."); break; @@ -91,7 +96,9 @@ impl System { } }); - trace!("Task system online!"); + info!(%workers_count, "Task system online!"); + + let has_shutdown = Arc::new(AtomicBool::new(false)); Self { workers: Arc::clone(&workers), @@ -100,9 +107,10 @@ impl System { workers, idle_workers, last_worker_id: Arc::new(AtomicWorkerId::new(0)), + has_shutdown: Arc::clone(&has_shutdown), }, - handle: RefCell::new(Some(handle)), + has_shutdown, } } @@ -112,15 +120,20 @@ impl System { } /// Dispatches a task to the system, the task will be assigned to a worker and executed as soon as possible. - pub async fn dispatch(&self, into_task: impl IntoTask) -> TaskHandle { + #[allow(clippy::missing_panics_doc)] + pub async fn dispatch( + &self, + into_task: impl IntoTask, + ) -> Result, DispatcherShutdownError> { self.dispatcher.dispatch(into_task).await } /// Dispatches many tasks to the system, the tasks will be assigned to workers and executed as soon as possible. + #[allow(clippy::missing_panics_doc)] pub async fn dispatch_many> + Send>( &self, into_tasks: I, - ) -> Vec> + ) -> Result>, DispatcherShutdownError> where ::IntoIter: Send, { @@ -142,84 +155,50 @@ impl System { while let Some(msg) = msg_stream.next().await { match msg { SystemMessage::IdleReport(worker_id) => { - trace!("Task system received a worker idle report request: "); idle_workers[worker_id].store(true, Ordering::Relaxed); } SystemMessage::WorkingReport(worker_id) => { - trace!( - "Task system received a working report request: " - ); idle_workers[worker_id].store(false, Ordering::Relaxed); } SystemMessage::ResumeTask { task_id, - worker_id, + task_work_table, ack, - } => { - trace!("Task system received a task resume request: "); - workers[worker_id].resume_task(task_id, ack).await; - } + } => dispatch_resume_request(&workers, task_id, task_work_table, ack), SystemMessage::PauseNotRunningTask { task_id, - worker_id, + task_work_table, ack, } => { - trace!("Task system received a task resume request: "); - workers[worker_id] - .pause_not_running_task(task_id, ack) - .await; + dispatch_pause_not_running_task_request( + &workers, + task_id, + task_work_table, + ack, + ); } SystemMessage::CancelNotRunningTask { task_id, - worker_id, + task_work_table, ack, - } => { - trace!("Task system received a task resume request: "); - workers[worker_id] - .cancel_not_running_task(task_id, ack) - .await; - } + } => dispatch_cancel_not_running_task_request( + &workers, + task_id, + task_work_table, + ack, + ), SystemMessage::ForceAbortion { task_id, - worker_id, + task_work_table, ack, - } => { - trace!( - "Task system received a task force abortion request: \ - " - ); - workers[worker_id].force_task_abortion(task_id, ack).await; - } - - SystemMessage::NotifyIdleWorkers { - start_from, - task_count, - } => { - trace!( - "Task system received a request to notify idle workers: \ - " - ); - - for idx in (0..workers.len()) - .cycle() - .skip(start_from) - .take(usize::min(task_count, workers.len())) - { - if idle_workers[idx].load(Ordering::Relaxed) { - workers[idx].wake().await; - // we don't mark the worker as not idle because we wait for it to - // successfully steal a task and then report it back as active - } - } - } + } => dispatch_force_abortion_task_request(&workers, task_id, task_work_table, ack), SystemMessage::ShutdownRequest(tx) => { - trace!("Task system received a shutdown request"); tx.send(Ok(())) .expect("System channel closed trying to shutdown"); return; @@ -235,6 +214,7 @@ impl System { /// If the system message channel is closed for some unknown reason or if we fail to respond to /// oneshot channel with shutdown response. pub async fn shutdown(&self) { + self.has_shutdown.store(true, Ordering::Release); if let Some(handle) = self .handle .try_borrow_mut() @@ -263,7 +243,7 @@ impl System { } if let Err(e) = handle.await { - error!("Task system failed to shutdown on handle await: {e:#?}"); + error!(?e, "Task system failed to shutdown on handle await"); } } else { warn!("Trying to shutdown the tasks system that was already shutdown"); @@ -271,6 +251,173 @@ impl System { } } +#[instrument(skip(workers, ack))] +fn dispatch_resume_request( + workers: &Arc>>, + task_id: TaskId, + task_work_table: Arc, + ack: oneshot::Sender>, +) { + trace!("Task system received a task resume request"); + spawn( + { + let workers = Arc::clone(workers); + async move { + let (tx, rx) = oneshot::channel(); + let first_attempt_worker_id = task_work_table.worker_id(); + workers[first_attempt_worker_id] + .resume_task(task_id, tx) + .await; + let res = rx + .await + .expect("Task system channel closed trying to resume not running task"); + + if matches!(res, Err(SystemError::TaskNotFound(_))) { + warn!( + %first_attempt_worker_id, + "Failed the first try to resume a not running task, trying again", + ); + workers[task_work_table.worker_id()] + .resume_task(task_id, ack) + .await; + } else { + ack.send(res) + .expect("System channel closed trying to resume not running task"); + } + } + } + .in_current_span(), + ); + trace!("Task system resumed task"); +} + +#[instrument(skip(workers, ack, task_work_table))] +fn dispatch_pause_not_running_task_request( + workers: &Arc>>, + task_id: TaskId, + task_work_table: Arc, + ack: oneshot::Sender>, +) { + spawn( + { + let workers: Arc>> = Arc::clone(workers); + + async move { + let (tx, rx) = oneshot::channel(); + let first_attempt_worker_id = task_work_table.worker_id(); + workers[first_attempt_worker_id] + .pause_not_running_task(task_id, tx) + .await; + let res = rx + .await + .expect("Task system channel closed trying to pause not running task"); + + if matches!(res, Err(SystemError::TaskNotFound(_))) { + warn!( + %first_attempt_worker_id, + "Failed the first try to pause a not running task, trying again", + ); + workers[task_work_table.worker_id()] + .pause_not_running_task(task_id, ack) + .await; + } else { + ack.send(res) + .expect("System channel closed trying to pause not running task"); + } + } + } + .in_current_span(), + ); +} + +#[instrument(skip(workers, ack))] +fn dispatch_cancel_not_running_task_request( + workers: &Arc>>, + task_id: TaskId, + task_work_table: Arc, + ack: oneshot::Sender>, +) { + trace!("Task system received a task cancel request"); + spawn( + { + let workers = Arc::clone(workers); + async move { + let (tx, rx) = oneshot::channel(); + let first_attempt_worker_id = task_work_table.worker_id(); + workers[first_attempt_worker_id] + .cancel_not_running_task(task_id, tx) + .await; + let res = rx + .await + .expect("Task system channel closed trying to cancel a not running task"); + + if matches!(res, Err(SystemError::TaskNotFound(_))) { + if task_work_table.is_finalized() { + return ack + .send(Ok(())) + .expect("System channel closed trying to cancel a not running task"); + } + + warn!( + %first_attempt_worker_id, + "Failed the first try to cancel a not running task, trying again", + ); + workers[task_work_table.worker_id()] + .cancel_not_running_task(task_id, ack) + .await; + } else { + ack.send(res) + .expect("System channel closed trying to cancel not running task"); + } + } + } + .in_current_span(), + ); + + trace!("Task system canceled task"); +} + +#[instrument(skip(workers, ack))] +fn dispatch_force_abortion_task_request( + workers: &Arc>>, + task_id: TaskId, + task_work_table: Arc, + ack: oneshot::Sender>, +) { + trace!("Task system received a task force abortion request"); + spawn( + { + let workers = Arc::clone(workers); + async move { + let (tx, rx) = oneshot::channel(); + let first_attempt_worker_id = task_work_table.worker_id(); + workers[first_attempt_worker_id] + .force_task_abortion(task_id, tx) + .await; + let res = rx.await.expect( + "Task system channel closed trying to force abortion of a not running task", + ); + + if matches!(res, Err(SystemError::TaskNotFound(_))) { + warn!( + %first_attempt_worker_id, + "Failed the first try to force abortion of a not running task, trying again", + ); + workers[task_work_table.worker_id()] + .force_task_abortion(task_id, ack) + .await; + } else { + ack.send(res).expect( + "System channel closed trying to force abortion of a not running task", + ); + } + } + } + .in_current_span(), + ); + trace!("Task system aborted task"); +} + /// The default implementation of the task system will create a system with a number of workers equal to the available /// parallelism in the user's machine. impl Default for System { @@ -288,104 +435,118 @@ unsafe impl Sync for System {} pub struct SystemComm(chan::Sender); impl SystemComm { - pub async fn idle_report(&self, worker_id: usize) { - self.0 - .send(SystemMessage::IdleReport(worker_id)) - .await - .expect("System channel closed trying to report idle"); + pub fn idle_report(&self, worker_id: usize) { + let system_tx = self.0.clone(); + spawn( + async move { + system_tx + .send(SystemMessage::IdleReport(worker_id)) + .await + .expect("System channel closed trying to report idle"); + } + .in_current_span(), + ); } - pub async fn working_report(&self, worker_id: usize) { - self.0 - .send(SystemMessage::WorkingReport(worker_id)) - .await - .expect("System channel closed trying to report working"); + pub fn working_report(&self, worker_id: usize) { + let system_tx = self.0.clone(); + spawn( + async move { + system_tx + .send(SystemMessage::WorkingReport(worker_id)) + .await + .expect("System channel closed trying to report working"); + } + .in_current_span(), + ); } - pub async fn pause_not_running_task( + pub fn pause_not_running_task( &self, task_id: TaskId, - worker_id: WorkerId, - ) -> Result<(), SystemError> { - let (tx, rx) = oneshot::channel(); - - self.0 - .send(SystemMessage::PauseNotRunningTask { - task_id, - worker_id, - ack: tx, - }) - .await - .expect("System channel closed trying to pause not running task"); - - rx.await - .expect("System channel closed trying receive pause not running task response") + task_work_table: Arc, + ack: oneshot::Sender>, + ) { + let system_tx = self.0.clone(); + spawn( + async move { + system_tx + .send(SystemMessage::PauseNotRunningTask { + task_id, + task_work_table, + ack, + }) + .await + .expect("System channel closed trying to pause not running task"); + } + .in_current_span(), + ); } - pub async fn cancel_not_running_task(&self, task_id: TaskId, worker_id: WorkerId) { - let (tx, rx) = oneshot::channel(); - - self.0 - .send(SystemMessage::CancelNotRunningTask { - task_id, - worker_id, - ack: tx, - }) - .await - .expect("System channel closed trying to cancel a not running task"); - - rx.await - .expect("System channel closed trying receive cancel a not running task response"); - } - - pub async fn request_help(&self, worker_id: WorkerId, task_count: usize) { - self.0 - .send(SystemMessage::NotifyIdleWorkers { - start_from: worker_id, - task_count, - }) - .await - .expect("System channel closed trying to request help"); - } - - pub async fn resume_task( + pub fn cancel_not_running_task( &self, task_id: TaskId, - worker_id: WorkerId, - ) -> Result<(), SystemError> { - let (tx, rx) = oneshot::channel(); - - self.0 - .send(SystemMessage::ResumeTask { - task_id, - worker_id, - ack: tx, - }) - .await - .expect("System channel closed trying to resume task"); - - rx.await - .expect("System channel closed trying receive resume task response") + task_work_table: Arc, + ack: oneshot::Sender>, + ) { + let system_tx = self.0.clone(); + spawn( + async move { + system_tx + .send(SystemMessage::CancelNotRunningTask { + task_id, + task_work_table, + ack, + }) + .await + .expect("System channel closed trying to cancel a not running task"); + } + .in_current_span(), + ); } - pub async fn force_abortion( + pub fn resume_task( &self, task_id: TaskId, - worker_id: WorkerId, - ) -> Result<(), SystemError> { - let (tx, rx) = oneshot::channel(); + task_work_table: Arc, + ack: oneshot::Sender>, + ) { + let system_tx = self.0.clone(); + spawn( + async move { + system_tx + .send(SystemMessage::ResumeTask { + task_id, + task_work_table, + ack, + }) + .await + .expect("System channel closed trying to resume task"); + } + .in_current_span(), + ); + } - self.0 - .send(SystemMessage::ForceAbortion { - task_id, - worker_id, - ack: tx, - }) - .await - .expect("System channel closed trying to resume task"); - - rx.await - .expect("System channel closed trying receive resume task response") + pub fn force_abortion( + &self, + task_id: TaskId, + task_work_table: Arc, + ack: oneshot::Sender>, + ) { + let system_tx = self.0.clone(); + spawn( + async move { + system_tx + .send(SystemMessage::ForceAbortion { + task_id, + task_work_table, + ack, + }) + .await + .expect("System channel closed trying to resume task"); + } + .in_current_span(), + ); } } @@ -398,11 +559,24 @@ pub struct BaseDispatcher { workers: Arc>>, idle_workers: Arc>, last_worker_id: Arc, + has_shutdown: Arc, } +/// A trait that represents a dispatcher that can be used to dispatch tasks to the system. +/// It can be used to dispatch tasks to the system from other threads or tasks. +/// +/// The `E: RunError` error parameter is the error type that the dispatcher can return. +/// Although the [`BaseDispatcher`] which is the default implementation of this trait, will always returns +/// a [`Result`] with the [`TaskHandle`] in the [`Ok`] variant, it can be used to implement a custom +/// fallible dispatcher that returns an [`Err`] variant with a custom error type. pub trait Dispatcher: fmt::Debug + Clone + Send + Sync + 'static { + type DispatchError: RunError; + /// Dispatches a task to the system, the task will be assigned to a worker and executed as soon as possible. - fn dispatch(&self, into_task: impl IntoTask) -> impl Future> + Send { + fn dispatch( + &self, + into_task: impl IntoTask, + ) -> impl Future, Self::DispatchError>> + Send { self.dispatch_boxed(into_task.into_task()) } @@ -411,15 +585,15 @@ pub trait Dispatcher: fmt::Debug + Clone + Send + Sync + 'static { fn dispatch_boxed( &self, boxed_task: Box>, - ) -> impl Future> + Send; + ) -> impl Future, Self::DispatchError>> + Send; /// Dispatches many tasks to the system, the tasks will be assigned to workers and executed as soon as possible. fn dispatch_many> + Send>( &self, into_tasks: I, - ) -> impl Future>> + Send + ) -> impl Future>, Self::DispatchError>> + Send where - ::IntoIter: Send, + I::IntoIter: Send, { self.dispatch_many_boxed(into_tasks.into_iter().map(IntoTask::into_task)) } @@ -429,7 +603,7 @@ pub trait Dispatcher: fmt::Debug + Clone + Send + Sync + 'static { fn dispatch_many_boxed( &self, boxed_tasks: impl IntoIterator>> + Send, - ) -> impl Future>> + Send; + ) -> impl Future>, Self::DispatchError>> + Send; } impl Clone for BaseDispatcher { @@ -438,17 +612,23 @@ impl Clone for BaseDispatcher { workers: Arc::clone(&self.workers), idle_workers: Arc::clone(&self.idle_workers), last_worker_id: Arc::clone(&self.last_worker_id), + has_shutdown: Arc::clone(&self.has_shutdown), } } } impl Dispatcher for BaseDispatcher { - async fn dispatch(&self, into_task: impl IntoTask) -> TaskHandle { - self.dispatch_boxed(into_task.into_task()).await - } + type DispatchError = DispatcherShutdownError; #[allow(clippy::missing_panics_doc)] - async fn dispatch_boxed(&self, task: Box>) -> TaskHandle { + async fn dispatch_boxed( + &self, + task: Box>, + ) -> Result, Self::DispatchError> { + if self.has_shutdown.load(Ordering::Acquire) { + return Err(DispatcherShutdownError(vec![task])); + } + let worker_id = self .last_worker_id .fetch_update(Ordering::Release, Ordering::Acquire, |last_worker_id| { @@ -456,35 +636,27 @@ impl Dispatcher for BaseDispatcher { }) .expect("we hardcoded the update function to always return Some(next_worker_id) through dispatcher"); - trace!( - "Dispatching task to worker: ", - task.id() - ); + trace!(%worker_id, task_id = %task.id(), "Dispatching task to worker"); + let handle = self.workers[worker_id].add_task(task).await; self.idle_workers[worker_id].store(false, Ordering::Relaxed); - handle + Ok(handle) } async fn dispatch_many_boxed( &self, into_tasks: impl IntoIterator>> + Send, - ) -> Vec> { - let mut workers_task_count = self - .workers - .iter() - .map(|worker| async move { (worker.id, worker.task_count().await) }) - .collect::>() - .join() - .await; - - workers_task_count.sort_by_key(|(_id, count)| *count); + ) -> Result>, Self::DispatchError> { + if self.has_shutdown.load(Ordering::Acquire) { + return Err(DispatcherShutdownError(into_tasks.into_iter().collect())); + } let (handles, workers_ids_set) = into_tasks .into_iter() - .zip(workers_task_count.into_iter().cycle()) - .map(|(task, (worker_id, _))| async move { + .zip((0..self.workers.len()).cycle()) + .map(|(task, worker_id)| async move { (self.workers[worker_id].add_task(task).await, worker_id) }) .collect::>() @@ -497,7 +669,7 @@ impl Dispatcher for BaseDispatcher { self.idle_workers[worker_id].store(false, Ordering::Relaxed); } - handles + Ok(handles) } } diff --git a/crates/task-system/src/task.rs b/crates/task-system/src/task.rs index bf7c18b49..7c5125983 100644 --- a/crates/task-system/src/task.rs +++ b/crates/task-system/src/task.rs @@ -1,21 +1,21 @@ use std::{ fmt, future::{Future, IntoFuture}, - pin::Pin, + pin::{pin, Pin}, sync::{ - atomic::{AtomicBool, AtomicU8, Ordering}, + atomic::{AtomicBool, Ordering}, Arc, }, task::{Context, Poll}, + time::Duration, }; use async_channel as chan; use async_trait::async_trait; -use chan::{Recv, RecvError}; use downcast_rs::{impl_downcast, Downcast}; -use futures::executor::block_on; -use tokio::sync::oneshot; -use tracing::{trace, warn}; +use futures::StreamExt; +use tokio::{spawn, sync::oneshot}; +use tracing::{error, instrument, trace, warn, Instrument}; use uuid::Uuid; use super::{ @@ -32,12 +32,18 @@ pub type TaskId = Uuid; /// The user will downcast it to the concrete type that the task returns. Most of the time, /// tasks will not return anything, so it isn't a costly abstraction, as only a heap allocation /// is needed when the user wants to return a [`Box`]. -pub trait AnyTaskOutput: Send + fmt::Debug + Downcast + 'static {} +pub trait AnyTaskOutput: Send + Downcast + 'static {} + +impl fmt::Debug for Box { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "") + } +} impl_downcast!(AnyTaskOutput); -/// Blanket implementation for all types that implements `std::fmt::Debug + Send + 'static` -impl AnyTaskOutput for T {} +/// Blanket implementation for all types that implements `Send + 'static` +impl AnyTaskOutput for T {} /// A helper trait to convert any type that implements [`AnyTaskOutput`] into a [`TaskOutput`], boxing it. pub trait IntoAnyTaskOutput { @@ -58,6 +64,12 @@ pub enum TaskOutput { Empty, } +impl From<()> for TaskOutput { + fn from((): ()) -> Self { + Self::Empty + } +} + /// An enum representing all possible outcomes for a task. #[derive(Debug)] pub enum TaskStatus { @@ -124,15 +136,9 @@ impl + 'static, E: RunError> IntoTask for T { /// We're currently using the [`async_trait`](https://docs.rs/async-trait) crate to allow dyn async traits, /// due to a limitation in the Rust language. #[async_trait] -pub trait Task: fmt::Debug + Downcast + Send + Sync + 'static { - /// This method represent the work that should be done by the worker, it will be called by the - /// worker when there is a slot available in its internal queue. - /// We receive a `&mut self` so any internal data can be mutated on each `run` invocation. - /// - /// The [`interrupter`](Interrupter) is a helper object that can be used to check if the user requested a pause or a cancel, - /// so the user can decide the appropriated moment to pause or cancel the task. Avoiding corrupted data or - /// inconsistent states. - async fn run(&mut self, interrupter: &Interrupter) -> Result; +pub trait Task: Downcast + Send + Sync + 'static { + /// An unique identifier for the task, it will be used to identify the task on the system and also to the user. + fn id(&self) -> TaskId; /// This method defines whether a task should run with priority or not. The task system has a mechanism /// to suspend non-priority tasks on any worker and run priority tasks ASAP. This is useful for tasks that @@ -142,12 +148,31 @@ pub trait Task: fmt::Debug + Downcast + Send + Sync + 'static { false } - /// An unique identifier for the task, it will be used to identify the task on the system and also to the user. - fn id(&self) -> TaskId; + /// Here we define if we want the task system to shutdown our task if it takes too long to finish. By default the + /// task system will wait indefinitely for the task to finish, but if the user wants to have a timeout, they can + /// return a [`Duration`] here and the task system will cancel the task if it takes longer than the specified time. + fn with_timeout(&self) -> Option { + None + } + + /// This method represent the work that should be done by the worker, it will be called by the + /// worker when there is a slot available in its internal queue. + /// We receive a `&mut self` so any internal data can be mutated on each `run` invocation. + /// + /// The [`interrupter`](Interrupter) is a helper object that can be used to check if the user requested a pause or a cancel, + /// so the user can decide the appropriated moment to pause or cancel the task. Avoiding corrupted data or + /// inconsistent states. + async fn run(&mut self, interrupter: &Interrupter) -> Result; } impl_downcast!(Task where E: RunError); +impl fmt::Debug for Box> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "") + } +} + pub trait SerializableTask: Task where Self: Sized, @@ -168,8 +193,7 @@ where #[pin_project::pin_project] pub struct InterrupterFuture<'recv> { #[pin] - fut: Recv<'recv, InterruptionRequest>, - has_interrupted: &'recv AtomicU8, + fut: chan::Recv<'recv, InterruptionRequest>, } impl Future for InterrupterFuture<'_> { @@ -180,13 +204,19 @@ impl Future for InterrupterFuture<'_> { match this.fut.poll(cx) { Poll::Ready(Ok(InterruptionRequest { kind, ack })) => { + trace!(?kind, "Running task received interruption request"); if ack.send(()).is_err() { warn!("TaskInterrupter ack channel closed"); } - this.has_interrupted.store(kind as u8, Ordering::Relaxed); + if let InternalInterruptionKind::Suspend(has_suspended) = &kind { + has_suspended.store(true, Ordering::SeqCst); + } + + let kind = kind.into(); + Poll::Ready(kind) } - Poll::Ready(Err(RecvError)) => { + Poll::Ready(Err(chan::RecvError)) => { // In case the task handle was dropped, we can't receive any more interrupt messages // so we will never interrupt and the task will run freely until ended warn!("Task interrupter channel closed, will run task until it finishes!"); @@ -207,7 +237,6 @@ impl<'recv> IntoFuture for &'recv Interrupter { fn into_future(self) -> Self::IntoFuture { InterrupterFuture { fut: self.interrupt_rx.recv(), - has_interrupted: &self.has_interrupted, } } } @@ -217,47 +246,68 @@ impl<'recv> IntoFuture for &'recv Interrupter { #[derive(Debug)] pub struct Interrupter { interrupt_rx: chan::Receiver, - has_interrupted: AtomicU8, +} + +impl Drop for Interrupter { + fn drop(&mut self) { + if !self.interrupt_rx.is_closed() { + self.close(); + } + } } impl Interrupter { pub(crate) fn new(interrupt_tx: chan::Receiver) -> Self { Self { interrupt_rx: interrupt_tx, - has_interrupted: AtomicU8::new(0), } } /// Check if the user requested a pause or a cancel, returning the kind of interruption that was requested /// in a non-blocking manner. pub fn try_check_interrupt(&self) -> Option { - InterruptionKind::load(&self.has_interrupted).map_or_else( - || { - if let Ok(InterruptionRequest { kind, ack }) = self.interrupt_rx.try_recv() { - if ack.send(()).is_err() { - warn!("TaskInterrupter ack channel closed"); - } + if let Ok(InterruptionRequest { kind, ack }) = self.interrupt_rx.try_recv() { + trace!(?kind, "Interrupter received interruption request"); - self.has_interrupted.store(kind as u8, Ordering::Relaxed); + if let InternalInterruptionKind::Suspend(has_suspended) = &kind { + has_suspended.store(true, Ordering::SeqCst); + } - Some(kind) - } else { - None - } - }, - Some, - ) + let kind = kind.into(); + + if ack.send(()).is_err() { + warn!("TaskInterrupter ack channel closed"); + } + + Some(kind) + } else { + None + } } - pub(super) fn reset(&self) { - self.has_interrupted - .compare_exchange( - InterruptionKind::Pause as u8, - 0, - Ordering::Release, - Ordering::Relaxed, - ) - .expect("we must only reset paused tasks"); + pub(super) fn close(&self) { + self.interrupt_rx.close(); + if !self.interrupt_rx.is_empty() { + trace!("Pending interruption requests were not handled"); + spawn({ + let interrupt_rx = self.interrupt_rx.clone(); + + async move { + let mut interrupt_stream = pin!(interrupt_rx); + + while let Some(InterruptionRequest { kind, ack }) = + interrupt_stream.next().await + { + trace!( + ?kind, + "Interrupter received interruption request after task was completed" + ); + ack.send(()).expect("Interrupter ack channel closed"); + } + } + .in_current_span() + }); + } } } @@ -267,8 +317,14 @@ macro_rules! check_interruption { let interrupter: &Interrupter = $interrupter; match interrupter.try_check_interrupt() { - Some($crate::InterruptionKind::Cancel) => return Ok($crate::ExecStatus::Canceled), - Some($crate::InterruptionKind::Pause) => return Ok($crate::ExecStatus::Paused), + Some($crate::InterruptionKind::Cancel) => { + ::tracing::trace!("Task was canceled by the user"); + return Ok($crate::ExecStatus::Canceled); + } + Some($crate::InterruptionKind::Pause) => { + ::tracing::trace!("Task was paused by the user or suspended by the task system"); + return Ok($crate::ExecStatus::Paused); + } None => { /* Everything is Awesome! */ } } }; @@ -281,11 +337,13 @@ macro_rules! check_interruption { match interrupter.try_check_interrupt() { Some($crate::InterruptionKind::Cancel) => { *duration_accumulator += instant.elapsed(); + ::tracing::trace!("Task was canceled by the user"); return Ok($crate::ExecStatus::Canceled); } Some($crate::InterruptionKind::Pause) => { *duration_accumulator += instant.elapsed(); + ::tracing::trace!("Task was paused by the user or suspended by the task system"); return Ok($crate::ExecStatus::Paused); } @@ -296,25 +354,30 @@ macro_rules! check_interruption { /// The kind of interruption that can be requested by the user, a pause or a cancel #[derive(Debug, Clone, Copy)] -#[repr(u8)] pub enum InterruptionKind { - Pause = 1, - Cancel = 2, + Pause, + Cancel, } -impl InterruptionKind { - fn load(kind: &AtomicU8) -> Option { - match kind.load(Ordering::Relaxed) { - 1 => Some(Self::Pause), - 2 => Some(Self::Cancel), - _ => None, +#[derive(Debug, Clone)] +enum InternalInterruptionKind { + Pause, + Suspend(Arc), + Cancel, +} + +impl From for InterruptionKind { + fn from(kind: InternalInterruptionKind) -> Self { + match kind { + InternalInterruptionKind::Pause | InternalInterruptionKind::Suspend(_) => Self::Pause, + InternalInterruptionKind::Cancel => Self::Cancel, } } } #[derive(Debug)] pub struct InterruptionRequest { - kind: InterruptionKind, + kind: InternalInterruptionKind, ack: oneshot::Sender<()>, } @@ -338,32 +401,43 @@ impl TaskRemoteController { /// # Panics /// /// Will panic if the worker failed to ack the pause request + #[instrument(skip(self), fields(task_id = %self.task_id), err)] pub async fn pause(&self) -> Result<(), SystemError> { - let is_paused = self.worktable.is_paused.load(Ordering::Relaxed); - let is_canceled = self.worktable.is_canceled.load(Ordering::Relaxed); - let is_done = self.worktable.is_done.load(Ordering::Relaxed); + if self.worktable.is_finalized() { + trace!("Task is finalized, will not pause"); + return Ok(()); + } - trace!("Received pause command task: "); + let is_paused = self.worktable.is_paused.load(Ordering::Acquire); + let is_canceled = self.worktable.has_canceled.load(Ordering::Acquire); + let is_done = self.worktable.is_done.load(Ordering::Acquire); + + trace!(%is_canceled, %is_done, "Received pause command task"); if !is_paused && !is_canceled && !is_done { - if self.worktable.is_running.load(Ordering::Relaxed) { + if self.worktable.is_running.load(Ordering::Acquire) { let (tx, rx) = oneshot::channel(); trace!("Task is running, sending pause request"); - self.worktable.pause(tx).await; + self.worktable.pause(tx); rx.await.expect("Worker failed to ack pause request"); } else { - trace!("Task is not running, setting is_paused flag"); - self.worktable.is_paused.store(true, Ordering::Relaxed); - return self - .system_comm - .pause_not_running_task( - self.task_id, - self.worktable.current_worker_id.load(Ordering::Relaxed), - ) - .await; + trace!("Task is not running, setting is_paused flag and communicating with system"); + self.worktable.is_paused.store(true, Ordering::Release); + + let (tx, rx) = oneshot::channel(); + + self.system_comm.pause_not_running_task( + self.task_id, + Arc::clone(&self.worktable), + tx, + ); + + return rx + .await + .expect("Worker failed to ack pause not running task request"); } } @@ -375,60 +449,103 @@ impl TaskRemoteController { /// # Panics /// /// Will panic if the worker failed to ack the cancel request - pub async fn cancel(&self) { - let is_canceled = self.worktable.is_canceled.load(Ordering::Relaxed); - let is_done = self.worktable.is_done.load(Ordering::Relaxed); + #[instrument(skip(self), fields(task_id = %self.task_id))] + pub async fn cancel(&self) -> Result<(), SystemError> { + if self.worktable.is_finalized() { + trace!("Task is finalized, will not cancel"); + return Ok(()); + } - trace!("Received cancel command task: "); + let is_canceled = self.worktable.has_canceled(); + let is_done = self.worktable.is_done(); + + trace!(%is_canceled, %is_done, "Received cancel command task"); if !is_canceled && !is_done { - if self.worktable.is_running.load(Ordering::Relaxed) { + if self.worktable.is_running() { let (tx, rx) = oneshot::channel(); trace!("Task is running, sending cancel request"); - self.worktable.cancel(tx).await; + self.worktable.cancel(tx); rx.await.expect("Worker failed to ack cancel request"); } else { - trace!("Task is not running, setting is_canceled flag"); - self.worktable.is_canceled.store(true, Ordering::Relaxed); - self.system_comm - .cancel_not_running_task( - self.task_id, - self.worktable.current_worker_id.load(Ordering::Relaxed), - ) - .await; + trace!( + "Task is not running, setting is_canceled flag and communicating with system" + ); + self.worktable.has_canceled.store(true, Ordering::Release); + + let (tx, rx) = oneshot::channel(); + + self.system_comm.cancel_not_running_task( + self.task_id, + Arc::clone(&self.worktable), + tx, + ); + + return rx + .await + .expect("Worker failed to ack cancel not running task request"); } } + + Ok(()) } /// Forcefully abort the task, this can lead to corrupted data or inconsistent states, so use it with caution. + /// + /// # Panics + /// + /// Will panic if the worker failed to ack the forced abortion request + #[instrument(skip(self), fields(task_id = %self.task_id), err)] pub async fn force_abortion(&self) -> Result<(), SystemError> { + if self.worktable.is_finalized() { + trace!("Task is finalized, will not force abortion"); + return Ok(()); + } + trace!("Received force abortion command task"); self.worktable.set_aborted(); + + let (tx, rx) = oneshot::channel(); + self.system_comm - .force_abortion( - self.task_id, - self.worktable.current_worker_id.load(Ordering::Relaxed), - ) - .await + .force_abortion(self.task_id, Arc::clone(&self.worktable), tx); + + rx.await + .expect("Worker failed to ack force abortion request") } /// Marks the task to be resumed by the task system, the worker will start processing it if there is a slot /// available or will be enqueued otherwise. + /// + /// # Panics + /// + /// Will panic if the worker failed to ack the resume request + #[instrument(skip(self), fields(task_id = %self.task_id), err)] pub async fn resume(&self) -> Result<(), SystemError> { + if self.worktable.is_finalized() { + trace!("Task is finalized, will not resume"); + return Ok(()); + } + trace!("Received resume command task"); + + let (tx, rx) = oneshot::channel(); + self.system_comm - .resume_task( - self.task_id, - self.worktable.current_worker_id.load(Ordering::Relaxed), - ) - .await + .resume_task(self.task_id, Arc::clone(&self.worktable), tx); + + rx.await.expect("Worker failed to ack resume request") } /// Verify if the task was already completed #[must_use] pub fn is_done(&self) -> bool { - self.worktable.is_done.load(Ordering::Relaxed) + self.worktable.is_done() + | self.worktable.has_shutdown() + | self.worktable.has_aborted() + | self.worktable.has_canceled() + | self.worktable.has_failed() } } @@ -458,21 +575,13 @@ impl TaskHandle { } /// Gracefully pause the task at a safe point defined by the user using the [`Interrupter`] - /// - /// # Panics - /// - /// Will panic if the worker failed to ack the pause request pub async fn pause(&self) -> Result<(), SystemError> { self.controller.pause().await } /// Gracefully cancel the task at a safe point defined by the user using the [`Interrupter`] - /// - /// # Panics - /// - /// Will panic if the worker failed to ack the cancel request - pub async fn cancel(&self) { - self.controller.cancel().await; + pub async fn cancel(&self) -> Result<(), SystemError> { + self.controller.cancel().await } /// Forcefully abort the task, this can lead to corrupted data or inconsistent states, so use it with caution. @@ -495,20 +604,41 @@ impl TaskHandle { } /// A helper struct when you just want to cancel a task if its `TaskHandle` gets dropped. -pub struct CancelTaskOnDrop(pub TaskHandle); +pub struct CancelTaskOnDrop(Option>); + +impl CancelTaskOnDrop { + /// Create a new `CancelTaskOnDrop` object with the given `TaskHandle`. + #[must_use] + pub const fn new(handle: TaskHandle) -> Self { + Self(Some(handle)) + } +} impl Future for CancelTaskOnDrop { type Output = Result, SystemError>; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - Pin::new(&mut self.0).poll(cx) + if let Some(handle) = self.0.as_mut() { + match Pin::new(handle).poll(cx) { + Poll::Ready(res) => { + self.0 = None; + Poll::Ready(res) + } + Poll::Pending => Poll::Pending, + } + } else { + error!("tried to poll an already completed CancelTaskOnDrop future"); + Poll::Pending + } } } impl Drop for CancelTaskOnDrop { fn drop(&mut self) { // FIXME: We should use async drop when it becomes stable - block_on(self.0.cancel()); + if let Some(handle) = self.0.take() { + spawn(async move { handle.cancel().await }.in_current_span()); + } } } @@ -518,9 +648,12 @@ pub struct TaskWorktable { is_running: AtomicBool, is_done: AtomicBool, is_paused: AtomicBool, - is_canceled: AtomicBool, - is_aborted: AtomicBool, + has_canceled: AtomicBool, + has_aborted: AtomicBool, + has_shutdown: AtomicBool, + has_failed: AtomicBool, interrupt_tx: chan::Sender, + finalized: AtomicBool, current_worker_id: AtomicWorkerId, } @@ -531,13 +664,27 @@ impl TaskWorktable { is_running: AtomicBool::new(false), is_done: AtomicBool::new(false), is_paused: AtomicBool::new(false), - is_canceled: AtomicBool::new(false), - is_aborted: AtomicBool::new(false), + has_canceled: AtomicBool::new(false), + has_aborted: AtomicBool::new(false), + has_shutdown: AtomicBool::new(false), + has_failed: AtomicBool::new(false), + finalized: AtomicBool::new(false), interrupt_tx, current_worker_id: AtomicWorkerId::new(worker_id), } } + #[inline] + pub fn worker_id(&self) -> WorkerId { + self.current_worker_id.load(Ordering::Acquire) + } + + #[inline] + pub fn change_worker(&self, new_worker_id: WorkerId) { + self.current_worker_id + .store(new_worker_id, Ordering::Release); + } + pub fn set_started(&self) { self.started.store(true, Ordering::Relaxed); self.is_running.store(true, Ordering::Relaxed); @@ -548,67 +695,241 @@ impl TaskWorktable { self.is_running.store(false, Ordering::Relaxed); } + pub fn set_canceled(&self) { + self.has_canceled.store(true, Ordering::Relaxed); + self.is_running.store(false, Ordering::Relaxed); + } + pub fn set_unpause(&self) { self.is_paused.store(false, Ordering::Relaxed); } pub fn set_aborted(&self) { - self.is_aborted.store(true, Ordering::Relaxed); + self.has_aborted.store(true, Ordering::Relaxed); + self.is_running.store(false, Ordering::Relaxed); } - pub async fn pause(&self, tx: oneshot::Sender<()>) { - self.is_paused.store(true, Ordering::Relaxed); + pub fn set_failed(&self) { + self.has_failed.store(true, Ordering::Relaxed); self.is_running.store(false, Ordering::Relaxed); - - trace!("Sending pause signal to Interrupter object on task"); - - self.interrupt_tx - .send(InterruptionRequest { - kind: InterruptionKind::Pause, - ack: tx, - }) - .await - .expect("Worker channel closed trying to pause task"); } - pub async fn cancel(&self, tx: oneshot::Sender<()>) { - self.is_canceled.store(true, Ordering::Relaxed); + pub fn set_shutdown(&self) { + self.has_shutdown.store(true, Ordering::Relaxed); self.is_running.store(false, Ordering::Relaxed); + } - self.interrupt_tx - .send(InterruptionRequest { - kind: InterruptionKind::Cancel, - ack: tx, - }) - .await - .expect("Worker channel closed trying to pause task"); + pub fn set_finalized(&self) { + self.finalized.store(true, Ordering::Release); + } + + pub fn pause(self: &Arc, outer_tx: oneshot::Sender<()>) { + spawn({ + let this = Arc::clone(self); + + trace!("Sending pause signal to Interrupter object on task"); + + async move { + let (tx, rx) = oneshot::channel(); + + if this + .interrupt_tx + .send(InterruptionRequest { + kind: InternalInterruptionKind::Pause, + ack: tx, + }) + .await + .is_ok() + { + rx.await.expect("Task failed to ack pause request"); + + this.is_paused.store(true, Ordering::Release); + this.is_running.store(false, Ordering::Release); + } + + trace!("Sent pause signal to Interrupter object on task"); + + outer_tx + .send(()) + .expect("Worker channel closed trying to pause task"); + } + .in_current_span() + }); + } + + pub fn suspend( + self: &Arc, + outer_tx: oneshot::Sender<()>, + has_suspended: Arc, + ) { + trace!("Sending suspend signal to Interrupter object on task"); + spawn({ + let this = Arc::clone(self); + + async move { + let (tx, rx) = oneshot::channel(); + + if this + .interrupt_tx + .send(InterruptionRequest { + kind: InternalInterruptionKind::Suspend(has_suspended), + ack: tx, + }) + .await + .is_ok() + { + rx.await.expect("Task failed to ack suspend request"); + + this.is_paused.store(true, Ordering::Release); + this.is_running.store(false, Ordering::Release); + } + + if outer_tx.send(()).is_err() { + trace!("Task suspend channel closed trying to suspend task, maybe task manage to be completed"); + } + } + .in_current_span() + }); + } + + pub fn cancel(self: &Arc, outer_tx: oneshot::Sender<()>) { + trace!("Sending cancel signal to Interrupter object on task"); + spawn({ + let this = Arc::clone(self); + async move { + let (tx, rx) = oneshot::channel(); + + if this + .interrupt_tx + .send(InterruptionRequest { + kind: InternalInterruptionKind::Cancel, + ack: tx, + }) + .await + .is_ok() + { + rx.await.expect("Task failed to ack cancel request"); + + this.has_canceled.store(true, Ordering::Release); + this.is_running.store(false, Ordering::Release); + } + + outer_tx + .send(()) + .expect("Worker channel closed trying to cancel task"); + } + .in_current_span() + }); + } + + pub fn is_done(&self) -> bool { + self.is_done.load(Ordering::Acquire) + } + + pub fn is_running(&self) -> bool { + self.is_running.load(Ordering::Acquire) } pub fn is_paused(&self) -> bool { - self.is_paused.load(Ordering::Relaxed) + self.is_paused.load(Ordering::Acquire) } - pub fn is_canceled(&self) -> bool { - self.is_canceled.load(Ordering::Relaxed) + pub fn has_canceled(&self) -> bool { + self.has_canceled.load(Ordering::Acquire) } - pub fn is_aborted(&self) -> bool { - self.is_aborted.load(Ordering::Relaxed) + pub fn has_failed(&self) -> bool { + self.has_failed.load(Ordering::Acquire) + } + + pub fn has_aborted(&self) -> bool { + self.has_aborted.load(Ordering::Acquire) + } + + pub fn has_shutdown(&self) -> bool { + self.has_shutdown.load(Ordering::Acquire) + } + + pub fn is_finalized(&self) -> bool { + self.finalized.load(Ordering::Acquire) + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum PendingTaskKind { + Normal, + Priority, + Suspended, +} + +impl PendingTaskKind { + const fn with_priority(has_priority: bool) -> Self { + if has_priority { + Self::Priority + } else { + Self::Normal + } } } -#[derive(Debug)] pub struct TaskWorkState { pub(crate) task: Box>, pub(crate) worktable: Arc, - pub(crate) done_tx: oneshot::Sender, SystemError>>, + pub(crate) done_tx: PanicOnSenderDrop, pub(crate) interrupter: Arc, } impl TaskWorkState { - pub fn change_worker(&self, new_worker_id: WorkerId) { - self.worktable - .current_worker_id - .store(new_worker_id, Ordering::Relaxed); + #[inline] + pub fn id(&self) -> TaskId { + self.task.id() + } + + #[inline] + pub fn kind(&self) -> PendingTaskKind { + PendingTaskKind::with_priority(self.task.with_priority()) + } +} + +#[derive(Debug)] +pub struct PanicOnSenderDrop { + task_id: TaskId, + maybe_done_tx: Option, SystemError>>>, +} + +impl PanicOnSenderDrop { + pub fn new( + task_id: TaskId, + done_tx: oneshot::Sender, SystemError>>, + ) -> Self { + Self { + task_id, + maybe_done_tx: Some(done_tx), + } + } + + pub fn send( + mut self, + res: Result, SystemError>, + ) -> Result<(), Result, SystemError>> { + self.maybe_done_tx + .take() + .expect("tried to send a task output twice to the same task handle") + .send(res) + } +} + +impl Drop for PanicOnSenderDrop { + #[track_caller] + fn drop(&mut self) { + trace!(task_id = %self.task_id, "Dropping TaskWorkState"); + assert!( + self.maybe_done_tx.is_none(), + "TaskHandle done channel dropped before sending a result: {}", + std::panic::Location::caller() + ); + trace!(task_id = %self.task_id, + "TaskWorkState successfully dropped" + ); } } diff --git a/crates/task-system/src/worker/mod.rs b/crates/task-system/src/worker/mod.rs index cdeae4ddc..070bbdc81 100644 --- a/crates/task-system/src/worker/mod.rs +++ b/crates/task-system/src/worker/mod.rs @@ -6,16 +6,15 @@ use std::{ use async_channel as chan; use tokio::{spawn, sync::oneshot, task::JoinHandle}; -use tracing::{error, info, trace, warn}; - -use crate::task::TaskRemoteController; +use tracing::{error, info, instrument, trace, warn, Instrument}; use super::{ error::{RunError, SystemError}, - message::WorkerMessage, + message::{StoleTaskMessage, TaskRunnerOutput, WorkerMessage}, system::SystemComm, task::{ - InternalTaskExecStatus, Interrupter, Task, TaskHandle, TaskId, TaskWorkState, TaskWorktable, + Interrupter, PanicOnSenderDrop, Task, TaskHandle, TaskId, TaskRemoteController, + TaskWorkState, TaskWorktable, }, }; @@ -54,6 +53,7 @@ impl WorkerBuilder { ) } + #[instrument(name = "task_system_worker", skip(self, system_comm, task_stealer), fields(worker_id = self.id))] pub fn build(self, system_comm: SystemComm, task_stealer: WorkStealer) -> Worker { let Self { id, @@ -65,7 +65,7 @@ impl WorkerBuilder { let system_comm = system_comm.clone(); async move { - trace!("Worker message processing task starting..."); + trace!("Worker message processing task starting..."); while let Err(e) = spawn(run( id, system_comm.clone(), @@ -75,20 +75,16 @@ impl WorkerBuilder { .await { if e.is_panic() { - error!( - "Worker critically failed and will restart: \ - {e:#?}" - ); + error!(?e, "Worker critically failed and will restart;"); } else { - trace!( - "Worker received shutdown signal and will exit..." - ); + trace!("Worker received shutdown signal and will exit..."); break; } } - info!("Worker gracefully shutdown"); + info!("Worker gracefully shutdown"); } + .in_current_span() }); Worker { @@ -123,7 +119,7 @@ impl Worker { task: new_task, worktable: Arc::clone(&worktable), interrupter: Arc::new(Interrupter::new(interrupt_rx)), - done_tx, + done_tx: PanicOnSenderDrop::new(task_id, done_tx), })) .await .expect("Worker channel closed trying to add task"); @@ -138,18 +134,6 @@ impl Worker { } } - pub async fn task_count(&self) -> usize { - let (tx, rx) = oneshot::channel(); - - self.msgs_tx - .send(WorkerMessage::TaskCountRequest(tx)) - .await - .expect("Worker channel closed trying to get task count"); - - rx.await - .expect("Worker channel closed trying to receive task count response") - } - pub async fn resume_task( &self, task_id: TaskId, @@ -172,7 +156,11 @@ impl Worker { .expect("Worker channel closed trying to pause a not running task"); } - pub async fn cancel_not_running_task(&self, task_id: TaskId, ack: oneshot::Sender<()>) { + pub async fn cancel_not_running_task( + &self, + task_id: TaskId, + ack: oneshot::Sender>, + ) { self.msgs_tx .send(WorkerMessage::CancelNotRunningTask { task_id, ack }) .await @@ -190,6 +178,7 @@ impl Worker { .expect("Worker channel closed trying to force task abortion"); } + #[instrument(skip(self), fields(worker_id = self.id))] pub async fn shutdown(&self) { if let Some(handle) = self .handle @@ -215,13 +204,6 @@ impl Worker { warn!("Trying to shutdown a worker that was already shutdown"); } } - - pub async fn wake(&self) { - self.msgs_tx - .send(WorkerMessage::WakeUp) - .await - .expect("Worker channel closed trying to wake up"); - } } /// SAFETY: Due to usage of refcell we lost `Sync` impl, but we only use it to have a shutdown method @@ -235,26 +217,24 @@ pub struct WorkerComm { } impl WorkerComm { - pub async fn steal_task(&self, worker_id: WorkerId) -> Option> { + pub async fn steal_task( + &self, + stealer_id: WorkerId, + stolen_task_tx: chan::Sender>>, + ) -> bool { let (tx, rx) = oneshot::channel(); self.msgs_tx - .send(WorkerMessage::StealRequest(tx)) + .send(WorkerMessage::StealRequest { + stealer_id, + ack: tx, + stolen_task_tx, + }) .await .expect("Worker channel closed trying to steal task"); rx.await .expect("Worker channel closed trying to steal task") - .map(|task_work_state| { - trace!( - "Worker stole task: \ - ", - self.worker_id, - task_work_state.task.id() - ); - task_work_state.change_worker(worker_id); - task_work_state - }) } } @@ -277,7 +257,12 @@ impl WorkStealer { } } - pub async fn steal(&self, worker_id: WorkerId) -> Option> { + #[instrument(skip(self, stolen_task_tx))] + pub async fn steal( + &self, + stealer_id: WorkerId, + stolen_task_tx: &chan::Sender>>, + ) { let total_workers = self.worker_comms.len(); for worker_comm in self @@ -286,41 +271,24 @@ impl WorkStealer { // Cycling over the workers .cycle() // Starting from the next worker id - .skip(worker_id) + .skip(stealer_id) // Taking the total amount of workers .take(total_workers) // Removing the current worker as we can't steal from ourselves - .filter(|worker_comm| worker_comm.worker_id != worker_id) + .filter(|worker_comm| worker_comm.worker_id != stealer_id) { - trace!( - "Trying to steal from worker ", - worker_comm.worker_id - ); - - if let Some(task) = worker_comm.steal_task(worker_id).await { - return Some(task); + if worker_comm + .steal_task(stealer_id, stolen_task_tx.clone()) + .await + { + trace!(stolen_worker_id = worker_comm.worker_id, "Stole a task"); + return; } - - trace!( - "Worker has no tasks to steal", - worker_comm.worker_id - ); } - None - } - - pub fn workers_count(&self) -> usize { - self.worker_comms.len() + stolen_task_tx + .send(None) + .await + .expect("Stolen task channel closed"); } } - -struct TaskRunnerOutput { - task_work_state: TaskWorkState, - status: InternalTaskExecStatus, -} - -enum RunnerMessage { - TaskOutput(TaskId, Result, ()>), - StoleTask(Option>), -} diff --git a/crates/task-system/src/worker/run.rs b/crates/task-system/src/worker/run.rs index 70de8c65c..9b2ed3c46 100644 --- a/crates/task-system/src/worker/run.rs +++ b/crates/task-system/src/worker/run.rs @@ -5,34 +5,42 @@ use futures::StreamExt; use futures_concurrency::stream::Merge; use tokio::time::{interval_at, Instant}; use tokio_stream::wrappers::IntervalStream; -use tracing::{error, warn}; +use tracing::{debug, error, instrument, trace, warn}; use super::{ - super::{error::RunError, message::WorkerMessage, system::SystemComm}, + super::{ + error::RunError, + message::{StoleTaskMessage, TaskOutputMessage, WorkerMessage}, + system::SystemComm, + }, runner::Runner, - RunnerMessage, WorkStealer, WorkerId, ONE_SECOND, + WorkStealer, WorkerId, ONE_SECOND, }; +enum StreamMessage { + Commands(WorkerMessage), + Steal(Option>), + TaskOutput(TaskOutputMessage), + IdleCheck, +} + +#[instrument(skip(system_comm, work_stealer, msgs_rx))] pub(super) async fn run( - id: WorkerId, + worker_id: WorkerId, system_comm: SystemComm, work_stealer: WorkStealer, msgs_rx: chan::Receiver>, ) { - enum StreamMessage { - Commands(WorkerMessage), - RunnerMsg(RunnerMessage), - IdleCheck, - } - - let (mut runner, runner_rx) = Runner::new(id, work_stealer, system_comm); + let (mut runner, stole_task_rx, task_output_rx) = + Runner::new(worker_id, work_stealer, system_comm); let mut idle_checker_interval = interval_at(Instant::now(), ONE_SECOND); idle_checker_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); let mut msg_stream = pin!(( msgs_rx.map(StreamMessage::Commands), - runner_rx.map(StreamMessage::RunnerMsg), + stole_task_rx.map(StreamMessage::Steal), + task_output_rx.map(StreamMessage::TaskOutput), IntervalStream::new(idle_checker_interval).map(|_| StreamMessage::IdleCheck), ) .merge()); @@ -41,20 +49,19 @@ pub(super) async fn run( match msg { // Worker messages StreamMessage::Commands(WorkerMessage::NewTask(task_work_state)) => { + let task_id = task_work_state.id(); runner.abort_steal_task(); - runner.new_task(task_work_state).await; - } - - StreamMessage::Commands(WorkerMessage::TaskCountRequest(tx)) => { - if tx.send(runner.total_tasks()).is_err() { - warn!("Task count request channel closed before sending task count"); - } + trace!(%task_id, "New task received"); + runner.new_task(task_id, task_work_state.kind(), task_work_state); + trace!(%task_id, "New task added"); } StreamMessage::Commands(WorkerMessage::ResumeTask { task_id, ack }) => { - if ack.send(runner.resume_task(task_id).await).is_err() { + trace!(%task_id, "Resume task request received"); + if ack.send(runner.resume_task(task_id)).is_err() { warn!("Resume task channel closed before sending ack"); } + trace!(%task_id, "Resumed task"); } StreamMessage::Commands(WorkerMessage::PauseNotRunningTask { task_id, ack }) => { @@ -64,41 +71,53 @@ pub(super) async fn run( } StreamMessage::Commands(WorkerMessage::CancelNotRunningTask { task_id, ack }) => { - runner.cancel_not_running_task(task_id); - if ack.send(()).is_err() { + if ack.send(runner.cancel_not_running_task(&task_id)).is_err() { warn!("Resume task channel closed before sending ack"); } } StreamMessage::Commands(WorkerMessage::ForceAbortion { task_id, ack }) => { - if ack.send(runner.force_task_abortion(task_id).await).is_err() { + trace!(%task_id, "Force abortion task request received"); + if ack + .send(runner.force_task_abortion(&task_id).await) + .is_err() + { warn!("Force abortion channel closed before sending ack"); } + trace!(%task_id, "Force aborted task response sent"); } StreamMessage::Commands(WorkerMessage::ShutdownRequest(tx)) => { return runner.shutdown(tx).await; } - StreamMessage::Commands(WorkerMessage::StealRequest(tx)) => runner.steal_request(tx), - - StreamMessage::Commands(WorkerMessage::WakeUp) => runner.wake_up(), + StreamMessage::Commands(WorkerMessage::StealRequest { + stealer_id, + ack, + stolen_task_tx, + }) => { + if ack + .send(runner.steal_request(stealer_id, stolen_task_tx).await) + .is_err() + { + debug!("Steal request attempt aborted before sending ack"); + } + } // Runner messages - StreamMessage::RunnerMsg(RunnerMessage::TaskOutput(task_id, Ok(output))) => { - runner.process_task_output(task_id, output).await; + StreamMessage::TaskOutput(TaskOutputMessage(task_id, Ok(output))) => { + runner.process_task_output(&task_id, output).await; } - StreamMessage::RunnerMsg(RunnerMessage::TaskOutput(task_id, Err(()))) => { - error!("Task failed "); + StreamMessage::TaskOutput(TaskOutputMessage(task_id, Err(()))) => { + error!(%task_id, "Task failed"); - runner.clean_suspended_task(task_id); - - runner.dispatch_next_task(task_id).await; + runner.clear_errored_task(task_id).await; + trace!(%task_id, "Failed task cleared"); } - StreamMessage::RunnerMsg(RunnerMessage::StoleTask(maybe_new_task)) => { - runner.process_stolen_task(maybe_new_task).await; + StreamMessage::Steal(maybe_stolen_task) => { + runner.process_stolen_task(maybe_stolen_task).await; } // Idle checking to steal some work diff --git a/crates/task-system/src/worker/runner.rs b/crates/task-system/src/worker/runner.rs index d3cc3d91e..d99981558 100644 --- a/crates/task-system/src/worker/runner.rs +++ b/crates/task-system/src/worker/runner.rs @@ -10,26 +10,27 @@ use std::{ }; use async_channel as chan; -use futures::StreamExt; -use futures_concurrency::future::Race; +use futures::{FutureExt, StreamExt}; +use futures_concurrency::{future::Race, stream::Merge}; use tokio::{ spawn, sync::oneshot, task::{JoinError, JoinHandle}, - time::{timeout, Instant}, + time::{sleep, timeout, Instant}, }; -use tracing::{debug, error, trace, warn}; +use tracing::{debug, error, instrument, trace, warn, Instrument}; use super::{ super::{ error::{RunError, SystemError}, + message::{StoleTaskMessage, TaskOutputMessage}, system::SystemComm, task::{ - ExecStatus, InternalTaskExecStatus, Interrupter, Task, TaskId, TaskOutput, TaskStatus, - TaskWorkState, TaskWorktable, + ExecStatus, InternalTaskExecStatus, Interrupter, PanicOnSenderDrop, PendingTaskKind, + Task, TaskId, TaskOutput, TaskStatus, TaskWorkState, TaskWorktable, }, }, - RunnerMessage, TaskRunnerOutput, WorkStealer, WorkerId, ONE_SECOND, + TaskRunnerOutput, WorkStealer, WorkerId, ONE_SECOND, }; const TEN_SECONDS: Duration = Duration::from_secs(10); @@ -49,44 +50,12 @@ struct AbortAndSuspendSignalers { suspend_tx: oneshot::Sender<()>, } -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(super) enum PendingTaskKind { - Normal, - Priority, - Suspended, -} - -impl PendingTaskKind { - const fn with_priority(has_priority: bool) -> Self { - if has_priority { - Self::Priority - } else { - Self::Normal - } - } -} - struct RunningTask { - task_id: TaskId, - task_kind: PendingTaskKind, + id: TaskId, + kind: PendingTaskKind, handle: JoinHandle<()>, } -fn dispatch_steal_request( - worker_id: WorkerId, - work_stealer: WorkStealer, - runner_tx: chan::Sender>, -) -> JoinHandle<()> { - spawn(async move { - runner_tx - .send(RunnerMessage::StoleTask( - work_stealer.steal(worker_id).await, - )) - .await - .expect("runner channel closed before send stolen task"); - }) -} - enum WaitingSuspendedTask { Task(TaskId), None, @@ -107,25 +76,33 @@ pub(super) struct Runner { paused_tasks: HashMap>, suspended_task: Option>, priority_tasks: VecDeque>, - last_requested_help: Instant, is_idle: bool, waiting_suspension: WaitingSuspendedTask, abort_and_suspend_map: HashMap, - msgs_tx: chan::Sender>, + stole_task_tx: chan::Sender>>, + task_output_tx: chan::Sender>, current_task_handle: Option, - suspend_on_shutdown_rx: chan::Receiver>, + suspend_on_shutdown_stole_task_rx: chan::Receiver>>, + suspend_on_shutdown_task_output_rx: chan::Receiver>, current_steal_task_handle: Option>, last_steal_attempt_at: Instant, steal_attempts_count: u32, } +type RunnerCreate = ( + Runner, + chan::Receiver>>, + chan::Receiver>, +); + impl Runner { pub(super) fn new( worker_id: WorkerId, work_stealer: WorkStealer, system_comm: SystemComm, - ) -> (Self, chan::Receiver>) { - let (runner_tx, runner_rx) = chan::bounded(8); + ) -> RunnerCreate { + let (stolen_task_tx, stolen_task_rx) = chan::bounded(2); + let (task_output_tx, task_output_rx) = chan::bounded(8); ( Self { @@ -137,40 +114,38 @@ impl Runner { paused_tasks: HashMap::new(), suspended_task: None, priority_tasks: VecDeque::with_capacity(PRIORITY_TASK_QUEUE_INITIAL_SIZE), - last_requested_help: Instant::now(), is_idle: true, waiting_suspension: WaitingSuspendedTask::None, abort_and_suspend_map: HashMap::with_capacity(ABORT_AND_SUSPEND_MAP_INITIAL_SIZE), - msgs_tx: runner_tx, + stole_task_tx: stolen_task_tx, + task_output_tx, current_task_handle: None, - suspend_on_shutdown_rx: runner_rx.clone(), + suspend_on_shutdown_stole_task_rx: stolen_task_rx.clone(), + suspend_on_shutdown_task_output_rx: task_output_rx.clone(), current_steal_task_handle: None, last_steal_attempt_at: Instant::now(), steal_attempts_count: 0, }, - runner_rx, + stolen_task_rx, + task_output_rx, ) } + #[instrument(skip(self))] pub(super) fn total_tasks(&self) -> usize { let priority_tasks_count = self.priority_tasks.len(); let current_task_count = usize::from(self.current_task_handle.is_some()); let suspended_task_count = usize::from(self.suspended_task.is_some()); let tasks_count = self.tasks.len(); - trace!( - "Task count: \ - ", - self.worker_id + trace!(%priority_tasks_count, %current_task_count, %suspended_task_count, %tasks_count, + "Tasks count" ); priority_tasks_count + current_task_count + suspended_task_count + tasks_count } + #[instrument(skip(self, task_work_state))] pub(super) fn spawn_task_runner( &mut self, task_id: TaskId, @@ -187,107 +162,79 @@ impl Runner { }, ); - let handle = spawn(run_single_task( - self.worker_id, - task_work_state, - self.msgs_tx.clone(), - suspend_rx, - abort_rx, - )); - - trace!( - "Task runner spawned: ", - self.worker_id + let handle = spawn( + run_single_task( + task_work_state, + self.task_output_tx.clone(), + suspend_rx, + abort_rx, + ) + .in_current_span(), ); + trace!("Task runner spawned"); + handle } - pub(super) async fn new_task(&mut self, task_work_state: TaskWorkState) { - let task_id = task_work_state.task.id(); - let new_kind = PendingTaskKind::with_priority(task_work_state.task.with_priority()); + #[instrument(skip(self, task_work_state))] + pub(super) fn new_task( + &mut self, + task_id: TaskId, + task_kind: PendingTaskKind, + task_work_state: TaskWorkState, + ) { + trace!("Received new task"); - trace!( - "Received new task: ", - self.worker_id - ); + self.task_kinds.insert(task_id, task_kind); - self.task_kinds.insert(task_id, new_kind); - - match self - .inner_add_task(task_id, new_kind, task_work_state) - .await - { - TaskAddStatus::Running => trace!( - "Task running: ", - self.worker_id - ), - TaskAddStatus::Enqueued => trace!( - "Task enqueued: ", - self.worker_id - ), + match self.inner_add_task(task_id, task_kind, task_work_state) { + TaskAddStatus::Running => trace!("New task is running"), + TaskAddStatus::Enqueued => { + trace!( + total_tasks = self.total_tasks(), + "Task enqueued with other tasks" + ); + } } } - pub(super) async fn resume_task(&mut self, task_id: TaskId) -> Result<(), SystemError> { - trace!( - "Resume task request: ", - self.worker_id - ); + #[instrument(skip(self))] + pub(super) fn resume_task(&mut self, task_id: TaskId) -> Result<(), SystemError> { + trace!("Resume task request"); if let Some(task_work_state) = self.paused_tasks.remove(&task_id) { task_work_state.worktable.set_unpause(); - match self - .inner_add_task( - task_id, - *self - .task_kinds - .get(&task_id) - .expect("we added the task kind before pausing it"), - task_work_state, - ) - .await - { - TaskAddStatus::Running => trace!( - "Resumed task is running: ", - self.worker_id - ), - TaskAddStatus::Enqueued => trace!( - "Resumed task was enqueued: ", - self.worker_id - ), + match self.inner_add_task( + task_id, + *self + .task_kinds + .get(&task_id) + .expect("we added the task kind before pausing it"), + task_work_state, + ) { + TaskAddStatus::Running => trace!("Resumed task is running"), + TaskAddStatus::Enqueued => trace!("Resumed task was enqueued"), } - Ok(()) - } else { - trace!( - "Task not found: ", - self.worker_id - ); - Err(SystemError::TaskNotFound(task_id)) + return Ok(()); } + + trace!("Task not found"); + Err(SystemError::TaskNotFound(task_id)) } + #[instrument(skip(self))] pub(super) fn pause_not_running_task(&mut self, task_id: TaskId) -> Result<(), SystemError> { - trace!( - "Pause not running task request: ", - self.worker_id - ); - if self.paused_tasks.contains_key(&task_id) { - trace!( - "Task is already paused: ", - self.worker_id - ); + trace!("Task is already paused"); return Ok(()); } if let Some(current_task) = &self.current_task_handle { - if current_task.task_id == task_id { + if current_task.id == task_id { trace!( - "Task began to run before we managed to pause it, run function will pause it: \ - ", - self.worker_id + "Task began to run before we managed to pause it, run function will pause it" ); return Ok(()); // The task will pause itself } @@ -300,13 +247,11 @@ impl Runner { Err(SystemError::TaskNotFound(task_id)) } + #[instrument(skip(self))] fn pause_suspended_task(&mut self, task_id: TaskId) -> bool { if let Some(suspended_task) = &self.suspended_task { - if suspended_task.task.id() == task_id { - trace!( - "Task is already suspended but will be paused: ", - self.worker_id - ); + if suspended_task.id() == task_id { + trace!("Task is already suspended but will be paused"); self.paused_tasks.insert( task_id, @@ -320,11 +265,12 @@ impl Runner { false } + #[instrument(skip(self))] fn pause_task_from_queues(&mut self, task_id: TaskId) -> bool { if let Some(index) = self .priority_tasks .iter() - .position(|task_work_state| task_work_state.task.id() == task_id) + .position(|task_work_state| task_work_state.id() == task_id) { self.paused_tasks.insert( task_id, @@ -339,7 +285,7 @@ impl Runner { if let Some(index) = self .tasks .iter() - .position(|task_work_state| task_work_state.task.id() == task_id) + .position(|task_work_state| task_work_state.id() == task_id) { self.paused_tasks.insert( task_id, @@ -352,75 +298,79 @@ impl Runner { false } - pub(super) fn cancel_not_running_task(&mut self, task_id: TaskId) { - trace!( - "Cancel not running task request: ", - self.worker_id - ); + #[instrument(skip(self))] + pub(super) fn cancel_not_running_task(&mut self, task_id: &TaskId) -> Result<(), SystemError> { + trace!("Cancel not running task request"); if let Some(current_task) = &self.current_task_handle { - if current_task.task_id == task_id { + if current_task.id == *task_id { trace!( - "Task began to run before we managed to cancel it, run function will cancel it: \ - ", - self.worker_id + "Task began to run before we managed to cancel it, run function will cancel it" ); - return; // The task will cancel itself + return Ok(()); // The task will cancel itself } } + // We only remove from task_kinds as if the task is already running, it will be removed when we + // process its cancelled output later + self.task_kinds.remove(task_id); + if let Some(suspended_task) = &self.suspended_task { - if suspended_task.task.id() == task_id { - trace!( - "Task is already suspended but will be paused: ", - self.worker_id - ); + if suspended_task.id() == *task_id { + trace!("Task is already suspended but will be canceled"); - send_cancel_task_response( - self.worker_id, - task_id, - self.suspended_task.take().expect("we just checked it"), - ); + send_cancel_task_response(self.suspended_task.take().expect("we just checked it")); - return; + return Ok(()); } } - self.cancel_task_from_queues(task_id); + if self.cancel_task_from_queues(task_id) { + return Ok(()); + } + + Err(SystemError::TaskNotFound(*task_id)) // If the task is not found, then it's possible that the user already canceled it but still have the handle } - fn cancel_task_from_queues(&mut self, task_id: TaskId) { + #[instrument(skip(self))] + #[inline] + fn cancel_task_from_queues(&mut self, task_id: &TaskId) -> bool { if let Some(index) = self .priority_tasks .iter() - .position(|task_work_state| task_work_state.task.id() == task_id) + .position(|task_work_state| task_work_state.id() == *task_id) { send_cancel_task_response( - self.worker_id, - task_id, self.priority_tasks .remove(index) .expect("we just checked it"), ); - return; + return true; } if let Some(index) = self .tasks .iter() - .position(|task_work_state| task_work_state.task.id() == task_id) + .position(|task_work_state| task_work_state.id() == *task_id) { - send_cancel_task_response( - self.worker_id, - task_id, - self.tasks.remove(index).expect("we just checked it"), - ); + send_cancel_task_response(self.tasks.remove(index).expect("we just checked it")); + + return true; } + + if let Some(task_work_state) = self.paused_tasks.remove(task_id) { + send_cancel_task_response(task_work_state); + + return true; + } + + false } + #[instrument(skip(self, task_work_state))] #[inline] fn add_task_when_idle( &mut self, @@ -428,15 +378,12 @@ impl Runner { task_kind: PendingTaskKind, task_work_state: TaskWorkState, ) { - trace!( - "Idle worker will process the new task: ", - self.worker_id - ); + trace!("Idle worker will process the new task"); let handle = self.spawn_task_runner(task_id, task_work_state); self.current_task_handle = Some(RunningTask { - task_id, - task_kind, + id: task_id, + kind: task_kind, handle, }); @@ -445,8 +392,64 @@ impl Runner { self.is_idle = false; } + #[instrument(skip(self, task_work_state))] #[inline] - pub(super) async fn inner_add_task( + fn add_task_when_busy( + &mut self, + new_kind: PendingTaskKind, + task_work_state: TaskWorkState, + old_task_id: TaskId, + old_kind: PendingTaskKind, + ) -> TaskAddStatus { + match (new_kind, old_kind) { + (PendingTaskKind::Priority, PendingTaskKind::Priority) => { + trace!("Old and new tasks have priority, will put new task on priority queue"); + self.priority_tasks.push_front(task_work_state); + TaskAddStatus::Enqueued + } + (PendingTaskKind::Priority, PendingTaskKind::Normal) => { + if self.waiting_suspension.is_waiting() { + trace!( + "Worker is already waiting for a task to be suspended, will enqueue new task" + ); + self.priority_tasks.push_front(task_work_state); + } else { + trace!("Old task will be suspended"); + // We put the query at the top of the priority queue, so it will be + // dispatched by the run function as soon as the current task is suspended + self.priority_tasks.push_front(task_work_state); + + if self + .abort_and_suspend_map + .remove(&old_task_id) + .expect("we always store the abort and suspend signalers") + .suspend_tx + .send(()) + .is_err() + { + warn!(%old_task_id, + "Suspend channel closed before receiving suspend signal. \ + This probably happened because the task finished before we could suspend it." + ); + } + + self.waiting_suspension = WaitingSuspendedTask::Task(old_task_id); + } + + TaskAddStatus::Running + } + (_, _) => { + trace!("New task doesn't have priority and will be enqueued"); + self.tasks.push_back(task_work_state); + + TaskAddStatus::Enqueued + } + } + } + + #[instrument(skip(self, task_work_state))] + #[inline] + pub(super) fn inner_add_task( &mut self, task_id: TaskId, task_kind: PendingTaskKind, @@ -456,125 +459,35 @@ impl Runner { self.add_task_when_idle(task_id, task_kind, task_work_state); TaskAddStatus::Running } else { + trace!("Worker is busy"); + let RunningTask { - task_id: old_task_id, - task_kind: old_kind, + id: old_task_id, + kind: old_kind, .. } = self .current_task_handle .as_ref() .expect("Worker isn't idle, but no task is running"); - trace!( - "Worker is busy: \ - ", - self.worker_id, - ); - - let add_status = match (task_kind, old_kind) { - (PendingTaskKind::Priority, PendingTaskKind::Priority) => { - trace!( - "Old and new tasks have priority, will put new task on priority queue: \ - ", - self.worker_id - ); - self.priority_tasks.push_front(task_work_state); - - TaskAddStatus::Enqueued - } - (PendingTaskKind::Priority, PendingTaskKind::Normal) => { - if self.waiting_suspension.is_waiting() { - trace!( - "Worker is already waiting for a task to be suspended, will enqueue new task: \ - ", - self.worker_id - ); - - self.priority_tasks.push_front(task_work_state); - } else { - trace!( - "Old task will be suspended: \ - ", - self.worker_id - ); - - // We put the query at the top of the priority queue, so it will be - // dispatched by the run function as soon as the current task is suspended - self.priority_tasks.push_front(task_work_state); - - if self - .abort_and_suspend_map - .remove(old_task_id) - .expect("we always store the abort and suspend signalers") - .suspend_tx - .send(()) - .is_err() - { - warn!( - "Task suspend channel closed before receiving suspend signal. \ - This probably happened because the task finished before we could suspend it." - ); - } - - self.waiting_suspension = WaitingSuspendedTask::Task(*old_task_id); - } - - TaskAddStatus::Running - } - (_, _) => { - trace!( - "New task doesn't have priority and will be enqueued: \ - ", - self.worker_id, - ); - - self.tasks.push_back(task_work_state); - - TaskAddStatus::Enqueued - } - }; - - let task_count = self.total_tasks(); - - trace!( - "Worker with {task_count} pending tasks: ", - self.worker_id - ); - - if task_count > self.work_stealer.workers_count() - && self.last_requested_help.elapsed() > ONE_SECOND - { - trace!( - "Worker requesting help from the system: \ - ", - self.worker_id - ); - - self.system_comm - .request_help(self.worker_id, task_count) - .await; - - self.last_requested_help = Instant::now(); - } - - add_status + self.add_task_when_busy(task_kind, task_work_state, *old_task_id, *old_kind) } } + #[instrument(skip(self))] pub(super) async fn force_task_abortion( &mut self, - task_id: uuid::Uuid, + task_id: &TaskId, ) -> Result<(), SystemError> { if let Some(AbortAndSuspendSignalers { abort_tx, .. }) = - self.abort_and_suspend_map.remove(&task_id) + self.abort_and_suspend_map.remove(task_id) { let (tx, rx) = oneshot::channel(); if abort_tx.send(tx).is_err() { debug!( - "Failed to send force abortion request, the task probably finished before we could abort it: \ - ", - self.worker_id + "Failed to send force abortion request, \ + the task probably finished before we could abort it" ); Ok(()) @@ -584,36 +497,29 @@ impl Runner { // If the sender was dropped, then the task finished before we could // abort it which is fine Ok(Err(_)) => Ok(()), - Err(_) => Err(SystemError::TaskForcedAbortTimeout(task_id)), + Err(_) => Err(SystemError::TaskForcedAbortTimeout(*task_id)), } } } else { - trace!( - "Forced abortion of a not running task request: ", - self.worker_id - ); + trace!("Forced abortion of a not running task request"); if let Some(current_task) = &self.current_task_handle { - if current_task.task_id == task_id { + if current_task.id == *task_id { trace!( - "Task began to run before we managed to abort it, run function will abort it: \ - ", - self.worker_id - ); + "Task began to run before we managed to abort it, \ + run function will abort it" + ); return Ok(()); // The task will abort itself } } + self.task_kinds.remove(task_id); + if let Some(suspended_task) = &self.suspended_task { - if suspended_task.task.id() == task_id { - trace!( - "Task is already suspended but will be paused: ", - self.worker_id - ); + if suspended_task.id() == *task_id { + trace!("Task is already suspended but will be force aborted"); send_forced_abortion_task_response( - self.worker_id, - task_id, self.suspended_task.take().expect("we just checked it"), ); @@ -624,11 +530,9 @@ impl Runner { if let Some(index) = self .priority_tasks .iter() - .position(|task_work_state| task_work_state.task.id() == task_id) + .position(|task_work_state| task_work_state.id() == *task_id) { send_forced_abortion_task_response( - self.worker_id, - task_id, self.priority_tasks .remove(index) .expect("we just checked it"), @@ -640,96 +544,109 @@ impl Runner { if let Some(index) = self .tasks .iter() - .position(|task_work_state| task_work_state.task.id() == task_id) + .position(|task_work_state| task_work_state.id() == *task_id) { send_forced_abortion_task_response( - self.worker_id, - task_id, self.tasks.remove(index).expect("we just checked it"), ); return Ok(()); } - // If the task is not found, then it's possible that the user already aborted it but still have the handle + // If the task is not found, then it's possible that + // the user already aborted it but still have the handle Ok(()) } } + #[instrument(skip(self, tx))] pub(super) async fn shutdown(mut self, tx: oneshot::Sender<()>) { - trace!( - "Worker beginning shutdown process: ", - self.worker_id - ); + trace!("Worker beginning shutdown process"); - trace!( - "Aborting steal task for shutdown if there is one running: ", - self.worker_id - ); + trace!("Aborting steal task for shutdown if there is one running"); self.abort_steal_task(); let Self { - worker_id, tasks, + suspended_task, paused_tasks, priority_tasks, is_idle, abort_and_suspend_map, - msgs_tx: runner_tx, + stole_task_tx: stolen_task_tx, + task_output_tx, mut current_task_handle, - suspend_on_shutdown_rx, + suspend_on_shutdown_stole_task_rx, + suspend_on_shutdown_task_output_rx, .. } = self; if is_idle { - trace!("Worker is idle, no tasks to shutdown: "); + trace!("Worker is idle, no tasks to shutdown"); + assert!( + current_task_handle.is_none(), + "can't shutdown with a running task if we're idle" + ); + assert!( + tasks.is_empty(), + "can't shutdown with pending tasks if we're idle" + ); + assert!( + priority_tasks.is_empty(), + "can't shutdown with priority tasks if we're idle" + ); + assert!( + suspended_task.is_none(), + "can't shutdown with a suspended task if we're idle" + ); + + paused_tasks + .into_values() + .for_each(send_shutdown_task_response); } else { - trace!("Worker is busy, will shutdown tasks: "); + trace!("Worker is busy, will shutdown tasks"); if let Some(RunningTask { - task_id, handle, .. + id: task_id, + handle, + .. }) = current_task_handle.take() { for (task_id, AbortAndSuspendSignalers { suspend_tx, .. }) in abort_and_suspend_map { if suspend_tx.send(()).is_err() { - warn!( - "Shutdown request channel closed before sending abort signal: \ - " + warn!(%task_id, + "Shutdown request channel closed before sending abort signal" ); } else { - trace!( - "Sent suspend signal for task on shutdown: \ - " - ); + trace!(%task_id, "Sent suspend signal for task on shutdown"); } } if let Err(e) = handle.await { - error!("Task failed to join: {e:#?}"); + error!(%task_id, ?e, "Task failed to join"); } - runner_tx.close(); + stolen_task_tx.close(); + task_output_tx.close(); - Self::process_tasks_being_suspended_on_shutdown(worker_id, suspend_on_shutdown_rx) - .await; + Self::process_tasks_being_suspended_on_shutdown( + suspend_on_shutdown_stole_task_rx, + suspend_on_shutdown_task_output_rx, + ) + .await; } priority_tasks .into_iter() + .chain(suspended_task.into_iter()) .chain(paused_tasks.into_values()) .chain(tasks.into_iter()) - .for_each(|task_work_state| { - send_shutdown_task_response( - worker_id, - task_work_state.task.id(), - task_work_state, - ); - }); + .for_each(send_shutdown_task_response); } - trace!("Worker shutdown process completed: "); + trace!("Worker shutdown process completed"); if tx.send(()).is_err() { warn!("Shutdown request channel closed before sending ack"); @@ -737,50 +654,58 @@ impl Runner { } async fn process_tasks_being_suspended_on_shutdown( - worker_id: WorkerId, - suspend_on_shutdown_rx: chan::Receiver>, + suspend_on_shutdown_stole_task_rx: chan::Receiver>>, + suspend_on_shutdown_task_output_rx: chan::Receiver>, ) { - let mut suspend_on_shutdown_rx = pin!(suspend_on_shutdown_rx); + enum StreamMessage { + Output(TaskOutputMessage), + Steal(Option>), + } - while let Some(runner_msg) = suspend_on_shutdown_rx.next().await { - match runner_msg { - RunnerMessage::TaskOutput(task_id, res) => match res { + let mut msg_stream = pin!(( + suspend_on_shutdown_stole_task_rx.map(StreamMessage::Steal), + suspend_on_shutdown_task_output_rx.map(StreamMessage::Output), + ) + .merge()); + + while let Some(msg) = msg_stream.next().await { + match msg { + StreamMessage::Output(TaskOutputMessage(task_id, res)) => match res { Ok(TaskRunnerOutput { task_work_state, status, }) => match status { InternalTaskExecStatus::Done(out) => { - send_complete_task_response(worker_id, task_id, task_work_state, out); + send_complete_task_response(task_work_state, out); } InternalTaskExecStatus::Canceled => { - send_cancel_task_response(worker_id, task_id, task_work_state); + send_cancel_task_response(task_work_state); } InternalTaskExecStatus::Suspend | InternalTaskExecStatus::Paused => { - send_shutdown_task_response(worker_id, task_id, task_work_state); + send_shutdown_task_response(task_work_state); } InternalTaskExecStatus::Error(e) => { - send_error_task_response(worker_id, task_id, task_work_state, e); + send_error_task_response(task_work_state, e); } }, Err(()) => { - error!( - "Task failed to suspend on shutdown" - ); + error!(%task_id, "Task failed to suspend on shutdown"); } }, - RunnerMessage::StoleTask(Some(task_work_state)) => { - send_shutdown_task_response( - worker_id, - task_work_state.task.id(), - task_work_state, + StreamMessage::Steal(Some(StoleTaskMessage(task_work_state))) => { + trace!( + task_id = %task_work_state.id(), + "Stole task", ); + + send_shutdown_task_response(task_work_state); } - RunnerMessage::StoleTask(None) => {} + StreamMessage::Steal(None) => {} } } } @@ -791,7 +716,6 @@ impl Runner { } if let Some(task) = self.suspended_task.take() { - task.interrupter.reset(); task.worktable.set_unpause(); return Some((PendingTaskKind::Suspended, task)); } @@ -801,99 +725,77 @@ impl Runner { .map(|task| (PendingTaskKind::Normal, task)) } - pub(super) fn steal_request(&mut self, tx: oneshot::Sender>>) { - trace!("Steal request: ", self.worker_id); - if let Some((kind, task_work_state)) = self.get_next_task() { - self.proceed_with_task_to_be_stolen(kind, task_work_state, tx); - } else { - trace!("No task to steal: ", self.worker_id); - if tx.send(None).is_err() { - warn!( - "Steal request channel closed before sending no task response: \ - ", - self.worker_id - ); - } - } - } - - fn proceed_with_task_to_be_stolen( + #[instrument(skip_all)] + pub(super) async fn steal_request( &mut self, - kind: PendingTaskKind, - task_work_state: TaskWorkState, - tx: oneshot::Sender>>, - ) { - let task_id = task_work_state.task.id(); - self.task_kinds.remove(&task_id); + stealer_id: WorkerId, + stolen_task_tx: chan::Sender>>, + ) -> bool { + while let Some((kind, task_work_state)) = self.get_next_task() { + let task_id = task_work_state.id(); + self.task_kinds.remove(&task_id); - trace!( - "Stealing task: ", - self.worker_id - ); + trace!(%task_id, ?kind, "Task being stolen"); - if let Err(Some(task_work_state)) = tx.send(Some(task_work_state)) { - self.put_back_failed_to_stole_task(task_id, kind, task_work_state); - } - } - - fn put_back_failed_to_stole_task( - &mut self, - id: TaskId, - kind: PendingTaskKind, - task_work_state: TaskWorkState, - ) { - warn!( - "Steal request channel closed before sending task: ", - self.worker_id - ); - match kind { - PendingTaskKind::Normal => self.tasks.push_front(task_work_state), - PendingTaskKind::Priority => self.priority_tasks.push_front(task_work_state), - PendingTaskKind::Suspended => self.suspended_task = Some(task_work_state), - } - - self.task_kinds.insert(id, kind); - } - - pub(super) fn wake_up(&mut self) { - if self.is_idle { - trace!( - "Worker is idle, waking up: ", - self.worker_id - ); - - if self.current_steal_task_handle.is_none() { - self.current_steal_task_handle = Some(dispatch_steal_request( - self.worker_id, - self.work_stealer.clone(), - self.msgs_tx.clone(), - )); - } else { - trace!( - "Steal task already running, ignoring wake up request: ", - self.worker_id - ); + if task_work_state.worktable.has_canceled() { + trace!(%task_id, "Task was canceled before we could steal it"); + send_cancel_task_response(task_work_state); + continue; } - } else { - trace!( - "Worker already working, ignoring wake up request: ", - self.worker_id - ); + + if task_work_state.worktable.has_aborted() { + trace!(%task_id, "Task was force aborted before we could steal it"); + send_forced_abortion_task_response(task_work_state); + continue; + } + + if task_work_state.worktable.is_paused() { + trace!(%task_id, "Task was paused before we could steal it"); + self.task_kinds.insert(task_id, kind); + self.paused_tasks.insert(task_id, task_work_state); + continue; + } + + trace!(%task_id, ?kind, "Task being stolen"); + + task_work_state.worktable.change_worker(stealer_id); + + if let Err(chan::SendError(Some(StoleTaskMessage(task_work_state)))) = stolen_task_tx + .send(Some(StoleTaskMessage(task_work_state))) + .await + { + warn!("Steal request channel closed before sending task"); + task_work_state.worktable.change_worker(self.worker_id); + match kind { + PendingTaskKind::Normal => self.tasks.push_front(task_work_state), + PendingTaskKind::Priority => self.priority_tasks.push_front(task_work_state), + PendingTaskKind::Suspended => { + assert!( + self.suspended_task.is_none(), + "tried to suspend a task when we already have a suspended task" + ); + self.suspended_task = Some(task_work_state); + } + } + + self.task_kinds.insert(task_id, kind); + + return false; + } + + return true; // Successfully stole the task } + + false // No task to steal } + #[instrument(skip(self))] #[inline] - pub(super) async fn dispatch_next_task(&mut self, finished_task_id: TaskId) { - trace!( - "Task finished and will try to process a new task: \ - ", - self.worker_id - ); - - self.abort_and_suspend_map.remove(&finished_task_id); + pub(super) async fn dispatch_next_task(&mut self, finished_task_id: &TaskId) { + self.abort_and_suspend_map.remove(finished_task_id); let RunningTask { - task_id: old_task_id, + id: old_task_id, handle, .. @@ -902,62 +804,42 @@ impl Runner { .take() .expect("Task handle missing, but task output received"); - assert_eq!(finished_task_id, old_task_id, "Task output id mismatch"); + assert_eq!(*finished_task_id, old_task_id, "Task output id mismatch"); // Sanity check - trace!( - "Waiting task handle: ", - self.worker_id - ); if let Err(e) = handle.await { - error!("Task failed to join: {e:#?}"); + error!(?e, "Task failed to join"); } - trace!( - "Waited task handle: ", - self.worker_id - ); - if let Some((task_kind, task_work_state)) = self.get_next_task() { - let task_id = task_work_state.task.id(); + if let Some((next_task_kind, task_work_state)) = self.get_next_task() { + let next_task_id = task_work_state.id(); - trace!( - "Dispatching next task: ", - self.worker_id - ); + trace!(%next_task_id, ?next_task_kind, "Dispatching next task"); - let handle = self.spawn_task_runner(task_id, task_work_state); + let handle = self.spawn_task_runner(next_task_id, task_work_state); self.current_task_handle = Some(RunningTask { - task_id, - task_kind, + id: next_task_id, + kind: next_task_kind, handle, }); } else { - trace!( - "No task to dispatch, worker is now idle and will dispatch a steal request: ", - self.worker_id - ); - self.is_idle = true; - self.system_comm.idle_report(self.worker_id).await; + self.system_comm.idle_report(self.worker_id); if self.current_steal_task_handle.is_none() { self.current_steal_task_handle = Some(dispatch_steal_request( self.worker_id, self.work_stealer.clone(), - self.msgs_tx.clone(), + self.stole_task_tx.clone(), )); - } else { - trace!( - "Steal task already running: ", - self.worker_id - ); } } } + #[instrument(skip(self, task_work_state, status))] pub(super) async fn process_task_output( &mut self, - task_id: TaskId, + task_id: &TaskId, TaskRunnerOutput { task_work_state, status, @@ -965,90 +847,63 @@ impl Runner { ) { match status { InternalTaskExecStatus::Done(out) => { - self.task_kinds.remove(&task_id); - send_complete_task_response(self.worker_id, task_id, task_work_state, out); + self.task_kinds.remove(task_id); + send_complete_task_response(task_work_state, out); } InternalTaskExecStatus::Paused => { - self.paused_tasks.insert(task_id, task_work_state); - trace!( - "Task paused: ", - self.worker_id - ); + self.paused_tasks.insert(*task_id, task_work_state); + trace!("Task paused"); } InternalTaskExecStatus::Canceled => { - self.task_kinds.remove(&task_id); - send_cancel_task_response(self.worker_id, task_id, task_work_state); + self.task_kinds.remove(task_id); + send_cancel_task_response(task_work_state); } InternalTaskExecStatus::Error(e) => { - self.task_kinds.remove(&task_id); - send_error_task_response(self.worker_id, task_id, task_work_state, e); + self.task_kinds.remove(task_id); + send_error_task_response(task_work_state, e); } InternalTaskExecStatus::Suspend => { - self.suspended_task = Some(task_work_state); - trace!( - "Task suspended: ", - self.worker_id + assert!( + self.suspended_task.is_none(), + "tried to suspend a task when we already have a suspended task" ); + self.suspended_task = Some(task_work_state); + trace!("Task suspended"); self.clean_suspended_task(task_id); } } - trace!( - "Processing task output completed and will try to dispatch a new task: \ - ", - self.worker_id - ); - self.dispatch_next_task(task_id).await; } + #[instrument(skip(self))] pub(super) fn idle_check(&mut self) { if self.is_idle { - trace!( - "Worker is idle for some time and will try to steal a task: ", - self.worker_id - ); - if self.current_steal_task_handle.is_none() { self.steal_attempt(); - } else { - trace!( - "Steal task already running, ignoring on this idle check: ", - self.worker_id - ); } self.idle_memory_cleanup(); } } + #[instrument(skip(self), fields(steal_attempts_count = self.steal_attempts_count))] fn steal_attempt(&mut self) { let elapsed = self.last_steal_attempt_at.elapsed(); let required = (TEN_SECONDS * self.steal_attempts_count).min(ONE_MINUTE); - trace!( - "Steal attempt required cool down: \ - ", - self.worker_id, - self.steal_attempts_count - ); + if elapsed > required { self.current_steal_task_handle = Some(dispatch_steal_request( self.worker_id, self.work_stealer.clone(), - self.msgs_tx.clone(), + self.stole_task_tx.clone(), )); self.last_steal_attempt_at = Instant::now(); - } else { - trace!( - "Steal attempt still cooling down: ", - self.worker_id, - self.steal_attempts_count - ); } } @@ -1060,7 +915,11 @@ impl Runner { } if self.task_kinds.capacity() > TASK_QUEUE_INITIAL_SIZE { - assert_eq!(self.task_kinds.len(), self.paused_tasks.len()); + assert_eq!( + self.task_kinds.len(), + self.paused_tasks.len(), + "If we're idle, the number of task_kinds MUST be equal to the number of paused tasks" + ); self.task_kinds.shrink_to(TASK_QUEUE_INITIAL_SIZE); } @@ -1081,60 +940,77 @@ impl Runner { } } + #[instrument(skip(self))] pub(super) fn abort_steal_task(&mut self) { if let Some(steal_task_handle) = self.current_steal_task_handle.take() { steal_task_handle.abort(); - trace!("Aborted steal task: ", self.worker_id); - } else { - trace!("No steal task to abort: ", self.worker_id); + trace!("Aborted steal task"); } } - pub(super) async fn process_stolen_task(&mut self, maybe_new_task: Option>) { + #[instrument( + skip(self, maybe_new_task), + fields( + maybe_new_task = ?maybe_new_task.as_ref() + .map(|StoleTaskMessage(task_work_state)| task_work_state.id()) + ) + )] + pub(super) async fn process_stolen_task( + &mut self, + maybe_new_task: Option>, + ) { if let Some(steal_task_handle) = self.current_steal_task_handle.take() { if let Err(e) = steal_task_handle.await { - error!("Steal task failed to join: {e:#?}"); + error!(?e, "Steal task failed to join"); } } - if let Some(task_work_state) = maybe_new_task { - self.system_comm.working_report(self.worker_id).await; - trace!( - "Stolen task: ", - self.worker_id, - task_work_state.task.id() - ); + if let Some(StoleTaskMessage(task_work_state)) = maybe_new_task { + self.system_comm.working_report(self.worker_id); + + let stolen_task_id = task_work_state.id(); + + trace!(%stolen_task_id, "Stolen task"); + self.steal_attempts_count = 0; - self.new_task(task_work_state).await; + self.new_task(stolen_task_id, task_work_state.kind(), task_work_state); } else { self.steal_attempts_count += 1; } } - pub(crate) fn clean_suspended_task(&mut self, task_id: uuid::Uuid) { + #[instrument(skip(self))] + pub(crate) fn clean_suspended_task(&mut self, task_id: &TaskId) { match self.waiting_suspension { - WaitingSuspendedTask::Task(waiting_task_id) if waiting_task_id == task_id => { - trace!( - "Task was suspended and will be cleaned: ", - self.worker_id - ); + WaitingSuspendedTask::Task(waiting_task_id) if waiting_task_id == *task_id => { + trace!("Task was suspended and will be cleaned"); self.waiting_suspension = WaitingSuspendedTask::None; } WaitingSuspendedTask::Task(_) => { - trace!( - "Task wasn't suspended, ignoring: ", - self.worker_id - ); + trace!("Task wasn't suspended, ignoring"); + } + WaitingSuspendedTask::None => { + // Everything is Awesome! } - WaitingSuspendedTask::None => {} } } + + #[instrument(skip(self))] + pub(crate) async fn clear_errored_task(&mut self, task_id: TaskId) { + self.task_kinds.remove(&task_id); + + self.clean_suspended_task(&task_id); + + trace!("Cleansed errored task"); + + self.dispatch_next_task(&task_id).await; + } } type RunTaskOutput = (Box>, Result, SystemError>); +#[instrument(skip(task, worktable, interrupter))] fn handle_run_task_attempt( - worker_id: WorkerId, task_id: TaskId, mut task: Box>, worktable: &TaskWorktable, @@ -1142,104 +1018,122 @@ fn handle_run_task_attempt( ) -> JoinHandle> { spawn({ let already_paused = worktable.is_paused(); - let already_canceled = worktable.is_canceled(); - let already_aborted = worktable.is_aborted(); + let already_canceled = worktable.has_canceled(); + let already_aborted = worktable.has_aborted(); + + let early_result = if already_paused { + trace!("Task was paused before running"); + + Some(Ok(Ok(ExecStatus::Paused))) + } else if already_canceled { + trace!("Task was canceled before running"); + + Some(Ok(Ok(ExecStatus::Canceled))) + } else if already_aborted { + trace!("Task was aborted before running"); + + Some(Err(SystemError::TaskAborted(task_id))) + } else { + // We can mark that the task has actually started now + worktable.set_started(); + None + }; async move { - if already_paused { - trace!( - "Task was paused before running: " - ); - - (task, Ok(Ok(ExecStatus::Paused))) - } else if already_canceled { - trace!( - "Task was canceled before running: " - ); - - (task, Ok(Ok(ExecStatus::Canceled))) - } else if already_aborted { - trace!( - "Task was aborted before running: " - ); - - (task, Err(SystemError::TaskAborted(task_id))) + if let Some(res) = early_result { + (task, res) } else { - let res = task.run(&interrupter).await; + let run_result = if let Some(timeout_duration) = task.with_timeout() { + (task.run(&interrupter).map(Ok), async move { + sleep(timeout_duration) + .map(|()| Err(SystemError::TaskTimeout(task_id))) + .await + }) + .race() + .await + } else { + task.run(&interrupter).map(Ok).await + }; - trace!("Ran task: : {res:?}"); + match run_result { + Ok(res) => { + trace!(?res, "Ran task"); - (task, Ok(res)) + (task, Ok(res)) + } + Err(e) => (task, Err(e)), + } } } + .in_current_span() }) } fn handle_task_suspension( - worker_id: WorkerId, - task_id: TaskId, has_suspended: Arc, worktable: Arc, suspend_rx: oneshot::Receiver<()>, ) -> JoinHandle<()> { - spawn(async move { - if suspend_rx.await.is_ok() { - let (tx, rx) = oneshot::channel(); + spawn( + async move { + if suspend_rx.await.is_ok() { + let (tx, rx) = oneshot::channel(); - trace!("Suspend signal received: "); + trace!("Suspend signal received"); - // The interrupter only knows about Pause and Cancel commands, we use pause as - // the suspend task feature should be invisible to the user - worktable.pause(tx).await; + worktable.suspend(tx, has_suspended); - match rx.await { - Ok(()) => { - trace!("Suspending: "); - has_suspended.store(true, Ordering::Relaxed); - } - Err(_) => { + if rx.await.is_ok() { + trace!("Suspending"); + } else { // The task probably finished before we could suspend it so the channel was dropped - trace!( - "Suspend channel closed: " - ); + trace!("Suspend channel closed"); } + } else { + trace!("Suspend channel closed, task probably finished before we could suspend it"); } - } else { - trace!( - "Suspend channel closed, task probably finished before we could suspend it: \ - " - ); } - }) + .in_current_span(), + ) } type PartialTaskWorkState = ( TaskId, Arc, - oneshot::Sender, SystemError>>, + PanicOnSenderDrop, Arc, ); async fn emit_task_completed_message( - worker_id: WorkerId, run_task_output: RunTaskOutput, has_suspended: Arc, (task_id, worktable, done_tx, interrupter): PartialTaskWorkState, - runner_tx: chan::Sender>, + task_output_tx: chan::Sender>, ) { match run_task_output { (task, Ok(res)) => { - trace!( - "Task completed ok: " - ); - runner_tx - .send(RunnerMessage::TaskOutput(task_id, { - let mut internal_status = res.into(); + trace!(?res, "Task completed ok"); - if matches!(internal_status, InternalTaskExecStatus::Paused) - && has_suspended.load(Ordering::Relaxed) - { - internal_status = InternalTaskExecStatus::Suspend; + task_output_tx + .send(TaskOutputMessage(task_id, { + let mut internal_status = res.into(); + let suspended = has_suspended.load(Ordering::SeqCst); + + match internal_status { + InternalTaskExecStatus::Paused if suspended => { + internal_status = InternalTaskExecStatus::Suspend; + } + + InternalTaskExecStatus::Paused | InternalTaskExecStatus::Suspend => { + /* Nothing to do */ + } + + InternalTaskExecStatus::Done(_) + | InternalTaskExecStatus::Canceled + | InternalTaskExecStatus::Error(_) => { + trace!(?internal_status, "Task completed, closing interrupter"); + interrupter.close(); + } } Ok(TaskRunnerOutput { @@ -1257,12 +1151,14 @@ async fn emit_task_completed_message( } (_, Err(e)) => { - trace!("Task had an error: "); + error!(?e, "Task had an error"); if done_tx .send(if matches!(e, SystemError::TaskAborted(_)) { + worktable.set_aborted(); Ok(TaskStatus::ForcedAbortion) } else { + worktable.set_failed(); Err(e) }) .is_err() @@ -1270,23 +1166,23 @@ async fn emit_task_completed_message( error!("Task done channel closed while sending error response"); } - runner_tx - .send(RunnerMessage::TaskOutput(task_id, Err(()))) + task_output_tx + .send(TaskOutputMessage(task_id, Err(()))) .await .expect("Task runner channel closed while sending task output"); } } } +#[instrument(skip_all, fields(task_id = %task.id()))] async fn run_single_task( - worker_id: WorkerId, TaskWorkState { task, worktable, interrupter, done_tx, }: TaskWorkState, - runner_tx: chan::Sender>, + task_output_tx: chan::Sender>, suspend_rx: oneshot::Receiver<()>, abort_rx: oneshot::Receiver>>, ) { @@ -1297,25 +1193,15 @@ async fn run_single_task( let task_id = task.id(); - worktable.set_started(); + trace!("Running task"); - trace!("Running task: "); - - let handle = handle_run_task_attempt( - worker_id, - task_id, - task, - &worktable, - Arc::clone(&interrupter), - ); + let handle = handle_run_task_attempt(task_id, task, &worktable, Arc::clone(&interrupter)); let task_abort_handle = handle.abort_handle(); let has_suspended = Arc::new(AtomicBool::new(false)); let suspender_handle = handle_task_suspension( - worker_id, - task_id, Arc::clone(&has_suspended), Arc::clone(&worktable), suspend_rx, @@ -1323,14 +1209,12 @@ async fn run_single_task( match (async { RaceOutput::Completed(handle.await) }, async move { if let Ok(tx) = abort_rx.await { - trace!("Aborting task: "); + trace!("Aborting task"); RaceOutput::Abort(tx) } else { // If the abort channel is closed, we should just ignore it and keep waiting for the task to finish // as we're being suspended by the worker - trace!( - "Abort channel closed, will wait for task to finish: " - ); + trace!("Abort channel closed, will wait for task to finish"); pending().await } }) @@ -1339,23 +1223,25 @@ async fn run_single_task( { RaceOutput::Completed(Ok(run_task_output)) => { emit_task_completed_message( - worker_id, run_task_output, has_suspended, (task_id, worktable, done_tx, interrupter), - runner_tx, + task_output_tx, ) .await; } RaceOutput::Completed(Err(join_error)) => { - error!("Task failed to join: {join_error:#?}",); + interrupter.close(); + error!(?join_error, "Task failed to join"); if done_tx.send(Err(SystemError::TaskJoin(task_id))).is_err() { error!("Task done channel closed while sending join error response"); } - if runner_tx - .send(RunnerMessage::TaskOutput(task_id, Err(()))) + worktable.set_failed(); + + if task_output_tx + .send(TaskOutputMessage(task_id, Err(()))) .await .is_err() { @@ -1366,14 +1252,16 @@ async fn run_single_task( RaceOutput::Abort(tx) => { task_abort_handle.abort(); - trace!("Task aborted: "); + trace!("Task aborted"); if done_tx.send(Ok(TaskStatus::ForcedAbortion)).is_err() { error!("Task done channel closed while sending abort error response"); } - if runner_tx - .send(RunnerMessage::TaskOutput(task_id, Err(()))) + worktable.set_aborted(); + + if task_output_tx + .send(TaskOutputMessage(task_id, Err(()))) .await .is_err() { @@ -1387,116 +1275,110 @@ async fn run_single_task( } if !suspender_handle.is_finished() { - trace!( - "Aborting suspender handler as it isn't needed anymore: " - ); // if we received a suspend signal this abort will do nothing, as the task finished already suspender_handle.abort(); } - - trace!("Run single task finished: "); } +#[instrument(skip(task, done_tx, worktable, out), fields(task_id = %task.id()))] fn send_complete_task_response( - worker_id: WorkerId, - task_id: TaskId, TaskWorkState { - done_tx, worktable, .. + done_tx, + worktable, + task, + .. }: TaskWorkState, out: TaskOutput, ) { worktable.set_completed(); - if done_tx.send(Ok(TaskStatus::Done((task_id, out)))).is_err() { - warn!( - "Task done channel closed before sending done response for task: \ - " - ); + worktable.set_finalized(); + if done_tx + .send(Ok(TaskStatus::Done((task.id(), out)))) + .is_err() + { + warn!("Task done channel closed before sending done response for task"); } else { - trace!( - "Emitted task done signal on shutdown: \ - " - ); + trace!("Emitted task done signal on task completion"); } } +#[instrument(skip(task, done_tx, worktable), fields(task_id = %task.id()))] fn send_cancel_task_response( - worker_id: WorkerId, - task_id: TaskId, TaskWorkState { - done_tx, worktable, .. + task, + done_tx, + worktable, + .. }: TaskWorkState, ) { - worktable.set_completed(); + worktable.set_canceled(); + worktable.set_finalized(); if done_tx.send(Ok(TaskStatus::Canceled)).is_err() { - warn!( - "Task done channel closed before sending canceled response for task: \ - ", - ); + warn!("Task done channel closed before sending canceled response for task"); } else { - trace!( - "Emitted task canceled signal on cancel not running task: \ - ", - ); + trace!("Emitted task canceled signal on cancel request"); } } +#[instrument(skip(task, done_tx, worktable), fields(task_id = %task.id()))] fn send_shutdown_task_response( - worker_id: WorkerId, - task_id: TaskId, - TaskWorkState { task, done_tx, .. }: TaskWorkState, + TaskWorkState { + task, + done_tx, + worktable, + .. + }: TaskWorkState, ) { + worktable.set_shutdown(); + worktable.set_finalized(); if done_tx.send(Ok(TaskStatus::Shutdown(task))).is_err() { - warn!( - "Task done channel closed before sending shutdown response for task: \ - " - ); + warn!("Task done channel closed before sending shutdown response for task"); } else { - trace!( - "Successfully suspended and sent back DynTask on worker shutdown: \ - " - ); + trace!("Successfully suspended and sent back DynTask on worker shutdown"); } } +#[instrument(skip(task, done_tx, worktable), fields(task_id = %task.id()))] fn send_error_task_response( - worker_id: usize, - task_id: uuid::Uuid, TaskWorkState { - done_tx, worktable, .. + task, + done_tx, + worktable, + .. }: TaskWorkState, e: E, ) { worktable.set_completed(); + worktable.set_finalized(); if done_tx.send(Ok(TaskStatus::Error(e))).is_err() { - warn!( - "Task done channel closed before sending error response for task: \ - " - ); + warn!("Task done channel closed before sending error response for task"); } else { - trace!( - "Emitted task error signal on shutdown: \ - " - ); + trace!("Emitted task error signal"); } } +#[instrument(skip(task, done_tx, worktable), fields(task_id = %task.id()))] fn send_forced_abortion_task_response( - worker_id: WorkerId, - task_id: TaskId, TaskWorkState { - done_tx, worktable, .. + task, + done_tx, + worktable, + .. }: TaskWorkState, ) { - worktable.set_completed(); + worktable.set_aborted(); + worktable.set_finalized(); if done_tx.send(Ok(TaskStatus::ForcedAbortion)).is_err() { - warn!( - "Task done channel closed before sending forced abortion response for task: \ - ", - ); + warn!("Task done channel closed before sending forced abortion response for task"); } else { - trace!( - "Emitted task forced abortion signal on cancel not running task: \ - ", - ); + trace!("Emitted task forced abortion signal"); } } + +fn dispatch_steal_request( + worker_id: WorkerId, + work_stealer: WorkStealer, + stole_task_tx: chan::Sender>>, +) -> JoinHandle<()> { + spawn(async move { work_stealer.steal(worker_id, &stole_task_tx).await }.in_current_span()) +} diff --git a/crates/task-system/tests/common/actors.rs b/crates/task-system/tests/common/actors.rs index 37bcbcefc..46205985f 100644 --- a/crates/task-system/tests/common/actors.rs +++ b/crates/task-system/tests/common/actors.rs @@ -83,6 +83,7 @@ impl SampleActor { paused_count, )) .await + .unwrap() } else { task_dispatcher .dispatch(SampleActorTask::with_id( @@ -92,6 +93,7 @@ impl SampleActor { paused_count, )) .await + .unwrap() }) .await .expect("Task handle receiver dropped"); @@ -121,8 +123,12 @@ impl SampleActor { self.task_dispatcher .dispatch(self.new_priority_task(duration)) .await + .unwrap() } else { - self.task_dispatcher.dispatch(self.new_task(duration)).await + self.task_dispatcher + .dispatch(self.new_task(duration)) + .await + .unwrap() }) .await .expect("Task handle receiver dropped"); diff --git a/crates/task-system/tests/common/jobs.rs b/crates/task-system/tests/common/jobs.rs index 7055c3473..5c7e0f242 100644 --- a/crates/task-system/tests/common/jobs.rs +++ b/crates/task-system/tests/common/jobs.rs @@ -41,6 +41,7 @@ impl SampleJob { task_dispatcher .dispatch_many(initial_steps) .await + .unwrap() .into_iter(), ) .lend_mut(); @@ -108,7 +109,8 @@ impl Task for SampleJobTask { expected_children: self.expected_children - 1, task_dispatcher: self.task_dispatcher.clone(), }) - .await, + .await + .unwrap(), } .into_output(), )) diff --git a/crates/task-system/tests/common/tasks.rs b/crates/task-system/tests/common/tasks.rs index 3d556ee07..6f27d7638 100644 --- a/crates/task-system/tests/common/tasks.rs +++ b/crates/task-system/tests/common/tasks.rs @@ -1,17 +1,22 @@ -use std::{future::pending, time::Duration}; +use std::{ + future::{pending, IntoFuture}, + time::Duration, +}; use sd_task_system::{ ExecStatus, Interrupter, InterruptionKind, IntoAnyTaskOutput, Task, TaskId, TaskOutput, }; +use async_channel as chan; use async_trait::async_trait; +use futures::FutureExt; use futures_concurrency::future::Race; use thiserror::Error; use tokio::{ sync::oneshot, time::{sleep, Instant}, }; -use tracing::{error, info}; +use tracing::{error, info, instrument}; #[derive(Debug, Error)] pub enum SampleError { @@ -215,6 +220,7 @@ impl Task for PauseOnceTask { self.id } + #[instrument(skip(self, interrupter), fields(task_id = %self.id))] async fn run(&mut self, interrupter: &Interrupter) -> Result { if let Some(began_tx) = self.began_tx.take() { if began_tx.send(()).is_err() { @@ -224,6 +230,7 @@ impl Task for PauseOnceTask { if !self.has_paused { self.has_paused = true; + info!("waiting for pause"); match interrupter.await { InterruptionKind::Pause => { info!("Pausing PauseOnceTask ", self.id); @@ -276,3 +283,59 @@ impl Task for BrokenTask { pending().await } } + +#[derive(Debug)] +pub struct WaitSignalTask { + id: TaskId, + signal_rx: chan::Receiver<()>, +} + +impl WaitSignalTask { + pub fn new() -> (Self, chan::Sender<()>) { + let (signal_tx, signal_rx) = chan::bounded(1); + ( + Self { + id: TaskId::new_v4(), + signal_rx, + }, + signal_tx, + ) + } +} + +#[async_trait] +impl Task for WaitSignalTask { + fn id(&self) -> TaskId { + self.id + } + + #[instrument(skip(self, interrupter), fields(task_id = %self.id))] + async fn run(&mut self, interrupter: &Interrupter) -> Result { + enum RaceOutput { + Signal, + Interrupt(InterruptionKind), + } + + let race = ( + self.signal_rx.recv().map(|res| { + res.unwrap(); + RaceOutput::Signal + }), + interrupter.into_future().map(RaceOutput::Interrupt), + ); + + match race.race().await { + RaceOutput::Signal => Ok(ExecStatus::Done(TaskOutput::Empty)), + RaceOutput::Interrupt(kind) => match kind { + InterruptionKind::Pause => { + info!("Paused"); + Ok(ExecStatus::Paused) + } + InterruptionKind::Cancel => { + info!("Canceled"); + Ok(ExecStatus::Canceled) + } + }, + } + } +} diff --git a/crates/task-system/tests/integration_test.rs b/crates/task-system/tests/integration_test.rs index db563754d..02c7cf6b7 100644 --- a/crates/task-system/tests/integration_test.rs +++ b/crates/task-system/tests/integration_test.rs @@ -1,4 +1,4 @@ -use sd_task_system::{TaskOutput, TaskStatus, TaskSystem}; +use sd_task_system::{TaskHandle, TaskOutput, TaskStatus, TaskSystem}; use std::{collections::VecDeque, time::Duration}; @@ -6,13 +6,16 @@ use futures_concurrency::future::Join; use rand::Rng; use tempfile::tempdir; use tracing::info; +use tracing_subscriber::EnvFilter; use tracing_test::traced_test; mod common; use common::{ actors::SampleActor, - tasks::{BogusTask, BrokenTask, NeverTask, PauseOnceTask, ReadyTask, SampleError}, + tasks::{ + BogusTask, BrokenTask, NeverTask, PauseOnceTask, ReadyTask, SampleError, WaitSignalTask, + }, }; use crate::common::jobs::SampleJob; @@ -57,7 +60,7 @@ async fn test_actor() { async fn shutdown_test() { let system = TaskSystem::new(); - let handle = system.dispatch(NeverTask::default()).await; + let handle = system.dispatch(NeverTask::default()).await.unwrap(); system.shutdown().await; @@ -69,10 +72,10 @@ async fn shutdown_test() { async fn cancel_test() { let system = TaskSystem::new(); - let handle = system.dispatch(NeverTask::default()).await; + let handle = system.dispatch(NeverTask::default()).await.unwrap(); info!("issuing cancel"); - handle.cancel().await; + handle.cancel().await.unwrap(); assert!(matches!(handle.await, Ok(TaskStatus::Canceled))); @@ -84,7 +87,7 @@ async fn cancel_test() { async fn done_test() { let system = TaskSystem::new(); - let handle = system.dispatch(ReadyTask::default()).await; + let handle = system.dispatch(ReadyTask::default()).await.unwrap(); assert!(matches!( handle.await, @@ -101,7 +104,7 @@ async fn abort_test() { let (task, began_rx) = BrokenTask::new(); - let handle = system.dispatch(task).await; + let handle = system.dispatch(task).await.unwrap(); began_rx.await.unwrap(); @@ -117,7 +120,7 @@ async fn abort_test() { async fn error_test() { let system = TaskSystem::new(); - let handle = system.dispatch(BogusTask::default()).await; + let handle = system.dispatch(BogusTask::default()).await.unwrap(); assert!(matches!( handle.await, @@ -134,7 +137,7 @@ async fn pause_test() { let (task, began_rx) = PauseOnceTask::new(); - let handle = system.dispatch(task).await; + let handle = system.dispatch(task).await.unwrap(); info!("Task dispatched, now we wait for it to begin..."); @@ -156,6 +159,83 @@ async fn pause_test() { system.shutdown().await; } +#[test] +fn many_pauses_test() { + std::env::set_var("RUST_LOG", "info,sd_task_system=error"); + + tracing_subscriber::fmt() + .with_file(true) + .with_line_number(true) + .with_env_filter(EnvFilter::from_default_env()) + .init(); + + std::thread::spawn(|| { + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(async move { + let system = TaskSystem::::new(); + + let (tasks, signalers) = (0..50) + .map(|_| WaitSignalTask::new()) + .unzip::<_, _, Vec<_>, Vec<_>>(); + + info!(total_tasks = %tasks.len()); + + let handles = system.dispatch_many(tasks).await.unwrap(); + + info!("all tasks dispatched"); + + for i in 1..=20 { + handles + .iter() + .map(TaskHandle::pause) + .collect::>() + .join() + .await; + + info!(%i, "all tasks paused"); + + handles + .iter() + .map(TaskHandle::resume) + .collect::>() + .join() + .await; + + info!(%i, "all tasks resumed"); + } + + signalers + .into_iter() + .enumerate() + .map(|(task_idx, signal_tx)| async move { + signal_tx.send(()).await.unwrap_or_else(|e| { + panic!("failed to send signal for task {task_idx}: {e:#?}") + }) + }) + .collect::>() + .join() + .await; + + info!("all tasks signaled for completion"); + + assert!(handles + .join() + .await + .into_iter() + .all(|res| matches!(res, Ok(TaskStatus::Done((_task_id, TaskOutput::Empty)))))); + + info!("all tasks done"); + + system.shutdown().await; + }) + }) + .join() + .unwrap(); +} + #[tokio::test] #[traced_test] async fn jobs_test() { @@ -182,11 +262,12 @@ async fn steal_test() { .unzip::<_, _, Vec<_>, Vec<_>>(); // With this, all workers will be busy - let mut pause_handles = VecDeque::from(system.dispatch_many(pause_tasks).await); + let mut pause_handles = VecDeque::from(system.dispatch_many(pause_tasks).await.unwrap()); let ready_handles = system .dispatch_many((0..100).map(|_| ReadyTask::default())) - .await; + .await + .unwrap(); pause_begans .into_iter() diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 5114f756f..1294af234 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -3,12 +3,11 @@ name = "sd-utils" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] # Spacedrive Sub-crates sd-prisma = { path = "../prisma" } +# Workspace dependencies prisma-client-rust = { workspace = true } rspc = { workspace = true, features = ["unstable"] } thiserror = { workspace = true } diff --git a/crates/utils/src/db.rs b/crates/utils/src/db.rs index e02df080d..edd406127 100644 --- a/crates/utils/src/db.rs +++ b/crates/utils/src/db.rs @@ -1,8 +1,11 @@ -use prisma_client_rust::{migrations::*, NewClientError}; -use sd_prisma::prisma::{self, PrismaClient}; +use prisma_client_rust::{ + migrations::{DbPushError, MigrateDeployError}, + NewClientError, +}; +use sd_prisma::prisma::PrismaClient; use thiserror::Error; -/// MigrationError represents an error that occurring while opening a initialising and running migrations on the database. +/// `[MigrationError]` represents an error that occurring while opening a initialising and running migrations on the database. #[derive(Error, Debug)] pub enum MigrationError { #[error("An error occurred while initialising a new database connection: {0}")] @@ -14,9 +17,11 @@ pub enum MigrationError { DbPushFailed(#[from] DbPushError), } -/// load_and_migrate will load the database from the given path and migrate it to the latest version of the schema. +/// `[load_and_migrate]` will load the database from the given path and migrate it to the latest version of the schema. pub async fn load_and_migrate(db_url: &str) -> Result { - let client = prisma::new_client_with_url(db_url) + let client = PrismaClient::_builder() + .with_url(db_url.to_string()) + .build() .await .map_err(Box::new)?; @@ -55,15 +60,41 @@ pub async fn load_and_migrate(db_url: &str) -> Result u64 { - u64::from_le_bytes(db_inode.try_into().expect("corrupted inode in database")) +/// Construct back an inode after storing it in database +#[must_use] +pub const fn inode_from_db(db_inode: &[u8]) -> u64 { + u64::from_le_bytes([ + db_inode[0], + db_inode[1], + db_inode[2], + db_inode[3], + db_inode[4], + db_inode[5], + db_inode[6], + db_inode[7], + ]) } +/// Constructs a database representation of an inode +#[must_use] pub fn inode_to_db(inode: u64) -> Vec { inode.to_le_bytes().to_vec() } -pub fn size_in_bytes_from_db(db_size_in_bytes: &[u8]) -> u64 { +#[must_use] +pub fn ffmpeg_data_field_to_db(field: i64) -> Vec { + field.to_be_bytes().to_vec() +} + +#[must_use] +pub const fn ffmpeg_data_field_from_db(field: &[u8]) -> i64 { + i64::from_be_bytes([ + field[0], field[1], field[2], field[3], field[4], field[5], field[6], field[7], + ]) +} + +#[must_use] +pub const fn size_in_bytes_from_db(db_size_in_bytes: &[u8]) -> u64 { u64::from_be_bytes([ db_size_in_bytes[0], db_size_in_bytes[1], @@ -76,6 +107,7 @@ pub fn size_in_bytes_from_db(db_size_in_bytes: &[u8]) -> u64 { ]) } +#[must_use] pub fn size_in_bytes_to_db(size: u64) -> Vec { size.to_be_bytes().to_vec() } @@ -93,7 +125,7 @@ impl MissingFieldError { impl From for rspc::Error { fn from(value: MissingFieldError) -> Self { - rspc::Error::with_cause( + Self::with_cause( rspc::ErrorCode::InternalServerError, "Missing crucial data in the database".to_string(), value, @@ -110,7 +142,7 @@ pub trait OptionalField: Sized { impl OptionalField for Option { type Out = T; - fn transform(self) -> Option { + fn transform(self) -> Self { self } } diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs index d8e2236b7..07a0bd20a 100644 --- a/crates/utils/src/lib.rs +++ b/crates/utils/src/lib.rs @@ -1,3 +1,32 @@ +#![warn( + clippy::all, + clippy::pedantic, + clippy::correctness, + clippy::perf, + clippy::style, + clippy::suspicious, + clippy::complexity, + clippy::nursery, + clippy::unwrap_used, + unused_qualifications, + rust_2018_idioms, + trivial_casts, + trivial_numeric_casts, + unused_allocation, + clippy::unnecessary_cast, + clippy::cast_lossless, + clippy::cast_possible_truncation, + clippy::cast_possible_wrap, + clippy::cast_precision_loss, + clippy::cast_sign_loss, + clippy::dbg_macro, + clippy::deprecated_cfg_attr, + clippy::separated_literal_suffix, + deprecated +)] +#![forbid(deprecated_in_future)] +#![allow(clippy::missing_errors_doc, clippy::module_name_repetitions)] + use uuid::Uuid; pub mod db; @@ -17,11 +46,36 @@ pub fn chain_optional_iter( .collect() } +#[inline] #[must_use] -pub fn uuid_to_bytes(uuid: Uuid) -> Vec { +pub const fn u64_to_frontend(num: u64) -> (u32, u32) { + #[allow(clippy::cast_possible_truncation)] + { + // SAFETY: We're splitting in (high, low) parts, so we're not going to lose data on truncation + ((num >> 32) as u32, num as u32) + } +} + +#[inline] +#[must_use] +pub const fn i64_to_frontend(num: i64) -> (i32, u32) { + #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + { + // SAFETY: We're splitting in (high, low) parts, so we're not going to lose data on truncation + ((num >> 32) as i32, num as u32) + } +} + +#[inline] +#[must_use] +pub fn uuid_to_bytes(uuid: &Uuid) -> Vec { uuid.as_bytes().to_vec() } +/// Converts a byte slice to a `Uuid` +/// # Panics +/// Panics if the byte slice is not a valid `Uuid` which means we have a corrupted database +#[inline] #[must_use] pub fn from_bytes_to_uuid(bytes: &[u8]) -> Uuid { Uuid::from_slice(bytes).expect("corrupted uuid in database") @@ -43,6 +97,8 @@ macro_rules! msgpack { // Only used for testing purposes. Do not use in production code. use std::any::type_name; +#[inline] +#[must_use] pub fn test_type_of(_: T) -> &'static str { type_name::() } diff --git a/docs/company/branding/logo.mdx b/docs/company/branding/logo.mdx deleted file mode 100644 index 25de14f43..000000000 --- a/docs/company/branding/logo.mdx +++ /dev/null @@ -1,3 +0,0 @@ -The file explorer from the future. - -logos, color scheme, typography diff --git a/docs/company/branding/typography.mdx b/docs/company/branding/typography.mdx deleted file mode 100644 index c972c3a80..000000000 --- a/docs/company/branding/typography.mdx +++ /dev/null @@ -1 +0,0 @@ -# Typography diff --git a/docs/company/legal/privacy.mdx b/docs/company/legal/privacy.mdx index da833ae4c..1c1539ef9 100644 --- a/docs/company/legal/privacy.mdx +++ b/docs/company/legal/privacy.mdx @@ -1,3 +1,16 @@ # Privacy Policy -_This page has yet to be written out in full. Please check back later!_ +**Effective date:** January 1st, 2024 + +Welcome to Spacedrive Technology Inc. ("Spacedrive", "we", "us", or "our"). Spacedrive is committed to protecting your privacy. This Privacy Policy outlines the types of information we may collect from you or that you may provide when you visit the website [https://spacedrive.com](https://spacedrive.com) ("Website") and our practices for collecting, using, maintaining, protecting, and disclosing that information. + +This policy applies to information we collect: + +- On this Website. +- In email, text, and other electronic messages between you and this Website. +- Through mobile, web, and desktop applications you download from this Website, which provide dedicated non-browser-based interaction between you and this Website. + +It does not apply to information collected by: + +- us offline or through any other means, including on any other website operated by Spacedrive or any third party; or +- any third party, including through any application or content (including advertising) that may link to or be accessible from the Website. diff --git a/docs/company/legal/terms.mdx b/docs/company/legal/terms.mdx index 0b3d78566..56160ffae 100644 --- a/docs/company/legal/terms.mdx +++ b/docs/company/legal/terms.mdx @@ -1,46 +1,52 @@ # Terms of Service -These terms and conditions outline the rules and regulations for the use of Spacedrive Technology Inc.'s Website, located at https://spacedrive.com. +These terms and conditions outline the rules and regulations for the use of Spacedrive Technology Inc.'s Website, located at [https://spacedrive.com](https://spacedrive.com). By accessing this website, we assume you accept these terms and conditions. Do not continue to use Spacedrive if you do not agree to take all of the terms and conditions stated on this page. -Cookies: +## Cookies + The website uses cookies to help personalize your online experience. By accessing Spacedrive, you agreed to use the required cookies. A cookie is a text file that is placed on your hard disk by a web page server. Cookies cannot be used to run programs or deliver viruses to your computer. Cookies are uniquely assigned to you and can only be read by a web server in the domain that issued the cookie to you. We may use cookies to collect, store, and track information for statistical or marketing purposes to operate our website. You have the ability to accept or decline optional Cookies. There are some required Cookies that are necessary for the operation of our website. These cookies do not require your consent as they always work. Please keep in mind that by accepting required Cookies, you also accept third-party Cookies, which might be used via third-party provided services if you use such services on our website, for example, a video display window provided by third parties and integrated into our website. -License: +## License + Unless otherwise stated, Spacedrive Technology Inc. and/or its licensors own the intellectual property rights for all material on Spacedrive. All intellectual property rights are reserved. You may access this from Spacedrive for your own personal use subjected to restrictions set in these terms and conditions. You must not: -Copy or republish material from Spacedrive -Sell, rent, or sub-license material from Spacedrive -Reproduce, duplicate or copy material from Spacedrive -Redistribute content from Spacedrive +- Copy or republish material from Spacedrive +- Sell, rent, or sub-license material from Spacedrive +- Reproduce, duplicate or copy material from Spacedrive +- Redistribute content from Spacedrive + This Agreement shall begin on the date hereof. -Hyperlinking to our Content: +## Hyperlinking to our Content + The following organizations may link to our Website without prior written approval: -Government agencies; -Search engines; -News organizations; -Online directory distributors may link to our Website in the same manner as they hyperlink to the Websites of other listed businesses; and -System-wide Accredited Businesses except soliciting non-profit organizations, charity shopping malls, and charity fundraising groups which may not hyperlink to our Web site. +- Government agencies; +- Search engines; +- News organizations; +- Online directory distributors may link to our Website in the same manner as they hyperlink to the Websites of other listed businesses; and +- System-wide Accredited Businesses except soliciting non-profit organizations, charity shopping malls, and charity fundraising groups which may not hyperlink to our Web site. + These organizations may link to our home page, to publications, or to other Website information so long as the link: (a) is not in any way deceptive; (b) does not falsely imply sponsorship, endorsement, or approval of the linking party and its products and/or services; and (c) fits within the context of the linking party's site. We may consider and approve other link requests from the following types of organizations: -commonly-known consumer and/or business information sources; -dot.com community sites; -associations or other groups representing charities; -online directory distributors; -internet portals; -accounting, law, and consulting firms; and -educational institutions and trade associations. +- Commonly-known consumer and/or business information sources; +- Dot.com community sites; +- Associations or other groups representing charities; +- Online directory distributors; +- Internet portals; +- Accounting, law, and consulting firms; and +- Educational institutions and trade associations. + We will approve link requests from these organizations if we decide that: (a) the link would not make us look unfavorably to ourselves or to our accredited businesses; (b) the organization does not have any negative records with us; (c) the benefit to us from the visibility of the hyperlink compensates the absence of Spacedrive Technology Inc.; and (d) the link is in the context of general resource information. These organizations may link to our home page so long as the link: (a) is not in any way deceptive; (b) does not falsely imply sponsorship, endorsement, or approval of the linking party and its products or services; and (c) fits within the context of the linking party's site. @@ -49,29 +55,35 @@ If you are one of the organizations listed in paragraph 2 above and are interest Approved organizations may hyperlink to our Website as follows: -By use of our corporate name; or -By use of the uniform resource locator being linked to; or -Using any other description of our Website being linked to that makes sense within the context and format of content on the linking party's site. +- By use of our corporate name; or +- By use of the uniform resource locator being linked to; or +- Using any other description of our Website being linked to that makes sense within the context and format of content on the linking party's site. + No use of Spacedrive Technology Inc.'s logo or other artwork will be allowed for linking absent a trademark license agreement. -Content Liability: +## Content Liability + We shall not be held responsible for any content that appears on your Website. You agree to protect and defend us against all claims that are raised on your Website. No link(s) should appear on any Website that may be interpreted as libelous, obscene, or criminal, or which infringes, otherwise violates, or advocates the infringement or other violation of, any third party rights. -Reservation of Rights: +## Reservation of Rights + We reserve the right to request that you remove all links or any particular link to our Website. You approve to immediately remove all links to our Website upon request. We also reserve the right to amend these terms and conditions and its linking policy at any time. By continuously linking to our Website, you agree to be bound to and follow these linking terms and conditions. -Removal of links from our website: +## Removal of links from our website + If you find any link on our Website that is offensive for any reason, you are free to contact and inform us at any moment. We will consider requests to remove links, but we are not obligated to or so or to respond to you directly. We do not ensure that the information on this website is correct. We do not warrant its completeness or accuracy, nor do we promise to ensure that the website remains available or that the material on the website is kept up to date. -Disclaimer: +## Disclaimer + To the maximum extent permitted by applicable law, we exclude all representations, warranties, and conditions relating to our website and the use of this website. Nothing in this disclaimer will: -limit or exclude our or your liability for death or personal injury; -limit or exclude our or your liability for fraud or fraudulent misrepresentation; -limit any of our or your liabilities in any way that is not permitted under applicable law; or -exclude any of our or your liabilities that may not be excluded under applicable law. +- Limit or exclude our or your liability for death or personal injury; +- Limit or exclude our or your liability for fraud or fraudulent misrepresentation; +- Limit any of our or your liabilities in any way that is not permitted under applicable law; or +- Exclude any of our or your liabilities that may not be excluded under applicable law. + The limitations and prohibitions of liability set in this Section and elsewhere in this disclaimer: (a) are subject to the preceding paragraph; and (b) govern all liabilities arising under the disclaimer, including liabilities arising in contract, in tort, and for breach of statutory duty. As long as the website and the information and services on the website are provided free of charge, we will not be liable for any loss or damage of any nature. diff --git a/docs/product/guides/actions.mdx b/docs/developers/architecture/actions.mdx similarity index 100% rename from docs/product/guides/actions.mdx rename to docs/developers/architecture/actions.mdx diff --git a/docs/developers/architecture/albums.mdx b/docs/developers/architecture/albums.mdx deleted file mode 100644 index 013ac14eb..000000000 --- a/docs/developers/architecture/albums.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -index: 10 ---- - -# Albums - -you can put photos here diff --git a/docs/developers/architecture/extensions.mdx b/docs/developers/architecture/extensions.mdx deleted file mode 100644 index 8033bbd27..000000000 --- a/docs/developers/architecture/extensions.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -index: 10 ---- - -# Extensions - -Extensions are planned but nothing is yet set in stone. diff --git a/docs/developers/architecture/jobs.mdx b/docs/developers/architecture/jobs.mdx index 4eb8e7b4a..fa541bcf1 100644 --- a/docs/developers/architecture/jobs.mdx +++ b/docs/developers/architecture/jobs.mdx @@ -4,4 +4,14 @@ index: 10 # Jobs -jobs are computation tasks performed by nodes in a Spacedrive network, they can be created by any node and performed by any or all nodes. +Spacedrive's job system is designed to handle any tasks that might take time to complete, such as indexing files and generating thumbnails. + +A small indicator is shown in the bottom left when a job is running; clicking it reveals the job manager. + +The job manager allows you to see current jobs, expand them to see various tasks part of that job. Jobs with only one task, such as copying a single file, will not be expandable by clicking. + +Jobs can be paused, resumed and canceled. Spacedrive will always try to restart jobs that were cut off by a restart or shutdown of Spacedrive. + +Job history can be cleared by hitting the small trash icon on the job manager. This will not remove any ongoing jobs. + +Up to 3 jobs can run simultaneously, although this may be configurable in the future. More CPU-intensive jobs like thumbnailing and labelling have an upper limit for CPU usage set in the General settings page. diff --git a/docs/developers/architecture/libraries.mdx b/docs/developers/architecture/libraries.mdx index e152faf11..688b49b10 100644 --- a/docs/developers/architecture/libraries.mdx +++ b/docs/developers/architecture/libraries.mdx @@ -8,4 +8,23 @@ A library is the database that Spacedrive stores all file structures and metadat To learn how data is synchronized check out the documentation on [Sync](/docs/developers/architecture/sync). +You must create a library to use Spacedrive. Users can also choose to create more librariesm, such as ones specifically for work. Spacedrive will run all your libraries in unison. + +Library data is never mixed or shared, even if two libraries are tracking the same Location. + +## Exporting a library + +## Encrypting a Library + Libraries can be encrypted with a passphrase set by the user. + + + +You can encrypt a Library by clicking the Lock icon button in the Library Settings. Once you have set a master password, the Library will be encrypted. If a library is locked, you will be prompted to enter the password when you try to open it. You can set an expiration time for the password, after which you will be prompted to enter it again. + +When a library is encrypted, the data is encrypted on disk, but the files themselves are not encrypted. This means that if you have a library that is not encrypted, and you encrypt it, the files will not be re-encrypted, only the metadata will be encrypted. + +If you wish to learn about encrypting files, see [File Encryption](#). diff --git a/docs/developers/architecture/search.mdx b/docs/developers/architecture/search.mdx index 4994d6583..45de86f0c 100644 --- a/docs/developers/architecture/search.mdx +++ b/docs/developers/architecture/search.mdx @@ -3,11 +3,3 @@ index: 11 --- # Search - -Press CTRL+F while on a Spacedrive window to access search. - -By default you will search the active library, however by checking "Search all Libraries" you can perform a simultaneous search of all libraries loaded on a Node. - -Search results return Objects, Locations, Albums, Tags and Spaces - -Search can be filtered by `ObjectKind`, as well as dates. diff --git a/docs/developers/architecture/spaces.mdx b/docs/developers/architecture/spaces.mdx index bced47286..0383723e7 100644 --- a/docs/developers/architecture/spaces.mdx +++ b/docs/developers/architecture/spaces.mdx @@ -4,8 +4,20 @@ index: 5 # Spaces -Spaces are virtual folders that can be shared publicly on the internet, or privately with friends, family and teams. Spaces contain [Objects](/docs/developers/architecture/objects) which can be physically stored on any connected Node, or by Spacedrive as a service. Objects can be organized and presented spatially, with various layouts and variable grid placements. Color theme, icon packs and typography can be customized per Space. +Spaces are virtual folders that can be shared publicly on the internet, or privately with friends, family and teams. Spaces contain [Objects](/docs/developers/architecture/objects) which can be hosted by any connected Node, or by Spacedrive as a service. -Objects can be added to a Space manually, or by matching a defined ruleset, similar to Tags. +Spaces can be shared with a unique URL, and can be embedded in websites, blogs and social media. Example: [sd.space/username/space](#). -Spacedrive comes with pre-defined Spaces, such as: photos, videos, screenshots, documents. +Objects can be added to a Space manually, or by matching a defined ruleset, similar to Tags. This mechanism is also used for the default Spaces such as favorites, photos, videos, documents and screenshots. Photos, being a Space, means that albums can be nested and contain various Object kinds. + +Spaces allow for permissions, which can be set to read-only, read-write, or read-write-delete for the entire Space, or per Object. + +When syncing a Space a folder is created somewhere on the user's system to sync the physical contents of the Space. This can be in the data folder of Spacedrive or at a path of the users choice. Metadata is ingested into the library + +Viewing a Space online or even opening it in the app will not add it to your Library. You must explicitly click "Add Space to Library" to sync it's contents, to which you can optionally configure the parameters. + +It is possible to put Tags and Locations and other strucured data models into a Space, in this case we will create an Object to represent it and handle syncing the Location, Tag or even another Space though a dedicated handler. For example when a foreign Location is loaded into a Space, we will sync the Location with their library, but it will be owned by the Space itself, meaning if the Space is removed so is the Location if it does not belong in the given Library. + +Spaces will be AI native, using our custom embedding architecture, we can dynamically embed an associated vector database, pre-generated by Spacedrive tailored specifically to that Space to enable AI features such as chat, deep search and workflows. + +In the future, Objects can be organized and presented spatially, with various layouts and variable grid placements. Color themes, icon packs and typography can be customized per Space. diff --git a/docs/developers/architecture/sync.mdx b/docs/developers/architecture/sync.mdx index 587f6db7d..bf298f737 100644 --- a/docs/developers/architecture/sync.mdx +++ b/docs/developers/architecture/sync.mdx @@ -4,8 +4,8 @@ index: 12 # Sync -Spacedrive synchronizes data using a combination of master-slave replication and last-write-wins CRDTs, -with the synchronization method encoded into the Prisma schema using [record type attributes](#record-types). +Spacedrive synchronizes libraries by treating SQLite cells as last-write-wins CRDTs, +with sync metadata about each model being encoded into Prisma schema using [model attributes](#model-types). In the cases where LWW CRDTs are used, conflicts are resolved using a [Hybrid Logical Clock](https://github.com/atolab/uhlc-rs) @@ -14,12 +14,12 @@ to determine the ordering of events. We would be remiss to not credit credit [Actual Budget](https://actualbudget.com/) with many of the CRDT concepts used in Spacedrive's sync system. -## Record Types +## Model Types All data in a library conforms to one of the following types. Each type uses a different strategy for syncing. -### Local Records +### Local Local records exist entirely outside of the sync system. They don't have Sync IDs and never leave the node they were created on. @@ -28,63 +28,71 @@ Used for Nodes, Statistics, and Sync Events. `@local` -### Owned Records - -Owned records are only ever modified by the node they are created by, -so they can be synced in a master-slave fashion. -The creator of an owned record dictates the state of the record to other nodes, -who will simply accept new changes without considering conflicts. - -File paths are owned records since they only exist on one node, -and that node can inform all other nodes about the correct state of the paths. - -Used for Locations, Paths, and Volumes. - -`@owned(owner: String, id?: String)` - -- `owner` - Field that identifies the owner of this model. - If a scalar, will directly use that value in sync operations. - If a relation, the Sync ID of the related model will be resolved for sync operations. -- `id` - Scalar field to override the default Sync ID. - -### Shared Records +### Shared Shared records encompass most data synced in the CRDT fashion. Updates are applied per-field using a last-write-wins strategy. Used for Objects, Tags, Spaces, and Jobs. -`@shared(create: SharedCreateType, id?: String)` +`@shared(id?: String, modelId: Int)` - `id` - Scalar field to override the default Sync ID. -- `create` - How the model should be created. - - `Unique` (default): Model can be created with many required arguemnts, - but ID provided _must_ be unique across all nodes. - Useful for Tags since their IDs are non-deterministic. - - `Atomic`: Require the model to have no required arguments apart from ID and apply all create arguments as atomic updates. - Necessary for models with the same ID that can be created on multiple nodes. - Useful for Objects since their ID is dependent on their content, - and could be the same across nodes. +- `modelId` - Integer to identify the model by. Helps save on bandwidth and storage as opposed to storing model names as strings. -### Relation Records +### Relation Similar to shared records, but represent a many-to-many relation between two records. Sync ID is the combination of `item` and `group` Sync IDs. Used for TagOnFile and FileInSpace. -`@relation(item: String, group: String)` +`@relation(item: String, group: String, modelId: Int)` - `item` - Field that identifies the item that the relation is connecting. - Similar to the `owner` argument of `@owned`. - `group` - Field that identifies the group that the item should be connected to. - Similar to the `owner` argument of `@owned`. + - `modelId` - Integer to identify the model by. Helps save on bandwidth and storage as opposed to storing model names as strings. -## Other Prisma Attributes +## Sync Actors -`@node` +The sync system is comprised of a number of actors that send, receive, and ingest sync operations. -Indicates that a relation field should be set to the current node. -This could be done manually, -but `@node` allows `node_id` fields to be resolved from the `node_id` field of a `CRDTOperation`, -saving on bandwidth +### Ingest + +The most important of these is the +[ingest actor](https://github.com/spacedriveapp/spacedrive/blob/main/core/crates/sync/src/ingest.rs). +Its existence entirely independent of both the core and the cloud sync actors allows it to be interacted with by many different systems, +while ensuring that only one process is responsible for providing it with operations to ingest at a time. + +Its work loop goes something like this: + +- Wait for a notification that new sync operations are available to ingest +- Request new operations from whatever process holds the communication channel with the ingester. + - This request is accompanied by timestamps of the last operation ingested for each instance of the library, to be used to fetch only the latest necessary sync operations. + - If the communication channel is dropped, the work loop will restart +- Ingested the sync operations in batches distinguished by instance, model, and record id + - If the batch contains a `Delete`, all other operations are ignored and the record is deleted. + - If the batch contains a `Create`, all `Update` operations are applied on top of it to reduce database load. + - If the batch only contains `Update` operations, they are applied on top of a fake `Create` operation to reduce datbase load. + - The latest timestamp of the instance is updated to the timestamp of the last operation ingested. +- Return to the beginning, waiting for a notification of new operations + +### Cloud Send/Receive/Ingest + +Each of these play a different role in getting sync operations to and from the cloud, and into the ingest actor. + +#### [Send](https://github.com/spacedriveapp/spacedrive/blob/main/core/src/cloud/sync/send.rs) + +When new sync operations are created on an instance will attempt to obtain a lock on cloud sync operations for that particular instance, +and will upload them as a compressed base64 format. + +The lock on cloud sync operations is necessary to prevent multiple processes from attempting to upload operations at the same time, +and is implemented as a short-expiry redis entry. + +#### [Receive](https://github.com/spacedriveapp/spacedrive/blob/main/core/src/cloud/sync/receive.rs) + +Downloads sync operations from the cloud periodically, and stores them in the `cloud_crdt_operation` table. + +#### [Ingest](https://github.com/spacedriveapp/spacedrive/blob/main/core/src/cloud/sync/ingest.rs) + +Reads sync operations from the `cloud_crdt_operation` table, and sends them to the ingest actor. diff --git a/docs/developers/architecture/vdfs.mdx b/docs/developers/architecture/vdfs.mdx index 8035a5b0b..2f7d5cad1 100644 --- a/docs/developers/architecture/vdfs.mdx +++ b/docs/developers/architecture/vdfs.mdx @@ -11,5 +11,9 @@ A virtual filesystem is simply a layer of abstraction between a physical filesys ## How it works Spacedrive defines a VDFS under the following data model; A Library, Nodes, Volumes, Locations, Paths and Objects. +- A node is a single machine running the VDFS software. +- It syncronizes a CRDT based database, called the Library, with other nodes in the network. +- The library consists of Locations, found on Volumes, +- These contain Paths to files on the underlying filesystem. -A node is a single machine running the VDFS software, it syncronizes a CRDT based database, called the Library, with other nodes in the network. The library consists of Locations, found on Volumes, which contain Paths to files on the underlying filesystem. +Objects are unique representations of files sorted by a sampled hash called a "cas_id" which stands for "Content Addressable Storage Identifier". Additional metadata like tags and comments are tied to the Objects. Folders are not assigned to objects by default, but if a tag is assigned then an Object is created to accomedate. diff --git a/docs/developers/p2p/discovery.mdx b/docs/developers/p2p/discovery.mdx new file mode 100644 index 000000000..57a0a58d4 --- /dev/null +++ b/docs/developers/p2p/discovery.mdx @@ -0,0 +1,36 @@ +--- +title: Discovery +index: 25 +--- + +# Discovery + +Discovery is the process of finding other nodes to connect with. + +We do this through the following 3 systems: + - Manual entry by the user + - [Local Network Discovery](/docs/developers/p2p/local-network-discovery) via mDNS + - [Relay](/docs/developers/p2p/relay) via mDNS + +## Overview of methods + +From a technical perspective all of these methods operate very differently so it's important to understand the differences between them when making changes to the P2P system. + +The relay and manual entry method both require the P2P system to be given an upfront list of peers to connect to, whereas the mDNS system is able to discover them itself. For the relay these peers comes from the instances table in the database and for manual entry these peers comes from the node configuration file. + +A quirk manual entry is that when we attempt a connection we don't know the remote nodes identity or metadata prior to connecting. We instead establish a full connection to ask for remote nodes information (`RemoteIdentity` and metadata) after which we treat it as discovered. + +This table summarises the differences between the methods: + +| | mDNS | Relay | Manual | +|-------------------------------------------------------------------------|---------|----------|-----------| +| Requires upfront knowledge of existence of peer | No | Yes | Yes | +| Knows connection info (metadata, RemoteIdentity) ahead of connection | Yes | Yes | No | + +## Manually provided peers + +The user can manually provide a set of [`SocketAddr`](https://doc.rust-lang.org/std/net/enum.SocketAddr.html)'s or [FQDN](https://en.wikipedia.org/wiki/Fully_qualified_domain_name)'s and the P2P system will attempt to connect to them. If a domain is provided the P2P system will resolve it to an IP address and then attempt to connect to that address. + +This feature primarily exists for usage with Docker as mDNS discovery does not work correctly, however it could be useful for working around difficult network setups. It's important to note that you *must* use [port forwarding](https://en.wikipedia.org/wiki/Port_forwarding) and set a static port for the node when using this feature. + +When you add a manual peer it will *not* show up in the nodes list until the P2P system is able to establish a connection. This is because without having established a connection the system is unable to determine the remote nodes identity or metadata which is required for it to be considered discovered. diff --git a/docs/developers/p2p/local-network-discovery.mdx b/docs/developers/p2p/local-network-discovery.mdx new file mode 100644 index 000000000..beb1a0887 --- /dev/null +++ b/docs/developers/p2p/local-network-discovery.mdx @@ -0,0 +1,91 @@ +--- +title: Local Network Discovery +index: 26 +--- + +# Local Network Discovery + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/crates/p2p/src/hooks/mdns.rs) + +Our local network discovery uses [DNS-Based Service Discovery](https://www.rfc-editor.org/rfc/rfc6763.html) which itself is built around [Multicast DNS (mDNS)](https://datatracker.ietf.org/doc/html/rfc6762). This is a really well established technology and is used in [Spotify Connect](https://support.spotify.com/au/article/spotify-connect/), [Apple Airplay](https://www.apple.com/au/airplay/) and many other services you use every day. + +We make use of the [mdns-sd](https://docs.rs/mdns-sd) crate. + +## Service Structure + +The following is an example of what would be broadcast from a single Spacedrive node: +```toml +# {remote_identity_of_self}._sd._udp.local. + +name=Oscars Laptop # Shown to the user to select a device +operating_system=macos # Used for UI purposes +device_model=MacBook Pro # Used for UI purposes +version=0.0.1 # Spacedrive version + +# For each library that's active on the Spacedrive node: +# {library_uuid}={remote_identity_of_self} +d66ed0c3-03ac-4f9b-a374-a927830dfd5b=0l9vTOWu+5aJs0cyWxdfJEGtloEepGRAXcEuDeTDRPk +``` + +Within `sd-core` this is defined in two parts. The [`PeerMetadata` struct](https://github.com/spacedriveapp/spacedrive/blob/44478207e72495b3777e294660d78939711b544f/core/src/p2p/metadata.rs#L9) takes care of the node metadata and libraries are inserted by the [`libraries_hook`](https://github.com/spacedriveapp/spacedrive/blob/44478207e72495b3777e294660d78939711b544f/core/src/p2p/libraries.rs#L13). + +## Modes + + + +Within Spacedrive's settings the user is able to choose between three modes for local network discovery: + - **Contacts only**: Only devices that are in your contacts list will be able to see your device. + - **Enabled**: All devices on the local network will be able to see your device. + - **Disabled**: No devices on the local network will be able to see your device. + +**Enabled** and **Disabled** are implemented by spawning and shutting down the [`sd_p2p::Mdns`](https://github.com/spacedriveapp/spacedrive/blob/44478207e72495b3777e294660d78939711b544f/crates/p2p/src/mdns.rs#L17) service as required within `sd-core`. + +**Contacts only** the mDNS service will not contain the [`PeerMetadata`](https://github.com/spacedriveapp/spacedrive/blob/44478207e72495b3777e294660d78939711b544f/core/src/p2p/metadata.rs#L9) fields and instead will contain a hash of the users Spacedrive identifier. If a Spacedrive node detects another node in the local network with a hash in it's contacts, it can make a request to the node and if the remote node also has the current node in it's contacts, it will respond with the full metadata. + +## Integration with Spacedrive accounts + +P2P is currently *not* integrated with Spacedrive accounts and we will integrate it in the future for better security. + +Right now we use a remote identity to identify the remote device, however tihs is not very user friendly. If a [MITM](https://en.wikipedia.org/wiki/Man-in-the-middle_attack)-style attack is preformed the remote identity will show up with the attacker's device but this isn't going to be particularly noticable by the user. + +To combat this issue we can integrate with Spacedrive accounts so the user can be presented with the users name and verified email. This allows the user to prove the remote device is who they expect in a more user friendly way. + +The Spacedrive account information will need to be put into the peer metadata and we can use cryptographic signatures to verify the account is linked with the remote device without a network connection. + +This issue is tracked as [ENG-1758](https://linear.app/spacedriveapp/issue/ENG-1758/p2p-🤝-spacedrive-accounts) + +## Problems with Docker + +Docker can be problematic with P2P due to it applying another level of [NAT](https://en.wikipedia.org/wiki/Network_address_translation). This shouldn't cause any issues for usage with the relay but it makes mDNS cease to work. + +It is possible to [expose the mDNS daemon](https://medium.com/@andrejtaneski/using-mdns-from-a-docker-container-b516a408a66b) of the host machine into the container, and we could potentially implement something similar, however it's unclear if [`mdns-sd`](https://docs.rs/mdns-sd) uses the OS's daemon and if `avahi` is used by all host Linux distributions we want to support. + +When `sd-server` is run from Docker the `Dockerfile` sets the environment variable `SD_DOCKER=true` which is picked up by the core and it exposes P2P on port `7373` instead of a random port like the default configuration. + +This allows the administrator to use the `-p 7373:7373` flag when running the container to expose the P2P port to the host machine. This can then be paired with manually entering the IP address and port of the node into the P2P settings of the other node and a connection can be established. Although this is suboptimal, it serves as an alternative for the time being. + +This issue is tracked as [ENG-1343](https://linear.app/spacedriveapp/issue/ENG-1343/docker-support-for-p2p). + +## Problems with mobile + +mDNS discovery does not work on mobile at the moment. To prevent this affecting other devices, we patch [`if-watch`](https://docs.rs/if-watch) using the fork [spacedriveapp/if-watch](https://github.com/spacedriveapp/if-watch). This fork basically implements a *no-op* for mobile so that the core is able to compile. + +This issue is tracked as [ENG-1108](https://linear.app/spacedriveapp/issue/ENG-1108/mdns-working-on-ios). + +## Problems on Linux + +It was reported on Discord that opening Spacedrive would cause excessive network activity. This is possibly a bug with the mDNS system; it was not able to be reproduced on macOS. + +This issue is tracked as [ENG-1319](https://linear.app/spacedriveapp/issue/ENG-1319/excessive-mdns-pings). + +## Tracking + +When information about the device is exposed to the local network we introduce the risk that this information is used for tracking users. + +The intention is for the contacts only mode to mitigate this risk as the device will only be discoverable by other devices that are in the users contacts and all information will be unintelligible. + +Apple outline some information about how they combat this for AirDrop [here](https://support.apple.com/en-au/guide/security/sec2261183f4/web) and we can do something similar. + diff --git a/docs/developers/p2p/overview.mdx b/docs/developers/p2p/overview.mdx new file mode 100644 index 000000000..d1c51098f --- /dev/null +++ b/docs/developers/p2p/overview.mdx @@ -0,0 +1,22 @@ +--- +title: overview +index: 20 +--- + +# Peer-to-peer + +Our peer-to-peer technology works at the heart of Spacedrive allowing all of your devices to seamlessly communicate and share data. This documentation outlines the system's design and how to use it. + +## Terminology + + - **Node**: An application running Spacedrive's network stack. + - This could be the Spacedrive app or the P2P relay. + - If you have multiple Spacedrive installations open on your computer, each one is an independent node. + - **Library**: A logical collection of your data within Spacedrive. + - Conceptually, a library is the conflict resolved state of one or more **instances**, although a lot of the time we don't strictly treat it that way. + - **Instance**: An instance of a library running on a particular node. + - An instance correlates directly to each SQLite file. + - You could *technically* have more than one instance for a library on a single node, although our core would fall apart as we identify traffic by library. + - [`Identity`](https://github.com/spacedriveapp/spacedrive/blob/518d5836f6585a5f597c3ae5a0d27d084adc0a63/crates/p2p/src/identity.rs#L29) - A public/private keypair which represents the library or node. + - [`RemoteIdentity`](https://github.com/spacedriveapp/spacedrive/blob/518d5836f6585a5f597c3ae5a0d27d084adc0a63/crates/p2p/src/identity.rs#L70) - A public key which represents the library or node. + - [`PeerId`](https://docs.rs/libp2p/latest/libp2p/struct.PeerId.html) - The identifier libp2p uses. Can be derived from a `RemoteIdentity`. diff --git a/docs/developers/p2p/protocols.mdx b/docs/developers/p2p/protocols.mdx new file mode 100644 index 000000000..00fd6ce53 --- /dev/null +++ b/docs/developers/p2p/protocols.mdx @@ -0,0 +1,79 @@ +--- +title: Protocols +index: 29 +--- + +# Protocols + +## Ping + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/core/src/p2p/operations/ping.rs) + +We have the implementation of a basic ping protocol. This is not actually used within Spacedrive but acts a reference for implementing a new protocol. + +## Spacedrop + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/core/src/p2p/operations/spacedrop.rs) + +Spacedrop is a system for sending files quickly to other peers. It is intended for sending to peers that have not been paired into the library. It is great for sending a file to a friend on your same network running Spacedrive but you can use the regular file manager for sharing a file without another node in your library. + +This protocol works but some of the following are missing features: + - Pause/resumable transfers + - Transfer a folder - [ENG-1297](https://linear.app/spacedriveapp/issue/ENG-1297/spacedrop-create-folder-button-in-save-dialog-for-multiple-file) + - Usage with `sd-server` will result in bugs if you have multiple web clients - [ENG-1034](https://linear.app/spacedriveapp/issue/ENG-1034/spacedrop-on-multi-user-server-will-break) and [ENG-1522](https://linear.app/spacedriveapp/issue/ENG-1522/spacedrop-on-web) + +The following are known bugs: + - [ENG-1298](https://linear.app/spacedriveapp/issue/ENG-1298/spacedrop-cancel-prior-to-toast) + - [ENG-1035](https://linear.app/spacedriveapp/issue/ENG-1035/spacedrop-show-toast-while-waiting-for-remote-to-acceptdeny-response) + - [ENG-1203](https://linear.app/spacedriveapp/issue/ENG-1203/spacedrop-ui-handle-timeouts) + - [ENG-1211](https://linear.app/spacedriveapp/issue/ENG-1211/spacedrop-what-if-file-content-changes-while-sending) + +## rspc + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/core/src/p2p/operations/rspc.rs) + +This protocol was an experiment to expose the rspc router of a node over P2P. Although it works this is a security nightmare so it has been disabled by default and hidden behind the `wipP2P` feature flag. + +How to test this feature: + - Enable the `wipP2P` feature flag + - Enable the feature within the network page of settings + - Ensure "Enable remote acccess" is enabled on both nodes + - Click the "rspc remote" button on the node you want to connect to. + - If the connection fails you will be presented with a white screen, otherwise you will be given a library selection and once seleted you will be given Spacedrive UI running on the remote node. + +Major problems with this feature: + - This protocol doesn't have any security (hence it being disabled by default). It's also a nightmare to secure as it's full access (including to do filesystem actions) or no access. - [ENG-1646](https://linear.app/spacedriveapp/issue/ENG-1646/rspc-over-p2p-handle-condition-in-ui-of-remote-offline-node) + - The rspc websocket connection established over the P2P system is leaked so it will never be cleaned up. Fixing this would require changes to rspc. - [ENG-1647](https://linear.app/spacedriveapp/issue/ENG-1647/stop-leaking-rspc-p2p-websockets) + - Any usage of rspc outside the React context will still be using the local node's rspc router. We don't do this often but we definitely do it. - [ENG-1648](https://linear.app/spacedriveapp/issue/ENG-1648/prevent-any-usage-of-rspc-out-of-the-react-context) + +From my ([oscartbeaumont](https://github.com/oscartbeaumont)'s) perspective this was a cool experiment but not something we should ship because getting it's nightmare to get security right. + +## Sync + +[Implementation](https://github.com/spacedriveapp/spacedrive/blob/main/core/src/p2p/sync/mod.rs) + +This protocol takes care of sending sync messages between nodes. This is an alternative to the Cloud-based system. + +This protocol uses [`sd_p2p_tunnel::Tunnel`](/docs/developers/p2p/sd_p2p_tunnel) so ensure the recipient is paired into the library. + +## Loading thumbnails and files remotely + +[Implementation](https://github.com/spacedriveapp/spacedrive/blob/main/core/src/p2p/operations/library.rs) + +This protocol takes care of loading both thumbnails and files remotely. This is used when the media is not available on the local mode. + +This protocol transparently extends the custom URI protocol and uses information in the database to determine the node responsible for the file. + +This protocol uses [`sd_p2p_tunnel::Tunnel`](/docs/developers/p2p/sd_p2p_tunnel) so ensure the recipient is paired into the library. + +### Design issues + +Right now the system relies on the `instance_id` column on the `Location` to table to determine which node to route the media request to. This is a suboptimal solution as a location may move nodes, a good example of this is a USB drive. + +A better design would be to have an in-memory table of `HashMap` and then using another P2P protocol which sends a message to all connected nodes when a location comes online/offline on the current node. + +## Sync preview media + +Unimplemented + +Tracked by [ENG-910](https://linear.app/spacedriveapp/issue/ENG-910/sync-preview-media) diff --git a/docs/developers/p2p/relay.mdx b/docs/developers/p2p/relay.mdx new file mode 100644 index 000000000..3a81d870b --- /dev/null +++ b/docs/developers/p2p/relay.mdx @@ -0,0 +1,106 @@ +--- +title: relay +index: 27 +--- + +# Relay + +To establish connections outside of your local network we rely on an external relay to help with coordinating connections and also to proxy traffic between peers if the network conditions are not favourable. + +## Implementation + +We make use of [libp2p](https://libp2p.io)'s [Direct Connection Upgrade through Relay](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md) and [Circuit Relay](https://github.com/libp2p/specs/blob/master/relay/README.md) protocols for our relay system. + +[Client Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/crates/p2p/src/hooks/quic/transport.rs) +· +[Server Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/apps/p2p-relay) + +## Relay discovery + +Each client will regularly make requests to [https://app.spacedrive.com/api/p2p/relays](https://app.spacedrive.com/api/p2p/relays) to get the list of currently active relay servers. + +Each relay server will register itself with the discovery server automatically when started. This requires an authentication token so it can only be done by Spacedrive ran servers. + +We store the relays in Redis with a TTL. This is so if the relay server is shutdown and does not do its regular check-in, it will be automatically removed from the pool. + +## How it works + +We register a listen for each relay that is returned from the discovery server. When a connection is established we will attempt to connect to the relay server. We also attempt to establish connections with peers that we already know about through the active libraries. + +Currently we connect to every relay server that is returned from the discovery server. This is obviously not ideal but if two nodes were to connect to the different relay servers we would need some way of communicating between them (which is a complicated problem to solve). + +The issue of connecting to every relay server is tracked as [ENG-1672](https://linear.app/spacedriveapp/issue/ENG-1672/mesh-relays). + +## Connection upgrades + +The relay will attempt to upgrade the connection between any peers to a direct connection if possible. If the firewall conditions are too challenging the relay will proxy the encrypted traffic between the two peers as a fallback. + +## Authentication + +Currently the relay service is completly unauthenticated. To prevent abuse we are planning to restrict the relays to Spacedrive accounts. + +libp2p doesn't have a ready-made solution for this as it's heavily designed around the [IPFS](https://ipfs.tech) usecase which is all open. This will likely require a custom network behavior to be implemented in libp2p which will be a decent undertaking. + +This issue is tracked as [ENG-1652](https://linear.app/spacedriveapp/issue/ENG-1652/relay-authentication). + +## Billing + +Currently the relay service has no method of tracking usage based on the connected peers. + +libp2p doesn't have a ready-made solution for this as it's heavily designed around the [IPFS](https://ipfs.tech) use case, which is all open. This will likely require a custom network behavior to be implemented in libp2p which will be a decent undertaking. + +This issue is tracked as [ENG-1667](https://linear.app/spacedriveapp/issue/ENG-1667/relay-metering). + +## Rate limiting + +We should rate limit connection being opened with the Relay to ensure denial of service attacks for not possible. + +libp2p has a built-in [RateLimiter](https://docs.rs/libp2p/latest/libp2p/relay/trait.RateLimiter.html) trait which we can implement. The rate limiting information should be stored to Redis so it shared between all relays. + +## Alternative design + +Our relay system is currently built on top of [libp2p](https://libp2p.io)'s system for relays. Given all of the limitations of the current design discussed above I don't think libp2p's relay system was really designed for private relays so it could be worth dropping it entirely and investigating another solution. + +I have done some digging into [WebRTC](https://webrtc.org) (specially [STUN](https://en.wikipedia.org/wiki/STUN) and [TURN](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT)) and it does seem like a really solid alternative. + +Given the core of the `sd_p2p` crate is decoupled from libp2p we could easily implement an alternative connection system based on WebRTC while keeping libp2p for the quic-based transport for local networks. + +The major advantage to using WebRTC would be the ability to use a SaSS solution for hosting the relay infrastructure. WebRTC is based on [STUN](https://en.wikipedia.org/wiki/STUN) and [TURN](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT) which are very ubiquitous protocols. The following is a comparison of some webrtc services: + +| | Pricing (per GB ) | Has Billing API | +|-------------------------------------------------------------------|-------------------|-----------------| +| [Cloudflare Calls](https://developers.cloudflare.com/calls/turn/) | 0.05$ | No | +| [Twilio](https://www.twilio.com/stun-turn) | 0.40$ to 0.80$ | No | +| [Metered](https://www.metered.ca/stun-turn) | 0.40$ to 0.10$ | Yes | + +WebRTC also has a built in system for authentication via the SDP object that needs to be exchanged between peers for a valid connection to be established. For an explaination of webrtc checkout [this Fireship video](https://www.youtube.com/watch?v=WmR9IMUD_CY). + +libp2p *does* have a [WebRTC transport](https://docs.rs/libp2p-webrtc/0.7.1-alpha) but it seems to be only for browser to server communication not server to server like we require so I don't think it would be viable for our usecase. + +### Security + +The relay works through encrypted communication so we can not read the data that is being relayed. The relay servers currently must be owned by Spacedrive to work, however it's possible we can allow the community to run their own relays in the future. + +### Hosting the Relay server + + + +1. Set up the server using the following command: + + ```bash + cargo run -p sd-p2p-relay init + # You will be prompted to enter the p2p secret. + # It can be found in the `spacedrive-api` Vercel project as the `P2P_SECRET` environment variable. + ``` + +2. Now that you have set up the server, you can run the relay server using the following command: + + ```bash + cargo run -p sd-p2p-relay + ``` + +*Note that you will need to ensure port `7373` is exposed through your firewall for this to work.* + diff --git a/docs/developers/p2p/sd_p2p.mdx b/docs/developers/p2p/sd_p2p.mdx new file mode 100644 index 000000000..791b4c77d --- /dev/null +++ b/docs/developers/p2p/sd_p2p.mdx @@ -0,0 +1,34 @@ +--- +title: sd-p2p +index: 22 +--- + +# `sd_p2p` crate + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/crates/p2p) + +The P2P crate was designed from the ground up to be modular. + +The `P2P` struct is the core of the system, but doesn't actually do any P2P functionality. It's a state manager and event bus which exposes a hook system for other components of the P2P system to register themselves. + +This modular design helps with separation of concerns which significantly helps with comprehending the entire system and streamlines testing. + +## What are hooks? + +A hook is very similar to an actor. It's a component which can be registered with the P2P system and it is allowed to listen and react to events. + +A hook allows for processing events from the P2P system and also ensures when the P2P system shuts down, the hook is also shutdown. + +There are special hooks called listeners. These are implemented as a superset of a regular hook and are able to create and accept connections. + +## Default hooks? + +The `sd_p2p` crate comes with a few default hooks: + - `Mdns` - Local network discovery using mDNS + - `Quic` - Quic transport layer built on top of `libp2p` + +Spacedrive implements some of it's own hooks within the `core/src/p2p` directory to deal with libraries correctly. + +## Lazy vs eager connection + +The P2P system is designed to lazily connect to peers. This is intentional to preserve battery life and reduce network usage. When the clients attempts to connect to a remote peer it will establish a connection and automatically close it after a period of inactivity. diff --git a/docs/developers/p2p/sd_p2p_block.mdx b/docs/developers/p2p/sd_p2p_block.mdx new file mode 100644 index 000000000..d33d8b3ac --- /dev/null +++ b/docs/developers/p2p/sd_p2p_block.mdx @@ -0,0 +1,57 @@ +--- +title: sd-p2p-block +index: 24 +--- + +# `sd_p2p_block` + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/crates/p2p/crates/block) + +This crate contains utilities focused on moving large arrays of bytes (files) between two peers reliabily and quickly. It's implementation is heavily inspired by [SyncThing Block Exchange Protocol v1](https://docs.syncthing.net/specs/bep-v1.html). + +## Rewrite? + +[Tracking issue](https://linear.app/spacedriveapp/issue/ENG-1760/block-protocol-v2) + +The current implementation is a bit of a mess and is definitely not as performant as it could be. A rewrite is probally a good idea to improve it and as it is a small component of the overall networking system it should be a fairly easy undertaking. + +Below I have outlined some of my thoughts on how to build an improved version: + +### Progress tracking + +Currently the protocol works like the following: + - Send block of file + - Wait for ack + - Send next block + +This is obviously not ideal as it means the sender is waiting for the receiver to ack each block before sending the next one. + +I originally added this to combat the fact that the progress indicator's were not the same on both sides, however I don't think this was worth the trade off. I was also generally testing on the same machine at this stage so it's entirely possible in the real world the progress is actually close enough without requiring acknowledgements. + +We can either, remove acknowledgements or send them less frequently, some testing would be required to determine the best approach. + +### Integrity checking + +[Tracking issue](https://linear.app/spacedriveapp/issue/ENG-1312/spaceblock-file-checksum) + +I think the new version of the protocol should compute a [Blake3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)) hash on both the sender and the receiver and ensure they much before the transfer is considered complete. This ensures both any data corruption or bugs in the Spacedrop protocol don't result in data loss for the user. The current protocol lacks this feature. + +### Cancellation + +Currently the protocol has a custom system built into the acknowledgements that allows each side to cancel an in-progress transfer. A more efficent system could just close the Quic connection and rely on an [`ErrorKind::UnexpectedEof`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.UnexpectedEof) on the other side to detect the shutdown condition. + +### Remove file names + +[Tracking issue](https://linear.app/spacedriveapp/issue/ENG-1292/spaceblock-abstract-name-from-spaceblockrequest) + +It doesn't make a lot of sense for `SpaceblockRequests` to have the `name` field as you may send an unnamed buffer. Where it should go instead is still undecided. + +### File name overflows + +[Tracking issue](https://linear.app/spacedriveapp/issue/ENG-572/spaceblock-file-name-overflow) + +Right now it's possible for a file name's length to overflow. Linux allows for bigger file names than Windows so a transfer from Linux to Windows with a long file name will cause an issue on the Windows side. We can probally prompt the user to pick a shorter name if we detect an overflow. + +## Example + +Refer to [the tests](https://github.com/spacedriveapp/spacedrive/blob/0392c781d75d8f8a571ed43a61ce90e11c7d73d5/crates/p2p/crates/block/src/lib.rs#L227) to see an example of how to use the protocol. diff --git a/docs/developers/p2p/sd_p2p_proto.mdx b/docs/developers/p2p/sd_p2p_proto.mdx new file mode 100644 index 000000000..fc8004547 --- /dev/null +++ b/docs/developers/p2p/sd_p2p_proto.mdx @@ -0,0 +1,75 @@ +--- +title: sd-p2p-proto +index: 23 +--- + +# `sd_p2p_proto` + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/crates/p2p/crates/proto) + +This crate provides utilities for implementing asynchronous deserializers and matching synchronous serializers. The goal of these implementations is to rapidly send and receive Rust structs over the network. + +This crate allows for creating implementations faster than other common options, at the cost of some developer experience. + +Before building, the performance of both [msgpack](https://docs.rs/rmp-serde) and [bincode](https://docs.rs/bincode) was compared against manual implementations using `AsyncRead`. It was found that over the network using asynchronous deserialization was faster. + +This logically follows as if you use a synchronous serializer, you will do the following: + + - Send the total length of the message + - Allocate a buffer for the message + - Wait asynchronously for the buffer to be filled + - Synchronously copy from the buffer into each of the struct fields + +When using an asynchronous serializer you can skip sending the messages length and allocating the intermediate buffer as we can rely on the known length of each field while decoding - this is a win for performance and memory usage. + +This crate provides utilities to make the implementations less error prone. However, long term it would be great to replace this with a derive macro similar to how crates like [serde](https://serde.rs) work. + +From my ([oscartbeaumont](https://github.com/oscartbeaumont)'s) research no crate exists that meets these requirements. I attempted the implementation of one called [binario](https://github.com/oscartbeaumont/binario), however it is still incomplete as juggling async and lifetimes is pretty challenging. The recent stablisation of [RPITIT](https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html) would likely make this much easier if it were to be implemented today. + +This issue is tracked as [ENG-431](https://linear.app/spacedriveapp/issue/ENG-431/binary-handling-abstraction). + +## Example + +### UUID + +```rust +let uuid: uuid::Uuid = todo!(); + +// Encode +let mut bytes = vec![]; +encode::uuid(&mut bytes, uuid); + +// Decode +let stream: impl AsyncRead + Unpin = todo!(); // This will commonly be a `sd_p2p::UnicastStream` +let uuid = decode::uuid(&mut stream).await.unwrap(); +``` + +### String + +```rust +let string = format!("Hello, World!"); + +// Encode +let mut bytes = vec![]; +encode::string(&mut bytes, string); + +// Decode +let stream: impl AsyncRead + Unpin = todo!(); // This will commonly be a `sd_p2p::UnicastStream` +let string = decode::string(&mut stream).await.unwrap(); +``` + +### Buffer + +This may seem redundant but it is required for dynamically sized buffers as it is not possible to know the length of the buffer in advance so when decoding, so we must send the length of the buffer too. + +```rust +let buf = b"Hello, World!".to_vec(); + +// Encode +let mut bytes = vec![]; +encode::buf(&mut bytes, buf); + +// Decode +let stream: impl AsyncRead + Unpin = todo!(); // This will commonly be a `sd_p2p::UnicastStream` +let buf = decode::buf(&mut stream).await.unwrap(); +``` diff --git a/docs/developers/p2p/sd_p2p_tunnel.mdx b/docs/developers/p2p/sd_p2p_tunnel.mdx new file mode 100644 index 000000000..47fd3c581 --- /dev/null +++ b/docs/developers/p2p/sd_p2p_tunnel.mdx @@ -0,0 +1,24 @@ +--- +title: sd-p2p-tunnel +index: 24 +--- + +# `sd-p2p-tunnel` + +[Implementation](https://github.com/spacedriveapp/spacedrive/tree/main/crates/p2p/crates/tunnel) + + + +You can wrap an `UnicastStream` with a `sd_p2p_tunnel::Tunnel` to authenticate that the remote peer is who they say they are and to encrypt the data being sent between the two peers. + +By default all communication is encrypted between the nodes, however we don't check that the remote peer is who they say they are, or are paired. + +So an attacker could setup a modified version of Spacedrive which presents it's own certificate but proxies all traffic between two nodes. This would allow them to view or modify the library data sent over the network. With mDNS being very easy to spoof getting a MITM attack like this is not a far feteched idea. + +Using `Tunnel` will prevent this attack by cryptographically verifying the remote peer holds the private key for the library instance they are advertising. This process also acts as an authentication mechanism for the remote peer to ensure they are allowed to request data within the library. + +You **should** use this is your communicating with a library on a remote node (Eg. sync, request file) but if you're talking with the node (Eg. Spacedrop) you don't need it. + +## Example + +Refer to [the tests](#todo) to see an example of how to use the protocol. diff --git a/docs/developers/p2p/transport-layer.mdx b/docs/developers/p2p/transport-layer.mdx new file mode 100644 index 000000000..5d9efcdb0 --- /dev/null +++ b/docs/developers/p2p/transport-layer.mdx @@ -0,0 +1,16 @@ +--- +title: Transport layer +index: 28 +--- + +# Transport Layer + +We use [QUIC](https://en.wikipedia.org/wiki/QUIC) as our transport layer for peer to peer communication. QUIC is the perfect protocol for our use cases as it's fast, has built in stream multiplexing and has TLS built in so we can encryption out of the box. + +## TLS authentication + +Quic comes with built in TLS authentication with we make use of. Each node is issued a keypair ([`Identity`](https://github.com/spacedriveapp/spacedrive/blob/518d5836f6585a5f597c3ae5a0d27d084adc0a63/crates/p2p/src/identity.rs#L29)) which is stored in the node configuration. + +This certificate ensures the communication between our node and the remote node can't be intercepted or tampered with, however it provides no assurances about the identity of the remote node. + +An attacker could still do an [MITM](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) by sitting in the middle and presenting it's certificate to each side. To combat this we also have library certificates that allow us to verify and encrypt the libraries traffic so it can only be decoded by another node within the library. diff --git a/docs/developers/p2p/usage.mdx b/docs/developers/p2p/usage.mdx new file mode 100644 index 000000000..08a6a2ecb --- /dev/null +++ b/docs/developers/p2p/usage.mdx @@ -0,0 +1,83 @@ +--- +title: usage +index: 21 +--- + +# Usage + +This is a high-level guide of how to build features within Spacedrive on top of the peer-to-peer system. I would recommend referring to this [example PR](https://github.com/spacedriveapp/spacedrive/pull/2523) alongside this guide as a practical reference. + +Start by adding a new variant to [`Header` enum](https://github.com/spacedriveapp/spacedrive/blob/main/core/src/p2p/protocol.rs) and adjusting the `Header::from_stream` and `Header::to_bytes` implementation to support it. + +Next create a new file for the features code in [`core/src/p2p/operations`](https://github.com/spacedriveapp/spacedrive/tree/main/core/src/p2p/operations) like the following: + +```rust +use std::{error::Error, sync::Arc}; + +use sd_p2p::{RemoteIdentity, UnicastStream, P2P}; +use tokio::io::AsyncWriteExt; +use tracing::debug; + +use crate::p2p::Header; + +/// This method can be called to send a ping to a remote peer. +/// The P2P system will take care of finding the peer and establishing a connection. +pub async fn ping(p2p: Arc, identity: RemoteIdentity) -> Result<(), Box> { + let peer = p2p + .peers() + .get(&identity) + .ok_or("Peer not found, has it been discovered?")? + .clone(); + let mut stream = peer.new_stream().await?; + + stream.write_all(&Header::NameOfYourNewHeaderVariant.to_bytes()).await?; + + Ok(()) +} + +/// This method is called when a ping `Header` is found on the incoming request. +/// You must call this from the `match header` on the incoming handler. +pub(crate) async fn receiver(stream: UnicastStream) { + debug!("Received communication from peer '{}'", stream.remote_identity()); +} +``` + +Next you need to setup an incoming handler [here](https://github.com/spacedriveapp/spacedrive/blob/4a62d268efea7dd6ff573531b1e2b2970c7ba562/core/src/p2p/manager.rs#L306) to define how your new `Header` variant should be handled when received. It should look something like: + +```rust +match header { + ... + Header::NameOfYourNewHeaderVariant => operations::name_of_your_new_file::receiver(stream).await; +} +``` + +Finally, you can use the `UnicastStream` stream which implements [`AsyncRead`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncRead.html) + [`AsyncWrite`](https://docs.rs/tokio/latest/tokio/io/trait.AsyncWrite.html) to send data back and forth between peers to implement any application functionality. + +## Version compatibility and breaking changes + +It is the responsibility of the developer to ensure the protocol does not go through any breaking changes, as this would cause communication errors when multiple devices are running different versions of the software. + +However, sometimes a breaking change may be required so we keep track of the Spacedrive version of each node within the peer metadata which can be used to coordinate breaking changes. + +In the sending code you will already have access to the `Peer` so you can access the metadata directly. If your in the receiver code you can use the following to get the `Peer`: + +```rust +let peer = p2p.peers().get(&stream.remote_identity()).unwrap(); +``` + +Then you can access the version from the metadata like so: + +```rust +// If your in the receiver method you've got the `peer` if not you can get it from the P2P system: + +let metadata = PeerMetadata::from_hashmap(&peer.metadata()).unwrap(); + +// You could use the `semver` crate to compare versions +let is_running_version_0_1_0 = metadata.version.as_deref() == Some("0.1.0"); +``` + +## Security + +If your devices are sending library scoped data you should ensure you use `sd_p2p_tunnel::Tunnel` to authenticate the library on the remote node. + +Refer to [it's docs](/docs/developers/p2p/sd_p2p_tunnel) for more information. diff --git a/docs/developers/technology/publishing-updates.mdx b/docs/developers/technology/publishing-updates.mdx index 446191a23..044da9abc 100644 --- a/docs/developers/technology/publishing-updates.mdx +++ b/docs/developers/technology/publishing-updates.mdx @@ -27,7 +27,7 @@ index: 11 - Available at `/api/releases/desktop/[version]/[target]/[arch]` - Same version semantics as Desktop Update API -- Looks for assets starting with `Spacedrive-{Target}-{Arch}` to allow for extensions like `.dmg`, `.AppImage` and `.msi` +- Looks for assets starting with `Spacedrive-{Target}-{Arch}` to allow for extensions like `.dmg`, `.deb` and `.msi` - Returns a redirect as it's intended to be invoked via `` elements ## Publishing a Release diff --git a/docs/developers/technology/rspc.mdx b/docs/developers/technology/rspc.mdx new file mode 100644 index 000000000..e42f6a93b --- /dev/null +++ b/docs/developers/technology/rspc.mdx @@ -0,0 +1,95 @@ +--- +title: ​rspc +index: 13 +--- + +# rspc + +We use a fork based on [rspc 0.1.4](https://docs.rs/rspc) which contains heavy modifications from the upstream. + +## What's different? + +- A super pre-release version of rspc v1's procedure syntax. +- Upgrade to Specta v2 prelease +- Add `Router::sd_patch_types_dangerously` +- Expose internal type maps for the invalidation system. +- All procedures must return a result +- `Procedure::with2` which is a hack to properly support the middleware mapper API +- Legacy executor system - Will require major changes to the React Native link. + +Removed features relied on by Spacedrive: + +- Argument middleware mapper API has been removed upstream + +## Basic usage + +```rust +use rspc::{alpha::AlphaRouter}; + +use super::{Ctx, R}; + +pub(crate) fn mount() -> AlphaRouter { + R.router() + // Define a library query + .procedure("todo", { + R.with2(library()) + .query(|(node, library), input: ()| async move { + Ok(todo!()) + }) + }) + // Define a node query + .procedure("todo2", { + R.query(|node, input: ()| async move { + Ok(todo!()) + }) + }) + // You can copy the above examples but use `.mutation` instead of `.query` for mutations + + // Define a node subscription + .procedure("todo3", { + // You can make this a library subscription by using `R.with2(library())` + R.subscription(|node, _: ()| async move { + // You can return any `impl Stream` + Ok(async_stream::stream! { + yield "hello"; + }) + }) + }) +} + +/// You merge this router into the main router defined in `core/src/api.rs`. +``` + +## Known bugs + +### Returning an error from a procedure can cause a panic + +This is due to a bug in the future that resolves requests. This was fixed [upstream in July 2023](https://github.com/oscartbeaumont/rspc/commit/f115ab22e04d59b0c9056989392215df2b7bb531). + +A panic will also take out the entire request which could contain a batch of multiple procedures. + +This will likely cause the frontend request to hang indefinitely. + +### Blocking + +#### Batching + +This applies to both Tauri and Axum when using the batch link (**which Spacedrive uses**). Each request within a batch is effectively run in serial. This may or may not make a major difference as the response can't be send until all items are ready but having to run them in parallel would be faster regardless. + +#### Tauri + +Minus batching everything is run in parallel. + +#### Axum + +All queries and mutations run within a single websocket connection (**which Spacedrive uses**) are run in serial. + +Minus batching HTTP requests are run in parallel. + +### Websocket reconnect + +If the websocket connection is dropped (due to network disruption) all subscriptions _will not_ restart upon reconnecting. + +This will cause the invalidation system to break and potentially other parts of the app that rely on subscriptions. + +Queries and mutations done during the network disruption will hang indefinitely. diff --git a/docs/product/assets/roadmap/folder.png b/docs/product/assets/roadmap/folder.png index 2d7344ec0..1684db5c5 100644 Binary files a/docs/product/assets/roadmap/folder.png and b/docs/product/assets/roadmap/folder.png differ diff --git a/docs/product/getting-started/introduction.mdx b/docs/product/getting-started/introduction.mdx index 98247c6b6..a396b2761 100644 --- a/docs/product/getting-started/introduction.mdx +++ b/docs/product/getting-started/introduction.mdx @@ -7,15 +7,11 @@ index: 0 ![image](/introduction.webp) -Spacedrive is a cross-platform file manager. It connects your devices together to help you organize files from anywhere. +Spacedrive is a cross-platform file manager. It connects your devices together to help you organize files +from anywhere. Beyond being an opinionated, swiss army knife file explorer, Spacedrive is a personal database. It identifies your files uniquely, understanding more file types than any operating system. -Create photo albums that you'll never lose, effortlessly catalogue terabytes of video, move files between devices dynamically to optimize space and redundancy, generate preview media for easy viewing, automate security and encryption—the list goes on. +Create photo albums that you'll never lose, effortlessly catalogue terabytes of video, move files between devices dynamically to optimize space and redundancy, generate preview media for easy viewing, and automate security and encryption—the; list goes on. A decentralized, local-first design optimizes for privacy, security and data ownership—and best of all, its open source and entirely free. - - diff --git a/docs/product/getting-started/setup.mdx b/docs/product/getting-started/setup.mdx index 0aba9699d..df4dea657 100644 --- a/docs/product/getting-started/setup.mdx +++ b/docs/product/getting-started/setup.mdx @@ -36,7 +36,7 @@ You can run Spacedrive in a Docker container using the following command. /> ```bash -docker run -d --name spacedrive -p 8080:8080 -e SD_AUTH=admin,spacedrive -v /var/spacedrive:/var/spacedrive ghcr.io/spacedriveapp/spacedrive/server +docker run -d --name spacedrive -p 8080:8080 -e SD_AUTH=admin:spacedrive -v /var/spacedrive:/var/spacedrive ghcr.io/spacedriveapp/spacedrive/server ``` #### Authentication @@ -44,9 +44,10 @@ docker run -d --name spacedrive -p 8080:8080 -e SD_AUTH=admin,spacedrive -v /var When using the Spacedrive server you can use the `SD_AUTH` environment variable to configure authentication. Valid values: - - `SD_AUTH=disabled` - Disables authentication. - - `SD_AUTH=username:password` - Enables authentication for a single user. - - `SD_AUTH=username:password,username1:password1` - Enables authentication with multiple users (you can add as many users as you want). + +- `SD_AUTH=disabled` - Disables authentication. +- `SD_AUTH=username:password` - Enables authentication for a single user. +- `SD_AUTH=username:password,username1:password1` - Enables authentication with multiple users (you can add as many users as you want). ### Mobile (Preview) @@ -107,5 +108,3 @@ C:\Program Files\Spacedrive\Spacedrive.exe ```bash /opt/Spacedrive/Spacedrive ``` - -- Alternatively you may launch the AppImage from a terminal to view the logs. diff --git a/docs/product/getting-started/terminology.mdx b/docs/product/getting-started/terminology.mdx deleted file mode 100644 index e9be5fa71..000000000 --- a/docs/product/getting-started/terminology.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Terminology -index: 0 ---- - -# Terminology - -Some useful Spacedrive related terminology. - -### `Library` - -A Library is the database that powers Spacedrive, all metadata and directory structures are saved in the Library. Libraries can be synced between devices and a user can have multiple libraries loaded in the Spacedrive app at once. [Learn more →](/docs/developers/architecture/libraries) - -### `Object` - -Objects are a fancy name for files, we call them Objects because we identify them uniquely based on a cryptographic hash of the contents. Objects in Spacedrive can come in a wide variety of kinds to provide a broad range of context. [Learn more →](/docs/developers/architecture/objects) - -### `Location` - -Locations are places Spacedrive will look for files, usually a directory on a mounted volume, but could also be a cloud service. [Learn more →](/docs/developers/architecture/locations) - -### `Node` - -A Node is a device or server running the Spacedrive core. Nodes can host libraries and communicate with other Nodes to sync data. [Learn more →](/docs/developers/architecture/nodes) - -### `Preview Media` - -Preview media refers to highly compressed image or video content for an Object, it is generated by Spacedrive and synced between your devices. [Learn more →](/docs/developers/architecture/preview-media) diff --git a/docs/product/guides/albums.mdx b/docs/product/guides/albums.mdx deleted file mode 100644 index c741c903a..000000000 --- a/docs/product/guides/albums.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -index: 100 ---- - -# Albums diff --git a/docs/product/guides/cli.mdx b/docs/product/guides/cli.mdx new file mode 100644 index 000000000..5aaf4ca83 --- /dev/null +++ b/docs/product/guides/cli.mdx @@ -0,0 +1,44 @@ +--- +index: 200 +--- + +# CLI + + + +Spacedrive is available as a command-line interface (CLI) tool. The CLI is a powerful tool that allows you to interact with the Spacedrive network from your terminal. + +## General Commands + +### Launching Spacedrive + +```bash +# Launch Spacedrive +spacedrive -d +# View help menu +spacedrive --help +# View version and build information +spacedrive --info +``` + +### Managing Locations + +At least one identifier such as `--name`, `--path` or `--id` is required for each command. + +```bash +# List all Locations +spacedrive location list +# Add a Location +spacedrive location add /path/to/folder --name "Location Name" +# Remove a Location by name +spacedrive location remove --name "Location Name" +# Remove a Location by path +spacedrive location remove --path /local/path/to/location +# Rescan a Location +spacedrive location rescan --id 4 +spacedrive location rescan --id 4 --full # Full rescan +``` diff --git a/docs/product/guides/clouds.mdx b/docs/product/guides/clouds.mdx index 33ac48702..be2544561 100644 --- a/docs/product/guides/clouds.mdx +++ b/docs/product/guides/clouds.mdx @@ -2,6 +2,24 @@ index: 100 --- -# Clouds +# Connecting Clouds -Cloud support is coming very soon! + + +Connecting cloud services with your Spacedrive library will allow you to create [Cloud Locations](). This will allow you to not only to search your cloud storage while offline, but also ensure you have local copies of your cloud files, or offload them if space is an issue. + +Spacedrive will support all major cloud services with a simple API to add more. + +### Authentication + +There are two ways to authenticate a cloud service with your Spacedrive library. The first is via Spacedrive, but this will be rate limited. The other is by creating an "app" in the respective cloud service's developer portal and saving those credentials in your Spacedrive library. More information on this will come as we develop. + +### Indexing + +Currently if you wish to index a cloud service with Spacedrive, it is possible using a third party service like [Cloud Mounter](https://cloudmounter.net/). However, the indexing process will trigger the entire file to be downloaded. This is a problem for bandwidth and storage for a lot of users, and offloading is entirely reliant on the cloud service or app you're using to mount the cloud on your system. In the base of iCloud on macOS this isn't as much of a problem as the OS offloads the files after Spacedrive reqests more to download. + +When official cloud support is released we will rely on the given APIs to perform indexing without downloading any files. This will have limitations in the case of some cloud services for which we will develop the nessesary UI flows to ensure the user is aware of the options. diff --git a/docs/product/guides/automations.mdx b/docs/product/guides/command-palette.mdx similarity index 52% rename from docs/product/guides/automations.mdx rename to docs/product/guides/command-palette.mdx index c56c13b29..4fbdcf621 100644 --- a/docs/product/guides/automations.mdx +++ b/docs/product/guides/command-palette.mdx @@ -2,4 +2,4 @@ index: 100 --- -# Automations +# Command Palette diff --git a/docs/product/guides/comments.mdx b/docs/product/guides/comments.mdx index 418aaf194..fbb870df8 100644 --- a/docs/product/guides/comments.mdx +++ b/docs/product/guides/comments.mdx @@ -3,3 +3,11 @@ index: 100 --- # Comments + + + +Comments allow you to annotate files on the file itself at a given coordinate or at a given timestamp (if the file have temporal data). If a file is shared, other users it is shared with will be able to see comments and reply, depending on the permissions. Comments are syncronized in realtime between Nodes. diff --git a/docs/product/guides/database-sync.mdx b/docs/product/guides/database-sync.mdx index 75693f0f3..d60534bc5 100644 --- a/docs/product/guides/database-sync.mdx +++ b/docs/product/guides/database-sync.mdx @@ -3,3 +3,38 @@ index: 100 --- # Database sync + + + +Spacedrive Libraries are just databases shared among multiple instances. When these instances connect, either via Spacedrive Cloud or peer-to-peer, the changes to each instance's local database are synchronized. +The technical details of this process are covered in the [Developer docs](/docs/developers/architecture/sync). + +Database sync is a feature that allows you to sync your library database between devices. Synchronizing happens in real-time, so you can see changes made on one device reflected on another device almost instantly. + +We have been working tirelessly on this feature to make sure it is as seamless as possible. We are excited to share it with you soon. + +## Sync Indicator + +Alongside the job indicator, a small sync icon will appear when a sync is in progress. Clicking it will reveal the sync manager. + +## Sync Manager + +The sync manager allows you to see the current sync status, and any errors that may have occured. You can also see the last time a sync was completed. + +## Cloud Sync + +When connected to Spacedrive Cloud, a Spacedrive Instance will send its changes to be stored in the Cloud in an encrypted format. +When another instance connects to the Cloud, it will download these changes and apply them to its local database. + +This process does not require multiple instances to be connected at the same time. +Spacedrive Cloud will store the changes for when other instances connect. + +## Peer-To-Peer Sync + +When connected over peer-to-peer, two instances will exchange their database changess directly. +The contents of the database changes are not encrypted themselves, +instead the connection between the two instances will ensure that they are encrypted during transit. diff --git a/docs/product/guides/duplicates.mdx b/docs/product/guides/duplicates.mdx index b463adcb6..984efeb64 100644 --- a/docs/product/guides/duplicates.mdx +++ b/docs/product/guides/duplicates.mdx @@ -3,3 +3,19 @@ index: 100 --- # Duplicates + +Spacedrive is fundamentally designed to recognize duplicate files. This feature is essential for ensuring data redundancy and optimizing storage space on your devices. + +## Sister files + +Spacedrive identifies files that are identical in content but have different names or locations as "sister files." This feature is particularly useful when you have multiple copies of the same file in different directories or with different names. You can view sister files in the Inspector panel. + +## Duplicate discovery + +During the indexing process, Spacedrive generates a `cas_id` (Content Addressable Storage Identifier), which are checksums based on samples of the file contents combined with the total size value. This method is highly efficient and offers a strong likelihood of identifying duplicates. + +However, for absolute certainty, we also perform a validation using `sha256` checksums. This validation is only carried out when necessary and usually runs in the background, ensuring data integrity without compromising system performance. + +## Duplicate cleanup + +Spacedrive allows you to delete duplicate files from any location or device. When triggering this action the data will be presented in the Explorer for you to review, with a panel somewhere totaling on how much space will be saved by the cleanup. diff --git a/docs/product/guides/folder-sync.mdx b/docs/product/guides/folder-sync.mdx deleted file mode 100644 index 18f1b64a5..000000000 --- a/docs/product/guides/folder-sync.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -index: 100 ---- - -# Folder Sync diff --git a/docs/product/guides/habits.mdx b/docs/product/guides/habits.mdx deleted file mode 100644 index b3ec1be1b..000000000 --- a/docs/product/guides/habits.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -index: 100 ---- - -# Habits diff --git a/docs/product/guides/importing-photos.mdx b/docs/product/guides/importing-photos.mdx new file mode 100644 index 000000000..e97573b8b --- /dev/null +++ b/docs/product/guides/importing-photos.mdx @@ -0,0 +1,23 @@ +--- +index: 20 +--- + +# Importing Photos + +Spacedrive is designed to be a central location for all your media. The [Media View]() makes viewing and managing your photos easy with a variety of filtering and sorting options. To compliment this we also have (and are working on) a variety of ways to import your photos. + +### macOS + +Spacedrive will index the contents of a photolibrary on your Mac if it is found within a Location. This will mean original photos, live photos and videos will be imported into Spacedrive. + +However, one downside to this method is that file names are not preserved and some the photo's metadata is lost, along with any edits made and albums created with media in your external library. + +An importer tool will be shipped in an upcoming release, which will not only import all the missing data, but won't be harmed if you have already indexed that photo library; essentially, it will append correct metadata onto the existing content you have in your Spacedrive. + +## From removable storage + +In an upcoming release we will ship a dedicated interface for importing media from removable storage, with the option to exclude already imported media. It will default to your preferences for photo storage and place the new media in a designated folder. + +## Google and Apple Photosß + +We are working on this, but it is not available yet. Please check our [roadmap](/roadmap) for updates. diff --git a/docs/product/guides/inspector.mdx b/docs/product/guides/inspector.mdx deleted file mode 100644 index 35657c22d..000000000 --- a/docs/product/guides/inspector.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -index: 100 ---- - -# Inspector diff --git a/docs/product/guides/interface.mdx b/docs/product/guides/interface.mdx index 16d095215..beb6720a5 100644 --- a/docs/product/guides/interface.mdx +++ b/docs/product/guides/interface.mdx @@ -4,32 +4,52 @@ index: 2 # Spacedrive Interface -Let's start by getting a clear understanding of the Spacedrive interface. Designed to mimic what you know and love with existing file explorers, but with powerful features and a universal desgin across operating systems. - -## Launch with CTRL+SPACE - - - -A single keybind to launch Spacedrive from anywhere, you can define from the settings how Spacedrive should present itself on this keybind. +Let's start by getting a clear understanding of the Spacedrive interface. Designed to mimic what you know and love with existing file explorers, but with powerful features and a universal design across operating systems. ## Sidebar -The sidebar starts with a library switcher, this allows you to change the entire context of Spacedrive quickly. Below it, you will see the contents of your library,such as Locations and Tags, Local drive explorer and mounts, Network overview, Statistics and base categories such as `All Files` and `Trash`. +![image](/library_switcher.webp) + +The sidebar starts with a library switcher, this allows you to change the entire context of Spacedrive quickly. Below it, you will see the contents of your library, such as Locations and Tags, local drive explorer, active mounts, and your local network. ## Explorer +The explorer is comprised of different views; List, Grid and Media View, with column and tree views on the way. The explorer can be used to navigate Locations, Tags, Local drives, Network drives, and even peer Spacedrive nodes. + +With Locations and search, Spacedrive is showing you the virtual representation of the filesystem, but is continuously refreshing the index to show you the latest changes. + +## Local Explorer + +The Local Explorer (found under "Local" in the sidebar) reveals the actual filesystem directly, without our "VDFS" layer. For large folders we stream the results as we index them ephemerally, which is often slower than our virtual filesystem. + +Certain Spacedrive specific features like [Tags](/docs/product/guides/tags) are not available for files in the Local Explorer, but you can still use the inspector to view metadata and edit files. + ## Inspector -## Categories +The inspector allows you to view more information about any given file in your Spacedrive library. It is closed by default, but can be opened with CMD/CTRL+I or pressing the icon in the top bar. + +Currently the explorer shows basic metadata, tags, and duplicate files. It also will display EXIF data for media and allow you to edit items. ## Overview -## Quick Preview +Currenty, the Overview screen shows you statistics about your library as well as list of supported file types as categories. Clicking them will open a search for that file type. Additionally, lists of Devices, Locations and Clouds can be found below. -## Command Pallette +As we improve, the overview will provide a customizable dashboard like view for your library; for example, most features will have a dashboard widget and the layout will be fully customizable. - +## Applications + + + +Applications found on your system can be tracked by your Spacedrive library. Our Applications tab acts as a manager atop your installed applications. Using existing command line package managers allows you to install the same applications accross operating systems, and re-install old ones on a new machine. This will preserve and backing-up application data when supported. + +## Network + +The network tab shows you all the devices connected to your library, allowing you to see their status, and even browse their filesystems. This is where you can view and manage [Nodes](/docs/product/guides/network#Nodes) and [Shares](/docs/product/guides/network#Shares) across your networks. + +## Launch with CTRL+SPACE + + + +A single keybind to launch Spacedrive from anywhere. You can define from the settings how Spacedrive should present itself on this keybind. ## Search - -{/* ![image](/thumbnails.webp) */} diff --git a/docs/product/guides/jobs.mdx b/docs/product/guides/jobs.mdx index 9abf9deb8..b60dc40a5 100644 --- a/docs/product/guides/jobs.mdx +++ b/docs/product/guides/jobs.mdx @@ -1,5 +1,33 @@ --- -index: 100 +index: 10 --- # Jobs + +Jobs allow Spacedrive to complete a body of work; a built-in multi-threaded task management system. + +Jobs can be paused, resumed, and cancelled. Spacedrive will always try to restart jobs that were cut off by a restart or shutdown of Spacedrive. + +A small indicator shows in the bottom left when a job is running. Clicking it will reveal the job manager. + +### Types of job + +| Name | Job Manager caption | Purpose | +| ---------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| Indexer | "Indexing files" | Discover file paths within a location and write them to the library database. | +| FileIdentifier | "Extracting metadata" | Extract filesystem metadata, generating unique identifier (cas_id) and categorize the file. | +| Media Processor | "Processing media" or "Generating thumbnails" | Generate thumbnails media for photos and videos and extract EXIF metadata. | +| Labeler | "Labeling files" | Assign labels using the currenly loaded object detection AI model, by default is YOLO. | +| Object Validator | "Validating files" | Generate a full checksum from all bytes present in the file, unlike the cas_id approach which is partial. | +| FileCutter | "Cutting X files" | Cut or "move" files. | +| FileCopier | "Copying X files" | Copy files. | +| FileEraser | "Erasing X files" | Permanently erase a file | +| LocationCleaner | "Removing Location" | Cleans up all data related to a location on delete. | + +### Job Manager + +The job manager allows you to see current jobs or expand them to see various child jobs. Jobs with only one child, such as copying a single file, will not be expandable by clicking. + +Job history can be cleared by hitting the small trash icon on the job manager. Note that this will not remove any ongoing jobs. + +Up to 3 jobs can run simultaneously, although this may be configurable in the future. More CPU-intensive jobs like thumbnailing and labelling have an upper limit for CPU usage that can be set in the General settings page. diff --git a/docs/product/guides/library-setup.mdx b/docs/product/guides/library-setup.mdx index 00d96cf7a..d105b47eb 100644 --- a/docs/product/guides/library-setup.mdx +++ b/docs/product/guides/library-setup.mdx @@ -4,28 +4,32 @@ index: 0 # Library Setup -A Library is where all your Spacedrive data lives, but not the files themselves. +A Library is where all your Spacedrive data lives (but not the files themselves). -For the convenience of finding, organizing and sharing files even when you don't have access; directory structures, metadata and preview media are extracted and stored within the Spacedrive Library. +For the convenience of finding, organizing and sharing files even when you don't have access, we've designed the Spacedrive library to extract and store directory structures, metadata and preview media within Spacedrive itself. -This data is heavily compressed and very portable, you can have multiple libraries and even lock and encrypt them. +This data is heavily compressed and very portable, so you can have multiple libraries and even lock and encrypt them\*. -## Library Sync +_\*Locking and encryption coming in a later update._ - +## Exporting a Library -When you connect another device, it happens via the Library. The two [Nodes]() are connected via this Library and the data is synced automatically between them. +For now, this is not possible to do in-app. However, you can find your [app data](/docs/product/getting-started/setup#app-data) folder and copy the library from the libraries folder and back it up somewhere safe. Don't forget to include the preview media found in the `thumbnails` directory, which name matches the UUID of the library. -## Encrypting a Library +Eventually the export feature will create a single file with this data self contiained. - +To import a library, simply copy the library folder back to the libraries directory and restart the app. -You can encrypt a Library by clicking the Lock icon button in the Library Settings, once you have set a master password, the Library will be encrypted. If a library is locked, you will be prompted to enter the password when you try to open it. You can set an expiration time for the password, after which you will be prompted to enter it again. +## Creating multiple Libraries -When a library is encrypted, the data is encrypted on disk, but the files themselves are not encrypted. This means that if you have a library that is not encrypted, and you encrypt it, the files will not be re-encrypted, only the metadata will be encrypted. - -If you wish to learn about encrypting files, see [File Encryption](#). +It is possible to create multiple libraries. If you do so, they will exist completely seperate of eachother and will not share any data. You can choose to create a new library through the Library switcher dropdown in the top left corner of the app. ## Deleting a Library -A Library can be deleted by clicking the Trash icon button in the Library Settings. Deleting a library will permanently the database, the files themselves will not be deleted. +A Library can be deleted by clicking the Trash icon button in the Library Settings. Deleting a library will permanently the database, but the files themselves will not be deleted. + +## Library Sync + + + +When you connect another device, it happens via a Library. The two [Nodes]() are connected via this Library and the data is synced automatically between them. diff --git a/docs/product/guides/locations.mdx b/docs/product/guides/locations.mdx index 18ec87600..e09ceaecd 100644 --- a/docs/product/guides/locations.mdx +++ b/docs/product/guides/locations.mdx @@ -4,19 +4,17 @@ index: 4 # Locations -Locations are places Spacedrive looks for files. You can add Locations from any device to your Library, they will be scanned and monitored for filesystem changes. +Locations are places Spacedrive looks for files. You can add Locations from any device to your Library and they will be scanned and monitored for filesystem changes. ![Spacedrive Locations from the Settings view](/locations.webp) -Locations can be managed from the settings. The "online" indicator shows if that Location is currently accessible from one of your devices. +Locations can be managed from the settings. The "connected" indicator shows if that Location is currently accessible from one of your devices. -Spacedrive allows you to browse your local system before creating a Location, but it may take longer to load explorer data without the indexing process of Locations. - -You can convert any local path to a Location when browsing your local filesystem. +Spacedrive allows you to browse your local filesystem before creating a Location via the [Local Explorer](/docs/product/guides/interface#Local%20Explorer), but it may take longer to load Explorer data without the indexing process of Locations. You can convert any local path to a Location when browsing your local filesystem from the top bar or the context menu. ## Scanning -When a Location is added it is immediately scanned. The scan happens via several phases. +When a Location is added it is immediately scanned. The scan happens in several phases as [Jobs](/docs/product/guides/jobs). 1. The [Indexer](): directory structure is indexed and saved to your library's database. 2. The [Identifier](): metadata is extracted and unique identifiers generated. @@ -26,16 +24,20 @@ If any one of these jobs fail or the application is closed, the state is saved a -There is a button to trigger a full re-scan of this Location. Otherwise the location will keep watch for filesystem changes automatically. +There is a button to trigger a full re-scan of this Location. Otherwise, the location will keep watch for filesystem changes automatically. -Deleting a location will remove the data from the database permanently. +Deleting a location will remove the data from the database permanently. If you wish to keep the data but not have it in your library, you can [archive](#Archiving) the location. ## Archiving - + Locations can be archived, meaning the directory structure is extracted from the Spacedrive database and preserved as a standalone database file. This file can be opened by Spacedrive in the [Database]() @@ -45,8 +47,21 @@ Archives are useful when files have been moved or deleted from a Location, but y ## Dynamic Space -A slider in the Location settings allows you to allocate an amount of GB to use as redundancy for other Locations. The storage space will be filled and emptied dynamically, recent and important files will be copied as priority. + -## Encrypted Space +A slider in the Location settings allows you to allocate an amount of GB to use as redundancy for other Locations. The storage space will be filled and emptied dynamically, with priority given to recent and important files being copied. -Allocate a portion of this location to be encrypted +## Size Limit + + +A Location can be set to have a size limit, which will prevent the Location from growing beyond the set +limit. Files will be removed from the Location based on the last accessed time, with oldest files being +removed first. diff --git a/docs/product/guides/media-conversion.mdx b/docs/product/guides/media-conversion.mdx index c8b8ef63b..60ed90841 100644 --- a/docs/product/guides/media-conversion.mdx +++ b/docs/product/guides/media-conversion.mdx @@ -3,3 +3,9 @@ index: 100 --- # Media Conversion + + diff --git a/docs/product/guides/network.mdx b/docs/product/guides/network.mdx new file mode 100644 index 000000000..668f8b80f --- /dev/null +++ b/docs/product/guides/network.mdx @@ -0,0 +1,17 @@ +--- +index: 100 +--- + +# Network + +The network view shows you all the connected devices in your library, you can see their status, and even browse their filesystems. + +Additionally, local network shares accessible from _any_ connected Spacedrive node will show here, allowing you to explore your extended local network. + +## Nodes + +## Shares + +## Contacts + +Contacts are other Spacedrive users you have saved information for in your library. You can see their status and previously shared files from here. diff --git a/docs/product/guides/people.mdx b/docs/product/guides/people.mdx deleted file mode 100644 index 7fdba1c75..000000000 --- a/docs/product/guides/people.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -index: 100 ---- - -# People diff --git a/docs/product/guides/quick-actions.mdx b/docs/product/guides/quick-actions.mdx deleted file mode 100644 index 13442eb43..000000000 --- a/docs/product/guides/quick-actions.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -index: 100 ---- - -# Quick Actions diff --git a/docs/product/guides/quick-preview.mdx b/docs/product/guides/quick-preview.mdx new file mode 100644 index 000000000..c7df1741c --- /dev/null +++ b/docs/product/guides/quick-preview.mdx @@ -0,0 +1,13 @@ +--- +index: 10 +--- + +# Quick Preview + +
{reloadBtn && ( )} {platform.openLogsDir && ( )} @@ -152,19 +154,15 @@ export function ErrorPage({ message.startsWith('failed to initialize library manager')) && (

- We detected you may have created your library with an older version of - Spacedrive. Please reset it to continue using the app! -

-

- {' '} - YOU WILL LOSE ANY EXISTING SPACEDRIVE DATA! + {t('reset_to_continue')}

+

{t('reset_warning')}

)} diff --git a/interface/app/$libraryId/Explorer/ContextMenu/AssignTagMenuItems.tsx b/interface/app/$libraryId/Explorer/ContextMenu/AssignTagMenuItems.tsx index fc8fef0ae..8c80dc54b 100644 --- a/interface/app/$libraryId/Explorer/ContextMenu/AssignTagMenuItems.tsx +++ b/interface/app/$libraryId/Explorer/ContextMenu/AssignTagMenuItems.tsx @@ -1,11 +1,11 @@ import { Plus } from '@phosphor-icons/react'; +import { ExplorerItem, useLibraryQuery } from '@sd/client'; +import { Button, ModifierKeys, dialogManager, tw } from '@sd/ui'; import { useQueryClient } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; import clsx from 'clsx'; import { RefObject, useMemo, useRef } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; -import { ExplorerItem, useCache, useLibraryQuery, useNodes } from '@sd/client'; -import { Button, dialogManager, ModifierKeys, tw } from '@sd/ui'; import CreateDialog, { AssignTagItems, useAssignItemsToTag @@ -23,7 +23,6 @@ interface Props { function useData({ items }: Props) { const tags = useLibraryQuery(['tags.list'], { suspense: true }); - useNodes(tags.data?.nodes); // Map> const tagsWithObjects = useLibraryQuery( @@ -39,10 +38,11 @@ function useData({ items }: Props) { { suspense: true } ); + return { tags: { ...tags, - data: useCache(tags.data?.items) + data: tags.data }, tagsWithObjects }; diff --git a/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx b/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx index 016d66463..497c1d381 100644 --- a/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx +++ b/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx @@ -250,7 +250,7 @@ export const ParentFolderActions = new ConditionalItem({ } catch (error) { toast.error({ title: t('failed_to_rescan_location'), - body: `Error: ${error}.` + body: t('error_message', { error }) }); } }} diff --git a/interface/app/$libraryId/Explorer/ContextMenu/Object/Items.tsx b/interface/app/$libraryId/Explorer/ContextMenu/Object/Items.tsx index a084357ea..502b806a1 100644 --- a/interface/app/$libraryId/Explorer/ContextMenu/Object/Items.tsx +++ b/interface/app/$libraryId/Explorer/ContextMenu/Object/Items.tsx @@ -35,7 +35,7 @@ export const RemoveFromRecents = new ConditionalItem({ } catch (error) { toast.error({ title: t('failed_to_remove_file_from_recents'), - body: `Error: ${error}.` + body: t('error_message', { error }) }); } }} diff --git a/interface/app/$libraryId/Explorer/ContextMenu/OpenWith.tsx b/interface/app/$libraryId/Explorer/ContextMenu/OpenWith.tsx index 220557a33..83d4024db 100644 --- a/interface/app/$libraryId/Explorer/ContextMenu/OpenWith.tsx +++ b/interface/app/$libraryId/Explorer/ContextMenu/OpenWith.tsx @@ -4,7 +4,7 @@ import { useLibraryContext } from '@sd/client'; import { toast } from '@sd/ui'; import { Menu } from '~/components/Menu'; import { useLocale } from '~/hooks'; -import { Platform, usePlatform } from '~/util/Platform'; +import { OpenWithApplication, Platform, Result, usePlatform } from '~/util/Platform'; import { ConditionalItem } from './ConditionalItem'; import { useContextMenuContext } from './context'; @@ -79,21 +79,36 @@ const Items = ({ const ids = selectedFilePaths.map((obj) => obj.id); const paths = selectedEphemeralPaths.map((obj) => obj.path); + const { t } = useLocale(); - const items = useQuery( + const { data: apps } = useQuery( ['openWith', ids, paths], - () => { - if (ids.length > 0) return actions.getFilePathOpenWithApps(library.uuid, ids); - else if (paths.length > 0) return actions.getEphemeralFilesOpenWithApps(paths); - else return { data: [] }; + async () => { + const handleError = (res: Result) => { + if (res?.status === 'error') { + toast.error('Failed to get applications capable to open file'); + if (res.error) console.error(res.error); + return []; + } + return res?.data; + }; + + return Promise.all([ + ids.length > 0 + ? actions.getFilePathOpenWithApps(library.uuid, ids).then(handleError) + : Promise.resolve([]), + paths.length > 0 + ? actions.getEphemeralFilesOpenWithApps(paths).then(handleError) + : Promise.resolve([]) + ]).then((res) => res.flat()); }, - { suspense: true } + { initialData: [] } ); return ( <> - {Array.isArray(items.data) && items.data.length > 0 ? ( - items.data.map((data, index) => ( + {apps.length > 0 ? ( + apps.map((data, index) => ( { @@ -103,13 +118,15 @@ const Items = ({ library.uuid, ids.map((id) => [id, data.url]) ); - } else if (paths.length > 0) { + } + + if (paths.length > 0) { await actions.openEphemeralFileWith( paths.map((path) => [path, data.url]) ); } } catch (e) { - toast.error(`Failed to open file, with: ${data.url}`); + toast.error(t('failed_to_open_file_with', { data: data.url })); } }} > @@ -117,7 +134,7 @@ const Items = ({ )) ) : ( -

No apps available

+

{t('no_apps_available')}

)} ); diff --git a/interface/app/$libraryId/Explorer/CopyAsPath.tsx b/interface/app/$libraryId/Explorer/CopyAsPath.tsx index ab8c2d193..9b15b6e08 100644 --- a/interface/app/$libraryId/Explorer/CopyAsPath.tsx +++ b/interface/app/$libraryId/Explorer/CopyAsPath.tsx @@ -27,7 +27,7 @@ export const CopyAsPathBase = ( } catch (error) { toast.error({ title: t('failed_to_copy_file_path'), - body: `Error: ${error}.` + body: t('error_message', { error }) }); } }} diff --git a/interface/app/$libraryId/Explorer/DismissibleNotice.tsx b/interface/app/$libraryId/Explorer/DismissibleNotice.tsx index eab622efd..7e93accfa 100644 --- a/interface/app/$libraryId/Explorer/DismissibleNotice.tsx +++ b/interface/app/$libraryId/Explorer/DismissibleNotice.tsx @@ -50,7 +50,7 @@ const notices = { }, media: { key: 'mediaView', - title: 'Media View', + title: i18n.t('media_view'), description: i18n.t('media_view_notice_description'), icon: } diff --git a/interface/app/$libraryId/Explorer/ExplorerPath.tsx b/interface/app/$libraryId/Explorer/ExplorerPathBar.tsx similarity index 92% rename from interface/app/$libraryId/Explorer/ExplorerPath.tsx rename to interface/app/$libraryId/Explorer/ExplorerPathBar.tsx index bb8e0913c..4e0e824ba 100644 --- a/interface/app/$libraryId/Explorer/ExplorerPath.tsx +++ b/interface/app/$libraryId/Explorer/ExplorerPathBar.tsx @@ -1,8 +1,4 @@ import { AppWindow, ArrowSquareOut, CaretRight, ClipboardText } from '@phosphor-icons/react'; -import clsx from 'clsx'; -import { memo, useMemo, useState } from 'react'; -import { useNavigate } from 'react-router'; -import { createSearchParams } from 'react-router-dom'; import { getExplorerItemData, getIndexedItemFilePath, @@ -10,9 +6,13 @@ import { useLibraryQuery } from '@sd/client'; import { ContextMenu } from '@sd/ui'; +import clsx from 'clsx'; +import { memo, useMemo, useState } from 'react'; +import { useNavigate } from 'react-router'; +import { createSearchParams } from 'react-router-dom'; +import { useTabsContext } from '~/TabsContext'; import { Icon } from '~/components'; import { useIsDark, useLocale, useOperatingSystem } from '~/hooks'; -import { useTabsContext } from '~/TabsContext'; import { usePlatform } from '~/util/Platform'; import { useExplorerContext } from './Context'; @@ -21,9 +21,10 @@ import { lookup } from './RevealInNativeExplorer'; import { useExplorerDroppable } from './useExplorerDroppable'; import { useExplorerSearchParams } from './util'; +// todo: ENTIRELY replace with computed combined pathbar+tagbar height export const PATH_BAR_HEIGHT = 32; -export const ExplorerPath = memo(() => { +export const ExplorerPathBar = memo(() => { const os = useOperatingSystem(true); const navigate = useNavigate(); const [{ path: searchPath }] = useExplorerSearchParams(); @@ -118,13 +119,16 @@ export const ExplorerPath = memo(() => { return (
- {paths.map((path) => ( + {paths.map((path, idx) => ( handleOnClick(path)} disabled={path.pathname === (searchPath ?? (location && '/'))} @@ -148,9 +152,10 @@ interface PathProps { onClick: () => void; disabled: boolean; locationPath: string; + isLast: boolean; } -const Path = ({ path, onClick, disabled, locationPath }: PathProps) => { +const Path = ({ path, onClick, disabled, locationPath, isLast }: PathProps) => { const isDark = useIsDark(); const { revealItems } = usePlatform(); const { library } = useLibraryContext(); @@ -192,7 +197,7 @@ const Path = ({ path, onClick, disabled, locationPath }: PathProps) => { } > diff --git a/interface/app/$libraryId/Explorer/ExplorerTagBar.tsx b/interface/app/$libraryId/Explorer/ExplorerTagBar.tsx new file mode 100644 index 000000000..38060d43e --- /dev/null +++ b/interface/app/$libraryId/Explorer/ExplorerTagBar.tsx @@ -0,0 +1,369 @@ +import { Circle } from '@phosphor-icons/react'; +import clsx from 'clsx'; +import { useEffect, useRef, useState } from 'react'; +import { + ExplorerItem, + getItemObject, + Tag, + Target, + useLibraryMutation, + useLibraryQuery, + useRspcContext, + useSelector +} from '@sd/client'; +import { Shortcut, toast } from '@sd/ui'; +import { useIsDark, useKeybind, useLocale, useOperatingSystem } from '~/hooks'; +import { keybindForOs } from '~/util/keybinds'; + +import { useExplorerContext } from './Context'; +import { explorerStore } from './store'; + +export const TAG_BAR_HEIGHT = 54; +const NUMBER_KEYCODES: string[][] = [ + ['Key1'], + ['Key2'], + ['Key3'], + ['Key4'], + ['Key5'], + ['Key6'], + ['Key7'], + ['Key8'], + ['Key9'] +]; + +// TODO: hoist this to somewhere higher as a utility function +const toTarget = (data: ExplorerItem): Target => { + if (!data || !('id' in data.item)) + throw new Error('Tried to convert an invalid object to Target.'); + + return ( + data.type === 'Object' + ? { + Object: data.item.id + } + : { + FilePath: data.item.id + } + ) satisfies Target; +}; + +type TagBulkAssignHotkeys = typeof explorerStore.tagBulkAssignHotkeys; +function getHotkeysWithNewAssignment( + hotkeys: TagBulkAssignHotkeys, + options: + | { + unassign?: false; + tagId: number; + hotkey: string; + } + | { + unassign: true; + tagId: number; + hotkey?: string; + } +): TagBulkAssignHotkeys { + const hotkeysWithoutCurrentTag = hotkeys.filter( + ({ hotkey, tagId }) => !(tagId === options.tagId || hotkey === options.hotkey) + ); + + if (options.unassign) { + return hotkeysWithoutCurrentTag; + } + + return hotkeysWithoutCurrentTag.concat({ + hotkey: options.hotkey, + tagId: options.tagId + }); +} + +// million-ignore +export const ExplorerTagBar = () => { + const [tagBulkAssignHotkeys] = useSelector(explorerStore, (s) => [s.tagBulkAssignHotkeys]); + const explorer = useExplorerContext(); + const rspc = useRspcContext(); + const tagsRef = useRef(null); + const [isTagsOverflowing, setIsTagsOverflowing] = useState(false); + + const updateOverflowState = () => { + const element = tagsRef.current; + if (element) { + setIsTagsOverflowing( + element.scrollHeight > element.clientHeight || + element.scrollWidth > element.clientWidth + ); + } + }; + + useEffect(() => { + const element = tagsRef.current; + if (!element) return; + //handles initial render when not resizing + setIsTagsOverflowing( + element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth + ); + //make sure state updates when window resizing + window.addEventListener('resize', () => { + updateOverflowState(); + }); + //remove listeners on unmount + return () => { + window.removeEventListener('resize', () => { + updateOverflowState(); + }); + }; + }, [tagsRef]); + + const [tagListeningForKeyPress, setTagListeningForKeyPress] = useState(); + + const { data: allTags = [] } = useLibraryQuery(['tags.list']); + const mutation = useLibraryMutation(['tags.assign'], { + onSuccess: () => rspc.queryClient.invalidateQueries(['search.paths']) + }); + + const { t } = useLocale(); + + // This will automagically listen for any keypress 1-9 while the tag bar is visible. + // These listeners will unmount when ExplorerTagBar is unmounted. + useKeybind( + NUMBER_KEYCODES, + async (e) => { + const targets = Array.from(explorer.selectedItems.entries()).map((item) => + toTarget(item[0]) + ); + + // Silent fail if no files are selected + if (targets.length < 1) return; + + const keyPressed = e.key; + + let tag: Tag | undefined; + + findTag: { + const tagId = tagBulkAssignHotkeys.find( + ({ hotkey }) => hotkey === keyPressed + )?.tagId; + const foundTag = allTags.find((t) => t.id === tagId); + + if (!foundTag) break findTag; + + tag = foundTag; + } + + if (!tag) return; + + // extract the list of tags from each object in the selected items + const targetsTagList = Array.from(explorer.selectedItems.entries()).map( + // issues with type here. unsure as to why, and not causing any noticeable errors, so ignoring for now with as any + (item) => (item[0] as any).object.item.tags + ); + + // iterate through each tag in the selected items and check if the tag we want to assign is already assigned + const areAllAssigned = targetsTagList.every((tags) => { + return tags.some((t: { tag_id: any }) => t.tag_id === tag.id); + }); + + try { + if (areAllAssigned) { + await mutation.mutateAsync({ + targets, + tag_id: tag.id, + unassign: true + }); + + toast( + t('tags_bulk_unassigned', { + tag_name: tag.name, + file_count: targets.length + }), + { + type: 'success' + } + ); + } else { + await mutation.mutateAsync({ + targets, + tag_id: tag.id, + unassign: false + }); + + toast( + t('tags_bulk_assigned', { + tag_name: tag.name, + file_count: targets.length + }), + { + type: 'success' + } + ); + } + } catch (err) { + let msg: string = t('error_unknown'); + + if (err instanceof Error || (typeof err === 'object' && err && 'message' in err)) { + msg = err.message as string; + } else if (typeof err === 'string') { + msg = err; + } + + console.error('Tag assignment failed with error', err); + + let failedToastMessage: string = t('tags_bulk_failed_without_tag', { + file_count: targets.length, + error_message: msg + }); + + if (tag) + failedToastMessage = t('tags_bulk_failed_with_tag', { + tag_name: tag.name, + file_count: targets.length, + error_message: msg + }); + + toast(failedToastMessage, { + type: 'error' + }); + } + }, + { + enabled: typeof tagListeningForKeyPress !== 'number' + } + ); + + return ( +
+ {t('tags_bulk_instructions')} + +
    + {/* Did not want to write a .toSorted() predicate for this so lazy spreading things with hotkeys first then the rest after */} + {allTags + .toSorted((tagA, tagB) => { + // Sort this array by hotkeys 1-9 first, then unasssigned tags. I know, it's terrible. + // This 998/999 bit is likely terrible for sorting. I'm bad at writing sort predicates. + // Improvements (probably much simpler than this anyway) are much welcome <3 + // -- iLynxcat 3/jun/2024 + + const hotkeyA = +( + tagBulkAssignHotkeys.find((k) => k.tagId === tagA.id)?.hotkey ?? 998 + ); + const hotkeyB = +( + tagBulkAssignHotkeys.find((k) => k.tagId === tagB.id)?.hotkey ?? 999 + ); + + return hotkeyA - hotkeyB; + }) + .map((tag) => ( +
  • + tagId === tag.id) + ?.hotkey + } + isAwaitingKeyPress={tagListeningForKeyPress === tag.id} + onClick={() => { + setTagListeningForKeyPress(tag.id); + }} + onKeyPress={(e) => { + if (e.key === 'Escape') { + explorerStore.tagBulkAssignHotkeys = + getHotkeysWithNewAssignment(tagBulkAssignHotkeys, { + unassign: true, + tagId: tag.id + }); + + setTagListeningForKeyPress(undefined); + + return; + } + + explorerStore.tagBulkAssignHotkeys = + getHotkeysWithNewAssignment(tagBulkAssignHotkeys, { + tagId: tag.id, + hotkey: e.key + }); + setTagListeningForKeyPress(undefined); + }} + /> +
  • + ))} +
+
+ ); +}; + +interface TagItemProps { + tag: Tag; + assignKey?: string; + isAwaitingKeyPress: boolean; + onKeyPress: (e: KeyboardEvent) => void; + onClick: () => void; +} + +const TagItem = ({ + tag, + assignKey, + isAwaitingKeyPress = false, + onKeyPress, + onClick +}: TagItemProps) => { + const buttonRef = useRef(null); + const isDark = useIsDark(); + + const os = useOperatingSystem(true); + const keybind = keybindForOs(os); + + useKeybind( + [...NUMBER_KEYCODES, ['Escape']], + (e) => { + buttonRef.current?.blur(); // Hides the focus ring after Escape is pressed to cancel assignment + return onKeyPress(e); + }, + { + enabled: isAwaitingKeyPress + } + ); + + return ( + + ); +}; diff --git a/interface/app/$libraryId/Explorer/FilePath/DeleteDialog.tsx b/interface/app/$libraryId/Explorer/FilePath/DeleteDialog.tsx index dc3425a01..910965bc2 100644 --- a/interface/app/$libraryId/Explorer/FilePath/DeleteDialog.tsx +++ b/interface/app/$libraryId/Explorer/FilePath/DeleteDialog.tsx @@ -1,5 +1,6 @@ import { useLibraryMutation, useZodForm } from '@sd/client'; import { CheckBox, Dialog, Tooltip, useDialog, UseDialogProps } from '@sd/ui'; +import i18n from '~/app/I18n'; import { Icon } from '~/components'; import { useLocale } from '~/hooks'; @@ -18,11 +19,11 @@ interface Props extends UseDialogProps { function getWording(dirCount: number, fileCount: number) { let type = 'file'; - let prefix = 'a'; + let prefix = i18n.t('prefix_a'); if (dirCount == 1 && fileCount == 0) { - type = 'directory'; - prefix = 'a'; + type = i18n.t('directory'); + prefix = i18n.t('prefix_a'); } if (dirCount > 1 && fileCount == 0) { @@ -40,7 +41,9 @@ function getWording(dirCount: number, fileCount: number) { prefix = (fileCount + dirCount).toString(); } - return { type, prefix }; + const translatedType = i18n.t(`${type}`); + + return { type, prefix, translatedType }; } export default (props: Props) => { @@ -53,11 +56,11 @@ export default (props: Props) => { const form = useZodForm(); const { dirCount = 0, fileCount = 0, indexedArgs, ephemeralArgs } = props; - const { type, prefix } = getWording(dirCount, fileCount); + const { type, prefix, translatedType } = getWording(dirCount, fileCount); const icon = type === 'file' || type === 'files' ? 'Document' : 'Folder'; - const description = t('delete_warning', { type }); + const description = t('delete_warning', { type: translatedType }); return ( { })} icon={} dialog={useDialog(props)} - title={t('delete_dialog_title', { prefix, type })} + title={t('delete_dialog_title', { prefix, type: translatedType })} description={description} loading={deleteFile.isLoading} ctaLabel={t('delete_forever')} ctaSecondLabel={t('move_to_trash')} + closeLabel={t('close')} ctaDanger className="w-[200px]" > diff --git a/interface/app/$libraryId/Explorer/FilePath/Original.tsx b/interface/app/$libraryId/Explorer/FilePath/Original.tsx index 6bd3e2a95..90c6f0c67 100644 --- a/interface/app/$libraryId/Explorer/FilePath/Original.tsx +++ b/interface/app/$libraryId/Explorer/FilePath/Original.tsx @@ -17,7 +17,7 @@ import { usePlatform } from '~/util/Platform'; import { useExplorerContext } from '../Context'; import { explorerStore } from '../store'; -import { ExplorerItemData } from '../util'; +import { ExplorerItemData } from '../useExplorerItemData'; import { Image } from './Image'; import { useBlackBars, useSize } from './utils'; @@ -29,6 +29,7 @@ interface OriginalRendererProps { isDark: boolean; childClassName?: string; size?: number; + magnification?: number; mediaControls?: boolean; frame?: boolean; isSidebarPreview?: boolean; @@ -163,16 +164,23 @@ const ORIGINAL_RENDERERS: { const size = useSize(ref); return ( - +
+ +
); } }; diff --git a/interface/app/$libraryId/Explorer/FilePath/Thumb.tsx b/interface/app/$libraryId/Explorer/FilePath/Thumb.tsx index 337471cd5..afd71e347 100644 --- a/interface/app/$libraryId/Explorer/FilePath/Thumb.tsx +++ b/interface/app/$libraryId/Explorer/FilePath/Thumb.tsx @@ -15,7 +15,7 @@ import { useIsDark } from '~/hooks'; import { pdfViewerEnabled } from '~/util/pdfViewer'; import { usePlatform } from '~/util/Platform'; -import { useExplorerItemData } from '../util'; +import { useExplorerItemData } from '../useExplorerItemData'; import { Image, ImageProps } from './Image'; import LayeredFileIcon from './LayeredFileIcon'; import { Original } from './Original'; @@ -40,6 +40,7 @@ export interface ThumbProps { childClassName?: string | ((type: ThumbType) => string | undefined); isSidebarPreview?: boolean; childProps?: HTMLAttributes; + magnification?: number; } type ThumbType = { variant: 'original' } | { variant: 'thumbnail' } | { variant: 'icon' }; @@ -68,7 +69,7 @@ export const FileThumb = forwardRef((props, ref) = if ( loadState.thumbnail !== 'error' && itemData.hasLocalThumbnail && - itemData.thumbnailKey.length > 0 + itemData.thumbnailKey ) return { variant: 'thumbnail' }; @@ -86,7 +87,7 @@ export const FileThumb = forwardRef((props, ref) = break; case 'thumbnail': - if (itemData.thumbnailKey.length > 0) + if (itemData.thumbnailKey) return platform.getThumbnailUrlByThumbKey(itemData.thumbnailKey); break; @@ -217,6 +218,7 @@ export const FileThumb = forwardRef((props, ref) = isDark={isDark} childClassName={childClassName} size={props.size} + magnification={props.magnification} mediaControls={props.mediaControls} frame={props.frame} isSidebarPreview={props.isSidebarPreview} diff --git a/interface/app/$libraryId/Explorer/Inspector/MediaData.tsx b/interface/app/$libraryId/Explorer/Inspector/MediaData.tsx index 6aaddf84a..3a2bebc46 100644 --- a/interface/app/$libraryId/Explorer/Inspector/MediaData.tsx +++ b/interface/app/$libraryId/Explorer/Inspector/MediaData.tsx @@ -1,13 +1,13 @@ import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; // import plugin - -import utc from 'dayjs/plugin/utc'; // import plugin - import { + capitalize, CoordinatesFormat, - MediaDate, + ExifMetadata, + FFmpegMetadata, + humanizeSize, + int32ArrayToBigInt, MediaLocation, - MediaMetadata, + MediaData as RemoteMediaData, useSelector, useUnitFormatStore } from '@sd/client'; @@ -18,38 +18,6 @@ import { Platform, usePlatform } from '~/util/Platform'; import { explorerStore } from '../store'; import { MetaData } from './index'; -interface Props { - data: MediaMetadata; -} - -// const DateFormatWithTz = 'YYYY-MM-DD HH:mm:ss ZZ'; -// const DateFormatWithoutTz = 'YYYY-MM-DD HH:mm:ss'; - -// const formatMediaDate = (datetime: MediaDate): { formatted: string; raw: string } | undefined => { -// dayjs.extend(customParseFormat); -// dayjs.extend(utc); - -// // dayjs.tz.setDefault(dayjs.tz.guess()); - -// const getTzData = (dt: string): [string, number] => { -// if (dt.includes('+')) -// return [DateFormatWithTz, Number.parseInt(dt.substring(dt.indexOf('+'), 3))]; -// return [DateFormatWithoutTz, 0]; -// }; - -// const [tzFormat, tzOffset] = getTzData(datetime); - -// console.log({ -// formatted: dayjs(datetime, tzFormat).utcOffset(tzOffset).format('HH:mm:ss, MMM Do YYYY'), -// raw: datetime -// }); - -// return { -// formatted: dayjs(datetime, tzFormat).utcOffset(tzOffset).format('HH:mm:ss, MMM Do YYYY'), -// raw: datetime -// }; -// }; - const formatLocationDD = (loc: MediaLocation, dp?: number): string => { // the lack of a + here will mean that coordinates may have padding at the end // google does the same (if one is larger than the other, the smaller one will be padded with zeroes) @@ -99,24 +67,157 @@ const UrlMetadataValue = (props: { text: string; url: string; platform: Platform
); -// const orientations = { -// Normal: 'Normal', -// MirroredHorizontal: 'Horizontally mirrored', -// MirroredHorizontalAnd90CW: 'Mirrored horizontally and rotated 90° clockwise', -// MirroredHorizontalAnd270CW: 'Mirrored horizontally and rotated 270° clockwise', -// MirroredVertical: 'Vertically mirrored', -// CW90: 'Rotated 90° clockwise', -// CW180: 'Rotated 180° clockwise', -// CW270: 'Rotated 270° clockwise' -// }; - -const MediaData = ({ data }: Props) => { +const ExifMediaData = (data: ExifMetadata) => { const platform = usePlatform(); const { t } = useLocale(); const coordinatesFormat = useUnitFormatStore().coordinatesFormat; const showMoreInfo = useSelector(explorerStore, (s) => s.showMoreInfo); - return data.type === 'Image' ? ( + return ( + <> + + + + ) + } + /> + + ) + } + /> + + + + + + + + + + + ); +}; + +const FFmpegMediaData = (data: FFmpegMetadata) => { + const { t } = useLocale(); + + const streamKinds = new Set( + data.programs.flatMap((program) => program.streams.map((stream) => stream.codec?.kind)) + ); + const type = streamKinds.has('video') + ? 'Video' + : streamKinds.has('audio') + ? 'Audio' + : capitalize(streamKinds.values().next().value) ?? 'Unknown'; + + const bit_rate = humanizeSize(int32ArrayToBigInt(data.bit_rate), { + is_bit: true, + base_unit: 'binary', + use_plural: false + }); + + const duration_ms = data.duration ? int32ArrayToBigInt(data.duration) / 1000n : null; + const duration = duration_ms + ? dayjs.duration( + Number(duration_ms / 1000n) + Number(duration_ms % 1000n) / 1000, + 'seconds' + ) + : null; + + const start_time_ms = data.start_time ? int32ArrayToBigInt(data.start_time) / 1000n : null; + const start_time = start_time_ms + ? dayjs.duration( + Number(start_time_ms / 1000n) + Number(start_time_ms % 1000n) / 1000, + 'seconds' + ) + : null; + + const chapters = data.chapters + .map((chapter) => { + const num = BigInt(chapter.time_base_num); + const den = BigInt(chapter.time_base_den); + + const start = dayjs.duration( + Number((int32ArrayToBigInt(chapter.start) * num) / den), + 'seconds' + ); + + const end = dayjs.duration( + Number((int32ArrayToBigInt(chapter.end) * num) / den), + 'seconds' + ); + + return `${start.format('HH:mm:ss')} - ${end.format('HH:mm:ss')}`; + }) + .join('\n'); + + return ( + <> + + + {duration && } + {start_time && ( + + )} + {chapters && } + + ); +}; + +interface Props { + data: RemoteMediaData; +} + +export const MediaData = ({ data }: Props) => { + const { t } = useLocale(); + const showMoreInfo = useSelector(explorerStore, (s) => s.showMoreInfo); + + return (
{ variant="apple" title={t('more_info')} > - - - - ) - } - /> - - ) - } - /> - - - - - - - - - + {'Exif' in data ? ExifMediaData(data.Exif) : FFmpegMediaData(data.FFmpeg)}
- ) : null; + ); }; export default MediaData; diff --git a/interface/app/$libraryId/Explorer/Inspector/Note.tsx b/interface/app/$libraryId/Explorer/Inspector/Note.tsx index 4ab35e0c0..bd440441c 100644 --- a/interface/app/$libraryId/Explorer/Inspector/Note.tsx +++ b/interface/app/$libraryId/Explorer/Inspector/Note.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react'; import { useDebouncedCallback } from 'use-debounce'; import { Object as SDObject, useLibraryMutation } from '@sd/client'; import { Divider, TextArea } from '@sd/ui'; +import { useLocale } from '~/hooks'; import { MetaContainer, MetaTitle } from '../Inspector'; @@ -27,12 +28,13 @@ export default function Note(props: Props) { useEffect(() => () => flush.current?.(), []); const [cachedNote, setCachedNote] = useState(props.data.note); + const { t } = useLocale(); return ( <> - Note + {t('note')}