import { type MockedResponse } from "@apollo/client/testing";
import {
  GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
  GET_CONVERSATIONS,
  GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
  GET_CHAT_MESSAGES,
  GET_CORPUSES,
  GET_ANNOTATIONS_FOR_ANALYSIS,
  GET_DATACELLS_FOR_EXTRACT,
  GET_DOCUMENT_ANNOTATIONS_ONLY,
  GET_DOCUMENT_ANNOTATION_INDEX,
} from "../../src/graphql/queries";
import { SMART_LABEL_SEARCH_OR_CREATE } from "../../src/graphql/mutations";

import path from "path";

// Keep type imports
import type {
  RawDocumentType,
  RawServerAnnotationType,
} from "../../src/types/graphql-api";

import { LabelType } from "../../src/components/annotator/types/enums";
import {
  DOCUMENT_ANNOTATION_INDEX_LIMIT,
  OC_SECTION_LABEL,
} from "../../src/assets/configurations/constants";

export const PDF_DOC_ID = "pdf-doc-1";
export const TXT_DOC_ID = "txt-doc-1";
export const CORPUS_ID = "corpus-1";
export const MOCK_PDF_URL = `/mock-pdf/${PDF_DOC_ID}/test.pdf`;

// New Document ID for structural annotation test
export const PDF_DOC_ID_FOR_STRUCTURAL_TEST = "pdf-doc-structural-test";
export const MOCK_PDF_URL_FOR_STRUCTURAL_TEST = `/mock-pdf/${PDF_DOC_ID_FOR_STRUCTURAL_TEST}/test.pdf`;

export const TEST_PDF_PATH = path.resolve(
  __dirname,
  "../../../frontend/test-assets/test.pdf"
);
export const TEST_PAWLS_PATH = path.resolve(
  __dirname,
  "../../../frontend/test-assets/test.pawls"
);

export const createPageInfo = (
  hasNext = false,
  hasPrev = false,
  start = "",
  end = ""
) => ({
  __typename: "PageInfo",
  hasNextPage: hasNext,
  hasPreviousPage: hasPrev,
  startCursor: start,
  endCursor: end,
});

// ============================================================================
// Mock Analyses and Extracts
// ============================================================================

export const mockAnalysis1 = {
  id: "analysis-1",
  analysisName: "Entity Recognition Analysis",
  analysisCompleted: true,
  analysisStatus: "COMPLETE",
  analysisStarted: "2025-01-01T10:00:00Z",
  analyzer: {
    id: "analyzer-1",
    description:
      "**Entity Recognition Analyzer**\n\nIdentifies and extracts named entities such as persons, organizations, and locations from documents.",
    taskName: "entity_recognition",
    disabled: false,
    created: "2024-12-01T10:00:00Z",
    modified: "2024-12-15T10:00:00Z",
    creator: {
      id: "user-1",
      email: "test@example.com",
      username: "testuser",
      __typename: "UserType",
    },
    hostGremlin: {
      id: "gremlin-1",
      __typename: "GremlinEngineType_Write",
    },
    __typename: "AnalyzerType",
  },
  annotations: {
    totalCount: 2,
    edges: [],
    pageInfo: createPageInfo(),
    __typename: "AnnotationTypeConnection",
  },
  corpusAction: null,
  __typename: "AnalysisType",
};

export const mockAnalysis2 = {
  id: "analysis-2",
  analysisName: "Sentiment Analysis",
  analysisCompleted: true,
  analysisStatus: "COMPLETE",
  analysisStarted: "2025-01-02T10:00:00Z",
  analyzer: {
    id: "analyzer-2",
    description: "Analyzes document sentiment and tone",
    taskName: "sentiment_analysis",
    disabled: false,
    created: "2024-12-01T10:00:00Z",
    modified: "2024-12-15T10:00:00Z",
    creator: {
      id: "user-1",
      email: "test@example.com",
      username: "testuser",
      __typename: "UserType",
    },
    hostGremlin: {
      id: "gremlin-1",
      __typename: "GremlinEngineType_Write",
    },
    __typename: "AnalyzerType",
  },
  annotations: {
    totalCount: 8,
    edges: [],
    pageInfo: createPageInfo(),
    __typename: "AnnotationTypeConnection",
  },
  corpusAction: null,
  __typename: "AnalysisType",
};

export const mockExtract1 = {
  id: "extract-1",
  name: "Contract Parties Extract",
  created: "2025-01-01T10:00:00Z",
  modified: "2025-01-01T10:00:00Z",
  started: "2025-01-01T10:00:00Z",
  finished: "2025-01-01T10:05:00Z",
  isPublic: false,
  error: null,
  fieldset: {
    id: "fieldset-1",
    name: "Contract Parties",
    description: "Extracts party information from contracts",
    __typename: "FieldsetType",
  },
  corpusAction: null,
  creator: {
    id: "user-1",
    email: "test@example.com",
    username: "testuser",
    __typename: "UserType",
  },
  corpus: {
    id: CORPUS_ID,
    title: "Test Corpus",
    __typename: "CorpusType",
  },
  __typename: "ExtractType",
};

export const mockExtract2 = {
  id: "extract-2",
  name: "Financial Data Extract",
  created: "2025-01-02T10:00:00Z",
  modified: "2025-01-02T10:00:00Z",
  started: "2025-01-02T10:00:00Z",
  finished: "2025-01-02T10:08:00Z",
  isPublic: false,
  error: null,
  fieldset: {
    id: "fieldset-2",
    name: "Financial Data",
    description: "Extracts financial information",
    __typename: "FieldsetType",
  },
  corpusAction: null,
  creator: {
    id: "user-1",
    email: "test@example.com",
    username: "testuser",
    __typename: "UserType",
  },
  corpus: {
    id: CORPUS_ID,
    title: "Test Corpus",
    __typename: "CorpusType",
  },
  __typename: "ExtractType",
};

// Helper to create analysisRow structure expected by GraphQL query
const createAnalysisRow = (analysis: typeof mockAnalysis1) => ({
  id: `row-${analysis.id}`,
  analysis,
  data: {
    edges: [],
    __typename: "DatacellTypeConnection",
  },
  __typename: "DocumentAnalysisRowType",
});

// ============================================================================
// Mock Annotations for Analysis
// ============================================================================

export const mockAnalysisAnnotation1 = {
  id: "analysis-annotation-1",
  page: 0,
  parent: null,
  analysis: {
    id: "analysis-1",
    __typename: "AnalysisType",
  },
  annotationLabel: {
    id: "analysis-label-1",
    text: "PERSON",
    color: "#3b82f6",
    icon: "user",
    description: "Person entity",
    labelType: LabelType.TokenLabel,
    __typename: "AnnotationLabelType",
  },
  annotationType: LabelType.TokenLabel,
  rawText: "John Smith",
  json: {
    "0": {
      bounds: {
        top: 100,
        left: 50,
        right: 200,
        bottom: 120,
      },
      rawText: "John Smith",
      tokensJsons: [
        { pageIndex: 0, tokenIndex: 10 },
        { pageIndex: 0, tokenIndex: 11 },
      ],
    },
  },
  isPublic: false,
  myPermissions: [
    "update_annotation",
    "create_annotation",
    "remove_annotation",
    "publish_annotation",
    "read_annotation",
  ],
  structural: false,
  userFeedback: {
    edges: [],
    totalCount: 0,
    __typename: "UserFeedbackTypeConnection",
  },
  allSourceNodeInRelationship: [],
  allTargetNodeInRelationship: [],
  __typename: "AnnotationType",
};

export const mockAnalysisAnnotation2 = {
  id: "analysis-annotation-2",
  page: 0,
  parent: null,
  analysis: {
    id: "analysis-1",
    __typename: "AnalysisType",
  },
  annotationLabel: {
    id: "analysis-label-2",
    text: "ORGANIZATION",
    color: "#10b981",
    icon: "building",
    description: "Organization entity",
    labelType: LabelType.TokenLabel,
    __typename: "AnnotationLabelType",
  },
  annotationType: LabelType.TokenLabel,
  rawText: "Acme Corporation",
  json: {
    "0": {
      bounds: {
        top: 150,
        left: 50,
        right: 250,
        bottom: 170,
      },
      rawText: "Acme Corporation",
      tokensJsons: [
        { pageIndex: 0, tokenIndex: 25 },
        { pageIndex: 0, tokenIndex: 26 },
      ],
    },
  },
  isPublic: false,
  myPermissions: [
    "update_annotation",
    "create_annotation",
    "remove_annotation",
    "publish_annotation",
    "read_annotation",
  ],
  structural: false,
  userFeedback: {
    edges: [],
    totalCount: 0,
    __typename: "UserFeedbackTypeConnection",
  },
  allSourceNodeInRelationship: [],
  allTargetNodeInRelationship: [],
  __typename: "AnnotationType",
};

