PageSourceSearch

https://portal.litelog.de/assets/HannahIntegrationPage-CjRB0fvN.js

js litelog.de collected 2026-10-07 03:54:09 UTC 11,644 bytes, 1 lines download raw bytes

1import{r as u,C as e}from"./vendor-core-kDn7q5nn.js";import{g as V,iZ as I,aN as Z,bc as X,i as M,A as W,b2 as Y,jP as ee,jL as te,jQ as ne,a5 as ae}from"./app-shared-D9Va_FlY.js";import{H as se,u as ie}from"./HannahToolPermissionsCard-DWID1Y8N.js";import{E as v,q as o,l as H,r as p,B as k,an as re,ao as le,s as D,S as oe,P as ce,g as B,Q as de,bv as ue,bM as he}from"./antd-DUwX4n57.js";import"./pro-components-U2bZqxZr.js";import"./mapbox-DrKvbh0K.js";import"./xlsx-DLNWaC59.js";import"./calendar-C0yHFNg9.js";import"./iso-3166-D9CfHPRA.js";import"./charts-B4kAPUKr.js";import"./html2canvas-CBrSDip1.js";const pe={attendance:"attendance",checkpoint:"checkpoint",incident:"incident_create",knowledge_doc:"document_upload"};function F(r,t){const n=pe[r];return!!n&&!!t&&!t.has(n)}const C=[{type:"location",actions:["attendance","checkpoint","ask"]},{type:"photo",actions:["incident","knowledge_doc","ask"]},{type:"document",actions:["knowledge_doc","incident","ask"]},{type:"audio",actions:["incident","ask"]}],b=()=>({location:"auto",photo:"auto",qr:"auto",document:"auto",audio:"auto"});function fe(r){const t=b(),n=new Map;for(const s of r)if(s.enabled)if(s.propertyId==null)t[s.inputType]=s.action;else{const d=n.get(s.propertyId)??b();d[s.inputType]=s.action,n.set(s.propertyId,d)}return{defaults:t,byProperty:n}}function w(r,t){const n=[];for(const{type:s}of C){const d=r[s];d!=="auto"&&n.push({propertyId:null,inputType:s,action:d,enabled:!0})}for(const s of t)if(s.propertyId!=null)for(const{type:d}of C){const g=s.rules[d];g!=="auto"&&n.push({propertyId:s.propertyId,inputType:d,action:g,enabled:!0})}return n}function ge({enabledCaps:r,embedded:t=!1}){const{t:n}=V("portal"),[s,d]=u.useState(!0),[g,j]=u.useState(!1),[m,T]=u.useState(b()),[h,x]=u.useState([]),P=u.useRef(JSON.stringify(w(b(),[]))),E=u.useMemo(()=>JSON.stringify(w(m,h))!==P.current,[m,h]);u.useEffect(()=>{let a=!1;return I.getInputRules().then(async i=>{const{defaults:l,byProperty:f}=fe(i),c=await Promise.all(Array.from(f.entries()).map(async([y,R])=>{let A;try{const z=await Z.getPropertyDataById(y);A=z==null?void 0:z.name}catch{}return{key:y,propertyId:y,name:A,rules:R}}));a||(P.current=JSON.stringify(w(l,c)),T(l),x(c))}).catch(()=>{}).finally(()=>!a&&d(!1)),()=>{a=!0}},[]);const S=u.useCallback((a,i)=>n(`hannahRules.${a}.${i}`,{defaultValue:me[`${a}.${i}`]??i}),[n]),N=n("hannahRules.capDisabled",{defaultValue:' (unter „Was Hannah darf" deaktiviert)'}),$=(a,i,l,f)=>e.jsx(oe,{size:"small",style:{minWidth:220},value:l,onChange:f,options:[{value:"auto",label:S("action","auto")},...i.map(c=>{const y=F(c,r);return{value:c,disabled:y&&l!==c,label:y?`${S("action",c)}${N}`:S("action",c)}})]}),K=(a,i)=>T(l=>({...l,[a]:i})),G=(a,i,l)=>x(f=>f.map(c=>c.key===a?{...c,rules:{...c.rules,[i]:l}}:c)),Q=u.useMemo(()=>new Set(h.map(a=>a.propertyId).filter(a=>a!=null)),[h]),J=()=>x(a=>[...a,{key:Date.now(),rules:b()}]),q=a=>x(i=>i.filter(l=>l.key!==a)),U=async()=>{j(!0);try{await I.updateInputRules(w(m,h)),D.success(n("hannahRules.saved",{defaultValue:"Regeln gespeichert."}))}catch{D.error(n("hannahRules.saveError",{defaultValue:"Speichern fehlgeschlagen."}))}finally{j(!1)}},O=(a,i)=>e.jsx(p,{direction:"vertical",size:8,style:{width:"100%"},children:C.map(({type:l,actions:f})=>{const c=a(l),y=c!=="auto"&&F(c,r);return e.jsxs("div",{children:[e.jsxs(p,{style:{width:"100%",justifyContent:"space-between"},wrap:!0,children:[e.jsx(o.Text,{children:S("type",l)}),$(l,f,c,R=>i(l,R))]}),y&&e.jsx(o.Text,{type:"warning",style:{fontSize:12},children:n("hannahRules.capDisabledWarning",{defaultValue:'Diese Aktion ist unter „Was Hannah darf" deaktiviert und wird nicht ausgeführt.'})})]},l)})});return e.jsxs(v,{variant:t?"borderless":"outlined",style:t?{width:"100%",marginTop:8}:{maxWidth:560,marginTop:16},styles:t?{body:{padding:0}}:void 0,children:[e.jsx(o.Title,{level:5,style:{marginTop:0},children:n("hannahRules.title",{defaultValue:"Wie Hannah Nachrichten verarbeitet"})}),e.jsx(o.Paragraph,{type:"secondary",children:n("hannahRules.description",{defaultValue:'Lege fest, was Hannah mit einem geteilten Standort, einem Foto, einem Dokument oder einer Sprachnachricht tut. „Automatisch" richtet sich nach den Einstellungen des Objekts.'})}),s?e.jsx(H,{active:!0}):e.jsxs(p,{direction:"vertical",size:20,style:{width:"100%"},children:[e.jsxs("div",{children:[e.jsx(o.Text,{strong:!0,children:n("hannahRules.tenantDefault",{defaultValue:"Standard für alle Objekte"})}),e.jsx("div",{style:{marginTop:12},children:O(a=>m[a],K)}),e.jsx(o.Paragraph,{type:"secondary",style:{fontSize:12,marginTop:8,marginBottom:0},children:n("hannahRules.qrHint",{defaultValue:"QR-Codes (Anmelde- und Kontrollpunkt-Codes
1) werden automatisch erkannt und ausgeführt."})})]}),e.jsxs("div",{style:{borderTop:"1px solid #f0f0f0",paddingTop:16},children:[e.jsx(o.Text,{strong:!0,children:n("hannahRules.overrides",{defaultValue:"Ausnahmen pro Objekt"})}),e.jsx(o.Paragraph,{type:"secondary",style:{marginTop:4},children:n("hannahRules.overridesHint",{defaultValue:"Überschreibt den Standard für einzelne Objekte."})}),e.jsxs(p,{direction:"vertical",size:16,style:{width:"100%"},children:[h.map(a=>e.jsxs(v,{size:"small",style:{background:"#fafafa"},children:[e.jsxs(p,{style:{width:"100%",justifyContent:"space-between",marginBottom:8},children:[e.jsxs("div",{style:{flex:1,minWidth:240},children:[a.name&&e.jsx(o.Text,{strong:!0,style:{display:"block",marginBottom:4},children:a.name}),e.jsx(X,{syncToUrl:!1,fullWidth:!0,size:"small",onChange:i=>x(l=>l.map(f=>f.key===a.key?{...f,propertyId:i==null?void 0:i.property_id,name:i==null?void 0:i.name}:f))})]}),e.jsx(k,{type:"text",danger:!0,size:"small",icon:e.jsx(re,{}),onClick:()=>q(a.key)})]}),a.propertyId!=null&&O(i=>a.rules[i],(i,l)=>G(a.key,i,l)),a.propertyId!=null&&Q.size!==h.length&&e.jsx(o.Text,{type:"warning",style:{fontSize:12},children:n("hannahRules.dupWarning",{defaultValue:"Jedes Objekt nur einmal anlegen."})})]},a.key)),e.jsx(k,{icon:e.jsx(le,{}),onClick:J,size:"small",children:n("hannahRules.addOverride",{defaultValue:"Objekt-Ausnahme hinzufügen"})})]})]}),e.jsxs(p,{size:12,wrap:!0,children:[e.jsx(k,{type:"primary",loading:g,disabled:!E,onClick:U,children:n("hannahRules.save",{defaultValue:"Speichern"})}),E&&e.jsx(o.Text,{type:"warning",children:n("hannahRules.unsaved",{defaultValue:"Ungespeicherte Änderungen"})})]})]})]})}const me={"type.location":"Standort geteilt","type.photo":"Foto (ohne QR-Code)","type.document":"Dokument / Datei","type.audio":"Sprachnachricht","action.auto":"Automatisch (nach Objekt)","action.attendance":"An-/Abmelden","action.checkpoint":"Rundgang-Kontrollpunkt","action.incident":"Meldung anlegen","action.knowledge_doc":"In Wissensdatenbank ablegen","action.ask":"Nachfragen (Auswahl-Knöpfe)"};function L(r){return`${r.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2})} €`}const ye=()=>{const{t:r}=V("portal"),[t,n]=u.useState(null),[s,d]=u.useState(!0);if(u.useEffect(()=>{let h=!1;return I.getBudget().then(x=>{h||n(x)}).catch(()=>{h||n(null)}).finally(()=>{h||d(!1)}),()=>{h=!0}},[]),s)return e.jsx(H,{active:!0,paragraph:{rows:1},title:!1});if(!t||t.limit_eur==null||t.percent==null)return null;const g=t.percent>=100,j=Math.min(t.percent,100),m=g?"exception":"normal",T=g?"#8B0000":t.almost_full?"#854F0B":void 0;return e.jsxs(v,{style:{maxWidth:560,marginTop:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:6},children:[e.jsx(o.Text,{strong:!0,children:r("hannahBudget.title",{defaultValue:"Hannah-Gratis-Budget (Telefonie & Chat)"})}),e.jsx(o.Text,{type:"secondary",children:r("hannahBudget.usage",{defaultValue:"{{used}} von {{limit}}",used:L(t.used_eur),limit:L(t.limit_eur)})})]}),e.jsx(ce,{percent:j,status:m,strokeColor:T,showInfo:!1,size:"small"}),g?e.jsx(B,{type:"warning",showIcon:!0,title:r("hannahBudget.exhausted",{defaultValue:"Gratis-Budget aufgebraucht — Hannah pausiert bis zum nächsten Monat."})}):t.almost_full?e.jsx(B,{type:"info",showIcon:!0,title:r("hannahBudget.almostFull",{defaultValue:"Gratis-Budget fast aufgebraucht."})}):null]})};function xe({link:r}){const{t}=V("portal"),n=M(),{pairing:s,pairingBusy:d,generatePairing:g}=r,[j,m]=u.useState(void 0);return e.jsxs(p,{direction:"vertical",size:16,style:{width:"100%",maxWidth:560},children:[e.jsx(v,{children:e.jsxs(p,{direction:"vertical",size:16,style:{width:"100%"},children:[e.jsx(k,{type:"primary",onClick:()=>n(W.EMPFANGO),children:t("postfachSettings.open",{defaultValue:"Postfach öffnen"})}),e.jsxs("div",{style:{borderTop:"1px solid #f0f0f0",paddingTop:16},children:[e.jsx(o.Text,{strong:!0,children:t("postfachSettings.pairTitle",{defaultValue:"Hannah im Chat verbinden"})}),e.jsx(o.Paragraph,{type:"secondary",style:{marginTop:4,marginBottom:12},children:t("postfachSettings.pairDescription",{defaultValue:"Erzeuge einen einmaligen Link, um dein Konto mit Hannah in Telegram zu verbinden. Danach beantwortet Hannah dir Fragen zu deinen Objekten und Daten."})}),e.jsx(k,{loading:d,onClick:g,children:t("postfachSettings.pairGenerate",{defaultValue:"Verbindungslink erzeugen"})}),s&&(s.deepLinkTelegram?e.jsxs(p,{direction:"vertical",size:12,style:{marginTop:16,width:"100%"},children:[e.jsx(de,{value:s.deepLinkTelegram,size:160}),e.jsx(o.Text,{type:"secondary",children:t("postfachSettings.pairScan",{defaultValue:"QR mit dem Handy scannen oder auf den Link tippen (10 Min gültig):"})}),e.jsx("a",{href:s.deepLinkTelegram,target:"_blank",rel:"noreferrer",children:t("postfachSettings.pairOpenTelegram",{defaultValue:"In Telegram öffnen"})})]}):e.jsx(B,{style:{marginTop:16},type:"warning",showIcon:!0,title:t("postfachSettings.pairNoBot",{defaultValue:"Für deine Firma ist in Empfango noch kein Chat-Bot eingerichtet. Lege ihn im Postfach an, dann erscheint hier der Verbindungslink."})}))]})]})}),e.jsx(ye,{}),e.jsxs(v,{children:[e.jsx(o.Text,{type:"secondary",children:t("postfachSettings.ready",{defaultValue:"Hannah ist startklar: Sie darf standardmäßig alles und erkennt automatisch, was zu tun ist. Hier kannst du das anpassen."})}),e.jsx(ue,{ghost:!0,style:{marginTop:8},items:[{key:"customize",label:t("postfachSettings.customize",{defaultValue:"Hannah anpassen — Berechtigungen & Verhalten"}),children:e.jsxs(e.Fragment,{children:[e.jsx(se,{embedded:!0,onEnabledChange:m}),e.jsx(ge,{embedded:!0,enabledCaps:j})]})}]})]})]})}const _=W.APPS;function Be(){const{t:r}=V("portal"),t=M(),n=ie(),{linked:s}=n,d=u.useMemo(()=>e.jsx(Y,{docKey:"hannahIntegration",size:"middle"}),[]);return ee({extra:d}),u.useEffect(()=>{s===!1&&t(_,{replace:!0})},[s,t]),e.jsx(te,{children:e.jsxs(p,{direction:"vertical",size:16,style:{width:"100%"},children:[e.jsx(k,{type:"link",icon:e.jsx(he,{}),style:{paddingLeft:0},onClick:()=>t(_),children:r("integrations.backToOverview",{defaultValue:"Zurück zur Übersicht"})}),e.jsxs(p,{align:"center",size:16,children:[e.jsx("img",{src:ne,alt:"Hannah",width:56,height:56,style:{borderRadius:"50%",objectFit:"cover",flex:"0 0 auto"}}),e.jsxs("div",{children:[e.jsxs(p,{align:"center",size:12,children:[e.jsx(o.Title,{level:4,style:{margin:0},children:r("postfachSettings.title",{defaultValue:"Hannah"})}),s&&e.jsx(ae,{tone:"success",children:r("integrations.connected",{defaultValue:"Verbunden"})})]}),e.jsx(o.Text,{type:"secondary",children:r("postfachSettings.description",{defaultValue:"Verbinde dein Konto mit Empfango, um Anrufe und Nachrichten deiner KI-Assistentin Hannah im Postfach zu sehen. Nach dem Verbinden erscheint „Postfach“ im Hauptmenü."})})]})]}),s===null?e.jsx(H,{active:!0}):s?e.jsx(xe,{link:n}):null]})})}export{Be as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.