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I,OAAO,KAAK,QAChB,CAOA,KAAA,GAEI,OAAO,KAAK,MAChB,CAOA,OAAA,GAEI,OAAO,KAAK,QAChB,EAKJ,MAAM,eAKF,GAKA,IAKA,QAIA,GASA,WAAA,CAAY,GACe,iBAAZ,EAAK,GACZ,KAAK,GAAK,EAAK,GAGf,KAAK,GAAK,OAAO,QAAQ,WAE7B,KAAK,QAAU,EAAK,QACpB,KAAK,IAAM,EAAK,IAChB,KAAK,GAAK,EAAK,IAAM,IAAI,eAC7B,CAQA,SAAA,GACI,MAA2B,UAApB,KAAK,YAA8C,UAApB,KAAK,UAC/C,CAOA,QAAA,GACI,MAA2B,SAApB,KAAK,UAChB,CAOA,YAAA,GACI,MAA2B,cAApB,KAAK,UAChB,CAQA,SAAA,GACI,MAA2B,UAApB,KAAK,UAChB,EAKJ,MAAM,4BAA4B,eAI9B,WAAa,QAIb,OASA,WAAA,CAAY,GACR,MAAM,GACN,KAAK,OAAS,EAAK,MACvB,EAKJ,MAAM,2BAA2B,eAI7B,WAAa,OAIb,OASA,WAAA,CAAY,GACR,MAAM,GACN,KAAK,OAAS,EAAK,MACvB,EAKJ,MAAM,gCAAgC,eAIlC,WAAa,YAIb,OASA,WAAA,CAAY,GACR,MAAM,GACN,KAAK,OAAS,EAAK,MACvB,EAKJ,MAAM,4BAA4B,eAI9B,WAAa,QAIb,OASA,WAAA,CAAY,GACR,MAAM,GACN,KAAK,OAAS,EAAK,MACvB,SAGK,oBAAqB,gBAAiB,wBAAyB,eAAgB,mBAAoB,qBAAsB,kBAAmB,oBAAqB,kBAAmB,mBAAoB,gBAAiB,4BAA6B,sBAAuB,aAAc,iBAAkB,0BAA2B","file":"/npm/@arcjet/protocol@1.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@arcjet/protocol@1.2.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { isMessage } from '@bufbuild/protobuf';\nimport { typeid } from 'typeid-js';\nimport { ReasonSchema } from './proto/decide/v1alpha1/decide_pb.js';\nexport { categories as botCategories } from './well-known-bots.js';\n\n/**\n * Reason returned by a rule.\n */\nclass ArcjetReason {\n    /**\n     * Kind.\n     */\n    type;\n    /**\n     * Check if this reason is a sensitive info reason.\n     *\n     * @returns\n     *   Whether this reason is a sensitive info reason.\n     */\n    isSensitiveInfo() {\n        return this.type === \"SENSITIVE_INFO\";\n    }\n    /**\n     * Check if this reason is a rate limit reason.\n     *\n     * @returns\n     *   Whether this reason is a rate limit reason.\n     */\n    isRateLimit() {\n        return this.type === \"RATE_LIMIT\";\n    }\n    /**\n     * Check if this reason is a bot reason.\n     *\n     * @returns\n     *   Whether this reason is a bot reason.\n     */\n    isBot() {\n        return this.type === \"BOT\";\n    }\n    /**\n     * Check if this reason is an edge rule reason.\n     *\n     * @returns\n     *   Whether this reason is an edge rule reason.\n     */\n    isEdgeRule() {\n        return this.type === \"EDGE_RULE\";\n    }\n    /**\n     * Check if this reason is a shield reason.\n     *\n     * @returns\n     *   Whether this reason is a shield reason.\n     */\n    isShield() {\n        return this.type === \"SHIELD\";\n    }\n    /**\n     * Check if this reason is an email reason.\n     *\n     * @returns\n     *   Whether this reason is an email reason.\n     */\n    isEmail() {\n        return this.type === \"EMAIL\";\n    }\n    /**\n     * Check if this reason is an error reason.\n     *\n     * @returns\n     *   Whether this reason is an error reason.\n     */\n    isError() {\n        return this.type === \"ERROR\";\n    }\n    /**\n     * Check if this is a filter reason.\n     *\n     * @returns\n     *   Whether this is a filter reason.\n     */\n    isFilter() {\n        return this.type === \"FILTER\";\n    }\n    /**\n     * Check if this is a prompt injection reason.\n     *\n     * @returns\n     *   Whether this is a prompt injection reason.\n     */\n    isPromptInjection() {\n        return this.type === \"PROMPT_INJECTION_DETECTION\";\n    }\n}\n/**\n * Filter reason.\n */\nclass ArcjetFilterReason extends ArcjetReason {\n    /**\n     * Expressions that matched.\n     */\n    matchedExpressions;\n    /**\n     * Kind.\n     */\n    type = \"FILTER\";\n    /**\n     * Expression that could not be matched.\n     */\n    undeterminedExpressions;\n    /**\n     * Create a filter reason.\n     *\n     * @param init\n     *   Expression that matched.\n     * @returns\n     *   Filter reason.\n     */\n    constructor(init) {\n        super();\n        this.matchedExpressions = init.matchedExpressions;\n        this.undeterminedExpressions = init.undeterminedExpressions;\n    }\n}\n/**\n * Prompt injection reason.\n */\nclass ArcjetPromptInjectionReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"PROMPT_INJECTION_DETECTION\";\n    /**\n     * Whether a prompt injection attempt was detected.\n     */\n    injectionDetected;\n    /**\n     * The prompt injection confidence score.\n     */\n    score;\n    /**\n     * Create a prompt injection reason.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Prompt injection reason.\n     */\n    constructor(init) {\n        super();\n        this.injectionDetected = init.injectionDetected ?? false;\n        this.score = init.score ?? 0.0;\n    }\n}\n/**\n * Sensitive info reason.\n */\nclass ArcjetSensitiveInfoReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"SENSITIVE_INFO\";\n    /**\n     * List of denied entities.\n     */\n    denied;\n    /**\n     * List of allowed entities.\n     */\n    allowed;\n    /**\n     * Create an `ArcjetSensitiveInfoReason`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Sensitive info reason.\n     */\n    constructor(init) {\n        super();\n        this.denied = init.denied;\n        this.allowed = init.allowed;\n    }\n}\n/**\n * Rate limit reason.\n */\nclass ArcjetRateLimitReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"RATE_LIMIT\";\n    /**\n     * Maximum number of allowed requests.\n     */\n    max;\n    /**\n     * Remaining number of requests.\n     */\n    remaining;\n    /**\n     * Time in seconds until reset.\n     */\n    reset;\n    /**\n     * Time in seconds until the window resets.\n     */\n    window;\n    /**\n     * Time when the rate limit resets.\n     */\n    resetTime;\n    /**\n     * Create an `ArcjetRateLimitReason`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Rate limit reason.\n     */\n    constructor(init) {\n        super();\n        this.max = init.max;\n        this.remaining = init.remaining;\n        this.reset = init.reset;\n        this.window = init.window;\n        this.resetTime = init.resetTime;\n    }\n}\n/**\n * Bot reason.\n */\nclass ArcjetBotReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"BOT\";\n    /**\n     * List of allowed bot identifiers.\n     */\n    allowed;\n    /**\n     * List of denied bot identifiers.\n     */\n    denied;\n    /**\n     * Whether the bot is verified.\n     */\n    verified;\n    /**\n     * Whether the bot is spoofed.\n     */\n    spoofed;\n    /**\n     * Create an `ArcjetBotReason`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Bot reason.\n     */\n    constructor(init) {\n        super();\n        this.allowed = init.allowed;\n        this.denied = init.denied;\n        this.verified = init.verified;\n        this.spoofed = init.spoofed;\n    }\n    /**\n     * Check if the bot is verified.\n     *\n     * @returns\n     *   Whether the bot is verified.\n     */\n    isVerified() {\n        return this.verified;\n    }\n    /**\n     * Check if the bot is spoofed.\n     *\n     * @returns\n     *   Whether the bot is spoofed.\n     */\n    isSpoofed() {\n        return this.spoofed;\n    }\n}\n/**\n * Edge rule reason.\n *\n * @deprecated\n *   This reason is currently not used.\n */\nclass ArcjetEdgeRuleReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"EDGE_RULE\";\n}\n/**\n * Shield reason.\n */\nclass ArcjetShieldReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"SHIELD\";\n    /**\n     * Whether the shield was triggered.\n     */\n    shieldTriggered;\n    /**\n     * Create an `ArcjetShieldReason`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Shield reason.\n     */\n    constructor(init) {\n        super();\n        this.shieldTriggered = init.shieldTriggered ?? false;\n    }\n}\n/**\n * Email reason.\n */\nclass ArcjetEmailReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"EMAIL\";\n    /**\n     * List of email types that are allowed.\n     */\n    emailTypes;\n    /**\n     * Create an `ArcjetEmailReason`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Email reason.\n     */\n    constructor(init) {\n        super();\n        this.emailTypes = init.emailTypes ?? [];\n    }\n}\n/**\n * Error reason.\n */\nclass ArcjetErrorReason extends ArcjetReason {\n    /**\n     * Kind.\n     */\n    type = \"ERROR\";\n    /**\n     * Error message.\n     */\n    message;\n    /**\n     * Create an `ArcjetErrorReason`.\n     *\n     * @param error\n     *   Error that occurred.\n     * @returns\n     *   Error reason.\n     */\n    constructor(error) {\n        super();\n        if (isMessage(error, ReasonSchema)) {\n            this.message =\n                error.reason.case === \"error\"\n                    ? error.reason.value.message\n                    : \"Missing error reason\";\n            return;\n        }\n        // TODO: Get rid of instanceof check\n        if (error instanceof Error) {\n            this.message = error.message;\n            return;\n        }\n        if (typeof error === \"string\") {\n            this.message = error;\n            return;\n        }\n        this.message = \"Unknown error occurred\";\n    }\n}\n/**\n * Result of calling a rule.\n */\nclass ArcjetRuleResult {\n    /**\n     * Stable, deterministic, and unique identifier of the rule that generated\n     * this result.\n     */\n    ruleId;\n    /**\n     * Fingerprint calculated for this rule, which can be used to cache the\n     * result for the amount of time specified by `ttl`.\n     */\n    fingerprint;\n    /**\n     * Duration in seconds this result should be considered valid, also known\n     * as time-to-live.\n     */\n    ttl;\n    /**\n     * State of the rule.\n     */\n    state;\n    /**\n     * Conclusion of the rule.\n     */\n    conclusion;\n    /**\n     * Reason for the conclusion.\n     */\n    reason;\n    /**\n     * Create an `ArcjetRuleResult`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Rule result.\n     */\n    constructor(init) {\n        this.ruleId = init.ruleId;\n        this.fingerprint = init.fingerprint;\n        this.ttl = init.ttl;\n        this.state = init.state;\n        this.conclusion = init.conclusion;\n        this.reason = init.reason;\n    }\n    /**\n     * Check if the rule result is denied.\n     *\n     * @returns\n     *   Whether the rule result is denied.\n     */\n    isDenied() {\n        return this.conclusion === \"DENY\";\n    }\n}\n/**\n * Info about an IP address.\n */\nclass ArcjetIpDetails {\n    /**\n     * Estimated latitude of the IP address within the `accuracyRadius` margin\n     * of error.\n     */\n    latitude;\n    /**\n     * Estimated longitude of the IP address - see accuracy_radius for the\n     * margin of error.\n     */\n    longitude;\n    /**\n     * Accuracy radius of the IP address location in kilometers.\n     */\n    accuracyRadius;\n    /**\n     * Timezone of the IP address.\n     */\n    timezone;\n    /**\n     * Postal code of the IP address.\n     */\n    postalCode;\n    /**\n     * City the IP address is located in.\n     */\n    city;\n    /**\n     * Region the IP address is located in.\n     */\n    region;\n    /**\n     * Country code the IP address is located in.\n     */\n    country;\n    /**\n     * Country name the IP address is located in.\n     */\n    countryName;\n    /**\n     * Continent code the IP address is located in.\n     */\n    continent;\n    /**\n     * Continent name the IP address is located in.\n     */\n    continentName;\n    /**\n     * AS number the IP address belongs to.\n     */\n    asn;\n    /**\n     * AS name the IP address belongs to.\n     */\n    asnName;\n    /**\n     * ASN domain the IP address belongs to.\n     */\n    asnDomain;\n    /**\n     * ASN type: ISP, hosting, business, or education\n     */\n    asnType;\n    /**\n     * ASN country code the IP address belongs to.\n     */\n    asnCountry;\n    /**\n     * Name of service the IP address belongs to.\n     */\n    service;\n    /**\n     * Create an `ArcjetIpDetails`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   IP details.\n     */\n    constructor(init = {}) {\n        this.latitude = init.latitude;\n        this.longitude = init.longitude;\n        this.accuracyRadius = init.accuracyRadius;\n        this.timezone = init.timezone;\n        this.postalCode = init.postalCode;\n        this.city = init.city;\n        this.region = init.region;\n        this.country = init.country;\n        this.countryName = init.countryName;\n        this.continent = init.continent;\n        this.continentName = init.continentName;\n        this.asn = init.asn;\n        this.asnName = init.asnName;\n        this.asnDomain = init.asnDomain;\n        this.asnType = init.asnType;\n        this.asnCountry = init.asnCountry;\n        this.service = init.service;\n        // TypeScript creates symbols on the class when using `private` or `#`\n        // identifiers for tracking these properties. We don't want to end up with\n        // the same issues as Next.js with private symbols so we use\n        // `Object.defineProperties` here and then `@ts-expect-error` when we access\n        // the values. This is mostly to improve the editor experience, as props\n        // starting with `_` are sorted to the top of autocomplete.\n        Object.defineProperties(this, {\n            _isHosting: {\n                configurable: false,\n                enumerable: false,\n                writable: false,\n                value: init.isHosting ?? false,\n            },\n            _isVpn: {\n                configurable: false,\n                enumerable: false,\n                writable: false,\n                value: init.isVpn ?? false,\n            },\n            _isProxy: {\n                configurable: false,\n                enumerable: false,\n                writable: false,\n                value: init.isProxy ?? false,\n            },\n            _isTor: {\n                configurable: false,\n                enumerable: false,\n                writable: false,\n                value: init.isTor ?? false,\n            },\n            _isRelay: {\n                configurable: false,\n                enumerable: false,\n                writable: false,\n                value: init.isRelay ?? false,\n            },\n        });\n    }\n    /**\n     * Check if the IP address has geo `latitude` info.\n     * This also implies that `accuracyRadius` is available.\n     *\n     * @returns\n     *   Whether the IP address has latitude info.\n     */\n    hasLatitude() {\n        return typeof this.latitude !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has geo `longitude` info.\n     * This also implies that `accuracyRadius` is available.\n     *\n     * @returns\n     *   Whether the IP address has longitude info.\n     */\n    hasLongitude() {\n        return typeof this.longitude !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has geo accuracy radius info.\n     * This also implies that `latitude` and `longitude` are available.\n     *\n     * @returns\n     *   Whether the IP address has accuracy info.\n     */\n    hasAccuracyRadius() {\n        return typeof this.accuracyRadius !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has timezone info.\n     *\n     * @returns\n     *   Whether the IP address has timezone info.\n     */\n    hasTimezone() {\n        return typeof this.timezone !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has postcal code info.\n     *\n     * @returns\n     *   Whether the IP address has postcal code info.\n     */\n    hasPostalCode() {\n        return typeof this.postalCode !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has city info.\n     *\n     * @returns\n     *   Whether the IP address has city info.\n     */\n    // TODO: If we have city, what other data are we sure to have?\n    hasCity() {\n        return typeof this.city !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has region info.\n     *\n     * @returns\n     *   Whether the IP address has region info.\n     */\n    // TODO: If we have region, what other data are we sure to have?\n    hasRegion() {\n        return typeof this.region !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has country info:\n     * `countryName` and `country`.\n     *\n     * @returns\n     *   Whether the IP address has country info.\n     */\n    // TODO: If we have country, should we also have continent?\n    hasCountry() {\n        return typeof this.country !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has continent info:\n     * `continentName` and `continent`.\n     *\n     * @returns\n     *   Whether the IP address has continent info.\n     */\n    hasContintent() {\n        return typeof this.continent !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has ASN info.\n     *\n     * @deprecated\n     *   Use `hasAsn()` instead.\n     *\n     * @returns\n     *   Whether the IP address has ASN info.\n     */\n    hasASN() {\n        return this.hasAsn();\n    }\n    /**\n     * Check if the IP address has ASN info:\n     * `asnCountry`, `asnDomain`, `asnName`, `asnType`, and `asn` fields.\n     *\n     * @returns\n     *   Whether the IP address has ASN info.\n     */\n    hasAsn() {\n        return typeof this.asn !== \"undefined\";\n    }\n    /**\n     * Check if the IP address has a service.\n     *\n     * @returns\n     *   Whether the IP address has a service.\n     */\n    hasService() {\n        return typeof this.service !== \"undefined\";\n    }\n    /**\n     * Check if the IP address belongs to a hosting provider.\n     *\n     * @returns\n     *   Whether the IP address belongs to a hosting provider.\n     */\n    isHosting() {\n        // @ts-expect-error because we attach this with Object.defineProperties\n        return this._isHosting;\n    }\n    /**\n     * Check if the IP address belongs to a VPN provider.\n     *\n     * @returns\n     *   Whether the IP address belongs to a VPN provider.\n     */\n    isVpn() {\n        // @ts-expect-error because we attach this with Object.defineProperties\n        return this._isVpn;\n    }\n    /**\n     * Check if the IP address belongs to a proxy provider.\n     *\n     * @returns\n     *   Whether the IP address belongs to a proxy provider.\n     */\n    isProxy() {\n        // @ts-expect-error because we attach this with Object.defineProperties\n        return this._isProxy;\n    }\n    /**\n     * Check if the IP address belongs to a Tor node.\n     *\n     * @returns\n     *   Whether the IP address belongs to a Tor node.\n     */\n    isTor() {\n        // @ts-expect-error because we attach this with Object.defineProperties\n        return this._isTor;\n    }\n    /**\n     * Check if the IP address belongs to a relay service.\n     *\n     * @returns\n     *   Whether the IP address belongs to a relay service.\n     */\n    isRelay() {\n        // @ts-expect-error because we attach this with Object.defineProperties\n        return this._isRelay;\n    }\n}\n/**\n * Decision returned by the Arcjet SDK.\n */\nclass ArcjetDecision {\n    /**\n     * Unique identifier of the decision.\n     * This can be used to look up the decision in the Arcjet dashboard.\n     */\n    id;\n    /**\n     * Duration in milliseconds this decision should be considered valid, also\n     * known as time-to-live.\n     */\n    ttl;\n    /**\n     * List of results from calling rules.\n     * Can also be found by logging into the Arcjet dashboard and searching for the decision `id`.\n     */\n    results;\n    /**\n     * Details about the IP address that informed the `conclusion`.\n     */\n    ip;\n    /**\n     * Create an `ArcjetDecision`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Decision.\n     */\n    constructor(init) {\n        if (typeof init.id === \"string\") {\n            this.id = init.id;\n        }\n        else {\n            this.id = typeid(\"lreq\").toString();\n        }\n        this.results = init.results;\n        this.ttl = init.ttl;\n        this.ip = init.ip ?? new ArcjetIpDetails();\n    }\n    /**\n     * Check if the decision is allowed.\n     * This considers `ERROR` decisions as allowed too.\n     *\n     * @returns\n     *   Whether the decision is allowed.\n     */\n    isAllowed() {\n        return this.conclusion === \"ALLOW\" || this.conclusion === \"ERROR\";\n    }\n    /**\n     * Check if the decision is denied.\n     *\n     * @returns\n     *   Whether the decision is denied.\n     */\n    isDenied() {\n        return this.conclusion === \"DENY\";\n    }\n    /**\n     * Check if the decision is challenged.\n     *\n     * @returns\n     *   Whether the decision is challenged.\n     */\n    isChallenged() {\n        return this.conclusion === \"CHALLENGE\";\n    }\n    /**\n     * Check if the decision is errored.\n     * This does **not** consider `ALLOW` as errored.\n     *\n     * @returns\n     *   Whether the decision is errored.\n     */\n    isErrored() {\n        return this.conclusion === \"ERROR\";\n    }\n}\n/**\n * Allow decision.\n */\nclass ArcjetAllowDecision extends ArcjetDecision {\n    /**\n     * Kind.\n     */\n    conclusion = \"ALLOW\";\n    /**\n     * Reason for decision.\n     */\n    reason;\n    /**\n     * Create an `ArcjetAllowDecision`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Allow decision.\n     */\n    constructor(init) {\n        super(init);\n        this.reason = init.reason;\n    }\n}\n/**\n * Deny decision.\n */\nclass ArcjetDenyDecision extends ArcjetDecision {\n    /**\n     * Kind.\n     */\n    conclusion = \"DENY\";\n    /**\n     * Reason for decision.\n     */\n    reason;\n    /**\n     * Create an `ArcjetDenyDecision`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Deny decision.\n     */\n    constructor(init) {\n        super(init);\n        this.reason = init.reason;\n    }\n}\n/**\n * Challenge decision.\n */\nclass ArcjetChallengeDecision extends ArcjetDecision {\n    /**\n     * Kind.\n     */\n    conclusion = \"CHALLENGE\";\n    /**\n     * Reason for decision.\n     */\n    reason;\n    /**\n     * Create an `ArcjetChallengeDecision`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Challenge decision.\n     */\n    constructor(init) {\n        super(init);\n        this.reason = init.reason;\n    }\n}\n/**\n * Error decision.\n */\nclass ArcjetErrorDecision extends ArcjetDecision {\n    /**\n     * Kind.\n     */\n    conclusion = \"ERROR\";\n    /**\n     * Reason for decision.\n     */\n    reason;\n    /**\n     * Create an `ArcjetErrorDecision`.\n     *\n     * @param init\n     *   Configuration.\n     * @returns\n     *   Error decision.\n     */\n    constructor(init) {\n        super(init);\n        this.reason = init.reason;\n    }\n}\n\nexport { ArcjetAllowDecision, ArcjetBotReason, ArcjetChallengeDecision, ArcjetDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetErrorDecision, ArcjetErrorReason, ArcjetFilterReason, ArcjetIpDetails, ArcjetPromptInjectionReason, ArcjetRateLimitReason, ArcjetReason, ArcjetRuleResult, ArcjetSensitiveInfoReason, ArcjetShieldReason };\n"]}