@salla.sa/twilight-components 1.0.63 → 1.0.64

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.
Files changed (140) hide show
  1. package/dist/cjs/{Helper-98cc9f18.js → Helper-8ae6a805.js} +3 -0
  2. package/dist/cjs/{index-e729d94c.js → index-c0f5bb97.js} +96 -58
  3. package/dist/cjs/index.cjs.js +3 -0
  4. package/dist/cjs/loader.cjs.js +6 -3
  5. package/dist/cjs/salla-branches.cjs.entry.js +5 -2
  6. package/dist/cjs/salla-button.cjs.entry.js +4 -1
  7. package/dist/cjs/salla-conditional-fields.cjs.entry.js +4 -1
  8. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +5 -2
  9. package/dist/cjs/salla-installment.cjs.entry.js +4 -1
  10. package/dist/cjs/salla-localization-modal.cjs.entry.js +5 -2
  11. package/dist/cjs/salla-login-modal.cjs.entry.js +6 -3
  12. package/dist/cjs/salla-modal_2.cjs.entry.js +18 -15
  13. package/dist/cjs/salla-offer-modal.cjs.entry.js +6 -4
  14. package/dist/cjs/salla-product-availability.cjs.entry.js +6 -3
  15. package/dist/cjs/salla-quantity-input.cjs.entry.js +4 -1
  16. package/dist/cjs/salla-rating-modal.cjs.entry.js +6 -4
  17. package/dist/cjs/salla-rating-stars.cjs.entry.js +5 -2
  18. package/dist/cjs/salla-tel-input.cjs.entry.js +5 -2
  19. package/dist/cjs/salla-verify-modal.cjs.entry.js +6 -3
  20. package/dist/cjs/twilight-components.cjs.js +6 -3
  21. package/dist/collection/Helpers/Helper.js +3 -0
  22. package/dist/collection/collection-manifest.json +2 -2
  23. package/dist/collection/components/salla-branches/salla-branches.js +4 -1
  24. package/dist/collection/components/salla-button/salla-button.js +5 -2
  25. package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +3 -0
  26. package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +3 -0
  27. package/dist/collection/components/salla-installment/salla-installment.js +3 -0
  28. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +3 -0
  29. package/dist/collection/components/salla-login-modal/salla-login-modal.js +4 -1
  30. package/dist/collection/components/salla-modal/salla-modal.js +17 -14
  31. package/dist/collection/components/salla-offer-modal/offer-schema.js +3 -0
  32. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +8 -6
  33. package/dist/collection/components/salla-product-availability/salla-product-availability.js +4 -1
  34. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +3 -0
  35. package/dist/collection/components/salla-rating-modal/order-feedback-response.js +3 -0
  36. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +4 -2
  37. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +3 -0
  38. package/dist/collection/components/salla-search/salla-search.css +12 -2
  39. package/dist/collection/components/salla-search/salla-search.js +7 -4
  40. package/dist/collection/components/salla-search/search-response.js +3 -0
  41. package/dist/collection/components/salla-tel-input/salla-tel-input.js +3 -0
  42. package/dist/collection/components/salla-verify-modal/salla-verify-modal.js +6 -3
  43. package/dist/collection/index.js +3 -0
  44. package/dist/collection/interfaces/colors.js +3 -0
  45. package/dist/collection/interfaces/index.js +3 -0
  46. package/dist/collection/interfaces/ratio.js +3 -0
  47. package/dist/components/Helper.js +3 -0
  48. package/dist/components/index.d.ts +1 -1
  49. package/dist/components/index.js +3 -0
  50. package/dist/components/salla-branches.d.ts +4 -0
  51. package/dist/components/salla-branches.js +47 -6
  52. package/dist/components/salla-button.d.ts +4 -0
  53. package/dist/components/salla-button.js +7 -116
  54. package/dist/components/salla-button2.js +149 -0
  55. package/dist/components/salla-conditional-fields.d.ts +4 -0
  56. package/dist/components/salla-conditional-fields.js +23 -5
  57. package/dist/components/salla-infinite-scroll.d.ts +4 -0
  58. package/dist/components/salla-infinite-scroll.js +31 -5
  59. package/dist/components/salla-installment.d.ts +4 -0
  60. package/dist/components/salla-installment.js +30 -5
  61. package/dist/components/salla-localization-modal.d.ts +4 -0
  62. package/dist/components/salla-localization-modal.js +46 -5
  63. package/dist/components/salla-login-modal.d.ts +4 -0
  64. package/dist/components/salla-login-modal.js +67 -6
  65. package/dist/components/salla-modal.d.ts +4 -0
  66. package/dist/components/salla-modal.js +7 -150
  67. package/dist/components/salla-modal2.js +185 -0
  68. package/dist/components/salla-offer-modal.d.ts +4 -0
  69. package/dist/components/salla-offer-modal.js +46 -7
  70. package/dist/components/salla-product-availability.d.ts +4 -0
  71. package/dist/components/salla-product-availability.js +54 -6
  72. package/dist/components/salla-quantity-input.d.ts +4 -0
  73. package/dist/components/salla-quantity-input.js +25 -5
  74. package/dist/components/salla-rating-modal.d.ts +4 -0
  75. package/dist/components/salla-rating-modal.js +47 -7
  76. package/dist/components/salla-rating-stars.d.ts +4 -0
  77. package/dist/components/salla-rating-stars.js +7 -79
  78. package/dist/components/salla-rating-stars2.js +100 -0
  79. package/dist/components/salla-search.d.ts +4 -0
  80. package/dist/components/salla-search.js +41 -10
  81. package/dist/components/salla-tel-input.d.ts +4 -0
  82. package/dist/components/salla-tel-input.js +6 -1474
  83. package/dist/components/salla-tel-input2.js +1506 -0
  84. package/dist/components/salla-verify-modal.d.ts +4 -0
  85. package/dist/components/salla-verify-modal.js +7 -145
  86. package/dist/components/salla-verify-modal2.js +182 -0
  87. package/dist/esm/{Helper-7162a06c.js → Helper-e1d414a5.js} +3 -0
  88. package/dist/esm/{index-8c9eabea.js → index-a1271335.js} +96 -58
  89. package/dist/esm/index.js +3 -1
  90. package/dist/esm/loader.js +6 -3
  91. package/dist/esm/polyfills/css-shim.js +1 -1
  92. package/dist/esm/salla-branches.entry.js +5 -2
  93. package/dist/esm/salla-button.entry.js +4 -1
  94. package/dist/esm/salla-conditional-fields.entry.js +4 -1
  95. package/dist/esm/salla-infinite-scroll.entry.js +5 -2
  96. package/dist/esm/salla-installment.entry.js +4 -1
  97. package/dist/esm/salla-localization-modal.entry.js +5 -2
  98. package/dist/esm/salla-login-modal.entry.js +6 -3
  99. package/dist/esm/salla-modal_2.entry.js +18 -15
  100. package/dist/esm/salla-offer-modal.entry.js +6 -4
  101. package/dist/esm/salla-product-availability.entry.js +6 -3
  102. package/dist/esm/salla-quantity-input.entry.js +4 -1
  103. package/dist/esm/salla-rating-modal.entry.js +6 -4
  104. package/dist/esm/salla-rating-stars.entry.js +5 -2
  105. package/dist/esm/salla-tel-input.entry.js +5 -2
  106. package/dist/esm/salla-verify-modal.entry.js +6 -3
  107. package/dist/esm/twilight-components.js +6 -3
  108. package/dist/twilight-components/index.esm.js +3 -0
  109. package/dist/twilight-components/{p-5a8f3684.entry.js → p-18b36fe0.entry.js} +4 -1
  110. package/dist/twilight-components/{p-75ff6410.entry.js → p-191c7430.entry.js} +4 -1
  111. package/dist/twilight-components/{p-0c3cea73.entry.js → p-2aaea044.entry.js} +4 -1
  112. package/dist/twilight-components/{p-40df26b0.entry.js → p-4679b0f7.entry.js} +4 -1
  113. package/dist/twilight-components/{p-11bf3444.entry.js → p-51ef8f42.entry.js} +4 -1
  114. package/dist/twilight-components/{p-29fdfcd3.entry.js → p-676beef2.entry.js} +4 -1
  115. package/dist/twilight-components/{p-b79f8eca.entry.js → p-69b8ebc1.entry.js} +4 -1
  116. package/dist/twilight-components/{p-c24a274d.entry.js → p-81dedc75.entry.js} +4 -1
  117. package/dist/twilight-components/{p-791e7cb1.entry.js → p-87e0df12.entry.js} +4 -1
  118. package/dist/twilight-components/p-8ee2e4db.js +4 -0
  119. package/dist/twilight-components/{p-7f8ba787.entry.js → p-976b7d27.entry.js} +4 -1
  120. package/dist/twilight-components/{p-ed1c00c5.js → p-9d2ca9c8.js} +3 -0
  121. package/dist/twilight-components/{p-9a7943e6.entry.js → p-9eaeceb7.entry.js} +4 -1
  122. package/dist/twilight-components/{p-2c88c8a0.entry.js → p-a6a4a2bd.entry.js} +4 -1
  123. package/dist/twilight-components/p-ab83b063.entry.js +4 -0
  124. package/dist/twilight-components/{p-fd6c850b.entry.js → p-c3b196f3.entry.js} +4 -1
  125. package/dist/twilight-components/p-fa55e3ea.entry.js +4 -0
  126. package/dist/twilight-components/twilight-components.esm.js +4 -1
  127. package/dist/types/components/salla-modal/salla-modal.d.ts +4 -4
  128. package/dist/types/components/salla-search/salla-search.d.ts +2 -2
  129. package/dist/types/components/salla-search/search-response.d.ts +42 -16
  130. package/dist/types/components.d.ts +3 -3
  131. package/dist/types/stencil-public-runtime.d.ts +6 -4
  132. package/loader/cdn.js +3 -1
  133. package/loader/index.cjs.js +3 -1
  134. package/loader/index.d.ts +0 -1
  135. package/loader/index.es2017.js +3 -1
  136. package/loader/index.js +3 -1
  137. package/package.json +1 -1
  138. package/dist/twilight-components/p-2e6ee2bc.js +0 -1
  139. package/dist/twilight-components/p-c1bad97f.entry.js +0 -1
  140. package/dist/twilight-components/p-da60f8ae.entry.js +0 -1
