@salla.sa/twilight-components 2.13.36 → 2.13.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/salla-add-product-button_47.cjs.entry.js +37 -27
- package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-advertisement.cjs.entry.js +14 -10
- package/dist/cjs/salla-advertisement.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -0
- package/dist/cjs/salla-apps-icons.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -0
- package/dist/cjs/salla-contacts.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +3 -0
- package/dist/cjs/salla-payments.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +3 -0
- package/dist/cjs/salla-social.cjs.entry.js.map +1 -1
- package/dist/collection/components/salla-advertisement/salla-advertisement.js +14 -10
- package/dist/collection/components/salla-advertisement/salla-advertisement.js.map +1 -1
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +3 -0
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js.map +1 -1
- package/dist/collection/components/salla-contacts/salla-contacts.js +3 -0
- package/dist/collection/components/salla-contacts/salla-contacts.js.map +1 -1
- package/dist/collection/components/salla-menu/salla-menu.js +6 -6
- package/dist/collection/components/salla-menu/salla-menu.js.map +1 -1
- package/dist/collection/components/salla-payments/salla-payments.js +3 -0
- package/dist/collection/components/salla-payments/salla-payments.js.map +1 -1
- package/dist/collection/components/salla-social/salla-social.js +3 -0
- package/dist/collection/components/salla-social/salla-social.js.map +1 -1
- package/dist/components/salla-advertisement.js +14 -10
- package/dist/components/salla-advertisement.js.map +1 -1
- package/dist/components/salla-apps-icons.js +3 -0
- package/dist/components/salla-apps-icons.js.map +1 -1
- package/dist/components/salla-contacts.js +3 -0
- package/dist/components/salla-contacts.js.map +1 -1
- package/dist/components/salla-menu.js +6 -6
- package/dist/components/salla-menu.js.map +1 -1
- package/dist/components/salla-payments.js +3 -0
- package/dist/components/salla-payments.js.map +1 -1
- package/dist/components/salla-quick-buy2.js +31 -21
- package/dist/components/salla-quick-buy2.js.map +1 -1
- package/dist/components/salla-social.js +3 -0
- package/dist/components/salla-social.js.map +1 -1
- package/dist/esm/salla-add-product-button_47.entry.js +37 -27
- package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
- package/dist/esm/salla-advertisement.entry.js +14 -10
- package/dist/esm/salla-advertisement.entry.js.map +1 -1
- package/dist/esm/salla-apps-icons.entry.js +3 -0
- package/dist/esm/salla-apps-icons.entry.js.map +1 -1
- package/dist/esm/salla-contacts.entry.js +3 -0
- package/dist/esm/salla-contacts.entry.js.map +1 -1
- package/dist/esm/salla-payments.entry.js +3 -0
- package/dist/esm/salla-payments.entry.js.map +1 -1
- package/dist/esm/salla-social.entry.js +3 -0
- package/dist/esm/salla-social.entry.js.map +1 -1
- package/dist/esm-es5/salla-add-product-button_47.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
- package/dist/esm-es5/salla-advertisement.entry.js +2 -2
- package/dist/esm-es5/salla-advertisement.entry.js.map +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
- package/dist/esm-es5/salla-apps-icons.entry.js.map +1 -1
- package/dist/esm-es5/salla-contacts.entry.js +1 -1
- package/dist/esm-es5/salla-contacts.entry.js.map +1 -1
- package/dist/esm-es5/salla-payments.entry.js +1 -1
- package/dist/esm-es5/salla-payments.entry.js.map +1 -1
- package/dist/esm-es5/salla-social.entry.js +1 -1
- package/dist/esm-es5/salla-social.entry.js.map +1 -1
- package/dist/twilight/p-056eaae7.system.entry.js +5 -0
- package/dist/twilight/p-056eaae7.system.entry.js.map +1 -0
- package/dist/twilight/{p-85993e98.entry.js → p-126a72c2.entry.js} +2 -2
- package/dist/twilight/p-126a72c2.entry.js.map +1 -0
- package/dist/twilight/{p-962d53a3.system.entry.js → p-2b0b9547.system.entry.js} +2 -2
- package/dist/twilight/p-2b0b9547.system.entry.js.map +1 -0
- package/dist/twilight/p-2e3ef7de.entry.js +5 -0
- package/dist/twilight/p-2e3ef7de.entry.js.map +1 -0
- package/dist/twilight/p-52560b3b.system.entry.js +5 -0
- package/dist/twilight/p-52560b3b.system.entry.js.map +1 -0
- package/dist/twilight/p-64707107.system.js +1 -1
- package/dist/twilight/p-906810cd.system.entry.js +5 -0
- package/dist/twilight/p-906810cd.system.entry.js.map +1 -0
- package/dist/twilight/{p-19f298e9.entry.js → p-be436042.entry.js} +2 -2
- package/dist/twilight/{p-19f298e9.entry.js.map → p-be436042.entry.js.map} +1 -1
- package/dist/twilight/p-c7028b08.entry.js +5 -0
- package/dist/twilight/p-c7028b08.entry.js.map +1 -0
- package/dist/twilight/{p-fc8e9b7f.entry.js → p-df041459.entry.js} +2 -2
- package/dist/twilight/p-df041459.entry.js.map +1 -0
- package/dist/twilight/{p-35541777.system.entry.js → p-e0f59673.system.entry.js} +2 -2
- package/dist/twilight/p-e0f59673.system.entry.js.map +1 -0
- package/dist/twilight/p-f0811b1f.entry.js +5 -0
- package/dist/twilight/p-f0811b1f.entry.js.map +1 -0
- package/dist/twilight/{p-9ff06235.system.entry.js → p-fc759ae1.system.entry.js} +2 -2
- package/dist/twilight/p-fc759ae1.system.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-advertisement/salla-advertisement.d.ts +1 -1
- package/dist/types/components/salla-apps-icons/salla-apps-icons.d.ts +1 -0
- package/dist/types/components/salla-contacts/salla-contacts.d.ts +1 -0
- package/dist/types/components/salla-menu/salla-menu.d.ts +0 -1
- package/dist/types/components/salla-payments/salla-payments.d.ts +1 -0
- package/dist/types/components/salla-social/salla-social.d.ts +1 -0
- package/package.json +5 -5
- package/dist/twilight/p-080bbb5b.entry.js +0 -5
- package/dist/twilight/p-080bbb5b.entry.js.map +0 -1
- package/dist/twilight/p-35541777.system.entry.js.map +0 -1
- package/dist/twilight/p-4390fbcd.system.entry.js +0 -5
- package/dist/twilight/p-4390fbcd.system.entry.js.map +0 -1
- package/dist/twilight/p-85993e98.entry.js.map +0 -1
- package/dist/twilight/p-962d53a3.system.entry.js.map +0 -1
- package/dist/twilight/p-9e86a50c.system.entry.js +0 -5
- package/dist/twilight/p-9e86a50c.system.entry.js.map +0 -1
- package/dist/twilight/p-9ff06235.system.entry.js.map +0 -1
- package/dist/twilight/p-b6a073de.entry.js +0 -5
- package/dist/twilight/p-b6a073de.entry.js.map +0 -1
- package/dist/twilight/p-bea45f66.system.entry.js +0 -5
- package/dist/twilight/p-bea45f66.system.entry.js.map +0 -1
- package/dist/twilight/p-fc8e9b7f.entry.js.map +0 -1
- package/dist/twilight/p-fcf9fe94.entry.js +0 -5
- package/dist/twilight/p-fcf9fe94.entry.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{l(r.next(e))}catch(e){a(e)}}function o(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?n(e.value):i(e.value).then(s,o)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(r=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;i=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
|
|
2
1
|
/*!
|
|
3
2
|
* Crafted with ❤ by Salla
|
|
4
|
-
*/
|
|
3
|
+
*/
|
|
4
|
+
import{r as registerInstance,h,g as getElement}from"./index-79837019.js";import{a as anime}from"./anime.es-6b92d9cd.js";import{H as Helper}from"./Helper-17531428.js";var sallaAdvertisementCss=":host{display:block}";var SallaAdvertisement=function(){function e(e){var t=this;registerInstance(this,e);var s;this.position=undefined;this.advertisements=undefined;this.advertIcon=undefined;this.currentSlug=salla.config.get("page.slug");salla.onReady((function(){t.currentSlug=salla.config.get("page.slug")}));this.advSlot=((s=this.host.querySelector('[slot="adv"]'))===null||s===void 0?void 0:s.innerHTML)||'<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n '}e.prototype.isNotVisible=function(e){return!!salla.storage.get("statusAd-".concat(e.id))};e.prototype.setCanDisplayFlag=function(e,t){if(!t){salla.storage.set("statusAd-".concat(e.id),"dismissed");anime({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}};e.prototype.render=function(){var e=this;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((function(t){return h("div",{class:{"s-hidden":e.isNotVisible(t),"s-advertisement":true},"data-id":t.id,style:{"background-color":t.colors.bg,color:t.colors.text}},h("div",{id:"adv-slot",innerHTML:e.advSlot.replace("{iconElem}",'<i class="s-advertisement-content-icon '.concat(t.icon,'"></i>')).replace("{urlElem}",t.url?'<a href="'.concat(t.url,'" target="').concat(t.target,'">').concat(t.description,"</a>"):t.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",t.icon).replace("{url}",t.url).replace("{target}",t.target).replace("{description}",t.description).replace("{bg_color}",t.colors.bg).replace("{text_color}",t.colors.text)}))}))};e.prototype.componentWillLoad=function(){var e=this;return Helper.onSallaReadyPromise((function(t){return salla.api.advertisement.fetch(e.currentSlug).then((function(s){var i=s.data;if(Array.isArray(i)&&i.length>0){for(var r=0,a=i;r<a.length;r++){var n=a[r];if(!salla.storage.get("statusAd-".concat(n.id))){e.advertisements=[n];break}}}t()}))}))};e.prototype.componentDidRender=function(){var e=this;var t;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((function(){var t=e.host.querySelector(".s-advertisement-action");if(t){t.addEventListener("click",(function(){return e.setCanDisplayFlag(e.advertisements[0],false)}))}}));this.host.querySelectorAll("#adv-slot").forEach((function(e){return e===null||e===void 0?void 0:e.replaceWith(e===null||e===void 0?void 0:e.firstChild)}));(t=this.host.querySelector('[slot="adv"]'))===null||t===void 0?void 0:t.remove();anime({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAdvertisement.style=sallaAdvertisementCss;export{SallaAdvertisement as salla_advertisement};
|
|
5
5
|
//# sourceMappingURL=salla-advertisement.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaAdvertisementCss","SallaAdvertisement","
|
|
1
|
+
{"version":3,"names":["sallaAdvertisementCss","SallaAdvertisement","hostRef","_this","this","salla","config","get","onReady","currentSlug","advSlot","_a","host","querySelector","innerHTML","prototype","isNotVisible","advert","storage","concat","id","setCanDisplayFlag","flag","set","AnimeJS","targets","opacity","duration","height","clientHeight","easing","render","Array","isArray","advertisements","length","map","advertisement","h","class","style","colors","bg","color","text","replace","icon","url","target","description","componentWillLoad","Helper","onSallaReadyPromise","resolve","api","fetch","then","resp","ads","data","_i","ads_1","ad","componentDidRender","setTimeout","closeBtn","addEventListener","querySelectorAll","forEach","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-advertisement/salla-advertisement.scss?tag=salla-advertisement","src/components/salla-advertisement/salla-advertisement.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, State, Element, h } from '@stencil/core';\nimport { Advertisement } from './interfaces';\nimport AnimeJS from 'animejs';\nimport Helper from '../../Helpers/Helper';\n/**\n * @name SallaAdvertisement\n * @description A StencilJS component for handling and displaying advertisements in different pages of salla applications.\n * @tag salla-advertisement\n */\n\n/**\n * @slot adv - Replaces the entire advertisement, has replaceable props `{icon}`, `{url}`, `{target}`, `{description}`, `{bg_color}`, `{text_color}`.\n * */\n@Component({\n tag: 'salla-advertisement',\n styleUrl: 'salla-advertisement.scss',\n})\nexport class SallaAdvertisement {\n /**\n * Constructor for initializing the component.\n */\n constructor() {\n salla.onReady(() => {\n this.currentSlug = salla.config.get(\"page.slug\");\n })\n\n this.advSlot = this.host.querySelector('[slot=\"adv\"]')?.innerHTML || `<div class=\"s-advertisement-content\"><h2 class=\"s-advertisement-content-main\">{iconElem}{urlElem}</h2>{closeElem}</div>\n `;\n }\n private readonly advSlot: string;\n // State properties for managing component state\n @State() position: string;\n @State() advertisements: Advertisement[];\n @State() advertIcon: string;\n @State() currentSlug: string = salla.config.get(\"page.slug\");\n\n @Element() private host: HTMLElement;\n\n\n /**\n * Checks whether an advertisement is marked as not visible/dismissed.\n * @param advert - The advertisement to check.\n * @returns True if the advertisement is not visible, false otherwise.\n */\n private isNotVisible(advert: Advertisement): boolean {\n return !!salla.storage.get(`statusAd-${advert.id}`)\n }\n\n /**\n * Sets a flag to control the visibility of an advertisement and triggers an animation when hiding it.\n * @param advert - The advertisement to update.\n * @param flag - The flag indicating whether to display or hide the advertisement.\n */\n private setCanDisplayFlag(advert: Advertisement, flag: boolean): void {\n if (!flag) {\n // Set the statusAd flag to 'dismissed'\n salla.storage.set(`statusAd-${advert.id}`, 'dismissed');\n // Trigger an animation to hide the advertisement\n AnimeJS({\n targets: this.host,\n opacity: [1, 0],\n duration: 300,\n height: [this.host.clientHeight, 0],\n easing: 'easeInOutQuad',\n });\n }\n }\n\n /**\n * Renders the advertisements based on the fetched data and visibility status.\n * @returns JSX for rendering advertisements.\n */\n render() {\n if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {\n return;\n }\n return this.advertisements.map((advertisement: Advertisement) => {\n return <div class={{ \"s-hidden\": this.isNotVisible(advertisement), 's-advertisement': true }} data-id={advertisement.id}\n style={{ \"background-color\": advertisement.colors.bg, \"color\": advertisement.colors.text }}>\n <div id=\"adv-slot\" innerHTML={\n this.advSlot\n // Replace the props with the advertisement data\n // !Note: The props with the 'Elem' suffix are for internal use only.\n .replace(\"{iconElem}\", `<i class=\"s-advertisement-content-icon ${advertisement.icon}\"></i>`)\n .replace(\"{urlElem}\", advertisement.url ? `<a href=\"${advertisement.url}\" target=\"${advertisement.target}\">${advertisement.description}</a>` : advertisement.description)\n .replace(\"{closeElem}\", `<button class=\"s-advertisement-action\" aria-label=\"close-alert\"><i class=\"sicon-cancel\"></i></button>`)\n .replace('{icon}', advertisement.icon)\n .replace('{url}', advertisement.url)\n .replace('{target}', advertisement.target)\n .replace('{description}', advertisement.description)\n .replace('{bg_color}', advertisement.colors.bg)\n .replace('{text_color}', advertisement.colors.text)\n }></div>\n </div>\n }\n );\n }\n\n /**\n * Lifecycle method that fetches advertisements before the component is loaded.\n */\n componentWillLoad() {\n // Fetch advertisements based on the current page\n return Helper.onSallaReadyPromise((resolve) => {\n return salla.api.advertisement.fetch(this.currentSlug)\n .then(resp => {\n let ads = resp.data;\n if (Array.isArray(ads) && ads.length > 0) {\n for (const ad of ads) {\n if (!salla.storage.get(`statusAd-${ad.id}`)) {\n this.advertisements = [ad];\n break;\n }\n }\n }\n resolve();\n })\n });\n }\n componentDidRender() {\n if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {\n return;\n }\n // Add event listener for the close button\n setTimeout(() => {\n let closeBtn = this.host.querySelector('.s-advertisement-action');\n if (closeBtn) {\n closeBtn.addEventListener('click', () => this.setCanDisplayFlag(this.advertisements[0], false));\n }\n });\n\n // Reduce Dom size by removing the slot element\n this.host.querySelectorAll('#adv-slot').forEach(el => el?.replaceWith(el?.firstChild));\n this.host.querySelector('[slot=\"adv\"]')?.remove();\n\n // Trigger an animation to show the advertisement\n AnimeJS({\n targets: this.host,\n opacity: [0, 1],\n duration: 300,\n height: [0, this.host.clientHeight],\n easing: 'easeInOutQuad',\n });\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";var sallaAppsIconsCss=":host{display:block}";var SallaAppsIcons=function(){function e(e){var
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";var sallaAppsIconsCss=":host{display:block}";var SallaAppsIcons=function(){function e(e){var t=this;registerInstance(this,e);var s;this.apps=salla.config.get("store.apps");this.hideTitle=undefined;this.appsTitle=undefined;this.vertical=undefined;this.appSlot=((s=this.host.querySelector('[slot="app"]'))===null||s===void 0?void 0:s.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){t.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){t.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}e.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(e){var t=e[0],s=e[1];return{name:t,value:s}}))};e.prototype.componentWillLoad=function(){return new Promise((function(e){return salla.onReady(e)}))};e.prototype.render=function(){var e=this;var t=this.getAppsArray();if(Array.isArray(t)&&!t.length){return}return h(Host,{class:"s-apps-icons"},!this.hideTitle&&h("h3",null,this.appsTitle),h("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},t.map((function(t,s){return h("a",{key:s,href:t.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:e.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(t.name,".png"))).replace(/\{name\}/g,t.name)})}))))};e.prototype.componentDidRender=function(){var e;(e=this.host.querySelector('[slot="app"]'))===null||e===void 0?void 0:e.remove()};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAppsIcons.style=sallaAppsIconsCss;export{SallaAppsIcons as salla_apps_icons};
|
|
5
5
|
//# sourceMappingURL=salla-apps-icons.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaAppsIconsCss","SallaAppsIcons","hostRef","_this","this","salla","config","get","appSlot","_a","host","querySelector","innerHTML","onReady","apps","lang","onLoaded","appsTitle","prototype","getAppsArray","Object","entries","map","_b","name","value","render","appsArray","Array","isArray","length","h","Host","class","hideTitle","vertical","app","index","key","href","rel","target","id","replace","url","cdn","concat","componentDidRender","remove"],"sources":["src/components/salla-apps-icons/salla-apps-icons.scss?tag=salla-apps-icons","src/components/salla-apps-icons/salla-apps-icons.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot app - Replaces app item, has replaceable props `{icon}`, `{name}`.\n */\n@Component({\n tag: 'salla-apps-icons',\n styleUrl: 'salla-apps-icons.scss',\n})\nexport class SallaAppsIcons {\n constructor() {\n this.appSlot = this.host.querySelector('[slot=\"app\"]')?.innerHTML || `<img alt={name} src={icon} />`;\n salla.onReady(() => {\n this.apps = salla.config.get('store.apps');\n });\n\n salla.lang.onLoaded(() => {\n this.appsTitle = salla.lang.get('blocks.footer.download_apps');\n });\n }\n private readonly appSlot: string;\n @Element() host: HTMLElement;\n @State() apps = salla.config.get('store.apps');\n\n /**\n * Flag to show or hide title.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * The title to display.\n */\n @Prop() appsTitle: string;\n\n /**\n * Display flag to horizontal/vertical.\n */\n @Prop() vertical: boolean;\n\n private getAppsArray() {\n return Object.entries(this.apps)\n .map(([name, value]) => ({ name, value }));\n }\n\n render() {\n const appsArray = this.getAppsArray();\n if (Array.isArray(appsArray) && !appsArray.length) {\n return;\n }\n return (\n <Host class=\"s-apps-icons\">\n {!this.hideTitle && <h3>{this.appsTitle}</h3>}\n <div class={{\"s-apps-icons-list\": true, \"vertical\": this.vertical}}>\n {appsArray.map((app, index) => (\n <a key={index} href={app.value as string} rel=\"noreferrer\" target=\"_blank\" class=\"s-apps-icons-item\" id=\"app-slot\" innerHTML={this.appSlot\n .replace(/\\{icon\\}/g, salla.url.cdn(`images/${app.name}.png`))\n .replace(/\\{name\\}/g, app.name)}>\n </a>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelector('[slot=\"app\"]')?.remove();\n }\n}\n"],"mappings":";;;mFAAA,IAAMA,kBAAoB,uB,ICQbC,eAAc,WACzB,SAAAA,EAAAC,GAAA,IAAAC,EAAAC,K,yCAYgBC,MAAMC,OAAOC,IAAI,c,0EAX/BH,KAAKI,UAAUC,EAAAL,KAAKM,KAAKC,cAAc,mBAAe,MAAAF,SAAA,SAAAA,EAAEG,YAAa,gCACrEP,MAAMQ,SAAQ,WACZV,EAAKW,KAAOT,MAAMC,OAAOC,IAAI,a,IAG/BF,MAAMU,KAAKC,UAAS,WAClBb,EAAKc,UAAYZ,MAAMU,KAAKR,IAAI,8B,IAsB5BN,EAAAiB,UAAAC,aAAA,WACN,OAAOC,OAAOC,QAAQjB,KAAKU,MACxBQ,KAAI,SAACC,G,IAACC,EAAID,EAAA,GAAEE,EAAKF,EAAA,GAAC,OAAQC,KAAIA,EAAEC,MAAKA,EAAnB,G,EAGvBxB,EAAAiB,UAAAQ,OAAA,
|
|
1
|
+
{"version":3,"names":["sallaAppsIconsCss","SallaAppsIcons","hostRef","_this","this","salla","config","get","appSlot","_a","host","querySelector","innerHTML","onReady","apps","lang","onLoaded","appsTitle","prototype","getAppsArray","Object","entries","map","_b","name","value","componentWillLoad","Promise","resolve","render","appsArray","Array","isArray","length","h","Host","class","hideTitle","vertical","app","index","key","href","rel","target","id","replace","url","cdn","concat","componentDidRender","remove"],"sources":["src/components/salla-apps-icons/salla-apps-icons.scss?tag=salla-apps-icons","src/components/salla-apps-icons/salla-apps-icons.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot app - Replaces app item, has replaceable props `{icon}`, `{name}`.\n */\n@Component({\n tag: 'salla-apps-icons',\n styleUrl: 'salla-apps-icons.scss',\n})\nexport class SallaAppsIcons {\n constructor() {\n this.appSlot = this.host.querySelector('[slot=\"app\"]')?.innerHTML || `<img alt={name} src={icon} />`;\n salla.onReady(() => {\n this.apps = salla.config.get('store.apps');\n });\n\n salla.lang.onLoaded(() => {\n this.appsTitle = salla.lang.get('blocks.footer.download_apps');\n });\n }\n private readonly appSlot: string;\n @Element() host: HTMLElement;\n @State() apps = salla.config.get('store.apps');\n\n /**\n * Flag to show or hide title.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * The title to display.\n */\n @Prop() appsTitle: string;\n\n /**\n * Display flag to horizontal/vertical.\n */\n @Prop() vertical: boolean;\n\n private getAppsArray() {\n return Object.entries(this.apps)\n .map(([name, value]) => ({ name, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const appsArray = this.getAppsArray();\n if (Array.isArray(appsArray) && !appsArray.length) {\n return;\n }\n return (\n <Host class=\"s-apps-icons\">\n {!this.hideTitle && <h3>{this.appsTitle}</h3>}\n <div class={{\"s-apps-icons-list\": true, \"vertical\": this.vertical}}>\n {appsArray.map((app, index) => (\n <a key={index} href={app.value as string} rel=\"noreferrer\" target=\"_blank\" class=\"s-apps-icons-item\" id=\"app-slot\" innerHTML={this.appSlot\n .replace(/\\{icon\\}/g, salla.url.cdn(`images/${app.name}.png`))\n .replace(/\\{name\\}/g, app.name)}>\n </a>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelector('[slot=\"app\"]')?.remove();\n }\n}\n"],"mappings":";;;mFAAA,IAAMA,kBAAoB,uB,ICQbC,eAAc,WACzB,SAAAA,EAAAC,GAAA,IAAAC,EAAAC,K,yCAYgBC,MAAMC,OAAOC,IAAI,c,0EAX/BH,KAAKI,UAAUC,EAAAL,KAAKM,KAAKC,cAAc,mBAAe,MAAAF,SAAA,SAAAA,EAAEG,YAAa,gCACrEP,MAAMQ,SAAQ,WACZV,EAAKW,KAAOT,MAAMC,OAAOC,IAAI,a,IAG/BF,MAAMU,KAAKC,UAAS,WAClBb,EAAKc,UAAYZ,MAAMU,KAAKR,IAAI,8B,IAsB5BN,EAAAiB,UAAAC,aAAA,WACN,OAAOC,OAAOC,QAAQjB,KAAKU,MACxBQ,KAAI,SAACC,G,IAACC,EAAID,EAAA,GAAEE,EAAKF,EAAA,GAAC,OAAQC,KAAIA,EAAEC,MAAKA,EAAnB,G,EAGvBxB,EAAAiB,UAAAQ,kBAAA,WACE,OAAO,IAAIC,SAAQ,SAAAC,GAAW,OAAAvB,MAAMQ,QAAQe,EAAd,G,EAGhC3B,EAAAiB,UAAAW,OAAA,eAAA1B,EAAAC,KACE,IAAM0B,EAAY1B,KAAKe,eACvB,GAAIY,MAAMC,QAAQF,KAAeA,EAAUG,OAAQ,CACjD,M,CAEF,OACEC,EAACC,KAAI,CAACC,MAAM,iBACNhC,KAAKiC,WAAaH,EAAA,UAAK9B,KAAKa,WAC9BiB,EAAA,OAAKE,MAAO,CAAC,oBAAqB,KAAME,SAAYlC,KAAKkC,WACtDR,EAAUR,KAAI,SAACiB,EAAKC,GAAK,OACvBN,EAAA,KAAGO,IAAKD,EAAOE,KAAMH,EAAId,MAAiBkB,IAAI,aAAaC,OAAO,SAASR,MAAM,oBAAoBS,GAAG,WAAWjC,UAAWT,EAAKK,QACjIsC,QAAQ,YAAazC,MAAM0C,IAAIC,IAAI,UAAAC,OAAUV,EAAIf,KAAI,UACrDsB,QAAQ,YAAaP,EAAIf,OAHJ,K,EAUpCvB,EAAAiB,UAAAgC,mBAAA,W,OACEzC,EAAAL,KAAKM,KAAKC,cAAc,mBAAe,MAAAF,SAAA,SAAAA,EAAE0C,Q,kIA3DlB,G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";import{e as email}from"./mail-25533e3f.js";var mobile='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var whatsapp='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n';var phone='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var telegram='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var sallaContactsCss=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var SallaContacts=function(){function t(t){var e=this;registerInstance(this,t);var n;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:mobile,whatsapp:whatsapp,phone:phone,telegram:telegram,email:email};this.contactSlot=((n=this.host.querySelector('[slot="contact"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){e.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){e.contactsTitle=e.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var e=t[0],n=t[1];return n!==""})).map((function(t){var e=t[0],n=t[1];return{type:e,value:n}}))};t.prototype.getContactLink=function(t){switch(t){case"phone":return"tel:".concat(this.contacts[t]);case"mobile":return"tel:".concat(this.contacts[t]);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(this.contacts[t]);case"telegram":return"https://t.me/".concat(this.contacts[t]);default:return this.contacts[t]}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.render=function(){var t=this;var e=this.getContactsArray();if(this.isHeader&&e&&e.length>0){return h(Host,{class:"s-contacts s-contacts-header"},e.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(e,n){return h("a",{href:t.getContactLink(e.type),key:n,class:"s-contacts-topnav-link"},e.type==="email"?e.value:[h("span",null,t.contactsTitle,": "),h("a",{class:"unicode",href:t.iconsList[e.type]},e.value)])})))}return h(Host,{class:"s-contacts"},!this.hideTitle&&h("h3",{class:"s-contacts-title"},this.contactsTitle),h("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},e.map((function(e,n){return h("div",{key:n,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(e.type)).replace(/\{value\}/g,e.value.toString()).replace(/\{link\}/g,t.getContactLink(e.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaContacts.style=sallaContactsCss;export{SallaContacts as salla_contacts};
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";import{e as email}from"./mail-25533e3f.js";var mobile='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var whatsapp='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n';var phone='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var telegram='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var sallaContactsCss=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var SallaContacts=function(){function t(t){var e=this;registerInstance(this,t);var n;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:mobile,whatsapp:whatsapp,phone:phone,telegram:telegram,email:email};this.contactSlot=((n=this.host.querySelector('[slot="contact"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){e.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){e.contactsTitle=e.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var e=t[0],n=t[1];return n!==""})).map((function(t){var e=t[0],n=t[1];return{type:e,value:n}}))};t.prototype.getContactLink=function(t){switch(t){case"phone":return"tel:".concat(this.contacts[t]);case"mobile":return"tel:".concat(this.contacts[t]);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(this.contacts[t]);case"telegram":return"https://t.me/".concat(this.contacts[t]);default:return this.contacts[t]}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var e=this.getContactsArray();if(this.isHeader&&e&&e.length>0){return h(Host,{class:"s-contacts s-contacts-header"},e.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(e,n){return h("a",{href:t.getContactLink(e.type),key:n,class:"s-contacts-topnav-link"},e.type==="email"?e.value:[h("span",null,t.contactsTitle,": "),h("a",{class:"unicode",href:t.iconsList[e.type]},e.value)])})))}return h(Host,{class:"s-contacts"},!this.hideTitle&&h("h3",{class:"s-contacts-title"},this.contactsTitle),h("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},e.map((function(e,n){return h("div",{key:n,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(e.type)).replace(/\{value\}/g,e.value.toString()).replace(/\{link\}/g,t.getContactLink(e.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaContacts.style=sallaContactsCss;export{SallaContacts as salla_contacts};
|
|
5
5
|
//# sourceMappingURL=salla-contacts.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaContactsCss","SallaContacts","hostRef","_this","this","salla","config","get","mobile","whatsapp","phone","telegram","email","contactSlot","_a","host","querySelector","innerHTML","concat","iconsOnly","onReady","contacts","lang","onLoaded","contactsTitle","prototype","getContactsArray","Object","entries","filter","_b","_key","value","map","type","getContactLink","url","getContactIcon","iconsList","render","contactsArray","isHeader","length","h","Host","class","contact","index","href","key","hideTitle","horizontal","id","replace","toString","componentDidRender","remove"],"sources":["src/components/salla-contacts/salla-contacts.scss?tag=salla-contacts","src/components/salla-contacts/salla-contacts.tsx"],"sourcesContent":[".unicode {\n unicode-bidi: plaintext;\n}","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\nimport mobile from '../../assets/svg/iphone.svg';\nimport whatsapp from '../../assets/svg/whatsapp2.svg';\nimport phone from '../../assets/svg/phone.svg';\nimport telegram from '../../assets/svg/paper-plane-o.svg';\nimport email from '../../assets/svg/mail.svg';\n/**\n * @slot contact - Replaces contact item, has replaceable props `{icon}`, `{value}`.\n */\n@Component({\n tag: 'salla-contacts',\n styleUrl: 'salla-contacts.scss',\n})\nexport class SallaContacts {\n constructor() {\n this.contactSlot = this.host.querySelector('[slot=\"contact\"]')?.innerHTML || `<a href={link} class=\"s-contacts-item\"><span class=\"s-contacts-icon\">{icon}</span>${!this.iconsOnly && \"<span class='unicode'>{value}</span>\"}</a>`;\n\n salla.onReady(() => {\n this.contacts = salla.config.get('store.contacts');\n });\n\n salla.lang.onLoaded(() => {\n this.contactsTitle = this.contactsTitle || salla.lang.get('blocks.footer.social');\n });\n }\n private readonly contactSlot: string;\n\n /**\n * Section title for social block of footer.\n */\n @Prop({mutable: true}) contactsTitle: string;\n\n /**\n * Flag to toggle title visibility.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * Conditional flag to check whether the content is header or not.\n */\n @Prop() isHeader: boolean;\n\n /**\n * Flag to toggle list of contents whether vertical or horizontal.\n */\n @Prop() horizontal: boolean;\n\n /**\n * Flag condition to show icon only or icon with label\n */\n @Prop() iconsOnly: boolean;\n\n\n @Element() host: HTMLElement;\n @State() contacts: any = salla.config.get('store.contacts');\n @State() iconsList: any = { mobile, whatsapp, phone, telegram, email }\n
|
|
1
|
+
{"version":3,"names":["sallaContactsCss","SallaContacts","hostRef","_this","this","salla","config","get","mobile","whatsapp","phone","telegram","email","contactSlot","_a","host","querySelector","innerHTML","concat","iconsOnly","onReady","contacts","lang","onLoaded","contactsTitle","prototype","getContactsArray","Object","entries","filter","_b","_key","value","map","type","getContactLink","url","getContactIcon","iconsList","componentWillLoad","Promise","resolve","render","contactsArray","isHeader","length","h","Host","class","contact","index","href","key","hideTitle","horizontal","id","replace","toString","componentDidRender","remove"],"sources":["src/components/salla-contacts/salla-contacts.scss?tag=salla-contacts","src/components/salla-contacts/salla-contacts.tsx"],"sourcesContent":[".unicode {\n unicode-bidi: plaintext;\n}","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\nimport mobile from '../../assets/svg/iphone.svg';\nimport whatsapp from '../../assets/svg/whatsapp2.svg';\nimport phone from '../../assets/svg/phone.svg';\nimport telegram from '../../assets/svg/paper-plane-o.svg';\nimport email from '../../assets/svg/mail.svg';\n/**\n * @slot contact - Replaces contact item, has replaceable props `{icon}`, `{value}`.\n */\n@Component({\n tag: 'salla-contacts',\n styleUrl: 'salla-contacts.scss',\n})\nexport class SallaContacts {\n constructor() {\n this.contactSlot = this.host.querySelector('[slot=\"contact\"]')?.innerHTML || `<a href={link} class=\"s-contacts-item\"><span class=\"s-contacts-icon\">{icon}</span>${!this.iconsOnly && \"<span class='unicode'>{value}</span>\"}</a>`;\n\n salla.onReady(() => {\n this.contacts = salla.config.get('store.contacts');\n });\n\n salla.lang.onLoaded(() => {\n this.contactsTitle = this.contactsTitle || salla.lang.get('blocks.footer.social');\n });\n }\n private readonly contactSlot: string;\n\n /**\n * Section title for social block of footer.\n */\n @Prop({mutable: true}) contactsTitle: string;\n\n /**\n * Flag to toggle title visibility.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * Conditional flag to check whether the content is header or not.\n */\n @Prop() isHeader: boolean;\n\n /**\n * Flag to toggle list of contents whether vertical or horizontal.\n */\n @Prop() horizontal: boolean;\n\n /**\n * Flag condition to show icon only or icon with label\n */\n @Prop() iconsOnly: boolean;\n\n\n @Element() host: HTMLElement;\n @State() contacts: any = salla.config.get('store.contacts');\n @State() iconsList: any = { mobile, whatsapp, phone, telegram, email }\n private getContactsArray() {\n return Object.entries(this.contacts)\n .filter(([_key, value]) => value !== '')\n .map(([type, value]) => ({ type, value }));\n }\n\n private getContactLink(type) {\n switch (type) {\n case 'phone':\n return `tel:${this.contacts[type]}`; \n case 'mobile':\n return `tel:${this.contacts[type]}`;\n case 'whatsapp':\n return salla.url.get('whatsapp/send');\n case 'email':\n return `mailto:${this.contacts[type]}`;\n case 'telegram':\n return `https://t.me/${this.contacts[type]}`;\n default:\n return this.contacts[type];\n }\n }\n\n private getContactIcon(type) {\n return this.iconsList[type];\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n\n render() {\n const contactsArray = this.getContactsArray();\n if (this.isHeader && contactsArray && contactsArray.length > 0) {\n return (\n <Host class=\"s-contacts s-contacts-header\">\n {contactsArray.filter((contact) => contact.type == 'phone' || contact.type == 'email').map((contact, index) => (\n <a href={this.getContactLink(contact.type)} key={index} class=\"s-contacts-topnav-link\">\n {contact.type === 'email' ? (\n contact.value\n ) : (\n [\n <span>{this.contactsTitle}: </span>,\n <a class=\"unicode\" href={this.iconsList[contact.type]}>{contact.value}</a>\n ]\n )}\n </a>\n ))}\n </Host>\n );\n }\n return (\n <Host class=\"s-contacts\">\n {!this.hideTitle && <h3 class=\"s-contacts-title\">{this.contactsTitle}</h3>}\n <div class={{\n 's-contacts-list': true,\n 's-contacts-list-horizontal': this.horizontal,\n 's-contacts-list-vertical': !this.horizontal,\n 's-contacts-list-icons-only': this.iconsOnly\n }\n }>\n {contactsArray.map((contact, index) => (\n <div key={index} id=\"contact-slot\" innerHTML={this.contactSlot\n .replace(/\\{icon\\}/g, this.getContactIcon(contact.type))\n .replace(/\\{value\\}/g, contact.value.toString())\n .replace(/\\{link\\}/g, this.getContactLink(contact.type))}>\n </div>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n // this.host.querySelectorAll('#contact-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"contact\"]')?.remove();\n }\n}\n\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";var sallaPaymentsCss=":host{display:block}";var SallaPayments=function(){function t(t){var e=this;registerInstance(this,t);var s,a,i;this.payments=salla.config.get("store.settings.payments");this.placeholderImage=salla.url.cdn("images/s-empty.png");this.withSbc=undefined;this.sbcId=undefined;this.withMadeInKsa=undefined;this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src="{image}" alt={name} /><li>');this.sbcSlot=((a=this.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');this.codSlot=((i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');salla.onReady((function(){e.payments=salla.config.get("store.settings.payments");e.placeholderImage=salla.url.cdn("images/s-empty.png")}))}t.prototype.render=function(){var t=this;return h(Host,{class:"s-payments-list"},this.withMadeInKsa&&h("li",{class:"s-payments-list-item"},h("img",{class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((function(e){return e=="cod"?h("div",{id:"cod-slot",innerHTML:t.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}):h("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(e,"_mini.png"),58,58)).replace(/\{payment\}/g,e)})})),this.withSbc&&this.sbcId&&h("div",{id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(this.sbcId))}))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,e,s;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(e=this.host.querySelector('[slot="sbc"]'))===null||e===void 0?void 0:e.remove();(s=this.host.querySelector('[slot="cod"]'))===null||s===void 0?void 0:s.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaPayments.style=sallaPaymentsCss;export{SallaPayments as salla_payments};
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";var sallaPaymentsCss=":host{display:block}";var SallaPayments=function(){function t(t){var e=this;registerInstance(this,t);var s,a,i;this.payments=salla.config.get("store.settings.payments");this.placeholderImage=salla.url.cdn("images/s-empty.png");this.withSbc=undefined;this.sbcId=undefined;this.withMadeInKsa=undefined;this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src="{image}" alt={name} /><li>');this.sbcSlot=((a=this.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');this.codSlot=((i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');salla.onReady((function(){e.payments=salla.config.get("store.settings.payments");e.placeholderImage=salla.url.cdn("images/s-empty.png")}))}t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;return h(Host,{class:"s-payments-list"},this.withMadeInKsa&&h("li",{class:"s-payments-list-item"},h("img",{class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((function(e){return e=="cod"?h("div",{id:"cod-slot",innerHTML:t.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}):h("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(e,"_mini.png"),58,58)).replace(/\{payment\}/g,e)})})),this.withSbc&&this.sbcId&&h("div",{id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(this.sbcId))}))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,e,s;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(e=this.host.querySelector('[slot="sbc"]'))===null||e===void 0?void 0:e.remove();(s=this.host.querySelector('[slot="cod"]'))===null||s===void 0?void 0:s.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaPayments.style=sallaPaymentsCss;export{SallaPayments as salla_payments};
|
|
5
5
|
//# sourceMappingURL=salla-payments.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaPaymentsCss","SallaPayments","hostRef","_this","this","salla","config","get","url","cdn","paymentSlot","_a","host","querySelector","innerHTML","concat","placeholderImage","sbcSlot","_b","codSlot","_c","onReady","payments","prototype","render","h","Host","class","withMadeInKsa","width","height","decoding","loading","alt","map","payment","id","replace","withSbc","sbcId","componentDidLoad","document","lazyLoadInstance","update","querySelectorAll","forEach","img","addEventListener","setAttribute","componentDidRender","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-payments/salla-payments.scss?tag=salla-payments","src/components/salla-payments/salla-payments.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n
|
|
1
|
+
{"version":3,"names":["sallaPaymentsCss","SallaPayments","hostRef","_this","this","salla","config","get","url","cdn","paymentSlot","_a","host","querySelector","innerHTML","concat","placeholderImage","sbcSlot","_b","codSlot","_c","onReady","payments","prototype","componentWillLoad","Promise","resolve","render","h","Host","class","withMadeInKsa","width","height","decoding","loading","alt","map","payment","id","replace","withSbc","sbcId","componentDidLoad","document","lazyLoadInstance","update","querySelectorAll","forEach","img","addEventListener","setAttribute","componentDidRender","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-payments/salla-payments.scss?tag=salla-payments","src/components/salla-payments/salla-payments.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot payment - Replaces payment item, has replaceable props `{image}`, `{name}`.\n * @slot sbc - Replaces SBC certificate item, has replaceable props `{image}`.\n * @slot cod - Replaces COD item, has replaceable props `{image}`.\n */\n@Component({\n tag: 'salla-payments',\n styleUrl: 'salla-payments.scss'\n})\n\nexport class SallaPayments {\n constructor() {\n this.paymentSlot = this.host.querySelector('[slot=\"payment\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><img class=\"lazy\" width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src=\"{image}\" alt={name} /><li>`;\n this.sbcSlot = this.host.querySelector('[slot=\"sbc\"]')?.innerHTML || `<li class=\"s-payments-list-item\"><a target=\"_blank\" href=\"{link}\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy s-payments-sbc-image\" alt=\"SBC\"/></a><li>`;\n this.codSlot = this.host.querySelector('[slot=\"cod\"]')?.innerHTML || `<li class=\"s-payments-list-item\"> <img width=\"100%\" height=\"100%\" src=\"${this.placeholderImage}\" data-src={image} class=\"lazy\" alt=\"COD\"/><li>`;\n\n salla.onReady(() => {\n this.payments = salla.config.get('store.settings.payments');\n this.placeholderImage = salla.url.cdn(`images/s-empty.png`);\n });\n }\n private readonly paymentSlot: string;\n private readonly sbcSlot: string;\n private readonly codSlot: string;\n @Element() host: HTMLElement;\n @State() payments = salla.config.get('store.settings.payments');\n @State() placeholderImage = salla.url.cdn(`images/s-empty.png`);\n /**\n * Boolean indicating whether to include the SBC (Saudi Business Council) certificate.\n */\n @Prop() withSbc: boolean;\n\n /**\n * The SBC (Saudi Business Council) certificate ID.\n */\n @Prop() sbcId: string;\n\n /**\n * Boolean indicating whether to include the \"Made in KSA\" certification.\n */\n @Prop() withMadeInKsa: boolean;\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n \n render() {\n return (\n <Host class=\"s-payments-list\">\n\n {/* Made in KSA */}\n {this.withMadeInKsa && <li class=\"s-payments-list-item\">\n <img class=\"lazy\" width=\"100%\" height=\"100%\" decoding=\"async\" loading=\"lazy\" data-src={salla.url.cdn(`images/made-in-ksa.svg`, 58, 58)} alt=\"made in KSA certified\" />\n </li>}\n\n {/* Dynamic methods */}\n {this.payments.map((payment) => (\n payment == \"cod\" ?\n <div id=\"cod-slot\" innerHTML={this.codSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/cod_mini.png`, 58, 58))}>\n </div> :\n <div id=\"payment-slot\" innerHTML={this.paymentSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/payment/${payment}_mini.png`, 58, 58))\n .replace(/\\{payment\\}/g, payment)}>\n </div>\n ))}\n\n\n {/* SBC certificate */}\n {this.withSbc && this.sbcId && <div id=\"sbc-slot\" innerHTML={this.sbcSlot\n .replace(/\\{image\\}/g, salla.url.cdn(`images/sbc.png`, 58, 58))\n .replace(/\\{link\\}/g, `https://eauthenticate.saudibusiness.gov.sa/certificate-details/${this.sbcId}`)}>\n </div>}\n </Host>\n );\n }\n componentDidLoad() {\n document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));\n // fix lazy loaded images that have 100% width and height\n this.host.querySelectorAll('.lazy').forEach((img) => {\n img.addEventListener('load', () => {\n img.setAttribute('width', \"100%\");\n img.setAttribute('height', \"100%\");\n });\n });\n }\n componentDidRender() {\n this.host.querySelectorAll('#payment-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#sbc-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelectorAll('#cod-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"payment\"]')?.remove();\n this.host.querySelector('[slot=\"sbc\"]')?.remove();\n this.host.querySelector('[slot=\"cod\"]')?.remove();\n }\n}\n"],"mappings":";;;mFAAA,IAAMA,iBAAmB,uB,ICWZC,cAAa,WACxB,SAAAA,EAAAC,GAAA,IAAAC,EAAAC,K,iDAcoBC,MAAMC,OAAOC,IAAI,2B,sBACTF,MAAMG,IAAIC,IAAI,sB,yEAdxCL,KAAKM,cAAcC,EAAAP,KAAKQ,KAAKC,cAAc,uBAAmB,MAAAF,SAAA,SAAAA,EAAEG,YAAa,sFAAAC,OAAsFX,KAAKY,iBAAgB,0CACxLZ,KAAKa,UAAUC,EAAAd,KAAKQ,KAAKC,cAAc,mBAAe,MAAAK,SAAA,SAAAA,EAAEJ,YAAa,2GAAAC,OAA2GX,KAAKY,iBAAgB,4EACrMZ,KAAKe,UAAUC,EAAAhB,KAAKQ,KAAKC,cAAc,mBAAe,MAAAO,SAAA,SAAAA,EAAEN,YAAa,0EAAAC,OAA0EX,KAAKY,iBAAgB,mDAEpKX,MAAMgB,SAAQ,WACZlB,EAAKmB,SAAWjB,MAAMC,OAAOC,IAAI,2BACjCJ,EAAKa,iBAAmBX,MAAMG,IAAIC,IAAI,qB,IAwB1CR,EAAAsB,UAAAC,kBAAA,WACE,OAAO,IAAIC,SAAQ,SAAAC,GAAW,OAAArB,MAAMgB,QAAQK,EAAd,G,EAGhCzB,EAAAsB,UAAAI,OAAA,eAAAxB,EAAAC,KACE,OACEwB,EAACC,KAAI,CAACC,MAAM,mBAGT1B,KAAK2B,eAAiBH,EAAA,MAAIE,MAAM,wBAC/BF,EAAA,OAAKE,MAAM,OAAOE,MAAM,OAAOC,OAAO,OAAOC,SAAS,QAAQC,QAAQ,OAAM,WAAW9B,MAAMG,IAAIC,IAAI,yBAA0B,GAAI,IAAK2B,IAAI,2BAI7IhC,KAAKkB,SAASe,KAAI,SAACC,GAAO,OACzBA,GAAW,MACTV,EAAA,OAAKW,GAAG,WAAWzB,UAAWX,EAAKgB,QAChCqB,QAAQ,aAAcnC,MAAMG,IAAIC,IAAI,8BAA+B,GAAI,OAE1EmB,EAAA,OAAKW,GAAG,eAAezB,UAAWX,EAAKO,YACpC8B,QAAQ,aAAcnC,MAAMG,IAAIC,IAAI,kBAAAM,OAAkBuB,EAAO,aAAa,GAAI,KAC9EE,QAAQ,eAAgBF,IAPJ,IAa1BlC,KAAKqC,SAAWrC,KAAKsC,OAASd,EAAA,OAAKW,GAAG,WAAWzB,UAAWV,KAAKa,QAC/DuB,QAAQ,aAAcnC,MAAMG,IAAIC,IAAI,iBAAkB,GAAI,KAC1D+B,QAAQ,YAAa,kEAAAzB,OAAkEX,KAAKsC,U,EAKrGzC,EAAAsB,UAAAoB,iBAAA,W,OACEhC,EAAAiC,SAASC,oBAAgB,MAAAlC,SAAA,SAAAA,EAAEmC,OAAO1C,KAAKQ,KAAKmC,iBAAiB,UAE7D3C,KAAKQ,KAAKmC,iBAAiB,SAASC,SAAQ,SAACC,GAC3CA,EAAIC,iBAAiB,QAAQ,WAC3BD,EAAIE,aAAa,QAAS,QAC1BF,EAAIE,aAAa,SAAU,O,QAIjClD,EAAAsB,UAAA6B,mBAAA,W,UACEhD,KAAKQ,KAAKmC,iBAAiB,iBAAiBC,SAAQ,SAAAK,GAAM,OAAAA,EAAGC,YAAYD,EAAGE,WAAlB,IAC1DnD,KAAKQ,KAAKmC,iBAAiB,aAAaC,SAAQ,SAAAK,GAAM,OAAAA,EAAGC,YAAYD,EAAGE,WAAlB,IACtDnD,KAAKQ,KAAKmC,iBAAiB,aAAaC,SAAQ,SAAAK,GAAM,OAAAA,EAAGC,YAAYD,EAAGE,WAAlB,KACtD5C,EAAAP,KAAKQ,KAAKC,cAAc,uBAAmB,MAAAF,SAAA,SAAAA,EAAE6C,UAC7CtC,EAAAd,KAAKQ,KAAKC,cAAc,mBAAe,MAAAK,SAAA,SAAAA,EAAEsC,UACzCpC,EAAAhB,KAAKQ,KAAKC,cAAc,mBAAe,MAAAO,SAAA,SAAAA,EAAEoC,Q,kIAlFnB,G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";import{t as twitter,f as facebook}from"./twitter-4aa505e4.js";var instagram='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n';var youtube='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n';var snapchat='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n';var tiktok='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n';var sallaSocialCss=":host{display:block}";var SallaSocial=function(){function c(c){var l=this;registerInstance(this,c);var t;this.links=salla.config.get("store.social");this.iconsList={instagram:instagram,twitter:twitter,facebook:facebook,youtube:youtube,snapchat:snapchat,tiktok:tiktok};this.socialSlot=((t=this.host.querySelector('[slot="social"]'))===null||t===void 0?void 0:t.innerHTML)||'<li class="s-social-link"><a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a></li>';salla.lang.onLoaded((function(){l.links=salla.config.get("store.social")}))}c.prototype.getLinksArray=function(){return Object.entries(this.links).filter((function(c){var l=c[0],t=c[1];return!!t&&l!=="whatsapp"})).map((function(c){var l=c[0],t=c[1];return{type:l,value:t}}))};c.prototype.render=function(){var c=this;var l=this.getLinksArray();return h(Host,{class:"s-social-list"},l.map((function(l){return h("div",{id:"social-slot",innerHTML:c.socialSlot.replace(/\{icon\}/g,c.iconsList[l.type]).replace(/\{type\}/g,l.type).replace(/\{link\}/g,l.value.toString())})})))};c.prototype.componentDidRender=function(){var c;this.host.querySelectorAll("#social-slot").forEach((function(c){return c.replaceWith(c.firstChild)}));(c=this.host.querySelector('[slot="social"]'))===null||c===void 0?void 0:c.remove()};Object.defineProperty(c.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return c}();SallaSocial.style=sallaSocialCss;export{SallaSocial as salla_social};
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-79837019.js";import{t as twitter,f as facebook}from"./twitter-4aa505e4.js";var instagram='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n';var youtube='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n';var snapchat='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n';var tiktok='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n';var sallaSocialCss=":host{display:block}";var SallaSocial=function(){function c(c){var l=this;registerInstance(this,c);var t;this.links=salla.config.get("store.social");this.iconsList={instagram:instagram,twitter:twitter,facebook:facebook,youtube:youtube,snapchat:snapchat,tiktok:tiktok};this.socialSlot=((t=this.host.querySelector('[slot="social"]'))===null||t===void 0?void 0:t.innerHTML)||'<li class="s-social-link"><a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a></li>';salla.lang.onLoaded((function(){l.links=salla.config.get("store.social")}))}c.prototype.getLinksArray=function(){return Object.entries(this.links).filter((function(c){var l=c[0],t=c[1];return!!t&&l!=="whatsapp"})).map((function(c){var l=c[0],t=c[1];return{type:l,value:t}}))};c.prototype.componentWillLoad=function(){return new Promise((function(c){return salla.onReady(c)}))};c.prototype.render=function(){var c=this;var l=this.getLinksArray();return h(Host,{class:"s-social-list"},l.map((function(l){return h("div",{id:"social-slot",innerHTML:c.socialSlot.replace(/\{icon\}/g,c.iconsList[l.type]).replace(/\{type\}/g,l.type).replace(/\{link\}/g,l.value.toString())})})))};c.prototype.componentDidRender=function(){var c;this.host.querySelectorAll("#social-slot").forEach((function(c){return c.replaceWith(c.firstChild)}));(c=this.host.querySelector('[slot="social"]'))===null||c===void 0?void 0:c.remove()};Object.defineProperty(c.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return c}();SallaSocial.style=sallaSocialCss;export{SallaSocial as salla_social};
|
|
5
5
|
//# sourceMappingURL=salla-social.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sallaSocialCss","SallaSocial","hostRef","_this","this","salla","config","get","instagram","twitter","facebook","youtube","snapchat","tiktok","socialSlot","_a","host","querySelector","innerHTML","lang","onLoaded","links","prototype","getLinksArray","Object","entries","filter","_b","key","value","map","type","render","linksArray","h","Host","class","link","id","replace","iconsList","toString","componentDidRender","querySelectorAll","forEach","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-social/salla-social.scss?tag=salla-social","src/components/salla-social/salla-social.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, State, h, Element } from '@stencil/core';\nimport instagram from '../../assets/svg/instagram.svg';\nimport twitter from '../../assets/svg/twitter.svg';\nimport facebook from '../../assets/svg/facebook.svg';\nimport youtube from '../../assets/svg/youtube.svg';\nimport snapchat from '../../assets/svg/snapchat.svg';\nimport tiktok from '../../assets/svg/tiktok.svg';\n\n@Component({\n tag: 'salla-social',\n styleUrl: 'salla-social.scss',\n})\nexport class SallaSocial {\n constructor() {\n this.socialSlot = this.host.querySelector('[slot=\"social\"]')?.innerHTML ||\n `<li class=\"s-social-link\"><a href={link} rel=\"noopener\" target=\"_blank\" title={type} aria-label={type}><span class=\"s-social-icon\">{icon}</span></a></li>`;\n salla.lang.onLoaded(() => {\n this.links = salla.config.get('store.social');\n });\n }\n\n private readonly socialSlot: string;\n @State() links = salla.config.get('store.social');\n @Element() host: HTMLElement;\n @State() iconsList: any = { instagram, twitter, facebook, youtube, snapchat, tiktok }\n\n
|
|
1
|
+
{"version":3,"names":["sallaSocialCss","SallaSocial","hostRef","_this","this","salla","config","get","instagram","twitter","facebook","youtube","snapchat","tiktok","socialSlot","_a","host","querySelector","innerHTML","lang","onLoaded","links","prototype","getLinksArray","Object","entries","filter","_b","key","value","map","type","componentWillLoad","Promise","resolve","onReady","render","linksArray","h","Host","class","link","id","replace","iconsList","toString","componentDidRender","querySelectorAll","forEach","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-social/salla-social.scss?tag=salla-social","src/components/salla-social/salla-social.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, State, h, Element } from '@stencil/core';\nimport instagram from '../../assets/svg/instagram.svg';\nimport twitter from '../../assets/svg/twitter.svg';\nimport facebook from '../../assets/svg/facebook.svg';\nimport youtube from '../../assets/svg/youtube.svg';\nimport snapchat from '../../assets/svg/snapchat.svg';\nimport tiktok from '../../assets/svg/tiktok.svg';\n\n@Component({\n tag: 'salla-social',\n styleUrl: 'salla-social.scss',\n})\nexport class SallaSocial {\n constructor() {\n this.socialSlot = this.host.querySelector('[slot=\"social\"]')?.innerHTML ||\n `<li class=\"s-social-link\"><a href={link} rel=\"noopener\" target=\"_blank\" title={type} aria-label={type}><span class=\"s-social-icon\">{icon}</span></a></li>`;\n salla.lang.onLoaded(() => {\n this.links = salla.config.get('store.social');\n });\n }\n\n private readonly socialSlot: string;\n @State() links = salla.config.get('store.social');\n @Element() host: HTMLElement;\n @State() iconsList: any = { instagram, twitter, facebook, youtube, snapchat, tiktok }\n\n private getLinksArray() {\n return Object.entries(this.links)\n .filter(([key, value]) => !!value && key !== 'whatsapp')\n .map(([type, value]) => ({ type, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const linksArray = this.getLinksArray();\n return (\n <Host class=\"s-social-list\">\n {linksArray.map((link) => (\n <div id=\"social-slot\" innerHTML={this.socialSlot\n .replace(/\\{icon\\}/g, this.iconsList[link.type])\n .replace(/\\{type\\}/g, link.type)\n .replace(/\\{link\\}/g, link.value.toString())}>\n </div>\n ))}\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelectorAll('#social-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"social\"]')?.remove();\n }\n}\n"],"mappings":";;;k2QAAA,IAAMA,eAAiB,uB,ICYVC,YAAW,WACtB,SAAAA,EAAAC,GAAA,IAAAC,EAAAC,K,0CASiBC,MAAMC,OAAOC,IAAI,gB,eAER,CAAEC,UAASA,UAAEC,QAAOA,QAAEC,SAAQA,SAAEC,QAAOA,QAAEC,SAAQA,SAAEC,OAAMA,QAVjFT,KAAKU,aAAaC,EAAAX,KAAKY,KAAKC,cAAc,sBAAkB,MAAAF,SAAA,SAAAA,EAAEG,YAC5D,4JACFb,MAAMc,KAAKC,UAAS,WAClBjB,EAAKkB,MAAQhB,MAAMC,OAAOC,IAAI,e,IAS1BN,EAAAqB,UAAAC,cAAA,WACN,OAAOC,OAAOC,QAAQrB,KAAKiB,OACxBK,QAAO,SAACC,G,IAACC,EAAGD,EAAA,GAAEE,EAAKF,EAAA,GAAM,QAAEE,GAASD,IAAQ,UAAnB,IACzBE,KAAI,SAACH,G,IAACI,EAAIJ,EAAA,GAAEE,EAAKF,EAAA,GAAC,OAAQI,KAAIA,EAAEF,MAAKA,EAAnB,G,EAGvB5B,EAAAqB,UAAAU,kBAAA,WACE,OAAO,IAAIC,SAAQ,SAAAC,GAAW,OAAA7B,MAAM8B,QAAQD,EAAd,G,EAGhCjC,EAAAqB,UAAAc,OAAA,eAAAjC,EAAAC,KACE,IAAMiC,EAAajC,KAAKmB,gBACxB,OACEe,EAACC,KAAI,CAACC,MAAM,iBACTH,EAAWP,KAAI,SAACW,GAAI,OACnBH,EAAA,OAAKI,GAAG,cAAcxB,UAAWf,EAAKW,WACnC6B,QAAQ,YAAaxC,EAAKyC,UAAUH,EAAKV,OACzCY,QAAQ,YAAaF,EAAKV,MAC1BY,QAAQ,YAAaF,EAAKZ,MAAMgB,aAJhB,I,EAU3B5C,EAAAqB,UAAAwB,mBAAA,W,MACE1C,KAAKY,KAAK+B,iBAAiB,gBAAgBC,SAAQ,SAAAC,GAAM,OAAAA,EAAGC,YAAYD,EAAGE,WAAlB,KACzDpC,EAAAX,KAAKY,KAAKC,cAAc,sBAAkB,MAAAF,SAAA,SAAAA,EAAEqC,Q,kIAxCxB,G"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
System.register(["./p-a0dabf35.system.js","./p-8f7b9e36.system.js","./p-9e0b1704.system.js"],(function(t){"use strict";var e,s,i,r,n;return{setters:[function(t){e=t.r;s=t.h;i=t.g},function(t){r=t.a},function(t){n=t.H}],execute:function(){var a=":host{display:block}";var o=t("salla_advertisement",function(){function t(t){var s=this;e(this,t);var i;this.position=undefined;this.advertisements=undefined;this.advertIcon=undefined;this.currentSlug=salla.config.get("page.slug");salla.onReady((function(){s.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||'<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n '}t.prototype.isNotVisible=function(t){return!!salla.storage.get("statusAd-".concat(t.id))};t.prototype.setCanDisplayFlag=function(t,e){if(!e){salla.storage.set("statusAd-".concat(t.id),"dismissed");r({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}};t.prototype.render=function(){var t=this;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((function(e){return s("div",{class:{"s-hidden":t.isNotVisible(e),"s-advertisement":true},"data-id":e.id,style:{"background-color":e.colors.bg,color:e.colors.text}},s("div",{id:"adv-slot",innerHTML:t.advSlot.replace("{iconElem}",'<i class="s-advertisement-content-icon '.concat(e.icon,'"></i>')).replace("{urlElem}",e.url?'<a href="'.concat(e.url,'" target="').concat(e.target,'">').concat(e.description,"</a>"):e.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",e.icon).replace("{url}",e.url).replace("{target}",e.target).replace("{description}",e.description).replace("{bg_color}",e.colors.bg).replace("{text_color}",e.colors.text)}))}))};t.prototype.componentWillLoad=function(){var t=this;return n.onSallaReadyPromise((function(e){return salla.api.advertisement.fetch(t.currentSlug).then((function(s){var i=s.data;if(Array.isArray(i)&&i.length>0){for(var r=0,n=i;r<n.length;r++){var a=n[r];if(!salla.storage.get("statusAd-".concat(a.id))){t.advertisements=[a];break}}}e()}))}))};t.prototype.componentDidRender=function(){var t=this;var e;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((function(){var e=t.host.querySelector(".s-advertisement-action");if(e){e.addEventListener("click",(function(){return t.setCanDisplayFlag(t.advertisements[0],false)}))}}));this.host.querySelectorAll("#adv-slot").forEach((function(t){return t===null||t===void 0?void 0:t.replaceWith(t===null||t===void 0?void 0:t.firstChild)}));(e=this.host.querySelector('[slot="adv"]'))===null||e===void 0?void 0:e.remove();r({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());o.style=a}}}));
|
|
5
|
+
//# sourceMappingURL=p-056eaae7.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaAdvertisementCss","SallaAdvertisement","exports","class_1","hostRef","_this","this","salla","config","get","onReady","currentSlug","advSlot","_a","host","querySelector","innerHTML","prototype","isNotVisible","advert","storage","concat","id","setCanDisplayFlag","flag","set","AnimeJS","targets","opacity","duration","height","clientHeight","easing","render","Array","isArray","advertisements","length","map","advertisement","h","class","style","colors","bg","color","text","replace","icon","url","target","description","componentWillLoad","Helper","onSallaReadyPromise","resolve","api","fetch","then","resp","ads","data","_i","ads_1","ad","componentDidRender","setTimeout","closeBtn","addEventListener","querySelectorAll","forEach","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-advertisement/salla-advertisement.scss?tag=salla-advertisement","src/components/salla-advertisement/salla-advertisement.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, State, Element, h } from '@stencil/core';\nimport { Advertisement } from './interfaces';\nimport AnimeJS from 'animejs';\nimport Helper from '../../Helpers/Helper';\n/**\n * @name SallaAdvertisement\n * @description A StencilJS component for handling and displaying advertisements in different pages of salla applications.\n * @tag salla-advertisement\n */\n\n/**\n * @slot adv - Replaces the entire advertisement, has replaceable props `{icon}`, `{url}`, `{target}`, `{description}`, `{bg_color}`, `{text_color}`.\n * */\n@Component({\n tag: 'salla-advertisement',\n styleUrl: 'salla-advertisement.scss',\n})\nexport class SallaAdvertisement {\n /**\n * Constructor for initializing the component.\n */\n constructor() {\n salla.onReady(() => {\n this.currentSlug = salla.config.get(\"page.slug\");\n })\n\n this.advSlot = this.host.querySelector('[slot=\"adv\"]')?.innerHTML || `<div class=\"s-advertisement-content\"><h2 class=\"s-advertisement-content-main\">{iconElem}{urlElem}</h2>{closeElem}</div>\n `;\n }\n private readonly advSlot: string;\n // State properties for managing component state\n @State() position: string;\n @State() advertisements: Advertisement[];\n @State() advertIcon: string;\n @State() currentSlug: string = salla.config.get(\"page.slug\");\n\n @Element() private host: HTMLElement;\n\n\n /**\n * Checks whether an advertisement is marked as not visible/dismissed.\n * @param advert - The advertisement to check.\n * @returns True if the advertisement is not visible, false otherwise.\n */\n private isNotVisible(advert: Advertisement): boolean {\n return !!salla.storage.get(`statusAd-${advert.id}`)\n }\n\n /**\n * Sets a flag to control the visibility of an advertisement and triggers an animation when hiding it.\n * @param advert - The advertisement to update.\n * @param flag - The flag indicating whether to display or hide the advertisement.\n */\n private setCanDisplayFlag(advert: Advertisement, flag: boolean): void {\n if (!flag) {\n // Set the statusAd flag to 'dismissed'\n salla.storage.set(`statusAd-${advert.id}`, 'dismissed');\n // Trigger an animation to hide the advertisement\n AnimeJS({\n targets: this.host,\n opacity: [1, 0],\n duration: 300,\n height: [this.host.clientHeight, 0],\n easing: 'easeInOutQuad',\n });\n }\n }\n\n /**\n * Renders the advertisements based on the fetched data and visibility status.\n * @returns JSX for rendering advertisements.\n */\n render() {\n if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {\n return;\n }\n return this.advertisements.map((advertisement: Advertisement) => {\n return <div class={{ \"s-hidden\": this.isNotVisible(advertisement), 's-advertisement': true }} data-id={advertisement.id}\n style={{ \"background-color\": advertisement.colors.bg, \"color\": advertisement.colors.text }}>\n <div id=\"adv-slot\" innerHTML={\n this.advSlot\n // Replace the props with the advertisement data\n // !Note: The props with the 'Elem' suffix are for internal use only.\n .replace(\"{iconElem}\", `<i class=\"s-advertisement-content-icon ${advertisement.icon}\"></i>`)\n .replace(\"{urlElem}\", advertisement.url ? `<a href=\"${advertisement.url}\" target=\"${advertisement.target}\">${advertisement.description}</a>` : advertisement.description)\n .replace(\"{closeElem}\", `<button class=\"s-advertisement-action\" aria-label=\"close-alert\"><i class=\"sicon-cancel\"></i></button>`)\n .replace('{icon}', advertisement.icon)\n .replace('{url}', advertisement.url)\n .replace('{target}', advertisement.target)\n .replace('{description}', advertisement.description)\n .replace('{bg_color}', advertisement.colors.bg)\n .replace('{text_color}', advertisement.colors.text)\n }></div>\n </div>\n }\n );\n }\n\n /**\n * Lifecycle method that fetches advertisements before the component is loaded.\n */\n componentWillLoad() {\n // Fetch advertisements based on the current page\n return Helper.onSallaReadyPromise((resolve) => {\n return salla.api.advertisement.fetch(this.currentSlug)\n .then(resp => {\n let ads = resp.data;\n if (Array.isArray(ads) && ads.length > 0) {\n for (const ad of ads) {\n if (!salla.storage.get(`statusAd-${ad.id}`)) {\n this.advertisements = [ad];\n break;\n }\n }\n }\n resolve();\n })\n });\n }\n componentDidRender() {\n if ((Array.isArray(this.advertisements) && !this.advertisements.length) || !this.advertisements) {\n return;\n }\n // Add event listener for the close button\n setTimeout(() => {\n let closeBtn = this.host.querySelector('.s-advertisement-action');\n if (closeBtn) {\n closeBtn.addEventListener('click', () => this.setCanDisplayFlag(this.advertisements[0], false));\n }\n });\n\n // Reduce Dom size by removing the slot element\n this.host.querySelectorAll('#adv-slot').forEach(el => el?.replaceWith(el?.firstChild));\n this.host.querySelector('[slot=\"adv\"]')?.remove();\n\n // Trigger an animation to show the advertisement\n AnimeJS({\n targets: this.host,\n opacity: [0, 1],\n duration: 300,\n height: [0, this.host.clientHeight],\n easing: 'easeInOutQuad',\n });\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as c,h as l,H as t,g as s}from"./p-fafedb13.js";import{t as
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
import{r as c,h as l,H as t,g as s}from"./p-fafedb13.js";import{t as o,f as i}from"./p-8ef03645.js";const n=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>instagram</title>\n<path d="M23 32h-14c-4.971 0-9-4.029-9-9v0-14c0-4.971 4.029-9 9-9v0h14c4.971 0 9 4.029 9 9v0 14c0 4.971-4.029 9-9 9v0zM9 2c-3.866 0-7 3.134-7 7v0 14c0 3.866 3.134 7 7 7v0h14c3.866 0 7-3.134 7-7v0-14c0-3.866-3.134-7-7-7v0zM16 24c-4.418 0-8-3.582-8-8s3.582-8 8-8c4.418 0 8 3.582 8 8v0c0 4.418-3.582 8-8 8v0zM16 10c-3.314 0-6 2.686-6 6s2.686 6 6 6c3.314 0 6-2.686 6-6v0c0-3.314-2.686-6-6-6v0zM25 9c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2v0c0 1.105-0.895 2-2 2v0zM25 7v0z"></path>\n</svg>\n`;const e=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>youtube</title>\n<path d="M16 28c-3.666 0-8.376-0.056-10.29-0.162-0.113 0.010-0.244 0.016-0.376 0.016-1.676 0-3.139-0.91-3.922-2.264l-0.012-0.022c-0.97-1.6-1.4-4.248-1.4-8.558s0.436-6.962 1.412-8.6c0.782-1.36 2.227-2.262 3.883-2.262 0.148 0 0.293 0.007 0.437 0.021l-0.018-0.001c1.872-0.124 6.544-0.168 10.286-0.168s8.4 0.044 10.292 0.168c0.124-0.012 0.267-0.019 0.412-0.019 1.656 0 3.101 0.905 3.866 2.247l0.012 0.022c0.982 1.624 1.418 4.27 1.418 8.582 0 4.338-0.438 6.982-1.422 8.6-0.789 1.364-2.241 2.268-3.904 2.268-0.133 0-0.265-0.006-0.395-0.017l0.017 0.001c-1.926 0.092-6.632 0.148-10.296 0.148zM16 8c-3.712 0-8.334 0.042-10.168 0.164-1.688 0.094-2.14 0.306-2.702 1.268-0.756 1.81-1.195 3.913-1.195 6.119 0 0.51 0.024 1.015 0.069 1.513l-0.005-0.064c-0.042 0.435-0.065 0.941-0.065 1.453 0 2.198 0.438 4.294 1.231 6.205l-0.039-0.107c0.566 0.968 1.022 1.184 2.708 1.296 3.29 0.184 17.022 0.184 20.34 0 1.678-0.11 2.132-0.326 2.684-1.28 0.764-1.803 1.208-3.899 1.208-6.1 0-0.513-0.024-1.020-0.071-1.52l0.005 0.064c0.042-0.436 0.065-0.943 0.065-1.455 0-2.203-0.439-4.303-1.235-6.218l0.040 0.107v-0.016c-0.554-0.958-1-1.17-2.684-1.264-1.862-0.122-6.644-0.164-10.186-0.164zM13 23c-0.552 0-1-0.448-1-1v0-10c0 0 0 0 0 0 0-0.552 0.448-1 1-1 0.196 0 0.38 0.057 0.534 0.154l-0.004-0.002 8 5c0.284 0.18 0.47 0.492 0.47 0.848s-0.186 0.668-0.466 0.846l-0.004 0.002-8 5c-0.15 0.095-0.334 0.152-0.53 0.152 0 0 0 0 0 0v0zM14 13.8v6.4l5.114-3.2z"></path>\n</svg>\n`;const a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>snapchat</title>\n<path d="M16.186 30h-0.266c-1.843-0.023-3.525-0.693-4.834-1.792l0.012 0.010c-0.476-0.405-1.043-0.72-1.665-0.909l-0.033-0.009c-0.287-0.044-0.617-0.069-0.954-0.069-0.492 0-0.972 0.053-1.434 0.155l0.044-0.008c-0.261 0.061-0.564 0.102-0.875 0.114l-0.009 0c-0.017 0.001-0.036 0.001-0.056 0.001-0.811 0-1.495-0.545-1.705-1.288l-0.003-0.012c-0.076-0.26-0.132-0.506-0.186-0.746-0.961-0.157-1.822-0.412-2.633-0.76l0.073 0.028c-0.667-0.259-1.199-0.745-1.509-1.362l-0.007-0.016c-0.082-0.189-0.135-0.409-0.146-0.64l-0-0.004c-0.002-0.031-0.003-0.067-0.003-0.103 0-0.841 0.614-1.538 1.417-1.668l0.010-0.001c0.822-0.141 1.555-0.438 2.198-0.859l-0.022 0.013c0.611-0.405 1.138-0.872 1.591-1.404l0.009-0.010c0.526-0.595 0.98-1.273 1.337-2.007l0.023-0.053c0.060-0.102 0.107-0.22 0.135-0.346l0.001-0.008c-0.092-0.020-0.73-0.222-0.972-0.298s-0.374-0.12-0.506-0.17c-0.546-0.205-1.016-0.487-1.424-0.839l0.006 0.005c-0.471-0.388-0.768-0.971-0.768-1.624 0-0.126 0.011-0.249 0.032-0.369l-0.002 0.013c0.143-0.644 0.551-1.172 1.1-1.474l0.011-0.006c0.389-0.241 0.861-0.384 1.366-0.384 0.347 0 0.678 0.067 0.982 0.19l-0.018-0.006c0.128 0.060 0.242 0.106 0.344 0.142-0.082-0.573-0.129-1.235-0.129-1.908 0-1.482 0.227-2.91 0.648-4.253l-0.027 0.101c0.512-1.142 1.207-2.114 2.056-2.925l0.004-0.003c0.7-0.664 1.516-1.214 2.413-1.616l0.055-0.022c1.128-0.5 2.444-0.794 3.828-0.8h0.592c1.386 0.007 2.701 0.301 3.893 0.825l-0.063-0.025c0.956 0.42 1.777 0.967 2.485 1.632l-0.005-0.004c0.855 0.815 1.55 1.789 2.039 2.876l0.023 0.058c0.396 1.237 0.625 2.659 0.625 4.135 0 0.658-0.045 1.304-0.133 1.938l0.008-0.073 0.172-0.076c0.303-0.16 0.661-0.253 1.042-0.253 0.374 0 0.728 0.091 1.039 0.251l-0.013-0.006c0.886 0.274 1.528 1.063 1.582 2.008l0 0.006c-0.001 0.602-0.25 1.146-0.65 1.536l-0 0c-0.429 0.408-0.945 0.73-1.516 0.935l-0.030 0.009c-0.144 0.056-0.316 0.112-0.504 0.17-0.367 0.103-0.686 0.235-0.984 0.398l0.024-0.012c0.018 0.030 0.042 0.094 0.086 0.18 0.963 2.174 2.834 3.796 5.118 4.4l0.054 0.012c0.814 0.133 1.427 0.83 1.427 1.671 0 0.036-0.001 0.072-0.003 0.108l0-0.005c-0.012 0.241-0.070 0.465-0.165 0.669l0.005-0.011c-0.319 0.624-0.847 1.103-1.489 1.352l-0.019 0.006c-0.739 0.323-1.6 0.578-2.497 0.724l-0.063 0.008c-0.056 0.264-0.112 0.496-0.186 0.742-0.215 0.747-0.893 1.284-1.696 1.284-0.011 0-0.021-0-0.032-0l0.002 0c-0.328-0.004-0.644-0.042-0.949-0.11l0.031 0.006c-0.404-0.090-0.869-0.142-1.345-0.142-0.353 0-0.7 0.029-1.038 0.083l0.037-0.005c-0.653 0.195-1.218 0.508-1.699 0.917l0.007-0.005c-1.275 1.065-2.916 1.731-4.71 1.788l-0.012 0zM8.444 25.218c0.457 0.001 0.904 0.041 1.339 0.117l-0.047-0.007c0.966 0.232 1.808 0.664 2.516 1.252l-0.010-0.008c0.96 0.829 2.199 1.357 3.56 1.427l0.014 0.001h0.37c1.373-0.070 2.61-0.597 3.576-1.43l-0.008 0.006c0.701-0.583 1.546-1.016 2.474-1.239l0.042-0.009c0.394-0.063 0.849-0.1 1.312-0.1 0.615 0 1.216 0.064 1.795 0.186l-0.057-0.010c0.105 0.023 0.238 0.045 0.372 0.059l0.016 0.001c0.042-0.162 0.076-0.314 0.11-0.47 0.059-0.339 0.156-0.641 0.287-0.924l-0.009 0.023 0.234-0.44 0.492-0.078c0.99-0.119 1.892-0.359 2.738-0.705l-0.070 0.025c0.086-0.040 0.158-0.076 0.216-0.11-2.748-0.86-4.933-2.816-6.081-5.342l-0.025-0.062c-0.184-0.31-0.294-0.684-0.294-1.083 0-0.27 0.050-0.528 0.14-0.765l-0.005 0.015c0.492-0.783 1.284-1.339 2.212-1.507l0.020-0.003c0.14-0.044 0.27-0.084 0.376-0.126 0.327-0.108 0.609-0.272 0.849-0.482l-0.003 0.002c0.074-0.106 0-0.2-0.216-0.284-0.094-0.041-0.203-0.065-0.318-0.066h-0c-0.529 0.242-1.142 0.411-1.786 0.474l-0.024 0.002c-0.313-0-0.612-0.064-0.883-0.18l0.015 0.006-0.628-0.28 0.072-1.272c0.093-0.623 0.146-1.342 0.146-2.074 0-1.269-0.16-2.501-0.46-3.677l0.022 0.103c-0.396-0.896-0.936-1.659-1.598-2.296l-0.002-0.002c-0.541-0.508-1.172-0.928-1.865-1.233l-0.043-0.017c-0.895-0.396-1.939-0.629-3.036-0.634h-0.002l-0.218-1v1h-0.348c-1.105 0.003-2.155 0.237-3.106 0.656l0.050-0.020c-0.733 0.322-1.361 0.742-1.903 1.253l0.003-0.003c-0.663 0.638-1.203 1.398-1.582 2.247l-0.018 0.045c-0.279 1.065-0.44 2.287-0.44 3.547 0 0.704 0.050 1.395 0.147 2.072l-0.009-0.078 0.080 1.372-0.618 0.284c-0.31 0.108-0.666 0.17-1.038 0.17-0.6 0-1.163-0.163-1.645-0.446l0.015 0.008c-0.019-0.001-0.041-0.002-0.064-0.002-0.154 0-0.299 0.039-0.425 0.109l0.005-0.002c-0.063 0.032-0.115 0.078-0.153 0.135l-0.001 0.001c0.258 0.244 0.567 0.435 0.91 0.556l0.018 0.006c0.094 0.036 0.2 0.070 0.32 0.108 0.971 0.167 1.784 0.732 2.282 1.516l0.008 0.014c0.087 0.225 0.137 0.486 0.137 0.758 0 0.403-0.11 0.781-0.303 1.104l0.005-0.010c-0.459 0.983-1.016 1.829-1.677 2.582l0.011-0.012c-0.588 0.687-1.26 1.279-2.004 1.768l-0.036 0.022c-0.689 0.451-1.49 0.805-2.346 1.017l-0.054 0.011c0.060 0.034 0.132 0.072 0.218 0.112 0.776 0.322 1.678 0.561 2.618 0.675l0.050 0.005 0.498 0.078 0.234 0.446c0.116 0.255 0.209 0.553 0.265 0.863l0.003 0.023c0.038 0.164 0.072 0.328 0.118 0.496 0.12-0.014 0.242-0.042 0.378-0.068 0.528-0.12 1.138-0.192 1.762-0.2l0.006-0zM30.244 22.892v0z"></path>\n</svg>\n`;const v=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tiktok</title>\n<path d="M29.046 7.029c-3.359 0-6.092-2.733-6.092-6.092 0-0.518-0.42-0.938-0.938-0.938h-5.021c-0.518 0-0.938 0.42-0.938 0.938v20.585c0 1.975-1.606 3.581-3.581 3.581s-3.581-1.606-3.581-3.581c0-1.975 1.606-3.581 3.581-3.581 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938-5.777 0-10.477 4.7-10.477 10.477s4.7 10.477 10.477 10.477c5.777 0 10.477-4.7 10.477-10.477v-9.112c1.866 0.995 3.942 1.514 6.092 1.514 0.518 0 0.938-0.42 0.938-0.938v-5.021c0-0.518-0.42-0.938-0.938-0.938zM28.108 12.011c-2.001-0.166-3.902-0.866-5.544-2.047-0.285-0.206-0.662-0.234-0.975-0.073s-0.51 0.482-0.51 0.834v10.798c0 4.743-3.859 8.602-8.602 8.602s-8.602-3.859-8.602-8.602c0-4.427 3.361-8.083 7.665-8.552v3.176c-2.563 0.446-4.519 2.687-4.519 5.376 0 3.009 2.447 5.456 5.456 5.456s5.456-2.448 5.456-5.456v-19.648h3.201c0.429 3.645 3.329 6.545 6.974 6.974z"></path>\n</svg>\n`;const h=":host{display:block}";const r=class{constructor(l){c(this,l);var t;this.links=salla.config.get("store.social");this.iconsList={instagram:n,twitter:o,facebook:i,youtube:e,snapchat:a,tiktok:v};this.socialSlot=((t=this.host.querySelector('[slot="social"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-social-link"><a href={link} rel="noopener" target="_blank" title={type} aria-label={type}><span class="s-social-icon">{icon}</span></a></li>`;salla.lang.onLoaded((()=>{this.links=salla.config.get("store.social")}))}getLinksArray(){return Object.entries(this.links).filter((([c,l])=>!!l&&c!=="whatsapp")).map((([c,l])=>({type:c,value:l})))}componentWillLoad(){return new Promise((c=>salla.onReady(c)))}render(){const c=this.getLinksArray();return l(t,{class:"s-social-list"},c.map((c=>l("div",{id:"social-slot",innerHTML:this.socialSlot.replace(/\{icon\}/g,this.iconsList[c.type]).replace(/\{type\}/g,c.type).replace(/\{link\}/g,c.value.toString())}))))}componentDidRender(){var c;this.host.querySelectorAll("#social-slot").forEach((c=>c.replaceWith(c.firstChild)));(c=this.host.querySelector('[slot="social"]'))===null||c===void 0?void 0:c.remove()}get host(){return s(this)}};r.style=h;export{r as salla_social};
|
|
5
|
+
//# sourceMappingURL=p-126a72c2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaSocialCss","SallaSocial","constructor","hostRef","salla","config","get","instagram","twitter","facebook","youtube","snapchat","tiktok","this","socialSlot","_a","host","querySelector","innerHTML","lang","onLoaded","links","getLinksArray","Object","entries","filter","key","value","map","type","componentWillLoad","Promise","resolve","onReady","render","linksArray","h","Host","class","link","id","replace","iconsList","toString","componentDidRender","querySelectorAll","forEach","el","replaceWith","firstChild","remove"],"sources":["src/components/salla-social/salla-social.scss?tag=salla-social","src/components/salla-social/salla-social.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, State, h, Element } from '@stencil/core';\nimport instagram from '../../assets/svg/instagram.svg';\nimport twitter from '../../assets/svg/twitter.svg';\nimport facebook from '../../assets/svg/facebook.svg';\nimport youtube from '../../assets/svg/youtube.svg';\nimport snapchat from '../../assets/svg/snapchat.svg';\nimport tiktok from '../../assets/svg/tiktok.svg';\n\n@Component({\n tag: 'salla-social',\n styleUrl: 'salla-social.scss',\n})\nexport class SallaSocial {\n constructor() {\n this.socialSlot = this.host.querySelector('[slot=\"social\"]')?.innerHTML ||\n `<li class=\"s-social-link\"><a href={link} rel=\"noopener\" target=\"_blank\" title={type} aria-label={type}><span class=\"s-social-icon\">{icon}</span></a></li>`;\n salla.lang.onLoaded(() => {\n this.links = salla.config.get('store.social');\n });\n }\n\n private readonly socialSlot: string;\n @State() links = salla.config.get('store.social');\n @Element() host: HTMLElement;\n @State() iconsList: any = { instagram, twitter, facebook, youtube, snapchat, tiktok }\n\n private getLinksArray() {\n return Object.entries(this.links)\n .filter(([key, value]) => !!value && key !== 'whatsapp')\n .map(([type, value]) => ({ type, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const linksArray = this.getLinksArray();\n return (\n <Host class=\"s-social-list\">\n {linksArray.map((link) => (\n <div id=\"social-slot\" innerHTML={this.socialSlot\n .replace(/\\{icon\\}/g, this.iconsList[link.type])\n .replace(/\\{type\\}/g, link.type)\n .replace(/\\{link\\}/g, link.value.toString())}>\n </div>\n ))}\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelectorAll('#social-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"social\"]')?.remove();\n }\n}\n"],"mappings":";;;myQAAA,MAAMA,EAAiB,uB,MCYVC,EAAW,MACtB,WAAAC,CAAAC,G,2BASiBC,MAAMC,OAAOC,IAAI,gB,eAER,CAAEC,YAAWC,UAASC,WAAUC,UAASC,WAAUC,UAV3EC,KAAKC,aAAaC,EAAAF,KAAKG,KAAKC,cAAc,sBAAkB,MAAAF,SAAA,SAAAA,EAAEG,YAC5D,4JACFd,MAAMe,KAAKC,UAAS,KAClBP,KAAKQ,MAAQjB,MAAMC,OAAOC,IAAI,eAAe,G,CASzC,aAAAgB,GACN,OAAOC,OAAOC,QAAQX,KAAKQ,OACxBI,QAAO,EAAEC,EAAKC,OAAaA,GAASD,IAAQ,aAC5CE,KAAI,EAAEC,EAAMF,MAAM,CAAQE,OAAMF,W,CAGrC,iBAAAG,GACE,OAAO,IAAIC,SAAQC,GAAW5B,MAAM6B,QAAQD,I,CAG9C,MAAAE,GACE,MAAMC,EAAatB,KAAKS,gBACxB,OACEc,EAACC,EAAI,CAACC,MAAM,iBACTH,EAAWP,KAAKW,GACfH,EAAA,OAAKI,GAAG,cAActB,UAAWL,KAAKC,WACnC2B,QAAQ,YAAa5B,KAAK6B,UAAUH,EAAKV,OACzCY,QAAQ,YAAaF,EAAKV,MAC1BY,QAAQ,YAAaF,EAAKZ,MAAMgB,gB,CAM3C,kBAAAC,G,MACE/B,KAAKG,KAAK6B,iBAAiB,gBAAgBC,SAAQC,GAAMA,EAAGC,YAAYD,EAAGE,eAC3ElC,EAAAF,KAAKG,KAAKC,cAAc,sBAAkB,MAAAF,SAAA,SAAAA,EAAEmC,Q"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
System.register(["./p-a0dabf35.system.js","./p-c4a73e1a.system.js"],(function(t){"use strict";var n,e,c,s,o;return{setters:[function(t){n=t.r;e=t.h;c=t.H;s=t.g},function(t){o=t.e}],execute:function(){var i='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var a='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n';var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var r='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var p=t("salla_contacts",function(){function t(t){var e=this;n(this,t);var c;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:i,whatsapp:a,phone:l,telegram:r,email:o};this.contactSlot=((c=this.host.querySelector('[slot="contact"]'))===null||c===void 0?void 0:c.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){e.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){e.contactsTitle=e.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var n=t[0],e=t[1];return e!==""})).map((function(t){var n=t[0],e=t[1];return{type:n,value:e}}))};t.prototype.getContactLink=function(t){switch(t){case"phone":return"tel:".concat(this.contacts[t]);case"mobile":return"tel:".concat(this.contacts[t]);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(this.contacts[t]);case"telegram":return"https://t.me/".concat(this.contacts[t]);default:return this.contacts[t]}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.render=function(){var t=this;var n=this.getContactsArray();if(this.isHeader&&n&&n.length>0){return e(c,{class:"s-contacts s-contacts-header"},n.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(n,c){return e("a",{href:t.getContactLink(n.type),key:c,class:"s-contacts-topnav-link"},n.type==="email"?n.value:[e("span",null,t.contactsTitle,": "),e("a",{class:"unicode",href:t.iconsList[n.type]},n.value)])})))}return e(c,{class:"s-contacts"},!this.hideTitle&&e("h3",{class:"s-contacts-title"},this.contactsTitle),e("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},n.map((function(n,c){return e("div",{key:c,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(n.type)).replace(/\{value\}/g,n.value.toString()).replace(/\{link\}/g,t.getContactLink(n.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());p.style=h}}}));
|
|
5
|
-
//# sourceMappingURL=p-
|
|
4
|
+
System.register(["./p-a0dabf35.system.js","./p-c4a73e1a.system.js"],(function(t){"use strict";var n,e,c,s,o;return{setters:[function(t){n=t.r;e=t.h;c=t.H;s=t.g},function(t){o=t.e}],execute:function(){var i='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var a='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n';var l='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var r='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var h=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var p=t("salla_contacts",function(){function t(t){var e=this;n(this,t);var c;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:i,whatsapp:a,phone:l,telegram:r,email:o};this.contactSlot=((c=this.host.querySelector('[slot="contact"]'))===null||c===void 0?void 0:c.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){e.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){e.contactsTitle=e.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var n=t[0],e=t[1];return e!==""})).map((function(t){var n=t[0],e=t[1];return{type:n,value:e}}))};t.prototype.getContactLink=function(t){switch(t){case"phone":return"tel:".concat(this.contacts[t]);case"mobile":return"tel:".concat(this.contacts[t]);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(this.contacts[t]);case"telegram":return"https://t.me/".concat(this.contacts[t]);default:return this.contacts[t]}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var n=this.getContactsArray();if(this.isHeader&&n&&n.length>0){return e(c,{class:"s-contacts s-contacts-header"},n.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(n,c){return e("a",{href:t.getContactLink(n.type),key:c,class:"s-contacts-topnav-link"},n.type==="email"?n.value:[e("span",null,t.contactsTitle,": "),e("a",{class:"unicode",href:t.iconsList[n.type]},n.value)])})))}return e(c,{class:"s-contacts"},!this.hideTitle&&e("h3",{class:"s-contacts-title"},this.contactsTitle),e("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},n.map((function(n,c){return e("div",{key:c,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(n.type)).replace(/\{value\}/g,n.value.toString()).replace(/\{link\}/g,t.getContactLink(n.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());p.style=h}}}));
|
|
5
|
+
//# sourceMappingURL=p-2b0b9547.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaContactsCss","SallaContacts","exports","class_1","hostRef","_this","this","salla","config","get","mobile","whatsapp","phone","telegram","email","contactSlot","_a","host","querySelector","innerHTML","concat","iconsOnly","onReady","contacts","lang","onLoaded","contactsTitle","prototype","getContactsArray","Object","entries","filter","_b","_key","value","map","type","getContactLink","url","getContactIcon","iconsList","componentWillLoad","Promise","resolve","render","contactsArray","isHeader","length","h","Host","class","contact","index","href","key","hideTitle","horizontal","id","replace","toString","componentDidRender","remove"],"sources":["src/components/salla-contacts/salla-contacts.scss?tag=salla-contacts","src/components/salla-contacts/salla-contacts.tsx"],"sourcesContent":[".unicode {\n unicode-bidi: plaintext;\n}","import { Component, Host, h, Prop, State, Element } from '@stencil/core';\nimport mobile from '../../assets/svg/iphone.svg';\nimport whatsapp from '../../assets/svg/whatsapp2.svg';\nimport phone from '../../assets/svg/phone.svg';\nimport telegram from '../../assets/svg/paper-plane-o.svg';\nimport email from '../../assets/svg/mail.svg';\n/**\n * @slot contact - Replaces contact item, has replaceable props `{icon}`, `{value}`.\n */\n@Component({\n tag: 'salla-contacts',\n styleUrl: 'salla-contacts.scss',\n})\nexport class SallaContacts {\n constructor() {\n this.contactSlot = this.host.querySelector('[slot=\"contact\"]')?.innerHTML || `<a href={link} class=\"s-contacts-item\"><span class=\"s-contacts-icon\">{icon}</span>${!this.iconsOnly && \"<span class='unicode'>{value}</span>\"}</a>`;\n\n salla.onReady(() => {\n this.contacts = salla.config.get('store.contacts');\n });\n\n salla.lang.onLoaded(() => {\n this.contactsTitle = this.contactsTitle || salla.lang.get('blocks.footer.social');\n });\n }\n private readonly contactSlot: string;\n\n /**\n * Section title for social block of footer.\n */\n @Prop({mutable: true}) contactsTitle: string;\n\n /**\n * Flag to toggle title visibility.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * Conditional flag to check whether the content is header or not.\n */\n @Prop() isHeader: boolean;\n\n /**\n * Flag to toggle list of contents whether vertical or horizontal.\n */\n @Prop() horizontal: boolean;\n\n /**\n * Flag condition to show icon only or icon with label\n */\n @Prop() iconsOnly: boolean;\n\n\n @Element() host: HTMLElement;\n @State() contacts: any = salla.config.get('store.contacts');\n @State() iconsList: any = { mobile, whatsapp, phone, telegram, email }\n private getContactsArray() {\n return Object.entries(this.contacts)\n .filter(([_key, value]) => value !== '')\n .map(([type, value]) => ({ type, value }));\n }\n\n private getContactLink(type) {\n switch (type) {\n case 'phone':\n return `tel:${this.contacts[type]}`; \n case 'mobile':\n return `tel:${this.contacts[type]}`;\n case 'whatsapp':\n return salla.url.get('whatsapp/send');\n case 'email':\n return `mailto:${this.contacts[type]}`;\n case 'telegram':\n return `https://t.me/${this.contacts[type]}`;\n default:\n return this.contacts[type];\n }\n }\n\n private getContactIcon(type) {\n return this.iconsList[type];\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n\n render() {\n const contactsArray = this.getContactsArray();\n if (this.isHeader && contactsArray && contactsArray.length > 0) {\n return (\n <Host class=\"s-contacts s-contacts-header\">\n {contactsArray.filter((contact) => contact.type == 'phone' || contact.type == 'email').map((contact, index) => (\n <a href={this.getContactLink(contact.type)} key={index} class=\"s-contacts-topnav-link\">\n {contact.type === 'email' ? (\n contact.value\n ) : (\n [\n <span>{this.contactsTitle}: </span>,\n <a class=\"unicode\" href={this.iconsList[contact.type]}>{contact.value}</a>\n ]\n )}\n </a>\n ))}\n </Host>\n );\n }\n return (\n <Host class=\"s-contacts\">\n {!this.hideTitle && <h3 class=\"s-contacts-title\">{this.contactsTitle}</h3>}\n <div class={{\n 's-contacts-list': true,\n 's-contacts-list-horizontal': this.horizontal,\n 's-contacts-list-vertical': !this.horizontal,\n 's-contacts-list-icons-only': this.iconsOnly\n }\n }>\n {contactsArray.map((contact, index) => (\n <div key={index} id=\"contact-slot\" innerHTML={this.contactSlot\n .replace(/\\{icon\\}/g, this.getContactIcon(contact.type))\n .replace(/\\{value\\}/g, contact.value.toString())\n .replace(/\\{link\\}/g, this.getContactLink(contact.type))}>\n </div>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n // this.host.querySelectorAll('#contact-slot').forEach(el => el.replaceWith(el.firstChild));\n this.host.querySelector('[slot=\"contact\"]')?.remove();\n }\n}\n\n"],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as s,h as a,H as t,g as i}from"./p-fafedb13.js";const e=":host{display:block}";const l=class{constructor(a){s(this,a);var t;this.apps=salla.config.get("store.apps");this.hideTitle=undefined;this.appsTitle=undefined;this.vertical=undefined;this.appSlot=((t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.innerHTML)||`<img alt={name} src={icon} />`;salla.onReady((()=>{this.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){var s;(s=this.host.querySelector('[slot="app"]'))===null||s===void 0?void 0:s.remove()}get host(){return i(this)}};l.style=e;export{l as salla_apps_icons};
|
|
5
|
+
//# sourceMappingURL=p-2e3ef7de.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sallaAppsIconsCss","SallaAppsIcons","constructor","hostRef","salla","config","get","this","appSlot","_a","host","querySelector","innerHTML","onReady","apps","lang","onLoaded","appsTitle","getAppsArray","Object","entries","map","name","value","componentWillLoad","Promise","resolve","render","appsArray","Array","isArray","length","h","Host","class","hideTitle","vertical","app","index","key","href","rel","target","id","replace","url","cdn","componentDidRender","remove"],"sources":["src/components/salla-apps-icons/salla-apps-icons.scss?tag=salla-apps-icons","src/components/salla-apps-icons/salla-apps-icons.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, Prop, State, h, Element } from '@stencil/core';\n/**\n * @slot app - Replaces app item, has replaceable props `{icon}`, `{name}`.\n */\n@Component({\n tag: 'salla-apps-icons',\n styleUrl: 'salla-apps-icons.scss',\n})\nexport class SallaAppsIcons {\n constructor() {\n this.appSlot = this.host.querySelector('[slot=\"app\"]')?.innerHTML || `<img alt={name} src={icon} />`;\n salla.onReady(() => {\n this.apps = salla.config.get('store.apps');\n });\n\n salla.lang.onLoaded(() => {\n this.appsTitle = salla.lang.get('blocks.footer.download_apps');\n });\n }\n private readonly appSlot: string;\n @Element() host: HTMLElement;\n @State() apps = salla.config.get('store.apps');\n\n /**\n * Flag to show or hide title.\n */\n @Prop() hideTitle: boolean;\n\n /**\n * The title to display.\n */\n @Prop() appsTitle: string;\n\n /**\n * Display flag to horizontal/vertical.\n */\n @Prop() vertical: boolean;\n\n private getAppsArray() {\n return Object.entries(this.apps)\n .map(([name, value]) => ({ name, value }));\n }\n\n componentWillLoad() {\n return new Promise(resolve => salla.onReady(resolve));\n }\n\n render() {\n const appsArray = this.getAppsArray();\n if (Array.isArray(appsArray) && !appsArray.length) {\n return;\n }\n return (\n <Host class=\"s-apps-icons\">\n {!this.hideTitle && <h3>{this.appsTitle}</h3>}\n <div class={{\"s-apps-icons-list\": true, \"vertical\": this.vertical}}>\n {appsArray.map((app, index) => (\n <a key={index} href={app.value as string} rel=\"noreferrer\" target=\"_blank\" class=\"s-apps-icons-item\" id=\"app-slot\" innerHTML={this.appSlot\n .replace(/\\{icon\\}/g, salla.url.cdn(`images/${app.name}.png`))\n .replace(/\\{name\\}/g, app.name)}>\n </a>\n ))}\n </div>\n </Host>\n );\n }\n componentDidRender() {\n this.host.querySelector('[slot=\"app\"]')?.remove();\n }\n}\n"],"mappings":";;;yDAAA,MAAMA,EAAoB,uB,MCQbC,EAAc,MACzB,WAAAC,CAAAC,G,0BAYgBC,MAAMC,OAAOC,IAAI,c,0EAX/BC,KAAKC,UAAUC,EAAAF,KAAKG,KAAKC,cAAc,mBAAe,MAAAF,SAAA,SAAAA,EAAEG,YAAa,gCACrER,MAAMS,SAAQ,KACZN,KAAKO,KAAOV,MAAMC,OAAOC,IAAI,aAAa,IAG5CF,MAAMW,KAAKC,UAAS,KAClBT,KAAKU,UAAYb,MAAMW,KAAKT,IAAI,8BAA8B,G,CAsB1D,YAAAY,GACN,OAAOC,OAAOC,QAAQb,KAAKO,MACxBO,KAAI,EAAEC,EAAMC,MAAM,CAAQD,OAAMC,W,CAGrC,iBAAAC,GACE,OAAO,IAAIC,SAAQC,GAAWtB,MAAMS,QAAQa,I,CAG9C,MAAAC,GACE,MAAMC,EAAYrB,KAAKW,eACvB,GAAIW,MAAMC,QAAQF,KAAeA,EAAUG,OAAQ,CACjD,M,CAEF,OACEC,EAACC,EAAI,CAACC,MAAM,iBACN3B,KAAK4B,WAAaH,EAAA,UAAKzB,KAAKU,WAC9Be,EAAA,OAAKE,MAAO,CAAC,oBAAqB,KAAME,SAAY7B,KAAK6B,WACtDR,EAAUP,KAAI,CAACgB,EAAKC,IAClBN,EAAA,KAAGO,IAAKD,EAAOE,KAAMH,EAAId,MAAiBkB,IAAI,aAAaC,OAAO,SAASR,MAAM,oBAAoBS,GAAG,WAAW/B,UAAWL,KAAKC,QACjIoC,QAAQ,YAAaxC,MAAMyC,IAAIC,IAAI,UAAUT,EAAIf,aACjDsB,QAAQ,YAAaP,EAAIf,W,CAOxC,kBAAAyB,G,OACEtC,EAAAF,KAAKG,KAAKC,cAAc,mBAAe,MAAAF,SAAA,SAAAA,EAAEuC,Q"}
|