@govtechsg/sgds-web-component 3.6.0-rc.2 → 3.6.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/base/button.js +1 -1
- package/components/Alert/index.umd.min.js +17 -17
- package/components/Alert/index.umd.min.js.map +1 -1
- package/components/Alert/sgds-alert.d.ts +1 -1
- package/components/Alert/sgds-alert.js +2 -2
- package/components/Alert/sgds-alert.js.map +1 -1
- package/components/Badge/index.umd.min.js +16 -16
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Badge/sgds-badge.d.ts +1 -1
- package/components/Badge/sgds-badge.js +2 -2
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +17 -17
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/Breadcrumb/sgds-breadcrumb-item.d.ts +1 -0
- package/components/Breadcrumb/sgds-breadcrumb-item.js +5 -2
- package/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -1
- package/components/Button/index.umd.min.js +1 -1
- package/components/Card/index.umd.min.js.map +1 -1
- package/components/Card/sgds-card.js.map +1 -1
- package/components/CloseButton/close-button.js +6 -0
- package/components/CloseButton/index.js +5 -0
- package/components/CloseButton/index.js.map +1 -0
- package/components/CloseButton/index.umd.min.js +50 -0
- package/components/CloseButton/index.umd.min.js.map +1 -0
- package/{internals → components}/CloseButton/sgds-close-button.d.ts +2 -4
- package/{internals → components}/CloseButton/sgds-close-button.js +4 -10
- package/components/CloseButton/sgds-close-button.js.map +1 -0
- package/components/ComboBox/index.umd.min.js +18 -18
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Drawer/index.umd.min.js +6 -11
- package/components/Drawer/index.umd.min.js.map +1 -1
- package/components/Drawer/sgds-drawer.d.ts +1 -1
- package/components/Drawer/sgds-drawer.js +1 -1
- package/components/Drawer/sgds-drawer.js.map +1 -1
- package/components/FileUpload/index.umd.min.js +26 -26
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +1 -1
- package/components/FileUpload/sgds-file-upload.js +1 -1
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/footer-item.js +1 -1
- package/components/Footer/footer.js +1 -1
- package/components/Footer/index.umd.min.js +17 -17
- package/components/Footer/index.umd.min.js.map +1 -1
- package/components/Footer/sgds-footer-item.d.ts +1 -0
- package/components/Footer/sgds-footer-item.js +11 -1
- package/components/Footer/sgds-footer-item.js.map +1 -1
- package/components/Footer/sgds-footer.js +7 -7
- package/components/Footer/sgds-footer.js.map +1 -1
- package/components/IconButton/index.umd.min.js +1 -1
- package/components/IconCard/index.umd.min.js.map +1 -1
- package/components/IconCard/sgds-icon-card.js.map +1 -1
- package/components/ImageCard/index.umd.min.js.map +1 -1
- package/components/ImageCard/sgds-image-card.js.map +1 -1
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Link/index.umd.min.js +9 -9
- package/components/Link/index.umd.min.js.map +1 -1
- package/components/Link/link.js +1 -1
- package/components/Link/sgds-link.d.ts +7 -1
- package/components/Link/sgds-link.js +28 -2
- package/components/Link/sgds-link.js.map +1 -1
- package/components/Mainnav/index.umd.min.js +1 -1
- package/components/Modal/index.umd.min.js +4 -4
- package/components/Modal/index.umd.min.js.map +1 -1
- package/components/Modal/sgds-modal.d.ts +1 -1
- package/components/Modal/sgds-modal.js +2 -2
- package/components/Modal/sgds-modal.js.map +1 -1
- package/components/Pagination/index.umd.min.js +1 -1
- package/components/QuantityToggle/index.umd.min.js +1 -1
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Subnav/index.umd.min.js +11 -9
- package/components/Subnav/index.umd.min.js.map +1 -1
- package/components/Subnav/sgds-subnav.d.ts +4 -0
- package/components/Subnav/sgds-subnav.js +18 -2
- package/components/Subnav/sgds-subnav.js.map +1 -1
- package/components/Subnav/subnav.js +1 -1
- package/components/SystemBanner/index.d.ts +6 -0
- package/components/SystemBanner/index.js +6 -0
- package/components/SystemBanner/index.js.map +1 -0
- package/components/SystemBanner/index.umd.min.js +2101 -0
- package/components/SystemBanner/index.umd.min.js.map +1 -0
- package/components/SystemBanner/sgds-system-banner-item.d.ts +24 -0
- package/components/SystemBanner/sgds-system-banner-item.js +93 -0
- package/components/SystemBanner/sgds-system-banner-item.js.map +1 -0
- package/components/SystemBanner/sgds-system-banner.d.ts +51 -0
- package/components/SystemBanner/sgds-system-banner.js +224 -0
- package/components/SystemBanner/sgds-system-banner.js.map +1 -0
- package/components/SystemBanner/system-banner-context.d.ts +3 -0
- package/components/SystemBanner/system-banner-context.js +6 -0
- package/components/SystemBanner/system-banner-context.js.map +1 -0
- package/components/SystemBanner/system-banner-item.js +6 -0
- package/components/SystemBanner/system-banner-item.js.map +1 -0
- package/components/SystemBanner/system-banner.js +6 -0
- package/components/SystemBanner/system-banner.js.map +1 -0
- package/components/Toast/index.umd.min.js +12 -12
- package/components/Toast/index.umd.min.js.map +1 -1
- package/components/Toast/sgds-toast.d.ts +1 -1
- package/components/Toast/sgds-toast.js +2 -2
- package/components/Toast/sgds-toast.js.map +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.js +2 -0
- package/components/index.js.map +1 -1
- package/components/index.umd.min.js +168 -136
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +3 -0
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.umd.min.js +212 -161
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/button.cjs.js +1 -1
- package/react/base/button.js +1 -1
- package/react/close-button/index.cjs.js +40 -0
- package/react/close-button/index.cjs.js.map +1 -0
- package/react/close-button/index.d.ts +2 -0
- package/react/close-button/index.js +16 -0
- package/react/close-button/index.js.map +1 -0
- package/react/components/Alert/sgds-alert.cjs.js +2 -2
- package/react/components/Alert/sgds-alert.cjs.js.map +1 -1
- package/react/components/Alert/sgds-alert.js +2 -2
- package/react/components/Alert/sgds-alert.js.map +1 -1
- package/react/components/Badge/sgds-badge.cjs.js +2 -2
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/react/components/Badge/sgds-badge.js +2 -2
- package/react/components/Badge/sgds-badge.js.map +1 -1
- package/react/components/Breadcrumb/sgds-breadcrumb-item.cjs.js +5 -2
- package/react/components/Breadcrumb/sgds-breadcrumb-item.cjs.js.map +1 -1
- package/react/components/Breadcrumb/sgds-breadcrumb-item.js +5 -2
- package/react/components/Breadcrumb/sgds-breadcrumb-item.js.map +1 -1
- package/react/components/Card/sgds-card.cjs.js.map +1 -1
- package/react/components/Card/sgds-card.js.map +1 -1
- package/react/components/CloseButton/close-button.cjs.js +11 -0
- package/react/components/CloseButton/close-button.js +7 -0
- package/react/{internals → components}/CloseButton/sgds-close-button.cjs.js +4 -10
- package/react/components/CloseButton/sgds-close-button.cjs.js.map +1 -0
- package/react/{internals → components}/CloseButton/sgds-close-button.js +4 -10
- package/react/components/CloseButton/sgds-close-button.js.map +1 -0
- package/react/components/Drawer/sgds-drawer.cjs.js +1 -1
- package/react/components/Drawer/sgds-drawer.cjs.js.map +1 -1
- package/react/components/Drawer/sgds-drawer.js +1 -1
- package/react/components/Drawer/sgds-drawer.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.js +1 -1
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/react/components/Footer/footer-item.cjs.js +1 -1
- package/react/components/Footer/footer-item.js +1 -1
- package/react/components/Footer/footer.cjs.js +1 -1
- package/react/components/Footer/footer.js +1 -1
- package/react/components/Footer/sgds-footer-item.cjs.js +11 -1
- package/react/components/Footer/sgds-footer-item.cjs.js.map +1 -1
- package/react/components/Footer/sgds-footer-item.js +11 -1
- package/react/components/Footer/sgds-footer-item.js.map +1 -1
- package/react/components/Footer/sgds-footer.cjs.js +7 -7
- package/react/components/Footer/sgds-footer.cjs.js.map +1 -1
- package/react/components/Footer/sgds-footer.js +7 -7
- package/react/components/Footer/sgds-footer.js.map +1 -1
- package/react/components/IconCard/sgds-icon-card.cjs.js.map +1 -1
- package/react/components/IconCard/sgds-icon-card.js.map +1 -1
- package/react/components/ImageCard/sgds-image-card.cjs.js.map +1 -1
- package/react/components/ImageCard/sgds-image-card.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Link/sgds-link.cjs.js +28 -2
- package/react/components/Link/sgds-link.cjs.js.map +1 -1
- package/react/components/Link/sgds-link.js +28 -2
- package/react/components/Link/sgds-link.js.map +1 -1
- package/react/components/Modal/sgds-modal.cjs.js +2 -2
- package/react/components/Modal/sgds-modal.cjs.js.map +1 -1
- package/react/components/Modal/sgds-modal.js +2 -2
- package/react/components/Modal/sgds-modal.js.map +1 -1
- package/react/components/Subnav/sgds-subnav.cjs.js +17 -1
- package/react/components/Subnav/sgds-subnav.cjs.js.map +1 -1
- package/react/components/Subnav/sgds-subnav.js +18 -2
- package/react/components/Subnav/sgds-subnav.js.map +1 -1
- package/react/components/Subnav/subnav.cjs.js +1 -1
- package/react/components/Subnav/subnav.js +1 -1
- package/react/components/SystemBanner/sgds-system-banner-item.cjs.js +99 -0
- package/react/components/SystemBanner/sgds-system-banner-item.cjs.js.map +1 -0
- package/react/components/SystemBanner/sgds-system-banner-item.js +94 -0
- package/react/components/SystemBanner/sgds-system-banner-item.js.map +1 -0
- package/react/components/SystemBanner/sgds-system-banner.cjs.js +230 -0
- package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -0
- package/react/components/SystemBanner/sgds-system-banner.js +225 -0
- package/react/components/SystemBanner/sgds-system-banner.js.map +1 -0
- package/react/components/SystemBanner/system-banner-context.cjs.js +11 -0
- package/react/components/SystemBanner/system-banner-context.cjs.js.map +1 -0
- package/react/components/SystemBanner/system-banner-context.js +7 -0
- package/react/components/SystemBanner/system-banner-context.js.map +1 -0
- package/react/components/SystemBanner/system-banner-item.cjs.js +11 -0
- package/react/components/SystemBanner/system-banner-item.cjs.js.map +1 -0
- package/react/components/SystemBanner/system-banner-item.js +7 -0
- package/react/components/SystemBanner/system-banner-item.js.map +1 -0
- package/react/components/SystemBanner/system-banner.cjs.js +11 -0
- package/react/components/SystemBanner/system-banner.cjs.js.map +1 -0
- package/react/components/SystemBanner/system-banner.js +7 -0
- package/react/components/SystemBanner/system-banner.js.map +1 -0
- package/react/components/Toast/sgds-toast.cjs.js +2 -2
- package/react/components/Toast/sgds-toast.cjs.js.map +1 -1
- package/react/components/Toast/sgds-toast.js +2 -2
- package/react/components/Toast/sgds-toast.js.map +1 -1
- package/react/index.cjs.js +114 -108
- package/react/index.cjs.js.map +1 -1
- package/react/index.d.ts +3 -0
- package/react/index.js +3 -0
- package/react/index.js.map +1 -1
- package/react/system-banner/index.cjs.js +43 -0
- package/react/system-banner/index.cjs.js.map +1 -0
- package/react/system-banner/index.d.ts +2 -0
- package/react/system-banner/index.js +19 -0
- package/react/system-banner/index.js.map +1 -0
- package/react/system-banner-item/index.cjs.js +42 -0
- package/react/system-banner-item/index.cjs.js.map +1 -0
- package/react/system-banner-item/index.d.ts +2 -0
- package/react/system-banner-item/index.js +18 -0
- package/react/system-banner-item/index.js.map +1 -0
- package/themes/root.css +14 -2
- package/internals/CloseButton/close-button.js +0 -6
- package/internals/CloseButton/sgds-close-button.js.map +0 -1
- package/react/internals/CloseButton/close-button.cjs.js +0 -11
- package/react/internals/CloseButton/close-button.js +0 -7
- package/react/internals/CloseButton/sgds-close-button.cjs.js.map +0 -1
- package/react/internals/CloseButton/sgds-close-button.js.map +0 -1
- package/utils/test.d.ts +0 -28
- /package/{internals → components}/CloseButton/close-button.js.map +0 -0
- /package/{internals → components}/CloseButton/index.d.ts +0 -0
- /package/react/{internals → components}/CloseButton/close-button.cjs.js.map +0 -0
- /package/react/{internals → components}/CloseButton/close-button.js.map +0 -0
|
@@ -15,7 +15,7 @@ const t=globalThis,s=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const S=globalThis,x=e=>{S.emitLitDebugLogEvents&&S.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let C,E=0;S.litIssuedWarnings??=new Set,C=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",S.litIssuedWarnings.has(t)||(console.warn(t),S.litIssuedWarnings.add(t))},C("dev-mode","Lit is in dev mode. Not recommended for production!");const k=S.ShadyDOM?.inUse&&!0===S.ShadyDOM?.noPatch?S.ShadyDOM.wrap:e=>e,U=S.trustedTypes,T=U?U.createPolicy("lit-html",{createHTML:e=>e}):void 0,O=e=>e,z=(e,t,s)=>O,N=e=>{if(re!==z)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");re=e},M=()=>{re=z},L=(e,t,s)=>re(e,t,s),R="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,V="?"+A,D=`<${V}>`,W=document,j=()=>W.createComment(""),q=e=>null===e||"object"!=typeof e&&"function"!=typeof e,I=Array.isArray,F="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,J=/>/g,K=new RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Z=/'/g,Y=/"/g,X=/^(?:script|style|textarea|title)$/i,G=(Q=1,(e,...t)=>(e.some((e=>void 0===e))&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some((e=>e?._$litStatic$))&&C("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:Q,strings:e,values:t}));var Q;const ee=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),se=new WeakMap,ie=W.createTreeWalker(W,129);let re=z;function ne(e,t){if(!I(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==T?T.createHTML(t):t}class oe{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let r=0,n=0;const o=e.length-1,a=this.parts,[l,d]=((e,t)=>{const s=e.length-1,i=[];let r,n=2===t?"<svg>":3===t?"<math>":"",o=H;for(let t=0;t<s;t++){const s=e[t];let a,l,d=-1,c=0;for(;c<s.length&&(o.lastIndex=c,l=o.exec(s),null!==l);)if(c=o.lastIndex,o===H){if("!--"===l[1])o=B;else if(void 0!==l[1])o=J;else if(void 0!==l[2])X.test(l[2])&&(r=new RegExp(`</${l[2]}`,"g")),o=K;else if(void 0!==l[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===K?">"===l[0]?(o=r??H,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?K:'"'===l[3]?Y:Z):o===Y||o===Z?o=K:o===B||o===J?o=H:(o=K,r=void 0);console.assert(-1===d||o===K||o===Z||o===Y,"unexpected parse state B");const h=o===K&&e[t+1].startsWith("/>")?" ":"";n+=o===H?s+D:d>=0?(i.push(a),s.slice(0,d)+R+s.slice(d)+A+h):s+A+(-2===d?t:h)}return[ne(e,n+(e[s]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]})(e,t);if(this.el=oe.createElement(l,s),ie.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=ie.nextNode())&&a.length<o;){if(1===i.nodeType){{const e=i.localName;if(/^(?:textarea|template)$/i.test(e)&&i.innerHTML.includes(A)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);C("",t)}}if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(R)){const t=d[n++],s=i.getAttribute(e).split(A),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:r,name:o[2],strings:s,ctor:"."===o[1]?he:"?"===o[1]?pe:"@"===o[1]?ue:ce}),i.removeAttribute(e)}else e.startsWith(A)&&(a.push({type:6,index:r}),i.removeAttribute(e));if(X.test(i.tagName)){const e=i.textContent.split(A),t=e.length-1;if(t>0){i.textContent=U?U.emptyScript:"";for(let s=0;s<t;s++)i.append(e[s],j()),ie.nextNode(),a.push({type:2,index:++r});i.append(e[t],j())}}}else if(8===i.nodeType){if(i.data===V)a.push({type:2,index:r});else{let e=-1;for(;-1!==(e=i.data.indexOf(A,e+1));)a.push({type:7,index:r}),e+=A.length-1}}r++}if(d.length!==n)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");x&&x({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const s=W.createElement("template");return s.innerHTML=e,s}}function ae(e,t,s=e,i){if(t===ee)return t;let r=void 0!==i?s.__directives?.[i]:s.__directive;const n=q(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$notifyDirectiveConnectionChanged?.(!1),void 0===n?r=void 0:(r=new n(e),r._$initialize(e,s,i)),void 0!==i?(s.__directives??=[])[i]=r:s.__directive=r),void 0!==r&&(t=ae(e,r._$resolve(e,t.values),r,i)),t}class le{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:s}=this._$template,i=(e?.creationScope??W).importNode(t,!0);ie.currentNode=i;let r=ie.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let t;2===a.type?t=new de(r,r.nextSibling,this,e):1===a.type?t=new a.ctor(r,a.name,a.strings,this,e):6===a.type&&(t=new me(r,this,e)),this._$parts.push(t),a=s[++o]}n!==a?.index&&(r=ie.nextNode(),n++)}return ie.currentNode=W,i}_update(e){let t=0;for(const s of this._$parts)void 0!==s&&(x&&x({kind:"set part",part:s,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==s.strings?(s._$setValue(e,s,t),t+=s.strings.length-2):s._$setValue(e[t])),t++}}class de{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,s,i){this.type=2,this._$committedValue=te,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=s,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=k(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=ae(this,e,t),q(e))e===te||null==e||""===e?(this._$committedValue!==te&&(x&&x({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=te):e!==this._$committedValue&&e!==ee&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else(e=>I(e)||"function"==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return k(k(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),re!==z){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}x&&x({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==te&&q(this._$committedValue)){const t=k(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=L(t,"data","property")),e=this._textSanitizer(e),x&&x({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=W.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=L(t,"data","property")),e=this._textSanitizer(e),x&&x({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:s}=e,i="number"==typeof s?this._$getTemplate(e):(void 0===s.el&&(s.el=oe.createElement(ne(s.h,s.h[0]),this.options)),s);if(this._$committedValue?._$template===i)x&&x({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new le(i,this),s=e._clone(this.options);x&&x({kind:"template instantiated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:s,values:t}),e._update(t),x&&x({kind:"template instantiated and updated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:s,values:t}),this._commitNode(s),this._$committedValue=e}}_$getTemplate(e){let t=se.get(e.strings);return void 0===t&&se.set(e.strings,t=new oe(e)),t}_commitIterable(e){I(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let s,i=0;for(const r of e)i===t.length?t.push(s=new de(this._insert(j()),this._insert(j()),this,this.options)):s=t[i],s._$setValue(r),i++;i<t.length&&(this._$clear(s&&k(s._$endNode).nextSibling,i),t.length=i)}_$clear(e=k(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e&&e!==this._$endNode;){const t=k(e).nextSibling;k(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class ce{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,s,i,r){this.type=1,this._$committedValue=te,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$committedValue=new Array(s.length-1).fill(new String),this.strings=s):this._$committedValue=te,this._sanitizer=void 0}_$setValue(e,t=this,s,i){const r=this.strings;let n=!1;if(void 0===r)e=ae(this,e,t,0),n=!q(e)||e!==this._$committedValue&&e!==ee,n&&(this._$committedValue=e);else{const i=e;let o,a;for(e=r[0],o=0;o<r.length-1;o++)a=ae(this,i[s+o],t,o),a===ee&&(a=this._$committedValue[o]),n||=!q(a)||a!==this._$committedValue[o],a===te?e=te:e!==te&&(e+=(a??"")+r[o+1]),this._$committedValue[o]=a}n&&!i&&this._commitValue(e)}_commitValue(e){e===te?k(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"attribute")),e=this._sanitizer(e??""),x&&x({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),k(this.element).setAttribute(this.name,e??""))}}class he extends ce{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"property")),e=this._sanitizer(e),x&&x({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===te?void 0:e}}class pe extends ce{constructor(){super(...arguments),this.type=4}_commitValue(e){x&&x({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===te),options:this.options}),k(this.element).toggleAttribute(this.name,!!e&&e!==te)}}class ue extends ce{constructor(e,t,s,i,r){if(super(e,t,s,i,r),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=ae(this,e,t,0)??te)===ee)return;const s=this._$committedValue,i=e===te&&s!==te||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==te&&(s===te||i);x&&x({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:i,addListener:r,oldListener:s}),i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class me{constructor(e,t,s){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=s}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){x&&x({kind:"commit to element binding",element:this.element,value:e,options:this.options}),ae(this,e)}}const ge=S.litHtmlPolyfillSupportDevMode;ge?.(oe,de),(S.litHtmlVersions??=[]).push("3.2.0"),S.litHtmlVersions.length>1&&C("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const fe=(e,t,s)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const i=E++,r=s?.renderBefore??t;let n=r._$litPart$;if(x&&x({kind:"begin render",id:i,value:e,container:t,options:s,part:n}),void 0===n){const e=s?.renderBefore??null;r._$litPart$=n=new de(t.insertBefore(j(),e),e,void 0,s??{})}return n._$setValue(e),x&&x({kind:"end render",id:i,value:e,container:t,options:s,part:n}),n};fe.setSanitizer=N,fe.createSanitizer=L,fe._testOnlyClearSanitizerFactoryDoNotCallOrElse=M;
|
|
18
|
+
const S=globalThis,x=e=>{S.emitLitDebugLogEvents&&S.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))};let C,k=0;S.litIssuedWarnings??=new Set,C=(e,t)=>{t+=e?` See https://lit.dev/msg/${e} for more information.`:"",S.litIssuedWarnings.has(t)||(console.warn(t),S.litIssuedWarnings.add(t))},C("dev-mode","Lit is in dev mode. Not recommended for production!");const E=S.ShadyDOM?.inUse&&!0===S.ShadyDOM?.noPatch?S.ShadyDOM.wrap:e=>e,U=S.trustedTypes,T=U?U.createPolicy("lit-html",{createHTML:e=>e}):void 0,O=e=>e,z=(e,t,s)=>O,N=e=>{if(re!==z)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");re=e},M=()=>{re=z},R=(e,t,s)=>re(e,t,s),A="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,V="?"+L,D=`<${V}>`,W=document,j=()=>W.createComment(""),q=e=>null===e||"object"!=typeof e&&"function"!=typeof e,I=Array.isArray,F="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,J=/>/g,K=new RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Z=/'/g,Y=/"/g,X=/^(?:script|style|textarea|title)$/i,G=(Q=1,(e,...t)=>(e.some((e=>void 0===e))&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),t.some((e=>e?._$litStatic$))&&C("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:Q,strings:e,values:t}));var Q;const ee=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),se=new WeakMap,ie=W.createTreeWalker(W,129);let re=z;function ne(e,t){if(!I(e)||!e.hasOwnProperty("raw")){let e="invalid template strings array";throw e="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(e)}return void 0!==T?T.createHTML(t):t}class oe{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let r=0,n=0;const o=e.length-1,a=this.parts,[l,d]=((e,t)=>{const s=e.length-1,i=[];let r,n=2===t?"<svg>":3===t?"<math>":"",o=H;for(let t=0;t<s;t++){const s=e[t];let a,l,d=-1,c=0;for(;c<s.length&&(o.lastIndex=c,l=o.exec(s),null!==l);)if(c=o.lastIndex,o===H){if("!--"===l[1])o=B;else if(void 0!==l[1])o=J;else if(void 0!==l[2])X.test(l[2])&&(r=new RegExp(`</${l[2]}`,"g")),o=K;else if(void 0!==l[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else o===K?">"===l[0]?(o=r??H,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?K:'"'===l[3]?Y:Z):o===Y||o===Z?o=K:o===B||o===J?o=H:(o=K,r=void 0);console.assert(-1===d||o===K||o===Z||o===Y,"unexpected parse state B");const h=o===K&&e[t+1].startsWith("/>")?" ":"";n+=o===H?s+D:d>=0?(i.push(a),s.slice(0,d)+A+s.slice(d)+L+h):s+L+(-2===d?t:h)}return[ne(e,n+(e[s]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]})(e,t);if(this.el=oe.createElement(l,s),ie.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=ie.nextNode())&&a.length<o;){if(1===i.nodeType){{const e=i.localName;if(/^(?:textarea|template)$/i.test(e)&&i.innerHTML.includes(L)){const t=`Expressions are not supported inside \`${e}\` elements. See https://lit.dev/msg/expression-in-${e} for more information.`;if("template"===e)throw new Error(t);C("",t)}}if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(A)){const t=d[n++],s=i.getAttribute(e).split(L),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:r,name:o[2],strings:s,ctor:"."===o[1]?he:"?"===o[1]?pe:"@"===o[1]?ue:ce}),i.removeAttribute(e)}else e.startsWith(L)&&(a.push({type:6,index:r}),i.removeAttribute(e));if(X.test(i.tagName)){const e=i.textContent.split(L),t=e.length-1;if(t>0){i.textContent=U?U.emptyScript:"";for(let s=0;s<t;s++)i.append(e[s],j()),ie.nextNode(),a.push({type:2,index:++r});i.append(e[t],j())}}}else if(8===i.nodeType){if(i.data===V)a.push({type:2,index:r});else{let e=-1;for(;-1!==(e=i.data.indexOf(L,e+1));)a.push({type:7,index:r}),e+=L.length-1}}r++}if(d.length!==n)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");x&&x({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){const s=W.createElement("template");return s.innerHTML=e,s}}function ae(e,t,s=e,i){if(t===ee)return t;let r=void 0!==i?s.__directives?.[i]:s.__directive;const n=q(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$notifyDirectiveConnectionChanged?.(!1),void 0===n?r=void 0:(r=new n(e),r._$initialize(e,s,i)),void 0!==i?(s.__directives??=[])[i]=r:s.__directive=r),void 0!==r&&(t=ae(e,r._$resolve(e,t.values),r,i)),t}class le{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){const{el:{content:t},parts:s}=this._$template,i=(e?.creationScope??W).importNode(t,!0);ie.currentNode=i;let r=ie.nextNode(),n=0,o=0,a=s[0];for(;void 0!==a;){if(n===a.index){let t;2===a.type?t=new de(r,r.nextSibling,this,e):1===a.type?t=new a.ctor(r,a.name,a.strings,this,e):6===a.type&&(t=new me(r,this,e)),this._$parts.push(t),a=s[++o]}n!==a?.index&&(r=ie.nextNode(),n++)}return ie.currentNode=W,i}_update(e){let t=0;for(const s of this._$parts)void 0!==s&&(x&&x({kind:"set part",part:s,value:e[t],valueIndex:t,values:e,templateInstance:this}),void 0!==s.strings?(s._$setValue(e,s,t),t+=s.strings.length-2):s._$setValue(e[t])),t++}}class de{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,s,i){this.type=2,this._$committedValue=te,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=s,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=E(this._$startNode).parentNode;const t=this._$parent;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=ae(this,e,t),q(e))e===te||null==e||""===e?(this._$committedValue!==te&&(x&&x({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=te):e!==this._$committedValue&&e!==ee&&this._commitText(e);else if(void 0!==e._$litType$)this._commitTemplateResult(e);else if(void 0!==e.nodeType){if(this.options?.host===e)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(e)}else(e=>I(e)||"function"==typeof e?.[Symbol.iterator])(e)?this._commitIterable(e):this._commitText(e)}_insert(e){return E(E(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),re!==z){const e=this._$startNode.parentNode?.nodeName;if("STYLE"===e||"SCRIPT"===e){let t="Forbidden";throw t="STYLE"===e?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(t)}}x&&x({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==te&&q(this._$committedValue)){const t=E(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=R(t,"data","property")),e=this._textSanitizer(e),x&&x({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{const t=W.createTextNode("");this._commitNode(t),void 0===this._textSanitizer&&(this._textSanitizer=R(t,"data","property")),e=this._textSanitizer(e),x&&x({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){const{values:t,_$litType$:s}=e,i="number"==typeof s?this._$getTemplate(e):(void 0===s.el&&(s.el=oe.createElement(ne(s.h,s.h[0]),this.options)),s);if(this._$committedValue?._$template===i)x&&x({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{const e=new le(i,this),s=e._clone(this.options);x&&x({kind:"template instantiated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:s,values:t}),e._update(t),x&&x({kind:"template instantiated and updated",template:i,instance:e,parts:e._$parts,options:this.options,fragment:s,values:t}),this._commitNode(s),this._$committedValue=e}}_$getTemplate(e){let t=se.get(e.strings);return void 0===t&&se.set(e.strings,t=new oe(e)),t}_commitIterable(e){I(this._$committedValue)||(this._$committedValue=[],this._$clear());const t=this._$committedValue;let s,i=0;for(const r of e)i===t.length?t.push(s=new de(this._insert(j()),this._insert(j()),this,this.options)):s=t[i],s._$setValue(r),i++;i<t.length&&(this._$clear(s&&E(s._$endNode).nextSibling,i),t.length=i)}_$clear(e=E(this._$startNode).nextSibling,t){for(this._$notifyConnectionChanged?.(!1,!0,t);e&&e!==this._$endNode;){const t=E(e).nextSibling;E(e).remove(),e=t}}setConnected(e){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=e,this._$notifyConnectionChanged?.(e)}}class ce{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,s,i,r){this.type=1,this._$committedValue=te,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$committedValue=new Array(s.length-1).fill(new String),this.strings=s):this._$committedValue=te,this._sanitizer=void 0}_$setValue(e,t=this,s,i){const r=this.strings;let n=!1;if(void 0===r)e=ae(this,e,t,0),n=!q(e)||e!==this._$committedValue&&e!==ee,n&&(this._$committedValue=e);else{const i=e;let o,a;for(e=r[0],o=0;o<r.length-1;o++)a=ae(this,i[s+o],t,o),a===ee&&(a=this._$committedValue[o]),n||=!q(a)||a!==this._$committedValue[o],a===te?e=te:e!==te&&(e+=(a??"")+r[o+1]),this._$committedValue[o]=a}n&&!i&&this._commitValue(e)}_commitValue(e){e===te?E(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"attribute")),e=this._sanitizer(e??""),x&&x({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),E(this.element).setAttribute(this.name,e??""))}}class he extends ce{constructor(){super(...arguments),this.type=3}_commitValue(e){void 0===this._sanitizer&&(this._sanitizer=re(this.element,this.name,"property")),e=this._sanitizer(e),x&&x({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===te?void 0:e}}class pe extends ce{constructor(){super(...arguments),this.type=4}_commitValue(e){x&&x({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!e||e===te),options:this.options}),E(this.element).toggleAttribute(this.name,!!e&&e!==te)}}class ue extends ce{constructor(e,t,s,i,r){if(super(e,t,s,i,r),this.type=5,void 0!==this.strings)throw new Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if((e=ae(this,e,t,0)??te)===ee)return;const s=this._$committedValue,i=e===te&&s!==te||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==te&&(s===te||i);x&&x({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:i,addListener:r,oldListener:s}),i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,e):this._$committedValue.handleEvent(e)}}class me{constructor(e,t,s){this.element=e,this.type=6,this._$disconnectableChildren=void 0,this._$parent=t,this.options=s}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){x&&x({kind:"commit to element binding",element:this.element,value:e,options:this.options}),ae(this,e)}}const ge=S.litHtmlPolyfillSupportDevMode;ge?.(oe,de),(S.litHtmlVersions??=[]).push("3.2.0"),S.litHtmlVersions.length>1&&C("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.");const fe=(e,t,s)=>{if(null==t)throw new TypeError(`The container to render into may not be ${t}`);const i=k++,r=s?.renderBefore??t;let n=r._$litPart$;if(x&&x({kind:"begin render",id:i,value:e,container:t,options:s,part:n}),void 0===n){const e=s?.renderBefore??null;r._$litPart$=n=new de(t.insertBefore(j(),e),e,void 0,s??{})}return n._$setValue(e),x&&x({kind:"end render",id:i,value:e,container:t,options:s,part:n}),n};fe.setSanitizer=N,fe.createSanitizer=R,fe._testOnlyClearSanitizerFactoryDoNotCallOrElse=M;
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2019 Google LLC
|
|
@@ -26,7 +26,7 @@ const ye=globalThis,ve=ye.ShadowRoot&&(void 0===ye.ShadyCSS||ye.ShadyCSS.nativeS
|
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/,{is:xe,defineProperty:Ce,getOwnPropertyDescriptor:Ee,getOwnPropertyNames:ke,getOwnPropertySymbols:Ue,getPrototypeOf:Te}=Object,Oe=globalThis;let ze;const Ne=Oe.trustedTypes,Me=Ne?Ne.emptyScript:"",Le=Oe.reactiveElementPolyfillSupportDevMode;{const e=Oe.litIssuedWarnings??=new Set;ze=(t,s)=>{s+=` See https://lit.dev/msg/${t} for more information.`,e.has(s)||(console.warn(s),e.add(s))},ze("dev-mode","Lit is in dev mode. Not recommended for production!"),Oe.ShadyDOM?.inUse&&void 0===Le&&ze("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")}const Re=(e,t)=>e,Ae={toAttribute(e,t){switch(t){case Boolean:e=e?Me:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=null!==e;break;case Number:s=null===e?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch(e){s=null}}return s}},Ve=(e,t)=>!xe(e,t),De={attribute:!0,type:String,converter:Ae,reflect:!1,hasChanged:Ve};Symbol.metadata??=Symbol("metadata"),Oe.litPropertyMetadata??=new WeakMap;class We extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=De){if(t.state&&(t.attribute=!1),this.__prepare(),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol.for(`${String(e)} (@property() cache)`),i=this.getPropertyDescriptor(e,s,t);void 0!==i&&Ce(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:r}=Ee(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==i){if("value"in(Ee(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);ze("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get(){return i?.call(this)},set(t){const n=i?.call(this);r.call(this,t),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??De}static __prepare(){if(this.hasOwnProperty(Re("elementProperties")))return;const e=Te(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Re("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(Re("properties"))){const e=this.properties,t=[...ke(e),...Ue(e)];for(const s of t)this.createProperty(s,e[s])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,s]of t)this.elementProperties.set(e,s)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const s=this.__attributeNameForProperty(e,t);void 0!==s&&this.__attributeToPropertyMap.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&ze("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&ze("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const e of s)t.unshift(Se(e))}else void 0!==e&&t.push(Se(e));return t}static __attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise((e=>this.enableUpdating=e)),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach((e=>e(this)))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(ve)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const s of t){const t=document.createElement("style"),i=ye.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=s.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,s){this._$attributeToProperty(e,s)}__propertyToAttribute(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor.__attributeNameForProperty(e,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:Ae).toAttribute(t,s.type);this.constructor.enabledWarnings.includes("migration")&&void 0===r&&ze("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const s=this.constructor,i=s.__attributeToPropertyMap.get(e);if(void 0!==i&&this.__reflectingProperty!==i){const e=s.getPropertyOptions(i),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Ae;this.__reflectingProperty=i,this[i]=r.fromAttribute(t,e.type),this.__reflectingProperty=null}}requestUpdate(e,t,s){if(void 0!==e){e instanceof Event&&ze("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()"),s??=this.constructor.getPropertyOptions(e);if(!(s.hasChanged??Ve)(this[e],t))return;this._$changeProperty(e,t,s)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,s){this._$changedProperties.has(e)||this._$changedProperties.set(e,t),!0===s.reflect&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e)}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof e?.then&&ze("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:"update"},Oe.emitLitDebugLogEvents&&Oe.dispatchEvent(new CustomEvent("lit-debug",{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter((e=>this.hasOwnProperty(e)&&e in Te(this)));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,s]of e)!0!==s.wrapped||this._$changedProperties.has(t)||void 0===this[t]||this._$changeProperty(t,this[t],s)}let t=!1;const s=this._$changedProperties;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this.__controllers?.forEach((e=>e.hostUpdate?.())),this.update(s)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(s)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&ze("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach((e=>this.__propertyToAttribute(e,this[e]))),this.__markUpdated()}updated(e){}firstUpdated(e){}}We.elementStyles=[],We.shadowRootOptions={mode:"open"},We[Re("elementProperties")]=new Map,We[Re("finalized")]=new Map,Le?.({ReactiveElement:We});{We.enabledWarnings=["change-in-update","async-perform-update"];const e=function(e){e.hasOwnProperty(Re("enabledWarnings"))||(e.enabledWarnings=e.enabledWarnings.slice())};We.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},We.disableWarning=function(t){e(this);const s=this.enabledWarnings.indexOf(t);s>=0&&this.enabledWarnings.splice(s,1)}}(Oe.reactiveElementVersions??=[]).push("2.0.4"),Oe.reactiveElementVersions.length>1&&ze("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")
|
|
29
|
+
*/,{is:xe,defineProperty:Ce,getOwnPropertyDescriptor:ke,getOwnPropertyNames:Ee,getOwnPropertySymbols:Ue,getPrototypeOf:Te}=Object,Oe=globalThis;let ze;const Ne=Oe.trustedTypes,Me=Ne?Ne.emptyScript:"",Re=Oe.reactiveElementPolyfillSupportDevMode;{const e=Oe.litIssuedWarnings??=new Set;ze=(t,s)=>{s+=` See https://lit.dev/msg/${t} for more information.`,e.has(s)||(console.warn(s),e.add(s))},ze("dev-mode","Lit is in dev mode. Not recommended for production!"),Oe.ShadyDOM?.inUse&&void 0===Re&&ze("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")}const Ae=(e,t)=>e,Le={toAttribute(e,t){switch(t){case Boolean:e=e?Me:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=null!==e;break;case Number:s=null===e?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch(e){s=null}}return s}},Ve=(e,t)=>!xe(e,t),De={attribute:!0,type:String,converter:Le,reflect:!1,hasChanged:Ve};Symbol.metadata??=Symbol("metadata"),Oe.litPropertyMetadata??=new WeakMap;class We extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=De){if(t.state&&(t.attribute=!1),this.__prepare(),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol.for(`${String(e)} (@property() cache)`),i=this.getPropertyDescriptor(e,s,t);void 0!==i&&Ce(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:r}=ke(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};if(null==i){if("value"in(ke(this.prototype,e)??{}))throw new Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);ze("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get(){return i?.call(this)},set(t){const n=i?.call(this);r.call(this,t),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??De}static __prepare(){if(this.hasOwnProperty(Ae("elementProperties")))return;const e=Te(this);e.finalize(),void 0!==e._initializers&&(this._initializers=[...e._initializers]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ae("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(Ae("properties"))){const e=this.properties,t=[...Ee(e),...Ue(e)];for(const s of t)this.createProperty(s,e[s])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,s]of t)this.elementProperties.set(e,s)}this.__attributeToPropertyMap=new Map;for(const[e,t]of this.elementProperties){const s=this.__attributeNameForProperty(e,t);void 0!==s&&this.__attributeToPropertyMap.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&ze("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&ze("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const e of s)t.unshift(Se(e))}else void 0!==e&&t.push(Se(e));return t}static __attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise((e=>this.enableUpdating=e)),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach((e=>e(this)))}addController(e){(this.__controllers??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this.__instanceProperties=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(ve)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const s of t){const t=document.createElement("style"),i=ye.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=s.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,s){this._$attributeToProperty(e,s)}__propertyToAttribute(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor.__attributeNameForProperty(e,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:Le).toAttribute(t,s.type);this.constructor.enabledWarnings.includes("migration")&&void 0===r&&ze("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this.__reflectingProperty=null}}_$attributeToProperty(e,t){const s=this.constructor,i=s.__attributeToPropertyMap.get(e);if(void 0!==i&&this.__reflectingProperty!==i){const e=s.getPropertyOptions(i),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:Le;this.__reflectingProperty=i,this[i]=r.fromAttribute(t,e.type),this.__reflectingProperty=null}}requestUpdate(e,t,s){if(void 0!==e){e instanceof Event&&ze("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()"),s??=this.constructor.getPropertyOptions(e);if(!(s.hasChanged??Ve)(this[e],t))return;this._$changeProperty(e,t,s)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(e,t,s){this._$changedProperties.has(e)||this._$changedProperties.set(e,t),!0===s.reflect&&this.__reflectingProperty!==e&&(this.__reflectingProperties??=new Set).add(e)}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){const e=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof e?.then&&ze("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),e}performUpdate(){if(!this.isUpdatePending)return;var e;if(e={kind:"update"},Oe.emitLitDebugLogEvents&&Oe.dispatchEvent(new CustomEvent("lit-debug",{detail:e})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const e=[...this.constructor.elementProperties.keys()].filter((e=>this.hasOwnProperty(e)&&e in Te(this)));if(e.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${e.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[e,t]of this.__instanceProperties)this[e]=t;this.__instanceProperties=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,s]of e)!0!==s.wrapped||this._$changedProperties.has(t)||void 0===this[t]||this._$changeProperty(t,this[t],s)}let t=!1;const s=this._$changedProperties;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this.__controllers?.forEach((e=>e.hostUpdate?.())),this.update(s)):this.__markUpdated()}catch(e){throw t=!1,this.__markUpdated(),e}t&&this._$didUpdate(s)}willUpdate(e){}_$didUpdate(e){this.__controllers?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&ze("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach((e=>this.__propertyToAttribute(e,this[e]))),this.__markUpdated()}updated(e){}firstUpdated(e){}}We.elementStyles=[],We.shadowRootOptions={mode:"open"},We[Ae("elementProperties")]=new Map,We[Ae("finalized")]=new Map,Re?.({ReactiveElement:We});{We.enabledWarnings=["change-in-update","async-perform-update"];const e=function(e){e.hasOwnProperty(Ae("enabledWarnings"))||(e.enabledWarnings=e.enabledWarnings.slice())};We.enableWarning=function(t){e(this),this.enabledWarnings.includes(t)||this.enabledWarnings.push(t)},We.disableWarning=function(t){e(this);const s=this.enabledWarnings.indexOf(t);s>=0&&this.enabledWarnings.splice(s,1)}}(Oe.reactiveElementVersions??=[]).push("2.0.4"),Oe.reactiveElementVersions.length>1&&ze("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
@@ -57,16 +57,11 @@ let He;Fe?.({LitElement:qe}),(globalThis.litElementVersions??=[]).push("4.1.0"),
|
|
|
57
57
|
* @license
|
|
58
58
|
* Copyright 2018 Google LLC
|
|
59
59
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
60
|
-
*/const et=(tt=class extends Qe{constructor(e){if(super(e),e.type!==Ge||"class"!==e.name||e.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==e.strings&&(this._staticClasses=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this._staticClasses?.has(e)&&this._previousClasses.add(e);return this.render(t)}const s=e.element.classList;for(const e of this._previousClasses)e in t||(s.remove(e),this._previousClasses.delete(e));for(const e in t){const i=!!t[e];i===this._previousClasses.has(e)||this._staticClasses?.has(e)||(i?(s.add(e),this._previousClasses.add(e)):(s.remove(e),this._previousClasses.delete(e)))}return ee}},(...e)=>({_$litDirective$:tt,values:e}));var tt,st=$e`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;class it extends qe{emit(e,t){const s=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(s),s}static define(e,t=this,s={}){if(customElements.get(e));else try{customElements.define(e,t,s)}catch(i){customElements.define(e,class extends t{},s)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach((e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})))}}function rt(e,t,s){return new Promise((i=>{if((null==s?void 0:s.duration)===1/0)throw new Error("Promise-based animations must be finite.");const r=e.animate(t,Object.assign(Object.assign({},s),{duration:nt()?0:null==s?void 0:s.duration}));r.addEventListener("cancel",i,{once:!0}),r.addEventListener("finish",i,{once:!0})}))}function nt(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ot(e){return Promise.all(e.getAnimations().map((e=>new Promise((t=>{const s=requestAnimationFrame(t);e.addEventListener("cancel",(()=>s),{once:!0}),e.addEventListener("finish",(()=>s),{once:!0}),e.cancel()})))))}it.styles=[st],it.dependencies={},e([Ke({type:Boolean,reflect:!0})],it.prototype,"ssr",void 0);const at=new Map,lt=new WeakMap;function dt(e,t){const s=lt.get(e);if(null==s?void 0:s[t])return s[t];const i=at.get(t);return i||{keyframes:[],options:{duration:0}}}function ct(e,t){at.set(e,function(e){return null!=e?e:{keyframes:[],options:{duration:0}}}(t))}function ht(e,t){return new Promise((s=>{e.addEventListener(t,(function i(r){r.target===e&&(e.removeEventListener(t,i),s())}))}))}const pt=new Set;function ut(e){pt.add(e),document.body.style.overflow="hidden"}function mt(e){pt.delete(e),0===pt.size&&(document.body.style.overflow="")}function gt(e,t){const s=Object.assign({waitUntilFirstUpdate:!1},t);return(t,i)=>{const{update:r}=t;if(e in t){const n=e;t.update=function(e){if(e.has(n)){const t=e.get(n),r=this[n];t!==r&&(s.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,r))}r.call(this,e)}}}}var ft=$e`:host{display:contents}:host([size=md]) .drawer-end .drawer-panel,:host([size=md]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-768)}:host([size=md]) .drawer-bottom .drawer-panel,:host([size=md]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-768)}:host([size=lg]) .drawer-end .drawer-panel,:host([size=lg]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-1024)}:host([size=lg]) .drawer-bottom .drawer-panel,:host([size=lg]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-1024)}.drawer{height:100%;inset-inline-start:0;overflow:hidden;pointer-events:none;top:0;width:100%}.drawer-fixed{position:fixed;z-index:1100}.drawer-panel{background-color:var(--sgds-surface-default);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);overflow:auto;padding:var(--sgds-padding-lg);pointer-events:all;position:absolute;z-index:2}.drawer-panel:focus{outline:none}.drawer-top .drawer-panel{bottom:auto;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:0;width:100%}.drawer-end .drawer-panel{bottom:auto;height:100%;inset-inline-end:0;inset-inline-start:auto;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-bottom .drawer-panel{bottom:0;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:auto;width:100%}.drawer-start .drawer-panel{bottom:auto;height:100%;inset-inline-end:auto;inset-inline-start:0;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-header{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}slot[name=title]::slotted(*){color:var(--sgds-color-default)!important;font-size:var(--sgds-font-size-4)!important;margin-bottom:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);margin-bottom:var(--sgds-margin-none)!important}slot[name=footer]::slotted(*){box-shadow:0 -2px 2px 0 hsla(0,0%,5%,.08);margin:var(--sgds-margin-none) calc(var(--sgds-margin-xs)*-1);padding:var(--sgds-padding-lg) var(--sgds-padding-lg) var(--sgds-padding-none)}sgds-close-button{position:absolute;right:8px;top:8px}.drawer-body{-webkit-overflow-scrolling:touch;display:block;flex:1 1 auto;overflow:auto}.drawer-overlay{background-color:var(--sgds-bg-overlay);bottom:0;display:block;left:0;pointer-events:all;position:fixed;right:0;top:0}.drawer-contained .drawer-overlay{display:none}.drawer-contained{height:unset;width:unset}@media screen and (min-width:512px){.drawer-panel{padding:var(--sgds-padding-2-xl)}slot[name=footer]::slotted(*){margin:var(--sgds-margin-none) calc(var(--sgds-margin-md)*-1);padding:var(--sgds-padding-2-xl) var(--sgds-padding-2-xl) var(--sgds-padding-none)}}`
|
|
61
|
-
|
|
62
|
-
* @license
|
|
63
|
-
* Copyright 2018 Google LLC
|
|
64
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
|
-
*/;var yt,vt,_t=$e`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([variant=light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([variant=dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:hover{background-color:var(--sgds-bg-translucent)}.btn-close:focus,.btn-close:focus-visible{background-color:var(--sgds-bg-translucent)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn-close-sm{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.btn-close.btn-close-sm{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}`;function bt(e){return!!function(e){return!!customElements.get(e)}(e)||(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}class wt extends it{constructor(){super(...arguments),this.ariaLabel="Close button",this.size="md",this.variant="default",this._clickHandler=()=>{}}_handleClick(){this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}firstUpdated(e){super.firstUpdated(e),bt("sgds-icon")}render(){return G`
|
|
66
|
-
<button class="btn-close" aria-label=${e=this.ariaLabel,e??te} @click=${this._handleClick}>
|
|
60
|
+
*/const et=(tt=class extends Qe{constructor(e){if(super(e),e.type!==Ge||"class"!==e.name||e.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==e.strings&&(this._staticClasses=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this._staticClasses?.has(e)&&this._previousClasses.add(e);return this.render(t)}const s=e.element.classList;for(const e of this._previousClasses)e in t||(s.remove(e),this._previousClasses.delete(e));for(const e in t){const i=!!t[e];i===this._previousClasses.has(e)||this._staticClasses?.has(e)||(i?(s.add(e),this._previousClasses.add(e)):(s.remove(e),this._previousClasses.delete(e)))}return ee}},(...e)=>({_$litDirective$:tt,values:e}));var tt,st=$e`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;class it extends qe{emit(e,t){const s=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(s),s}static define(e,t=this,s={}){if(customElements.get(e));else try{customElements.define(e,t,s)}catch(i){customElements.define(e,class extends t{},s)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach((e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})))}}function rt(e,t,s){return new Promise((i=>{if((null==s?void 0:s.duration)===1/0)throw new Error("Promise-based animations must be finite.");const r=e.animate(t,Object.assign(Object.assign({},s),{duration:nt()?0:null==s?void 0:s.duration}));r.addEventListener("cancel",i,{once:!0}),r.addEventListener("finish",i,{once:!0})}))}function nt(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ot(e){return Promise.all(e.getAnimations().map((e=>new Promise((t=>{const s=requestAnimationFrame(t);e.addEventListener("cancel",(()=>s),{once:!0}),e.addEventListener("finish",(()=>s),{once:!0}),e.cancel()})))))}it.styles=[st],it.dependencies={},e([Ke({type:Boolean,reflect:!0})],it.prototype,"ssr",void 0);const at=new Map,lt=new WeakMap;function dt(e,t){const s=lt.get(e);if(null==s?void 0:s[t])return s[t];const i=at.get(t);return i||{keyframes:[],options:{duration:0}}}function ct(e,t){at.set(e,function(e){return null!=e?e:{keyframes:[],options:{duration:0}}}(t))}function ht(e,t){return new Promise((s=>{e.addEventListener(t,(function i(r){r.target===e&&(e.removeEventListener(t,i),s())}))}))}const pt=new Set;function ut(e){pt.add(e),document.body.style.overflow="hidden"}function mt(e){pt.delete(e),0===pt.size&&(document.body.style.overflow="")}function gt(e,t){const s=Object.assign({waitUntilFirstUpdate:!1},t);return(t,i)=>{const{update:r}=t;if(e in t){const n=e;t.update=function(e){if(e.has(n)){const t=e.get(n),r=this[n];t!==r&&(s.waitUntilFirstUpdate&&!this.hasUpdated||this[i](t,r))}r.call(this,e)}}}}var ft,yt,vt=$e`:host{display:contents}:host([size=md]) .drawer-end .drawer-panel,:host([size=md]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-768)}:host([size=md]) .drawer-bottom .drawer-panel,:host([size=md]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-768)}:host([size=lg]) .drawer-end .drawer-panel,:host([size=lg]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-1024)}:host([size=lg]) .drawer-bottom .drawer-panel,:host([size=lg]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-1024)}.drawer{height:100%;inset-inline-start:0;overflow:hidden;pointer-events:none;top:0;width:100%}.drawer-fixed{position:fixed;z-index:1100}.drawer-panel{background-color:var(--sgds-surface-default);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);overflow:auto;padding:var(--sgds-padding-lg);pointer-events:all;position:absolute;z-index:2}.drawer-panel:focus{outline:none}.drawer-top .drawer-panel{bottom:auto;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:0;width:100%}.drawer-end .drawer-panel{bottom:auto;height:100%;inset-inline-end:0;inset-inline-start:auto;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-bottom .drawer-panel{bottom:0;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:auto;width:100%}.drawer-start .drawer-panel{bottom:auto;height:100%;inset-inline-end:auto;inset-inline-start:0;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-header{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}slot[name=title]::slotted(*){color:var(--sgds-color-default)!important;font-size:var(--sgds-font-size-4)!important;margin-bottom:var(--sgds-margin-none)!important}slot[name=description]::slotted(*){color:var(--sgds-color-subtle);margin-bottom:var(--sgds-margin-none)!important}slot[name=footer]::slotted(*){box-shadow:0 -2px 2px 0 hsla(0,0%,5%,.08);margin:var(--sgds-margin-none) calc(var(--sgds-margin-xs)*-1);padding:var(--sgds-padding-lg) var(--sgds-padding-lg) var(--sgds-padding-none)}sgds-close-button{position:absolute;right:8px;top:8px}.drawer-body{-webkit-overflow-scrolling:touch;display:block;flex:1 1 auto;overflow:auto}.drawer-overlay{background-color:var(--sgds-bg-overlay);bottom:0;display:block;left:0;pointer-events:all;position:fixed;right:0;top:0}.drawer-contained .drawer-overlay{display:none}.drawer-contained{height:unset;width:unset}@media screen and (min-width:512px){.drawer-panel{padding:var(--sgds-padding-2-xl)}slot[name=footer]::slotted(*){margin:var(--sgds-margin-none) calc(var(--sgds-margin-md)*-1);padding:var(--sgds-padding-2-xl) var(--sgds-padding-2-xl) var(--sgds-padding-none)}}`,_t=$e`:host{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm);display:inline-flex}:host([size=sm]) .btn-close{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}:host([tone=fixed-light]) .btn-close{color:var(--sgds-color-fixed-light)}:host([tone=fixed-dark]) .btn-close{color:var(--sgds-color-fixed-dark)}.btn-close{align-items:center;background-color:var(--sgds-bg-transparent);border:0;border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-close-btn-border-radius);cursor:pointer;display:flex;height:var(--sgds-dimension-32);justify-content:center;padding:0;position:relative;width:var(--sgds-dimension-32)}.btn-close:focus,.btn-close:focus-visible,.btn-close:hover{background-color:var(--sgds-bg-translucent)}:host([tone=fixed-light]) .btn-close:focus,:host([tone=fixed-light]) .btn-close:focus-visible,:host([tone=fixed-light]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-light)}:host([tone=fixed-dark]) .btn-close:focus,:host([tone=fixed-dark]) .btn-close:focus-visible,:host([tone=fixed-dark]) .btn-close:hover{background-color:var(--sgds-bg-translucent-fixed-dark)}.btn-close:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn-close-sm{height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.btn-close.btn-close-sm{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}`;function bt(e){return!!function(e){return!!customElements.get(e)}(e)||(console.error(`Custom element of name : ${e} is not registered. Remember to import the component file for custom element registration`),!1)}class wt extends it{constructor(){super(...arguments),this.size="md",this.tone="default",this._clickHandler=()=>{}}_handleClick(){this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}firstUpdated(e){super.firstUpdated(e),bt("sgds-icon")}render(){return G`
|
|
61
|
+
<button class="btn-close" aria-label="Close button" @click=${this._handleClick}>
|
|
67
62
|
<sgds-icon name="cross" size=${this.size}></sgds-icon>
|
|
68
63
|
</button>
|
|
69
|
-
|
|
64
|
+
`}}wt.styles=[...it.styles,_t],e([Ke({type:String,reflect:!0})],wt.prototype,"size",void 0),e([Ke({type:String,reflect:!0})],wt.prototype,"tone",void 0);class $t extends it{constructor(){super(...arguments),this.open=!1,this.size="sm",this.placement="end",this.contained=!1,this.handleDocumentKeyDown=e=>{this.open&&!this.contained&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(e){super.firstUpdated(e),this.open&&(this.addOpenListeners(),this.contained||ut(this))}disconnectedCallback(){super.disconnectedCallback(),mt(this)}uppercaseFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}requestClose(e){if(this.emit("sgds-request-close",{cancelable:!0,detail:{source:e}}).defaultPrevented){const e=dt(this,"drawer.denyClose");rt(this.panel,e.keyframes,e.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sgds-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||ut(this);const e=this.querySelector("[autofocus]");e&&e.removeAttribute("autofocus"),await Promise.all([ot(this.drawer),ot(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame((()=>{this.emit("sgds-initial-focus",{cancelable:!0}).defaultPrevented||(e?e.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),e&&e.setAttribute("autofocus","")}));const t=dt(this,`drawer.show${this.uppercaseFirstLetter(this.placement)}`),s=dt(this,"drawer.overlay.show");await Promise.all([rt(this.panel,t.keyframes,t.options),rt(this.overlay,s.keyframes,s.options)]),this.emit("sgds-after-show")}else{this.emit("sgds-hide"),this.removeOpenListeners(),this.contained||mt(this),await Promise.all([ot(this.drawer),ot(this.overlay)]);const e=dt(this,`drawer.hide${this.uppercaseFirstLetter(this.placement)}`),t=dt(this,"drawer.overlay.hide");await Promise.all([rt(this.overlay,t.keyframes,t.options).then((()=>{this.overlay.hidden=!0})),rt(this.panel,e.keyframes,e.options).then((()=>{this.panel.hidden=!0}))]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const s=this.originalTrigger;"function"==typeof(null==s?void 0:s.focus)&&setTimeout((()=>s.focus())),this.emit("sgds-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&ut(this),this.open&&this.contained&&mt(this)}async show(){if(!this.open)return this.open=!0,ht(this,"sgds-after-show")}async hide(){if(this.open)return this.open=!1,ht(this,"sgds-after-hide")}render(){const e=this.hasUpdated,t=!this.open&&!e;return G`
|
|
70
65
|
<div
|
|
71
66
|
class=${et({drawer:!0,"drawer-top":"top"===this.placement,"drawer-end":"end"===this.placement,"drawer-bottom":"bottom"===this.placement,"drawer-start":"start"===this.placement,"drawer-contained":this.contained,"drawer-fixed":!this.contained})}
|
|
72
67
|
?hidden=${t}
|
|
@@ -93,5 +88,5 @@ let He;Fe?.({LitElement:qe}),(globalThis.litElementVersions??=[]).push("4.1.0"),
|
|
|
93
88
|
<slot name="footer"></slot>
|
|
94
89
|
</div>
|
|
95
90
|
</div>
|
|
96
|
-
`}}$t.styles=[...it.styles,
|
|
91
|
+
`}}$t.styles=[...it.styles,vt],$t.dependencies={"sgds-close-button":wt},e([Xe(".drawer")],$t.prototype,"drawer",void 0),e([Xe(".drawer-panel")],$t.prototype,"panel",void 0),e([Xe(".drawer-overlay")],$t.prototype,"overlay",void 0),e([Ke({type:Boolean,reflect:!0})],$t.prototype,"open",void 0),e([Ke({type:String,reflect:!0})],$t.prototype,"size",void 0),e([Ke({type:String,reflect:!0})],$t.prototype,"placement",void 0),e([Ke({type:Boolean,reflect:!0})],$t.prototype,"contained",void 0),e([gt("open",{waitUntilFirstUpdate:!0})],$t.prototype,"handleOpenChange",null),e([gt("contained",{waitUntilFirstUpdate:!0})],$t.prototype,"handleNoModalChange",null),ct("drawer.showTop",{keyframes:[{opacity:0,translate:"0 -100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}}),ct("drawer.hideTop",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 -100%"}],options:{duration:250,easing:"ease"}}),ct("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),ct("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),ct("drawer.showBottom",{keyframes:[{opacity:0,translate:"0 100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}}),ct("drawer.hideBottom",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 100%"}],options:{duration:250,easing:"ease"}}),ct("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),ct("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),ct("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),ct("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),ct("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}}),ft="sgds-drawer",yt=$t,customElements.get(ft)||customElements.define(ft,yt)}));
|
|
97
92
|
//# sourceMappingURL=index.umd.min.js.map
|