@everymatrix/cashier-notifications 1.0.69 → 1.0.71

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.
@@ -0,0 +1 @@
1
+ "use strict";var G=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var k=(e,t,n)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))W.call(t,n)&&k(e,n,t[n]);if(M)for(var n of M(t))X.call(t,n)&&k(e,n,t[n]);return e},R=(e,t)=>K(e,Q(t));var f=(e,t,n)=>k(e,typeof t!="symbol"?t+"":t,n);var H=(e,t,n)=>new Promise((i,r)=>{var s=u=>{try{c(n.next(u))}catch(o){r(o)}},l=u=>{try{c(n.throw(u))}catch(o){r(o)}},c=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,l);c((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function v(){}function D(e){return e()}function z(){return Object.create(null)}function E(e){e.forEach(D)}function J(e){return typeof e=="function"}function Y(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Z(e){return Object.keys(e).length===0}function _(e,t){e.appendChild(t)}function tt(e,t,n){const i=et(e);if(!i.getElementById(t)){const r=x("style");r.id=t,r.textContent=n,nt(i,r)}}function et(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function nt(e,t){return _(e.head||e,t),t.sheet}function V(e,t,n){e.insertBefore(t,n||null)}function P(e){e.parentNode&&e.parentNode.removeChild(e)}function x(e){return document.createElement(e)}function L(e){return document.createTextNode(e)}function st(){return L(" ")}function it(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function j(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function rt(e){return Array.from(e.childNodes)}function I(e,t){t=""+t,e.data!==t&&(e.data=t)}function ot(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}let B;function w(e){B=e}const g=[],O=[];let y=[];const U=[],ct=Promise.resolve();let S=!1;function lt(){S||(S=!0,ct.then(b))}function A(e){y.push(e)}const N=new Set;let m=0;function b(){if(m!==0)return;const e=B;do{try{for(;m<g.length;){const t=g[m];m++,w(t),ut(t.$$)}}catch(t){throw g.length=0,m=0,t}for(w(null),g.length=0,m=0;O.length;)O.pop()();for(let t=0;t<y.length;t+=1){const n=y[t];N.has(n)||(N.add(n),n())}y.length=0}while(g.length);for(;U.length;)U.pop()();S=!1,N.clear(),w(e)}function ut(e){if(e.fragment!==null){e.update(),E(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(A)}}function at(e){const t=[],n=[];y.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),y=t}const ft=new Set;function $t(e,t){e&&e.i&&(ft.delete(e),e.i(t))}function ht(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),A(()=>{const s=e.$$.on_mount.map(D).filter(J);e.$$.on_destroy?e.$$.on_destroy.push(...s):E(s),e.$$.on_mount=[]}),r.forEach(A)}function dt(e,t){const n=e.$$;n.fragment!==null&&(at(n.after_update),E(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function mt(e,t){e.$$.dirty[0]===-1&&(g.push(e),lt(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function _t(e,t,n,i,r,s,l=null,c=[-1]){const u=B;w(e);const o=e.$$={fragment:null,ctx:[],props:s,update:v,not_equal:r,bound:z(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:z(),dirty:c,skip_bound:!1,root:t.target||u.$$.root};l&&l(o.root);let $=!1;if(o.ctx=n?n(e,t.props||{},(h,a,...p)=>{const d=p.length?p[0]:a;return o.ctx&&r(o.ctx[h],o.ctx[h]=d)&&(!o.skip_bound&&o.bound[h]&&o.bound[h](d),$&&mt(e,h)),a}):[],o.update(),$=!0,E(o.before_update),o.fragment=i?i(o.ctx):!1,t.target){if(t.hydrate){const h=rt(t.target);o.fragment&&o.fragment.l(h),h.forEach(P)}else o.fragment&&o.fragment.c();t.intro&&$t(e.$$.fragment),ht(e,t.target,t.anchor),b()}w(u)}let F;typeof HTMLElement=="function"&&(F=class extends HTMLElement{constructor(t,n,i){super();f(this,"$$ctor");f(this,"$$s");f(this,"$$c");f(this,"$$cn",!1);f(this,"$$d",{});f(this,"$$r",!1);f(this,"$$p_d",{});f(this,"$$l",{});f(this,"$$l_u",new Map);this.$$ctor=t,this.$$s=n,i&&this.attachShadow({mode:"open"})}addEventListener(t,n,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const r=this.$$c.$on(t,n);this.$$l_u.set(n,r)}super.addEventListener(t,n,i)}removeEventListener(t,n,i){if(super.removeEventListener(t,n,i),this.$$c){const r=this.$$l_u.get(n);r&&(r(),this.$$l_u.delete(n))}}connectedCallback(){return H(this,null,function*(){if(this.$$cn=!0,!this.$$c){let t=function(s){return()=>{let l;return{c:function(){l=x("slot"),s!=="default"&&j(l,"name",s)},m:function(o,$){V(o,l,$)},d:function(o){o&&P(l)}}}};if(yield Promise.resolve(),!this.$$cn||this.$$c)return;const n={},i=ot(this);for(const s of this.$$s)s in i&&(n[s]=[t(s)]);for(const s of this.attributes){const l=this.$$g_p(s.name);l in this.$$d||(this.$$d[l]=C(l,s.value,this.$$p_d,"toProp"))}for(const s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:R(T({},this.$$d),{$$slots:n,$$scope:{ctx:[]}})});const r=()=>{this.$$r=!0;for(const s in this.$$p_d)if(this.$$d[s]=this.$$c.$$.ctx[this.$$c.$$.props[s]],this.$$p_d[s].reflect){const l=C(s,this.$$d[s],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,l)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}})}attributeChangedCallback(t,n,i){var r;this.$$r||(t=this.$$g_p(t),this.$$d[t]=C(t,i,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function C(e,t,n,i){var s;const r=(s=n[e])==null?void 0:s.type;if(t=r==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(r){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t==null?null:t;default:return t}else switch(r){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function gt(e,t,n,i,r,s){let l=class extends F{constructor(){super(e,n,r),this.$$p_d=t}static get observedAttributes(){return Object.keys(t).map(c=>(t[c].attribute||c).toLowerCase())}};return Object.keys(t).forEach(c=>{Object.defineProperty(l.prototype,c,{get(){return this.$$c&&c in this.$$c?this.$$c[c]:this.$$d[c]},set(u){var o;u=C(c,u,t),this.$$d[c]=u,(o=this.$$c)==null||o.$set({[c]:u})}})}),i.forEach(c=>{Object.defineProperty(l.prototype,c,{get(){var u;return(u=this.$$c)==null?void 0:u[c]}})}),e.element=l,l}class bt{constructor(){f(this,"$$");f(this,"$$set")}$destroy(){dt(this,1),this.$destroy=v}$on(t,n){if(!J(n))return v;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!Z(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const yt="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(yt);function pt(e){tt(e,"svelte-enajx",".CashierNotifications.svelte-enajx.svelte-enajx{position:fixed;z-index:9;background-color:var(--emw--color-background, #111);color:var(--emw--color-white, #fff);display:flex;border-radius:var(--emw--border-radius-medium, 4px);align-items:center;gap:var(--emw--spacing-small, 12px);padding:var(--emw--spacing-small, 12px) var(--emw--spacing-medium, 15px);min-height:50px;pointer-events:auto;bottom:0;width:calc(100% - 30px)}.CashierNotifications.svelte-enajx span.svelte-enajx,.CashierNotifications.svelte-enajx button.svelte-enajx{font-family:inherit;border:none;font-variant:normal}.CashierNotifications.svelte-enajx span.svelte-enajx{line-height:normal}.CashierNotifications.svelte-enajx button.svelte-enajx{color:var(--emw--color-primary, #7EC51E);background-color:transparent;cursor:pointer;font-size:var(--emw--font-size-small, 14px);font-style:normal;font-weight:var(--emw--font-weight-bold, 700);font-family:inherit}")}function xt(e){let t,n,i,r,s,l,c,u;return{c(){t=x("div"),n=x("span"),i=L(e[0]),r=st(),s=x("button"),l=L(e[1]),j(n,"class","svelte-enajx"),j(s,"class","svelte-enajx"),j(t,"class","CashierNotifications svelte-enajx")},m(o,$){V(o,t,$),_(t,n),_(n,i),_(t,r),_(t,s),_(s,l),e[6](t),c||(u=it(s,"click",e[3]),c=!0)},p(o,[$]){$&1&&I(i,o[0]),$&2&&I(l,o[1])},i:v,o:v,d(o){o&&P(t),e[6](null),c=!1,u()}}}function wt(e,t,n){let{text:i}=t,{button:r}=t,{clientstyling:s=""}=t,{clientstylingurl:l=""}=t,c;const u=()=>{dispatchEvent(new CustomEvent("notificationButtonClick",{bubbles:!0,cancelable:!0,composed:!0}))},o=()=>{let a=document.createElement("style");a.innerHTML=s,c.appendChild(a)},$=()=>{let a=new URL(l),p=document.createElement("style");fetch(a.href).then(d=>d.text()).then(d=>{p.innerHTML=d,setTimeout(()=>{c.appendChild(p)},1)})};function h(a){O[a?"unshift":"push"](()=>{c=a,n(2,c)})}return e.$$set=a=>{"text"in a&&n(0,i=a.text),"button"in a&&n(1,r=a.button),"clientstyling"in a&&n(4,s=a.clientstyling),"clientstylingurl"in a&&n(5,l=a.clientstylingurl)},e.$$.update=()=>{e.$$.dirty&20&&s&&c&&o(),e.$$.dirty&36&&l&&c&&$()},[i,r,c,u,s,l,h]}class q extends bt{constructor(t){super(),_t(this,t,wt,xt,Y,{text:0,button:1,clientstyling:4,clientstylingurl:5},pt)}get text(){return this.$$.ctx[0]}set text(t){this.$$set({text:t}),b()}get button(){return this.$$.ctx[1]}set button(t){this.$$set({button:t}),b()}get clientstyling(){return this.$$.ctx[4]}set clientstyling(t){this.$$set({clientstyling:t}),b()}get clientstylingurl(){return this.$$.ctx[5]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),b()}}gt(q,{text:{},button:{},clientstyling:{},clientstylingurl:{}},[],[],!0);exports.default=q;
@@ -0,0 +1,585 @@
1
+ var q = Object.defineProperty, G = Object.defineProperties;
2
+ var K = Object.getOwnPropertyDescriptors;
3
+ var M = Object.getOwnPropertySymbols;
4
+ var Q = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
+ var k = (e, t, n) => t in e ? q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, R = (e, t) => {
6
+ for (var n in t || (t = {}))
7
+ Q.call(t, n) && k(e, n, t[n]);
8
+ if (M)
9
+ for (var n of M(t))
10
+ W.call(t, n) && k(e, n, t[n]);
11
+ return e;
12
+ }, T = (e, t) => G(e, K(t));
13
+ var f = (e, t, n) => k(e, typeof t != "symbol" ? t + "" : t, n);
14
+ var H = (e, t, n) => new Promise((i, r) => {
15
+ var s = (u) => {
16
+ try {
17
+ c(n.next(u));
18
+ } catch (o) {
19
+ r(o);
20
+ }
21
+ }, l = (u) => {
22
+ try {
23
+ c(n.throw(u));
24
+ } catch (o) {
25
+ r(o);
26
+ }
27
+ }, c = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(s, l);
28
+ c((n = n.apply(e, t)).next());
29
+ });
30
+ function v() {
31
+ }
32
+ function D(e) {
33
+ return e();
34
+ }
35
+ function z() {
36
+ return /* @__PURE__ */ Object.create(null);
37
+ }
38
+ function E(e) {
39
+ e.forEach(D);
40
+ }
41
+ function J(e) {
42
+ return typeof e == "function";
43
+ }
44
+ function X(e, t) {
45
+ return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
46
+ }
47
+ function Y(e) {
48
+ return Object.keys(e).length === 0;
49
+ }
50
+ function m(e, t) {
51
+ e.appendChild(t);
52
+ }
53
+ function Z(e, t, n) {
54
+ const i = tt(e);
55
+ if (!i.getElementById(t)) {
56
+ const r = x("style");
57
+ r.id = t, r.textContent = n, et(i, r);
58
+ }
59
+ }
60
+ function tt(e) {
61
+ if (!e) return document;
62
+ const t = e.getRootNode ? e.getRootNode() : e.ownerDocument;
63
+ return t && /** @type {ShadowRoot} */
64
+ t.host ? (
65
+ /** @type {ShadowRoot} */
66
+ t
67
+ ) : e.ownerDocument;
68
+ }
69
+ function et(e, t) {
70
+ return m(
71
+ /** @type {Document} */
72
+ e.head || e,
73
+ t
74
+ ), t.sheet;
75
+ }
76
+ function V(e, t, n) {
77
+ e.insertBefore(t, n || null);
78
+ }
79
+ function P(e) {
80
+ e.parentNode && e.parentNode.removeChild(e);
81
+ }
82
+ function x(e) {
83
+ return document.createElement(e);
84
+ }
85
+ function L(e) {
86
+ return document.createTextNode(e);
87
+ }
88
+ function nt() {
89
+ return L(" ");
90
+ }
91
+ function st(e, t, n, i) {
92
+ return e.addEventListener(t, n, i), () => e.removeEventListener(t, n, i);
93
+ }
94
+ function j(e, t, n) {
95
+ n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
96
+ }
97
+ function it(e) {
98
+ return Array.from(e.childNodes);
99
+ }
100
+ function I(e, t) {
101
+ t = "" + t, e.data !== t && (e.data = /** @type {string} */
102
+ t);
103
+ }
104
+ function rt(e) {
105
+ const t = {};
106
+ return e.childNodes.forEach(
107
+ /** @param {Element} node */
108
+ (n) => {
109
+ t[n.slot || "default"] = !0;
110
+ }
111
+ ), t;
112
+ }
113
+ let B;
114
+ function w(e) {
115
+ B = e;
116
+ }
117
+ const g = [], O = [];
118
+ let y = [];
119
+ const U = [], ot = /* @__PURE__ */ Promise.resolve();
120
+ let S = !1;
121
+ function ct() {
122
+ S || (S = !0, ot.then(b));
123
+ }
124
+ function A(e) {
125
+ y.push(e);
126
+ }
127
+ const N = /* @__PURE__ */ new Set();
128
+ let _ = 0;
129
+ function b() {
130
+ if (_ !== 0)
131
+ return;
132
+ const e = B;
133
+ do {
134
+ try {
135
+ for (; _ < g.length; ) {
136
+ const t = g[_];
137
+ _++, w(t), lt(t.$$);
138
+ }
139
+ } catch (t) {
140
+ throw g.length = 0, _ = 0, t;
141
+ }
142
+ for (w(null), g.length = 0, _ = 0; O.length; ) O.pop()();
143
+ for (let t = 0; t < y.length; t += 1) {
144
+ const n = y[t];
145
+ N.has(n) || (N.add(n), n());
146
+ }
147
+ y.length = 0;
148
+ } while (g.length);
149
+ for (; U.length; )
150
+ U.pop()();
151
+ S = !1, N.clear(), w(e);
152
+ }
153
+ function lt(e) {
154
+ if (e.fragment !== null) {
155
+ e.update(), E(e.before_update);
156
+ const t = e.dirty;
157
+ e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(A);
158
+ }
159
+ }
160
+ function ut(e) {
161
+ const t = [], n = [];
162
+ y.forEach((i) => e.indexOf(i) === -1 ? t.push(i) : n.push(i)), n.forEach((i) => i()), y = t;
163
+ }
164
+ const at = /* @__PURE__ */ new Set();
165
+ function ft(e, t) {
166
+ e && e.i && (at.delete(e), e.i(t));
167
+ }
168
+ function $t(e, t, n) {
169
+ const { fragment: i, after_update: r } = e.$$;
170
+ i && i.m(t, n), A(() => {
171
+ const s = e.$$.on_mount.map(D).filter(J);
172
+ e.$$.on_destroy ? e.$$.on_destroy.push(...s) : E(s), e.$$.on_mount = [];
173
+ }), r.forEach(A);
174
+ }
175
+ function ht(e, t) {
176
+ const n = e.$$;
177
+ n.fragment !== null && (ut(n.after_update), E(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
178
+ }
179
+ function dt(e, t) {
180
+ e.$$.dirty[0] === -1 && (g.push(e), ct(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
181
+ }
182
+ function _t(e, t, n, i, r, s, l = null, c = [-1]) {
183
+ const u = B;
184
+ w(e);
185
+ const o = e.$$ = {
186
+ fragment: null,
187
+ ctx: [],
188
+ // state
189
+ props: s,
190
+ update: v,
191
+ not_equal: r,
192
+ bound: z(),
193
+ // lifecycle
194
+ on_mount: [],
195
+ on_destroy: [],
196
+ on_disconnect: [],
197
+ before_update: [],
198
+ after_update: [],
199
+ context: new Map(t.context || (u ? u.$$.context : [])),
200
+ // everything else
201
+ callbacks: z(),
202
+ dirty: c,
203
+ skip_bound: !1,
204
+ root: t.target || u.$$.root
205
+ };
206
+ l && l(o.root);
207
+ let $ = !1;
208
+ if (o.ctx = n ? n(e, t.props || {}, (h, a, ...p) => {
209
+ const d = p.length ? p[0] : a;
210
+ return o.ctx && r(o.ctx[h], o.ctx[h] = d) && (!o.skip_bound && o.bound[h] && o.bound[h](d), $ && dt(e, h)), a;
211
+ }) : [], o.update(), $ = !0, E(o.before_update), o.fragment = i ? i(o.ctx) : !1, t.target) {
212
+ if (t.hydrate) {
213
+ const h = it(t.target);
214
+ o.fragment && o.fragment.l(h), h.forEach(P);
215
+ } else
216
+ o.fragment && o.fragment.c();
217
+ t.intro && ft(e.$$.fragment), $t(e, t.target, t.anchor), b();
218
+ }
219
+ w(u);
220
+ }
221
+ let F;
222
+ typeof HTMLElement == "function" && (F = class extends HTMLElement {
223
+ constructor(t, n, i) {
224
+ super();
225
+ /** The Svelte component constructor */
226
+ f(this, "$$ctor");
227
+ /** Slots */
228
+ f(this, "$$s");
229
+ /** The Svelte component instance */
230
+ f(this, "$$c");
231
+ /** Whether or not the custom element is connected */
232
+ f(this, "$$cn", !1);
233
+ /** Component props data */
234
+ f(this, "$$d", {});
235
+ /** `true` if currently in the process of reflecting component props back to attributes */
236
+ f(this, "$$r", !1);
237
+ /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
238
+ f(this, "$$p_d", {});
239
+ /** @type {Record<string, Function[]>} Event listeners */
240
+ f(this, "$$l", {});
241
+ /** @type {Map<Function, Function>} Event listener unsubscribe functions */
242
+ f(this, "$$l_u", /* @__PURE__ */ new Map());
243
+ this.$$ctor = t, this.$$s = n, i && this.attachShadow({ mode: "open" });
244
+ }
245
+ addEventListener(t, n, i) {
246
+ if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) {
247
+ const r = this.$$c.$on(t, n);
248
+ this.$$l_u.set(n, r);
249
+ }
250
+ super.addEventListener(t, n, i);
251
+ }
252
+ removeEventListener(t, n, i) {
253
+ if (super.removeEventListener(t, n, i), this.$$c) {
254
+ const r = this.$$l_u.get(n);
255
+ r && (r(), this.$$l_u.delete(n));
256
+ }
257
+ }
258
+ connectedCallback() {
259
+ return H(this, null, function* () {
260
+ if (this.$$cn = !0, !this.$$c) {
261
+ let t = function(s) {
262
+ return () => {
263
+ let l;
264
+ return {
265
+ c: function() {
266
+ l = x("slot"), s !== "default" && j(l, "name", s);
267
+ },
268
+ /**
269
+ * @param {HTMLElement} target
270
+ * @param {HTMLElement} [anchor]
271
+ */
272
+ m: function(o, $) {
273
+ V(o, l, $);
274
+ },
275
+ d: function(o) {
276
+ o && P(l);
277
+ }
278
+ };
279
+ };
280
+ };
281
+ if (yield Promise.resolve(), !this.$$cn || this.$$c)
282
+ return;
283
+ const n = {}, i = rt(this);
284
+ for (const s of this.$$s)
285
+ s in i && (n[s] = [t(s)]);
286
+ for (const s of this.attributes) {
287
+ const l = this.$$g_p(s.name);
288
+ l in this.$$d || (this.$$d[l] = C(l, s.value, this.$$p_d, "toProp"));
289
+ }
290
+ for (const s in this.$$p_d)
291
+ !(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]);
292
+ this.$$c = new this.$$ctor({
293
+ target: this.shadowRoot || this,
294
+ props: T(R({}, this.$$d), {
295
+ $$slots: n,
296
+ $$scope: {
297
+ ctx: []
298
+ }
299
+ })
300
+ });
301
+ const r = () => {
302
+ this.$$r = !0;
303
+ for (const s in this.$$p_d)
304
+ if (this.$$d[s] = this.$$c.$$.ctx[this.$$c.$$.props[s]], this.$$p_d[s].reflect) {
305
+ const l = C(
306
+ s,
307
+ this.$$d[s],
308
+ this.$$p_d,
309
+ "toAttribute"
310
+ );
311
+ l == null ? this.removeAttribute(this.$$p_d[s].attribute || s) : this.setAttribute(this.$$p_d[s].attribute || s, l);
312
+ }
313
+ this.$$r = !1;
314
+ };
315
+ this.$$c.$$.after_update.push(r), r();
316
+ for (const s in this.$$l)
317
+ for (const l of this.$$l[s]) {
318
+ const c = this.$$c.$on(s, l);
319
+ this.$$l_u.set(l, c);
320
+ }
321
+ this.$$l = {};
322
+ }
323
+ });
324
+ }
325
+ // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
326
+ // and setting attributes through setAttribute etc, this is helpful
327
+ attributeChangedCallback(t, n, i) {
328
+ var r;
329
+ this.$$r || (t = this.$$g_p(t), this.$$d[t] = C(t, i, this.$$p_d, "toProp"), (r = this.$$c) == null || r.$set({ [t]: this.$$d[t] }));
330
+ }
331
+ disconnectedCallback() {
332
+ this.$$cn = !1, Promise.resolve().then(() => {
333
+ !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
334
+ });
335
+ }
336
+ $$g_p(t) {
337
+ return Object.keys(this.$$p_d).find(
338
+ (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t
339
+ ) || t;
340
+ }
341
+ });
342
+ function C(e, t, n, i) {
343
+ var s;
344
+ const r = (s = n[e]) == null ? void 0 : s.type;
345
+ if (t = r === "Boolean" && typeof t != "boolean" ? t != null : t, !i || !n[e])
346
+ return t;
347
+ if (i === "toAttribute")
348
+ switch (r) {
349
+ case "Object":
350
+ case "Array":
351
+ return t == null ? null : JSON.stringify(t);
352
+ case "Boolean":
353
+ return t ? "" : null;
354
+ case "Number":
355
+ return t == null ? null : t;
356
+ default:
357
+ return t;
358
+ }
359
+ else
360
+ switch (r) {
361
+ case "Object":
362
+ case "Array":
363
+ return t && JSON.parse(t);
364
+ case "Boolean":
365
+ return t;
366
+ case "Number":
367
+ return t != null ? +t : t;
368
+ default:
369
+ return t;
370
+ }
371
+ }
372
+ function mt(e, t, n, i, r, s) {
373
+ let l = class extends F {
374
+ constructor() {
375
+ super(e, n, r), this.$$p_d = t;
376
+ }
377
+ static get observedAttributes() {
378
+ return Object.keys(t).map(
379
+ (c) => (t[c].attribute || c).toLowerCase()
380
+ );
381
+ }
382
+ };
383
+ return Object.keys(t).forEach((c) => {
384
+ Object.defineProperty(l.prototype, c, {
385
+ get() {
386
+ return this.$$c && c in this.$$c ? this.$$c[c] : this.$$d[c];
387
+ },
388
+ set(u) {
389
+ var o;
390
+ u = C(c, u, t), this.$$d[c] = u, (o = this.$$c) == null || o.$set({ [c]: u });
391
+ }
392
+ });
393
+ }), i.forEach((c) => {
394
+ Object.defineProperty(l.prototype, c, {
395
+ get() {
396
+ var u;
397
+ return (u = this.$$c) == null ? void 0 : u[c];
398
+ }
399
+ });
400
+ }), e.element = /** @type {any} */
401
+ l, l;
402
+ }
403
+ class gt {
404
+ constructor() {
405
+ /**
406
+ * ### PRIVATE API
407
+ *
408
+ * Do not use, may change at any time
409
+ *
410
+ * @type {any}
411
+ */
412
+ f(this, "$$");
413
+ /**
414
+ * ### PRIVATE API
415
+ *
416
+ * Do not use, may change at any time
417
+ *
418
+ * @type {any}
419
+ */
420
+ f(this, "$$set");
421
+ }
422
+ /** @returns {void} */
423
+ $destroy() {
424
+ ht(this, 1), this.$destroy = v;
425
+ }
426
+ /**
427
+ * @template {Extract<keyof Events, string>} K
428
+ * @param {K} type
429
+ * @param {((e: Events[K]) => void) | null | undefined} callback
430
+ * @returns {() => void}
431
+ */
432
+ $on(t, n) {
433
+ if (!J(n))
434
+ return v;
435
+ const i = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
436
+ return i.push(n), () => {
437
+ const r = i.indexOf(n);
438
+ r !== -1 && i.splice(r, 1);
439
+ };
440
+ }
441
+ /**
442
+ * @param {Partial<Props>} props
443
+ * @returns {void}
444
+ */
445
+ $set(t) {
446
+ this.$$set && !Y(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
447
+ }
448
+ }
449
+ const bt = "4";
450
+ typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(bt);
451
+ function yt(e) {
452
+ Z(e, "svelte-enajx", ".CashierNotifications.svelte-enajx.svelte-enajx{position:fixed;z-index:9;background-color:var(--emw--color-background, #111);color:var(--emw--color-white, #fff);display:flex;border-radius:var(--emw--border-radius-medium, 4px);align-items:center;gap:var(--emw--spacing-small, 12px);padding:var(--emw--spacing-small, 12px) var(--emw--spacing-medium, 15px);min-height:50px;pointer-events:auto;bottom:0;width:calc(100% - 30px)}.CashierNotifications.svelte-enajx span.svelte-enajx,.CashierNotifications.svelte-enajx button.svelte-enajx{font-family:inherit;border:none;font-variant:normal}.CashierNotifications.svelte-enajx span.svelte-enajx{line-height:normal}.CashierNotifications.svelte-enajx button.svelte-enajx{color:var(--emw--color-primary, #7EC51E);background-color:transparent;cursor:pointer;font-size:var(--emw--font-size-small, 14px);font-style:normal;font-weight:var(--emw--font-weight-bold, 700);font-family:inherit}");
453
+ }
454
+ function pt(e) {
455
+ let t, n, i, r, s, l, c, u;
456
+ return {
457
+ c() {
458
+ t = x("div"), n = x("span"), i = L(
459
+ /*text*/
460
+ e[0]
461
+ ), r = nt(), s = x("button"), l = L(
462
+ /*button*/
463
+ e[1]
464
+ ), j(n, "class", "svelte-enajx"), j(s, "class", "svelte-enajx"), j(t, "class", "CashierNotifications svelte-enajx");
465
+ },
466
+ m(o, $) {
467
+ V(o, t, $), m(t, n), m(n, i), m(t, r), m(t, s), m(s, l), e[6](t), c || (u = st(
468
+ s,
469
+ "click",
470
+ /*notificationClick*/
471
+ e[3]
472
+ ), c = !0);
473
+ },
474
+ p(o, [$]) {
475
+ $ & /*text*/
476
+ 1 && I(
477
+ i,
478
+ /*text*/
479
+ o[0]
480
+ ), $ & /*button*/
481
+ 2 && I(
482
+ l,
483
+ /*button*/
484
+ o[1]
485
+ );
486
+ },
487
+ i: v,
488
+ o: v,
489
+ d(o) {
490
+ o && P(t), e[6](null), c = !1, u();
491
+ }
492
+ };
493
+ }
494
+ function xt(e, t, n) {
495
+ let { text: i } = t, { button: r } = t, { clientstyling: s = "" } = t, { clientstylingurl: l = "" } = t, c;
496
+ const u = () => {
497
+ dispatchEvent(new CustomEvent(
498
+ "notificationButtonClick",
499
+ {
500
+ bubbles: !0,
501
+ cancelable: !0,
502
+ composed: !0
503
+ }
504
+ ));
505
+ }, o = () => {
506
+ let a = document.createElement("style");
507
+ a.innerHTML = s, c.appendChild(a);
508
+ }, $ = () => {
509
+ let a = new URL(l), p = document.createElement("style");
510
+ fetch(a.href).then((d) => d.text()).then((d) => {
511
+ p.innerHTML = d, setTimeout(
512
+ () => {
513
+ c.appendChild(p);
514
+ },
515
+ 1
516
+ );
517
+ });
518
+ };
519
+ function h(a) {
520
+ O[a ? "unshift" : "push"](() => {
521
+ c = a, n(2, c);
522
+ });
523
+ }
524
+ return e.$$set = (a) => {
525
+ "text" in a && n(0, i = a.text), "button" in a && n(1, r = a.button), "clientstyling" in a && n(4, s = a.clientstyling), "clientstylingurl" in a && n(5, l = a.clientstylingurl);
526
+ }, e.$$.update = () => {
527
+ e.$$.dirty & /*clientstyling, customStylingContainer*/
528
+ 20 && s && c && o(), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
529
+ 36 && l && c && $();
530
+ }, [
531
+ i,
532
+ r,
533
+ c,
534
+ u,
535
+ s,
536
+ l,
537
+ h
538
+ ];
539
+ }
540
+ class wt extends gt {
541
+ constructor(t) {
542
+ super(), _t(
543
+ this,
544
+ t,
545
+ xt,
546
+ pt,
547
+ X,
548
+ {
549
+ text: 0,
550
+ button: 1,
551
+ clientstyling: 4,
552
+ clientstylingurl: 5
553
+ },
554
+ yt
555
+ );
556
+ }
557
+ get text() {
558
+ return this.$$.ctx[0];
559
+ }
560
+ set text(t) {
561
+ this.$$set({ text: t }), b();
562
+ }
563
+ get button() {
564
+ return this.$$.ctx[1];
565
+ }
566
+ set button(t) {
567
+ this.$$set({ button: t }), b();
568
+ }
569
+ get clientstyling() {
570
+ return this.$$.ctx[4];
571
+ }
572
+ set clientstyling(t) {
573
+ this.$$set({ clientstyling: t }), b();
574
+ }
575
+ get clientstylingurl() {
576
+ return this.$$.ctx[5];
577
+ }
578
+ set clientstylingurl(t) {
579
+ this.$$set({ clientstylingurl: t }), b();
580
+ }
581
+ }
582
+ mt(wt, { text: {}, button: {}, clientstyling: {}, clientstylingurl: {} }, [], [], !0);
583
+ export {
584
+ wt as default
585
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-notifications",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "type": "module",
5
5
  "main": "es2015/cashier-notifications.cjs",
6
6
  "module": "es2015/cashier-notifications.js",
@@ -11,8 +11,9 @@
11
11
  },
12
12
  "./es2015/cashier-notifications.cjs": "./es2015/cashier-notifications.cjs"
13
13
  },
14
- "files": [
15
- "es2015/"
14
+ "files": [
15
+ "es2015/",
16
+ "components"
16
17
  ],
17
18
  "publishConfig": {
18
19
  "access": "public"