1import{a as k}from"./QSelect-ihuQyl41.js";import{as as v,d as c,at as a,au as s,av as o,j as l,bp as n,az as r,aD as u,a$ as m,aw as p,F as g,b5 as b,ax as V,aO as f,bm as L}from"./index-BMwF3ZB-.js";import"./QItemLabel-Bsa4xd--.js";import"./QMenu-CadXYskZ.js";import"./position-engine-DJ1a8K0y.js";import"./selection-76ju9b1I.js";const w=c({name:"LinkPromoção",data(){return{selectOptions:[{label:"Regulamento",value:"regulamento"},{label:"Promoção",value:"promocao"}],title_promotion:"",identifier:"",source:"",background:"",link_description:"",link:"",links:[]}},methods:{generateLink(e){return e.source.value==="regulamento"?this.generateLinkRegulation(e):this.generateLinkPromotion(e)},generateLinkRegulation(e){return location.origin+"/"+e.source.value+"/"+this.formatText(e.title_promotion)+"?link="+e.link},generateLinkPromotion(e){let t=location.origin+"/"+e.source.value;return e.identifier&&(t+="/"+this.formatText(e.identifier)),e.link&&(t+="?link="+this.formatLinks(e.link)),e.title_promotion&&(t+="&title_promotion="+e.title_promotion),e.background&&(t+="&background="+e.background),e.source.value&&(t+="&utm_source="+this.formatText(e.source.value)),e.title_promotion&&(t+="&utm_campaign="+this.formatText(e.identifier)),t},addLink(){const e={title_promotion:this.title_promotion,identifier:this.identifier,source:this.source,background:this.background,link_description:this.link_description,link:this.source.value==="promocao"?[this.link_description+"|"+this.link]:this.link};this.links.push(e)},removeLink(e){this.links.splice(e,1)},formatText(e){return L(e).replace(/ |\//g,"_").toLowerCase()},formatLinks(e){return e.length===1?e[0]:e.join("&link=")}}}),x={class:"adm-link-promocao"},h={class:"form"},y={class:"input-field text-left"},C={class:"input-field text-left"},_={class:"input-field text-left"},T={class:"input-field text-left"},$={class:"input-field text-left"},P={class:"input-field text-left"},U={class:"input-field text-center"},B={key:0},R={style:{width:"100%"},class:"text-center"},I={key:1};function N(e,t,Q,O,j,A){return s(),a("section",x,[o("div",h,[t[16]||(t[16]=o("div",{class:"titulo-adm-link-promocao text-center"}," Criação do link de promoção/Regulamento ",-1)),o("div",y,[t[7]||(t[7]=o("label",{for:"source"},"Tipo",-1)),l(k,{modelValue:e.source,"onUpdate:modelValue":t[0]||(t[0]=i=>e.source=i),filled:"",dense:"",options:e.selectOptions},null,8,["modelValue","options"])]),o("div",C,[t[8]||(t[8]=o("label",{for:"title_promotion"},"Titulo da promoção",-1)),l(n,{id:"title_promotion",modelValue:e.title_promotion,"onUpdate:modelValue":t[1]||(t[1]=i=>e.title_promotion=i),filled:"",dense:"",color:"white",type:"text",class:"validate text-black"},null,8,["modelValue"])]),o("div",_,[t[9]||(t[9]=o("label",{for:"identifier",class:"active"},"Identificador",-1)),l(n,{id:"identifier",modelValue:e.identifier,"onUpdate:modelValue":t[2]||(t[2]=i=>e.identifier=i),filled:"",dense:"",color:"white",type:"text",class:"validate text-black"},null,8,["modelValue"])]),o("div",T,[t[10]||(t[10]=o("label",{for:"background"},"Imagem de fundo",-1)),l(n,{id:"background",modelValue:e.background,"onUpdate:modelValue":t[3]||(t[3]=i=>e.background=i),filled:"",dense:"",color:"white",type:"text",class:"validate text-black"},null,8,["modelValue"])]),o("div",$,[t[11]||(t[11]=o("label",{for:"link_description"},"Descrição do link",-1)),l(n,{id:"link_description",modelValue:e.link_description,"onUpdate:modelValue":t[4]||(t[4]=i=>e.link_description=i),filled:"",dense:"",color:"white",type:"text",class:"validate text-black"},null,8,["modelValue"])]),o("div",P,[t[12]||(t[12]=o("label",{for:"link"},"Link",-1)),l(n,{id:"link",modelValue:e.link,"onUpdate:modelValue":t[5]||(t[5]=i=>e.link=i),filled:"",dense:"",color:"white",type:"text",class:"validate text-black"},null,8,["modelValue"])]),o("div",U,[l(m,{"no-caps":"",color:"positive",class:"waves-effect waves-light text-white btn-adicionar",onClick:t[6]||(t[6]=i=>e.addLink())},{default:r(()=>[...t[13]||(t[13]=[u(" Adicionar link ",-1)])]),_:1})]),l(f,null,{default:r(()=>[e.links.length>0?(s(),a("div",B,[t[15]||(t[15]=o("div",{class:"texto-link"},"Links gerados:",-1)),(s(!0),a(g,null,b(e.links,(i,d)=>(s(),V(f,{key:d,class:"link box-shadow"},{default:r(()=>[l(n,{filled:"",dense:"",type:"textarea",value:e.generateLink(i),target:"_blank",rel:"noopener"},null,8,["value"]),o("div",R,[l(m,{class:"waves-effect waves-light btn text-black btn-adicionar",onClick:D=>e.removeLink(d)},{default:r(()=>[...t[14]||(t[14]=[u(" Remover ",-1)])]),_:1},8,["onClick"])])]),_:2},1024))),128))])):p("",!0),e.links.length>0?(s(),a("p",I)):p("",!0)]),_:1})])])}const H=v(w,[["render",N],["__scopeId","data-v-702c2d03"]]);export{H 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.