@silexlabs/grapesjs-advanced-selector 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,18 +2,20 @@
2
2
 
3
3
  An advanced selector management plugin for GrapesJS, specifically designed for cases where the default Selector Manager falls short,
4
4
 
5
+ > This code is part of a larger project: [about Silex v3](https://www.silexlabs.org/silex-v3-kickoff/)
6
+ > The Advanced Selector Manager comes pre-installed in Silex v3, [give it a try here](https://v3.silex.me/)
7
+
5
8
  Before: GrapesJs default Selector Manager
6
9
 
7
10
  ![GrapesJs default Selector Manager](https://github.com/user-attachments/assets/dcd85a63-78f4-4bb9-bde3-06009b02ae68)
8
11
 
9
- After: GrapesJs Advanced Selector Manager
10
-
11
- -screenshot to come soon-
12
+ After:
12
13
 
14
+ [GrapesJs Advanced Selector Manager](https://github.com/silexlabs/grapesjs-advanced-selector)
13
15
 
14
16
  ### Links
15
17
 
16
- - [DEMO](##) (TODO: **Provide a live demo**)
18
+ - [DEMO](https://codepen.io/lexoyo/full/EaxZrmz)
17
19
  - [Discussion on GrapesJS Forum](https://github.com/GrapesJS/grapesjs/discussions/5262)
18
20
  - [Feature Request in Silex Project](https://github.com/silexlabs/Silex/issues/1496)
19
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"inline-select.d.ts","sourceRoot":"","sources":["../../src/components/inline-select.ts"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,gBAAgB,CAAA;AAGvB,KAAK,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAEpC,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,eAAe;IAGhE;;OAEG;IAED,KAAK,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IAED,OAAO,EAAE,MAAM,EAAE,CAAK;IAExB;;OAEG;IAED,WAAW,SAAqB;IAIlC,OAAO,CAAC,QAAQ,CAAgC;IAIhD,OAAgB,MAAM,0BA8DrB;IAEQ,MAAM,IAAI,cAAc;IAwBjC,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,WAAW;CAsBpB"}
1
+ {"version":3,"file":"inline-select.d.ts","sourceRoot":"","sources":["../../src/components/inline-select.ts"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,gBAAgB,CAAA;AAGvB,KAAK,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAEpC,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,eAAe;IAGhE;;OAEG;IAED,KAAK,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IAED,OAAO,EAAE,MAAM,EAAE,CAAK;IAExB;;OAEG;IAED,WAAW,SAAqB;IAIlC,OAAO,CAAC,QAAQ,CAAgC;IAIhD,OAAgB,MAAM,0BA6DrB;IAEQ,MAAM,IAAI,cAAc;IAwBjC,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,WAAW;CAsBpB"}
package/dist/index.js CHANGED
@@ -1,12 +1,18 @@
1
- /*! @silexlabs/grapesjs-advanced-selector - 1.0.1 */
1
+ /*! @silexlabs/grapesjs-advanced-selector - 1.0.3 */
2
2
  !function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t():'function'==typeof define&&define.amd?define([],t):'object'==typeof exports?exports["@silexlabs/grapesjs-advanced-selector"]=t():e["@silexlabs/grapesjs-advanced-selector"]=t()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})}},t={};e.r(t),e.d(t,{default:()=>Jt});const o=globalThis,s=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),i=new WeakMap;class n{constructor(e,t,o){if(this._$cssResult$=!0,o!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(s&&void 0===e){const o=void 0!==t&&1===t.length;o&&(e=i.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&i.set(t,e))}return e}toString(){return this.cssText}}const l=(e,...t)=>{const o=1===e.length?e[0]:t.reduce(((t,o,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1]),e[0]);return new n(o,e,r)},a=s?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const o of e.cssRules)t+=o.cssText;return(e=>new n("string"==typeof e?e:e+"",void 0,r))(t)})(e):e,{is:c,defineProperty:d,getOwnPropertyDescriptor:h,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:v}=Object,S=globalThis,m=S.trustedTypes,g=m?m.emptyScript:"",f=S.reactiveElementPolyfillSupport,b=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let o=e;switch(t){case Boolean:o=null!==e;break;case Number:o=null===e?null:Number(e);break;case Object:case Array:try{o=JSON.parse(e)}catch(e){o=null}}return o}},C=(e,t)=>!c(e,t),$={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:C};Symbol.metadata??=Symbol("metadata"),S.litPropertyMetadata??=new WeakMap;class _ extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=$){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const o=Symbol(),s=this.getPropertyDescriptor(e,o,t);void 0!==s&&d(this.prototype,e,s)}}static getPropertyDescriptor(e,t,o){const{get:s,set:r}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return s?.call(this)},set(t){const i=s?.call(this);r.call(this,t),this.requestUpdate(e,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const e=v(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const e=this.properties,t=[...p(e),...u(e)];for(const o of t)this.createProperty(o,e[o])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,o]of t)this.elementProperties.set(e,o)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const o=this._$Eu(e,t);void 0!==o&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const o=new Set(e.flat(1/0).reverse());for(const e of o)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const o=t.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(s)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const s of t){const t=document.createElement("style"),r=o.litNonce;void 0!==r&&t.setAttribute("nonce",r),t.textContent=s.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$EC(e,t){const o=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,o);if(void 0!==s&&!0===o.reflect){const r=(void 0!==o.converter?.toAttribute?o.converter:y).toAttribute(t,o.type);this._$Em=e,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){const o=this.constructor,s=o._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=o.getPropertyOptions(s),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=s,this[s]=r.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,o){if(void 0!==e){if(o??=this.constructor.getPropertyOptions(e),!(o.hasChanged??C)(this[e],t))return;this.P(e,t,o)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,o){this._$AL.has(e)||this._$AL.set(e,t),!0===o.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,o]of e)!0!==o.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[b("elementProperties")]=new Map,_[b("finalized")]=new Map,f?.({ReactiveElement:_}),(S.reactiveElementVersions??=[]).push("2.0.4");const A=globalThis,E=A.trustedTypes,W=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,U="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,w="?"+z,R=`<${w}>`,P=document,T=()=>P.createComment(""),k=e=>null===e||"object"!=typeof e&&"function"!=typeof e,L=Array.isArray,I=e=>L(e)||"function"==typeof e?.[Symbol.iterator],O="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x=/-->/g,j=/>/g,D=RegExp(`>|${O}(?:([^\\s"'>=/]+)(${O}*=${O}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,H=/"/g,F=/^(?:script|style|textarea|title)$/i,V=e=>(t,...o)=>({_$litType$:e,strings:t,values:o}),B=V(1),q=(V(2),V(3),Symbol.for("lit-noChange")),G=Symbol.for("lit-nothing"),Y=new WeakMap,Z=P.createTreeWalker(P,129);function K(e,t){if(!L(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==W?W.createHTML(t):t}const J=(e,t)=>{const o=e.length-1,s=[];let r,i=2===t?"<svg>":3===t?"<math>":"",n=N;for(let t=0;t<o;t++){const o=e[t];let l,a,c=-1,d=0;for(;d<o.length&&(n.lastIndex=d,a=n.exec(o),null!==a);)d=n.lastIndex,n===N?"!--"===a[1]?n=x:void 0!==a[1]?n=j:void 0!==a[2]?(F.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=D):void 0!==a[3]&&(n=D):n===D?">"===a[0]?(n=r??N,c=-1):void 0===a[1]?c=-2:(c=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?D:'"'===a[3]?H:M):n===H||n===M?n=D:n===x||n===j?n=N:(n=D,r=void 0);const h=n===D&&e[t+1].startsWith("/>")?" ":"";i+=n===N?o+R:c>=0?(s.push(l),o.slice(0,c)+U+o.slice(c)+z+h):o+z+(-2===c?t:h)}return[K(e,i+(e[o]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]};class Q{constructor({strings:e,_$litType$:t},o){let s;this.parts=[];let r=0,i=0;const n=e.length-1,l=this.parts,[a,c]=J(e,t);if(this.el=Q.createElement(a,o),Z.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Z.nextNode())&&l.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(U)){const t=c[i++],o=s.getAttribute(e).split(z),n=/([.?@])?(.*)/.exec(t);l.push({type:1,index:r,name:n[2],strings:o,ctor:"."===n[1]?se:"?"===n[1]?re:"@"===n[1]?ie:oe}),s.removeAttribute(e)}else e.startsWith(z)&&(l.push({type:6,index:r}),s.removeAttribute(e));if(F.test(s.tagName)){const e=s.textContent.split(z),t=e.length-1;if(t>0){s.textContent=E?E.emptyScript:"";for(let o=0;o<t;o++)s.append(e[o],T()),Z.nextNode(),l.push({type:2,index:++r});s.append(e[t],T())}}}else if(8===s.nodeType)if(s.data===w)l.push({type:2,index:r});else{let e=-1;for(;-1!==(e=s.data.indexOf(z,e+1));)l.push({type:7,index:r}),e+=z.length-1}r++}}static createElement(e,t){const o=P.createElement("template");return o.innerHTML=e,o}}function X(e,t,o=e,s){if(t===q)return t;let r=void 0!==s?o._$Co?.[s]:o._$Cl;const i=k(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(e),r._$AT(e,o,s)),void 0!==s?(o._$Co??=[])[s]=r:o._$Cl=r),void 0!==r&&(t=X(e,r._$AS(e,t.values),r,s)),t}class ee{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:o}=this._$AD,s=(e?.creationScope??P).importNode(t,!0);Z.currentNode=s;let r=Z.nextNode(),i=0,n=0,l=o[0];for(;void 0!==l;){if(i===l.index){let t;2===l.type?t=new te(r,r.nextSibling,this,e):1===l.type?t=new l.ctor(r,l.name,l.strings,this,e):6===l.type&&(t=new ne(r,this,e)),this._$AV.push(t),l=o[++n]}i!==l?.index&&(r=Z.nextNode(),i++)}return Z.currentNode=P,s}p(e){let t=0;for(const o of this._$AV)void 0!==o&&(void 0!==o.strings?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}}class te{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,s){this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=X(this,e,t),k(e)?e===G||null==e||""===e?(this._$AH!==G&&this._$AR(),this._$AH=G):e!==this._$AH&&e!==q&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):I(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==G&&k(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:o}=e,s="number"==typeof o?this._$AC(e):(void 0===o.el&&(o.el=Q.createElement(K(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new ee(s,this),o=e.u(this.options);e.p(t),this.T(o),this._$AH=e}}_$AC(e){let t=Y.get(e.strings);return void 0===t&&Y.set(e.strings,t=new Q(e)),t}k(e){L(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let o,s=0;for(const r of e)s===t.length?t.push(o=new te(this.O(T()),this.O(T()),this,this.options)):o=t[s],o._$AI(r),s++;s<t.length&&(this._$AR(o&&o._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class oe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,s,r){this.type=1,this._$AH=G,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=G}_$AI(e,t=this,o,s){const r=this.strings;let i=!1;if(void 0===r)e=X(this,e,t,0),i=!k(e)||e!==this._$AH&&e!==q,i&&(this._$AH=e);else{const s=e;let n,l;for(e=r[0],n=0;n<r.length-1;n++)l=X(this,s[o+n],t,n),l===q&&(l=this._$AH[n]),i||=!k(l)||l!==this._$AH[n],l===G?e=G:e!==G&&(e+=(l??"")+r[n+1]),this._$AH[n]=l}i&&!s&&this.j(e)}j(e){e===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class se extends oe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===G?void 0:e}}class re extends oe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==G)}}class ie extends oe{constructor(e,t,o,s,r){super(e,t,o,s,r),this.type=5}_$AI(e,t=this){if((e=X(this,e,t,0)??G)===q)return;const o=this._$AH,s=e===G&&o!==G||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,r=e!==G&&(o===G||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ne{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){X(this,e)}}const le={M:U,P:z,A:w,C:1,L:J,R:ee,D:I,V:X,I:te,H:oe,N:re,U:ie,B:se,F:ne},ae=A.litHtmlPolyfillSupport;ae?.(Q,te),(A.litHtmlVersions??=[]).push("3.2.1");const ce=(e,t,o)=>{const s=o?.renderBefore??t;let r=s._$litPart$;if(void 0===r){const e=o?.renderBefore??null;s._$litPart$=r=new te(t.insertBefore(T(),e),e,void 0,o??{})}return r._$AI(e),r};class de extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ce(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}}de._$litElement$=!0,de["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:de});const he=globalThis.litElementPolyfillSupport;he?.({LitElement:de});(globalThis.litElementVersions??=[]).push("4.1.1");const pe={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:C},ue=(e=pe,t,o)=>{const{kind:s,metadata:r}=o;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),i.set(o.name,e),"accessor"===s){const{name:s}=o;return{set(o){const r=t.get.call(this);t.set.call(this,o),this.requestUpdate(s,r,e)},init(t){return void 0!==t&&this.P(s,void 0,e),t}}}if("setter"===s){const{name:s}=o;return function(o){const r=this[s];t.call(this,o),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+s)};function ve(e){return(t,o)=>"object"==typeof o?ue(e,t,o):((e,t,o)=>{const s=t.hasOwnProperty(o);return t.constructor.createProperty(o,s?{...e,wrapped:!0}:e),s?Object.getOwnPropertyDescriptor(t,o):void 0})(e,t,o)}const Se=1,me=2,ge=e=>(...t)=>({_$litDirective$:e,values:t});class fe{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,o){this._$Ct=e,this._$AM=t,this._$Ci=o}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const be="important",ye=" !"+be,Ce=ge(class extends fe{constructor(e){if(super(e),e.type!==Se||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,o)=>{const s=e[o];return null==s?t:t+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[t]){const{style:o}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?o.removeProperty(e):o[e]=null);for(const e in t){const s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(ye);e.includes("-")||t?o.setProperty(e,t?s.slice(0,-11):s,t?be:""):o[e]=s}}return q}});var $e,_e;!function(e){e["TAG"]="tag",e["CUSTOM_TAG"]="custom-tag",e["CLASS"]="class",e["ID"]="id",e["ATTRIBUTE"]="attribute",e["UNIVERSAL"]="universal",e["UNKNOWN"]="unknown"}($e||($e={})),function(e){e["EQUALS"]="=",e["INCLUDES"]="~=",e["DASH_MATCH"]="|=",e["PREFIX_MATCH"]="^=",e["SUFFIX_MATCH"]="$=",e["SUBSTRING_MATCH"]="*="}(_e||(_e={}));const Ae=['id','class','style','name','type','value','placeholder','href','src','alt','title','width','height','disabled','checked','selected','hidden','readonly','multiple','required','min','max','step','pattern','autocomplete','autofocus','spellcheck','contenteditable','dir','lang','tabindex','accesskey','role'],Ee=['a','abbr','address','area','article','aside','audio','b','base','bdi','bdo','blockquote','body','br','button','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','dialog','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','label','legend','li','link','main','map','mark','meta','meter','nav','noscript','object','ol','optgroup','option','output','p','param','picture','pre','progress','q','rb','rp','rt','rtc','ruby','s','samp','script','section','select','slot','small','source','span','strong','style','sub','summary','sup','table','tbody','td','template','textarea','tfoot','th','thead','time','title','tr','track','u','ul','var','video','wbr'],We=[' '],Ue={[$e.TAG]:'var(--gjs-color-blue, #3b97e3)',[$e.CUSTOM_TAG]:'var(--gjs-color-blue, #3b97e3)',[$e.CLASS]:'var(--gjs-color-green, #62c462)',[$e.ID]:'var(--gjs-color-yellow, #ffca6f)',[$e.ATTRIBUTE]:'var(--gjs-color-yellow, #ffca6f)',[$e.UNIVERSAL]:'var(--gjs-color-red, #dd3636)',[$e.UNKNOWN]:'var(--gjs-color-red, #dd3636)'},ze='•',we='#',Re='[ ]',Pe='*',Te='⚛',ke='⚛',Le='?';function Ie(e,t,o=!0){if(e.type!==t.type)return!1;if(!o&&e.active!==t.active)return!1;switch(e.type){case $e.TAG:case $e.CUSTOM_TAG:case $e.CLASS:case $e.ID:{const o=t;return e.value===o.value}case $e.ATTRIBUTE:{const o=e,s=t;return o.operator===s.operator&&((!o.operator||o.attributeValue===s.attributeValue)&&o.value===s.value)}case $e.UNIVERSAL:return!0;default:return!1}}function Oe(e){var t;switch(e.type){case $e.ATTRIBUTE:{const o=e;return`[${o.value||''}${o.operator?`${o.operator}"${null!==(t=o.attributeValue)&&void 0!==t?t:''}"`:''}]`}case $e.CLASS:return`.${e.value||''}`;case $e.ID:return`#${e.value||''}`;case $e.TAG:case $e.CUSTOM_TAG:return e.value||'';case $e.UNIVERSAL:return'*';default:return''}}function Ne(e){if(e.type===$e.ATTRIBUTE){return`[${e.value||''}]`}return Oe(e)}function xe(e){if(''===e)return e;if('*'===e)return e;const t=We.map((e=>`\\${e}`)).join('|'),o=e.toLowerCase().replace(new RegExp(t,'g'),'-');if(o.match(/^[0-9-]/))return!1;if(o.startsWith('-'))return!1;if(o.match(/^\[[a-z-]*\]?$/)&&Ae.includes(o.replace('[','').replace(']','')))return o.replace(']','')+']';const s=e.match(/^\[([\w-]+)\s*=\s*"([^"]*)"?\]?$/);if(s){const[,e,t]=s;if(Ae.includes(e))return`[${e}="${t}"]`}return o.match(/^\[data-[_a-zA-Z]+[_a-zA-Z0-9-]*\]?$/)?o.replace(']','')+']':o.match(/^[a-z-]*[a-z]$/)&&o.includes('-')||o.match(/^[a-z]*$/)&&Ee.includes(o)||o.match(/^\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/)||o.match(/^#-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/)?o:!!o.match(/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*[_a-zA-Z0-9]$/)&&'.'+o}function je(e,t=!1){if(!t&&!e.active)return 0;switch(e.type){case $e.TAG:return 1;case $e.CLASS:case $e.ATTRIBUTE:case $e.CUSTOM_TAG:return 10;case $e.ID:return 100;case $e.UNIVERSAL:return 0;default:return console.warn(`Unknown selector type: ${e.type}`),0}}function De(e){switch(e.type){case $e.TAG:case $e.CUSTOM_TAG:return 1;case $e.ID:return 2;case $e.CLASS:return 3;case $e.ATTRIBUTE:return 4;case $e.UNIVERSAL:return 5;default:return 6}}var Me=void 0&&(void 0).__decorate||function(e,t,o,s){var r,i=arguments.length,n=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(n=(i<3?r(n):i>3?r(t,o,n):r(t,o))||n);return i>3&&n&&Object.defineProperty(t,o,n),n};class He extends de{constructor(){super(...arguments),this.t=e=>e}connectedCallback(){super.connectedCallback();document.querySelectorAll('style, link[rel="stylesheet"]').forEach((e=>{var t;null===(t=this.shadowRoot)||void 0===t||t.appendChild(e.cloneNode(!0))}))}}Me([ve({type:Function})],He.prototype,"t",void 0);const{I:Fe}=le,Ve=(e,t)=>{const o=e._$AN;if(void 0===o)return!1;for(const e of o)e._$AO?.(t,!1),Ve(e,t);return!0},Be=e=>{let t,o;do{if(void 0===(t=e._$AM))break;o=t._$AN,o.delete(e),e=t}while(0===o?.size)},qe=e=>{for(let t;t=e._$AM;e=t){let o=t._$AN;if(void 0===o)t._$AN=o=new Set;else if(o.has(e))break;o.add(e),Ze(t)}};function Ge(e){void 0!==this._$AN?(Be(this),this._$AM=e,qe(this)):this._$AM=e}function Ye(e,t=!1,o=0){const s=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(s))for(let e=o;e<s.length;e++)Ve(s[e],!1),Be(s[e]);else null!=s&&(Ve(s,!1),Be(s));else Ve(this,e)}const Ze=e=>{e.type==me&&(e._$AP??=Ye,e._$AQ??=Ge)};class Ke extends fe{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,o){super._$AT(e,t,o),qe(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Ve(this,e),Be(this))}setValue(e){if((e=>void 0===e.strings)(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}const Je=()=>new Qe;class Qe{}const Xe=new WeakMap,et=ge(class extends Ke{render(e){return G}update(e,[t]){const o=t!==this.Y;return o&&void 0!==this.Y&&this.rt(void 0),(o||this.lt!==this.ct)&&(this.Y=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),G}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.Y){const t=this.ht??globalThis;let o=Xe.get(t);void 0===o&&(o=new WeakMap,Xe.set(t,o)),void 0!==o.get(this.Y)&&this.Y.call(this.ht,void 0),o.set(this.Y,e),void 0!==e&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){return"function"==typeof this.Y?Xe.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),tt=l`
3
- background: none;
4
3
  border: none;
5
4
  -webkit-appearance: none;
6
5
  -moz-appearance: none;
7
6
  appearance: none;
8
7
  font-family: inherit;
9
8
  cursor: pointer;
9
+ /* chrome */
10
+ background: var(--gjs-main-color, #444);
11
+ /* in chrome, make the dropdown text align to the left, with padding */
12
+ text-align-last: center;
13
+ padding: 0 0.5rem;
14
+ text-align: left;
15
+ padding: 0 0.5rem;
10
16
  `,ot=l`
11
17
  border: none;
12
18
  border-bottom: 1px dashed;
@@ -300,7 +306,6 @@
300
306
  }
301
307
  select {
302
308
  ${tt}
303
- text-align: center;
304
309
  border-bottom: 1px dashed;
305
310
  }
306
311
  aside {