@salla.sa/twilight-bundles 0.1.3 → 0.1.5

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,23 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const N=globalThis,V=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol(),G=new WeakMap;let at=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==J)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(V&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=G.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&G.set(e,t))}return t}toString(){return this.cssText}};const ut=n=>new at(typeof n=="string"?n:n+"",void 0,J),pt=(n,...t)=>{const e=n.length===1?n[0]:t.reduce(((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[r+1]),n[0]);return new at(e,n,J)},mt=(n,t)=>{if(V)n.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),i=N.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},Q=V?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ut(e)})(n):n;/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const{is:$t,defineProperty:ft,getOwnPropertyDescriptor:gt,getOwnPropertyNames:_t,getOwnPropertySymbols:yt,getPrototypeOf:At}=Object,f=globalThis,X=f.trustedTypes,St=X?X.emptyScript:"",L=f.reactiveElementPolyfillSupport,P=(n,t)=>n,k={toAttribute(n,t){switch(t){case Boolean:n=n?St:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},K=(n,t)=>!$t(n,t),Y={attribute:!0,type:String,converter:k,reflect:!1,useDefault:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class w extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&ft(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=gt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){const l=i==null?void 0:i.call(this);r==null||r.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=At(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[..._t(e),...yt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Q(i))}else t!==void 0&&e.push(Q(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return mt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var r;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:k).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var r,o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const l=s.getPropertyOptions(i),a=typeof l.converter=="function"?{fromAttribute:l.converter}:((r=l.converter)==null?void 0:r.fromAttribute)!==void 0?l.converter:k;this._$Em=i;const c=a.fromAttribute(e,l.type);this[i]=c??((o=this._$Ej)==null?void 0:o.get(i))??c,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const r=this.constructor,o=this[t];if(s??(s=r.getPropertyOptions(t)),!((s.hasChanged??K)(o,e)||s.useDefault&&s.reflect&&o===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i){const{wrapped:l}=o,a=this[r];l!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,o,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)})),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}}w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[P("elementProperties")]=new Map,w[P("finalized")]=new Map,L==null||L({ReactiveElement:w}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.1.1");/**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const T=globalThis,D=T.trustedTypes,tt=D?D.createPolicy("lit-html",{createHTML:n=>n}):void 0,lt="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,ht="?"+$,vt=`<${ht}>`,S=document,x=()=>S.createComment(""),U=n=>n===null||typeof n!="object"&&typeof n!="function",Z=Array.isArray,wt=n=>Z(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",B=`[
14
+ \f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,et=/-->/g,st=/>/g,g=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,nt=/"/g,ct=/^(?:script|style|textarea|title)$/i,b=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ot=new WeakMap,_=S.createTreeWalker(S,129);function dt(n,t){if(!Z(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return tt!==void 0?tt.createHTML(t):t}const bt=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":t===3?"<math>":"",o=C;for(let l=0;l<e;l++){const a=n[l];let c,u,h=-1,p=0;for(;p<a.length&&(o.lastIndex=p,u=o.exec(a),u!==null);)p=o.lastIndex,o===C?u[1]==="!--"?o=et:u[1]!==void 0?o=st:u[2]!==void 0?(ct.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=g):u[3]!==void 0&&(o=g):o===g?u[0]===">"?(o=i??C,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?g:u[3]==='"'?nt:it):o===nt||o===it?o=g:o===et||o===st?o=C:(o=g,i=void 0);const m=o===g&&n[l+1].startsWith("/>")?" ":"";r+=o===C?a+vt:h>=0?(s.push(c),a.slice(0,h)+lt+a.slice(h)+$+m):a+$+(h===-2?l:m)}return[dt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class O{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const l=t.length-1,a=this.parts,[c,u]=bt(t,e);if(this.el=O.createElement(c,s),_.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=_.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(lt)){const p=u[o++],m=i.getAttribute(h).split($),H=/([.?@])?(.*)/.exec(p);a.push({type:1,index:r,name:H[2],strings:m,ctor:H[1]==="."?Ct:H[1]==="?"?Pt:H[1]==="@"?Tt:j}),i.removeAttribute(h)}else h.startsWith($)&&(a.push({type:6,index:r}),i.removeAttribute(h));if(ct.test(i.tagName)){const h=i.textContent.split($),p=h.length-1;if(p>0){i.textContent=D?D.emptyScript:"";for(let m=0;m<p;m++)i.append(h[m],x()),_.nextNode(),a.push({type:2,index:++r});i.append(h[p],x())}}}else if(i.nodeType===8)if(i.data===ht)a.push({type:2,index:r});else{let h=-1;for(;(h=i.data.indexOf($,h+1))!==-1;)a.push({type:7,index:r}),h+=$.length-1}r++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function E(n,t,e=n,s){var o,l;if(t===b)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=U(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(n,i._$AS(n,t.values),i,s)),t}class Et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??S).importNode(e,!0);_.currentNode=i;let r=_.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new R(r,r.nextSibling,this,t):a.type===1?c=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(c=new Mt(r,this,t)),this._$AV.push(c),a=s[++l]}o!==(a==null?void 0:a.index)&&(r=_.nextNode(),o++)}return _.currentNode=S,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class R{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):wt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=O.createElement(dt(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(e);else{const o=new Et(i,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=ot.get(t.strings);return e===void 0&&ot.set(t.strings,e=new O(t)),e}k(t){Z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new R(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class j{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=E(this,t,e,0),o=!U(t)||t!==this._$AH&&t!==b,o&&(this._$AH=t);else{const l=t;let a,c;for(t=r[0],a=0;a<r.length-1;a++)c=E(this,l[s+a],e,a),c===b&&(c=this._$AH[a]),o||(o=!U(c)||c!==this._$AH[a]),c===d?t=d:t!==d&&(t+=(c??"")+r[a+1]),this._$AH[a]=c}o&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Pt extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Tt extends j{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??d)===b)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Mt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}}const q=T.litHtmlPolyfillSupport;q==null||q(O,R),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.3.1");const xt=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new R(t.insertBefore(x(),r),r,void 0,e??{})}return i._$AI(n),i};/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */const A=globalThis;class M extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=xt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return b}}var rt;M._$litElement$=!0,M.finalized=!0,(rt=A.litElementHydrateSupport)==null||rt.call(A,{LitElement:M});const W=A.litElementPolyfillSupport;W==null||W({LitElement:M});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.1");/**
20
+ * @license
21
+ * Copyright 2017 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ */const Ut={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:K},Ot=(n=Ut,t,e)=>{const{kind:s,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),s==="setter"&&((n=Object.create(n)).wrapped=!0),r.set(e.name,n),s==="accessor"){const{name:o}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(o,a,n)},init(l){return l!==void 0&&this.C(o,void 0,n,l),l}}}if(s==="setter"){const{name:o}=e;return function(l){const a=this[o];t.call(this,l),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+s)};function z(n){return(t,e)=>typeof e=="object"?Ot(n,t,e):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,t,e)}class y{static onBundlesReady(){return y.makeSureSallaIsReady().then(()=>Salla.event.onlyWhen("twilight-bundles::initiated"))}static async initializeSalla(){if(Salla.status==="ready"){salla.log("Salla is ready");return}const t=document.currentScript||document.querySelector('script[src*="twilight-bundles.js"]'),e=t==null?void 0:t.hasAttribute("demo-mode");let s=t==null?void 0:t.getAttribute("store-id"),i=JSON.parse((t==null?void 0:t.getAttribute("config"))||"false");return e||i||s?(s=s||"1510890315",i=i||await y.getStoreSettings(s),Salla.init(i||{debug:!0,store:{id:s}})):Salla.onReady()}static async getStoreSettings(t){let e=Salla.storage.session.get(`store-settings-${t}`);return e||(e=(await fetch("https://api.salla.dev/store/v1/store/settings",{headers:{"store-identifier":t}}).then(s=>s.json())).data,Salla.storage.session.set(`store-settings-${t}`,e),e)}static makeSureSallaIsReady(){return window.Salla?Promise.resolve(y.initializeSalla()):new Promise((t,e)=>{let s;const i=setTimeout(()=>{window.clearInterval(s),e(new Error("Timeout: Salla object not found after 10 seconds"))},1e4);s=window.setInterval(()=>{window.Salla&&(window.clearInterval(s),clearTimeout(i),t(y.initializeSalla()))},50)})}}var Rt=Object.defineProperty,I=(n,t,e,s)=>{for(var i=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=o(t,e,i)||i);return i&&Rt(t,e,i),i};const F=class F extends M{constructor(){super(...arguments),this.key="",this.data={},this.imports={},this.shadowRootMode="open"}createRenderRoot(){return this.shadowRootMode!==!1?this.attachShadow({mode:this.shadowRootMode||"closed"}):this}static register(t){const e={component:this,dynamicTagName:`${t}-${Math.random().toString(36).substring(2,8)}`};return y.onBundlesReady().then(()=>Salla.bundles.registerComponent(t,e))}};F.styles=pt`:host { display: block; }`;let v=F;I([z()],v.prototype,"key");I([z()],v.prototype,"data");I([z()],v.prototype,"imports");I([z()],v.prototype,"shadowRootMode");class Ht extends HTMLElement{connectedCallback(){var e;let t=(e=this.getAttribute("component-name"))==null?void 0:e.replace(/^salla-/,"");if(!t)return Salla.error("Component name is required",this),Promise.resolve();this.innerHTML=`<!-- Loading ${t} -->`,this.removeAttribute("component-name"),Salla.bundles.renderCustomComponentDom(`salla-${t}`,this)}}class Nt{constructor(){this.components=new Map,this.pendingComponents=[],this.initialized=!1,Salla.onReady().then(()=>{if(Salla.bundles){Salla.log("TwilightBundles is already initialized");return}this.init(),Salla.bundles=this,Salla.event.emit("twilight-bundles::initiated"),this.registerCustomComponents()})}async init(){this.initialized||(this.initialized=!0)}registerCustomComponents(){var t;HTMLElement.registerSallaComponent=function(e){Salla.bundles.registerComponent(e,{component:this,dynamicTagName:`${e}-${Math.random().toString(36).substring(2,8)}`})},(t=window.customComponents)==null||t.forEach(e=>{const s=document.createElement("script");s.type="module",s.src=e,document.head.appendChild(s)})}renderCustomComponentDom(t,e){salla.log("Rendering custom component",t),e.getAttribute("component-name");const s=this.components.get(t);return s?this.renderDynamicCustomComponentDom(s.dynamicTagName,e):this.pendingComponents.push({tagName:t,component:e})}renderDynamicCustomComponentDom(t,e){const s=document.createElement(t);Array.from(e.attributes).forEach(i=>s.setAttribute(i.name,i.value||"")),e.before(s),e.remove()}registerComponent(t,e){if(this.components.has(t))return console.warn(`Component ${t} is already registered into the this.components map. Skipping.`);if(!e.dynamicTagName)return console.warn(`Component ${t} is missing dynamicTagName. Skipping.`);if(!e.component)return console.warn(`Component ${t} is missing component. Skipping.`);if(window.customElements.get(e.dynamicTagName))return console.warn(`Component ${e.dynamicTagName} is already registered into the window custom elements. Skipping.`);window.customElements.define(e.dynamicTagName,e.component),this.components.set(t,e),Salla.log("Component registered:",e.dynamicTagName);const s=this.pendingComponents.filter(i=>i.tagName===t);s.length&&(s.forEach(i=>{this.renderDynamicCustomComponentDom(e.dynamicTagName,i.component)}),this.pendingComponents=this.pendingComponents.filter(i=>i.tagName!==t),Salla.log("Pending Components rendered:",t,e.dynamicTagName))}renderSharedAssests(...t){const e={sallaicons:`<link rel="stylesheet" href="${Salla.url.cdn("fonts/sallaicons.css")}">`};return t.map(s=>e[s]||"").join("")}}y.makeSureSallaIsReady().then(()=>new Nt).then(()=>window.customElements.get("salla-custom-component")||window.customElements.define("salla-custom-component",Ht));exports.SallaComponent=v;
@@ -0,0 +1 @@
1
+ :root{--font-main: "PingARLT";--color-primary-50: rgb(186, 243, 230);--color-primary-100: rgb(120, 232, 206);--color-primary-900: rgb(0, 73, 86);--color-primary: rgb(0, 78, 92)}:root[data-theme=dark]{--bg-primary: #1E1E1E;--bg-secondary: #2A2A2A;--text-primary: #FFFFFF;--text-secondary: #9CA3AF;--border-color: #333333;--color-primary: #1d1e20;--component-title: #baf3e5}:root[data-theme=light]{--bg-primary: #FFFFFF;--bg-secondary: #F8F9FA;--text-primary: #1E1E1E;--text-secondary: #4B5563;--border-color: #E5E7EB;--component-title: #004e5c}*{margin:0;padding:0;box-sizing:border-box;font-family:var(--font-main)}body{min-height:100vh}header{background-color:var(--color-primary);padding:.75rem 0;box-shadow:0 2px 4px #0000001a}.container{max-width:1200px;margin:0 auto;padding:0 .75rem}.header-content{display:flex;align-items:center;justify-content:space-between}.logo-container{display:flex;align-items:center;gap:1rem}.logo{height:40px}.logo img{height:100%;width:auto}.title{color:#fff;font-size:1.25rem;font-weight:500;margin:0}.actions{display:flex;gap:1rem;align-items:center}.actions button{background:transparent;border:none;color:#fff;cursor:pointer;padding:.5rem;border-radius:4px;transition:color .2s ease;font-size:1rem;display:flex;align-items:center;gap:.5rem}.actions button:hover{color:rgb(var(--color-primary-100))}.theme-icon{transition:transform .3s ease}[data-theme=dark] .theme-icon.moon,[data-theme=light] .theme-icon.sun{display:none}.lang-icon{transition:transform .3s ease}[dir=rtl] .lang-icon{transform:scaleX(-1)}.lang-code{font-size:.875rem;font-weight:500;text-transform:uppercase}main{padding:1.5rem 0}.component-card{min-height:60px;position:relative}.component-card-header{position:absolute;z-index:10;top:50%;transform:translateY(-50%) translate(-100%);left:0;opacity:0;transition:all .3s ease}.component-card:hover .component-card-header{opacity:1;transform:translateY(-50%) translate(0)}.component-card-actions{display:flex;flex-direction:column;gap:.5rem;background:#fff;padding:10px;border-radius:0 5px 5px 0;box-shadow:11px 0 20px -10px #0000000d,8px 3px 13px -4px #0000000d}.component-visibility-btn,.component-settings-btn{background:transparent;border:1px solid var(--border-color);color:var(--text-secondary);cursor:pointer;width:32px;height:32px;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all .2s ease}.component-visibility-btn:hover,.component-settings-btn:hover{background-color:var(--bg-secondary);color:var(--text-primary)}.component-card.hidden{opacity:.5;position:relative}.component-card.hidden:after{content:"Hidden";position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:#0000001a;font-size:1.5rem;font-weight:700;color:var(--text-secondary);z-index:10}.drawer-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#00000080;z-index:999;opacity:0;visibility:hidden;transition:all .3s ease}.drawer-overlay.active{opacity:1;visibility:visible}.drawer{position:fixed;top:0;bottom:0;background-color:var(--bg-primary);width:400px;max-width:100%;z-index:1000;box-shadow:0 0 10px #0000001a;transition:transform .3s ease;overflow-y:auto;opacity:0;visibility:hidden}#settingsDrawer{width:500px}.drawer.active{opacity:1;visibility:visible}[dir=ltr] .drawer{right:0;transform:translate(100%)}[dir=rtl] .drawer{left:0;transform:translate(-100%)}.drawer.active{transform:translate(0)}.drawer-header{display:flex;justify-content:space-between;align-items:center;padding:1.25rem 1.5rem;border-bottom:1px solid var(--border-color);background-color:var(--bg-secondary);box-shadow:0 2px 4px #0000000d}.drawer-header h3{margin:0;color:var(--text-primary);flex:1;font-size:1.25rem;font-weight:600;letter-spacing:.01em}.drawer-actions{display:flex;align-items:center;gap:.75rem}.drawer-close,.drawer-reset{background-color:var(--bg-primary);border:1px solid var(--border-color);border-radius:6px;cursor:pointer;font-size:1.25rem;color:var(--text-secondary);padding:.5rem;width:36px;height:36px;display:flex;align-items:center;justify-content:center;transition:all .2s ease;box-shadow:0 1px 2px #0000000d}.drawer-close:hover,.drawer-reset:hover{background-color:var(--bg-secondary);color:var(--text-primary);transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.drawer-close:active,.drawer-reset:active{transform:translateY(0);box-shadow:0 1px 2px #0000000d}.drawer-reset{color:var(--color-primary)}.drawer-close{color:var(--color-danger, var(--text-secondary))}.drawer-content{padding:1rem}.filter-actions{display:flex;gap:1rem;margin-bottom:1rem}.btn{padding:.5rem 1rem;border-radius:4px;border:none;cursor:pointer;font-weight:500;transition:all .2s ease}.btn-primary:hover{background-color:var(--color-primary-50)}.btn-secondary{background-color:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border-color)}.btn-secondary:hover{background-color:var(--bg-primary)}.component-visibility-list{display:flex;flex-direction:column;gap:.75rem;overflow-y:auto}.visibility-item{padding:.5rem;border-radius:4px;transition:background-color .2s ease}.visibility-item:hover{background-color:var(--bg-secondary)}.visibility-item label{display:flex;align-items:center;gap:.75rem;cursor:pointer;color:var(--text-primary)}.visibility-checkbox{width:1.25rem;height:1.25rem;cursor:pointer}.settings-tabs{display:flex;flex-direction:column;gap:1.5rem}.settings-tab-headers{display:flex;border-bottom:1px solid var(--border-color);margin-bottom:1rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.settings-tab-btn{padding:.75rem 1rem;background:none;border:none;border-bottom:2px solid transparent;color:var(--text-secondary);cursor:pointer;font-weight:500;white-space:nowrap;transition:all .2s ease}.settings-tab-btn:hover{color:var(--text-primary)}.settings-tab-btn.active{color:var(--color-primary);border-bottom-color:var(--color-primary)}.settings-tab-content{display:none;animation:fadeIn .3s ease}.settings-tab-content.active{display:block}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.settings-section-title{margin:0 0 .5rem;font-size:1.1rem;font-weight:600;color:var(--text-primary)}.settings-section-desc{margin:0 0 1.5rem;font-size:.9rem;color:var(--text-secondary)}.settings-form-group{margin-bottom:1.25rem}.settings-form-group label{display:block;margin-bottom:.5rem;font-weight:500;color:var(--text-primary)}.settings-input,.settings-textarea{width:100%;padding:.75rem;border:1px solid var(--border-color);border-radius:4px;background-color:var(--bg-primary);color:var(--text-primary);font-family:inherit;font-size:.9rem;transition:border-color .2s ease}.settings-input:focus,.settings-textarea:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary-50)}.settings-textarea{resize:vertical;min-height:100px;direction:ltr;font-family:monospace;color:#888}.settings-form-group small{display:block;margin-top:.25rem;font-size:.8rem;color:var(--text-secondary)}.settings-actions{display:flex;justify-content:flex-end;gap:1rem;margin-top:2rem;padding-top:1rem;border-top:1px solid var(--border-color)}.settings-languages-container{max-height:200px;overflow-y:auto;border:1px solid var(--border-color);border-radius:4px;background-color:var(--bg-primary)}.settings-languages-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(60px,1fr));gap:.5rem;padding:.75rem}.settings-language-item{display:flex;align-items:center;gap:.25rem;padding:.25rem;border-radius:4px;cursor:pointer;transition:background-color .2s ease}.settings-language-item:hover{background-color:var(--bg-secondary)}.settings-language-item input{margin:0}.settings-language-item span{font-size:.85rem}.grid-columns-presets{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem}.grid-preset-btn{display:flex;align-items:center;justify-content:center;width:60px;height:40px;border:1px solid var(--border-color);border-radius:4px;background-color:var(--bg-primary);cursor:pointer;transition:all .2s ease}.grid-preset-btn:hover{background-color:var(--bg-secondary);transform:translateY(-1px);box-shadow:0 2px 4px #0000000d}.grid-preset-btn.active{border-color:var(--color-primary);background-color:var(--color-primary-50)}.grid-preset-icon{font-size:1.25rem;color:var(--text-primary);letter-spacing:-2px}.custom-grid-columns-container{margin-top:.75rem}.settings-input-with-unit{display:flex;align-items:center;gap:.5rem}.settings-input-number{flex:1}.settings-input-unit{width:80px;padding:.75rem;border:1px solid var(--border-color);border-radius:4px;background-color:var(--bg-primary);color:var(--text-primary);font-family:inherit;font-size:.9rem}.component-card-empty{min-height:200px;display:flex;align-items:center;justify-content:center;background-color:var(--bg-secondary);border:2px dashed var(--border-color);border-radius:8px;transition:all .3s ease}.component-card-empty:hover{border-color:var(--color-primary-100);background-color:var(--bg-primary)}.empty-state{text-align:center;padding:2rem;max-width:300px}.empty-state-icon{margin-bottom:1rem}.empty-state-icon i{font-size:3rem;color:var(--text-secondary);opacity:.6}.empty-state-title{font-size:1.25rem;font-weight:600;color:var(--text-primary);margin-bottom:.5rem;text-transform:capitalize}.empty-state-description{font-size:.9rem;color:var(--text-secondary);line-height:1.5;margin-bottom:1.5rem}.empty-state-actions{display:flex;justify-content:center}.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:6px;font-family:inherit;font-weight:500;text-decoration:none;cursor:pointer;transition:all .2s ease;font-size:.9rem}.btn-primary{background-color:var(--color-primary-100);color:var(--color-primary-900)}.btn-primary:hover{background-color:var(--color-primary-50);transform:translateY(-1px);box-shadow:0 4px 8px #0000001a}.btn-sm{padding:.5rem 1rem;font-size:.85rem}.btn i{font-size:.9em}.drawer-empty-state{min-height:400px;display:flex;align-items:center;justify-content:center;padding:2rem}.drawer-empty-state .empty-state{max-width:400px}.drawer-empty-state .empty-state-icon i{font-size:4rem;color:var(--text-secondary);opacity:.5}.drawer-empty-state .empty-state-title{font-size:1.5rem;margin-bottom:1rem;text-transform:capitalize}.drawer-empty-state .empty-state-description{margin-bottom:1rem;line-height:1.6}.drawer-empty-state .empty-state-actions{margin-top:2rem}.drawer-empty-state .btn,.drawer-empty-state .btn:hover{text-decoration:none}