1import{i as B,Z as F,r as v,f as u,c as L,a as b,w,b as e,d as T,g as I,l as f,v as x,o as d,F as _,j as C,t as M,p as V,m as D,n as g,e as N,T as O,y as H}from"./app-B9KORyBa.js";import{A as R}from"./AuthenticatedLayout-DcpqZk2r.js";import{_ as z}from"./InputError-BH5ciAU3.js";import{_ as J}from"./InputLabel-C-zTQq7X.js";import{S as K}from"./Switch-CjgwlyRI.js";import{_ as P}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-DrAX-EpC.js";import"./NavLink-BiVKPBr8.js";import"./TextOutline-CGLkonHp.js";import"./DocumentTextOutline-B7A647Cs.js";import"./InformationCircleOutline-DCl6slX2.js";const Y={components:{Switch:K,InputLabel:J,InputError:z,AuthenticatedLayout:R,Head:F,Link:B},props:{template:{type:Object,required:!0},scholarships:{type:Array,required:!0}},setup(n){var y;const t=O({exclusive:n.template.exclusive??!1,title:((y=n.template)==null?void 0:y.title)||"",scholarship_id:n.template.scholarship_id||"",fields:n.template.fields||{step1:[{label:"",name:"",type:"text",cols:"12",required:!0}],step2:[{label:"",name:"",type:"text",cols:"12",required:!0}],step3:[{label:"",name:"",type:"text",cols:"12",required:!0}],step4:[{label:"",name:"",type:"text",cols:"12",required:!0}]},active:n.template.active||0}),h=o=>
1{t.fields[o].push({label:"",name:"",type:"text",cols:"12",required:!1})},l=(o,a)=>{t.fields[o].length>1&&t.fields[o].splice(a,1)},S=(o,a)=>{if(a>0){const p=t.fields[o][a];t.fields[o].splice(a,1),t.fields[o].splice(a-1,0,p)}},U=(o,a)=>{if(a<t.fields[o].length-1){const p=t.fields[o][a];t.fields[o].splice(a,1),t.fields[o].splice(a+1,0,p)}},k=()=>{var o;(o=n.template)!=null&&o.id?(t._method="put",t.put(route("admin.regformtemplates.update",{regformtemplate:n.template.id}))):t.post(route("admin.regformtemplates.store"))};return H(()=>t.active,o=>{o===0&&Object.keys(t.fields).forEach(a=>{t.fields[a].forEach(p=>{p.required=!1})})}),console.log(t.fields),{form:t,scholarships:n.scholarships,addField:h,removeField:l,moveUp:S,moveDown:U,submit:k}}},Z={class:"flex items-center justify-between"},G={class:"font-semibold text-xl text-gray-800 leading-tight"},Q={class:"py-12"},W={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg p-4"},X={class:"mb-4"},$={class:"space-y-2"},ee={key:0,class:"mb-4"},te=["value"],oe={class:"text-lg font-semibold text-gray-800 mb-4"},le=["for"],se=["id","onUpdate:modelValue"],ae=["for"],ie=["id","onUpdate:modelValue"],ne=["for"],re=["id","onUpdate:modelValue"],de=["for"],me=["id","onUpdate:modelValue"],ue=["for"],ce=["id","onUpdate:modelValue"],pe={class:"flex space-x-2 ml-5 pl-5"},fe=["onClick"],he=["onClick"],ve=["onClick","disabled"],be=["onClick","disabled"],ke={class:"flex justify-end mt-6"},ye=["disabled"];function _e(n,t,h,l,S,U){var j;const k=v("Head"),y=v("Link"),o=v("InputLabel"),a=v("Switch"),p=v("InputError"),E=v("AuthenticatedLayout");return d(),u(_,null,[(j=h.template)!=null&&j.id?(d(),L(k,{key:0,title:"Edit Scholarship template"})):(d(),L(k,{key:1,title:"Add Scholarship template"})),b(E,null,{header:w(()=>[e("div",Z,[e("h2",G,M(h.template.title?`Edit Regform Template: ${h.template.title}`:"Add Regform Template"),1),b(y,{class:"btn btn-secondary",href:n.route("admin.regformtemplates.index")},{default:w(()=>[...t[4]||(t[4]=[N(" Back to List ",-1)])]),_:1},8,["href"])])]),default:w(()=>{var q;return[e("div",Q,[e("div",W,[e("form",{onSubmit:t[3]||(t[3]=T((...r)=>l.submit&&l.submit(...r),["prevent"]))},[e("div",X,[t[5]||(t[5]=e("label",{for:"title",class:"block text-sm font-medium text-gray-700"},"Stipendija",-1)),f(e("input",{id:"title","onUpdate:modelValue":t[0]||(t[0]=r=>l.form.title=r),type:"text",class:"mt-1 block w-full border-gray-300 rounded-md shadow-sm",placeholder:"Enter template title"},null,512),[[x,l.form.title]])]),e("div",$,[b(o,{for:"regform",value:"RÄdÄ«t tikai Å¡ai stipendijai"}),b(a,{isOn:l.form.exclusive,"onUpdate:isOn":t[1]||(t[1]=r=>l.form.exclusive=r),id:"exclusive"},null,8,["isOn"]),b(p,{class:"mt-2",message:l.form.errors.exclusive},null,8,["message"])]),(q=h.template)!=null&&q.id?I("",!0):(d(),u("div",ee,[t[7]||(t[7]=e("label",{for:"scholarship",class:"block text-sm font-medium text-gray-700"},"Scholarship",-1)),f(e("select",{id:"scholarship","onUpdate:modelValue":t[2]||(t[2]=r=>l.form.scholarship_id=r),class:"mt-1 block w-full border-gray-300 rounded-md shadow-sm"},[t[6]||(t[6]=e("option",{value:"",disabled:""},"Select a scholarship",-1)),(d(!0),u(_,null,C(l.scholarships,r=>(d(),u("option",{key:r.id,value:r.id},M(JSON.parse(r.name).lv),9,te))),128))],512),[[V,l.form.scholarship_id]])])),(d(!0),u(_,null,C(l.form.fields,(r,i,A)=>(d(),u("div",{key:A,class:"mb-6"},[e("h3",oe,M(i),1),(d(!0),u(_,null,C(r,(c,s)=>(d(),u("div",{key:s,class:"flex items-center space-x-4 mb-4"},[e("label",{for:"label-"+i+"-"+s,class:"text-sm font-medium text-gray-700"}," Label ",8,le),f(e("input",{id:"label-"+i+"-"+s,"onUpdate:modelValue":m=>c.label=m,type:"text",class:"mt-1 block w-full border-gray-300 rounded-md shadow-sm"},null,8,se),[[x,c.label]]),e("label",{for:"name-"+i+"-"+s,class:"text-sm font-medium text-gray-700"}," Name ",8,ae),f(e("input",{id:"name-"+i+"-"+s,"onUpdate:modelValue":m=>c.name=m,type:"text",class:"mt-1 block w-full border-gray-300 rounded-md shadow-sm"},null,8,ie),[[x,c.name]]),e("label",{for:"type-"+i+"-"+s,class:"text-sm font-medium text-gray-700"}," Type ",8,ne),f(e("select",{id:"type-"+i+"-"+s,"onUpdate:modelValue":m=>c.type=m,class:"mt-1 block w-full border-gray-300 rounded-md shadow-sm"},[...t[8]||(t[8]=[e("option",{value:"text"},"Teksts",-1),e("option",{value:"textarea"},"Teksta lauks",-1),e("option",{value:"number"},"Skaitlis",-1),e("option",{value:"email"},"E-pasts",-1),e("option",{value:"phone"},"TÄlrunis",-1),e("option",{value:"date"},"Datums",-1),e("option",{value:"checkbox"},"Ķeksis",-1),e("option",{value:"file"},"Fails",-1),e("option",{value:"atvk"},"AdministratÄ«vÄ teritorija",-1),e("option",{value:"school"},"Augstskola",-1),e("option",{value:"school_faculty"},"FakultÄte",-1),e("option",{value:"school_programm"},"MÄcÄ«bu programma",-1),e("option",{value:"school_grade"},"Kurss/rezidentÅ«ra/pÄtniecÄ«ba",-1),e("option",{value:"student_features"},"Papildus kritÄriji",-1),e("option",{value:"dummy"},"DUMMY",-1)])],8,re),[[V,c.type]]),e("label",{for:"type-"+i+"-"+s,class:"text-sm font-medium text-gray-700"}," Columns ",8,de),f(e("select",{id:"type-"+i+"-"+s,"onUpdate:modelValue":m=>c.cols=m,class:"mt-1 block w-100 border-gray-300 rounded-md shadow-sm"},[...t[9]||(t[9]=[e("option",{value:"1"},"1",-1),e("option",{value:"2"},"2",-1),e("option",{value:"3"},"3",-1),e("option",{value:"4"},"4",-1),e("option",{value:"5"},"5",-1),e("option",{value:"6"},"6",-1),e("option",{value:"7"},"7",-1),e("option",{value:"8"},"8",-1),e("option",{value:"9"},"9",-1),e("option",{value:"10"},"10",-1),e("option",{value:"11"},"11",-1),e("option",{value:"12",selected:"selected"},"12",-1)])],8,me),[[V,c.cols]]),e("label",{for:"required-"+i+"-"+s,class:"text-sm font-medium text-gray-700"}," Required ",8,ue),f(e("input",{id:"required-"+i+"-"+s,type:"checkbox","onUpdate:modelValue":m=>c.required=m,class:"form-checkbox h-5 w-5 text-indigo-600"},null,8,ce),[[D,c.required]]),e("div",pe,[e("button",{type:"button",class:"btn btn-secondary",onClick:m=>l.addField(i,s)},[(d(),u("svg",{xmlns:"http://www.w3.org/2000/svg",class:g(n.styleClasses),viewBox:"0 0 512 512"},[...t[10]||(t[10]=[e("path",{d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 176v160M336 256H176"},null,-1)])],2))],8,fe),e("button",{type:"button",class:"btn btn-danger",onClick:m=>l.removeField(i,s)},[(d(),u("svg",{xmlns:"http://www.w3.org/2000/svg",class:g(n.styleClasses),viewBox:"0 0 512 512"},[...t[11]||(t[11]=[e("path",{d:"M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),e("path",{d:"M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])],2))],8,he),e("button",{type:"button",class:"btn btn-secondary",onClick:m=>l.moveUp(i,s),disabled:s===0},[(d(),u("svg",{xmlns:"http://www.w3.org/2000/svg",class:g(n.styleClasses),viewBox:"0 0 512 512"},[...t[12]||(t[12]=[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M112 244l144-144 144 144M256 120v292"},null,-1)])],2))],8,ve),e("button",{type:"button",class:"btn btn-secondary",onClick:m=>l.moveDown(i,s),disabled:s===r.length-1},[(d(),u("svg",{xmlns:"http://www.w3.org/2000/svg",class:g(n.styleClasses),viewBox:"0 0 512 512"},[...t[13]||(t[13]=[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M112 268l144 144 144-144M256 392V100"},null,-1)])],2))],8,be)])]))),128))]))),128)),e("div",ke,[e("button",{type:"submit",class:"btn btn-primary",disabled:l.form.processing}," Save Changes ",8,ye)])],32)])])]}),_:1})],64)}const Ee=P(Y,[["render",_e],["__scopeId","data-v-382b662e"]]);export{Ee 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.