<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
  xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
  xsi:type="TaskPaneApp">

  <!-- Production: word.priviq.ai | Dev: localhost:3000

       WARUM EIN ZWEITES MANIFEST UND NICHT EIN GEMEINSAMES:

       Ein Manifest kann mehrere <Host>-Elemente tragen — für Excel+Word wäre
       das aber eine Falle. Microsoft Learn ("Understand the logic of API
       requirement configuration") ist ausdrücklich: <Set>-Elemente für WordApi
       UND ExcelApi im BASIS-Manifest deaktivieren das Add-in in ALLEN
       Office-Anwendungen. Das Excel-Manifest hat genau so ein Basis-
       <Requirements> mit ExcelApi 1.13 (nötig für insertWorksheetsFromBase64).

       Zwei Manifeste umgehen das vollständig und entkoppeln zugleich die
       Freigabezyklen: eine Word-Version zu heben zwingt niemanden, das
       Excel-Add-in im M365 Admin Center neu zu verteilen. -->

  <!-- STABIL HALTEN. Excel ist …0001, Word ist …0002, …0003 ist für PowerPoint
       reserviert. Die Id ist der Primärschlüssel jeder Installation: sie zu
       ändern behandelt Office als völlig neue App und bricht jede bestehende
       Installation. Bei Aktualisierungen NUR <Version> erhöhen. -->
  <Id>a1b2c3d4-e5f6-7890-abcd-ef1234560002</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Priviq AI GmbH</ProviderName>
  <DefaultLocale>de-DE</DefaultLocale>
  <DisplayName DefaultValue="Priviq Word Agent">
    <Override Locale="en-US" Value="Priviq Word Agent" />
  </DisplayName>
  <Description DefaultValue="KI-gestützte Dokumentarbeit — DSGVO-konform, gehostet in Deutschland">
    <Override Locale="en-US" Value="AI-powered document work — GDPR-compliant, hosted in Germany" />
  </Description>
  <IconUrl DefaultValue="https://word.priviq.ai/assets/priviq-logo-32.png" />
  <HighResolutionIconUrl DefaultValue="https://word.priviq.ai/assets/priviq-logo-64.png" />
  <SupportUrl DefaultValue="https://priviq.ai/support">
    <Override Locale="en-US" Value="https://priviq.ai/en/support" />
  </SupportUrl>

  <!-- agent.priviq.ai bedient sowohl die Agent-API als auch den Supabase-Proxy
       unter /supabase/*, ist also die einzige Backend-Herkunft des Panes. -->
  <AppDomains>
    <AppDomain>https://word.priviq.ai</AppDomain>
    <AppDomain>https://agent.priviq.ai</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Document" />
  </Hosts>

  <!-- WordApi 1.3 ist die Untergrenze, die die Werkzeuge tatsächlich brauchen:
         · paragraph.styleBuiltIn  (Gliederung lesen UND Überschriften setzen)
         · Word.Table rowCount / headerRowCount
         · document.properties
       Alle drei sind ab 1.3 verfügbar, und 1.3 gibt es auf Web, Windows und
       Mac — die Anforderung schliesst also keine Plattform aus, auf der wir
       laufen wollen. Höher zu gehen (1.4 für Kommentare) wäre teuer erkauft:
       insertComment scheitert in Word im Browser ohnehin. -->
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="WordApi" MinVersion="1.3" />
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="https://word.priviq.ai/taskpane.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <!-- xsi:type="Document" ist die VersionOverrides-Schreibweise für Word;
           im Basis-Manifest heisst derselbe Host Name="Document". -->
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title" />
            <Description resid="GetStarted.Description" />
            <LearnMoreUrl resid="GetStarted.LearnMoreUrl" />
          </GetStarted>

          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
              <Group id="PriviqGroup">
                <Label resid="PriviqGroup.Label" />
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16" />
                  <bt:Image size="32" resid="Icon.32x32" />
                  <bt:Image size="80" resid="Icon.80x80" />
                </Icon>

                <!-- Taskpane Button -->
                <Control xsi:type="Button" id="TaskpaneButton">
                  <Label resid="TaskpaneButton.Label" />
                  <Supertip>
                    <Title resid="TaskpaneButton.Label" />
                    <Description resid="TaskpaneButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16" />
                    <bt:Image size="32" resid="Icon.32x32" />
                    <bt:Image size="80" resid="Icon.80x80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>PriviqTaskpane</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://word.priviq.ai/assets/priviq-logo-16.png" />
        <bt:Image id="Icon.32x32" DefaultValue="https://word.priviq.ai/assets/priviq-logo-32.png" />
        <bt:Image id="Icon.80x80" DefaultValue="https://word.priviq.ai/assets/priviq-logo-80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Taskpane.Url" DefaultValue="https://word.priviq.ai/taskpane.html">
          <bt:Override Locale="en-US" Value="https://word.priviq.ai/taskpane.html" />
        </bt:Url>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://priviq.ai">
          <bt:Override Locale="en-US" Value="https://priviq.ai/en/" />
        </bt:Url>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="PriviqGroup.Label" DefaultValue="Priviq AI">
          <bt:Override Locale="en-US" Value="Priviq AI" />
        </bt:String>
        <bt:String id="TaskpaneButton.Label" DefaultValue="Word-Agent">
          <bt:Override Locale="en-US" Value="Word Agent" />
        </bt:String>
        <bt:String id="GetStarted.Title" DefaultValue="Priviq Word Agent">
          <bt:Override Locale="en-US" Value="Priviq Word Agent" />
        </bt:String>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Öffne den Priviq Word Agent für die Arbeit an deinem Dokument">
          <bt:Override Locale="en-US" Value="Open the Priviq Word Agent to work on your document" />
        </bt:String>
        <bt:String id="GetStarted.Description" DefaultValue="Prüfe Zahlen und Verweise, erstelle Textbausteine und arbeite an Anhang und Lagebericht — mit KI-Unterstützung.">
          <bt:Override Locale="en-US" Value="Check figures and cross-references, draft standard text, and work on notes and management reports with AI assistance." />
        </bt:String>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
