@rizom/brain 0.2.0-alpha.220 → 0.2.0-alpha.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{a,b}from"./index-wwsjsaez.js";import"./index-rcxrkj9z.js";import"./index-920pgj26.js";import"./index-457w4zv3.js";import"./index-c7ehmqhv.js";import"./index-e7bz0548.js";import"./index-q9sthmbv.js";import"./index-zmtkjeqj.js";import"./index-r4f9aab7.js";import"./index-7j5wm2z5.js";export{b as blogPostAdapter,a as BlogPostAdapter};
3
+
4
+ //# debugId=1740B4E5E07C590464756E2164756E21
5
+ //# sourceMappingURL=blog-post-adapter-b2z9z4sr.js.map
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{E as _,G as j,H as Q,I as y,J as L,K as D,L as q,P as S,Q as E,R as U,S as v,T as WZ,Y as cA,Z as uA}from"./index-c7ehmqhv.js";import{Aa as pA,Ba as c,ta as oA,wa as M}from"./index-gbnw7xez.js";import{Ka as wZ}from"./index-zmtkjeqj.js";import{Ra as Z}from"./index-r4f9aab7.js";var _$=Z.object({id:Z.string(),sessionId:Z.string(),interfaceType:Z.string(),channelId:Z.string(),channelName:Z.string().optional(),startedAt:Z.string(),lastActiveAt:Z.string(),createdAt:Z.string(),updatedAt:Z.string(),metadata:c}),O$=Z.object({id:Z.string(),conversationId:Z.string(),role:M,content:Z.string(),timestamp:Z.string(),metadata:c});var WA=Z.object({name:Z.string(),role:Z.string(),purpose:Z.string(),values:Z.array(Z.string())}),KA=Z.object({name:Z.string(),kind:Z.enum(["professional","team","collective"]),organization:Z.string().optional(),description:Z.string().optional(),avatar:Z.string().optional(),website:Z.string().optional(),email:Z.string().optional(),socialLinks:Z.array(Z.object({platform:Z.enum(["github","instagram","linkedin","email","website"]),url:Z.string(),label:Z.string().optional()})).optional()});import{createClient as J$}from"@libsql/client";class VA{constructor(A,$){this.name=A,this.unique=$}static[y]="SQLiteIndexBuilderOn";on(...A){return new DA(this.name,A,this.unique)}}class DA{static[y]="SQLiteIndexBuilder";config;constructor(A,$,H){this.config={name:A,columns:$,unique:H,where:void 0}}where(A){return this.config.where=A,this}build(A){return new NA(this.config,A)}}class NA{static[y]="SQLiteIndex";config;constructor(A,$){this.config={...A,table:$}}}function w(A){return new VA(A,!1)}var z=q("conversations",{id:D("id").primaryKey(),sessionId:D("session_id").notNull(),interfaceType:D("interface_type").notNull(),channelId:D("channel_id").notNull(),started:D("started").notNull(),lastActive:D("last_active").notNull(),metadata:D("metadata"),created:D("created").notNull(),updated:D("updated").notNull()},(A)=>({sessionIdx:w("idx_conversations_session").on(A.sessionId),channelIdx:w("idx_conversations_channel").on(A.channelId),interfaceSessionIdx:w("idx_conversations_interface_session").on(A.interfaceType,A.sessionId),interfaceChannelIdx:w("idx_conversations_interface_channel").on(A.interfaceType,A.channelId)})),FA=q("messages",{id:D("id").primaryKey(),conversationId:D("conversation_id").notNull().references(()=>z.id,{onDelete:"cascade"}),role:D("role").notNull(),content:D("content").notNull(),timestamp:D("timestamp").notNull(),metadata:D("metadata")},(A)=>({conversationIdx:w("idx_messages_conversation").on(A.conversationId),timestampIdx:w("idx_messages_timestamp").on(A.timestamp)})),UA=q("summary_tracking",{conversationId:D("conversation_id").primaryKey().references(()=>z.id,{onDelete:"cascade"}),lastSummarizedAt:D("last_summarized_at"),lastMessageId:D("last_message_id"),messagesSinceSummary:L("messages_since_summary").default(0),updated:D("updated").notNull()});var OZ=Z.preprocess((A)=>{if(typeof A!=="string")return A;try{return JSON.parse(A)}catch{return}},Z.record(Z.string(),Z.unknown())).catch({});function J(A){return OZ.parse(A)}var m=Z.object({actorId:Z.string(),canonicalId:Z.string().optional(),interfaceType:Z.string(),role:M,displayName:Z.string().optional(),username:Z.string().optional(),isBot:Z.boolean().optional()}),h=Z.object({messageId:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),threadId:Z.string().optional(),metadata:Z.record(Z.string(),Z.unknown()).optional()}),CZ=Z.looseObject({actor:m.optional(),source:h.optional()});var BZ=Z.object({id:Z.string(),conversationId:Z.string(),role:Z.string(),content:Z.string(),timestamp:Z.string(),metadata:Z.string().nullable()}),MZ=Z.object({conversationId:Z.string(),messageCount:Z.number(),messages:Z.array(BZ),windowStart:Z.number(),windowEnd:Z.number(),windowSize:Z.number(),timestamp:Z.string()});var RA=Z.object({kind:Z.string().min(1),id:Z.string().min(1)}),kZ=Z.object({kind:Z.literal("text"),filename:Z.string().min(1),mediaType:Z.string().min(1),content:Z.string(),sizeBytes:Z.number().nonnegative().optional(),source:RA.optional()}),EZ=Z.custom((A)=>A instanceof Uint8Array),fZ=Z.object({kind:Z.literal("file"),filename:Z.string().min(1),mediaType:Z.string().min(1),data:EZ,sizeBytes:Z.number().nonnegative().optional(),source:RA.optional()}),JZ=Z.discriminatedUnion("kind",[kZ,fZ]),U1=Z.object({userPermissionLevel:Z.enum(["anchor","trusted","public"]).optional(),interfaceType:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),actor:m.optional(),source:h.optional(),attachments:Z.array(JZ).optional()});var TZ=Z.object({status:Z.enum(["healthy","warning","error","unknown"]),message:Z.string().optional(),lastCheck:Z.date().optional(),details:Z.record(Z.string(),Z.unknown()).optional()}),wA=Z.object({name:Z.string(),pluginId:Z.string(),status:Z.string(),health:TZ.optional()});import{McpServer as S1,ResourceTemplate as x1}from"@modelcontextprotocol/sdk/server/mcp.js";var LA=Z.object({interfaceType:Z.string(),userId:Z.string(),conversationId:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),runId:Z.string().optional(),toolCallId:Z.string().optional(),userPermissionLevel:Z.enum(["anchor","trusted","public"]).optional()}),_A=Z.strictObject({success:Z.literal(!0),data:Z.unknown().optional(),message:Z.string().optional(),cached:Z.literal(!0).optional()}),OA=Z.strictObject({success:Z.literal(!1),error:Z.string(),code:Z.string().optional()}),CA=Z.strictObject({needsConfirmation:Z.literal(!0),toolName:Z.string(),summary:Z.string(),completionSummary:Z.string().optional(),preview:Z.string().optional(),args:Z.unknown()}),u=Z.union([_A,OA,CA]);var q1=Z.union([Z.looseObject({success:Z.literal(!0)}),Z.object({success:Z.literal(!1),error:Z.string()})]);var SZ=Z.union([Z.object({success:Z.literal(!0),data:Z.unknown(),message:Z.string().optional()}),Z.object({success:Z.literal(!1),error:Z.string(),code:Z.string().optional()})]);var BH=Z.object({id:Z.string(),type:Z.string(),version:Z.string(),status:Z.string()}),MH=Z.object({name:Z.string(),description:Z.string()}),BA=Z.enum(["anchor","trusted","public"]),d=Z.object({label:Z.string(),url:Z.string(),pluginId:Z.string(),priority:Z.number().default(100),visibility:BA.default("public")}),xZ=Z.enum(["human","agent","admin","protocol"]),yZ=Z.enum(["available","coming-soon","disabled"]),l=Z.object({id:Z.string(),label:Z.string(),description:Z.string().optional(),href:Z.string(),kind:xZ,pluginId:Z.string(),priority:Z.number().default(100),visibility:BA.default("public"),status:yZ.default("available")}),i=Z.object({entityType:Z.string(),count:Z.number()}),qH=Z.object({model:Z.string(),version:Z.string(),uptime:Z.number(),entities:Z.number(),entityCounts:Z.array(i),embeddings:Z.number(),ai:Z.object({model:Z.string(),embeddingModel:Z.string()}),daemons:Z.array(wA),endpoints:Z.array(d),interactions:Z.array(l)});var QH=Z.object({id:Z.string(),version:Z.string(),type:Z.enum(["core","entity","service","interface"]),description:Z.string().optional(),dependencies:Z.array(Z.string()).optional(),packageName:Z.string()});var zZ=Z.object({status:Z.enum(["healthy","warning","error","unknown"]),message:Z.string().optional(),lastCheck:Z.string().optional(),details:Z.record(Z.string(),Z.unknown()).optional()}),mZ=Z.object({name:Z.string(),pluginId:Z.string(),status:Z.string(),health:zZ.optional()}),TH=Z.object({model:Z.string(),version:Z.string(),uptime:Z.number(),entities:Z.number(),entityCounts:Z.array(i),embeddings:Z.number(),ai:Z.object({model:Z.string(),embeddingModel:Z.string()}),daemons:Z.array(mZ),endpoints:Z.array(d),interactions:Z.array(l)});var yH=Z.object({enabled:Z.boolean().describe("Whether the plugin is enabled"),debug:Z.boolean().describe("Enable debug logging for this plugin")});class n extends Error{pluginId;issues;constructor(A,$){super(`Invalid plugin config for ${A}`);this.name="PluginConfigValidationError",this.pluginId=A,this.issues=$}}var r=Z.enum(["file_operations","content_operations","data_processing","batch_processing"]),hZ=Z.object({pluginId:Z.string().optional(),progressToken:Z.union([Z.string(),Z.number()]).optional(),operationType:r,operationTarget:Z.string().optional(),interfaceType:Z.string().optional(),conversationId:Z.string().optional(),channelId:Z.string().optional(),silent:Z.boolean().optional()}),k=Z.object({pluginId:Z.string().optional(),progressToken:Z.union([Z.string(),Z.number()]).optional(),operationType:r,operationTarget:Z.string().optional(),interfaceType:Z.string().optional(),conversationId:Z.string().optional(),channelId:Z.string().optional(),silent:Z.boolean().optional(),rootJobId:Z.string()}),hH=Z.enum(["none","skip","replace","coalesce"]);var a=Z.enum(["pending","processing","completed","failed"]),MA=Z.enum(["completed","failed"]);var jZ=Z.object({id:Z.string(),type:Z.string(),status:a,data:Z.unknown(),result:Z.unknown().optional(),lastError:Z.string().optional().nullable(),attempts:Z.number(),maxRetries:Z.number(),priority:Z.number(),createdAt:Z.date(),updatedAt:Z.date(),processedAt:Z.date().optional().nullable(),completedAt:Z.date().optional().nullable(),failedAt:Z.date().optional().nullable()}),vZ=Z.object({jobId:Z.string(),type:Z.string(),status:MA,result:Z.unknown().optional(),error:Z.string().optional()}),qA=Z.object({success:Z.literal(!1),error:Z.string().optional()}),s=Z.object({id:Z.string(),type:Z.enum(["job","batch"]),status:a,message:Z.string().optional(),progress:Z.object({current:Z.number(),total:Z.number(),percentage:Z.number()}).optional(),aggregationKey:Z.string().optional(),batchDetails:Z.object({totalOperations:Z.number(),completedOperations:Z.number(),failedOperations:Z.number(),currentOperation:Z.string().optional(),errors:Z.array(Z.string()).optional()}).optional(),jobDetails:Z.object({jobType:Z.string(),priority:Z.number(),retryCount:Z.number()}).optional(),metadata:k});var IZ=Z.record(Z.string(),Z.unknown());class QA{logger;schema;jobTypeName;constructor(A,$){this.logger=A,this.schema=$.schema,this.jobTypeName=$.jobTypeName}validateAndParse(A){if(!this.schema)throw Error(`${this.jobTypeName}: No schema provided. Override validateAndParse() or provide a schema.`);let $=this.schema.safeParse(A);if(!$.success)return this.logger.warn(`Invalid ${this.jobTypeName} job data`,{data:A,validationError:$.error.issues}),null;return this.logger.debug(`${this.jobTypeName} job data validation successful`,{data:this.summarizeDataForLog($.data)}),$.data}async onError(A,$,H,Y){this.logger.error(`${this.jobTypeName} job error handler triggered`,{jobId:H,errorMessage:A.message,errorStack:A.stack,data:this.summarizeDataForLog($)})}async reportProgress(A,$){await A.report({progress:$.progress,total:$.total??100,message:$.message})}summarizeDataForLog(A){let $=IZ.safeParse(A);return $.success?$.data:{}}}import{createClient as iH}from"@libsql/client";var kA=q("job_queue",{id:D("id").primaryKey().$defaultFn(()=>Q()),type:D("type").notNull(),data:D("data").notNull(),result:D("result",{mode:"json"}),source:D("source"),metadata:D("metadata",{mode:"json"}).$type().notNull(),status:D("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:L("priority").notNull().default(0),retryCount:L("retryCount").notNull().default(0),maxRetries:L("maxRetries").notNull().default(3),lastError:D("lastError"),createdAt:L("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:L("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:L("startedAt"),completedAt:L("completedAt")},(A)=>({queueReadyIdx:w("idx_job_queue_ready").on(A.status,A.priority,A.scheduledFor),jobTypeIdx:w("idx_job_queue_type").on(A.type,A.status),jobSourceIdx:w("idx_job_queue_source").on(A.source)}));var Z4=Z.looseObject({deduplicationKey:Z.string().optional()});class O{callback;heartbeatInterval;constructor(A){this.callback=A}static from(A){if(!A)return;return new O(A)}createSub(A){let{scale:$}=A??{};if($){let{start:H,end:Y}=$,X=Y-H;return new O(async(G)=>{let W=H+G.progress/(G.total??100)*X;await this.callback({...G,progress:W,total:100})})}return new O(this.callback)}async report(A){await this.callback(A)}startHeartbeat(A,$=5000){this.stopHeartbeat(),this.heartbeatInterval=setInterval(()=>{this.report({message:A,progress:0}).catch(()=>{})},$)}stopHeartbeat(){if(this.heartbeatInterval)clearInterval(this.heartbeatInterval),this.heartbeatInterval=void 0}toCallback(){return this.callback}}var S4=Z.preprocess((A)=>{if(typeof A!=="string")return A;return JSON.parse(A)},Z.record(Z.string(),Z.unknown()));var pZ=Z.object({id:Z.string(),type:Z.string(),data:Z.string(),status:Z.enum(["pending","processing","completed","failed"]),source:Z.string().nullable(),priority:Z.number(),retryCount:Z.number(),maxRetries:Z.number(),lastError:Z.string().nullable(),createdAt:Z.number(),scheduledFor:Z.number(),startedAt:Z.number().nullable(),completedAt:Z.number().nullable(),metadata:k,result:Z.unknown().nullable().optional()});function o(A,$,H){return async(Y)=>{let{type:X,data:G,toolContext:W=null,options:P}=Y,{metadata:K,...V}=P??{},N={source:$,...P?.rootJobId&&{rootJobId:P.rootJobId},...V,metadata:{operationType:"data_processing",pluginId:$,...W&&{interfaceType:W.interfaceType,channelId:W.channelId},...K}},F=H&&!X.includes(":")?`${$}:${X}`:X;return A.enqueue({type:F,data:G,options:N})}}function t(A,$){return async(H,Y)=>{let X=Q(),G=H.map((P)=>({...P,type:P.type.includes(":")?P.type:`${$}:${P.type}`})),W={...Y,source:$,rootJobId:X,metadata:{...Y?.metadata,operationType:"batch_processing",pluginId:$}};return await A.enqueueBatch(G,W,X,$),X}}function e(A,$){return(H,Y)=>{let X=H.includes(":")?H:`${$}:${H}`;A.registerHandler(X,Y,$)}}var cZ=Z.custom((A)=>typeof A==="object"&&A!==null&&("safeParse"in A)),uZ=Z.object({name:Z.string(),schema:cZ});function EA(A){return uZ.safeParse(A).success}function dZ(A){if(!A)return;return{status:A.status,message:A.message,lastCheck:A.lastCheck?.toISOString(),details:A.details}}function fA(A){return{model:A.model,version:A.version,uptime:A.uptime,entities:A.entities,entityCounts:A.entityCounts,embeddings:A.embeddings,ai:A.ai,daemons:A.daemons.map(($)=>({name:$.name,pluginId:$.pluginId,status:$.status,health:dZ($.health)})),endpoints:A.endpoints,interactions:A.interactions}}function lZ(A){let $=M.safeParse(A);return $.success?$.data:"user"}function I(A){let $=J(A.metadata),H=typeof $.channelName==="string"?$.channelName:void 0;return{id:A.id,sessionId:A.sessionId,interfaceType:A.interfaceType,channelId:A.channelId,channelName:H,startedAt:A.started,lastActiveAt:A.lastActive,createdAt:A.created,updatedAt:A.updated,metadata:$}}function JA(A){return{id:A.id,conversationId:A.conversationId,role:lZ(A.role),content:A.content,timestamp:A.timestamp,metadata:J(A.metadata)}}function TA(A){return WA.parse(A)}function SA(A){return KA.parse(A)}function xA(A){return async()=>{return fA(await A.getAppInfo())}}function yA(A,$){return{get:()=>TA(A.getIdentity()),getProfile:()=>SA(A.getProfile()),getAppInfo:$}}function zA(A,$,H){let Y=A.getMessageBus();return{send:async(G)=>{return Y.send({...G,sender:$})},subscribe:(G,W)=>{if(EA(G)){let P=G,K=W,V=async(N)=>{let F=P.schema.safeParse(N.payload);if(!F.success)return H.warn(`Invalid payload for channel ${P.name}`,{error:F.error.message}),{noop:!0};let{payload:B,...R}=N;return K(F.data,R)};return Y.subscribe(P.name,V)}return Y.subscribe(G,W)}}}function mA(A,$){let H=A.getJobQueueService();return{...A.jobs,enqueue:o(H,$,!0),enqueueBatch:t(A.jobs,$),registerHandler:e(H,$)}}function hA(A){let $=A.getPermissionService();return{assertEntityActionAllowed:(H,Y,X)=>{$.assertEntityActionAllowed(H,Y,X.userPermissionLevel)}}}function jA(A){return{get:async($)=>{let Y=await A.getConversationService().getConversation($);return Y?I(Y):null},search:async($)=>{return(await A.getConversationService().searchConversations($)).map(I)},list:async($)=>{return(await A.getConversationService().listConversations($)).map(I)},getMessages:async($,H)=>{return(await A.getConversationService().getMessages($,H)).map(JA)},countMessages:async($)=>{return A.getConversationService().countMessages($)}}}function vA(A,$){return{registerHandler:(H,Y)=>{A.registerEvalHandler($,H,Y)}}}function IA(A){return{register:($,H)=>{A.getInsightsRegistry().register($,H)}}}function gA(A,$){return{register:(H)=>{A.registerEndpoint({...H,pluginId:$})}}}function bA(A,$){return{register:(H)=>{A.registerInteraction({...H,pluginId:$})}}}function f(A,$,H){let Y=A.getEntityService(),X=A.getLogger().child($),G=A.getDomain(),W=A.getLocalSiteUrl(),P=A.shouldPreferLocalUrls(),K=A.getThemeCSS(),V=xA(A),N=A.getAttachmentRegistry(),F=A.getRuntimeUploadRegistry(),B=A.getRuntimeState();return{pluginId:$,logger:X,entityService:Y,semantic:{project:(R)=>Y.projectSemanticSpace(R)},identity:yA(A,V),appInfo:V,judge:(R)=>A.judge(R),domain:G,siteUrl:G?`https://${G}`:void 0,localSiteUrl:W,previewUrl:G?`https://${pA(G)}`:void 0,preferLocalUrls:P,themeCSS:K,entityDisplay:H?.entityDisplay,spaces:A.getSpaces(),permissions:hA(A),messaging:zA(A,$,X),jobs:mA(A,$),attachments:N,uploads:F,runtimeState:B,recurringChecks:A.getRecurringChecks($),conversations:jA(A),dataDir:A.getDataDir(),eval:vA(A,$),insights:IA(A),endpoints:gA(A,$),interactions:bA(A,$)}}function iZ(A){return A.replace(/:/g,"-")}function nZ(A){return A.split(/[:.-]/).map(($)=>$.charAt(0).toUpperCase()+$.slice(1)).join(" ")}var AA=new Map;async function dA(A,$,H){let Y=AA.get($);if(Y!==void 0)return Y;let X=iZ($),G;try{G=await A.getEntity({entityType:"prompt",id:X})}catch{return H}if(G?.content){let W=uA(G.content,Z.record(Z.string(),Z.unknown())).content;return AA.set($,W),W}try{let W=nZ($),P=cA(H,{title:W,target:$});await A.createEntity({entity:{id:X,entityType:"prompt",content:P,metadata:{title:W,target:$,slug:X}}})}catch{}return AA.set($,H),H}function g(A){let $=A.getEntityService(),H=A.getEntityRegistry(),Y=A.getDataSourceRegistry();return{register:(X,G,W,P)=>{H.registerEntityType(X,G,W,P)},getAdapter:(X)=>{try{return H.getAdapter(X)}catch{return}},extendFrontmatterSchema:(X,G)=>{H.extendFrontmatterSchema(X,G)},getEffectiveFrontmatterSchema:(X)=>{return H.getEffectiveFrontmatterSchema(X)},registerCreateInterceptor:(X,G)=>{H.registerCreateInterceptor(X,G)},registerUploadSaveHandler:(X)=>{H.registerUploadSaveHandler(X)},getUploadSaveHandler:(X)=>{return H.getUploadSaveHandler(X)},update:async(X)=>{return $.updateEntity({entity:X})},registerDataSource:(X)=>{Y.register(X)}}}function b(A){return{resolve:($,H)=>{return dA(A,$,H)}}}function lA(A,$,H){let Y=f(A,$,H),X=A.getEntityService();return{...Y,entityService:X,entities:g(A),ai:{query:(G,W)=>A.query(G,W),generate:async(G)=>{return A.generateContent(G)},generateObject:async(G,W,P)=>{return A.generateObject(G,W,P)},generateImage:async(G,W)=>{return A.generateImage(G,W)},canGenerateImages:()=>{return A.canGenerateImages()}},prompts:b(X),permissions:Y.permissions}}function nA(A,$,H){let Y=!1,X=!1;if(A.jobs.registerHandler(H.job.type,H.job.handler),H.initialSync){let G=H.initialSync;A.messaging.subscribe("sync:initial:completed",async()=>{if(Y)return{success:!0};if(Y=!0,!(await G.shouldEnqueue?.()??!0))return $.info("Skipping derived entity projection initial sync",{projectionId:H.id,targetType:H.targetType}),{success:!0};return X=await iA(A,$,H,G.jobData,aZ(G.jobOptions),"initial-sync"),{success:!0}})}if(H.sourceChange){let G=H.sourceChange,W=new Set(G.sourceTypes),P=G.events??["entity:created","entity:updated"],K=async(V)=>{if(G.requireInitialSync&&!Y)return{success:!0};let N=V.payload,F=rZ(G,N);if(!F||!W.has("*")&&!W.has(F))return{success:!0};if(!(await G.shouldEnqueue?.(N)??!0))return{success:!0};let R=await G.jobData(N);if(!R)return{success:!0};return await iA(A,$,H,R,G.jobOptions?.(N),"source-change"),{success:!0}};for(let V of P)A.messaging.subscribe(V,K)}return{hasObservedInitialSync:()=>Y,hasQueuedInitialSync:()=>X}}function rZ(A,$){if(A.sourceType)return A.sourceType;if(A.sourceKind&&A.sourceKind!=="entity")return A.sourceKind;return $.entityType}async function iA(A,$,H,Y,X,G){try{return await A.jobs.enqueue({type:H.job.type,data:Y,...X?{options:X}:{}}),$.info("Queued derived entity projection",{projectionId:H.id,targetType:H.targetType,reason:G}),!0}catch(W){return $.error("Failed to queue derived entity projection",{projectionId:H.id,targetType:H.targetType,reason:G,error:_(W)}),!1}}function aZ(A){return typeof A==="function"?A():A}var sZ=Z.object({toolName:Z.string(),args:Z.unknown(),progressToken:Z.union([Z.string(),Z.number()]).optional(),hasProgress:Z.boolean().optional(),interfaceType:Z.string(),userId:Z.string(),conversationId:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),runId:Z.string().optional(),toolCallId:Z.string().optional(),userPermissionLevel:Z.enum(["anchor","trusted","public"]).optional(),signal:Z.custom((A)=>A instanceof AbortSignal).optional()}),oZ=Z.object({resourceUri:Z.string()});class C{id;version;description;packageName;config;context;get logger(){return this.context?.logger??j.createFresh({context:this.id})}constructor(A,$,H,Y){this.id=A,this.packageName=$.name,this.version=$.version,this.description=$.description??`${$.name} plugin`;let X=Y.safeParse(H);if(!X.success)throw new n(A,X.error.issues.map((G)=>({path:G.path.map(String).join("."),code:G.code,message:G.message})));this.config=X.data}setupMessageHandlers(A){A.messaging.subscribe(`plugin:${this.id}:tool:execute`,async($)=>{try{let H=sZ.safeParse($.payload);if(!H.success)return{success:!1,error:"Invalid tool execution request format"};let{toolName:Y,args:X,progressToken:G,hasProgress:W,interfaceType:P,userId:K,conversationId:V,channelId:N,channelName:F,runId:B,toolCallId:R,userPermissionLevel:XA,signal:GA}=H.data,PA=(await this.getTools()).find((p)=>p.name===Y);if(!PA)return{success:!1,error:`Tool not found: ${Y}`};let _Z={interfaceType:P,userId:K,...V&&{conversationId:V},...N&&{channelId:N},...F&&{channelName:F},...B&&{runId:B},...R&&{toolCallId:R},...XA&&{userPermissionLevel:XA},...GA&&{signal:GA},...W&&G!==void 0&&{progressToken:G,sendProgress:async(p)=>{await A.messaging.send({type:`plugin:${this.id}:progress`,payload:{progressToken:G,notification:p}})}}};return{success:!0,data:await PA.handler(X,_Z)}}catch(H){return this.logger.error("Tool execution error",H),{success:!1,error:_(H)}}}),A.messaging.subscribe(`plugin:${this.id}:resource:get`,async($)=>{try{let H=oZ.safeParse($.payload);if(!H.success)return{success:!1,error:"Invalid resource get request format"};let{resourceUri:Y}=H.data,G=(await this.getResources()).find((P)=>P.uri===Y);if(!G)return{success:!1,error:`Resource not found: ${Y}`};return{success:!0,data:await G.handler()}}catch(H){return this.logger.error("Resource fetch error",H),{success:!1,error:_(H)}}})}async onRegister(A){}async onReady(A){}async ready(){await this.onReady(this.getContext())}async getCapabilities(){let A=await this.getInstructions();return{tools:await this.getTools(),resources:await this.getResources(),...A&&{instructions:A}}}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}async shutdown(){await this.onShutdown()}async onShutdown(){}getContext(){if(!this.context)throw Error(`Plugin ${this.id}: Plugin not registered yet`);return this.context}determineUserPermissionLevel(A){return"public"}createProgressBridge(A){if(!A)return;let $=this.context;if(!$)return;let H=this.id;return O.from(async(Y)=>{await $.messaging.send({type:`plugin:${H}:progress`,payload:{progressToken:A,notification:{progress:Y.progress,total:Y.total,message:Y.message}}})})}}var j6=Z.object({});class rA extends C{type="entity";entityActionPolicy;derivedEntityProjectionControllers=new Map;constructor(A,$,H,Y,X){super(A,$,H,Y);if(X!==void 0)this.entityActionPolicy=X}async register(A,$){let H=lA(A,this.id,$);if(this.context=H,this.setupMessageHandlers(H),H.entities.register(this.entityType,this.schema,this.adapter,this.getEntityTypeConfig()),this.interceptCreate!==rA.prototype.interceptCreate)H.entities.registerCreateInterceptor(this.entityType,(K,V)=>this.interceptCreate(K,V,H));let Y=this.createGenerationHandler(H);if(Y)H.jobs.registerHandler(`${this.entityType}:generation`,Y);let X=this.getTemplates();if(X&&Object.keys(X).length>0)A.registerTemplates(X,this.id);let G=this.getDataSources();for(let K of G)H.entities.registerDataSource(K);let W=this.getDerivedEntityProjections(H);for(let K of W){let V=nA(H,this.logger,K);this.derivedEntityProjectionControllers.set(K.id,V)}await this.onRegister(this.context);let P=await this.getInstructions();return{tools:[],resources:[],...P&&{instructions:P}}}async interceptCreate(A,$,H){return{kind:"continue",input:A}}createGenerationHandler(A){return null}getTemplates(){return null}getDataSources(){return[]}getEntityTypeConfig(){return}getDerivedEntityProjections(A){return[]}getDerivedEntityProjectionController(A){return this.derivedEntityProjectionControllers.get(A)}}function aA(A){return oA(A)}function sA(A){if(!A)return;return{...A.userPermissionLevel&&{userPermissionLevel:A.userPermissionLevel},...A.interfaceType&&{interfaceType:A.interfaceType},...A.channelId&&{channelId:A.channelId},...A.channelName&&{channelName:A.channelName},...A.actor&&{actor:A.actor},...A.source&&{source:A.source},...A.attachments&&{attachments:A.attachments}}}function tA(A){return{chat:async($,H,Y,X)=>{let G=sA(Y),W=X?await A.chat($,H,G,X):await A.chat($,H,G);return aA(W)},confirmPendingAction:async($,H,Y,X,G)=>{let W=sA(X);if(!W)throw Error("Confirmation requires caller context.");let P=G?await A.confirmPendingAction($,H,Y,W,G):await A.confirmPendingAction($,H,Y,W);return aA(P)},invalidate:()=>{A.invalidateAgent()}}}function eA(A,$,H){let Y=f(A,$,H),X=A.getMCPService(),G=A.getPermissionService(),W=tA(A.getAgentService());return{...Y,mcpTransport:X,agent:W,permissions:{...Y.permissions,getUserLevel:(P,K,V)=>{return G.determineUserLevel(P,K,V)}},daemons:{register:(P,K)=>{let V=`${$}:${P}`;A.registerDaemon(V,K,$),Y.logger.debug(`Registered daemon: ${V}`)}},conversations:{...Y.conversations,start:async(P)=>{return A.getConversationService().startConversation(P)},addMessage:async(P)=>{await A.getConversationService().addMessage(P)},updateMetadata:async(P)=>{return A.getConversationService().updateConversationMetadata(P)},delete:async(P)=>{return A.getConversationService().deleteConversation(P)}},tools:{listForPermissionLevel:(P)=>{return A.listToolsForPermissionLevel(P)}},apiRoutes:{getRoutes:()=>{return A.getPluginApiRoutes()},getMessageBus:()=>{return A.getMessageBus()}},webRoutes:{getRoutes:()=>{return A.getPluginWebRoutes()}},plugins:{has:(P)=>A.hasPlugin(P)}}}var tZ=3600000;class ZA extends C{type="interface";daemon;jobTrackingEntries=new Map;jobTrackingTtlMs=tZ;async register(A,$){let H=eA(A,this.id,$);if(this.context=H,this.initializeDaemon(),this.daemon)await this.registerDaemon(H);return this.setupMessageHandlers(H),await this.onRegister(H),this.getCapabilities()}async onRegister(A){}async registerDaemon(A){if(!this.daemon)return;A.daemons.register(this.id,this.daemon),A.logger.debug(`Registered daemon for interface: ${this.id}`)}createDaemon(){return}requiresDaemonStartup(){return!1}getWebRoutes(){return[]}initializeDaemon(){let A=this.createDaemon();if(A)this.daemon=A}async handleProgressEvent(A,$){}cleanupExpiredEntries(){let A=Date.now(),$=[];for(let[H,Y]of this.jobTrackingEntries)if(A-Y.createdAt>this.jobTrackingTtlMs)$.push(H);for(let H of $)this.jobTrackingEntries.delete(H)}ownsJob(A,$){return this.jobTrackingEntries.has(A)||$!==void 0&&this.jobTrackingEntries.has($)}getJobTracking(A,$){let H=this.jobTrackingEntries.get(A);if(H)return H.info;if($){let Y=this.jobTrackingEntries.get($);if(Y)return Y.info}return}setJobTracking(A,$){this.cleanupExpiredEntries(),this.jobTrackingEntries.set(A,{info:$,createdAt:Date.now()})}removeJobTracking(A){this.jobTrackingEntries.delete(A)}async createJobWithTracking(A,$){let Y=await this.getContext().jobs.enqueue(A);return this.setJobTracking(Y,$),Y}async createBatchWithTracking(A,$,H){let X=await this.getContext().jobs.enqueueBatch(A,H);return this.setJobTracking(X,$),X}}function x(A,$){return{state:$,toolName:A.toolName,conversationId:A.conversationId,interfaceType:A.interfaceType,...A.channelId!==void 0&&{channelId:A.channelId},...A.channelName!==void 0&&{channelName:A.channelName},...A.error!==void 0&&{error:A.error}}}function AZ(A,$){return A.pendingConfirmations?.some((H)=>H.toolName===$)===!0||eZ(A.cards).some((H)=>H.toolName===$)}function eZ(A){return A?.filter(($)=>$.kind==="tool-approval"&&$.state==="approval-requested")??[]}var $A=1e5,A$=[".md",".txt",".markdown"],Z$=["text/plain","text/markdown","text/x-markdown"],$$=/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi,H$=["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"],Y$=Z.object({captureUrls:Z.boolean().default(!1),blockedUrlDomains:Z.array(Z.string()).default(H$)});function ZZ(A,$){if($&&Z$.some((H)=>$.startsWith(H)))return!0;return A$.some((H)=>A.toLowerCase().endsWith(H))}function $Z(A){return A<=$A}function HZ(A){if(A.includes(0))return!1;try{return new TextDecoder("utf-8",{fatal:!0}).decode(A),!0}catch{return!1}}function YZ(A,$){return`User uploaded a file "${A}":
2
+ import{E as _,G as j,H as Q,I as y,J as L,K as D,L as q,P as S,Q as E,R as U,S as v,T as WZ,Y as cA,Z as uA}from"./index-c7ehmqhv.js";import{Aa as pA,Ba as c,ta as oA,wa as M}from"./index-e7bz0548.js";import{Ka as wZ}from"./index-zmtkjeqj.js";import{Ra as Z}from"./index-r4f9aab7.js";var _$=Z.object({id:Z.string(),sessionId:Z.string(),interfaceType:Z.string(),channelId:Z.string(),channelName:Z.string().optional(),startedAt:Z.string(),lastActiveAt:Z.string(),createdAt:Z.string(),updatedAt:Z.string(),metadata:c}),O$=Z.object({id:Z.string(),conversationId:Z.string(),role:M,content:Z.string(),timestamp:Z.string(),metadata:c});var WA=Z.object({name:Z.string(),role:Z.string(),purpose:Z.string(),values:Z.array(Z.string())}),KA=Z.object({name:Z.string(),kind:Z.enum(["professional","team","collective"]),organization:Z.string().optional(),description:Z.string().optional(),avatar:Z.string().optional(),website:Z.string().optional(),email:Z.string().optional(),socialLinks:Z.array(Z.object({platform:Z.enum(["github","instagram","linkedin","email","website"]),url:Z.string(),label:Z.string().optional()})).optional()});import{createClient as J$}from"@libsql/client";class VA{constructor(A,$){this.name=A,this.unique=$}static[y]="SQLiteIndexBuilderOn";on(...A){return new DA(this.name,A,this.unique)}}class DA{static[y]="SQLiteIndexBuilder";config;constructor(A,$,H){this.config={name:A,columns:$,unique:H,where:void 0}}where(A){return this.config.where=A,this}build(A){return new NA(this.config,A)}}class NA{static[y]="SQLiteIndex";config;constructor(A,$){this.config={...A,table:$}}}function w(A){return new VA(A,!1)}var z=q("conversations",{id:D("id").primaryKey(),sessionId:D("session_id").notNull(),interfaceType:D("interface_type").notNull(),channelId:D("channel_id").notNull(),started:D("started").notNull(),lastActive:D("last_active").notNull(),metadata:D("metadata"),created:D("created").notNull(),updated:D("updated").notNull()},(A)=>({sessionIdx:w("idx_conversations_session").on(A.sessionId),channelIdx:w("idx_conversations_channel").on(A.channelId),interfaceSessionIdx:w("idx_conversations_interface_session").on(A.interfaceType,A.sessionId),interfaceChannelIdx:w("idx_conversations_interface_channel").on(A.interfaceType,A.channelId)})),FA=q("messages",{id:D("id").primaryKey(),conversationId:D("conversation_id").notNull().references(()=>z.id,{onDelete:"cascade"}),role:D("role").notNull(),content:D("content").notNull(),timestamp:D("timestamp").notNull(),metadata:D("metadata")},(A)=>({conversationIdx:w("idx_messages_conversation").on(A.conversationId),timestampIdx:w("idx_messages_timestamp").on(A.timestamp)})),UA=q("summary_tracking",{conversationId:D("conversation_id").primaryKey().references(()=>z.id,{onDelete:"cascade"}),lastSummarizedAt:D("last_summarized_at"),lastMessageId:D("last_message_id"),messagesSinceSummary:L("messages_since_summary").default(0),updated:D("updated").notNull()});var OZ=Z.preprocess((A)=>{if(typeof A!=="string")return A;try{return JSON.parse(A)}catch{return}},Z.record(Z.string(),Z.unknown())).catch({});function J(A){return OZ.parse(A)}var m=Z.object({actorId:Z.string(),canonicalId:Z.string().optional(),interfaceType:Z.string(),role:M,displayName:Z.string().optional(),username:Z.string().optional(),isBot:Z.boolean().optional()}),h=Z.object({messageId:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),threadId:Z.string().optional(),metadata:Z.record(Z.string(),Z.unknown()).optional()}),CZ=Z.looseObject({actor:m.optional(),source:h.optional()});var BZ=Z.object({id:Z.string(),conversationId:Z.string(),role:Z.string(),content:Z.string(),timestamp:Z.string(),metadata:Z.string().nullable()}),MZ=Z.object({conversationId:Z.string(),messageCount:Z.number(),messages:Z.array(BZ),windowStart:Z.number(),windowEnd:Z.number(),windowSize:Z.number(),timestamp:Z.string()});var RA=Z.object({kind:Z.string().min(1),id:Z.string().min(1)}),kZ=Z.object({kind:Z.literal("text"),filename:Z.string().min(1),mediaType:Z.string().min(1),content:Z.string(),sizeBytes:Z.number().nonnegative().optional(),source:RA.optional()}),EZ=Z.custom((A)=>A instanceof Uint8Array),fZ=Z.object({kind:Z.literal("file"),filename:Z.string().min(1),mediaType:Z.string().min(1),data:EZ,sizeBytes:Z.number().nonnegative().optional(),source:RA.optional()}),JZ=Z.discriminatedUnion("kind",[kZ,fZ]),U1=Z.object({userPermissionLevel:Z.enum(["anchor","trusted","public"]).optional(),interfaceType:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),actor:m.optional(),source:h.optional(),attachments:Z.array(JZ).optional()});var TZ=Z.object({status:Z.enum(["healthy","warning","error","unknown"]),message:Z.string().optional(),lastCheck:Z.date().optional(),details:Z.record(Z.string(),Z.unknown()).optional()}),wA=Z.object({name:Z.string(),pluginId:Z.string(),status:Z.string(),health:TZ.optional()});import{McpServer as S1,ResourceTemplate as x1}from"@modelcontextprotocol/sdk/server/mcp.js";var LA=Z.object({interfaceType:Z.string(),userId:Z.string(),conversationId:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),runId:Z.string().optional(),toolCallId:Z.string().optional(),userPermissionLevel:Z.enum(["anchor","trusted","public"]).optional()}),_A=Z.strictObject({success:Z.literal(!0),data:Z.unknown().optional(),message:Z.string().optional(),cached:Z.literal(!0).optional()}),OA=Z.strictObject({success:Z.literal(!1),error:Z.string(),code:Z.string().optional()}),CA=Z.strictObject({needsConfirmation:Z.literal(!0),toolName:Z.string(),summary:Z.string(),completionSummary:Z.string().optional(),preview:Z.string().optional(),args:Z.unknown()}),u=Z.union([_A,OA,CA]);var q1=Z.union([Z.looseObject({success:Z.literal(!0)}),Z.object({success:Z.literal(!1),error:Z.string()})]);var SZ=Z.union([Z.object({success:Z.literal(!0),data:Z.unknown(),message:Z.string().optional()}),Z.object({success:Z.literal(!1),error:Z.string(),code:Z.string().optional()})]);var BH=Z.object({id:Z.string(),type:Z.string(),version:Z.string(),status:Z.string()}),MH=Z.object({name:Z.string(),description:Z.string()}),BA=Z.enum(["anchor","trusted","public"]),d=Z.object({label:Z.string(),url:Z.string(),pluginId:Z.string(),priority:Z.number().default(100),visibility:BA.default("public")}),xZ=Z.enum(["human","agent","admin","protocol"]),yZ=Z.enum(["available","coming-soon","disabled"]),l=Z.object({id:Z.string(),label:Z.string(),description:Z.string().optional(),href:Z.string(),kind:xZ,pluginId:Z.string(),priority:Z.number().default(100),visibility:BA.default("public"),status:yZ.default("available")}),i=Z.object({entityType:Z.string(),count:Z.number()}),qH=Z.object({model:Z.string(),version:Z.string(),uptime:Z.number(),entities:Z.number(),entityCounts:Z.array(i),embeddings:Z.number(),ai:Z.object({model:Z.string(),embeddingModel:Z.string()}),daemons:Z.array(wA),endpoints:Z.array(d),interactions:Z.array(l)});var QH=Z.object({id:Z.string(),version:Z.string(),type:Z.enum(["core","entity","service","interface"]),description:Z.string().optional(),dependencies:Z.array(Z.string()).optional(),packageName:Z.string()});var zZ=Z.object({status:Z.enum(["healthy","warning","error","unknown"]),message:Z.string().optional(),lastCheck:Z.string().optional(),details:Z.record(Z.string(),Z.unknown()).optional()}),mZ=Z.object({name:Z.string(),pluginId:Z.string(),status:Z.string(),health:zZ.optional()}),TH=Z.object({model:Z.string(),version:Z.string(),uptime:Z.number(),entities:Z.number(),entityCounts:Z.array(i),embeddings:Z.number(),ai:Z.object({model:Z.string(),embeddingModel:Z.string()}),daemons:Z.array(mZ),endpoints:Z.array(d),interactions:Z.array(l)});var yH=Z.object({enabled:Z.boolean().describe("Whether the plugin is enabled"),debug:Z.boolean().describe("Enable debug logging for this plugin")});class n extends Error{pluginId;issues;constructor(A,$){super(`Invalid plugin config for ${A}`);this.name="PluginConfigValidationError",this.pluginId=A,this.issues=$}}var r=Z.enum(["file_operations","content_operations","data_processing","batch_processing"]),hZ=Z.object({pluginId:Z.string().optional(),progressToken:Z.union([Z.string(),Z.number()]).optional(),operationType:r,operationTarget:Z.string().optional(),interfaceType:Z.string().optional(),conversationId:Z.string().optional(),channelId:Z.string().optional(),silent:Z.boolean().optional()}),k=Z.object({pluginId:Z.string().optional(),progressToken:Z.union([Z.string(),Z.number()]).optional(),operationType:r,operationTarget:Z.string().optional(),interfaceType:Z.string().optional(),conversationId:Z.string().optional(),channelId:Z.string().optional(),silent:Z.boolean().optional(),rootJobId:Z.string()}),hH=Z.enum(["none","skip","replace","coalesce"]);var a=Z.enum(["pending","processing","completed","failed"]),MA=Z.enum(["completed","failed"]);var jZ=Z.object({id:Z.string(),type:Z.string(),status:a,data:Z.unknown(),result:Z.unknown().optional(),lastError:Z.string().optional().nullable(),attempts:Z.number(),maxRetries:Z.number(),priority:Z.number(),createdAt:Z.date(),updatedAt:Z.date(),processedAt:Z.date().optional().nullable(),completedAt:Z.date().optional().nullable(),failedAt:Z.date().optional().nullable()}),vZ=Z.object({jobId:Z.string(),type:Z.string(),status:MA,result:Z.unknown().optional(),error:Z.string().optional()}),qA=Z.object({success:Z.literal(!1),error:Z.string().optional()}),s=Z.object({id:Z.string(),type:Z.enum(["job","batch"]),status:a,message:Z.string().optional(),progress:Z.object({current:Z.number(),total:Z.number(),percentage:Z.number()}).optional(),aggregationKey:Z.string().optional(),batchDetails:Z.object({totalOperations:Z.number(),completedOperations:Z.number(),failedOperations:Z.number(),currentOperation:Z.string().optional(),errors:Z.array(Z.string()).optional()}).optional(),jobDetails:Z.object({jobType:Z.string(),priority:Z.number(),retryCount:Z.number()}).optional(),metadata:k});var IZ=Z.record(Z.string(),Z.unknown());class QA{logger;schema;jobTypeName;constructor(A,$){this.logger=A,this.schema=$.schema,this.jobTypeName=$.jobTypeName}validateAndParse(A){if(!this.schema)throw Error(`${this.jobTypeName}: No schema provided. Override validateAndParse() or provide a schema.`);let $=this.schema.safeParse(A);if(!$.success)return this.logger.warn(`Invalid ${this.jobTypeName} job data`,{data:A,validationError:$.error.issues}),null;return this.logger.debug(`${this.jobTypeName} job data validation successful`,{data:this.summarizeDataForLog($.data)}),$.data}async onError(A,$,H,Y){this.logger.error(`${this.jobTypeName} job error handler triggered`,{jobId:H,errorMessage:A.message,errorStack:A.stack,data:this.summarizeDataForLog($)})}async reportProgress(A,$){await A.report({progress:$.progress,total:$.total??100,message:$.message})}summarizeDataForLog(A){let $=IZ.safeParse(A);return $.success?$.data:{}}}import{createClient as iH}from"@libsql/client";var kA=q("job_queue",{id:D("id").primaryKey().$defaultFn(()=>Q()),type:D("type").notNull(),data:D("data").notNull(),result:D("result",{mode:"json"}),source:D("source"),metadata:D("metadata",{mode:"json"}).$type().notNull(),status:D("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:L("priority").notNull().default(0),retryCount:L("retryCount").notNull().default(0),maxRetries:L("maxRetries").notNull().default(3),lastError:D("lastError"),createdAt:L("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:L("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:L("startedAt"),completedAt:L("completedAt")},(A)=>({queueReadyIdx:w("idx_job_queue_ready").on(A.status,A.priority,A.scheduledFor),jobTypeIdx:w("idx_job_queue_type").on(A.type,A.status),jobSourceIdx:w("idx_job_queue_source").on(A.source)}));var Z4=Z.looseObject({deduplicationKey:Z.string().optional()});class O{callback;heartbeatInterval;constructor(A){this.callback=A}static from(A){if(!A)return;return new O(A)}createSub(A){let{scale:$}=A??{};if($){let{start:H,end:Y}=$,X=Y-H;return new O(async(G)=>{let W=H+G.progress/(G.total??100)*X;await this.callback({...G,progress:W,total:100})})}return new O(this.callback)}async report(A){await this.callback(A)}startHeartbeat(A,$=5000){this.stopHeartbeat(),this.heartbeatInterval=setInterval(()=>{this.report({message:A,progress:0}).catch(()=>{})},$)}stopHeartbeat(){if(this.heartbeatInterval)clearInterval(this.heartbeatInterval),this.heartbeatInterval=void 0}toCallback(){return this.callback}}var S4=Z.preprocess((A)=>{if(typeof A!=="string")return A;return JSON.parse(A)},Z.record(Z.string(),Z.unknown()));var pZ=Z.object({id:Z.string(),type:Z.string(),data:Z.string(),status:Z.enum(["pending","processing","completed","failed"]),source:Z.string().nullable(),priority:Z.number(),retryCount:Z.number(),maxRetries:Z.number(),lastError:Z.string().nullable(),createdAt:Z.number(),scheduledFor:Z.number(),startedAt:Z.number().nullable(),completedAt:Z.number().nullable(),metadata:k,result:Z.unknown().nullable().optional()});function o(A,$,H){return async(Y)=>{let{type:X,data:G,toolContext:W=null,options:P}=Y,{metadata:K,...V}=P??{},N={source:$,...P?.rootJobId&&{rootJobId:P.rootJobId},...V,metadata:{operationType:"data_processing",pluginId:$,...W&&{interfaceType:W.interfaceType,channelId:W.channelId},...K}},F=H&&!X.includes(":")?`${$}:${X}`:X;return A.enqueue({type:F,data:G,options:N})}}function t(A,$){return async(H,Y)=>{let X=Q(),G=H.map((P)=>({...P,type:P.type.includes(":")?P.type:`${$}:${P.type}`})),W={...Y,source:$,rootJobId:X,metadata:{...Y?.metadata,operationType:"batch_processing",pluginId:$}};return await A.enqueueBatch(G,W,X,$),X}}function e(A,$){return(H,Y)=>{let X=H.includes(":")?H:`${$}:${H}`;A.registerHandler(X,Y,$)}}var cZ=Z.custom((A)=>typeof A==="object"&&A!==null&&("safeParse"in A)),uZ=Z.object({name:Z.string(),schema:cZ});function EA(A){return uZ.safeParse(A).success}function dZ(A){if(!A)return;return{status:A.status,message:A.message,lastCheck:A.lastCheck?.toISOString(),details:A.details}}function fA(A){return{model:A.model,version:A.version,uptime:A.uptime,entities:A.entities,entityCounts:A.entityCounts,embeddings:A.embeddings,ai:A.ai,daemons:A.daemons.map(($)=>({name:$.name,pluginId:$.pluginId,status:$.status,health:dZ($.health)})),endpoints:A.endpoints,interactions:A.interactions}}function lZ(A){let $=M.safeParse(A);return $.success?$.data:"user"}function I(A){let $=J(A.metadata),H=typeof $.channelName==="string"?$.channelName:void 0;return{id:A.id,sessionId:A.sessionId,interfaceType:A.interfaceType,channelId:A.channelId,channelName:H,startedAt:A.started,lastActiveAt:A.lastActive,createdAt:A.created,updatedAt:A.updated,metadata:$}}function JA(A){return{id:A.id,conversationId:A.conversationId,role:lZ(A.role),content:A.content,timestamp:A.timestamp,metadata:J(A.metadata)}}function TA(A){return WA.parse(A)}function SA(A){return KA.parse(A)}function xA(A){return async()=>{return fA(await A.getAppInfo())}}function yA(A,$){return{get:()=>TA(A.getIdentity()),getProfile:()=>SA(A.getProfile()),getAppInfo:$}}function zA(A,$,H){let Y=A.getMessageBus();return{send:async(G)=>{return Y.send({...G,sender:$})},subscribe:(G,W)=>{if(EA(G)){let P=G,K=W,V=async(N)=>{let F=P.schema.safeParse(N.payload);if(!F.success)return H.warn(`Invalid payload for channel ${P.name}`,{error:F.error.message}),{noop:!0};let{payload:B,...R}=N;return K(F.data,R)};return Y.subscribe(P.name,V)}return Y.subscribe(G,W)}}}function mA(A,$){let H=A.getJobQueueService();return{...A.jobs,enqueue:o(H,$,!0),enqueueBatch:t(A.jobs,$),registerHandler:e(H,$)}}function hA(A){let $=A.getPermissionService();return{assertEntityActionAllowed:(H,Y,X)=>{$.assertEntityActionAllowed(H,Y,X.userPermissionLevel)}}}function jA(A){return{get:async($)=>{let Y=await A.getConversationService().getConversation($);return Y?I(Y):null},search:async($)=>{return(await A.getConversationService().searchConversations($)).map(I)},list:async($)=>{return(await A.getConversationService().listConversations($)).map(I)},getMessages:async($,H)=>{return(await A.getConversationService().getMessages($,H)).map(JA)},countMessages:async($)=>{return A.getConversationService().countMessages($)}}}function vA(A,$){return{registerHandler:(H,Y)=>{A.registerEvalHandler($,H,Y)}}}function IA(A){return{register:($,H)=>{A.getInsightsRegistry().register($,H)}}}function gA(A,$){return{register:(H)=>{A.registerEndpoint({...H,pluginId:$})}}}function bA(A,$){return{register:(H)=>{A.registerInteraction({...H,pluginId:$})}}}function f(A,$,H){let Y=A.getEntityService(),X=A.getLogger().child($),G=A.getDomain(),W=A.getLocalSiteUrl(),P=A.shouldPreferLocalUrls(),K=A.getThemeCSS(),V=xA(A),N=A.getAttachmentRegistry(),F=A.getRuntimeUploadRegistry(),B=A.getRuntimeState();return{pluginId:$,logger:X,entityService:Y,semantic:{project:(R)=>Y.projectSemanticSpace(R)},identity:yA(A,V),appInfo:V,judge:(R)=>A.judge(R),domain:G,siteUrl:G?`https://${G}`:void 0,localSiteUrl:W,previewUrl:G?`https://${pA(G)}`:void 0,preferLocalUrls:P,themeCSS:K,entityDisplay:H?.entityDisplay,spaces:A.getSpaces(),permissions:hA(A),messaging:zA(A,$,X),jobs:mA(A,$),attachments:N,uploads:F,runtimeState:B,recurringChecks:A.getRecurringChecks($),conversations:jA(A),dataDir:A.getDataDir(),eval:vA(A,$),insights:IA(A),endpoints:gA(A,$),interactions:bA(A,$)}}function iZ(A){return A.replace(/:/g,"-")}function nZ(A){return A.split(/[:.-]/).map(($)=>$.charAt(0).toUpperCase()+$.slice(1)).join(" ")}var AA=new Map;async function dA(A,$,H){let Y=AA.get($);if(Y!==void 0)return Y;let X=iZ($),G;try{G=await A.getEntity({entityType:"prompt",id:X})}catch{return H}if(G?.content){let W=uA(G.content,Z.record(Z.string(),Z.unknown())).content;return AA.set($,W),W}try{let W=nZ($),P=cA(H,{title:W,target:$});await A.createEntity({entity:{id:X,entityType:"prompt",content:P,metadata:{title:W,target:$,slug:X}}})}catch{}return AA.set($,H),H}function g(A){let $=A.getEntityService(),H=A.getEntityRegistry(),Y=A.getDataSourceRegistry();return{register:(X,G,W,P)=>{H.registerEntityType(X,G,W,P)},getAdapter:(X)=>{try{return H.getAdapter(X)}catch{return}},extendFrontmatterSchema:(X,G)=>{H.extendFrontmatterSchema(X,G)},getEffectiveFrontmatterSchema:(X)=>{return H.getEffectiveFrontmatterSchema(X)},registerCreateInterceptor:(X,G)=>{H.registerCreateInterceptor(X,G)},registerUploadSaveHandler:(X)=>{H.registerUploadSaveHandler(X)},getUploadSaveHandler:(X)=>{return H.getUploadSaveHandler(X)},update:async(X)=>{return $.updateEntity({entity:X})},registerDataSource:(X)=>{Y.register(X)}}}function b(A){return{resolve:($,H)=>{return dA(A,$,H)}}}function lA(A,$,H){let Y=f(A,$,H),X=A.getEntityService();return{...Y,entityService:X,entities:g(A),ai:{query:(G,W)=>A.query(G,W),generate:async(G)=>{return A.generateContent(G)},generateObject:async(G,W,P)=>{return A.generateObject(G,W,P)},generateImage:async(G,W)=>{return A.generateImage(G,W)},canGenerateImages:()=>{return A.canGenerateImages()}},prompts:b(X),permissions:Y.permissions}}function nA(A,$,H){let Y=!1,X=!1;if(A.jobs.registerHandler(H.job.type,H.job.handler),H.initialSync){let G=H.initialSync;A.messaging.subscribe("sync:initial:completed",async()=>{if(Y)return{success:!0};if(Y=!0,!(await G.shouldEnqueue?.()??!0))return $.info("Skipping derived entity projection initial sync",{projectionId:H.id,targetType:H.targetType}),{success:!0};return X=await iA(A,$,H,G.jobData,aZ(G.jobOptions),"initial-sync"),{success:!0}})}if(H.sourceChange){let G=H.sourceChange,W=new Set(G.sourceTypes),P=G.events??["entity:created","entity:updated"],K=async(V)=>{if(G.requireInitialSync&&!Y)return{success:!0};let N=V.payload,F=rZ(G,N);if(!F||!W.has("*")&&!W.has(F))return{success:!0};if(!(await G.shouldEnqueue?.(N)??!0))return{success:!0};let R=await G.jobData(N);if(!R)return{success:!0};return await iA(A,$,H,R,G.jobOptions?.(N),"source-change"),{success:!0}};for(let V of P)A.messaging.subscribe(V,K)}return{hasObservedInitialSync:()=>Y,hasQueuedInitialSync:()=>X}}function rZ(A,$){if(A.sourceType)return A.sourceType;if(A.sourceKind&&A.sourceKind!=="entity")return A.sourceKind;return $.entityType}async function iA(A,$,H,Y,X,G){try{return await A.jobs.enqueue({type:H.job.type,data:Y,...X?{options:X}:{}}),$.info("Queued derived entity projection",{projectionId:H.id,targetType:H.targetType,reason:G}),!0}catch(W){return $.error("Failed to queue derived entity projection",{projectionId:H.id,targetType:H.targetType,reason:G,error:_(W)}),!1}}function aZ(A){return typeof A==="function"?A():A}var sZ=Z.object({toolName:Z.string(),args:Z.unknown(),progressToken:Z.union([Z.string(),Z.number()]).optional(),hasProgress:Z.boolean().optional(),interfaceType:Z.string(),userId:Z.string(),conversationId:Z.string().optional(),channelId:Z.string().optional(),channelName:Z.string().optional(),runId:Z.string().optional(),toolCallId:Z.string().optional(),userPermissionLevel:Z.enum(["anchor","trusted","public"]).optional(),signal:Z.custom((A)=>A instanceof AbortSignal).optional()}),oZ=Z.object({resourceUri:Z.string()});class C{id;version;description;packageName;config;context;get logger(){return this.context?.logger??j.createFresh({context:this.id})}constructor(A,$,H,Y){this.id=A,this.packageName=$.name,this.version=$.version,this.description=$.description??`${$.name} plugin`;let X=Y.safeParse(H);if(!X.success)throw new n(A,X.error.issues.map((G)=>({path:G.path.map(String).join("."),code:G.code,message:G.message})));this.config=X.data}setupMessageHandlers(A){A.messaging.subscribe(`plugin:${this.id}:tool:execute`,async($)=>{try{let H=sZ.safeParse($.payload);if(!H.success)return{success:!1,error:"Invalid tool execution request format"};let{toolName:Y,args:X,progressToken:G,hasProgress:W,interfaceType:P,userId:K,conversationId:V,channelId:N,channelName:F,runId:B,toolCallId:R,userPermissionLevel:XA,signal:GA}=H.data,PA=(await this.getTools()).find((p)=>p.name===Y);if(!PA)return{success:!1,error:`Tool not found: ${Y}`};let _Z={interfaceType:P,userId:K,...V&&{conversationId:V},...N&&{channelId:N},...F&&{channelName:F},...B&&{runId:B},...R&&{toolCallId:R},...XA&&{userPermissionLevel:XA},...GA&&{signal:GA},...W&&G!==void 0&&{progressToken:G,sendProgress:async(p)=>{await A.messaging.send({type:`plugin:${this.id}:progress`,payload:{progressToken:G,notification:p}})}}};return{success:!0,data:await PA.handler(X,_Z)}}catch(H){return this.logger.error("Tool execution error",H),{success:!1,error:_(H)}}}),A.messaging.subscribe(`plugin:${this.id}:resource:get`,async($)=>{try{let H=oZ.safeParse($.payload);if(!H.success)return{success:!1,error:"Invalid resource get request format"};let{resourceUri:Y}=H.data,G=(await this.getResources()).find((P)=>P.uri===Y);if(!G)return{success:!1,error:`Resource not found: ${Y}`};return{success:!0,data:await G.handler()}}catch(H){return this.logger.error("Resource fetch error",H),{success:!1,error:_(H)}}})}async onRegister(A){}async onReady(A){}async ready(){await this.onReady(this.getContext())}async getCapabilities(){let A=await this.getInstructions();return{tools:await this.getTools(),resources:await this.getResources(),...A&&{instructions:A}}}async getTools(){return[]}async getResources(){return[]}async getInstructions(){return}async shutdown(){await this.onShutdown()}async onShutdown(){}getContext(){if(!this.context)throw Error(`Plugin ${this.id}: Plugin not registered yet`);return this.context}determineUserPermissionLevel(A){return"public"}createProgressBridge(A){if(!A)return;let $=this.context;if(!$)return;let H=this.id;return O.from(async(Y)=>{await $.messaging.send({type:`plugin:${H}:progress`,payload:{progressToken:A,notification:{progress:Y.progress,total:Y.total,message:Y.message}}})})}}var j6=Z.object({});class rA extends C{type="entity";entityActionPolicy;derivedEntityProjectionControllers=new Map;constructor(A,$,H,Y,X){super(A,$,H,Y);if(X!==void 0)this.entityActionPolicy=X}async register(A,$){let H=lA(A,this.id,$);if(this.context=H,this.setupMessageHandlers(H),H.entities.register(this.entityType,this.schema,this.adapter,this.getEntityTypeConfig()),this.interceptCreate!==rA.prototype.interceptCreate)H.entities.registerCreateInterceptor(this.entityType,(K,V)=>this.interceptCreate(K,V,H));let Y=this.createGenerationHandler(H);if(Y)H.jobs.registerHandler(`${this.entityType}:generation`,Y);let X=this.getTemplates();if(X&&Object.keys(X).length>0)A.registerTemplates(X,this.id);let G=this.getDataSources();for(let K of G)H.entities.registerDataSource(K);let W=this.getDerivedEntityProjections(H);for(let K of W){let V=nA(H,this.logger,K);this.derivedEntityProjectionControllers.set(K.id,V)}await this.onRegister(this.context);let P=await this.getInstructions();return{tools:[],resources:[],...P&&{instructions:P}}}async interceptCreate(A,$,H){return{kind:"continue",input:A}}createGenerationHandler(A){return null}getTemplates(){return null}getDataSources(){return[]}getEntityTypeConfig(){return}getDerivedEntityProjections(A){return[]}getDerivedEntityProjectionController(A){return this.derivedEntityProjectionControllers.get(A)}}function aA(A){return oA(A)}function sA(A){if(!A)return;return{...A.userPermissionLevel&&{userPermissionLevel:A.userPermissionLevel},...A.interfaceType&&{interfaceType:A.interfaceType},...A.channelId&&{channelId:A.channelId},...A.channelName&&{channelName:A.channelName},...A.actor&&{actor:A.actor},...A.source&&{source:A.source},...A.attachments&&{attachments:A.attachments}}}function tA(A){return{chat:async($,H,Y,X)=>{let G=sA(Y),W=X?await A.chat($,H,G,X):await A.chat($,H,G);return aA(W)},confirmPendingAction:async($,H,Y,X,G)=>{let W=sA(X);if(!W)throw Error("Confirmation requires caller context.");let P=G?await A.confirmPendingAction($,H,Y,W,G):await A.confirmPendingAction($,H,Y,W);return aA(P)},invalidate:()=>{A.invalidateAgent()}}}function eA(A,$,H){let Y=f(A,$,H),X=A.getMCPService(),G=A.getPermissionService(),W=tA(A.getAgentService());return{...Y,mcpTransport:X,agent:W,permissions:{...Y.permissions,getUserLevel:(P,K,V)=>{return G.determineUserLevel(P,K,V)}},daemons:{register:(P,K)=>{let V=`${$}:${P}`;A.registerDaemon(V,K,$),Y.logger.debug(`Registered daemon: ${V}`)}},conversations:{...Y.conversations,start:async(P)=>{return A.getConversationService().startConversation(P)},addMessage:async(P)=>{await A.getConversationService().addMessage(P)},updateMetadata:async(P)=>{return A.getConversationService().updateConversationMetadata(P)},delete:async(P)=>{return A.getConversationService().deleteConversation(P)}},tools:{listForPermissionLevel:(P)=>{return A.listToolsForPermissionLevel(P)}},apiRoutes:{getRoutes:()=>{return A.getPluginApiRoutes()},getMessageBus:()=>{return A.getMessageBus()}},webRoutes:{getRoutes:()=>{return A.getPluginWebRoutes()}},plugins:{has:(P)=>A.hasPlugin(P)}}}var tZ=3600000;class ZA extends C{type="interface";daemon;jobTrackingEntries=new Map;jobTrackingTtlMs=tZ;async register(A,$){let H=eA(A,this.id,$);if(this.context=H,this.initializeDaemon(),this.daemon)await this.registerDaemon(H);return this.setupMessageHandlers(H),await this.onRegister(H),this.getCapabilities()}async onRegister(A){}async registerDaemon(A){if(!this.daemon)return;A.daemons.register(this.id,this.daemon),A.logger.debug(`Registered daemon for interface: ${this.id}`)}createDaemon(){return}requiresDaemonStartup(){return!1}getWebRoutes(){return[]}initializeDaemon(){let A=this.createDaemon();if(A)this.daemon=A}async handleProgressEvent(A,$){}cleanupExpiredEntries(){let A=Date.now(),$=[];for(let[H,Y]of this.jobTrackingEntries)if(A-Y.createdAt>this.jobTrackingTtlMs)$.push(H);for(let H of $)this.jobTrackingEntries.delete(H)}ownsJob(A,$){return this.jobTrackingEntries.has(A)||$!==void 0&&this.jobTrackingEntries.has($)}getJobTracking(A,$){let H=this.jobTrackingEntries.get(A);if(H)return H.info;if($){let Y=this.jobTrackingEntries.get($);if(Y)return Y.info}return}setJobTracking(A,$){this.cleanupExpiredEntries(),this.jobTrackingEntries.set(A,{info:$,createdAt:Date.now()})}removeJobTracking(A){this.jobTrackingEntries.delete(A)}async createJobWithTracking(A,$){let Y=await this.getContext().jobs.enqueue(A);return this.setJobTracking(Y,$),Y}async createBatchWithTracking(A,$,H){let X=await this.getContext().jobs.enqueueBatch(A,H);return this.setJobTracking(X,$),X}}function x(A,$){return{state:$,toolName:A.toolName,conversationId:A.conversationId,interfaceType:A.interfaceType,...A.channelId!==void 0&&{channelId:A.channelId},...A.channelName!==void 0&&{channelName:A.channelName},...A.error!==void 0&&{error:A.error}}}function AZ(A,$){return A.pendingConfirmations?.some((H)=>H.toolName===$)===!0||eZ(A.cards).some((H)=>H.toolName===$)}function eZ(A){return A?.filter(($)=>$.kind==="tool-approval"&&$.state==="approval-requested")??[]}var $A=1e5,A$=[".md",".txt",".markdown"],Z$=["text/plain","text/markdown","text/x-markdown"],$$=/https?:\/\/[^\s<>"{}|\\^`[\]]+?(?=[,;:\s]|$)/gi,H$=["meet.google.com","zoom.us","teams.microsoft.com","whereby.com","gather.town","calendly.com","cal.com","discord.com","discord.gg","cdn.discordapp.com","media.discordapp.net","giphy.com","tenor.com","wetransfer.com","file.io"],Y$=Z.object({captureUrls:Z.boolean().default(!1),blockedUrlDomains:Z.array(Z.string()).default(H$)});function ZZ(A,$){if($&&Z$.some((H)=>$.startsWith(H)))return!0;return A$.some((H)=>A.toLowerCase().endsWith(H))}function $Z(A){return A<=$A}function HZ(A){if(A.includes(0))return!1;try{return new TextDecoder("utf-8",{fatal:!0}).decode(A),!0}catch{return!1}}function YZ(A,$){return`User uploaded a file "${A}":
3
3
 
4
4
  ${$}`}function XZ(A,$){let H=A.match($$)??[];return[...new Set(H)].filter((Y)=>{try{let{hostname:X}=new URL(Y);return!$.some((G)=>X===G||X.endsWith(`.${G}`))}catch{return!1}})}function HA(A,$){let H=A.attachment.source;if((H?.entityType==="document"||H?.entityType==="image")&&H.entityId)return{entityType:H.entityType,id:H.entityId};return X$(A.attachment.downloadUrl??A.attachment.url,$)}function X$(A,$="http://local"){if(!A)return;let H;try{H=new URL(A,$)}catch{return}let Y=H.searchParams.get("id")?.trim();if(!Y)return;if(H.pathname==="/api/chat/attachments/document")return{entityType:"document",id:Y};if(H.pathname==="/api/chat/attachments/image")return{entityType:"image",id:Y};return}function GZ(A,$){let H=G$($,A==="document"?/^application\/pdf$/i:/^image\/[a-z0-9.+-]+$/i);if(!H)return;if(A==="document"&&H.mimeType.toLowerCase()!=="application/pdf")return;return H}function PZ(A,$,H,Y){let X=A?.filename;if(typeof X==="string"&&X.trim())return X;if(H==="document")return`${$}.pdf`;let G=A?.format;if(typeof G==="string"&&G.trim())return`${$}.${G==="jpeg"?"jpg":G}`;let W=Y.split("/")[1]?.split("+")[0]??"png";return`${$}.${W}`}function G$(A,$){let H=A.match(/^data:([^;]+);base64,(.+)$/i),Y=H?.[1],X=H?.[2];if(!Y||!X||!$.test(Y))return;let G=Buffer.from(X,"base64");return{mimeType:Y,data:G.buffer.slice(G.byteOffset,G.byteOffset+G.byteLength)}}async function KZ({entityRef:A,userLevel:$,getEntity:H,getVisibleEntity:Y}){let X=WZ($),G=await Y(A,X);if(G)return{status:"visible",entity:G};return Boolean(await H(A))?{status:"denied"}:{status:"missing"}}function VZ(A){return A==="anchor"||A==="trusted"}function DZ(A,$){A.messaging.subscribe("job-progress",async(H)=>{try{let Y=s.safeParse(H.payload);if(!Y.success)return $.onInvalidSchema(),{success:!1};let X=Y.data;return await $.onProgress(X,X.metadata),{success:!0}}catch(Y){return $.onError(Y),{success:!1}}})}function NZ(A){let $=A.status==="completed"?"\u2705":"\u274C",H=A.status==="completed"?"completed":"failed",Y=A.metadata.operationType.replace(/_/g," "),X=A.metadata.operationTarget?`: ${A.metadata.operationTarget}`:"",G=`${$} **${Y}${X}** ${H}`;if(A.message)G+=`
5
5
  ${A.message}`;return G}function FZ(A){let $=A.metadata.operationType.replace(/_/g," "),H=A.metadata.operationTarget?`: ${A.metadata.operationTarget}`:"",Y=`\uD83D\uDD04 **${$}${H}**`;if(A.progress&&A.progress.total>0)Y+=` ${A.progress.current}/${A.progress.total} (${A.progress.percentage}%)`;if(A.message)Y+=`
@@ -7,4 +7,4 @@ ${A.message}`;return Y}var P$=Z.enum(["tool:invoking","tool:completed","tool:fai
7
7
  export{QA as p,_$ as q,O$ as r,WA as s,KA as t,j6 as u,rA as v,ZA as w,D$ as x,N$ as y,U1 as z,TH as A};
8
8
 
9
9
  //# debugId=F84C6E7A488F0D8D64756E2164756E21
10
- //# sourceMappingURL=index-f4gcns9h.js.map
10
+ //# sourceMappingURL=index-920pgj26.js.map
@@ -1,42 +1,42 @@
1
1
  // @bun
2
- import{Ea as g0}from"./index-q9sthmbv.js";import{Ra as J}from"./index-r4f9aab7.js";var H0=J.object({id:J.string(),template:J.string(),content:J.unknown().optional(),dataQuery:J.looseObject({entityType:J.string().optional(),template:J.string().optional(),query:J.looseObject({id:J.string().optional(),limit:J.number().optional(),offset:J.number().optional()}).optional()}).optional(),order:J.number().optional()}),R0=["primary","secondary"],Y0=J.object({show:J.boolean().default(!1),label:J.string().optional(),slot:J.enum(R0).default("primary"),priority:J.number().min(0).max(100).default(50)}).optional(),P0=J.object({id:J.string(),path:J.string(),title:J.string().default(""),pageLabel:J.string().optional(),description:J.string().default(""),sections:J.array(H0).default([]),layout:J.string().default("default"),fullscreen:J.boolean().optional(),pluginId:J.string().optional(),sourceEntityType:J.string().optional(),external:J.boolean().optional(),navigation:Y0}),L$=J.object({routes:J.array(P0),pluginId:J.string()}),N$=J.object({paths:J.array(J.string()).optional(),pluginId:J.string().optional()}),I$=J.object({pluginId:J.string().optional()}),S$=J.object({path:J.string()}),IZ=J.object({label:J.string(),href:J.string(),priority:J.number()});function SZ(F){if(Array.isArray(F))return F.map(SZ);if(!F||typeof F!=="object")return F;if(F instanceof Uint8Array)return F;return Object.fromEntries(Object.entries(F).filter(([,U])=>U!==void 0).map(([U,P])=>[U,SZ(P)]))}var B0=J.object({id:J.string(),toolCallId:J.string().optional(),toolName:J.string(),summary:J.string(),completionSummary:J.string().optional(),preview:J.string().optional(),args:J.unknown()}),O0=J.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),q0=J.object({kind:J.literal("tool-approval"),id:J.string(),toolCallId:J.string().optional(),toolName:J.string(),input:J.record(J.string(),J.unknown()).optional(),summary:J.string(),completionSummary:J.string().optional(),preview:J.string().optional(),state:O0,output:J.unknown().optional(),error:J.string().optional()}),z$=q0,A0=J.object({entityType:J.string().optional(),entityId:J.string().optional(),attachmentType:J.string().optional()}),T0=J.object({mediaType:J.string().min(1),url:J.string().min(1),downloadUrl:J.string().min(1).optional(),previewUrl:J.string().min(1).optional(),filename:J.string().min(1).optional(),sizeBytes:J.number().nonnegative().optional(),source:A0.optional()}),w0=J.object({kind:J.literal("attachment"),id:J.string(),jobId:J.string().optional(),title:J.string(),description:J.string().optional(),attachment:T0}),k$=w0,C0=J.object({id:J.string().min(1),title:J.string().min(1).optional(),source:J.string().min(1),url:J.string().min(1).optional(),entityType:J.string().min(1).optional(),entityId:J.string().min(1).optional(),excerpt:J.string().min(1).optional(),provenance:J.record(J.string(),J.unknown()).optional()}),x$=J.object({kind:J.literal("sources"),id:J.string().min(1),title:J.string().min(1).optional(),sources:J.array(C0).min(1)});var v$=J.object({type:J.literal("prompt"),id:J.string().min(1),label:J.string().min(1),prompt:J.string().min(1),description:J.string().min(1).optional()});var b$=J.object({type:J.literal("event"),id:J.string().min(1),label:J.string().min(1),event:J.string().min(1),fromState:J.string().min(1).optional(),description:J.string().min(1).optional()});var j0=J.discriminatedUnion("type",[v$,b$]),g$=J.object({kind:J.literal("actions"),id:J.string().min(1),title:J.string().min(1).optional(),defaultOpen:J.boolean().optional(),actions:J.array(j0).min(1)});var L0=J.discriminatedUnion("kind",[q0,w0,x$,g$]),N0=J.object({toolName:J.string(),args:J.record(J.string(),J.unknown()).optional(),jobId:J.string().optional(),data:J.unknown().optional(),error:J.object({message:J.string(),code:J.string().optional()}).optional()}),I0=J.object({text:J.string(),toolResults:J.array(N0).optional(),cards:J.array(L0).optional(),pendingConfirmations:J.array(B0).optional(),usage:J.object({promptTokens:J.number(),completionTokens:J.number(),totalTokens:J.number()})});function _$(F){return I0.parse(SZ(F))}var S0=J.object({type:J.literal("event"),event:J.string().min(1),fromState:J.string().min(1).optional()}),E$=J.object({conversationId:J.string().min(1),interfaceType:J.string().min(1),channelId:J.string().min(1).optional(),channelName:J.string().min(1),userPermissionLevel:J.enum(["anchor","trusted","public"]),action:S0});var z0=J.enum(["anchor","trusted","public"]),y$=J.object({conversationId:J.string().min(1),message:J.string(),interfaceType:J.string().min(1),channelId:J.string().optional(),channelName:J.string().optional(),userPermissionLevel:z0}),k0=J.object({id:J.string().min(1),source:J.string().min(1),title:J.string().optional(),content:J.string().min(1),provenance:J.record(J.string(),J.unknown()).optional()}),m$=J.object({items:J.array(k0).default([])});var h$=J.object({url:J.string(),authToken:J.string().optional()});var u$=J.object({success:J.boolean(),entityId:J.string().optional(),error:J.string().optional()});var p$={success(F){return{success:!0,...F}},failure(F){return{success:!1,error:F instanceof Error?F.message:String(F)}}};var d$=J.enum(["user","assistant"]);var l$={START:0,INIT:10,FETCH:20,PROCESS:40,GENERATE:50,EXTRACT:60,SAVE:80,COMPLETE:100};var c$=J.object({id:J.string().min(1),trigger:J.string().min(1),playbookId:J.string().min(1),once:J.boolean().default(!0),starterText:J.string().min(1),description:J.string().min(1).optional(),starterPrompt:J.string().min(1)}).strict();var o$=J.object({message:J.string().describe("Natural language response to the query"),summary:J.string().optional().describe("Brief summary if applicable"),topics:J.array(J.string()).optional().describe("Related topics mentioned"),sources:J.array(J.object({id:J.string(),type:J.string(),excerpt:J.string().optional(),relevance:J.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:J.record(J.string(),J.unknown()).optional()}).describe("defaultQueryResponse"),r$=J.object({message:J.string()}).describe("simpleTextResponse"),x0=J.object({success:J.boolean(),entityId:J.string().optional(),message:J.string()}).describe("createEntityResponse"),v0=J.object({success:J.boolean(),entityId:J.string(),changes:J.array(J.string()).optional(),message:J.string()}).describe("updateEntityResponse");var uZ=J.object({heading:J.string().describe("Main CTA heading text"),buttonText:J.string().describe("Call-to-action button text"),buttonLink:J.string().describe("URL or anchor for the CTA button")}),pZ=J.object({blurb:J.string().optional().describe("Short italic subtitle under the section title")}),n$=J.object({title:J.string().describe("The site's title"),description:J.string().describe("The site's description"),url:J.string().optional().describe("Canonical site URL"),copyright:J.string().optional().describe("Copyright notice text"),logo:J.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:J.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:J.string().optional().describe("Analytics script HTML"),cta:uZ.optional().describe("Call-to-action configuration"),sections:J.record(J.string(),pZ).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers.")});var i$=J.object({platform:J.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:J.string().describe("Profile or contact URL"),label:J.string().optional().describe("Optional display label")}),s$=J.object({title:J.string().describe("The site's title"),description:J.string().describe("The site's description"),url:J.string().optional().describe("Canonical site URL"),copyright:J.string(),logo:J.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:J.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:J.string().optional().describe("Analytics script HTML"),cta:uZ.optional().describe("Call-to-action configuration"),sections:J.record(J.string(),pZ).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers."),navigation:J.object({primary:J.array(IZ),secondary:J.array(IZ)}),socialLinks:J.array(i$).optional().describe("Social media links from profile metadata")});var X2=J.record(J.string(),J.unknown());var M2=J.object({message:J.string()});var b0=J.record(J.string(),J.unknown());class zZ{schema;config;processor=g0();constructor(F,U){this.schema=F,this.config=U}getLabels(){let F={};for(let U of this.config.mappings)F[U.key]=U.label;return F}generateBodyTemplate(){if(this.config.mappings.length===0)return"";let F=[];for(let U of this.config.mappings)F.push(`## ${U.label}`,"",`<!-- Write your ${U.label.toLowerCase()} here -->`,"");return F.join(`
2
+ import{Ea as _0}from"./index-q9sthmbv.js";import{Ra as J}from"./index-r4f9aab7.js";var H0=J.object({id:J.string(),template:J.string(),content:J.unknown().optional(),dataQuery:J.looseObject({entityType:J.string().optional(),template:J.string().optional(),query:J.looseObject({id:J.string().optional(),limit:J.number().optional(),offset:J.number().optional()}).optional()}).optional(),order:J.number().optional()}),R0=["primary","secondary"],Y0=J.object({show:J.boolean().default(!1),label:J.string().optional(),slot:J.enum(R0).default("primary"),priority:J.number().min(0).max(100).default(50)}).optional(),P0=J.object({id:J.string(),path:J.string(),title:J.string().default(""),pageLabel:J.string().optional(),description:J.string().default(""),sections:J.array(H0).default([]),layout:J.string().default("default"),fullscreen:J.boolean().optional(),pluginId:J.string().optional(),sourceEntityType:J.string().optional(),external:J.boolean().optional(),navigation:Y0}),N$=J.object({routes:J.array(P0),pluginId:J.string()}),I$=J.object({paths:J.array(J.string()).optional(),pluginId:J.string().optional()}),S$=J.object({pluginId:J.string().optional()}),z$=J.object({path:J.string()}),IZ=J.object({label:J.string(),href:J.string(),priority:J.number()});function SZ(F){if(Array.isArray(F))return F.map(SZ);if(!F||typeof F!=="object")return F;if(F instanceof Uint8Array)return F;return Object.fromEntries(Object.entries(F).filter(([,U])=>U!==void 0).map(([U,Y])=>[U,SZ(Y)]))}var B0=J.object({id:J.string(),toolCallId:J.string().optional(),toolName:J.string(),summary:J.string(),completionSummary:J.string().optional(),preview:J.string().optional(),args:J.unknown()}),O0=J.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),q0=J.object({kind:J.literal("tool-approval"),id:J.string(),toolCallId:J.string().optional(),toolName:J.string(),input:J.record(J.string(),J.unknown()).optional(),summary:J.string(),completionSummary:J.string().optional(),preview:J.string().optional(),state:O0,output:J.unknown().optional(),error:J.string().optional()}),k$=q0,A0=J.object({entityType:J.string().optional(),entityId:J.string().optional(),attachmentType:J.string().optional()}),T0=J.object({mediaType:J.string().min(1),url:J.string().min(1),downloadUrl:J.string().min(1).optional(),previewUrl:J.string().min(1).optional(),filename:J.string().min(1).optional(),sizeBytes:J.number().nonnegative().optional(),source:A0.optional()}),C0=J.object({kind:J.literal("attachment"),id:J.string(),jobId:J.string().optional(),title:J.string(),description:J.string().optional(),attachment:T0}),x$=C0,w0=J.object({id:J.string().min(1),title:J.string().min(1).optional(),source:J.string().min(1),url:J.string().min(1).optional(),entityType:J.string().min(1).optional(),entityId:J.string().min(1).optional(),excerpt:J.string().min(1).optional(),provenance:J.record(J.string(),J.unknown()).optional()}),v$=J.object({kind:J.literal("sources"),id:J.string().min(1),title:J.string().min(1).optional(),sources:J.array(w0).min(1)});var b$=J.object({type:J.literal("prompt"),id:J.string().min(1),label:J.string().min(1),prompt:J.string().min(1),description:J.string().min(1).optional()});var _$=J.object({type:J.literal("event"),id:J.string().min(1),label:J.string().min(1),event:J.string().min(1),fromState:J.string().min(1).optional(),description:J.string().min(1).optional()});var j0=J.discriminatedUnion("type",[b$,_$]),g$=J.object({kind:J.literal("actions"),id:J.string().min(1),title:J.string().min(1).optional(),defaultOpen:J.boolean().optional(),actions:J.array(j0).min(1)});var L0=J.discriminatedUnion("kind",[q0,C0,v$,g$]),N0=J.object({toolName:J.string(),args:J.record(J.string(),J.unknown()).optional(),jobId:J.string().optional(),data:J.unknown().optional(),error:J.object({message:J.string(),code:J.string().optional()}).optional()}),I0=J.object({text:J.string(),toolResults:J.array(N0).optional(),cards:J.array(L0).optional(),pendingConfirmations:J.array(B0).optional(),usage:J.object({promptTokens:J.number(),completionTokens:J.number(),totalTokens:J.number()})});function E$(F){return I0.parse(SZ(F))}var S0=J.object({type:J.literal("event"),event:J.string().min(1),fromState:J.string().min(1).optional()}),y$=J.object({conversationId:J.string().min(1),interfaceType:J.string().min(1),channelId:J.string().min(1).optional(),channelName:J.string().min(1),userPermissionLevel:J.enum(["anchor","trusted","public"]),action:S0});var z0=J.enum(["anchor","trusted","public"]),m$=J.object({conversationId:J.string().min(1),message:J.string(),interfaceType:J.string().min(1),channelId:J.string().optional(),channelName:J.string().optional(),userPermissionLevel:z0}),k0=J.object({id:J.string().min(1),source:J.string().min(1),title:J.string().optional(),content:J.string().min(1),provenance:J.record(J.string(),J.unknown()).optional()}),h$=J.object({items:J.array(k0).default([])});var u$=J.object({url:J.string(),authToken:J.string().optional()});var p$=J.object({success:J.boolean(),entityId:J.string().optional(),error:J.string().optional()});var d$={success(F){return{success:!0,...F}},failure(F){return{success:!1,error:F instanceof Error?F.message:String(F)}}};var l$=J.enum(["user","assistant"]);var c$={START:0,INIT:10,FETCH:20,PROCESS:40,GENERATE:50,EXTRACT:60,SAVE:80,COMPLETE:100};var o$=J.object({id:J.string().min(1),trigger:J.string().min(1),playbookId:J.string().min(1),once:J.boolean().default(!0),starterText:J.string().min(1),description:J.string().min(1).optional(),starterPrompt:J.string().min(1)}).strict();var r$=J.object({message:J.string().describe("Natural language response to the query"),summary:J.string().optional().describe("Brief summary if applicable"),topics:J.array(J.string()).optional().describe("Related topics mentioned"),sources:J.array(J.object({id:J.string(),type:J.string(),excerpt:J.string().optional(),relevance:J.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:J.record(J.string(),J.unknown()).optional()}).describe("defaultQueryResponse"),n$=J.object({message:J.string()}).describe("simpleTextResponse"),x0=J.object({success:J.boolean(),entityId:J.string().optional(),message:J.string()}).describe("createEntityResponse"),v0=J.object({success:J.boolean(),entityId:J.string(),changes:J.array(J.string()).optional(),message:J.string()}).describe("updateEntityResponse");var uZ=J.object({heading:J.string().describe("Main CTA heading text"),buttonText:J.string().describe("Call-to-action button text"),buttonLink:J.string().describe("URL or anchor for the CTA button")}),pZ=J.object({blurb:J.string().optional().describe("Short italic subtitle under the section title")}),i$=J.object({title:J.string().describe("The site's title"),description:J.string().describe("The site's description"),url:J.string().optional().describe("Canonical site URL"),copyright:J.string().optional().describe("Copyright notice text"),logo:J.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:J.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:J.string().optional().describe("Analytics script HTML"),cta:uZ.optional().describe("Call-to-action configuration"),sections:J.record(J.string(),pZ).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers.")});var s$=J.object({platform:J.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:J.string().describe("Profile or contact URL"),label:J.string().optional().describe("Optional display label")}),a$=J.object({title:J.string().describe("The site's title"),description:J.string().describe("The site's description"),url:J.string().optional().describe("Canonical site URL"),copyright:J.string(),logo:J.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:J.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:J.string().optional().describe("Analytics script HTML"),cta:uZ.optional().describe("Call-to-action configuration"),sections:J.record(J.string(),pZ).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers."),navigation:J.object({primary:J.array(IZ),secondary:J.array(IZ)}),socialLinks:J.array(s$).optional().describe("Social media links from profile metadata")});var G2=J.record(J.string(),J.unknown());var K2=J.object({message:J.string()});var b0=J.record(J.string(),J.unknown());class zZ{schema;config;processor=_0();constructor(F,U){this.schema=F,this.config=U}getLabels(){let F={};for(let U of this.config.mappings)F[U.key]=U.label;return F}generateBodyTemplate(){if(this.config.mappings.length===0)return"";let F=[];for(let U of this.config.mappings)F.push(`## ${U.label}`,"",`<!-- Write your ${U.label.toLowerCase()} here -->`,"");return F.join(`
3
3
  `).trimEnd()+`
4
- `}format(F){try{let U=[`# ${this.config.title}`,""];for(let P of this.config.mappings)this.formatField(F,P,U,2);return U.join(`
5
- `)}catch(U){throw Error(`Failed to format structured content: ${this.describeError(U)}`,{cause:U})}}parse(F){try{let U=this.processor.parse(F),P=this.extractSections(U,2),T=this.buildDataFromSections(P,this.config.mappings);return this.schema.parse(T)}catch(U){throw Error(`Failed to parse structured content: ${this.describeError(U)}`,{cause:U})}}describeError(F){if(F instanceof J.ZodError)return F.issues.map((U)=>`${U.path.join(".")||"(root)"}: ${U.message}`).join("; ");return F instanceof Error?F.message:String(F)}escapeBlockMarkup(F){return F.replace(/^(\s*)#/gm,"$1\\#")}formatField(F,U,P,T){let V="#".repeat(T)+" "+U.label,Q=this.getValueByPath(F,U.key);if(U.type==="custom"&&U.formatter){if(Q!==void 0&&Q!==null){P.push(V,"");let W=U.formatter(Q);if(W)P.push(W,"")}return}switch(U.type){case"string":case"number":if(Q===void 0||Q===null)break;P.push(V,this.escapeBlockMarkup(String(Q)),"");break;case"object":if(P.push(V),U.children&&Q)for(let W of U.children)this.formatField(Q,W,P,T+1);break;case"array":if(P.push(V,""),Array.isArray(Q))if(U.itemType==="object"&&U.itemMappings)Q.forEach((W,f)=>{if(P.push(`${"#".repeat(T+1)} ${U.label.slice(0,-1)} ${f+1}`),P.push(""),U.itemMappings)for(let C of U.itemMappings)this.formatField(W,C,P,T+2)});else{for(let W of Q){let f=this.defaultArrayItemFormat(W);P.push(`- ${f}`)}P.push("")}break}}getValueByPath(F,U){let P=U.split("."),T=F;for(let V of P){let Q=b0.safeParse(T);if(!Q.success)return;T=Q.data[V]}return T}defaultArrayItemFormat(F){if(typeof F==="string"||typeof F==="number")return String(F);return JSON.stringify(F)}extractSections(F,U){let P=new Map,T=null,V=[];for(let Q of F.children)if(Q.type==="heading"&&Q.depth===U){if(T)P.set(T.toLowerCase(),V);T=this.getHeadingText(Q),V=[]}else if(T)V.push(Q);if(T)P.set(T.toLowerCase(),V);return P}extractSubsections(F,U){let P=new Map,T=null,V=[];for(let Q of F)if(Q.type==="heading"&&Q.depth===U){if(T)P.set(T.toLowerCase(),V);T=this.getHeadingText(Q),V=[]}else if(T)V.push(Q);if(T)P.set(T.toLowerCase(),V);return P}textNodeSchema=J.object({type:J.literal("text"),value:J.string()});extractTextValue(F){let U=this.textNodeSchema.safeParse(F);return U.success?U.data.value:""}getHeadingText(F){return F.children.filter((P)=>P.type==="text").map((P)=>this.extractTextValue(P)).join("")}buildDataFromSections(F,U,P=2){let T={};for(let V of U){let Q=F.get(V.label.toLowerCase());if(V.type==="custom"&&V.parser&&Q){let W=this.getTextFromSection(Q),f=V.parser(W);this.setValueByPath(T,V.key,f)}else if(V.type==="object"&&V.children&&Q){let W=this.extractSubsections(Q,P+1),f=this.buildDataFromSections(W,V.children,P+1);this.setValueByPath(T,V.key,f)}else if(V.type==="array"&&Q)if(V.itemType==="object"&&V.itemMappings){let W=this.extractObjectArrayItems(Q,P+1,V.itemMappings);this.setValueByPath(T,V.key,W)}else{let W=this.extractSimpleArrayItems(Q);this.setValueByPath(T,V.key,W)}else if(Q){let W=this.getTextFromSection(Q),f=V.type==="number"?Number(W):W;this.setValueByPath(T,V.key,f)}}return T}setValueByPath(F,U,P){let T=U.split("."),V=F;for(let W=0;W<T.length-1;W++){let f=T[W];if(!f)continue;let C=b0.safeParse(V[f]);if(C.success){V[f]=C.data,V=C.data;continue}let D={};V[f]=D,V=D}let Q=T[T.length-1];if(Q)V[Q]=P}getTextFromSection(F){let U=[];for(let P of F)if(P.type==="paragraph"){let T=this.extractTextFromParagraph(P);if(T)U.push(T)}else if(P.type==="list"){let T=P;for(let V of T.children){let Q=this.extractTextFromListItem(V);if(Q)U.push(`- ${Q}`)}}return U.join(`
6
- `)}extractTextFromParagraph(F){return this.extractInlineText(F.children).trim()}extractInlineText(F){let U=[];for(let P of F)if(P.type==="text")U.push(this.extractTextValue(P));else if(P.type==="emphasis"){let T=this.extractInlineText(P.children);if(T)U.push(`*${T}*`)}else if(P.type==="strong"){let T=this.extractInlineText(P.children);if(T)U.push(`**${T}**`)}return U.join("")}extractSimpleArrayItems(F){let U=[];for(let P of F)if(P.type==="list"){let T=P;for(let V of T.children){let Q=this.extractTextFromListItem(V);if(Q)U.push(Q)}}return U}extractObjectArrayItems(F,U,P){let T=[],V=[],Q=!1;for(let W of F)if(W.type==="heading"&&W.depth===U){if(Q&&V.length>0){let f=this.extractSubsections(V,U+1),C=this.buildDataFromSections(f,P,U+1);T.push(C)}V=[],Q=!0}else if(Q)V.push(W);if(Q&&V.length>0){let W=this.extractSubsections(V,U+1),f=this.buildDataFromSections(W,P,U+1);T.push(f)}return T}extractTextFromListItem(F){let U=[];for(let P of F.children)if(P.type==="paragraph"){let T=this.extractTextFromParagraph(P);if(T)U.push(T)}return U.join(`
7
- `)}}function a$(F){return F&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F.default:F}var m={},kZ={},t={},_0;function KZ(){if(_0)return t;_0=1;function F(W){return typeof W>"u"||W===null}function U(W){return typeof W==="object"&&W!==null}function P(W){if(Array.isArray(W))return W;else if(F(W))return[];return[W]}function T(W,f){if(f){let C=Object.keys(f);for(let D=0,H=C.length;D<H;D+=1){let j=C[D];W[j]=f[j]}}return W}function V(W,f){let C="";for(let D=0;D<f;D+=1)C+=W;return C}function Q(W){return W===0&&Number.NEGATIVE_INFINITY===1/W}return t.isNothing=F,t.isObject=U,t.toArray=P,t.repeat=V,t.isNegativeZero=Q,t.extend=T,t}var lZ,E0;function HZ(){if(E0)return lZ;E0=1;function F(P,T){let V="",Q=P.reason||"(unknown reason)";if(!P.mark)return Q;if(P.mark.name)V+='in "'+P.mark.name+'" ';if(V+="("+(P.mark.line+1)+":"+(P.mark.column+1)+")",!T&&P.mark.snippet)V+=`
4
+ `}format(F){try{let U=[`# ${this.config.title}`,""];for(let Y of this.config.mappings)this.formatField(F,Y,U,2);return U.join(`
5
+ `)}catch(U){throw Error(`Failed to format structured content: ${this.describeError(U)}`,{cause:U})}}parse(F){try{let U=this.processor.parse(F),Y=this.extractSections(U,2),T=this.buildDataFromSections(Y,this.config.mappings);return this.schema.parse(T)}catch(U){throw Error(`Failed to parse structured content: ${this.describeError(U)}`,{cause:U})}}describeError(F){if(F instanceof J.ZodError)return F.issues.map((U)=>`${U.path.join(".")||"(root)"}: ${U.message}`).join("; ");return F instanceof Error?F.message:String(F)}escapeBlockMarkup(F){return F.replace(/^(\s*)#/gm,"$1\\#")}formatField(F,U,Y,T){let V="#".repeat(T)+" "+U.label,Q=this.getValueByPath(F,U.key);if(U.type==="custom"&&U.formatter){if(Q!==void 0&&Q!==null){Y.push(V,"");let W=U.formatter(Q);if(W)Y.push(W,"")}return}switch(U.type){case"string":case"number":if(Q===void 0||Q===null)break;Y.push(V,this.escapeBlockMarkup(String(Q)),"");break;case"object":if(Y.push(V),U.children&&Q)for(let W of U.children)this.formatField(Q,W,Y,T+1);break;case"array":if(Y.push(V,""),Array.isArray(Q))if(U.itemType==="object"&&U.itemMappings)Q.forEach((W,K)=>{if(Y.push(`${"#".repeat(T+1)} ${U.label.slice(0,-1)} ${K+1}`),Y.push(""),U.itemMappings)for(let w of U.itemMappings)this.formatField(W,w,Y,T+2)});else{for(let W of Q){let K=this.defaultArrayItemFormat(W);Y.push(`- ${K}`)}Y.push("")}break}}getValueByPath(F,U){let Y=U.split("."),T=F;for(let V of Y){let Q=b0.safeParse(T);if(!Q.success)return;T=Q.data[V]}return T}defaultArrayItemFormat(F){if(typeof F==="string"||typeof F==="number")return String(F);return JSON.stringify(F)}extractSections(F,U){let Y=new Map,T=null,V=[];for(let Q of F.children)if(Q.type==="heading"&&Q.depth===U){if(T)Y.set(T.toLowerCase(),V);T=this.getHeadingText(Q),V=[]}else if(T)V.push(Q);if(T)Y.set(T.toLowerCase(),V);return Y}extractSubsections(F,U){let Y=new Map,T=null,V=[];for(let Q of F)if(Q.type==="heading"&&Q.depth===U){if(T)Y.set(T.toLowerCase(),V);T=this.getHeadingText(Q),V=[]}else if(T)V.push(Q);if(T)Y.set(T.toLowerCase(),V);return Y}textNodeSchema=J.object({type:J.literal("text"),value:J.string()});extractTextValue(F){let U=this.textNodeSchema.safeParse(F);return U.success?U.data.value:""}getHeadingText(F){return F.children.filter((Y)=>Y.type==="text").map((Y)=>this.extractTextValue(Y)).join("")}buildDataFromSections(F,U,Y=2){let T={};for(let V of U){let Q=F.get(V.label.toLowerCase());if(V.type==="custom"&&V.parser&&Q){let W=this.getTextFromSection(Q),K=V.parser(W);this.setValueByPath(T,V.key,K)}else if(V.type==="object"&&V.children&&Q){let W=this.extractSubsections(Q,Y+1),K=this.buildDataFromSections(W,V.children,Y+1);this.setValueByPath(T,V.key,K)}else if(V.type==="array"&&Q)if(V.itemType==="object"&&V.itemMappings){let W=this.extractObjectArrayItems(Q,Y+1,V.itemMappings);this.setValueByPath(T,V.key,W)}else{let W=this.extractSimpleArrayItems(Q);this.setValueByPath(T,V.key,W)}else if(Q){let W=this.getTextFromSection(Q),K=V.type==="number"?Number(W):W;this.setValueByPath(T,V.key,K)}}return T}setValueByPath(F,U,Y){let T=U.split("."),V=F;for(let W=0;W<T.length-1;W++){let K=T[W];if(!K)continue;let w=b0.safeParse(V[K]);if(w.success){V[K]=w.data,V=w.data;continue}let D={};V[K]=D,V=D}let Q=T[T.length-1];if(Q)V[Q]=Y}getTextFromSection(F){let U=[];for(let Y of F)if(Y.type==="paragraph"){let T=this.extractTextFromParagraph(Y);if(T)U.push(T)}else if(Y.type==="list"){let T=Y;for(let V of T.children){let Q=this.extractTextFromListItem(V);if(Q)U.push(`- ${Q}`)}}return U.join(`
6
+ `)}extractTextFromParagraph(F){return this.extractInlineText(F.children).trim()}extractInlineText(F){let U=[];for(let Y of F)if(Y.type==="text")U.push(this.extractTextValue(Y));else if(Y.type==="emphasis"){let T=this.extractInlineText(Y.children);if(T)U.push(`*${T}*`)}else if(Y.type==="strong"){let T=this.extractInlineText(Y.children);if(T)U.push(`**${T}**`)}return U.join("")}extractSimpleArrayItems(F){let U=[];for(let Y of F)if(Y.type==="list"){let T=Y;for(let V of T.children){let Q=this.extractTextFromListItem(V);if(Q)U.push(Q)}}return U}extractObjectArrayItems(F,U,Y){let T=[],V=[],Q=!1;for(let W of F)if(W.type==="heading"&&W.depth===U){if(Q&&V.length>0){let K=this.extractSubsections(V,U+1),w=this.buildDataFromSections(K,Y,U+1);T.push(w)}V=[],Q=!0}else if(Q)V.push(W);if(Q&&V.length>0){let W=this.extractSubsections(V,U+1),K=this.buildDataFromSections(W,Y,U+1);T.push(K)}return T}extractTextFromListItem(F){let U=[];for(let Y of F.children)if(Y.type==="paragraph"){let T=this.extractTextFromParagraph(Y);if(T)U.push(T)}return U.join(`
7
+ `)}}function e$(F){return F&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F.default:F}var m={},kZ={},t={},g0;function fZ(){if(g0)return t;g0=1;function F(W){return typeof W>"u"||W===null}function U(W){return typeof W==="object"&&W!==null}function Y(W){if(Array.isArray(W))return W;else if(F(W))return[];return[W]}function T(W,K){if(K){let w=Object.keys(K);for(let D=0,H=w.length;D<H;D+=1){let j=w[D];W[j]=K[j]}}return W}function V(W,K){let w="";for(let D=0;D<K;D+=1)w+=W;return w}function Q(W){return W===0&&Number.NEGATIVE_INFINITY===1/W}return t.isNothing=F,t.isObject=U,t.toArray=Y,t.repeat=V,t.isNegativeZero=Q,t.extend=T,t}var lZ,E0;function HZ(){if(E0)return lZ;E0=1;function F(Y,T){let V="",Q=Y.reason||"(unknown reason)";if(!Y.mark)return Q;if(Y.mark.name)V+='in "'+Y.mark.name+'" ';if(V+="("+(Y.mark.line+1)+":"+(Y.mark.column+1)+")",!T&&Y.mark.snippet)V+=`
8
8
 
9
- `+P.mark.snippet;return Q+" "+V}function U(P,T){if(Error.call(this),this.name="YAMLException",this.reason=P,this.mark=T,this.message=F(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.toString=function(T){return this.name+": "+F(this,T)},lZ=U,lZ}var cZ,y0;function e$(){if(y0)return cZ;y0=1;let F=KZ();function U(V,Q,W,f,C){let D="",H="",j=Math.floor(C/2)-1;if(f-Q>j)D=" ... ",Q=f-j+D.length;if(W-f>j)H=" ...",W=f+j-H.length;return{str:D+V.slice(Q,W).replace(/\t/g,"\u2192")+H,pos:f-Q+D.length}}function P(V,Q){return F.repeat(" ",Q-V.length)+V}function T(V,Q){if(Q=Object.create(Q||null),!V.buffer)return null;if(!Q.maxLength)Q.maxLength=79;if(typeof Q.indent!=="number")Q.indent=1;if(typeof Q.linesBefore!=="number")Q.linesBefore=3;if(typeof Q.linesAfter!=="number")Q.linesAfter=2;let W=/\r?\n|\r|\0/g,f=[0],C=[],D,H=-1;while(D=W.exec(V.buffer))if(C.push(D.index),f.push(D.index+D[0].length),V.position<=D.index&&H<0)H=f.length-2;if(H<0)H=f.length-1;let j="",k=Math.min(V.line+Q.linesAfter,C.length).toString().length,v=Q.maxLength-(Q.indent+k+3);for(let g=1;g<=Q.linesBefore;g++){if(H-g<0)break;let l=U(V.buffer,f[H-g],C[H-g],V.position-(f[H]-f[H-g]),v);j=F.repeat(" ",Q.indent)+P((V.line-g+1).toString(),k)+" | "+l.str+`
10
- `+j}let s=U(V.buffer,f[H],C[H],V.position,v);j+=F.repeat(" ",Q.indent)+P((V.line+1).toString(),k)+" | "+s.str+`
9
+ `+Y.mark.snippet;return Q+" "+V}function U(Y,T){if(Error.call(this),this.name="YAMLException",this.reason=Y,this.mark=T,this.message=F(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.toString=function(T){return this.name+": "+F(this,T)},lZ=U,lZ}var cZ,y0;function t$(){if(y0)return cZ;y0=1;let F=fZ();function U(V,Q,W,K,w){let D="",H="",j=Math.floor(w/2)-1;if(K-Q>j)D=" ... ",Q=K-j+D.length;if(W-K>j)H=" ...",W=K+j-H.length;return{str:D+V.slice(Q,W).replace(/\t/g,"\u2192")+H,pos:K-Q+D.length}}function Y(V,Q){return F.repeat(" ",Q-V.length)+V}function T(V,Q){if(Q=Object.create(Q||null),!V.buffer)return null;if(!Q.maxLength)Q.maxLength=79;if(typeof Q.indent!=="number")Q.indent=1;if(typeof Q.linesBefore!=="number")Q.linesBefore=3;if(typeof Q.linesAfter!=="number")Q.linesAfter=2;let W=/\r?\n|\r|\0/g,K=[0],w=[],D,H=-1;while(D=W.exec(V.buffer))if(w.push(D.index),K.push(D.index+D[0].length),V.position<=D.index&&H<0)H=K.length-2;if(H<0)H=K.length-1;let j="",k=Math.min(V.line+Q.linesAfter,w.length).toString().length,v=Q.maxLength-(Q.indent+k+3);for(let _=1;_<=Q.linesBefore;_++){if(H-_<0)break;let l=U(V.buffer,K[H-_],w[H-_],V.position-(K[H]-K[H-_]),v);j=F.repeat(" ",Q.indent)+Y((V.line-_+1).toString(),k)+" | "+l.str+`
10
+ `+j}let s=U(V.buffer,K[H],w[H],V.position,v);j+=F.repeat(" ",Q.indent)+Y((V.line+1).toString(),k)+" | "+s.str+`
11
11
  `,j+=F.repeat("-",Q.indent+k+3+s.pos)+`^
12
- `;for(let g=1;g<=Q.linesAfter;g++){if(H+g>=C.length)break;let l=U(V.buffer,f[H+g],C[H+g],V.position-(f[H]-f[H+g]),v);j+=F.repeat(" ",Q.indent)+P((V.line+g+1).toString(),k)+" | "+l.str+`
13
- `}return j.replace(/\n$/,"")}return cZ=T,cZ}var oZ,m0;function h(){if(m0)return oZ;m0=1;let F=HZ(),U=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],P=["scalar","sequence","mapping"];function T(Q){let W={};if(Q!==null)Object.keys(Q).forEach(function(f){Q[f].forEach(function(C){W[String(C)]=f})});return W}function V(Q,W){if(W=W||{},Object.keys(W).forEach(function(f){if(U.indexOf(f)===-1)throw new F('Unknown option "'+f+'" is met in definition of "'+Q+'" YAML type.')}),this.options=W,this.tag=Q,this.kind=W.kind||null,this.resolve=W.resolve||function(){return!0},this.construct=W.construct||function(f){return f},this.instanceOf=W.instanceOf||null,this.predicate=W.predicate||null,this.represent=W.represent||null,this.representName=W.representName||null,this.defaultStyle=W.defaultStyle||null,this.multi=W.multi||!1,this.styleAliases=T(W.styleAliases||null),P.indexOf(this.kind)===-1)throw new F('Unknown kind "'+this.kind+'" is specified for "'+Q+'" YAML type.')}return oZ=V,oZ}var rZ,h0;function Q$(){if(h0)return rZ;h0=1;let F=HZ(),U=h();function P(Q,W){let f=[];return Q[W].forEach(function(C){let D=f.length;f.forEach(function(H,j){if(H.tag===C.tag&&H.kind===C.kind&&H.multi===C.multi)D=j}),f[D]=C}),f}function T(){let Q={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function W(f){if(f.multi)Q.multi[f.kind].push(f),Q.multi.fallback.push(f);else Q[f.kind][f.tag]=Q.fallback[f.tag]=f}for(let f=0,C=arguments.length;f<C;f+=1)arguments[f].forEach(W);return Q}function V(Q){return this.extend(Q)}return V.prototype.extend=function(W){let f=[],C=[];if(W instanceof U)C.push(W);else if(Array.isArray(W))C=C.concat(W);else if(W&&(Array.isArray(W.implicit)||Array.isArray(W.explicit))){if(W.implicit)f=f.concat(W.implicit);if(W.explicit)C=C.concat(W.explicit)}else throw new F("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");f.forEach(function(H){if(!(H instanceof U))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(H.loadKind&&H.loadKind!=="scalar")throw new F("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(H.multi)throw new F("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),C.forEach(function(H){if(!(H instanceof U))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let D=Object.create(V.prototype);return D.implicit=(this.implicit||[]).concat(f),D.explicit=(this.explicit||[]).concat(C),D.compiledImplicit=P(D,"implicit"),D.compiledExplicit=P(D,"explicit"),D.compiledTypeMap=T(D.compiledImplicit,D.compiledExplicit),D},rZ=V,rZ}var nZ,u0;function D$(){if(u0)return nZ;return u0=1,nZ=new(h())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(U){return U!==null?U:""}}),nZ}var iZ,p0;function U$(){if(p0)return iZ;return p0=1,iZ=new(h())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(U){return U!==null?U:[]}}),iZ}var sZ,d0;function W$(){if(d0)return sZ;return d0=1,sZ=new(h())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(U){return U!==null?U:{}}}),sZ}var aZ,l0;function M$(){if(l0)return aZ;return l0=1,aZ=new(Q$())({explicit:[D$(),U$(),W$()]}),aZ}var eZ,c0;function f$(){if(c0)return eZ;c0=1;let F=h();function U(V){if(V===null)return!0;let Q=V.length;return Q===1&&V==="~"||Q===4&&(V==="null"||V==="Null"||V==="NULL")}function P(){return null}function T(V){return V===null}return eZ=new F("tag:yaml.org,2002:null",{kind:"scalar",resolve:U,construct:P,predicate:T,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),eZ}var tZ,o0;function K$(){if(o0)return tZ;o0=1;let F=h();function U(V){if(V===null)return!1;let Q=V.length;return Q===4&&(V==="true"||V==="True"||V==="TRUE")||Q===5&&(V==="false"||V==="False"||V==="FALSE")}function P(V){return V==="true"||V==="True"||V==="TRUE"}function T(V){return Object.prototype.toString.call(V)==="[object Boolean]"}return tZ=new F("tag:yaml.org,2002:bool",{kind:"scalar",resolve:U,construct:P,predicate:T,represent:{lowercase:function(V){return V?"true":"false"},uppercase:function(V){return V?"TRUE":"FALSE"},camelcase:function(V){return V?"True":"False"}},defaultStyle:"lowercase"}),tZ}var Z0,r0;function H$(){if(r0)return Z0;r0=1;let F=KZ(),U=h();function P(D){return D>=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102}function T(D){return D>=48&&D<=55}function V(D){return D>=48&&D<=57}function Q(D){if(D===null)return!1;let H=D.length,j=0,k=!1;if(!H)return!1;let v=D[j];if(v==="-"||v==="+")v=D[++j];if(v==="0"){if(j+1===H)return!0;if(v=D[++j],v==="b"){j++;for(;j<H;j++){if(v=D[j],v!=="0"&&v!=="1")return!1;k=!0}return k&&isFinite(W(D))}if(v==="x"){j++;for(;j<H;j++){if(!P(D.charCodeAt(j)))return!1;k=!0}return k&&isFinite(W(D))}if(v==="o"){j++;for(;j<H;j++){if(!T(D.charCodeAt(j)))return!1;k=!0}return k&&isFinite(W(D))}}for(;j<H;j++){if(!V(D.charCodeAt(j)))return!1;k=!0}if(!k)return!1;return isFinite(W(D))}function W(D){let H=D,j=1,k=H[0];if(k==="-"||k==="+"){if(k==="-")j=-1;H=H.slice(1),k=H[0]}if(H==="0")return 0;if(k==="0"){if(H[1]==="b")return j*parseInt(H.slice(2),2);if(H[1]==="x")return j*parseInt(H.slice(2),16);if(H[1]==="o")return j*parseInt(H.slice(2),8)}return j*parseInt(H,10)}function f(D){return W(D)}function C(D){return Object.prototype.toString.call(D)==="[object Number]"&&(D%1===0&&!F.isNegativeZero(D))}return Z0=new U("tag:yaml.org,2002:int",{kind:"scalar",resolve:Q,construct:f,predicate:C,represent:{binary:function(D){return D>=0?"0b"+D.toString(2):"-0b"+D.toString(2).slice(1)},octal:function(D){return D>=0?"0o"+D.toString(8):"-0o"+D.toString(8).slice(1)},decimal:function(D){return D.toString(10)},hexadecimal:function(D){return D>=0?"0x"+D.toString(16).toUpperCase():"-0x"+D.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Z0}var $0,n0;function R$(){if(n0)return $0;n0=1;let F=KZ(),U=h(),P=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),T=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function V(D){if(D===null)return!1;if(!P.test(D))return!1;if(isFinite(parseFloat(D,10)))return!0;return T.test(D)}function Q(D){let H=D.toLowerCase(),j=H[0]==="-"?-1:1;if("+-".indexOf(H[0])>=0)H=H.slice(1);if(H===".inf")return j===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(H===".nan")return NaN;return j*parseFloat(H,10)}let W=/^[-+]?[0-9]+e/;function f(D,H){if(isNaN(D))switch(H){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===D)switch(H){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===D)switch(H){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(F.isNegativeZero(D))return"-0.0";let j=D.toString(10);return W.test(j)?j.replace("e",".e"):j}function C(D){return Object.prototype.toString.call(D)==="[object Number]"&&(D%1!==0||F.isNegativeZero(D))}return $0=new U("tag:yaml.org,2002:float",{kind:"scalar",resolve:V,construct:Q,predicate:C,represent:f,defaultStyle:"lowercase"}),$0}var J0,i0;function Y$(){if(i0)return J0;return i0=1,J0=M$().extend({implicit:[f$(),K$(),H$(),R$()]}),J0}var X0,s0;function P$(){if(s0)return X0;return s0=1,X0=Y$(),X0}var G0,a0;function B$(){if(a0)return G0;a0=1;let F=h(),U=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),P=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function T(W){if(W===null)return!1;if(U.exec(W)!==null)return!0;if(P.exec(W)!==null)return!0;return!1}function V(W){let f=0,C=null,D=U.exec(W);if(D===null)D=P.exec(W);if(D===null)throw Error("Date resolve error");let H=+D[1],j=+D[2]-1,k=+D[3];if(!D[4])return new Date(Date.UTC(H,j,k));let v=+D[4],s=+D[5],g=+D[6];if(D[7]){f=D[7].slice(0,3);while(f.length<3)f+="0";f=+f}if(D[9]){let ZZ=+D[10],u=+(D[11]||0);if(C=(ZZ*60+u)*60000,D[9]==="-")C=-C}let l=new Date(Date.UTC(H,j,k,v,s,g,f));if(C)l.setTime(l.getTime()-C);return l}function Q(W){return W.toISOString()}return G0=new F("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:T,construct:V,instanceOf:Date,represent:Q}),G0}var V0,e0;function O$(){if(e0)return V0;e0=1;let F=h();function U(P){return P==="<<"||P===null}return V0=new F("tag:yaml.org,2002:merge",{kind:"scalar",resolve:U}),V0}var F0,t0;function q$(){if(t0)return F0;t0=1;let F=h(),U=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
14
- \r`;function P(W){if(W===null)return!1;let f=0,C=W.length,D=U;for(let H=0;H<C;H++){let j=D.indexOf(W.charAt(H));if(j>64)continue;if(j<0)return!1;f+=6}return f%8===0}function T(W){let f=W.replace(/[\r\n=]/g,""),C=f.length,D=U,H=0,j=[];for(let v=0;v<C;v++){if(v%4===0&&v)j.push(H>>16&255),j.push(H>>8&255),j.push(H&255);H=H<<6|D.indexOf(f.charAt(v))}let k=C%4*6;if(k===0)j.push(H>>16&255),j.push(H>>8&255),j.push(H&255);else if(k===18)j.push(H>>10&255),j.push(H>>2&255);else if(k===12)j.push(H>>4&255);return new Uint8Array(j)}function V(W){let f="",C=0,D=W.length,H=U;for(let k=0;k<D;k++){if(k%3===0&&k)f+=H[C>>18&63],f+=H[C>>12&63],f+=H[C>>6&63],f+=H[C&63];C=(C<<8)+W[k]}let j=D%3;if(j===0)f+=H[C>>18&63],f+=H[C>>12&63],f+=H[C>>6&63],f+=H[C&63];else if(j===2)f+=H[C>>10&63],f+=H[C>>4&63],f+=H[C<<2&63],f+=H[64];else if(j===1)f+=H[C>>2&63],f+=H[C<<4&63],f+=H[64],f+=H[64];return f}function Q(W){return Object.prototype.toString.call(W)==="[object Uint8Array]"}return F0=new F("tag:yaml.org,2002:binary",{kind:"scalar",resolve:P,construct:T,predicate:Q,represent:V}),F0}var Q0,Z$;function A$(){if(Z$)return Q0;Z$=1;let F=h(),U=Object.prototype.hasOwnProperty,P=Object.prototype.toString;function T(Q){if(Q===null)return!0;let W=[],f=Q;for(let C=0,D=f.length;C<D;C+=1){let H=f[C],j=!1;if(P.call(H)!=="[object Object]")return!1;let k;for(k in H)if(U.call(H,k))if(!j)j=!0;else return!1;if(!j)return!1;if(W.indexOf(k)===-1)W.push(k);else return!1}return!0}function V(Q){return Q!==null?Q:[]}return Q0=new F("tag:yaml.org,2002:omap",{kind:"sequence",resolve:T,construct:V}),Q0}var D0,$$;function T$(){if($$)return D0;$$=1;let F=h(),U=Object.prototype.toString;function P(V){if(V===null)return!0;let Q=V,W=Array(Q.length);for(let f=0,C=Q.length;f<C;f+=1){let D=Q[f];if(U.call(D)!=="[object Object]")return!1;let H=Object.keys(D);if(H.length!==1)return!1;W[f]=[H[0],D[H[0]]]}return!0}function T(V){if(V===null)return[];let Q=V,W=Array(Q.length);for(let f=0,C=Q.length;f<C;f+=1){let D=Q[f],H=Object.keys(D);W[f]=[H[0],D[H[0]]]}return W}return D0=new F("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:P,construct:T}),D0}var U0,J$;function w$(){if(J$)return U0;J$=1;let F=h(),U=Object.prototype.hasOwnProperty;function P(V){if(V===null)return!0;let Q=V;for(let W in Q)if(U.call(Q,W)){if(Q[W]!==null)return!1}return!0}function T(V){return V!==null?V:{}}return U0=new F("tag:yaml.org,2002:set",{kind:"mapping",resolve:P,construct:T}),U0}var W0,X$;function f0(){if(X$)return W0;return X$=1,W0=P$().extend({implicit:[B$(),O$()],explicit:[q$(),A$(),T$(),w$()]}),W0}var G$;function t$(){if(G$)return kZ;G$=1;let F=KZ(),U=HZ(),P=e$(),T=f0(),V=Object.prototype.hasOwnProperty,Q=1,W=2,f=3,C=4,D=1,H=2,j=3,k=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,s=/[,\[\]{}]/,g=/^(?:!|!!|![0-9A-Za-z-]+!)$/,l=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ZZ(Z){return Object.prototype.toString.call(Z)}function u(Z){return Z===10||Z===13}function p(Z){return Z===9||Z===32}function y(Z){return Z===9||Z===32||Z===10||Z===13}function a(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function xZ(Z){if(Z>=48&&Z<=57)return Z-48;let X=Z|32;if(X>=97&&X<=102)return X-97+10;return-1}function vZ(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function RZ(Z){if(Z>=48&&Z<=57)return Z-48;return-1}function FZ(Z){switch(Z){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
15
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function bZ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function QZ(Z,X,K){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:K});else Z[X]=K}let YZ=Array(256),DZ=Array(256);for(let Z=0;Z<256;Z++)YZ[Z]=FZ(Z)?1:0,DZ[Z]=FZ(Z);function E(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||T,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.maxDepth=typeof X.maxDepth==="number"?X.maxDepth:100,this.maxTotalMergeKeys=typeof X.maxTotalMergeKeys==="number"?X.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=Z.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function PZ(Z,X){let K={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return K.snippet=P(K),new U(X,K)}function I(Z,X){throw PZ(Z,X)}function JZ(Z,X){if(Z.onWarning)Z.onWarning.call(null,PZ(Z,X))}function c(Z,X,K){let B=Z.anchorMapTransactions;if(B.length!==0){let M=B[B.length-1];if(!V.call(M,X))M[X]={existed:V.call(Z.anchorMap,X),value:Z.anchorMap[X]}}Z.anchorMap[X]=K}function gZ(Z){Z.anchorMapTransactions.push(Object.create(null))}function $Z(Z){let X=Z.anchorMapTransactions.pop(),K=Z.anchorMapTransactions;if(K.length===0)return;let B=K[K.length-1],M=Object.keys(X);for(let w=0,$=M.length;w<$;w+=1){let G=M[w];if(!V.call(B,G))B[G]=X[G]}}function _Z(Z){let X=Z.anchorMapTransactions.pop(),K=Object.keys(X);for(let B=K.length-1;B>=0;B-=1){let M=X[K[B]];if(M.existed)Z.anchorMap[K[B]]=M.value;else delete Z.anchorMap[K[B]]}}function UZ(Z){return{position:Z.position,line:Z.line,lineStart:Z.lineStart,lineIndent:Z.lineIndent,firstTabInLine:Z.firstTabInLine,tag:Z.tag,anchor:Z.anchor,kind:Z.kind,result:Z.result}}function XZ(Z,X){Z.position=X.position,Z.line=X.line,Z.lineStart=X.lineStart,Z.lineIndent=X.lineIndent,Z.firstTabInLine=X.firstTabInLine,Z.tag=X.tag,Z.anchor=X.anchor,Z.kind=X.kind,Z.result=X.result}let BZ={YAML:function(X,K,B){if(X.version!==null)I(X,"duplication of %YAML directive");if(B.length!==1)I(X,"YAML directive accepts exactly one argument");let M=/^([0-9]+)\.([0-9]+)$/.exec(B[0]);if(M===null)I(X,"ill-formed argument of the YAML directive");let w=parseInt(M[1],10),$=parseInt(M[2],10);if(w!==1)I(X,"unacceptable YAML version of the document");if(X.version=B[0],X.checkLineBreaks=$<2,$!==1&&$!==2)JZ(X,"unsupported YAML version of the document")},TAG:function(X,K,B){let M;if(B.length!==2)I(X,"TAG directive accepts exactly two arguments");let w=B[0];if(M=B[1],!g.test(w))I(X,"ill-formed tag handle (first argument) of the TAG directive");if(V.call(X.tagMap,w))I(X,'there is a previously declared suffix for "'+w+'" tag handle');if(!l.test(M))I(X,"ill-formed tag prefix (second argument) of the TAG directive");try{M=decodeURIComponent(M)}catch($){I(X,"tag prefix is malformed: "+M)}X.tagMap[w]=M}};function d(Z,X,K,B){if(X<K){let M=Z.input.slice(X,K);if(B)for(let w=0,$=M.length;w<$;w+=1){let G=M.charCodeAt(w);if(!(G===9||G>=32&&G<=1114111))I(Z,"expected valid JSON character")}else if(k.test(M))I(Z,"the stream contains non-printable characters");Z.result+=M}}function e(Z,X,K,B){if(!F.isObject(K))I(Z,"cannot merge mappings; the provided source object is unacceptable");let M=Object.keys(K);for(let w=0,$=M.length;w<$;w+=1){let G=M[w];if(Z.maxTotalMergeKeys!==-1&&++Z.totalMergeKeys>Z.maxTotalMergeKeys)I(Z,"merge keys exceeded maxTotalMergeKeys ("+Z.maxTotalMergeKeys+")");if(!V.call(X,G))QZ(X,G,K[G]),B[G]=!0}}function o(Z,X,K,B,M,w,$,G,q){if(Array.isArray(M)){M=Array.prototype.slice.call(M);for(let R=0,Y=M.length;R<Y;R+=1){if(Array.isArray(M[R]))I(Z,"nested arrays are not supported inside keys");if(typeof M==="object"&&ZZ(M[R])==="[object Object]")M[R]="[object Object]"}}if(typeof M==="object"&&ZZ(M)==="[object Object]")M="[object Object]";if(M=String(M),X===null)X={};if(B==="tag:yaml.org,2002:merge")if(Array.isArray(w))for(let R=0,Y=w.length;R<Y;R+=1)e(Z,X,w[R],K);else e(Z,X,w,K);else{if(!Z.json&&!V.call(K,M)&&V.call(X,M))Z.line=$||Z.line,Z.lineStart=G||Z.lineStart,Z.position=q||Z.position,I(Z,"duplicated mapping key");QZ(X,M,w),delete K[M]}return X}function GZ(Z){let X=Z.input.charCodeAt(Z.position);if(X===10)Z.position++;else if(X===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else I(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function _(Z,X,K){let B=0,M=Z.input.charCodeAt(Z.position);while(M!==0){while(p(M)){if(M===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;M=Z.input.charCodeAt(++Z.position)}if(X&&M===35)do M=Z.input.charCodeAt(++Z.position);while(M!==10&&M!==13&&M!==0);if(u(M)){GZ(Z),M=Z.input.charCodeAt(Z.position),B++,Z.lineIndent=0;while(M===32)Z.lineIndent++,M=Z.input.charCodeAt(++Z.position)}else break}if(K!==-1&&B!==0&&Z.lineIndent<K)JZ(Z,"deficient indentation");return B}function VZ(Z){let X=Z.position,K=Z.input.charCodeAt(X);if((K===45||K===46)&&K===Z.input.charCodeAt(X+1)&&K===Z.input.charCodeAt(X+2)){if(X+=3,K=Z.input.charCodeAt(X),K===0||y(K))return!0}return!1}function r(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=F.repeat(`
16
- `,X-1)}function OZ(Z,X,K){let B,M,w,$,G,q,R=Z.kind,Y=Z.result,A=Z.input.charCodeAt(Z.position);if(y(A)||a(A)||A===35||A===38||A===42||A===33||A===124||A===62||A===39||A===34||A===37||A===64||A===96)return!1;if(A===63||A===45){let O=Z.input.charCodeAt(Z.position+1);if(y(O)||K&&a(O))return!1}Z.kind="scalar",Z.result="",B=M=Z.position,w=!1;while(A!==0){if(A===58){let O=Z.input.charCodeAt(Z.position+1);if(y(O)||K&&a(O))break}else if(A===35){let O=Z.input.charCodeAt(Z.position-1);if(y(O))break}else if(Z.position===Z.lineStart&&VZ(Z)||K&&a(A))break;else if(u(A))if($=Z.line,G=Z.lineStart,q=Z.lineIndent,_(Z,!1,-1),Z.lineIndent>=X){w=!0,A=Z.input.charCodeAt(Z.position);continue}else{Z.position=M,Z.line=$,Z.lineStart=G,Z.lineIndent=q;break}if(w)d(Z,B,M,!1),r(Z,Z.line-$),B=M=Z.position,w=!1;if(!p(A))M=Z.position+1;A=Z.input.charCodeAt(++Z.position)}if(d(Z,B,M,!1),Z.result)return!0;return Z.kind=R,Z.result=Y,!1}function qZ(Z,X){let K,B,M=Z.input.charCodeAt(Z.position);if(M!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,K=B=Z.position;while((M=Z.input.charCodeAt(Z.position))!==0)if(M===39)if(d(Z,K,Z.position,!0),M=Z.input.charCodeAt(++Z.position),M===39)K=Z.position,Z.position++,B=Z.position;else return!0;else if(u(M))d(Z,K,B,!0),r(Z,_(Z,!1,X)),K=B=Z.position;else if(Z.position===Z.lineStart&&VZ(Z))I(Z,"unexpected end of the document within a single quoted scalar");else if(Z.position++,!p(M))B=Z.position;I(Z,"unexpected end of the stream within a single quoted scalar")}function WZ(Z,X){let K,B,M,w=Z.input.charCodeAt(Z.position);if(w!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,K=B=Z.position;while((w=Z.input.charCodeAt(Z.position))!==0)if(w===34)return d(Z,K,Z.position,!0),Z.position++,!0;else if(w===92){if(d(Z,K,Z.position,!0),w=Z.input.charCodeAt(++Z.position),u(w))_(Z,!1,X);else if(w<256&&YZ[w])Z.result+=DZ[w],Z.position++;else if((M=vZ(w))>0){let $=M,G=0;for(;$>0;$--)if(w=Z.input.charCodeAt(++Z.position),(M=xZ(w))>=0)G=(G<<4)+M;else I(Z,"expected hexadecimal character");Z.result+=bZ(G),Z.position++}else I(Z,"unknown escape sequence");K=B=Z.position}else if(u(w))d(Z,K,B,!0),r(Z,_(Z,!1,X)),K=B=Z.position;else if(Z.position===Z.lineStart&&VZ(Z))I(Z,"unexpected end of the document within a double quoted scalar");else if(Z.position++,!p(w))B=Z.position;I(Z,"unexpected end of the stream within a double quoted scalar")}function AZ(Z,X){let K=!0,B,M,w,$=Z.tag,G,q=Z.anchor,R,Y,A,O,N=Object.create(null),L,S,z,x=Z.input.charCodeAt(Z.position);if(x===91)R=93,O=!1,G=[];else if(x===123)R=125,O=!0,G={};else return!1;if(Z.anchor!==null)c(Z,Z.anchor,G);x=Z.input.charCodeAt(++Z.position);while(x!==0){if(_(Z,!0,X),x=Z.input.charCodeAt(Z.position),x===R)return Z.position++,Z.tag=$,Z.anchor=q,Z.kind=O?"mapping":"sequence",Z.result=G,!0;else if(!K)I(Z,"missed comma between flow collection entries");else if(x===44)I(Z,"expected the node content, but found ','");if(S=L=z=null,Y=A=!1,x===63){let b=Z.input.charCodeAt(Z.position+1);if(y(b))Y=A=!0,Z.position++,_(Z,!0,X)}if(B=Z.line,M=Z.lineStart,w=Z.position,i(Z,X,Q,!1,!0),S=Z.tag,L=Z.result,_(Z,!0,X),x=Z.input.charCodeAt(Z.position),(A||Z.line===B)&&x===58)Y=!0,x=Z.input.charCodeAt(++Z.position),_(Z,!0,X),i(Z,X,Q,!1,!0),z=Z.result;if(O)o(Z,G,N,S,L,z,B,M,w);else if(Y)G.push(o(Z,null,N,S,L,z,B,M,w));else G.push(L);if(_(Z,!0,X),x=Z.input.charCodeAt(Z.position),x===44)K=!0,x=Z.input.charCodeAt(++Z.position);else K=!1}I(Z,"unexpected end of the stream within a flow collection")}function TZ(Z,X){let K,B=D,M=!1,w=!1,$=X,G=0,q=!1,R,Y=Z.input.charCodeAt(Z.position);if(Y===124)K=!1;else if(Y===62)K=!0;else return!1;Z.kind="scalar",Z.result="";while(Y!==0)if(Y=Z.input.charCodeAt(++Z.position),Y===43||Y===45)if(D===B)B=Y===43?j:H;else I(Z,"repeat of a chomping mode identifier");else if((R=RZ(Y))>=0)if(R===0)I(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!w)$=X+R-1,w=!0;else I(Z,"repeat of an indentation width identifier");else break;if(p(Y)){do Y=Z.input.charCodeAt(++Z.position);while(p(Y));if(Y===35)do Y=Z.input.charCodeAt(++Z.position);while(!u(Y)&&Y!==0)}while(Y!==0){GZ(Z),Z.lineIndent=0,Y=Z.input.charCodeAt(Z.position);while((!w||Z.lineIndent<$)&&Y===32)Z.lineIndent++,Y=Z.input.charCodeAt(++Z.position);if(!w&&Z.lineIndent>$)$=Z.lineIndent;if(u(Y)){G++;continue}if(!w&&$===0)I(Z,"missing indentation for block scalar");if(Z.lineIndent<$){if(B===j)Z.result+=F.repeat(`
12
+ `;for(let _=1;_<=Q.linesAfter;_++){if(H+_>=w.length)break;let l=U(V.buffer,K[H+_],w[H+_],V.position-(K[H]-K[H+_]),v);j+=F.repeat(" ",Q.indent)+Y((V.line+_+1).toString(),k)+" | "+l.str+`
13
+ `}return j.replace(/\n$/,"")}return cZ=T,cZ}var oZ,m0;function h(){if(m0)return oZ;m0=1;let F=HZ(),U=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Y=["scalar","sequence","mapping"];function T(Q){let W={};if(Q!==null)Object.keys(Q).forEach(function(K){Q[K].forEach(function(w){W[String(w)]=K})});return W}function V(Q,W){if(W=W||{},Object.keys(W).forEach(function(K){if(U.indexOf(K)===-1)throw new F('Unknown option "'+K+'" is met in definition of "'+Q+'" YAML type.')}),this.options=W,this.tag=Q,this.kind=W.kind||null,this.resolve=W.resolve||function(){return!0},this.construct=W.construct||function(K){return K},this.instanceOf=W.instanceOf||null,this.predicate=W.predicate||null,this.represent=W.represent||null,this.representName=W.representName||null,this.defaultStyle=W.defaultStyle||null,this.multi=W.multi||!1,this.styleAliases=T(W.styleAliases||null),Y.indexOf(this.kind)===-1)throw new F('Unknown kind "'+this.kind+'" is specified for "'+Q+'" YAML type.')}return oZ=V,oZ}var rZ,h0;function Q$(){if(h0)return rZ;h0=1;let F=HZ(),U=h();function Y(Q,W){let K=[];return Q[W].forEach(function(w){let D=K.length;K.forEach(function(H,j){if(H.tag===w.tag&&H.kind===w.kind&&H.multi===w.multi)D=j}),K[D]=w}),K}function T(){let Q={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function W(K){if(K.multi)Q.multi[K.kind].push(K),Q.multi.fallback.push(K);else Q[K.kind][K.tag]=Q.fallback[K.tag]=K}for(let K=0,w=arguments.length;K<w;K+=1)arguments[K].forEach(W);return Q}function V(Q){return this.extend(Q)}return V.prototype.extend=function(W){let K=[],w=[];if(W instanceof U)w.push(W);else if(Array.isArray(W))w=w.concat(W);else if(W&&(Array.isArray(W.implicit)||Array.isArray(W.explicit))){if(W.implicit)K=K.concat(W.implicit);if(W.explicit)w=w.concat(W.explicit)}else throw new F("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");K.forEach(function(H){if(!(H instanceof U))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(H.loadKind&&H.loadKind!=="scalar")throw new F("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(H.multi)throw new F("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),w.forEach(function(H){if(!(H instanceof U))throw new F("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let D=Object.create(V.prototype);return D.implicit=(this.implicit||[]).concat(K),D.explicit=(this.explicit||[]).concat(w),D.compiledImplicit=Y(D,"implicit"),D.compiledExplicit=Y(D,"explicit"),D.compiledTypeMap=T(D.compiledImplicit,D.compiledExplicit),D},rZ=V,rZ}var nZ,u0;function D$(){if(u0)return nZ;return u0=1,nZ=new(h())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(U){return U!==null?U:""}}),nZ}var iZ,p0;function U$(){if(p0)return iZ;return p0=1,iZ=new(h())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(U){return U!==null?U:[]}}),iZ}var sZ,d0;function W$(){if(d0)return sZ;return d0=1,sZ=new(h())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(U){return U!==null?U:{}}}),sZ}var aZ,l0;function M$(){if(l0)return aZ;return l0=1,aZ=new(Q$())({explicit:[D$(),U$(),W$()]}),aZ}var eZ,c0;function K$(){if(c0)return eZ;c0=1;let F=h();function U(V){if(V===null)return!0;let Q=V.length;return Q===1&&V==="~"||Q===4&&(V==="null"||V==="Null"||V==="NULL")}function Y(){return null}function T(V){return V===null}return eZ=new F("tag:yaml.org,2002:null",{kind:"scalar",resolve:U,construct:Y,predicate:T,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),eZ}var tZ,o0;function f$(){if(o0)return tZ;o0=1;let F=h();function U(V){if(V===null)return!1;let Q=V.length;return Q===4&&(V==="true"||V==="True"||V==="TRUE")||Q===5&&(V==="false"||V==="False"||V==="FALSE")}function Y(V){return V==="true"||V==="True"||V==="TRUE"}function T(V){return Object.prototype.toString.call(V)==="[object Boolean]"}return tZ=new F("tag:yaml.org,2002:bool",{kind:"scalar",resolve:U,construct:Y,predicate:T,represent:{lowercase:function(V){return V?"true":"false"},uppercase:function(V){return V?"TRUE":"FALSE"},camelcase:function(V){return V?"True":"False"}},defaultStyle:"lowercase"}),tZ}var Z0,r0;function H$(){if(r0)return Z0;r0=1;let F=fZ(),U=h();function Y(D){return D>=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102}function T(D){return D>=48&&D<=55}function V(D){return D>=48&&D<=57}function Q(D){if(D===null)return!1;let H=D.length,j=0,k=!1;if(!H)return!1;let v=D[j];if(v==="-"||v==="+")v=D[++j];if(v==="0"){if(j+1===H)return!0;if(v=D[++j],v==="b"){j++;for(;j<H;j++){if(v=D[j],v!=="0"&&v!=="1")return!1;k=!0}return k&&isFinite(W(D))}if(v==="x"){j++;for(;j<H;j++){if(!Y(D.charCodeAt(j)))return!1;k=!0}return k&&isFinite(W(D))}if(v==="o"){j++;for(;j<H;j++){if(!T(D.charCodeAt(j)))return!1;k=!0}return k&&isFinite(W(D))}}for(;j<H;j++){if(!V(D.charCodeAt(j)))return!1;k=!0}if(!k)return!1;return isFinite(W(D))}function W(D){let H=D,j=1,k=H[0];if(k==="-"||k==="+"){if(k==="-")j=-1;H=H.slice(1),k=H[0]}if(H==="0")return 0;if(k==="0"){if(H[1]==="b")return j*parseInt(H.slice(2),2);if(H[1]==="x")return j*parseInt(H.slice(2),16);if(H[1]==="o")return j*parseInt(H.slice(2),8)}return j*parseInt(H,10)}function K(D){return W(D)}function w(D){return Object.prototype.toString.call(D)==="[object Number]"&&(D%1===0&&!F.isNegativeZero(D))}return Z0=new U("tag:yaml.org,2002:int",{kind:"scalar",resolve:Q,construct:K,predicate:w,represent:{binary:function(D){return D>=0?"0b"+D.toString(2):"-0b"+D.toString(2).slice(1)},octal:function(D){return D>=0?"0o"+D.toString(8):"-0o"+D.toString(8).slice(1)},decimal:function(D){return D.toString(10)},hexadecimal:function(D){return D>=0?"0x"+D.toString(16).toUpperCase():"-0x"+D.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Z0}var $0,n0;function R$(){if(n0)return $0;n0=1;let F=fZ(),U=h(),Y=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),T=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function V(D){if(D===null)return!1;if(!Y.test(D))return!1;if(isFinite(parseFloat(D,10)))return!0;return T.test(D)}function Q(D){let H=D.toLowerCase(),j=H[0]==="-"?-1:1;if("+-".indexOf(H[0])>=0)H=H.slice(1);if(H===".inf")return j===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(H===".nan")return NaN;return j*parseFloat(H,10)}let W=/^[-+]?[0-9]+e/;function K(D,H){if(isNaN(D))switch(H){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===D)switch(H){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===D)switch(H){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(F.isNegativeZero(D))return"-0.0";let j=D.toString(10);return W.test(j)?j.replace("e",".e"):j}function w(D){return Object.prototype.toString.call(D)==="[object Number]"&&(D%1!==0||F.isNegativeZero(D))}return $0=new U("tag:yaml.org,2002:float",{kind:"scalar",resolve:V,construct:Q,predicate:w,represent:K,defaultStyle:"lowercase"}),$0}var J0,i0;function Y$(){if(i0)return J0;return i0=1,J0=M$().extend({implicit:[K$(),f$(),H$(),R$()]}),J0}var X0,s0;function P$(){if(s0)return X0;return s0=1,X0=Y$(),X0}var G0,a0;function B$(){if(a0)return G0;a0=1;let F=h(),U=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Y=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function T(W){if(W===null)return!1;if(U.exec(W)!==null)return!0;if(Y.exec(W)!==null)return!0;return!1}function V(W){let K=0,w=null,D=U.exec(W);if(D===null)D=Y.exec(W);if(D===null)throw Error("Date resolve error");let H=+D[1],j=+D[2]-1,k=+D[3];if(!D[4])return new Date(Date.UTC(H,j,k));let v=+D[4],s=+D[5],_=+D[6];if(D[7]){K=D[7].slice(0,3);while(K.length<3)K+="0";K=+K}if(D[9]){let ZZ=+D[10],u=+(D[11]||0);if(w=(ZZ*60+u)*60000,D[9]==="-")w=-w}let l=new Date(Date.UTC(H,j,k,v,s,_,K));if(w)l.setTime(l.getTime()-w);return l}function Q(W){return W.toISOString()}return G0=new F("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:T,construct:V,instanceOf:Date,represent:Q}),G0}var V0,e0;function O$(){if(e0)return V0;e0=1;let F=h();function U(Y){return Y==="<<"||Y===null}return V0=new F("tag:yaml.org,2002:merge",{kind:"scalar",resolve:U}),V0}var F0,t0;function q$(){if(t0)return F0;t0=1;let F=h(),U=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
14
+ \r`;function Y(W){if(W===null)return!1;let K=0,w=W.length,D=U;for(let H=0;H<w;H++){let j=D.indexOf(W.charAt(H));if(j>64)continue;if(j<0)return!1;K+=6}return K%8===0}function T(W){let K=W.replace(/[\r\n=]/g,""),w=K.length,D=U,H=0,j=[];for(let v=0;v<w;v++){if(v%4===0&&v)j.push(H>>16&255),j.push(H>>8&255),j.push(H&255);H=H<<6|D.indexOf(K.charAt(v))}let k=w%4*6;if(k===0)j.push(H>>16&255),j.push(H>>8&255),j.push(H&255);else if(k===18)j.push(H>>10&255),j.push(H>>2&255);else if(k===12)j.push(H>>4&255);return new Uint8Array(j)}function V(W){let K="",w=0,D=W.length,H=U;for(let k=0;k<D;k++){if(k%3===0&&k)K+=H[w>>18&63],K+=H[w>>12&63],K+=H[w>>6&63],K+=H[w&63];w=(w<<8)+W[k]}let j=D%3;if(j===0)K+=H[w>>18&63],K+=H[w>>12&63],K+=H[w>>6&63],K+=H[w&63];else if(j===2)K+=H[w>>10&63],K+=H[w>>4&63],K+=H[w<<2&63],K+=H[64];else if(j===1)K+=H[w>>2&63],K+=H[w<<4&63],K+=H[64],K+=H[64];return K}function Q(W){return Object.prototype.toString.call(W)==="[object Uint8Array]"}return F0=new F("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Y,construct:T,predicate:Q,represent:V}),F0}var Q0,Z$;function A$(){if(Z$)return Q0;Z$=1;let F=h(),U=Object.prototype.hasOwnProperty,Y=Object.prototype.toString;function T(Q){if(Q===null)return!0;let W=[],K=Q;for(let w=0,D=K.length;w<D;w+=1){let H=K[w],j=!1;if(Y.call(H)!=="[object Object]")return!1;let k;for(k in H)if(U.call(H,k))if(!j)j=!0;else return!1;if(!j)return!1;if(W.indexOf(k)===-1)W.push(k);else return!1}return!0}function V(Q){return Q!==null?Q:[]}return Q0=new F("tag:yaml.org,2002:omap",{kind:"sequence",resolve:T,construct:V}),Q0}var D0,$$;function T$(){if($$)return D0;$$=1;let F=h(),U=Object.prototype.toString;function Y(V){if(V===null)return!0;let Q=V,W=Array(Q.length);for(let K=0,w=Q.length;K<w;K+=1){let D=Q[K];if(U.call(D)!=="[object Object]")return!1;let H=Object.keys(D);if(H.length!==1)return!1;W[K]=[H[0],D[H[0]]]}return!0}function T(V){if(V===null)return[];let Q=V,W=Array(Q.length);for(let K=0,w=Q.length;K<w;K+=1){let D=Q[K],H=Object.keys(D);W[K]=[H[0],D[H[0]]]}return W}return D0=new F("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Y,construct:T}),D0}var U0,J$;function C$(){if(J$)return U0;J$=1;let F=h(),U=Object.prototype.hasOwnProperty;function Y(V){if(V===null)return!0;let Q=V;for(let W in Q)if(U.call(Q,W)){if(Q[W]!==null)return!1}return!0}function T(V){return V!==null?V:{}}return U0=new F("tag:yaml.org,2002:set",{kind:"mapping",resolve:Y,construct:T}),U0}var W0,X$;function K0(){if(X$)return W0;return X$=1,W0=P$().extend({implicit:[B$(),O$()],explicit:[q$(),A$(),T$(),C$()]}),W0}var G$;function Z1(){if(G$)return kZ;G$=1;let F=fZ(),U=HZ(),Y=t$(),T=K0(),V=Object.prototype.hasOwnProperty,Q=1,W=2,K=3,w=4,D=1,H=2,j=3,k=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,s=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,l=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ZZ(Z){return Object.prototype.toString.call(Z)}function u(Z){return Z===10||Z===13}function p(Z){return Z===9||Z===32}function y(Z){return Z===9||Z===32||Z===10||Z===13}function a(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function xZ(Z){if(Z>=48&&Z<=57)return Z-48;let X=Z|32;if(X>=97&&X<=102)return X-97+10;return-1}function vZ(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function RZ(Z){if(Z>=48&&Z<=57)return Z-48;return-1}function FZ(Z){switch(Z){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
15
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function bZ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function QZ(Z,X,f){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:f});else Z[X]=f}let YZ=Array(256),DZ=Array(256);for(let Z=0;Z<256;Z++)YZ[Z]=FZ(Z)?1:0,DZ[Z]=FZ(Z);function E(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||T,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.maxDepth=typeof X.maxDepth==="number"?X.maxDepth:100,this.maxTotalMergeKeys=typeof X.maxTotalMergeKeys==="number"?X.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=Z.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function PZ(Z,X){let f={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return f.snippet=Y(f),new U(X,f)}function I(Z,X){throw PZ(Z,X)}function JZ(Z,X){if(Z.onWarning)Z.onWarning.call(null,PZ(Z,X))}function c(Z,X,f){let B=Z.anchorMapTransactions;if(B.length!==0){let M=B[B.length-1];if(!V.call(M,X))M[X]={existed:V.call(Z.anchorMap,X),value:Z.anchorMap[X]}}Z.anchorMap[X]=f}function _Z(Z){Z.anchorMapTransactions.push(Object.create(null))}function $Z(Z){let X=Z.anchorMapTransactions.pop(),f=Z.anchorMapTransactions;if(f.length===0)return;let B=f[f.length-1],M=Object.keys(X);for(let C=0,$=M.length;C<$;C+=1){let G=M[C];if(!V.call(B,G))B[G]=X[G]}}function gZ(Z){let X=Z.anchorMapTransactions.pop(),f=Object.keys(X);for(let B=f.length-1;B>=0;B-=1){let M=X[f[B]];if(M.existed)Z.anchorMap[f[B]]=M.value;else delete Z.anchorMap[f[B]]}}function UZ(Z){return{position:Z.position,line:Z.line,lineStart:Z.lineStart,lineIndent:Z.lineIndent,firstTabInLine:Z.firstTabInLine,tag:Z.tag,anchor:Z.anchor,kind:Z.kind,result:Z.result}}function XZ(Z,X){Z.position=X.position,Z.line=X.line,Z.lineStart=X.lineStart,Z.lineIndent=X.lineIndent,Z.firstTabInLine=X.firstTabInLine,Z.tag=X.tag,Z.anchor=X.anchor,Z.kind=X.kind,Z.result=X.result}let BZ={YAML:function(X,f,B){if(X.version!==null)I(X,"duplication of %YAML directive");if(B.length!==1)I(X,"YAML directive accepts exactly one argument");let M=/^([0-9]+)\.([0-9]+)$/.exec(B[0]);if(M===null)I(X,"ill-formed argument of the YAML directive");let C=parseInt(M[1],10),$=parseInt(M[2],10);if(C!==1)I(X,"unacceptable YAML version of the document");if(X.version=B[0],X.checkLineBreaks=$<2,$!==1&&$!==2)JZ(X,"unsupported YAML version of the document")},TAG:function(X,f,B){let M;if(B.length!==2)I(X,"TAG directive accepts exactly two arguments");let C=B[0];if(M=B[1],!_.test(C))I(X,"ill-formed tag handle (first argument) of the TAG directive");if(V.call(X.tagMap,C))I(X,'there is a previously declared suffix for "'+C+'" tag handle');if(!l.test(M))I(X,"ill-formed tag prefix (second argument) of the TAG directive");try{M=decodeURIComponent(M)}catch($){I(X,"tag prefix is malformed: "+M)}X.tagMap[C]=M}};function d(Z,X,f,B){if(X<f){let M=Z.input.slice(X,f);if(B)for(let C=0,$=M.length;C<$;C+=1){let G=M.charCodeAt(C);if(!(G===9||G>=32&&G<=1114111))I(Z,"expected valid JSON character")}else if(k.test(M))I(Z,"the stream contains non-printable characters");Z.result+=M}}function e(Z,X,f,B){if(!F.isObject(f))I(Z,"cannot merge mappings; the provided source object is unacceptable");let M=Object.keys(f);for(let C=0,$=M.length;C<$;C+=1){let G=M[C];if(Z.maxTotalMergeKeys!==-1&&++Z.totalMergeKeys>Z.maxTotalMergeKeys)I(Z,"merge keys exceeded maxTotalMergeKeys ("+Z.maxTotalMergeKeys+")");if(!V.call(X,G))QZ(X,G,f[G]),B[G]=!0}}function o(Z,X,f,B,M,C,$,G,q){if(Array.isArray(M)){M=Array.prototype.slice.call(M);for(let R=0,P=M.length;R<P;R+=1){if(Array.isArray(M[R]))I(Z,"nested arrays are not supported inside keys");if(typeof M==="object"&&ZZ(M[R])==="[object Object]")M[R]="[object Object]"}}if(typeof M==="object"&&ZZ(M)==="[object Object]")M="[object Object]";if(M=String(M),X===null)X={};if(B==="tag:yaml.org,2002:merge")if(Array.isArray(C))for(let R=0,P=C.length;R<P;R+=1)e(Z,X,C[R],f);else e(Z,X,C,f);else{if(!Z.json&&!V.call(f,M)&&V.call(X,M))Z.line=$||Z.line,Z.lineStart=G||Z.lineStart,Z.position=q||Z.position,I(Z,"duplicated mapping key");QZ(X,M,C),delete f[M]}return X}function GZ(Z){let X=Z.input.charCodeAt(Z.position);if(X===10)Z.position++;else if(X===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else I(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function g(Z,X,f){let B=0,M=Z.input.charCodeAt(Z.position);while(M!==0){while(p(M)){if(M===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;M=Z.input.charCodeAt(++Z.position)}if(X&&M===35)do M=Z.input.charCodeAt(++Z.position);while(M!==10&&M!==13&&M!==0);if(u(M)){GZ(Z),M=Z.input.charCodeAt(Z.position),B++,Z.lineIndent=0;while(M===32)Z.lineIndent++,M=Z.input.charCodeAt(++Z.position)}else break}if(f!==-1&&B!==0&&Z.lineIndent<f)JZ(Z,"deficient indentation");return B}function VZ(Z){let X=Z.position,f=Z.input.charCodeAt(X);if((f===45||f===46)&&f===Z.input.charCodeAt(X+1)&&f===Z.input.charCodeAt(X+2)){if(X+=3,f=Z.input.charCodeAt(X),f===0||y(f))return!0}return!1}function r(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=F.repeat(`
16
+ `,X-1)}function OZ(Z,X,f){let B,M,C,$,G,q,R=Z.kind,P=Z.result,A=Z.input.charCodeAt(Z.position);if(y(A)||a(A)||A===35||A===38||A===42||A===33||A===124||A===62||A===39||A===34||A===37||A===64||A===96)return!1;if(A===63||A===45){let O=Z.input.charCodeAt(Z.position+1);if(y(O)||f&&a(O))return!1}Z.kind="scalar",Z.result="",B=M=Z.position,C=!1;while(A!==0){if(A===58){let O=Z.input.charCodeAt(Z.position+1);if(y(O)||f&&a(O))break}else if(A===35){let O=Z.input.charCodeAt(Z.position-1);if(y(O))break}else if(Z.position===Z.lineStart&&VZ(Z)||f&&a(A))break;else if(u(A))if($=Z.line,G=Z.lineStart,q=Z.lineIndent,g(Z,!1,-1),Z.lineIndent>=X){C=!0,A=Z.input.charCodeAt(Z.position);continue}else{Z.position=M,Z.line=$,Z.lineStart=G,Z.lineIndent=q;break}if(C)d(Z,B,M,!1),r(Z,Z.line-$),B=M=Z.position,C=!1;if(!p(A))M=Z.position+1;A=Z.input.charCodeAt(++Z.position)}if(d(Z,B,M,!1),Z.result)return!0;return Z.kind=R,Z.result=P,!1}function qZ(Z,X){let f,B,M=Z.input.charCodeAt(Z.position);if(M!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,f=B=Z.position;while((M=Z.input.charCodeAt(Z.position))!==0)if(M===39)if(d(Z,f,Z.position,!0),M=Z.input.charCodeAt(++Z.position),M===39)f=Z.position,Z.position++,B=Z.position;else return!0;else if(u(M))d(Z,f,B,!0),r(Z,g(Z,!1,X)),f=B=Z.position;else if(Z.position===Z.lineStart&&VZ(Z))I(Z,"unexpected end of the document within a single quoted scalar");else if(Z.position++,!p(M))B=Z.position;I(Z,"unexpected end of the stream within a single quoted scalar")}function WZ(Z,X){let f,B,M,C=Z.input.charCodeAt(Z.position);if(C!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,f=B=Z.position;while((C=Z.input.charCodeAt(Z.position))!==0)if(C===34)return d(Z,f,Z.position,!0),Z.position++,!0;else if(C===92){if(d(Z,f,Z.position,!0),C=Z.input.charCodeAt(++Z.position),u(C))g(Z,!1,X);else if(C<256&&YZ[C])Z.result+=DZ[C],Z.position++;else if((M=vZ(C))>0){let $=M,G=0;for(;$>0;$--)if(C=Z.input.charCodeAt(++Z.position),(M=xZ(C))>=0)G=(G<<4)+M;else I(Z,"expected hexadecimal character");Z.result+=bZ(G),Z.position++}else I(Z,"unknown escape sequence");f=B=Z.position}else if(u(C))d(Z,f,B,!0),r(Z,g(Z,!1,X)),f=B=Z.position;else if(Z.position===Z.lineStart&&VZ(Z))I(Z,"unexpected end of the document within a double quoted scalar");else if(Z.position++,!p(C))B=Z.position;I(Z,"unexpected end of the stream within a double quoted scalar")}function AZ(Z,X){let f=!0,B,M,C,$=Z.tag,G,q=Z.anchor,R,P,A,O,N=Object.create(null),L,S,z,x=Z.input.charCodeAt(Z.position);if(x===91)R=93,O=!1,G=[];else if(x===123)R=125,O=!0,G={};else return!1;if(Z.anchor!==null)c(Z,Z.anchor,G);x=Z.input.charCodeAt(++Z.position);while(x!==0){if(g(Z,!0,X),x=Z.input.charCodeAt(Z.position),x===R)return Z.position++,Z.tag=$,Z.anchor=q,Z.kind=O?"mapping":"sequence",Z.result=G,!0;else if(!f)I(Z,"missed comma between flow collection entries");else if(x===44)I(Z,"expected the node content, but found ','");if(S=L=z=null,P=A=!1,x===63){let b=Z.input.charCodeAt(Z.position+1);if(y(b))P=A=!0,Z.position++,g(Z,!0,X)}if(B=Z.line,M=Z.lineStart,C=Z.position,i(Z,X,Q,!1,!0),S=Z.tag,L=Z.result,g(Z,!0,X),x=Z.input.charCodeAt(Z.position),(A||Z.line===B)&&x===58)P=!0,x=Z.input.charCodeAt(++Z.position),g(Z,!0,X),i(Z,X,Q,!1,!0),z=Z.result;if(O)o(Z,G,N,S,L,z,B,M,C);else if(P)G.push(o(Z,null,N,S,L,z,B,M,C));else G.push(L);if(g(Z,!0,X),x=Z.input.charCodeAt(Z.position),x===44)f=!0,x=Z.input.charCodeAt(++Z.position);else f=!1}I(Z,"unexpected end of the stream within a flow collection")}function TZ(Z,X){let f,B=D,M=!1,C=!1,$=X,G=0,q=!1,R,P=Z.input.charCodeAt(Z.position);if(P===124)f=!1;else if(P===62)f=!0;else return!1;Z.kind="scalar",Z.result="";while(P!==0)if(P=Z.input.charCodeAt(++Z.position),P===43||P===45)if(D===B)B=P===43?j:H;else I(Z,"repeat of a chomping mode identifier");else if((R=RZ(P))>=0)if(R===0)I(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!C)$=X+R-1,C=!0;else I(Z,"repeat of an indentation width identifier");else break;if(p(P)){do P=Z.input.charCodeAt(++Z.position);while(p(P));if(P===35)do P=Z.input.charCodeAt(++Z.position);while(!u(P)&&P!==0)}while(P!==0){GZ(Z),Z.lineIndent=0,P=Z.input.charCodeAt(Z.position);while((!C||Z.lineIndent<$)&&P===32)Z.lineIndent++,P=Z.input.charCodeAt(++Z.position);if(!C&&Z.lineIndent>$)$=Z.lineIndent;if(u(P)){G++;continue}if(!C&&$===0)I(Z,"missing indentation for block scalar");if(Z.lineIndent<$){if(B===j)Z.result+=F.repeat(`
17
17
  `,M?1+G:G);else if(B===D){if(M)Z.result+=`
18
- `}break}if(K)if(p(Y))q=!0,Z.result+=F.repeat(`
18
+ `}break}if(f)if(p(P))q=!0,Z.result+=F.repeat(`
19
19
  `,M?1+G:G);else if(q)q=!1,Z.result+=F.repeat(`
20
20
  `,G+1);else if(G===0){if(M)Z.result+=" "}else Z.result+=F.repeat(`
21
21
  `,G);else Z.result+=F.repeat(`
22
- `,M?1+G:G);M=!0,w=!0,G=0;let A=Z.position;while(!u(Y)&&Y!==0)Y=Z.input.charCodeAt(++Z.position);d(Z,A,Z.position,!1)}return!0}function n(Z,X){let{tag:K,anchor:B}=Z,M=[],w=!1;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)c(Z,Z.anchor,M);let $=Z.input.charCodeAt(Z.position);while($!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,I(Z,"tab characters must not be used in indentation");if($!==45)break;let G=Z.input.charCodeAt(Z.position+1);if(!y(G))break;if(w=!0,Z.position++,_(Z,!0,-1)){if(Z.lineIndent<=X){M.push(null),$=Z.input.charCodeAt(Z.position);continue}}let q=Z.line;if(i(Z,X,f,!1,!0),M.push(Z.result),_(Z,!0,-1),$=Z.input.charCodeAt(Z.position),(Z.line===q||Z.lineIndent>X)&&$!==0)I(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(w)return Z.tag=K,Z.anchor=B,Z.kind="sequence",Z.result=M,!0;return!1}function wZ(Z,X,K){let B,M,w,$,G=Z.tag,q=Z.anchor,R={},Y=Object.create(null),A=null,O=null,N=null,L=!1,S=!1;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)c(Z,Z.anchor,R);let z=Z.input.charCodeAt(Z.position);while(z!==0){if(!L&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,I(Z,"tab characters must not be used in indentation");let x=Z.input.charCodeAt(Z.position+1),b=Z.line;if((z===63||z===58)&&y(x)){if(z===63){if(L)o(Z,R,Y,A,O,null,M,w,$),A=O=N=null;S=!0,L=!0,B=!0}else if(L)L=!1,B=!0;else I(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,z=x}else{if(M=Z.line,w=Z.lineStart,$=Z.position,!i(Z,K,W,!1,!0))break;if(Z.line===b){z=Z.input.charCodeAt(Z.position);while(p(z))z=Z.input.charCodeAt(++Z.position);if(z===58){if(z=Z.input.charCodeAt(++Z.position),!y(z))I(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(L)o(Z,R,Y,A,O,null,M,w,$),A=O=N=null;S=!0,L=!1,B=!1,A=Z.tag,O=Z.result}else if(S)I(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=G,Z.anchor=q,!0}else if(S)I(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=G,Z.anchor=q,!0}if(Z.line===b||Z.lineIndent>X){if(L)M=Z.line,w=Z.lineStart,$=Z.position;if(i(Z,X,C,!0,B))if(L)O=Z.result;else N=Z.result;if(!L)o(Z,R,Y,A,O,N,M,w,$),A=O=N=null;_(Z,!0,-1),z=Z.input.charCodeAt(Z.position)}if((Z.line===b||Z.lineIndent>X)&&z!==0)I(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(L)o(Z,R,Y,A,O,null,M,w,$);if(S)Z.tag=G,Z.anchor=q,Z.kind="mapping",Z.result=R;return S}function EZ(Z){let X=!1,K=!1,B,M,w=Z.input.charCodeAt(Z.position);if(w!==33)return!1;if(Z.tag!==null)I(Z,"duplication of a tag property");if(w=Z.input.charCodeAt(++Z.position),w===60)X=!0,w=Z.input.charCodeAt(++Z.position);else if(w===33)K=!0,B="!!",w=Z.input.charCodeAt(++Z.position);else B="!";let $=Z.position;if(X){do w=Z.input.charCodeAt(++Z.position);while(w!==0&&w!==62);if(Z.position<Z.length)M=Z.input.slice($,Z.position),w=Z.input.charCodeAt(++Z.position);else I(Z,"unexpected end of the stream within a verbatim tag")}else{while(w!==0&&!y(w)){if(w===33)if(!K){if(B=Z.input.slice($-1,Z.position+1),!g.test(B))I(Z,"named tag handle cannot contain such characters");K=!0,$=Z.position+1}else I(Z,"tag suffix cannot contain exclamation marks");w=Z.input.charCodeAt(++Z.position)}if(M=Z.input.slice($,Z.position),s.test(M))I(Z,"tag suffix cannot contain flow indicator characters")}if(M&&!l.test(M))I(Z,"tag name cannot contain such characters: "+M);try{M=decodeURIComponent(M)}catch(G){I(Z,"tag name is malformed: "+M)}if(X)Z.tag=M;else if(V.call(Z.tagMap,B))Z.tag=Z.tagMap[B]+M;else if(B==="!")Z.tag="!"+M;else if(B==="!!")Z.tag="tag:yaml.org,2002:"+M;else I(Z,'undeclared tag handle "'+B+'"');return!0}function CZ(Z){let X=Z.input.charCodeAt(Z.position);if(X!==38)return!1;if(Z.anchor!==null)I(Z,"duplication of an anchor property");X=Z.input.charCodeAt(++Z.position);let K=Z.position;while(X!==0&&!y(X)&&!a(X))X=Z.input.charCodeAt(++Z.position);if(Z.position===K)I(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(K,Z.position),!0}function jZ(Z){let X=Z.input.charCodeAt(Z.position);if(X!==42)return!1;X=Z.input.charCodeAt(++Z.position);let K=Z.position;while(X!==0&&!y(X)&&!a(X))X=Z.input.charCodeAt(++Z.position);if(Z.position===K)I(Z,"name of an alias node must contain at least one character");let B=Z.input.slice(K,Z.position);if(!V.call(Z.anchorMap,B))I(Z,'unidentified alias "'+B+'"');return Z.result=Z.anchorMap[B],_(Z,!0,-1),!0}function yZ(Z,X,K,B){let M=UZ(Z);if(gZ(Z),XZ(Z,X),Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,wZ(Z,K,B)&&Z.kind==="mapping")return $Z(Z),!0;return _Z(Z),XZ(Z,M),!1}function i(Z,X,K,B,M){let w,$,G=1,q=!1,R=!1,Y=null,A,O,N;if(Z.depth>=Z.maxDepth)I(Z,"nesting exceeded maxDepth ("+Z.maxDepth+")");if(Z.depth+=1,Z.listener!==null)Z.listener("open",Z);Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null;let L=w=$=C===K||f===K;if(B){if(_(Z,!0,-1)){if(q=!0,Z.lineIndent>X)G=1;else if(Z.lineIndent===X)G=0;else if(Z.lineIndent<X)G=-1}}if(G===1)while(!0){let S=Z.input.charCodeAt(Z.position),z=UZ(Z);if(q&&(S===33&&Z.tag!==null||S===38&&Z.anchor!==null))break;if(!EZ(Z)&&!CZ(Z))break;if(Y===null)Y=z;if(_(Z,!0,-1)){if(q=!0,$=L,Z.lineIndent>X)G=1;else if(Z.lineIndent===X)G=0;else if(Z.lineIndent<X)G=-1}else $=!1}if($)$=q||M;if(G===1||C===K){if(Q===K||W===K)O=X;else O=X+1;if(N=Z.position-Z.lineStart,G===1)if($&&(n(Z,N)||wZ(Z,N,O))||AZ(Z,O))R=!0;else{let S=Z.input.charCodeAt(Z.position);if(Y!==null&&L&&!$&&S!==124&&S!==62&&yZ(Z,Y,Y.position-Y.lineStart,O))R=!0;else if(w&&TZ(Z,O)||qZ(Z,O)||WZ(Z,O))R=!0;else if(jZ(Z)){if(R=!0,Z.tag!==null||Z.anchor!==null)I(Z,"alias node should not have any properties")}else if(OZ(Z,O,Q===K)){if(R=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)c(Z,Z.anchor,Z.result)}else if(G===0)R=$&&n(Z,N)}if(Z.tag===null){if(Z.anchor!==null)c(Z,Z.anchor,Z.result)}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")I(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(let S=0,z=Z.implicitTypes.length;S<z;S+=1)if(A=Z.implicitTypes[S],A.resolve(Z.result)){if(Z.result=A.construct(Z.result),Z.tag=A.tag,Z.anchor!==null)c(Z,Z.anchor,Z.result);break}}else if(Z.tag!=="!"){if(V.call(Z.typeMap[Z.kind||"fallback"],Z.tag))A=Z.typeMap[Z.kind||"fallback"][Z.tag];else{A=null;let S=Z.typeMap.multi[Z.kind||"fallback"];for(let z=0,x=S.length;z<x;z+=1)if(Z.tag.slice(0,S[z].tag.length)===S[z].tag){A=S[z];break}}if(!A)I(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&A.kind!==Z.kind)I(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+A.kind+'", not "'+Z.kind+'"');if(!A.resolve(Z.result,Z.tag))I(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=A.construct(Z.result,Z.tag),Z.anchor!==null)c(Z,Z.anchor,Z.result)}if(Z.listener!==null)Z.listener("close",Z);return Z.depth-=1,Z.tag!==null||Z.anchor!==null||R}function mZ(Z){let X=Z.position,K=!1,B;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((B=Z.input.charCodeAt(Z.position))!==0){if(_(Z,!0,-1),B=Z.input.charCodeAt(Z.position),Z.lineIndent>0||B!==37)break;K=!0,B=Z.input.charCodeAt(++Z.position);let M=Z.position;while(B!==0&&!y(B))B=Z.input.charCodeAt(++Z.position);let w=Z.input.slice(M,Z.position),$=[];if(w.length<1)I(Z,"directive name must not be less than one character in length");while(B!==0){while(p(B))B=Z.input.charCodeAt(++Z.position);if(B===35){do B=Z.input.charCodeAt(++Z.position);while(B!==0&&!u(B));break}if(u(B))break;M=Z.position;while(B!==0&&!y(B))B=Z.input.charCodeAt(++Z.position);$.push(Z.input.slice(M,Z.position))}if(B!==0)GZ(Z);if(V.call(BZ,w))BZ[w](Z,w,$);else JZ(Z,'unknown document directive "'+w+'"')}if(_(Z,!0,-1),Z.lineIndent===0&&Z.input.charCodeAt(Z.position)===45&&Z.input.charCodeAt(Z.position+1)===45&&Z.input.charCodeAt(Z.position+2)===45)Z.position+=3,_(Z,!0,-1);else if(K)I(Z,"directives end mark is expected");if(i(Z,Z.lineIndent-1,C,!1,!0),_(Z,!0,-1),Z.checkLineBreaks&&v.test(Z.input.slice(X,Z.position)))JZ(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&VZ(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,_(Z,!0,-1);return}if(Z.position<Z.length-1)I(Z,"end of the stream or a document separator is expected")}function LZ(Z,X){if(Z=String(Z),X=X||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
23
- `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}let K=new E(Z,X),B=Z.indexOf("\x00");if(B!==-1)K.position=B,I(K,"null byte is not allowed in input");K.input+="\x00";while(K.input.charCodeAt(K.position)===32)K.lineIndent+=1,K.position+=1;while(K.position<K.length-1)mZ(K);return K.documents}function NZ(Z,X,K){if(X!==null&&typeof X==="object"&&typeof K>"u")K=X,X=null;let B=LZ(Z,K);if(typeof X!=="function")return B;for(let M=0,w=B.length;M<w;M+=1)X(B[M])}function hZ(Z,X){let K=LZ(Z,X);if(K.length===0)return;else if(K.length===1)return K[0];throw new U("expected a single document in the stream, but found more")}return kZ.loadAll=NZ,kZ.load=hZ,kZ}var M0={},V$;function Z1(){if(V$)return M0;V$=1;let F=KZ(),U=HZ(),P=f0(),T=Object.prototype.toString,V=Object.prototype.hasOwnProperty,Q=65279,W=9,f=10,C=13,D=32,H=33,j=34,k=35,v=37,s=38,g=39,l=42,ZZ=44,u=45,p=58,y=61,a=62,xZ=63,vZ=64,RZ=91,FZ=93,bZ=96,QZ=123,YZ=124,DZ=125,E={};E[0]="\\0",E[7]="\\a",E[8]="\\b",E[9]="\\t",E[10]="\\n",E[11]="\\v",E[12]="\\f",E[13]="\\r",E[27]="\\e",E[34]="\\\"",E[92]="\\\\",E[133]="\\N",E[160]="\\_",E[8232]="\\L",E[8233]="\\P";let PZ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],I=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function JZ($,G){if(G===null)return{};let q={},R=Object.keys(G);for(let Y=0,A=R.length;Y<A;Y+=1){let O=R[Y],N=String(G[O]);if(O.slice(0,2)==="!!")O="tag:yaml.org,2002:"+O.slice(2);let L=$.compiledTypeMap.fallback[O];if(L&&V.call(L.styleAliases,N))N=L.styleAliases[N];q[O]=N}return q}function c($){let G,q,R=$.toString(16).toUpperCase();if($<=255)G="x",q=2;else if($<=65535)G="u",q=4;else if($<=4294967295)G="U",q=8;else throw new U("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+G+F.repeat("0",q-R.length)+R}let gZ=1,$Z=2;function _Z($){this.schema=$.schema||P,this.indent=Math.max(1,$.indent||2),this.noArrayIndent=$.noArrayIndent||!1,this.skipInvalid=$.skipInvalid||!1,this.flowLevel=F.isNothing($.flowLevel)?-1:$.flowLevel,this.styleMap=JZ(this.schema,$.styles||null),this.sortKeys=$.sortKeys||!1,this.lineWidth=$.lineWidth||80,this.noRefs=$.noRefs||!1,this.noCompatMode=$.noCompatMode||!1,this.condenseFlow=$.condenseFlow||!1,this.quotingType=$.quotingType==='"'?$Z:gZ,this.forceQuotes=$.forceQuotes||!1,this.replacer=typeof $.replacer==="function"?$.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function UZ($,G){let q=F.repeat(" ",G),R=0,Y="",A=$.length;while(R<A){let O,N=$.indexOf(`
22
+ `,M?1+G:G);M=!0,C=!0,G=0;let A=Z.position;while(!u(P)&&P!==0)P=Z.input.charCodeAt(++Z.position);d(Z,A,Z.position,!1)}return!0}function n(Z,X){let{tag:f,anchor:B}=Z,M=[],C=!1;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)c(Z,Z.anchor,M);let $=Z.input.charCodeAt(Z.position);while($!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,I(Z,"tab characters must not be used in indentation");if($!==45)break;let G=Z.input.charCodeAt(Z.position+1);if(!y(G))break;if(C=!0,Z.position++,g(Z,!0,-1)){if(Z.lineIndent<=X){M.push(null),$=Z.input.charCodeAt(Z.position);continue}}let q=Z.line;if(i(Z,X,K,!1,!0),M.push(Z.result),g(Z,!0,-1),$=Z.input.charCodeAt(Z.position),(Z.line===q||Z.lineIndent>X)&&$!==0)I(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(C)return Z.tag=f,Z.anchor=B,Z.kind="sequence",Z.result=M,!0;return!1}function CZ(Z,X,f){let B,M,C,$,G=Z.tag,q=Z.anchor,R={},P=Object.create(null),A=null,O=null,N=null,L=!1,S=!1;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)c(Z,Z.anchor,R);let z=Z.input.charCodeAt(Z.position);while(z!==0){if(!L&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,I(Z,"tab characters must not be used in indentation");let x=Z.input.charCodeAt(Z.position+1),b=Z.line;if((z===63||z===58)&&y(x)){if(z===63){if(L)o(Z,R,P,A,O,null,M,C,$),A=O=N=null;S=!0,L=!0,B=!0}else if(L)L=!1,B=!0;else I(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,z=x}else{if(M=Z.line,C=Z.lineStart,$=Z.position,!i(Z,f,W,!1,!0))break;if(Z.line===b){z=Z.input.charCodeAt(Z.position);while(p(z))z=Z.input.charCodeAt(++Z.position);if(z===58){if(z=Z.input.charCodeAt(++Z.position),!y(z))I(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(L)o(Z,R,P,A,O,null,M,C,$),A=O=N=null;S=!0,L=!1,B=!1,A=Z.tag,O=Z.result}else if(S)I(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=G,Z.anchor=q,!0}else if(S)I(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=G,Z.anchor=q,!0}if(Z.line===b||Z.lineIndent>X){if(L)M=Z.line,C=Z.lineStart,$=Z.position;if(i(Z,X,w,!0,B))if(L)O=Z.result;else N=Z.result;if(!L)o(Z,R,P,A,O,N,M,C,$),A=O=N=null;g(Z,!0,-1),z=Z.input.charCodeAt(Z.position)}if((Z.line===b||Z.lineIndent>X)&&z!==0)I(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(L)o(Z,R,P,A,O,null,M,C,$);if(S)Z.tag=G,Z.anchor=q,Z.kind="mapping",Z.result=R;return S}function EZ(Z){let X=!1,f=!1,B,M,C=Z.input.charCodeAt(Z.position);if(C!==33)return!1;if(Z.tag!==null)I(Z,"duplication of a tag property");if(C=Z.input.charCodeAt(++Z.position),C===60)X=!0,C=Z.input.charCodeAt(++Z.position);else if(C===33)f=!0,B="!!",C=Z.input.charCodeAt(++Z.position);else B="!";let $=Z.position;if(X){do C=Z.input.charCodeAt(++Z.position);while(C!==0&&C!==62);if(Z.position<Z.length)M=Z.input.slice($,Z.position),C=Z.input.charCodeAt(++Z.position);else I(Z,"unexpected end of the stream within a verbatim tag")}else{while(C!==0&&!y(C)){if(C===33)if(!f){if(B=Z.input.slice($-1,Z.position+1),!_.test(B))I(Z,"named tag handle cannot contain such characters");f=!0,$=Z.position+1}else I(Z,"tag suffix cannot contain exclamation marks");C=Z.input.charCodeAt(++Z.position)}if(M=Z.input.slice($,Z.position),s.test(M))I(Z,"tag suffix cannot contain flow indicator characters")}if(M&&!l.test(M))I(Z,"tag name cannot contain such characters: "+M);try{M=decodeURIComponent(M)}catch(G){I(Z,"tag name is malformed: "+M)}if(X)Z.tag=M;else if(V.call(Z.tagMap,B))Z.tag=Z.tagMap[B]+M;else if(B==="!")Z.tag="!"+M;else if(B==="!!")Z.tag="tag:yaml.org,2002:"+M;else I(Z,'undeclared tag handle "'+B+'"');return!0}function wZ(Z){let X=Z.input.charCodeAt(Z.position);if(X!==38)return!1;if(Z.anchor!==null)I(Z,"duplication of an anchor property");X=Z.input.charCodeAt(++Z.position);let f=Z.position;while(X!==0&&!y(X)&&!a(X))X=Z.input.charCodeAt(++Z.position);if(Z.position===f)I(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(f,Z.position),!0}function jZ(Z){let X=Z.input.charCodeAt(Z.position);if(X!==42)return!1;X=Z.input.charCodeAt(++Z.position);let f=Z.position;while(X!==0&&!y(X)&&!a(X))X=Z.input.charCodeAt(++Z.position);if(Z.position===f)I(Z,"name of an alias node must contain at least one character");let B=Z.input.slice(f,Z.position);if(!V.call(Z.anchorMap,B))I(Z,'unidentified alias "'+B+'"');return Z.result=Z.anchorMap[B],g(Z,!0,-1),!0}function yZ(Z,X,f,B){let M=UZ(Z);if(_Z(Z),XZ(Z,X),Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,CZ(Z,f,B)&&Z.kind==="mapping")return $Z(Z),!0;return gZ(Z),XZ(Z,M),!1}function i(Z,X,f,B,M){let C,$,G=1,q=!1,R=!1,P=null,A,O,N;if(Z.depth>=Z.maxDepth)I(Z,"nesting exceeded maxDepth ("+Z.maxDepth+")");if(Z.depth+=1,Z.listener!==null)Z.listener("open",Z);Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null;let L=C=$=w===f||K===f;if(B){if(g(Z,!0,-1)){if(q=!0,Z.lineIndent>X)G=1;else if(Z.lineIndent===X)G=0;else if(Z.lineIndent<X)G=-1}}if(G===1)while(!0){let S=Z.input.charCodeAt(Z.position),z=UZ(Z);if(q&&(S===33&&Z.tag!==null||S===38&&Z.anchor!==null))break;if(!EZ(Z)&&!wZ(Z))break;if(P===null)P=z;if(g(Z,!0,-1)){if(q=!0,$=L,Z.lineIndent>X)G=1;else if(Z.lineIndent===X)G=0;else if(Z.lineIndent<X)G=-1}else $=!1}if($)$=q||M;if(G===1||w===f){if(Q===f||W===f)O=X;else O=X+1;if(N=Z.position-Z.lineStart,G===1)if($&&(n(Z,N)||CZ(Z,N,O))||AZ(Z,O))R=!0;else{let S=Z.input.charCodeAt(Z.position);if(P!==null&&L&&!$&&S!==124&&S!==62&&yZ(Z,P,P.position-P.lineStart,O))R=!0;else if(C&&TZ(Z,O)||qZ(Z,O)||WZ(Z,O))R=!0;else if(jZ(Z)){if(R=!0,Z.tag!==null||Z.anchor!==null)I(Z,"alias node should not have any properties")}else if(OZ(Z,O,Q===f)){if(R=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)c(Z,Z.anchor,Z.result)}else if(G===0)R=$&&n(Z,N)}if(Z.tag===null){if(Z.anchor!==null)c(Z,Z.anchor,Z.result)}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")I(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(let S=0,z=Z.implicitTypes.length;S<z;S+=1)if(A=Z.implicitTypes[S],A.resolve(Z.result)){if(Z.result=A.construct(Z.result),Z.tag=A.tag,Z.anchor!==null)c(Z,Z.anchor,Z.result);break}}else if(Z.tag!=="!"){if(V.call(Z.typeMap[Z.kind||"fallback"],Z.tag))A=Z.typeMap[Z.kind||"fallback"][Z.tag];else{A=null;let S=Z.typeMap.multi[Z.kind||"fallback"];for(let z=0,x=S.length;z<x;z+=1)if(Z.tag.slice(0,S[z].tag.length)===S[z].tag){A=S[z];break}}if(!A)I(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&A.kind!==Z.kind)I(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+A.kind+'", not "'+Z.kind+'"');if(!A.resolve(Z.result,Z.tag))I(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=A.construct(Z.result,Z.tag),Z.anchor!==null)c(Z,Z.anchor,Z.result)}if(Z.listener!==null)Z.listener("close",Z);return Z.depth-=1,Z.tag!==null||Z.anchor!==null||R}function mZ(Z){let X=Z.position,f=!1,B;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((B=Z.input.charCodeAt(Z.position))!==0){if(g(Z,!0,-1),B=Z.input.charCodeAt(Z.position),Z.lineIndent>0||B!==37)break;f=!0,B=Z.input.charCodeAt(++Z.position);let M=Z.position;while(B!==0&&!y(B))B=Z.input.charCodeAt(++Z.position);let C=Z.input.slice(M,Z.position),$=[];if(C.length<1)I(Z,"directive name must not be less than one character in length");while(B!==0){while(p(B))B=Z.input.charCodeAt(++Z.position);if(B===35){do B=Z.input.charCodeAt(++Z.position);while(B!==0&&!u(B));break}if(u(B))break;M=Z.position;while(B!==0&&!y(B))B=Z.input.charCodeAt(++Z.position);$.push(Z.input.slice(M,Z.position))}if(B!==0)GZ(Z);if(V.call(BZ,C))BZ[C](Z,C,$);else JZ(Z,'unknown document directive "'+C+'"')}if(g(Z,!0,-1),Z.lineIndent===0&&Z.input.charCodeAt(Z.position)===45&&Z.input.charCodeAt(Z.position+1)===45&&Z.input.charCodeAt(Z.position+2)===45)Z.position+=3,g(Z,!0,-1);else if(f)I(Z,"directives end mark is expected");if(i(Z,Z.lineIndent-1,w,!1,!0),g(Z,!0,-1),Z.checkLineBreaks&&v.test(Z.input.slice(X,Z.position)))JZ(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&VZ(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,g(Z,!0,-1);return}if(Z.position<Z.length-1)I(Z,"end of the stream or a document separator is expected")}function LZ(Z,X){if(Z=String(Z),X=X||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
23
+ `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}let f=new E(Z,X),B=Z.indexOf("\x00");if(B!==-1)f.position=B,I(f,"null byte is not allowed in input");f.input+="\x00";while(f.input.charCodeAt(f.position)===32)f.lineIndent+=1,f.position+=1;while(f.position<f.length-1)mZ(f);return f.documents}function NZ(Z,X,f){if(X!==null&&typeof X==="object"&&typeof f>"u")f=X,X=null;let B=LZ(Z,f);if(typeof X!=="function")return B;for(let M=0,C=B.length;M<C;M+=1)X(B[M])}function hZ(Z,X){let f=LZ(Z,X);if(f.length===0)return;else if(f.length===1)return f[0];throw new U("expected a single document in the stream, but found more")}return kZ.loadAll=NZ,kZ.load=hZ,kZ}var M0={},V$;function $1(){if(V$)return M0;V$=1;let F=fZ(),U=HZ(),Y=K0(),T=Object.prototype.toString,V=Object.prototype.hasOwnProperty,Q=65279,W=9,K=10,w=13,D=32,H=33,j=34,k=35,v=37,s=38,_=39,l=42,ZZ=44,u=45,p=58,y=61,a=62,xZ=63,vZ=64,RZ=91,FZ=93,bZ=96,QZ=123,YZ=124,DZ=125,E={};E[0]="\\0",E[7]="\\a",E[8]="\\b",E[9]="\\t",E[10]="\\n",E[11]="\\v",E[12]="\\f",E[13]="\\r",E[27]="\\e",E[34]="\\\"",E[92]="\\\\",E[133]="\\N",E[160]="\\_",E[8232]="\\L",E[8233]="\\P";let PZ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],I=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function JZ($,G){if(G===null)return{};let q={},R=Object.keys(G);for(let P=0,A=R.length;P<A;P+=1){let O=R[P],N=String(G[O]);if(O.slice(0,2)==="!!")O="tag:yaml.org,2002:"+O.slice(2);let L=$.compiledTypeMap.fallback[O];if(L&&V.call(L.styleAliases,N))N=L.styleAliases[N];q[O]=N}return q}function c($){let G,q,R=$.toString(16).toUpperCase();if($<=255)G="x",q=2;else if($<=65535)G="u",q=4;else if($<=4294967295)G="U",q=8;else throw new U("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+G+F.repeat("0",q-R.length)+R}let _Z=1,$Z=2;function gZ($){this.schema=$.schema||Y,this.indent=Math.max(1,$.indent||2),this.noArrayIndent=$.noArrayIndent||!1,this.skipInvalid=$.skipInvalid||!1,this.flowLevel=F.isNothing($.flowLevel)?-1:$.flowLevel,this.styleMap=JZ(this.schema,$.styles||null),this.sortKeys=$.sortKeys||!1,this.lineWidth=$.lineWidth||80,this.noRefs=$.noRefs||!1,this.noCompatMode=$.noCompatMode||!1,this.condenseFlow=$.condenseFlow||!1,this.quotingType=$.quotingType==='"'?$Z:_Z,this.forceQuotes=$.forceQuotes||!1,this.replacer=typeof $.replacer==="function"?$.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function UZ($,G){let q=F.repeat(" ",G),R=0,P="",A=$.length;while(R<A){let O,N=$.indexOf(`
24
24
  `,R);if(N===-1)O=$.slice(R),R=A;else O=$.slice(R,N+1),R=N+1;if(O.length&&O!==`
25
- `)Y+=q;Y+=O}return Y}function XZ($,G){return`
26
- `+F.repeat(" ",$.indent*G)}function BZ($,G){for(let q=0,R=$.implicitTypes.length;q<R;q+=1)if($.implicitTypes[q].resolve(G))return!0;return!1}function d($){return $===D||$===W}function e($){return $>=32&&$<=126||$>=161&&$<=55295&&$!==8232&&$!==8233||$>=57344&&$<=65533&&$!==Q||$>=65536&&$<=1114111}function o($){return e($)&&$!==Q&&$!==C&&$!==f}function GZ($,G,q){let R=o($),Y=R&&!d($);return(q?R:R&&$!==ZZ&&$!==RZ&&$!==FZ&&$!==QZ&&$!==DZ)&&$!==k&&!(G===p&&!Y)||o(G)&&!d(G)&&$===k||G===p&&Y}function _($){return e($)&&$!==Q&&!d($)&&$!==u&&$!==xZ&&$!==p&&$!==ZZ&&$!==RZ&&$!==FZ&&$!==QZ&&$!==DZ&&$!==k&&$!==s&&$!==l&&$!==H&&$!==YZ&&$!==y&&$!==a&&$!==g&&$!==j&&$!==v&&$!==vZ&&$!==bZ}function VZ($){return!d($)&&$!==p}function r($,G){let q=$.charCodeAt(G),R;if(q>=55296&&q<=56319&&G+1<$.length){if(R=$.charCodeAt(G+1),R>=56320&&R<=57343)return(q-55296)*1024+R-56320+65536}return q}function OZ($){return/^\n* /.test($)}let qZ=1,WZ=2,AZ=3,TZ=4,n=5;function wZ($,G,q,R,Y,A,O,N){let L,S=0,z=null,x=!1,b=!1,K0=R!==-1,MZ=-1,fZ=_(r($,0))&&VZ(r($,$.length-1));if(G||O)for(L=0;L<$.length;S>=65536?L+=2:L++){if(S=r($,L),!e(S))return n;fZ=fZ&&GZ(S,z,N),z=S}else{for(L=0;L<$.length;S>=65536?L+=2:L++){if(S=r($,L),S===f){if(x=!0,K0)b=b||L-MZ-1>R&&$[MZ+1]!==" ",MZ=L}else if(!e(S))return n;fZ=fZ&&GZ(S,z,N),z=S}b=b||K0&&(L-MZ-1>R&&$[MZ+1]!==" ")}if(!x&&!b){if(fZ&&!O&&!Y($))return qZ;return A===$Z?n:WZ}if(q>9&&OZ($))return n;if(!O)return b?TZ:AZ;return A===$Z?n:WZ}function EZ($,G,q,R,Y){$.dump=function(){if(G.length===0)return $.quotingType===$Z?'""':"''";if(!$.noCompatMode){if(PZ.indexOf(G)!==-1||I.test(G))return $.quotingType===$Z?'"'+G+'"':"'"+G+"'"}let A=$.indent*Math.max(1,q),O=$.lineWidth===-1?-1:Math.max(Math.min($.lineWidth,40),$.lineWidth-A),N=R||$.flowLevel>-1&&q>=$.flowLevel;function L(S){return BZ($,S)}switch(wZ(G,N,$.indent,O,L,$.quotingType,$.forceQuotes&&!R,Y)){case qZ:return G;case WZ:return"'"+G.replace(/'/g,"''")+"'";case AZ:return"|"+CZ(G,$.indent)+jZ(UZ(G,A));case TZ:return">"+CZ(G,$.indent)+jZ(UZ(yZ(G,O),A));case n:return'"'+mZ(G)+'"';default:throw new U("impossible error: invalid scalar style")}}()}function CZ($,G){let q=OZ($)?String(G):"",R=$[$.length-1]===`
25
+ `)P+=q;P+=O}return P}function XZ($,G){return`
26
+ `+F.repeat(" ",$.indent*G)}function BZ($,G){for(let q=0,R=$.implicitTypes.length;q<R;q+=1)if($.implicitTypes[q].resolve(G))return!0;return!1}function d($){return $===D||$===W}function e($){return $>=32&&$<=126||$>=161&&$<=55295&&$!==8232&&$!==8233||$>=57344&&$<=65533&&$!==Q||$>=65536&&$<=1114111}function o($){return e($)&&$!==Q&&$!==w&&$!==K}function GZ($,G,q){let R=o($),P=R&&!d($);return(q?R:R&&$!==ZZ&&$!==RZ&&$!==FZ&&$!==QZ&&$!==DZ)&&$!==k&&!(G===p&&!P)||o(G)&&!d(G)&&$===k||G===p&&P}function g($){return e($)&&$!==Q&&!d($)&&$!==u&&$!==xZ&&$!==p&&$!==ZZ&&$!==RZ&&$!==FZ&&$!==QZ&&$!==DZ&&$!==k&&$!==s&&$!==l&&$!==H&&$!==YZ&&$!==y&&$!==a&&$!==_&&$!==j&&$!==v&&$!==vZ&&$!==bZ}function VZ($){return!d($)&&$!==p}function r($,G){let q=$.charCodeAt(G),R;if(q>=55296&&q<=56319&&G+1<$.length){if(R=$.charCodeAt(G+1),R>=56320&&R<=57343)return(q-55296)*1024+R-56320+65536}return q}function OZ($){return/^\n* /.test($)}let qZ=1,WZ=2,AZ=3,TZ=4,n=5;function CZ($,G,q,R,P,A,O,N){let L,S=0,z=null,x=!1,b=!1,f0=R!==-1,MZ=-1,KZ=g(r($,0))&&VZ(r($,$.length-1));if(G||O)for(L=0;L<$.length;S>=65536?L+=2:L++){if(S=r($,L),!e(S))return n;KZ=KZ&&GZ(S,z,N),z=S}else{for(L=0;L<$.length;S>=65536?L+=2:L++){if(S=r($,L),S===K){if(x=!0,f0)b=b||L-MZ-1>R&&$[MZ+1]!==" ",MZ=L}else if(!e(S))return n;KZ=KZ&&GZ(S,z,N),z=S}b=b||f0&&(L-MZ-1>R&&$[MZ+1]!==" ")}if(!x&&!b){if(KZ&&!O&&!P($))return qZ;return A===$Z?n:WZ}if(q>9&&OZ($))return n;if(!O)return b?TZ:AZ;return A===$Z?n:WZ}function EZ($,G,q,R,P){$.dump=function(){if(G.length===0)return $.quotingType===$Z?'""':"''";if(!$.noCompatMode){if(PZ.indexOf(G)!==-1||I.test(G))return $.quotingType===$Z?'"'+G+'"':"'"+G+"'"}let A=$.indent*Math.max(1,q),O=$.lineWidth===-1?-1:Math.max(Math.min($.lineWidth,40),$.lineWidth-A),N=R||$.flowLevel>-1&&q>=$.flowLevel;function L(S){return BZ($,S)}switch(CZ(G,N,$.indent,O,L,$.quotingType,$.forceQuotes&&!R,P)){case qZ:return G;case WZ:return"'"+G.replace(/'/g,"''")+"'";case AZ:return"|"+wZ(G,$.indent)+jZ(UZ(G,A));case TZ:return">"+wZ(G,$.indent)+jZ(UZ(yZ(G,O),A));case n:return'"'+mZ(G)+'"';default:throw new U("impossible error: invalid scalar style")}}()}function wZ($,G){let q=OZ($)?String(G):"",R=$[$.length-1]===`
27
27
  `,A=R&&($[$.length-2]===`
28
28
  `||$===`
29
29
  `)?"+":R?"":"-";return q+A+`
30
30
  `}function jZ($){return $[$.length-1]===`
31
31
  `?$.slice(0,-1):$}function yZ($,G){let q=/(\n+)([^\n]*)/g,R=function(){let N=$.indexOf(`
32
- `);return N=N!==-1?N:$.length,q.lastIndex=N,i($.slice(0,N),G)}(),Y=$[0]===`
33
- `||$[0]===" ",A,O;while(O=q.exec($)){let N=O[1],L=O[2];A=L[0]===" ",R+=N+(!Y&&!A&&L!==""?`
34
- `:"")+i(L,G),Y=A}return R}function i($,G){if($===""||$[0]===" ")return $;let q=/ [^ ]/g,R,Y=0,A,O=0,N=0,L="";while(R=q.exec($)){if(N=R.index,N-Y>G)A=O>Y?O:N,L+=`
35
- `+$.slice(Y,A),Y=A+1;O=N}if(L+=`
36
- `,$.length-Y>G&&O>Y)L+=$.slice(Y,O)+`
37
- `+$.slice(O+1);else L+=$.slice(Y);return L.slice(1)}function mZ($){let G="",q=0;for(let R=0;R<$.length;q>=65536?R+=2:R++){q=r($,R);let Y=E[q];if(!Y&&e(q)){if(G+=$[R],q>=65536)G+=$[R+1]}else G+=Y||c(q)}return G}function LZ($,G,q){let R="",Y=$.tag;for(let A=0,O=q.length;A<O;A+=1){let N=q[A];if($.replacer)N=$.replacer.call(q,String(A),N);if(K($,G,N,!1,!1)||typeof N>"u"&&K($,G,null,!1,!1)){if(R!=="")R+=","+(!$.condenseFlow?" ":"");R+=$.dump}}$.tag=Y,$.dump="["+R+"]"}function NZ($,G,q,R){let Y="",A=$.tag;for(let O=0,N=q.length;O<N;O+=1){let L=q[O];if($.replacer)L=$.replacer.call(q,String(O),L);if(K($,G+1,L,!0,!0,!1,!0)||typeof L>"u"&&K($,G+1,null,!0,!0,!1,!0)){if(!R||Y!=="")Y+=XZ($,G);if($.dump&&f===$.dump.charCodeAt(0))Y+="-";else Y+="- ";Y+=$.dump}}$.tag=A,$.dump=Y||"[]"}function hZ($,G,q){let R="",Y=$.tag,A=Object.keys(q);for(let O=0,N=A.length;O<N;O+=1){let L="";if(R!=="")L+=", ";if($.condenseFlow)L+='"';let S=A[O],z=q[S];if($.replacer)z=$.replacer.call(q,S,z);if(!K($,G,S,!1,!1))continue;if($.dump.length>1024)L+="? ";if(L+=$.dump+($.condenseFlow?'"':"")+":"+($.condenseFlow?"":" "),!K($,G,z,!1,!1))continue;L+=$.dump,R+=L}$.tag=Y,$.dump="{"+R+"}"}function Z($,G,q,R){let Y="",A=$.tag,O=Object.keys(q);if($.sortKeys===!0)O.sort();else if(typeof $.sortKeys==="function")O.sort($.sortKeys);else if($.sortKeys)throw new U("sortKeys must be a boolean or a function");for(let N=0,L=O.length;N<L;N+=1){let S="";if(!R||Y!=="")S+=XZ($,G);let z=O[N],x=q[z];if($.replacer)x=$.replacer.call(q,z,x);if(!K($,G+1,z,!0,!0,!0))continue;let b=$.tag!==null&&$.tag!=="?"||$.dump&&$.dump.length>1024;if(b)if($.dump&&f===$.dump.charCodeAt(0))S+="?";else S+="? ";if(S+=$.dump,b)S+=XZ($,G);if(!K($,G+1,x,!0,b))continue;if($.dump&&f===$.dump.charCodeAt(0))S+=":";else S+=": ";S+=$.dump,Y+=S}$.tag=A,$.dump=Y||"{}"}function X($,G,q){let R=q?$.explicitTypes:$.implicitTypes;for(let Y=0,A=R.length;Y<A;Y+=1){let O=R[Y];if((O.instanceOf||O.predicate)&&(!O.instanceOf||typeof G==="object"&&G instanceof O.instanceOf)&&(!O.predicate||O.predicate(G))){if(q)if(O.multi&&O.representName)$.tag=O.representName(G);else $.tag=O.tag;else $.tag="?";if(O.represent){let N=$.styleMap[O.tag]||O.defaultStyle,L;if(T.call(O.represent)==="[object Function]")L=O.represent(G,N);else if(V.call(O.represent,N))L=O.represent[N](G,N);else throw new U("!<"+O.tag+'> tag resolver accepts not "'+N+'" style');$.dump=L}return!0}}return!1}function K($,G,q,R,Y,A,O){if($.tag=null,$.dump=q,!X($,q,!1))X($,q,!0);let N=T.call($.dump),L=R;if(R)R=$.flowLevel<0||$.flowLevel>G;let S=N==="[object Object]"||N==="[object Array]",z,x;if(S)z=$.duplicates.indexOf(q),x=z!==-1;if($.tag!==null&&$.tag!=="?"||x||$.indent!==2&&G>0)Y=!1;if(x&&$.usedDuplicates[z])$.dump="*ref_"+z;else{if(S&&x&&!$.usedDuplicates[z])$.usedDuplicates[z]=!0;if(N==="[object Object]"){if(R&&Object.keys($.dump).length!==0){if(Z($,G,$.dump,Y),x)$.dump="&ref_"+z+$.dump}else if(hZ($,G,$.dump),x)$.dump="&ref_"+z+" "+$.dump}else if(N==="[object Array]"){if(R&&$.dump.length!==0){if($.noArrayIndent&&!O&&G>0)NZ($,G-1,$.dump,Y);else NZ($,G,$.dump,Y);if(x)$.dump="&ref_"+z+$.dump}else if(LZ($,G,$.dump),x)$.dump="&ref_"+z+" "+$.dump}else if(N==="[object String]"){if($.tag!=="?")EZ($,$.dump,G,A,L)}else if(N==="[object Undefined]")return!1;else{if($.skipInvalid)return!1;throw new U("unacceptable kind of an object to dump "+N)}if($.tag!==null&&$.tag!=="?"){let b=encodeURI($.tag[0]==="!"?$.tag.slice(1):$.tag).replace(/!/g,"%21");if($.tag[0]==="!")b="!"+b;else if(b.slice(0,18)==="tag:yaml.org,2002:")b="!!"+b.slice(18);else b="!<"+b+">";$.dump=b+" "+$.dump}}return!0}function B($,G){let q=[],R=[];M($,q,R);let Y=R.length;for(let A=0;A<Y;A+=1)G.duplicates.push(q[R[A]]);G.usedDuplicates=Array(Y)}function M($,G,q){if($!==null&&typeof $==="object"){let R=G.indexOf($);if(R!==-1){if(q.indexOf(R)===-1)q.push(R)}else if(G.push($),Array.isArray($))for(let Y=0,A=$.length;Y<A;Y+=1)M($[Y],G,q);else{let Y=Object.keys($);for(let A=0,O=Y.length;A<O;A+=1)M($[Y[A]],G,q)}}}function w($,G){G=G||{};let q=new _Z(G);if(!q.noRefs)B($,q);let R=$;if(q.replacer)R=q.replacer.call({"":R},"",R);if(K(q,0,R,!0,!0))return q.dump+`
38
- `;return""}return M0.dump=w,M0}var F$;function $1(){if(F$)return m;F$=1;let F=t$(),U=Z1();function P(T,V){return function(){throw Error("Function yaml."+T+" is removed in js-yaml 4. Use yaml."+V+" instead, which is now safe by default.")}}return m.Type=h(),m.Schema=Q$(),m.FAILSAFE_SCHEMA=M$(),m.JSON_SCHEMA=Y$(),m.CORE_SCHEMA=P$(),m.DEFAULT_SCHEMA=f0(),m.load=F.load,m.loadAll=F.loadAll,m.dump=U.dump,m.YAMLException=HZ(),m.types={binary:q$(),float:R$(),map:W$(),null:f$(),pairs:T$(),set:w$(),timestamp:B$(),bool:K$(),int:H$(),merge:O$(),omap:A$(),seq:U$(),str:D$()},m.safeLoad=P("safeLoad","load"),m.safeLoadAll=P("safeLoadAll","loadAll"),m.safeDump=P("safeDump","dump"),m}var J1=$1(),X1=a$(J1),{Type:T2,Schema:w2,FAILSAFE_SCHEMA:C2,JSON_SCHEMA:j2,CORE_SCHEMA:L2,DEFAULT_SCHEMA:N2,load:G1,loadAll:I2,dump:V1,YAMLException:S2,types:z2,safeLoad:k2,safeLoadAll:x2,safeDump:v2}=X1;var g2=J.record(J.string(),J.unknown());var V8=J.object({slug:J.string(),title:J.string(),type:J.string(),entityId:J.string(),contentHash:J.string()});function F1(F){return`preview.${F.trim().replace(/^https?:\/\//,"")}`}var Q1=J.string(),D1=J.looseObject({id:J.string().min(1)}),U1=J.looseObject({label:J.string().min(1)}),W1=J.looseObject({layouts:J.record(J.string(),J.unknown()),plugin:J.custom((F)=>typeof F==="function").optional(),routes:J.array(D1),entityDisplay:J.record(J.string(),U1),content:J.unknown().optional(),themeOverride:J.string().optional(),headScripts:J.array(J.string()).optional(),staticAssets:J.record(J.string(),J.string()).optional()}),M1=J.custom((F)=>W1.safeParse(F).success);var j$=J.record(J.string(),J.unknown());var l8=J.union([J.object({success:J.boolean(),data:J.unknown().optional(),error:J.string().optional()}),J.object({noop:J.literal(!0)})]),c8=J.object({id:J.string(),timestamp:J.string(),type:J.string(),source:J.string(),target:J.string().optional(),metadata:j$.optional()});
39
- export{R0 as ha,P0 as ia,L$ as ja,N$ as ka,I$ as la,S$ as ma,n$ as na,B0 as oa,z$ as pa,k$ as qa,N0 as ra,I0 as sa,_$ as ta,u$ as ua,p$ as va,d$ as wa,l$ as xa,zZ as ya,G1 as za,F1 as Aa,j$ as Ba,l8 as Ca,c8 as Da};
32
+ `);return N=N!==-1?N:$.length,q.lastIndex=N,i($.slice(0,N),G)}(),P=$[0]===`
33
+ `||$[0]===" ",A,O;while(O=q.exec($)){let N=O[1],L=O[2];A=L[0]===" ",R+=N+(!P&&!A&&L!==""?`
34
+ `:"")+i(L,G),P=A}return R}function i($,G){if($===""||$[0]===" ")return $;let q=/ [^ ]/g,R,P=0,A,O=0,N=0,L="";while(R=q.exec($)){if(N=R.index,N-P>G)A=O>P?O:N,L+=`
35
+ `+$.slice(P,A),P=A+1;O=N}if(L+=`
36
+ `,$.length-P>G&&O>P)L+=$.slice(P,O)+`
37
+ `+$.slice(O+1);else L+=$.slice(P);return L.slice(1)}function mZ($){let G="",q=0;for(let R=0;R<$.length;q>=65536?R+=2:R++){q=r($,R);let P=E[q];if(!P&&e(q)){if(G+=$[R],q>=65536)G+=$[R+1]}else G+=P||c(q)}return G}function LZ($,G,q){let R="",P=$.tag;for(let A=0,O=q.length;A<O;A+=1){let N=q[A];if($.replacer)N=$.replacer.call(q,String(A),N);if(f($,G,N,!1,!1)||typeof N>"u"&&f($,G,null,!1,!1)){if(R!=="")R+=","+(!$.condenseFlow?" ":"");R+=$.dump}}$.tag=P,$.dump="["+R+"]"}function NZ($,G,q,R){let P="",A=$.tag;for(let O=0,N=q.length;O<N;O+=1){let L=q[O];if($.replacer)L=$.replacer.call(q,String(O),L);if(f($,G+1,L,!0,!0,!1,!0)||typeof L>"u"&&f($,G+1,null,!0,!0,!1,!0)){if(!R||P!=="")P+=XZ($,G);if($.dump&&K===$.dump.charCodeAt(0))P+="-";else P+="- ";P+=$.dump}}$.tag=A,$.dump=P||"[]"}function hZ($,G,q){let R="",P=$.tag,A=Object.keys(q);for(let O=0,N=A.length;O<N;O+=1){let L="";if(R!=="")L+=", ";if($.condenseFlow)L+='"';let S=A[O],z=q[S];if($.replacer)z=$.replacer.call(q,S,z);if(!f($,G,S,!1,!1))continue;if($.dump.length>1024)L+="? ";if(L+=$.dump+($.condenseFlow?'"':"")+":"+($.condenseFlow?"":" "),!f($,G,z,!1,!1))continue;L+=$.dump,R+=L}$.tag=P,$.dump="{"+R+"}"}function Z($,G,q,R){let P="",A=$.tag,O=Object.keys(q);if($.sortKeys===!0)O.sort();else if(typeof $.sortKeys==="function")O.sort($.sortKeys);else if($.sortKeys)throw new U("sortKeys must be a boolean or a function");for(let N=0,L=O.length;N<L;N+=1){let S="";if(!R||P!=="")S+=XZ($,G);let z=O[N],x=q[z];if($.replacer)x=$.replacer.call(q,z,x);if(!f($,G+1,z,!0,!0,!0))continue;let b=$.tag!==null&&$.tag!=="?"||$.dump&&$.dump.length>1024;if(b)if($.dump&&K===$.dump.charCodeAt(0))S+="?";else S+="? ";if(S+=$.dump,b)S+=XZ($,G);if(!f($,G+1,x,!0,b))continue;if($.dump&&K===$.dump.charCodeAt(0))S+=":";else S+=": ";S+=$.dump,P+=S}$.tag=A,$.dump=P||"{}"}function X($,G,q){let R=q?$.explicitTypes:$.implicitTypes;for(let P=0,A=R.length;P<A;P+=1){let O=R[P];if((O.instanceOf||O.predicate)&&(!O.instanceOf||typeof G==="object"&&G instanceof O.instanceOf)&&(!O.predicate||O.predicate(G))){if(q)if(O.multi&&O.representName)$.tag=O.representName(G);else $.tag=O.tag;else $.tag="?";if(O.represent){let N=$.styleMap[O.tag]||O.defaultStyle,L;if(T.call(O.represent)==="[object Function]")L=O.represent(G,N);else if(V.call(O.represent,N))L=O.represent[N](G,N);else throw new U("!<"+O.tag+'> tag resolver accepts not "'+N+'" style');$.dump=L}return!0}}return!1}function f($,G,q,R,P,A,O){if($.tag=null,$.dump=q,!X($,q,!1))X($,q,!0);let N=T.call($.dump),L=R;if(R)R=$.flowLevel<0||$.flowLevel>G;let S=N==="[object Object]"||N==="[object Array]",z,x;if(S)z=$.duplicates.indexOf(q),x=z!==-1;if($.tag!==null&&$.tag!=="?"||x||$.indent!==2&&G>0)P=!1;if(x&&$.usedDuplicates[z])$.dump="*ref_"+z;else{if(S&&x&&!$.usedDuplicates[z])$.usedDuplicates[z]=!0;if(N==="[object Object]"){if(R&&Object.keys($.dump).length!==0){if(Z($,G,$.dump,P),x)$.dump="&ref_"+z+$.dump}else if(hZ($,G,$.dump),x)$.dump="&ref_"+z+" "+$.dump}else if(N==="[object Array]"){if(R&&$.dump.length!==0){if($.noArrayIndent&&!O&&G>0)NZ($,G-1,$.dump,P);else NZ($,G,$.dump,P);if(x)$.dump="&ref_"+z+$.dump}else if(LZ($,G,$.dump),x)$.dump="&ref_"+z+" "+$.dump}else if(N==="[object String]"){if($.tag!=="?")EZ($,$.dump,G,A,L)}else if(N==="[object Undefined]")return!1;else{if($.skipInvalid)return!1;throw new U("unacceptable kind of an object to dump "+N)}if($.tag!==null&&$.tag!=="?"){let b=encodeURI($.tag[0]==="!"?$.tag.slice(1):$.tag).replace(/!/g,"%21");if($.tag[0]==="!")b="!"+b;else if(b.slice(0,18)==="tag:yaml.org,2002:")b="!!"+b.slice(18);else b="!<"+b+">";$.dump=b+" "+$.dump}}return!0}function B($,G){let q=[],R=[];M($,q,R);let P=R.length;for(let A=0;A<P;A+=1)G.duplicates.push(q[R[A]]);G.usedDuplicates=Array(P)}function M($,G,q){if($!==null&&typeof $==="object"){let R=G.indexOf($);if(R!==-1){if(q.indexOf(R)===-1)q.push(R)}else if(G.push($),Array.isArray($))for(let P=0,A=$.length;P<A;P+=1)M($[P],G,q);else{let P=Object.keys($);for(let A=0,O=P.length;A<O;A+=1)M($[P[A]],G,q)}}}function C($,G){G=G||{};let q=new gZ(G);if(!q.noRefs)B($,q);let R=$;if(q.replacer)R=q.replacer.call({"":R},"",R);if(f(q,0,R,!0,!0))return q.dump+`
38
+ `;return""}return M0.dump=C,M0}var F$;function J1(){if(F$)return m;F$=1;let F=Z1(),U=$1();function Y(T,V){return function(){throw Error("Function yaml."+T+" is removed in js-yaml 4. Use yaml."+V+" instead, which is now safe by default.")}}return m.Type=h(),m.Schema=Q$(),m.FAILSAFE_SCHEMA=M$(),m.JSON_SCHEMA=Y$(),m.CORE_SCHEMA=P$(),m.DEFAULT_SCHEMA=K0(),m.load=F.load,m.loadAll=F.loadAll,m.dump=U.dump,m.YAMLException=HZ(),m.types={binary:q$(),float:R$(),map:W$(),null:K$(),pairs:T$(),set:C$(),timestamp:B$(),bool:f$(),int:H$(),merge:O$(),omap:A$(),seq:U$(),str:D$()},m.safeLoad=Y("safeLoad","load"),m.safeLoadAll=Y("safeLoadAll","loadAll"),m.safeDump=Y("safeDump","dump"),m}var X1=J1(),G1=e$(X1),{Type:C2,Schema:w2,FAILSAFE_SCHEMA:j2,JSON_SCHEMA:L2,CORE_SCHEMA:N2,DEFAULT_SCHEMA:I2,load:V1,loadAll:S2,dump:F1,YAMLException:z2,types:k2,safeLoad:x2,safeLoadAll:v2,safeDump:b2}=G1;var g2=J.record(J.string(),J.unknown());var F8=J.object({slug:J.string(),title:J.string(),type:J.string(),entityId:J.string(),contentHash:J.string()});function Q1(F,U={}){let Y=j$(F),T=j$(U.sharedDomain??"rizom.ai").replace(/^\./,""),V=`.${T}`;if(Y.endsWith(V)){let Q=Y.slice(0,-V.length);if(Q.length>0&&!Q.includes("."))return`${Q}-preview.${T}`}return`preview.${Y}`}function j$(F){return F.trim().replace(/^https?:\/\//i,"").replace(/\/$/,"").toLowerCase()}var D1=J.string(),U1=J.looseObject({id:J.string().min(1)}),W1=J.looseObject({label:J.string().min(1)}),M1=J.looseObject({layouts:J.record(J.string(),J.unknown()),plugin:J.custom((F)=>typeof F==="function").optional(),routes:J.array(U1),entityDisplay:J.record(J.string(),W1),content:J.unknown().optional(),themeOverride:J.string().optional(),headScripts:J.array(J.string()).optional(),staticAssets:J.record(J.string(),J.string()).optional()}),K1=J.custom((F)=>M1.safeParse(F).success);var L$=J.record(J.string(),J.unknown());var c8=J.union([J.object({success:J.boolean(),data:J.unknown().optional(),error:J.string().optional()}),J.object({noop:J.literal(!0)})]),o8=J.object({id:J.string(),timestamp:J.string(),type:J.string(),source:J.string(),target:J.string().optional(),metadata:L$.optional()});
39
+ export{R0 as ha,P0 as ia,N$ as ja,I$ as ka,S$ as la,z$ as ma,i$ as na,B0 as oa,k$ as pa,x$ as qa,N0 as ra,I0 as sa,E$ as ta,p$ as ua,d$ as va,l$ as wa,c$ as xa,zZ as ya,V1 as za,Q1 as Aa,L$ as Ba,c8 as Ca,o8 as Da};
40
40
 
41
- //# debugId=5407C4DBE75ADD1464756E2164756E21
42
- //# sourceMappingURL=index-gbnw7xez.js.map
41
+ //# debugId=4A7ABFCE782C62CA64756E2164756E21
42
+ //# sourceMappingURL=index-e7bz0548.js.map