// ============================================================================
// Mock Columns and Datacells for Extract
// ============================================================================

export const mockColumn1 = {
  id: "column-1",
  name: "Party Name",
  query: "Extract the name of the contracting party",
  outputType: "str",
  limitToLabel: null,
  instructions: "Find and extract party names",
  extractIsList: false,
  taskName: "extract_party_name",
  __typename: "ColumnType",
};

export const mockColumn2 = {
  id: "column-2",
  name: "Party Role",
  query: "Extract the role of the party (e.g., buyer, seller)",
  outputType: "str",
  limitToLabel: null,
  instructions: "Identify party role",
  extractIsList: false,
  taskName: "extract_party_role",
  __typename: "ColumnType",
};

export const mockDatacell1 = {
  id: "datacell-1",
  column: {
    id: mockColumn1.id,
    name: mockColumn1.name,
    __typename: "ColumnType",
  },
  document: {
    id: PDF_DOC_ID,
    title: "Test PDF Document",
    __typename: "DocumentType",
  },
  data: JSON.stringify({ value: "Acme Corporation" }),
  dataDefinition: "Party name extracted from contract",
  started: "2025-01-01T10:00:00Z",
  completed: "2025-01-01T10:00:05Z",
  failed: false,
  correctedData: null,
  stacktrace: null,
  approvedBy: null,
  rejectedBy: null,
  fullSourceList: [
    {
      id: "datacell-source-1",
      annotationLabel: {
        id: "label-org",
        text: "ORGANIZATION",
        color: "#10b981",
        icon: "building",
        labelType: LabelType.SpanLabel,
        description: "Organization entity",
        __typename: "AnnotationLabelType",
      },
      boundingBox: JSON.stringify({
        top: 150,
        bottom: 170,
        left: 50,
        right: 250,
        page: 0,
      }),
      page: 0,
      rawText: "Acme Corporation",
      tokensJsons: JSON.stringify([
        { pageIndex: 0, tokenIndex: 25 },
        { pageIndex: 0, tokenIndex: 26 },
      ]),
      json: JSON.stringify({
        "0": {
          bounds: { top: 150, bottom: 170, left: 50, right: 250 },
          rawText: "Acme Corporation",
          tokensJsons: [
            { pageIndex: 0, tokenIndex: 25 },
            { pageIndex: 0, tokenIndex: 26 },
          ],
        },
      }),
      __typename: "AnnotationType",
    },
  ],
  __typename: "DatacellType",
};

export const mockDatacell2 = {
  id: "datacell-2",
  column: {
    id: mockColumn2.id,
    name: mockColumn2.name,
    __typename: "ColumnType",
  },
  document: {
    id: PDF_DOC_ID,
    title: "Test PDF Document",
    __typename: "DocumentType",
  },
  data: JSON.stringify({ value: "Buyer" }),
  dataDefinition: "Party role extracted from contract",
  started: "2025-01-01T10:00:00Z",
  completed: "2025-01-01T10:00:05Z",
  failed: false,
  correctedData: null,
  stacktrace: null,
  approvedBy: null,
  rejectedBy: null,
  fullSourceList: [],
  __typename: "DatacellType",
};

// ============================================================================
// GraphQL Mock Response Creators
// ============================================================================

/**
 * Creates a mock response for GET_ANNOTATIONS_FOR_ANALYSIS query
 */
export const createAnnotationsForAnalysisMock = (
  analysisId: string,
  documentId: string
) => ({
  request: {
    query: GET_ANNOTATIONS_FOR_ANALYSIS,
    variables: { analysisId, documentId },
  },
  result: {
    data: {
      analysis: {
        ...mockAnalysis1,
        id: analysisId,
        analyzer: {
          ...mockAnalysis1.analyzer,
          analyzerId: mockAnalysis1.analyzer.id,
          fullLabelList: [
            {
              id: "analysis-label-1",
              text: "PERSON",
              color: "#3b82f6",
              icon: "user",
              description: "Person entity",
              labelType: LabelType.TokenLabel,
              __typename: "AnnotationLabelType",
            },
            {
              id: "analysis-label-2",
              text: "ORGANIZATION",
              color: "#10b981",
              icon: "building",
              description: "Organization entity",
              labelType: LabelType.TokenLabel,
              __typename: "AnnotationLabelType",
            },
          ],
        },
        fullAnnotationList: [mockAnalysisAnnotation1, mockAnalysisAnnotation2],
        __typename: "AnalysisType",
      },
    },
  },
});

/**
 * Creates a mock response for GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS with analysis annotations included
 */
export const createDocumentKnowledgeMockWithAnalysisAnnotations = (
  documentId: string,
  corpusId: string,
  analysisId?: string
) => ({
  request: {
    query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
    variables: {
      documentId,
      corpusId,
      analysisId,
    },
  },
  result: {
    data: {
      document: {
        ...mockPdfDocument,
        allAnnotations: [mockAnalysisAnnotation1, mockAnalysisAnnotation2],
        allNotes: [mockNote1, mockNote2],
      },
      corpus: mockCorpusData,
    },
  },
});

/**
 * Creates a mock response for GET_DOCUMENT_ANNOTATIONS_ONLY with analysis annotations
 * This is what the PDF renderer queries for when displaying annotations
 */
export const createDocumentAnnotationsOnlyMock = (
  documentId: string,
  corpusId: string,
  analysisId: string | null | undefined
) => ({
  request: {
    query: GET_DOCUMENT_ANNOTATIONS_ONLY,
    variables: {
      documentId,
      corpusId,
      analysisId: analysisId ?? null,
    },
  },
  result: {
    data: {
      document: {
        id: documentId,
        allAnnotations: analysisId
          ? [mockAnalysisAnnotation1, mockAnalysisAnnotation2]
          : [],
        allRelationships: [],
        __typename: "DocumentType",
      },
    },
  },
});

/**
 * Creates a mock response for GET_DATACELLS_FOR_EXTRACT query
 */
export const createDatacellsForExtractMock = (extractId: string) => ({
  request: {
    query: GET_DATACELLS_FOR_EXTRACT,
    variables: { extractId },
  },
  result: {
    data: {
      extract: {
        ...mockExtract1,
        id: extractId,
        fieldset: {
          ...mockExtract1.fieldset,
          inUse: true,
          fullColumnList: [mockColumn1, mockColumn2],
          __typename: "FieldsetType",
        },
        fullDatacellList: [mockDatacell1, mockDatacell2],
        __typename: "ExtractType",
      },
    },
  },
});

export const mockPdfDocument: RawDocumentType = {
  id: PDF_DOC_ID,
  __typename: "DocumentType",
  title: "Test PDF Document",
  fileType: "application/pdf",
  pdfFile: MOCK_PDF_URL,
  pawlsParseFile: "test.pawls",
  txtExtractFile: null,
  mdSummaryFile: "dummy-summary.md",
  creator: { __typename: "UserType", id: "user-1", email: "test@test.com" },
  created: new Date("2023-10-26T10:00:00.000Z").toISOString(),
  myPermissions: [
    "read_document",
    "create_document",
    "update_document",
    "remove_document",
  ],
  allAnnotations: [], // Will be populated with mock annotations
  allStructuralAnnotations: [],
  allRelationships: [],
  allDocRelationships: [],
  allNotes: [], // Will be overridden in specific document mocks
};

// Mock Annotations for Structural Test based on provided examples
export const mockAnnotationStructural1: RawServerAnnotationType = {
  // Fields present in the provided example
  id: "QW5ub3RhdGlvblR5cGU6MQ==", // Example ID
  page: 0,
  parent: null,
  annotationLabel: {
    __typename: "AnnotationLabelType",
    id: "QW5ub3RhdGlvbkxhYmVsVHlwZTo0MQ==", // Example ID
    text: "page_header",
    color: "grey",
    icon: "expand",
    description: "Parser Structural Label",
    labelType: LabelType.TokenLabel, // Assuming "TOKEN_LABEL" maps to this // Example
  },
  annotationType: LabelType.TokenLabel, // Assuming "TOKEN_LABEL" maps to this
  rawText: "Exhibit 10.1",
  json: {
    "0": {
      bounds: {
        top: 52.19200000000001,
        left: 503.919,
        right: 544.95,
        bottom: 59.35000000000002,
        // page is often part of bounds in other systems, but not in example. Add if needed.
      },
      rawText: "Exhibit 10.1",
      tokensJsons: [
        { pageIndex: 0, tokenIndex: 0 },
        { pageIndex: 0, tokenIndex: 1 },
      ],
    },
  },
  isPublic: true,
  myPermissions: [
    "update_annotation",
    "create_annotation",
    "remove_annotation",
    "publish_annotation",
    "read_annotation",
  ],
  structural: true,
  __typename: "AnnotationType",
  // annotation_created was in example, created/modified is in ServerAnnotationType
};

