@interactive-inc/claude-funnel 0.49.0 → 0.51.0
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.
- package/dist/bin.js +1 -1
- package/dist/claude-CB1WkV77.d.ts +115 -0
- package/dist/claude.d.ts +59 -0
- package/dist/claude.js +322 -0
- package/dist/{connector-diagnostic-log-OPpPi9V9.d.ts → connector-diagnostic-log-yTOojKUR.d.ts} +14 -14
- package/dist/{logger-Czli2OKh.js → connector-listener-DU54DN-f.js} +1 -9
- package/dist/connectors/discord.d.ts +3 -3
- package/dist/connectors/discord.js +2 -1
- package/dist/connectors/gh.d.ts +4 -3
- package/dist/connectors/gh.js +2 -1
- package/dist/connectors/schedule.d.ts +1 -1
- package/dist/connectors/schedule.js +2 -1
- package/dist/connectors/slack.d.ts +2 -2
- package/dist/connectors/slack.js +2 -1
- package/dist/discord-connector-schema-CBDyGdOI.js +21 -0
- package/dist/{discord-connector-schema-BeThExJp.js → discord-listener-_jSE3HsQ.js} +2 -22
- package/dist/file-system-BeOKXjlV.d.ts +26 -0
- package/dist/file-system-PWKKU7lA.js +9 -0
- package/dist/gateway.d.ts +3 -0
- package/dist/gateway.js +2 -0
- package/dist/gh-connector-schema-eoTtHbY6.d.ts +14 -0
- package/dist/{gh-connector-schema-eYE4g77K.js → gh-connector-schema-o3Q1-ojL.js} +1 -176
- package/dist/gh-listener-DH-fClQm.js +178 -0
- package/dist/index-BM0-f6KL.d.ts +3404 -0
- package/dist/index.d.ts +11 -4083
- package/dist/index.js +247 -3459
- package/dist/local-config-json-schema-8IHjS4Q7.js +439 -0
- package/dist/local-config-sync-BdsrDZOu.d.ts +381 -0
- package/dist/local-config.d.ts +3 -0
- package/dist/local-config.js +3 -0
- package/dist/logger-BP6SisKt.js +9 -0
- package/dist/mcp-Dr-nIBwN.js +253 -0
- package/dist/memory-connector-diagnostic-log-CrW1ltLM.js +2245 -0
- package/dist/memory-token-prompter-B5FFCsGP.d.ts +57 -0
- package/dist/memory-token-prompter-CLerGsgM.js +61 -0
- package/dist/node-file-system-BcrmWN9I.js +48 -0
- package/dist/{gh-connector-schema-CQmEWzdV.d.ts → process-runner-DfniuWVU.d.ts} +1 -14
- package/dist/profiles-f0mNmEyP.d.ts +64 -0
- package/dist/profiles-wMRnjSid.js +129 -0
- package/dist/profiles.d.ts +2 -0
- package/dist/profiles.js +2 -0
- package/dist/schedule-connector-schema-iCI61gzU.js +31 -0
- package/dist/{schedule-listener-3M6WkH1Y.d.ts → schedule-listener-CUyUFFR1.d.ts} +22 -46
- package/dist/{schedule-connector-schema-CM-sRkac.js → schedule-listener-ePAjians.js} +3 -86
- package/dist/settings-reader-BSU6JyvM.d.ts +167 -0
- package/dist/settings-reader-DPqrpV7s.js +11 -0
- package/dist/settings-store-D2XSXTyt.js +186 -0
- package/dist/slack-connector-schema-BCNWluHM.js +32 -0
- package/dist/{slack-listener-9UdAn_ui.d.ts → slack-listener-Bv5xI9gC.d.ts} +31 -31
- package/dist/{slack-connector-schema-DDbSGPZn.js → slack-listener-ClQuHhEF.js} +2 -32
- package/package.json +6 -1
- /package/dist/{connector-adapter-VA6undzc.d.ts → connector-adapter-DKgsVuMH.d.ts} +0 -0
- /package/dist/{discord-connector-schema-DF4pL3Sc.d.ts → discord-connector-schema-R0Uu-3ns.d.ts} +0 -0
package/dist/bin.js
CHANGED
|
@@ -481,7 +481,7 @@ Since you have not provided a token or authorize, you might be missing one or mo
|
|
|
481
481
|
* Copyright(c) 2013 Roman Shtylman
|
|
482
482
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
483
483
|
* MIT Licensed
|
|
484
|
-
*/var JI=pr1(),pL6=v("events").EventEmitter,Ze1=lr1(),Ke1=as1(),We1=Wl(),Ve1=It1(),He1=Qe1();i7=Ge1.exports=iL6;function iL6(){var $=function(Y,Q,X){$.handle(Y,Q,X)};return Ze1($,pL6.prototype,!1),Ze1($,Ke1,!1),$.request=Object.create(Ve1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(He1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}i7.application=Ke1;i7.request=Ve1;i7.response=He1;i7.Route=We1.Route;i7.Router=We1;i7.json=JI.json;i7.raw=JI.raw;i7.static=ze1();i7.text=JI.text;i7.urlencoded=JI.urlencoded});var je1=x((Q8)=>{var lL6=Q8&&Q8.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),nL6=Q8&&Q8.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),xe1=Q8&&Q8.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))lL6(Y,$,Q)}return nL6(Y,$),Y},wI=Q8&&Q8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q8,"__esModule",{value:!0});Q8.buildBodyParserMiddleware=Q8.verifySignatureAndParseBody=Q8.verifySignatureAndParseRawBody=Q8.respondToUrlVerification=Q8.respondToSslCheck=void 0;var dL6=wI(v("crypto")),aL6=v("http"),oL6=v("https"),rL6=wI(v("querystring")),we1=L$(),sL6=Sw(),Ue1=xe1(Je1()),tL6=wI(bP()),eL6=wI(AP()),qQ=P$(),v2=xe1(mw()),$N6=RP(),YN6=kP(),QN6=["ALPNProtocols","clientCertEngine","enableTrace","handshakeTimeout","rejectUnauthorized","requestCert","sessionTimeout","SNICallback","ticketKeys","pskCallback","pskIdentityHint","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","passphrase","pfx","secureOptions","secureProtocol","sessionIdContext"],vl="The receiver cannot be started because private state was mutated. Please report this to the maintainers.",XN6=($,Y,Q)=>{if($.body?.ssl_check){Y.send();return}Q()};Q8.respondToSslCheck=XN6;var zN6=($,Y,Q)=>{if($.body?.type&&$.body.type==="url_verification"){Y.json({challenge:$.body.challenge});return}Q()};Q8.respondToUrlVerification=zN6;class Be1{app;server;bolt;logger;processBeforeResponse;signatureVerification;router;installer=void 0;installerOptions;customPropertiesExtractor;dispatchErrorHandler;processEventErrorHandler;unhandledRequestHandler;unhandledRequestTimeoutMillis;constructor({signingSecret:$="",logger:Y=void 0,logLevel:Q=we1.LogLevel.INFO,endpoints:X={events:"/slack/events"},processBeforeResponse:z=!1,signatureVerification:Z=!0,clientId:K=void 0,clientSecret:W=void 0,stateSecret:V=void 0,redirectUri:H=void 0,installationStore:G=void 0,scopes:J=void 0,installerOptions:w={},app:U=void 0,router:B=void 0,customPropertiesExtractor:D=(I)=>({}),dispatchErrorHandler:q=v2.defaultAsyncDispatchErrorHandler,processEventErrorHandler:F=v2.defaultProcessEventErrorHandler,unhandledRequestHandler:P=v2.defaultUnhandledRequestHandler,unhandledRequestTimeoutMillis:L=3001}){if(this.app=U!==void 0?U:(0,Ue1.default)(),typeof Y<"u")this.logger=Y;else this.logger=new we1.ConsoleLogger,this.logger.setLevel(Q);this.signatureVerification=Z;let O=[this.signatureVerification?qe1(this.logger,$):Fe1(this.logger),Q8.respondToSslCheck,Q8.respondToUrlVerification,this.requestHandler.bind(this)];this.processBeforeResponse=z;let m=typeof X==="string"?[X]:Object.values(X);this.router=B!==void 0?B:(0,Ue1.Router)();for(let H1 of m)this.router.post(H1,...O);if(this.customPropertiesExtractor=D,this.dispatchErrorHandler=q,this.processEventErrorHandler=F,this.unhandledRequestHandler=P,this.unhandledRequestTimeoutMillis=L,(0,YN6.verifyRedirectOpts)({redirectUri:H,redirectUriPath:w.redirectUriPath}),K!==void 0&&W!==void 0&&(w.stateVerification===!1||V!==void 0||w.stateStore!==void 0))this.installer=new sL6.InstallProvider({clientId:K,clientSecret:W,stateSecret:V,installationStore:G,logLevel:Q,logger:Y,directInstall:w.directInstall,stateStore:w.stateStore,stateVerification:w.stateVerification,legacyStateVerification:w.legacyStateVerification,stateCookieName:w.stateCookieName,stateCookieExpirationSeconds:w.stateCookieExpirationSeconds,renderHtmlForInstallPath:w.renderHtmlForInstallPath,authVersion:w.authVersion??"v2",clientOptions:w.clientOptions,authorizationUrl:w.authorizationUrl});let V1={metadata:w.metadata,scopes:J??[],userScopes:w.userScopes,redirectUri:H};if(this.installer!==void 0){let{installer:H1}=this,p=w.redirectUriPath===void 0?"/slack/oauth_redirect":w.redirectUriPath,{callbackOptions:i,stateVerification:X1}=w;this.router.use(p,async(I1,O1)=>{try{if(X1===!1)await H1.handleCallback(I1,O1,i,V1);else await H1.handleCallback(I1,O1,i)}catch(S1){await this.dispatchErrorHandler({error:S1,logger:this.logger,request:I1,response:O1})}});let G1=w.installPath===void 0?"/slack/install":w.installPath,{installPathOptions:A1}=w;this.router.get(G1,async(I1,O1,S1)=>{try{try{await H1.handleInstallPath(I1,O1,A1,V1)}catch(f1){S1(f1)}}catch(f1){await this.dispatchErrorHandler({error:f1,logger:this.logger,request:I1,response:O1})}})}this.app.use(this.router)}async requestHandler($,Y){let Q=new $N6.HTTPResponseAck({logger:this.logger,processBeforeResponse:this.processBeforeResponse,unhandledRequestHandler:this.unhandledRequestHandler,unhandledRequestTimeoutMillis:this.unhandledRequestTimeoutMillis,httpRequest:$,httpRequestBody:$.body,httpResponse:Y}),X={body:$.body,ack:Q.bind(),retryNum:v2.extractRetryNumFromHTTPRequest($),retryReason:v2.extractRetryReasonFromHTTPRequest($),customProperties:this.customPropertiesExtractor($)};try{if(await this.bolt?.processEvent(X),Q.storedResponse!==void 0)v2.buildContentResponse(Y,Q.storedResponse),this.logger.debug("stored response sent")}catch(z){if(await this.processEventErrorHandler({error:z,logger:this.logger,request:$,response:Y,storedResponse:Q.storedResponse}))Q.ack()}}init($){this.bolt=$}start($,Y={}){let Q=aL6.createServer;if(Object.keys(Y).filter((X)=>QN6.includes(X)).length>0)Q=oL6.createServer;if(this.server!==void 0)return Promise.reject(new qQ.ReceiverInconsistentStateError("The receiver cannot be started because it was already started."));return this.server=Q(Y,this.app),new Promise((X,z)=>{if(this.server===void 0)throw new qQ.ReceiverInconsistentStateError(vl);this.server.on("error",(Z)=>{if(this.server===void 0)throw new qQ.ReceiverInconsistentStateError(vl);this.server.close(),z(Z)}),this.server.on("close",()=>{this.server=void 0}),this.server.listen($,()=>{if(this.server===void 0)return z(new qQ.ReceiverInconsistentStateError(vl));return X(this.server)})})}stop(){if(this.server===void 0)return Promise.reject(new qQ.ReceiverInconsistentStateError("The receiver cannot be stopped because it was not started."));return new Promise(($,Y)=>{this.server?.close((Q)=>{if(Q!==void 0)return Y(Q);return this.server=void 0,$()})})}}Q8.default=Be1;function ZN6($,Y){return qe1($,Y)}Q8.verifySignatureAndParseRawBody=ZN6;function qe1($,Y){return async(Q,X,z)=>{let Z=await Ne1(Q);try{Q.body=De1(typeof Y==="string"?Y:await Y(),Z,Q.headers)}catch(K){if(K){if(K instanceof qQ.ReceiverAuthenticityError){bl($,"Request verification failed",K),X.status(401).send();return}bl($,"Parsing request body failed",K),X.status(400).send();return}}z()}}function bl($,Y,Q){let X="code"in Q?`${Y} (code: ${Q.code}, message: ${Q.message})`:`${Y} (error: ${Q})`;$.warn(X)}function KN6($,Y,Q,X){if(Q===void 0||X===void 0)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Some headers are missing.");let z=Number(X);if(Number.isNaN(z))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is invalid.");let Z=Math.floor(Date.now()/1000)-300;if(z<Z)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is too old.");let K=dL6.default.createHmac("sha256",$),[W,V]=Q.split("=");if(K.update(`${W}:${z}:${Y}`),!(0,eL6.default)(V,K.digest("hex")))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Signature mismatch.")}function De1($,Y,Q){let{"x-slack-signature":X,"x-slack-request-timestamp":z,"content-type":Z}=Q;return KN6($,Y,X,z),Le1(Y,Z)}Q8.verifySignatureAndParseBody=De1;function Fe1($){return async(Y,Q,X)=>{let z=await Ne1(Y);try{let{"content-type":Z}=Y.headers;Y.body=Le1(z,Z)}catch(Z){if(Z){bl($,"Parsing request body failed",Z),Q.status(400).send();return}}X()}}Q8.buildBodyParserMiddleware=Fe1;function Le1($,Y){if(Y==="application/x-www-form-urlencoded"){let Q=rL6.default.parse($);if(typeof Q.payload==="string")return JSON.parse(Q.payload);return Q}return JSON.parse($)}async function Ne1($){if("rawBody"in $&&$.rawBody)return Promise.resolve($.rawBody.toString());return(await(0,tL6.default)($)).toString()}});var ve1=x((Me1)=>{Object.defineProperty(Me1,"__esModule",{value:!0});Me1.DefaultThreadContextStore=void 0;var Pe1=Al();class Ie1{context={};async get($){let{context:Y,client:Q,payload:X,logger:z}=$;if(z.debug("DefaultAssistantThreadStore: get method called"),this.context.channel_id)return this.context;let{channelId:Z,threadTs:K}=(0,Pe1.extractThreadInfo)(X),W=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!W.messages)return{};let V=W.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);return(V?.metadata?V.metadata.event_payload:null)||{}}async save($){let{context:Y,client:Q,payload:X,logger:z}=$,{channelId:Z,threadTs:K,context:W}=(0,Pe1.extractThreadInfo)(X);z.debug("DefaultAssistantThreadStore: save method called");let V=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!V.messages)return;let H=V.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);if(H?.ts){let G={channel:Z,ts:H.ts,text:H.text,blocks:H.blocks?H.blocks:[],metadata:{event_type:"assistant_thread_context",event_payload:W}};await Q.chat.update(G)}this.context=W}}Me1.DefaultThreadContextStore=Ie1});var Al=x((c8)=>{var WN6=c8&&c8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(c8,"__esModule",{value:!0});c8.extractThreadInfo=c8.processAssistantMiddleware=c8.validate=c8.isAssistantMessage=c8.matchesConstraints=c8.isAssistantEvent=c8.enrichAssistantArgs=c8.Assistant=void 0;var VN6=ve1(),be1=Eh(),QK=P$(),UI=qj(),HN6=WN6(Dj()),GN6=new Set(["assistant_thread_started","assistant_thread_context_changed","message"]);class Ae1{threadContextStore;threadStarted;threadContextChanged;userMessage;constructor($){Se1($);let{threadContextStore:Y=new VN6.DefaultThreadContextStore,threadStarted:Q,threadContextChanged:X=(Z)=>Y.save(Z),userMessage:z}=$;this.threadContextStore=Y,this.threadStarted=Array.isArray(Q)?Q:[Q],this.threadContextChanged=Array.isArray(X)?X:[X],this.userMessage=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(Re1($)&&Te1($))return this.processEvent($);return $.next()}}async processEvent($){let{payload:Y}=$,Q=_e1(this.threadContextStore,$),X=this.getAssistantMiddleware(Y);return fe1(Q,X)}getAssistantMiddleware($){switch($.type){case"assistant_thread_started":return this.threadStarted;case"assistant_thread_context_changed":return this.threadContextChanged;case"message":return this.userMessage;default:return[]}}}c8.Assistant=Ae1;function _e1($,Y){let{next:Q,...X}=Y,z={...X};return z.getThreadContext=()=>$.get(Y),z.saveThreadContext=()=>$.save(Y),z.say=JN6(z),z.sayStream=wN6(z),z.setStatus=UN6(z),z.setSuggestedPrompts=xN6(z),z.setTitle=BN6(z),z}c8.enrichAssistantArgs=_e1;function Re1($){return GN6.has($.payload.type)}c8.isAssistantEvent=Re1;function Te1($){return $.payload.type==="message"?ke1($.payload):!0}c8.matchesConstraints=Te1;function ke1($){let Y="channel"in $&&"thread_ts"in $,Q="channel_type"in $&&$.channel_type==="im"&&(!("subtype"in $)||$.subtype==="file_share"||$.subtype===void 0);return Y&&Q}c8.isAssistantMessage=ke1;function Se1($){if(typeof $!=="object")throw new QK.AssistantInitializationError("Assistant expects a configuration object as the argument");let Y=["threadStarted","userMessage"],Q=[];for(let z of Y)if($[z]===void 0)Q.push(z);if(Q.length>0){let z=`Assistant is missing required keys: ${Q.join(", ")}`;throw new QK.AssistantInitializationError(z)}let X=["threadStarted","userMessage"];if("threadContextChanged"in $)X.push("threadContextChanged");for(let z of X)if(typeof $[z]!=="function"&&!Array.isArray($[z])){let Z=`Assistant ${z} property must be a function or an array of functions`;throw new QK.AssistantInitializationError(Z)}if($.threadContextStore){if(typeof $.threadContextStore!=="object")throw new QK.AssistantInitializationError("Assistant expects threadContextStore to be a configuration object");let z=["get","save"],Z=[];for(let W of z)if($.threadContextStore&&$.threadContextStore[W]===void 0)Z.push(W);if(Z.length>0){let W=`threadContextStore is missing required keys: ${Z.join(", ")}`;throw new QK.AssistantInitializationError(W)}let K=["get","save"];for(let W of K)if($.threadContextStore&&typeof $.threadContextStore[W]!=="function"){let V=`threadContextStore ${W} property must be a function`;throw new QK.AssistantInitializationError(V)}}}c8.validate=Se1;async function fe1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,HN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}c8.processAssistantMiddleware=fe1;function JN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z,context:Z}=b2(Q);return async(K)=>{let W=Z.channel_id?Z:await $.getThreadContext(),V=typeof K==="string"?{text:K,channel:X,thread_ts:z}:{...K,channel:X,thread_ts:z};if(W||V.metadata)V.metadata={event_type:V.metadata?.event_type??"assistant_thread_context",event_payload:{...W,...V.metadata?.event_payload??{}}};return Y.chat.postMessage(V)}}function wN6($){let{client:Y,context:Q,payload:X}=$,{channelId:z,threadTs:Z}=b2(X);return(0,be1.createSayStream)(Y,Q,z,Z)}function UN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(0,be1.createSetStatus)(Y,X,z)}function xN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(Z)=>{let{prompts:K,title:W}=Z;return Y.assistant.threads.setSuggestedPrompts({channel_id:X,thread_ts:z,prompts:K,title:W})}}function BN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(Z)=>Y.assistant.threads.setTitle({channel_id:X,thread_ts:z,title:Z})}function b2($){let Y={};if("assistant_thread"in $&&(0,UI.isRecord)($.assistant_thread)){if((0,UI.isRecord)($.assistant_thread.context))Y=$.assistant_thread.context}let Q=(0,UI.extractEventChannelId)($),X=(0,UI.extractEventThreadTs)($);if(!Q||!X){let z=[];if(!Q)z.push("channel_id");if(!X)z.push("thread_ts");throw new QK.AssistantMissingPropertyError(`Assistant message event is missing required properties: ${z.join(", ")}`)}return{channelId:Q,threadTs:X,context:Y}}c8.extractThreadInfo=b2});var ge1=x((a9)=>{var qN6=a9&&a9.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(a9,"__esModule",{value:!0});a9.prepareStepArgs=a9.isStepEvent=a9.processStepMiddleware=a9.validate=a9.WorkflowStep=void 0;var xI=P$(),DN6=qN6(Dj()),FN6=new Set(["workflow_step_edit","workflow_step","workflow_step_execute"]);class Ee1{callbackId;edit;save;execute;constructor($,Y){Ce1($,Y);let{save:Q,edit:X,execute:z}=Y;this.callbackId=$,this.save=Array.isArray(Q)?Q:[Q],this.edit=Array.isArray(X)?X:[X],this.execute=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(ce1($)&&this.matchesConstraints($))return this.processEvent($);return $.next()}}matchesConstraints($){return $.payload.callback_id===this.callbackId}async processEvent($){let{payload:Y}=$,Q=ye1($),X=this.getStepMiddleware(Y);return ue1(Q,X)}getStepMiddleware($){switch($.type){case"workflow_step_edit":return this.edit;case"workflow_step":return this.save;case"workflow_step_execute":return this.execute;default:return[]}}}a9.WorkflowStep=Ee1;function Ce1($,Y){if(typeof $!=="string")throw new xI.WorkflowStepInitializationError("WorkflowStep expects a callback_id as the first argument");if(typeof Y!=="object")throw new xI.WorkflowStepInitializationError("WorkflowStep expects a configuration object as the second argument");let Q=["save","edit","execute"],X=[];for(let Z of Q)if(Y[Z]===void 0)X.push(Z);if(X.length>0){let Z=`WorkflowStep is missing required keys: ${X.join(", ")}`;throw new xI.WorkflowStepInitializationError(Z)}let z=["save","edit","execute"];for(let Z of z)if(typeof Y[Z]!=="function"&&!Array.isArray(Y[Z])){let K=`WorkflowStep ${Z} property must be a function or an array of functions`;throw new xI.WorkflowStepInitializationError(K)}}a9.validate=Ce1;async function ue1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,DN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}a9.processStepMiddleware=ue1;function ce1($){return FN6.has($.payload.type)}a9.isStepEvent=ce1;function BI($){return $.botToken!==void 0?$.botToken:$.userToken}function LN6($){let{context:Y,client:Q,body:{callback_id:X,trigger_id:z}}=$,Z=BI(Y);return(K)=>Q.views.open({token:Z,trigger_id:z,view:{callback_id:X,type:"workflow_step",...K}})}function NN6($){let{context:Y,client:Q,body:{workflow_step:{workflow_step_edit_id:X}}}=$,z=BI(Y);return(Z={})=>Q.workflows.updateStep({token:z,workflow_step_edit_id:X,...Z})}function jN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=BI(Y);return(Z={})=>Q.workflows.stepCompleted({token:z,workflow_step_execute_id:X,...Z})}function PN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=BI(Y);return(Z)=>{let{error:K}=Z;return Q.workflows.stepFailed({token:z,workflow_step_execute_id:X,error:K})}}function ye1($){let{next:Y,...Q}=$,X={...Q};switch(X.payload.type){case"workflow_step_edit":X.step=X.action.workflow_step,X.configure=LN6(X);break;case"workflow_step":X.step=X.body.workflow_step,X.update=NN6(X);break;case"workflow_step_execute":X.step=X.event.workflow_step,X.complete=jN6(X),X.fail=PN6(X);break;default:break}return X}a9.prepareStepArgs=ye1});var le1=x((Q0)=>{var he1=Q0&&Q0.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),IN6=Q0&&Q0.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),_l=Q0&&Q0.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))he1(Y,$,Q)}return IN6(Y,$),Y},Rl=Q0&&Q0.__exportStar||function($,Y){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Y,Q))he1(Y,$,Q)},UU=Q0&&Q0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.webApi=Q0.types=Q0.FileInstallationStore=Q0.MemoryInstallationStore=Q0.WorkflowStep=Q0.Assistant=Q0.buildReceiverRoutes=Q0.MemoryStore=Q0.defaultProcessEventErrorHandler=Q0.HTTPResponseAck=Q0.HTTPModuleFunctions=Q0.AwsLambdaReceiver=Q0.HTTPReceiver=Q0.SocketModeReceiver=Q0.ExpressReceiver=Q0.isValidSlackRequest=Q0.verifySlackRequest=Q0.App=Q0.LogLevel=void 0;var me1=UU(Ni());Q0.App=me1.default;var MN6=Ni();Object.defineProperty(Q0,"LogLevel",{enumerable:!0,get:function(){return MN6.LogLevel}});Q0.default=me1.default;var pe1=Ki();Object.defineProperty(Q0,"verifySlackRequest",{enumerable:!0,get:function(){return pe1.verifySlackRequest}});Object.defineProperty(Q0,"isValidSlackRequest",{enumerable:!0,get:function(){return pe1.isValidSlackRequest}});var ON6=UU(Jo1());Q0.AwsLambdaReceiver=ON6.default;var vN6=UU(je1());Q0.ExpressReceiver=vN6.default;var bN6=UU(Vi());Q0.HTTPReceiver=bN6.default;var AN6=UU(xi());Q0.SocketModeReceiver=AN6.default;Q0.HTTPModuleFunctions=_l(mw());var _N6=RP();Object.defineProperty(Q0,"HTTPResponseAck",{enumerable:!0,get:function(){return _N6.HTTPResponseAck}});var RN6=Ui();Object.defineProperty(Q0,"defaultProcessEventErrorHandler",{enumerable:!0,get:function(){return RN6.defaultProcessEventErrorHandler}});Rl(P$(),Q0);Rl(Bj(),Q0);Rl(qi(),Q0);var TN6=Ch();Object.defineProperty(Q0,"MemoryStore",{enumerable:!0,get:function(){return TN6.MemoryStore}});var kN6=TP();Object.defineProperty(Q0,"buildReceiverRoutes",{enumerable:!0,get:function(){return kN6.buildReceiverRoutes}});var SN6=Al();Object.defineProperty(Q0,"Assistant",{enumerable:!0,get:function(){return SN6.Assistant}});var fN6=ge1();Object.defineProperty(Q0,"WorkflowStep",{enumerable:!0,get:function(){return fN6.WorkflowStep}});var ie1=Sw();Object.defineProperty(Q0,"MemoryInstallationStore",{enumerable:!0,get:function(){return ie1.MemoryInstallationStore}});Object.defineProperty(Q0,"FileInstallationStore",{enumerable:!0,get:function(){return ie1.FileInstallationStore}});Q0.types=_l(Mh());Q0.webApi=_l(xj())});import{homedir as xP6}from"os";var Zd={name:"@interactive-inc/claude-funnel",version:"0.49.0",description:"Hub CLI that routes external events (Slack / GitHub / Discord) to Claude Code agents through subscription channels over MCP.",keywords:["bun","claude","claude-code","cli","discord","github","mcp","slack"],homepage:"https://github.com/interactive-inc/open-claude-funnel#readme",bugs:{url:"https://github.com/interactive-inc/open-claude-funnel/issues"},license:"MIT",author:"Interactive Inc.",repository:{type:"git",url:"git+https://github.com/interactive-inc/open-claude-funnel.git"},bin:{fnl:"./dist/bin.js",funnel:"./dist/bin.js"},files:["dist/**/*","funnel.schema.json","README.md","LICENSE"],type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./gateway":{types:"./dist/gateway.d.ts",import:"./dist/gateway.js",default:"./dist/gateway.js"},"./profiles":{types:"./dist/profiles.d.ts",import:"./dist/profiles.js",default:"./dist/profiles.js"},"./local-config":{types:"./dist/local-config.d.ts",import:"./dist/local-config.js",default:"./dist/local-config.js"},"./connectors/slack":{types:"./dist/connectors/slack.d.ts",import:"./dist/connectors/slack.js",default:"./dist/connectors/slack.js"},"./connectors/discord":{types:"./dist/connectors/discord.d.ts",import:"./dist/connectors/discord.js",default:"./dist/connectors/discord.js"},"./connectors/gh":{types:"./dist/connectors/gh.d.ts",import:"./dist/connectors/gh.js",default:"./dist/connectors/gh.js"},"./connectors/schedule":{types:"./dist/connectors/schedule.d.ts",import:"./dist/connectors/schedule.js",default:"./dist/connectors/schedule.js"},"./bin":"./dist/bin.js","./package.json":"./package.json"},publishConfig:{access:"public"},scripts:{prepack:"make build"},dependencies:{"@hono/zod-validator":"^0.8.0","@modelcontextprotocol/sdk":"^1.29.0","@slack/bolt":"^4.7.2","@slack/web-api":"^7.16.0","discord.js":"^14.26.4",hono:"^4.12.19",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@typescript/native-preview":"^7.0.0-dev.20260516.1","vite-plus":"^0.1.21"},engines:{bun:">=1.3.0"}};var W0=class extends Error{res;status;constructor($=500,Y){super(Y?.message,{cause:Y?.cause});this.res=Y?.res,this.status=$}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var N={};s7(N,{xor:()=>ua,xid:()=>Ka,void:()=>Ta,uuidv7:()=>td,uuidv6:()=>sd,uuidv4:()=>rd,uuid:()=>od,util:()=>D1,url:()=>ed,uppercase:()=>AK,unknown:()=>NZ,union:()=>WB,undefined:()=>_a,ulid:()=>Za,uint64:()=>ba,uint32:()=>Ma,tuple:()=>IA,trim:()=>fK,treeifyError:()=>xM,transform:()=>HB,toUpperCase:()=>CK,toLowerCase:()=>EK,toJSONSchema:()=>fx,templateLiteral:()=>sa,symbol:()=>Aa,superRefine:()=>sA,success:()=>da,stringbool:()=>Zo,stringFormat:()=>Da,string:()=>zV,strictObject:()=>Ea,startsWith:()=>RK,slugify:()=>uK,size:()=>DZ,setErrorMap:()=>n$0,set:()=>ma,safeParseAsync:()=>sb,safeParse:()=>rb,safeEncodeAsync:()=>zA,safeEncode:()=>QA,safeDecodeAsync:()=>ZA,safeDecode:()=>XA,registry:()=>Zx,regexes:()=>t9,regex:()=>vK,refine:()=>rA,record:()=>MA,readonly:()=>iA,property:()=>Rx,promise:()=>ta,prettifyError:()=>BM,preprocess:()=>Wo,prefault:()=>CA,positive:()=>vx,pipe:()=>hx,partialRecord:()=>ya,parseAsync:()=>ob,parse:()=>ab,overwrite:()=>t7,optional:()=>KV,object:()=>fa,number:()=>WA,nullish:()=>na,nullable:()=>WV,null:()=>wA,normalize:()=>SK,nonpositive:()=>Ax,nonoptional:()=>uA,nonnegative:()=>_x,never:()=>KB,negative:()=>bx,nativeEnum:()=>pa,nanoid:()=>Qa,nan:()=>aa,multipleOf:()=>CX,minSize:()=>uY,minLength:()=>AQ,mime:()=>kK,meta:()=>Xo,maxSize:()=>uX,maxLength:()=>FZ,map:()=>ha,mac:()=>Ha,lte:()=>e9,lt:()=>EY,lowercase:()=>bK,looseRecord:()=>ga,looseObject:()=>Ca,locales:()=>$V,literal:()=>ia,length:()=>LZ,lazy:()=>dA,ksuid:()=>Wa,keyof:()=>Sa,jwt:()=>qa,json:()=>Ko,iso:()=>gK,ipv6:()=>Ga,ipv4:()=>Va,invertCodec:()=>ra,intersection:()=>jA,int64:()=>va,int32:()=>Ia,int:()=>gx,instanceof:()=>zo,includes:()=>_K,httpUrl:()=>$a,hostname:()=>Fa,hex:()=>La,hash:()=>Na,guid:()=>ad,gte:()=>r$,gt:()=>CY,globalRegistry:()=>V$,getErrorMap:()=>d$0,function:()=>ea,fromJSONSchema:()=>Ho,formatError:()=>p2,float64:()=>Pa,float32:()=>ja,flattenError:()=>m2,file:()=>la,exactOptional:()=>TA,enum:()=>VB,endsWith:()=>TK,encodeAsync:()=>$A,encode:()=>tb,emoji:()=>Ya,email:()=>dd,e164:()=>Ba,discriminatedUnion:()=>ca,describe:()=>Qo,decodeAsync:()=>YA,decode:()=>eb,date:()=>ka,custom:()=>Yo,cuid2:()=>za,cuid:()=>Xa,core:()=>_Q,config:()=>K8,coerce:()=>eA,codec:()=>oa,clone:()=>a$,cidrv6:()=>wa,cidrv4:()=>Ja,check:()=>$o,catch:()=>gA,boolean:()=>VA,bigint:()=>Oa,base64url:()=>xa,base64:()=>Ua,array:()=>JV,any:()=>Ra,_function:()=>ea,_default:()=>fA,_ZodString:()=>mx,ZodXor:()=>FA,ZodXID:()=>ox,ZodVoid:()=>qA,ZodUnknown:()=>xA,ZodUnion:()=>UV,ZodUndefined:()=>GA,ZodUUID:()=>cY,ZodURL:()=>HV,ZodULID:()=>ax,ZodType:()=>N0,ZodTuple:()=>PA,ZodTransform:()=>_A,ZodTemplateLiteral:()=>lA,ZodSymbol:()=>HA,ZodSuccess:()=>cA,ZodStringFormat:()=>G6,ZodString:()=>pK,ZodSet:()=>vA,ZodRecord:()=>hK,ZodRealError:()=>O9,ZodReadonly:()=>pA,ZodPromise:()=>aA,ZodPreprocess:()=>mA,ZodPrefault:()=>EA,ZodPipe:()=>xV,ZodOptional:()=>GB,ZodObject:()=>wV,ZodNumberFormat:()=>jZ,ZodNumber:()=>lK,ZodNullable:()=>kA,ZodNull:()=>JA,ZodNonOptional:()=>JB,ZodNever:()=>BA,ZodNanoID:()=>lx,ZodNaN:()=>hA,ZodMap:()=>OA,ZodMAC:()=>KA,ZodLiteral:()=>bA,ZodLazy:()=>nA,ZodKSUID:()=>rx,ZodJWT:()=>zB,ZodIssueCode:()=>l$0,ZodIntersection:()=>NA,ZodISOTime:()=>cx,ZodISODuration:()=>yx,ZodISODateTime:()=>Cx,ZodISODate:()=>ux,ZodIPv6:()=>tx,ZodIPv4:()=>sx,ZodGUID:()=>ZV,ZodFunction:()=>oA,ZodFirstPartyTypeKind:()=>tA,ZodFile:()=>AA,ZodExactOptional:()=>RA,ZodError:()=>p$0,ZodEnum:()=>mK,ZodEmoji:()=>ix,ZodEmail:()=>px,ZodE164:()=>XB,ZodDiscriminatedUnion:()=>LA,ZodDefault:()=>SA,ZodDate:()=>GV,ZodCustomStringFormat:()=>iK,ZodCustom:()=>qV,ZodCodec:()=>BV,ZodCatch:()=>yA,ZodCUID2:()=>dx,ZodCUID:()=>nx,ZodCIDRv6:()=>$B,ZodCIDRv4:()=>ex,ZodBoolean:()=>nK,ZodBigIntFormat:()=>ZB,ZodBigInt:()=>dK,ZodBase64URL:()=>QB,ZodBase64:()=>YB,ZodArray:()=>DA,ZodAny:()=>UA,TimePrecision:()=>Iv,NEVER:()=>QM,$output:()=>Dv,$input:()=>Fv,$brand:()=>XM});var _Q={};s7(_Q,{version:()=>J3,util:()=>D1,treeifyError:()=>xM,toJSONSchema:()=>fx,toDotPath:()=>wd,safeParseAsync:()=>DM,safeParse:()=>qM,safeEncodeAsync:()=>l60,safeEncode:()=>p60,safeDecodeAsync:()=>n60,safeDecode:()=>i60,registry:()=>Zx,regexes:()=>t9,process:()=>K6,prettifyError:()=>BM,parseAsync:()=>uU,parse:()=>CU,meta:()=>Xb,locales:()=>$V,isValidJWT:()=>fd,isValidBase64URL:()=>Sd,isValidBase64:()=>S3,initializeContext:()=>cX,globalRegistry:()=>V$,globalConfig:()=>wZ,formatError:()=>p2,flattenError:()=>m2,finalize:()=>gX,extractDefs:()=>yX,encodeAsync:()=>h60,encode:()=>y60,describe:()=>Qb,decodeAsync:()=>m60,decode:()=>g60,createToJSONSchemaMethod:()=>Zb,createStandardJSONSchemaMethod:()=>yK,config:()=>K8,clone:()=>a$,_xor:()=>L$0,_xid:()=>qx,_void:()=>dv,_uuidv7:()=>Gx,_uuidv6:()=>Hx,_uuidv4:()=>Vx,_uuid:()=>Wx,_url:()=>QV,_uppercase:()=>AK,_unknown:()=>lv,_union:()=>F$0,_undefined:()=>mv,_ulid:()=>Bx,_uint64:()=>gv,_uint32:()=>fv,_tuple:()=>P$0,_trim:()=>fK,_transform:()=>_$0,_toUpperCase:()=>CK,_toLowerCase:()=>EK,_templateLiteral:()=>c$0,_symbol:()=>hv,_superRefine:()=>Yb,_success:()=>f$0,_stringbool:()=>zb,_stringFormat:()=>cK,_string:()=>Nv,_startsWith:()=>RK,_slugify:()=>uK,_size:()=>DZ,_set:()=>O$0,_safeParseAsync:()=>IK,_safeParse:()=>PK,_safeEncodeAsync:()=>iU,_safeEncode:()=>mU,_safeDecodeAsync:()=>lU,_safeDecode:()=>pU,_regex:()=>vK,_refine:()=>$b,_record:()=>I$0,_readonly:()=>u$0,_property:()=>Rx,_promise:()=>g$0,_positive:()=>vx,_pipe:()=>C$0,_parseAsync:()=>jK,_parse:()=>NK,_overwrite:()=>t7,_optional:()=>R$0,_number:()=>Av,_nullable:()=>T$0,_null:()=>pv,_normalize:()=>SK,_nonpositive:()=>Ax,_nonoptional:()=>S$0,_nonnegative:()=>_x,_never:()=>nv,_negative:()=>bx,_nativeEnum:()=>b$0,_nanoid:()=>wx,_nan:()=>rv,_multipleOf:()=>CX,_minSize:()=>uY,_minLength:()=>AQ,_min:()=>r$,_mime:()=>kK,_maxSize:()=>uX,_maxLength:()=>FZ,_max:()=>e9,_map:()=>M$0,_mac:()=>Pv,_lte:()=>e9,_lt:()=>EY,_lowercase:()=>bK,_literal:()=>A$0,_length:()=>LZ,_lazy:()=>y$0,_ksuid:()=>Dx,_jwt:()=>Ox,_isoTime:()=>vv,_isoDuration:()=>bv,_isoDateTime:()=>Mv,_isoDate:()=>Ov,_ipv6:()=>Lx,_ipv4:()=>Fx,_intersection:()=>j$0,_int64:()=>yv,_int32:()=>Sv,_int:()=>Rv,_includes:()=>_K,_guid:()=>YV,_gte:()=>r$,_gt:()=>CY,_float64:()=>kv,_float32:()=>Tv,_file:()=>tv,_enum:()=>v$0,_endsWith:()=>TK,_encodeAsync:()=>gU,_encode:()=>cU,_emoji:()=>Jx,_email:()=>Kx,_e164:()=>Mx,_discriminatedUnion:()=>N$0,_default:()=>k$0,_decodeAsync:()=>hU,_decode:()=>yU,_date:()=>av,_custom:()=>ev,_cuid2:()=>xx,_cuid:()=>Ux,_coercedString:()=>jv,_coercedNumber:()=>_v,_coercedDate:()=>ov,_coercedBoolean:()=>Cv,_coercedBigint:()=>cv,_cidrv6:()=>jx,_cidrv4:()=>Nx,_check:()=>pd,_catch:()=>E$0,_boolean:()=>Ev,_bigint:()=>uv,_base64url:()=>Ix,_base64:()=>Px,_array:()=>sv,_any:()=>iv,TimePrecision:()=>Iv,NEVER:()=>QM,JSONSchemaGenerator:()=>pb,JSONSchema:()=>id,Doc:()=>oU,$output:()=>Dv,$input:()=>Fv,$constructor:()=>y,$brand:()=>XM,$ZodXor:()=>s3,$ZodXID:()=>P3,$ZodVoid:()=>d3,$ZodUnknown:()=>l3,$ZodUnion:()=>a2,$ZodUndefined:()=>m3,$ZodUUID:()=>x3,$ZodURL:()=>q3,$ZodULID:()=>j3,$ZodType:()=>w0,$ZodTuple:()=>Qx,$ZodTransform:()=>KO,$ZodTemplateLiteral:()=>DO,$ZodSymbol:()=>h3,$ZodSuccess:()=>wO,$ZodStringFormat:()=>H6,$ZodString:()=>qZ,$ZodSet:()=>QO,$ZodRegistry:()=>Lv,$ZodRecord:()=>$O,$ZodRealError:()=>M9,$ZodReadonly:()=>qO,$ZodPromise:()=>LO,$ZodPreprocess:()=>BO,$ZodPrefault:()=>GO,$ZodPipe:()=>zx,$ZodOptional:()=>Xx,$ZodObjectJIT:()=>r3,$ZodObject:()=>ud,$ZodNumberFormat:()=>y3,$ZodNumber:()=>$x,$ZodNullable:()=>VO,$ZodNull:()=>p3,$ZodNonOptional:()=>JO,$ZodNever:()=>n3,$ZodNanoID:()=>F3,$ZodNaN:()=>xO,$ZodMap:()=>YO,$ZodMAC:()=>R3,$ZodLiteral:()=>zO,$ZodLazy:()=>NO,$ZodKSUID:()=>I3,$ZodJWT:()=>u3,$ZodIntersection:()=>e3,$ZodISOTime:()=>v3,$ZodISODuration:()=>b3,$ZodISODateTime:()=>M3,$ZodISODate:()=>O3,$ZodIPv6:()=>_3,$ZodIPv4:()=>A3,$ZodGUID:()=>U3,$ZodFunction:()=>FO,$ZodFile:()=>ZO,$ZodExactOptional:()=>WO,$ZodError:()=>h2,$ZodEnum:()=>XO,$ZodEncodeError:()=>UZ,$ZodEmoji:()=>D3,$ZodEmail:()=>B3,$ZodE164:()=>C3,$ZodDiscriminatedUnion:()=>t3,$ZodDefault:()=>HO,$ZodDate:()=>a3,$ZodCustomStringFormat:()=>c3,$ZodCustom:()=>jO,$ZodCodec:()=>o2,$ZodCheckUpperCase:()=>z3,$ZodCheckStringFormat:()=>MK,$ZodCheckStartsWith:()=>K3,$ZodCheckSizeEquals:()=>tM,$ZodCheckRegex:()=>Q3,$ZodCheckProperty:()=>V3,$ZodCheckOverwrite:()=>G3,$ZodCheckNumberFormat:()=>aM,$ZodCheckMultipleOf:()=>dM,$ZodCheckMinSize:()=>sM,$ZodCheckMinLength:()=>$3,$ZodCheckMimeType:()=>H3,$ZodCheckMaxSize:()=>rM,$ZodCheckMaxLength:()=>eM,$ZodCheckLowerCase:()=>X3,$ZodCheckLessThan:()=>dU,$ZodCheckLengthEquals:()=>Y3,$ZodCheckIncludes:()=>Z3,$ZodCheckGreaterThan:()=>aU,$ZodCheckEndsWith:()=>W3,$ZodCheckBigIntFormat:()=>oM,$ZodCheck:()=>q6,$ZodCatch:()=>UO,$ZodCUID2:()=>N3,$ZodCUID:()=>L3,$ZodCIDRv6:()=>k3,$ZodCIDRv4:()=>T3,$ZodBoolean:()=>d2,$ZodBigIntFormat:()=>g3,$ZodBigInt:()=>Yx,$ZodBase64URL:()=>E3,$ZodBase64:()=>f3,$ZodAsyncError:()=>fY,$ZodArray:()=>o3,$ZodAny:()=>i3});var Kd,QM=Object.freeze({status:"aborted"});function y($,Y,Q){function X(W,V){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:V,constr:K,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),Y(W,V);let H=K.prototype,G=Object.keys(H);for(let J=0;J<G.length;J++){let w=G[J];if(!(w in W))W[w]=H[w].bind(W)}}let z=Q?.Parent??Object;class Z extends z{}Object.defineProperty(Z,"name",{value:$});function K(W){var V;let H=Q?.Parent?new Z:this;X(H,W),(V=H._zod).deferred??(V.deferred=[]);for(let G of H._zod.deferred)G();return H}return Object.defineProperty(K,"init",{value:X}),Object.defineProperty(K,Symbol.hasInstance,{value:(W)=>{if(Q?.Parent&&W instanceof Q.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(K,"name",{value:$}),K}var XM=Symbol("zod_brand");class fY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class UZ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var wZ=globalThis.__zod_globalConfig;function K8($){if($)Object.assign(wZ,$);return wZ}var D1={};s7(D1,{unwrapMessage:()=>E2,uint8ArrayToHex:()=>u60,uint8ArrayToBase64url:()=>E60,uint8ArrayToBase64:()=>Hd,stringifyPrimitive:()=>U1,slugify:()=>KM,shallowClone:()=>VM,safeExtend:()=>_60,required:()=>k60,randomString:()=>P60,propertyKeyTypes:()=>c2,promiseAllObject:()=>j60,primitiveTypes:()=>HM,prefixIssues:()=>I9,pick:()=>v60,partial:()=>T60,parsedType:()=>q1,optionalKeys:()=>GM,omit:()=>b60,objectClone:()=>F60,numKeys:()=>I60,nullish:()=>kX,normalizeParams:()=>j1,mergeDefs:()=>bQ,merge:()=>R60,jsonStringifyReplacer:()=>DK,joinValues:()=>n,issue:()=>LK,isPlainObject:()=>fX,isObject:()=>xZ,hexToUint8Array:()=>C60,getSizableOrigin:()=>y2,getParsedType:()=>M60,getLengthableOrigin:()=>g2,getEnumValues:()=>C2,getElementAtPath:()=>N60,floatSafeRemainder:()=>ZM,finalizeIssue:()=>o$,extend:()=>A60,explicitlyAborted:()=>UM,escapeRegex:()=>B7,esc:()=>fU,defineLazy:()=>A0,createTransparentProxy:()=>O60,cloneDef:()=>L60,clone:()=>a$,cleanRegex:()=>u2,cleanEnum:()=>S60,captureStackTrace:()=>EU,cached:()=>FK,base64urlToUint8Array:()=>f60,base64ToUint8Array:()=>Vd,assignProp:()=>SX,assertNotEqual:()=>x60,assertNever:()=>q60,assertIs:()=>B60,assertEqual:()=>U60,assert:()=>D60,allowsEval:()=>WM,aborted:()=>EX,NUMBER_FORMAT_RANGES:()=>JM,Class:()=>Gd,BIGINT_FORMAT_RANGES:()=>wM});function U60($){return $}function x60($){return $}function B60($){}function q60($){throw Error("Unexpected value in exhaustive check")}function D60($){}function C2($){let Y=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,z])=>Y.indexOf(+X)===-1).map(([X,z])=>z)}function n($,Y="|"){return $.map((Q)=>U1(Q)).join(Y)}function DK($,Y){if(typeof Y==="bigint")return Y.toString();return Y}function FK($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw Error("cached value already set")}}}function kX($){return $===null||$===void 0}function u2($){let Y=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(Y,Q)}function ZM($,Y){let Q=$/Y,X=Math.round(Q),z=Number.EPSILON*Math.max(Math.abs(Q),1);if(Math.abs(Q-X)<z)return 0;return Q-X}var Wd=Symbol("evaluating");function A0($,Y,Q){let X=void 0;Object.defineProperty($,Y,{get(){if(X===Wd)return;if(X===void 0)X=Wd,X=Q();return X},set(z){Object.defineProperty($,Y,{value:z})},configurable:!0})}function F60($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function SX($,Y,Q){Object.defineProperty($,Y,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function bQ(...$){let Y={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(Y,X)}return Object.defineProperties({},Y)}function L60($){return bQ($._zod.def)}function N60($,Y){if(!Y)return $;return Y.reduce((Q,X)=>Q?.[X],$)}function j60($){let Y=Object.keys($),Q=Y.map((X)=>$[X]);return Promise.all(Q).then((X)=>{let z={};for(let Z=0;Z<Y.length;Z++)z[Y[Z]]=X[Z];return z})}function P60($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function fU($){return JSON.stringify($)}function KM($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var EU="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function xZ($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var WM=FK(()=>{if(wZ.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function fX($){if(xZ($)===!1)return!1;let Y=$.constructor;if(Y===void 0)return!0;if(typeof Y!=="function")return!0;let Q=Y.prototype;if(xZ(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function VM($){if(fX($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function I60($){let Y=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))Y++;return Y}var M60=($)=>{let Y=typeof $;switch(Y){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Y}`)}},c2=new Set(["string","number","symbol"]),HM=new Set(["string","number","bigint","boolean","symbol","undefined"]);function B7($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a$($,Y,Q){let X=new $._zod.constr(Y??$._zod.def);if(!Y||Q?.parent)X._zod.parent=$;return X}function j1($){let Y=$;if(!Y)return{};if(typeof Y==="string")return{error:()=>Y};if(Y?.message!==void 0){if(Y?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Y.error=Y.message}if(delete Y.message,typeof Y.error==="string")return{...Y,error:()=>Y.error};return Y}function O60($){let Y;return new Proxy({},{get(Q,X,z){return Y??(Y=$()),Reflect.get(Y,X,z)},set(Q,X,z,Z){return Y??(Y=$()),Reflect.set(Y,X,z,Z)},has(Q,X){return Y??(Y=$()),Reflect.has(Y,X)},deleteProperty(Q,X){return Y??(Y=$()),Reflect.deleteProperty(Y,X)},ownKeys(Q){return Y??(Y=$()),Reflect.ownKeys(Y)},getOwnPropertyDescriptor(Q,X){return Y??(Y=$()),Reflect.getOwnPropertyDescriptor(Y,X)},defineProperty(Q,X,z){return Y??(Y=$()),Reflect.defineProperty(Y,X,z)}})}function U1($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function GM($){return Object.keys($).filter((Y)=>{return $[Y]._zod.optin==="optional"&&$[Y]._zod.optout==="optional"})}var JM={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wM={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function v60($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let Z=bQ($._zod.def,{get shape(){let K={};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;K[W]=Q.shape[W]}return SX(this,"shape",K),K},checks:[]});return a$($,Z)}function b60($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let Z=bQ($._zod.def,{get shape(){let K={...$._zod.def.shape};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;delete K[W]}return SX(this,"shape",K),K},checks:[]});return a$($,Z)}function A60($,Y){if(!fX(Y))throw Error("Invalid input to extend: expected a plain object");let Q=$._zod.def.checks;if(Q&&Q.length>0){let Z=$._zod.def.shape;for(let K in Y)if(Object.getOwnPropertyDescriptor(Z,K)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=bQ($._zod.def,{get shape(){let Z={...$._zod.def.shape,...Y};return SX(this,"shape",Z),Z}});return a$($,z)}function _60($,Y){if(!fX(Y))throw Error("Invalid input to safeExtend: expected a plain object");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y};return SX(this,"shape",X),X}});return a$($,Q)}function R60($,Y){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y._zod.def.shape};return SX(this,"shape",X),X},get catchall(){return Y._zod.def.catchall},checks:Y._zod.def.checks??[]});return a$($,Q)}function T60($,Y,Q){let z=Y._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let K=bQ(Y._zod.def,{get shape(){let W=Y._zod.def.shape,V={...W};if(Q)for(let H in Q){if(!(H in W))throw Error(`Unrecognized key: "${H}"`);if(!Q[H])continue;V[H]=$?new $({type:"optional",innerType:W[H]}):W[H]}else for(let H in W)V[H]=$?new $({type:"optional",innerType:W[H]}):W[H];return SX(this,"shape",V),V},checks:[]});return a$(Y,K)}function k60($,Y,Q){let X=bQ(Y._zod.def,{get shape(){let z=Y._zod.def.shape,Z={...z};if(Q)for(let K in Q){if(!(K in Z))throw Error(`Unrecognized key: "${K}"`);if(!Q[K])continue;Z[K]=new $({type:"nonoptional",innerType:z[K]})}else for(let K in z)Z[K]=new $({type:"nonoptional",innerType:z[K]});return SX(this,"shape",Z),Z}});return a$(Y,X)}function EX($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue!==!0)return!0;return!1}function UM($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue===!1)return!0;return!1}function I9($,Y){return Y.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function E2($){return typeof $==="string"?$:$?.message}function o$($,Y,Q){let X=$.message?$.message:E2($.inst?._zod.def?.error?.($))??E2(Y?.error?.($))??E2(Q.customError?.($))??E2(Q.localeError?.($))??"Invalid input",{inst:z,continue:Z,input:K,...W}=$;if(W.path??(W.path=[]),W.message=X,Y?.reportInput)W.input=K;return W}function y2($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function g2($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function q1($){let Y=typeof $;switch(Y){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let Q=$;if(Q&&Object.getPrototypeOf(Q)!==Object.prototype&&"constructor"in Q&&Q.constructor)return Q.constructor.name}}return Y}function LK(...$){let[Y,Q,X]=$;if(typeof Y==="string")return{message:Y,code:"custom",input:Q,inst:X};return{...Y}}function S60($){return Object.entries($).filter(([Y,Q])=>{return Number.isNaN(Number.parseInt(Y,10))}).map((Y)=>Y[1])}function Vd($){let Y=atob($),Q=new Uint8Array(Y.length);for(let X=0;X<Y.length;X++)Q[X]=Y.charCodeAt(X);return Q}function Hd($){let Y="";for(let Q=0;Q<$.length;Q++)Y+=String.fromCharCode($[Q]);return btoa(Y)}function f60($){let Y=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-Y.length%4)%4);return Vd(Y+Q)}function E60($){return Hd($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function C60($){let Y=$.replace(/^0x/,"");if(Y.length%2!==0)throw Error("Invalid hex string length");let Q=new Uint8Array(Y.length/2);for(let X=0;X<Y.length;X+=2)Q[X/2]=Number.parseInt(Y.slice(X,X+2),16);return Q}function u60($){return Array.from($).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}class Gd{constructor(...$){}}var Jd=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,DK,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},h2=y("$ZodError",Jd),M9=y("$ZodError",Jd,{Parent:Error});function m2($,Y=(Q)=>Q.message){let Q={},X=[];for(let z of $.issues)if(z.path.length>0)Q[z.path[0]]=Q[z.path[0]]||[],Q[z.path[0]].push(Y(z));else X.push(Y(z));return{formErrors:X,fieldErrors:Q}}function p2($,Y=(Q)=>Q.message){let Q={_errors:[]},X=(z,Z=[])=>{for(let K of z.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map((W)=>X({issues:W},[...Z,...K.path]));else if(K.code==="invalid_key")X({issues:K.issues},[...Z,...K.path]);else if(K.code==="invalid_element")X({issues:K.issues},[...Z,...K.path]);else{let W=[...Z,...K.path];if(W.length===0)Q._errors.push(Y(K));else{let V=Q,H=0;while(H<W.length){let G=W[H];if(H!==W.length-1)V[G]=V[G]||{_errors:[]};else V[G]=V[G]||{_errors:[]},V[G]._errors.push(Y(K));V=V[G],H++}}}};return X($),Q}function xM($,Y=(Q)=>Q.message){let Q={errors:[]},X=(z,Z=[])=>{var K,W;for(let V of z.issues)if(V.code==="invalid_union"&&V.errors.length)V.errors.map((H)=>X({issues:H},[...Z,...V.path]));else if(V.code==="invalid_key")X({issues:V.issues},[...Z,...V.path]);else if(V.code==="invalid_element")X({issues:V.issues},[...Z,...V.path]);else{let H=[...Z,...V.path];if(H.length===0){Q.errors.push(Y(V));continue}let G=Q,J=0;while(J<H.length){let w=H[J],U=J===H.length-1;if(typeof w==="string")G.properties??(G.properties={}),(K=G.properties)[w]??(K[w]={errors:[]}),G=G.properties[w];else G.items??(G.items=[]),(W=G.items)[w]??(W[w]={errors:[]}),G=G.items[w];if(U)G.errors.push(Y(V));J++}}};return X($),Q}function wd($){let Y=[],Q=$.map((X)=>typeof X==="object"?X.key:X);for(let X of Q)if(typeof X==="number")Y.push(`[${X}]`);else if(typeof X==="symbol")Y.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))Y.push(`[${JSON.stringify(X)}]`);else{if(Y.length)Y.push(".");Y.push(X)}return Y.join("")}function BM($){let Y=[],Q=[...$.issues].sort((X,z)=>(X.path??[]).length-(z.path??[]).length);for(let X of Q)if(Y.push(`\u2716 ${X.message}`),X.path?.length)Y.push(` \u2192 at ${wd(X.path)}`);return Y.join(`
|
|
484
|
+
*/var JI=pr1(),pL6=v("events").EventEmitter,Ze1=lr1(),Ke1=as1(),We1=Wl(),Ve1=It1(),He1=Qe1();i7=Ge1.exports=iL6;function iL6(){var $=function(Y,Q,X){$.handle(Y,Q,X)};return Ze1($,pL6.prototype,!1),Ze1($,Ke1,!1),$.request=Object.create(Ve1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(He1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}i7.application=Ke1;i7.request=Ve1;i7.response=He1;i7.Route=We1.Route;i7.Router=We1;i7.json=JI.json;i7.raw=JI.raw;i7.static=ze1();i7.text=JI.text;i7.urlencoded=JI.urlencoded});var je1=x((Q8)=>{var lL6=Q8&&Q8.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),nL6=Q8&&Q8.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),xe1=Q8&&Q8.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))lL6(Y,$,Q)}return nL6(Y,$),Y},wI=Q8&&Q8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q8,"__esModule",{value:!0});Q8.buildBodyParserMiddleware=Q8.verifySignatureAndParseBody=Q8.verifySignatureAndParseRawBody=Q8.respondToUrlVerification=Q8.respondToSslCheck=void 0;var dL6=wI(v("crypto")),aL6=v("http"),oL6=v("https"),rL6=wI(v("querystring")),we1=L$(),sL6=Sw(),Ue1=xe1(Je1()),tL6=wI(bP()),eL6=wI(AP()),qQ=P$(),v2=xe1(mw()),$N6=RP(),YN6=kP(),QN6=["ALPNProtocols","clientCertEngine","enableTrace","handshakeTimeout","rejectUnauthorized","requestCert","sessionTimeout","SNICallback","ticketKeys","pskCallback","pskIdentityHint","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","passphrase","pfx","secureOptions","secureProtocol","sessionIdContext"],vl="The receiver cannot be started because private state was mutated. Please report this to the maintainers.",XN6=($,Y,Q)=>{if($.body?.ssl_check){Y.send();return}Q()};Q8.respondToSslCheck=XN6;var zN6=($,Y,Q)=>{if($.body?.type&&$.body.type==="url_verification"){Y.json({challenge:$.body.challenge});return}Q()};Q8.respondToUrlVerification=zN6;class Be1{app;server;bolt;logger;processBeforeResponse;signatureVerification;router;installer=void 0;installerOptions;customPropertiesExtractor;dispatchErrorHandler;processEventErrorHandler;unhandledRequestHandler;unhandledRequestTimeoutMillis;constructor({signingSecret:$="",logger:Y=void 0,logLevel:Q=we1.LogLevel.INFO,endpoints:X={events:"/slack/events"},processBeforeResponse:z=!1,signatureVerification:Z=!0,clientId:K=void 0,clientSecret:W=void 0,stateSecret:V=void 0,redirectUri:H=void 0,installationStore:G=void 0,scopes:J=void 0,installerOptions:w={},app:U=void 0,router:B=void 0,customPropertiesExtractor:D=(I)=>({}),dispatchErrorHandler:q=v2.defaultAsyncDispatchErrorHandler,processEventErrorHandler:F=v2.defaultProcessEventErrorHandler,unhandledRequestHandler:P=v2.defaultUnhandledRequestHandler,unhandledRequestTimeoutMillis:L=3001}){if(this.app=U!==void 0?U:(0,Ue1.default)(),typeof Y<"u")this.logger=Y;else this.logger=new we1.ConsoleLogger,this.logger.setLevel(Q);this.signatureVerification=Z;let O=[this.signatureVerification?qe1(this.logger,$):Fe1(this.logger),Q8.respondToSslCheck,Q8.respondToUrlVerification,this.requestHandler.bind(this)];this.processBeforeResponse=z;let m=typeof X==="string"?[X]:Object.values(X);this.router=B!==void 0?B:(0,Ue1.Router)();for(let H1 of m)this.router.post(H1,...O);if(this.customPropertiesExtractor=D,this.dispatchErrorHandler=q,this.processEventErrorHandler=F,this.unhandledRequestHandler=P,this.unhandledRequestTimeoutMillis=L,(0,YN6.verifyRedirectOpts)({redirectUri:H,redirectUriPath:w.redirectUriPath}),K!==void 0&&W!==void 0&&(w.stateVerification===!1||V!==void 0||w.stateStore!==void 0))this.installer=new sL6.InstallProvider({clientId:K,clientSecret:W,stateSecret:V,installationStore:G,logLevel:Q,logger:Y,directInstall:w.directInstall,stateStore:w.stateStore,stateVerification:w.stateVerification,legacyStateVerification:w.legacyStateVerification,stateCookieName:w.stateCookieName,stateCookieExpirationSeconds:w.stateCookieExpirationSeconds,renderHtmlForInstallPath:w.renderHtmlForInstallPath,authVersion:w.authVersion??"v2",clientOptions:w.clientOptions,authorizationUrl:w.authorizationUrl});let V1={metadata:w.metadata,scopes:J??[],userScopes:w.userScopes,redirectUri:H};if(this.installer!==void 0){let{installer:H1}=this,p=w.redirectUriPath===void 0?"/slack/oauth_redirect":w.redirectUriPath,{callbackOptions:i,stateVerification:X1}=w;this.router.use(p,async(I1,O1)=>{try{if(X1===!1)await H1.handleCallback(I1,O1,i,V1);else await H1.handleCallback(I1,O1,i)}catch(S1){await this.dispatchErrorHandler({error:S1,logger:this.logger,request:I1,response:O1})}});let G1=w.installPath===void 0?"/slack/install":w.installPath,{installPathOptions:A1}=w;this.router.get(G1,async(I1,O1,S1)=>{try{try{await H1.handleInstallPath(I1,O1,A1,V1)}catch(f1){S1(f1)}}catch(f1){await this.dispatchErrorHandler({error:f1,logger:this.logger,request:I1,response:O1})}})}this.app.use(this.router)}async requestHandler($,Y){let Q=new $N6.HTTPResponseAck({logger:this.logger,processBeforeResponse:this.processBeforeResponse,unhandledRequestHandler:this.unhandledRequestHandler,unhandledRequestTimeoutMillis:this.unhandledRequestTimeoutMillis,httpRequest:$,httpRequestBody:$.body,httpResponse:Y}),X={body:$.body,ack:Q.bind(),retryNum:v2.extractRetryNumFromHTTPRequest($),retryReason:v2.extractRetryReasonFromHTTPRequest($),customProperties:this.customPropertiesExtractor($)};try{if(await this.bolt?.processEvent(X),Q.storedResponse!==void 0)v2.buildContentResponse(Y,Q.storedResponse),this.logger.debug("stored response sent")}catch(z){if(await this.processEventErrorHandler({error:z,logger:this.logger,request:$,response:Y,storedResponse:Q.storedResponse}))Q.ack()}}init($){this.bolt=$}start($,Y={}){let Q=aL6.createServer;if(Object.keys(Y).filter((X)=>QN6.includes(X)).length>0)Q=oL6.createServer;if(this.server!==void 0)return Promise.reject(new qQ.ReceiverInconsistentStateError("The receiver cannot be started because it was already started."));return this.server=Q(Y,this.app),new Promise((X,z)=>{if(this.server===void 0)throw new qQ.ReceiverInconsistentStateError(vl);this.server.on("error",(Z)=>{if(this.server===void 0)throw new qQ.ReceiverInconsistentStateError(vl);this.server.close(),z(Z)}),this.server.on("close",()=>{this.server=void 0}),this.server.listen($,()=>{if(this.server===void 0)return z(new qQ.ReceiverInconsistentStateError(vl));return X(this.server)})})}stop(){if(this.server===void 0)return Promise.reject(new qQ.ReceiverInconsistentStateError("The receiver cannot be stopped because it was not started."));return new Promise(($,Y)=>{this.server?.close((Q)=>{if(Q!==void 0)return Y(Q);return this.server=void 0,$()})})}}Q8.default=Be1;function ZN6($,Y){return qe1($,Y)}Q8.verifySignatureAndParseRawBody=ZN6;function qe1($,Y){return async(Q,X,z)=>{let Z=await Ne1(Q);try{Q.body=De1(typeof Y==="string"?Y:await Y(),Z,Q.headers)}catch(K){if(K){if(K instanceof qQ.ReceiverAuthenticityError){bl($,"Request verification failed",K),X.status(401).send();return}bl($,"Parsing request body failed",K),X.status(400).send();return}}z()}}function bl($,Y,Q){let X="code"in Q?`${Y} (code: ${Q.code}, message: ${Q.message})`:`${Y} (error: ${Q})`;$.warn(X)}function KN6($,Y,Q,X){if(Q===void 0||X===void 0)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Some headers are missing.");let z=Number(X);if(Number.isNaN(z))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is invalid.");let Z=Math.floor(Date.now()/1000)-300;if(z<Z)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is too old.");let K=dL6.default.createHmac("sha256",$),[W,V]=Q.split("=");if(K.update(`${W}:${z}:${Y}`),!(0,eL6.default)(V,K.digest("hex")))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Signature mismatch.")}function De1($,Y,Q){let{"x-slack-signature":X,"x-slack-request-timestamp":z,"content-type":Z}=Q;return KN6($,Y,X,z),Le1(Y,Z)}Q8.verifySignatureAndParseBody=De1;function Fe1($){return async(Y,Q,X)=>{let z=await Ne1(Y);try{let{"content-type":Z}=Y.headers;Y.body=Le1(z,Z)}catch(Z){if(Z){bl($,"Parsing request body failed",Z),Q.status(400).send();return}}X()}}Q8.buildBodyParserMiddleware=Fe1;function Le1($,Y){if(Y==="application/x-www-form-urlencoded"){let Q=rL6.default.parse($);if(typeof Q.payload==="string")return JSON.parse(Q.payload);return Q}return JSON.parse($)}async function Ne1($){if("rawBody"in $&&$.rawBody)return Promise.resolve($.rawBody.toString());return(await(0,tL6.default)($)).toString()}});var ve1=x((Me1)=>{Object.defineProperty(Me1,"__esModule",{value:!0});Me1.DefaultThreadContextStore=void 0;var Pe1=Al();class Ie1{context={};async get($){let{context:Y,client:Q,payload:X,logger:z}=$;if(z.debug("DefaultAssistantThreadStore: get method called"),this.context.channel_id)return this.context;let{channelId:Z,threadTs:K}=(0,Pe1.extractThreadInfo)(X),W=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!W.messages)return{};let V=W.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);return(V?.metadata?V.metadata.event_payload:null)||{}}async save($){let{context:Y,client:Q,payload:X,logger:z}=$,{channelId:Z,threadTs:K,context:W}=(0,Pe1.extractThreadInfo)(X);z.debug("DefaultAssistantThreadStore: save method called");let V=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!V.messages)return;let H=V.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);if(H?.ts){let G={channel:Z,ts:H.ts,text:H.text,blocks:H.blocks?H.blocks:[],metadata:{event_type:"assistant_thread_context",event_payload:W}};await Q.chat.update(G)}this.context=W}}Me1.DefaultThreadContextStore=Ie1});var Al=x((c8)=>{var WN6=c8&&c8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(c8,"__esModule",{value:!0});c8.extractThreadInfo=c8.processAssistantMiddleware=c8.validate=c8.isAssistantMessage=c8.matchesConstraints=c8.isAssistantEvent=c8.enrichAssistantArgs=c8.Assistant=void 0;var VN6=ve1(),be1=Eh(),QK=P$(),UI=qj(),HN6=WN6(Dj()),GN6=new Set(["assistant_thread_started","assistant_thread_context_changed","message"]);class Ae1{threadContextStore;threadStarted;threadContextChanged;userMessage;constructor($){Se1($);let{threadContextStore:Y=new VN6.DefaultThreadContextStore,threadStarted:Q,threadContextChanged:X=(Z)=>Y.save(Z),userMessage:z}=$;this.threadContextStore=Y,this.threadStarted=Array.isArray(Q)?Q:[Q],this.threadContextChanged=Array.isArray(X)?X:[X],this.userMessage=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(Re1($)&&Te1($))return this.processEvent($);return $.next()}}async processEvent($){let{payload:Y}=$,Q=_e1(this.threadContextStore,$),X=this.getAssistantMiddleware(Y);return fe1(Q,X)}getAssistantMiddleware($){switch($.type){case"assistant_thread_started":return this.threadStarted;case"assistant_thread_context_changed":return this.threadContextChanged;case"message":return this.userMessage;default:return[]}}}c8.Assistant=Ae1;function _e1($,Y){let{next:Q,...X}=Y,z={...X};return z.getThreadContext=()=>$.get(Y),z.saveThreadContext=()=>$.save(Y),z.say=JN6(z),z.sayStream=wN6(z),z.setStatus=UN6(z),z.setSuggestedPrompts=xN6(z),z.setTitle=BN6(z),z}c8.enrichAssistantArgs=_e1;function Re1($){return GN6.has($.payload.type)}c8.isAssistantEvent=Re1;function Te1($){return $.payload.type==="message"?ke1($.payload):!0}c8.matchesConstraints=Te1;function ke1($){let Y="channel"in $&&"thread_ts"in $,Q="channel_type"in $&&$.channel_type==="im"&&(!("subtype"in $)||$.subtype==="file_share"||$.subtype===void 0);return Y&&Q}c8.isAssistantMessage=ke1;function Se1($){if(typeof $!=="object")throw new QK.AssistantInitializationError("Assistant expects a configuration object as the argument");let Y=["threadStarted","userMessage"],Q=[];for(let z of Y)if($[z]===void 0)Q.push(z);if(Q.length>0){let z=`Assistant is missing required keys: ${Q.join(", ")}`;throw new QK.AssistantInitializationError(z)}let X=["threadStarted","userMessage"];if("threadContextChanged"in $)X.push("threadContextChanged");for(let z of X)if(typeof $[z]!=="function"&&!Array.isArray($[z])){let Z=`Assistant ${z} property must be a function or an array of functions`;throw new QK.AssistantInitializationError(Z)}if($.threadContextStore){if(typeof $.threadContextStore!=="object")throw new QK.AssistantInitializationError("Assistant expects threadContextStore to be a configuration object");let z=["get","save"],Z=[];for(let W of z)if($.threadContextStore&&$.threadContextStore[W]===void 0)Z.push(W);if(Z.length>0){let W=`threadContextStore is missing required keys: ${Z.join(", ")}`;throw new QK.AssistantInitializationError(W)}let K=["get","save"];for(let W of K)if($.threadContextStore&&typeof $.threadContextStore[W]!=="function"){let V=`threadContextStore ${W} property must be a function`;throw new QK.AssistantInitializationError(V)}}}c8.validate=Se1;async function fe1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,HN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}c8.processAssistantMiddleware=fe1;function JN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z,context:Z}=b2(Q);return async(K)=>{let W=Z.channel_id?Z:await $.getThreadContext(),V=typeof K==="string"?{text:K,channel:X,thread_ts:z}:{...K,channel:X,thread_ts:z};if(W||V.metadata)V.metadata={event_type:V.metadata?.event_type??"assistant_thread_context",event_payload:{...W,...V.metadata?.event_payload??{}}};return Y.chat.postMessage(V)}}function wN6($){let{client:Y,context:Q,payload:X}=$,{channelId:z,threadTs:Z}=b2(X);return(0,be1.createSayStream)(Y,Q,z,Z)}function UN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(0,be1.createSetStatus)(Y,X,z)}function xN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(Z)=>{let{prompts:K,title:W}=Z;return Y.assistant.threads.setSuggestedPrompts({channel_id:X,thread_ts:z,prompts:K,title:W})}}function BN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(Z)=>Y.assistant.threads.setTitle({channel_id:X,thread_ts:z,title:Z})}function b2($){let Y={};if("assistant_thread"in $&&(0,UI.isRecord)($.assistant_thread)){if((0,UI.isRecord)($.assistant_thread.context))Y=$.assistant_thread.context}let Q=(0,UI.extractEventChannelId)($),X=(0,UI.extractEventThreadTs)($);if(!Q||!X){let z=[];if(!Q)z.push("channel_id");if(!X)z.push("thread_ts");throw new QK.AssistantMissingPropertyError(`Assistant message event is missing required properties: ${z.join(", ")}`)}return{channelId:Q,threadTs:X,context:Y}}c8.extractThreadInfo=b2});var ge1=x((a9)=>{var qN6=a9&&a9.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(a9,"__esModule",{value:!0});a9.prepareStepArgs=a9.isStepEvent=a9.processStepMiddleware=a9.validate=a9.WorkflowStep=void 0;var xI=P$(),DN6=qN6(Dj()),FN6=new Set(["workflow_step_edit","workflow_step","workflow_step_execute"]);class Ee1{callbackId;edit;save;execute;constructor($,Y){Ce1($,Y);let{save:Q,edit:X,execute:z}=Y;this.callbackId=$,this.save=Array.isArray(Q)?Q:[Q],this.edit=Array.isArray(X)?X:[X],this.execute=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(ce1($)&&this.matchesConstraints($))return this.processEvent($);return $.next()}}matchesConstraints($){return $.payload.callback_id===this.callbackId}async processEvent($){let{payload:Y}=$,Q=ye1($),X=this.getStepMiddleware(Y);return ue1(Q,X)}getStepMiddleware($){switch($.type){case"workflow_step_edit":return this.edit;case"workflow_step":return this.save;case"workflow_step_execute":return this.execute;default:return[]}}}a9.WorkflowStep=Ee1;function Ce1($,Y){if(typeof $!=="string")throw new xI.WorkflowStepInitializationError("WorkflowStep expects a callback_id as the first argument");if(typeof Y!=="object")throw new xI.WorkflowStepInitializationError("WorkflowStep expects a configuration object as the second argument");let Q=["save","edit","execute"],X=[];for(let Z of Q)if(Y[Z]===void 0)X.push(Z);if(X.length>0){let Z=`WorkflowStep is missing required keys: ${X.join(", ")}`;throw new xI.WorkflowStepInitializationError(Z)}let z=["save","edit","execute"];for(let Z of z)if(typeof Y[Z]!=="function"&&!Array.isArray(Y[Z])){let K=`WorkflowStep ${Z} property must be a function or an array of functions`;throw new xI.WorkflowStepInitializationError(K)}}a9.validate=Ce1;async function ue1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,DN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}a9.processStepMiddleware=ue1;function ce1($){return FN6.has($.payload.type)}a9.isStepEvent=ce1;function BI($){return $.botToken!==void 0?$.botToken:$.userToken}function LN6($){let{context:Y,client:Q,body:{callback_id:X,trigger_id:z}}=$,Z=BI(Y);return(K)=>Q.views.open({token:Z,trigger_id:z,view:{callback_id:X,type:"workflow_step",...K}})}function NN6($){let{context:Y,client:Q,body:{workflow_step:{workflow_step_edit_id:X}}}=$,z=BI(Y);return(Z={})=>Q.workflows.updateStep({token:z,workflow_step_edit_id:X,...Z})}function jN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=BI(Y);return(Z={})=>Q.workflows.stepCompleted({token:z,workflow_step_execute_id:X,...Z})}function PN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=BI(Y);return(Z)=>{let{error:K}=Z;return Q.workflows.stepFailed({token:z,workflow_step_execute_id:X,error:K})}}function ye1($){let{next:Y,...Q}=$,X={...Q};switch(X.payload.type){case"workflow_step_edit":X.step=X.action.workflow_step,X.configure=LN6(X);break;case"workflow_step":X.step=X.body.workflow_step,X.update=NN6(X);break;case"workflow_step_execute":X.step=X.event.workflow_step,X.complete=jN6(X),X.fail=PN6(X);break;default:break}return X}a9.prepareStepArgs=ye1});var le1=x((Q0)=>{var he1=Q0&&Q0.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),IN6=Q0&&Q0.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),_l=Q0&&Q0.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))he1(Y,$,Q)}return IN6(Y,$),Y},Rl=Q0&&Q0.__exportStar||function($,Y){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Y,Q))he1(Y,$,Q)},UU=Q0&&Q0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.webApi=Q0.types=Q0.FileInstallationStore=Q0.MemoryInstallationStore=Q0.WorkflowStep=Q0.Assistant=Q0.buildReceiverRoutes=Q0.MemoryStore=Q0.defaultProcessEventErrorHandler=Q0.HTTPResponseAck=Q0.HTTPModuleFunctions=Q0.AwsLambdaReceiver=Q0.HTTPReceiver=Q0.SocketModeReceiver=Q0.ExpressReceiver=Q0.isValidSlackRequest=Q0.verifySlackRequest=Q0.App=Q0.LogLevel=void 0;var me1=UU(Ni());Q0.App=me1.default;var MN6=Ni();Object.defineProperty(Q0,"LogLevel",{enumerable:!0,get:function(){return MN6.LogLevel}});Q0.default=me1.default;var pe1=Ki();Object.defineProperty(Q0,"verifySlackRequest",{enumerable:!0,get:function(){return pe1.verifySlackRequest}});Object.defineProperty(Q0,"isValidSlackRequest",{enumerable:!0,get:function(){return pe1.isValidSlackRequest}});var ON6=UU(Jo1());Q0.AwsLambdaReceiver=ON6.default;var vN6=UU(je1());Q0.ExpressReceiver=vN6.default;var bN6=UU(Vi());Q0.HTTPReceiver=bN6.default;var AN6=UU(xi());Q0.SocketModeReceiver=AN6.default;Q0.HTTPModuleFunctions=_l(mw());var _N6=RP();Object.defineProperty(Q0,"HTTPResponseAck",{enumerable:!0,get:function(){return _N6.HTTPResponseAck}});var RN6=Ui();Object.defineProperty(Q0,"defaultProcessEventErrorHandler",{enumerable:!0,get:function(){return RN6.defaultProcessEventErrorHandler}});Rl(P$(),Q0);Rl(Bj(),Q0);Rl(qi(),Q0);var TN6=Ch();Object.defineProperty(Q0,"MemoryStore",{enumerable:!0,get:function(){return TN6.MemoryStore}});var kN6=TP();Object.defineProperty(Q0,"buildReceiverRoutes",{enumerable:!0,get:function(){return kN6.buildReceiverRoutes}});var SN6=Al();Object.defineProperty(Q0,"Assistant",{enumerable:!0,get:function(){return SN6.Assistant}});var fN6=ge1();Object.defineProperty(Q0,"WorkflowStep",{enumerable:!0,get:function(){return fN6.WorkflowStep}});var ie1=Sw();Object.defineProperty(Q0,"MemoryInstallationStore",{enumerable:!0,get:function(){return ie1.MemoryInstallationStore}});Object.defineProperty(Q0,"FileInstallationStore",{enumerable:!0,get:function(){return ie1.FileInstallationStore}});Q0.types=_l(Mh());Q0.webApi=_l(xj())});import{homedir as xP6}from"os";var Zd={name:"@interactive-inc/claude-funnel",version:"0.51.0",description:"Hub CLI that routes external events (Slack / GitHub / Discord) to Claude Code agents through subscription channels over MCP.",keywords:["bun","claude","claude-code","cli","discord","github","mcp","slack"],homepage:"https://github.com/interactive-inc/open-claude-funnel#readme",bugs:{url:"https://github.com/interactive-inc/open-claude-funnel/issues"},license:"MIT",author:"Interactive Inc.",repository:{type:"git",url:"git+https://github.com/interactive-inc/open-claude-funnel.git"},bin:{fnl:"./dist/bin.js",funnel:"./dist/bin.js"},files:["dist/**/*","funnel.schema.json","README.md","LICENSE"],type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./claude":{types:"./dist/claude.d.ts",import:"./dist/claude.js",default:"./dist/claude.js"},"./gateway":{types:"./dist/gateway.d.ts",import:"./dist/gateway.js",default:"./dist/gateway.js"},"./profiles":{types:"./dist/profiles.d.ts",import:"./dist/profiles.js",default:"./dist/profiles.js"},"./local-config":{types:"./dist/local-config.d.ts",import:"./dist/local-config.js",default:"./dist/local-config.js"},"./connectors/slack":{types:"./dist/connectors/slack.d.ts",import:"./dist/connectors/slack.js",default:"./dist/connectors/slack.js"},"./connectors/discord":{types:"./dist/connectors/discord.d.ts",import:"./dist/connectors/discord.js",default:"./dist/connectors/discord.js"},"./connectors/gh":{types:"./dist/connectors/gh.d.ts",import:"./dist/connectors/gh.js",default:"./dist/connectors/gh.js"},"./connectors/schedule":{types:"./dist/connectors/schedule.d.ts",import:"./dist/connectors/schedule.js",default:"./dist/connectors/schedule.js"},"./bin":"./dist/bin.js","./package.json":"./package.json"},publishConfig:{access:"public"},scripts:{prepack:"make build"},dependencies:{"@hono/zod-validator":"^0.8.0","@modelcontextprotocol/sdk":"^1.29.0","@slack/bolt":"^4.7.2","@slack/web-api":"^7.16.0","discord.js":"^14.26.4",hono:"^4.12.19",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@typescript/native-preview":"^7.0.0-dev.20260516.1","vite-plus":"^0.1.21"},engines:{bun:">=1.3.0"}};var W0=class extends Error{res;status;constructor($=500,Y){super(Y?.message,{cause:Y?.cause});this.res=Y?.res,this.status=$}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var N={};s7(N,{xor:()=>ua,xid:()=>Ka,void:()=>Ta,uuidv7:()=>td,uuidv6:()=>sd,uuidv4:()=>rd,uuid:()=>od,util:()=>D1,url:()=>ed,uppercase:()=>AK,unknown:()=>NZ,union:()=>WB,undefined:()=>_a,ulid:()=>Za,uint64:()=>ba,uint32:()=>Ma,tuple:()=>IA,trim:()=>fK,treeifyError:()=>xM,transform:()=>HB,toUpperCase:()=>CK,toLowerCase:()=>EK,toJSONSchema:()=>fx,templateLiteral:()=>sa,symbol:()=>Aa,superRefine:()=>sA,success:()=>da,stringbool:()=>Zo,stringFormat:()=>Da,string:()=>zV,strictObject:()=>Ea,startsWith:()=>RK,slugify:()=>uK,size:()=>DZ,setErrorMap:()=>n$0,set:()=>ma,safeParseAsync:()=>sb,safeParse:()=>rb,safeEncodeAsync:()=>zA,safeEncode:()=>QA,safeDecodeAsync:()=>ZA,safeDecode:()=>XA,registry:()=>Zx,regexes:()=>t9,regex:()=>vK,refine:()=>rA,record:()=>MA,readonly:()=>iA,property:()=>Rx,promise:()=>ta,prettifyError:()=>BM,preprocess:()=>Wo,prefault:()=>CA,positive:()=>vx,pipe:()=>hx,partialRecord:()=>ya,parseAsync:()=>ob,parse:()=>ab,overwrite:()=>t7,optional:()=>KV,object:()=>fa,number:()=>WA,nullish:()=>na,nullable:()=>WV,null:()=>wA,normalize:()=>SK,nonpositive:()=>Ax,nonoptional:()=>uA,nonnegative:()=>_x,never:()=>KB,negative:()=>bx,nativeEnum:()=>pa,nanoid:()=>Qa,nan:()=>aa,multipleOf:()=>CX,minSize:()=>uY,minLength:()=>AQ,mime:()=>kK,meta:()=>Xo,maxSize:()=>uX,maxLength:()=>FZ,map:()=>ha,mac:()=>Ha,lte:()=>e9,lt:()=>EY,lowercase:()=>bK,looseRecord:()=>ga,looseObject:()=>Ca,locales:()=>$V,literal:()=>ia,length:()=>LZ,lazy:()=>dA,ksuid:()=>Wa,keyof:()=>Sa,jwt:()=>qa,json:()=>Ko,iso:()=>gK,ipv6:()=>Ga,ipv4:()=>Va,invertCodec:()=>ra,intersection:()=>jA,int64:()=>va,int32:()=>Ia,int:()=>gx,instanceof:()=>zo,includes:()=>_K,httpUrl:()=>$a,hostname:()=>Fa,hex:()=>La,hash:()=>Na,guid:()=>ad,gte:()=>r$,gt:()=>CY,globalRegistry:()=>V$,getErrorMap:()=>d$0,function:()=>ea,fromJSONSchema:()=>Ho,formatError:()=>p2,float64:()=>Pa,float32:()=>ja,flattenError:()=>m2,file:()=>la,exactOptional:()=>TA,enum:()=>VB,endsWith:()=>TK,encodeAsync:()=>$A,encode:()=>tb,emoji:()=>Ya,email:()=>dd,e164:()=>Ba,discriminatedUnion:()=>ca,describe:()=>Qo,decodeAsync:()=>YA,decode:()=>eb,date:()=>ka,custom:()=>Yo,cuid2:()=>za,cuid:()=>Xa,core:()=>_Q,config:()=>K8,coerce:()=>eA,codec:()=>oa,clone:()=>a$,cidrv6:()=>wa,cidrv4:()=>Ja,check:()=>$o,catch:()=>gA,boolean:()=>VA,bigint:()=>Oa,base64url:()=>xa,base64:()=>Ua,array:()=>JV,any:()=>Ra,_function:()=>ea,_default:()=>fA,_ZodString:()=>mx,ZodXor:()=>FA,ZodXID:()=>ox,ZodVoid:()=>qA,ZodUnknown:()=>xA,ZodUnion:()=>UV,ZodUndefined:()=>GA,ZodUUID:()=>cY,ZodURL:()=>HV,ZodULID:()=>ax,ZodType:()=>N0,ZodTuple:()=>PA,ZodTransform:()=>_A,ZodTemplateLiteral:()=>lA,ZodSymbol:()=>HA,ZodSuccess:()=>cA,ZodStringFormat:()=>G6,ZodString:()=>pK,ZodSet:()=>vA,ZodRecord:()=>hK,ZodRealError:()=>O9,ZodReadonly:()=>pA,ZodPromise:()=>aA,ZodPreprocess:()=>mA,ZodPrefault:()=>EA,ZodPipe:()=>xV,ZodOptional:()=>GB,ZodObject:()=>wV,ZodNumberFormat:()=>jZ,ZodNumber:()=>lK,ZodNullable:()=>kA,ZodNull:()=>JA,ZodNonOptional:()=>JB,ZodNever:()=>BA,ZodNanoID:()=>lx,ZodNaN:()=>hA,ZodMap:()=>OA,ZodMAC:()=>KA,ZodLiteral:()=>bA,ZodLazy:()=>nA,ZodKSUID:()=>rx,ZodJWT:()=>zB,ZodIssueCode:()=>l$0,ZodIntersection:()=>NA,ZodISOTime:()=>cx,ZodISODuration:()=>yx,ZodISODateTime:()=>Cx,ZodISODate:()=>ux,ZodIPv6:()=>tx,ZodIPv4:()=>sx,ZodGUID:()=>ZV,ZodFunction:()=>oA,ZodFirstPartyTypeKind:()=>tA,ZodFile:()=>AA,ZodExactOptional:()=>RA,ZodError:()=>p$0,ZodEnum:()=>mK,ZodEmoji:()=>ix,ZodEmail:()=>px,ZodE164:()=>XB,ZodDiscriminatedUnion:()=>LA,ZodDefault:()=>SA,ZodDate:()=>GV,ZodCustomStringFormat:()=>iK,ZodCustom:()=>qV,ZodCodec:()=>BV,ZodCatch:()=>yA,ZodCUID2:()=>dx,ZodCUID:()=>nx,ZodCIDRv6:()=>$B,ZodCIDRv4:()=>ex,ZodBoolean:()=>nK,ZodBigIntFormat:()=>ZB,ZodBigInt:()=>dK,ZodBase64URL:()=>QB,ZodBase64:()=>YB,ZodArray:()=>DA,ZodAny:()=>UA,TimePrecision:()=>Iv,NEVER:()=>QM,$output:()=>Dv,$input:()=>Fv,$brand:()=>XM});var _Q={};s7(_Q,{version:()=>J3,util:()=>D1,treeifyError:()=>xM,toJSONSchema:()=>fx,toDotPath:()=>wd,safeParseAsync:()=>DM,safeParse:()=>qM,safeEncodeAsync:()=>l60,safeEncode:()=>p60,safeDecodeAsync:()=>n60,safeDecode:()=>i60,registry:()=>Zx,regexes:()=>t9,process:()=>K6,prettifyError:()=>BM,parseAsync:()=>uU,parse:()=>CU,meta:()=>Xb,locales:()=>$V,isValidJWT:()=>fd,isValidBase64URL:()=>Sd,isValidBase64:()=>S3,initializeContext:()=>cX,globalRegistry:()=>V$,globalConfig:()=>wZ,formatError:()=>p2,flattenError:()=>m2,finalize:()=>gX,extractDefs:()=>yX,encodeAsync:()=>h60,encode:()=>y60,describe:()=>Qb,decodeAsync:()=>m60,decode:()=>g60,createToJSONSchemaMethod:()=>Zb,createStandardJSONSchemaMethod:()=>yK,config:()=>K8,clone:()=>a$,_xor:()=>L$0,_xid:()=>qx,_void:()=>dv,_uuidv7:()=>Gx,_uuidv6:()=>Hx,_uuidv4:()=>Vx,_uuid:()=>Wx,_url:()=>QV,_uppercase:()=>AK,_unknown:()=>lv,_union:()=>F$0,_undefined:()=>mv,_ulid:()=>Bx,_uint64:()=>gv,_uint32:()=>fv,_tuple:()=>P$0,_trim:()=>fK,_transform:()=>_$0,_toUpperCase:()=>CK,_toLowerCase:()=>EK,_templateLiteral:()=>c$0,_symbol:()=>hv,_superRefine:()=>Yb,_success:()=>f$0,_stringbool:()=>zb,_stringFormat:()=>cK,_string:()=>Nv,_startsWith:()=>RK,_slugify:()=>uK,_size:()=>DZ,_set:()=>O$0,_safeParseAsync:()=>IK,_safeParse:()=>PK,_safeEncodeAsync:()=>iU,_safeEncode:()=>mU,_safeDecodeAsync:()=>lU,_safeDecode:()=>pU,_regex:()=>vK,_refine:()=>$b,_record:()=>I$0,_readonly:()=>u$0,_property:()=>Rx,_promise:()=>g$0,_positive:()=>vx,_pipe:()=>C$0,_parseAsync:()=>jK,_parse:()=>NK,_overwrite:()=>t7,_optional:()=>R$0,_number:()=>Av,_nullable:()=>T$0,_null:()=>pv,_normalize:()=>SK,_nonpositive:()=>Ax,_nonoptional:()=>S$0,_nonnegative:()=>_x,_never:()=>nv,_negative:()=>bx,_nativeEnum:()=>b$0,_nanoid:()=>wx,_nan:()=>rv,_multipleOf:()=>CX,_minSize:()=>uY,_minLength:()=>AQ,_min:()=>r$,_mime:()=>kK,_maxSize:()=>uX,_maxLength:()=>FZ,_max:()=>e9,_map:()=>M$0,_mac:()=>Pv,_lte:()=>e9,_lt:()=>EY,_lowercase:()=>bK,_literal:()=>A$0,_length:()=>LZ,_lazy:()=>y$0,_ksuid:()=>Dx,_jwt:()=>Ox,_isoTime:()=>vv,_isoDuration:()=>bv,_isoDateTime:()=>Mv,_isoDate:()=>Ov,_ipv6:()=>Lx,_ipv4:()=>Fx,_intersection:()=>j$0,_int64:()=>yv,_int32:()=>Sv,_int:()=>Rv,_includes:()=>_K,_guid:()=>YV,_gte:()=>r$,_gt:()=>CY,_float64:()=>kv,_float32:()=>Tv,_file:()=>tv,_enum:()=>v$0,_endsWith:()=>TK,_encodeAsync:()=>gU,_encode:()=>cU,_emoji:()=>Jx,_email:()=>Kx,_e164:()=>Mx,_discriminatedUnion:()=>N$0,_default:()=>k$0,_decodeAsync:()=>hU,_decode:()=>yU,_date:()=>av,_custom:()=>ev,_cuid2:()=>xx,_cuid:()=>Ux,_coercedString:()=>jv,_coercedNumber:()=>_v,_coercedDate:()=>ov,_coercedBoolean:()=>Cv,_coercedBigint:()=>cv,_cidrv6:()=>jx,_cidrv4:()=>Nx,_check:()=>pd,_catch:()=>E$0,_boolean:()=>Ev,_bigint:()=>uv,_base64url:()=>Ix,_base64:()=>Px,_array:()=>sv,_any:()=>iv,TimePrecision:()=>Iv,NEVER:()=>QM,JSONSchemaGenerator:()=>pb,JSONSchema:()=>id,Doc:()=>oU,$output:()=>Dv,$input:()=>Fv,$constructor:()=>y,$brand:()=>XM,$ZodXor:()=>s3,$ZodXID:()=>P3,$ZodVoid:()=>d3,$ZodUnknown:()=>l3,$ZodUnion:()=>a2,$ZodUndefined:()=>m3,$ZodUUID:()=>x3,$ZodURL:()=>q3,$ZodULID:()=>j3,$ZodType:()=>w0,$ZodTuple:()=>Qx,$ZodTransform:()=>KO,$ZodTemplateLiteral:()=>DO,$ZodSymbol:()=>h3,$ZodSuccess:()=>wO,$ZodStringFormat:()=>H6,$ZodString:()=>qZ,$ZodSet:()=>QO,$ZodRegistry:()=>Lv,$ZodRecord:()=>$O,$ZodRealError:()=>M9,$ZodReadonly:()=>qO,$ZodPromise:()=>LO,$ZodPreprocess:()=>BO,$ZodPrefault:()=>GO,$ZodPipe:()=>zx,$ZodOptional:()=>Xx,$ZodObjectJIT:()=>r3,$ZodObject:()=>ud,$ZodNumberFormat:()=>y3,$ZodNumber:()=>$x,$ZodNullable:()=>VO,$ZodNull:()=>p3,$ZodNonOptional:()=>JO,$ZodNever:()=>n3,$ZodNanoID:()=>F3,$ZodNaN:()=>xO,$ZodMap:()=>YO,$ZodMAC:()=>R3,$ZodLiteral:()=>zO,$ZodLazy:()=>NO,$ZodKSUID:()=>I3,$ZodJWT:()=>u3,$ZodIntersection:()=>e3,$ZodISOTime:()=>v3,$ZodISODuration:()=>b3,$ZodISODateTime:()=>M3,$ZodISODate:()=>O3,$ZodIPv6:()=>_3,$ZodIPv4:()=>A3,$ZodGUID:()=>U3,$ZodFunction:()=>FO,$ZodFile:()=>ZO,$ZodExactOptional:()=>WO,$ZodError:()=>h2,$ZodEnum:()=>XO,$ZodEncodeError:()=>UZ,$ZodEmoji:()=>D3,$ZodEmail:()=>B3,$ZodE164:()=>C3,$ZodDiscriminatedUnion:()=>t3,$ZodDefault:()=>HO,$ZodDate:()=>a3,$ZodCustomStringFormat:()=>c3,$ZodCustom:()=>jO,$ZodCodec:()=>o2,$ZodCheckUpperCase:()=>z3,$ZodCheckStringFormat:()=>MK,$ZodCheckStartsWith:()=>K3,$ZodCheckSizeEquals:()=>tM,$ZodCheckRegex:()=>Q3,$ZodCheckProperty:()=>V3,$ZodCheckOverwrite:()=>G3,$ZodCheckNumberFormat:()=>aM,$ZodCheckMultipleOf:()=>dM,$ZodCheckMinSize:()=>sM,$ZodCheckMinLength:()=>$3,$ZodCheckMimeType:()=>H3,$ZodCheckMaxSize:()=>rM,$ZodCheckMaxLength:()=>eM,$ZodCheckLowerCase:()=>X3,$ZodCheckLessThan:()=>dU,$ZodCheckLengthEquals:()=>Y3,$ZodCheckIncludes:()=>Z3,$ZodCheckGreaterThan:()=>aU,$ZodCheckEndsWith:()=>W3,$ZodCheckBigIntFormat:()=>oM,$ZodCheck:()=>q6,$ZodCatch:()=>UO,$ZodCUID2:()=>N3,$ZodCUID:()=>L3,$ZodCIDRv6:()=>k3,$ZodCIDRv4:()=>T3,$ZodBoolean:()=>d2,$ZodBigIntFormat:()=>g3,$ZodBigInt:()=>Yx,$ZodBase64URL:()=>E3,$ZodBase64:()=>f3,$ZodAsyncError:()=>fY,$ZodArray:()=>o3,$ZodAny:()=>i3});var Kd,QM=Object.freeze({status:"aborted"});function y($,Y,Q){function X(W,V){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:V,constr:K,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),Y(W,V);let H=K.prototype,G=Object.keys(H);for(let J=0;J<G.length;J++){let w=G[J];if(!(w in W))W[w]=H[w].bind(W)}}let z=Q?.Parent??Object;class Z extends z{}Object.defineProperty(Z,"name",{value:$});function K(W){var V;let H=Q?.Parent?new Z:this;X(H,W),(V=H._zod).deferred??(V.deferred=[]);for(let G of H._zod.deferred)G();return H}return Object.defineProperty(K,"init",{value:X}),Object.defineProperty(K,Symbol.hasInstance,{value:(W)=>{if(Q?.Parent&&W instanceof Q.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(K,"name",{value:$}),K}var XM=Symbol("zod_brand");class fY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class UZ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var wZ=globalThis.__zod_globalConfig;function K8($){if($)Object.assign(wZ,$);return wZ}var D1={};s7(D1,{unwrapMessage:()=>E2,uint8ArrayToHex:()=>u60,uint8ArrayToBase64url:()=>E60,uint8ArrayToBase64:()=>Hd,stringifyPrimitive:()=>U1,slugify:()=>KM,shallowClone:()=>VM,safeExtend:()=>_60,required:()=>k60,randomString:()=>P60,propertyKeyTypes:()=>c2,promiseAllObject:()=>j60,primitiveTypes:()=>HM,prefixIssues:()=>I9,pick:()=>v60,partial:()=>T60,parsedType:()=>q1,optionalKeys:()=>GM,omit:()=>b60,objectClone:()=>F60,numKeys:()=>I60,nullish:()=>kX,normalizeParams:()=>j1,mergeDefs:()=>bQ,merge:()=>R60,jsonStringifyReplacer:()=>DK,joinValues:()=>n,issue:()=>LK,isPlainObject:()=>fX,isObject:()=>xZ,hexToUint8Array:()=>C60,getSizableOrigin:()=>y2,getParsedType:()=>M60,getLengthableOrigin:()=>g2,getEnumValues:()=>C2,getElementAtPath:()=>N60,floatSafeRemainder:()=>ZM,finalizeIssue:()=>o$,extend:()=>A60,explicitlyAborted:()=>UM,escapeRegex:()=>B7,esc:()=>fU,defineLazy:()=>A0,createTransparentProxy:()=>O60,cloneDef:()=>L60,clone:()=>a$,cleanRegex:()=>u2,cleanEnum:()=>S60,captureStackTrace:()=>EU,cached:()=>FK,base64urlToUint8Array:()=>f60,base64ToUint8Array:()=>Vd,assignProp:()=>SX,assertNotEqual:()=>x60,assertNever:()=>q60,assertIs:()=>B60,assertEqual:()=>U60,assert:()=>D60,allowsEval:()=>WM,aborted:()=>EX,NUMBER_FORMAT_RANGES:()=>JM,Class:()=>Gd,BIGINT_FORMAT_RANGES:()=>wM});function U60($){return $}function x60($){return $}function B60($){}function q60($){throw Error("Unexpected value in exhaustive check")}function D60($){}function C2($){let Y=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,z])=>Y.indexOf(+X)===-1).map(([X,z])=>z)}function n($,Y="|"){return $.map((Q)=>U1(Q)).join(Y)}function DK($,Y){if(typeof Y==="bigint")return Y.toString();return Y}function FK($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw Error("cached value already set")}}}function kX($){return $===null||$===void 0}function u2($){let Y=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(Y,Q)}function ZM($,Y){let Q=$/Y,X=Math.round(Q),z=Number.EPSILON*Math.max(Math.abs(Q),1);if(Math.abs(Q-X)<z)return 0;return Q-X}var Wd=Symbol("evaluating");function A0($,Y,Q){let X=void 0;Object.defineProperty($,Y,{get(){if(X===Wd)return;if(X===void 0)X=Wd,X=Q();return X},set(z){Object.defineProperty($,Y,{value:z})},configurable:!0})}function F60($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function SX($,Y,Q){Object.defineProperty($,Y,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function bQ(...$){let Y={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(Y,X)}return Object.defineProperties({},Y)}function L60($){return bQ($._zod.def)}function N60($,Y){if(!Y)return $;return Y.reduce((Q,X)=>Q?.[X],$)}function j60($){let Y=Object.keys($),Q=Y.map((X)=>$[X]);return Promise.all(Q).then((X)=>{let z={};for(let Z=0;Z<Y.length;Z++)z[Y[Z]]=X[Z];return z})}function P60($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function fU($){return JSON.stringify($)}function KM($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var EU="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function xZ($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var WM=FK(()=>{if(wZ.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function fX($){if(xZ($)===!1)return!1;let Y=$.constructor;if(Y===void 0)return!0;if(typeof Y!=="function")return!0;let Q=Y.prototype;if(xZ(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function VM($){if(fX($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function I60($){let Y=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))Y++;return Y}var M60=($)=>{let Y=typeof $;switch(Y){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Y}`)}},c2=new Set(["string","number","symbol"]),HM=new Set(["string","number","bigint","boolean","symbol","undefined"]);function B7($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a$($,Y,Q){let X=new $._zod.constr(Y??$._zod.def);if(!Y||Q?.parent)X._zod.parent=$;return X}function j1($){let Y=$;if(!Y)return{};if(typeof Y==="string")return{error:()=>Y};if(Y?.message!==void 0){if(Y?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Y.error=Y.message}if(delete Y.message,typeof Y.error==="string")return{...Y,error:()=>Y.error};return Y}function O60($){let Y;return new Proxy({},{get(Q,X,z){return Y??(Y=$()),Reflect.get(Y,X,z)},set(Q,X,z,Z){return Y??(Y=$()),Reflect.set(Y,X,z,Z)},has(Q,X){return Y??(Y=$()),Reflect.has(Y,X)},deleteProperty(Q,X){return Y??(Y=$()),Reflect.deleteProperty(Y,X)},ownKeys(Q){return Y??(Y=$()),Reflect.ownKeys(Y)},getOwnPropertyDescriptor(Q,X){return Y??(Y=$()),Reflect.getOwnPropertyDescriptor(Y,X)},defineProperty(Q,X,z){return Y??(Y=$()),Reflect.defineProperty(Y,X,z)}})}function U1($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function GM($){return Object.keys($).filter((Y)=>{return $[Y]._zod.optin==="optional"&&$[Y]._zod.optout==="optional"})}var JM={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wM={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function v60($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let Z=bQ($._zod.def,{get shape(){let K={};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;K[W]=Q.shape[W]}return SX(this,"shape",K),K},checks:[]});return a$($,Z)}function b60($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let Z=bQ($._zod.def,{get shape(){let K={...$._zod.def.shape};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;delete K[W]}return SX(this,"shape",K),K},checks:[]});return a$($,Z)}function A60($,Y){if(!fX(Y))throw Error("Invalid input to extend: expected a plain object");let Q=$._zod.def.checks;if(Q&&Q.length>0){let Z=$._zod.def.shape;for(let K in Y)if(Object.getOwnPropertyDescriptor(Z,K)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=bQ($._zod.def,{get shape(){let Z={...$._zod.def.shape,...Y};return SX(this,"shape",Z),Z}});return a$($,z)}function _60($,Y){if(!fX(Y))throw Error("Invalid input to safeExtend: expected a plain object");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y};return SX(this,"shape",X),X}});return a$($,Q)}function R60($,Y){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y._zod.def.shape};return SX(this,"shape",X),X},get catchall(){return Y._zod.def.catchall},checks:Y._zod.def.checks??[]});return a$($,Q)}function T60($,Y,Q){let z=Y._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let K=bQ(Y._zod.def,{get shape(){let W=Y._zod.def.shape,V={...W};if(Q)for(let H in Q){if(!(H in W))throw Error(`Unrecognized key: "${H}"`);if(!Q[H])continue;V[H]=$?new $({type:"optional",innerType:W[H]}):W[H]}else for(let H in W)V[H]=$?new $({type:"optional",innerType:W[H]}):W[H];return SX(this,"shape",V),V},checks:[]});return a$(Y,K)}function k60($,Y,Q){let X=bQ(Y._zod.def,{get shape(){let z=Y._zod.def.shape,Z={...z};if(Q)for(let K in Q){if(!(K in Z))throw Error(`Unrecognized key: "${K}"`);if(!Q[K])continue;Z[K]=new $({type:"nonoptional",innerType:z[K]})}else for(let K in z)Z[K]=new $({type:"nonoptional",innerType:z[K]});return SX(this,"shape",Z),Z}});return a$(Y,X)}function EX($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue!==!0)return!0;return!1}function UM($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue===!1)return!0;return!1}function I9($,Y){return Y.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function E2($){return typeof $==="string"?$:$?.message}function o$($,Y,Q){let X=$.message?$.message:E2($.inst?._zod.def?.error?.($))??E2(Y?.error?.($))??E2(Q.customError?.($))??E2(Q.localeError?.($))??"Invalid input",{inst:z,continue:Z,input:K,...W}=$;if(W.path??(W.path=[]),W.message=X,Y?.reportInput)W.input=K;return W}function y2($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function g2($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function q1($){let Y=typeof $;switch(Y){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let Q=$;if(Q&&Object.getPrototypeOf(Q)!==Object.prototype&&"constructor"in Q&&Q.constructor)return Q.constructor.name}}return Y}function LK(...$){let[Y,Q,X]=$;if(typeof Y==="string")return{message:Y,code:"custom",input:Q,inst:X};return{...Y}}function S60($){return Object.entries($).filter(([Y,Q])=>{return Number.isNaN(Number.parseInt(Y,10))}).map((Y)=>Y[1])}function Vd($){let Y=atob($),Q=new Uint8Array(Y.length);for(let X=0;X<Y.length;X++)Q[X]=Y.charCodeAt(X);return Q}function Hd($){let Y="";for(let Q=0;Q<$.length;Q++)Y+=String.fromCharCode($[Q]);return btoa(Y)}function f60($){let Y=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-Y.length%4)%4);return Vd(Y+Q)}function E60($){return Hd($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function C60($){let Y=$.replace(/^0x/,"");if(Y.length%2!==0)throw Error("Invalid hex string length");let Q=new Uint8Array(Y.length/2);for(let X=0;X<Y.length;X+=2)Q[X/2]=Number.parseInt(Y.slice(X,X+2),16);return Q}function u60($){return Array.from($).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}class Gd{constructor(...$){}}var Jd=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,DK,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},h2=y("$ZodError",Jd),M9=y("$ZodError",Jd,{Parent:Error});function m2($,Y=(Q)=>Q.message){let Q={},X=[];for(let z of $.issues)if(z.path.length>0)Q[z.path[0]]=Q[z.path[0]]||[],Q[z.path[0]].push(Y(z));else X.push(Y(z));return{formErrors:X,fieldErrors:Q}}function p2($,Y=(Q)=>Q.message){let Q={_errors:[]},X=(z,Z=[])=>{for(let K of z.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map((W)=>X({issues:W},[...Z,...K.path]));else if(K.code==="invalid_key")X({issues:K.issues},[...Z,...K.path]);else if(K.code==="invalid_element")X({issues:K.issues},[...Z,...K.path]);else{let W=[...Z,...K.path];if(W.length===0)Q._errors.push(Y(K));else{let V=Q,H=0;while(H<W.length){let G=W[H];if(H!==W.length-1)V[G]=V[G]||{_errors:[]};else V[G]=V[G]||{_errors:[]},V[G]._errors.push(Y(K));V=V[G],H++}}}};return X($),Q}function xM($,Y=(Q)=>Q.message){let Q={errors:[]},X=(z,Z=[])=>{var K,W;for(let V of z.issues)if(V.code==="invalid_union"&&V.errors.length)V.errors.map((H)=>X({issues:H},[...Z,...V.path]));else if(V.code==="invalid_key")X({issues:V.issues},[...Z,...V.path]);else if(V.code==="invalid_element")X({issues:V.issues},[...Z,...V.path]);else{let H=[...Z,...V.path];if(H.length===0){Q.errors.push(Y(V));continue}let G=Q,J=0;while(J<H.length){let w=H[J],U=J===H.length-1;if(typeof w==="string")G.properties??(G.properties={}),(K=G.properties)[w]??(K[w]={errors:[]}),G=G.properties[w];else G.items??(G.items=[]),(W=G.items)[w]??(W[w]={errors:[]}),G=G.items[w];if(U)G.errors.push(Y(V));J++}}};return X($),Q}function wd($){let Y=[],Q=$.map((X)=>typeof X==="object"?X.key:X);for(let X of Q)if(typeof X==="number")Y.push(`[${X}]`);else if(typeof X==="symbol")Y.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))Y.push(`[${JSON.stringify(X)}]`);else{if(Y.length)Y.push(".");Y.push(X)}return Y.join("")}function BM($){let Y=[],Q=[...$.issues].sort((X,z)=>(X.path??[]).length-(z.path??[]).length);for(let X of Q)if(Y.push(`\u2716 ${X.message}`),X.path?.length)Y.push(` \u2192 at ${wd(X.path)}`);return Y.join(`
|
|
485
485
|
`)}var NK=($)=>(Y,Q,X,z)=>{let Z=X?{...X,async:!1}:{async:!1},K=Y._zod.run({value:Q,issues:[]},Z);if(K instanceof Promise)throw new fY;if(K.issues.length){let W=new(z?.Err??$)(K.issues.map((V)=>o$(V,Z,K8())));throw EU(W,z?.callee),W}return K.value},CU=NK(M9),jK=($)=>async(Y,Q,X,z)=>{let Z=X?{...X,async:!0}:{async:!0},K=Y._zod.run({value:Q,issues:[]},Z);if(K instanceof Promise)K=await K;if(K.issues.length){let W=new(z?.Err??$)(K.issues.map((V)=>o$(V,Z,K8())));throw EU(W,z?.callee),W}return K.value},uU=jK(M9),PK=($)=>(Y,Q,X)=>{let z=X?{...X,async:!1}:{async:!1},Z=Y._zod.run({value:Q,issues:[]},z);if(Z instanceof Promise)throw new fY;return Z.issues.length?{success:!1,error:new($??h2)(Z.issues.map((K)=>o$(K,z,K8())))}:{success:!0,data:Z.value}},qM=PK(M9),IK=($)=>async(Y,Q,X)=>{let z=X?{...X,async:!0}:{async:!0},Z=Y._zod.run({value:Q,issues:[]},z);if(Z instanceof Promise)Z=await Z;return Z.issues.length?{success:!1,error:new $(Z.issues.map((K)=>o$(K,z,K8())))}:{success:!0,data:Z.value}},DM=IK(M9),cU=($)=>(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return NK($)(Y,Q,z)},y60=cU(M9),yU=($)=>(Y,Q,X)=>{return NK($)(Y,Q,X)},g60=yU(M9),gU=($)=>async(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return jK($)(Y,Q,z)},h60=gU(M9),hU=($)=>async(Y,Q,X)=>{return jK($)(Y,Q,X)},m60=hU(M9),mU=($)=>(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return PK($)(Y,Q,z)},p60=mU(M9),pU=($)=>(Y,Q,X)=>{return PK($)(Y,Q,X)},i60=pU(M9),iU=($)=>async(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return IK($)(Y,Q,z)},l60=iU(M9),lU=($)=>async(Y,Q,X)=>{return IK($)(Y,Q,X)},n60=lU(M9);var t9={};s7(t9,{xid:()=>jM,uuid7:()=>r60,uuid6:()=>o60,uuid4:()=>a60,uuid:()=>BZ,uppercase:()=>nM,unicodeEmail:()=>Ud,undefined:()=>iM,ulid:()=>NM,time:()=>uM,string:()=>yM,sha512_hex:()=>D80,sha512_base64url:()=>L80,sha512_base64:()=>F80,sha384_hex:()=>x80,sha384_base64url:()=>q80,sha384_base64:()=>B80,sha256_hex:()=>J80,sha256_base64url:()=>U80,sha256_base64:()=>w80,sha1_hex:()=>V80,sha1_base64url:()=>G80,sha1_base64:()=>H80,rfc5322Email:()=>t60,number:()=>i2,null:()=>pM,nanoid:()=>IM,md5_hex:()=>Z80,md5_base64url:()=>W80,md5_base64:()=>K80,mac:()=>RM,lowercase:()=>lM,ksuid:()=>PM,ipv6:()=>_M,ipv4:()=>AM,integer:()=>hM,idnEmail:()=>e60,httpProtocol:()=>fM,html5Email:()=>s60,hostname:()=>Q80,hex:()=>z80,guid:()=>OM,extendedDuration:()=>d60,emoji:()=>bM,email:()=>vM,e164:()=>EM,duration:()=>MM,domain:()=>X80,datetime:()=>cM,date:()=>CM,cuid2:()=>LM,cuid:()=>FM,cidrv6:()=>kM,cidrv4:()=>TM,browserEmail:()=>$80,boolean:()=>mM,bigint:()=>gM,base64url:()=>nU,base64:()=>SM});var FM=/^[cC][0-9a-z]{6,}$/,LM=/^[0-9a-z]+$/,NM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jM=/^[0-9a-vA-V]{20}$/,PM=/^[A-Za-z0-9]{27}$/,IM=/^[a-zA-Z0-9_-]{21}$/,MM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,d60=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OM=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,BZ=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},a60=BZ(4),o60=BZ(6),r60=BZ(7),vM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,s60=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,t60=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ud=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,e60=Ud,$80=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Y80="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bM(){return new RegExp(Y80,"u")}var AM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_M=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,RM=($)=>{let Y=B7($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},TM=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,kM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,SM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nU=/^[A-Za-z0-9_-]*$/,Q80=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,X80=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,fM=/^https?$/,EM=/^\+[1-9]\d{6,14}$/,xd="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",CM=new RegExp(`^${xd}$`);function Bd($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function uM($){return new RegExp(`^${Bd($)}$`)}function cM($){let Y=Bd({precision:$.precision}),Q=["Z"];if($.local)Q.push("");if($.offset)Q.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let X=`${Y}(?:${Q.join("|")})`;return new RegExp(`^${xd}T(?:${X})$`)}var yM=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},gM=/^-?\d+n?$/,hM=/^-?\d+$/,i2=/^-?\d+(?:\.\d+)?$/,mM=/^(?:true|false)$/i,pM=/^null$/i;var iM=/^undefined$/i;var lM=/^[^A-Z]*$/,nM=/^[^a-z]*$/,z80=/^[0-9a-fA-F]*$/;function l2($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function n2($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Z80=/^[0-9a-fA-F]{32}$/,K80=l2(22,"=="),W80=n2(22),V80=/^[0-9a-fA-F]{40}$/,H80=l2(27,"="),G80=n2(27),J80=/^[0-9a-fA-F]{64}$/,w80=l2(43,"="),U80=n2(43),x80=/^[0-9a-fA-F]{96}$/,B80=l2(64,""),q80=n2(64),D80=/^[0-9a-fA-F]{128}$/,F80=l2(86,"=="),L80=n2(86);var q6=y("$ZodCheck",($,Y)=>{var Q;$._zod??($._zod={}),$._zod.def=Y,(Q=$._zod).onattach??(Q.onattach=[])}),Dd={number:"number",bigint:"bigint",object:"date"},dU=y("$ZodCheckLessThan",($,Y)=>{q6.init($,Y);let Q=Dd[typeof Y.value];$._zod.onattach.push((X)=>{let z=X._zod.bag,Z=(Y.inclusive?z.maximum:z.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(Y.value<Z)if(Y.inclusive)z.maximum=Y.value;else z.exclusiveMaximum=Y.value}),$._zod.check=(X)=>{if(Y.inclusive?X.value<=Y.value:X.value<Y.value)return;X.issues.push({origin:Q,code:"too_big",maximum:typeof Y.value==="object"?Y.value.getTime():Y.value,input:X.value,inclusive:Y.inclusive,inst:$,continue:!Y.abort})}}),aU=y("$ZodCheckGreaterThan",($,Y)=>{q6.init($,Y);let Q=Dd[typeof Y.value];$._zod.onattach.push((X)=>{let z=X._zod.bag,Z=(Y.inclusive?z.minimum:z.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(Y.value>Z)if(Y.inclusive)z.minimum=Y.value;else z.exclusiveMinimum=Y.value}),$._zod.check=(X)=>{if(Y.inclusive?X.value>=Y.value:X.value>Y.value)return;X.issues.push({origin:Q,code:"too_small",minimum:typeof Y.value==="object"?Y.value.getTime():Y.value,input:X.value,inclusive:Y.inclusive,inst:$,continue:!Y.abort})}}),dM=y("$ZodCheckMultipleOf",($,Y)=>{q6.init($,Y),$._zod.onattach.push((Q)=>{var X;(X=Q._zod.bag).multipleOf??(X.multipleOf=Y.value)}),$._zod.check=(Q)=>{if(typeof Q.value!==typeof Y.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof Q.value==="bigint"?Q.value%Y.value===BigInt(0):ZM(Q.value,Y.value)===0)return;Q.issues.push({origin:typeof Q.value,code:"not_multiple_of",divisor:Y.value,input:Q.value,inst:$,continue:!Y.abort})}}),aM=y("$ZodCheckNumberFormat",($,Y)=>{q6.init($,Y),Y.format=Y.format||"float64";let Q=Y.format?.includes("int"),X=Q?"int":"number",[z,Z]=JM[Y.format];$._zod.onattach.push((K)=>{let W=K._zod.bag;if(W.format=Y.format,W.minimum=z,W.maximum=Z,Q)W.pattern=hM}),$._zod.check=(K)=>{let W=K.value;if(Q){if(!Number.isInteger(W)){K.issues.push({expected:X,format:Y.format,code:"invalid_type",continue:!1,input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)K.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!Y.abort});else K.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!Y.abort});return}}if(W<z)K.issues.push({origin:"number",input:W,code:"too_small",minimum:z,inclusive:!0,inst:$,continue:!Y.abort});if(W>Z)K.issues.push({origin:"number",input:W,code:"too_big",maximum:Z,inclusive:!0,inst:$,continue:!Y.abort})}}),oM=y("$ZodCheckBigIntFormat",($,Y)=>{q6.init($,Y);let[Q,X]=wM[Y.format];$._zod.onattach.push((z)=>{let Z=z._zod.bag;Z.format=Y.format,Z.minimum=Q,Z.maximum=X}),$._zod.check=(z)=>{let Z=z.value;if(Z<Q)z.issues.push({origin:"bigint",input:Z,code:"too_small",minimum:Q,inclusive:!0,inst:$,continue:!Y.abort});if(Z>X)z.issues.push({origin:"bigint",input:Z,code:"too_big",maximum:X,inclusive:!0,inst:$,continue:!Y.abort})}}),rM=y("$ZodCheckMaxSize",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(z)&&z.size!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Y.maximum<z)X._zod.bag.maximum=Y.maximum}),$._zod.check=(X)=>{let z=X.value;if(z.size<=Y.maximum)return;X.issues.push({origin:y2(z),code:"too_big",maximum:Y.maximum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),sM=y("$ZodCheckMinSize",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(z)&&z.size!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Y.minimum>z)X._zod.bag.minimum=Y.minimum}),$._zod.check=(X)=>{let z=X.value;if(z.size>=Y.minimum)return;X.issues.push({origin:y2(z),code:"too_small",minimum:Y.minimum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),tM=y("$ZodCheckSizeEquals",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(z)&&z.size!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.minimum=Y.size,z.maximum=Y.size,z.size=Y.size}),$._zod.check=(X)=>{let z=X.value,Z=z.size;if(Z===Y.size)return;let K=Z>Y.size;X.issues.push({origin:y2(z),...K?{code:"too_big",maximum:Y.size}:{code:"too_small",minimum:Y.size},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!Y.abort})}}),eM=y("$ZodCheckMaxLength",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(z)&&z.length!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Y.maximum<z)X._zod.bag.maximum=Y.maximum}),$._zod.check=(X)=>{let z=X.value;if(z.length<=Y.maximum)return;let K=g2(z);X.issues.push({origin:K,code:"too_big",maximum:Y.maximum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),$3=y("$ZodCheckMinLength",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(z)&&z.length!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Y.minimum>z)X._zod.bag.minimum=Y.minimum}),$._zod.check=(X)=>{let z=X.value;if(z.length>=Y.minimum)return;let K=g2(z);X.issues.push({origin:K,code:"too_small",minimum:Y.minimum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),Y3=y("$ZodCheckLengthEquals",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(z)&&z.length!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.minimum=Y.length,z.maximum=Y.length,z.length=Y.length}),$._zod.check=(X)=>{let z=X.value,Z=z.length;if(Z===Y.length)return;let K=g2(z),W=Z>Y.length;X.issues.push({origin:K,...W?{code:"too_big",maximum:Y.length}:{code:"too_small",minimum:Y.length},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!Y.abort})}}),MK=y("$ZodCheckStringFormat",($,Y)=>{var Q,X;if(q6.init($,Y),$._zod.onattach.push((z)=>{let Z=z._zod.bag;if(Z.format=Y.format,Y.pattern)Z.patterns??(Z.patterns=new Set),Z.patterns.add(Y.pattern)}),Y.pattern)(Q=$._zod).check??(Q.check=(z)=>{if(Y.pattern.lastIndex=0,Y.pattern.test(z.value))return;z.issues.push({origin:"string",code:"invalid_format",format:Y.format,input:z.value,...Y.pattern?{pattern:Y.pattern.toString()}:{},inst:$,continue:!Y.abort})});else(X=$._zod).check??(X.check=()=>{})}),Q3=y("$ZodCheckRegex",($,Y)=>{MK.init($,Y),$._zod.check=(Q)=>{if(Y.pattern.lastIndex=0,Y.pattern.test(Q.value))return;Q.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Q.value,pattern:Y.pattern.toString(),inst:$,continue:!Y.abort})}}),X3=y("$ZodCheckLowerCase",($,Y)=>{Y.pattern??(Y.pattern=lM),MK.init($,Y)}),z3=y("$ZodCheckUpperCase",($,Y)=>{Y.pattern??(Y.pattern=nM),MK.init($,Y)}),Z3=y("$ZodCheckIncludes",($,Y)=>{q6.init($,Y);let Q=B7(Y.includes),X=new RegExp(typeof Y.position==="number"?`^.{${Y.position}}${Q}`:Q);Y.pattern=X,$._zod.onattach.push((z)=>{let Z=z._zod.bag;Z.patterns??(Z.patterns=new Set),Z.patterns.add(X)}),$._zod.check=(z)=>{if(z.value.includes(Y.includes,Y.position))return;z.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:Y.includes,input:z.value,inst:$,continue:!Y.abort})}}),K3=y("$ZodCheckStartsWith",($,Y)=>{q6.init($,Y);let Q=new RegExp(`^${B7(Y.prefix)}.*`);Y.pattern??(Y.pattern=Q),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(Q)}),$._zod.check=(X)=>{if(X.value.startsWith(Y.prefix))return;X.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:Y.prefix,input:X.value,inst:$,continue:!Y.abort})}}),W3=y("$ZodCheckEndsWith",($,Y)=>{q6.init($,Y);let Q=new RegExp(`.*${B7(Y.suffix)}$`);Y.pattern??(Y.pattern=Q),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(Q)}),$._zod.check=(X)=>{if(X.value.endsWith(Y.suffix))return;X.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:Y.suffix,input:X.value,inst:$,continue:!Y.abort})}});function qd($,Y,Q){if($.issues.length)Y.issues.push(...I9(Q,$.issues))}var V3=y("$ZodCheckProperty",($,Y)=>{q6.init($,Y),$._zod.check=(Q)=>{let X=Y.schema._zod.run({value:Q.value[Y.property],issues:[]},{});if(X instanceof Promise)return X.then((z)=>qd(z,Q,Y.property));qd(X,Q,Y.property);return}}),H3=y("$ZodCheckMimeType",($,Y)=>{q6.init($,Y);let Q=new Set(Y.mime);$._zod.onattach.push((X)=>{X._zod.bag.mime=Y.mime}),$._zod.check=(X)=>{if(Q.has(X.value.type))return;X.issues.push({code:"invalid_value",values:Y.mime,input:X.value.type,inst:$,continue:!Y.abort})}}),G3=y("$ZodCheckOverwrite",($,Y)=>{q6.init($,Y),$._zod.check=(Q)=>{Q.value=Y.tx(Q.value)}});class oU{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let Q=$.split(`
|
|
486
486
|
`).filter((Z)=>Z),X=Math.min(...Q.map((Z)=>Z.length-Z.trimStart().length)),z=Q.map((Z)=>Z.slice(X)).map((Z)=>" ".repeat(this.indent*2)+Z);for(let Z of z)this.content.push(Z)}compile(){let $=Function,Y=this?.args,X=[...(this?.content??[""]).map((z)=>` ${z}`)];return new $(...Y,X.join(`
|
|
487
487
|
`))}}var J3={major:4,minor:4,patch:3};var w0=y("$ZodType",($,Y)=>{var Q;$??($={}),$._zod.def=Y,$._zod.bag=$._zod.bag||{},$._zod.version=J3;let X=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))X.unshift($);for(let z of X)for(let Z of z._zod.onattach)Z($);if(X.length===0)(Q=$._zod).deferred??(Q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let z=(K,W,V)=>{let H=EX(K),G;for(let J of W){if(J._zod.def.when){if(UM(K))continue;if(!J._zod.def.when(K))continue}else if(H)continue;let w=K.issues.length,U=J._zod.check(K);if(U instanceof Promise&&V?.async===!1)throw new fY;if(G||U instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await U,K.issues.length===w)return;if(!H)H=EX(K,w)});else{if(K.issues.length===w)continue;if(!H)H=EX(K,w)}}if(G)return G.then(()=>{return K});return K},Z=(K,W,V)=>{if(EX(K))return K.aborted=!0,K;let H=z(W,X,V);if(H instanceof Promise){if(V.async===!1)throw new fY;return H.then((G)=>$._zod.parse(G,V))}return $._zod.parse(H,V)};$._zod.run=(K,W)=>{if(W.skipChecks)return $._zod.parse(K,W);if(W.direction==="backward"){let H=$._zod.parse({value:K.value,issues:[]},{...W,skipChecks:!0});if(H instanceof Promise)return H.then((G)=>{return Z(G,K,W)});return Z(H,K,W)}let V=$._zod.parse(K,W);if(V instanceof Promise){if(W.async===!1)throw new fY;return V.then((H)=>z(H,X,W))}return z(V,X,W)}}A0($,"~standard",()=>({validate:(z)=>{try{let Z=qM($,z);return Z.success?{value:Z.data}:{issues:Z.error?.issues}}catch(Z){return DM($,z).then((K)=>K.success?{value:K.data}:{issues:K.error?.issues})}},vendor:"zod",version:1}))}),qZ=y("$ZodString",($,Y)=>{w0.init($,Y),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??yM($._zod.bag),$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=String(Q.value)}catch(z){}if(typeof Q.value==="string")return Q;return Q.issues.push({expected:"string",code:"invalid_type",input:Q.value,inst:$}),Q}}),H6=y("$ZodStringFormat",($,Y)=>{MK.init($,Y),qZ.init($,Y)}),U3=y("$ZodGUID",($,Y)=>{Y.pattern??(Y.pattern=OM),H6.init($,Y)}),x3=y("$ZodUUID",($,Y)=>{if(Y.version){let X={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[Y.version];if(X===void 0)throw Error(`Invalid UUID version: "${Y.version}"`);Y.pattern??(Y.pattern=BZ(X))}else Y.pattern??(Y.pattern=BZ());H6.init($,Y)}),B3=y("$ZodEmail",($,Y)=>{Y.pattern??(Y.pattern=vM),H6.init($,Y)}),q3=y("$ZodURL",($,Y)=>{H6.init($,Y),$._zod.check=(Q)=>{try{let X=Q.value.trim();if(!Y.normalize&&Y.protocol?.source===fM.source){if(!/^https?:\/\//i.test(X)){Q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:Q.value,inst:$,continue:!Y.abort});return}}let z=new URL(X);if(Y.hostname){if(Y.hostname.lastIndex=0,!Y.hostname.test(z.hostname))Q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Y.hostname.source,input:Q.value,inst:$,continue:!Y.abort})}if(Y.protocol){if(Y.protocol.lastIndex=0,!Y.protocol.test(z.protocol.endsWith(":")?z.protocol.slice(0,-1):z.protocol))Q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:Y.protocol.source,input:Q.value,inst:$,continue:!Y.abort})}if(Y.normalize)Q.value=z.href;else Q.value=X;return}catch(X){Q.issues.push({code:"invalid_format",format:"url",input:Q.value,inst:$,continue:!Y.abort})}}}),D3=y("$ZodEmoji",($,Y)=>{Y.pattern??(Y.pattern=bM()),H6.init($,Y)}),F3=y("$ZodNanoID",($,Y)=>{Y.pattern??(Y.pattern=IM),H6.init($,Y)}),L3=y("$ZodCUID",($,Y)=>{Y.pattern??(Y.pattern=FM),H6.init($,Y)}),N3=y("$ZodCUID2",($,Y)=>{Y.pattern??(Y.pattern=LM),H6.init($,Y)}),j3=y("$ZodULID",($,Y)=>{Y.pattern??(Y.pattern=NM),H6.init($,Y)}),P3=y("$ZodXID",($,Y)=>{Y.pattern??(Y.pattern=jM),H6.init($,Y)}),I3=y("$ZodKSUID",($,Y)=>{Y.pattern??(Y.pattern=PM),H6.init($,Y)}),M3=y("$ZodISODateTime",($,Y)=>{Y.pattern??(Y.pattern=cM(Y)),H6.init($,Y)}),O3=y("$ZodISODate",($,Y)=>{Y.pattern??(Y.pattern=CM),H6.init($,Y)}),v3=y("$ZodISOTime",($,Y)=>{Y.pattern??(Y.pattern=uM(Y)),H6.init($,Y)}),b3=y("$ZodISODuration",($,Y)=>{Y.pattern??(Y.pattern=MM),H6.init($,Y)}),A3=y("$ZodIPv4",($,Y)=>{Y.pattern??(Y.pattern=AM),H6.init($,Y),$._zod.bag.format="ipv4"}),_3=y("$ZodIPv6",($,Y)=>{Y.pattern??(Y.pattern=_M),H6.init($,Y),$._zod.bag.format="ipv6",$._zod.check=(Q)=>{try{new URL(`http://[${Q.value}]`)}catch{Q.issues.push({code:"invalid_format",format:"ipv6",input:Q.value,inst:$,continue:!Y.abort})}}}),R3=y("$ZodMAC",($,Y)=>{Y.pattern??(Y.pattern=RM(Y.delimiter)),H6.init($,Y),$._zod.bag.format="mac"}),T3=y("$ZodCIDRv4",($,Y)=>{Y.pattern??(Y.pattern=TM),H6.init($,Y)}),k3=y("$ZodCIDRv6",($,Y)=>{Y.pattern??(Y.pattern=kM),H6.init($,Y),$._zod.check=(Q)=>{let X=Q.value.split("/");try{if(X.length!==2)throw Error();let[z,Z]=X;if(!Z)throw Error();let K=Number(Z);if(`${K}`!==Z)throw Error();if(K<0||K>128)throw Error();new URL(`http://[${z}]`)}catch{Q.issues.push({code:"invalid_format",format:"cidrv6",input:Q.value,inst:$,continue:!Y.abort})}}});function S3($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var f3=y("$ZodBase64",($,Y)=>{Y.pattern??(Y.pattern=SM),H6.init($,Y),$._zod.bag.contentEncoding="base64",$._zod.check=(Q)=>{if(S3(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64",input:Q.value,inst:$,continue:!Y.abort})}});function Sd($){if(!nU.test($))return!1;let Y=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),Q=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return S3(Q)}var E3=y("$ZodBase64URL",($,Y)=>{Y.pattern??(Y.pattern=nU),H6.init($,Y),$._zod.bag.contentEncoding="base64url",$._zod.check=(Q)=>{if(Sd(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64url",input:Q.value,inst:$,continue:!Y.abort})}}),C3=y("$ZodE164",($,Y)=>{Y.pattern??(Y.pattern=EM),H6.init($,Y)});function fd($,Y=null){try{let Q=$.split(".");if(Q.length!==3)return!1;let[X]=Q;if(!X)return!1;let z=JSON.parse(atob(X));if("typ"in z&&z?.typ!=="JWT")return!1;if(!z.alg)return!1;if(Y&&(!("alg"in z)||z.alg!==Y))return!1;return!0}catch{return!1}}var u3=y("$ZodJWT",($,Y)=>{H6.init($,Y),$._zod.check=(Q)=>{if(fd(Q.value,Y.alg))return;Q.issues.push({code:"invalid_format",format:"jwt",input:Q.value,inst:$,continue:!Y.abort})}}),c3=y("$ZodCustomStringFormat",($,Y)=>{H6.init($,Y),$._zod.check=(Q)=>{if(Y.fn(Q.value))return;Q.issues.push({code:"invalid_format",format:Y.format,input:Q.value,inst:$,continue:!Y.abort})}}),$x=y("$ZodNumber",($,Y)=>{w0.init($,Y),$._zod.pattern=$._zod.bag.pattern??i2,$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=Number(Q.value)}catch(K){}let z=Q.value;if(typeof z==="number"&&!Number.isNaN(z)&&Number.isFinite(z))return Q;let Z=typeof z==="number"?Number.isNaN(z)?"NaN":!Number.isFinite(z)?"Infinity":void 0:void 0;return Q.issues.push({expected:"number",code:"invalid_type",input:z,inst:$,...Z?{received:Z}:{}}),Q}}),y3=y("$ZodNumberFormat",($,Y)=>{aM.init($,Y),$x.init($,Y)}),d2=y("$ZodBoolean",($,Y)=>{w0.init($,Y),$._zod.pattern=mM,$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=Boolean(Q.value)}catch(Z){}let z=Q.value;if(typeof z==="boolean")return Q;return Q.issues.push({expected:"boolean",code:"invalid_type",input:z,inst:$}),Q}}),Yx=y("$ZodBigInt",($,Y)=>{w0.init($,Y),$._zod.pattern=gM,$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=BigInt(Q.value)}catch(z){}if(typeof Q.value==="bigint")return Q;return Q.issues.push({expected:"bigint",code:"invalid_type",input:Q.value,inst:$}),Q}}),g3=y("$ZodBigIntFormat",($,Y)=>{oM.init($,Y),Yx.init($,Y)}),h3=y("$ZodSymbol",($,Y)=>{w0.init($,Y),$._zod.parse=(Q,X)=>{let z=Q.value;if(typeof z==="symbol")return Q;return Q.issues.push({expected:"symbol",code:"invalid_type",input:z,inst:$}),Q}}),m3=y("$ZodUndefined",($,Y)=>{w0.init($,Y),$._zod.pattern=iM,$._zod.values=new Set([void 0]),$._zod.parse=(Q,X)=>{let z=Q.value;if(typeof z>"u")return Q;return Q.issues.push({expected:"undefined",code:"invalid_type",input:z,inst:$}),Q}}),p3=y("$ZodNull",($,Y)=>{w0.init($,Y),$._zod.pattern=pM,$._zod.values=new Set([null]),$._zod.parse=(Q,X)=>{let z=Q.value;if(z===null)return Q;return Q.issues.push({expected:"null",code:"invalid_type",input:z,inst:$}),Q}}),i3=y("$ZodAny",($,Y)=>{w0.init($,Y),$._zod.parse=(Q)=>Q}),l3=y("$ZodUnknown",($,Y)=>{w0.init($,Y),$._zod.parse=(Q)=>Q}),n3=y("$ZodNever",($,Y)=>{w0.init($,Y),$._zod.parse=(Q,X)=>{return Q.issues.push({expected:"never",code:"invalid_type",input:Q.value,inst:$}),Q}}),d3=y("$ZodVoid",($,Y)=>{w0.init($,Y),$._zod.parse=(Q,X)=>{let z=Q.value;if(typeof z>"u")return Q;return Q.issues.push({expected:"void",code:"invalid_type",input:z,inst:$}),Q}}),a3=y("$ZodDate",($,Y)=>{w0.init($,Y),$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=new Date(Q.value)}catch(W){}let z=Q.value,Z=z instanceof Date;if(Z&&!Number.isNaN(z.getTime()))return Q;return Q.issues.push({expected:"date",code:"invalid_type",input:z,...Z?{received:"Invalid Date"}:{},inst:$}),Q}});function Ld($,Y,Q){if($.issues.length)Y.issues.push(...I9(Q,$.issues));Y.value[Q]=$.value}var o3=y("$ZodArray",($,Y)=>{w0.init($,Y),$._zod.parse=(Q,X)=>{let z=Q.value;if(!Array.isArray(z))return Q.issues.push({expected:"array",code:"invalid_type",input:z,inst:$}),Q;Q.value=Array(z.length);let Z=[];for(let K=0;K<z.length;K++){let W=z[K],V=Y.element._zod.run({value:W,issues:[]},X);if(V instanceof Promise)Z.push(V.then((H)=>Ld(H,Q,K)));else Ld(V,Q,K)}if(Z.length)return Promise.all(Z).then(()=>Q);return Q}});function eU($,Y,Q,X,z,Z){let K=Q in X;if($.issues.length){if(z&&Z&&!K)return;Y.issues.push(...I9(Q,$.issues))}if(!K&&!z){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[Q]});return}if($.value===void 0){if(K)Y.value[Q]=void 0}else Y.value[Q]=$.value}function Ed($){let Y=Object.keys($.shape);for(let X of Y)if(!$.shape?.[X]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${X}": expected a Zod schema`);let Q=GM($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(Q)}}function Cd($,Y,Q,X,z,Z){let K=[],W=z.keySet,V=z.catchall._zod,H=V.def.type,G=V.optin==="optional",J=V.optout==="optional";for(let w in Y){if(w==="__proto__")continue;if(W.has(w))continue;if(H==="never"){K.push(w);continue}let U=V.run({value:Y[w],issues:[]},X);if(U instanceof Promise)$.push(U.then((B)=>eU(B,Q,w,Y,G,J)));else eU(U,Q,w,Y,G,J)}if(K.length)Q.issues.push({code:"unrecognized_keys",keys:K,input:Y,inst:Z});if(!$.length)return Q;return Promise.all($).then(()=>{return Q})}var ud=y("$ZodObject",($,Y)=>{if(w0.init($,Y),!Object.getOwnPropertyDescriptor(Y,"shape")?.get){let W=Y.shape;Object.defineProperty(Y,"shape",{get:()=>{let V={...W};return Object.defineProperty(Y,"shape",{value:V}),V}})}let X=FK(()=>Ed(Y));A0($._zod,"propValues",()=>{let W=Y.shape,V={};for(let H in W){let G=W[H]._zod;if(G.values){V[H]??(V[H]=new Set);for(let J of G.values)V[H].add(J)}}return V});let z=xZ,Z=Y.catchall,K;$._zod.parse=(W,V)=>{K??(K=X.value);let H=W.value;if(!z(H))return W.issues.push({expected:"object",code:"invalid_type",input:H,inst:$}),W;W.value={};let G=[],J=K.shape;for(let w of K.keys){let U=J[w],B=U._zod.optin==="optional",D=U._zod.optout==="optional",q=U._zod.run({value:H[w],issues:[]},V);if(q instanceof Promise)G.push(q.then((F)=>eU(F,W,w,H,B,D)));else eU(q,W,w,H,B,D)}if(!Z)return G.length?Promise.all(G).then(()=>W):W;return Cd(G,H,W,V,X.value,$)}}),r3=y("$ZodObjectJIT",($,Y)=>{ud.init($,Y);let Q=$._zod.parse,X=FK(()=>Ed(Y)),z=(w)=>{let U=new oU(["shape","payload","ctx"]),B=X.value,D=(L)=>{let I=fU(L);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};U.write("const input = payload.value;");let q=Object.create(null),F=0;for(let L of B.keys)q[L]=`key_${F++}`;U.write("const newResult = {};");for(let L of B.keys){let I=q[L],O=fU(L),m=w[L],V1=m?._zod?.optin==="optional",H1=m?._zod?.optout==="optional";if(U.write(`const ${I} = ${D(L)};`),V1&&H1)U.write(`
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { n as FunnelIdGenerator, r as ChannelConfig } from "./settings-reader-BSU6JyvM.js";
|
|
2
|
+
import { S as FunnelLogger } from "./connector-diagnostic-log-yTOojKUR.js";
|
|
3
|
+
import { r as FunnelProcessRunner } from "./process-runner-DfniuWVU.js";
|
|
4
|
+
|
|
5
|
+
//#region lib/engine/claude/channel-resolver.d.ts
|
|
6
|
+
type ChannelResolver = {
|
|
7
|
+
get(name: string): ChannelConfig | null;
|
|
8
|
+
getById(id: string): ChannelConfig | null;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region lib/engine/claude/gateway-controller.d.ts
|
|
12
|
+
type GatewayController = {
|
|
13
|
+
isRunning(): boolean;
|
|
14
|
+
start(options?: {
|
|
15
|
+
caffeinate?: boolean;
|
|
16
|
+
}): Promise<boolean>;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region lib/engine/claude/mcp-installer.d.ts
|
|
20
|
+
type McpInstaller = {
|
|
21
|
+
findInstalledName(cwd: string): string | null;
|
|
22
|
+
install(cwd: string): void;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region lib/engine/claude/process-guard.d.ts
|
|
26
|
+
type ProcessGuard = {
|
|
27
|
+
/** Returns true if a live process is already registered for this profile. */isRunning(profileId: string): boolean; /** Writes the PID file and registers an exit hook to clean it up. */
|
|
28
|
+
acquire(profileId: string): void; /** Removes the PID file. */
|
|
29
|
+
release(profileId: string): void;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region lib/engine/claude/session-store.d.ts
|
|
33
|
+
type SessionStore = {
|
|
34
|
+
getSessionId(profileId: string): string | null;
|
|
35
|
+
setSessionId(profileId: string, sessionId: string): void; /** Returns true when the session jsonl exists on disk and is non-empty. */
|
|
36
|
+
sessionFileExists(cwd: string, sessionId: string, env: Record<string, string>): boolean;
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region lib/engine/claude/claude.d.ts
|
|
40
|
+
type LaunchOptions = {
|
|
41
|
+
channel: string;
|
|
42
|
+
cwd?: string;
|
|
43
|
+
userArgs?: string[];
|
|
44
|
+
/** Stable id of the launching profile (uuid). Keys the singleton PID file and
|
|
45
|
+
* the resumable session. Absent for a profile-less launch (raw `--channel`),
|
|
46
|
+
* which never enforces singleton-ness and never resumes. */
|
|
47
|
+
profileId?: string; /** Args prepended to the claude argv (typically a profile's recipe). Defaults to none. */
|
|
48
|
+
options?: string[]; /** Env vars layered under the launched claude process. process.env wins on collision. */
|
|
49
|
+
env?: Record<string, string>;
|
|
50
|
+
/** Whether to inject a `--session-id`/`--resume` for this profile.
|
|
51
|
+
* Defaults to false: resuming is opt-in and only meaningful for a profile,
|
|
52
|
+
* since the persisted session is owned by the profile (by id). A launch
|
|
53
|
+
* without a profile always starts a fresh session regardless of this flag. */
|
|
54
|
+
resume?: boolean;
|
|
55
|
+
/** Invoked synchronously after the child claude process has been spawned, with its PID.
|
|
56
|
+
* Useful for hosts that need to register the spawned process before it exits
|
|
57
|
+
* (e.g. multi-session registries that track per-claude liveness). */
|
|
58
|
+
onSpawned?: (pid: number) => void;
|
|
59
|
+
/** Whether to install the funnel MCP entry into `.mcp.json` (default: true).
|
|
60
|
+
* Set to false when the host already provides its own MCP server entry and
|
|
61
|
+
* does not need the funnel binary as an MCP endpoint. */
|
|
62
|
+
installMcp?: boolean;
|
|
63
|
+
};
|
|
64
|
+
type Deps = {
|
|
65
|
+
channels: ChannelResolver;
|
|
66
|
+
mcp: McpInstaller;
|
|
67
|
+
gateway: GatewayController;
|
|
68
|
+
sessions: SessionStore;
|
|
69
|
+
guard: ProcessGuard;
|
|
70
|
+
process?: FunnelProcessRunner;
|
|
71
|
+
idGenerator?: FunnelIdGenerator;
|
|
72
|
+
logger?: FunnelLogger;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Launches Claude Code with funnel pre-wired: ensures the gateway is running,
|
|
76
|
+
* installs the funnel MCP into the target repo's `.mcp.json` if missing,
|
|
77
|
+
* injects `FUNNEL_CHANNEL_ID` into the child env, and delegates singleton
|
|
78
|
+
* enforcement to a ProcessGuard.
|
|
79
|
+
*/
|
|
80
|
+
declare class FunnelClaude {
|
|
81
|
+
private readonly channels;
|
|
82
|
+
private readonly mcp;
|
|
83
|
+
private readonly gateway;
|
|
84
|
+
private readonly sessions;
|
|
85
|
+
private readonly guard;
|
|
86
|
+
private readonly process;
|
|
87
|
+
private readonly idGenerator;
|
|
88
|
+
private readonly logger;
|
|
89
|
+
constructor(deps: Deps);
|
|
90
|
+
launch(options: LaunchOptions): Promise<number>;
|
|
91
|
+
private buildArgs;
|
|
92
|
+
/**
|
|
93
|
+
* Decides whether funnel should resume an existing claude session or start
|
|
94
|
+
* a freshly minted one. Backs off when the user already passed a
|
|
95
|
+
* session-shaping flag, since combining them would either confuse claude
|
|
96
|
+
* or override the explicit user intent.
|
|
97
|
+
*
|
|
98
|
+
* The session is owned by the profile (by id), not by cwd: two profiles
|
|
99
|
+
* pointing at the same repo each keep their own conversation, and a launch
|
|
100
|
+
* with no profile never resumes — so an unrelated session in the same repo
|
|
101
|
+
* can't bleed in. The channel never enters into it; sessions belong to the
|
|
102
|
+
* launch layer (profiles), keeping the transport layer ignorant of them.
|
|
103
|
+
*
|
|
104
|
+
* A persisted id is only resumed when its session jsonl still exists on
|
|
105
|
+
* disk. claude errors out on `--resume <id>` for a missing conversation, and
|
|
106
|
+
* a persisted id can outlive its jsonl (claude pruned it, or the very first
|
|
107
|
+
* launch was aborted after the id was written but before the jsonl
|
|
108
|
+
* appeared). When the file is gone we mint a fresh session instead, which
|
|
109
|
+
* overwrites the dangling entry — so the store self-heals.
|
|
110
|
+
*/
|
|
111
|
+
private resolveSession;
|
|
112
|
+
private buildEnv;
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { McpInstaller as a, ProcessGuard as i, LaunchOptions as n, GatewayController as o, SessionStore as r, ChannelResolver as s, FunnelClaude as t };
|
package/dist/claude.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { a as McpInstaller, i as ProcessGuard, n as LaunchOptions, o as GatewayController, r as SessionStore, s as ChannelResolver, t as FunnelClaude } from "./claude-CB1WkV77.js";
|
|
2
|
+
import { r as FunnelProcessRunner } from "./process-runner-DfniuWVU.js";
|
|
3
|
+
import { n as FunnelFileSystem } from "./file-system-BeOKXjlV.js";
|
|
4
|
+
import { t as FunnelProfiles } from "./profiles-f0mNmEyP.js";
|
|
5
|
+
import { C as profileSpecSchema, S as localConfigSchema, _ as LOCAL_CONFIG_FILENAME, b as channelSpecSchema, g as ConnectorSpec, h as ChannelSpec, i as FunnelTokenPrompter, m as FunnelLocalConfig, n as FunnelLocalConfigSync, r as LocalConfigSyncResult, t as ConnectorSyncOutcome, v as LocalConfig, x as connectorSpecSchema, y as ProfileSpec } from "./local-config-sync-BdsrDZOu.js";
|
|
6
|
+
import { i as funnelJsonSchema, n as NodeFunnelTokenPrompter, r as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-B5FFCsGP.js";
|
|
7
|
+
|
|
8
|
+
//#region lib/engine/claude/file-process-guard.d.ts
|
|
9
|
+
type Deps$1 = {
|
|
10
|
+
fs?: FunnelFileSystem;
|
|
11
|
+
process?: FunnelProcessRunner;
|
|
12
|
+
dir?: string;
|
|
13
|
+
};
|
|
14
|
+
declare class FileProcessGuard implements ProcessGuard {
|
|
15
|
+
private readonly fs;
|
|
16
|
+
private readonly process;
|
|
17
|
+
private readonly pidDir;
|
|
18
|
+
constructor(deps?: Deps$1);
|
|
19
|
+
isRunning(profileId: string): boolean;
|
|
20
|
+
acquire(profileId: string): void;
|
|
21
|
+
release(profileId: string): void;
|
|
22
|
+
private pidPath;
|
|
23
|
+
private readPid;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region lib/engine/mcp/mcp.d.ts
|
|
27
|
+
declare const FUNNEL_MCP_COMMAND = "bun";
|
|
28
|
+
declare const FUNNEL_MCP_ARGS: string[];
|
|
29
|
+
declare const FUNNEL_MCP_NAME = "funnel";
|
|
30
|
+
type Deps = {
|
|
31
|
+
fs?: FunnelFileSystem;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Installs/uninstalls the funnel MCP entry into a target repository's
|
|
35
|
+
* `.mcp.json`. Detects an existing entry by command match so renaming is
|
|
36
|
+
* preserved across re-installs.
|
|
37
|
+
*/
|
|
38
|
+
declare class FunnelMcp {
|
|
39
|
+
private readonly fs;
|
|
40
|
+
constructor(deps?: Deps);
|
|
41
|
+
install(repoPath: string): void;
|
|
42
|
+
uninstall(repoPath: string): void;
|
|
43
|
+
findInstalledName(cwd: string): string | null;
|
|
44
|
+
private findServerName;
|
|
45
|
+
private isFunnelEntry;
|
|
46
|
+
private readConfig;
|
|
47
|
+
private writeConfig;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region lib/engine/mcp/channel-server.d.ts
|
|
51
|
+
type ChannelServerOptions = {
|
|
52
|
+
/** Funnel home directory (settings.json + gateway.token). Defaults to ~/.funnel. */dir?: string; /** Gateway base URL. Defaults to `$FUNNEL_GATEWAY_URL` or `http://127.0.0.1:<port>`. */
|
|
53
|
+
gatewayUrl?: string; /** Channel id to subscribe to. Defaults to `$FUNNEL_CHANNEL_ID`. */
|
|
54
|
+
channelId?: string; /** Auth token. Defaults to `$FUNNEL_GATEWAY_TOKEN` then `<dir>/gateway.token`. */
|
|
55
|
+
token?: string;
|
|
56
|
+
};
|
|
57
|
+
declare const startChannelServer: (options?: ChannelServerOptions) => Promise<void>;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { ChannelResolver, ChannelServerOptions, ChannelSpec, ConnectorSpec, ConnectorSyncOutcome, FUNNEL_MCP_ARGS, FUNNEL_MCP_COMMAND, FUNNEL_MCP_NAME, FileProcessGuard, FunnelClaude, FunnelLocalConfig, FunnelLocalConfigSync, FunnelLocalConfigWriter, FunnelMcp, FunnelProfiles, FunnelTokenPrompter, GatewayController, LOCAL_CONFIG_FILENAME, LaunchOptions, LocalConfig, LocalConfigSyncResult, McpInstaller, MemoryFunnelTokenPrompter, NodeFunnelTokenPrompter, ProcessGuard, ProfileSpec, SessionStore, channelSpecSchema, connectorSpecSchema, funnelJsonSchema, localConfigSchema, profileSpecSchema, startChannelServer };
|