@overturo/js 0.0.0-stage → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../node_modules/ajv/lib/runtime/ucs2length.ts","../../src/constants.ts","../../src/field/constants.ts","../../src/field/appearance.ts","../../src/generated/field-v1/envelope.js","../../src/generated/field-v1/ready.js","../../src/generated/field-v1/state.js","../../src/generated/field-v1/resize.js","../../src/generated/field-v1/complete.js","../../src/generated/field-v1/error.js","../../src/generated/field-v1/submit_requested.js","../../src/generated/field-v1/init.js","../../src/generated/field-v1/capture.js","../../src/generated/field-v1/reset.js","../../src/field/protocol.ts","../../src/errors.ts","../../src/forms/intercept.ts","../../src/forms/presentation.ts","../../src/field/element.ts","../../src/field/index.ts"],"sourcesContent":["// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nexport default function ucs2length(str: string): number {\n const len = str.length\n let length = 0\n let pos = 0\n let value: number\n while (pos < len) {\n length++\n value = str.charCodeAt(pos++)\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos)\n if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate\n }\n }\n return length\n}\n\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default'\n","/**\n * Current protocol version for postMessage communication.\n *\n * Parity invariant: this constant MUST match the `PROTOCOL_VERSION` declared\n * by the decision page's frame messaging.\n * Enforced by `spec/lib/protocol_version_parity_spec.rb`.\n */\nexport const PROTOCOL_VERSION = 2\n\n/**\n * postMessage event types — protocol v2 (`overturo:*` namespace, kind-aware).\n *\n * Seven closed-enum types. Adding a type is a protocol version change.\n * Pinned decisions.\n */\nexport const MESSAGE_TYPES_V2 = {\n READY: \"overturo:ready\",\n STATE: \"overturo:state\",\n COMPLETE: \"overturo:complete\",\n CANCEL: \"overturo:cancel\",\n ERROR: \"overturo:error\",\n RESIZE: \"overturo:resize\",\n DEADLINE: \"overturo:deadline\",\n} as const\n\nexport type MessageTypeV2 = (typeof MESSAGE_TYPES_V2)[keyof typeof MESSAGE_TYPES_V2]\n\n/** Default iframe styles for embed mode. */\nexport const EMBED_DEFAULTS = {\n width: \"100%\",\n minHeight: \"400px\",\n maxHeight: \"none\",\n border: \"none\",\n borderRadius: \"0\",\n background: \"transparent\",\n} as const\n\n/** Allowed style keys for embed iframe (whitelist). */\nexport const EMBED_STYLE_KEYS = Object.keys(EMBED_DEFAULTS) as ReadonlyArray<keyof typeof EMBED_DEFAULTS>\n\n/** Default popup window dimensions. */\nexport const POPUP_DEFAULTS = {\n width: 500,\n height: 700,\n} as const\n\n/** postMessage event types for AccordSetup bridge controller. */\nexport const SETUP_MESSAGE_TYPES = {\n READY: \"overturoid:ready\",\n RESIZE: \"overturoid:resize\",\n STEP: \"overturoid:setup:step\",\n CREATED: \"overturoid:setup:created\",\n CANCEL: \"overturoid:cancel\",\n ERROR: \"overturoid:error\",\n PING: \"overturoid:ping\",\n HEARTBEAT: \"overturoid:heartbeat\",\n} as const\n\n/** Default popup dimensions for AccordSetup. */\nexport const SETUP_POPUP_DEFAULTS = {\n width: 600,\n height: 800,\n} as const\n\n/** API path for consent sessions. */\nexport const API_PATH = \"/api/v1/consent_sessions\"\n\n/**\n * kind-agnostic decisions API path . The v0\n * `/api/v1/consent_sessions` path is preserved as a server-side alias\n * during the alias window; the SDK calls the canonical\n * `/api/v1/decisions` path from `decisions.createSession`.\n */\nexport const DECISIONS_API_PATH = \"/api/v1/decisions\"\n\n/**\n * Decisions flow path on the trust host: `${flowBaseUrl}/decisions/:token`\n * for popup/redirect, `${flowBaseUrl}/decisions/:token/embed` for embed.\n */\nexport const DECISIONS_FLOW_PATH = \"/decisions\"\n\n/** The participant's own meeting pair (status / withdrawal) — publishable key + session token. */\nexport const MEETING_CONSENTS_API_PATH = \"/api/v1/meeting_consents\"\n\n/** API path for accord setup sessions. */\nexport const SETUP_API_PATH = \"/api/v1/accord_setup_sessions\"\n\n/**\n * API path for preview tokens — top-level, not nested under consent_sessions.\n * Used by previewTemplate (a flow template) and previewSetup (a setup session).\n * The route is declared in `config/routes/api_core.rb` as\n * POST only.\n */\nexport const PREVIEW_TOKENS_PATH = \"/api/v1/preview_tokens\"\n\n/** Default base URL. */\nexport const DEFAULT_BASE_URL = \"https://overturo.com\"\n\n/** The v2 family's type prefix; an envelope of another family on the same page is not ours to validate. */\nexport const MESSAGE_PREFIX_V2 = \"overturo:\"\n\n/** True for a message whose `type` names another protocol family (dropped silently, never a protocol violation). */\nexport function isForeignEnvelope(data: unknown): boolean {\n const type = (data as { type?: unknown } | null)?.type\n return typeof type === \"string\" && !type.startsWith(MESSAGE_PREFIX_V2)\n}\n\n/** Default request timeout in milliseconds (30 seconds). */\nexport const DEFAULT_TIMEOUT = 30_000\n\n/** 202 — the embedded consent field element (registered by the separate `@overturo/js/field` entry). */\nexport const CONSENT_FIELD_ELEMENT_NAME = \"overturo-consent-field\"\n","// 202 — the embedded consent field protocol family.\n//\n// A family of its own beside postMessage v2 and SETUP: the `overturo-field:`\n// prefix keeps it outside the v2 parity scan, and FIELD_PROTOCOL_VERSION\n// moves in lockstep with the frame runtime\n// (app/javascript/controllers/trust_surface/field_controller.js) — enforced\n// by spec/lib/field_protocol_parity_spec.rb.\nexport const FIELD_PROTOCOL_VERSION = 1\n\nimport { CONSENT_FIELD_ELEMENT_NAME } from \"../constants\"\n\nexport const FIELD_ELEMENT_NAME = CONSENT_FIELD_ELEMENT_NAME\n\nexport const FIELD_MESSAGE_TYPES = {\n READY: \"overturo-field:ready\",\n STATE: \"overturo-field:state\",\n RESIZE: \"overturo-field:resize\",\n COMPLETE: \"overturo-field:complete\",\n ERROR: \"overturo-field:error\",\n SUBMIT_REQUESTED: \"overturo-field:submit_requested\",\n INIT: \"overturo-field:init\",\n CAPTURE: \"overturo-field:capture\",\n RESET: \"overturo-field:reset\",\n} as const\n\nexport type FieldMessageType = (typeof FIELD_MESSAGE_TYPES)[keyof typeof FIELD_MESSAGE_TYPES]\n\n/** The field document's path on the trust host: `${flowBaseUrl}/decisions/fields/:flowId`. */\nexport const FIELD_DOCUMENT_PATH = \"/decisions/fields\"\n","// 202 D8 — the bounded appearance vocabulary. The values travel in the frame\n// URL's FRAGMENT (never sent to the server) and are validated inside the frame\n// against the same closed set; an invalid value is ignored there.\n\nexport const APPEARANCE_KEYS = [\"fontFamily\", \"fontSize\", \"text\", \"muted\", \"accent\", \"border\", \"radius\", \"density\"] as const\n\nexport type AppearanceKey = (typeof APPEARANCE_KEYS)[number]\n\nexport interface FieldAppearance {\n /** One of `system`, `inter`, `serif`, `mono` (no host font file is ever loaded). */\n fontFamily?: \"system\" | \"inter\" | \"serif\" | \"mono\"\n /** A CSS length in px, rem or em. */\n fontSize?: string\n text?: string\n muted?: string\n accent?: string\n border?: string\n radius?: string\n density?: \"compact\" | \"regular\" | \"relaxed\"\n}\n\n/** Keeps only the vocabulary's keys with string values; the frame validates the values. */\nexport function sanitiseAppearance(input: unknown): Partial<Record<AppearanceKey, string>> {\n const out: Partial<Record<AppearanceKey, string>> = {}\n if (!input || typeof input !== \"object\") return out\n for (const key of APPEARANCE_KEYS) {\n const value = (input as Record<string, unknown>)[key]\n if (typeof value === \"string\" && value.length <= 64) out[key] = value\n }\n return out\n}\n\n/** `#a=<base64url json>` — empty string when nothing survives sanitisation. */\nexport function encodeAppearance(input: unknown): string {\n const clean = sanitiseAppearance(input)\n if (Object.keys(clean).length === 0) return \"\"\n const json = JSON.stringify(clean)\n // UTF-8 → base64 with the platform's btoa (browsers and Node 16+ alike; no Buffer in a browser bundle).\n const b64 = btoa(unescape(encodeURIComponent(json)))\n return `#a=${b64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\")}`\n}\n","\"use strict\";export const validate = validate22;export default validate22;const schema33 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/envelope.json\",\"title\":\"Embedded consent field envelope v1\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"version\",\"payload\",\"ts\",\"message_id\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"overturo-field:ready\",\"overturo-field:state\",\"overturo-field:resize\",\"overturo-field:complete\",\"overturo-field:error\",\"overturo-field:submit_requested\",\"overturo-field:init\",\"overturo-field:capture\",\"overturo-field:reset\"]},\"version\":{\"type\":\"integer\",\"const\":1},\"payload\":{\"type\":\"object\",\"additionalProperties\":true},\"ts\":{\"type\":\"string\",\"pattern\":\"^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(Z|[+-]\\\\d{2}:\\\\d{2})$\"},\"message_id\":{\"type\":\"string\",\"pattern\":\"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"}}};const pattern4 = new RegExp(\"^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(Z|[+-]\\\\d{2}:\\\\d{2})$\", \"u\");const pattern5 = new RegExp(\"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\", \"u\");function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/envelope.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.payload === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"payload\"},message:\"must have required property '\"+\"payload\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.ts === undefined){const err3 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"ts\"},message:\"must have required property '\"+\"ts\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.message_id === undefined){const err4 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"message_id\"},message:\"must have required property '\"+\"message_id\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!(((((key0 === \"type\") || (key0 === \"version\")) || (key0 === \"payload\")) || (key0 === \"ts\")) || (key0 === \"message_id\"))){const err5 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.type !== undefined){let data0 = data.type;if(typeof data0 !== \"string\"){const err6 = {instancePath:instancePath+\"/type\",schemaPath:\"#/properties/type/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((((((((data0 === \"overturo-field:ready\") || (data0 === \"overturo-field:state\")) || (data0 === \"overturo-field:resize\")) || (data0 === \"overturo-field:complete\")) || (data0 === \"overturo-field:error\")) || (data0 === \"overturo-field:submit_requested\")) || (data0 === \"overturo-field:init\")) || (data0 === \"overturo-field:capture\")) || (data0 === \"overturo-field:reset\"))){const err7 = {instancePath:instancePath+\"/type\",schemaPath:\"#/properties/type/enum\",keyword:\"enum\",params:{allowedValues: schema33.properties.type.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.version !== undefined){let data1 = data.version;if(!((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1)))){const err8 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(1 !== data1){const err9 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/const\",keyword:\"const\",params:{allowedValue: 1},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.payload !== undefined){let data2 = data.payload;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){}else {const err10 = {instancePath:instancePath+\"/payload\",schemaPath:\"#/properties/payload/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.ts !== undefined){let data3 = data.ts;if(typeof data3 === \"string\"){if(!pattern4.test(data3)){const err11 = {instancePath:instancePath+\"/ts\",schemaPath:\"#/properties/ts/pattern\",keyword:\"pattern\",params:{pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(Z|[+-]\\\\d{2}:\\\\d{2})$\"},message:\"must match pattern \\\"\"+\"^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(Z|[+-]\\\\d{2}:\\\\d{2})$\"+\"\\\"\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+\"/ts\",schemaPath:\"#/properties/ts/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.message_id !== undefined){let data4 = data.message_id;if(typeof data4 === \"string\"){if(!pattern5.test(data4)){const err13 = {instancePath:instancePath+\"/message_id\",schemaPath:\"#/properties/message_id/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+\"/message_id\",schemaPath:\"#/properties/message_id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate25;export default validate25;const schema36 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/ready.json\",\"title\":\"READY payload (an announcement; carries nothing)\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{}};function validate25(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/ready.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate25.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){}else {const err0 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate25.errors = vErrors;return errors === 0;}validate25.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate28;export default validate28;const schema39 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/state.json\",\"title\":\"STATE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"decisions\"],\"properties\":{\"decisions\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"string\",\"enum\":[\"granted\",\"declined\"]}}}};function validate28(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/state.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate28.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.decisions === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"decisions\"},message:\"must have required property '\"+\"decisions\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.decisions !== undefined){let data0 = data.decisions;if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){for(const key0 in data0){let data1 = data0[key0];if(typeof data1 !== \"string\"){const err1 = {instancePath:instancePath+\"/decisions/\" + key0.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/properties/decisions/additionalProperties/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!((data1 === \"granted\") || (data1 === \"declined\"))){const err2 = {instancePath:instancePath+\"/decisions/\" + key0.replace(/~/g, \"~0\").replace(/\\//g, \"~1\"),schemaPath:\"#/properties/decisions/additionalProperties/enum\",keyword:\"enum\",params:{allowedValues: schema39.properties.decisions.additionalProperties.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}}else {const err3 = {instancePath:instancePath+\"/decisions\",schemaPath:\"#/properties/decisions/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate28.errors = vErrors;return errors === 0;}validate28.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate27;export default validate27;const schema38 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/resize.json\",\"title\":\"RESIZE payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"height\"],\"properties\":{\"height\":{\"type\":\"integer\",\"minimum\":0}}};function validate27(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/resize.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate27.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.height === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"height\"},message:\"must have required property '\"+\"height\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.height !== undefined){let data0 = data.height;if(!((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0)))){const err1 = {instancePath:instancePath+\"/height\",schemaPath:\"#/properties/height/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(typeof data0 == \"number\"){if(data0 < 0 || isNaN(data0)){const err2 = {instancePath:instancePath+\"/height\",schemaPath:\"#/properties/height/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}}}else {const err3 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate21;export default validate21;const schema32 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/complete.json\",\"title\":\"COMPLETE payload (the capture token)\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"token\",\"committed\"],\"properties\":{\"token\":{\"type\":\"string\",\"minLength\":1},\"committed\":{\"type\":\"boolean\"},\"record_id\":{\"type\":[\"string\",\"null\"]}}};const func1 = require(\"ajv/dist/runtime/ucs2length\").default;function validate21(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/complete.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.token === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"token\"},message:\"must have required property '\"+\"token\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.committed === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"committed\"},message:\"must have required property '\"+\"committed\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.token !== undefined){let data0 = data.token;if(typeof data0 === \"string\"){if(func1(data0) < 1){const err2 = {instancePath:instancePath+\"/token\",schemaPath:\"#/properties/token/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/token\",schemaPath:\"#/properties/token/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.committed !== undefined){if(typeof data.committed !== \"boolean\"){const err4 = {instancePath:instancePath+\"/committed\",schemaPath:\"#/properties/committed/type\",keyword:\"type\",params:{type: \"boolean\"},message:\"must be boolean\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.record_id !== undefined){let data2 = data.record_id;if((typeof data2 !== \"string\") && (data2 !== null)){const err5 = {instancePath:instancePath+\"/record_id\",schemaPath:\"#/properties/record_id/type\",keyword:\"type\",params:{type: schema32.properties.record_id.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate23;export default validate23;const schema34 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/error.json\",\"title\":\"ERROR payload\",\"type\":\"object\",\"additionalProperties\":true,\"required\":[\"code\"],\"properties\":{\"code\":{\"type\":\"string\",\"minLength\":1},\"message\":{\"type\":\"string\"}}};const func1 = require(\"ajv/dist/runtime/ucs2length\").default;function validate23(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/error.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate23.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.code === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"code\"},message:\"must have required property '\"+\"code\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.code !== undefined){let data0 = data.code;if(typeof data0 === \"string\"){if(func1(data0) < 1){const err1 = {instancePath:instancePath+\"/code\",schemaPath:\"#/properties/code/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath:instancePath+\"/code\",schemaPath:\"#/properties/code/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.message !== undefined){if(typeof data.message !== \"string\"){const err3 = {instancePath:instancePath+\"/message\",schemaPath:\"#/properties/message/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate23.errors = vErrors;return errors === 0;}validate23.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate29;export default validate29;const schema40 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/submit_requested.json\",\"title\":\"SUBMIT_REQUESTED payload (the person pressed Enter inside the frame)\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{}};function validate29(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/submit_requested.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate29.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){}else {const err0 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate29.errors = vErrors;return errors === 0;}validate29.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate24;export default validate24;const schema35 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/init.json\",\"title\":\"INIT payload (host → frame; the origin handshake)\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"locale\":{\"type\":\"string\"}}};function validate24(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/init.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate24.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.locale !== undefined){if(typeof data.locale !== \"string\"){const err0 = {instancePath:instancePath+\"/locale\",schemaPath:\"#/properties/locale/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate20;export default validate20;const schema31 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/capture.json\",\"title\":\"CAPTURE payload (host → frame; what only the host knows)\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"subject\":{\"type\":\"object\",\"additionalProperties\":true,\"properties\":{\"email\":{\"type\":\"string\"},\"external_id\":{\"type\":\"string\"}}},\"page_url\":{\"type\":[\"string\",\"null\"]},\"form_id\":{\"type\":[\"string\",\"null\"]},\"submitter\":{\"type\":[\"string\",\"null\"]},\"commit\":{\"type\":\"boolean\"}}};function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/capture.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.subject !== undefined){let data0 = data.subject;if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.email !== undefined){if(typeof data0.email !== \"string\"){const err0 = {instancePath:instancePath+\"/subject/email\",schemaPath:\"#/properties/subject/properties/email/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data0.external_id !== undefined){if(typeof data0.external_id !== \"string\"){const err1 = {instancePath:instancePath+\"/subject/external_id\",schemaPath:\"#/properties/subject/properties/external_id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}else {const err2 = {instancePath:instancePath+\"/subject\",schemaPath:\"#/properties/subject/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.page_url !== undefined){let data3 = data.page_url;if((typeof data3 !== \"string\") && (data3 !== null)){const err3 = {instancePath:instancePath+\"/page_url\",schemaPath:\"#/properties/page_url/type\",keyword:\"type\",params:{type: schema31.properties.page_url.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.form_id !== undefined){let data4 = data.form_id;if((typeof data4 !== \"string\") && (data4 !== null)){const err4 = {instancePath:instancePath+\"/form_id\",schemaPath:\"#/properties/form_id/type\",keyword:\"type\",params:{type: schema31.properties.form_id.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.submitter !== undefined){let data5 = data.submitter;if((typeof data5 !== \"string\") && (data5 !== null)){const err5 = {instancePath:instancePath+\"/submitter\",schemaPath:\"#/properties/submitter/type\",keyword:\"type\",params:{type: schema31.properties.submitter.type},message:\"must be string,null\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.commit !== undefined){if(typeof data.commit !== \"boolean\"){const err6 = {instancePath:instancePath+\"/commit\",schemaPath:\"#/properties/commit/type\",keyword:\"type\",params:{type: \"boolean\"},message:\"must be boolean\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","\"use strict\";export const validate = validate26;export default validate26;const schema37 = {\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"$id\":\"https://schemas.overturo.com/field-v1/reset.json\",\"title\":\"RESET payload (host → frame)\",\"type\":\"object\",\"additionalProperties\":true,\"properties\":{}};function validate26(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL=\"https://schemas.overturo.com/field-v1/reset.json\" */;let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == \"object\" && !Array.isArray(data)){}else {const err0 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {\"props\":true,\"dynamicProps\":false,\"dynamicItems\":false};","// 202 — field-v1 validator helper (the postmessage_v2.ts shape over the\n// Ajv standalone validators generated from schemas/field-v1/*.json).\n\nimport envelopeValidator from \"../generated/field-v1/envelope.js\"\nimport readyValidator from \"../generated/field-v1/ready.js\"\nimport stateValidator from \"../generated/field-v1/state.js\"\nimport resizeValidator from \"../generated/field-v1/resize.js\"\nimport completeValidator from \"../generated/field-v1/complete.js\"\nimport errorValidator from \"../generated/field-v1/error.js\"\nimport submitRequestedValidator from \"../generated/field-v1/submit_requested.js\"\nimport initValidator from \"../generated/field-v1/init.js\"\nimport captureValidator from \"../generated/field-v1/capture.js\"\nimport resetValidator from \"../generated/field-v1/reset.js\"\nimport { FIELD_MESSAGE_TYPES, FIELD_PROTOCOL_VERSION, type FieldMessageType } from \"./constants\"\n\nexport interface FieldEnvelope {\n type: FieldMessageType\n version: typeof FIELD_PROTOCOL_VERSION\n payload: Record<string, unknown>\n ts: string\n message_id: string\n}\n\nexport interface FieldValidationError {\n instancePath?: string\n schemaPath?: string\n keyword?: string\n message?: string\n params?: Record<string, unknown>\n}\n\nexport interface FieldValidationResult {\n valid: boolean\n errors: FieldValidationError[] | null\n}\n\ninterface ValidatorFn {\n (data: unknown): boolean\n errors?: FieldValidationError[] | null\n}\n\nconst VALIDATORS: Record<string, ValidatorFn> = {\n [FIELD_MESSAGE_TYPES.READY]: readyValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.STATE]: stateValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.RESIZE]: resizeValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.COMPLETE]: completeValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.ERROR]: errorValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.SUBMIT_REQUESTED]: submitRequestedValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.INIT]: initValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.CAPTURE]: captureValidator as ValidatorFn,\n [FIELD_MESSAGE_TYPES.RESET]: resetValidator as ValidatorFn,\n}\n\nconst envelopeFn = envelopeValidator as ValidatorFn\n\nexport function validateFieldEnvelope(message: unknown): FieldValidationResult {\n const valid = envelopeFn(message)\n return { valid, errors: valid ? null : (envelopeFn.errors ?? null) }\n}\n\nexport function validateFieldPayload(message: FieldEnvelope): FieldValidationResult {\n const validator = VALIDATORS[message.type]\n if (!validator) return { valid: false, errors: [{ message: `Unknown type ${message.type}` }] }\n const valid = validator(message.payload)\n return { valid, errors: valid ? null : (validator.errors ?? null) }\n}\n\n/** Envelope first, then payload. */\nexport function validateField(message: unknown): FieldValidationResult {\n const envelopeResult = validateFieldEnvelope(message)\n if (!envelopeResult.valid) return envelopeResult\n return validateFieldPayload(message as FieldEnvelope)\n}\n\n/** Builds an outbound envelope (host → frame). */\nexport function fieldEnvelope(type: FieldMessageType, payload: Record<string, unknown>): FieldEnvelope {\n return { type, version: FIELD_PROTOCOL_VERSION, payload, ts: new Date().toISOString(), message_id: uuidV4() }\n}\n\nfunction uuidV4(): string {\n if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") return crypto.randomUUID()\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16)\n })\n}\n","/** Base error class for all Overturo SDK errors. */\nexport class OverturoError extends Error {\n constructor(message: string) {\n super(message)\n this.name = \"OverturoError\"\n }\n}\n\n/** Thrown when required parameters are missing or invalid. */\nexport class OverturoValidationError extends OverturoError {\n constructor(message: string) {\n super(message)\n this.name = \"OverturoValidationError\"\n }\n}\n\n/** Thrown when the API returns a 4xx or 5xx response. */\nexport class OverturoApiError extends OverturoError {\n /** HTTP status code. */\n status: number\n /** Parsed response body, if available. */\n body: unknown\n\n constructor(message: string, status: number, body: unknown) {\n super(message)\n this.name = \"OverturoApiError\"\n this.status = status\n this.body = body\n }\n}\n\n/** Thrown when a network error prevents the request from completing. */\nexport class OverturoNetworkError extends OverturoError {\n /** The original error that caused the failure. */\n cause: unknown\n\n constructor(message: string, cause: unknown) {\n super(message)\n this.name = \"OverturoNetworkError\"\n this.cause = cause\n }\n}\n\n/** Thrown when an operation times out. */\nexport class OverturoTimeoutError extends OverturoError {\n constructor(message: string = \"Operation timed out\") {\n super(message)\n this.name = \"OverturoTimeoutError\"\n }\n}\n\n/**\n * OAP denial category vocabulary.\n *\n * Cascade-relevant errors returned by OAP endpoints carry one of these\n * values. Non-cascade errors (validation, conflict, internal) omit the\n * field.\n */\nexport type OapDenialCategory = \"authorization_denied\" | \"intent_denied\" | \"trajectory_denied\"\n\n/**\n * Shape of a single OAP error envelope as rendered by the server.\n * Surfaced through {@link OapDenied} so callers can introspect the\n * full envelope without re-parsing the response body.\n */\nexport interface OapErrorEnvelope {\n reason_code: string\n message: string\n detail?: Record<string, unknown>\n failed_bound?: string\n denial_category?: OapDenialCategory\n cascade_step?: number\n request_id?: string\n negotiable?: boolean\n negotiate_url?: string\n documentation_url?: string\n}\n\n/**\n * Thrown when an OAP-protocol endpoint returns a denial.\n *\n * Carries the structured fields from the OAP error envelope. The\n * three subclasses below map 1:1 to {@link OapDenialCategory} so\n * callers can `catch (e: OapIntentDenied)` directly.\n */\nexport class OapDenied extends OverturoApiError {\n reason_code: string\n failed_bound: string | undefined\n denial_category: OapDenialCategory | undefined\n cascade_step: number | undefined\n detail: Record<string, unknown> | undefined\n\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope.message, status, body)\n this.name = \"OapDenied\"\n this.reason_code = envelope.reason_code\n this.failed_bound = envelope.failed_bound\n this.denial_category = envelope.denial_category\n this.cascade_step = envelope.cascade_step\n this.detail = envelope.detail\n }\n\n /**\n * Build the most-specific subclass for the envelope. Reason-code\n * dispatch takes precedence over category dispatch so the most\n * specific subclass wins (sequence denials are\n * trajectory_denied but get their own subclass).\n */\n static fromEnvelope(envelope: OapErrorEnvelope, status: number, body: unknown): OapDenied {\n if (envelope.reason_code === \"sequence_prohibited\" || envelope.reason_code === \"sequence_missing_predecessor\") {\n return new OapSequenceDenied(envelope, status, body)\n }\n switch (envelope.denial_category) {\n case \"authorization_denied\":\n return new OapAuthorizationDenied(envelope, status, body)\n case \"intent_denied\":\n return new OapIntentDenied(envelope, status, body)\n case \"trajectory_denied\":\n return new OapTrajectoryDenied(envelope, status, body)\n default:\n return new OapDenied(envelope, status, body)\n }\n }\n}\n\n/** denial_category == \"authorization_denied\" — OAuth/DPoP layer rejected. */\nexport class OapAuthorizationDenied extends OapDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapAuthorizationDenied\"\n }\n}\n\n/** denial_category == \"intent_denied\" — request fell outside grant bounds. */\nexport class OapIntentDenied extends OapDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapIntentDenied\"\n }\n}\n\n/** denial_category == \"trajectory_denied\" — execution history blocked. */\nexport class OapTrajectoryDenied extends OapDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapTrajectoryDenied\"\n }\n}\n\n/**\n * 2 — sequence_bounds violation\n * (`sequence_prohibited` / `sequence_missing_predecessor`). A\n * trajectory denial with a structural-ordering flavour.\n */\nexport class OapSequenceDenied extends OapTrajectoryDenied {\n constructor(envelope: OapErrorEnvelope, status: number, body: unknown) {\n super(envelope, status, body)\n this.name = \"OapSequenceDenied\"\n }\n}\n","import { OverturoValidationError } from \"../errors\"\n\n/** 201 — the hidden input that carries the capture token to the organisation's server. */\nexport const DEFAULT_TOKEN_FIELD = \"overturo_capture_token\"\n/** One-shot marker for the re-entrant submit the facade itself triggers; cleared as soon as it is seen. */\nexport const CAPTURED_MARK = \"overturoCaptured\"\n/** The capture never holds the form longer than this (ms): the form submits either way. */\nexport const CAPTURE_TIMEOUT_MS = 5_000\n\nexport interface InterceptOptions {\n tokenFieldName?: string\n submitAfterCapture?: boolean\n onError?: (error: Error) => void\n}\n\nexport interface InterceptContext {\n submitter: HTMLElement | null\n}\n\n/** One interception per form: a second attach without a detach would make two handlers re-submit each other forever. */\nconst attached = new WeakMap<HTMLFormElement, true>()\n\n/**\n * 201 D4 Level B / 202 D9 — the one submit interception both capture shapes\n * share: one-shot re-entry, an in-flight guard, the timeout, the clicked\n * button travelling with the re-submit, the hidden token input. `run` does\n * the capture (from the DOM for the snippet, through the field element for\n * the embedded field) and returns the token; whatever happens, the form\n * submits afterwards unless `submitAfterCapture` is false.\n */\nexport function interceptSubmit(\n form: HTMLFormElement,\n opts: InterceptOptions,\n run: (ctx: InterceptContext) => Promise<{ token: string }>\n): () => void {\n if (attached.has(form)) {\n throw new OverturoValidationError(\"duplicate_attach: this form already has a capture interception; detach it before attaching again\")\n }\n attached.set(form, true)\n let inFlight = false\n const tokenField = opts.tokenFieldName ?? DEFAULT_TOKEN_FIELD\n const handler = (ev: Event) => {\n if (form.dataset[CAPTURED_MARK] === \"1\") {\n // The re-entrant submit the interception itself triggered: let it through once,\n // and forget it — the next real submit captures again.\n delete form.dataset[CAPTURED_MARK]\n return\n }\n ev.preventDefault()\n ev.stopImmediatePropagation()\n if (inFlight) return // a second click while the capture is in flight: the first one answers\n inFlight = true\n form.querySelector(`input[name=\"${tokenField}\"]`)?.remove() // never carry a stale token\n const submitter = (ev as SubmitEvent).submitter ?? null\n void (async () => {\n try {\n const { token } = await withTimeout(run({ submitter }), CAPTURE_TIMEOUT_MS)\n setHiddenInput(form, tokenField, token)\n } catch (e) {\n opts.onError?.(e as Error) // the form still submits\n } finally {\n inFlight = false\n if (opts.submitAfterCapture !== false) {\n form.dataset[CAPTURED_MARK] = \"1\"\n resubmit(form, submitter)\n }\n }\n })()\n }\n form.addEventListener(\"submit\", handler, { capture: true })\n return () => {\n attached.delete(form)\n form.removeEventListener(\"submit\", handler, { capture: true })\n delete form.dataset[CAPTURED_MARK]\n form.querySelector(`input[name=\"${tokenField}\"]`)?.remove()\n }\n}\n\n/** The capture never holds the form hostage: past the limit the form submits without a token. */\nexport function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(\n () => reject(new OverturoValidationError(`capture timed out after ${ms} ms; the form submits without a capture token`)),\n ms\n )\n promise.then(\n (v) => {\n clearTimeout(timer)\n resolve(v)\n },\n (e) => {\n clearTimeout(timer)\n reject(e)\n }\n )\n })\n}\n\n/** Re-submits the way the person did: the clicked button's name/value and formaction travel with it. */\nexport function resubmit(form: HTMLFormElement, submitter: HTMLElement | null): void {\n if (submitter && submitter.isConnected && typeof form.requestSubmit === \"function\") {\n try {\n form.requestSubmit(submitter)\n return\n } catch {\n /* fall through: an unusual submitter; the plain re-submit follows */\n }\n }\n if (typeof form.requestSubmit === \"function\") form.requestSubmit()\n else if (submitter && typeof (submitter as HTMLButtonElement).click === \"function\") (submitter as HTMLButtonElement).click()\n else form.submit()\n}\n\nexport function resolveForm(form: HTMLFormElement | string): HTMLFormElement {\n const el = typeof form === \"string\" ? document.querySelector(form) : form\n if (!(el instanceof HTMLFormElement)) throw new OverturoValidationError(\"form must resolve to a <form> element\")\n return el\n}\n\nexport function setHiddenInput(form: HTMLFormElement, name: string, value: string): void {\n let input = form.querySelector<HTMLInputElement>(`input[name=\"${name}\"]`)\n if (!input) {\n input = document.createElement(\"input\")\n input.type = \"hidden\"\n input.name = name\n form.appendChild(input)\n }\n input.value = value\n}\n","/**\n * 201 D12 — the decision and the presentation of one mapped form control, as\n * observed in the DOM at submit: ticked → granted, unticked → declined (never\n * silence), with the default-ticked and required flags the server's matrix\n * refuses for a consent purpose. Only checkable controls are read; anything\n * else is declined (a text field is never a consent).\n */\nexport interface AttestedDecision {\n decision: \"granted\" | \"declined\"\n default_checked: boolean\n mandatory: boolean\n}\n\nexport function resolveControl(root: ParentNode, selector: string): HTMLInputElement | null {\n const el = root.querySelector(selector)\n return el instanceof HTMLInputElement ? el : null\n}\n\nexport function presentationFor(control: HTMLInputElement | null, initiallyChecked?: boolean): AttestedDecision {\n if (!control || (control.type !== \"checkbox\" && control.type !== \"radio\")) {\n return { decision: \"declined\", default_checked: false, mandatory: false }\n }\n return {\n decision: control.checked ? \"granted\" : \"declined\",\n // Shown ticked by default: the HTML attribute, or a script that ticked it before the person saw it.\n default_checked: control.defaultChecked || initiallyChecked === true,\n mandatory: mandatoryFor(control),\n }\n}\n\n/**\n * `required` on a lone checkbox means the person had to tick it. `required` on a\n * radio whose group offers another option (a \"No\") means the person had to\n * choose — which is a decision, not a mandatory consent.\n */\nfunction mandatoryFor(control: HTMLInputElement): boolean {\n if (!control.required) return false\n if (control.type !== \"radio\" || !control.name) return true\n const root: ParentNode = control.form ?? control.ownerDocument\n const group = Array.from(root.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')).filter((r) => r.name === control.name)\n return group.length <= 1\n}\n\n/** Every mapped purpose → its attested decision. */\nexport function decisionsFor(\n form: HTMLFormElement,\n map: Record<string, string>,\n initiallyChecked: Record<string, boolean> = {}\n): Record<string, AttestedDecision> {\n const out: Record<string, AttestedDecision> = {}\n for (const [purpose, selector] of Object.entries(map)) {\n out[purpose] = presentationFor(resolveControl(form, selector), initiallyChecked[purpose])\n }\n return out\n}\n","// 202 — `<overturo-consent-field>`: an Overturo-rendered consent control\n// placed inside the organisation's own form (Level C of 201 D4).\n//\n// Usage:\n// <script src=\"https://overturo.com/sdk/v1/overturo.js\"></script>\n// <script src=\"https://overturo.com/sdk/v1/overturo-field.js\"></script>\n// <form id=\"signup\">\n// <input id=\"email\" name=\"email\">\n// <overturo-consent-field name=\"consent\" flow=\"flw_…\"></overturo-consent-field>\n// </form>\n// overturo.forms.attach({ flowId: \"flw_…\", form: \"#signup\", field: \"overturo-consent-field\", subjectField: \"#email\" })\n//\n// The element renders nothing itself: it mounts the field document (served\n// by the trust host, no session) in a sandboxed frame, speaks the field-v1\n// protocol with it, and is a form-associated control to the host form (its\n// value is the capture token once captured). It never fetches anything.\n\nimport { FIELD_DOCUMENT_PATH, FIELD_ELEMENT_NAME, FIELD_MESSAGE_TYPES } from \"./constants\"\nimport { DEFAULT_BASE_URL } from \"../constants\"\nimport { encodeAppearance } from \"./appearance\"\nimport { fieldEnvelope, validateField, type FieldEnvelope } from \"./protocol\"\nimport { interceptSubmit } from \"../forms/intercept\"\nimport { resolveControl } from \"../forms/presentation\"\nimport type { FormCaptureOptions, FormCaptureResult, DecisionToken } from \"../types\"\n\nexport const FIELD_ALREADY_DEFINED_CODE = \"OVERTURO_FIELD_ELEMENT_ALREADY_DEFINED\"\n\nexport interface FieldCaptureRequest {\n subject?: { email?: string; external_id?: string }\n pageUrl?: string\n formId?: string\n submitter?: string | null\n commit?: boolean\n}\n\nexport interface FieldCaptureResult {\n token: string\n committed: boolean\n recordId: string | null\n}\n\nexport class FieldCaptureError extends Error {\n readonly code: string\n constructor(code: string, message?: string) {\n super(message || code)\n this.name = \"FieldCaptureError\"\n this.code = code\n }\n}\n\ninterface PendingCapture {\n resolve: (result: FieldCaptureResult) => void\n reject: (error: Error) => void\n}\n\nexport class ConsentFieldElement extends HTMLElement {\n static formAssociated = true\n static observedAttributes = [\"flow\", \"purposes\", \"locale\", \"theme\", \"name\", \"appearance\", \"publishable-key\", \"base-url\"]\n\n #internals: ElementInternals | null = null\n #shadow: ShadowRoot\n #iframe: HTMLIFrameElement | null = null\n #ac: AbortController | null = null\n #frameOrigin = \"\"\n #ready = false\n #value = \"\"\n #decisions: Record<string, \"granted\" | \"declined\"> = {}\n #pending: PendingCapture | null = null\n\n constructor() {\n super()\n this.#shadow = this.attachShadow({ mode: \"open\" })\n // jsdom (the unit tests) has no ElementInternals; the element still works, minus form association.\n if (typeof this.attachInternals === \"function\") {\n try {\n this.#internals = this.attachInternals()\n } catch {\n this.#internals = null\n }\n }\n }\n\n /** The capture token once captured; empty before. */\n get value(): string {\n return this.#value\n }\n\n /** The host form this control belongs to (form association), if any. */\n get form(): HTMLFormElement | null {\n return this.#internals?.form ?? this.closest(\"form\")\n }\n\n /** The last STATE the frame reported. */\n get decisions(): Record<string, \"granted\" | \"declined\"> {\n return { ...this.#decisions }\n }\n\n get ready(): boolean {\n return this.#ready\n }\n\n connectedCallback(): void {\n // A custom element is inline by default: its box would have no height and\n // the host form's following controls would overlap the frame (and swallow\n // clicks). The field takes the row it sits on.\n if (!this.style.display) this.style.display = \"block\"\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"group\")\n if (!this.hasAttribute(\"aria-label\")) this.setAttribute(\"aria-label\", this.getAttribute(\"name\") || \"Consent choices\")\n this.setAttribute(\"aria-busy\", \"true\")\n this.#mount()\n }\n\n disconnectedCallback(): void {\n this.#teardown()\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue || !this.isConnected) return\n if (name === \"name\") {\n // The accessible name only: the frame stays, a pending capture stays.\n this.setAttribute(\"aria-label\", newValue || \"Consent choices\")\n if (this.#iframe) this.#iframe.title = newValue || \"Consent choices\"\n return\n }\n this.#teardown()\n this.#mount()\n }\n\n /** The facade's handoff: the trust-host base and the publishable key the client was built with. */\n configure(opts: { flowBaseUrl: string; publishableKey: string }): void {\n this.setAttribute(\"base-url\", opts.flowBaseUrl.replace(/\\/+$/, \"\"))\n this.setAttribute(\"publishable-key\", opts.publishableKey)\n if (this.isConnected && !this.#iframe) this.#mount()\n }\n\n /** Asks the frame to capture; resolves on COMPLETE, rejects on ERROR. */\n capture(request: FieldCaptureRequest): Promise<FieldCaptureResult> {\n return new Promise<FieldCaptureResult>((resolve, reject) => {\n if (!this.#ready || !this.#frameOrigin) {\n reject(new FieldCaptureError(\"field_not_ready\", \"The consent field has not finished loading.\"))\n return\n }\n if (this.#pending) {\n reject(new FieldCaptureError(\"capture_in_flight\", \"A capture is already in progress; the first one answers.\"))\n return\n }\n this.#pending = { resolve, reject }\n this.#post(FIELD_MESSAGE_TYPES.CAPTURE, {\n subject: request.subject ?? {},\n page_url: request.pageUrl ?? null,\n form_id: request.formId ?? null,\n submitter: request.submitter ?? null,\n commit: request.commit === true,\n })\n })\n }\n\n /**\n * 202 D9 — the facade's handoff (`overturo.forms.attach({ field })` lands\n * here): the 201 submit interception is reused unchanged in shape, and the\n * capture is asked of this element instead of being read from the DOM.\n */\n attachTo(form: HTMLFormElement, opts: FormCaptureOptions, client: { flowBaseUrl: string; publishableKey: string }): () => void {\n if (!this.getAttribute(\"flow\")) this.setAttribute(\"flow\", opts.flowId)\n if (opts.locale && !this.getAttribute(\"locale\")) this.setAttribute(\"locale\", opts.locale)\n this.configure(client)\n return interceptSubmit(form, opts, async ({ submitter }) => {\n const subject = resolveControl(form, opts.subjectField)\n const external = opts.externalIdField ? resolveControl(form, opts.externalIdField) : null\n const outcome = await this.capture({\n subject: { email: subject?.value?.trim() || undefined, external_id: external?.value?.trim() || undefined },\n pageUrl: typeof window !== \"undefined\" ? window.location.href : undefined,\n formId: form.getAttribute(\"id\") || undefined,\n submitter: submitter?.getAttribute(\"name\") ?? null,\n commit: opts.commit === true,\n })\n const result: FormCaptureResult = {\n token: outcome.token as DecisionToken,\n attestationId: \"\",\n committed: outcome.committed,\n wordingVerdict: \"match\",\n recordId: outcome.recordId,\n }\n opts.onCaptured?.(result)\n return { token: outcome.token }\n })\n }\n\n /** Returns every control to its rendered state and clears the token. */\n reset(): void {\n this.#post(FIELD_MESSAGE_TYPES.RESET, {})\n this.#setValue(\"\")\n }\n\n /** Form-associated hook: the host form was reset. */\n formResetCallback(): void {\n this.reset()\n }\n\n #mount(): void {\n const flow = this.getAttribute(\"flow\")\n const key = this.getAttribute(\"publishable-key\")\n if (!flow || !key) return // wait for the facade's configure() or the attributes\n const base = (this.getAttribute(\"base-url\") || defaultBaseUrl()).replace(/\\/+$/, \"\")\n const url = new URL(`${base}${FIELD_DOCUMENT_PATH}/${encodeURIComponent(flow)}`)\n url.searchParams.set(\"pk\", key)\n for (const attr of [\"locale\", \"purposes\", \"theme\"] as const) {\n const value = this.getAttribute(attr)\n if (value) url.searchParams.set(attr, value)\n }\n const appearance = this.getAttribute(\"appearance\")\n if (appearance) {\n try {\n url.hash = encodeAppearance(JSON.parse(appearance))\n } catch {\n url.hash = \"\"\n }\n }\n this.#frameOrigin = url.origin\n\n const iframe = document.createElement(\"iframe\")\n iframe.src = url.toString()\n iframe.title = this.getAttribute(\"name\") || \"Consent choices\"\n // No `allow-forms`: the frame captures with fetch; `allow-popups` for the receipt-explanation link.\n iframe.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-popups\")\n iframe.setAttribute(\"referrerpolicy\", \"strict-origin\")\n iframe.style.cssText = \"width:100%;height:0;border:0;display:block;background:transparent;\"\n const nonce = readCspNonce()\n if (nonce) iframe.setAttribute(\"nonce\", nonce)\n iframe.addEventListener(\"error\", () => {\n this.#emit(\"field:error\", { code: \"iframe_load_failed\", message: \"The consent field failed to load.\" })\n this.setAttribute(\"aria-busy\", \"false\")\n })\n\n this.#ac = new AbortController()\n window.addEventListener(\"message\", this.#onMessage, { signal: this.#ac.signal })\n this.#iframe = iframe\n this.#shadow.appendChild(iframe)\n }\n\n #onMessage = (event: MessageEvent): void => {\n if (!this.#iframe || event.origin !== this.#frameOrigin) return\n // Only our own frame: a synthetic event with no source (any script on the\n // host page can dispatch one) or another frame at the trust origin is not it.\n const source = this.#iframe.contentWindow\n if (!source || event.source !== source) return\n const result = validateField(event.data)\n if (!result.valid) {\n this.#emit(\"field:error\", { code: \"protocol_violation\" })\n return\n }\n const envelope = event.data as FieldEnvelope\n switch (envelope.type) {\n case FIELD_MESSAGE_TYPES.READY:\n this.#ready = true\n this.setAttribute(\"aria-busy\", \"false\")\n this.#post(FIELD_MESSAGE_TYPES.INIT, this.getAttribute(\"locale\") ? { locale: this.getAttribute(\"locale\") } : {})\n this.#emit(\"field:ready\", {})\n break\n case FIELD_MESSAGE_TYPES.STATE:\n this.#decisions = { ...(envelope.payload.decisions as Record<string, \"granted\" | \"declined\">) }\n this.#emit(\"field:state\", { decisions: this.decisions })\n break\n case FIELD_MESSAGE_TYPES.RESIZE: {\n const height = (envelope.payload as { height?: number }).height\n if (typeof height === \"number\" && this.#iframe) this.#iframe.style.height = `${height}px`\n break\n }\n case FIELD_MESSAGE_TYPES.COMPLETE: {\n const payload = envelope.payload as { token: string; committed: boolean; record_id?: string | null }\n this.#setValue(payload.token)\n const outcome: FieldCaptureResult = { token: payload.token, committed: payload.committed === true, recordId: payload.record_id ?? null }\n this.#pending?.resolve(outcome)\n this.#pending = null\n this.#emit(\"field:complete\", outcome)\n break\n }\n case FIELD_MESSAGE_TYPES.ERROR: {\n const payload = envelope.payload as { code: string; message?: string }\n this.#pending?.reject(new FieldCaptureError(payload.code, payload.message))\n this.#pending = null\n this.#emit(\"field:error\", payload)\n break\n }\n case FIELD_MESSAGE_TYPES.SUBMIT_REQUESTED:\n this.form?.requestSubmit?.()\n break\n }\n }\n\n #post(type: (typeof FIELD_MESSAGE_TYPES)[keyof typeof FIELD_MESSAGE_TYPES], payload: Record<string, unknown>): void {\n const target = this.#iframe?.contentWindow\n if (!target || !this.#frameOrigin) return\n try {\n target.postMessage(fieldEnvelope(type, payload), this.#frameOrigin)\n } catch {\n // the frame went away\n }\n }\n\n #setValue(token: string): void {\n this.#value = token\n // jsdom's ElementInternals has no setFormValue; a real browser's does.\n if (this.#internals && typeof this.#internals.setFormValue === \"function\") this.#internals.setFormValue(token || null)\n }\n\n #emit(name: string, detail: unknown): void {\n this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }))\n }\n\n #teardown(): void {\n this.#ac?.abort()\n this.#ac = null\n if (this.#iframe?.parentNode) this.#iframe.parentNode.removeChild(this.#iframe)\n this.#iframe = null\n this.#ready = false\n this.#frameOrigin = \"\"\n this.#pending?.reject(new FieldCaptureError(\"field_unmounted\"))\n this.#pending = null\n this.setAttribute(\"aria-busy\", \"true\")\n }\n}\n\nfunction readCspNonce(): string | null {\n if (typeof document === \"undefined\") return null\n return document.querySelector('meta[name=\"csp-nonce\"]')?.getAttribute(\"content\") ?? null\n}\n\n/** The trust host the core defaults to; the host page's own origin serves no field document. */\nfunction defaultBaseUrl(): string {\n return DEFAULT_BASE_URL\n}\n\n/** Registers `<overturo-consent-field>` once; warns and skips when already defined. */\nexport function registerConsentFieldElement(): void {\n if (typeof customElements === \"undefined\") return\n if (customElements.get(FIELD_ELEMENT_NAME)) {\n // eslint-disable-next-line no-console\n console.warn(\"[overturo:sdk]\", FIELD_ALREADY_DEFINED_CODE, `<${FIELD_ELEMENT_NAME}> already registered; skipping.`)\n return\n }\n customElements.define(FIELD_ELEMENT_NAME, ConsentFieldElement)\n}\n","// 202 — `@overturo/js/field`: the embedded consent field entry, loaded\n// EXPLICITLY beside the core (a second import or script tag). Registering the\n// element is its side effect; the core facade (`overturo.forms.attach({ field })`)\n// recognises the element and reports a clear error when this entry is absent.\n\nexport {\n ConsentFieldElement,\n FieldCaptureError,\n FIELD_ALREADY_DEFINED_CODE,\n registerConsentFieldElement,\n type FieldCaptureRequest,\n type FieldCaptureResult,\n} from \"./element\"\nexport { FIELD_ELEMENT_NAME, FIELD_MESSAGE_TYPES, FIELD_PROTOCOL_VERSION, FIELD_DOCUMENT_PATH } from \"./constants\"\nexport { validateField, validateFieldEnvelope, validateFieldPayload, fieldEnvelope, type FieldEnvelope } from \"./protocol\"\nexport { encodeAppearance, sanitiseAppearance, APPEARANCE_KEYS, type FieldAppearance } from \"./appearance\"\n\nimport { registerConsentFieldElement } from \"./element\"\n\nregisterConsentFieldElement()\n\n// The IIFE build exposes `window.OverturoField` (tsup footer); nothing else to do here.\nexport { ConsentFieldElement as default } from \"./element\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,aAAwB,WAAW,KAAW;AAC5C,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