export const mockAnnotationNonStructural1: RawServerAnnotationType = {
  // Fields present in the provided example
  id: "QW5ub3RhdasfasdasdfcGU6MQ==", // Example ID
  page: 0,
  parent: null,
  annotationLabel: {
    __typename: "AnnotationLabelType",
    id: "QW5ub3RhdGlvbkxhYmVsVHlwZTo0MQ==", // Example ID
    text: "page_header",
    color: "grey",
    icon: "expand",
    description: "Parser Structural Label",
    labelType: LabelType.TokenLabel, // Assuming "TOKEN_LABEL" maps to this // Example
  },
  annotationType: LabelType.TokenLabel, // Assuming "TOKEN_LABEL" maps to this
  rawText: "Exhibit 10.1",
  json: {
    "0": {
      bounds: {
        top: 52.19200000000001,
        left: 503.919,
        right: 544.95,
        bottom: 59.35000000000002,
        // page is often part of bounds in other systems, but not in example. Add if needed.
      },
      rawText: "Exhibit 10.1",
      tokensJsons: [
        { pageIndex: 0, tokenIndex: 0 },
        { pageIndex: 0, tokenIndex: 1 },
      ],
    },
  },
  myPermissions: [
    "update_annotation",
    "create_annotation",
    "remove_annotation",
    "publish_annotation",
    "read_annotation",
  ],
  isPublic: true,
  structural: false,
  __typename: "AnnotationType",
};

// Multi-page annotation that spans pages 1-3 (0-indexed: pages 0, 1, 2)
export const mockMultiPageAnnotation: RawServerAnnotationType = {
  id: "multi-page-annotation-1",
  page: 0, // First page as anchor
  parent: null,
  annotationLabel: {
    __typename: "AnnotationLabelType",
    id: "multi-page-label-1",
    text: "Multi-Page Section",
    color: "#FF6B6B",
    icon: "file" as any,
    description: "Annotation spanning multiple pages",
    labelType: LabelType.TokenLabel,
  },
  annotationType: LabelType.TokenLabel,
  rawText: "This is text that spans across multiple pages in the document",
  json: {
    // Page 1 (index 0)
    "0": {
      bounds: {
        top: 100,
        left: 50,
        right: 550,
        bottom: 150,
      },
      rawText: "This is text that",
      tokensJsons: [
        { pageIndex: 0, tokenIndex: 10 },
        { pageIndex: 0, tokenIndex: 11 },
        { pageIndex: 0, tokenIndex: 12 },
      ],
    },
    // Page 2 (index 1)
    "1": {
      bounds: {
        top: 50,
        left: 50,
        right: 550,
        bottom: 100,
      },
      rawText: "spans across multiple",
      tokensJsons: [
        { pageIndex: 1, tokenIndex: 0 },
        { pageIndex: 1, tokenIndex: 1 },
        { pageIndex: 1, tokenIndex: 2 },
      ],
    },
    // Page 3 (index 2)
    "2": {
      bounds: {
        top: 75,
        left: 50,
        right: 550,
        bottom: 125,
      },
      rawText: "pages in the document",
      tokensJsons: [
        { pageIndex: 2, tokenIndex: 5 },
        { pageIndex: 2, tokenIndex: 6 },
        { pageIndex: 2, tokenIndex: 7 },
        { pageIndex: 2, tokenIndex: 8 },
      ],
    },
  },
  structural: false,
  myPermissions: [
    "update_annotation",
    "create_annotation",
    "remove_annotation",
    "publish_annotation",
    "read_annotation",
  ],
  __typename: "AnnotationType",
};

export const mockPdfDocumentForStructuralTest: RawDocumentType = {
  id: PDF_DOC_ID_FOR_STRUCTURAL_TEST,
  __typename: "DocumentType",
  title: "Test PDF Document",
  fileType: "application/pdf",
  pdfFile: MOCK_PDF_URL_FOR_STRUCTURAL_TEST,
  pawlsParseFile: "test.pawls",
  txtExtractFile: null,
  mdSummaryFile: "dummy-summary.md",
  creator: { __typename: "UserType", id: "user-1", email: "test@test.com" },
  created: new Date("2023-10-26T10:00:00.000Z").toISOString(),
  myPermissions: [
    "read_document",
    "create_document",
    "update_document",
    "remove_document",
  ],
  allAnnotations: [
    mockAnnotationNonStructural1,
    mockAnnotationStructural1,
    mockMultiPageAnnotation,
  ],
  allStructuralAnnotations: [mockAnnotationStructural1],
  allRelationships: [],
  allDocRelationships: [],
  allNotes: [],
};

// Mock label for text annotations
const mockTextLabel = {
  __typename: "AnnotationLabelType" as const,
  id: "text-label-1",
  text: "Important Text",
  color: "#3B82F6",
  icon: "tag" as any,
  description: "Label for important text sections",
  labelType: LabelType.SpanLabel,
};

// Mock annotations for TXT document
export const mockTxtAnnotation1: RawServerAnnotationType = {
  id: "txt-annot-1",
  page: 0,
  parent: null,
  annotationLabel: mockTextLabel,
  annotationType: LabelType.SpanLabel,
  rawText: "Lorem ipsum",
  json: {
    start: 0,
    end: 11,
  },
  structural: false,
  myPermissions: ["read", "write", "delete", "update"],
  __typename: "AnnotationType",
};

export const mockTxtAnnotation2: RawServerAnnotationType = {
  id: "txt-annot-2",
  page: 0,
  parent: null,
  annotationLabel: mockTextLabel,
  annotationType: LabelType.SpanLabel,
  rawText: "consectetur adipiscing",
  json: {
    start: 28,
    end: 50,
  },
  structural: false,
  myPermissions: ["read", "write", "delete", "update"],
  __typename: "AnnotationType",
};

// Mock notes
const mockNote1 = {
  id: "note-1",
  __typename: "NoteType" as const,
  title: "Test Note 1",
  content: "This is a test note for the document.",
  created: new Date("2023-10-26T10:00:00.000Z").toISOString(),
  modified: new Date("2023-10-26T10:00:00.000Z").toISOString(),
  creator: {
    __typename: "UserType" as const,
    id: "user-1",
    email: "test@test.com",
  },
  corpus: null,
  document: { __typename: "DocumentType" as const, id: PDF_DOC_ID },
  page: 1,
  myPermissions: ["read", "write", "delete", "update"],
};

const mockNote2 = {
  id: "note-2",
  __typename: "NoteType" as const,
  title: "Another Note",
  content: "This is another test note.",
  created: new Date("2023-10-26T11:00:00.000Z").toISOString(),
  modified: new Date("2023-10-26T11:00:00.000Z").toISOString(),
  creator: {
    __typename: "UserType" as const,
    id: "user-1",
    email: "test@test.com",
  },
  corpus: null,
  document: { __typename: "DocumentType" as const, id: PDF_DOC_ID },
  page: 2,
  myPermissions: ["read", "write", "delete", "update"],
};

export const mockTxtDocument: RawDocumentType = {
  ...mockPdfDocument,
  id: TXT_DOC_ID,
  title: "Test TXT Document",
  fileType: "text/plain",
  pdfFile: undefined,
  pawlsParseFile: undefined,
  txtExtractFile: "dummy-txt.txt",
  mdSummaryFile: undefined,
  allAnnotations: [mockTxtAnnotation1, mockTxtAnnotation2],
};

// ============================================================================
// DOCX Document Mocks
// ============================================================================

export const DOCX_DOC_ID = "docx-doc-1";
export const MOCK_DOCX_URL = `/mock-docx/${DOCX_DOC_ID}/test.docx`;

export const TEST_DOCX_PATH = path.resolve(__dirname, "../fixtures/test.docx");

export const mockDocxAnnotation1: RawServerAnnotationType = {
  id: "docx-annot-1",
  page: 0,
  parent: null,
  annotationLabel: mockTextLabel,
  annotationType: LabelType.SpanLabel,
  rawText: "Hello World",
  json: {
    start: 0,
    end: 11,
  },
  structural: false,
  myPermissions: ["read", "write", "delete", "update"],
  __typename: "AnnotationType",
};

export const mockDocxDocument: RawDocumentType = {
  ...mockPdfDocument,
  id: DOCX_DOC_ID,
  title: "Test DOCX Document",
  fileType:
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  pdfFile: MOCK_DOCX_URL,
  pawlsParseFile: undefined,
  txtExtractFile: "docx-text-extract.txt",
  mdSummaryFile: undefined,
  allAnnotations: [mockDocxAnnotation1],
};

