import{_ as M}from"./D_7E8SMU.js";import{_ as P}from"./BOhf1Bbf.js";import{s as c,u as D,N,j as m,k as U,d as j,w as F,m as o,o as u,b as t,c as _,e as b,G as n,t as l,D as K,I as g,J as y,K as f,f as R}from"./Bgmy51Qv.js";import{u as x}from"./7pZkuj9N.js";import{u as q}from"./DKgjlGGV.js";import"./CNIrc0EA.js";import"./DZl4_Bww.js";import"./AmaTRG5a.js";import"./BHvLfWtM.js";import"./DuSynPle.js";import"./B2895E6R.js";const z=["innerHTML"],G={class:"input-wrapper"},I=["placeholder"],J={key:0,class:"error"},O=["innerHTML"],A={class:"input-wrapper dply-felx start"},E={for:"headerCode",class:"mb-0"},Q={key:0,class:"input-wrapper"},W=["placeholder"],X={class:"input-wrapper dply-felx start"},Y={for:"bodyCode",class:"mb-0"},Z={key:1,class:"input-wrapper"},ee=["placeholder"],te={class:"input-wrapper"},oe={class:"dply-felx j-left mb-20 mb-sm-15"},se={class:"mr-15"},Ce={__name:"[id]",setup(ae){const h=x(),{getDropdownList:re}=h,{allCategories:le,allSubCategories:ne,allBrands:ie}=c(h),v=D(),{setting:C}=c(v),k=N(),{currentLanguage:de}=c(k),{statusObj:w}=q(),i=m(!1),d=m(!1),s=m({id:"",route_pattern:"",header_script:"",header_script_code:"",body_script:"",body_script_code:"",status:""});U(()=>{var e;return((e=C.value)==null?void 0:e.currency_icon)||"$"});const $=()=>{i.value=!i.value},S=()=>{d.value=!d.value},V=e=>{i.value=e.target.checked},B=e=>{d.value=e.target.checked},H=e=>{s.value.status=e.key};return(e,a)=>{const L=M,T=P;return u(),j(T,{ref:"dataPageRef","set-api":"setCustomScript","get-api":"getCustomScript","route-name":"custom-scripts",name:e.$t("title.cs"),"validation-keys":["route_pattern"],result:o(s),gate:"header_link",onResult:a[5]||(a[5]=p=>s.value=p)},{form:F(({hasError:p})=>[t("p",{class:"info-msg mb-20 mb-sm-15",innerHTML:e.$t("title.up")},null,8,z),t("div",G,[t("label",null,l(e.$t("title.rParam")),1),n(t("input",{type:"text",placeholder:e.$t("title.rParam"),name:"title","onUpdate:modelValue":a[0]||(a[0]=r=>o(s).route_pattern=r),class:K({invalid:!o(s).route_pattern&&p})},null,10,I),[[g,o(s).route_pattern]]),!o(s).route_pattern&&p?(u(),_("span",J,l(e.$t("category.req",{type:e.$t("title.rParam")})),1)):b("",!0)]),t("p",{class:"info-msg mb-20 mb-sm-15",innerHTML:e.$t("title.wj")},null,8,O),t("div",A,[t("label",E,[n(t("input",{type:"checkbox","true-value":1,"false-value":0,id:"headerCode","onUpdate:modelValue":a[1]||(a[1]=r=>o(s).header_script=r),onChange:V},null,544),[[f,o(s).header_script]]),y(" "+l(e.$t("title.hsc")),1)]),t("button",{type:"button",class:"toggle-arrow",onClick:$},a[6]||(a[6]=[t("i",{class:"icon black arrow-down"},null,-1)]))]),o(i)?(u(),_("div",Q,[t("label",null,l(e.$t("title.hsc")),1),n(t("textarea",{placeholder:e.$t("title.hsc"),"onUpdate:modelValue":a[2]||(a[2]=r=>o(s).header_script_code=r)},null,8,W),[[g,o(s).header_script_code]])])):b("",!0),t("div",X,[t("label",Y,[n(t("input",{type:"checkbox",id:"bodyCode","true-value":1,"false-value":0,"onUpdate:modelValue":a[3]||(a[3]=r=>o(s).body_script=r),onChange:B},null,544),[[f,o(s).body_script]]),y(" "+l(e.$t("title.bs")),1)]),t("button",{type:"button",class:"toggle-arrow",onClick:S},a[7]||(a[7]=[t("i",{class:"icon black arrow-down"},null,-1)]))]),o(d)?(u(),_("div",Z,[t("label",null,l(e.$t("title.bsc")),1),n(t("textarea",{placeholder:e.$t("title.bsc"),"onUpdate:modelValue":a[4]||(a[4]=r=>o(s).body_script_code=r)},null,8,ee),[[g,o(s).body_script_code]])])):b("",!0),t("div",te,[t("div",oe,[t("span",se,l(e.$t("category.status")),1),R(L,{selectedKey:`${o(s).status}`,options:o(w),onClicked:H},null,8,["selectedKey","options"])])])]),_:1},8,["name","result"])}}};export{Ce as default};