@@ -1,18 +1,44 @@
1
- export default interface SearchResponse {
2
- status: number;
3
- success: boolean;
4
- data: Array<{
5
- id: string;
6
- name: string;
7
- price: string;
8
- image_url: string;
9
- url: string;
10
- }>;
11
- features: {
12
- sorting: boolean;
1
+ declare type Nullable<T> = T | undefined | null | '';
2
+ declare type Price = {
3
+ amount: string;
4
+ currency: string;
5
+ };
6
+ declare type ProductType = 'product' | 'service' | 'group_products' | 'codes' | 'digital' | 'food' | 'donating';
7
+ export interface Product {
8
+ id: number;
9
+ name: string;
10
+ type: ProductType;
11
+ promotion: {
12
+ title: Nullable<string>;
13
+ sub_title: Nullable<string>;
13
14
  };
14
- sort_options: Array<{
15
- id: 'ourSuggest' | 'bestSell' | 'topRated' | 'priceFromTopToLow' | 'priceFromLowToTop';
16
- name: 'مقترحاتنا' | 'الاكثر مبيعا' | 'الاعلى تقيماً' | 'السعر من الاعلى إلى الاقل' | 'السعر من الاقل إلى الاعلى';
17
- }>;
15
+ price: Price;
16
+ sale_price: Nullable<Price>;
17
+ regular_price: Price;
18
+ has_special_price: boolean;
19
+ status: 'sale' | 'out';
20
+ is_available: boolean;
21
+ sku: Nullable<string>;
22
+ currency: string | 'SAR';
23
+ url: string;
24
+ thumbnail: string;
25
+ calories: Nullable<number>;
18
26
  }
27
+ declare type SortOption = {
28
+ id: "ourSuggest" | "bestSell" | "topRated" | "priceFromTopToLow" | "priceFromLowToTop";
29
+ name: string;
30
+ };
31
+ export default interface SearchProductsResponse {
32
+ data: Product[];
33
+ cursor: {
34
+ current: number;
35
+ previous: Nullable<string>;
36
+ next: Nullable<string>;
37
+ count: number;
38
+ };
39
+ features?: {
40
+ sorting?: true;
41
+ };
42
+ sort_options: SortOption[];
43
+ }
44
+ export {};
@@ -163,10 +163,10 @@ export namespace Components {
163
163
  */
164
164
  "position": 'top' | 'middle' | 'bottom';
165
165
  /**
166
- * Change the title
167
- * @param title
166
+ * Change the Modal Title
167
+ * @param modalTitle
168
168
  */
169
- "setTitle": (title: any) => Promise<HTMLElement>;
169
+ "setTitle": (modalTitle: any) => Promise<HTMLElement>;
170
170
  /**
171
171
  * Show the modal
172
172
  */
@@ -666,7 +666,7 @@ export declare namespace JSXBase {
666
666
  use: JSXBase.SVGAttributes;
667
667
  view: JSXBase.SVGAttributes;
668
668
  }
669
- interface SlotAttributes {
669
+ interface SlotAttributes extends JSXAttributes {
670
670
  name?: string;
671
671
  slot?: string;
672
672
  onSlotchange?: (event: Event) => void;
@@ -1427,9 +1427,7 @@ export declare namespace JSXBase {
1427
1427
  z?: number | string;
1428
1428
  zoomAndPan?: string;
1429
1429
  }
1430
- interface DOMAttributes<T = Element> {
1431
- key?: string | number;
1432
- ref?: (elm?: T) => void;
1430
+ interface DOMAttributes<T> extends JSXAttributes<T> {
1433
1431
  slot?: string;
1434
1432
  part?: string;
1435
1433
  exportparts?: string;
@@ -1550,6 +1548,10 @@ export declare namespace JSXBase {
1550
1548
  onTransitionEndCapture?: (event: TransitionEvent) => void;
1551
1549
  }
1552
1550
  }
1551
+ export interface JSXAttributes<T = Element> {
1552
+ key?: string | number;
1553
+ ref?: (elm?: T) => void;
1554
+ }
1553
1555
  export interface CustomElementsDefineOptions {
1554
1556
  exclude?: string[];
1555
1557
  resourcesUrl?: string;
package/loader/cdn.js CHANGED
@@ -1,3 +1,5 @@
1
-
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
2
4
  module.exports = require('../dist/cjs/loader.cjs.js');
3
5
  module.exports.applyPolyfills = function() { return Promise.resolve() };
@@ -1,3 +1,5 @@
1
-
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
2
4
  module.exports = require('../dist/cjs/loader.cjs.js');
3
5
  module.exports.applyPolyfills = function() { return Promise.resolve() };
package/loader/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  export * from '../dist/types/components';
3
2
  export interface CustomElementsDefineOptions {
4
3
  exclude?: string[];
@@ -1,3 +1,5 @@
1
-
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
2
4
  export * from '../dist/esm/polyfills/index.js';
3
5
  export * from '../dist/esm/loader.js';
package/loader/index.js CHANGED
@@ -1,4 +1,6 @@
1
-
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
2
4
  (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
3
5
  export * from '../dist/esm/polyfills/index.js';
4
6
  export * from '../dist/esm/loader.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "license": "MIT",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -1 +0,0 @@
1
- let e,l,t=!1,n=!1,s=!1,o=!1;const i="undefined"!=typeof window?window:{},r=i.document||{head:{}},c={l:0,t:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,l,t,n)=>e.addEventListener(l,t,n),rel:(e,l,t,n)=>e.removeEventListener(l,t,n),ce:(e,l)=>new CustomEvent(e,l)},f=e=>Promise.resolve(e),a=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=(e,l,t)=>{t&&t.map((([t,n,s])=>{const o=e,i=$(l,s),r=d(t);c.ael(o,n,i,r),(l.o=l.o||[]).push((()=>c.rel(o,n,i,r)))}))},$=(e,l)=>t=>{try{256&e.l?e.i[l](t):(e.u=e.u||[]).push([l,t])}catch(e){fe(e)}},d=e=>0!=(2&e),h="http://www.w3.org/1999/xlink",y=new WeakMap,m=e=>"sc-"+e.$,p={},b=e=>"object"==(e=typeof e)||"function"===e,w=(e,l,...t)=>{let n=null,s=null,o=null,i=!1,r=!1,c=[];const f=l=>{for(let t=0;t<l.length;t++)n=l[t],Array.isArray(n)?f(n):null!=n&&"boolean"!=typeof n&&((i="function"!=typeof e&&!b(n))&&(n+=""),i&&r?c[c.length-1].h+=n:c.push(i?g(null,n):n),r=i)};if(f(t),l){l.key&&(s=l.key),l.name&&(o=l.name);{const e=l.className||l.class;e&&(l.class="object"!=typeof e?e:Object.keys(e).filter((l=>e[l])).join(" "))}}const a=g(e,null);return a.m=l,c.length>0&&(a.p=c),a.g=s,a.k=o,a},g=(e,l)=>({l:0,S:e,h:l,v:null,p:null,m:null,g:null,k:null}),k={},S=(e,l,t,n,s,o)=>{if(t!==n){let r=ce(e,l),f=l.toLowerCase();if("class"===l){const l=e.classList,s=j(t),o=j(n);l.remove(...s.filter((e=>e&&!o.includes(e)))),l.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===l){for(const l in t)n&&null!=n[l]||(l.includes("-")?e.style.removeProperty(l):e.style[l]="");for(const l in n)t&&n[l]===t[l]||(l.includes("-")?e.style.setProperty(l,n[l]):e.style[l]=n[l])}else if("key"===l);else if("ref"===l)n&&n(e);else if(r||"o"!==l[0]||"n"!==l[1]){const i=b(n);if((r||i&&null!==n)&&!s)try{if(e.tagName.includes("-"))e[l]=n;else{let s=null==n?"":n;"list"===l?r=!1:null!=t&&e[l]==s||(e[l]=s)}}catch(e){}let c=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(l=f,c=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(l)||(c?e.removeAttributeNS(h,l):e.removeAttribute(l)):(!r||4&o||s)&&!i&&(n=!0===n?"":n,c?e.setAttributeNS(h,l,n):e.setAttribute(l,n))}else l="-"===l[2]?l.slice(3):ce(i,f)?f.slice(2):f[2]+l.slice(3),t&&c.rel(e,l,t,!1),n&&c.ael(e,l,n,!1)}},v=/\s/,j=e=>e?e.split(v):[],x=(e,l,t,n)=>{const s=11===l.v.nodeType&&l.v.host?l.v.host:l.v,o=e&&e.m||p,i=l.m||p;for(n in o)n in i||S(s,n,o[n],void 0,t,l.l);for(n in i)S(s,n,o[n],i[n],t,l.l)},M=(n,o,i)=>{let c,f,a,u=o.p[i],$=0;if(t||(s=!0,"slot"===u.S&&(u.l|=u.p?2:1)),null!==u.h)c=u.v=r.createTextNode(u.h);else if(1&u.l)c=u.v=r.createTextNode("");else if(c=u.v=r.createElement(2&u.l?"slot-fb":u.S),x(null,u,!1),u.p)for($=0;$<u.p.length;++$)f=M(n,u,$),f&&c.appendChild(f);return c["s-hn"]=l,3&u.l&&(c["s-sr"]=!0,c["s-cr"]=e,c["s-sn"]=u.k||"",a=n&&n.p&&n.p[i],a&&a.S===u.S&&n.v&&O(n.v,!1)),c},O=(e,t)=>{c.l|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==l&&o["s-ol"]&&(I(o).insertBefore(o,T(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&O(o,t)}c.l&=-2},C=(e,l,t,n,s,o)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(;s<=o;++s)n[s]&&(i=M(null,t,s),i&&(n[s].v=i,r.insertBefore(i,T(l))))},R=(e,l,t,s,o)=>{for(;l<=t;++l)(s=e[l])&&(o=s.v,F(s),n=!0,o["s-ol"]?o["s-ol"].remove():O(o,!0),o.remove())},P=(e,l)=>e.S===l.S&&("slot"===e.S?e.k===l.k:e.g===l.g),T=e=>e&&e["s-ol"]||e,I=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,L=(e,l)=>{const t=l.v=e.v,n=e.p,s=l.p,o=l.h;let i;null===o?("slot"===l.S||x(e,l,!1),null!==n&&null!==s?((e,l,t,n)=>{let s,o,i=0,r=0,c=0,f=0,a=l.length-1,u=l[0],$=l[a],d=n.length-1,h=n[0],y=n[d];for(;i<=a&&r<=d;)if(null==u)u=l[++i];else if(null==$)$=l[--a];else if(null==h)h=n[++r];else if(null==y)y=n[--d];else if(P(u,h))L(u,h),u=l[++i],h=n[++r];else if(P($,y))L($,y),$=l[--a],y=n[--d];else if(P(u,y))"slot"!==u.S&&"slot"!==y.S||O(u.v.parentNode,!1),L(u,y),e.insertBefore(u.v,$.v.nextSibling),u=l[++i],y=n[--d];else if(P($,h))"slot"!==u.S&&"slot"!==y.S||O($.v.parentNode,!1),L($,h),e.insertBefore($.v,u.v),$=l[--a],h=n[++r];else{for(c=-1,f=i;f<=a;++f)if(l[f]&&null!==l[f].g&&l[f].g===h.g){c=f;break}c>=0?(o=l[c],o.S!==h.S?s=M(l&&l[r],t,c):(L(o,h),l[c]=void 0,s=o.v),h=n[++r]):(s=M(l&&l[r],t,r),h=n[++r]),s&&I(u.v).insertBefore(s,T(u.v))}i>a?C(e,null==n[d+1]?null:n[d+1].v,t,n,r,d):r>d&&R(l,i,a)})(t,n,l,s):null!==s?(null!==e.h&&(t.textContent=""),C(t,null,l,s,0,s.length-1)):null!==n&&R(n,0,n.length-1)):(i=t["s-cr"])?i.parentNode.textContent=o:e.h!==o&&(t.data=o)},E=e=>{let l,t,n,s,o,i,r=e.childNodes;for(t=0,n=r.length;t<n;t++)if(l=r[t],1===l.nodeType){if(l["s-sr"])for(o=l["s-sn"],l.hidden=!1,s=0;s<n;s++)if(i=r[s].nodeType,r[s]["s-hn"]!==l["s-hn"]||""!==o){if(1===i&&o===r[s].getAttribute("slot")){l.hidden=!0;break}}else if(1===i||3===i&&""!==r[s].textContent.trim()){l.hidden=!0;break}E(l)}},W=[],A=e=>{let l,t,s,o,i,r,c=0,f=e.childNodes,a=f.length;for(;c<a;c++){if(l=f[c],l["s-sr"]&&(t=l["s-cr"])&&t.parentNode)for(s=t.parentNode.childNodes,o=l["s-sn"],r=s.length-1;r>=0;r--)t=s[r],t["s-cn"]||t["s-nr"]||t["s-hn"]===l["s-hn"]||(D(t,o)?(i=W.find((e=>e.j===t)),n=!0,t["s-sn"]=t["s-sn"]||o,i?i.M=l:W.push({M:l,j:t}),t["s-sr"]&&W.map((e=>{D(e.j,t["s-sn"])&&(i=W.find((e=>e.j===t)),i&&!e.M&&(e.M=i.M))}))):W.some((e=>e.j===t))||W.push({j:t}));1===l.nodeType&&A(l)}},D=(e,l)=>1===e.nodeType?null===e.getAttribute("slot")&&""===l||e.getAttribute("slot")===l:e["s-sn"]===l||""===l,F=e=>{e.m&&e.m.ref&&e.m.ref(null),e.p&&e.p.map(F)},H=e=>oe(e).O,N=(e,l,t)=>{const n=H(e);return{emit:e=>U(n,l,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},U=(e,l,t)=>{const n=c.ce(l,t);return e.dispatchEvent(n),n},q=(e,l)=>{l&&!e.C&&l["s-p"]&&l["s-p"].push(new Promise((l=>e.C=l)))},V=(e,l)=>{if(e.l|=16,!(4&e.l))return q(e,e.R),we((()=>_(e,l)));e.l|=512},_=(e,l)=>{const t=e.i;let n;return l&&(e.l|=256,e.u&&(e.u.map((([e,l])=>K(t,e,l))),e.u=null),n=K(t,"componentWillLoad")),Q(n,(()=>z(e,t,l)))},z=async(e,l,t)=>{const n=e.O,s=n["s-rc"];t&&(e=>{const l=e.P;((e,l)=>{let t=m(l),n=$e.get(t);if(e=11===e.nodeType?e:r,n)if("string"==typeof n){let l,s=y.get(e=e.head||e);s||y.set(e,s=new Set),s.has(t)||(e.host&&(l=e.querySelector(`[sty-id="${t}"]`))?l.innerHTML=n:(l=r.createElement("style"),l.innerHTML=n,e.insertBefore(l,e.querySelector("link"))),s&&s.add(t))}else e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n])})(e.O.getRootNode(),l)})(e);B(e,l),s&&(s.map((e=>e())),n["s-rc"]=void 0);{const l=n["s-p"],t=()=>G(e);0===l.length?t():(Promise.all(l).then(t),e.l|=4,l.length=0)}},B=(o,i)=>{try{i=i.render(),o.l&=-17,o.l|=2,((o,i)=>{const f=o.O,a=o.P,u=o.T||g(null,null),$=(e=>e&&e.S===k)(i)?i:w(null,null,i);if(l=f.tagName,a.I&&($.m=$.m||{},a.I.map((([e,l])=>$.m[l]=f[e]))),$.S=null,$.l|=4,o.T=$,$.v=u.v=f,e=f["s-cr"],t=0!=(1&a.l),n=!1,L(u,$),c.l|=1,s){let e,l,t,n,s,o;A($.v);let i=0;for(;i<W.length;i++)e=W[i],l=e.j,l["s-ol"]||(t=r.createTextNode(""),t["s-nr"]=l,l.parentNode.insertBefore(l["s-ol"]=t,l));for(i=0;i<W.length;i++)if(e=W[i],l=e.j,e.M){for(n=e.M.parentNode,s=e.M.nextSibling,t=l["s-ol"];t=t.previousSibling;)if(o=t["s-nr"],o&&o["s-sn"]===l["s-sn"]&&n===o.parentNode&&(o=o.nextSibling,!o||!o["s-nr"])){s=o;break}(!s&&n!==l.parentNode||l.nextSibling!==s)&&l!==s&&(!l["s-hn"]&&l["s-ol"]&&(l["s-hn"]=l["s-ol"].parentNode.nodeName),n.insertBefore(l,s))}else 1===l.nodeType&&(l.hidden=!0)}n&&E($.v),c.l&=-2,W.length=0})(o,i)}catch(e){fe(e,o.O)}return null},G=e=>{const l=e.O,t=e.i,n=e.R;K(t,"componentDidRender"),64&e.l||(e.l|=64,X(l),K(t,"componentDidLoad"),e.L(l),n||J()),e.W(l),e.C&&(e.C(),e.C=void 0),512&e.l&&be((()=>V(e,!1))),e.l&=-517},J=()=>{X(r.documentElement),be((()=>U(i,"appload",{detail:{namespace:"twilight-components"}})))},K=(e,l,t)=>{if(e&&e[l])try{return e[l](t)}catch(e){fe(e)}},Q=(e,l)=>e&&e.then?e.then(l):l(),X=e=>e.classList.add("hydrated"),Y=(e,l,t,n,s,o,i)=>{let r,c,f,a;if(1===o.nodeType){for(r=o.getAttribute("c-id"),r&&(c=r.split("."),c[0]!==i&&"0"!==c[0]||(f={l:0,A:c[0],D:c[1],F:c[2],H:c[3],S:o.tagName.toLowerCase(),v:o,m:null,p:null,g:null,k:null,h:null},l.push(f),o.removeAttribute("c-id"),e.p||(e.p=[]),e.p[f.H]=f,e=f,n&&"0"===f.F&&(n[f.H]=f.v))),a=o.childNodes.length-1;a>=0;a--)Y(e,l,t,n,s,o.childNodes[a],i);if(o.shadowRoot)for(a=o.shadowRoot.childNodes.length-1;a>=0;a--)Y(e,l,t,n,s,o.shadowRoot.childNodes[a],i)}else if(8===o.nodeType)c=o.nodeValue.split("."),c[1]!==i&&"0"!==c[1]||(r=c[0],f={l:0,A:c[1],D:c[2],F:c[3],H:c[4],v:o,m:null,p:null,g:null,k:null,S:null,h:null},"t"===r?(f.v=o.nextSibling,f.v&&3===f.v.nodeType&&(f.h=f.v.textContent,l.push(f),o.remove(),e.p||(e.p=[]),e.p[f.H]=f,n&&"0"===f.F&&(n[f.H]=f.v))):f.A===i&&("s"===r?(f.S="slot",o["s-sn"]=c[5]?f.k=c[5]:"",o["s-sr"]=!0,t.push(f),e.p||(e.p=[]),e.p[f.H]=f):"r"===r&&(s["s-cr"]=o,o["s-cn"]=!0)));else if(e&&"style"===e.S){const l=g(null,o.textContent);l.v=o,l.H="0",e.p=[l]}},Z=(e,l)=>{if(1===e.nodeType){let t=0;for(;t<e.childNodes.length;t++)Z(e.childNodes[t],l);if(e.shadowRoot)for(t=0;t<e.shadowRoot.childNodes.length;t++)Z(e.shadowRoot.childNodes[t],l)}else if(8===e.nodeType){const t=e.nodeValue.split(".");"o"===t[0]&&(l.set(t[1]+"."+t[2],e),e.nodeValue="",e["s-en"]=t[3])}},ee=(e,l,t)=>{if(l.N){e.watchers&&(l.U=e.watchers);const n=Object.entries(l.N),s=e.prototype;if(n.map((([e,[n]])=>{31&n||2&t&&32&n?Object.defineProperty(s,e,{get(){return((e,l)=>oe(this).q.get(l))(0,e)},set(t){((e,l,t,n)=>{const s=oe(e),o=s.O,i=s.q.get(l),r=s.l,c=s.i;if(t=((e,l)=>null==e||b(e)?e:4&l?"false"!==e&&(""===e||!!e):2&l?parseFloat(e):1&l?e+"":e)(t,n.N[l][0]),!(8&r&&void 0!==i||t===i)&&(s.q.set(l,t),c)){if(n.U&&128&r){const e=n.U[l];e&&e.map((e=>{try{c[e](t,i,l)}catch(e){fe(e,o)}}))}2==(18&r)&&V(s,!1)}})(this,e,t,l)},configurable:!0,enumerable:!0}):1&t&&64&n&&Object.defineProperty(s,e,{value(...l){const t=oe(this);return t.V.then((()=>t.i[e](...l)))}})})),1&t){const t=new Map;s.attributeChangedCallback=function(e,l,n){c.jmp((()=>{const l=t.get(e);this.hasOwnProperty(l)&&(n=this[l],delete this[l]),this[l]=(null!==n||"boolean"!=typeof this[l])&&n}))},e.observedAttributes=n.filter((([e,l])=>15&l[0])).map((([e,n])=>{const s=n[1]||e;return t.set(s,e),512&n[0]&&l.I.push([e,s]),s}))}}return e},le=e=>{if(0==(1&c.l)){const l=oe(e),t=l.P,n=()=>{};if(1&l.l)u(e,l,t._);else{let n;l.l|=1,n=e.getAttribute("s-id"),n&&((e,l,t,n)=>{const s=e.shadowRoot,o=[],i=n.T=g(l,null);c.B||Z(r.body,c.B=new Map),e["s-id"]=t,e.removeAttribute("s-id"),Y(i,o,[],null,e,e,t),o.map((e=>{const t=e.A+"."+e.D,n=c.B.get(t),o=e.v;n&&""===n["s-en"]&&n.parentNode.insertBefore(o,n.nextSibling),s||(o["s-hn"]=l,n&&(o["s-ol"]=n,o["s-ol"]["s-nr"]=o)),c.B.delete(t)}))})(e,t.$,n,l),n||12&t.l&&te(e);{let t=e;for(;t=t.parentNode||t.host;)if(1===t.nodeType&&t.hasAttribute("s-id")&&t["s-p"]||t["s-p"]){q(l,l.R=t);break}}t.N&&Object.entries(t.N).map((([l,[t]])=>{if(31&t&&e.hasOwnProperty(l)){const t=e[l];delete e[l],e[l]=t}})),(async(e,l,t,n,s)=>{if(0==(32&l.l)){{if(l.l|=32,(s=ue(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(t.U=s.watchers,ee(s,t,2),s.isProxied=!0);const e=()=>{};l.l|=8;try{new s(l)}catch(e){fe(e)}l.l&=-9,l.l|=128,e()}if(s.style){let e=s.style;const l=m(t);if(!$e.has(l)){const n=()=>{};((e,l,t)=>{let n=$e.get(e);a&&t?(n=n||new CSSStyleSheet,n.replace(l)):n=l,$e.set(e,n)})(l,e,!!(1&t.l)),n()}}}const o=l.R,i=()=>V(l,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,l,t)}n()}},te=e=>{const l=e["s-cr"]=r.createComment("");l["s-cn"]=!0,e.insertBefore(l,e.firstChild)},ne=(e,l={})=>{const t=[],n=l.exclude||[],s=i.customElements,o=r.head,f=o.querySelector("meta[charset]"),a=r.createElement("style"),u=[];let $,d=!0;Object.assign(c,l),c.t=new URL(l.resourcesUrl||"./",r.baseURI).href,c.l|=2,e.map((e=>e[1].map((l=>{const o={l:l[0],$:l[1],N:l[2],_:l[3]};o.N=l[2],o._=l[3],o.I=[],o.U={};const i=o.$,r=class extends HTMLElement{constructor(e){super(e),re(e=this,o)}connectedCallback(){$&&(clearTimeout($),$=null),d?u.push(this):c.jmp((()=>le(this)))}disconnectedCallback(){c.jmp((()=>(()=>{if(0==(1&c.l)){const e=oe(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return oe(this).G}};o.J=e[0],n.includes(i)||s.get(i)||(t.push(i),s.define(i,ee(r,o,1)))})))),a.innerHTML=t+"{visibility:hidden}.hydrated{visibility:inherit}",a.setAttribute("data-styles",""),o.insertBefore(a,f?f.nextSibling:o.firstChild),d=!1,u.length?u.map((e=>e.connectedCallback())):c.jmp((()=>$=setTimeout(J,30)))},se=new WeakMap,oe=e=>se.get(e),ie=(e,l)=>se.set(l.i=e,l),re=(e,l)=>{const t={l:0,O:e,P:l,q:new Map};return t.V=new Promise((e=>t.W=e)),t.G=new Promise((e=>t.L=e)),e["s-p"]=[],e["s-rc"]=[],u(e,t,l._),se.set(e,t)},ce=(e,l)=>l in e,fe=(e,l)=>(0,console.error)(e,l),ae=new Map,ue=e=>{const l=e.$.replace(/-/g,"_"),t=e.J,n=ae.get(t);return n?n[l]:import(`./${t}.entry.js`).then((e=>(ae.set(t,e),e[l])),fe)},$e=new Map,de=[],he=[],ye=(e,l)=>t=>{e.push(t),o||(o=!0,l&&4&c.l?be(pe):c.raf(pe))},me=e=>{for(let l=0;l<e.length;l++)try{e[l](performance.now())}catch(e){fe(e)}e.length=0},pe=()=>{me(de),me(he),(o=de.length>0)&&c.raf(pe)},be=e=>f().then(e),we=ye(he,!0);export{k as H,ne as b,N as c,H as g,w as h,f as p,ie as r}
@@ -1 +0,0 @@
1
- import{r as s,c as i,h as a,H as t,g as e}from"./p-2e6ee2bc.js";import{H as l}from"./p-ed1c00c5.js";const o=class{constructor(a){s(this,a),this.modalOpened=i(this,"modalOpened",7),this.modalClosed=i(this,"modalClosed",7),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.icon="",this.iconStyle="",this.imageIcon="",l.setHost(this.host),salla.event.on("modal::open",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("modal::close",(s=>s.dataset.target==this.host.id&&this.hide())),this.title=this.host.title,this.host.removeAttribute("title")}handleVisible(s){if(!s)return this.toggleModal(!1),void this.modalClosed.emit();this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0))),this.modalOpened.emit()}async show(){return this.host.setAttribute("visible",""),this.host}async hide(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.title=s,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}toggleModal(s){const i=this.host.querySelector(".s-modal-body");l.toggleElementClassIf(i,"s-modal-entering","s-modal-leaving",(()=>s)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>s)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":"error"!=this.iconStyle&&"success"!=this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}iconClasses(){return{[this.icon]:!0,"sicon-alert-engine":!this.icon&&"error"==this.iconStyle&&!this.imageIcon,"sicon-check-circle2":!this.icon&&"success"==this.iconStyle&&!this.imageIcon}}render(){return this.host.id=this.host.id||"salla-modal",a(t,{class:"salla-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},a("div",{class:"s-modal-overlay",ref:s=>this.overlay=s,onClick:()=>this.closeModal()}),a("div",{class:"s-modal-wrapper"},a("span",{class:"s-modal-spacer s-modal-align-"+this.position},"​"),a("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.width+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},this.isLoading?a("div",{class:"s-modal-loader-wrap"},a("span",{class:"s-modal-loader"})):[a("div",{class:{"s-modal-header":!0,"s-modal-is-center":""!=this.icon||""!=this.imageIcon}},this.isClosable?a("button",{class:"s-modal-close",onClick:()=>this.closeModal(),type:"button"},a("span",{class:"sicon-cancel"})):"",this.title||this.subTitle?a("div",{class:"s-modal-header-inner"},this.iconStyle||this.icon?a("div",{class:this.iconBlockClasses()},a("i",{class:this.iconClasses()})):this.imageIcon?a("img",{class:"s-modal-header-img",src:this.imageIcon}):"",a("div",{class:"s-modal-header-content"},a("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.title}),a("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}))):""),a("slot",null),a("slot",{name:"footer"})])))}get host(){return e(this)}static get watchers(){return{visible:["handleVisible"]}}};o.style="";const r=class{constructor(i){var a;s(this,i),this.inputValue="",this.inline=!1,this.oval=!1,this.height=60,l.setHost(this.host),this.productSlot=(null===(a=l.getElement('[slot="product"]'))||void 0===a?void 0:a.innerHTML)||this.getDefaultProductSlot(),salla.event.on("search::show",(()=>this.modal.show())),salla.event.on("languages::translations.loaded",(()=>{this.placeholder=salla.lang.get("blocks.header.search_placeholder"),this.noResultsText=salla.lang.get("common.elements.no_options")}))}onModalOpen(){this.modal.querySelector(".s-search-input").focus()}onModalClose(){this.modal.querySelector(".s-search-input").value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price}</div></div>'}search(s){if(this.inputValue=s.target.value,l.hideElement(this.noResults),0===s.target.value.length)return this.results=void 0,void this.afterSearching();s.target.value.length<=2||(l.toggleElementClassIf(this.searchIcon,"s-search-spinner-loader","sicon-search",(()=>!0)),salla.search.api.search(s.target.value).then((s=>this.results=s)).catch((s=>"Query Same As Previous!"!==s?this.results=void 0:null)).finally((()=>this.afterSearching(!1))))}afterSearching(s=!0){var i;this.noResults.style.display=s||(null===(i=this.results)||void 0===i?void 0:i.data.length)>0?"none":"block",l.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>{var s;return null===(s=this.results)||void 0===s?void 0:s.data.length})).toggleElementClassIf(this.searchIcon,"s-search-spinner-loader","sicon-search",(()=>!1)),salla.search.api.previousQuery="",0==this.inputValue.length&&this.container.classList.remove("s-search-no-results")}render(){var s;const i=a("div",{class:{"s-search-container":!0,"s-search-inline":this.inline},ref:s=>this.container=s,style:this.oval?{borderRadius:this.height/2+"px"}:{}},a("input",{class:"s-search-input",type:"text",placeholder:this.placeholder,onInput:s=>this.search(s),style:{height:this.height+"px"}}),a("span",{class:"s-search-icon-wrap"},a("i",{class:"s-search-icon sicon-search",ref:s=>this.searchIcon=s})),a("div",{class:"s-search-results"},null===(s=this.results)||void 0===s?void 0:s.data.map((s=>a("a",{href:s.url,class:"s-search-product",innerHTML:this.productSlot.replace(/\{name\}/g,s.name).replace(/\{price\}/g,salla.money(s.price)).replace(/\{image\}/g,s.image_url)}))),a("p",{ref:s=>this.noResults=s,class:"s-search-no-results-placeholder"},this.noResultsText)));return this.inline?a("div",{id:"s-search-modal"},i):a("salla-modal",{position:"top",id:"s-search-modal",ref:s=>this.modal=s},i)}componentDidLoad(){this.afterSearching()}get host(){return e(this)}};r.style="#s-search-modal .s-search-inline{border:1px solid #eee}#s-search-modal .s-search-no-results .s-search-input,#s-search-modal .s-search-container-open .s-search-input{border-bottom:1px solid #f4f4f5}#s-search-modal .s-search-product-image[src=null]{opacity:0}#s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}#s-search-modal .s-modal-spacer{display:inline}#s-search-modal .s-modal-body{padding:0;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible}#s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";export{o as salla_modal,r as salla_search}
@@ -1 +0,0 @@
1
- import{r as s,h as e,g as a}from"./p-2e6ee2bc.js";const t=class{constructor(e){s(this,e),this.open=!1,this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.displayAs="default",this.browseProductsFrom="all",this.branches=[{id:1,name:"فرع الرياض",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:2,name:"فرع جدة",open:!1,available:!1,limited:!1,tag:"غير متوفر"},{id:3,name:"فرع مكة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:4,name:"فرع المدينة",open:!0,available:!0,limited:!1,tag:"متوفر"},{id:5,name:"فرع جازان",open:!0,available:!0,limited:!0,tag:"الكمية محدودة"}],this.current=1,this.currentBranch=s=>this.branches.filter((s=>s.id==this.current))[0][s],this.statusColor=(s=null)=>s?s.limited?"s-branches-color-red":s.available?"s-branches-color-green":"s-branches-color-gray":this.currentBranch("limited")?"s-branches-color-red":this.currentBranch("available")?"s-branches-color-green":"s-branches-color-gray",this.isChoiceable=()=>"all"!==this.browseProductsFrom&&"single"==this.position||"header"==this.position,this.formTitle=()=>this.isChoiceable()?"توفر المنتج في الفروع الآخرى":"التسوق من فرع آخر",salla.event.on("branches::show",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("languages::translations.loaded",(()=>{var s;return null===(s=this.btn)||void 0===s?void 0:s.setText(salla.lang.get("common.elements.ok"))}))}async show(){return this.modal.show()}async hide(){return this.modal.hide()}handelChange(s){this.selected=s.target.value}handleSubmit(){this.btn.load().then((()=>{setTimeout((()=>location.reload()),2e3)})),salla.storage.set("branch-choosed-before",!0),this.show(),setTimeout((()=>{this.current=this.selected}),300)}render(){return e("salla-modal",{icon:"sicon-store-alt",title:"فرع الرياض","sub-title":"أنت الآن تتصفح المتجر من","sub-title-first":!0,"is-closable":this.isOpenedBefore||"popup"!=this.displayAs?"true":"false",ref:s=>this.modal=s,width:"sm",id:"s-branches-modal",class:"s-hidden"},e("h4",{class:"s-branches-title"},this.formTitle()),this.branches.length<=5?e("div",{class:"s-branches-space-v"},this.branches.map((s=>e("div",{class:"s-branches-input-wrap"},e("input",{id:this.position+"_branch_"+s.id,disabled:!s.open&&this.isChoiceable(),name:"lang",type:"radio",value:s.id,onChange:s=>this.handelChange(s),class:{"s-branches-input":!0,"opacity-50":!s.open,"s-hidden":!this.isChoiceable()},checked:this.current==s.id}),e("label",{htmlFor:this.position+"_branch_"+s.id,class:{"s-branches-label":!0,"s-branches-clickable":this.isChoiceable()}},e("span",{class:{"s-branches-is-closed":!s.open}},s.name),this.isChoiceable()?e("small",{class:"s-branches-closed-badge"},s.open?"":"مُغلق"):e("span",{class:this.statusColor(s)},s.tag)))))):e("select",{class:"s-branches-select",onInput:s=>this.handelChange(s)},this.branches.map((s=>e("option",{value:s.id,disabled:!s.open,selected:this.selected==s.id},s.name," ",s.open?"":"- مُغلق")))),this.isChoiceable()?e("slot",{name:"footer"},e("salla-button",{ref:s=>this.btn=s,onClick:()=>this.handleSubmit(),class:"s-branches-submit",wide:!0},salla.lang.get("common.elements.ok"))):"")}componentDidRender(){this.isOpenedBefore||"popup"!=this.displayAs||this.show()}get host(){return a(this)}};t.style="";export{t as salla_branches}