export const mockCorpusData = {
  id: CORPUS_ID,
  __typename: "CorpusType",
  name: "Test Corpus",
  myPermissions: [
    "read_corpus",
    "create_corpus",
    "update_corpus",
    "remove_corpus",
  ],
  labelSet: {
    __typename: "LabelSetType",
    id: "ls-1",
    allAnnotationLabels: [
      {
        __typename: "AnnotationLabelType",
        id: "lbl-span-1",
        text: "Person",
        labelType: LabelType.TokenLabel,
        color: "#FF0000",
        icon: undefined,
        description: "A person entity",
      },
      {
        __typename: "AnnotationLabelType",
        id: "text-label-1",
        text: "Important Text",
        labelType: LabelType.SpanLabel,
        color: "#3B82F6",
        icon: undefined,
        description: "Label for important text sections",
      },
      {
        __typename: "AnnotationLabelType",
        id: "lbl-rel-1",
        text: "Connects",
        labelType: LabelType.RelationshipLabel,
        color: "#00FF00",
        icon: undefined,
        description: "A connection relationship",
      },
      {
        __typename: "AnnotationLabelType",
        id: "lbl-doc-1",
        text: "Contract",
        labelType: LabelType.DocTypeLabel,
        color: "#0000FF",
        icon: undefined,
        description: "A contract document type",
      },
    ],
  },
};

// Mock summary versions for document summary testing
const mockSummaryVersions = [
  {
    id: "rev-1",
    version: 1,
    created: "2025-01-24T14:00:00Z",
    snapshot: "# Mock Summary Title\n\nMock summary details.",
    diff: "",
    author: {
      id: "user-1",
      username: "testuser",
      email: "test@example.com",
      __typename: "UserType",
    },
    __typename: "DocumentSummaryRevision",
  },
];

// Define mocks needed by the tests
export const graphqlMocks: ReadonlyArray<MockedResponse> = [
  // ... (keep all existing mocks as they are) ...
  // --- Add mock for the unexpected initial call with empty documentId ---
  {
    request: {
      query: GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
      variables: { documentId: "", corpusId: CORPUS_ID }, // Match the empty string call
    },
    result: {
      data: {
        documentCorpusActions: {
          __typename: "DocumentCorpusActionsType",
          corpusActions: {
            __typename: "CorpusActionsType",
            extracts: {
              __typename: "ExtractTypeConnection",
              edges: [],
              pageInfo: createPageInfo(),
            },
            analyses: {
              __typename: "AnalysisTypeConnection",
              edges: [],
              pageInfo: createPageInfo(),
            },
          },
          extracts: [],
          analysisRows: [],
        },
      },
    },
  },
  // 1) Original knowledge+annotations query for PDF (First call)
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: PDF_DOC_ID,
        corpusId: CORPUS_ID,
        analysisId: undefined,
      },
    },
    result: {
      data: {
        document: {
          ...mockPdfDocument,
          allNotes: [mockNote1, mockNote2],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // --- Add the PDF knowledge+annotations query AGAIN for the refetch ---
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: PDF_DOC_ID,
        corpusId: CORPUS_ID,
        analysisId: undefined, // Assuming refetch doesn't add analysisId initially
      },
    },
    result: {
      data: {
        document: {
          ...mockPdfDocument,
          allNotes: [mockNote1, mockNote2],
        },
        corpus: mockCorpusData,
      },
    }, // Same result
  },
  // 2) Original knowledge+annotations query for TXT
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: TXT_DOC_ID,
        corpusId: CORPUS_ID,
        analysisId: undefined,
      },
    },
    result: {
      data: {
        document: {
          ...mockTxtDocument,
          allNotes: [mockNote1, mockNote2],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // 2b) TXT knowledge+annotations query without analysisId (Apollo strips undefined)
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: TXT_DOC_ID,
        corpusId: CORPUS_ID,
      },
    },
    result: {
      data: {
        document: {
          ...mockTxtDocument,
          allNotes: [mockNote1, mockNote2],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // 2c) TXT knowledge+annotations query AGAIN for refetch
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: TXT_DOC_ID,
        corpusId: CORPUS_ID,
      },
    },
    result: {
      data: {
        document: {
          ...mockTxtDocument,
          allNotes: [mockNote1, mockNote2],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // 3) CORRECTED: Stub for Analyses/Extracts (documentCorpusActions) - PDF
  {
    request: {
      query: GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
      variables: { documentId: PDF_DOC_ID, corpusId: CORPUS_ID },
    },
    result: {
      data: {
        documentCorpusActions: {
          __typename: "DocumentCorpusActionsType",
          corpusActions: [],
          extracts: [mockExtract1, mockExtract2],
          analysisRows: [
            createAnalysisRow(mockAnalysis1),
            createAnalysisRow(mockAnalysis2),
          ],
        },
      },
    },
  },
  // 3b) Stub for Analyses/Extracts (documentCorpusActions) - TXT
  {
    request: {
      query: GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
      variables: { documentId: TXT_DOC_ID, corpusId: CORPUS_ID },
    },
    result: {
      data: {
        documentCorpusActions: {
          __typename: "DocumentCorpusActionsType",
          corpusActions: [],
          extracts: [],
          analysisRows: [],
        },
      },
    },
  },
  // 4) Stub for GetConversations - PDF
  {
    request: {
      query: GET_CONVERSATIONS,
      variables: {
        documentId: PDF_DOC_ID,
        limit: undefined,
        cursor: undefined,
        title_Contains: undefined,
        createdAt_Gte: undefined,
        createdAt_Lte: undefined,
      },
    },
    result: {
      data: {
        conversations: {
          __typename: "ConversationTypeConnection",
          edges: [],
          pageInfo: createPageInfo(),
        },
      },
    },
  },
  // 4b) Stub for GetConversations - TXT
  {
    request: {
      query: GET_CONVERSATIONS,
      variables: {
        documentId: TXT_DOC_ID,
        limit: undefined,
        cursor: undefined,
        title_Contains: undefined,
        createdAt_Gte: undefined,
        createdAt_Lte: undefined,
      },
    },
    result: {
      data: {
        conversations: {
          __typename: "ConversationTypeConnection",
          edges: [],
          pageInfo: createPageInfo(),
        },
      },
    },
  },
  // --- DOCX Document Mocks ---
  // 5) DOCX knowledge+annotations query (first call)
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: DOCX_DOC_ID,
        corpusId: CORPUS_ID,
        analysisId: undefined,
      },
    },
    result: {
      data: {
        document: {
          ...mockDocxDocument,
          allNotes: [],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // 5b) DOCX knowledge+annotations query without analysisId (Apollo strips undefined)
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: DOCX_DOC_ID,
        corpusId: CORPUS_ID,
      },
    },
    result: {
      data: {
        document: {
          ...mockDocxDocument,
          allNotes: [],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // 5c) DOCX knowledge+annotations query AGAIN for refetch
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: DOCX_DOC_ID,
        corpusId: CORPUS_ID,
      },
    },
    result: {
      data: {
        document: {
          ...mockDocxDocument,
          allNotes: [],
        },
        corpus: mockCorpusData,
      },
    },
  },
  // 5d) DOCX annotations-only query
  {
    request: {
      query: GET_DOCUMENT_ANNOTATIONS_ONLY,
      variables: {
        documentId: DOCX_DOC_ID,
        corpusId: CORPUS_ID,
        analysisId: null,
      },
    },
    result: {
      data: {
        document: {
          id: DOCX_DOC_ID,
          allStructuralAnnotations: [],
          allAnnotations: [mockDocxAnnotation1],
          allRelationships: [],
          __typename: "DocumentType",
        },
      },
    },
  },
  // 5e) Stub for Analyses/Extracts (documentCorpusActions) - DOCX
  {
    request: {
      query: GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
      variables: { documentId: DOCX_DOC_ID, corpusId: CORPUS_ID },
    },
    result: {
      data: {
        documentCorpusActions: {
          __typename: "DocumentCorpusActionsType",
          corpusActions: [],
          extracts: [],
          analysisRows: [],
        },
      },
    },
  },
  // 5f) Stub for GetConversations - DOCX
  {
    request: {
      query: GET_CONVERSATIONS,
      variables: {
        documentId: DOCX_DOC_ID,
        limit: undefined,
        cursor: undefined,
        title_Contains: undefined,
        createdAt_Gte: undefined,
        createdAt_Lte: undefined,
      },
    },
    result: {
      data: {
        conversations: {
          __typename: "ConversationTypeConnection",
          edges: [],
          pageInfo: createPageInfo(),
        },
      },
    },
  },
  // Add a mock variant for GET_DOCUMENT_ANALYSES_AND_EXTRACTS with only documentId
  {
    request: {
      query: GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
      variables: { documentId: PDF_DOC_ID }, // Only documentId
    },
    result: {
      // Provide the same minimal successful result structure
      data: {
        documentCorpusActions: {
          __typename: "DocumentCorpusActionsType",
          corpusActions: [],
          extracts: [],
          analysisRows: [],
        },
      },
    },
  },
  // --- Mocks for Structural Annotation Test Document ---
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: PDF_DOC_ID_FOR_STRUCTURAL_TEST,
        corpusId: CORPUS_ID,
        analysisId: undefined,
      },
    },
    result: {
      data: {
        document: mockPdfDocumentForStructuralTest,
        corpus: mockCorpusData,
      },
    },
  },
  // Duplicate for potential refetch
  {
    request: {
      query: GET_DOCUMENT_KNOWLEDGE_AND_ANNOTATIONS,
      variables: {
        documentId: PDF_DOC_ID_FOR_STRUCTURAL_TEST,
        corpusId: CORPUS_ID,
        analysisId: undefined,
      },
    },
    result: {
      data: {
        document: mockPdfDocumentForStructuralTest,
        corpus: mockCorpusData,
      },
    },
  },
  // Analyses/Extracts for Structural Test Document
  {
    request: {
      query: GET_DOCUMENT_ANALYSES_AND_EXTRACTS,
      variables: {
        documentId: PDF_DOC_ID_FOR_STRUCTURAL_TEST,
        corpusId: CORPUS_ID,
      },
    },
    result: {
      data: {
        documentCorpusActions: {
          __typename: "DocumentCorpusActionsType",
          corpusActions: [],
          extracts: [],
          analysisRows: [],
        },
      },
    },
  },
  // Conversations for Structural Test Document
  {
    request: {
      query: GET_CONVERSATIONS,
      variables: {
        documentId: PDF_DOC_ID_FOR_STRUCTURAL_TEST,
        limit: undefined,
        cursor: undefined,
        title_Contains: undefined,
        createdAt_Gte: undefined,
        createdAt_Lte: undefined,
      },
    },
    result: {
      data: {
        conversations: {
          __typename: "ConversationTypeConnection",
          edges: [],
          pageInfo: createPageInfo(),
        },
      },
    },
  },
  // Minimal corpus list mock so <Corpuses> loads without infinite load
  {
    request: {
      query: GET_CORPUSES,
      variables: {},
    },
    result: {
      data: {
        corpuses: {
          __typename: "CorpusTypeConnection",
          edges: [
            {
              __typename: "CorpusTypeEdge",
              node: {
                __typename: "CorpusType",
                id: CORPUS_ID,
                title: "Sample Corpus",
                description: "",
                myPermissions: ["read_corpus"],
              },
            },
          ],
          pageInfo: createPageInfo(),
        },
      },
    },
  },
  // Same query but with *no* variables object – MockedProvider treats this as a separate match
  {
    request: {
      query: GET_CORPUSES,
    },
    result: {
      data: {
        corpuses: {
          __typename: "CorpusTypeConnection",
          edges: [
            {
              __typename: "CorpusTypeEdge",
              node: {
                __typename: "CorpusType",
                id: CORPUS_ID,
                title: "Sample Corpus",
                description: "",
                myPermissions: ["read_corpus"],
              },
            },
          ],
          pageInfo: createPageInfo(),
        },
      },
    },
  },
  // Mock for smart label search or create mutation
  {
    request: {
      query: SMART_LABEL_SEARCH_OR_CREATE,
      variables: {
        corpusId: CORPUS_ID,
        searchTerm: "Test Label",
        labelType: LabelType.TokenLabel,
        color: "#1a75bc",
        description: "",
        createIfNotFound: true,
        labelsetTitle: undefined,
        labelsetDescription: undefined,
      },
    },
    result: {
      data: {
        smartLabelSearchOrCreate: {
          ok: true,
          message: "Created label 'Test Label'",
          labels: [
            {
              __typename: "AnnotationLabelType",
              id: "new-label-1",
              text: "Test Label",
              description: "",
              color: "#1a75bc",
              icon: "tag",
              labelType: LabelType.TokenLabel,
            },
          ],
          labelset: {
            __typename: "LabelSetType",
            id: "ls-1",
            title: "Test Corpus Labels",
            description: "Labels for Test Corpus",
          },
          labelsetCreated: false,
          labelCreated: true,
        },
      },
    },
  },
  // Mock for smart label mutation with labelset creation
  {
    request: {
      query: SMART_LABEL_SEARCH_OR_CREATE,
      variables: {
        corpusId: CORPUS_ID,
        searchTerm: "New Label With Labelset",
        labelType: LabelType.SpanLabel,
        color: "#1a75bc",
        description: "",
        createIfNotFound: true,
        labelsetTitle: "Test Corpus Labels",
        labelsetDescription: "",
      },
    },
    result: {
      data: {
        smartLabelSearchOrCreate: {
          ok: true,
          message:
            "Created labelset 'Test Corpus Labels' and label 'New Label With Labelset'",
          labels: [
            {
              __typename: "AnnotationLabelType",
              id: "new-label-2",
              text: "New Label With Labelset",
              description: "",
              color: "#1a75bc",
              icon: "tag",
              labelType: LabelType.SpanLabel,
            },
          ],
          labelset: {
            __typename: "LabelSetType",
            id: "new-ls-1",
            title: "Test Corpus Labels",
            description: "",
          },
          labelsetCreated: true,
          labelCreated: true,
        },
      },
    },
  },
];

