@solid-design-system/components 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/es/accordion-group.js +1 -1
- package/dist/components/es/accordion.js +1 -1
- package/dist/components/es/brandshape.js +1 -1
- package/dist/components/es/button.js +1 -1
- package/dist/components/es/carousel.js +2 -2
- package/dist/components/es/drawer.js +1 -1
- package/dist/components/es/dropdown.js +1 -1
- package/dist/components/es/icon.js +3 -3
- package/dist/components/es/if-defined.js +2 -2
- package/dist/components/es/link.js +1 -1
- package/dist/components/es/lit-element.js +4 -4
- package/dist/components/es/navigation-item.js +2 -2
- package/dist/components/es/popup.js +1 -1
- package/dist/components/es/query-assigned-elements.js +6 -0
- package/dist/components/es/query.js +7 -2
- package/dist/components/es/radio-group.js +1 -1
- package/dist/components/es/radio.js +1 -1
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +2 -12
- package/dist/components/es/state.js +1 -1
- package/dist/components/es/static.js +1 -1
- package/dist/components/es/tag.js +1 -1
- package/dist/components/es/teaser.js +1 -1
- package/dist/components/es/video.js +1 -1
- package/dist/components/umd/solid-components.js +18 -18
- package/dist/custom-elements.json +1 -1
- package/dist/package/node_modules/.pnpm/{@shoelace-style_localize@3.1.0 → @shoelace-style_localize@3.1.2}/node_modules/@shoelace-style/localize/dist/index.js +1 -1
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/package/translations/en.js +1 -1
- package/dist/package/utilities/localize.js +1 -1
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/icon.js +3 -3
- package/dist/versioned-components/es/if-defined.js +2 -2
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/lit-element.js +4 -4
- package/dist/versioned-components/es/navigation-item.js +2 -2
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/query-assigned-elements.js +6 -0
- package/dist/versioned-components/es/query.js +7 -2
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +2 -12
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/state.js +1 -1
- package/dist/versioned-components/es/static.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +1 -1
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +6 -6
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +12 -12
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +1 -1
- package/dist/versioned-package/node_modules/.pnpm/{@shoelace-style_localize@3.1.0 → @shoelace-style_localize@3.1.2}/node_modules/@shoelace-style/localize/dist/index.js +1 -1
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-package/translations/en.js +1 -1
- package/dist/versioned-package/utilities/localize.js +1 -1
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +21 -21
- package/dist/web-types.json +22 -22
- package/package.json +49 -54
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as t,i as e}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{H as i}from"./slot.js";import{
|
|
1
|
+
import{x as t,i as e}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{H as i}from"./slot.js";import{o}from"./if-defined.js";import{S as r,n as l}from"./solid-element.js";import{e as n}from"./query.js";import{t as a}from"./classix.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let f=class extends r{constructor(){super(...arguments),this.hasSlotController=new i(this,"[default]","icon-left","icon-right"),this.size="inherit",this.inverted=!1,this.standalone=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const e={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return t`<a part="base" class="${a("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${o(this.href||void 0)}" target="${o(this.target||void 0)}" download="${o(this.download||void 0)}" rel="${o(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${a("inline",e["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${a("inline",e["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};f.styles=[r.styles,e`::slotted(sd-1-21-0-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-1-21-0-icon){font-size:1rem}:host([size=lg][standalone]) ::slotted(sd-1-21-0-icon){font-size:1.5rem}`],m([n("a")],f.prototype,"button",2),m([l({reflect:!0})],f.prototype,"size",2),m([l({type:Boolean,reflect:!0})],f.prototype,"inverted",2),m([l({type:Boolean,reflect:!0})],f.prototype,"standalone",2),m([l()],f.prototype,"href",2),m([l()],f.prototype,"target",2),m([l()],f.prototype,"download",2),f=m([s("sd-1-21-0-link")],f);export{f as default};
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const t=
|
|
6
|
+
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;let n=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}};const r=t=>new n("string"==typeof t?t:t+"",void 0,s),o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new n(i,t,s)},l=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
|
|
11
|
+
*/,{is:h,defineProperty:a,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,$=globalThis,_=$.trustedTypes,f=_?_.emptyScript:"",v=$.reactiveElementPolyfillSupport,A=(t,e)=>t,g={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},m=(t,e)=>!h(t,e),y={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:m};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);class E 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.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&a(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==i?void 0:i.call(this)},set(e){const r=null==i?void 0:i.call(this);n.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(A("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(A("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(A("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}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 t of s)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?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._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e;(this._$ES??(this._$ES=[])).push(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$ES)||e.splice(this._$ES.indexOf(t)>>>0,1)}_$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 s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),n=t.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}})(s,this.constructor.elementStyles),s}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$ES)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$ES)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e){var s;const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:g).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:g;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s,i=!1,n){if(void 0!==t){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??m)(i?n:this[t],e))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],s)}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this._$ES)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(s)):this._$ET()}catch(t){throw e=!1,this._$ET(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null==(e=this._$ES)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EO(t,this[t])))),this._$ET()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[A("elementProperties")]=new Map,E[A("finalized")]=new Map,null==v||v({ReactiveElement:E}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.0.1");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
const S=globalThis,b=S.trustedTypes,C=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",P=`lit$${(Math.random()+"").slice(9)}$`,x="?"+P,U=`<${x}>`,T=document,H=()=>T.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,M="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,k=/-->/g,L=/>/g,z=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,D=/"/g,I=/^(?:script|style|textarea|title)$/i,j=(1,(t,...e)=>({_$litType$:1,strings:t,values:e})),V=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),q=new WeakMap,J=T.createTreeWalker(T,129);function K(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}class Z{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[h,a]=((t,e)=>{const s=t.length-1,i=[];let n,r=2===e?"<svg>":"",o=R;for(let e=0;e<s;e++){const s=t[e];let l,h,a=-1,c=0;for(;c<s.length&&(o.lastIndex=c,h=o.exec(s),null!==h);)c=o.lastIndex,o===R?"!--"===h[1]?o=k:void 0!==h[1]?o=L:void 0!==h[2]?(I.test(h[2])&&(n=RegExp("</"+h[2],"g")),o=z):void 0!==h[3]&&(o=z):o===z?">"===h[0]?(o=n??R,a=-1):void 0===h[1]?a=-2:(a=o.lastIndex-h[2].length,l=h[1],o=void 0===h[3]?z:'"'===h[3]?D:B):o===D||o===B?o=z:o===k||o===L?o=R:(o=z,n=void 0);const d=o===z&&t[e+1].startsWith("/>")?" ":"";r+=o===R?s+U:a>=0?(i.push(l),s.slice(0,a)+w+s.slice(a)+P+d):s+P+(-2===a?e:d)}return[K(t,r+(t[s]||"<?>")+(2===e?"</svg>":"")),i]})(t,e);if(this.el=Z.createElement(h,s),J.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=J.nextNode())&&l.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(w)){const e=a[r++],s=i.getAttribute(t).split(P),o=/([.?@])?(.*)/.exec(e);l.push({type:1,index:n,name:o[2],strings:s,ctor:"."===o[1]?Y:"?"===o[1]?tt:"@"===o[1]?et:X}),i.removeAttribute(t)}else t.startsWith(P)&&(l.push({type:6,index:n}),i.removeAttribute(t));if(I.test(i.tagName)){const t=i.textContent.split(P),e=t.length-1;if(e>0){i.textContent=b?b.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],H()),J.nextNode(),l.push({type:2,index:++n});i.append(t[e],H())}}}else if(8===i.nodeType)if(i.data===x)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(P,t+1));)l.push({type:7,index:n}),t+=P.length-1}n++}}static createElement(t,e){const s=T.createElement("template");return s.innerHTML=t,s}}function F(t,e,s=t,i){var n,r;if(e===V)return e;let o=void 0!==i?null==(n=s._$Co)?void 0:n[i]:s._$Cl;const l=N(e)?void 0:e._$litDirective$;return(null==o?void 0:o.constructor)!==l&&(null==(r=null==o?void 0:o._$AO)||r.call(o,!1),void 0===l?o=void 0:(o=new l(t),o._$AT(t,s,i)),void 0!==i?(s._$Co??(s._$Co=[]))[i]=o:s._$Cl=o),void 0!==o&&(e=F(t,o._$AS(t,e.values),o,i)),e}class G{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=((null==t?void 0:t.creationScope)??T).importNode(e,!0);J.currentNode=i;let n=J.nextNode(),r=0,o=0,l=s[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new Q(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new st(n,this,t)),this._$AV.push(e),l=s[++o]}r!==(null==l?void 0:l.index)&&(n=J.nextNode(),r++)}return J.currentNode=T,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class Q{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=F(this,t,e),N(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==W&&N(this._$AH)?this._$AA.nextSibling.data=t:this.$(T.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Z.createElement(K(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===n)this._$AH.p(s);else{const t=new G(n,this),e=t.u(this.options);t.p(s),this.$(e),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new Z(t)),e}T(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new Q(this.k(H()),this.k(H()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for(null==(s=this._$AP)||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=W}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=F(this,t,e,0),r=!N(t)||t!==this._$AH&&t!==V,r&&(this._$AH=t);else{const i=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=F(this,i[s+o],e,o),l===V&&(l=this._$AH[o]),r||(r=!N(l)||l!==this._$AH[o]),l===W?t=W:t!==W&&(t+=(l??"")+n[o+1]),this._$AH[o]=l}r&&!i&&this.O(t)}O(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Y extends X{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===W?void 0:t}}class tt extends X{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class et extends X{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=F(this,t,e,0)??W)===V)return;const s=this._$AH,i=t===W&&s!==W||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==W&&(s===W||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class st{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){F(this,t)}}const it=S.litHtmlPolyfillSupport;null==it||it(Z,Q),(S.litHtmlVersions??(S.litHtmlVersions=[])).push("3.0.2");
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
class nt extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=(null==s?void 0:s.renderBefore)??e;let n=i._$litPart$;if(void 0===n){const t=(null==s?void 0:s.renderBefore)??null;i._$litPart$=n=new Q(e.insertBefore(H(),t),t,void 0,s??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return V}}var rt;nt._$litElement$=!0,nt.finalized=!0,null==(rt=globalThis.litElementHydrateSupport)||rt.call(globalThis,{LitElement:nt});const ot=globalThis.litElementPolyfillSupport;null==ot||ot({LitElement:nt}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.1");export{W as T,m as f,o as i,r,nt as s,g as u,V as w,j as x};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{i as t}from"./lit-element.js";import{H as e}from"./slot.js";import{i,n as s}from"./static.js";import{
|
|
1
|
+
import{i as t}from"./lit-element.js";import{H as e}from"./slot.js";import{s as i,n as s}from"./static.js";import{o as r}from"./if-defined.js";import{S as o,n as l}from"./solid-element.js";import{c as a}from"./component.styles.js";import{t as n}from"./classix.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,
|
|
6
|
+
*/var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,p=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?h(e,i):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&d(e,i,o),o};let c=class extends o{constructor(){super(...arguments),this.hasSlotController=new e(this,"[default]","description","children"),this.href="",this.current=!1,this.disabled=!1,this.size="base",this.vertical=!1,this.chevron=!1,this.indented=!1,this.relaxed=!1,this.divider=!1,this.open=!1}isButton(){return!this.href&&!this.hasSlotController.test("children")}isLink(){return!!this.href}isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}handleClickSummary(t){t.preventDefault(),t.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}render(){const t=this.isLink(),e=this.isButton(),o=this.isAccordion(),l=(this.hasSlotController.test("[default]"),this.hasSlotController.test("main"),this.hasSlotController.test("description")),a=this.hasSlotController.test("children"),d=t?i`a`:o?i`summary`:i`button`,h=this.vertical?"pb-3":"pb-2",p=s`<${d} part="base" class="${n("hover:bg-neutral-200 group transition-all min-h-[48px] cursor-pointer relative focus-visible:focus-outline",{base:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",o?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-[1px]",this.vertical?"px-8":"px-4")}" aria-controls="${r(o?"navigation-item-details":void 0)}" aria-current="${r(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${r(e?this.disabled:void 0)}" href="${r(this.href||void 0)}" target="${r(t?this.target:void 0)}" download="${r(t?this.download:void 0)}" rel="${r(t&&this.target?"noreferrer noopener":void 0)}" role="${t?"link":"button"}" tabindex="${this.disabled?"-1":"0"}" @click="${o?this.handleClickSummary:e?this.handleClickButton:void 0}"><div class="${n("absolute w-full left-0 top-0 pointer-events-none transition-all duration-150",this.vertical?"border-l-4 h-[calc(100%-8px)] top-1 group-hover:h-full group-hover:top-0":"border-b-4 h-full",this.current?"border-accent":"border-transparent",this.disabled&&"border-neutral-500")}"></div><span class="${n("relative pt-3 inline-flex justify-between items-center",o?"grow":"w-full",l?"pb-1":h,this.calculatePaddingX())}">${this.divider&&this.vertical?s`<sd-1-21-0-divider part="divider" class="${n("w-full transition-all absolute -top-[1px] left-0",this.calculatePaddingX())}"></sd-1-21-0-divider>`:""} <span class="inline-flex items-center flex-auto"><slot part="content" class="inline"></slot></span>${(this.chevron||a)&&this.vertical?s`<sd-1-21-0-icon name="chevron-down" part="chevron" library="system" color="currentColor" class="${n("h-6 w-6 ml-2 transition-all",o?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-1-21-0-icon>`:""} </span>${l&&this.vertical?s`<slot name="description" part="description" class="${n("inline-block text-sm text-left text-black",o?"grow":"w-full",h,this.calculatePaddingX())}"></slot>`:""}</${d}>`;return o?s`<details id="navigation-item-details" ?open="${this.open}" class="relative flex">${p}<slot name="children"></slot></details>`:s`${p}`}};var u;c.styles=[a,o.styles,t`:host{box-sizing:border-box;position:relative;display:inline-block}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}`],p([l({reflect:!0})],c.prototype,"href",2),p([l()],c.prototype,"target",2),p([l()],c.prototype,"download",2),p([l({type:Boolean,reflect:!0})],c.prototype,"current",2),p([l({type:Boolean,reflect:!0})],c.prototype,"disabled",2),p([l({reflect:!0})],c.prototype,"size",2),p([l({type:Boolean,reflect:!0})],c.prototype,"vertical",2),p([l({type:Boolean,reflect:!0})],c.prototype,"chevron",2),p([l({type:Boolean,reflect:!0})],c.prototype,"indented",2),p([l({type:Boolean,reflect:!0})],c.prototype,"relaxed",2),p([l({type:Boolean,reflect:!0})],c.prototype,"divider",2),p([l({type:Boolean,reflect:!0})],c.prototype,"open",2),c=p([(u="sd-1-21-0-navigation-item",(t,e)=>{void 0!==e?e.addInitializer((()=>{customElements.define(u,t)})):customElements.define(u,t)})],c);export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as t,i as e}from"./lit-element.js";import{c as n}from"./register-custom-element.js";import{S as o,n as i}from"./solid-element.js";import{i as r}from"./query.js";import{c as a}from"./component.styles.js";import{t as s}from"./classix.js";const l=Math.min,c=Math.max,f=Math.round,p=Math.floor,h=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"},d={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function w(t){return t.split("-")[1]}function b(t){return"x"===t?"y":"x"}function v(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(g(t))?"y":"x"}function P(t){return b(x(t))}function E(t){return t.replace(/start|end/g,(t=>d[t]))}function z(t){return t.replace(/left|right|bottom|top/g,(t=>u[t]))}function R(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function S(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function T(t,e,n){let{reference:o,floating:i}=t;const r=x(e),a=P(e),s=v(a),l=g(e),c="y"===r,f=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let u;switch(l){case"top":u={x:f,y:o.y-i.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:p};break;case"left":u={x:o.x-i.width,y:p};break;default:u={x:o.x,y:o.y}}switch(w(e)){case"start":u[a]-=h*(n&&c?-1:1);break;case"end":u[a]+=h*(n&&c?-1:1)}return u}async function L(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:u=0}=y(e,t),d=R(u),m=s[h?"floating"===p?"reference":"floating":p],g=S(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),w="floating"===p?{...a.floating,x:o,y:i}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},x=S(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+d.top)/v.y,bottom:(x.bottom-g.bottom+d.bottom)/v.y,left:(g.left-x.left+d.left)/v.x,right:(x.right-g.right+d.right)/v.x}}const A=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=g(n),s=w(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,f=r&&l?-1:1,p=y(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&"number"==typeof d&&(u="end"===s?-1*d:d),l?{x:u*f,y:h*c}:{x:h*c,y:u*f}}(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},k=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),f=await L(e,s),p=g(n),h=w(n),u="y"===x(n),{width:d,height:m}=o.floating;let b,v;"top"===p||"bottom"===p?(b=p,v=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(v=p,b="end"===h?"top":"bottom");const P=m-f[b],E=d-f[v],z=!e.middlewareData.shift;let R=P,S=E;if(u){const t=d-f.left-f.right;S=h||z?l(E,t):t}else{const t=m-f.top-f.bottom;R=h||z?l(P,t):t}if(z&&!h){const t=c(f.left,0),e=c(f.right,0),n=c(f.top,0),o=c(f.bottom,0);u?S=d-2*(0!==t||0!==e?t+e:c(f.left,f.right)):R=m-2*(0!==n||0!==o?n+o:c(f.top,f.bottom))}await a({...e,availableWidth:S,availableHeight:R});const T=await i.getDimensions(r.floating);return d!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function O(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function C(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function F(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return t instanceof Node||t instanceof C(t).Node}function B(t){return t instanceof Element||t instanceof C(t).Element}function $(t){return t instanceof HTMLElement||t instanceof C(t).HTMLElement}function j(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof C(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function N(t){return["table","td","th"].includes(O(t))}function W(t){const e=M(),n=q(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function M(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(O(t))}function q(t){return C(t).getComputedStyle(t)}function I(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function X(t){if("html"===O(t))return t;const e=t.assignedSlot||t.parentNode||j(t)&&t.host||F(t);return j(e)?e.host:e}function Y(t){const e=X(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&H(e)?e:Y(e)}function _(t,e){var n;void 0===e&&(e=[]);const o=Y(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=C(o);return i?e.concat(r,r.visualViewport||[],H(o)?o:[]):e.concat(o,_(o))}function G(t){const e=q(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=$(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function J(t){return B(t)?t:t.contextElement}function K(t){const e=J(t);if(!$(e))return h(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=G(e);let a=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Q=h(0);function U(t){const e=C(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Q}function Z(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=J(t);let a=h(1);e&&(o?B(o)&&(a=K(o)):a=K(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==C(t))&&e}(r,n,o)?U(r):h(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(r){const t=C(r),e=o&&B(o)?C(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=K(n),e=n.getBoundingClientRect(),o=q(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,p*=t.y,l+=i,c+=r,n=C(n).frameElement}}return S({width:f,height:p,x:l,y:c})}function tt(t){return Z(F(t)).left+I(t).scrollLeft}function et(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=C(t),o=F(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=M();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=F(t),n=I(t),o=t.ownerDocument.body,i=c(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=c(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+tt(t);const s=-n.scrollTop;return"rtl"===q(o).direction&&(a+=c(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(F(t));else if(B(e))o=function(t,e){const n=Z(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=$(t)?K(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=U(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return S(o)}function nt(t,e){const n=X(t);return!(n===e||!B(n)||V(n))&&("fixed"===q(n).position||nt(n,e))}function ot(t,e){const n=e.get(t);if(n)return n;let o=_(t).filter((t=>B(t)&&"body"!==O(t))),i=null;const r="fixed"===q(t).position;let a=r?X(t):t;for(;B(a)&&!V(a);){const e=q(a),n=W(a);!n&&"fixed"===e.position&&(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(a)&&!n&&nt(t,a))?o=o.filter((t=>t!==a)):i=e,a=X(a)}return e.set(t,o),o}function it(t,e,n){const o=$(e),i=F(e),r="fixed"===n,a=Z(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(o||!o&&!r)if(("body"!==O(e)||H(i))&&(s=I(e)),o){const t=Z(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=tt(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function rt(t,e){return $(t)&&"fixed"!==q(t).position?e?e(t):t.offsetParent:null}function at(t,e){const n=C(t);if(!$(t))return n;let o=rt(t,e);for(;o&&N(o)&&"static"===q(o).position;)o=rt(o,e);return o&&("html"===O(o)||"body"===O(o)&&"static"===q(o).position&&!W(o))?n:o||function(t){let e=X(t);for(;$(e)&&!V(e);){if(W(e))return e;e=X(e)}return null}(t)||n}const st={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=$(n),r=F(n);if(n===r)return e;let a={scrollLeft:0,scrollTop:0},s=h(1);const l=h(0);if((i||!i&&"fixed"!==o)&&(("body"!==O(n)||H(r))&&(a=I(n)),$(n))){const t=Z(n);s=K(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:F,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?ot(e,this._c):[].concat(n),o],a=r[0],s=r.reduce(((t,n)=>{const o=et(e,n,i);return t.top=c(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=c(o.left,t.left),t}),et(e,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:at,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||at,r=this.getDimensions;return{reference:it(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return G(t)},getScale:K,isElement:B,isRTL:function(t){return"rtl"===q(t).direction}};var lt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,ft=(t,e,n,o)=>{for(var i,r=o>1?void 0:o?ct(e,n):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o?i(e,n,r):i(r))||r);return o&&r&<(e,n,r),r};let pt=class extends o{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=J(t),u=i||r?[...h?_(h):[],..._(e)]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const d=h&&s?function(t,e){let n,o=null;const i=F(t);function r(){clearTimeout(n),o&&o.disconnect(),o=null}return function a(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const{left:h,top:u,width:d,height:m}=t.getBoundingClientRect();if(s||e(),!d||!m)return;const y={rootMargin:-p(u)+"px "+-p(i.clientWidth-(h+d))+"px "+-p(i.clientHeight-(u+m))+"px "+-p(h)+"px",threshold:c(0,l(1,f))||1};let g=!0;function w(t){const e=t[0].intersectionRatio;if(e!==f){if(!g)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}g=!1}try{o=new IntersectionObserver(w,{...y,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,y)}o.observe(t)}(!0),r}(h,n):null;let m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{y&&y.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let g,w=f?Z(t):null;return f&&function e(){const o=Z(t);w&&(o.x!==w.x||o.y!==w.y||o.width!==w.width||o.height!==w.height)&&n(),w=o,g=requestAnimationFrame(e)}(),n(),()=>{u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),d&&d(),y&&y.disconnect(),y=null,f&&cancelAnimationFrame(g)}}(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[A({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(k({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:o,middlewareData:i,rects:r,initialPlacement:a,platform:s,elements:l}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:d=!0,...m}=y(t,e),b=g(o),x=g(a)===a,R=await(null==s.isRTL?void 0:s.isRTL(l.floating)),S=p||(x||!d?[z(a)]:function(t){const e=z(t);return[E(t),e,E(e)]}(a));!p&&"none"!==u&&S.push(...function(t,e,n,o){const i=w(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(a,d,u,R));const T=[a,...S],A=await L(e,m),k=[];let O=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&k.push(A[b]),f){const t=function(t,e,n){void 0===n&&(n=!1);const o=w(t),i=P(t),r=v(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=z(a)),[a,z(a)]}(o,r,R);k.push(A[t[0]],A[t[1]])}if(O=[...O,{placement:o,overflows:k}],!k.every((t=>t<=0))){var C,F;const t=((null==(C=i.flip)?void 0:C.index)||0)+1,e=T[t];if(e)return{data:{index:t,overflows:O},reset:{placement:e}};let n=null==(F=O.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:F.placement;if(!n)switch(h){case"bestFit":{var D;const t=null==(D=O.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:D[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}}({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:o},f=await L(e,l),p=x(g(i)),h=b(p);let u=c[h],d=c[p];if(r){const t="y"===h?"bottom":"right";u=m(u+f["y"===h?"top":"left"],u,u-f[t])}if(a){const t="y"===p?"bottom":"right";d=m(d+f["y"===p?"top":"left"],d,d-f[t])}const w=s.fn({...e,[h]:u,[p]:d});return{...w,data:{x:w.x-n,y:w.y-o}}}}}({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(k({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s}=e,{element:c,padding:f=0}=y(t,e)||{};if(null==c)return{};const p=R(f),h={x:n,y:o},u=P(i),d=v(u),g=await a.getDimensions(c),b="y"===u,x=b?"top":"left",E=b?"bottom":"right",z=b?"clientHeight":"clientWidth",S=r.reference[d]+r.reference[u]-h[u]-r.floating[d],T=h[u]-r.reference[u],L=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let A=L?L[z]:0;(!A||!await(null==a.isElement?void 0:a.isElement(L)))&&(A=s.floating[z]||r.floating[d]);const k=S/2-T/2,O=A/2-g[d]/2-1,C=l(p[x],O),F=l(p[E],O),D=C,B=A-g[d]-F,$=A/2-g[d]/2+k,j=m(D,$,B),H=null!=w(i)&&$!=j&&r.reference[d]/2-($<D?C:F)-g[d]/2<0?$<D?D-$:B-$:0;return{[u]:h[u]-H,data:{[u]:j,centerOffset:$-j+H}}}}))({element:this.arrowEl,padding:this.arrowPadding})),((t,e,n)=>{const o=new Map,i={platform:st,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=T(c,o,l),h=o,u={},d=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:g,data:w,reset:b}=await m({x:f,y:p,initialPlacement:o,placement:h,strategy:i,middlewareData:u,rects:c,platform:a,elements:{reference:t,floating:e}});f=y??f,p=g??p,u={...u,[r]:{...u[r],...w}},b&&d<=50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:p}=T(c,h,l))),n=-1)}return{x:f,y:p,placement:h,strategy:i,middlewareData:u}})(t,e,{...i,platform:r})})(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy}).then((({x:t,y:e,middlewareData:n,placement:o})=>{const i="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let o="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?n:"",l=i?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":n,l=i?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sd-reposition")}render(){return t`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${s("isolate","fixed"!==this.strategy?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?t`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};pt.styles=[o.styles,a,e`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}[part=arrow]{width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);background:var(--arrow-color)}`],ft([r('[part="popup"]')],pt.prototype,"popup",2),ft([r('[part="arrow"]')],pt.prototype,"arrowEl",2),ft([i()],pt.prototype,"anchor",2),ft([i({type:Boolean,reflect:!0})],pt.prototype,"active",2),ft([i({reflect:!0})],pt.prototype,"placement",2),ft([i({reflect:!0})],pt.prototype,"strategy",2),ft([i({type:Number})],pt.prototype,"distance",2),ft([i({type:Number})],pt.prototype,"skidding",2),ft([i({type:Boolean})],pt.prototype,"arrow",2),ft([i({attribute:"arrow-placement"})],pt.prototype,"arrowPlacement",2),ft([i({attribute:"arrow-padding",type:Number})],pt.prototype,"arrowPadding",2),ft([i({type:Boolean})],pt.prototype,"flip",2),ft([i({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],pt.prototype,"flipFallbackPlacements",2),ft([i({attribute:"flip-fallback-strategy"})],pt.prototype,"flipFallbackStrategy",2),ft([i({type:Object})],pt.prototype,"flipBoundary",2),ft([i({attribute:"flip-padding",type:Number})],pt.prototype,"flipPadding",2),ft([i({type:Boolean})],pt.prototype,"shift",2),ft([i({type:Object})],pt.prototype,"shiftBoundary",2),ft([i({attribute:"shift-padding",type:Number})],pt.prototype,"shiftPadding",2),ft([i({attribute:"auto-size"})],pt.prototype,"autoSize",2),ft([i()],pt.prototype,"sync",2),ft([i({type:Object})],pt.prototype,"autoSizeBoundary",2),ft([i({attribute:"auto-size-padding",type:Number})],pt.prototype,"autoSizePadding",2),pt=ft([n("sd-1-20-0-popup")],pt);export{pt as default};
|
|
1
|
+
import{x as t,i as e}from"./lit-element.js";import{c as n}from"./register-custom-element.js";import{S as o,n as i}from"./solid-element.js";import{e as r}from"./query.js";import{c as a}from"./component.styles.js";import{t as s}from"./classix.js";const l=Math.min,c=Math.max,f=Math.round,p=Math.floor,h=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"},d={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function w(t){return t.split("-")[1]}function b(t){return"x"===t?"y":"x"}function v(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(g(t))?"y":"x"}function P(t){return b(x(t))}function E(t){return t.replace(/start|end/g,(t=>d[t]))}function z(t){return t.replace(/left|right|bottom|top/g,(t=>u[t]))}function R(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function S(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function T(t,e,n){let{reference:o,floating:i}=t;const r=x(e),a=P(e),s=v(a),l=g(e),c="y"===r,f=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let u;switch(l){case"top":u={x:f,y:o.y-i.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:p};break;case"left":u={x:o.x-i.width,y:p};break;default:u={x:o.x,y:o.y}}switch(w(e)){case"start":u[a]-=h*(n&&c?-1:1);break;case"end":u[a]+=h*(n&&c?-1:1)}return u}async function L(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:u=0}=y(e,t),d=R(u),m=s[h?"floating"===p?"reference":"floating":p],g=S(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),w="floating"===p?{...a.floating,x:o,y:i}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},x=S(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+d.top)/v.y,bottom:(x.bottom-g.bottom+d.bottom)/v.y,left:(g.left-x.left+d.left)/v.x,right:(x.right-g.right+d.right)/v.x}}const A=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=g(n),s=w(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,f=r&&l?-1:1,p=y(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&"number"==typeof d&&(u="end"===s?-1*d:d),l?{x:u*f,y:h*c}:{x:h*c,y:u*f}}(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},k=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),f=await L(e,s),p=g(n),h=w(n),u="y"===x(n),{width:d,height:m}=o.floating;let b,v;"top"===p||"bottom"===p?(b=p,v=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(v=p,b="end"===h?"top":"bottom");const P=m-f[b],E=d-f[v],z=!e.middlewareData.shift;let R=P,S=E;if(u){const t=d-f.left-f.right;S=h||z?l(E,t):t}else{const t=m-f.top-f.bottom;R=h||z?l(P,t):t}if(z&&!h){const t=c(f.left,0),e=c(f.right,0),n=c(f.top,0),o=c(f.bottom,0);u?S=d-2*(0!==t||0!==e?t+e:c(f.left,f.right)):R=m-2*(0!==n||0!==o?n+o:c(f.top,f.bottom))}await a({...e,availableWidth:S,availableHeight:R});const T=await i.getDimensions(r.floating);return d!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function O(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function C(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function F(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return t instanceof Node||t instanceof C(t).Node}function B(t){return t instanceof Element||t instanceof C(t).Element}function $(t){return t instanceof HTMLElement||t instanceof C(t).HTMLElement}function j(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof C(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function N(t){return["table","td","th"].includes(O(t))}function W(t){const e=M(),n=q(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function M(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(O(t))}function q(t){return C(t).getComputedStyle(t)}function I(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function X(t){if("html"===O(t))return t;const e=t.assignedSlot||t.parentNode||j(t)&&t.host||F(t);return j(e)?e.host:e}function Y(t){const e=X(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&H(e)?e:Y(e)}function _(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=Y(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),a=C(i);return r?e.concat(a,a.visualViewport||[],H(i)?i:[],a.frameElement&&n?_(a.frameElement):[]):e.concat(i,_(i,[],n))}function G(t){const e=q(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=$(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function J(t){return B(t)?t:t.contextElement}function K(t){const e=J(t);if(!$(e))return h(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=G(e);let a=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Q=h(0);function U(t){const e=C(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Q}function Z(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=J(t);let a=h(1);e&&(o?B(o)&&(a=K(o)):a=K(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==C(t))&&e}(r,n,o)?U(r):h(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(r){const t=C(r),e=o&&B(o)?C(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=K(n),e=n.getBoundingClientRect(),o=q(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,p*=t.y,l+=i,c+=r,n=C(n).frameElement}}return S({width:f,height:p,x:l,y:c})}function tt(t){return Z(F(t)).left+I(t).scrollLeft}function et(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=C(t),o=F(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=M();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=F(t),n=I(t),o=t.ownerDocument.body,i=c(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=c(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+tt(t);const s=-n.scrollTop;return"rtl"===q(o).direction&&(a+=c(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(F(t));else if(B(e))o=function(t,e){const n=Z(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=$(t)?K(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=U(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return S(o)}function nt(t,e){const n=X(t);return!(n===e||!B(n)||V(n))&&("fixed"===q(n).position||nt(n,e))}function ot(t,e){const n=e.get(t);if(n)return n;let o=_(t,[],!1).filter((t=>B(t)&&"body"!==O(t))),i=null;const r="fixed"===q(t).position;let a=r?X(t):t;for(;B(a)&&!V(a);){const e=q(a),n=W(a);!n&&"fixed"===e.position&&(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(a)&&!n&&nt(t,a))?o=o.filter((t=>t!==a)):i=e,a=X(a)}return e.set(t,o),o}function it(t,e,n){const o=$(e),i=F(e),r="fixed"===n,a=Z(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(o||!o&&!r)if(("body"!==O(e)||H(i))&&(s=I(e)),o){const t=Z(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=tt(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function rt(t,e){return $(t)&&"fixed"!==q(t).position?e?e(t):t.offsetParent:null}function at(t,e){const n=C(t);if(!$(t))return n;let o=rt(t,e);for(;o&&N(o)&&"static"===q(o).position;)o=rt(o,e);return o&&("html"===O(o)||"body"===O(o)&&"static"===q(o).position&&!W(o))?n:o||function(t){let e=X(t);for(;$(e)&&!V(e);){if(W(e))return e;e=X(e)}return null}(t)||n}const st={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=$(n),r=F(n);if(n===r)return e;let a={scrollLeft:0,scrollTop:0},s=h(1);const l=h(0);if((i||!i&&"fixed"!==o)&&(("body"!==O(n)||H(r))&&(a=I(n)),$(n))){const t=Z(n);s=K(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:F,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?ot(e,this._c):[].concat(n),o],a=r[0],s=r.reduce(((t,n)=>{const o=et(e,n,i);return t.top=c(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=c(o.left,t.left),t}),et(e,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:at,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||at,r=this.getDimensions;return{reference:it(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return G(t)},getScale:K,isElement:B,isRTL:function(t){return"rtl"===q(t).direction}};var lt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,ft=(t,e,n,o)=>{for(var i,r=o>1?void 0:o?ct(e,n):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o?i(e,n,r):i(r))||r);return o&&r&<(e,n,r),r};let pt=class extends o{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=J(t),u=i||r?[...h?_(h):[],..._(e)]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const d=h&&s?function(t,e){let n,o=null;const i=F(t);function r(){clearTimeout(n),o&&o.disconnect(),o=null}return function a(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const{left:h,top:u,width:d,height:m}=t.getBoundingClientRect();if(s||e(),!d||!m)return;const y={rootMargin:-p(u)+"px "+-p(i.clientWidth-(h+d))+"px "+-p(i.clientHeight-(u+m))+"px "+-p(h)+"px",threshold:c(0,l(1,f))||1};let g=!0;function w(t){const e=t[0].intersectionRatio;if(e!==f){if(!g)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}g=!1}try{o=new IntersectionObserver(w,{...y,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,y)}o.observe(t)}(!0),r}(h,n):null;let m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{y&&y.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let g,w=f?Z(t):null;return f&&function e(){const o=Z(t);w&&(o.x!==w.x||o.y!==w.y||o.width!==w.width||o.height!==w.height)&&n(),w=o,g=requestAnimationFrame(e)}(),n(),()=>{u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),d&&d(),y&&y.disconnect(),y=null,f&&cancelAnimationFrame(g)}}(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[A({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(k({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...b}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=g(i),R=g(s)===s,S=await(null==l.isRTL?void 0:l.isRTL(c.floating)),T=h||(R||!m?[z(s)]:function(t){const e=z(t);return[E(t),e,E(e)]}(s));!h&&"none"!==d&&T.push(...function(t,e,n,o){const i=w(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(s,m,d,S));const A=[s,...T],k=await L(e,b),O=[];let C=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&O.push(k[x]),p){const t=function(t,e,n){void 0===n&&(n=!1);const o=w(t),i=P(t),r=v(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=z(a)),[a,z(a)]}(i,a,S);O.push(k[t[0]],k[t[1]])}if(C=[...C,{placement:i,overflows:O}],!O.every((t=>t<=0))){var F,D;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=A[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(D=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(u){case"bestFit":{var B;const t=null==(B=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}}({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:o},f=await L(e,l),p=x(g(i)),h=b(p);let u=c[h],d=c[p];if(r){const t="y"===h?"bottom":"right";u=m(u+f["y"===h?"top":"left"],u,u-f[t])}if(a){const t="y"===p?"bottom":"right";d=m(d+f["y"===p?"top":"left"],d,d-f[t])}const w=s.fn({...e,[h]:u,[p]:d});return{...w,data:{x:w.x-n,y:w.y-o}}}}}({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(k({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:f,padding:p=0}=y(t,e)||{};if(null==f)return{};const h=R(p),u={x:n,y:o},d=P(i),g=v(d),b=await a.getDimensions(f),x="y"===d,E=x?"top":"left",z=x?"bottom":"right",S=x?"clientHeight":"clientWidth",T=r.reference[g]+r.reference[d]-u[d]-r.floating[g],L=u[d]-r.reference[d],A=await(null==a.getOffsetParent?void 0:a.getOffsetParent(f));let k=A?A[S]:0;(!k||!await(null==a.isElement?void 0:a.isElement(A)))&&(k=s.floating[S]||r.floating[g]);const O=T/2-L/2,C=k/2-b[g]/2-1,F=l(h[E],C),D=l(h[z],C),B=F,$=k-b[g]-D,j=k/2-b[g]/2+O,H=m(B,j,$),N=!c.arrow&&null!=w(i)&&j!=H&&r.reference[g]/2-(j<B?F:D)-b[g]/2<0,W=N?j<B?j-B:j-$:0;return{[d]:u[d]+W,data:{[d]:H,centerOffset:j-H-W,...N&&{alignmentOffset:W}},reset:N}}}))({element:this.arrowEl,padding:this.arrowPadding})),((t,e,n)=>{const o=new Map,i={platform:st,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=T(c,o,l),h=o,u={},d=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:g,data:w,reset:b}=await m({x:f,y:p,initialPlacement:o,placement:h,strategy:i,middlewareData:u,rects:c,platform:a,elements:{reference:t,floating:e}});f=y??f,p=g??p,u={...u,[r]:{...u[r],...w}},b&&d<=50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:p}=T(c,h,l))),n=-1)}return{x:f,y:p,placement:h,strategy:i,middlewareData:u}})(t,e,{...i,platform:r})})(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy}).then((({x:t,y:e,middlewareData:n,placement:o})=>{const i="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let o="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?n:"",l=i?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":n,l=i?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sd-reposition")}render(){return t`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${s("isolate","fixed"!==this.strategy?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?t`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};pt.styles=[o.styles,a,e`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}[part=arrow]{width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);background:var(--arrow-color)}`],ft([r('[part="popup"]')],pt.prototype,"popup",2),ft([r('[part="arrow"]')],pt.prototype,"arrowEl",2),ft([i()],pt.prototype,"anchor",2),ft([i({type:Boolean,reflect:!0})],pt.prototype,"active",2),ft([i({reflect:!0})],pt.prototype,"placement",2),ft([i({reflect:!0})],pt.prototype,"strategy",2),ft([i({type:Number})],pt.prototype,"distance",2),ft([i({type:Number})],pt.prototype,"skidding",2),ft([i({type:Boolean})],pt.prototype,"arrow",2),ft([i({attribute:"arrow-placement"})],pt.prototype,"arrowPlacement",2),ft([i({attribute:"arrow-padding",type:Number})],pt.prototype,"arrowPadding",2),ft([i({type:Boolean})],pt.prototype,"flip",2),ft([i({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],pt.prototype,"flipFallbackPlacements",2),ft([i({attribute:"flip-fallback-strategy"})],pt.prototype,"flipFallbackStrategy",2),ft([i({type:Object})],pt.prototype,"flipBoundary",2),ft([i({attribute:"flip-padding",type:Number})],pt.prototype,"flipPadding",2),ft([i({type:Boolean})],pt.prototype,"shift",2),ft([i({type:Object})],pt.prototype,"shiftBoundary",2),ft([i({attribute:"shift-padding",type:Number})],pt.prototype,"shiftPadding",2),ft([i({attribute:"auto-size"})],pt.prototype,"autoSize",2),ft([i()],pt.prototype,"sync",2),ft([i({type:Object})],pt.prototype,"autoSizeBoundary",2),ft([i({attribute:"auto-size-padding",type:Number})],pt.prototype,"autoSizePadding",2),pt=ft([n("sd-1-21-0-popup")],pt);export{pt as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as e}from"./query.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2021 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/function t(t){return(o,r)=>{const{slot:n,selector:s}=t??{},l="slot"+(n?`[name=${n}]`:":not([name])");return e(o,r,{get(){var e;const o=null==(e=this.renderRoot)?void 0:e.querySelector(l),r=(null==o?void 0:o.assignedElements(t))??[];return void 0===s?r:r.filter((e=>e.matches(s)))}})}}export{t as o};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import{o}from"./solid-element.js";
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
3
|
* Copyright 2017 Google LLC
|
|
5
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/
|
|
5
|
+
*/
|
|
6
|
+
const e=(e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r)
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/;function t(t,r){return(n,o,s)=>{const u=e=>{var r;return(null==(r=e.renderRoot)?void 0:r.querySelector(t))??null};if(r){const{get:t,set:c}="object"==typeof o?n:s??(()=>{const e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return e(n,o,{get(){if(r){let e=t.call(this);return void 0===e&&(e=u(this),c.call(this,e)),e}return u(this)}})}return e(n,o,{get(){return u(this)}})}}export{e as a,t as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t,x as e}from"./lit-element.js";import{c as o}from"./register-custom-element.js";import{F as s,c as i,a as l,v as a}from"./form.js";import{H as r}from"./slot.js";import{n,S as d}from"./solid-element.js";import{
|
|
1
|
+
import{i as t,x as e}from"./lit-element.js";import{c as o}from"./register-custom-element.js";import{F as s,c as i,a as l,v as a}from"./form.js";import{H as r}from"./slot.js";import{n,S as d}from"./solid-element.js";import{r as h}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as p}from"./component.styles.js";import{t as m}from"./classix.js";const g=t`${p}:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`;var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,b=(t,e,o,s)=>{for(var i,l=s>1?void 0:s?v(e,o):e,a=t.length-1;a>=0;a--)(i=t[a])&&(l=(s?i(e,o,l):i(l))||l);return s&&l&&f(e,o,l),l};let y=class extends d{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=C(t.target);null==e||e.classList.add("sd-1-21-0-button-group__button--focus")}handleBlur(t){const e=C(t.target);null==e||e.classList.remove("sd-1-21-0-button-group__button--focus")}handleMouseOver(t){const e=C(t.target);null==e||e.classList.add("sd-1-21-0-button-group__button--hover")}handleMouseOut(t){const e=C(t.target);null==e||e.classList.remove("sd-1-21-0-button-group__button--hover")}handleSlotChange(){const t=[...this.defaultSlot.assignedElements({flatten:!0})];t.forEach((e=>{const o=t.indexOf(e),s=C(e);null!==s&&(s.classList.add("sd-1-21-0-button-group__button"),s.classList.toggle("sd-1-21-0-button-group__button--first",0===o),s.classList.toggle("sd-1-21-0-button-group__button--inner",o>0&&o<t.length-1),s.classList.toggle("sd-1-21-0-button-group__button--last",o===t.length-1),s.classList.toggle("sd-1-21-0-button-group__button--radio","sd-1-21-0-radio-button"===s.tagName.toLowerCase()))}))}render(){return e`<slot part="base" class="button-group" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}" @slotchange="${this.handleSlotChange}"></slot>`}};function C(t){const e="sd-1-21-0-button, sd-1-21-0-radio-button";return t.closest(e)??t.querySelector(e)}y.styles=g,b([u("slot")],y.prototype,"defaultSlot",2),b([h()],y.prototype,"disableRole",2),b([n()],y.prototype,"label",2),y=b([o("sd-1-21-0-button-group")],y);var x=Object.defineProperty,w=Object.getOwnPropertyDescriptor,_=(t,e,o,s)=>{for(var i,l=s>1?void 0:s?w(e,o):e,a=t.length-1;a>=0;a--)(i=t[a])&&(l=(s?i(e,o,l):i(l))||l);return s&&l&&x(e,o,l),l};let R=class extends d{constructor(){super(...arguments),this.formControlController=new s(this),this.hasSlotController=new r(this,"label","error-text"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.invalid=!1,this.errorText="",this.label="",this.name="option",this.value="",this.size="lg",this.form="",this.required=!1,this.orientation="vertical"}get validity(){const t=this.required&&!this.value;return""!==this.customValidityMessage?(this.invalid=!0,i):t?(this.invalid=!0,l):(this.invalid=!1,a)}get validationMessage(){const t=this.required&&!this.value;return""!==this.customValidityMessage?(console.log("this.customValidityMessage",this.customValidityMessage),this.customValidityMessage):t?(console.log("this.validationInput.validationMessage",this.validationInput),this.validationInput.validationMessage):""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value}firstUpdated(){this.formControlController.updateValidity()}getAllRadios(){return[...this.querySelectorAll("sd-1-21-0-radio, sd-1-21-0-radio-button")]}handleRadioClick(t){const e=t.target.closest("sd-1-21-0-radio, sd-1-21-0-radio-button"),o=this.getAllRadios(),s=this.value;e.disabled||(this.value=e.value,o.forEach((t=>t.checked=t===e)),this.value!==s&&(this.emit("sd-change"),this.emit("sd-input")))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),o=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,i=this.value;let l=e.indexOf(o)+s;l<0&&(l=e.length-1),l>e.length-1&&(l=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[l].value,e[l].checked=!0,this.hasButtonGroup?e[l].shadowRoot.querySelector("button").focus():(e[l].tabIndex=0,e[l].focus()),this.value!==i&&(this.emit("sd-change"),this.emit("sd-input")),t.preventDefault()}handleLabelClick(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}async syncRadioElements(){var t,e;const o=this.getAllRadios();if(await Promise.all(o.map((async t=>{await t.updateComplete,t.checked=t.value===this.value,t.size=this.size,t.invalid=this.invalid}))),this.hasButtonGroup=o.some((t=>"sd-1-21-0-radio-button"===t.tagName.toLowerCase())),!o.some((t=>t.checked)))if(this.hasButtonGroup){const e=null==(t=o[0].shadowRoot)?void 0:t.querySelector("button");e&&(e.tabIndex=0)}else o[0].tabIndex=0;if(this.hasButtonGroup){const t=null==(e=this.shadowRoot)?void 0:e.querySelector("sd-1-21-0-button-group");t&&(t.disableRole=!0)}}syncRadios(){customElements.get("sd-1-21-0-radio")&&customElements.get("sd-1-21-0-radio-button")?this.syncRadioElements():(customElements.get("sd-1-21-0-radio")?this.syncRadioElements():customElements.whenDefined("sd-1-21-0-radio").then((()=>this.syncRadios())),customElements.get("sd-1-21-0-radio-button")?this.syncRadioElements():customElements.whenDefined("sd-1-21-0-radio-button").then((()=>this.syncRadios())))}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value)),this.formControlController.setValidity(this.validity.valid)}handleSizeChange(){this.syncRadios()}handleInvalidChange(){this.syncRadios()}handleValueChange(){this.hasUpdated&&(this.updateCheckedRadio(),this.reportValidity())}checkValidity(){const t=this.required&&!this.value,e=""!==this.customValidityMessage;return!t&&!e||(this.formControlController.emitInvalidEvent(),!1)}getForm(){return this.formControlController.getForm()}reportValidity(){const t=this.validity.valid;return this.errorText=this.customValidityMessage||t?"":this.validationInput.validationMessage,this.formControlController.setValidity(t),this.validationInput.hidden=!0,clearTimeout(this.validationTimeout),t||(this.validationInput.hidden=!1,this.validationInput.reportValidity(),this.validationTimeout=setTimeout((()=>this.validationInput.hidden=!0),1e4)),t}setCustomValidity(t=""){this.customValidityMessage=t,this.errorText=t,this.validationInput.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),o=this.hasSlotController.test("error-text"),s=!!this.label||!!t,i=!!this.errorText||!!o,l=e`<slot @slotchange="${this.syncRadios}" @click="${this.handleRadioClick}" @keydown="${this.handleKeyDown}"></slot>`;return e`<fieldset part="form-control" class="${m("form-control form-control--radio-group border-0 p-0 m-0",s&&"form-control--has-label",i&&"text-error",{sm:"text-sm",lg:"text-base"}[this.size])}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="form-control__label mb-2 hidden p-0 font-bold leading-normal text-black" aria-hidden="${!s}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${m("form-control-input flex",this.invalid&&"form-control-input--invalid text-error",{vertical:"form-control-input--vertical flex-col",horizontal:"form-control-input--horizontal flex-row"}[this.orientation])}"><div class="sr-only"><div id="error-message" aria-live="assertive">${this.errorText}</div><label class="radio-group__validation"><input type="text" class="radio-group__validation-input" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${l}</div></fieldset>`}};R.dependencies={"sd-1-21-0-button-group":y},R.styles=[p,d.styles,t`:host{display:block}.form-control-input--vertical ::slotted(sd-1-21-0-radio){margin-bottom:8px;display:flex}.form-control-input--vertical ::slotted(sd-1-21-0-radio:last-of-type){margin-bottom:0}.form-control-input--horizontal ::slotted(sd-1-21-0-radio){margin-right:24px}.form-control-input--horizontal ::slotted(sd-1-21-0-radio:last-of-type){margin-right:0}.form-control--has-label .form-control__label{display:flex}:host([required]) .form-control--has-label .form-control__label::after{content:'*';margin-left:2px}`],_([u("slot:not([name])")],R.prototype,"defaultSlot",2),_([u(".radio-group__validation-input")],R.prototype,"validationInput",2),_([h()],R.prototype,"hasButtonGroup",2),_([h()],R.prototype,"defaultValue",2),_([h()],R.prototype,"invalid",2),_([h()],R.prototype,"errorText",2),_([n()],R.prototype,"label",2),_([n()],R.prototype,"name",2),_([n({reflect:!0})],R.prototype,"value",2),_([n({reflect:!0})],R.prototype,"size",2),_([n({reflect:!0})],R.prototype,"form",2),_([n({type:Boolean,reflect:!0})],R.prototype,"required",2),_([n({reflect:!0})],R.prototype,"orientation",2),_([c("size",{waitUntilFirstUpdate:!0})],R.prototype,"handleSizeChange",1),_([c("invalid",{waitUntilFirstUpdate:!0})],R.prototype,"handleInvalidChange",1),_([c("value")],R.prototype,"handleValueChange",1),R=_([o("sd-1-21-0-radio-group")],R);export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{x as e,i as t}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{S as i,n as r}from"./solid-element.js";import{
|
|
1
|
+
import"./icon.js";import{x as e,i as t}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{S as i,n as r}from"./solid-element.js";import{r as o}from"./state.js";import{w as l}from"./watch.js";import{t as a}from"./classix.js";import"./solid-components2.js";import"./request.js";import"./request2.js";import"./component.styles.js";var n=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(e,t,s,i)=>{for(var r,o=i>1?void 0:i?h(t,s):t,l=e.length-1;l>=0;l--)(r=e[l])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&n(t,s,o),o};let c=class extends i{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.invalid=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return e`<span part="base" class="${a("sd-1-21-0-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",this.checked&&"radio--checked",this.disabled&&"hover:cursor-not-allowed",this.hasFocus&&"radio--focused",{sm:"small-size text-sm",lg:"text-base"}[this.size])}"><span part="${this.checked?"control--checked":"control--unchecked"}" class="${a("flex-initial shrink-0 relative inline-flex items-center justify-center border rounded-full bg-white h-4 w-4",(this.disabled?"border-neutral-500":this.invalid&&"border-error hover:border-error-400 group-hover:border-error-400")||this.checked&&"border-accent hover:border-accent-550 group-hover:border-accent-550"||"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200")}">${this.checked?e`<span part="checked" class="${a("rounded-full inline-flex text-white border bg-accent h-2.5 w-2.5",(this.disabled?"bg-neutral-500":this.invalid&&"bg-error hover:bg-error-400 group-hover:bg-error-400")||this.checked&&"bg-accent hover:bg-accent-550 group-hover:bg-accent-550"||"bg-neutral-800")}"></span>`:""}</span><slot part="label" class="${a("label ml-2 select-none inline-block",(this.disabled?"text-neutral-500":this.invalid&&"text-error")||"text-black")}"></slot></span>`}};c.styles=[i.styles,t`:host{display:block}:host(:focus-visible){outline:0}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline:2px solid #00358e;outline-offset:2px}`],d([o()],c.prototype,"checked",2),d([o()],c.prototype,"hasFocus",2),d([r({reflect:!0})],c.prototype,"size",2),d([r({type:Boolean,reflect:!0})],c.prototype,"invalid",2),d([r({type:Boolean,reflect:!0})],c.prototype,"disabled",2),d([r()],c.prototype,"value",2),d([l("checked")],c.prototype,"handleCheckedChange",1),d([l("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",1),c=d([s("sd-1-21-0-radio")],c);export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={"chevron-down":'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>\n </svg>\n ',"chevron-up":'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>\n </svg>\n ',close:'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>\n </svg>\n',start:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>\n </svg>',pause:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>\n </svg>\n '},o={name:"system",resolver:o=>o in e?`data:image/svg+xml,${encodeURIComponent(e[o])}`:"",mutator:e=>e.setAttribute("fill","currentColor")},t=Object.freeze(Object.defineProperty({__proto__:null,default:o,icons:e},Symbol.toStringTag,{value:"Module"}));let n=[o],s=[];function r(e){s.push(e)}function a(e){s=s.filter((o=>o!==e))}function i(e){return n.find((o=>o.name===e))}function l(e,o){c(e),n.push({name:e,resolver:o.resolver,mutator:o.mutator}),s.forEach((o=>{o.library===e&&o.setIcon()}))}function c(e){n=n.filter((o=>o.name!==e))}const m=Object.freeze(Object.defineProperty({__proto__:null,getIconLibrary:i,registerIconLibrary:l,unregisterIconLibrary:c,unwatchIcon:a,watchIcon:r},Symbol.toStringTag,{value:"Module"})),p=new Set,d=new MutationObserver(w),u=new Map;let g,v=document.documentElement.dir||"ltr",h=document.documentElement.lang||navigator.language;function w(){v=document.documentElement.dir||"ltr",h=document.documentElement.lang||navigator.language,[...p.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let b=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){p.add(this.host)}hostDisconnected(){p.delete(this.host)}dir(){return`${this.host.dir||v}`.toLowerCase()}lang(){return`${this.host.lang||h}`.toLowerCase()}getTranslationData(e){var o,t;const n=new Intl.Locale(e),s=null==n?void 0:n.language.toLowerCase(),r=null!==(t=null===(o=null==n?void 0:n.region)||void 0===o?void 0:o.toLowerCase())&&void 0!==t?t:"";return{locale:n,language:s,region:r,primary:u.get(`${s}-${r}`),secondary:u.get(s)}}exists(e,o){var t;const{primary:n,secondary:s}=this.getTranslationData(null!==(t=o.lang)&&void 0!==t?t:this.lang());return o=Object.assign({includeFallback:!1},o),!!(n&&n[e]||s&&s[e]||o.includeFallback&&g&&g[e])}term(e,...o){const{primary:t,secondary:n}=this.getTranslationData(this.lang());let s;if(t&&t[e])s=t[e];else if(n&&n[e])s=n[e];else{if(!g||!g[e])return console.error(`No translation found for: ${String(e)}`),String(e);s=g[e]}return"function"==typeof s?s(...o):s}date(e,o){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),o).format(e)}number(e,o){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),o).format(e)}relativeTime(e,o,t){return new Intl.RelativeTimeFormat(this.lang(),t).format(e,o)}};!function(...e){e.map((e=>{const o=e.$code.toLowerCase();u.has(o)?u.set(o,Object.assign(Object.assign({},u.get(o)),e)):u.set(o,e),g||(g=e)})),w()}({$code:"en",$name:"English",$dir:"ltr",clearEntry:"Clear entry",close:"Close",copy:"Copy",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,currentValue:"Current value",hidePassword:"Hide password",loading:"Loading",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",toggleColorFormat:"Toggle color format",carousel:"Carousel",nextSlide:"Next slide",previousSlide:"Previous slide",goToSlide:(e,o)=>`Go to slide ${e} of ${o}`,slideNum:e=>`Slide ${e}`});class j extends b{}const f=Object.assign({"./components/accordion-group/accordion-group.ts":()=>import("./accordion-group.js"),"./components/accordion/accordion.ts":()=>import("./accordion.js"),"./components/badge/badge.ts":()=>import("./badge.js"),"./components/brandshape/brandshape.ts":()=>import("./brandshape.js"),"./components/button/button.ts":()=>import("./button.js"),"./components/carousel-item/carousel-item.ts":()=>import("./carousel-item.js"),"./components/carousel/autoplay-controller.ts":()=>import("./autoplay-controller.js"),"./components/carousel/carousel.ts":()=>import("./carousel.js"),"./components/carousel/scroll-controller.ts":()=>import("./scroll-controller.js"),"./components/divider/divider.ts":()=>import("./divider.js"),"./components/drawer/drawer.ts":()=>import("./drawer.js"),"./components/dropdown/dropdown.ts":()=>import("./dropdown.js"),"./components/icon/icon.ts":()=>import("./icon.js"),"./components/icon/library.system.ts":()=>Promise.resolve().then((()=>t)),"./components/icon/library.ts":()=>Promise.resolve().then((()=>m)),"./components/icon/request.ts":()=>import("./request.js"),"./components/include/include.styles.ts":()=>import("./include.styles.js"),"./components/include/include.ts":()=>import("./include.js"),"./components/include/request.ts":()=>import("./request2.js"),"./components/link/link.ts":()=>import("./link.js"),"./components/navigation-item/navigation-item.ts":()=>import("./navigation-item.js"),"./components/popup/popup.ts":()=>import("./popup.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.js"),"./components/spinner/spinner.ts":()=>import("./spinner.js"),"./components/tag/tag.ts":()=>import("./tag.js"),"./components/teaser/teaser.ts":()=>import("./teaser.js"),"./components/video/video.ts":()=>import("./video.js")});Object.keys(f).forEach((e=>{f[e]()}));export{j as L,c as a,i as g,l as r,a as u,r as w};
|
|
1
|
+
const e={"chevron-down":'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>\n </svg>\n ',"chevron-up":'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>\n </svg>\n ',close:'\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>\n </svg>\n',start:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>\n </svg>',pause:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>\n </svg>\n '},o={name:"system",resolver:o=>o in e?`data:image/svg+xml,${encodeURIComponent(e[o])}`:"",mutator:e=>e.setAttribute("fill","currentColor")},t=Object.freeze(Object.defineProperty({__proto__:null,default:o,icons:e},Symbol.toStringTag,{value:"Module"}));let n=[o],s=[];function r(e){s.push(e)}function a(e){s=s.filter((o=>o!==e))}function i(e){return n.find((o=>o.name===e))}function l(e,o){c(e),n.push({name:e,resolver:o.resolver,mutator:o.mutator}),s.forEach((o=>{o.library===e&&o.setIcon()}))}function c(e){n=n.filter((o=>o.name!==e))}const m=Object.freeze(Object.defineProperty({__proto__:null,getIconLibrary:i,registerIconLibrary:l,unregisterIconLibrary:c,unwatchIcon:a,watchIcon:r},Symbol.toStringTag,{value:"Module"})),p=new Set,d=new MutationObserver(w),u=new Map;let g,v=document.documentElement.dir||"ltr",h=document.documentElement.lang||navigator.language;function w(){v=document.documentElement.dir||"ltr",h=document.documentElement.lang||navigator.language,[...p.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let b=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){p.add(this.host)}hostDisconnected(){p.delete(this.host)}dir(){return`${this.host.dir||v}`.toLowerCase()}lang(){return`${this.host.lang||h}`.toLowerCase()}getTranslationData(e){var o,t;const n=new Intl.Locale(e.replace(/_/g,"-")),s=null==n?void 0:n.language.toLowerCase(),r=null!==(t=null===(o=null==n?void 0:n.region)||void 0===o?void 0:o.toLowerCase())&&void 0!==t?t:"";return{locale:n,language:s,region:r,primary:u.get(`${s}-${r}`),secondary:u.get(s)}}exists(e,o){var t;const{primary:n,secondary:s}=this.getTranslationData(null!==(t=o.lang)&&void 0!==t?t:this.lang());return o=Object.assign({includeFallback:!1},o),!!(n&&n[e]||s&&s[e]||o.includeFallback&&g&&g[e])}term(e,...o){const{primary:t,secondary:n}=this.getTranslationData(this.lang());let s;if(t&&t[e])s=t[e];else if(n&&n[e])s=n[e];else{if(!g||!g[e])return console.error(`No translation found for: ${String(e)}`),String(e);s=g[e]}return"function"==typeof s?s(...o):s}date(e,o){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),o).format(e)}number(e,o){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),o).format(e)}relativeTime(e,o,t){return new Intl.RelativeTimeFormat(this.lang(),t).format(e,o)}};!function(...e){e.map((e=>{const o=e.$code.toLowerCase();u.has(o)?u.set(o,Object.assign(Object.assign({},u.get(o)),e)):u.set(o,e),g||(g=e)})),w()}({$code:"en",$name:"English",$dir:"ltr",clearEntry:"Clear entry",close:"Close",copy:"Copy",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,currentValue:"Current value",hidePassword:"Hide password",loading:"Loading",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",toggleColorFormat:"Toggle color format",carousel:"Carousel",nextSlide:"Next slide",previousSlide:"Previous slide",goToSlide:(e,o)=>`Go to slide ${e} of ${o}`,slideNum:e=>`Slide ${e}`});class j extends b{}const f=Object.assign({"./components/accordion-group/accordion-group.ts":()=>import("./accordion-group.js"),"./components/accordion/accordion.ts":()=>import("./accordion.js"),"./components/badge/badge.ts":()=>import("./badge.js"),"./components/brandshape/brandshape.ts":()=>import("./brandshape.js"),"./components/button/button.ts":()=>import("./button.js"),"./components/carousel-item/carousel-item.ts":()=>import("./carousel-item.js"),"./components/carousel/autoplay-controller.ts":()=>import("./autoplay-controller.js"),"./components/carousel/carousel.ts":()=>import("./carousel.js"),"./components/carousel/scroll-controller.ts":()=>import("./scroll-controller.js"),"./components/divider/divider.ts":()=>import("./divider.js"),"./components/drawer/drawer.ts":()=>import("./drawer.js"),"./components/dropdown/dropdown.ts":()=>import("./dropdown.js"),"./components/icon/icon.ts":()=>import("./icon.js"),"./components/icon/library.system.ts":()=>Promise.resolve().then((()=>t)),"./components/icon/library.ts":()=>Promise.resolve().then((()=>m)),"./components/icon/request.ts":()=>import("./request.js"),"./components/include/include.styles.ts":()=>import("./include.styles.js"),"./components/include/include.ts":()=>import("./include.js"),"./components/include/request.ts":()=>import("./request2.js"),"./components/link/link.ts":()=>import("./link.js"),"./components/navigation-item/navigation-item.ts":()=>import("./navigation-item.js"),"./components/popup/popup.ts":()=>import("./popup.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.js"),"./components/spinner/spinner.ts":()=>import("./spinner.js"),"./components/tag/tag.ts":()=>import("./tag.js"),"./components/teaser/teaser.ts":()=>import("./teaser.js"),"./components/video/video.ts":()=>import("./video.js")});Object.keys(f).forEach((e=>{f[e]()}));export{j as L,c as a,i as g,l as r,a as u,r as w};
|