1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/doc-note-panel.0d13f92.js","assets/client.0d13f92.js","assets/client.0d13f92.css","assets/textarea.0d13f92.js","assets/doc-note-panel.0d13f92.css"])))=>i.map(i=>d[i]); 2import{R as ue,b4 as Be,B as K,c,o as a,F as I,r as G,b as f,e as A,i as q,t as _,a as n,d as H,w as P,h as be,n as x,x as te,y as he,L as He,C as me,b5 as Ee,p as Z,K as ze,q as W,v as re,s as pe,U as ye,N as U,O as ee,aN as We,Q as oe,f as je,M as Ve,b6 as Ye,b7 as Ae,k as qe,b8 as Fe,_ as Te,b9 as Ge,ba as $e,T as Xe,u as Ze,J as Je,ag as Qe,I as ge,$ as Re,ah as _e,ak as Ce}from"./client.0d13f92.js";import Ke from"./doc-note-panel.0d13f92.js";import{_ as et}from"./drawer.0d13f92.js";import{u as tt}from"./tutorial.0d13f92.js";import st from"./editor.0d13f92.js";import{d as nt}from"./duration.0d13f92.js";import{g as it}from"./navigationData.0d13f92.js";import"./textarea.0d13f92.js";const ke=["scroll","ps-scroll-y","ps-scroll-x","ps-scroll-up","ps-scroll-down","ps-scroll-left","ps-scroll-right","ps-y-reach-start","ps-y-reach-end","ps-x-reach-start","ps-x-reach-end"];var ot={name:"PerfectScrollbar",props:{options:{type:Object,required:!1,default:()=>{}},tag:{type:String,required:!1,default:"div"},watchOptions:{type:Boolean,required:!1,default:!1}},emits:ke,data(){return{ps:null}},watch:{watchOptions(t){!t&&this.watcher?this.watcher():this.createWatcher()}},mounted(){this.create(),this.watchOptions&&this.createWatcher()},updated(){this.$nextTick(()=>{this.update()})},beforeUnmount(){this.destroy()},methods:{create(){this.ps&&this.$isServer||(this.ps=new Be(this.$el,this.options),ke.forEach(t=>{this.ps.element.addEventListener(t,e=>this.$emit(t,e))}))},createWatcher(){this.watcher=this.$watch("options",()=>{this.destroy(),this.create()},{deep:!0})},update(){this.ps&&this.ps.update()},destroy(){this.ps&&(this.ps.destroy(),this.ps=null)}},render(){return ue(this.tag,{class:"ps"},this.$slots.default&&this.$slots.default())}};function rt(t={}){const e={filename:"bug-report.png",autoDownload:!1,onReport:null,scrollDelay:150,captureDelay:300,autoDetectOverlap:!0,...t};return async function(){var u;const o={url:location.href,title:document.title,userAgent:navigator.userAgent,viewport:{width:innerWidth,height:innerHeight,pixelRatio:devicePixelRatio},time:new Date().toISOString(),strategyUsed:"scroll-capture"},i=window.scrollX,l=window.scrollY;if(!((u=navigator.mediaDevices)!=null&&u.getDisplayMedia)){const v=document.createElement("canvas");v.width=800,v.height=600;const h=v.getContext("2d");h.fillStyle="#e8e8e8",h.fillRect(0,0,800,600),h.fillStyle="#999",h.font="bold 20px sans-serif",h.textAlign="center",h.fillText("DEV MODE â Screenshot nicht verfügbar",400,280),h.font="14px sans-serif",h.fillText("(HTTPS erforderlich)",400,310);const C=await new Promise(p=>v.toBlob(p,"image/png")),O=URL.createObjectURL(C);return typeof e.onReport=="function"&&await e.onReport({blob:C,meta:o,objectUrl:O}),{blob:C,meta:o,objectUrl:O}}try{const v=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth,document.documentElement.offsetWidth,document.body.offsetWidth),h=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,document.documentElement.offsetHeight,document.body.offsetHeight),C=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",preferCurrentTab:!0,frameRate:30},audio:!1}),[O]=C.getVideoTracks();try{window.scrollTo(0,0),await new Promise(X=>setTimeout(X,e.scrollDelay));const p=await s(O),$=p.width,j=p.height;console.log(`[Chrome Detection] Capture size: ${$}x${j}`),console.log(`[Chrome Detection] Window inner size: ${window.innerWidth}x${window.innerHeight}`),console.log(`[Chrome Detection] Window outer size: ${window.outerWidth}x${window.outerHeight}`);const T=$/window.innerWidth,Q=T;console.log(`[Chrome Detection] Scale factor: ${T}`);const g=window.innerHeight*T,y=j-g;console.log(`[Chrome Detection] Expected capture height (viewport * scale): ${g}`),console.log(`[Chrome Detection] Actual capture height: ${j}`),console.log(`[Chrome Detection] Browser chrome detected: ${y}px`);const E=Math.max(0,Math.round(y)),d=window.innerWidth,b=window.innerHeight,B=Math.ceil(v/d),V=Math.ceil(h/b);console.log(`[Chrome Detection] Will crop ${E}px from top of each subsequent screenshot`),console.log(`[Chrome Detection] Grid: ${B}x${V} tiles`);const N=document.createElement("canvas");N.width=Math.ceil(v*T),N.height=Math.ceil(h*T);const z=N.getContext("2d");z.fillStyle="#ffffff",z.fillRect(0,0,N.width,N.height),console.log(`Capturing ${B}x${V} tiles (${B*V} total)`),console.log(`Viewport: ${d}x${b}`),console.log(`Capture: ${$}x${j}`),console.log(`Scale: ${T}x${Q}`),console.log(`Final canvas: ${N.width}x${N.height}`);let M=0,Y=-1;for(let X=0;X<V;X++)for(let le=0;le<B;le++){M++;const ae=le*d,de=X*b;window.scrollTo(ae,de),await new Promise(S=>setTimeout(S,e.scrollDelay));const ne=window.scrollY;if(await new Promise(S=>setTimeout(S,e.captureDelay)),le===0&&ne===Y&&X>0){console.log(`[Stitch] Tile ${M}/${B*V}: SKIPPED - same position as previous (${ne}px)`);continue}Y=ne;const we=ne<de,J=await s(O),ie=E,m=Math.floor(ae*T),w=Math.floor(ne*T),k=J.height-ie;console.log(`[Stitch] Tile ${M}/${B*V}:`),console.log(` - Scroll position: (${ae}, ${de})`),console.log(` - Bitmap size: ${J.width}x${J.height}`),console.log(` - Crop from top: ${ie}px`),console.log(` - Source height after crop: ${k}px`),console.log(` - Dest position: (${m}, ${w})`),console.log(` - Drawing from bitmap(0,${ie},${J.width},${k}) to canvas(${m},${w})`),z.drawImage(J,0,ie,J.width,k,m,w,J.width,k)}const ce=await new Promise(X=>N.toBlob(X,"image/png")),se=URL.createObjectURL(ce);if(e.autoDownload){const X=document.createElement("a");X.href=se,X.download=e.filename,X.click(),setTimeout(()=>URL.revokeObjectURL(se),3e3)}return typeof e.onReport=="function"&&await e.onReport({blob:ce,meta:o,objectUrl:se}),{blob:ce,meta:o,objectUrl:se}}finally{O.stop()}}finally{window.scrollTo(i,l)}};async function s(r){if("ImageCapture"in window)return new ImageCapture(r).grabFrame();const o=document.createElement("video");
2o.srcObject=new MediaStream([r]),await o.play(),await new Promise(u=>setTimeout(u,100));const i=document.createElement("canvas");i.width=o.videoWidth,i.height=o.videoHeight,i.getContext("2d").drawImage(o,0,0);const l=await createImageBitmap(i);return o.pause(),l}}const xe=/(\*\*([^*]+)\*\*)|(`([^`]+)`)|(\[([^\]]+)\]\(([^)\s]+)\))/g;function lt(t){return typeof t!="string"||!t?null:/^https?:\/\//i.test(t)?{kind:"external",href:t}:t.startsWith("/")&&!t.startsWith("//")&&!t.includes("\\")?{kind:"internal",href:t}:null}function ve(t){const e=[];if(!t)return e;let s=0,r;for(xe.lastIndex=0;(r=xe.exec(t))!==null;){if(r.index>s&&e.push({t:"text",v:t.slice(s,r.index)}),r[1])e.push({t:"bold",v:r[2]});else if(r[3])e.push({t:"code",v:r[4]});else{const o=lt(r[7]);o?e.push({t:"link",v:r[6],href:o.href,kind:o.kind}):e.push({t:"text",v:r[6]})}s=r.index+r[0].length}return s<t.length&&e.push({t:"text",v:t.slice(s)}),e}function at(t){const e=[];if(!t)return e;for(const s of String(t).split(/\r?\n/)){const r=s.trimEnd(),o=/^\s*[-*]\s+(.*)$/.exec(r),i=/^\s*\d+[.)]\s+(.*)$/.exec(r),l=/^\s*#{1,6}\s+(.*)$/.exec(r);if(o||i){const u=o?"ul":"ol",v=ve((o||i)[1]),h=e[e.length-1];h&&h.type===u?h.items.push(v):e.push({type:u,items:[v]})}else if(l)e.push({type:"h",inline:ve(l[1])});else if(r.trim())e.push({type:"p",inline:ve(r)});else{const u=e[e.length-1];u&&u.type!=="gap"&&e.push({type:"gap"})}}for(;e.length&&e[e.length-1].type==="gap";)e.pop();return e}const ct={class:"agent-md"},dt={key:0,class:"agent-md-h"},ut={key:1,class:"agent-md-p"},mt={key:2,class:"agent-md-list"},ht={key:3,class:"agent-md-list"},gt={key:4,class:"agent-md-gap"};function pt(t,e,s,r,o,i){const l=K("MdInline");return a(),c("div",ct,[(a(!0),c(I,null,G(i.blocks,(u,v)=>(a(),c(I,{key:v},[u.type==="h"?(a(),c("div",dt,[A(l,{tokens:u.inline},null,8,["tokens"])])):u.type==="p"?(a(),c("p",ut,[A(l,{tokens:u.inline},null,8,["tokens"])])):u.type==="ul"?(a(),c("ul",mt,[(a(!0),c(I,null,G(u.items,(h,C)=>(a(),c("li",{key:C},[A(l,{tokens:h},null,8,["tokens"])]))),128))])):u.type==="ol"?(a(),c("ol",ht,[(a(!0),c(I,null,G(u.items,(h,C)=>(a(),c("li",{key:C},[A(l,{tokens:h},null,8,["tokens"])]))),128))])):u.type==="gap"?(a(),c("div",gt)):f("",!0)],64))),128))])}const ft={name:"CmsAdmincenterAiagentMdInline",props:{tokens:{type:Array,default:()=>[]}},render(){return this.tokens.map(t=>t.t==="bold"?ue("strong",t.v):t.t==="code"?ue("code",t.v):t.t==="link"&&t.kind==="internal"?ue(K("router-link"),{to:t.href},{default:()=>t.v}):t.t==="link"?ue("a",{href:t.href,target:"_blank",rel:"noopener noreferrer"},t.v):t.v)}},vt={name:"CmsAdmincenterAiagentMarkdownText",components:{MdInline:ft},props:{text:{type:String,default:""}},computed:{blocks(){return at(this.text)}}},De=q(vt,[["render",pt],["__scopeId","data-v-571cfedc"]]),bt={class:"agent-ui-list"},yt={key:0,class:"agent-ui-list-title"},wt={class:"material-icons item-icon"},_t={class:"item-main"},Ct=["href"],kt={key:2,class:"item-label"},xt={key:3,class:"item-sublabel"},St=["disabled","onClick"];function Et(t,e,s,r,o,i){const l=K("router-link");return a(),c("div",bt,[s.block.title?(a(),c("div",yt,_(s.block.title),1)):f("",!0),(a(!0),c(I,null,G(i.items,(u,v)=>(a(),c("div",{class:"agent-ui-list-item",key:v},[n("i",wt,_(u.icon||"chevron_right"),1),n("div",_t,[i.internalTo(u)?(a(),H(l,{key:0,class:"item-label",to:i.internalTo(u)},{default:P(()=>[be(_(u.label),1)]),_:2},1032,["to"])):i.externalHref(u)?(a(),c("a",{key:1,class:"item-label",href:i.externalHref(u),target:"_blank",rel:"noopener noreferrer"},_(u.label),9,Ct)):(a(),c("span",kt,_(u.label),1)),u.sublabel?(a(),c("div",xt,_(u.sublabel),1)):f("",!0)]),u.action&&u.action.message?(a(),c("button",{key:0,class:"item-use",disabled:!s.active,onClick:h=>t.$emit("send",u.action.message)},"übernehmen",8,St)):f("",!0)]))),128))])}const At={name:"CmsAdmincenterAiagentEntityList",props:{block:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["send"],computed:{adminBase(){return this.$store.getters["config/ADMINCENTER_URL"]||"/admincenter"},items(){var t;return Array.isArray((t=this.block)==null?void 0:t.items)?this.block.items:[]}},methods:{internalTo(t){const e=t&&t.adminPath;return typeof e!="string"||!/^\/(?!\/)[^\\\s]*$/.test(e)?null:this.adminBase+e},externalHref(t){const e=t&&t.href;return typeof e!="string"||!/^https?:\/\//i.test(e)?null:e}}},Me=q(At,[["render",Et],["__scopeId","data-v-a6d441c7"]]),Tt={class:"agent-ui-link"},$t={class:"material-icons"},Rt=["href"],Dt={class:"material-icons"},Mt={key:2,class:"link-chip is-plain"};function Lt(t,e,s,r,o,i){const l=K("router-link");return a(),c("div",Tt,[i.internalTo?(a(),H(l,{key:0,class:"link-chip",to:i.internalTo},{default:P(()=>[n("i",$t,_(s.block.icon||"open_in_new"),1),n("span",null,_(s.block.label),1)]),_:1},8,["to"])):i.externalHref?(a(),c("a",{key:1,class:"link-chip",href:i.externalHref,target:"_blank",rel:"noopener noreferrer"},[n("i",Dt,_(s.block.icon||"open_in_new"),1),n("span",null,_(s.block.label),1)],8,Rt)):(a(),c("span",Mt,_(s.block.label),1))])}const Pt={name:"CmsAdmincenterAiagentEntityLink",props:{block:{type:Object,required:!0}},computed:{adminBase(){return this.$store.getters["config/ADMINCENTER_URL"]||"/admincenter"},internalTo(){var e;const t=(e=this.block)==null?void 0:e.adminPath;return typeof t!="string"||!/^\/(?!\/)[^\\\s]*$/.test(t)?null:this.adminBase+t},externalHref(){var e;const t=(e=this.block)==null?void 0:e.href;return typeof t!="string"||!/^https?:\/\//i.test(t)?null:t}}},Le=q(Pt,[["render",Lt],["__scopeId","data-v-f31f8a83"]]),It={class:"q-text"},Nt={key:0,class:"q-reason"},Ut={key:1,class:"q-options"},Ot=["onClick"];function Bt(t,e,s,r,o,i){return a(),c("div",{class:x(["agent-ui-question",{"is-inactive":!s.active}])},[n("div",It,[e[0]||(e[0]=n("i",{class:"material-icons"},"help_outline",-1)),n("span",null,_(s.block.question),1)]),s.block.reason?(a(),c("div",Nt,_(s.block.reason),1)):f("",!0),i.options.length&&s.active?(a(),c("div",Ut,[(a(!0),c(I,null,G(i.options,
2(l,u)=>(a(),c("button",{class:"q-opt",key:u,onClick:v=>t.$emit("answer",l)},_(l),9,Ot))),128))])):f("",!0)],2)}const Ht={name:"CmsAdmincenterAiagentQuestionCard",props:{block:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["answer"],computed:{options(){var t;return(Array.isArray((t=this.block)==null?void 0:t.options)?this.block.options:[]).filter(e=>typeof e=="string"&&e.trim())}}},Pe=q(Ht,[["render",Bt],["__scopeId","data-v-a5cc5360"]]);function zt(t,e,s,r,o,i){const l=Me,u=Le,v=Pe;return s.ui&&s.ui.type==="list"?(a(),H(l,{key:0,block:s.ui,active:s.active,onSend:e[0]||(e[0]=h=>t.$emit("send",h))},null,8,["block","active"])):s.ui&&s.ui.type==="link"?(a(),H(u,{key:1,block:s.ui},null,8,["block"])):s.ui&&s.ui.type==="question"?(a(),H(v,{key:2,block:s.ui,active:s.active,onAnswer:e[1]||(e[1]=h=>t.$emit("send",h))},null,8,["block","active"])):f("",!0)}const Wt={name:"CmsAdmincenterAiagentToolUiBlock",components:{CmsAdmincenterAiagentEntityList:Me,CmsAdmincenterAiagentEntityLink:Le,CmsAdmincenterAiagentQuestionCard:Pe},props:{ui:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["send"]},Ie=q(Wt,[["render",zt]]),jt={class:"agent-msg-icon"},Vt={key:0,class:"material-icons"},Yt={key:1,class:"material-icons"},qt={key:2,class:"material-icons"},Ft={key:3,class:"material-icons"},Gt={class:"agent-msg-body"},Xt={key:1,class:"agent-msg-content"},Zt={key:2,class:"agent-msg-attachments"},Jt=["src","alt"],Qt={key:1,class:"agent-msg-attachment-name"},Kt={key:3,class:"agent-msg-tool-calls"},es={class:"tc-name"},ts={key:4,class:"agent-msg-tool-result"},ss={key:1};function ns(t,e,s,r,o,i){const l=De,u=Ie;return a(),c("div",{class:x(["agent-msg",["role-"+s.msg.role,s.msg.toolCalls&&s.msg.toolCalls.length?"has-tool-calls":""]])},[n("div",jt,[s.msg.role==="user"?(a(),c("i",Vt,"person")):s.msg.role==="assistant"?(a(),c("i",Yt,"smart_toy")):s.msg.role==="tool"?(a(),c("i",qt,"build")):(a(),c("i",Ft,"info"))]),n("div",Gt,[s.msg.content&&s.msg.role==="assistant"?(a(),H(l,{key:0,class:"agent-msg-content is-md",text:s.msg.content},null,8,["text"])):s.msg.content&&s.msg.role!=="tool"?(a(),c("div",Xt,_(s.msg.content),1)):f("",!0),s.msg.attachments&&s.msg.attachments.length?(a(),c("div",Zt,[(a(!0),c(I,null,G(s.msg.attachments,v=>(a(),c("div",{class:"agent-msg-attachment",key:v.fileId},[v.kind!=="file"?(a(),c("img",{key:0,src:`/api/v1/file/${v.fileId}/grid?max=256`,alt:v.name||"image"},null,8,Jt)):f("",!0),v.name?(a(),c("span",Qt,_(v.name),1)):f("",!0)]))),128))])):f("",!0),s.msg.toolCalls&&s.msg.toolCalls.length?(a(),c("div",Kt,[(a(!0),c(I,null,G(s.msg.toolCalls,v=>(a(),c("div",{class:"agent-msg-tool-call",key:v.id},[e[1]||(e[1]=n("i",{class:"material-icons tc-icon"},"build",-1)),n("span",es,_(v.name),1),n("span",{class:x(["tc-status","st-"+(v.status||"pending")])},_(v.status||"pending"),3)]))),128))])):f("",!0),s.msg.role==="tool"?(a(),c("div",ts,[i.toolUi?(a(),H(u,{key:0,ui:i.toolUi,active:s.active,onSend:e[0]||(e[0]=v=>t.$emit("send",v))},null,8,["ui","active"])):(a(),c("details",ss,[n("summary",null,"tool: "+_(s.msg.name),1),n("pre",null,_(i.formattedContent),1)]))])):f("",!0)])],2)}const is={name:"CmsAdmincenterAiagentMessageBubble",components:{CmsAdmincenterAiagentMarkdownText:De,CmsAdmincenterAiagentToolUiBlock:Ie},props:{msg:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["send"],computed:{toolUi(){if(this.msg.role!=="tool"||!this.msg.content)return null;try{const t=JSON.parse(this.msg.content);return t&&t.ui&&t.ui.type?t.ui:null}catch{return null}},formattedContent(){if(!this.msg.content)return"";try{return JSON.stringify(JSON.parse(this.msg.content),null,2)}catch{return this.msg.content}}}},Ne=q(is,[["render",ns],["__scopeId","data-v-94bba082"]]),os={class:"agent-approval-card"},rs={class:"approval-header"},ls={class:"approval-title"},as={key:0,class:"approval-desc"},cs={class:"approval-args"},ds={class:"approval-actions"},us={key:0,class:"approval-edit"};function ms(t,e,s,r,o,i){return a(),c("div",os,[n("div",rs,[e[5]||(e[5]=n("i",{class:"material-icons approval-icon"},"warning",-1)),n("div",ls,[n("strong",null,"Schreib-Aktion: "+_(s.approval.name),1),s.approval.description?(a(),c("div",as,_(s.approval.description),1)):f("",!0)])]),n("div",cs,[n("pre",null,_(i.argsText),1)]),n("div",ds,[n("button",{class:"btn-approve",onClick:e[0]||(e[0]=(...l)=>i.approve&&i.approve(...l))},"Genehmigen"),n("button",{class:"btn-reject",onClick:e[1]||(e[1]=(...l)=>i.reject&&i.reject(...l))},"Ablehnen"),n("button",{class:x(["btn-edit",{active:o.editing}]),onClick:e[2]||(e[2]=(...l)=>i.toggleEdit&&i.toggleEdit(...l))},"Bearbeiten",2)]),o.editing?(a(),c("div",us,[te(n("textarea",{"onUpdate:modelValue":e[3]||(e[3]=l=>o.editText=l),rows:"6"},null,512),[[he,o.editText]]),e[6]||(e[6]=n("div",{class:"edit-hint"},'Args als JSON. Bei Speichern wird "Genehmigen mit Edit" durchgefuehrt.',-1)),n("button",{class:"btn-approve",onClick:e[4]||(e[4]=(...l)=>i.approveEdited&&i.approveEdited(...l))},"Mit diesen Args genehmigen")])):f("",!0)])}const hs={name:"CmsAdmincenterAiagentApprovalCard",props:{approval:{type:Object,required:!0}},data(){return{editing:!1,editText:""}},computed:{argsText(){try{return JSON.stringify(this.approval.args||{},null,2)}catch{return String(this.approval.args)}}},methods:{toggleEdit(){this.editing=!this.editing,this.editing&&(this.editText=this.argsText)},approve(){this.$emit("decide",{toolCallId:this.approval.toolCallId,decision:"approve"})},reject(){this.$emit("decide",{toolCallId:this.approval.toolCallId,decision:"reject"})},approveEdited(){let t=null;try{t=JSON.parse(this.editText)}catch(e){alert("Ungueltiges JSON: "+e.message);return}this.$emit("decide",{toolCallId:this.approval.toolCallId,decision:"approve",editedArgs:t})}}},Ue=q(hs,[["render",ms],["__scopeId","data-v-39623d92"]]),gs={class:"pane-header"},ps={class:"pane-title"},fs={key:0,class:"pane-context"},vs={class:"pane-actions"},bs={key:0,class:"pane-error"},ys={class:"pane-messages",ref:"msgs"},ws={key:0,class:"agent-thinking"},_s={class:"pane-input"},Cs={key:0,class:"pane-attachments"},ks=["src","alt"],xs=["onClick"],Ss={class:"pane-input-row"},Es=["disabled"],As=["disabled"],Ts=["disabled"];function $s(t,e,s,r,o,i){const l=Ne,u=Ue,v=K("CmsDrawerDrawer");return a(),H(v,{class:"cms-admincenter-drawer cms-aiagent-drawer",ref:"drawerRef",orientation:"right",width:420,padding:0,overlay:!1,"prevent-scroll":!1,"z-index":9998,onClose:i.closePane},{header:P(()=>[n("div",gs,[n("div",ps,[e[6]||(e[6]=n("i",{class:"material-icons"},"smart_toy",-1)),e[7]||(e[7]=n("span",null,"AI Assistent",-1)),i.contextLabel?(a(),c("span",fs,_(i.contextLabel),
21)):f("",!0)]),n("div",vs,[n("button",{class:"icon-btn",onClick:e[0]||(e[0]=(...h)=>i.resetConversation&&i.resetConversation(...h)),title:"Neue Unterhaltung"},e[8]||(e[8]=[n("i",{class:"material-icons"},"refresh",-1)])),n("button",{class:"icon-btn",onClick:e[1]||(e[1]=(...h)=>i.closePane&&i.closePane(...h)),title:"Schliessen"},e[9]||(e[9]=[n("i",{class:"material-icons"},"close",-1)]))])])]),content:P(()=>[i.agentState.error?(a(),c("div",bs,_(i.agentState.error),1)):f("",!0),n("div",ys,[(a(!0),c(I,null,G(i.agentState.messages,(h,C)=>(a(),H(l,{key:C,msg:h,active:C===i.activeUiIndex,onSend:i.sendQuick},null,8,["msg","active","onSend"]))),128)),i.agentState.thinking?(a(),c("div",ws,e[10]||(e[10]=[n("i",{class:"material-icons spin"},"autorenew",-1),n("span",null,"denkt nach...",-1)]))):f("",!0),(a(!0),c(I,null,G(i.agentState.pendingApprovals,h=>(a(),H(u,{key:h.toolCallId,approval:h,onDecide:i.onApprovalDecide},null,8,["approval","onDecide"]))),128))],512)]),footer:P(()=>[n("div",_s,[o.pendingAttachments.length?(a(),c("div",Cs,[(a(!0),c(I,null,G(o.pendingAttachments,(h,C)=>(a(),c("div",{class:"pane-attachment",key:h.fileId},[n("img",{src:`/api/v1/file/${h.fileId}/grid?max=64`,alt:h.name},null,8,ks),n("button",{class:"icon-btn",onClick:O=>i.removeAttachment(C),title:"entfernen"},e[11]||(e[11]=[n("i",{class:"material-icons"},"close",-1)]),8,xs)]))),128))])):f("",!0),n("div",Ss,[n("button",{class:"icon-btn",onClick:e[2]||(e[2]=(...h)=>i.openAttachmentPicker&&i.openAttachmentPicker(...h)),title:"Bild anhaengen",disabled:i.agentState.thinking},e[12]||(e[12]=[n("i",{class:"material-icons"},"attach_file",-1)]),8,Es),te(n("textarea",{"onUpdate:modelValue":e[3]||(e[3]=h=>o.draft=h),ref:"input",placeholder:"Nachricht ... (Enter zum Senden, Shift+Enter neue Zeile)",rows:"2",disabled:i.agentState.thinking,onKeydown:e[4]||(e[4]=He(me((...h)=>i.send&&i.send(...h),["exact","prevent"]),["enter"]))},null,40,As),[[he,o.draft]]),n("button",{class:"btn-send",onClick:e[5]||(e[5]=(...h)=>i.send&&i.send(...h)),disabled:!i.canSend},e[13]||(e[13]=[n("i",{class:"material-icons"},"send",-1)]),8,Ts)])])]),_:1},8,["onClose"])}const Rs={name:"CmsAdmincenterAiagentChatPane",components:{CmsDrawerDrawer:et,CmsAdmincenterAiagentMessageBubble:Ne,CmsAdmincenterAiagentApprovalCard:Ue},data(){return{draft:"",pendingAttachments:[]}},computed:{...Ee("ai",["AGENT_STATE"]),agentState(){return this.AGENT_STATE},contextLabel(){var e;const t=this.agentState.clientContext||{};return(e=t.entity)!=null&&e.title?t.entity.title:t.route?t.route:null},canSend(){return!this.agentState.thinking&&(this.draft.trim().length>0||this.pendingAttachments.length>0)},activeUiIndex(){var s;const t=this.agentState.messages||[];let e=-1;for(let r=t.length-1;r>=0;r--)if(t[r].role==="user"){e=r;break}for(let r=t.length-1;r>e;r--){const o=t[r];if(!(o.role!=="tool"||!o.content))try{const i=(s=JSON.parse(o.content))==null?void 0:s.ui;if(i&&(i.type==="question"||i.type==="list"))return r}catch{}}return-1}},watch:{"agentState.paneOpen"(t){var e,s;t?(e=this.$refs.drawerRef)==null||e.open():(s=this.$refs.drawerRef)==null||s.close()},"agentState.messages"(){this.$nextTick(()=>this.scrollBottom())},"agentState.pendingApprovals.length"(){this.$nextTick(()=>this.scrollBottom())}},mounted(){this.updateClientContext(),this.$nextTick(()=>{var t;this.agentState.paneOpen&&((t=this.$refs.drawerRef)==null||t.open())})},methods:{scrollBottom(){const t=this.$refs.msgs;t&&(t.scrollTop=t.scrollHeight)},updateClientContext(){var e,s;const t={route:((e=this.$route)==null?void 0:e.fullPath)||(typeof window<"u"?window.location.pathname:null),locale:((s=this.$store.state.locals)==null?void 0:s.language)||null};this.$store.dispatch("ai/AGENT_SET_CLIENT_CONTEXT",t)},async send(){if(!this.canSend)return;const t=this.draft,e=this.pendingAttachments.slice();this.draft="",this.pendingAttachments=[],await this.doSend(t,e)},async sendQuick(t){if(this.agentState.thinking)return;const e=String(t||"").trim();e&&await this.doSend(e,[])},async doSend(t,e){this.updateClientContext();try{await this.$store.dispatch("ai/AGENT_SEND_MESSAGE",{content:t,attachments:e,clientContext:this.agentState.clientContext})}catch(s){console.error("agent send failed",s)}},async resetConversation(){this.$store.commit("ai/AGENT_RESET"),this.draft="",this.pendingAttachments=[]},closePane(){this.$store.dispatch("ai/AGENT_CLOSE_PANE")},onApprovalDecide({toolCallId:t,decision:e,editedArgs:s}){this.$store.dispatch("ai/AGENT_SEND_APPROVAL",{toolCallId:t,decision:e,editedArgs:s})},openAttachmentPicker(){var e;const t=(e=this.$store.state.admincenter)==null?void 0:e.gallerybrowser;if(!t){alert("Gallery Browser nicht verfuegbar");return}t.mode="insertImageNewsletter",t.title="Bild fuer AI-Anfrage waehlen",t.selected_gallery={images:[]},t.onSelect=s=>{const r=Array.isArray(s==null?void 0:s.images)?s.images:Array.isArray(s)?s:[];
2for(const o of r){const i=typeof o=="string"?o:o._id||o.fileId;i&&this.pendingAttachments.push({fileId:String(i),kind:"image",name:typeof o=="object"?o.name:null})}},t.open=!0},removeAttachment(t){this.pendingAttachments.splice(t,1)}}},Ds=q(Rs,[["render",$s],["__scopeId","data-v-a5c592fd"]]),Ms={key:0,class:"cms-tutorial-mask"},Ls={id:"tutorial-spotlight"},Ps=["x","y","width","height"],Is={class:"cms-tutorial-tooltip-header"},Ns={class:"cms-tutorial-tooltip-step"},Us={key:0,class:"cms-tutorial-tooltip-title"},Os={key:1,class:"cms-tutorial-tooltip-hint"},Bs={class:"cms-tutorial-progress"},Hs={class:"cms-tutorial-nav"},zs=["disabled"],Ws={class:"cms-tutorial-dots"},js=["onClick"],Oe={__name:"tutorial-player",setup(t){const e=Z(!1),s=Z(null),r=Z(null),o=Z("bottom");let i=null,l=null;try{l=tt()}catch{}let u=null;try{u=ze()}catch{}const v=W(()=>r.value?{top:r.value.y-6+"px",left:r.value.x-6+"px",width:r.value.width+12+"px",height:r.value.height+12+"px"}:{}),h=W(()=>{if(!r.value)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const g=r.value,y=360,E=220,d=16,b=window.innerWidth,B=window.innerHeight,V=l==null?void 0:l.currentStep;let N=(V==null?void 0:V.position)||"auto",z=N;N==="auto"&&(g.y+g.height+d+E<B?z="bottom":g.y-d-E>0?z="top":g.x+g.width+d+y<b?z="right":z="left"),o.value=z;let M,Y;switch(z){case"bottom":M=g.y+g.height+d,Y=g.x+g.width/2-y/2;break;case"top":M=g.y-d-E,Y=g.x+g.width/2-y/2;break;case"right":M=g.y+g.height/2-E/2,Y=g.x+g.width+d;break;case"left":M=g.y+g.height/2-E/2,Y=g.x-d-y;break}return Y=Math.max(12,Math.min(Y,b-y-12)),M=Math.max(12,Math.min(M,B-E-12)),{top:M+"px",left:Y+"px"}});function C(){const g=l==null?void 0:l.currentStep;if(!g||!g.selector){r.value=null;return}const y=document.querySelector(g.selector);if(!y){g.waitForSelector!==!1?O(g.selector):r.value=null;return}const E=y.getBoundingClientRect();r.value={x:E.x,y:E.y,width:E.width,height:E.height,el:y}}function O(g,y=5e3){const E=Date.now(),d=()=>{if(Date.now()-E>y){r.value=null;return}document.querySelector(g)?C():requestAnimationFrame(d)};requestAnimationFrame(d)}function p(){var d;if(!((d=r.value)!=null&&d.el))return;const g=l==null?void 0:l.currentStep;if((g==null?void 0:g.scrollTo)===!1)return;const y=r.value.el,E=y.getBoundingClientRect();(E.top<0||E.bottom>window.innerHeight)&&(y.scrollIntoView({behavior:"instant",block:"center"}),C())}function $(){l&&(l.isLastStep?l.stop():l.next())}function j(g){if(l!=null&&l.isActive)switch(g.key){case"ArrowRight":case"Enter":g.preventDefault(),l.isLastStep?l.stop():l.next();break;case"ArrowLeft":g.preventDefault(),l.prev();break;case"Escape":g.preventDefault(),l.stop();break}}function T(){l!=null&&l.isActive&&C()}function Q(){l!=null&&l.isActive&&C()}return l&&(re(()=>l.currentStepIndex,async()=>{const g=l.currentStep;if(g!=null&&g.onActivate&&u)try{await g.onActivate(u,l.baseUrl)}catch{}await oe(),C(),await oe(),p()}),re(()=>l.isActive,async g=>{if(g){document.body.style.overflow="hidden";const y=l.currentStep;if(y!=null&&y.onActivate&&u)try{await y.onActivate(u,l.baseUrl)}catch{}oe(()=>{C(),oe(()=>p())})}else document.body.style.overflow="",r.value=null})),pe(()=>{e.value=!0,l&&(window.addEventListener("keydown",j),window.addEventListener("scroll",T,!0),window.addEventListener("resize",Q))}),ye(()=>{window.removeEventListener("keydown",j),window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",Q),document.body.style.overflow="",clearTimeout(i)}),(g,y)=>e.value?(a(),H(We,{key:0,to:"body"},[U(l)&&U(l).isActive&&U(l).currentStep?(a(),c("div",{key:0,class:"cms-tutorial-overlay",onClick:me($,["self"])},[r.value?(a(),c("svg",Ms,[n("defs",null,[n("mask",Ls,[y[4]||(y[4]=n("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"},null,-1)),n("rect",{x:r.value.x-6,y:r.value.y-6,width:r.value.width+12,height:r.value.height+12,rx:8,fill:"black"},null,8,Ps)])]),y[5]||(y[5]=n("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"rgba(0,0,0,0.55)",mask:"url(#tutorial-spotlight)"},null,-1))])):f("",!0),r.value?(a(),c("div",{key:1,class:"cms-tutorial-highlight",style:ee(v.value)},null,4)):f("",!0),n("div",{class:x(["cms-tutorial-tooltip",[o.value,{"no-target":!r.value}]]),ref_key:"tooltip",ref:s,style:ee(h.value)},[n("div",Is,[n("div",Ns,_(U(l).currentStepIndex+1)+" / "+_(U(l).totalSteps),1),n("div",{class:"cms-tutorial-tooltip-close",onClick:y[0]||(y[0]=E=>U(l).stop())},y[6]||(y[6]=[n("i",{class:"material-icons"},"close",-1)]))]),U(l).currentStep.title?(a(),c("div",Us,_(U(l).currentStep.title),1)):f("",!0),U(l).currentStep.hint?(a(),c("div",Os,_(U(l).currentStep.hint),1)):f("",!0),n("div",Bs,[n("div",{class:"cms-tutorial-progress-bar",style:ee({width:U(l).progress+"%"})},null,4)]),n("div",Hs,[n("button",{class:"cms-tutorial-btn secondary",onClick:y[1]||(y[1]=E=>U(l).prev()),disabled:U(l).isFirstStep},y[7]||(y[7]=[n("i",{class:"material-icons"},"arrow_back",-1),n("span",null,"Zurück",-1)]),8,zs),n("div",Ws,[(a(!0),c(I,null,G(U(l).currentTutorial.steps,(E,d)=>(a(),c("span",{class:x(["cms-tutorial-dot",{active:d===U(l).currentStepIndex,visited:d<U(l).currentStepIndex}]),key:d,onClick:b=>U(l).goTo(d)},null,10,js))),128))]),U(l).isLastStep?(a(),c("button",{key:1,class:"cms-tutorial-btn primary",onClick:y[3]||(y[3]=E=>U(l).stop())},y[9]||(y[9]=[n("span",null,"Fertig",-1),n("i",{class:"material-icons"},"check",-1)]))):(a(),c("button",{key:0,class:"cms-tutorial-btn primary",onClick:y[2]||(y[2]=E=>U(l).next())},y[8]||(y[8]=[n("span",null,"Weiter",-1),n("i",{class:"material-icons"},"arrow_forward",-1)])))])],6)])):f("",!0)])):f("",!0)}},Vs=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"})),Ys={key:0,class:"image-editor-overlay"},qs={class:"image-editor-container"},Fs={class:"image-editor-header"},Gs={class:"image-editor-tools"},Xs={class:"color-picker-wrapper"},Zs={class:"size-picker-wrapper"},Js={class:"zoom-display"},Qs={class:"image-editor-actions"},Ks={class:"image-editor-canvas-wrapper"};function en(t,e,s,r,o,i){return s.visible?(a(),c("div",Ys,[n("div",qs,[n("div",Fs,[e[32]||(e[32]=n("div",{class:"image-editor-title"},"Screenshot bearbeiten",-1)),n("div",Gs,[n("div",{class:x(["cms-btn-icon round mini",{active:o.drawingTool==="pan"}]),onClick:e[0]||(e[0]=l=>o.drawingTool="pan"),title:"Verschieben"},e[19]||(e[19]=[n("i",{class:"material-icons"},"pan_tool",-1)]),2),n("div",{class:x(["cms-btn-icon round mini",{active:o.drawingTool==="pen"}]),onClick:e[1]||(e[1]=l=>o.drawingTool="pen"),title:"Stift"},e[20]||(e[20]=[n("i",{class:"material-icons"},"edit",-1)]),2),n("div",{class:x(["cms-btn-icon round mini",{active:o.drawingTool==="arrow"}]),onClick:e[2]||(e[2]=l=>o.drawingTool="arrow"),title:"Pfeil"},e[21]||(e[21]=[n("i",{class:"material-icons"},"arrow_forward",-1)]),2),n("div",{class:x(["cms-btn-icon round mini",{active:o.drawingTool==="rectangle"}]),onClick:e[3]||(e[3]=l=>o.drawingTool="rectangle"),title:"Rechteck"},e[22]||(e[22]=[n("i",{class:"material-icons"},"crop_square",-1)]),2),n("div",{class:x(["cms-btn-icon round mini",{active:o.drawingTool==="text"}]),onClick:e[4]||(e[4]=l=>o.drawingTool="text"),title:"Text"},e[23]||(e[23]=[n("i",{class:"material-icons"},"text_fields",-1)]),2),n("div",Xs,[e[24]||(e[24]=n("label",null,"Farbe:",-1)),te(n("input",{class:"color-picker",type:"color","onUpdate:modelValue":e[5]||(e[5]=l=>o.drawingColor=l)},null,512),[[he,o.drawingColor]])]),n("div",Zs,[e[25]||(e[25]=n("label",null,"GröÃe:",-1)),te(n("input",{class:"size-slider",type:"range",min:"1",max:"10","onUpdate:modelValue":e[6]||(e[6]=l=>o.drawingSize=l)},null,512),[[he,o.drawingSize]])]),n("div",Js,[e[26]||(e[26]=n("i",{class:"material-icons"},"zoom_in",-1)),n("span",null,_(Math.round(o.zoomLevel*100))+"%",1)]),n("div",{class:"cms-btn-icon round mini",onClick:e[7]||(e[7]=(...l)=>i.resetZoom&&i.resetZoom(...l)),title:"Zoom zurücksetzen"}
2,e[27]||(e[27]=[n("i",{class:"material-icons"},"center_focus_strong",-1)])),n("div",{class:"cms-btn-icon round mini",onClick:e[8]||(e[8]=(...l)=>i.undoDrawing&&i.undoDrawing(...l)),title:"Rückgängig"},e[28]||(e[28]=[n("i",{class:"material-icons"},"undo",-1)])),n("div",{class:"cms-btn-icon round mini",onClick:e[9]||(e[9]=(...l)=>i.clearDrawing&&i.clearDrawing(...l)),title:"Alle löschen"},e[29]||(e[29]=[n("i",{class:"material-icons"},"delete_sweep",-1)]))]),n("div",Qs,[n("div",{class:"cms-btn-icon icon-left label-visible-xs variant-danger",onClick:e[10]||(e[10]=(...l)=>i.cancel&&i.cancel(...l))},e[30]||(e[30]=[n("i",{class:"material-icons"},"close",-1),n("div",{class:"label"},"Abbrechen",-1)])),n("div",{class:"cms-btn-icon icon-left label-visible-xs variant-primary",onClick:e[11]||(e[11]=(...l)=>i.save&&i.save(...l))},e[31]||(e[31]=[n("i",{class:"material-icons"},"check",-1),n("div",{class:"label"},"Speichern",-1)]))])]),n("div",Ks,[n("canvas",{class:"image-editor-canvas",ref:"editorCanvas",onMousedown:e[12]||(e[12]=(...l)=>i.startDrawing&&i.startDrawing(...l)),onMousemove:e[13]||(e[13]=(...l)=>i.draw&&i.draw(...l)),onMouseup:e[14]||(e[14]=(...l)=>i.stopDrawing&&i.stopDrawing(...l)),onMouseleave:e[15]||(e[15]=(...l)=>i.stopDrawing&&i.stopDrawing(...l)),onClick:e[16]||(e[16]=(...l)=>i.handleCanvasClick&&i.handleCanvasClick(...l)),onWheel:e[17]||(e[17]=(...l)=>i.handleWheel&&i.handleWheel(...l)),onContextmenu:e[18]||(e[18]=me(()=>{},["prevent"]))},null,544)])])])):f("",!0)}const tn={name:"ImageEditor",props:{visible:{type:Boolean,default:!1},screenshot:{type:Object,default:null}},data(){return{drawingTool:"pen",baseScale:1,drawingColor:"#ff0000",drawingSize:3,isDrawing:!1,drawingHistory:[],currentDrawing:null,editorContext:null,originalImageData:null,zoomLevel:1,minZoom:.1,maxZoom:10,panX:0,panY:0,isPanning:!1,lastPanX:0,lastPanY:0}},watch:{visible(t){t&&this.screenshot&&this.initEditor()},screenshot(t){t&&this.visible&&this.initEditor()},drawingTool(t){const e=this.$refs.editorCanvas;e&&(e.style.cursor=t==="pan"?"grab":"crosshair")}},methods:{initEditor(){this.drawingHistory=[],this.zoomLevel=1,this.panX=0,this.panY=0,this.$nextTick(()=>{this.initializeCanvas()})},initializeCanvas(){const t=this.$refs.editorCanvas;if(!t||!this.screenshot)return;const e=t.getContext("2d");this.editorContext=e;const s=new Image;s.onload=()=>{t.width=s.width,t.height=s.height,e.drawImage(s,0,0),this.originalImageData=e.getImageData(0,0,t.width,t.height);const r=t.parentElement,o=r.clientWidth-40,i=r.clientHeight-40,l=Math.min(o/s.width,i/s.height,1);this.baseScale=l;const u=Math.sqrt(s.width*s.width+s.height*s.height);this.maxZoom=Math.max(10,Math.ceil(u/200)),t.style.transform=`scale(${l})`,t.style.transformOrigin="center center"},s.src=this.screenshot.objectUrl},updateCanvasTransform(t){const e=this.$refs.editorCanvas;if(!e)return;const r=(t!==void 0?t:this.baseScale||1)*this.zoomLevel;e.style.transform=`translate(${this.panX}px, ${this.panY}px) scale(${r})`,e.style.transformOrigin="center center"},handleWheel(t){t.preventDefault();const e=t.deltaY>0?.9:1.1,s=Math.max(this.minZoom,Math.min(this.maxZoom,this.zoomLevel*e));this.zoomLevel=s,this.updateCanvasTransform()},resetZoom(){this.zoomLevel=1,this.panX=0,this.panY=0,this.updateCanvasTransform()},startDrawing(t){const e=this.$refs.editorCanvas;if(e.getBoundingClientRect(),this.drawingTool==="pan"||t.button===1||t.button===2||t.button===0&&t.shiftKey){t.preventDefault(),this.isPanning=!0,this.lastPanX=t.clientX,this.lastPanY=t.clientY,e.style.cursor="grabbing";return}if(this.drawingTool==="text")return;this.isDrawing=!0;const{x:s,y:r}=this.getCanvasCoordinates(t.clientX,t.clientY);this.currentDrawing={tool:this.drawingTool,color:this.drawingColor,size:this.drawingSize,startX:s,startY:r,points:[{x:s,y:r}]}},draw(t){if(this.$refs.editorCanvas,this.isPanning){const o=t.clientX-this.lastPanX,i=t.clientY-this.lastPanY;this.panX+=o,this.panY+=i,this.lastPanX=t.clientX,this.lastPanY=t.clientY,this.updateCanvasTransform();return}if(!this.isDrawing||this.drawingTool==="text")return;const{x:e,y:s}=this.getCanvasCoordinates(t.clientX,t.clientY),r=this.editorContext;if(this.drawingTool==="pen"){this.currentDrawing.points.push({x:e,y:s});const o=this.currentDrawing.points[this.currentDrawing.points.length-2];r.strokeStyle=this.drawingColor,r.lineWidth=this.drawingSize,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(o.x,o.y),r.lineTo(e,s),r.stroke()}else this.currentDrawing.endX=e,this.currentDrawing.endY=s,this.redrawCanvas(),this.drawShape(this.currentDrawing.startX,this.currentDrawing.startY,e,s)},stopDrawing(){const t=this.$refs.editorCanvas;if(this.isPanning){this.isPanning=!1,t.style.cursor=this.drawingTool==="pan"?"grab":"crosshair";return}this.isDrawing&&(this.isDrawing=!1,this.currentDrawing&&(this.drawingHistory.push(this.currentDrawing),this.currentDrawing=null))},drawShape(t,e,s,r){const o=this.editorContext;o.strokeStyle=this.drawingColor,o.fillStyle=this.drawingColor,o.lineWidth=this.drawingSize,o.lineCap="round",this.drawingTool==="arrow"?this.drawArrow(t,e,s,r):this.drawingTool==="rectangle"&&o.strokeRect(t,e,s-t,r-e)},drawArrow(t,e,s,r){const o=this.editorContext,i=15+this.drawingSize*2,l=Math.atan2(r-e,s-t);o.beginPath(),o.moveTo(t,e),o.lineTo(s,r),o.stroke(),o.beginPath(),o.moveTo(s,r),o.lineTo(s-i*Math.cos(l-Math.PI/6),r-i*Math.sin(l-Math.PI/6)),o.moveTo(s,r),o.lineTo(s-i*Math.cos(l+Math.PI/6),r-i*Math.sin(l+Math.PI/6)),o.stroke()},handleCanvasClick(t){if(this.drawingTool!=="text")return;const{x:e,y:s}=this.getCanvasCoordinates(t.clientX,t.clientY),r=prompt("Text eingeben:");if(r){const o=this.editorContext;o.font=`${this.drawingSize*8}px Arial`,o.fillStyle=this.drawingColor,o.fillText(r,e,s),this.drawingHistory.push({tool:"text",color:this.drawingColor,size:this.drawingSize,x:e,y:s,text:r})}},getCanvasCoordinates(t,e){const s=this.$refs.editorCanvas,r=s.getBoundingClientRect(),o=(t-r.left)/r.width*s.width,i=(e-r.top)/r.height*s.height;return{x:o,y:i}},redrawCanvas(){const t=this.editorContext;this.$refs.editorCanvas,this.originalImageData&&(t.putImageData(this.originalImageData,0,0),this.drawingHistory.forEac
2h(e=>{t.strokeStyle=e.color,t.fillStyle=e.color,t.lineWidth=e.size,t.lineCap="round",t.lineJoin="round",e.tool==="pen"?(t.beginPath(),t.moveTo(e.points[0].x,e.points[0].y),e.points.forEach(s=>{t.lineTo(s.x,s.y)}),t.stroke()):e.tool==="arrow"?this.drawArrow(e.startX,e.startY,e.endX,e.endY):e.tool==="rectangle"?t.strokeRect(e.startX,e.startY,e.endX-e.startX,e.endY-e.startY):e.tool==="text"&&(t.font=`${e.size*8}px Arial`,t.fillText(e.text,e.x,e.y))}))},undoDrawing(){this.drawingHistory.length>0&&(this.drawingHistory.pop(),this.redrawCanvas())},clearDrawing(){this.drawingHistory=[],this.redrawCanvas()},cancel(){this.$emit("cancel")},save(){this.$refs.editorCanvas.toBlob(e=>{const s=URL.createObjectURL(e);this.$emit("save",{blob:e,objectUrl:s})},"image/png")}}},sn=q(tn,[["render",en],["__scopeId","data-v-150fcb6a"]]),nn={key:0,class:"bug-preview-body"},on={key:0,class:"bug-preview-grid"},rn={class:"bug-preview-image-wrapper"},ln=["src"],an={class:"bug-preview-overlay-actions"},cn=["onClick"],dn=["onClick"],un={key:0,class:"bug-preview-meta"},mn={class:"bug-preview-meta-item"},hn={key:0,class:"bug-preview-meta-item"},gn={key:1,class:"bug-preview-meta-item"},pn={key:1,class:"bug-preview-empty"},fn={key:1,class:"bug-preview-body"},vn={class:"cms-form-form"},bn={class:"cms-form-group horizontal"},yn={key:2,class:"bug-preview-body"},wn={class:"upload-progress-container"},_n={class:"upload-header"},Cn={class:"upload-list"},kn={class:"upload-item-image"},xn=["src"],Sn={class:"upload-item-details"},En={class:"upload-item-name"},An={class:"upload-item-status"},Tn={key:0,class:"upload-summary"},$n={class:"bug-preview-footer"},Rn={key:0,class:"material-icons"},Dn={key:1,class:"material-icons"},Mn={class:"label"};function Ln(t,e,s,r,o,i){const l=je,u=Ve,v=st,h=Ye,C=Ae,O=sn;return a(),c(I,null,[o.show?(a(),H(C,{key:0,modal:!0,controls:!0,title:i.getTitle(),icon:"bug_report",onClose:i.close,wrapperClass:{"cms-bugreport-dialog":!0}},{body:P(()=>[o.currentPage===1?(a(),c("div",nn,[t.screenshotCount>0?(a(),c("div",on,[(a(!0),c(I,null,G(t.screenshots,p=>(a(),c("div",{class:"bug-preview-item",key:p.id},[n("div",rn,[n("img",{class:"bug-preview-image",src:p.objectUrl,alt:"Screenshot"},null,8,ln),n("div",an,[n("div",{class:"cms-btn-icon round mini",onClick:$=>i.editScreenshot(p),title:"Edit"},e[10]||(e[10]=[n("i",{class:"material-icons"},"edit",-1)]),8,cn),n("div",{class:"cms-btn-icon round mini",onClick:$=>i.removeScreenshot(p.id),title:"Remove"},e[11]||(e[11]=[n("i",{class:"material-icons"},"delete",-1)]),8,dn)])]),p.meta?(a(),c("div",un,[n("div",mn,[e[12]||(e[12]=n("i",{class:"material-icons"},"schedule",-1)),n("span",null,_(i.formatTime(p.timestamp)),1)]),p.meta.viewport?(a(),c("div",hn,[e[13]||(e[13]=n("i",{class:"material-icons"},"aspect_ratio",-1)),n("span",null,_(p.meta.viewport.width)+"Ã"+_(p.meta.viewport.height),1)])):f("",!0),p.meta.edited?(a(),c("div",gn,e[14]||(e[14]=[n("i",{class:"material-icons"},"edit",-1),n("span",null,"Bearbeitet",-1)]))):f("",!0)])):f("",!0)]))),128))])):(a(),c("div",pn,e[15]||(e[15]=[n("i",{class:"material-icons"},"image_not_supported",-1),n("p",null,"No screenshots captured",-1),n("small",null,"Click the bug report button to capture a screenshot",-1)])))])):f("",!0),o.currentPage===2?(a(),c("div",fn,[n("div",vn,[A(l,{modelValue:o.bugReport.title,"onUpdate:modelValue":e[0]||(e[0]=p=>o.bugReport.title=p),label:"Kurzer Titel des Problems"},null,8,["modelValue"]),n("div",bn,[A(u,{modelValue:o.bugReport.status_reproduceable,"onUpdate:modelValue":e[1]||(e[1]=p=>o.bugReport.status_reproduceable=p),options:t.statusReproduce,placeholder:"Reproduzierbar",label:"Reproduzierbar","track-by":"key"},null,8,["modelValue","options"])]),A(v,{modelValue:o.bugReport.description,"onUpdate:modelValue":e[2]||(e[2]=p=>o.bugReport.description=p),label:"Beschreibung",mode:"basic"},null,8,["modelValue"]),A(v,{modelValue:o.bugReport.steps_to_reproduce,"onUpdate:modelValue":e[3]||(e[3]=p=>o.bugReport.steps_to_reproduce=p),label:"Schritte zur Reproduktion",mode:"basic"},null,8,["modelValue"]),A(v,{modelValue:o.bugReport.additional_information,"onUpdate:modelValue":e[4]||(e[4]=p=>o.bugReport.additional_information=p),label:"Zusätzliche Informationen",mode:"basic"},null,8,["modelValue"])])])):f("",!0),o.currentPage===3?(a(),c("div",yn,[n("div",wn,[n("div",_n,[e[16]||(e[16]=n("i",{class:"material-icons upload-icon"},"cloud_upload",-1)),e[17]||(e[17]=n("h3",null,"Screenshots werden hochgeladen...",-1)),n("p",null,_(i.uploadedCount)+" von "+_(i.totalUploads)+" hochgeladen",1)]),n("div",Cn,[(a(!0),c(I,null,G(o.uploadProgress,p=>(a(),c("div",{class:x(["upload-item",{completed:p.status==="complete",error:p.status==="error"}]),key:p.id},[n("div",kn,[n("img",{src:p.objectUrl,alt:"Screenshot"},null,8,xn)]),n("div",Sn,[n("div",En,"Screenshot "+_(p.index+1),1),n("div",An,[p.status==="uploading"?(a(),H(h,{key:0,current:p.progress,total:100,type:"upload","show-label":!1,size:"sm"},null,8,["current"])):f("",!0),p.status==="complete"?(a(),c(I,{key:1},[e[18]||(e[18]=n("i",{class:"material-icons success-icon"},"check_circle",-1)),e[19]||(e[19]=n("span",{class:"success-text"},"Hochgeladen",-1))],64)):f("",!0),p.status==="error"?(a(),c(I,{key:2},[e[20]||(e[20]=n("i",{class:"material-icons error-icon"},"error",-1)),e[21]||(e[21]=n("span",{class:"error-text"},"Fehler beim Hochladen",-1))],64)):f("",!0)])])],2))),128))]),i.uploadComplete?(a(),c("div",Tn,e[22]||(e[22]=[n("i",{class:"material-icons success-icon-large"},"check_circle",-1),n("h3",null,"Alle Screenshots erfolgreich hochgeladen!",-1),n("p",null,"Bug Report wird erstellt...",-1)]))):f("",!0)])])):f("",!0)]),footer:P(()=>[n("div",$n,[o.currentPage===1?(a(),c(I,{key:0},[n("div",{class:"cms-btn-icon icon-left label-visible-xs variant-danger",onClick:e[5]||(e[5]=(...p)=>i.clearAll&&i.clearAll(...p))},e[23]||(e[23]=[n("i",{class:"material-icons"},"delete_sweep",-1),n("div",{class:"label"},"Alle löschen",-1)])),n("div",{class:"cms-btn-icon icon-left label-visible-xs",onClick:e[6]||(e[6]=(...p)=>i.captureAnotherScreenshot&&i.captureAnotherScreenshot(...p))},e[24]||(e[24]=[n("i",{class:"material-icons"},"add",-1),n("div",{class:"label"},"Screenshot hinzufügen",-1)])),e[26]||(e[26]=n("div",{class:"cms-spacer"},null,-1)),n("div",{class:x(["cms-btn-icon icon-right label-visible-xs variant-primary",{disabled:t.screenshotCount===0}]),onClick:e[7]||(e[7]=(...p)=>i.nextPage&&i.nextPage(...p))},e[25]||(e[25]=[n("div",{class:"label"},"Weiter",-1),n("i",{class:"material-icons"},"arrow_forward",-1)]),2)],64)):f("",!0),o.currentPage===2?(a(),c(I,{key:1},[n("div",{class:"cms-btn-icon icon-left label-visible-xs",onClick:e[8]||(e[8]=(...p)=>i.previousPage&&i.previousPage(...p))}
2,e[27]||(e[27]=[n("i",{class:"material-icons"},"arrow_back",-1),n("div",{class:"label"},"Zurück",-1)])),e[29]||(e[29]=n("div",{class:"cms-spacer"},null,-1)),n("div",{class:"cms-btn-icon icon-right label-visible-xs variant-primary",onClick:e[9]||(e[9]=(...p)=>i.proceedToUpload&&i.proceedToUpload(...p))},e[28]||(e[28]=[n("div",{class:"label"},"Bug Report senden",-1),n("i",{class:"material-icons"},"send",-1)]))],64)):f("",!0),o.currentPage===3?(a(),c(I,{key:2},[e[30]||(e[30]=n("div",{class:"cms-spacer"},null,-1)),n("div",{class:x(["cms-btn-icon icon-right label-visible-xs variant-primary",{disabled:!i.uploadComplete}])},[i.uploadComplete?(a(),c("i",Rn,"check")):(a(),c("i",Dn,"hourglass_empty")),n("div",Mn,_(i.uploadComplete?"Abgeschlossen":"Upload läuft..."),1)],2)],64)):f("",!0)])]),_:1},8,["title","onClose"])):f("",!0),A(O,{visible:o.editingScreenshot!==null,screenshot:o.editingScreenshot,onCancel:i.cancelEdit,onSave:i.saveEdit},null,8,["visible","screenshot","onCancel","onSave"])],64)}const Pn={name:"BugReportPreview",components:{},data(){return{show:!1,isMounted:!1,currentPage:1,bugReport:{title:"",status_reproduceable:null,status_severity:null,status_priority:null,description:"",steps_to_reproduce:"",additional_information:""},editingScreenshot:null,isClient:!1,uploadProgress:[],uploadedScreenshotIds:[],uploader:null}},mounted(){this.isMounted=!0,this.isClient=!0,this.initUploader()},computed:{...Ee("bugtracker",["screenshots","screenshotCount","statusReproduce","statusSeverity","statusPriority"]),totalUploads(){return this.uploadProgress.length},uploadedCount(){return this.uploadProgress.filter(t=>t.status==="complete").length},uploadComplete(){return this.totalUploads>0&&this.uploadedCount===this.totalUploads}},watch:{uploadComplete(t){t&&setTimeout(()=>{this.createBugReportWithUploadedScreenshots()},1500)}},methods:{getTitle(){return{1:"Neuer Bugreport - Screenshots",2:"Neuer Bugreport - Details",3:"Neuer Bugreport - Upload"}[this.currentPage]},initUploader(){this.uploader=new Fe({endpoint:"/api/v0/upload",newtags:["bugreport","screenshot"]}),this.uploader.on("upload::progress",(t,e)=>{const s=this.uploadProgress.find(r=>r.tempId===t._id);s&&(s.progress=e,s.status=e===100?"processing":"uploading")}),this.uploader.on("upload::complete",(t,e)=>{const s=this.uploadProgress.find(r=>r.tempId===t._id);if(s){s.status="complete";const r=e.response[0];this.uploadedScreenshotIds.push(r._id)}})},open(){this.show=!0,this.currentPage=1,this.resetBugReport(),this.uploadProgress=[],this.uploadedScreenshotIds=[]},close(){this.show=!1,this.currentPage=1},nextPage(){if(this.screenshotCount===0){this.$notify({content:"Bitte fügen Sie mindestens einen Screenshot hinzu",type:"warning"});return}this.currentPage=2},previousPage(){this.currentPage=1},captureAnotherScreenshot(){this.$emit("capture-screenshot"),this.close()},editScreenshot(t){this.editingScreenshot=t},cancelEdit(){this.editingScreenshot=null},saveEdit({blob:t,objectUrl:e}){this.editingScreenshot.objectUrl&&URL.revokeObjectURL(this.editingScreenshot.objectUrl),this.screenshots.find(r=>r.id===this.editingScreenshot.id)&&this.$store.commit("bugtracker/UPDATE_SCREENSHOT_META",{screenshotId:this.editingScreenshot.id,meta:{blob:t,objectUrl:e,edited:!0}}),this.editingScreenshot=null},resetBugReport(){this.bugReport={title:"",status_reproduceable:null,status_severity:null,status_priority:null,description:"",steps_to_reproduce:"",additional_information:""}},removeScreenshot(t){this.$store.commit("bugtracker/REMOVE_SCREENSHOT",t)},clearAll(){qe("Alle Screenshots löschen?",t=>{t||this.$store.commit("bugtracker/CLEAR_ALL_SCREENSHOTS")})},proceedToUpload(){if(!this.bugReport.title){this.$notify({content:"Bitte geben Sie einen Titel ein",type:"warning"});return}this.currentPage=3,this.uploadProgress=this.screenshots.map((t,e)=>({id:t.id,tempId:t.id,index:e,objectUrl:t.objectUrl,progress:0,status:"queued",uploadedId:null})),this.uploadScreenshots()},async uploadScreenshots(){const t=[];for(let e=0;e<this.screenshots.length;e++){const s=this.screenshots[e];let r=s.blob;!r&&s.objectUrl&&(r=await(await fetch(s.objectUrl)).blob());const o=new File([r],`screenshot-${e+1}.png`,{type:"image/png"});o._id=s.id,o.tags=["bugreport","screenshot"],t.push({_id:s.id,file:o,newtags:["bugreport","screenshot"],tags:["upload_queued"],name:`screenshot-${e+1}`,size:r.size,ext:"png",status:"queued",progress:0,type:"upload",isImg:!0})}this.uploader.setQueue(t),this.uploader.processQueue(e=>{e&&this.$notify({content:"Fehler beim Hochladen der Screenshots",type:"error"})})},createBugReportWithUploadedScreenshots(){var e;const t={...this.bugReport,images:this.uploadedScreenshotIds,date:new Date,reported_by:(e=this.$store.getters["auth/user"])==null?void 0:e._id,status_developer:{key:"open",value:"offen"},vuex_state:JSON.stringify(this.$store.state)};this.$store.dispatch("bugtracker/create",t).then(()=>
2{this.$notify({content:"Bug Report erfolgreich erstellt!"}),this.$store.commit("bugtracker/CLEAR_ALL_SCREENSHOTS"),this.close()},s=>{this.$notify({content:"Fehler beim Erstellen: "+s,type:"error"})})},formatTime(t){return t?new Date(t).toLocaleTimeString():""}}},In=q(Pn,[["render",Ln]]),Nn={class:"logout-content"},Un={class:"logout-controls"};function On(t,e,s,r,o,i){const l=Te,u=Ae;return o.isClient&&o.showModal?(a(),H(u,{key:0,modal:!0,onClose:i.dismissModal,controls:!1,showHeader:!0,showFooter:!1,fitContent:!0,icon:"warning",wrapperClass:{"cms-logout-warning-dialog":!0}},{header:P(()=>e[0]||(e[0]=[n("div",{class:"logout-title"},"Automatischer Logout",-1)])),body:P(()=>[n("div",Nn,[n("p",null,[e[1]||(e[1]=be("Sie werden in ",-1)),n("strong",null,_(i.displayTime),1),e[2]||(e[2]=be(" automatisch abgemeldet.",-1))]),e[3]||(e[3]=n("p",null,"Ungespeicherte Ãnderungen gehen dabei verloren.",-1))]),n("div",Un,[A(l,{label:"Verstanden",icon:"close",variant:"outline",onClick:i.dismissModal},null,8,["onClick"])])]),_:1},8,["onClose"])):f("",!0)}$e.extend(nt);const Se=["mousemove","mousedown","keydown","scroll","touchstart","click"],Bn={data(){return{timeLeftMs:null,showModal:!1,isClient:!1,sessionWarningThreshold:5*60*1e3,lastDismissedAt:null,dismissIntervalMs:15*1e3,lastActivityAt:0}},computed:{autologoutMs(){var e,s,r;const t=Number((r=(s=(e=this.$store.state.config)==null?void 0:e.components)==null?void 0:s.auth)==null?void 0:r.default_autologout);return isFinite(t)&&t>0?t*6e4:0},displayTime(){if(this.timeLeftMs==null||this.timeLeftMs<0)return"0 Sekunden";const t=$e.duration(this.timeLeftMs),e=Math.floor(this.timeLeftMs/6e4),s=t.seconds();if(this.timeLeftMs>=6e4){const r=String(s).padStart(2,"0");return`${e}:${r} Minuten`}else return`${s} Sekunden`},ADMINCENTER_URL(){return this.$store.getters["config/ADMINCENTER_URL"]}},methods:{registerActivity(){const t=Date.now();t-this.lastActivityAt>=900&&(this.lastActivityAt=t)},updateTimeLeft(){const t=Date.now(),e=parseInt(Ge(this.$store),10),s=isNaN(e)?-1:e-t,r=this.autologoutMs>0?this.autologoutMs-(t-this.lastActivityAt):1/0;if(this.timeLeftMs=Math.min(s,r),this.timeLeftMs<=0){this.showModal=!1,this.handleSessionExpiration();return}let o=this.sessionWarningThreshold;this.autologoutMs>0&&this.autologoutMs<this.sessionWarningThreshold*2&&(o=Math.max(3e4,Math.floor(this.autologoutMs/2))),this.timeLeftMs<=o?!this.showModal&&(this.lastDismissedAt===null||t-this.lastDismissedAt>=this.dismissIntervalMs)&&(this.showModal=!0):(this.showModal=!1,this.lastDismissedAt=null)},dismissModal(){this.showModal=!1,this.lastDismissedAt=Date.now()},async handleSessionExpiration(){var e,s;clearInterval(this.timer);let t;try{t=this.$router.resolve({name:"login",params:{lang:((s=(e=this.$route)==null?void 0:e.params)==null?void 0:s.lang)||"de"}}).href}catch{}await this.$store.dispatch("auth/forceLogout",t?{href:t}:{})}},mounted(){this.isClient=!0,this.lastActivityAt=Date.now(),this._activityHandler=this.registerActivity.bind(this),Se.forEach(t=>window.addEventListener(t,this._activityHandler,{passive:!0})),this.updateTimeLeft(),this.timer=setInterval(this.updateTimeLeft,1e3)},beforeUnmount(){clearInterval(this.timer),this._activityHandler&&Se.forEach(t=>window.removeEventListener(t,this._activityHandler))}},Hn=q(Bn,[["render",On]]),zn=["shop","accounting","pages","customer-contact","customer-contact-crm","customer-contact-messages","customer-contact-booking","marketing","marketing-newsletter","marketing-blog","marketing-analytics","system","system-notifications","system-aiintegration"],Wn={__name:"NavigationNode",props:{item:{type:Object,required:!0},autoCollapse:{type:Boolean,default:!0},currentRoute:{type:String,default:""},baseClass:{type:String,default:"cms-admincenter-navnew-node"},depth:{type:Number,default:0},toggleOnClick:{type:Boolean,default:!0}},emits:["toggle","navigate"],setup(t,{emit:e}){const s=t,r=e,o=(...d)=>{};pe(()=>{var d,b,B,V;o("MOUNTED",{itemId:(d=s.item)==null?void 0:d.id,itemLabel:(b=s.item)==null?void 0:b.label,itemHref:(B=s.item)==null?void 0:B.href,hasChildren:l.value,isExpanded:u.value,currentRoute:s.currentRoute,visible:(V=s.item)==null?void 0:V.visible,depth:s.depth})}),ye(()=>{var d,b;o("UNMOUNTING",{itemId:(d=s.item)==null?void 0:d.id,itemLabel:(b=s.item)==null?void 0:b.label})});const i=W(()=>{const d=s.item.visible!==!1;return o("shouldRenderItem computed",{visible:d,itemVisible:s.item.visible}),d}),l=W(()=>{var b;const d=s.item.children&&s.item.children.length>0;return o("hasChildren computed",{result:d,childrenLength:(b=s.item.children)==null?void 0:b.length}),d}),u=W(()=>{const d=s.item.expanded===!0;return o("isExpanded computed",{expanded:d,itemExpanded:s.item.expanded}),d}),v=W(()=>{if(!s.item.href||typeof s.item.href!="string"||!s.currentRoute)return!1;let d=s.item.href;if(d.startsWith("http://")||d.startsWith("https://"))try{d=new URL(d).pathname}catch{return!1}return l.value?s.currentRoute.startsWith(d):s.currentRoute===d}),h=W(()=>{if($.value)return[];if(!s.item.children)return[];const d=s.item.children.filter(b=>b.visible!==!1);return o("visibleChildren computed",{totalChildren:s.item.children.length,visibleCount:d.length,children:s.item.children.map(b=>({id:b.id,label:b.label,visible:b.visible}))}),d}),C=W(()=>s.item.moduleEnabled===!1||s.item.roleDisabled===!0?"module-disabled":"module-enabled"),O=W(()=>{const b=(s.item.id||"").split("-"),B=[];for(let M=b.length;M>0;M--)B.push(b.slice(0,M).join("-"));
2const N=(s.item.href||"").split("/").filter(Boolean),z=N.indexOf("admincenter");if(z>=0){const M=N.slice(z+1);for(let Y=M.length;Y>0;Y--)B.push(M.slice(0,Y).join("-"))}return B.some(M=>zn.includes(M))}),p=W(()=>s.item.moduleEnabled===!1||s.item.roleDisabled===!0),$=W(()=>p.value&&!O.value);re(()=>s.currentRoute,(d,b)=>{}),re(()=>s.item,(d,b)=>{o("item CHANGED",{oldId:b==null?void 0:b.id,newId:d==null?void 0:d.id,oldExpanded:b==null?void 0:b.expanded,newExpanded:d==null?void 0:d.expanded,oldHref:b==null?void 0:b.href,newHref:d==null?void 0:d.href})},{deep:!0}),re(()=>{var d;return(d=s.item)==null?void 0:d.expanded},(d,b)=>{});const j=d=>{const b={};return d&&(b.borderLeft=`10px solid ${d}`),b},T=()=>{$.value||(o("handleToggle CALLED",{itemId:s.item.id,itemLabel:s.item.label,currentExpanded:s.item.expanded,href:s.item.href,hasChildren:l.value}),r("toggle",s.item.id),o("handleToggle - emitted toggle event",{itemId:s.item.id}),s.item.href&&(o("handleToggle - has href, scheduling navigate emit",{href:s.item.href}),oe(()=>{o("handleToggle - emitting navigate event",{href:s.item.href}),r("navigate",s.item.href)})))},Q=d=>{if($.value){d.preventDefault(),d.stopPropagation();return}o("handleSimpleClick CALLED",{itemId:s.item.id,itemLabel:s.item.label,href:s.item.href,hasHref:!!s.item.href}),s.item.href&&(o("handleSimpleClick - emitting navigate event",{href:s.item.href}),r("navigate",s.item.href))},g=d=>{o("onEnter - transition starting",{scrollHeight:d.scrollHeight}),d.style.height="0",d.style.opacity="0",d.offsetHeight,d.style.transition="height 0.3s ease, opacity 0.3s ease",d.style.height=d.scrollHeight+"px",d.style.opacity="1"},y=d=>{d.style.height="auto"},E=d=>{o("onLeave - transition starting",{scrollHeight:d.scrollHeight}),d.style.height=d.scrollHeight+"px",d.offsetHeight,d.style.transition="height 0.3s ease, opacity 0.3s ease",d.style.height="0",d.style.opacity="0"};return(d,b)=>{const B=K("navigation-node",!0),V=K("router-link");return i.value?(a(),c("div",{key:0,class:x([t.baseClass,{[`${t.baseClass}--first-level`]:t.depth===0}])},[l.value&&!$.value?(a(),c("div",{key:0,class:x([`${t.baseClass}__item`,`${t.baseClass}__item--expandable`,C.value,{[`${t.baseClass}__item--active`]:t.item.active||v.value,[`${t.baseClass}__item--expanded`]:u.value}]),style:ee({marginLeft:t.depth>0?"10px":"0",backgroundColor:t.item.color})},[n("div",{class:x(`${t.baseClass}__content`),style:ee(j(t.item.color)),onClick:me(T,["stop"])},[n("div",{class:x(`${t.baseClass}__label`)},[n("i",{class:x(["material-icons",`${t.baseClass}__icon`])},_(t.item.icon),3),n("span",{class:x(`${t.baseClass}__text`)},_(t.item.label),3)],2),n("div",{class:x(`${t.baseClass}__toggle`)},[n("i",{class:x(["material-icons",[`${t.baseClass}__arrow`,{[`${t.baseClass}__arrow--expanded`]:u.value}]])},"expand_more",2)],2)],6),n("div",{class:x(`${t.baseClass}__spacer`)},null,2),A(Xe,{name:"expand",onEnter:g,onAfterEnter:y,onLeave:E},{default:P(()=>[u.value?(a(),c("div",{key:0,class:x(`${t.baseClass}__children`)},[(a(!0),c(I,null,G(h.value,N=>(a(),H(B,{key:N.id,item:N,"auto-collapse":t.autoCollapse,"current-route":t.currentRoute,"base-class":t.baseClass,depth:t.depth+1,"toggle-on-click":t.toggleOnClick,onToggle:b[0]||(b[0]=z=>d.$emit("toggle",z)),onNavigate:b[1]||(b[1]=z=>d.$emit("navigate",z))},null,8,["item","auto-collapse","current-route","base-class","depth","toggle-on-click"]))),128))],2)):f("",!0)]),_:1})],6)):(a(),c("div",{key:1,class:x([`${t.baseClass}__item`,`${t.baseClass}__item--simple`,C.value,{[`${t.baseClass}__item--active`]:t.item.active||v.value}]),style:ee({marginLeft:t.depth>0?"10px":"0"}),onClick:b[2]||(b[2]=me(N=>Q(N),["stop"]))},[t.item.href&&!$.value?(a(),H(V,{key:0,to:t.item.href,class:x(`${t.baseClass}__link`),style:ee(j(t.item.color))},{default:P(()=>[n("i",{class:x(["material-icons",`${t.baseClass}__icon`])},_(t.item.icon),3),n("span",{class:x(`${t.baseClass}__text`)},_(t.item.label),3)]),_:1},8,["to","class","style"])):(a(),c("div",{key:1,class:x(`${t.baseClass}__content`),style:ee(j(t.item.color))},[n("i",{class:x(["material-icons",`${t.baseClass}__icon`])},_(t.item.icon),3),n("span",{class:x(`${t.baseClass}__text`)},_(t.item.label),3)],6)),n("div",{class:x(`${t.baseClass}__spacer`)},null,2)],6))],2)):f("",!0)}}},jn=q(Wn,[["__scopeId","data-v-0867e480"]]),Vn={class:"inner"},Yn={__name:"admincenterMenu",props:{autoCollapse:{type:Boolean,default:!1}},setup(t,{expose:e}){function s(m,w){const k=(m==null?void 0:m.roles)||[];function S(L,R=[]){R=R.concat(L);for(const D of L){if(!w||!w[D])continue;const F=w[D].inherits;F&&F.length&&(R=S(F,R))}return R}return[...new Set(S(k))]}const r=Ze(),o=Qe(),i=Z(null),l=Z({path:"",params:{}}),u=typeof window>"u",v=()=>{var m;return u?{router:null,route:{path:"",params:{}}}:(m=o==null?void 0:o.proxy)!=null&&m.$router&&typeof o.proxy.$router.push=="function"?{router:o.proxy.$router,route:o.proxy.$route}:{router:null,route:{path:"",params:{}}}},h=v();i.value=h.router,l.value=h.route;const C=Z(null),O=Z(!1),p=Z({suppressScrollX:!0}),$=Z([]),j=W(()=>
2r.getters["auth/isAdmin"]),T=W(()=>r.getters["auth/isSystem"]),Q=W(()=>r.getters["auth/isModerator"]),g=W(()=>r.getters["config/ADMINCENTER_URL"]),y=W(()=>r.getters["invoice/MODULE_RESOURCES_ENABLED"]),E=W(()=>r.getters["invoice/MODULE_FACTORS_ENABLED"]),d=W(()=>{var m,w;return(w=(m=l.value)==null?void 0:m.params)==null?void 0:w.id}),b=W(()=>{var m;return((m=l.value)==null?void 0:m.path)||""}),B=()=>!0,V=m=>{if(!r.hasModule||!r.hasModule("invoice")||typeof r.getters["invoice/COLORS"]!="function")return"#eee";let w=r.getters["invoice/COLORS"](m+"_background");return w||"#eee"},N=m=>`${g.value}/accounting/${m}/edit`,z=()=>{const m=[],w=k=>{k.forEach(S=>{S.expanded&&m.push(S.id),S.children&&w(S.children)})};return w($.value),m},M=m=>{const w=k=>{k.forEach(S=>{m.includes(S.id)&&(S.expanded=!0),S.children&&w(S.children)})};w($.value)},Y=(m=!1)=>{var k,S,L,R,D;const w=m?z():[];$.value=it({ADMINCENTER_URL:g.value,auth_isSystem:T.value,auth_isAdmin:j.value,auth_isModerator:Q.value,isEnabled:B,getColors:V,getEditLink:N,hasId:d.value,MODULE_FACTORS_ENABLED:E.value,MODULE_RESOURCES_ENABLED:y.value,crmMailboxes:r.getters["config/CRM_SELECTED_MAILBOXES"]||[],menuRolePermissions:((S=(k=r.state.config)==null?void 0:k.permissions)==null?void 0:S.menuRoles)||null,userInheritedRoles:s((L=r.state.auth)==null?void 0:L.user,((R=r.state.config)==null?void 0:R.defaultRoles)||{}),defaultRoles:((D=r.state.config)==null?void 0:D.defaultRoles)||{}}),m&&w.length>0&&M(w)},ce=t,se=m=>{const w=(S,L,R=null)=>{for(const D of S){if(D.id===L)return{item:D,parent:R,siblings:S};if(D.children){const F=w(D.children,L,D);if(F)return F}}return null},k=w($.value,m);if(k){const{item:S,siblings:L}=k;ce.autoCollapse&&L.forEach(R=>{if(R.id!==m){R.expanded=!1;const D=F=>{F.forEach(fe=>{fe.expanded=!1,fe.children&&D(fe.children)})};R.children&&D(R.children)}}),S.expanded=!S.expanded}},X=(m,w)=>{const k=S=>{for(const L of S){if(L.id===m)return L.expanded=w,!0;if(L.children&&k(L.children))return!0}return!1};k($.value)},le=m=>{const w=(k,S,L=[])=>{for(const R of k){if(R.id===S)return L.forEach(D=>D.expanded=!0),!0;if(R.children&&w(R.children,S,[...L,R]))return!0}return!1};w($.value,m)},ae=m=>{if(!m)return;let w=null,k=0;const S=(L,R=[])=>{for(const D of L){if(D.href){let F=D.href;if(F.startsWith("http"))try{F=new URL(F).pathname}catch{}(m===F||m.startsWith(F+"/"))&&F.length>k&&(k=F.length,w={item:D,parents:[...R]})}D.children&&S(D.children,[...R,D])}};S($.value),w&&w.parents.forEach(L=>L.expanded=!0)},de=()=>{const m=w=>{w.forEach(k=>{k.expanded=!1,k.children&&m(k.children)})};m($.value)},ne=m=>{if(i.value&&typeof i.value.push=="function"){let w=m;if(m.startsWith("http://")||m.startsWith("https://"))try{w=new URL(m).pathname}catch(k){console.error("[admincenterMenu] Error parsing URL:",k)}i.value.push(w).catch(k=>{console.error("[admincenterMenu] Navigation failed",{error:k,to:w})})}else{let w=m;!m.startsWith("http://")&&!m.startsWith("https://")&&(g.value?w=g.value+m:w=window.location.origin+m),window.location.href=w}},we=()=>{C.value&&C.value.ps&&oe(()=>{C.value.ps.update()})},J=()=>{C.value&&C.value.$el&&(C.value.$el.style.height=`${window.innerHeight-56}px`,C.value.ps&&C.value.ps.update())},ie=()=>{O.value=window.scrollY>50};return re(()=>{var m;return(m=l.value)==null?void 0:m.path},m=>{we(),ae(m)}),re([g,j,T,Q,d,E,y],()=>{Y(!0)}),pe(()=>{var w;if(!i.value||typeof i.value.push!="function"){const k=v();i.value=k.router,l.value=k.route}Y(),ae((w=l.value)==null?void 0:w.path);const m=document.getElementsByTagName("body")[0];m&&(m.style.overflow="visible"),window.addEventListener("scroll",ie),window.addEventListener("resize",J),oe(()=>{J()})}),Je(()=>{window.removeEventListener("scroll",ie),window.removeEventListener("resize",J)}),e({setExpanded:X,toggleExpanded:se,expandParents:le,collapseAll:de}),(m,w)=>{const k=jn;return a(),c("div",{class:x(["cms-admincenter-nav cms-card-card",{scrolled:O.value}])},[A(U(ot),{ref_key:"scrollbarRef",ref:C,options:p.value},{default:P(()=>[n("div",Vn,[(a(!0),c(I,null,G($.value,S=>(a(),H(k,{key:S.id,item:S,"auto-collapse":t.autoCollapse,"current-route":b.value,"base-class":"cms-admincenter-navnew-node",onToggle:se,onNavigate:ne},null,8,["item","auto-collapse","current-route"]))),128))])]),_:1},8,["options"])],2)}}},qn=q(Yn,[["__scopeId","data-v-c01ff222"]]),Fn={class:"cms-popup-menu",ref:"popupContainer"},Gn={key:0,class:"popup-menu"};function Xn(t,e,s,r,o,i){return a(),c("div",Fn,[n("div",{onClick:e[0]||(e[0]=(...l)=>r.toggleMenu&&r.toggleMenu(...l))},[ge(t.$slots,"button",{},()=>[e[1]||(e[1]=n("button",{class:"menu-button menu-button"},"Menu",-1))],!0)]),r.isMenuOpen?(a(),c("div",Gn,[ge(t.$slots,"menu",{selectOption:r.selectOption},void 0,!0)])):f("",!0)],512)}const Zn={name:"PopupMenu",setup(){const t=Z(!1),e=Z(null),s=()=>{t.value=!t.value},r=()=>{t.value=!1},o=l=>{e.value&&!e.value.contains(l.target)&&r()};return pe(()=>{document.addEventListener("click",o)}),ye(()=>{document.removeEventListener("click",o)}),{isMenuOpen:t,toggleMenu:s,popupContainer:e,selectOption:l=>{console.log(`Selected: ${l}`),r()}}}},Jn=q(Zn,[["render",Xn],["__scopeId","data-v-cf7923a2"]]);function Qn(t,e,s,r,o,i){return a(),c("div",{onClick:e[0]||(e[0]=(...l)=>i.doLogout&&i.doLogout(...l))},[ge(t.$slots,"button",{},()=>[e[1]||(e[1]=n("div",{class:"label"},null,-1)),e[2]||(e[2]=n("i",{class:"material-icons"},"exit_to_app",-1))])])}const Kn={props:{btnClass:{type:String,default:"cms-btn-icon"}},computed:{myClasses(){for(var t={},e=this.btnClass.split(" "),s=0;s<e.length;s++)t[e[s]]=!0;return t}},methods:{doLogout(){this.$store.dispatch("auth/logout").then(()=>{window.location=this.$store.state.config.components.auth.logout_redirect_url||"/"})}}},ei=q(Kn,[["render",Qn]]),ti={class:"cms-admincenter-greeting"},si={key:1,class:"cms-auth-user-popup-menu"},ni={class:"cms-popupmenu-btn"},ii={key:0,class:"cms-popupmenu-btn"},oi={key:2,class:"cms-auth-user-popup-menu"},ri={class:"cms-popupmenu-btn"},li={class:"cms-popupmenu-btn"};function ai(t,e,s,r,o,i){const l=Te,u=K("router-link"),v=ei,h=Jn,C=Re("tippy");return a(),c("div",ti,[n("div",null,_(i.GREETING),1),i.unresolvedMentionsCount>0&&i.collaborationEnabled?te((a(),H(l,{key:0,variant:"danger",icon:"mail",label:String(i.unresolvedMentionsCount),mini:!0,onClick:i.goToMentions},null,8,["label","onClick"])),[[C,{text:i.unresolvedMentionsCount+" offene Erwähnungen"}]]):f("",!0),i.IS_ADMINCENTER?(a(),c("div",si,[A(h,null,{button:P(()=>[A(l,{mini:!0,icon:"menu"})]),menu:P(({selectOption:O})=>[n("div",ni,[A(u,{to:`${t.ADMINCENTER_URL}/account`},{default:P(()=>e[0]||(e[0]=[n("i",{class:"material-icons"},"account_circle",-1),n("div",{class:"label"},"Mein Konto",-1)])),_:1,__:[0]},8,["to"])]),i.isPagesEnabled?(a(),c("div",ii,[A(u,{to:"/"},{default:P(()=>e[1]||(e[1]=[n("i",{class:"material-icons"},"web",-1),n("div",{class:"label"},"zur Website",-1)])),_:1,__:[1]})])):f("",!0),A(v,null,{button:P(()=>e[2]||(e[2]=[n("div",{class:"cms-popupmenu-btn"},[n("a",{href:"#",link:"norel"},[n("i",{class:"material-icons"},"logout"),n("div",{class:"label"},"ausloggen")])],-1)])),_:1})]),_:1})])):(a(),c("div",oi,[A(h,null,{button:P(()=>[A(l,{mini:!0,icon:"menu"})]),menu:P(({selectOption:O})=>[n("div",ri,[A(u,{to:`${t.ADMINCENTER_URL}/account`},{default:P(()=>e[3]||(e[3]=[n("i",{class:"material-icons"},"account_circle",-1),n("div",{class:"label"},"Mein Konto",-1)])),_:1,__:[3]},8,["to"])]),n("div",li,[A(u,{to:`${t.ADMINCENTER_URL}/dashboard`},{default:P(()=>e[4]||(e[4]=[n("i",{class:"material-icons"},"dashboard",-1),n("div",{class:"label"},"zum Dashboard",-1)])),_:1,__:[4]},8,["to"])]),A(v,null,{button:P(()=>e[5]||(e[5]=[n("div",{class:"cms-popupmenu-btn"},[n("a",{href:"#",link:"norel"},[n("i",{class:"material-icons"},"logout"),n("div",{class:"label"},"ausloggen")])],-1)])),_:1})]),_:1})]))])}const ci={computed:{GREETING(){var t=this.$store.getters["auth/userName"];
2return t?"Willkommen "+t+" !":`Willkommen ${this.userHandle} !`},userHandle(){return this.$store.getters["auth/userHandle"]},userName(){return this.$store.getters["auth/userName"]},IS_ADMINCENTER(){return this.$route.path.includes(this.ADMINCENTER_URL)},CURR_USER(){return this.$store.getters["auth/user"]},isPagesEnabled(){var t,e,s;return((s=(e=(t=this.$store.state.config)==null?void 0:t.enabled_components)==null?void 0:e.pages)==null?void 0:s.enabled)==="enabled"},unresolvedMentionsCount(){var t;return((t=this.$store.state.admincenter)==null?void 0:t.unresolvedMentionsCount)||0},collaborationEnabled(){var t,e,s;return((s=(e=(t=this.$store.state.config)==null?void 0:t.system)==null?void 0:e.websockets)==null?void 0:s.collaboration)===!0}},methods:{goToMentions(){const t=this.ADMINCENTER_URL+"/accounting/dashboard",e=()=>{this.$nextTick(()=>{const s=document.querySelector(".cms-admincenter-accounting-dashboard .mentions-list, .cms-admincenter-accounting-dashboard .mentions-empty");s&&s.scrollIntoView({behavior:"smooth",block:"start"})})};this.$route.path===t?e():this.$router.push(t).then(e)}}},di=q(ci,[["render",ai]]),ui={class:"cms-nav-bar"},mi={class:"cms-nav-btns"},hi={key:0,class:"upload-dot"},gi={class:"cms-nav-title cms-admincenter-greeting"},pi={class:"cms-admincenter-main"},fi={class:"cms-admincenter-mid"};function vi(t,e,s,r,o,i){const l=di,u=qn,v=K("router-view"),h=Hn,C=In,O=Oe,p=Ds,$=Ke,j=Re("tippy");return t.$store.getters["auth/isAuthenticated"]?(a(),c("div",{key:0,class:x(["cms-admincenter-admincenter",{collapsed:o.nav_collapsed,isStaging:t.$store.state.config.system.is_staging,"mobile-nav-open":o.mobile_nav_open}])},[n("div",{class:x(["cms-navbar-admincenter",{scrolled:o.nav_scrolled,hidden:o.nav_hidden}]),ref:"navbar"},[n("div",ui,[n("div",{class:"cms-btn-icon mobile-burger",onClick:e[0]||(e[0]=T=>o.mobile_nav_open=!o.mobile_nav_open)},e[6]||(e[6]=[n("i",{class:"material-icons"},"menu",-1)])),n("div",mi,[t.auth_isSystem?(a(),c("div",{key:0,class:"cms-btn-icon icon-left",onClick:e[1]||(e[1]=(...T)=>i.toggleDebug&&i.toggleDebug(...T))},e[7]||(e[7]=[n("i",{class:"material-icons"},"bug_report",-1)]))):f("",!0),te((a(),c("div",{class:"cms-btn-icon",onClick:e[2]||(e[2]=(...T)=>i.createBugReport&&i.createBugReport(...T))},e[8]||(e[8]=[n("i",{class:"material-icons"},"bug_report",-1)]))),[[j,{text:"report Bug"}]]),te((a(),c("div",{class:x(["cms-btn-icon cms-nav-upload-btn",{"is-uploading":i.IS_UPLOAD_ACTIVE}]),onClick:e[3]||(e[3]=(...T)=>i.openGalleryBrowser&&i.openGalleryBrowser(...T))},[e[9]||(e[9]=n("i",{class:"material-icons"},"photo_library",-1)),i.IS_UPLOAD_ACTIVE?(a(),c("div",hi)):f("",!0)],2)),[[j,{text:"Dateibrowser"}]]),i.aiEnabled?te((a(),c("div",{key:1,class:x(["cms-btn-icon",{"is-active":i.agentPaneOpen}]),onClick:e[4]||(e[4]=(...T)=>i.toggleAgentPane&&i.toggleAgentPane(...T))},e[10]||(e[10]=[n("i",{class:"material-icons"},"smart_toy",-1)]),2)),[[j,{text:"AI Assistent"}]]):f("",!0),ge(t.$slots,"nav-btns")]),e[11]||(e[11]=n("div",{class:"cms-spacer"},null,-1)),n("div",gi,[A(l)])])],2),n("div",pi,[A(u,{autoCollapse:!1}),n("div",fi,[A(v,{name:"test"})])]),o.mobile_nav_open?(a(),c("div",{key:0,class:"mobile-backdrop",onClick:e[5]||(e[5]=T=>o.mobile_nav_open=!1)})):f("",!0),A(h),A(C,{ref:"bugPreview"},null,512),A(O),i.aiEnabled?(a(),H(p,{key:1})):f("",!0),i.collaborationEnabled?(a(),H($,{key:2,room:i.currentRoom,"doc-id":i.activeDocContext&&i.activeDocContext.docId,"doc-type":i.activeDocContext&&i.activeDocContext.docType},null,8,["room","doc-id","doc-type"])):f("",!0)],2)):f("",!0)}const bi={components:{CmsTutorialTutorialPlayer:_e(()=>Ce(()=>Promise.resolve().then(()=>Vs),void 0)),CmsAdmincenterAccountingComponentsDocNotePanel:_e(()=>Ce(()=>import("./doc-note-panel.0d13f92.js"),__vite__mapDeps([0,1,2,3,4])))},props:{model:{type:Object,default:()=>({})},routes:{type:Array,default:()=>[]}},data(){return{nav_collapsed:!1,nav_scrolled:!1,nav_hidden:!1,mobile_nav_open:!1,lastScrollY:0}},serverPrefetch(){},computed:{LOCAL_SESSION_ID(){return this.$store.state.auth.localSessionId},isStaging(){return this.$store.state.config.system.is_staging},CURR_USER(){return this.$store.getters["auth/user"]},GREETING(){var t=this.$store.getters["auth/userName"];
2return t?"Willkommen "+t+" !":`Willkommen ${this.userHandle} !`},userHandle(){return this.$store.getters["auth/userHandle"]},userName(){return this.$store.getters["auth/userName"]},IS_UPLOAD_ACTIVE(){return this.$store.state.admincenter.gallerybrowser.uploadItems.some(t=>t.status==="uploading"||t.status==="processing")},collaborationEnabled(){var t,e,s;return((s=(e=(t=this.$store.state.config)==null?void 0:t.system)==null?void 0:e.websockets)==null?void 0:s.collaboration)===!0},currentRoom(){var s,r,o;const t=((o=(r=(s=this.$store.state.config)==null?void 0:s.components)==null?void 0:r.admincenter)==null?void 0:o.url)||"/admincenter",e=this.$route.path;return e.startsWith(t)?e.slice(t.length).replace(/^\//,"")||"home":null},activeDocContext(){const t=this.$route.params.id;if(!t)return null;const e=this.$route.path.split("/"),s=e.indexOf("edit");if(s<1)return null;const r=e[s-1];return{docId:t,docType:r}},aiEnabled(){return!!(this.$store.hasModule&&this.$store.hasModule("ai"))},agentPaneOpen(){var t,e;return((e=(t=this.$store.state.ai)==null?void 0:t.agent)==null?void 0:e.paneOpen)===!0}},watch:{$route(){this.mobile_nav_open=!1}},beforeUnmount(){window.removeEventListener("scroll",this.handleScroll)},mounted(){window.addEventListener("scroll",this.handleScroll),this.loadAdminFont()},methods:{async createBugReport(){console.log("Capturing screenshot first...");try{await rt({strategy:"auto",fullPage:!0,autoDownload:!1,onReport:async({blob:e,meta:s,objectUrl:r})=>{await this.$store.dispatch("bugtracker/captureScreenshot",async()=>({blob:e,meta:s,objectUrl:r}))}})(),this.$refs.bugPreview.open()}catch(t){console.error("Failed to capture screenshot:",t),this.$notify({content:"Failed to capture screenshot",type:"error"})}},handleScroll(){const t=window.scrollY;this.nav_scrolled=t>50,t>this.lastScrollY&&t>56?this.nav_hidden=!0:this.nav_hidden=!1,this.lastScrollY=t},loadAdminFont(){if(document.getElementById("admin-full-font"))return;const t=document.createElement("style");t.id="admin-full-font",t.textContent=` 3 @font-face { 4 font-family: "Material Symbols Outlined Static"; 5 src: url("/fonts/material-symbols-outlined-full.woff2") format("woff2"); 6 font-style: normal; 7 font-weight: 100 700; 8 font-display: swap; 9 } 10 @font-face { 11 font-family: "Material Symbols Filled Static"; 12 src: url("/fonts/material-symbols-filled-full.woff2") format("woff2"); 13 font-style: normal; 14 font-weight: 100 700; 15 font-display: swap; 16 } 17 `,document.head.appendChild(t)},toggleDebug(){this.$store.state.admincenter.page.debug=!this.$store.state.admincenter.page.debug},openGalleryBrowser(){this.$store.state.admincenter.gallerybrowser.open=!0,this.$store.state.admincenter.gallerybrowser.mode="gallery",this.$store.state.admincenter.gallerybrowser.title="Dateibrowser"},async toggleAgentPane(){var t,e;if(!this.$store.hasModule||!this.$store.hasModule("ai")||!((e=(t=this.$store).isModuleReady)!=null&&e.call(t,"ai")))try{await this.$store.dispatch("loadModule","ai")}catch(s){console.error("Failed to load ai module",s)}this.$store.dispatch("ai/AGENT_TOGGLE_PANE")},toggleNav(){this.nav_collapsed=!this.nav_collapsed},showAdminCenter(){this.$router.push("/designer")}}},Ai=q(bi,[["render",vi]]);export{Ai 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.