export const CHAT_MESSAGES_PAYLOAD = {
  conversations: {
    edges: [
      {
        node: {
          id: "Q29udmVyc2F0aW9uVHlwZToz",
          title: "Transfer Taxes in Document Analysis",
          createdAt: "2025-05-19T05:23:56.913169+00:00",
          updatedAt: "2025-05-19T05:23:58.482189+00:00",
          creator: {
            id: "VXNlclR5cGU6Mw==",
            email: "scrudato@umich.edu",
            __typename: "UserType",
          },
          chatMessages: {
            totalCount: 2,
            __typename: "MessageTypeConnection",
          },
          isPublic: false,
          myPermissions: [],
          __typename: "ConversationType",
        },
        __typename: "ConversationTypeEdge",
      },
      {
        node: {
          id: "Q29udmVyc2F0aW9uVHlwZToy",
          title: "Transfer Taxes in Document Analysis",
          createdAt: "2025-05-19T05:17:30.973110+00:00",
          updatedAt: "2025-05-19T05:17:32.044191+00:00",
          creator: {
            id: "VXNlclR5cGU6Mw==",
            email: "scrudato@umich.edu",
            __typename: "UserType",
          },
          chatMessages: {
            totalCount: 2,
            __typename: "MessageTypeConnection",
          },
          isPublic: false,
          myPermissions: [],
          __typename: "ConversationType",
        },
        __typename: "ConversationTypeEdge",
      },
      {
        node: {
          id: "Q29udmVyc2F0aW9uVHlwZTox",
          title: "Tax Transfers Document Summary",
          createdAt: "2025-05-19T04:33:00.003664+00:00",
          updatedAt: "2025-05-19T04:33:02.400566+00:00",
          creator: {
            id: "VXNlclR5cGU6Mw==",
            email: "scrudato@umich.edu",
            __typename: "UserType",
          },
          chatMessages: {
            totalCount: 2,
            __typename: "MessageTypeConnection",
          },
          isPublic: false,
          myPermissions: [],
          __typename: "ConversationType",
        },
        __typename: "ConversationTypeEdge",
      },
    ],
    pageInfo: {
      hasNextPage: false,
      hasPreviousPage: false,
      startCursor: "YXJyYXljb25uZWN0aW9uOjA=",
      endCursor: "YXJyYXljb25uZWN0aW9uOjI=",
      __typename: "PageInfo",
    },
    __typename: "ConversationTypeConnection",
  },
};

