import{s as _,T as b,m as f,c as x,a as l,u as o,b as t,w as v,t as y,d as g,v as w,F as h,g as U,o as k,Z as V,q as $}from"./app-13978987.js";import{_ as C}from"./UserLayout-6a50516d.js";import{_ as L}from"./InputFieldError-52549d23.js";import{_ as S}from"./SpinnerBtn-cb152833.js";import{_ as T}from"./RichEditor-132d6d13.js";import"./dropdown-45d66330.js";import"./FloatingDropdown-0be3e47c.js";const B={class:"container flex-grow p-4 sm:p-6"},R={class:"text-xl"},j={class:"flex"},D=t("i",{class:"bx bx-file text-2xl"},null,-1),E=[D],F=t("i",{class:"bx bx-download text-2xl"},null,-1),G=[F],M={class:"ai-ck-section"},N=U({layout:C}),J=Object.assign(N,{__name:"Edit",props:["aiGenerated"],setup(d){const{copyToClipboard:u}=_(),r=d,s=b({...r.aiGenerated}),i=f(""),m=()=>{s.patch(route("user.ai-generated-history.update",r.aiGenerated.uuid),{onSuccess:()=>{s.reset(),$.success("Submitted Successfully")}})};function p(a,e){const n=new Blob([a],{type:"text/html"}),c=document.createElement("a");c.href=URL.createObjectURL(n),c.download=e?e.replace(" ","-"):"untitled.html",c.click(),URL.revokeObjectURL(url)}return(a,e)=>(k(),x(h,null,[l(o(V),{title:a.trans("History")},null,8,["title"]),t("main",B,[t("form",{onSubmit:v(m,["prevent"]),class:"card card-body mx-auto mt-5 w-11/12 space-y-4 lg:w-8/12"},[t("p",R,y(a.trans("Template")),1),t("div",j,[t("button",{class:"me-1",type:"button",onClick:e[0]||(e[0]=n=>o(u)(o(s).content))},E),t("button",{class:"ms-1",type:"button",onClick:e[1]||(e[1]=n=>p(o(s).content,i.value))},G)]),t("div",null,[g(t("input",{"onUpdate:modelValue":e[2]||(e[2]=n=>i.value=n),type:"text",class:"input w-full",placeholder:"Untitled Document..."},null,512),[[w,i.value]])]),t("div",M,[l(T,{modelValue:o(s).content,"onUpdate:modelValue":e[3]||(e[3]=n=>o(s).content=n)},null,8,["modelValue"]),l(L,{class:"mb-5",message:o(s).errors.content},null,8,["message"])]),t("div",null,[l(S,{processing:o(s).processing,classes:"btn btn-primary","btn-text":"Update"},null,8,["processing"])])],32)])],64))}});export{J as default};
