File size: 9,408 Bytes
2130805
a452d3d
 
1
2
3
import{aV as e,aY as t,a_ as n,ae as r,ao as i,bb as a,bc as o,be as s,bf as c,bs as l,e$ as u,eA as d,eB as ee,eC as f,eD as p,eF as m,eG as h,eH as g,eM as _,eR as v,eT as te,eX as ne,ew as re,ez as y,f1 as b,f2 as x,f4 as S,f7 as C,f8 as w,fb as T,fc as E,fi as D}from"./index-BftXnxo2.js";import{b as ie}from"./airi-card-Bx3JaQWz.js";var O=E(((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n})),k=E(((exports,t)=>{var n=O();t.exports=n})),A=E(((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n})),j=E(((exports,t)=>{var n=A();t.exports=n})),M=E(((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n})),N=E(((exports,t)=>{var n=String.prototype.trim;t.exports=n})),P=E(((exports,t)=>{var n=N(),r=` 
	\r
\f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a})),F=E(((exports,t)=>{var n=j(),r=/^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;function i(e){return n(e,r,`$1`)}t.exports=i})),I=E(((exports,t)=>{var n=N();function r(e){return n.call(e)}t.exports=r})),L=E(((exports,t)=>{var n=M(),r=P(),i=F(),a=I(),o;o=n&&r()?a:i,t.exports=o})),R=E(((exports,t)=>{var n=k(),r=j(),i=L(),a=/\s+/g,o=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,s=/([a-z0-9])([A-Z])/g;function c(e){return e=r(e,o,` `),e=r(e,s,`$1 $2`),e=i(e),e=r(e,a,`-`),n(e)}t.exports=c})),z=E(((exports,t)=>{var n=R();t.exports=n})),B=D(z());const V={class:`w-full flex flex-col gap-5`},H={class:`mt-4`},U={class:`border-b border-neutral-200 dark:border-neutral-700`},W={class:`flex justify-center -mb-px sm:justify-start space-x-1`},G=[`onClick`],K={class:`flex items-center gap-1`},ae={key:0,class:`w-full rounded-xl bg-red900`},oe={class:`w-full p-4`},se={key:1,class:`tab-content ml-auto mr-auto w-95%`},ce={class:`mb-3`},le={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},ue={key:2,class:`tab-content ml-auto mr-auto w-95%`},de={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},fe={key:3,class:`tab-content ml-auto mr-auto w-95%`},pe={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},me={class:`ml-auto mr-1 flex flex-row gap-2`};var q=g({__name:`CardCreationDialog`,props:_({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:_([`update:modelValue`],[`update:modelValue`]),setup(t,{emit:g}){let _=g,E=ne(t,`modelValue`),{t:D}=r(),O=ie(),k=x(``),A=[{id:`identity`,label:D(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:D(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:D(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],j=y({get:()=>A.find(e=>e.id===k.value)?k.value:A[0]?.id||``,set:e=>{k.value=e}}),M=x(!1),N=x(``);function P(e){let t=S(e);if(t.name.length>0)if(/^(?:\d+\.)+\d+$/.test(t.version))if(t.description.length>0)if(t.personality.length>0)if(t.scenario.length>0)if(t.systemPrompt.length>0){if(!(t.postHistoryInstructions.length>0))return M.value=!0,N.value=D(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return M.value=!0,N.value=D(`settings.pages.card.creation.errors.systemprompt`),!1;else return M.value=!0,N.value=D(`settings.pages.card.creation.errors.scenario`),!1;else return M.value=!0,N.value=D(`settings.pages.card.creation.errors.personality`),!1;else return M.value=!0,N.value=D(`settings.pages.card.creation.errors.description`),!1;else return M.value=!0,N.value=D(`settings.pages.card.creation.errors.version`),!1;else return M.value=!0,N.value=D(`settings.pages.card.creation.errors.name`),!1;return M.value=!1,O.addCard(t),E.value=!1,!0}let F=x({name:D(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:D(`settings.pages.card.creation.defaults.personality`),scenario:D(`settings.pages.card.creation.defaults.scenario`),systemPrompt:D(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:D(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function I(e,t){return y({get:()=>F.value[e]??``,set:n=>{let r=n.trim();F.value[e]=r.length>0?t?t(r):r:``}})}let L=I(`name`,e=>(0,B.default)(e)),R=I(`nickname`),z=I(`description`),q=I(`notes`),J=I(`personality`),Y=I(`scenario`),X=y({get:()=>F.value.greetings??[],set:e=>{F.value.greetings=e||[]}}),Z=I(`version`),Q=I(`systemPrompt`),$=I(`postHistoryInstructions`);return(t,r)=>(v(),ee(C(l),{open:E.value,"onUpdate:open":r[12]||=e=>_(`update:modelValue`,e)},{default:u(()=>[h(C(o),null,{default:u(()=>[h(C(s),{class:`fixed inset-0 z-100 bg-black/50 backdrop-blur-sm data-[state=closed]:animate-fadeOut data-[state=open]:animate-fadeIn`}),h(C(c),{class:`fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 data-[state=closed]:animate-contentHide data-[state=open]:animate-contentShow dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:u(()=>[d(`div`,V,[h(C(a),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:u(()=>[m(T(C(D)(`settings.pages.card.create_card`)),1)]),_:1}),d(`div`,H,[d(`div`,U,[d(`div`,W,[(v(),p(re,null,te(A,e=>d(`button`,{key:e.id,class:w([`px-4 py-2 text-sm font-medium`,[j.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>j.value=e.id},[d(`div`,K,[d(`div`,{class:w(e.icon)},null,2),m(` `+T(e.label),1)])],10,G)),64))])])]),M.value?(v(),p(`div`,ae,[d(`p`,oe,T(N.value),1)])):f(``,!0),j.value===`identity`?(v(),p(`div`,se,[d(`p`,ce,T(C(D)(`settings.pages.card.creation.fields_info.subtitle`)),1),d(`div`,le,[h(C(n),{modelValue:C(L),"onUpdate:modelValue":r[0]||=e=>b(L)?L.value=e:null,label:C(D)(`settings.pages.card.creation.name`),description:C(D)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),h(C(n),{modelValue:C(R),"onUpdate:modelValue":r[1]||=e=>b(R)?R.value=e:null,label:C(D)(`settings.pages.card.creation.nickname`),description:C(D)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),h(C(n),{modelValue:C(z),"onUpdate:modelValue":r[2]||=e=>b(z)?z.value=e:null,label:C(D)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:C(D)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),h(C(n),{modelValue:C(q),"onUpdate:modelValue":r[3]||=e=>b(q)?q.value=e:null,label:C(D)(`settings.pages.card.creator_notes`),"single-line":!1,description:C(D)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):j.value===`behavior`?(v(),p(`div`,ue,[d(`div`,de,[h(C(n),{modelValue:C(J),"onUpdate:modelValue":r[4]||=e=>b(J)?J.value=e:null,label:C(D)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:C(D)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),h(C(n),{modelValue:C(Y),"onUpdate:modelValue":r[5]||=e=>b(Y)?Y.value=e:null,label:C(D)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:C(D)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),h(C(e),{modelValue:X.value,"onUpdate:modelValue":r[6]||=e=>X.value=e,label:C(D)(`settings.pages.card.creation.greetings`),description:C(D)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):j.value===`settings`?(v(),p(`div`,fe,[d(`div`,pe,[h(C(n),{modelValue:C(Q),"onUpdate:modelValue":r[7]||=e=>b(Q)?Q.value=e:null,label:C(D)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:C(D)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),h(C(n),{modelValue:C($),"onUpdate:modelValue":r[8]||=e=>b($)?$.value=e:null,label:C(D)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:C(D)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),h(C(n),{modelValue:C(Z),"onUpdate:modelValue":r[9]||=e=>b(Z)?Z.value=e:null,label:C(D)(`settings.pages.card.creation.version`),required:!0,description:C(D)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):f(``,!0),d(`div`,me,[h(C(i),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:C(D)(`settings.pages.card.cancel`),disabled:!1,onClick:r[10]||=e=>E.value=!1},null,8,[`label`]),h(C(i),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:C(D)(`settings.pages.card.creation.create`),disabled:!1,onClick:r[11]||=e=>P(F.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=t(q,[[`__scopeId`,`data-v-664b482e`]]);export{J as b};