1import{P as e,O as l,Q as t,K as s,d as a,U as o,$ as d,L as i,M as r,a6 as n,R as c,a0 as u,a1 as m,V as p,a2 as v,Y as g,F as y,X as f,u as _,a4 as x,J as h}from"./index-BsLsMjlV.js";import{a as b,_ as w}from"./AdminLayout-9ounIWk_.js";import{_ as k}from"./InputError-DoOnjxCQ.js";import{_ as V}from"./InputLabel-CJ0LkEhL.js";import{_ as U}from"./TextInput-C8_cgRMw.js";import{_ as C}from"./TextArea-DrfKbHkP.js";import{_ as M}from"./Checkbox-BfJOXU8h.js";import{r as z}from"./ArrowLeftIcon-CtE36XA2.js";import{r as O}from"./CheckIcon-D51lOYRe.js";import"./Banner-B3VNYRSc.js";import"./ResponsiveNavLink-BKe24OV6.js";const S={class:"flex items-center justify-between gap-4"},A={class:"flex items-center gap-2 flex-wrap text-sm text-gray-500"},L={class:"font-semibold text-xl text-gray-800 leading-tight mt-1"},$={class:"max-w-4xl mx-auto"},B={class:"bg-white rounded-lg border border-gray-200 shadow-sm p-6"},I={class:"border-b border-gray-200 pb-6"},j={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},E={class:"mt-4"},T={class:"border-b border-gray-200 pb-6"},q={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},P={class:"flex space-x-2"},F={class:"flex space-x-2"},H={class:"flex space-x-2"},R={class:"mt-4"},D={class:"flex items-center space-x-3"},G={class:"mt-6 p-4 bg-gray-50 rounded-lg"},N={class:"flex items-center space-x-3 mb-4"},K={key:0},W={class:"flex space-x-2"},Y={key:0,class:"mt-3"},J={controls:"",class:"mt-2"},Q=["src"],X=["src"],Z=["src"],ee={key:0,class:"mt-4"},le={class:"mt-2 inline-block"},te=["src","alt"],se={key:1,class:"mt-4"},ae={class:"mt-2 inline-block"},oe=["src"],de={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},ie={class:"mt-4 space-y-3"},re={class:"flex items-center"},ne={class:"flex items-center"},ce={class:"mt-6 bg-gray-50 p-4 rounded-lg border border-gray-200"},ue={class:"flex items-start mb-4"},me={class:"ml-3"},pe={key:0,class:"ml-6 pl-4 border-l-2 border-blue-200 space-y-4"},ve={class:"text-xs text-gray-500 mt-1"},ge={key:0},ye={key:1},fe={class:"bg-blue-50 p-3 rounded border border-blue-200"},_e={class:"text-sm text-blue-800"},xe={key:0},he={key:1},be={class:"mt-6 bg-white p-4 rounded-lg border border-gray-200"},we={class:"flex items-start mb-4"},ke={class:"ml-3"},Ve={key:0,class:"ml-6 pl-4 border-l-2 border-gray-100 space-y-4"},Ue={key:0,class:"text-sm text-gray-500 italic text-center py-4"},Ce={class:"flex items-center justify-between mb-3"},Me={class:"text-sm font-medium text-gray-900"},ze=["onClick"],Oe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Se={class:"mt-4"},Ae={class:"mt-4 grid grid-cols-1 md:grid-cols-3 gap-4"},Le={class:"flex items-center"},$e={key:1,class:"bg-gray-50 p-3 rounded border border-gray-100"},Be={class:"space-y-2"},Ie={key:0},je={key:1,class:"text-red-500 ml-1"},Ee={key:2,class:"text-gray-600 ml-2 text-xs"},Te={class:"bg-white p-4 rounded-lg border border-gray-200"},qe={class:"space-y-4"},Pe={key:0,class:"flex items-center space-x-3 mb-4 p-3 bg-purple-50 rounded-lg border border-purple-200"},Fe={key:1,class:"text-sm text-gray-500 italic text-center py-4"},He={class:"flex items-center justify-between mb-3"},Re={class:"text-sm font-medium text-gray-900"},De=["onClick"],Ge={class:"grid grid-cols-1 gap-4"},Ne={class:"flex items-center"},Ke={class:"mt-1 px-3 py-2 bg-gray-100 rounded text-xs text-gray-600 font-mono"},We={key:2,class:"bg-purple-50 p-3 rounded border border-purple-200"},Ye={class:"space-y-2"},Je={key:0,class:"text-red-500 ml-1"},Qe={key:1,class:"text-purple-600 ml-2 text-xs"},Xe={class:"mt-3 pt-3 border-t border-purple-200"},Ze={class:"text-xs text-purple-700"},el={class:"bg-gray-50 rounded-lg p-6 border border-gray-200"},ll={class:"space-y-6"},tl={class:"flex items-start mb-4"},sl={class:"ml-3"},al={key:0,class:"ml-6 pl-4 border-l-2 border-green-200 space-y-4"},ol={class:"text-xs text-gray-500 mt-1"},dl={class:"bg-white border border-gray-200 rounded-lg p-4"},il={class:"space-y-1"},rl={class:"text-blue-600 text-sm font-medium"},nl={class:"text-green-600 text-xs"},cl={class:"text-gray-600 text-sm"},ul={class:"bg-gray-50 border border-gray-200 rounded-lg p-6"},ml={class:"flex items-center space-x-3 mb-4"},pl={class:"flex items-center"},vl={key:0,class:"bg-yellow-50 border border-yellow-200 rounded-lg p-4"},gl={class:"flex items-center justify-end gap-3 pt-6 border-t border-gray-200"},yl=["disabled"],fl={key:0,class:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24"},_l={__name:"Edit",props:{group:Object,item:Object},setup(_l){var xl,hl,bl,wl,kl,Vl;
1const Ul=_l,Cl=e(!1),Ml=e(null),zl=l({title:Ul.item.title,description:Ul.item.description,value:Ul.item.value,display_data:{image:(null==(xl=Ul.item.display_data)?void 0:xl.image)||"",thumbnail:(null==(hl=Ul.item.display_data)?void 0:hl.thumbnail)||"",video:(null==(bl=Ul.item.display_data)?void 0:bl.video)||"",color:(null==(wl=Ul.item.display_data)?void 0:wl.color)||"",sound:(null==(kl=Ul.item.display_data)?void 0:kl.sound)||"",play_sound:(null==(Vl=Ul.item.display_data)?void 0:Vl.play_sound)||!1},order_index:Ul.item.order_index,is_active:Ul.item.is_active,is_default:Ul.item.is_default,has_credit_cost:Ul.item.has_credit_cost||!1,credit_cost_type:Ul.item.credit_cost_type||"additional",credit_cost_amount:Ul.item.credit_cost_amount||0,has_dynamic_fields:Ul.item.has_dynamic_fields||!1,dynamic_fields:Ul.item.dynamic_fields||[],override_file_inputs:Ul.item.override_file_inputs||[],override_columns:Ul.item.override_columns||1,has_seo:Ul.item.has_seo||!1,seo_slug:Ul.item.seo_slug||"",seo_title:Ul.item.seo_title||"",seo_description:Ul.item.seo_description||"",seo_keywords:Ul.item.seo_keywords||"",admin_only:Ul.item.admin_only||!1}),Ol=()=>{zl.put(route("admin.form-selection-items.update",[Ul.group,Ul.item]),{preserveScroll:!0})},Sl=()=>{zl.title&&!zl.value&&(zl.value=zl.title.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"_").trim())},Al=e=>{Ml.value=e,Cl.value=!0},Ll=()=>{Cl.value=!1,Ml.value=null},$l=e=>{if(Ml.value){const l=Ml.value.split(".");let t=zl;for(let e=0;e<l.length-1;e++)t[l[e]]||(t[l[e]]={}),t=t[l[e]];t[l[l.length-1]]=e.url||e.file_path}Ll()},Bl=()=>{zl.dynamic_fields.push({type:"textarea",name:"",label:"",placeholder:"",description:"",required:!1,default_value:"",validation:{min_length:0,max_length:500}})},Il=()=>{zl.override_file_inputs.push({key:crypto.randomUUID(),label:"",required:!0,description:""})};return(e,l)=>(s(),t(y,null,[a(o(d),{title:"Edit Selection Item"}),a(w,null,{header:i(()=>[r("div",S,[r("div",null,[r("div",A,[a(o(x),{href:e.route("admin.form-selection-groups.index"),class:"hover:text-gray-700"},{default:i(()=>l[32]||(l[32]=[p("Groups")])),_:1},8,["href"]),l[33]||(l[33]=r("span",null,"/",-1)),a(o(x),{href:e.route("admin.form-selection-items.index",_l.group),class:"hover:text-gray-700"},{default:i(()=>[p(g(_l.group.name),1)]),_:1},8,["href"])]),r("h2",L,"Edit: "+g(_l.item.title),1)]),a(o(x),{href:e.route("admin.form-selection-items.index",_l.group),class:"admin-btn admin-btn-back"},{default:i(()=>[a(o(z)),l[34]||(l[34]=p(" Back "))]),_:1},8,["href"])])]),default:i(()=>[r("div",$,[r("div",B,[r("form",{onSubmit:n(Ol,["prevent"]),class:"space-y-6"},[r("div",I,[l[36]||(l[36]=r("h3",{class:"text-lg font-medium text-gray-900 mb-4"},"Basic Information",-1)),r("div",j,[r("div",null,[a(V,{for:"title",value:"Title"}),a(U,{id:"title",modelValue:o(zl).title,"onUpdate:modelValue":l[0]||(l[0]=e=>o(zl).title=e),type:"text",class:"mt-1 block w-full",placeholder:"e.g., Cartoon Style, Rock Music",required:"",autofocus:"",onBlur:Sl},null,8,["modelValue"]),a(k,{class:"mt-2",message:o(zl).errors.title},null,8,["message"])]),r("div",null,[a(V,{for:"value",value:"Value (Form Submission)"}),a(U,{id:"value",modelValue:o(zl).value,"onUpdate:modelValue":l[1]||(l[1]=e=>o(zl).value=e),type:"text",class:"mt-1 block w-full",placeholder:"cartoon_style, rock_music",required:""},null,8,["modelValue"]),l[35]||(l[35]=r("p",{class:"mt-1 text-xs text-gray-500"},"Used when form is submitted. Auto-generated from title if empty.",-1)),a(k,{class:"mt-2",message:o(zl).errors.value},null,8,["message"])])]),r("div",E,[a(V,{for:"description",value:"Description (Optional)"}),a(C,{id:"description",modelValue:o(zl).description,"onUpdate:modelValue":l[2]||(l[2]=e=>o(zl).description=e),class:"mt-1 block w-full",rows:"2",placeholder:"Optional description for this item..."},null,8,["modelValue"]),a(k,{class:"mt-2",message:o(zl).errors.description},null,8,["message"])])]),r("div",T,[l[44]||(l[44]=r("h3",{class:"text-lg font-medium text-gray-900 mb-4"},"Visual Properties",-1)),r("div",q,[r("div",null,[a(V,{for:"image",value:"Image URL"}),r("div",P,[a(U,{id:"image",modelValue:o(zl).display_data.image,"onUpdate:modelValue":l[3]||(l[3]=e=>o(zl).display_data.image=e),type:"url",class:"mt-1 block w-full",placeholder:"https://example.com/image.jpg"},null,8,["modelValue"]),r("button",{type:"button",onClick:l[4]||(l[4]=e=>Al("display_data.image")),class:"mt-1 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 transition-colors whitespace-nowrap"}
1," Browse ")]),l[37]||(l[37]=r("p",{class:"mt-1 text-xs text-gray-500"},"Main image for this selection option",-1)),a(k,{class:"mt-2",message:o(zl).errors["display_data.image"]},null,8,["message"])]),r("div",null,[a(V,{for:"thumbnail",value:"Thumbnail URL (Optional)"}),r("div",F,[a(U,{id:"thumbnail",modelValue:o(zl).display_data.thumbnail,"onUpdate:modelValue":l[5]||(l[5]=e=>o(zl).display_data.thumbnail=e),type:"url",class:"mt-1 block w-full",placeholder:"https://example.com/thumb.jpg"},null,8,["modelValue"]),r("button",{type:"button",onClick:l[6]||(l[6]=e=>Al("display_data.thumbnail")),class:"mt-1 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 transition-colors whitespace-nowrap"}," Browse ")]),l[38]||(l[38]=r("p",{class:"mt-1 text-xs text-gray-500"},"Optional smaller version. Uses main image if empty.",-1)),a(k,{class:"mt-2",message:o(zl).errors["display_data.thumbnail"]},null,8,["message"])]),r("div",null,[a(V,{for:"video",value:"Video URL (Optional)"}),r("div",H,[a(U,{id:"video",modelValue:o(zl).display_data.video,"onUpdate:modelValue":l[7]||(l[7]=e=>o(zl).display_data.video=e),type:"url",class:"mt-1 block w-full",placeholder:"https://example.com/video.mp4"},null,8,["modelValue"]),r("button",{type:"button",onClick:l[8]||(l[8]=e=>Al("display_data.video")),class:"mt-1 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 transition-colors whitespace-nowrap"}," Browse ")]),l[39]||(l[39]=r("p",{class:"mt-1 text-xs text-gray-500"},"Video that plays on hover. Supports MP4, WebM.",-1)),a(k,{class:"mt-2",message:o(zl).errors["display_data.video"]},null,8,["message"])])]),r("div",R,[a(V,{for:"color",value:"Color (Optional)"}),r("div",D,[a(U,{id:"color",modelValue:o(zl).display_data.color,"onUpdate:modelValue":l[9]||(l[9]=e=>o(zl).display_data.color=e),type:"text",class:"mt-1 block w-32",placeholder:"#FF5733",pattern:"^#[0-9A-Fa-f]{6}$"},null,8,["modelValue"]),u(r("input",{type:"color","onUpdate:modelValue":l[10]||(l[10]=e=>o(zl).display_data.color=e),class:"mt-1 h-10 w-16 border border-gray-300 rounded cursor-pointer"},null,512),[[m,o(zl).display_data.color]])]),l[40]||(l[40]=r("p",{class:"mt-1 text-xs text-gray-500"},"Optional color associated with this item",-1)),a(k,{class:"mt-2",message:o(zl).errors["display_data.color"]},null,8,["message"])]),r("div",G,[r("div",N,[a(M,{id:"play_sound",checked:o(zl).display_data.play_sound,"onUpdate:checked":l[11]||(l[11]=e=>o(zl).display_data.play_sound=e)},null,8,["checked"]),a(V,{for:"play_sound",value:"Play Sound",class:"cursor-pointer"})]),l[43]||(l[43]=r("p",{class:"text-xs text-gray-500 mb-4"},"Enable sound playback for this selection item",-1)),o(zl).display_data.play_sound?(s(),t("div",K,[a(V,{for:"sound",value:"Sound URL"}),r("div",W,[a(U,{id:"sound",modelValue:o(zl).display_data.sound,"onUpdate:modelValue":l[12]||(l[12]=e=>o(zl).display_data.sound=e),type:"url",class:"mt-1 block w-full",placeholder:"https://example.com/sound.mp3"},null,8,["modelValue"]),r("button",{type:"button",onClick:l[13]||(l[13]=e=>Al("display_data.sound")),class:"mt-1 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 transition-colors whitespace-nowrap"}," Browse ")]),l[42]||(l[42]=r("p",{class:"mt-1 text-xs text-gray-500"},"Audio file that will play when user clicks the play button. Supports MP3, WAV, OGG.",-1)),a(k,{class:"mt-2",message:o(zl).errors["display_data.sound"]},null,8,["message"]),o(zl).display_data.sound?(s(),t("div",Y,[a(V,{value:"Sound Preview"}),r("audio",J,[r("source",{src:o(zl).display_data.sound,type:"audio/mpeg"},null,8,Q),r("source",{src:o(zl).display_data.sound,type:"audio/wav"},null,8,X),r("source",{src:o(zl).display_data.sound,type:"audio/ogg"},null,8,Z),l[41]||(l[41]=p(" Your browser does not support the audio element. "))])])):c("",!0)])):c("",!0)]),o(zl).display_data.image?(s(),t("div",ee,[a(V,{value:"Preview"}),r("div",le,[r("img",{src:o(zl).display_data.image,alt:o(zl).title||"Preview",class:"h-24 w-24 object-cover rounded-lg border border-gray-200",onError:l[14]||(l[14]=e=>e.target.style.display="none")},null,40,te)])])):c("",!0),o(zl).display_data.video?(s(),t("div",se,[a(V,{value:"Video Preview"}),r("div",ae,[r("video",{src:o(zl).display_data.video,class:"h-24 w-24 object-cover rounded-lg border border-gray-200",muted:"",onError:l[15]||(l[15]=e=>e.target.style.display="none"),onMouseenter:l[16]||(l[16]=e=>e.target.play()),onMouseleave:l[17]||(l[17]=e=>{e.target.pause(),e.target.currentTime=0})},null,40,oe)])])):c("",!0)]),r("div",null,[l[67]||(l[67]=r("h3",{class:"text-lg font-medium text-gray-900 mb-4"},"Settings",-1)),r("div",de,[r("div",null,[a(V,{for:"order_index",value:"Order Index"}),a(U,{id:"order_index",modelValue:o(zl).order_index,"onUpdate:modelValue":l[18]||(l[18]=e=>o(zl).order_index=e),modelModifiers:{number:!0},type:"number",min:"0",class:"mt-1 block w-full"},null,8,["modelValue"]),l[45]||(l[45]=r("p",{class:"mt-1 text-xs text-gray-500"},"Lower numbers appear first. 0 is the default.",-1)),a(k,{class:"mt-2",message:o(zl).errors.order_index},null,8,["message"])])]),r("div",ie,[r("div",re,[a(M,{id:"is_active",checked:o(zl).is_active,"onUpdate:checked":l[19]||(l[19]=e=>o(zl).is_active=e)},null,8,["checked"]),a(V,{for:"is_active",value:"Active",class:"ml-2"}),l[46]||(l[46]=r("p",{class:"ml-4 text-sm text-gray-500"},"Inactive items won't be shown in forms.",-1))]),r("div",ne,[a(M,{id:"is_default",checked:o(zl).is_default,"onUpdate:checked":l[20]||(l[20]=e=>o(zl).is_default=e)},null,8,["checked"]),a(V,{for:"is_default",value:"Default Selection",class:"ml-2"}),l[47]||(l[47]=r("p",{class:"ml-4 text-sm text-gray-500"},"This item will be pre-selected in forms.",-1))])]),r("div",ce,[l[58]||(l[58]=r("h4",{class:"text-lg font-medium text-gray-900 mb-4 flex items-center"},[r("svg",{class:"w-5 h-5 mr-2 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{d:"M8.433 7.418c.155-.103.346-.196.567-.267v1.698a2.305 2.305 0 01-.567-.267C8.07 8.34 8 8.114 8 8c0-.114.07-.34.433-.582zM11 12.849v-1.698c.22.071.412.164.567.267.364.243.433.468.433.582 0 .114-.07.34-.433.582a2.305 2.305 0 01-.567.267z"}),r("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.51-1.31c-.562-.649-1.413-1.076-2.353-1.253V5z","clip-rule":"evenodd"})]),p(" Credit Cost Settings ")],-1)),r("div",ue,[a(M,{id:"has_credit_cost",checked:o(zl).has_credit_cost,"onUpdate:checked":l[21]||(l[21]=e=>o(zl).has_credit_cost=e),class:"mt-1"},null,8,["checked"]),r("div",me,[a(V,{for:"has_credit_cost",value:"This item has custom credit cost"}),l[48]||(l[48]=r("p",{class:"text-sm text-gray-500 mt-1"}," Enable this to set a custom credit cost for this selection option ",-1))])]),o(zl).has_credit_cost?(s(),t("div",pe,[r("div",null,[a(V,{for:"credit_cost_type",value:"Cost Type"}),u(r("select",{id:"credit_cost_type","onUpdate:modelValue":l[22]||(l[22]=e=>o(zl).credit_cost_type=e),class:"border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm block w-full mt-1"},l[49]||(l[49]=[r("option",{value:"additional"},"Additional Cost (adds to app base cost)",-1),r("option",{value:"override"},"Override Cost (replaces app base cost)",-1)]),512),[[v,o(zl).credit_cost_type]]),r("p",ve,["additional"===o(zl).credit_cost_type?(s(),t("span",ge,l[50]||(l[50]=[p(" ð¡ This cost will be "),r("strong",null,"added",-1),p(" to the app's base cost ")]))):(s(),t("span",ye,l[51]||(l[51]=[p(" ð This cost will "),r("strong",null,"replace",-1),p(" the app's base cost entirely ")])))])]),r("div",null,[a(V,{for:"credit_cost_amount",value:"Credit Amount"}),a(U,{id:"credit_cost_amount",modelValue:o(zl).credit_cost_amount,"onUpdate:modelValue":l[23]||(l[23]=e=>o(zl).credit_cost_amount=e),modelModifiers:{number:!0},type:"number",min:"0",step:"0.01",class:"mt-1 block w-full"},null,8,["modelValue"]),a(k,{class:"mt-2",message:o(zl).errors.credit_cost_amount},null,8,["message"]),l[52]||(l[52]=r("p",{class:"text-xs text-gray-500 mt-1"}," Enter the credit amount for this selection item ",-1))]),r("div",fe,[l[57]||(l[57]=r("h5",{class:"text-sm font-medium text-blue-900 mb-2 flex items-center"},[r("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})]),p(" Cost Preview: ")],-1)),r("p",_e,["additional"===o(zl).credit_cost_type?(s(),t("span",xe,[l[53]||(l[53]=p(" ð App base cost + ")),r("strong",null,g(o(zl).credit_cost_amount||0),1),l[54]||(l[54]=p(" additional credits "))])):(s(),t("span",he,[l[55]||(l[55]=p(" ð ")),r("strong",null,g(o(zl).credit_cost_amount||0),1),l[56]||
1(l[56]=p(" credits total (overrides app base cost) "))]))])])])):c("",!0)]),r("div",be,[l[66]||(l[66]=r("h4",{class:"text-lg font-medium text-gray-900 mb-4 flex items-center"},[r("svg",{class:"w-5 h-5 mr-2 text-gray-600",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M3 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z","clip-rule":"evenodd"})]),p(" Dynamic Fields Settings ")],-1)),r("div",we,[a(M,{id:"has_dynamic_fields",checked:o(zl).has_dynamic_fields,"onUpdate:checked":l[24]||(l[24]=e=>o(zl).has_dynamic_fields=e),class:"mt-1"},null,8,["checked"]),r("div",ke,[a(V,{for:"has_dynamic_fields",value:"This item has dynamic input fields"}),l[59]||(l[59]=r("p",{class:"text-sm text-gray-500 mt-1"}," Enable this to add custom input fields that appear when this item is selected ",-1))])]),o(zl).has_dynamic_fields?(s(),t("div",Ve,[r("div",{class:"flex items-center justify-between"},[l[61]||(l[61]=r("h5",{class:"text-sm font-medium text-gray-900"},"Dynamic Fields",-1)),r("button",{type:"button",onClick:Bl,class:"px-3 py-1 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 transition-colors flex items-center"},l[60]||(l[60]=[r("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z","clip-rule":"evenodd"})],-1),p(" Add Field ")]))]),0===o(zl).dynamic_fields.length?(s(),t("div",Ue,' No dynamic fields added yet. Click "Add Field" to get started. ')):c("",!0),(s(!0),t(y,null,f(o(zl).dynamic_fields,(e,o)=>(s(),t("div",{key:o,class:"border border-gray-200 rounded-lg p-4 bg-white"},[r("div",Ce,[r("h6",Me,"Field #"+g(o+1),1),r("button",{type:"button",onClick:e=>(e=>{confirm("Are you sure you want to remove this field?")&&zl.dynamic_fields.splice(e,1)})(o),class:"text-red-500 hover:text-red-700 transition-colors"},l[62]||(l[62]=[r("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),8,ze)]),r("div",Oe,[r("div",null,[a(V,{for:`field_label_${o}`,value:"Label"},null,8,["for"]),a(U,{id:`field_label_${o}`,modelValue:e.label,"onUpdate:modelValue":l=>e.label=l,type:"text",class:"mt-1 block w-full",placeholder:"e.g., Box Text, Color Preference",onBlur:e=>(e=>{const l=zl.dynamic_fields[e];l.label&&!l.name&&(l.name=l.label.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"_").trim())})(o)},null,8,["id","modelValue","onUpdate:modelValue","onBlur"])]),r("div",null,[a(V,{for:`field_name_${o}`,value:"Field Name"},null,8,["for"]),a(U,{id:`field_name_${o}`,modelValue:e.name,"onUpdate:modelValue":l=>e.name=l,type:"text",class:"mt-1 block w-full",placeholder:"box_text, color_preference"},null,8,["id","modelValue","onUpdate:modelValue"]),l[63]||(l[63]=r("p",{class:"mt-1 text-xs text-gray-500"},"Used in form submission. Auto-generated from label.",-1))]),r("div",null,[a(V,{for:`field_placeholder_${o}`,value:"Placeholder"},null,8,["for"]),a(U,{id:`field_placeholder_${o}`,modelValue:e.placeholder,"onUpdate:modelValue":l=>e.placeholder=l,type:"text",class:"mt-1 block w-full",placeholder:"Enter placeholder text..."},null,8,["id","modelValue","onUpdate:modelValue"])]),r("div",null,[a(V,{for:`field_default_${o}`,value:"Default Value"},null,8,["for"]),a(U,{id:`field_default_${o}`,modelValue:e.default_value,"onUpdate:modelValue":l=>e.default_value=l,type:"text",class:"mt-1 block w-full",placeholder:"Default text..."},null,8,["id","modelValue","onUpdate:modelValue"])])]),r("div",Se,[a(V,{for:`field_description_${o}`,value:"Description (Optional)"},null,8,["for"]),a(C,{id:`field_description_${o}`,modelValue:e.description,"onUpdate:modelValue":l=>e.description=l,class:"mt-1 block w-full",rows:"2",placeholder:"Help text for this field..."},null,8,["id","modelValue","onUpdate:modelValue"])]),r("div",Ae,[r("div",null,[a(V,{for:`field_min_${o}`,value:"Min Length"},null,8,["for"]),a(U,{id:`field_min_${o}`,modelValue:e.validation.min_length,"onUpdate:modelValue":l=>e.validation.min_length=l,modelModifiers:{number:!0},type:"number",min:"0",class:"mt-1 block w-full"},null,8,["id","modelValue","onUpdate:modelValue"])]),r("div",null,[a(V,{for:`field_max_${o}`,value:"Max Length"},null,8,["for"]),a(U,{id:`field_max_${o}`,modelValue:e.validation.max_length,"onUpdate:modelValue":l=>e.validation.max_length=l,modelModifiers:{number:!0},type:"number",min:"0",class:"mt-1 block w-full"},null,8,["id","modelValue","onUpdate:modelValue"])]),r("div",Le,[a(M,{id:`field_required_${o}`,checked:e.required,"onUpdate:checked":l=>e.required=l,class:"mt-1"},null,8,["id","checked","onUpdate:checked"]),a(V,{for:`field_required_${o}`,value:"Required",class:"ml-2"},null,8,["for"])])])]))),128)),o(zl).dynamic_fields.length>0?(s(),t("div",$e,[l[65]||(l[65]=r("h5",{class:"text-sm font-medium text-gray-900 mb-2 flex items-center"},[r("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})]),p(" Fields Preview: ")],-1)),r("div",Be,[(s(!0),t(y,null,f(o(zl).dynamic_fields,(e,a)=>(s(),t("div",{key:a,class:"text-sm text-gray-800"}
1,[l[64]||(l[64]=p(" ð ")),r("strong",null,g(e.label||`Field ${a+1}`),1),e.name?(s(),t("span",Ie,"("+g(e.name)+")",1)):c("",!0),e.required?(s(),t("span",je,"*")):c("",!0),e.validation.max_length?(s(),t("span",Ee," (max: "+g(e.validation.max_length)+" chars) ",1)):c("",!0)]))),128))])])):c("",!0)])):c("",!0)])]),r("div",Te,[l[77]||(l[77]=r("h4",{class:"text-lg font-medium text-gray-900 mb-4 flex items-center"},[r("svg",{class:"w-5 h-5 mr-2 text-purple-600",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})]),p(" File Input Override Settings ")],-1)),l[78]||(l[78]=r("div",{class:"mb-4 bg-purple-50 p-3 rounded border border-purple-200"},[r("p",{class:"text-sm text-purple-800"},[r("strong",null,"â¡ Advanced Feature:"),p(' Override array-type file inputs to show multiple labeled inputs. For example, instead of one "Upload Images" input, show "Person 1" and "Person 2" inputs. The files will still be processed as a single array in the backend. ')])],-1)),r("div",qe,[r("div",{class:"flex items-center justify-between"},[l[69]||(l[69]=r("h5",{class:"text-sm font-medium text-gray-900"},"Override Inputs",-1)),r("button",{type:"button",onClick:Il,class:"px-3 py-1 bg-purple-600 text-white text-sm rounded-md hover:bg-purple-700 transition-colors flex items-center"},l[68]||(l[68]=[r("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z","clip-rule":"evenodd"}
1)],-1),p(" Add Input ")]))]),o(zl).override_file_inputs.length>0?(s(),t("div",Pe,[l[71]||(l[71]=r("label",{class:"text-sm font-medium text-gray-700 whitespace-nowrap"}," Inputs per row: ",-1)),u(r("select",{"onUpdate:modelValue":l[25]||(l[25]=e=>o(zl).override_columns=e),class:"rounded-md border-gray-300 text-sm focus:border-purple-500 focus:ring-purple-500"},l[70]||(l[70]=[r("option",{value:1},"1 (Vertical)",-1),r("option",{value:2},"2 (Grid)",-1),r("option",{value:3},"3 (Grid)",-1)]),512),[[v,o(zl).override_columns]])])):c("",!0),0===o(zl).override_file_inputs.length?(s(),t("div",Fe," No override inputs defined. The standard file input will be used. ")):c("",!0),(s(!0),t(y,null,f(o(zl).override_file_inputs,(e,o)=>(s(),t("div",{key:e.key||o,class:"border border-purple-200 rounded-lg p-4 bg-purple-50"},[r("div",He,[r("h6",Re,"Input #"+g(o+1),1),r("button",{type:"button",onClick:e=>(e=>{confirm("Are you sure you want to remove this input?")&&zl.override_file_inputs.splice(e,1)})(o),class:"text-red-500 hover:text-red-700 transition-colors"},l[72]||(l[72]=[r("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),8,De)]),r("div",Ge,[r("div",null,[a(V,{for:`override_label_${o}`,value:"Label"},null,8,["for"]),a(U,{id:`override_label_${o}`,modelValue:e.label,"onUpdate:modelValue":l=>e.label=l,type:"text",class:"mt-1 block w-full",placeholder:"e.g., Person 1, Background Image",required:""},null,8,["id","modelValue","onUpdate:modelValue"]),l[73]||(l[73]=r("p",{class:"mt-1 text-xs text-gray-500"},"This label will be shown to users",-1))]),r("div",null,[a(V,{for:`override_description_${o}`,value:"Description (Optional)"},null,8,["for"]),a(C,{id:`override_description_${o}`,modelValue:e.description,"onUpdate:modelValue":l=>e.description=l,class:"mt-1 block w-full",rows:"2",placeholder:"Optional help text for this input..."},null,8,["id","modelValue","onUpdate:modelValue"])]),r("div",Ne,[a(M,{id:`override_required_${o}`,checked:e.required,"onUpdate:checked":l=>e.required=l,class:"mt-1"},null,8,["id","checked","onUpdate:checked"]),a(V,{for:`override_required_${o}`,value:"Required",class:"ml-2"},null,8,["for"])]),r("div",null,[a(V,{value:"Unique Key (auto-generated)"}),r("div",Ke,g(e.key||"N/A"),1),l[74]||(l[74]=r("p",{class:"mt-1 text-xs text-gray-500"},"This key is used for translations and tracking",-1))])])]))),128)),o(zl).override_file_inputs.length>0?(s(),t("div",We,[l[76]||(l[76]=r("h5",{class:"text-sm font-medium text-purple-900 mb-2 flex items-center"},[r("svg",{class:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})]),p(" Override Preview: ")],-1)),r("div",Ye,[(s(!0),t(y,null,f(o(zl).override_file_inputs,(e,a)=>(s(),t("div",{key:a,class:"text-sm text-purple-800"},[l[75]||(l[75]=p(" ð ")),r("strong",null,g(e.label||`Input ${a+1}`),1),e.required?(s(),t("span",Je,"*")):c("",!0),e.description?(s(),t("span",Qe," ("+g(e.description)+") ",1)):c("",!0)]))),128))]),r("div",Xe,[r("p",Ze," ð¡ When this template is selected, the array file input will be replaced with "+g(o(zl).override_file_inputs.length)+" separate input"+g(1!==o(zl).override_file_inputs.length?"s":"")+". ",1)])])):c("",!0)])]),r("div",el,[r("div",ll,[l[85]||(l[85]=r("h4",{class:"text-lg font-medium text-gray-900 flex items-center"},[r("svg",{class:"w-5 h-5 mr-2 text-green-600",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})]),p(" SEO Settings ")],-1)),r("div",tl,[a(M,{id:"has_seo",checked:o(zl).has_seo,"onUpdate:checked":l[26]||(l[26]=e=>o(zl).has_seo=e),class:"mt-1"},null,8,["checked"]),r("div",sl,[a(V,{for:"has_seo",value:"Enable SEO for this item"}),l[79]||(l[79]=r("p",{class:"text-sm text-gray-500 mt-1"}," Create a dedicated SEO-friendly URL for this selection item ",-1))])]),o(zl).has_seo?(s(),t("div",al,[r("div",null,[a(V,{for:"seo_slug",value:"URL Slug"}),a(U,{id:"seo_slug",modelValue:o(zl).seo_slug,"onUpdate:modelValue":l[27]||(l[27]=e=>o(zl).seo_slug=e),type:"text",class:_(["mt-1 block w-full",{"border-red-500":o(zl).errors.seo_slug}]),placeholder:"cyberpunk-style"},null,8,["modelValue","class"]),r("p",ol,[l[80]||(l[80]=p(" URL will be: /apps/app-name/playground/")),r("strong",null,g(o(zl).seo_slug||"your-slug"),1)]),a(k,{message:o(zl).errors.seo_slug,class:"mt-2"},null,8,["message"])]),r("div",null,[a(V,{for:"seo_title",value:"SEO Title"}),a(U,{id:"seo_title",modelValue:o(zl).seo_title,"onUpdate:modelValue":l[28]||(l[28]=e=>o(zl).seo_title=e),type:"text",class:_(["mt-1 block w-full",{"border-red-500":o(zl).errors.seo_title}]),placeholder:"Create Amazing Cyberpunk Style Videos"},null,8,["modelValue","class"]),l[81]||(l[81]=r("p",{class:"text-xs text-gray-500 mt-1"}," This will be the page title in search results ",-1)),a(k,{message:o(zl).errors.seo_title,class:"mt-2"},null,8,["message"])]),r("div",null,[a(V,{for:"seo_description",value:"SEO Description"}
1),a(C,{id:"seo_description",modelValue:o(zl).seo_description,"onUpdate:modelValue":l[29]||(l[29]=e=>o(zl).seo_description=e),class:_(["mt-1 block w-full",{"border-red-500":o(zl).errors.seo_description}]),rows:"3",placeholder:"Generate stunning cyberpunk-style videos with AI. Perfect for social media, content creation, and digital art projects."},null,8,["modelValue","class"]),l[82]||(l[82]=r("p",{class:"text-xs text-gray-500 mt-1"}," This will be shown in search results and social media previews ",-1)),a(k,{message:o(zl).errors.seo_description,class:"mt-2"},null,8,["message"])]),r("div",null,[a(V,{for:"seo_keywords",value:"SEO Keywords"}),a(U,{id:"seo_keywords",modelValue:o(zl).seo_keywords,"onUpdate:modelValue":l[30]||(l[30]=e=>o(zl).seo_keywords=e),type:"text",class:_(["mt-1 block w-full",{"border-red-500":o(zl).errors.seo_keywords}]),placeholder:"cyberpunk, AI video, neon effects, futuristic"},null,8,["modelValue","class"]),l[83]||(l[83]=r("p",{class:"text-xs text-gray-500 mt-1"}," Separate keywords with commas ",-1)),a(k,{message:o(zl).errors.seo_keywords,class:"mt-2"},null,8,["message"])]),r("div",dl,[l[84]||(l[84]=r("h5",{class:"text-sm font-medium text-gray-800 mb-2"}," SEO Preview: ",-1)),r("div",il,[r("div",rl,g(o(zl).seo_title||o(zl).title||"Item Title"),1),r("div",nl," yoursite.com/apps/app-name/playground/"+g(o(zl).seo_slug||"slug"),1),r("div",cl,g(o(zl).seo_description||"SEO description will appear here..."),1)])])])):c("",!0)])]),r("div",ul,[r("div",ml,[r("div",pl,[a(M,{id:"admin_only",checked:o(zl).admin_only,"onUpdate:checked":l[31]||(l[31]=e=>o(zl).admin_only=e),class:"mr-2"},null,8,["checked"]),a(V,{for:"admin_only",value:"Admin Only Item",class:"!mb-0 font-medium"})])]),l[87]||(l[87]=r("p",{class:"text-sm text-gray-600 mb-4"}," If enabled, this item will only be visible to admin users and test users in the playground. ",-1)),o(zl).admin_only?(s(),t("div",vl,l[86]||(l[86]=[r("div",{class:"flex items-center space-x-2"},[r("svg",{class:"w-5 h-5 text-yellow-600",fill:"currentColor",viewBox:"0 0 20 20"},[r("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),r("div",null,[r("p",{class:"text-sm font-medium text-yellow-800"},"Admin Only Mode Active"),r("p",{class:"text-xs text-yellow-700"},"Only admins and test users can see this item")])],-1)]))):c("",!0)]),r("div",gl,[a(o(x),{href:e.route("admin.form-selection-items.index",_l.group),class:"admin-btn admin-btn-back"},{default:i(()=>[a(o(z)),l[88]||(l[88]=p(" Cancel "))]),_:1},8,["href"]),r("button",{type:"submit",disabled:o(zl).processing,class:"admin-btn admin-btn-edit"},[o(zl).processing?(s(),t("svg",fl,l[89]||(l[89]=[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),r("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):(s(),h(o(O),{key:1})),p(" "+g(o(zl).processing?"Updatingâ¦":"Update Item"),1)],8,yl)])],32)])]),a(b,{show:Cl.value,category:"visual-selection",onClose:Ll,onSelect:$l},null,8,["show"])]),_:1})],64))}};export{_l 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.