// ============================================================================
// Index Tab Mocks (Document Annotation Index / TOC)
// ============================================================================
export const indexTabMocks = [
  /* document annotation index (TOC) – TXT doc with sections ------------ */
  ...Array.from({ length: 2 }).map(() => ({
    request: {
      query: GET_DOCUMENT_ANNOTATION_INDEX,
      variables: {
        documentId: TXT_DOC_ID,
        corpusId: CORPUS_ID,
        labelText: OC_SECTION_LABEL,
        first: DOCUMENT_ANNOTATION_INDEX_LIMIT,
      },
    },
    result: {
      data: {
        annotations: {
          edges: [
            {
              node: {
                id: "section-1",
                rawText: "Introduction",
                longDescription: null,
                page: 0,
                parent: null,
                __typename: "AnnotationType",
              },
              __typename: "AnnotationTypeEdge",
            },
            {
              node: {
                id: "section-2",
                rawText: "Terms and Conditions",
                longDescription: null,
                page: 0,
                parent: null,
                __typename: "AnnotationType",
              },
              __typename: "AnnotationTypeEdge",
            },
          ],
          totalCount: 2,
          __typename: "AnnotationTypeConnection",
        },
      },
    },
  })),
  /* document annotation index for PDF doc (empty) ---------------------- */
  ...Array.from({ length: 2 }).map(() => ({
    request: {
      query: GET_DOCUMENT_ANNOTATION_INDEX,
      variables: {
        documentId: PDF_DOC_ID,
        corpusId: CORPUS_ID,
        labelText: OC_SECTION_LABEL,
        first: DOCUMENT_ANNOTATION_INDEX_LIMIT,
      },
    },
    result: {
      data: {
        annotations: {
          edges: [],
          totalCount: 0,
          __typename: "AnnotationTypeConnection",
        },
      },
    },
  })),
];

