-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5332dc2.modern.js
More file actions
1 lines (1 loc) · 3.2 KB
/
Copy path5332dc2.modern.js
File metadata and controls
1 lines (1 loc) · 3.2 KB
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[139],{369:function(t,e,o){var content=o(687);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(11).default)("4cd76477",content,!0,{sourceMap:!1})},686:function(t,e,o){"use strict";o(369)},687:function(t,e,o){var n=o(10)(function(i){return i[1]});n.push([t.i,"#product_sharing[data-v-dc5c9a9a]{display:flex;flex-direction:column;gap:8px 4px;margin-top:24px}.sharing_item[data-v-dc5c9a9a]{align-items:center;cursor:pointer;display:flex;flex-direction:row;max-width:100%;position:relative;width:-moz-fit-content;width:fit-content}.sharing_item .sharing_media[data-v-dc5c9a9a]{height:20px;margin-right:8px;width:20px}.sharing_item .sharing_media svg[data-v-dc5c9a9a]{height:100%;width:100%}.sharing_item .sharing_text[data-v-dc5c9a9a]{font-size:var(--font_size_base);font-weight:var(--font_weight_light);text-transform:uppercase}.sharing_item:hover .sharing_text[data-v-dc5c9a9a]{-webkit-text-decoration:underline;text-decoration:underline}.sharing_item .tooltip[data-v-dc5c9a9a]{border:1px solid var(--bg_third);color:var(--text_light);font-size:var(--font_size_small);left:0;padding:2px 6px;position:absolute;top:calc(100% + 4px)}@media (max-width:1024px){#product_sharing[data-v-dc5c9a9a]{margin-top:32px}}",""]),n.locals={},t.exports=n},872:function(t,e,o){"use strict";o.r(e);var n={props:{productName:{type:String,required:!0}},data:()=>({showTooltip:!1,productUrl:null}),computed:{whatsNumber(){var t;return null!==(t=this.$store.state.contactData)&&void 0!==t&&t.menu[0]?this.$store.state.contactData.menu[0].sub[0]:null}},mounted(){this.productUrl=window.location.href},methods:{clearedWhatsPhone(){if(!this.whatsNumber.label)return;let t=this.whatsNumber.label.replace(/\D/g,"");return t.startsWith("55")&&(t=t.slice(2)),`https://api.whatsapp.com/send?l=pt&phone=55${t}`},shareWhatsApp(){const t=window.location.href,e=encodeURIComponent(`Olá! Estou interessado no produto "${this.productName}", com o link: ${t}`),o=`${this.clearedWhatsPhone()}&text=${e}`,n=window.open(o,"_blank");n&&n.focus()},async copyLink(){try{await navigator.clipboard.writeText(this.productUrl),this.showTooltip=!0,setTimeout(()=>{this.showTooltip=!1},2e3)}catch(t){console.error("Falha ao copiar o link:",t),setTimeout(()=>{this.showTooltip=!1},2e3)}}}},r=(o(686),o(12)),component=Object(r.a)(n,function(){var t=this,e=t._self._c;return e("ul",{attrs:{id:"product_sharing"}},[e("li",{staticClass:"sharing_item",on:{click:t.shareWhatsApp}},[e("span",{staticClass:"sharing_media"},[e("svg",{attrs:{width:"20",height:"20"}},[e("use",{attrs:{"xlink:href":"#whats-thin-icon"}})])]),t._v(" "),e("div",{staticClass:"sharing_text"},[t._v("\n Comprar no WhatsApp\n ")])]),t._v(" "),e("li",{staticClass:"sharing_item",on:{click:t.copyLink}},[e("span",{staticClass:"sharing_media"},[e("svg",{attrs:{width:"20",height:"20"}},[e("use",{attrs:{"xlink:href":"#share-icon"}})])]),t._v(" "),e("div",{staticClass:"sharing_text"},[t._v("\n Compartilhar\n ")]),t._v(" "),e("span",{staticClass:"tooltip fade",class:{"-show":t.showTooltip}},[t._v("\n Link Copiado\n ")])])])},[],!1,null,"dc5c9a9a",null);e.default=component.exports}}]);