/**
 * Cloudflare BROWSER-RENDERING API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service browser-rendering
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
import { SensitiveString } from "../sensitive.js";
export const CreateContentRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    url: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    html: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/content",
}));
export const CreateContentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const createContent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateContentRequest,
    output: CreateContentResponse,
    errors: [],
}));
export const GetCrawlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    cursor: Schema.optional(Schema.Number).pipe(T.HttpQuery("cursor")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    status: Schema.optional(Schema.Union([
        Schema.Literals([
            "queued",
            "errored",
            "completed",
            "disallowed",
            "skipped",
            "cancelled",
        ]),
        Schema.String,
    ])).pipe(T.HttpQuery("status")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/crawl/{jobId}",
}));
export const GetCrawlResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    browserSecondsUsed: Schema.Number,
    finished: Schema.Number,
    records: Schema.Array(Schema.Struct({
        metadata: Schema.Struct({
            status: Schema.Number,
            url: Schema.String,
            title: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        status: Schema.Union([
            Schema.Literals([
                "queued",
                "errored",
                "completed",
                "disallowed",
                "skipped",
                "cancelled",
            ]),
            Schema.String,
        ]),
        url: Schema.String,
        html: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        json: Schema.optional(Schema.Union([
            Schema.Record(Schema.String, Schema.Unknown),
            Schema.Null,
        ])),
        markdown: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    skipped: Schema.Number,
    status: Schema.String,
    total: Schema.Number,
    cursor: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getCrawl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCrawlRequest,
    output: GetCrawlResponse,
    errors: [],
}));
export const CreateCrawlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    url: Schema.String,
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    crawlPurposes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals(["search", "ai-input", "ai-train"]),
        Schema.String,
    ]))),
    depth: Schema.optional(Schema.Number),
    emulateMediaType: Schema.optional(Schema.String),
    formats: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals(["html", "markdown", "json"]),
        Schema.String,
    ]))),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    jsonOptions: Schema.optional(Schema.Struct({
        customAi: Schema.optional(Schema.Array(Schema.Struct({
            model: Schema.String,
            authorization: Schema.optional(Schema.String),
        }))),
        prompt: Schema.optional(Schema.String),
        responseFormat: Schema.optional(Schema.Struct({
            type: Schema.String,
            jsonSchema: Schema.optional(Schema.Union([
                Schema.Record(Schema.String, Schema.Unknown),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({ type: "type", jsonSchema: "json_schema" }))),
    }).pipe(Schema.encodeKeys({
        customAi: "custom_ai",
        prompt: "prompt",
        responseFormat: "response_format",
    }))),
    limit: Schema.optional(Schema.Number),
    maxAge: Schema.optional(Schema.Number),
    modifiedSince: Schema.optional(Schema.Number),
    options: Schema.optional(Schema.Struct({
        excludePatterns: Schema.optional(Schema.Array(Schema.String)),
        includeExternalLinks: Schema.optional(Schema.Boolean),
        includePatterns: Schema.optional(Schema.Array(Schema.String)),
        includeSubdomains: Schema.optional(Schema.Boolean),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    render: Schema.optional(Schema.Literals([true, false])),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    source: Schema.optional(Schema.Union([
        Schema.Literals(["sitemaps", "links", "all"]),
        Schema.String,
    ])),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/crawl",
}));
export const CreateCrawlResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const createCrawl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateCrawlRequest,
    output: CreateCrawlResponse,
    errors: [],
}));
export const DeleteCrawlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String.pipe(T.HttpPath("jobId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/browser-rendering/crawl/{jobId}",
}));
export const DeleteCrawlResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    jobId: Schema.String,
    message: Schema.String,
})
    .pipe(Schema.encodeKeys({ jobId: "job_id", message: "message" }))
    .pipe(T.ResponsePath("result"));
export const deleteCrawl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteCrawlRequest,
    output: DeleteCrawlResponse,
    errors: [],
}));
export const CreateDevtoolBrowserRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    keepAlive: Schema.optional(Schema.Number).pipe(T.HttpQuery("keep_alive")),
    lab: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("lab")),
    recording: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("recording")),
    targets: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("targets")),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser",
}));
export const CreateDevtoolBrowserResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String,
    webSocketDebuggerUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
});
export const createDevtoolBrowser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateDevtoolBrowserRequest,
    output: CreateDevtoolBrowserResponse,
    errors: [],
}));
export const DeleteDevtoolBrowserRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}",
}));
export const DeleteDevtoolBrowserResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    status: Schema.Union([
        Schema.Literals(["closing", "closed"]),
        Schema.String,
    ]),
});
export const deleteDevtoolBrowser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteDevtoolBrowserRequest,
    output: DeleteDevtoolBrowserResponse,
    errors: [],
}));
export const ConnectDevtoolBrowserRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    keepAlive: Schema.optional(Schema.Number).pipe(T.HttpQuery("keep_alive")),
    lab: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("lab")),
    recording: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("recording")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}",
}));
export const ConnectDevtoolBrowserResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const connectDevtoolBrowser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ConnectDevtoolBrowserRequest,
    output: ConnectDevtoolBrowserResponse,
    errors: [],
}));
export const LaunchDevtoolBrowserRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    keepAlive: Schema.optional(Schema.Number).pipe(T.HttpQuery("keep_alive")),
    lab: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("lab")),
    recording: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("recording")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser",
}));
export const LaunchDevtoolBrowserResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const launchDevtoolBrowser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: LaunchDevtoolBrowserRequest,
    output: LaunchDevtoolBrowserResponse,
    errors: [],
}));
export const ProtocolDevtoolBrowserRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/protocol",
}));
export const ProtocolDevtoolBrowserResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domains: Schema.Array(Schema.Struct({
        domain: Schema.String,
        commands: Schema.optional(Schema.Union([
            Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
            Schema.Null,
        ])),
        dependencies: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        events: Schema.optional(Schema.Union([
            Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
            Schema.Null,
        ])),
        experimental: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        types: Schema.optional(Schema.Union([
            Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
            Schema.Null,
        ])),
    })),
    version: Schema.optional(Schema.Union([
        Schema.Struct({
            major: Schema.String,
            minor: Schema.String,
        }),
        Schema.Null,
    ])),
});
export const protocolDevtoolBrowser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ProtocolDevtoolBrowserRequest,
    output: ProtocolDevtoolBrowserResponse,
    errors: [],
}));
export const VersionDevtoolBrowserRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/version",
}));
export const VersionDevtoolBrowserResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    browser: Schema.String,
    protocolVersion: Schema.String,
    userAgent: Schema.String,
    v8Version: Schema.String,
    webKitVersion: Schema.String,
    webSocketDebuggerUrl: Schema.String,
}).pipe(Schema.encodeKeys({
    browser: "Browser",
    protocolVersion: "Protocol-Version",
    userAgent: "User-Agent",
    v8Version: "V8-Version",
    webKitVersion: "WebKit-Version",
    webSocketDebuggerUrl: "webSocketDebuggerUrl",
}));
export const versionDevtoolBrowser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: VersionDevtoolBrowserRequest,
    output: VersionDevtoolBrowserResponse,
    errors: [],
}));
export const GetDevtoolBrowserPageRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    targetId: Schema.String.pipe(T.HttpPath("targetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/page/{targetId}",
}));
export const GetDevtoolBrowserPageResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const getDevtoolBrowserPage = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDevtoolBrowserPageRequest,
    output: GetDevtoolBrowserPageResponse,
    errors: [],
}));
export const GetDevtoolBrowserTargetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    targetId: Schema.String.pipe(T.HttpPath("targetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/list/{targetId}",
}));
export const GetDevtoolBrowserTargetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    type: Schema.String,
    url: Schema.String,
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    devtoolsFrontendUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    title: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    webSocketDebuggerUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
});
export const getDevtoolBrowserTarget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDevtoolBrowserTargetRequest,
    output: GetDevtoolBrowserTargetResponse,
    errors: [],
}));
export const ListDevtoolBrowserTargetsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/list",
}));
export const ListDevtoolBrowserTargetsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    id: Schema.String,
    type: Schema.String,
    url: Schema.String,
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    devtoolsFrontendUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    title: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    webSocketDebuggerUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}));
export const listDevtoolBrowserTargets = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListDevtoolBrowserTargetsRequest,
    output: ListDevtoolBrowserTargetsResponse,
    errors: [],
}));
export const CreateDevtoolBrowserTargetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    url: Schema.optional(Schema.String).pipe(T.HttpQuery("url")),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/new",
}));
export const CreateDevtoolBrowserTargetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    type: Schema.String,
    url: Schema.String,
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    devtoolsFrontendUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    title: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    webSocketDebuggerUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
});
export const createDevtoolBrowserTarget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateDevtoolBrowserTargetRequest,
    output: CreateDevtoolBrowserTargetResponse,
    errors: [],
}));
export const ActivateDevtoolBrowserTargetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    targetId: Schema.String.pipe(T.HttpPath("targetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/activate/{targetId}",
}));
export const ActivateDevtoolBrowserTargetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    message: Schema.String,
});
export const activateDevtoolBrowserTarget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ActivateDevtoolBrowserTargetRequest,
    output: ActivateDevtoolBrowserTargetResponse,
    errors: [],
}));
export const CloseDevtoolBrowserTargetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    targetId: Schema.String.pipe(T.HttpPath("targetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/browser/{sessionId}/json/close/{targetId}",
}));
export const CloseDevtoolBrowserTargetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    message: Schema.String,
});
export const closeDevtoolBrowserTarget = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CloseDevtoolBrowserTargetRequest,
    output: CloseDevtoolBrowserTargetResponse,
    errors: [],
}));
export const GetDevtoolSessionRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String.pipe(T.HttpPath("sessionId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/session/{sessionId}",
}));
export const GetDevtoolSessionResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    sessionId: Schema.String,
    closeReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    closeReasonText: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    connectionEndTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    connectionId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    connectionStartTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    devtoolsFrontendUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    endTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    lastUpdated: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    startTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    webSocketDebuggerUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
});
export const getDevtoolSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDevtoolSessionRequest,
    output: GetDevtoolSessionResponse,
    errors: [],
}));
export const ListDevtoolSessionsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/browser-rendering/devtools/session",
}));
export const ListDevtoolSessionsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    sessionId: Schema.String,
    closeReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    closeReasonText: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    connectionEndTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    connectionId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    connectionStartTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    devtoolsFrontendUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    endTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    lastUpdated: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    startTime: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    webSocketDebuggerUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}));
export const listDevtoolSessions = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListDevtoolSessionsRequest,
    output: ListDevtoolSessionsResponse,
    errors: [],
}));
export const CreateJsonRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    html: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    customAi: Schema.optional(Schema.Array(Schema.Struct({
        model: Schema.String,
        authorization: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    prompt: Schema.optional(Schema.String),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    responseFormat: Schema.optional(Schema.Struct({
        type: Schema.String,
        jsonSchema: Schema.optional(Schema.Union([
            Schema.Record(Schema.String, Schema.Unknown),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({ type: "type", jsonSchema: "json_schema" }))),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    url: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    html: "html",
    actionTimeout: "actionTimeout",
    addScriptTag: "addScriptTag",
    addStyleTag: "addStyleTag",
    allowRequestPattern: "allowRequestPattern",
    allowResourceTypes: "allowResourceTypes",
    authenticate: "authenticate",
    bestAttempt: "bestAttempt",
    cookies: "cookies",
    customAi: "custom_ai",
    emulateMediaType: "emulateMediaType",
    gotoOptions: "gotoOptions",
    prompt: "prompt",
    rejectRequestPattern: "rejectRequestPattern",
    rejectResourceTypes: "rejectResourceTypes",
    responseFormat: "response_format",
    setExtraHTTPHeaders: "setExtraHTTPHeaders",
    setJavaScriptEnabled: "setJavaScriptEnabled",
    userAgent: "userAgent",
    viewport: "viewport",
    waitForSelector: "waitForSelector",
    waitForTimeout: "waitForTimeout",
    url: "url",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/json",
}));
export const CreateJsonResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Record(Schema.String, Schema.Unknown).pipe(T.ResponsePath("result"));
export const createJson = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateJsonRequest,
    output: CreateJsonResponse,
    errors: [],
}));
export const CreateLinkRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    html: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    excludeExternalLinks: Schema.optional(Schema.Boolean),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    visibleLinksOnly: Schema.optional(Schema.Boolean),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    url: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/links",
}));
export const CreateLinkResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.String).pipe(T.ResponsePath("result"));
export const createLink = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateLinkRequest,
    output: CreateLinkResponse,
    errors: [],
}));
export const CreateMarkdownRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    url: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    html: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/markdown",
}));
export const CreateMarkdownResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const createMarkdown = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateMarkdownRequest,
    output: CreateMarkdownResponse,
    errors: [],
}));
export const CreatePdfRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    html: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    pdfOptions: Schema.optional(Schema.Struct({
        displayHeaderFooter: Schema.optional(Schema.Boolean),
        footerTemplate: Schema.optional(Schema.String),
        format: Schema.optional(Schema.Union([
            Schema.Literals([
                "letter",
                "legal",
                "tabloid",
                "ledger",
                "a0",
                "a1",
                "a2",
                "a3",
                "a4",
                "a5",
                "a6",
            ]),
            Schema.String,
        ])),
        headerTemplate: Schema.optional(Schema.String),
        height: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
        landscape: Schema.optional(Schema.Boolean),
        margin: Schema.optional(Schema.Struct({
            bottom: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
            left: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
            right: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
            top: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
        })),
        omitBackground: Schema.optional(Schema.Boolean),
        outline: Schema.optional(Schema.Boolean),
        pageRanges: Schema.optional(Schema.String),
        preferCSSPageSize: Schema.optional(Schema.Boolean),
        printBackground: Schema.optional(Schema.Boolean),
        scale: Schema.optional(Schema.Number),
        tagged: Schema.optional(Schema.Boolean),
        timeout: Schema.optional(Schema.Number),
        width: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    url: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/pdf",
}));
export const CreatePdfResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const createPdf = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreatePdfRequest,
    output: CreatePdfResponse,
    errors: [],
}));
export const CreateScrapeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    elements: Schema.Array(Schema.Struct({
        selector: Schema.String,
    })),
    html: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    url: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/scrape",
}));
export const CreateScrapeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    results: Schema.Struct({
        attributes: Schema.Array(Schema.Struct({
            name: Schema.String,
            value: Schema.String,
        })),
        height: Schema.Number,
        html: Schema.String,
        left: Schema.Number,
        text: Schema.String,
        top: Schema.Number,
        width: Schema.Number,
    }),
    selector: Schema.String,
})).pipe(T.ResponsePath("result"));
export const createScrape = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateScrapeRequest,
    output: CreateScrapeResponse,
    errors: [],
}));
export const CreateScreenshotRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    html: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    screenshotOptions: Schema.optional(Schema.Struct({
        captureBeyondViewport: Schema.optional(Schema.Boolean),
        clip: Schema.optional(Schema.Struct({
            height: Schema.Number,
            width: Schema.Number,
            x: Schema.Number,
            y: Schema.Number,
            scale: Schema.optional(Schema.Number),
        })),
        encoding: Schema.optional(Schema.Union([Schema.Literals(["binary", "base64"]), Schema.String])),
        fromSurface: Schema.optional(Schema.Boolean),
        fullPage: Schema.optional(Schema.Boolean),
        omitBackground: Schema.optional(Schema.Boolean),
        optimizeForSpeed: Schema.optional(Schema.Boolean),
        quality: Schema.optional(Schema.Number),
        type: Schema.optional(Schema.Union([
            Schema.Literals(["png", "jpeg", "webp"]),
            Schema.String,
        ])),
    })),
    scrollPage: Schema.optional(Schema.Boolean),
    selector: Schema.optional(Schema.String),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    url: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/screenshot",
}));
export const CreateScreenshotResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    success: Schema.Boolean,
    errors: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            code: Schema.Number,
            message: Schema.String,
        })),
        Schema.Null,
    ])),
});
export const createScreenshot = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateScreenshotRequest,
    output: CreateScreenshotResponse,
    errors: [],
}));
export const CreateSnapshotRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cacheTTL: Schema.optional(Schema.Number).pipe(T.HttpQuery("cacheTTL")),
    html: Schema.optional(Schema.String),
    actionTimeout: Schema.optional(Schema.Number),
    addScriptTag: Schema.optional(Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.String),
        content: Schema.optional(Schema.String),
        type: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    addStyleTag: Schema.optional(Schema.Array(Schema.Struct({
        content: Schema.optional(Schema.String),
        url: Schema.optional(Schema.String),
    }))),
    allowRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    allowResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    authenticate: Schema.optional(Schema.Struct({
        password: SensitiveString,
        username: Schema.String,
    })),
    bestAttempt: Schema.optional(Schema.Boolean),
    cookies: Schema.optional(Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
        domain: Schema.optional(Schema.String),
        expires: Schema.optional(Schema.Number),
        httpOnly: Schema.optional(Schema.Boolean),
        partitionKey: Schema.optional(Schema.String),
        path: Schema.optional(Schema.String),
        priority: Schema.optional(Schema.Union([
            Schema.Literals(["Low", "Medium", "High"]),
            Schema.String,
        ])),
        sameParty: Schema.optional(Schema.Boolean),
        sameSite: Schema.optional(Schema.Union([
            Schema.Literals(["Strict", "Lax", "None"]),
            Schema.String,
        ])),
        secure: Schema.optional(Schema.Boolean),
        sourcePort: Schema.optional(Schema.Number),
        sourceScheme: Schema.optional(Schema.Union([
            Schema.Literals(["Unset", "NonSecure", "Secure"]),
            Schema.String,
        ])),
        url: Schema.optional(Schema.String),
    }))),
    emulateMediaType: Schema.optional(Schema.String),
    gotoOptions: Schema.optional(Schema.Struct({
        referer: Schema.optional(Schema.String),
        referrerPolicy: Schema.optional(Schema.String),
        timeout: Schema.optional(Schema.Number),
        waitUntil: Schema.optional(Schema.Union([
            Schema.Literal("load"),
            Schema.Literal("domcontentloaded"),
            Schema.Literal("networkidle0"),
            Schema.Literal("networkidle2"),
            Schema.Array(Schema.Union([
                Schema.Literals([
                    "load",
                    "domcontentloaded",
                    "networkidle0",
                    "networkidle2",
                ]),
                Schema.String,
            ])),
        ])),
    })),
    rejectRequestPattern: Schema.optional(Schema.Array(Schema.String)),
    rejectResourceTypes: Schema.optional(Schema.Array(Schema.Union([
        Schema.Literals([
            "document",
            "stylesheet",
            "image",
            "media",
            "font",
            "script",
            "texttrack",
            "xhr",
            "fetch",
            "prefetch",
            "eventsource",
            "websocket",
            "manifest",
            "signedexchange",
            "ping",
            "cspviolationreport",
            "preflight",
            "other",
        ]),
        Schema.String,
    ]))),
    screenshotOptions: Schema.optional(Schema.Struct({
        captureBeyondViewport: Schema.optional(Schema.Boolean),
        clip: Schema.optional(Schema.Struct({
            height: Schema.Number,
            width: Schema.Number,
            x: Schema.Number,
            y: Schema.Number,
            scale: Schema.optional(Schema.Number),
        })),
        fromSurface: Schema.optional(Schema.Boolean),
        fullPage: Schema.optional(Schema.Boolean),
        omitBackground: Schema.optional(Schema.Boolean),
        optimizeForSpeed: Schema.optional(Schema.Boolean),
        quality: Schema.optional(Schema.Number),
        type: Schema.optional(Schema.Union([Schema.Literals(["png", "jpeg", "webp"]), Schema.String])),
    })),
    setExtraHTTPHeaders: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    setJavaScriptEnabled: Schema.optional(Schema.Boolean),
    userAgent: Schema.optional(Schema.String),
    viewport: Schema.optional(Schema.Struct({
        height: Schema.Number,
        width: Schema.Number,
        deviceScaleFactor: Schema.optional(Schema.Number),
        hasTouch: Schema.optional(Schema.Boolean),
        isLandscape: Schema.optional(Schema.Boolean),
        isMobile: Schema.optional(Schema.Boolean),
    })),
    waitForSelector: Schema.optional(Schema.Struct({
        selector: Schema.String,
        hidden: Schema.optional(Schema.Literal(true)),
        timeout: Schema.optional(Schema.Number),
        visible: Schema.optional(Schema.Literal(true)),
    })),
    waitForTimeout: Schema.optional(Schema.Number),
    url: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/browser-rendering/snapshot",
}));
export const CreateSnapshotResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    content: Schema.String,
    screenshot: Schema.String,
}).pipe(T.ResponsePath("result"));
export const createSnapshot = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSnapshotRequest,
    output: CreateSnapshotResponse,
    errors: [],
}));
//# sourceMappingURL=browser-rendering.js.map