export const chatTrayMocks = [
  /* conversations list ------------------------------------------------- */
  {
    request: {
      query: GET_CONVERSATIONS,
      variables: {
        documentId: PDF_DOC_ID,
        corpusId: CORPUS_ID,
        limit: undefined,
        cursor: undefined,
        title_Contains: undefined,
        createdAt_Gte: undefined,
        createdAt_Lte: undefined,
      },
    },
    result: {
      data: CHAT_MESSAGES_PAYLOAD,
    },
  },

  /* chat messages for the first conversation -------------------------- */
  /*  variants: without orderBy and with `orderBy: null` (robust match) */
  ...[undefined, null].map((orderBy) => ({
    request: {
      query: GET_CHAT_MESSAGES,
      variables: {
        conversationId: "Q29udmVyc2F0aW9uVHlwZToz", // first conv edge
        orderBy,
      },
    },
    result: {
      data: {
        chatMessages: [
          {
            id: "TWVzc2FnZVR5cGU6NQ==",
            msgType: "HUMAN",
            content: "What does this document say about Transfer Taxes?",
            data: {},
            __typename: "MessageType",
          },
          {
            id: "TWVzc2FnZVR5cGU6Ng==",
            msgType: "LLM",
            content:
              "The document specifies that Transfer Taxes, which include transfer, sales, value added, stamp duty, and similar taxes, are handled as follows:\n\n- **U.S. Government Taxes**: These are to be borne by ETON.\n- **Ex-U.S. Government Taxes**: These are to be borne by Aucta.",
            data: {
              sources: [
                {
                  json: {
                    "11": {
                      bounds: {
                        top: 168.97299999999996,
                        left: 50.05,
                        right: 131.481,
                        bottom: 176.13099999999997,
                      },
                      rawText: "10. TRANSFER TAXES",
                      tokensJsons: [
                        {
                          pageIndex: 11,
                          tokenIndex: 216,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 217,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 218,
                        },
                      ],
                    },
                  },
                  page: 11,
                  label: "section_header",
                  rawText: "10. TRANSFER TAXES",
                  label_id: 43,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 149,
                },
                {
                  json: {
                    "11": {
                      bounds: {
                        top: 179.07299999999998,
                        left: 50.05,
                        right: 544.95,
                        bottom: 207.02200000000005,
                      },
                      rawText:
                        "All transfer, sales, value added, stamp duty and similar Taxes (' Transfer Taxes ') payable to the U.S. government in connection with the transaction contemplated hereby will be borne by ETON and all Transfer Taxes payable to an ex-U.S. government in connection with the transaction contemplated hereby will be borne by Aucta.",
                      tokensJsons: [
                        {
                          pageIndex: 11,
                          tokenIndex: 219,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 220,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 221,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 222,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 223,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 224,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 225,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 226,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 227,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 228,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 229,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 230,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 231,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 232,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 233,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 234,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 235,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 236,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 237,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 238,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 239,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 240,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 241,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 242,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 243,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 244,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 245,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 246,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 247,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 248,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 249,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 250,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 251,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 252,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 253,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 254,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 255,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 256,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 257,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 258,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 259,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 260,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 261,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 262,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 263,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 264,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 265,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 266,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 267,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 268,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 269,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 270,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 271,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 272,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 273,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 274,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 275,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 276,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 277,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 278,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 279,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 280,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 281,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 282,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 283,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 284,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 285,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 286,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 287,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 288,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 289,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 290,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 291,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 292,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 293,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 294,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 295,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 296,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 297,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 298,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 299,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 300,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 301,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 302,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 303,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 304,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 305,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 306,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 307,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 308,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 309,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 310,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 311,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 312,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 313,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 314,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 315,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 316,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 317,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 318,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 319,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 320,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 321,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 322,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 323,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 324,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 325,
                        },
                        {
                          pageIndex: 11,
                          tokenIndex: 326,
                        },
                      ],
                    },
                  },
                  page: 11,
                  label: "text",
                  rawText:
                    "All transfer, sales, value added, stamp duty and similar Taxes (' Transfer Taxes ') payable to the U.S. government in connection with the transaction contemplated hereby will be borne by ETON and all Transfer Taxes payable to an ex-U.S. government in connection with the transaction contemplated hereby will be borne by Aucta.",
                  label_id: 42,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 150,
                },
                {
                  json: {
                    "4": {
                      bounds: {
                        top: 99.53599999999994,
                        left: 80.35,
                        right: 412.388,
                        bottom: 106.69399999999996,
                      },
                      rawText:
                        "1.40 ' Transfer Taxes ' shall have the meaning ascribed to this term in Section 10 of this Agreement.",
                      tokensJsons: [
                        {
                          pageIndex: 4,
                          tokenIndex: 72,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 73,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 74,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 75,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 76,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 77,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 78,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 79,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 80,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 81,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 82,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 83,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 84,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 85,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 86,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 87,
                        },
                        {
                          pageIndex: 4,
                          tokenIndex: 88,
                        },
                      ],
                    },
                  },
                  page: 4,
                  label: "list_item",
                  rawText:
                    "1.40 ' Transfer Taxes ' shall have the meaning ascribed to this term in Section 10 of this Agreement.",
                  label_id: 44,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 64,
                },
                {
                  json: {
                    "3": {
                      bounds: {
                        top: 193.59199999999998,
                        left: 50.05,
                        right: 544.95,
                        bottom: 261.942,
                      },
                      rawText:
                        "1.35 ' Taxes ' means taxes, duties, fees, premiums, assessments, imposts, levies and other charges of any kind whatsoever imposed by any Governmental Entity, including all interest, penalties, fines, additions to tax or other additional amounts imposed by any Governmental Entity in respect thereof, and including those levied on, or measured by, or referred to as, income, gross receipts, profits, capital, transfer, land transfer, sales, goods and services, harmonized sales, use, value-added, excise, stamp, withholding, business, franchising, property, development, occupancy, employer health, payroll, employment, health, social services, education and social security taxes, all surtaxes, all customs duties and import and export taxes, countervail and anti-dumping, all license, franchise and registration fees and all employment insurance, health insurance and government pension plan premiums or contributions.",
                      tokensJsons: [
                        {
                          pageIndex: 3,
                          tokenIndex: 205,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 206,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 207,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 208,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 209,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 210,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 211,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 212,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 213,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 214,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 215,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 216,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 217,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 218,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 219,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 220,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 221,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 222,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 223,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 224,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 225,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 226,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 227,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 228,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 229,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 230,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 231,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 232,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 233,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 234,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 235,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 236,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 237,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 238,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 239,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 240,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 241,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 242,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 243,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 244,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 245,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 246,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 247,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 248,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 249,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 250,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 251,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 252,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 253,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 254,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 255,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 256,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 257,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 258,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 259,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 260,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 261,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 262,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 263,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 264,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 265,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 266,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 267,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 268,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 269,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 270,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 271,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 272,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 273,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 274,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 275,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 276,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 277,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 278,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 279,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 280,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 281,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 282,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 283,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 284,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 285,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 286,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 287,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 288,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 289,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 290,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 291,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 292,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 293,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 294,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 295,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 296,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 297,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 298,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 299,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 300,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 301,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 302,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 303,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 304,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 305,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 306,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 307,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 308,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 309,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 310,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 311,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 312,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 313,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 314,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 315,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 316,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 317,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 318,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 319,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 320,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 321,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 322,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 323,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 324,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 325,
                        },
                        {
                          pageIndex: 3,
                          tokenIndex: 326,
                        },
                      ],
                    },
                  },
                  page: 3,
                  label: "list_item",
                  rawText:
                    "1.35 ' Taxes ' means taxes, duties, fees, premiums, assessments, imposts, levies and other charges of any kind whatsoever imposed by any Governmental Entity, including all interest, penalties, fines, additions to tax or other additional amounts imposed by any Governmental Entity in respect thereof, and including those levied on, or measured by, or referred to as, income, gross receipts, profits, capital, transfer, land transfer, sales, goods and services, harmonized sales, use, value-added, excise, stamp, withholding, business, franchising, property, development, occupancy, employer health, payroll, employment, health, social services, education and social security taxes, all surtaxes, all customs duties and import and export taxes, countervail and anti-dumping, all license, franchise and registration fees and all employment insurance, health insurance and government pension plan premiums or contributions.",
                  label_id: 44,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 56,
                },
                {
                  json: {
                    "8": {
                      bounds: {
                        top: 57.24199999999996,
                        left: 50.05,
                        right: 544.95,
                        bottom: 114.86000000000001,
                      },
                      rawText:
                        "6.6 Taxes. Each Party shall be responsible for and shall pay all Taxes payable on any income earned or received by it during the Term. Where required by law, ETON shall have the right to withhold applicable Taxes from any payments to be made hereunder by ETON to Aucta. Any Tax, duty or other levy paid or required to be withheld by ETON on account of any payments payable to Aucta under this Agreement shall be deducted from the amount of payments due to Aucta. ETON shall secure and promptly send to Aucta proof of such Taxes, duties or other levies withheld and paid by ETON for the benefit of Aucta. Each Party agrees to cooperate with the other Party in claiming exemptions from such deductions or withholdings under any agreement or treaty from time to time in effect.",
                      tokensJsons: [
                        {
                          pageIndex: 8,
                          tokenIndex: 1,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 2,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 3,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 4,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 5,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 6,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 7,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 8,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 9,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 10,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 11,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 12,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 13,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 14,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 15,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 16,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 17,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 18,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 19,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 20,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 21,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 22,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 23,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 24,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 25,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 26,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 27,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 28,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 29,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 30,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 31,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 32,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 33,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 34,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 35,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 36,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 37,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 38,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 39,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 40,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 41,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 42,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 43,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 44,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 45,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 46,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 47,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 48,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 49,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 50,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 51,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 52,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 53,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 54,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 55,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 56,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 57,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 58,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 59,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 60,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 61,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 62,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 63,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 64,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 65,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 66,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 67,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 68,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 69,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 70,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 71,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 72,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 73,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 74,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 75,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 76,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 77,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 78,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 79,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 80,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 81,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 82,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 83,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 84,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 85,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 86,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 87,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 88,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 89,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 90,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 91,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 92,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 93,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 94,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 95,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 96,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 97,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 98,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 99,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 100,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 101,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 102,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 103,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 104,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 105,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 106,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 107,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 108,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 109,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 110,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 111,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 112,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 113,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 114,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 115,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 116,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 117,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 118,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 119,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 120,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 121,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 122,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 123,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 124,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 125,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 126,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 127,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 128,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 129,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 130,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 131,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 132,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 133,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 134,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 135,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 136,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 137,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 138,
                        },
                        {
                          pageIndex: 8,
                          tokenIndex: 139,
                        },
                      ],
                    },
                  },
                  page: 8,
                  label: "text",
                  rawText:
                    "6.6 Taxes. Each Party shall be responsible for and shall pay all Taxes payable on any income earned or received by it during the Term. Where required by law, ETON shall have the right to withhold applicable Taxes from any payments to be made hereunder by ETON to Aucta. Any Tax, duty or other levy paid or required to be withheld by ETON on account of any payments payable to Aucta under this Agreement shall be deducted from the amount of payments due to Aucta. ETON shall secure and promptly send to Aucta proof of such Taxes, duties or other levies withheld and paid by ETON for the benefit of Aucta. Each Party agrees to cooperate with the other Party in claiming exemptions from such deductions or withholdings under any agreement or treaty from time to time in effect.",
                  label_id: 42,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 121,
                },
                {
                  json: {
                    "20": {
                      bounds: {
                        top: 158.24199999999996,
                        left: 50.05,
                        right: 544.95,
                        bottom: 215.86,
                      },
                      rawText:
                        "15.8 Assignment. The terms and provisions hereof shall inure to the benefit of, and be binding upon the Parties and their respective successors and permitted assigns. The Parties shall not assign, encumber or otherwise transfer this Agreement or any part of it to any Third Party, without the prior written consent of the other Party. Notwithstanding the foregoing, each Party may assign the rights and obligations under this Agreement in whole, without consent of the other Party, to a Third Party or Affiliate in connection with the transfer or sale of all or substantially all of its business or in the event of a merger, consolidation or change in control provided that the assignee assumes in writing and becomes directly obligated to the other Party to perform all of the obligations of assignor under this Agreement.",
                      tokensJsons: [
                        {
                          pageIndex: 20,
                          tokenIndex: 174,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 175,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 176,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 177,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 178,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 179,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 180,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 181,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 182,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 183,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 184,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 185,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 186,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 187,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 188,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 189,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 190,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 191,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 192,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 193,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 194,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 195,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 196,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 197,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 198,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 199,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 200,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 201,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 202,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 203,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 204,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 205,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 206,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 207,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 208,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 209,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 210,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 211,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 212,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 213,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 214,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 215,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 216,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 217,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 218,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 219,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 220,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 221,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 222,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 223,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 224,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 225,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 226,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 227,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 228,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 229,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 230,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 231,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 232,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 233,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 234,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 235,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 236,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 237,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 238,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 239,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 240,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 241,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 242,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 243,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 244,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 245,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 246,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 247,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 248,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 249,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 250,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 251,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 252,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 253,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 254,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 255,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 256,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 257,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 258,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 259,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 260,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 261,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 262,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 263,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 264,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 265,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 266,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 267,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 268,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 269,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 270,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 271,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 272,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 273,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 274,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 275,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 276,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 277,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 278,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 279,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 280,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 281,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 282,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 283,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 284,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 285,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 286,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 287,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 288,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 289,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 290,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 291,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 292,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 293,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 294,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 295,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 296,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 297,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 298,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 299,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 300,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 301,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 302,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 303,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 304,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 305,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 306,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 307,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 308,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 309,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 310,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 311,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 312,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 313,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 314,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 315,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 316,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 317,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 318,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 319,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 320,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 321,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 322,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 323,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 324,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 325,
                        },
                        {
                          pageIndex: 20,
                          tokenIndex: 326,
                        },
                      ],
                    },
                  },
                  page: 20,
                  label: "list_item",
                  rawText:
                    "15.8 Assignment. The terms and provisions hereof shall inure to the benefit of, and be binding upon the Parties and their respective successors and permitted assigns. The Parties shall not assign, encumber or otherwise transfer this Agreement or any part of it to any Third Party, without the prior written consent of the other Party. Notwithstanding the foregoing, each Party may assign the rights and obligations under this Agreement in whole, without consent of the other Party, to a Third Party or Affiliate in connection with the transfer or sale of all or substantially all of its business or in the event of a merger, consolidation or change in control provided that the assignee assumes in writing and becomes directly obligated to the other Party to perform all of the obligations of assignor under this Agreement.",
                  label_id: 44,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 253,
                },
                {
                  json: {
                    "2": {
                      bounds: {
                        top: 204.95399999999995,
                        left: 50.05,
                        right: 544.95,
                        bottom: 324.43499999999995,
                      },
                      rawText:
                        "1.26 ' Net Sales ' means, with respect to each Product sold in the Territory, the aggregate gross sales amount invoiced by ETON or any sublicensee or other party authorized by ETON to wholesale or distribute the Products on an arms-length basis to Third Parties in the Territory (' Gross Sales '), less (as applicable) the following ETON expenses as accrued and adjusted for amounts actually taken, consistent with ETON'S standard accounting practices in accordance with GAAP: (a) amounts refunded or credited for returned, damaged, outdated, short-dated or defective goods, and bad debts, and (b) all of the following: (i) taxes, duties and other governmental charges related to the production, use or sale of the Products (including, including without limitation the brand manufacturer's tax imposed pursuant to the Patient Protection and Affordable Care Act (Pub. L. No. 111-148) as amended or replaced, but not including taxes assessed against the income derived from such sale)\u037e (ii) trade, quantity and cash discounts, allowances, retroactive price adjustments, credit incentive payments, chargebacks, patient support programs, and rebates (including governmental rebates or other price reductions provided, based on sales by ETON to any Governmental Entity or regulatory authority in respect of state or federal Medicare, Medicaid, government pricing or similar programs\u037e)\u037e and (iii) any costs incurred in connection with or arising out of compliance with any Risk Evaluation and Mitigation Strategies approved by the FDA and (iv) any expenses associated with serialization of the Products. Distribution of Licensed Products for clinical trials or as samples will not be deemed a 'Net Sale' under this definition.",
                      tokensJsons: [
                        {
                          pageIndex: 2,
                          tokenIndex: 207,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 208,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 209,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 210,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 211,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 212,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 213,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 214,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 215,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 216,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 217,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 218,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 219,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 220,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 221,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 222,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 223,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 224,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 225,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 226,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 227,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 228,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 229,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 230,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 231,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 232,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 233,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 234,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 235,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 236,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 237,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 238,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 239,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 240,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 241,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 242,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 243,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 244,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 245,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 246,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 247,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 248,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 249,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 250,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 251,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 252,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 253,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 254,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 255,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 256,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 257,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 258,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 259,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 260,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 261,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 262,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 263,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 264,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 265,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 266,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 267,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 268,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 269,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 270,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 271,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 272,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 273,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 274,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 275,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 276,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 277,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 278,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 279,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 280,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 281,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 282,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 283,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 284,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 285,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 286,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 287,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 288,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 289,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 290,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 291,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 292,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 293,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 294,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 295,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 296,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 297,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 298,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 299,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 300,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 301,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 302,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 303,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 304,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 305,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 306,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 307,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 308,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 309,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 310,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 311,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 312,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 313,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 314,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 315,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 316,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 317,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 318,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 319,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 320,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 321,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 322,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 323,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 324,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 325,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 326,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 327,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 328,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 329,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 330,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 331,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 332,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 333,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 334,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 335,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 336,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 337,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 338,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 339,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 340,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 341,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 342,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 343,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 344,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 345,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 346,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 347,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 348,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 349,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 350,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 351,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 352,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 353,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 354,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 355,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 356,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 357,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 358,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 359,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 360,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 361,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 362,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 363,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 364,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 365,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 366,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 367,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 368,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 369,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 370,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 371,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 372,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 373,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 374,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 375,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 376,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 377,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 378,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 379,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 380,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 381,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 382,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 383,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 384,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 385,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 386,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 387,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 388,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 389,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 390,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 391,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 392,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 393,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 394,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 395,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 396,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 397,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 398,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 399,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 400,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 401,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 402,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 403,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 404,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 405,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 406,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 407,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 408,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 409,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 410,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 411,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 412,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 413,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 414,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 415,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 416,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 417,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 418,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 419,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 420,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 421,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 422,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 423,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 424,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 425,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 426,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 427,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 428,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 429,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 430,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 431,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 432,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 433,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 434,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 435,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 436,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 437,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 438,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 439,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 440,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 441,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 442,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 443,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 444,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 445,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 446,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 447,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 448,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 449,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 450,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 451,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 452,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 453,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 454,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 455,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 456,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 457,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 458,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 459,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 460,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 461,
                        },
                        {
                          pageIndex: 2,
                          tokenIndex: 462,
                        },
                      ],
                    },
                  },
                  page: 2,
                  label: "text",
                  rawText:
                    "1.26 ' Net Sales ' means, with respect to each Product sold in the Territory, the aggregate gross sales amount invoiced by ETON or any sublicensee or other party authorized by ETON to wholesale or distribute the Products on an arms-length basis to Third Parties in the Territory (' Gross Sales '), less (as applicable) the following ETON expenses as accrued and adjusted for amounts actually taken, consistent with ETON'S standard accounting practices in accordance with GAAP: (a) amounts refunded or credited for returned, damaged, outdated, short-dated or defective goods, and bad debts, and (b) all of the following: (i) taxes, duties and other governmental charges related to the production, use or sale of the Products (including, including without limitation the brand manufacturer's tax imposed pursuant to the Patient Protection and Affordable Care Act (Pub. L. No. 111-148) as amended or replaced, but not including taxes assessed against the income derived from such sale)\u037e (ii) trade, quantity and cash discounts, allowances, retroactive price adjustments, credit incentive payments, chargebacks, patient support programs, and rebates (including governmental rebates or other price reductions provided, based on sales by ETON to any Governmental Entity or regulatory authority in respect of state or federal Medicare, Medicaid, government pricing or similar programs\u037e)\u037e and (iii) any costs incurred in connection with or arising out of compliance with any Risk Evaluation and Mitigation Strategies approved by the FDA and (iv) any expenses associated with serialization of the Products. Distribution of Licensed Products for clinical trials or as samples will not be deemed a 'Net Sale' under this definition.",
                  label_id: 42,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 44,
                },
                {
                  json: {
                    "7": {
                      bounds: {
                        top: 107.74300000000005,
                        left: 61.412,
                        right: 544.95,
                        bottom: 135.06100000000004,
                      },
                      rawText:
                        "6.3.3 If the amount of royalty payment under Section 6.3.1 is less than the amount of royalty payment under Section 6.3.2, then ETON shall pay Aucta the difference between royalty payments in Sections 6.3.1 and 6.3.2 within sixty (60) days of the calendar year end, but in no event shall the difference paid be greater than the minimum amount in Section 6.3.2.",
                      tokensJsons: [
                        {
                          pageIndex: 7,
                          tokenIndex: 67,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 68,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 69,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 70,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 71,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 72,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 73,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 74,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 75,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 76,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 77,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 78,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 79,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 80,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 81,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 82,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 83,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 84,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 85,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 86,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 87,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 88,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 89,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 90,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 91,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 92,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 93,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 94,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 95,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 96,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 97,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 98,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 99,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 100,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 101,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 102,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 103,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 104,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 105,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 106,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 107,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 108,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 109,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 110,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 111,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 112,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 113,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 114,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 115,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 116,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 117,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 118,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 119,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 120,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 121,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 122,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 123,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 124,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 125,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 126,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 127,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 128,
                        },
                      ],
                    },
                  },
                  page: 7,
                  label: "text",
                  rawText:
                    "6.3.3 If the amount of royalty payment under Section 6.3.1 is less than the amount of royalty payment under Section 6.3.2, then ETON shall pay Aucta the difference between royalty payments in Sections 6.3.1 and 6.3.2 within sixty (60) days of the calendar year end, but in no event shall the difference paid be greater than the minimum amount in Section 6.3.2.",
                  label_id: 42,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 111,
                },
                {
                  json: {
                    "7": {
                      bounds: {
                        top: 87.543,
                        left: 122.013,
                        right: 420.594,
                        bottom: 94.66099999999994,
                      },
                      rawText:
                        "6.3.1 ETON shall pay to Aucta a royalty payment of [ * * * ] of Net Sales of the Products.",
                      tokensJsons: [
                        {
                          pageIndex: 7,
                          tokenIndex: 40,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 41,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 42,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 43,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 44,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 45,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 46,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 47,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 48,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 49,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 50,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 51,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 52,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 53,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 54,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 55,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 56,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 57,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 58,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 59,
                        },
                        {
                          pageIndex: 7,
                          tokenIndex: 60,
                        },
                      ],
                    },
                  },
                  page: 7,
                  label: "text",
                  rawText:
                    "6.3.1 ETON shall pay to Aucta a royalty payment of [ * * * ] of Net Sales of the Products.",
                  label_id: 42,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 109,
                },
                {
                  json: {
                    "15": {
                      bounds: {
                        top: 87.54200000000003,
                        left: 61.412,
                        right: 544.95,
                        bottom: 104.75999999999999,
                      },
                      rawText:
                        "12.2.1  it has the corporate power and authority to enter into this Agreement and to consummate the transactions contemplated hereby\u037e",
                      tokensJsons: [
                        {
                          pageIndex: 15,
                          tokenIndex: 44,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 45,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 46,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 47,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 48,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 49,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 50,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 51,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 52,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 53,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 54,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 55,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 56,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 57,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 58,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 59,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 60,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 61,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 62,
                        },
                        {
                          pageIndex: 15,
                          tokenIndex: 63,
                        },
                      ],
                    },
                  },
                  page: 15,
                  label: "text",
                  rawText:
                    "12.2.1  it has the corporate power and authority to enter into this Agreement and to consummate the transactions contemplated hereby\u037e",
                  label_id: 42,
                  bounding_box: {
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                  },
                  annotation_id: 187,
                },
              ],
              message_id: 6,
            },
            __typename: "MessageType",
          },
        ],
      },
    },
  })),
  /* chat messages – initial load + a possible refetch ---------------- */
  ...Array.from({ length: 2 }).map(() => ({
    request: {
      query: GET_CHAT_MESSAGES,
      variables: {
        conversationId: "Q29udmVyc2F0aW9uVHlwZToz", // first conv edge
        limit: 10, // ← added field
      },
    },
    result: { data: CHAT_MESSAGES_PAYLOAD },
  })),
  ...indexTabMocks,
];
